@accurix/centrinfo-widget 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/cdn/centrinfo-widget.js +355 -31
- package/dist/cdn/manifest.json +6 -6
- package/dist/index.cjs +1 -3519
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -3519
- package/dist/runtime.cjs +2 -1
- package/dist/runtime.d.cts +170 -22
- package/dist/runtime.d.mts +170 -22
- package/dist/runtime.mjs +2 -1
- package/dist/styles-BgWsSZsR.cjs +7714 -0
- package/dist/styles-CIJFMOKa.mjs +3869 -0
- package/dist/{types-1ZJJY7Da.d.mts → types-BGKFxmKB.d.cts} +113 -11
- package/dist/{types-B0r4SXaT.d.cts → types-DhmmWqaj.d.mts} +115 -10
- package/package.json +5 -4
- package/dist/config-CkU4urQY.mjs +0 -30
- package/dist/config-DsNMbdKp.cjs +0 -36
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
var Centrinfo=(function(Tr){"use strict";var aO=Object.defineProperty;var iO=(Tr,Zt,Ee)=>Zt in Tr?aO(Tr,Zt,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):Tr[Zt]=Ee;var Vt=(Tr,Zt,Ee)=>iO(Tr,typeof Zt!="symbol"?Zt+"":Zt,Ee);var Zt,Ee,Mp,hn,Ap,Dp,Ip,Zc,us,Ni,Lp,Kc,jc,Qc,Pp,fs={},hs=[],W1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ds=Array.isArray;function Wr(t,e){for(var r in e)t[r]=e[r];return t}function Jc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function U1(t,e,r){var n,a,i,o={};for(i in e)i=="key"?n=e[i]:i=="ref"?a=e[i]:o[i]=e[i];if(arguments.length>2&&(o.children=arguments.length>3?Zt.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)o[i]===void 0&&(o[i]=t.defaultProps[i]);return ps(t,o,n,a,null)}function ps(t,e,r,n,a){var i={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Mp,__i:-1,__u:0};return a==null&&Ee.vnode!=null&&Ee.vnode(i),i}function Ae(t){return t.children}function vs(t,e){this.props=t,this.context=e}function Oa(t,e){if(e==null)return t.__?Oa(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Oa(t):null}function Y1(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,n=[],a=[],i=Wr({},e);i.__v=e.__v+1,Ee.vnode&&Ee.vnode(i),tu(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,n,r??Oa(e),!!(32&e.__u),a),i.__v=e.__v,i.__.__k[i.__i]=i,zp(n,i,a),e.__e=e.__=null,i.__e!=r&&Rp(i)}}function Rp(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Rp(t)}function eu(t){(!t.__d&&(t.__d=!0)&&hn.push(t)&&!gs.__r++||Ap!=Ee.debounceRendering)&&((Ap=Ee.debounceRendering)||Dp)(gs)}function gs(){try{for(var t,e=1;hn.length;)hn.length>e&&hn.sort(Ip),t=hn.shift(),e=hn.length,Y1(t)}finally{hn.length=gs.__r=0}}function Ep(t,e,r,n,a,i,o,s,l,c,u){var f,h,d,p,m,g,v,y=n&&n.__k||hs,b=e.length;for(l=q1(r,e,y,l,b),f=0;f<b;f++)(d=r.__k[f])!=null&&(h=d.__i!=-1&&y[d.__i]||fs,d.__i=f,g=tu(t,d,h,a,i,o,s,l,c,u),p=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&nu(h.ref,null,d),u.push(d.ref,d.__c||p,d)),m==null&&p!=null&&(m=p),(v=!!(4&d.__u))||h.__k===d.__k?(l=Op(d,l,t,v),v&&h.__e&&(h.__e=null)):typeof d.type=="function"&&g!==void 0?l=g:p&&(l=p.nextSibling),d.__u&=-7);return r.__e=m,l}function q1(t,e,r,n,a){var i,o,s,l,c,u=r.length,f=u,h=0;for(t.__k=new Array(a),i=0;i<a;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[i]=ps(null,o,null,null,null):ds(o)?o=t.__k[i]=ps(Ae,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[i]=ps(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[i]=o,l=i+h,o.__=t,o.__b=t.__b+1,s=null,(c=o.__i=X1(o,r,l,f))!=-1&&(f--,(s=r[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(a>u?h--:a<u&&h++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,o.__u|=4))):t.__k[i]=null;if(f)for(i=0;i<u;i++)(s=r[i])!=null&&(2&s.__u)==0&&(s.__e==n&&(n=Oa(s)),Hp(s,s));return n}function Op(t,e,r,n){var a,i;if(typeof t.type=="function"){for(a=t.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=t,e=Op(a[i],e,r,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=Oa(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function X1(t,e,r,n){var a,i,o,s=t.key,l=t.type,c=e[r],u=c!=null&&(2&c.__u)==0;if(c===null&&s==null||u&&s==c.key&&l==c.type)return r;if(n>(u?1:0)){for(a=r-1,i=r+1;a>=0||i<e.length;)if((c=e[o=a>=0?a--:i++])!=null&&(2&c.__u)==0&&s==c.key&&l==c.type)return o}return-1}function Np(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||W1.test(e)?r:r+"px"}function ms(t,e,r,n,a){var i,o;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Np(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||Np(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Lp,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=r,r?n?r[Ni]=n[Ni]:(r[Ni]=Kc,t.addEventListener(e,i?Qc:jc,i)):t.removeEventListener(e,i?Qc:jc,i);else{if(a=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Bp(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[us]==null)e[us]=Kc++;else if(e[us]<r[Ni])return;return r(Ee.event?Ee.event(e):e)}}}function tu(t,e,r,n,a,i,o,s,l,c){var u,f,h,d,p,m,g,v,y,b,x,S,w,k,T,C=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[s=e.__e=r.__e]),(u=Ee.__b)&&u(e);e:if(typeof C=="function")try{if(v=e.props,y=C.prototype&&C.prototype.render,b=(u=C.contextType)&&n[u.__c],x=u?b?b.props.value:u.__:n,r.__c?g=(f=e.__c=r.__c).__=f.__E:(y?e.__c=f=new C(v,x):(e.__c=f=new vs(v,x),f.constructor=C,f.render=K1),b&&b.sub(f),f.state||(f.state={}),f.__n=n,h=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&C.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Wr({},f.__s)),Wr(f.__s,C.getDerivedStateFromProps(v,f.__s))),d=f.props,p=f.state,f.__v=e,h)y&&C.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&C.getDerivedStateFromProps==null&&v!==d&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),e.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(v,f.__s,x)===!1){e.__v!=r.__v&&(f.props=v,f.state=f.__s,f.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(A){A&&(A.__=e)}),hs.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(d,p,m)})}if(f.context=x,f.props=v,f.__P=t,f.__e=!1,S=Ee.__r,w=0,y)f.state=f.__s,f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),hs.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++w<25);f.state=f.__s,f.getChildContext!=null&&(n=Wr(Wr({},n),f.getChildContext())),y&&!h&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(d,p)),k=u!=null&&u.type===Ae&&u.key==null?Fp(u.props.children):u,s=Ep(t,ds(k)?k:[k],e,r,n,a,i,o,s,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),g&&(f.__E=f.__=null)}catch(A){if(e.__v=null,l||i!=null)if(A.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else{for(T=i.length;T--;)Jc(i[T]);ru(e)}else e.__e=r.__e,e.__k=r.__k,A.then||ru(e);Ee.__e(A,e,r)}else i==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=Z1(r.__e,e,r,n,a,i,o,l,c);return(u=Ee.diffed)&&u(e),128&e.__u?void 0:s}function ru(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(ru))}function zp(t,e,r){for(var n=0;n<r.length;n++)nu(r[n],r[++n],r[++n]);Ee.__c&&Ee.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){Ee.__e(i,a.__v)}})}function Fp(t){return typeof t!="object"||t==null||t.__b>0?t:ds(t)?t.map(Fp):t.constructor!==void 0?null:Wr({},t)}function Z1(t,e,r,n,a,i,o,s,l){var c,u,f,h,d,p,m,g=r.props||fs,v=e.props,y=e.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((d=i[c])&&"setAttribute"in d==!!y&&(y?d.localName==y:d.nodeType==3)){t=d,i[c]=null;break}}if(t==null){if(y==null)return document.createTextNode(v);t=document.createElementNS(a,y,v.is&&v),s&&(Ee.__m&&Ee.__m(e,i),s=!1),i=null}if(y==null)g===v||s&&t.data==v||(t.data=v);else{if(i=y=="textarea"&&v.defaultValue!=null?null:i&&Zt.call(t.childNodes),!s&&i!=null)for(g={},c=0;c<t.attributes.length;c++)g[(d=t.attributes[c]).name]=d.value;for(c in g)d=g[c],c=="dangerouslySetInnerHTML"?f=d:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||ms(t,c,null,d,a);for(c in v)d=v[c],c=="children"?h=d:c=="dangerouslySetInnerHTML"?u=d:c=="value"?p=d:c=="checked"?m=d:s&&typeof d!="function"||g[c]===d||ms(t,c,d,g[c],a);if(u)s||f&&(u.__html==f.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(f&&(t.innerHTML=""),Ep(e.type=="template"?t.content:t,ds(h)?h:[h],e,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:r.__k&&Oa(r,0),s,l),i!=null)for(c=i.length;c--;)Jc(i[c]);s&&y!="textarea"||(c="value",y=="progress"&&p==null?t.removeAttribute("value"):p!=null&&(p!==t[c]||y=="progress"&&!p||y=="option"&&p!=g[c])&&ms(t,c,p,g[c],a),c="checked",m!=null&&m!=t[c]&&ms(t,c,m,g[c],a))}return t}function nu(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(a){Ee.__e(a,r)}}function Hp(t,e,r){var n,a;if(Ee.unmount&&Ee.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||nu(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){Ee.__e(i,e)}n.base=n.__P=null}if(n=t.__k)for(a=0;a<n.length;a++)n[a]&&Hp(n[a],e,r||typeof t.type!="function");r||Jc(t.__e),t.__c=t.__=t.__e=void 0}function K1(t,e,r){return this.constructor(t,r)}function Vp(t,e,r){var n,a,i,o;e==document&&(e=document.documentElement),Ee.__&&Ee.__(t,e),a=(n=!1)?null:e.__k,i=[],o=[],tu(e,t=e.__k=U1(Ae,null,[t]),a||fs,fs,e.namespaceURI,a?null:e.firstChild?Zt.call(e.childNodes):null,i,a?a.__e:e.firstChild,n,o),zp(i,t,o)}function j1(t){function e(r){var n,a;return this.getChildContext||(n=new Set,(a={})[e.__c]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&n.forEach(function(o){o.__e=!0,eu(o)})},this.sub=function(i){n.add(i);var o=i.componentWillUnmount;i.componentWillUnmount=function(){n&&n.delete(i),o&&o.call(i)}}),r.children}return e.__c="__cC"+Pp++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,n){return r.children(n)}).contextType=e,e}Zt=hs.slice,Ee={__e:function(t,e,r,n){for(var a,i,o;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(t)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(t,n||{}),o=a.__d),o)return a.__E=a}catch(s){t=s}throw t}},Mp=0,vs.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Wr({},this.state),typeof t=="function"&&(t=t(Wr({},r),this.props)),t&&Wr(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),eu(this))},vs.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),eu(this))},vs.prototype.render=Ae,hn=[],Dp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ip=function(t,e){return t.__v.__b-e.__v.__b},gs.__r=0,Zc=Math.random().toString(8),us="__d"+Zc,Ni="__a"+Zc,Lp=/(PointerCapture)$|Capture$/i,Kc=0,jc=Bp(!1),Qc=Bp(!0),Pp=0;var Q1=0;function _(t,e,r,n,a,i){e||(e={});var o,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?o=e[s]:l[s]=e[s];var c={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Q1,__i:-1,__u:0,__source:a,__self:i};if(typeof t=="function"&&(o=t.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return Ee.vnode&&Ee.vnode(c),c}class Gp extends Error{constructor(r,n){super(n);Vt(this,"status");this.status=r,this.name="ApiError"}}const au=()=>({agentName:"Accurix",greeting:"Hi! 👋 How can I help you today?",widgetModule:"chat",assistantMediaKind:"image",soundEnabled:!0,voiceOutputEnabled:!1,talkbackMode:"text",allowVoiceInput:!1,memoryEnabled:!0,memoryRetentionDays:30,memoryMessageCap:50,availableActions:[]}),J1="Sara is an AI assistant; answers may be imperfect.",ew="Accurix is an AI assistant; answers may be imperfect.",$p=t=>{typeof console>"u"||console.warn(`[centrinfo-widget] Could not load saved widget configuration from the API (${t}). Showing default widget chrome. Check data-token, data-api-base, CORS, and backend availability.`)},iu=(t,e={})=>{const n=t.disclaimerText?.trim()?.toLowerCase(),a=e.agentName?.trim()||t.agentName?.trim()||"Accurix",i=e.agentAvatarUrl?.trim()||t.agentAvatarUrl?.trim();return{...t,agentName:a,agentAvatarUrl:i||void 0,disclaimerText:n===J1.toLowerCase()||n?.includes("sara is an ai assistant")?ew:t.disclaimerText}};class Wp{constructor(e,r,n,a,i={},o,s,l="floating"){Vt(this,"baseUrl");Vt(this,"token");Vt(this,"gifApiKey");Vt(this,"analyticsContextToken");Vt(this,"bootstrapOverrides");Vt(this,"identityToken");Vt(this,"identityTokenProvider");Vt(this,"chatSurface");this.baseUrl=e,this.token=r,this.gifApiKey=n,this.analyticsContextToken=a,this.bootstrapOverrides=i,this.identityToken=o,this.identityTokenProvider=s,this.chatSurface=l}async currentIdentityToken(){if(this.identityTokenProvider){const e=await this.identityTokenProvider();this.identityToken=e?.trim()||void 0}return this.identityToken}headers(e=!0){const r={Authorization:`Bearer ${this.token}`};return e&&(r["Content-Type"]="application/json"),r}async json(e){let r;try{r=await e.json()}catch{r=void 0}if(!e.ok){const n=rw(r)??`request failed (${e.status})`;throw new Gp(e.status,n)}return r?.data??r}async bootstrap(){try{const e=await fetch(`${this.baseUrl}/public-chat/bootstrap`,{headers:this.headers(!1)});if(!e.ok)return $p(`bootstrap request failed with ${e.status}`),iu(au(),this.bootstrapOverrides);const r=await this.json(e);return iu({...au(),...r},this.bootstrapOverrides)}catch(e){return $p(e instanceof Error?e.message:"bootstrap request failed"),iu(au(),this.bootstrapOverrides)}}async history(){const e=await this.currentIdentityToken();if(!e)return{conversations:[]};const r=await fetch(`${this.baseUrl}/public-chat/history`,{method:"POST",headers:this.headers(),body:JSON.stringify({identityToken:e,surface:this.chatSurface})}),n=await this.json(r);return{activeSessionId:n.activeSessionId,conversations:Array.isArray(n.conversations)?n.conversations:[]}}async stream(e,r,n){const a=await this.currentIdentityToken(),i=await fetch(`${this.baseUrl}/public-chat/stream`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:r,voicePlaybackRequested:!!n.voicePlaybackRequested,analyticsContextToken:this.analyticsContextToken,identityToken:a,surface:this.chatSurface}),signal:n.signal});return!i.ok||!i.body?this.send(e,r,n):nw(i.body,n)}async liveEvents(e,r){const n=`sessionId=${encodeURIComponent(e)}&after=${encodeURIComponent(r)}`,a=await fetch(`${this.baseUrl}/public-chat/live-events?${n}`,{headers:this.headers(!1)}),i=await this.json(a);return{mode:i.mode??"ai",assignedAgentName:i.assignedAgentName,agentTyping:!!i.agentTyping,agentTypingName:i.agentTypingName,conversationEnded:!!i.conversationEnded,events:i.events??[]}}async typing(e,r){try{const n=await fetch(`${this.baseUrl}/public-chat/typing`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e,isTyping:r})});if(!n.ok)try{await n.text()}catch{}}catch{}}async send(e,r,n){const a=await this.currentIdentityToken(),i=await fetch(`${this.baseUrl}/public-chat`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:r,voicePlaybackRequested:!!n.voicePlaybackRequested,analyticsContextToken:this.analyticsContextToken,identityToken:a,surface:this.chatSurface}),signal:n.signal}),o=await this.json(i);return n.onChunk(o.answer??""),{answer:o.answer??"",sources:o.sources??[],suggestedReplies:o.suggestedReplies??[],availableActions:o.availableActions??[],actions:o.actions??[],selectedAction:o.selectedAction,handoffOffered:o.handoffOffered??!1,requestedContactFields:Up(o.requestedContactFields),conversationEnded:o.conversationEnded??!1,liveMode:o.liveMode,assignedAgentName:o.assignedAgentName,audioBase64:o.audioBase64,mimeType:o.mimeType,visualization:o.visualization,artifacts:o.artifacts}}async action(e,r,n){const a=n?.trim()||(e==="contact-support"?"inquiry":e),i=await fetch(`${this.baseUrl}/public-chat/${a}`,{method:"POST",headers:this.headers(),body:JSON.stringify(r)}),o=await this.json(i);return{ok:!0,note:o?.note,booking:o?.booking}}async speak(e){const r=await fetch(`${this.baseUrl}/public-chat/speak`,{method:"POST",headers:this.headers(),body:JSON.stringify({text:e})}),n=await this.json(r);return{providerReady:!!n.providerReady,message:n.message,audioBase64:n.audioBase64,mimeType:n.mimeType}}async identify(e,r){if(!(!e||!r))try{const n=await fetch(`${this.baseUrl}/public-chat/identify`,{method:"POST",headers:this.headers(),body:JSON.stringify(tw(e,r))});if(!n.ok)try{await n.text()}catch{}}catch{}}async transcribe(e,r,n,a){const i=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:"POST",headers:this.headers(),body:JSON.stringify({audioBase64:e,mimeType:r,languageHint:n,durationSeconds:a})});return(await this.json(i)).text??""}async transcribeAudio(e,r,n,a){const i=new FormData;i.append("audio",e,"voice-recording"),i.append("mimeType",r||e.type||"audio/webm"),n&&i.append("languageHint",n),a!==void 0&&Number.isFinite(a)&&i.append("durationSeconds",String(a));const o=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:"POST",headers:this.headers(!1),body:i});return(await this.json(o)).text??""}async endConversation(e){try{const r=await fetch(`${this.baseUrl}/public-chat/end`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e})});if(!r.ok)try{await r.text()}catch{}}catch{}}async sendFeedback(e){try{const r=await fetch(`${this.baseUrl}/public-chat/feedback`,{method:"POST",headers:this.headers(),body:JSON.stringify(e)});if(!r.ok)try{await r.text()}catch{}}catch{}}async extract(e,r,n){const a=await fetch(`${this.baseUrl}/public-chat/extract`,{method:"POST",headers:this.headers(),body:JSON.stringify({fileBase64:e,mimeType:r,filename:n})});return(await this.json(a)).text??""}async demoSlots(e,r){const n=`from=${encodeURIComponent(e)}&to=${encodeURIComponent(r)}`,a=await fetch(`${this.baseUrl}/public-chat/demo-slots?${n}`,{headers:this.headers(!1)});if(!a.ok){const o=new Error("Calendar availability is temporarily unavailable.");throw o.status=a.status,o}const i=await this.json(a);return{status:i?.status,reason:i?.reason,timezone:i?.timezone,slotDurationMinutes:i?.slotDurationMinutes,available:i?.available,taken:i?.taken??[],busy:i?.busy??[]}}async searchGifs(e){if(!this.gifApiKey)return[];const n=`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(e.trim()||"trending")}&key=${this.gifApiKey}&limit=24&media_filter=tinygif,gif&contentfilter=high`;try{const a=await fetch(n);return a.ok?((await a.json()).results??[]).map(o=>({id:o.id,url:o.media_formats?.gif?.url??o.media_formats?.tinygif?.url??"",preview:o.media_formats?.tinygif?.url??o.media_formats?.gif?.url??"",alt:o.content_description||"GIF"})).filter(o=>o.url):[]}catch{return[]}}}const tw=(t,e)=>{const r={...e.customAttributes??{},...e.metadata??{}};e.createdAt!==void 0&&(r.createdAt=e.createdAt),e.avatarUrl&&(r.avatarUrl=e.avatarUrl),e.company&&(r.company=e.company);const n={sessionId:t},a=e.externalId??e.userId;return a&&(n.externalId=a),e.email&&(n.email=e.email),e.firstName&&(n.firstName=e.firstName),e.lastName&&(n.lastName=e.lastName),e.name&&(n.name=e.name),e.phone&&(n.phone=e.phone),Object.keys(r).length>0&&(n.metadata=r),n},rw=t=>{const e=t?.message;if(Array.isArray(e))return e.join(", ");if(typeof e=="string")return e},nw=async(t,e)=>{const r=t.getReader(),n=new TextDecoder,a={answer:"",sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1,requestedContactFields:[],conversationEnded:!1};let i="";for(;;){const{done:o,value:s}=await r.read();if(o)break;i+=n.decode(s,{stream:!0});let l;for(;(l=i.indexOf(`
|
|
1
|
+
var Centrinfo=(function(Vr){"use strict";var YO=Object.defineProperty;var XO=(Vr,ur,Be)=>ur in Vr?YO(Vr,ur,{enumerable:!0,configurable:!0,writable:!0,value:Be}):Vr[ur]=Be;var se=(Vr,ur,Be)=>XO(Vr,typeof ur!="symbol"?ur+"":ur,Be);var ur,Be,zp,Ln,Fp,Hp,Vp,hu,Ps,Ji,Up,pu,vu,gu,Gp,Rs={},Es=[],J1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Os=Array.isArray;function fn(t,e){for(var r in e)t[r]=e[r];return t}function mu(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Q1(t,e,r){var n,a,i,o={};for(i in e)i=="key"?n=e[i]:i=="ref"?a=e[i]:o[i]=e[i];if(arguments.length>2&&(o.children=arguments.length>3?ur.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)o[i]===void 0&&(o[i]=t.defaultProps[i]);return Ns(t,o,n,a,null)}function Ns(t,e,r,n,a){var i={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++zp,__i:-1,__u:0};return a==null&&Be.vnode!=null&&Be.vnode(i),i}function Me(t){return t.children}function Bs(t,e){this.props=t,this.context=e}function ti(t,e){if(e==null)return t.__?ti(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?ti(t):null}function ew(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,n=[],a=[],i=fn({},e);i.__v=e.__v+1,Be.vnode&&Be.vnode(i),_u(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,n,r??ti(e),!!(32&e.__u),a),i.__v=e.__v,i.__.__k[i.__i]=i,Zp(n,i,a),e.__e=e.__=null,i.__e!=r&&$p(i)}}function $p(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),$p(t)}function yu(t){(!t.__d&&(t.__d=!0)&&Ln.push(t)&&!zs.__r++||Fp!=Be.debounceRendering)&&((Fp=Be.debounceRendering)||Hp)(zs)}function zs(){try{for(var t,e=1;Ln.length;)Ln.length>e&&Ln.sort(Vp),t=Ln.shift(),e=Ln.length,ew(t)}finally{Ln.length=zs.__r=0}}function Wp(t,e,r,n,a,i,o,s,l,c,u){var f,h,d,p,m,g,v,y=n&&n.__k||Es,b=e.length;for(l=tw(r,e,y,l,b),f=0;f<b;f++)(d=r.__k[f])!=null&&(h=d.__i!=-1&&y[d.__i]||Rs,d.__i=f,g=_u(t,d,h,a,i,o,s,l,c,u),p=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&xu(h.ref,null,d),u.push(d.ref,d.__c||p,d)),m==null&&p!=null&&(m=p),(v=!!(4&d.__u))||h.__k===d.__k?(l=qp(d,l,t,v),v&&h.__e&&(h.__e=null)):typeof d.type=="function"&&g!==void 0?l=g:p&&(l=p.nextSibling),d.__u&=-7);return r.__e=m,l}function tw(t,e,r,n,a){var i,o,s,l,c,u=r.length,f=u,h=0;for(t.__k=new Array(a),i=0;i<a;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[i]=Ns(null,o,null,null,null):Os(o)?o=t.__k[i]=Ns(Me,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[i]=Ns(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[i]=o,l=i+h,o.__=t,o.__b=t.__b+1,s=null,(c=o.__i=rw(o,r,l,f))!=-1&&(f--,(s=r[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(a>u?h--:a<u&&h++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,o.__u|=4))):t.__k[i]=null;if(f)for(i=0;i<u;i++)(s=r[i])!=null&&(2&s.__u)==0&&(s.__e==n&&(n=ti(s)),jp(s,s));return n}function qp(t,e,r,n){var a,i;if(typeof t.type=="function"){for(a=t.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=t,e=qp(a[i],e,r,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=ti(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function rw(t,e,r,n){var a,i,o,s=t.key,l=t.type,c=e[r],u=c!=null&&(2&c.__u)==0;if(c===null&&s==null||u&&s==c.key&&l==c.type)return r;if(n>(u?1:0)){for(a=r-1,i=r+1;a>=0||i<e.length;)if((c=e[o=a>=0?a--:i++])!=null&&(2&c.__u)==0&&s==c.key&&l==c.type)return o}return-1}function Yp(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||J1.test(e)?r:r+"px"}function Fs(t,e,r,n,a){var i,o;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Yp(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||Yp(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Up,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=r,r?n?r[Ji]=n[Ji]:(r[Ji]=pu,t.addEventListener(e,i?gu:vu,i)):t.removeEventListener(e,i?gu:vu,i);else{if(a=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Xp(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[Ps]==null)e[Ps]=pu++;else if(e[Ps]<r[Ji])return;return r(Be.event?Be.event(e):e)}}}function _u(t,e,r,n,a,i,o,s,l,c){var u,f,h,d,p,m,g,v,y,b,x,w,S,k,C,A=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[s=e.__e=r.__e]),(u=Be.__b)&&u(e);e:if(typeof A=="function")try{if(v=e.props,y=A.prototype&&A.prototype.render,b=(u=A.contextType)&&n[u.__c],x=u?b?b.props.value:u.__:n,r.__c?g=(f=e.__c=r.__c).__=f.__E:(y?e.__c=f=new A(v,x):(e.__c=f=new Bs(v,x),f.constructor=A,f.render=aw),b&&b.sub(f),f.state||(f.state={}),f.__n=n,h=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&A.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=fn({},f.__s)),fn(f.__s,A.getDerivedStateFromProps(v,f.__s))),d=f.props,p=f.state,f.__v=e,h)y&&A.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&A.getDerivedStateFromProps==null&&v!==d&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),e.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(v,f.__s,x)===!1){e.__v!=r.__v&&(f.props=v,f.state=f.__s,f.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(M){M&&(M.__=e)}),Es.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(d,p,m)})}if(f.context=x,f.props=v,f.__P=t,f.__e=!1,w=Be.__r,S=0,y)f.state=f.__s,f.__d=!1,w&&w(e),u=f.render(f.props,f.state,f.context),Es.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,w&&w(e),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++S<25);f.state=f.__s,f.getChildContext!=null&&(n=fn(fn({},n),f.getChildContext())),y&&!h&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(d,p)),k=u!=null&&u.type===Me&&u.key==null?Kp(u.props.children):u,s=Wp(t,Os(k)?k:[k],e,r,n,a,i,o,s,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),g&&(f.__E=f.__=null)}catch(M){if(e.__v=null,l||i!=null)if(M.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else{for(C=i.length;C--;)mu(i[C]);bu(e)}else e.__e=r.__e,e.__k=r.__k,M.then||bu(e);Be.__e(M,e,r)}else i==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=nw(r.__e,e,r,n,a,i,o,l,c);return(u=Be.diffed)&&u(e),128&e.__u?void 0:s}function bu(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(bu))}function Zp(t,e,r){for(var n=0;n<r.length;n++)xu(r[n],r[++n],r[++n]);Be.__c&&Be.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){Be.__e(i,a.__v)}})}function Kp(t){return typeof t!="object"||t==null||t.__b>0?t:Os(t)?t.map(Kp):t.constructor!==void 0?null:fn({},t)}function nw(t,e,r,n,a,i,o,s,l){var c,u,f,h,d,p,m,g=r.props||Rs,v=e.props,y=e.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((d=i[c])&&"setAttribute"in d==!!y&&(y?d.localName==y:d.nodeType==3)){t=d,i[c]=null;break}}if(t==null){if(y==null)return document.createTextNode(v);t=document.createElementNS(a,y,v.is&&v),s&&(Be.__m&&Be.__m(e,i),s=!1),i=null}if(y==null)g===v||s&&t.data==v||(t.data=v);else{if(i=y=="textarea"&&v.defaultValue!=null?null:i&&ur.call(t.childNodes),!s&&i!=null)for(g={},c=0;c<t.attributes.length;c++)g[(d=t.attributes[c]).name]=d.value;for(c in g)d=g[c],c=="dangerouslySetInnerHTML"?f=d:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||Fs(t,c,null,d,a);for(c in v)d=v[c],c=="children"?h=d:c=="dangerouslySetInnerHTML"?u=d:c=="value"?p=d:c=="checked"?m=d:s&&typeof d!="function"||g[c]===d||Fs(t,c,d,g[c],a);if(u)s||f&&(u.__html==f.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(f&&(t.innerHTML=""),Wp(e.type=="template"?t.content:t,Os(h)?h:[h],e,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:r.__k&&ti(r,0),s,l),i!=null)for(c=i.length;c--;)mu(i[c]);s&&y!="textarea"||(c="value",y=="progress"&&p==null?t.removeAttribute("value"):p!=null&&(p!==t[c]||y=="progress"&&!p||y=="option"&&p!=g[c])&&Fs(t,c,p,g[c],a),c="checked",m!=null&&m!=t[c]&&Fs(t,c,m,g[c],a))}return t}function xu(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(a){Be.__e(a,r)}}function jp(t,e,r){var n,a;if(Be.unmount&&Be.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||xu(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){Be.__e(i,e)}n.base=n.__P=null}if(n=t.__k)for(a=0;a<n.length;a++)n[a]&&jp(n[a],e,r||typeof t.type!="function");r||mu(t.__e),t.__c=t.__=t.__e=void 0}function aw(t,e,r){return this.constructor(t,r)}function Jp(t,e,r){var n,a,i,o;e==document&&(e=document.documentElement),Be.__&&Be.__(t,e),a=(n=!1)?null:e.__k,i=[],o=[],_u(e,t=e.__k=Q1(Me,null,[t]),a||Rs,Rs,e.namespaceURI,a?null:e.firstChild?ur.call(e.childNodes):null,i,a?a.__e:e.firstChild,n,o),Zp(i,t,o)}function iw(t){function e(r){var n,a;return this.getChildContext||(n=new Set,(a={})[e.__c]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&n.forEach(function(o){o.__e=!0,yu(o)})},this.sub=function(i){n.add(i);var o=i.componentWillUnmount;i.componentWillUnmount=function(){n&&n.delete(i),o&&o.call(i)}}),r.children}return e.__c="__cC"+Gp++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,n){return r.children(n)}).contextType=e,e}ur=Es.slice,Be={__e:function(t,e,r,n){for(var a,i,o;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(t)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(t,n||{}),o=a.__d),o)return a.__E=a}catch(s){t=s}throw t}},zp=0,Bs.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=fn({},this.state),typeof t=="function"&&(t=t(fn({},r),this.props)),t&&fn(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),yu(this))},Bs.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),yu(this))},Bs.prototype.render=Me,Ln=[],Hp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vp=function(t,e){return t.__v.__b-e.__v.__b},zs.__r=0,hu=Math.random().toString(8),Ps="__d"+hu,Ji="__a"+hu,Up=/(PointerCapture)$|Capture$/i,pu=0,vu=Xp(!1),gu=Xp(!0),Gp=0;var ow=0;function _(t,e,r,n,a,i){e||(e={});var o,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?o=e[s]:l[s]=e[s];var c={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ow,__i:-1,__u:0,__source:a,__self:i};if(typeof t=="function"&&(o=t.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return Be.vnode&&Be.vnode(c),c}class Qi extends Error{constructor(r,n){super(n);se(this,"status");this.status=r,this.name="ApiError"}}const wu=()=>({agentName:"Accurix",greeting:"Hi! 👋 How can I help you today?",widgetModule:"chat",assistantMediaKind:"image",soundEnabled:!0,voiceOutputEnabled:!1,talkbackMode:"text",allowVoiceInput:!1,memoryEnabled:!0,memoryRetentionDays:30,memoryMessageCap:50,availableActions:[]}),sw="Sara is an AI assistant; answers may be imperfect.",lw="Accurix is an AI assistant; answers may be imperfect.",Qp=t=>{typeof console>"u"||console.warn(`[centrinfo-widget] Could not load saved widget configuration from the API (${t}). Showing default widget chrome. Check data-token, data-api-base, CORS, and backend availability.`)},Su=(t,e={})=>{const n=t.disclaimerText?.trim()?.toLowerCase(),a=e.agentName?.trim()||t.agentName?.trim()||"Accurix",i=e.agentAvatarUrl?.trim()||t.agentAvatarUrl?.trim();return{...t,allowVoiceInput:!!(t.allowVoiceInput&&t.talkbackMode&&t.talkbackMode!=="text"),voiceOutputEnabled:!!(t.voiceOutputEnabled&&t.talkbackMode&&t.talkbackMode!=="text"),agentName:a,agentAvatarUrl:i||void 0,disclaimerText:n===sw.toLowerCase()||n?.includes("sara is an ai assistant")?lw:t.disclaimerText}};class ev{constructor(e,r,n,a,i={},o,s,l="floating"){se(this,"baseUrl");se(this,"token");se(this,"gifApiKey");se(this,"analyticsContextToken");se(this,"bootstrapOverrides");se(this,"identityToken");se(this,"identityTokenProvider");se(this,"chatSurface");this.baseUrl=e,this.token=r,this.gifApiKey=n,this.analyticsContextToken=a,this.bootstrapOverrides=i,this.identityToken=o,this.identityTokenProvider=s,this.chatSurface=l}async currentIdentityToken(){if(this.identityTokenProvider){const e=await this.identityTokenProvider();this.identityToken=e?.trim()||void 0}return this.identityToken}headers(e=!0){const r={Authorization:`Bearer ${this.token}`};return e&&(r["Content-Type"]="application/json"),r}async json(e){let r;try{r=await e.json()}catch{r=void 0}if(!e.ok){const n=uw(r)??`request failed (${e.status})`;throw new Qi(e.status,n)}return r?.data??r}async bootstrap(){try{const e=await fetch(`${this.baseUrl}/public-chat/bootstrap`,{headers:this.headers(!1)});if(!e.ok)return Qp(`bootstrap request failed with ${e.status}`),Su(wu(),this.bootstrapOverrides);const r=await this.json(e);return Su({...wu(),...r},this.bootstrapOverrides)}catch(e){return Qp(e instanceof Error?e.message:"bootstrap request failed"),Su(wu(),this.bootstrapOverrides)}}async history(){const e=await this.currentIdentityToken();if(!e)return{conversations:[]};const r=await fetch(`${this.baseUrl}/public-chat/history`,{method:"POST",headers:this.headers(),body:JSON.stringify({identityToken:e,surface:this.chatSurface})}),n=await this.json(r);return{activeSessionId:n.activeSessionId,conversations:Array.isArray(n.conversations)?n.conversations:[]}}async stream(e,r,n){const a=await this.currentIdentityToken(),i=await fetch(`${this.baseUrl}/public-chat/stream`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:r,clientMessageId:n.clientMessageId,attachmentId:n.attachmentId,attachmentIds:n.attachmentIds,voicePlaybackRequested:!!n.voicePlaybackRequested,analyticsContextToken:this.analyticsContextToken,identityToken:a,surface:this.chatSurface}),signal:n.signal});return!i.ok||!i.body?this.send(e,r,n):fw(i.body,n)}async liveEvents(e,r){const n=`sessionId=${encodeURIComponent(e)}&after=${encodeURIComponent(r)}`,a=await fetch(`${this.baseUrl}/public-chat/live-events?${n}`,{headers:this.headers(!1)}),i=await this.json(a);return{mode:i.mode??"ai",assignedAgentName:i.assignedAgentName,agentTyping:!!i.agentTyping,agentTypingName:i.agentTypingName,conversationEnded:!!i.conversationEnded,events:i.events??[]}}async typing(e,r){try{const n=await fetch(`${this.baseUrl}/public-chat/typing`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e,isTyping:r})});if(!n.ok)try{await n.text()}catch{}}catch{}}async presence(e){try{await fetch(`${this.baseUrl}/public-chat/presence`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e})})}catch{}}async send(e,r,n){const a=await this.currentIdentityToken(),i=await fetch(`${this.baseUrl}/public-chat`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:r,clientMessageId:n.clientMessageId,attachmentId:n.attachmentId,attachmentIds:n.attachmentIds,voicePlaybackRequested:!!n.voicePlaybackRequested,analyticsContextToken:this.analyticsContextToken,identityToken:a,surface:this.chatSurface}),signal:n.signal}),o=await this.json(i);return n.onChunk(o.answer??""),{answer:o.answer??"",sources:o.sources??[],suggestedReplies:o.suggestedReplies??[],availableActions:o.availableActions??[],actions:o.actions??[],selectedAction:o.selectedAction,handoffOffered:o.handoffOffered??!1,requestedContactFields:tv(o.requestedContactFields),conversationEnded:o.conversationEnded??!1,liveMode:o.liveMode,assignedAgentName:o.assignedAgentName,audioBase64:o.audioBase64,mimeType:o.mimeType,visualization:o.visualization,artifacts:o.artifacts}}async action(e,r,n){const a=n?.trim()||(e==="contact-support"?"inquiry":e),i=await fetch(`${this.baseUrl}/public-chat/${a}`,{method:"POST",headers:this.headers(),body:JSON.stringify(r)}),o=await this.json(i);return{ok:!0,note:o?.note,booking:o?.booking,caseReference:o?.caseReference||void 0,inquiryId:o?.inquiryId||o?.inquiry?.id||void 0}}async confirmHostedBooking(e){const r=await fetch(`${this.baseUrl}/public-chat/book-demo/confirm`,{method:"POST",headers:this.headers(),body:JSON.stringify(e)}),n=await this.json(r);if(!n?.booking)throw new Error("Calendar booking confirmation was unavailable.");return n.booking}async speak(e){const r=await fetch(`${this.baseUrl}/public-chat/speak`,{method:"POST",headers:this.headers(),body:JSON.stringify({text:e})}),n=await this.json(r);return{providerReady:!!n.providerReady,message:n.message,audioBase64:n.audioBase64,mimeType:n.mimeType}}async identify(e,r){if(!(!e||!r))try{const n=await fetch(`${this.baseUrl}/public-chat/identify`,{method:"POST",headers:this.headers(),body:JSON.stringify(cw(e,r))});if(!n.ok)try{await n.text()}catch{}}catch{}}async transcribe(e,r,n,a){const i=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:"POST",headers:this.headers(),body:JSON.stringify({audioBase64:e,mimeType:r,languageHint:n,durationSeconds:a})});return(await this.json(i)).text??""}async transcribeAudio(e,r,n,a){const i=new FormData;i.append("audio",e,"voice-recording"),i.append("mimeType",r||e.type||"audio/webm"),n&&i.append("languageHint",n),a!==void 0&&Number.isFinite(a)&&i.append("durationSeconds",String(a));const o=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:"POST",headers:this.headers(!1),body:i});return(await this.json(o)).text??""}async endConversation(e){try{const r=await fetch(`${this.baseUrl}/public-chat/end`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e})});if(!r.ok)try{await r.text()}catch{}}catch{}}async sendFeedback(e){try{const r=await fetch(`${this.baseUrl}/public-chat/feedback`,{method:"POST",headers:this.headers(),body:JSON.stringify(e)});if(!r.ok)try{await r.text()}catch{}}catch{}}async uploadAttachment(e,r,n,a,i){const o=await fetch(`${this.baseUrl}/public-chat/attachments`,{method:"POST",headers:this.headers(),body:JSON.stringify({fileBase64:e,mimeType:r,filename:n,sessionId:a,analyze:i})});return this.json(o)}async fetchAttachment(e,r){const n=await fetch(`${this.baseUrl}/public-chat/attachments/${encodeURIComponent(e)}?sessionId=${encodeURIComponent(r)}`,{headers:this.headers(!1)});if(!n.ok)throw new Qi(n.status,"This file is no longer available.");return n.blob()}async demoSlots(e,r){const n=`from=${encodeURIComponent(e)}&to=${encodeURIComponent(r)}`,a=await fetch(`${this.baseUrl}/public-chat/demo-slots?${n}`,{headers:this.headers(!1)});if(!a.ok){const o=new Error("Calendar availability is temporarily unavailable.");throw o.status=a.status,o}const i=await this.json(a);return{status:i?.status,reason:i?.reason,timezone:i?.timezone,slotDurationMinutes:i?.slotDurationMinutes,available:i?.available,taken:i?.taken??[],busy:i?.busy??[]}}async searchGifs(e){if(!this.gifApiKey)return[];const n=`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(e.trim()||"trending")}&key=${this.gifApiKey}&limit=24&media_filter=tinygif,gif&contentfilter=high`;try{const a=await fetch(n);return a.ok?((await a.json()).results??[]).map(o=>({id:o.id,url:o.media_formats?.gif?.url??o.media_formats?.tinygif?.url??"",preview:o.media_formats?.tinygif?.url??o.media_formats?.gif?.url??"",alt:o.content_description||"GIF"})).filter(o=>o.url):[]}catch{return[]}}}const cw=(t,e)=>{const r={...e.customAttributes??{},...e.metadata??{}};e.createdAt!==void 0&&(r.createdAt=e.createdAt),e.avatarUrl&&(r.avatarUrl=e.avatarUrl),e.company&&(r.company=e.company);const n={sessionId:t},a=e.externalId??e.userId;return a&&(n.externalId=a),e.email&&(n.email=e.email),e.firstName&&(n.firstName=e.firstName),e.lastName&&(n.lastName=e.lastName),e.name&&(n.name=e.name),e.phone&&(n.phone=e.phone),Object.keys(r).length>0&&(n.metadata=r),n},uw=t=>{const e=t?.message;if(Array.isArray(e))return e.join(", ");if(typeof e=="string")return e},fw=async(t,e)=>{const r=t.getReader(),n=new TextDecoder,a={answer:"",sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1,requestedContactFields:[],conversationEnded:!1};let i="";for(;;){const{done:o,value:s}=await r.read();if(o)break;i+=n.decode(s,{stream:!0});let l;for(;(l=i.indexOf(`
|
|
2
2
|
|
|
3
|
-
`))!==-1;){const c=i.slice(0,l);i=i.slice(l+2);const u=
|
|
3
|
+
`))!==-1;){const c=i.slice(0,l);i=i.slice(l+2);const u=dw(c);if(u){if(u.event==="error")throw new Qi(502,u.data?.message??"stream error");if(u.event==="chunk"&&typeof u.data?.text=="string")a.answer+=u.data.text,e.onChunk(u.data.text);else if(u.event==="reset")a.answer="",e.onReset?.();else if(u.event==="final"&&u.data)typeof u.data.answer=="string"&&(a.answer=u.data.answer),a.sources=u.data.sources??[],a.suggestedReplies=u.data.suggestedReplies??[],a.availableActions=u.data.availableActions??[],a.actions=u.data.actions??[],a.selectedAction=u.data.selectedAction,a.handoffOffered=!!u.data.handoffOffered,a.requestedContactFields=tv(u.data.requestedContactFields),a.conversationEnded=!!u.data.conversationEnded,a.liveMode=u.data.liveMode,a.assignedAgentName=u.data.assignedAgentName,a.visualization=u.data.visualization,a.artifacts=u.data.artifacts,a.audioBase64=u.data.audioBase64,a.mimeType=u.data.mimeType,e.onTextReady?.();else if(u.event==="audio"&&u.data)typeof u.data.seq=="number"?(a.liveAudio=!0,e.onAudioSegment?.({seq:u.data.seq,audioBase64:u.data.audioBase64??"",mimeType:u.data.mimeType,text:typeof u.data.text=="string"?u.data.text:void 0})):(a.audioBase64=u.data.audioBase64,a.mimeType=u.data.mimeType);else if(u.event==="done")return a}}}return a},dw=t=>{let e="message";const r=[];for(const n of t.split(`
|
|
4
4
|
`))n.startsWith("event:")?e=n.slice(6).trim():n.startsWith("data:")&&r.push(n.slice(5).trim());if(r.length===0)return{event:e};try{return{event:e,data:JSON.parse(r.join(`
|
|
5
|
-
`))}}catch{return{event:e}}},Up=t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):[],Gt=t=>new Promise(e=>setTimeout(e,t)),Yp={agentName:"Accurix",agentAvatarUrl:"",widgetModule:"assistant",assistantMediaUrl:"https://images.unsplash.com/photo-1494790108377-be9c29b29330",assistantMediaKind:"image",assistantPrivacyUrl:"https://accurix.tech/privacy",soundEnabled:!0,voiceOutputEnabled:!1,talkbackMode:"avatar",avatarProvider:"demo",avatarId:"accurix-demo",greeting:"Hi! I'm Accurix, the AI assistant for Accurix. Ask me anything about products, pricing, or documentation — or book a demo.",allowVoiceInput:!1,memoryEnabled:!0,memoryRetentionDays:30,memoryMessageCap:50,availableActions:["public_book_demo","public_capture_contact","public_submit_inquiry"],agentDescription:"I help with Accurix products, pricing, and documentation.",welcomeSubtitle:"Ask me anything — most answers are instant.",disclaimerText:"Accurix is an AI assistant; answers may be imperfect.",starterQuestions:["What can Accurix help with?","How do I get started?","What's your pricing?"],featuredLinks:[{label:"Accurix founders",url:"https://accurix.tech/about"},{label:"Pricing",url:"https://accurix.tech/pricing"}]},iw=[{match:/demo chart|monthly orders|orders by status/i,result:{answer:"Orders moved in different directions by status in the latest month. The chart below shows one line for submitted, approved, and fulfilled orders.",sources:[],suggestedReplies:["Show a demo KPI","Show a demo table"],handoffOffered:!1,visualization:{version:1,presentation:"chart",type:"line",title:"Monthly orders by status",columns:["month","status","order_count"],rows:[{month:"2025-01-01",status:"Submitted",order_count:12},{month:"2025-01-01",status:"Approved",order_count:16},{month:"2025-01-01",status:"Fulfilled",order_count:14},{month:"2025-02-01",status:"Submitted",order_count:14},{month:"2025-02-01",status:"Approved",order_count:15},{month:"2025-02-01",status:"Fulfilled",order_count:15},{month:"2025-03-01",status:"Submitted",order_count:13},{month:"2025-03-01",status:"Approved",order_count:17},{month:"2025-03-01",status:"Fulfilled",order_count:16},{month:"2025-04-01",status:"Submitted",order_count:15},{month:"2025-04-01",status:"Approved",order_count:16},{month:"2025-04-01",status:"Fulfilled",order_count:17},{month:"2025-05-01",status:"Submitted",order_count:16},{month:"2025-05-01",status:"Approved",order_count:18},{month:"2025-05-01",status:"Fulfilled",order_count:17},{month:"2025-06-01",status:"Submitted",order_count:17},{month:"2025-06-01",status:"Approved",order_count:17},{month:"2025-06-01",status:"Fulfilled",order_count:18},{month:"2025-07-01",status:"Submitted",order_count:18},{month:"2025-07-01",status:"Approved",order_count:19},{month:"2025-07-01",status:"Fulfilled",order_count:18},{month:"2025-08-01",status:"Submitted",order_count:19},{month:"2025-08-01",status:"Approved",order_count:18},{month:"2025-08-01",status:"Fulfilled",order_count:19}],rowCount:24,timezone:"UTC",columnMetadata:[{key:"month",label:"Order month",dataType:"date",semanticRole:"date"},{key:"status",label:"Status",dataType:"text",semanticRole:"dimension"},{key:"order_count",label:"Distinct order count",dataType:"number",semanticRole:"measure",aggregation:"count_distinct"}],chartRecommendation:{type:"line",mode:"time_series",categoryField:"month",valueFields:["order_count"],seriesField:"status"},expandable:!0,tableAvailable:!1,explanation:{headline:"The latest results moved in different directions by status.",summary:"Submitted and fulfilled orders increased, while approved orders decreased.",evidence:["Submitted orders increased from 18 in July to 19 in August.","Approved orders decreased from 19 in July to 18 in August.","Fulfilled orders increased from 18 in July to 19 in August."],businessMeaning:"Overall order activity is steady, but the small approval decline is worth watching if it continues.",followUps:["Which status changed the most?","How does this compare with the prior quarter?"],source:"governed_result"}}}},{match:/demo kpi|active accounts/i,result:{answer:"There are 5,632 active accounts in the current demo result.",sources:[],suggestedReplies:["Show a demo chart","Show a demo table"],handoffOffered:!1,visualization:{version:1,presentation:"kpi",type:"kpi",title:"Active accounts",columns:["active_accounts"],value:"active_accounts",rows:[{active_accounts:5632}],rowCount:1,columnMetadata:[{key:"active_accounts",label:"Active accounts",dataType:"number",semanticRole:"measure",aggregation:"count_distinct"}],explanation:{headline:"Active accounts are 5,632.",summary:"This is the latest value in the demo result.",evidence:["The displayed active-account count is 5,632."],source:"governed_result"}}}},{match:/demo table|account health/i,result:{answer:"Nine accounts are included in this governed result. The table shows a compact preview and can be expanded to inspect every permitted row.",sources:[],suggestedReplies:["Show a demo chart","Test the hidden table response"],handoffOffered:!1,visualization:{version:1,presentation:"table",type:"table",title:"Account health",columns:["account_name","region","health_score","renewal_month"],rows:[{account_name:"Northstar Industries",region:"West",health_score:94,renewal_month:"August"},{account_name:"Apex Group",region:"East",health_score:91,renewal_month:"September"},{account_name:"Summit Retail",region:"North",health_score:88,renewal_month:"August"},{account_name:"Harbor Logistics",region:"South",health_score:86,renewal_month:"October"},{account_name:"Brightline Media",region:"West",health_score:84,renewal_month:"November"},{account_name:"Redwood Labs",region:"East",health_score:82,renewal_month:"September"},{account_name:"Atlas Foods",region:"North",health_score:79,renewal_month:"December"},{account_name:"Cedar Health",region:"South",health_score:77,renewal_month:"October"},{account_name:"Bluewave Energy",region:"West",health_score:74,renewal_month:"December"}],rowCount:9,columnMetadata:[{key:"account_name",label:"Account",dataType:"text",semanticRole:"dimension"},{key:"region",label:"Region",dataType:"text",semanticRole:"geography"},{key:"health_score",label:"Health score",dataType:"number",semanticRole:"measure"},{key:"renewal_month",label:"Renewal month",dataType:"text",semanticRole:"date"}],expandable:!0,tableAvailable:!0,downloadAvailable:!0,explanation:{headline:"Nine accounts are available for review.",summary:"Health scores range from 74 to 94 across four regions.",evidence:["Northstar Industries has the highest health score at 94."],source:"governed_result"}}}},{match:/hidden table|table response/i,result:{answer:"Three accounts need attention. The public widget explains the result without exposing its underlying rows.",sources:[],suggestedReplies:["Show a demo chart","Show a demo KPI"],handoffOffered:!1,visualization:{version:1,presentation:"table",type:"table",columns:["account_name","risk_score"],rows:[{account_name:"Private account A",risk_score:91},{account_name:"Private account B",risk_score:87},{account_name:"Private account C",risk_score:82}],rowCount:3,tableAvailable:!1,explanation:{headline:"Three accounts need attention.",summary:"The written result is available without displaying a public data table.",evidence:["Three accounts matched the approved attention rule."],source:"governed_result"}}}},{match:/^\s*(hi+|hey+|hello|yo|sup|howdy|hola|thanks|thank you|thx|good (morning|afternoon|evening))\b/i,result:{answer:"Hello! 👋 How can I help you today?",sources:[],suggestedReplies:["How do I track a shipment?","How does customs work?"],handoffOffered:!1}},{match:/track|shipment|where|status/i,result:{answer:"Centrinfo can answer from your indexed knowledge base, public website, connected files, and approved organization tools. It keeps answers grounded in your configured sources and can hand a conversation to your team when the AI is not enough.",sources:[{title:"Centrinfo public widget",url:"https://accurix.tech/centrinfo"}],suggestedReplies:["How does the widget work?","Can a human take over?"],handoffOffered:!1}},{match:/custom|clear|duty|tariff|import/i,result:{answer:"Accurix connects your organization knowledge, channels, integrations, and public widget in one place. You can configure which sources the AI can use, which tools visitors can trigger, and when your team should take over live chat.",sources:[{title:"Accurix documentation",url:"https://accurix.tech/docs"}],suggestedReplies:["Which tools can I connect?","How do permissions work?"],handoffOffered:!1}},{match:/price|cost|pricing|plan|quote/i,result:{answer:"Accurix uses a usage-based pricing model. Organizations keep an active subscription and spend credits as the AI answers, searches, and uses tools. Credit top-ups can extend usage when the subscription grant runs low.",sources:[{title:"Pricing",url:"https://accurix.tech/pricing"}],suggestedReplies:["How do credits work?","Can I top up credits?"],handoffOffered:!1}}],ow={answer:"That's a great question — I don't have a confident answer from Accurix's published docs yet. Want me to pass it to the team so a human can follow up? You can also book a quick demo.",sources:[],suggestedReplies:["What can you help with?"],handoffOffered:!0},sw=t=>iw.find(e=>e.match.test(t))?.result??ow;class lw{async history(){return{conversations:[]}}async bootstrap(){return await Gt(180),Yp}async stream(e,r,n){await Gt(550);const a=sw(e),i=a.answer.split(/(\s+)/);for(const o of i){if(n.signal?.aborted)break;n.onChunk(o),await Gt(18+Math.min(40,o.length*6))}return{...a,availableActions:Yp.availableActions}}async liveEvents(){return{mode:"ai",conversationEnded:!1,events:[]}}async typing(){await Gt(20)}async action(e,r){return await Gt(450),{ok:!0,note:{"book-demo":"Demo requested — we'll email you a few times that work. 📅",contact:"Got it — saved your details. ✅","contact-support":"Support has been notified and can join this conversation. ✅",inquiry:"Thanks! We'll get back to you shortly. ✉️","request-callback":"We'll call you back soon. 📞","subscribe-newsletter":"You're subscribed. 🎉"}[e]}}async speak(){return await Gt(120),{providerReady:!1,message:"Demo voice provider is not connected."}}async transcribe(e,r,n,a){return await Gt(700),"How do I track a shipment?"}async extract(e,r,n){return await Gt(600),`[Attached file${n?`: ${n}`:""}] Invoice #4821 — 3 pallets, Rotterdam → Lagos, ETA 12 days.`}async identify(e,r){await Gt(50)}async endConversation(e){await Gt(50)}async sendFeedback(){await Gt(50)}async demoSlots(e,r){return await Gt(150),{taken:[[11,0],[15,0]].map(([a,i])=>{const o=new Date;return o.setHours(a,i,0,0),o.toISOString()}),busy:[]}}async searchGifs(e){await Gt(280);const r=e.trim().toLowerCase(),n=r?ou.filter(i=>i.alt.includes(r)||i.tags.some(o=>o.includes(r)||r.includes(o))):ou;return(n.length>0?n:ou).map(i=>({id:i.id,url:qp(i.emoji,i.anim),preview:qp(i.emoji,i.anim),alt:i.alt}))}}const ys="<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>",_s="<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>",qp=(t,e)=>{const r=`<svg xmlns='http://www.w3.org/2000/svg' width='128' height='128'><rect width='128' height='128' rx='14' fill='#eef1f4'/><text x='64' y='88' font-size='64' text-anchor='middle'>${t}${e}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(r)}`},ou=[{id:"g1",emoji:"👍",alt:"thumbs up",tags:["thumbs","yes","ok","great","good"],anim:ys},{id:"g2",emoji:"🎉",alt:"celebrate",tags:["party","yay","congrats","celebrate"],anim:_s},{id:"g3",emoji:"👋",alt:"wave hello",tags:["hi","hello","hey","wave","bye"],anim:_s},{id:"g4",emoji:"❤️",alt:"heart",tags:["love","thanks","heart"],anim:ys},{id:"g5",emoji:"🤔",alt:"thinking",tags:["hmm","think","thinking"],anim:_s},{id:"g6",emoji:"😂",alt:"laughing",tags:["lol","funny","haha","laugh"],anim:ys},{id:"g7",emoji:"🔥",alt:"fire",tags:["fire","hot","lit","awesome"],anim:ys},{id:"g8",emoji:"🚀",alt:"rocket",tags:["rocket","launch","fast","go"],anim:_s}],su=t=>new Promise(e=>setTimeout(e,t));class cw{constructor(e,r){Vt(this,"real");Vt(this,"strings");this.real=e,this.strings=r}bootstrap(){return this.real.bootstrap()}async history(){return{conversations:[]}}async stream(e,r,n){await su(300);for(const a of this.strings.previewReply.split(/(\s+)/)){if(n.signal?.aborted)break;n.onChunk(a),await su(16)}return{answer:this.strings.previewReply,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1}}async liveEvents(){return{mode:"ai",conversationEnded:!1,events:[]}}async typing(){}async action(){return await su(250),{ok:!0,note:this.strings.previewActionNote}}async speak(){return{providerReady:!1,message:"Preview voice provider is not connected."}}async identify(){}async endConversation(){}async sendFeedback(){}async transcribe(e,r,n,a){return""}async extract(){return""}async searchGifs(){return[]}async demoSlots(){return{taken:[],busy:[]}}}var Fn,je,lu,Xp,Bi=0,Zp=[],nt=Ee,Kp=nt.__b,jp=nt.__r,Qp=nt.diffed,Jp=nt.__c,ev=nt.unmount,tv=nt.__;function zi(t,e){nt.__h&&nt.__h(je,t,Bi||e),Bi=0;var r=je.__H||(je.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function V(t){return Bi=1,uw(av,t)}function uw(t,e,r){var n=zi(Fn++,2);if(n.t=t,!n.__c&&(n.__=[av(void 0,e),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=je,!je.__f)){var a=function(s,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return h.__c});if(u.every(function(h){return!h.__N}))return!i||i.call(this,s,l,c);var f=n.__c.props!==s;return u.some(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(f=!0)}}),i&&i.call(this,s,l,c)||f};je.__f=!0;var i=je.shouldComponentUpdate,o=je.componentWillUpdate;je.componentWillUpdate=function(s,l,c){if(this.__e){var u=i;i=void 0,a(s,l,c),i=u}o&&o.call(this,s,l,c)},je.shouldComponentUpdate=a}return n.__N||n.__}function ie(t,e){var r=zi(Fn++,3);!nt.__s&&uu(r.__H,e)&&(r.__=t,r.u=e,je.__H.__h.push(r))}function rv(t,e){var r=zi(Fn++,4);!nt.__s&&uu(r.__H,e)&&(r.__=t,r.u=e,je.__h.push(r))}function W(t){return Bi=5,Kt(function(){return{current:t}},[])}function Kt(t,e){var r=zi(Fn++,7);return uu(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Q(t,e){return Bi=8,Kt(function(){return t},e)}function fw(t){var e=je.context[t.__c],r=zi(Fn++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(je)),e.props.value):t.__}function hw(){for(var t;t=Zp.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(bs),e.__h.some(cu),e.__h=[]}catch(r){e.__h=[],nt.__e(r,t.__v)}}}nt.__b=function(t){je=null,Kp&&Kp(t)},nt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),tv&&tv(t,e)},nt.__r=function(t){jp&&jp(t),Fn=0;var e=(je=t.__c).__H;e&&(lu===je?(e.__h=[],je.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(bs),e.__h.some(cu),e.__h=[],Fn=0)),lu=je},nt.diffed=function(t){Qp&&Qp(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Zp.push(e)!==1&&Xp===nt.requestAnimationFrame||((Xp=nt.requestAnimationFrame)||dw)(hw)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),lu=je=null},nt.__c=function(t,e){e.some(function(r){try{r.__h.some(bs),r.__h=r.__h.filter(function(n){return!n.__||cu(n)})}catch(n){e.some(function(a){a.__h&&(a.__h=[])}),e=[],nt.__e(n,r.__v)}}),Jp&&Jp(t,e)},nt.unmount=function(t){ev&&ev(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(n){try{bs(n)}catch(a){e=a}}),r.__H=void 0,e&&nt.__e(e,r.__v))};var nv=typeof requestAnimationFrame=="function";function dw(t){var e,r=function(){clearTimeout(n),nv&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);nv&&(e=requestAnimationFrame(r))}function bs(t){var e=je,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),je=e}function cu(t){var e=je;t.__c=t.__(),je=e}function uu(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function av(t,e){return typeof e=="function"?e(t):e}var fu=function(t,e){return fu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},fu(t,e)};function Z(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");fu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var hu=12,pw="sans-serif",Hn=hu+"px "+pw,vw=20,gw=100,mw="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function yw(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r<t.length;r++){var n=String.fromCharCode(r+32),a=(t.charCodeAt(r)-vw)/gw;e[n]=a}return e}var _w=yw(mw),Na={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var t,e;return function(r,n){if(!t){var a=Na.createCanvas();t=a&&a.getContext("2d")}if(t)return e!==n&&(e=t.font=n||Hn),t.measureText(r);r=r||"",n=n||Hn;var i=/((?:\d+)?\.?\d*)px/.exec(n),o=i&&+i[1]||hu,s=0;if(n.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var c=_w[r[l]];s+=c==null?o:c*o}return{width:s}}})(),loadImage:function(t,e,r){var n=new Image;return n.onload=e,n.onerror=r,n.src=t,n}},iv=Ba(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),ov=Ba(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),Fi=Object.prototype.toString,xs=Array.prototype,bw=xs.forEach,xw=xs.filter,du=xs.slice,ww=xs.map,sv=function(){}.constructor,ws=sv?sv.prototype:null,pu="__proto__",Sw=2311;function lv(){return Sw++}function vu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function Te(t){if(t==null||typeof t!="object")return t;var e=t,r=Fi.call(t);if(r==="[object Array]"){if(!Gi(t)){e=[];for(var n=0,a=t.length;n<a;n++)e[n]=Te(t[n])}}else if(ov[r]){if(!Gi(t)){var i=t.constructor;if(i.from)e=i.from(t);else{e=new i(t.length);for(var n=0,a=t.length;n<a;n++)e[n]=t[n]}}}else if(!iv[r]&&!Gi(t)&&!Hi(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==pu&&(e[o]=Te(t[o]))}return e}function De(t,e,r){if(!ce(e)||!ce(t))return r?Te(e):t;for(var n in e)if(e.hasOwnProperty(n)&&n!==pu){var a=t[n],i=e[n];ce(i)&&ce(a)&&!ee(i)&&!ee(a)&&!Hi(i)&&!Hi(a)&&!cv(i)&&!cv(a)&&!Gi(i)&&!Gi(a)?De(a,i,r):(r||!(n in t))&&(t[n]=Te(e[n]))}return t}function U(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==pu&&(t[r]=e[r]);return t}function Ne(t,e,r){for(var n=Qe(e),a=0,i=n.length;a<i;a++){var o=n[a];t[o]==null&&(t[o]=e[o])}return t}function ze(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r}return-1}function kw(t,e){var r=t.prototype;function n(){}n.prototype=e.prototype,t.prototype=new n;for(var a in r)r.hasOwnProperty(a)&&(t.prototype[a]=r[a]);t.prototype.constructor=t,t.superClass=e}function Cr(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(e),a=0;a<n.length;a++){var i=n[a];i!=="constructor"&&t[i]==null&&(t[i]=e[i])}else Ne(t,e)}function Dt(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function D(t,e,r){if(t&&e)if(t.forEach&&t.forEach===bw)t.forEach(e,r);else if(t.length===+t.length)for(var n=0,a=t.length;n<a;n++)e.call(r,t[n],n,t);else for(var i in t)t.hasOwnProperty(i)&&e.call(r,t[i],i,t)}function ue(t,e,r){if(!t)return[];if(!e)return mu(t);if(t.map&&t.map===ww)return t.map(e,r);for(var n=[],a=0,i=t.length;a<i;a++)n.push(e.call(r,t[a],a,t));return n}function Ba(t,e,r,n){if(t&&e){for(var a=0,i=t.length;a<i;a++)r=e.call(n,r,t[a],a,t);return r}}function dt(t,e,r){if(!t)return[];if(!e)return mu(t);if(t.filter&&t.filter===xw)return t.filter(e,r);for(var n=[],a=0,i=t.length;a<i;a++)e.call(r,t[a],a,t)&&n.push(t[a]);return n}function Qe(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}function Tw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return function(){return t.apply(e,r.concat(du.call(arguments)))}}var Le=ws&&ye(ws.bind)?ws.call.bind(ws.bind):Tw;function at(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(du.call(arguments)))}}function ee(t){return Array.isArray?Array.isArray(t):Fi.call(t)==="[object Array]"}function ye(t){return typeof t=="function"}function ne(t){return typeof t=="string"}function gu(t){return Fi.call(t)==="[object String]"}function Ke(t){return typeof t=="number"}function ce(t){var e=typeof t;return e==="function"||!!t&&e==="object"}function cv(t){return!!iv[Fi.call(t)]}function It(t){return!!ov[Fi.call(t)]}function Hi(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function Ss(t){return t.colorStops!=null}function Cw(t){return t.image!=null}function ks(t){return t!==t}function Vi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=t.length;r<n;r++)if(t[r]!=null)return t[r]}function Ce(t,e){return t??e}function Ts(t,e,r){return t??e??r}function mu(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return du.apply(t,e)}function uv(t){if(typeof t=="number")return[t,t,t,t];var e=t.length;return e===2?[t[0],t[1],t[0],t[1]]:e===3?[t[0],t[1],t[2],t[1]]:t}function Ur(t,e){if(!t)throw new Error(e)}function Mr(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var fv="__ec_primitive__";function yu(t){t[fv]=!0}function Gi(t){return t[fv]}var Mw=(function(){function t(){this.data={}}return t.prototype.delete=function(e){var r=this.has(e);return r&&delete this.data[e],r},t.prototype.has=function(e){return this.data.hasOwnProperty(e)},t.prototype.get=function(e){return this.data[e]},t.prototype.set=function(e,r){return this.data[e]=r,this},t.prototype.keys=function(){return Qe(this.data)},t.prototype.forEach=function(e){var r=this.data;for(var n in r)r.hasOwnProperty(n)&&e(r[n],n)},t})(),hv=typeof Map=="function";function Aw(){return hv?new Map:new Mw}var Dw=(function(){function t(e){var r=ee(e);this.data=Aw();var n=this;e instanceof t?e.each(a):e&&D(e,a);function a(i,o){r?n.set(i,o):n.set(o,i)}}return t.prototype.hasKey=function(e){return this.data.has(e)},t.prototype.get=function(e){return this.data.get(e)},t.prototype.set=function(e,r){return this.data.set(e,r),r},t.prototype.each=function(e,r){this.data.forEach(function(n,a){e.call(r,n,a)})},t.prototype.keys=function(){var e=this.data.keys();return hv?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t})();function de(t){return new Dw(t)}function Iw(t,e){for(var r=new t.constructor(t.length+e.length),n=0;n<t.length;n++)r[n]=t[n];for(var a=t.length,n=0;n<e.length;n++)r[n+a]=e[n];return r}function Cs(t,e){var r;if(Object.create)r=Object.create(t);else{var n=function(){};n.prototype=t,r=new n}return e&&U(r,e),r}function dv(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function Vn(t,e){return t.hasOwnProperty(e)}function Ct(){}var Lw=180/Math.PI,Pw=(function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t})(),Rw=(function(){function t(){this.browser=new Pw,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return t})(),ge=new Rw;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(ge.wxa=!0,ge.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?ge.worker=!0:!ge.hasGlobalWindow||"Deno"in window?(ge.node=!0,ge.svgSupported=!0):Ew(navigator.userAgent,ge);function Ew(t,e){var r=e.browser,n=t.match(/Firefox\/([\d.]+)/),a=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),i=t.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(t);n&&(r.firefox=!0,r.version=n[1]),a&&(r.ie=!0,r.version=a[1]),i&&(r.edge=!0,r.version=i[1],r.newEdge=+i[1].split(".")[0]>18),o&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}var Ow=".",Gn="___EC__COMPONENT__CONTAINER___",pv="___EC__EXTENDED_CLASS___";function Ar(t){var e={main:"",sub:""};if(t){var r=t.split(Ow);e.main=r[0]||"",e.sub=r[1]||""}return e}function Nw(t){Ur(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function Bw(t){return!!(t&&t[pv])}function _u(t,e){t.$constructor=t,t.extend=function(r){var n=this,a;return zw(n)?a=(function(i){Z(o,i);function o(){return i.apply(this,arguments)||this}return o})(n):(a=function(){(r.$constructor||n).apply(this,arguments)},kw(a,this)),U(a.prototype,r),a[pv]=!0,a.extend=this.extend,a.superCall=Vw,a.superApply=Gw,a.superClass=n,a}}function zw(t){return ye(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function vv(t,e){t.extend=e.extend}var Fw=Math.round(Math.random()*10);function Hw(t){var e=["__\0is_clz",Fw++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function Vw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.superClass.prototype[e].apply(t,r)}function Gw(t,e,r){return this.superClass.prototype[e].apply(t,r)}function Ms(t){var e={};t.registerClass=function(n){var a=n.type||n.prototype.type;if(a){Nw(a),n.prototype.type=a;var i=Ar(a);if(!i.sub)e[i.main]=n;else if(i.sub!==Gn){var o=r(i);o[i.sub]=n}}return n},t.getClass=function(n,a,i){var o=e[n];if(o&&o[Gn]&&(o=a?o[a]:null),i&&!o)throw new Error(a?"Component "+n+"."+(a||"")+" is used but not imported.":n+".type should be specified.");return o},t.getClassesByMainType=function(n){var a=Ar(n),i=[],o=e[a.main];return o&&o[Gn]?D(o,function(s,l){l!==Gn&&i.push(s)}):i.push(o),i},t.hasClass=function(n){var a=Ar(n);return!!e[a.main]},t.getAllClassMainTypes=function(){var n=[];return D(e,function(a,i){n.push(i)}),n},t.hasSubTypes=function(n){var a=Ar(n),i=e[a.main];return i&&i[Gn]};function r(n){var a=e[n.main];return(!a||!a[Gn])&&(a=e[n.main]={},a[Gn]=!0),a}}function $i(t,e){for(var r=0;r<t.length;r++)t[r][1]||(t[r][1]=t[r][0]);return e=e||!1,function(n,a,i){for(var o={},s=0;s<t.length;s++){var l=t[s][1];if(!(a&&ze(a,l)>=0||i&&ze(i,l)<0)){var c=n.getShallow(l,e);c!=null&&(o[t[s][0]]=c)}}return o}}var $w=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Ww=$i($w),Uw=(function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return Ww(this,e,r)},t})(),gv=(function(){function t(e){this.value=e}return t})(),Yw=(function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new gv(e);return this.insertEntry(r),r},t.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},t.prototype.remove=function(e){var r=e.prev,n=e.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t})(),Wi=(function(){function t(e){this._list=new Yw,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var n=this._list,a=this._map,i=null;if(a[e]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete a[l.key],i=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new gv(r),s.key=e,n.insertEntry(s),a[e]=s}return i},t.prototype.get=function(e){var r=this._map[e],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t})(),bu=new Wi(50);function qw(t){if(typeof t=="string"){var e=bu.get(t);return e&&e.image}else return t}function mv(t,e,r,n,a){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var i=bu.get(t),o={hostEl:r,cb:n,cbPayload:a};return i?(e=i.image,!As(e)&&i.pending.push(o)):(e=Na.loadImage(t,yv,yv),e.__zrImageSrc=t,bu.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function yv(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var r=t.pending[e],n=r.cb;n&&n(this,r.cbPayload),r.hostEl.dirty()}t.pending.length=0}function As(t){return t&&t.width&&t.height}function za(){return[1,0,0,1,0,0]}function xu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Xw(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Fa(t,e,r){var n=e[0]*r[0]+e[2]*r[1],a=e[1]*r[0]+e[3]*r[1],i=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t}function wu(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Su(t,e,r,n){n===void 0&&(n=[0,0]);var a=e[0],i=e[2],o=e[4],s=e[1],l=e[3],c=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=a*f+s*u,t[1]=-a*u+s*f,t[2]=i*f+l*u,t[3]=-i*u+f*l,t[4]=f*(o-n[0])+u*(c-n[1])+n[0],t[5]=f*(c-n[1])-u*(o-n[0])+n[1],t}function Zw(t,e,r){var n=r[0],a=r[1];return t[0]=e[0]*n,t[1]=e[1]*a,t[2]=e[2]*n,t[3]=e[3]*a,t[4]=e[4]*n,t[5]=e[5]*a,t}function ku(t,e){var r=e[0],n=e[2],a=e[4],i=e[1],o=e[3],s=e[5],l=r*o-i*n;return l?(l=1/l,t[0]=o*l,t[1]=-i*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*a)*l,t[5]=(i*a-r*s)*l,t):null}var Ye=(function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,n=this.y-e.y;return Math.sqrt(r*r+n*n)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,n=this.y-e.y;return r*r+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,n=this.y;return this.x=e[0]*r+e[2]*n+e[4],this.y=e[1]*r+e[3]*n+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,n){e.x=r,e.y=n},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,n){e.x=r.x+n.x,e.y=r.y+n.y},t.sub=function(e,r,n){e.x=r.x-n.x,e.y=r.y-n.y},t.scale=function(e,r,n){e.x=r.x*n,e.y=r.y*n},t.scaleAndAdd=function(e,r,n,a){e.x=r.x+n.x*a,e.y=r.y+n.y*a},t.lerp=function(e,r,n,a){var i=1-a;e.x=i*r.x+a*n.x,e.y=i*r.y+a*n.y},t})(),Ds=Math.min,Is=Math.max,$n=new Ye,Wn=new Ye,Un=new Ye,Yn=new Ye,Ui=new Ye,Yi=new Ye,Fe=(function(){function t(e,r,n,a){n<0&&(e=e+n,n=-n),a<0&&(r=r+a,a=-a),this.x=e,this.y=r,this.width=n,this.height=a}return t.prototype.union=function(e){var r=Ds(e.x,this.x),n=Ds(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Is(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Is(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=r,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){var r=this,n=e.width/r.width,a=e.height/r.height,i=za();return wu(i,i,[-r.x,-r.y]),Zw(i,i,[n,a]),wu(i,i,[e.x,e.y]),i},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var n=this,a=n.x,i=n.x+n.width,o=n.y,s=n.y+n.height,l=e.x,c=e.x+e.width,u=e.y,f=e.y+e.height,h=!(i<l||c<a||s<u||f<o);if(r){var d=1/0,p=0,m=Math.abs(i-l),g=Math.abs(c-a),v=Math.abs(s-u),y=Math.abs(f-o),b=Math.min(m,g),x=Math.min(v,y);i<l||c<a?b>p&&(p=b,m<g?Ye.set(Yi,-m,0):Ye.set(Yi,g,0)):b<d&&(d=b,m<g?Ye.set(Ui,m,0):Ye.set(Ui,-g,0)),s<u||f<o?x>p&&(p=x,v<y?Ye.set(Yi,0,-v):Ye.set(Yi,0,y)):b<d&&(d=b,v<y?Ye.set(Ui,0,v):Ye.set(Ui,0,-y))}return r&&Ye.copy(r,h?Ui:Yi),h},t.prototype.contain=function(e,r){var n=this;return e>=n.x&&e<=n.x+n.width&&r>=n.y&&r<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(e,r){e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height},t.applyTransform=function(e,r,n){if(!n){e!==r&&t.copy(e,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var a=n[0],i=n[3],o=n[4],s=n[5];e.x=r.x*a+o,e.y=r.y*i+s,e.width=r.width*a,e.height=r.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}$n.x=Un.x=r.x,$n.y=Yn.y=r.y,Wn.x=Yn.x=r.x+r.width,Wn.y=Un.y=r.y+r.height,$n.transform(n),Yn.transform(n),Wn.transform(n),Un.transform(n),e.x=Ds($n.x,Wn.x,Un.x,Yn.x),e.y=Ds($n.y,Wn.y,Un.y,Yn.y);var l=Is($n.x,Wn.x,Un.x,Yn.x),c=Is($n.y,Wn.y,Un.y,Yn.y);e.width=l-e.x,e.height=c-e.y},t})(),_v={};function $t(t,e){e=e||Hn;var r=_v[e];r||(r=_v[e]=new Wi(500));var n=r.get(t);return n==null&&(n=Na.measureText(t,e).width,r.put(t,n)),n}function bv(t,e,r,n){var a=$t(t,e),i=Cu(e),o=qi(0,a,r),s=Ha(0,i,n),l=new Fe(o,s,a,i);return l}function Tu(t,e,r,n){var a=((t||"")+"").split(`
|
|
6
|
-
`),i=a.length;if(i===1)return
|
|
7
|
-
`);i=
|
|
8
|
-
`),t.isTruncated=s}function
|
|
9
|
-
`):[];var d=h.length*s,p=
|
|
10
|
-
`),c=!0),n.accumWidth=p}else{var m=
|
|
11
|
-
`);for(var g=0;g<u.length;g++){var v=u[g],y=new
|
|
12
|
-
`){l&&(s+=l,u+=c),i.push(s),o.push(u),s="",l="",c=0,u=0;continue}var d=$t(h,e),p=n?!1:!aS(h);if(i.length?u+d>r:a+u+d>r){u?(s||l)&&(p?(s||(s=l,l="",c=0,u=c),i.push(s),o.push(u-c),l+=h,c+=d,s="",u=c):(l&&(s+=l,l="",c=0),i.push(s),o.push(u),s=h,u=d)):p?(i.push(l),o.push(c),l=h,c=d):(i.push(h),o.push(d));continue}u+=d,p?(l+=h,c+=d):(l&&(s+=l,l="",c=0),s+=h)}return!i.length&&!s&&(s=t,l="",c=0),l&&(s+=l),s&&(i.push(s),o.push(u)),i.length===1&&(u+=a),{accumWidth:u,lines:i,linesWidths:o}}function Va(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function iS(t){return[t[0],t[1]]}function Tv(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function oS(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function sS(t){return Math.sqrt(lS(t))}function lS(t){return t[0]*t[0]+t[1]*t[1]}function Du(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function cS(t,e){var r=sS(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function Iu(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var uS=Iu;function fS(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Ga=fS;function jt(t,e,r){var n=e[0],a=e[1];return t[0]=r[0]*n+r[2]*a+r[4],t[1]=r[1]*n+r[3]*a+r[5],t}function $a(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Wa(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var Cv=xu,Mv=5e-5;function qn(t){return t>Mv||t<-Mv}var Xn=[],Ua=[],Lu=za(),Pu=Math.abs,Ru=(function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return qn(this.rotation)||qn(this.x)||qn(this.y)||qn(this.scaleX-1)||qn(this.scaleY-1)||qn(this.skewX)||qn(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(Cv(n),this.invTransform=null);return}n=n||za(),r?this.getLocalTransform(n):Cv(n),e&&(r?Fa(n,e,n):Xw(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Xn);var n=Xn[0]<0?-1:1,a=Xn[1]<0?-1:1,i=((Xn[0]-n)*r+n)/Xn[0]||0,o=((Xn[1]-a)*r+a)/Xn[1]||0;e[0]*=i,e[1]*=i,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||za(),ku(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],a=Math.atan2(e[1],e[0]),i=Math.PI/2+a-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),r=Math.sqrt(r),this.skewX=i,this.skewY=0,this.rotation=-a,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||za(),Fa(Ua,e.invTransform,r),r=Ua);var n=this.originX,a=this.originY;(n||a)&&(Lu[4]=n,Lu[5]=a,Fa(Ua,r,Lu),Ua[4]-=n,Ua[5]-=a,r=Ua),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var n=[e,r],a=this.invTransform;return a&&jt(n,n,a),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],a=this.transform;return a&&jt(n,n,a),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&Pu(e[0]-1)>1e-10&&Pu(e[3]-1)>1e-10?Math.sqrt(Pu(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){hS(this,e)},t.getLocalTransform=function(e,r){r=r||[];var n=e.originX||0,a=e.originY||0,i=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,c=e.rotation||0,u=e.x,f=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||a||s||l){var p=n+s,m=a+l;r[4]=-p*i-h*m*o,r[5]=-m*o-d*p*i}else r[4]=r[5]=0;return r[0]=i,r[3]=o,r[1]=d*i,r[2]=h*o,c&&Su(r,r,c),r[4]+=n+u,r[5]+=a+f,r},t.initDefaultProps=(function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0})(),t})(),Xi=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function hS(t,e){for(var r=0;r<Xi.length;r++){var n=Xi[r];t[n]=e[n]}}var Zi={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},elasticOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},elasticInOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Zi.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?Zi.bounceIn(t*2)*.5:Zi.bounceOut(t*2-1)*.5+.5}},Ps=Math.pow,pn=Math.sqrt,Rs=1e-8,Av=1e-4,Dv=pn(3),Es=1/3,Dr=Va(),Qt=Va(),Ya=Va();function vn(t){return t>-Rs&&t<Rs}function Iv(t){return t>Rs||t<-Rs}function gt(t,e,r,n,a){var i=1-a;return i*i*(i*t+3*a*e)+a*a*(a*n+3*i*r)}function Lv(t,e,r,n,a){var i=1-a;return 3*(((e-t)*i+2*(r-e)*a)*i+(n-r)*a*a)}function Os(t,e,r,n,a,i){var o=n+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),c=t-a,u=s*s-3*o*l,f=s*l-9*o*c,h=l*l-3*s*c,d=0;if(vn(u)&&vn(f))if(vn(s))i[0]=0;else{var p=-l/s;p>=0&&p<=1&&(i[d++]=p)}else{var m=f*f-4*u*h;if(vn(m)){var g=f/u,p=-s/o+g,v=-g/2;p>=0&&p<=1&&(i[d++]=p),v>=0&&v<=1&&(i[d++]=v)}else if(m>0){var y=pn(m),b=u*s+1.5*o*(-f+y),x=u*s+1.5*o*(-f-y);b<0?b=-Ps(-b,Es):b=Ps(b,Es),x<0?x=-Ps(-x,Es):x=Ps(x,Es);var p=(-s-(b+x))/(3*o);p>=0&&p<=1&&(i[d++]=p)}else{var S=(2*u*s-3*o*f)/(2*pn(u*u*u)),w=Math.acos(S)/3,k=pn(u),T=Math.cos(w),p=(-s-2*k*T)/(3*o),v=(-s+k*(T+Dv*Math.sin(w)))/(3*o),C=(-s+k*(T-Dv*Math.sin(w)))/(3*o);p>=0&&p<=1&&(i[d++]=p),v>=0&&v<=1&&(i[d++]=v),C>=0&&C<=1&&(i[d++]=C)}}return d}function Pv(t,e,r,n,a){var i=6*r-12*e+6*t,o=9*e+3*n-3*t-9*r,s=3*e-3*t,l=0;if(vn(o)){if(Iv(i)){var c=-s/i;c>=0&&c<=1&&(a[l++]=c)}}else{var u=i*i-4*o*s;if(vn(u))a[0]=-i/(2*o);else if(u>0){var f=pn(u),c=(-i+f)/(2*o),h=(-i-f)/(2*o);c>=0&&c<=1&&(a[l++]=c),h>=0&&h<=1&&(a[l++]=h)}}return l}function Ns(t,e,r,n,a,i){var o=(e-t)*a+t,s=(r-e)*a+e,l=(n-r)*a+r,c=(s-o)*a+o,u=(l-s)*a+s,f=(u-c)*a+c;i[0]=t,i[1]=o,i[2]=c,i[3]=f,i[4]=f,i[5]=u,i[6]=l,i[7]=n}function dS(t,e,r,n,a,i,o,s,l,c,u){var f,h=.005,d=1/0,p,m,g,v;Dr[0]=l,Dr[1]=c;for(var y=0;y<1;y+=.05)Qt[0]=gt(t,r,a,o,y),Qt[1]=gt(e,n,i,s,y),g=Ga(Dr,Qt),g<d&&(f=y,d=g);d=1/0;for(var b=0;b<32&&!(h<Av);b++)p=f-h,m=f+h,Qt[0]=gt(t,r,a,o,p),Qt[1]=gt(e,n,i,s,p),g=Ga(Qt,Dr),p>=0&&g<d?(f=p,d=g):(Ya[0]=gt(t,r,a,o,m),Ya[1]=gt(e,n,i,s,m),v=Ga(Ya,Dr),m<=1&&v<d?(f=m,d=v):h*=.5);return pn(d)}function pS(t,e,r,n,a,i,o,s,l){for(var c=t,u=e,f=0,h=1/l,d=1;d<=l;d++){var p=d*h,m=gt(t,r,a,o,p),g=gt(e,n,i,s,p),v=m-c,y=g-u;f+=Math.sqrt(v*v+y*y),c=m,u=g}return f}function Lt(t,e,r,n){var a=1-n;return a*(a*t+2*n*e)+n*n*r}function Rv(t,e,r,n){return 2*((1-n)*(e-t)+n*(r-e))}function vS(t,e,r,n,a){var i=t-2*e+r,o=2*(e-t),s=t-n,l=0;if(vn(i)){if(Iv(o)){var c=-s/o;c>=0&&c<=1&&(a[l++]=c)}}else{var u=o*o-4*i*s;if(vn(u)){var c=-o/(2*i);c>=0&&c<=1&&(a[l++]=c)}else if(u>0){var f=pn(u),c=(-o+f)/(2*i),h=(-o-f)/(2*i);c>=0&&c<=1&&(a[l++]=c),h>=0&&h<=1&&(a[l++]=h)}}return l}function Ev(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function Bs(t,e,r,n,a){var i=(e-t)*n+t,o=(r-e)*n+e,s=(o-i)*n+i;a[0]=t,a[1]=i,a[2]=s,a[3]=s,a[4]=o,a[5]=r}function gS(t,e,r,n,a,i,o,s,l){var c,u=.005,f=1/0;Dr[0]=o,Dr[1]=s;for(var h=0;h<1;h+=.05){Qt[0]=Lt(t,r,a,h),Qt[1]=Lt(e,n,i,h);var d=Ga(Dr,Qt);d<f&&(c=h,f=d)}f=1/0;for(var p=0;p<32&&!(u<Av);p++){var m=c-u,g=c+u;Qt[0]=Lt(t,r,a,m),Qt[1]=Lt(e,n,i,m);var d=Ga(Qt,Dr);if(m>=0&&d<f)c=m,f=d;else{Ya[0]=Lt(t,r,a,g),Ya[1]=Lt(e,n,i,g);var v=Ga(Ya,Dr);g<=1&&v<f?(c=g,f=v):u*=.5}}return pn(f)}function mS(t,e,r,n,a,i,o){for(var s=t,l=e,c=0,u=1/o,f=1;f<=o;f++){var h=f*u,d=Lt(t,r,a,h),p=Lt(e,n,i,h),m=d-s,g=p-l;c+=Math.sqrt(m*m+g*g),s=d,l=p}return c}var yS=/cubic-bezier\(([0-9,\.e ]+)\)/;function Ov(t){var e=t&&yS.exec(t);if(e){var r=e[1].split(","),n=+Mr(r[0]),a=+Mr(r[1]),i=+Mr(r[2]),o=+Mr(r[3]);if(isNaN(n+a+i+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:Os(0,n,i,1,l,s)&>(0,a,o,1,s[0])}}}var _S=(function(){function t(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Ct,this.ondestroy=e.ondestroy||Ct,this.onrestart=e.onrestart||Ct,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,a=e-this._startTime-this._pausedTime,i=a/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,s=o?o(i):i;if(this.onframe(s),i===1)if(this.loop){var l=a%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ye(e)?e:Zi[e]||Ov(e)},t})(),Nv={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function gn(t){return t=Math.round(t),t<0?0:t>255?255:t}function Eu(t){return t<0?0:t>1?1:t}function Ou(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?gn(parseFloat(e)/100*255):gn(parseInt(e,10))}function Ki(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Eu(parseFloat(e)/100):Eu(parseFloat(e))}function Nu(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(.6666666666666666-r)*6:t}function zs(t,e,r){return t+(e-t)*r}function Jt(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}function Bu(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Bv=new Wi(20),Fs=null;function qa(t,e){Fs&&Bu(Fs,e),Fs=Bv.put(t,Fs||e.slice())}function Yr(t,e){if(t){e=e||[];var r=Bv.get(t);if(r)return Bu(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in Nv)return Bu(e,Nv[n]),qa(t,e),e;var a=n.length;if(n.charAt(0)==="#"){if(a===4||a===5){var i=parseInt(n.slice(1,4),16);if(!(i>=0&&i<=4095)){Jt(e,0,0,0,1);return}return Jt(e,(i&3840)>>4|(i&3840)>>8,i&240|(i&240)>>4,i&15|(i&15)<<4,a===5?parseInt(n.slice(4),16)/15:1),qa(t,e),e}else if(a===7||a===9){var i=parseInt(n.slice(1,7),16);if(!(i>=0&&i<=16777215)){Jt(e,0,0,0,1);return}return Jt(e,(i&16711680)>>16,(i&65280)>>8,i&255,a===9?parseInt(n.slice(7),16)/255:1),qa(t,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===a){var l=n.substr(0,o),c=n.substr(o+1,s-(o+1)).split(","),u=1;switch(l){case"rgba":if(c.length!==4)return c.length===3?Jt(e,+c[0],+c[1],+c[2],1):Jt(e,0,0,0,1);u=Ki(c.pop());case"rgb":if(c.length>=3)return Jt(e,Ou(c[0]),Ou(c[1]),Ou(c[2]),c.length===3?u:Ki(c[3])),qa(t,e),e;Jt(e,0,0,0,1);return;case"hsla":if(c.length!==4){Jt(e,0,0,0,1);return}return c[3]=Ki(c[3]),zv(c,e),qa(t,e),e;case"hsl":if(c.length!==3){Jt(e,0,0,0,1);return}return zv(c,e),qa(t,e),e;default:return}}Jt(e,0,0,0,1)}}function zv(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=Ki(t[1]),a=Ki(t[2]),i=a<=.5?a*(n+1):a+n-a*n,o=a*2-i;return e=e||[],Jt(e,gn(Nu(o,i,r+.3333333333333333)*255),gn(Nu(o,i,r)*255),gn(Nu(o,i,r-.3333333333333333)*255),1),t.length===4&&(e[3]=t[3]),e}function Fv(t,e){var r=Yr(t);if(r){for(var n=0;n<3;n++)r[n]=r[n]*(1-e)|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Hs(r,r.length===4?"rgba":"rgb")}}function bS(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var n=t*(e.length-1),a=Math.floor(n),i=Math.ceil(n),o=Yr(e[a]),s=Yr(e[i]),l=n-a,c=Hs([gn(zs(o[0],s[0],l)),gn(zs(o[1],s[1],l)),gn(zs(o[2],s[2],l)),Eu(zs(o[3],s[3],l))],"rgba");return r?{color:c,leftIndex:a,rightIndex:i,value:n}:c}}function Hs(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function Vs(t,e){var r=Yr(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Hv=new Wi(100);function Vv(t){if(ne(t)){var e=Hv.get(t);return e||(e=Fv(t,-.1),Hv.put(t,e)),e}else if(Ss(t)){var r=U({},t);return r.colorStops=ue(t.colorStops,function(n){return{offset:n.offset,color:Fv(n.color,-.1)}}),r}return t}function xS(t){return t.type==="linear"}function wS(t){return t.type==="radial"}(function(){return ge.hasGlobalWindow&&ye(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:typeof Buffer<"u"?function(t){return Buffer.from(t).toString("base64")}:function(t){return null}})();var zu=Array.prototype.slice;function qr(t,e,r){return(e-t)*r+t}function Fu(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=qr(e[i],r[i],n);return t}function SS(t,e,r,n){for(var a=e.length,i=a&&e[0].length,o=0;o<a;o++){t[o]||(t[o]=[]);for(var s=0;s<i;s++)t[o][s]=qr(e[o][s],r[o][s],n)}return t}function Gs(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=e[i]+r[i]*n;return t}function Gv(t,e,r,n){for(var a=e.length,i=a&&e[0].length,o=0;o<a;o++){t[o]||(t[o]=[]);for(var s=0;s<i;s++)t[o][s]=e[o][s]+r[o][s]*n}return t}function kS(t,e){for(var r=t.length,n=e.length,a=r>n?e:t,i=Math.min(r,n),o=a[i-1]||{color:[0,0,0,0],offset:0},s=i;s<Math.max(r,n);s++)a.push({offset:o.offset,color:o.color.slice()})}function TS(t,e,r){var n=t,a=e;if(!(!n.push||!a.push)){var i=n.length,o=a.length;if(i!==o){var s=i>o;if(s)n.length=o;else for(var l=i;l<o;l++)n.push(r===1?a[l]:zu.call(a[l]))}for(var c=n[0]&&n[0].length,l=0;l<n.length;l++)if(r===1)isNaN(n[l])&&(n[l]=a[l]);else for(var u=0;u<c;u++)isNaN(n[l][u])&&(n[l][u]=a[l][u])}}function $s(t){if(Dt(t)){var e=t.length;if(Dt(t[0])){for(var r=[],n=0;n<e;n++)r.push(zu.call(t[n]));return r}return zu.call(t)}return t}function Ws(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=t[3]==null?1:t[3],"rgba("+t.join(",")+")"}function CS(t){return Dt(t&&t[0])?2:1}var Us=0,Ys=1,$v=2,ji=3,Hu=4,Vu=5,Wv=6;function Uv(t){return t===Hu||t===Vu}function qs(t){return t===Ys||t===$v}var Qi=[0,0,0,0],MS=(function(){function t(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,n){this._needsSort=!0;var a=this.keyframes,i=a.length,o=!1,s=Wv,l=r;if(Dt(r)){var c=CS(r);s=c,(c===1&&!Ke(r[0])||c===2&&!Ke(r[0][0]))&&(o=!0)}else if(Ke(r)&&!ks(r))s=Us;else if(ne(r))if(!isNaN(+r))s=Us;else{var u=Yr(r);u&&(l=u,s=ji)}else if(Ss(r)){var f=U({},l);f.colorStops=ue(r.colorStops,function(d){return{offset:d.offset,color:Yr(d.color)}}),xS(r)?s=Hu:wS(r)&&(s=Vu),l=f}i===0?this.valType=s:(s!==this.valType||s===Wv)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=ye(n)?n:Zi[n]||Ov(n)),a.push(h),h},t.prototype.prepare=function(e,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,g){return m.time-g.time});for(var a=this.valType,i=n.length,o=n[i-1],s=this.discrete,l=qs(a),c=Uv(a),u=0;u<i;u++){var f=n[u],h=f.value,d=o.value;f.percent=f.time/e,s||(l&&u!==i-1?TS(h,d,a):c&&kS(h.colorStops,d.colorStops))}if(!s&&a!==Vu&&r&&this.needsAnimate()&&r.needsAnimate()&&a===r.valType&&!r._finished){this._additiveTrack=r;for(var p=n[0].value,u=0;u<i;u++)a===Us?n[u].additiveValue=n[u].value-p:a===ji?n[u].additiveValue=Gs([],n[u].value,p,-1):qs(a)&&(n[u].additiveValue=a===Ys?Gs([],n[u].value,p,-1):Gv([],n[u].value,p,-1))}},t.prototype.step=function(e,r){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n=this._additiveTrack!=null,a=n?"additiveValue":"value",i=this.valType,o=this.keyframes,s=o.length,l=this.propName,c=i===ji,u,f=this._lastFr,h=Math.min,d,p;if(s===1)d=p=o[0];else{if(r<0)u=0;else if(r<this._lastFrP){var m=h(f+1,s-1);for(u=m;u>=0&&!(o[u].percent<=r);u--);u=h(u,s-2)}else{for(u=f;u<s&&!(o[u].percent>r);u++);u=h(u-1,s-2)}p=o[u+1],d=o[u]}if(d&&p){this._lastFr=u,this._lastFrP=r;var g=p.percent-d.percent,v=g===0?1:h((r-d.percent)/g,1);p.easingFunc&&(v=p.easingFunc(v));var y=n?this._additiveValue:c?Qi:e[l];if((qs(i)||c)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=v<1?d.rawValue:p.rawValue;else if(qs(i))i===Ys?Fu(y,d[a],p[a],v):SS(y,d[a],p[a],v);else if(Uv(i)){var b=d[a],x=p[a],S=i===Hu;e[l]={type:S?"linear":"radial",x:qr(b.x,x.x,v),y:qr(b.y,x.y,v),colorStops:ue(b.colorStops,function(k,T){var C=x.colorStops[T];return{offset:qr(k.offset,C.offset,v),color:Ws(Fu([],k.color,C.color,v))}}),global:x.global},S?(e[l].x2=qr(b.x2,x.x2,v),e[l].y2=qr(b.y2,x.y2,v)):e[l].r=qr(b.r,x.r,v)}else if(c)Fu(y,d[a],p[a],v),n||(e[l]=Ws(y));else{var w=qr(d[a],p[a],v);n?this._additiveValue=w:e[l]=w}n&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,n=this.propName,a=this._additiveValue;r===Us?e[n]=e[n]+a:r===ji?(Yr(e[n],Qi),Gs(Qi,Qi,a,1),e[n]=Ws(Qi)):r===Ys?Gs(e[n],e[n],a,1):r===$v&&Gv(e[n],e[n],a,1)},t})(),Gu=(function(){function t(e,r,n,a){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&a){vu("Can' use additive animation on looped animation.");return}this._additiveAnimators=a,this._allowDiscrete=n}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,n){return this.whenWithKeys(e,r,Qe(r),n)},t.prototype.whenWithKeys=function(e,r,n,a){for(var i=this._tracks,o=0;o<n.length;o++){var s=n[o],l=i[s];if(!l){l=i[s]=new MS(s);var c=void 0,u=this._getAdditiveTrack(s);if(u){var f=u.keyframes,h=f[f.length-1];c=h&&h.value,u.valType===ji&&c&&(c=Ws(c))}else c=this._target[s];if(c==null)continue;e>0&&l.addKeyframe(0,$s(c),a),this._trackKeys.push(s)}l.addKeyframe(e,$s(r[s]),a)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,n=0;n<r;n++)e[n].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,r=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,r)for(var n=0;n<r.length;n++)r[n].call(this)},t.prototype._setTracksFinished=function(){for(var e=this._tracks,r=this._trackKeys,n=0;n<r.length;n++)e[r[n]].setFinished()},t.prototype._getAdditiveTrack=function(e){var r,n=this._additiveAnimators;if(n)for(var a=0;a<n.length;a++){var i=n[a].getTrack(e);i&&(r=i)}return r},t.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var r=this,n=[],a=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],s=this._tracks[o],l=this._getAdditiveTrack(o),c=s.keyframes,u=c.length;if(s.prepare(a,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var f=c[u-1];f&&(r._target[s.propName]=f.rawValue),s.setFinished()}else n.push(s)}if(n.length||this._force){var h=new _S({life:a,loop:this._loop,delay:this._delay||0,onframe:function(d){r._started=2;var p=r._additiveAnimators;if(p){for(var m=!1,g=0;g<p.length;g++)if(p[g]._clip){m=!0;break}m||(r._additiveAnimators=null)}for(var g=0;g<n.length;g++)n[g].step(r._target,d);var v=r._onframeCbs;if(v)for(var g=0;g<v.length;g++)v[g](r._target,d)},ondestroy:function(){r._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},t.prototype.stop=function(e){if(this._clip){var r=this._clip;e&&r.onframe(1),this._abortedCallback()}},t.prototype.delay=function(e){return this._delay=e,this},t.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},t.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},t.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(e){return this._tracks[e]},t.prototype.getTracks=function(){var e=this;return ue(this._trackKeys,function(r){return e._tracks[r]})},t.prototype.stopTracks=function(e,r){if(!e.length||!this._clip)return!0;for(var n=this._tracks,a=this._trackKeys,i=0;i<e.length;i++){var o=n[e[i]];o&&!o.isFinished()&&(r?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,i=0;i<a.length;i++)if(!n[a[i]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},t.prototype.saveTo=function(e,r,n){if(e){r=r||this._trackKeys;for(var a=0;a<r.length;a++){var i=r[a],o=this._tracks[i];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[n?0:s.length-1];l&&(e[i]=$s(l.rawValue))}}}},t.prototype.__changeFinalValue=function(e,r){r=r||Qe(e);for(var n=0;n<r.length;n++){var a=r[n],i=this._tracks[a];if(i){var o=i.keyframes;if(o.length>1){var s=o.pop();i.addKeyframe(s.time,e[a]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},t})(),ur=(function(){function t(e){e&&(this._$eventProcessor=e)}return t.prototype.on=function(e,r,n,a){this._$handlers||(this._$handlers={});var i=this._$handlers;if(typeof r=="function"&&(a=n,n=r,r=null),!n||!e)return this;var o=this._$eventProcessor;r!=null&&o&&o.normalizeQuery&&(r=o.normalizeQuery(r)),i[e]||(i[e]=[]);for(var s=0;s<i[e].length;s++)if(i[e][s].h===n)return this;var l={h:n,query:r,ctx:a||this,callAtLast:n.zrEventfulCallAtLast},c=i[e].length-1,u=i[e][c];return u&&u.callAtLast?i[e].splice(c,0,l):i[e].push(l),this},t.prototype.isSilent=function(e){var r=this._$handlers;return!r||!r[e]||!r[e].length},t.prototype.off=function(e,r){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(r){if(n[e]){for(var a=[],i=0,o=n[e].length;i<o;i++)n[e][i].h!==r&&a.push(n[e][i]);n[e]=a}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},t.prototype.trigger=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var a=this._$handlers[e],i=this._$eventProcessor;if(a)for(var o=r.length,s=a.length,l=0;l<s;l++){var c=a[l];if(!(i&&i.filter&&c.query!=null&&!i.filter(e,c.query)))switch(o){case 0:c.h.call(c.ctx);break;case 1:c.h.call(c.ctx,r[0]);break;case 2:c.h.call(c.ctx,r[0],r[1]);break;default:c.h.apply(c.ctx,r);break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},t.prototype.triggerWithContext=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var a=this._$handlers[e],i=this._$eventProcessor;if(a)for(var o=r.length,s=r[o-1],l=a.length,c=0;c<l;c++){var u=a[c];if(!(i&&i.filter&&u.query!=null&&!i.filter(e,u.query)))switch(o){case 0:u.h.call(s);break;case 1:u.h.call(s,r[0]);break;case 2:u.h.call(s,r[0],r[1]);break;default:u.h.apply(s,r.slice(1,o-1));break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},t})(),Yv=1;ge.hasGlobalWindow&&(Yv=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Xs=Yv,$u=.4,Wu="#333",Uu="#ccc",AS="#eee",Wt=1,Ji=2,Xa=4,Yu="__zr_normal__",qu=Xi.concat(["ignore"]),DS=Ba(Xi,function(t,e){return t[e]=!0,t},{ignore:!1}),Za={},IS=new Fe(0,0,0,0),Zs=(function(){function t(e){this.id=lv(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var a=this.transform;a||(a=this.transform=[1,0,0,1,0,0]),a[4]+=e,a[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,a=n.local,i=r.innerTransformable,o=void 0,s=void 0,l=!1;i.parent=a?this:null;var c=!1;if(i.copyTransform(r),n.position!=null){var u=IS;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),a||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Za,n,u):Ls(Za,n,u),i.x=Za.x,i.y=Za.y,o=Za.align,s=Za.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var h=void 0,d=void 0;f==="center"?(h=u.width*.5,d=u.height*.5):(h=dn(f[0],u.width),d=dn(f[1],u.height)),c=!0,i.originX=-i.x+h+(a?0:u.x),i.originY=-i.y+d+(a?0:u.y)}}n.rotation!=null&&(i.rotation=n.rotation);var p=n.offset;p&&(i.x+=p[0],i.y+=p[1],c||(i.originX=-p[0],i.originY=-p[1]));var m=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,y=void 0,b=void 0;m&&this.canBeInsideText()?(v=n.insideFill,y=n.insideStroke,(v==null||v==="auto")&&(v=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(v),b=!0)):(v=n.outsideFill,y=n.outsideStroke,(v==null||v==="auto")&&(v=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(v),b=!0)),v=v||"#000",(v!==g.fill||y!==g.stroke||b!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=v,g.stroke=y,g.autoStroke=b,g.align=o,g.verticalAlign=s,r.setDefaultTextStyle(g)),r.__dirty|=Wt,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Uu:Wu},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Yr(r);n||(n=[255,255,255,1]);for(var a=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*a+(i?0:255)*(1-a);return n[3]=1,Hs(n,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},U(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(ce(e))for(var n=e,a=Qe(n),i=0;i<a.length;i++){var o=a[i];this.attrKV(o,e[o])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var r=this._normalState,n=0;n<this.animators.length;n++){var a=this.animators[n],i=a.__fromStateTransition;if(!(a.getLoop()||i&&i!==Yu)){var o=a.targetName,s=o?r[o]:r;a.saveTo(s)}}},t.prototype._innerSaveToNormal=function(e){var r=this._normalState;r||(r=this._normalState={}),e.textConfig&&!r.textConfig&&(r.textConfig=this.textConfig),this._savePrimaryToNormal(e,r,qu)},t.prototype._savePrimaryToNormal=function(e,r,n){for(var a=0;a<n.length;a++){var i=n[a];e[i]!=null&&!(i in r)&&(r[i]=this[i])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(Yu,!1,e)},t.prototype.useState=function(e,r,n,a){var i=e===Yu,o=this.hasState();if(!(!o&&i)){var s=this.currentStates,l=this.stateTransition;if(!(ze(s,e)>=0&&(r||s.length===1))){var c;if(this.stateProxy&&!i&&(c=this.stateProxy(e)),c||(c=this.states&&this.states[e]),!c&&!i){vu("State "+e+" not exists.");return}i||this.saveCurrentToNormalState(c);var u=!!(c&&c.hoverLayer||a);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,c,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(e,r,n,u),h&&h.useState(e,r,n,u),i?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Wt),c}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var a=[],i=this.currentStates,o=e.length,s=o===i.length;if(s){for(var l=0;l<o;l++)if(e[l]!==i[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var c=e[l],u=void 0;this.stateProxy&&(u=this.stateProxy(c,e)),u||(u=this.states[c]),u&&a.push(u)}var f=a[o-1],h=!!(f&&f.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(a),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!r&&!this.__inHover&&p&&p.duration>0,p);var m=this._textContent,g=this._textGuide;m&&m.useStates(e,r,h),g&&g.useStates(e,r,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Wt)}},t.prototype.isSilent=function(){for(var e=this.silent,r=this.parent;!e&&r;){if(r.silent){e=!0;break}r=r.parent}return e},t.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var r=this.animators[e];r.targetName&&r.changeTarget(this[r.targetName])}},t.prototype.removeState=function(e){var r=ze(this.currentStates,e);if(r>=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},t.prototype.replaceState=function(e,r,n){var a=this.currentStates.slice(),i=ze(a,e),o=ze(a,r)>=0;i>=0?o?a.splice(i,1):a[i]=r:n&&!o&&a.push(r),this.useStates(a)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},n,a=0;a<e.length;a++){var i=e[a];U(r,i),i.textConfig&&(n=n||{},U(n,i.textConfig))}return n&&(r.textConfig=n),r},t.prototype._applyStateObj=function(e,r,n,a,i,o){var s=!(r&&a);r&&r.textConfig?(this.textConfig=U({},a?this.textConfig:n.textConfig),U(this.textConfig,r.textConfig)):s&&n.textConfig&&(this.textConfig=n.textConfig);for(var l={},c=!1,u=0;u<qu.length;u++){var f=qu[u],h=i&&DS[f];r&&r[f]!=null?h?(c=!0,l[f]=r[f]):this[f]=r[f]:s&&n[f]!=null&&(h?(c=!0,l[f]=n[f]):this[f]=n[f])}if(!i)for(var u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(r||n)[p]:r||n)}c&&this._transitionState(e,l,o)},t.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var r=this.__zr;r&&e.addSelfToZr(r),e.__zr=r,e.__hostTarget=this}},t.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},t.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(e){var r=this._textContent;r!==e&&(r&&r!==e&&this.removeTextContent(),e.innerTransformable=new Ru,this._attachComponent(e),this._textContent=e,this.markRedraw())},t.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),U(this.textConfig,e),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=Wt;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var r=this._textContent,n=this._textGuide;r&&(r.__inHover=e),n&&(n.__inHover=e)},t.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var r=this.animators;if(r)for(var n=0;n<r.length;n++)e.animation.addAnimator(r[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},t.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var r=this.animators;if(r)for(var n=0;n<r.length;n++)e.animation.removeAnimator(r[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},t.prototype.animate=function(e,r,n){var a=e?this[e]:this,i=new Gu(a,r,n);return e&&(i.targetName=e),this.addAnimator(i,e),i},t.prototype.addAnimator=function(e,r){var n=this.__zr,a=this;e.during(function(){a.updateDuringAnimation(r)}).done(function(){var i=a.animators,o=ze(i,e);o>=0&&i.splice(o,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var n=this.animators,a=n.length,i=[],o=0;o<a;o++){var s=n[o];!e||e===s.scope?s.stop(r):i.push(s)}return this.animators=i,this},t.prototype.animateTo=function(e,r,n){Xu(this,e,r,n)},t.prototype.animateFrom=function(e,r,n){Xu(this,e,r,n,!0)},t.prototype._transitionState=function(e,r,n,a){for(var i=Xu(this,r,n,a),o=0;o<i.length;o++)i[o].__fromStateTransition=e},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=(function(){var e=t.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=Wt;function r(n,a,i,o){Object.defineProperty(e,n,{get:function(){if(!this[a]){var l=this[a]=[];s(this,l)}return this[a]},set:function(l){this[i]=l[0],this[o]=l[1],this[a]=l,s(this,l)}});function s(l,c){Object.defineProperty(c,0,{get:function(){return l[i]},set:function(u){l[i]=u}}),Object.defineProperty(c,1,{get:function(){return l[o]},set:function(u){l[o]=u}})}}Object.defineProperty&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))})(),t})();Cr(Zs,ur),Cr(Zs,Ru);function Xu(t,e,r,n,a){r=r||{};var i=[];qv(t,"",t,e,r,n,i,a);var o=i.length,s=!1,l=r.done,c=r.aborted,u=function(){s=!0,o--,o<=0&&(s?l&&l():c&&c())},f=function(){o--,o<=0&&(s?l&&l():c&&c())};o||l&&l(),i.length>0&&r.during&&i[0].during(function(p,m){r.during(m)});for(var h=0;h<i.length;h++){var d=i[h];u&&d.done(u),f&&d.aborted(f),r.force&&d.duration(r.duration),d.start(r.easing)}return i}function Zu(t,e,r){for(var n=0;n<r;n++)t[n]=e[n]}function LS(t){return Dt(t[0])}function PS(t,e,r){if(Dt(e[r]))if(Dt(t[r])||(t[r]=[]),It(e[r])){var n=e[r].length;t[r].length!==n&&(t[r]=new e[r].constructor(n),Zu(t[r],e[r],n))}else{var a=e[r],i=t[r],o=a.length;if(LS(a))for(var s=a[0].length,l=0;l<o;l++)i[l]?Zu(i[l],a[l],s):i[l]=Array.prototype.slice.call(a[l]);else Zu(i,a,o);i.length=a.length}else t[r]=e[r]}function RS(t,e){return t===e||Dt(t)&&Dt(e)&&ES(t,e)}function ES(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function qv(t,e,r,n,a,i,o,s){for(var l=Qe(n),c=a.duration,u=a.delay,f=a.additive,h=a.setToFinal,d=!ce(i),p=t.animators,m=[],g=0;g<l.length;g++){var v=l[g],y=n[v];if(y!=null&&r[v]!=null&&(d||i[v]))if(ce(y)&&!Dt(y)&&!Ss(y)){if(e){s||(r[v]=y,t.updateDuringAnimation(e));continue}qv(t,v,r[v],y,a,i&&i[v],o,s)}else m.push(v);else s||(r[v]=y,t.updateDuringAnimation(e),m.push(v))}var b=m.length;if(!f&&b)for(var x=0;x<p.length;x++){var S=p[x];if(S.targetName===e){var w=S.stopTracks(m);if(w){var k=ze(p,S);p.splice(k,1)}}}if(a.force||(m=dt(m,function(M){return!RS(n[M],r[M])}),b=m.length),b>0||a.force&&!o.length){var T=void 0,C=void 0,A=void 0;if(s){C={},h&&(T={});for(var x=0;x<b;x++){var v=m[x];C[v]=r[v],h?T[v]=n[v]:r[v]=n[v]}}else if(h){A={};for(var x=0;x<b;x++){var v=m[x];A[v]=$s(r[v]),PS(r,n,v)}}var S=new Gu(r,!1,!1,f?dt(p,function(I){return I.targetName===e}):null);S.targetName=e,a.scope&&(S.scope=a.scope),h&&T&&S.whenWithKeys(0,T,m),A&&S.whenWithKeys(0,A,m),S.whenWithKeys(c??500,s?C:n,m).delay(u||0),t.addAnimator(S,e),o.push(S)}}var Ku="__zr_style_"+Math.round(Math.random()*10),Zn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Ks={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Zn[Ku]=!0;var Xv=["z","z2","invisible"],OS=["invisible"],eo=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=Qe(r),a=0;a<n.length;a++){var i=n[a];i==="style"?this.useStyle(r[i]):t.prototype.attrKV.call(this,i,r[i])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(r,n,a,i){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&NS(this,r,n)||o&&!o[0]&&!o[3])return!1;if(a&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(i&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(r,n){return this.rectContain(r,n)},e.prototype.traverse=function(r,n){r.call(n,this)},e.prototype.rectContain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect();return i.contain(a[0],a[1])},e.prototype.getPaintRect=function(){var r=this._paintRect;if(!this._paintRect||this.__dirty){var n=this.transform,a=this.getBoundingRect(),i=this.style,o=i.shadowBlur||0,s=i.shadowOffsetX||0,l=i.shadowOffsetY||0;r=this._paintRect||(this._paintRect=new Fe(0,0,0,0)),n?Fe.applyTransform(r,a,n):r.copy(a),(o||s||l)&&(r.width+=o*2+Math.abs(s),r.height+=o*2+Math.abs(l),r.x=Math.min(r.x,r.x+s-o),r.y=Math.min(r.y,r.y+l-o));var c=this.dirtyRectTolerance;r.isZero()||(r.x=Math.floor(r.x-c),r.y=Math.floor(r.y-c),r.width=Math.ceil(r.width+1+c*2),r.height=Math.ceil(r.height+1+c*2))}return r},e.prototype.setPrevPaintRect=function(r){r?(this._prevPaintRect=this._prevPaintRect||new Fe(0,0,0,0),this._prevPaintRect.copy(r)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(r){return this.animate("style",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(r,n){r!=="style"?t.prototype.attrKV.call(this,r,n):this.style?this.setStyle(n):this.useStyle(n)},e.prototype.setStyle=function(r,n){return typeof r=="string"?this.style[r]=n:U(this.style,r),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(r){r||this.markRedraw(),this.__dirty|=Ji,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&Ji)},e.prototype.styleUpdated=function(){this.__dirty&=~Ji},e.prototype.createStyle=function(r){return Cs(Zn,r)},e.prototype.useStyle=function(r){r[Ku]||(r=this.createStyle(r)),this.__inHover?this.__hoverStyle=r:this.style=r,this.dirtyStyle()},e.prototype.isStyleObject=function(r){return r[Ku]},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(r,n,Xv)},e.prototype._applyStateObj=function(r,n,a,i,o,s){t.prototype._applyStateObj.call(this,r,n,a,i,o,s);var l=!(n&&i),c;if(n&&n.style?o?i?c=n.style:(c=this._mergeStyle(this.createStyle(),a.style),this._mergeStyle(c,n.style)):(c=this._mergeStyle(this.createStyle(),i?this.style:a.style),this._mergeStyle(c,n.style)):l&&(c=a.style),c)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var f=Qe(u),h=0;h<f.length;h++){var d=f[h];d in c&&(c[d]=c[d],this.style[d]=u[d])}for(var p=Qe(c),h=0;h<p.length;h++){var d=p[h];this.style[d]=this.style[d]}this._transitionState(r,{style:c},s,this.getAnimationStyleProps())}else this.useStyle(c);for(var m=this.__inHover?OS:Xv,h=0;h<m.length;h++){var d=m[h];n&&n[d]!=null?this[d]=n[d]:l&&a[d]!=null&&(this[d]=a[d])}},e.prototype._mergeStates=function(r){for(var n=t.prototype._mergeStates.call(this,r),a,i=0;i<r.length;i++){var o=r[i];o.style&&(a=a||{},this._mergeStyle(a,o.style))}return a&&(n.style=a),n},e.prototype._mergeStyle=function(r,n){return U(r,n),r},e.prototype.getAnimationStyleProps=function(){return Ks},e.initDefaultProps=(function(){var r=e.prototype;r.type="displayable",r.invisible=!1,r.z=0,r.z2=0,r.zlevel=0,r.culling=!1,r.cursor="pointer",r.rectHover=!1,r.incremental=!1,r._rect=null,r.dirtyRectTolerance=0,r.__dirty=Wt|Ji})(),e})(Zs),ju=new Fe(0,0,0,0),Qu=new Fe(0,0,0,0);function NS(t,e,r){return ju.copy(t.getBoundingRect()),t.transform&&ju.applyTransform(t.transform),Qu.width=e,Qu.height=r,!ju.intersect(Qu)}var er=Math.min,tr=Math.max,Ju=Math.sin,ef=Math.cos,Kn=Math.PI*2,js=Va(),Qs=Va(),Js=Va();function Zv(t,e,r,n,a,i){a[0]=er(t,r),a[1]=er(e,n),i[0]=tr(t,r),i[1]=tr(e,n)}var Kv=[],jv=[];function BS(t,e,r,n,a,i,o,s,l,c){var u=Pv,f=gt,h=u(t,r,a,o,Kv);l[0]=1/0,l[1]=1/0,c[0]=-1/0,c[1]=-1/0;for(var d=0;d<h;d++){var p=f(t,r,a,o,Kv[d]);l[0]=er(p,l[0]),c[0]=tr(p,c[0])}h=u(e,n,i,s,jv);for(var d=0;d<h;d++){var m=f(e,n,i,s,jv[d]);l[1]=er(m,l[1]),c[1]=tr(m,c[1])}l[0]=er(t,l[0]),c[0]=tr(t,c[0]),l[0]=er(o,l[0]),c[0]=tr(o,c[0]),l[1]=er(e,l[1]),c[1]=tr(e,c[1]),l[1]=er(s,l[1]),c[1]=tr(s,c[1])}function zS(t,e,r,n,a,i,o,s){var l=Ev,c=Lt,u=tr(er(l(t,r,a),1),0),f=tr(er(l(e,n,i),1),0),h=c(t,r,a,u),d=c(e,n,i,f);o[0]=er(t,a,h),o[1]=er(e,i,d),s[0]=tr(t,a,h),s[1]=tr(e,i,d)}function FS(t,e,r,n,a,i,o,s,l){var c=$a,u=Wa,f=Math.abs(a-i);if(f%Kn<1e-4&&f>1e-4){s[0]=t-r,s[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(js[0]=ef(a)*r+t,js[1]=Ju(a)*n+e,Qs[0]=ef(i)*r+t,Qs[1]=Ju(i)*n+e,c(s,js,Qs),u(l,js,Qs),a=a%Kn,a<0&&(a=a+Kn),i=i%Kn,i<0&&(i=i+Kn),a>i&&!o?i+=Kn:a<i&&o&&(a+=Kn),o){var h=i;i=a,a=h}for(var d=0;d<i;d+=Math.PI/2)d>a&&(Js[0]=ef(d)*r+t,Js[1]=Ju(d)*n+e,c(s,Js,s),u(l,Js,l))}var He={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},jn=[],Qn=[],Ir=[],mn=[],Lr=[],Pr=[],tf=Math.min,rf=Math.max,Jn=Math.cos,ea=Math.sin,Xr=Math.abs,nf=Math.PI,yn=nf*2,af=typeof Float32Array<"u",to=[];function of(t){var e=Math.round(t/nf*1e8)/1e8;return e%2*nf}function HS(t,e){var r=of(t[0]);r<0&&(r+=yn);var n=r-t[0],a=t[1];a+=n,!e&&a-r>=yn?a=r+yn:e&&r-a>=yn?a=r-yn:!e&&r>a?a=r+(yn-of(r-a)):e&&r<a&&(a=r-(yn-of(a-r))),t[0]=r,t[1]=a}var ta=(function(){function t(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(e,r,n){n=n||0,n>0&&(this._ux=Xr(n/Xs/e)||0,this._uy=Xr(n/Xs/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(He.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var n=Xr(e-this._xi),a=Xr(r-this._yi),i=n>this._ux||a>this._uy;if(this.addData(He.L,e,r),this._ctx&&i&&this._ctx.lineTo(e,r),i)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=n*n+a*a;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,n,a,i,o){return this._drawPendingPt(),this.addData(He.C,e,r,n,a,i,o),this._ctx&&this._ctx.bezierCurveTo(e,r,n,a,i,o),this._xi=i,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,n,a){return this._drawPendingPt(),this.addData(He.Q,e,r,n,a),this._ctx&&this._ctx.quadraticCurveTo(e,r,n,a),this._xi=n,this._yi=a,this},t.prototype.arc=function(e,r,n,a,i,o){this._drawPendingPt(),to[0]=a,to[1]=i,HS(to,o),a=to[0],i=to[1];var s=i-a;return this.addData(He.A,e,r,n,n,a,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,a,i,o),this._xi=Jn(i)*n+e,this._yi=ea(i)*n+r,this},t.prototype.arcTo=function(e,r,n,a,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,n,a,i),this},t.prototype.rect=function(e,r,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,n,a),this.addData(He.R,e,r,n,a),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(He.Z);var e=this._ctx,r=this._x0,n=this._y0;return e&&e.closePath(),this._xi=r,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){var r=e.length;!(this.data&&this.data.length===r)&&af&&(this.data=new Float32Array(r));for(var n=0;n<r;n++)this.data[n]=e[n];this._len=r},t.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var r=e.length,n=0,a=this._len,i=0;i<r;i++)n+=e[i].len();af&&this.data instanceof Float32Array&&(this.data=new Float32Array(a+n));for(var i=0;i<r;i++)for(var o=e[i].data,s=0;s<o.length;s++)this.data[a++]=o[s];this._len=a},t.prototype.addData=function(e,r,n,a,i,o,s,l,c){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var f=0;f<arguments.length;f++)u[this._len++]=arguments[f]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r<this._len;r++)e[r]=this.data[r];this.data=e}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,af&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){Ir[0]=Ir[1]=Lr[0]=Lr[1]=Number.MAX_VALUE,mn[0]=mn[1]=Pr[0]=Pr[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,a=0,i=0,o;for(o=0;o<this._len;){var s=e[o++],l=o===1;switch(l&&(r=e[o],n=e[o+1],a=r,i=n),s){case He.M:r=a=e[o++],n=i=e[o++],Lr[0]=a,Lr[1]=i,Pr[0]=a,Pr[1]=i;break;case He.L:Zv(r,n,e[o],e[o+1],Lr,Pr),r=e[o++],n=e[o++];break;case He.C:BS(r,n,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],Lr,Pr),r=e[o++],n=e[o++];break;case He.Q:zS(r,n,e[o++],e[o++],e[o],e[o+1],Lr,Pr),r=e[o++],n=e[o++];break;case He.A:var c=e[o++],u=e[o++],f=e[o++],h=e[o++],d=e[o++],p=e[o++]+d;o+=1;var m=!e[o++];l&&(a=Jn(d)*f+c,i=ea(d)*h+u),FS(c,u,f,h,d,p,m,Lr,Pr),r=Jn(p)*f+c,n=ea(p)*h+u;break;case He.R:a=r=e[o++],i=n=e[o++];var g=e[o++],v=e[o++];Zv(a,i,a+g,i+v,Lr,Pr);break;case He.Z:r=a,n=i;break}$a(Ir,Ir,Lr),Wa(mn,mn,Pr)}return o===0&&(Ir[0]=Ir[1]=mn[0]=mn[1]=0),new Fe(Ir[0],Ir[1],mn[0]-Ir[0],mn[1]-Ir[1])},t.prototype._calculateLength=function(){var e=this.data,r=this._len,n=this._ux,a=this._uy,i=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var c=this._pathSegLen,u=0,f=0,h=0;h<r;){var d=e[h++],p=h===1;p&&(i=e[h],o=e[h+1],s=i,l=o);var m=-1;switch(d){case He.M:i=s=e[h++],o=l=e[h++];break;case He.L:{var g=e[h++],v=e[h++],y=g-i,b=v-o;(Xr(y)>n||Xr(b)>a||h===r-1)&&(m=Math.sqrt(y*y+b*b),i=g,o=v);break}case He.C:{var x=e[h++],S=e[h++],g=e[h++],v=e[h++],w=e[h++],k=e[h++];m=pS(i,o,x,S,g,v,w,k,10),i=w,o=k;break}case He.Q:{var x=e[h++],S=e[h++],g=e[h++],v=e[h++];m=mS(i,o,x,S,g,v,10),i=g,o=v;break}case He.A:var T=e[h++],C=e[h++],A=e[h++],M=e[h++],I=e[h++],L=e[h++],P=L+I;h+=1,p&&(s=Jn(I)*A+T,l=ea(I)*M+C),m=rf(A,M)*tf(yn,Math.abs(L)),i=Jn(P)*A+T,o=ea(P)*M+C;break;case He.R:{s=i=e[h++],l=o=e[h++];var N=e[h++],O=e[h++];m=N*2+O*2;break}case He.Z:{var y=s-i,b=l-o;m=Math.sqrt(y*y+b*b),i=s,o=l;break}}m>=0&&(c[f++]=m,u+=m)}return this._pathLen=u,u},t.prototype.rebuildPath=function(e,r){var n=this.data,a=this._ux,i=this._uy,o=this._len,s,l,c,u,f,h,d=r<1,p,m,g=0,v=0,y,b=0,x,S;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,y=r*m,!y)))e:for(var w=0;w<o;){var k=n[w++],T=w===1;switch(T&&(c=n[w],u=n[w+1],s=c,l=u),k!==He.L&&b>0&&(e.lineTo(x,S),b=0),k){case He.M:s=c=n[w++],l=u=n[w++],e.moveTo(c,u);break;case He.L:{f=n[w++],h=n[w++];var C=Xr(f-c),A=Xr(h-u);if(C>a||A>i){if(d){var M=p[v++];if(g+M>y){var I=(y-g)/M;e.lineTo(c*(1-I)+f*I,u*(1-I)+h*I);break e}g+=M}e.lineTo(f,h),c=f,u=h,b=0}else{var L=C*C+A*A;L>b&&(x=f,S=h,b=L)}break}case He.C:{var P=n[w++],N=n[w++],O=n[w++],q=n[w++],R=n[w++],z=n[w++];if(d){var M=p[v++];if(g+M>y){var I=(y-g)/M;Ns(c,P,O,R,I,jn),Ns(u,N,q,z,I,Qn),e.bezierCurveTo(jn[1],Qn[1],jn[2],Qn[2],jn[3],Qn[3]);break e}g+=M}e.bezierCurveTo(P,N,O,q,R,z),c=R,u=z;break}case He.Q:{var P=n[w++],N=n[w++],O=n[w++],q=n[w++];if(d){var M=p[v++];if(g+M>y){var I=(y-g)/M;Bs(c,P,O,I,jn),Bs(u,N,q,I,Qn),e.quadraticCurveTo(jn[1],Qn[1],jn[2],Qn[2]);break e}g+=M}e.quadraticCurveTo(P,N,O,q),c=O,u=q;break}case He.A:var F=n[w++],X=n[w++],te=n[w++],fe=n[w++],me=n[w++],we=n[w++],Ze=n[w++],Ie=!n[w++],tt=te>fe?te:fe,Ge=Xr(te-fe)>.001,Me=me+we,re=!1;if(d){var M=p[v++];g+M>y&&(Me=me+we*(y-g)/M,re=!0),g+=M}if(Ge&&e.ellipse?e.ellipse(F,X,te,fe,Ze,me,Me,Ie):e.arc(F,X,tt,me,Me,Ie),re)break e;T&&(s=Jn(me)*te+F,l=ea(me)*fe+X),c=Jn(Me)*te+F,u=ea(Me)*fe+X;break;case He.R:s=c=n[w],l=u=n[w+1],f=n[w++],h=n[w++];var he=n[w++],Be=n[w++];if(d){var M=p[v++];if(g+M>y){var pe=y-g;e.moveTo(f,h),e.lineTo(f+tf(pe,he),h),pe-=he,pe>0&&e.lineTo(f+he,h+tf(pe,Be)),pe-=Be,pe>0&&e.lineTo(f+rf(he-pe,0),h+Be),pe-=he,pe>0&&e.lineTo(f,h+rf(Be-pe,0));break e}g+=M}e.rect(f,h,he,Be);break;case He.Z:if(d){var M=p[v++];if(g+M>y){var I=(y-g)/M;e.lineTo(c*(1-I)+s*I,u*(1-I)+l*I);break e}g+=M}e.closePath(),c=s,u=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=He,t.initDefaultProps=(function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0})(),t})();function Ka(t,e,r,n,a,i,o){if(a===0)return!1;var s=a,l=0,c=t;if(o>e+s&&o>n+s||o<e-s&&o<n-s||i>t+s&&i>r+s||i<t-s&&i<r-s)return!1;if(t!==r)l=(e-n)/(t-r),c=(t*n-r*e)/(t-r);else return Math.abs(i-t)<=s/2;var u=l*i-o+c,f=u*u/(l*l+1);return f<=s/2*s/2}function VS(t,e,r,n,a,i,o,s,l,c,u){if(l===0)return!1;var f=l;if(u>e+f&&u>n+f&&u>i+f&&u>s+f||u<e-f&&u<n-f&&u<i-f&&u<s-f||c>t+f&&c>r+f&&c>a+f&&c>o+f||c<t-f&&c<r-f&&c<a-f&&c<o-f)return!1;var h=dS(t,e,r,n,a,i,o,s,c,u);return h<=f/2}function GS(t,e,r,n,a,i,o,s,l){if(o===0)return!1;var c=o;if(l>e+c&&l>n+c&&l>i+c||l<e-c&&l<n-c&&l<i-c||s>t+c&&s>r+c&&s>a+c||s<t-c&&s<r-c&&s<a-c)return!1;var u=gS(t,e,r,n,a,i,s,l);return u<=c/2}var Qv=Math.PI*2;function el(t){return t%=Qv,t<0&&(t+=Qv),t}var ro=Math.PI*2;function $S(t,e,r,n,a,i,o,s,l){if(o===0)return!1;var c=o;s-=t,l-=e;var u=Math.sqrt(s*s+l*l);if(u-c>r||u+c<r)return!1;if(Math.abs(n-a)%ro<1e-4)return!0;if(i){var f=n;n=el(a),a=el(f)}else n=el(n),a=el(a);n>a&&(a+=ro);var h=Math.atan2(l,s);return h<0&&(h+=ro),h>=n&&h<=a||h+ro>=n&&h+ro<=a}function ra(t,e,r,n,a,i){if(i>e&&i>n||i<e&&i<n||n===e)return 0;var o=(i-e)/(n-e),s=n<e?1:-1;(o===1||o===0)&&(s=n<e?.5:-.5);var l=o*(r-t)+t;return l===a?1/0:l>a?s:0}var _n=ta.CMD,na=Math.PI*2,WS=1e-4;function US(t,e){return Math.abs(t-e)<WS}var Mt=[-1,-1,-1],rr=[-1,-1];function YS(){var t=rr[0];rr[0]=rr[1],rr[1]=t}function qS(t,e,r,n,a,i,o,s,l,c){if(c>e&&c>n&&c>i&&c>s||c<e&&c<n&&c<i&&c<s)return 0;var u=Os(e,n,i,s,c,Mt);if(u===0)return 0;for(var f=0,h=-1,d=void 0,p=void 0,m=0;m<u;m++){var g=Mt[m],v=g===0||g===1?.5:1,y=gt(t,r,a,o,g);y<l||(h<0&&(h=Pv(e,n,i,s,rr),rr[1]<rr[0]&&h>1&&YS(),d=gt(e,n,i,s,rr[0]),h>1&&(p=gt(e,n,i,s,rr[1]))),h===2?g<rr[0]?f+=d<e?v:-v:g<rr[1]?f+=p<d?v:-v:f+=s<p?v:-v:g<rr[0]?f+=d<e?v:-v:f+=s<d?v:-v)}return f}function XS(t,e,r,n,a,i,o,s){if(s>e&&s>n&&s>i||s<e&&s<n&&s<i)return 0;var l=vS(e,n,i,s,Mt);if(l===0)return 0;var c=Ev(e,n,i);if(c>=0&&c<=1){for(var u=0,f=Lt(e,n,i,c),h=0;h<l;h++){var d=Mt[h]===0||Mt[h]===1?.5:1,p=Lt(t,r,a,Mt[h]);p<o||(Mt[h]<c?u+=f<e?d:-d:u+=i<f?d:-d)}return u}else{var d=Mt[0]===0||Mt[0]===1?.5:1,p=Lt(t,r,a,Mt[0]);return p<o?0:i<e?d:-d}}function ZS(t,e,r,n,a,i,o,s){if(s-=e,s>r||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Mt[0]=-l,Mt[1]=l;var c=Math.abs(n-a);if(c<1e-4)return 0;if(c>=na-1e-4){n=0,a=na;var u=i?1:-1;return o>=Mt[0]+t&&o<=Mt[1]+t?u:0}if(n>a){var f=n;n=a,a=f}n<0&&(n+=na,a+=na);for(var h=0,d=0;d<2;d++){var p=Mt[d];if(p+t>o){var m=Math.atan2(s,p),u=i?1:-1;m<0&&(m=na+m),(m>=n&&m<=a||m+na>=n&&m+na<=a)&&(m>Math.PI/2&&m<Math.PI*1.5&&(u=-u),h+=u)}}return h}function Jv(t,e,r,n,a){for(var i=t.data,o=t.len(),s=0,l=0,c=0,u=0,f=0,h,d,p=0;p<o;){var m=i[p++],g=p===1;switch(m===_n.M&&p>1&&(r||(s+=ra(l,c,u,f,n,a))),g&&(l=i[p],c=i[p+1],u=l,f=c),m){case _n.M:u=i[p++],f=i[p++],l=u,c=f;break;case _n.L:if(r){if(Ka(l,c,i[p],i[p+1],e,n,a))return!0}else s+=ra(l,c,i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case _n.C:if(r){if(VS(l,c,i[p++],i[p++],i[p++],i[p++],i[p],i[p+1],e,n,a))return!0}else s+=qS(l,c,i[p++],i[p++],i[p++],i[p++],i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case _n.Q:if(r){if(GS(l,c,i[p++],i[p++],i[p],i[p+1],e,n,a))return!0}else s+=XS(l,c,i[p++],i[p++],i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case _n.A:var v=i[p++],y=i[p++],b=i[p++],x=i[p++],S=i[p++],w=i[p++];p+=1;var k=!!(1-i[p++]);h=Math.cos(S)*b+v,d=Math.sin(S)*x+y,g?(u=h,f=d):s+=ra(l,c,h,d,n,a);var T=(n-v)*x/b+v;if(r){if($S(v,y,x,S,S+w,k,e,T,a))return!0}else s+=ZS(v,y,x,S,S+w,k,T,a);l=Math.cos(S+w)*b+v,c=Math.sin(S+w)*x+y;break;case _n.R:u=l=i[p++],f=c=i[p++];var C=i[p++],A=i[p++];if(h=u+C,d=f+A,r){if(Ka(u,f,h,f,e,n,a)||Ka(h,f,h,d,e,n,a)||Ka(h,d,u,d,e,n,a)||Ka(u,d,u,f,e,n,a))return!0}else s+=ra(h,f,h,d,n,a),s+=ra(u,d,u,f,n,a);break;case _n.Z:if(r){if(Ka(l,c,u,f,e,n,a))return!0}else s+=ra(l,c,u,f,n,a);l=u,c=f;break}}return!r&&!US(c,f)&&(s+=ra(l,c,u,f,n,a)||0),s!==0}function KS(t,e,r){return Jv(t,0,!1,e,r)}function jS(t,e,r,n){return Jv(t,e,!0,r,n)}var eg=Ne({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Zn),QS={style:Ne({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Ks.style)},sf=Xi.concat(["invisible","culling","z","z2","zlevel","parent"]),$e=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var a=this._decalEl=this._decalEl||new e;a.buildPath===e.prototype.buildPath&&(a.buildPath=function(l){r.buildPath(l,r.shape)}),a.silent=!0;var i=a.style;for(var o in n)i[o]!==n[o]&&(i[o]=n[o]);i.fill=n.fill?n.decal:null,i.decal=null,i.shadowColor=null,n.strokeFirst&&(i.stroke=null);for(var s=0;s<sf.length;++s)a[sf[s]]=this[sf[s]];a.__dirty|=Wt}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(r){var n=Qe(r);this.shape=this.getDefaultShape();var a=this.getDefaultStyle();a&&this.useStyle(a);for(var i=0;i<n.length;i++){var o=n[i],s=r[o];o==="style"?this.style?U(this.style,s):this.useStyle(s):o==="shape"?U(this.shape,s):t.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var r=this.style.fill;if(r!=="none"){if(ne(r)){var n=Vs(r,0);return n>.5?Wu:n>.2?AS:Uu}else if(r)return Uu}return Wu},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(ne(n)){var a=this.__zr,i=!!(a&&a.isDarkMode()),o=Vs(r,0)<$u;if(i===o)return n}},e.prototype.buildPath=function(r,n,a){},e.prototype.pathUpdated=function(){this.__dirty&=~Xa},e.prototype.getUpdatedPathProxy=function(r){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,r),this.path},e.prototype.createPathProxy=function(){this.path=new ta(!1)},e.prototype.hasStroke=function(){var r=this.style,n=r.stroke;return!(n==null||n==="none"||!(r.lineWidth>0))},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,a=!r;if(a){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||this.__dirty&Xa)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||a){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,c=n.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;c=Math.max(c,u??4)}l>1e-10&&(s.width+=c/l,s.height+=c/l,s.x-=c/l/2,s.y-=c/l/2)}return s}return r},e.prototype.contain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect(),o=this.style;if(r=a[0],n=a[1],i.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,c=o.strokeNoScale?this.getLineScale():1;if(c>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),jS(s,l/c,r,n)))return!0}if(this.hasFill())return KS(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Xa,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):t.prototype.attrKV.call(this,r,n)},e.prototype.setShape=function(r,n){var a=this.shape;return a||(a=this.shape={}),typeof r=="string"?a[r]=n:U(a,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Xa)},e.prototype.createStyle=function(r){return Cs(eg,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=U({},this.shape))},e.prototype._applyStateObj=function(r,n,a,i,o,s){t.prototype._applyStateObj.call(this,r,n,a,i,o,s);var l=!(n&&i),c;if(n&&n.shape?o?i?c=n.shape:(c=U({},a.shape),U(c,n.shape)):(c=U({},i?this.shape:a.shape),U(c,n.shape)):l&&(c=a.shape),c)if(o){this.shape=U({},this.shape);for(var u={},f=Qe(c),h=0;h<f.length;h++){var d=f[h];typeof c[d]=="object"?this.shape[d]=c[d]:u[d]=c[d]}this._transitionState(r,{shape:u},s)}else this.shape=c,this.dirtyShape()},e.prototype._mergeStates=function(r){for(var n=t.prototype._mergeStates.call(this,r),a,i=0;i<r.length;i++){var o=r[i];o.shape&&(a=a||{},this._mergeStyle(a,o.shape))}return a&&(n.shape=a),n},e.prototype.getAnimationStyleProps=function(){return QS},e.prototype.isZeroArea=function(){return!1},e.extend=function(r){var n=(function(i){Z(o,i);function o(s){var l=i.call(this,s)||this;return r.init&&r.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return Te(r.style)},o.prototype.getDefaultShape=function(){return Te(r.shape)},o})(e);for(var a in r)typeof r[a]=="function"&&(n.prototype[a]=r[a]);return n},e.initDefaultProps=(function(){var r=e.prototype;r.type="path",r.strokeContainThreshold=5,r.segmentIgnoreThreshold=0,r.subPixelOptimize=!1,r.autoBatch=!1,r.__dirty=Wt|Ji|Xa})(),e})(eo),JS=Ne({strokeFirst:!0,font:Hn,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},eg),tl=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var r=this.style,n=r.stroke;return n!=null&&n!=="none"&&r.lineWidth>0},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.createStyle=function(r){return Cs(JS,r)},e.prototype.setBoundingRect=function(r){this._rect=r},e.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var n=r.text;n!=null?n+="":n="";var a=Tu(n,r.font,r.textAlign,r.textBaseline);if(a.x+=r.x||0,a.y+=r.y||0,this.hasStroke()){var i=r.lineWidth;a.x-=i/2,a.y-=i/2,a.width+=i,a.height+=i}this._rect=a}return this._rect},e.initDefaultProps=(function(){var r=e.prototype;r.dirtyRectTolerance=10})(),e})(eo);tl.prototype.type="tspan";var ek=Ne({x:0,y:0},Zn),tk={style:Ne({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Ks.style)};function rk(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var bn=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return Cs(ek,r)},e.prototype._getSize=function(r){var n=this.style,a=n[r];if(a!=null)return a;var i=rk(n.image)?n.image:this.__image;if(!i)return 0;var o=r==="width"?"height":"width",s=n[o];return s==null?i[r]:i[r]/i[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return tk},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new Fe(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e})(eo);bn.prototype.type="image";function nk(t,e){var r=e.x,n=e.y,a=e.width,i=e.height,o=e.r,s,l,c,u;a<0&&(r=r+a,a=-a),i<0&&(n=n+i,i=-i),typeof o=="number"?s=l=c=u=o:o instanceof Array?o.length===1?s=l=c=u=o[0]:o.length===2?(s=c=o[0],l=u=o[1]):o.length===3?(s=o[0],l=u=o[1],c=o[2]):(s=o[0],l=o[1],c=o[2],u=o[3]):s=l=c=u=0;var f;s+l>a&&(f=s+l,s*=a/f,l*=a/f),c+u>a&&(f=c+u,c*=a/f,u*=a/f),l+c>i&&(f=l+c,l*=i/f,c*=i/f),s+u>i&&(f=s+u,s*=i/f,u*=i/f),t.moveTo(r+s,n),t.lineTo(r+a-l,n),l!==0&&t.arc(r+a-l,n+l,l,-Math.PI/2,0),t.lineTo(r+a,n+i-c),c!==0&&t.arc(r+a-c,n+i-c,c,0,Math.PI/2),t.lineTo(r+u,n+i),u!==0&&t.arc(r+u,n+i-u,u,Math.PI/2,Math.PI),t.lineTo(r,n+s),s!==0&&t.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var ja=Math.round;function tg(t,e,r){if(e){var n=e.x1,a=e.x2,i=e.y1,o=e.y2;t.x1=n,t.x2=a,t.y1=i,t.y2=o;var s=r&&r.lineWidth;return s&&(ja(n*2)===ja(a*2)&&(t.x1=t.x2=aa(n,s,!0)),ja(i*2)===ja(o*2)&&(t.y1=t.y2=aa(i,s,!0))),t}}function rg(t,e,r){if(e){var n=e.x,a=e.y,i=e.width,o=e.height;t.x=n,t.y=a,t.width=i,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=aa(n,s,!0),t.y=aa(a,s,!0),t.width=Math.max(aa(n+i,s,!1)-t.x,i===0?0:1),t.height=Math.max(aa(a+o,s,!1)-t.y,o===0?0:1)),t}}function aa(t,e,r){if(!e)return t;var n=ja(t*2);return(n+ja(e))%2===0?n/2:(n+(r?1:-1))/2}var ak=(function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t})(),ik={},ft=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new ak},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=rg(ik,n,this.style);a=l.x,i=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else a=n.x,i=n.y,o=n.width,s=n.height;n.r?nk(r,n):r.rect(a,i,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e})($e);ft.prototype.type="rect";var ng={fill:"#000"},ag=2,ok={style:Ne({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Ks.style)},Pt=(function(t){Z(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=ng,n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r<this._children.length;r++){var n=this._children[r];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},e.prototype.updateTransform=function(){var r=this.innerTransformable;r?(r.updateTransform(),r.transform&&(this.transform=r.transform)):t.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(r){var n=this.innerTransformable;return n?n.getLocalTransform(r):t.prototype.getLocalTransform.call(this,r)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,fk(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var n=0;n<this._children.length;n++)this._children[n].__zr=r},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var r=new Fe(0,0,0,0),n=this._children,a=[],i=null,o=0;o<n.length;o++){var s=n[o],l=s.getBoundingRect(),c=s.getLocalTransform(a);c?(r.copy(l),r.applyTransform(c),i=i||r.clone(),i.union(r)):(i=i||l.clone(),i.union(l))}this._rect=i||r}return this._rect},e.prototype.setDefaultTextStyle=function(r){this._defaultStyle=r||ng},e.prototype.setTextContent=function(r){},e.prototype._mergeStyle=function(r,n){if(!n)return r;var a=n.rich,i=r.rich||a&&{};return U(r,n),a&&i?(this._mergeRich(i,a),r.rich=i):i&&(r.rich=i),r},e.prototype._mergeRich=function(r,n){for(var a=Qe(n),i=0;i<a.length;i++){var o=a[i];r[o]=r[o]||{},U(r[o],n[o])}},e.prototype.getAnimationStyleProps=function(){return ok},e.prototype._getOrCreateChild=function(r){var n=this._children[this._childCursor];return(!n||!(n instanceof r))&&(n=new r),this._children[this._childCursor++]=n,n.__zr=this.__zr,n.parent=this,n},e.prototype._updatePlainTexts=function(){var r=this.style,n=r.font||Hn,a=r.padding,i=fg(r),o=Qw(i,r),s=lf(r),l=!!r.backgroundColor,c=o.outerHeight,u=o.outerWidth,f=o.contentWidth,h=o.lines,d=o.lineHeight,p=this._defaultStyle;this.isTruncated=!!o.isTruncated;var m=r.x||0,g=r.y||0,v=r.align||p.align||"left",y=r.verticalAlign||p.verticalAlign||"top",b=m,x=Ha(g,o.contentHeight,y);if(s||a){var S=qi(m,u,v),w=Ha(g,c,y);s&&this._renderBackground(r,r,S,w,u,c)}x+=d/2,a&&(b=ug(m,v,a),y==="top"?x+=a[0]:y==="bottom"&&(x-=a[2]));for(var k=0,T=!1,C=cg("fill"in r?r.fill:(T=!0,p.fill)),A=lg("stroke"in r?r.stroke:!l&&(!p.autoStroke||T)?(k=ag,p.stroke):null),M=r.textShadowBlur>0,I=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),L=o.calculatedLineHeight,P=0;P<h.length;P++){var N=this._getOrCreateChild(tl),O=N.createStyle();N.useStyle(O),O.text=h[P],O.x=b,O.y=x,O.textAlign=v,O.textBaseline="middle",O.opacity=r.opacity,O.strokeFirst=!0,M&&(O.shadowBlur=r.textShadowBlur||0,O.shadowColor=r.textShadowColor||"transparent",O.shadowOffsetX=r.textShadowOffsetX||0,O.shadowOffsetY=r.textShadowOffsetY||0),O.stroke=A,O.fill=C,A&&(O.lineWidth=r.lineWidth||k,O.lineDash=r.lineDash,O.lineDashOffset=r.lineDashOffset||0),O.font=n,og(O,r),x+=d,I&&N.setBoundingRect(new Fe(qi(O.x,f,O.textAlign),Ha(O.y,L,O.textBaseline),f,L))}},e.prototype._updateRichTexts=function(){var r=this.style,n=fg(r),a=tS(n,r),i=a.width,o=a.outerWidth,s=a.outerHeight,l=r.padding,c=r.x||0,u=r.y||0,f=this._defaultStyle,h=r.align||f.align,d=r.verticalAlign||f.verticalAlign;this.isTruncated=!!a.isTruncated;var p=qi(c,o,h),m=Ha(u,s,d),g=p,v=m;l&&(g+=l[3],v+=l[0]);var y=g+i;lf(r)&&this._renderBackground(r,r,p,m,o,s);for(var b=!!r.backgroundColor,x=0;x<a.lines.length;x++){for(var S=a.lines[x],w=S.tokens,k=w.length,T=S.lineHeight,C=S.width,A=0,M=g,I=y,L=k-1,P=void 0;A<k&&(P=w[A],!P.align||P.align==="left");)this._placeToken(P,r,T,v,M,"left",b),C-=P.width,M+=P.width,A++;for(;L>=0&&(P=w[L],P.align==="right");)this._placeToken(P,r,T,v,I,"right",b),C-=P.width,I-=P.width,L--;for(M+=(i-(M-g)-(y-I)-C)/2;A<=L;)P=w[A],this._placeToken(P,r,T,v,M+P.width/2,"center",b),M+=P.width,A++;v+=T}},e.prototype._placeToken=function(r,n,a,i,o,s,l){var c=n.rich[r.styleName]||{};c.text=r.text;var u=r.verticalAlign,f=i+a/2;u==="top"?f=i+r.height/2:u==="bottom"&&(f=i+a-r.height/2);var h=!r.isLineHolder&&lf(c);h&&this._renderBackground(c,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var d=!!c.backgroundColor,p=r.textPadding;p&&(o=ug(o,s,p),f-=r.height/2-p[0]-r.innerHeight/2);var m=this._getOrCreateChild(tl),g=m.createStyle();m.useStyle(g);var v=this._defaultStyle,y=!1,b=0,x=cg("fill"in c?c.fill:"fill"in n?n.fill:(y=!0,v.fill)),S=lg("stroke"in c?c.stroke:"stroke"in n?n.stroke:!d&&!l&&(!v.autoStroke||y)?(b=ag,v.stroke):null),w=c.textShadowBlur>0||n.textShadowBlur>0;g.text=r.text,g.x=o,g.y=f,w&&(g.shadowBlur=c.textShadowBlur||n.textShadowBlur||0,g.shadowColor=c.textShadowColor||n.textShadowColor||"transparent",g.shadowOffsetX=c.textShadowOffsetX||n.textShadowOffsetX||0,g.shadowOffsetY=c.textShadowOffsetY||n.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=r.font||Hn,g.opacity=Ts(c.opacity,n.opacity,1),og(g,c),S&&(g.lineWidth=Ts(c.lineWidth,n.lineWidth,b),g.lineDash=Ce(c.lineDash,n.lineDash),g.lineDashOffset=n.lineDashOffset||0,g.stroke=S),x&&(g.fill=x);var k=r.contentWidth,T=r.contentHeight;m.setBoundingRect(new Fe(qi(g.x,k,g.textAlign),Ha(g.y,T,g.textBaseline),k,T))},e.prototype._renderBackground=function(r,n,a,i,o,s){var l=r.backgroundColor,c=r.borderWidth,u=r.borderColor,f=l&&l.image,h=l&&!f,d=r.borderRadius,p=this,m,g;if(h||r.lineHeight||c&&u){m=this._getOrCreateChild(ft),m.useStyle(m.createStyle()),m.style.fill=null;var v=m.shape;v.x=a,v.y=i,v.width=o,v.height=s,v.r=d,m.dirtyShape()}if(h){var y=m.style;y.fill=l||null,y.fillOpacity=Ce(r.fillOpacity,1)}else if(f){g=this._getOrCreateChild(bn),g.onload=function(){p.dirtyStyle()};var b=g.style;b.image=l.image,b.x=a,b.y=i,b.width=o,b.height=s}if(c&&u){var y=m.style;y.lineWidth=c,y.stroke=u,y.strokeOpacity=Ce(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(m||g).style;x.shadowBlur=r.shadowBlur||0,x.shadowColor=r.shadowColor||"transparent",x.shadowOffsetX=r.shadowOffsetX||0,x.shadowOffsetY=r.shadowOffsetY||0,x.opacity=Ts(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return uk(r)&&(n=[r.fontStyle,r.fontWeight,ck(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Mr(n)||r.textFont||r.font},e})(eo),sk={left:!0,right:1,center:1},lk={top:1,bottom:1,middle:1},ig=["fontStyle","fontWeight","fontSize","fontFamily"];function ck(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?hu+"px":t+"px"}function og(t,e){for(var r=0;r<ig.length;r++){var n=ig[r],a=e[n];a!=null&&(t[n]=a)}}function uk(t){return t.fontSize!=null||t.fontFamily||t.fontWeight}function fk(t){return sg(t),D(t.rich,sg),t}function sg(t){if(t){t.font=Pt.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||sk[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||lk[r]?r:"top";var n=t.padding;n&&(t.padding=uv(t.padding))}}function lg(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function cg(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function ug(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function fg(t){var e=t.text;return e!=null&&(e+=""),e}function lf(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var hg=1e-4,dg=20;function hk(t){return t.replace(/^\s+|\s+$/g,"")}function ia(t,e,r,n){var a=e[0],i=e[1],o=r[0],s=r[1],l=i-a,c=s-o;if(l===0)return c===0?o:(o+s)/2;if(n)if(l>0){if(t<=a)return o;if(t>=i)return s}else{if(t>=a)return o;if(t<=i)return s}else{if(t===a)return o;if(t===i)return s}return(t-a)/l*c+o}function At(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return ne(t)?hk(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function lt(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),dg),t=(+t).toFixed(e),r?t:+t}function dk(t){return t.sort(function(e,r){return e-r}),t}function Zr(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Math.round(t*e)/e===t)return r}return pk(t)}function pk(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),n=r>0?+e.slice(r+1):0,a=r>0?r:e.length,i=e.indexOf("."),o=i<0?0:a-1-i;return Math.max(0,o-n)}function pg(t,e){var r=Math.log,n=Math.LN10,a=Math.floor(r(t[1]-t[0])/n),i=Math.round(r(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-a+i,0),20);return isFinite(o)?o:20}function vk(t,e){var r=Math.max(Zr(t),Zr(e)),n=t+e;return r>dg?n:lt(n,r)}function vg(t){var e=Math.PI*2;return(t%e+e)%e}function rl(t){return t>-hg&&t<hg}var gk=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Kr(t){if(t instanceof Date)return t;if(ne(t)){var e=gk.exec(t);if(!e)return new Date(NaN);if(e[8]){var r=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(r-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,r,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}else return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}else if(t==null)return new Date(NaN);return new Date(Math.round(t))}function mk(t){return Math.pow(10,cf(t))}function cf(t){if(t===0)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return t/Math.pow(10,e)>=10&&e++,e}function gg(t,e){var r=cf(t),n=Math.pow(10,r),a=t/n,i;return a<1.5?i=1:a<2.5?i=2:a<4?i=3:a<7?i=5:i=10,t=i*n,r>=-20?+t.toFixed(r<0?-r:0):t}function nl(t){var e=parseFloat(t);return e==t&&(e!==0||!ne(t)||t.indexOf("x")<=0)?e:NaN}function yk(t){return!isNaN(nl(t))}function mg(){return Math.round(Math.random()*9)}function yg(t,e){return e===0?t:yg(e,t%e)}function _g(t,e){return t==null?e:e==null?t:t*e/yg(t,e)}function Rt(t){throw new Error(t)}function bg(t,e,r){return(e-t)*r+t}var xg="series\0",_k="\0_ec_\0";function _t(t){return t instanceof Array?t:t==null?[]:[t]}function wg(t,e,r){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,a=r.length;n<a;n++){var i=r[n];!t.emphasis[e].hasOwnProperty(i)&&t[e].hasOwnProperty(i)&&(t.emphasis[e][i]=t[e][i])}}}var Sg=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function no(t){return ce(t)&&!ee(t)&&!(t instanceof Date)?t.value:t}function bk(t){return ce(t)&&!(t instanceof Array)}function xk(t,e,r){var n=r==="normalMerge",a=r==="replaceMerge",i=r==="replaceAll";t=t||[],e=(e||[]).slice();var o=de();D(e,function(l,c){if(!ce(l)){e[c]=null;return}});var s=wk(t,o,r);return(n||a)&&Sk(s,t,o,e),n&&kk(s,e),n||a?Tk(s,e,a):i&&Ck(s,e),Mk(s),s}function wk(t,e,r){var n=[];if(r==="replaceAll")return n;for(var a=0;a<t.length;a++){var i=t[a];i&&i.id!=null&&e.set(i.id,a),n.push({existing:r==="replaceMerge"||io(i)?null:i,newOption:null,keyInfo:null,brandNew:null})}return n}function Sk(t,e,r,n){D(n,function(a,i){if(!(!a||a.id==null)){var o=ao(a.id),s=r.get(o);if(s!=null){var l=t[s];Ur(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=a,l.existing=e[s],n[i]=null}}})}function kk(t,e){D(e,function(r,n){if(!(!r||r.name==null))for(var a=0;a<t.length;a++){var i=t[a].existing;if(!t[a].newOption&&i&&(i.id==null||r.id==null)&&!io(r)&&!io(i)&&kg("name",i,r)){t[a].newOption=r,e[n]=null;return}}})}function Tk(t,e,r){D(e,function(n){if(n){for(var a,i=0;(a=t[i])&&(a.newOption||io(a.existing)||a.existing&&n.id!=null&&!kg("id",n,a.existing));)i++;a?(a.newOption=n,a.brandNew=r):t.push({newOption:n,brandNew:r,existing:null,keyInfo:null}),i++}})}function Ck(t,e){D(e,function(r){t.push({newOption:r,brandNew:!0,existing:null,keyInfo:null})})}function Mk(t){var e=de();D(t,function(r){var n=r.existing;n&&e.set(n.id,r)}),D(t,function(r){var n=r.newOption;Ur(!n||n.id==null||!e.get(n.id)||e.get(n.id)===r,"id duplicates: "+(n&&n.id)),n&&n.id!=null&&e.set(n.id,r),!r.keyInfo&&(r.keyInfo={})}),D(t,function(r,n){var a=r.existing,i=r.newOption,o=r.keyInfo;if(ce(i)){if(o.name=i.name!=null?ao(i.name):a?a.name:xg+n,a)o.id=ao(a.id);else if(i.id!=null)o.id=ao(i.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(e.get(o.id))}e.set(o.id,r)}})}function kg(t,e,r){var n=Rr(e[t],null),a=Rr(r[t],null);return n!=null&&a!=null&&n===a}function ao(t){return Rr(t,"")}function Rr(t,e){return t==null?e:ne(t)?t:Ke(t)||gu(t)?t+"":e}function uf(t){var e=t.name;return!!(e&&e.indexOf(xg))}function io(t){return t&&t.id!=null&&ao(t.id).indexOf(_k)===0}function Ak(t,e,r){D(t,function(n){var a=n.newOption;ce(a)&&(n.keyInfo.mainType=e,n.keyInfo.subType=Dk(e,a,n.existing,r))})}function Dk(t,e,r,n){var a=e.type?e.type:r?r.subType:n.determineSubType(t,e);return a}function oa(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return ee(e.dataIndex)?ue(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return ee(e.name)?ue(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}function it(){var t="__ec_inner_"+Ik++;return function(e){return e[t]||(e[t]={})}}var Ik=mg();function ff(t,e,r){var n=hf(e,r),a=n.mainTypeSpecified,i=n.queryOptionMap,o=n.others,s=o,l=r?r.defaultMainType:null;return!a&&l&&i.set(l,{}),i.each(function(c,u){var f=oo(t,u,c,{useDefault:l===u,enableAll:r&&r.enableAll!=null?r.enableAll:!0,enableNone:r&&r.enableNone!=null?r.enableNone:!0});s[u+"Models"]=f.models,s[u+"Model"]=f.models[0]}),s}function hf(t,e){var r;if(ne(t)){var n={};n[t+"Index"]=0,r=n}else r=t;var a=de(),i={},o=!1;return D(r,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){i[l]=s;return}var c=l.match(/^(\w+)(Index|Id|Name)$/)||[],u=c[1],f=(c[2]||"").toLowerCase();if(!(!u||!f||e&&e.includeMainTypes&&ze(e.includeMainTypes,u)<0)){o=o||!!u;var h=a.get(u)||a.set(u,{});h[f]=s}}),{mainTypeSpecified:o,queryOptionMap:a,others:i}}var Et={useDefault:!0,enableAll:!1,enableNone:!1},Lk={useDefault:!1,enableAll:!0,enableNone:!0};function oo(t,e,r,n){n=n||Et;var a=r.index,i=r.id,o=r.name,s={models:null,specified:a!=null||i!=null||o!=null};if(!s.specified){var l=void 0;return s.models=n.useDefault&&(l=t.getComponent(e))?[l]:[],s}return a==="none"||a===!1?(Ur(n.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(a==="all"&&(Ur(n.enableAll,'`"all"` is not a valid value on index option.'),a=i=o=null),s.models=t.queryComponents({mainType:e,index:a,id:i,name:o}),s)}function Tg(t,e,r){t.setAttribute?t.setAttribute(e,r):t[e]=r}function Pk(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function Rk(t){return t==="auto"?ge.domSupported?"html":"richText":t||"html"}function Ek(t,e,r,n,a){var i=e==null||e==="auto";if(n==null)return n;if(Ke(n)){var o=bg(r||0,n,a);return lt(o,i?Math.max(Zr(r||0),Zr(n)):e)}else{if(ne(n))return a<1?r:n;for(var s=[],l=r,c=n,u=Math.max(l?l.length:0,c.length),f=0;f<u;++f){var h=t.getDimensionInfo(f);if(h&&h.type==="ordinal")s[f]=(a<1&&l?l:c)[f];else{var d=l&&l[f]?l[f]:0,p=c[f],o=bg(d,p,a);s[f]=lt(o,i?Math.max(Zr(d),Zr(p)):e)}}return s}}var Ve=it(),Ok=function(t,e,r,n){if(n){var a=Ve(n);a.dataIndex=r,a.dataType=e,a.seriesIndex=t,a.ssrType="chart",n.type==="group"&&n.traverse(function(i){var o=Ve(i);o.seriesIndex=t,o.dataIndex=r,o.dataType=e,o.ssrType="chart"})}},Cg=1,Mg={},Ag=it(),df=it(),pf=0,al=1,il=2,Er=["emphasis","blur","select"],Dg=["normal","emphasis","blur","select"],Nk=10,Bk=9,sa="highlight",ol="downplay",so="select",sl="unselect",lo="toggleSelect";function Qa(t){return t!=null&&t!=="none"}function ll(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function Ig(t){ll(t,"emphasis",il)}function Lg(t){t.hoverState===il&&ll(t,"normal",pf)}function vf(t){ll(t,"blur",al)}function Pg(t){t.hoverState===al&&ll(t,"normal",pf)}function zk(t){t.selected=!0}function Fk(t){t.selected=!1}function Rg(t,e,r){e(t,r)}function jr(t,e,r){Rg(t,e,r),t.isGroup&&t.traverse(function(n){Rg(n,e,r)})}function Eg(t,e){switch(e){case"emphasis":t.hoverState=il;break;case"normal":t.hoverState=pf;break;case"blur":t.hoverState=al;break;case"select":t.selected=!0}}function Hk(t,e,r,n){for(var a=t.style,i={},o=0;o<e.length;o++){var s=e[o],l=a[s];i[s]=l??(n&&n[s])}for(var o=0;o<t.animators.length;o++){var c=t.animators[o];c.__fromStateTransition&&c.__fromStateTransition.indexOf(r)<0&&c.targetName==="style"&&c.saveTo(i,e)}return i}function Vk(t,e,r,n){var a=r&&ze(r,"select")>=0,i=!1;if(t instanceof $e){var o=Ag(t),s=a&&o.selectFill||o.normalFill,l=a&&o.selectStroke||o.normalStroke;if(Qa(s)||Qa(l)){n=n||{};var c=n.style||{};c.fill==="inherit"?(i=!0,n=U({},n),c=U({},c),c.fill=s):!Qa(c.fill)&&Qa(s)?(i=!0,n=U({},n),c=U({},c),c.fill=Vv(s)):!Qa(c.stroke)&&Qa(l)&&(i||(n=U({},n),c=U({},c)),c.stroke=Vv(l)),n.style=c}}if(n&&n.z2==null){i||(n=U({},n));var u=t.z2EmphasisLift;n.z2=t.z2+(u??Nk)}return n}function Gk(t,e,r){if(r&&r.z2==null){r=U({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??Bk)}return r}function $k(t,e,r){var n=ze(t.currentStates,e)>=0,a=t.style.opacity,i=n?null:Hk(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=U({},r),o=U({opacity:n?a:i.opacity*.1},o),r.style=o),r}function gf(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return Vk(this,t,e,r);if(t==="blur")return $k(this,t,r);if(t==="select")return Gk(this,t,r)}return r}function Wk(t){t.stateProxy=gf;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=gf),r&&(r.stateProxy=gf)}function Og(t,e){!Hg(t,e)&&!t.__highByOuter&&jr(t,Ig)}function Ng(t,e){!Hg(t,e)&&!t.__highByOuter&&jr(t,Lg)}function cl(t,e){t.__highByOuter|=1<<(e||0),jr(t,Ig)}function ul(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&jr(t,Lg)}function Uk(t){jr(t,vf)}function Bg(t){jr(t,Pg)}function zg(t){jr(t,zk)}function Fg(t){jr(t,Fk)}function Hg(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Vg(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(a,i){var o=df(i),s=a==="series",l=s?t.getViewOfSeriesModel(i):t.getViewOfComponentModel(i);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(c){Pg(c)}),s&&r.push(i)),o.isBlured=!1}),D(n,function(a){a&&a.toggleBlurSeries&&a.toggleBlurSeries(r,!1,e)})}function mf(t,e,r,n){var a=n.getModel();r=r||"coordinateSystem";function i(c,u){for(var f=0;f<u.length;f++){var h=c.getItemGraphicEl(u[f]);h&&Bg(h)}}if(t!=null&&!(!e||e==="none")){var o=a.getSeriesByIndex(t),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];a.eachSeries(function(c){var u=o===c,f=c.coordinateSystem;f&&f.master&&(f=f.master);var h=f&&s?f===s:u;if(!(r==="series"&&!u||r==="coordinateSystem"&&!h||e==="series"&&u)){var d=n.getViewOfSeriesModel(c);if(d.group.traverse(function(g){g.__highByOuter&&u&&e==="self"||vf(g)}),Dt(e))i(c.getData(),e);else if(ce(e))for(var p=Qe(e),m=0;m<p.length;m++)i(c.getData(p[m]),e[p[m]]);l.push(c),df(c).isBlured=!0}}),a.eachComponent(function(c,u){if(c!=="series"){var f=n.getViewOfComponentModel(u);f&&f.toggleBlurSeries&&f.toggleBlurSeries(l,!0,a)}})}}function yf(t,e,r){if(!(t==null||e==null)){var n=r.getModel().getComponent(t,e);if(n){df(n).isBlured=!0;var a=r.getViewOfComponentModel(n);!a||!a.focusBlurEnabled||a.group.traverse(function(i){vf(i)})}}}function Yk(t,e,r){var n=t.seriesIndex,a=t.getData(e.dataType);if(a){var i=oa(a,e);i=(ee(i)?i[0]:i)||0;var o=a.getItemGraphicEl(i);if(!o)for(var s=a.count(),l=0;!o&&l<s;)o=a.getItemGraphicEl(l++);if(o){var c=Ve(o);mf(n,c.focus,c.blurScope,r)}else{var u=t.get(["emphasis","focus"]),f=t.get(["emphasis","blurScope"]);u!=null&&mf(n,u,f,r)}}}function _f(t,e,r,n){var a={focusSelf:!1,dispatchers:null};if(t==null||t==="series"||e==null||r==null)return a;var i=n.getModel().getComponent(t,e);if(!i)return a;var o=n.getViewOfComponentModel(i);if(!o||!o.findHighDownDispatchers)return a;for(var s=o.findHighDownDispatchers(r),l,c=0;c<s.length;c++)if(Ve(s[c]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function qk(t,e,r){var n=Ve(t),a=_f(n.componentMainType,n.componentIndex,n.componentHighDownName,r),i=a.dispatchers,o=a.focusSelf;i?(o&&yf(n.componentMainType,n.componentIndex,r),D(i,function(s){return Og(s,e)})):(mf(n.seriesIndex,n.focus,n.blurScope,r),n.focus==="self"&&yf(n.componentMainType,n.componentIndex,r),Og(t,e))}function Xk(t,e,r){Vg(r);var n=Ve(t),a=_f(n.componentMainType,n.componentIndex,n.componentHighDownName,r).dispatchers;a?D(a,function(i){return Ng(i,e)}):Ng(t,e)}function Zk(t,e,r){if(Sf(e)){var n=e.dataType,a=t.getData(n),i=oa(a,e);ee(i)||(i=[i]),t[e.type===lo?"toggleSelect":e.type===so?"select":"unselect"](i,n)}}function Gg(t){var e=t.getAllData();D(e,function(r){var n=r.data,a=r.type;n.eachItemGraphicEl(function(i,o){t.isSelected(o,a)?zg(i):Fg(i)})})}function Kk(t){var e=[];return t.eachSeries(function(r){var n=r.getAllData();D(n,function(a){a.data;var i=a.type,o=r.getSelectedDataIndices();if(o.length>0){var s={dataIndex:o,seriesIndex:r.seriesIndex};i!=null&&(s.dataType=i),e.push(s)}})}),e}function bf(t,e,r){Wg(t,!0),jr(t,Wk),Qk(t,e,r)}function jk(t){Wg(t,!1)}function fl(t,e,r,n){n?jk(t):bf(t,e,r)}function Qk(t,e,r){var n=Ve(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var $g=["emphasis","blur","select"],Jk={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function xf(t,e,r,n){r=r||"itemStyle";for(var a=0;a<$g.length;a++){var i=$g[a],o=e.getModel([i,r]),s=t.ensureState(i);s.style=o[Jk[r]]()}}function Wg(t,e){var r=e===!1,n=t;t.highDownSilentOnTouch&&(n.__highDownSilentOnTouch=t.highDownSilentOnTouch),(!r||n.__highDownDispatcher)&&(n.__highByOuter=n.__highByOuter||0,n.__highDownDispatcher=!r)}function wf(t){return!!(t&&t.__highDownDispatcher)}function eT(t){var e=Mg[t];return e==null&&Cg<=32&&(e=Mg[t]=Cg++),e}function Sf(t){var e=t.type;return e===so||e===sl||e===lo}function Ug(t){var e=t.type;return e===sa||e===ol}function tT(t){var e=Ag(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var r=t.states.select||{};e.selectFill=r.style&&r.style.fill||null,e.selectStroke=r.style&&r.style.stroke||null}var Ja=ta.CMD,rT=[[],[],[]],Yg=Math.sqrt,nT=Math.atan2;function aT(t,e){if(e){var r=t.data,n=t.len(),a,i,o,s,l,c,u=Ja.M,f=Ja.C,h=Ja.L,d=Ja.R,p=Ja.A,m=Ja.Q;for(o=0,s=0;o<n;){switch(a=r[o++],s=o,i=0,a){case u:i=1;break;case h:i=1;break;case f:i=3;break;case m:i=2;break;case p:var g=e[4],v=e[5],y=Yg(e[0]*e[0]+e[1]*e[1]),b=Yg(e[2]*e[2]+e[3]*e[3]),x=nT(-e[1]/b,e[0]/y);r[o]*=y,r[o++]+=g,r[o]*=b,r[o++]+=v,r[o++]*=y,r[o++]*=b,r[o++]+=x,r[o++]+=x,o+=2,s=o;break;case d:c[0]=r[o++],c[1]=r[o++],jt(c,c,e),r[s++]=c[0],r[s++]=c[1],c[0]+=r[o++],c[1]+=r[o++],jt(c,c,e),r[s++]=c[0],r[s++]=c[1]}for(l=0;l<i;l++){var S=rT[l];S[0]=r[o++],S[1]=r[o++],jt(S,S,e),r[s++]=S[0],r[s++]=S[1]}}t.increaseVersion()}}var kf=Math.sqrt,hl=Math.sin,dl=Math.cos,co=Math.PI;function qg(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Tf(t,e){return(t[0]*e[0]+t[1]*e[1])/(qg(t)*qg(e))}function Xg(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Tf(t,e))}function Zg(t,e,r,n,a,i,o,s,l,c,u){var f=l*(co/180),h=dl(f)*(t-r)/2+hl(f)*(e-n)/2,d=-1*hl(f)*(t-r)/2+dl(f)*(e-n)/2,p=h*h/(o*o)+d*d/(s*s);p>1&&(o*=kf(p),s*=kf(p));var m=(a===i?-1:1)*kf((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,g=m*o*d/s,v=m*-s*h/o,y=(t+r)/2+dl(f)*g-hl(f)*v,b=(e+n)/2+hl(f)*g+dl(f)*v,x=Xg([1,0],[(h-g)/o,(d-v)/s]),S=[(h-g)/o,(d-v)/s],w=[(-1*h-g)/o,(-1*d-v)/s],k=Xg(S,w);if(Tf(S,w)<=-1&&(k=co),Tf(S,w)>=1&&(k=0),k<0){var T=Math.round(k/co*1e6)/1e6;k=co*2+T%2*co}u.addData(c,y,b,o,s,x,k,f,i)}var iT=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,oT=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function sT(t){var e=new ta;if(!t)return e;var r=0,n=0,a=r,i=n,o,s=ta.CMD,l=t.match(iT);if(!l)return e;for(var c=0;c<l.length;c++){for(var u=l[c],f=u.charAt(0),h=void 0,d=u.match(oT)||[],p=d.length,m=0;m<p;m++)d[m]=parseFloat(d[m]);for(var g=0;g<p;){var v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0,k=void 0,T=r,C=n,A=void 0,M=void 0;switch(f){case"l":r+=d[g++],n+=d[g++],h=s.L,e.addData(h,r,n);break;case"L":r=d[g++],n=d[g++],h=s.L,e.addData(h,r,n);break;case"m":r+=d[g++],n+=d[g++],h=s.M,e.addData(h,r,n),a=r,i=n,f="l";break;case"M":r=d[g++],n=d[g++],h=s.M,e.addData(h,r,n),a=r,i=n,f="L";break;case"h":r+=d[g++],h=s.L,e.addData(h,r,n);break;case"H":r=d[g++],h=s.L,e.addData(h,r,n);break;case"v":n+=d[g++],h=s.L,e.addData(h,r,n);break;case"V":n=d[g++],h=s.L,e.addData(h,r,n);break;case"C":h=s.C,e.addData(h,d[g++],d[g++],d[g++],d[g++],d[g++],d[g++]),r=d[g-2],n=d[g-1];break;case"c":h=s.C,e.addData(h,d[g++]+r,d[g++]+n,d[g++]+r,d[g++]+n,d[g++]+r,d[g++]+n),r+=d[g-2],n+=d[g-1];break;case"S":v=r,y=n,A=e.len(),M=e.data,o===s.C&&(v+=r-M[A-4],y+=n-M[A-3]),h=s.C,T=d[g++],C=d[g++],r=d[g++],n=d[g++],e.addData(h,v,y,T,C,r,n);break;case"s":v=r,y=n,A=e.len(),M=e.data,o===s.C&&(v+=r-M[A-4],y+=n-M[A-3]),h=s.C,T=r+d[g++],C=n+d[g++],r+=d[g++],n+=d[g++],e.addData(h,v,y,T,C,r,n);break;case"Q":T=d[g++],C=d[g++],r=d[g++],n=d[g++],h=s.Q,e.addData(h,T,C,r,n);break;case"q":T=d[g++]+r,C=d[g++]+n,r+=d[g++],n+=d[g++],h=s.Q,e.addData(h,T,C,r,n);break;case"T":v=r,y=n,A=e.len(),M=e.data,o===s.Q&&(v+=r-M[A-4],y+=n-M[A-3]),r=d[g++],n=d[g++],h=s.Q,e.addData(h,v,y,r,n);break;case"t":v=r,y=n,A=e.len(),M=e.data,o===s.Q&&(v+=r-M[A-4],y+=n-M[A-3]),r+=d[g++],n+=d[g++],h=s.Q,e.addData(h,v,y,r,n);break;case"A":b=d[g++],x=d[g++],S=d[g++],w=d[g++],k=d[g++],T=r,C=n,r=d[g++],n=d[g++],h=s.A,Zg(T,C,r,n,w,k,b,x,S,h,e);break;case"a":b=d[g++],x=d[g++],S=d[g++],w=d[g++],k=d[g++],T=r,C=n,r+=d[g++],n+=d[g++],h=s.A,Zg(T,C,r,n,w,k,b,x,S,h,e);break}}(f==="z"||f==="Z")&&(h=s.Z,e.addData(h),r=a,n=i),o=h}return e.toStatic(),e}var Kg=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.applyTransform=function(r){},e})($e);function jg(t){return t.setData!=null}function Qg(t,e){var r=sT(t),n=U({},e);return n.buildPath=function(a){if(jg(a)){a.setData(r.data);var i=a.getContext();i&&a.rebuildPath(i,1)}else{var i=a;r.rebuildPath(i,1)}},n.applyTransform=function(a){aT(r,a),this.dirtyShape()},n}function lT(t,e){return new Kg(Qg(t,e))}function cT(t,e){var r=Qg(t,e),n=(function(a){Z(i,a);function i(o){var s=a.call(this,o)||this;return s.applyTransform=r.applyTransform,s.buildPath=r.buildPath,s}return i})(Kg);return n}function uT(t,e){for(var r=[],n=t.length,a=0;a<n;a++){var i=t[a];r.push(i.getUpdatedPathProxy(!0))}var o=new $e(e);return o.createPathProxy(),o.buildPath=function(s){if(jg(s)){s.appendPath(r);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var mt=(function(t){Z(e,t);function e(r){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var n=this._children,a=0;a<n.length;a++)if(n[a].name===r)return n[a]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(r){return r&&r!==this&&r.parent!==this&&(this._children.push(r),this._doAdd(r)),this},e.prototype.addBefore=function(r,n){if(r&&r!==this&&r.parent!==this&&n&&n.parent===this){var a=this._children,i=a.indexOf(n);i>=0&&(a.splice(i,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,n){var a=ze(this._children,r);return a>=0&&this.replaceAt(n,a),this},e.prototype.replaceAt=function(r,n){var a=this._children,i=a[n];if(r&&r!==this&&r.parent!==this&&r!==i){a[n]=r,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(r){var n=this.__zr,a=this._children,i=ze(a,r);return i<0?this:(a.splice(i,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,a=0;a<r.length;a++){var i=r[a];n&&i.removeSelfFromZr(n),i.parent=null}return r.length=0,this},e.prototype.eachChild=function(r,n){for(var a=this._children,i=0;i<a.length;i++){var o=a[i];r.call(n,o,i)}return this},e.prototype.traverse=function(r,n){for(var a=0;a<this._children.length;a++){var i=this._children[a],o=r.call(n,i);i.isGroup&&!o&&i.traverse(r,n)}return this},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var n=0;n<this._children.length;n++){var a=this._children[n];a.addSelfToZr(r)}},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var n=0;n<this._children.length;n++){var a=this._children[n];a.removeSelfFromZr(r)}},e.prototype.getBoundingRect=function(r){for(var n=new Fe(0,0,0,0),a=r||this._children,i=[],o=null,s=0;s<a.length;s++){var l=a[s];if(!(l.ignore||l.invisible)){var c=l.getBoundingRect(),u=l.getLocalTransform(i);u?(Fe.applyTransform(n,c,u),o=o||n.clone(),o.union(n)):(o=o||c.clone(),o.union(c))}}return o||n},e})(Zs);mt.prototype.type="group";var fT=(function(){function t(){this.cx=0,this.cy=0,this.r=0}return t})(),pl=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new fT},e.prototype.buildPath=function(r,n){r.moveTo(n.cx+n.r,n.cy),r.arc(n.cx,n.cy,n.r,0,Math.PI*2)},e})($e);pl.prototype.type="circle";var hT=(function(){function t(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return t})(),Cf=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new hT},e.prototype.buildPath=function(r,n){var a=.5522848,i=n.cx,o=n.cy,s=n.rx,l=n.ry,c=s*a,u=l*a;r.moveTo(i-s,o),r.bezierCurveTo(i-s,o-u,i-c,o-l,i,o-l),r.bezierCurveTo(i+c,o-l,i+s,o-u,i+s,o),r.bezierCurveTo(i+s,o+u,i+c,o+l,i,o+l),r.bezierCurveTo(i-c,o+l,i-s,o+u,i-s,o),r.closePath()},e})($e);Cf.prototype.type="ellipse";var Jg=Math.PI,Mf=Jg*2,la=Math.sin,ei=Math.cos,dT=Math.acos,bt=Math.atan2,em=Math.abs,uo=Math.sqrt,fo=Math.max,Or=Math.min,fr=1e-4;function pT(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,h=f*l-u*c;if(!(h*h<fr))return h=(u*(e-i)-f*(t-a))/h,[t+h*l,e+h*c]}function vl(t,e,r,n,a,i,o){var s=t-r,l=e-n,c=(o?i:-i)/uo(s*s+l*l),u=c*l,f=-c*s,h=t+u,d=e+f,p=r+u,m=n+f,g=(h+p)/2,v=(d+m)/2,y=p-h,b=m-d,x=y*y+b*b,S=a-i,w=h*m-p*d,k=(b<0?-1:1)*uo(fo(0,S*S*x-w*w)),T=(w*b-y*k)/x,C=(-w*y-b*k)/x,A=(w*b+y*k)/x,M=(-w*y+b*k)/x,I=T-g,L=C-v,P=A-g,N=M-v;return I*I+L*L>P*P+N*N&&(T=A,C=M),{cx:T,cy:C,x0:-u,y0:-f,x1:T*(a/S-1),y1:C*(a/S-1)}}function vT(t){var e;if(ee(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function gT(t,e){var r,n=fo(e.r,0),a=fo(e.r0||0,0),i=n>0,o=a>0;if(!(!i&&!o)){if(i||(n=a,a=0),a>n){var s=n;n=a,a=s}var l=e.startAngle,c=e.endAngle;if(!(isNaN(l)||isNaN(c))){var u=e.cx,f=e.cy,h=!!e.clockwise,d=em(c-l),p=d>Mf&&d%Mf;if(p>fr&&(d=p),!(n>fr))t.moveTo(u,f);else if(d>Mf-fr)t.moveTo(u+n*ei(l),f+n*la(l)),t.arc(u,f,n,l,c,!h),a>fr&&(t.moveTo(u+a*ei(c),f+a*la(c)),t.arc(u,f,a,c,l,h));else{var m=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0,k=void 0,T=void 0,C=void 0,A=void 0,M=void 0,I=void 0,L=void 0,P=void 0,N=n*ei(l),O=n*la(l),q=a*ei(c),R=a*la(c),z=d>fr;if(z){var F=e.cornerRadius;F&&(r=vT(F),m=r[0],g=r[1],v=r[2],y=r[3]);var X=em(n-a)/2;if(b=Or(X,v),x=Or(X,y),S=Or(X,m),w=Or(X,g),C=k=fo(b,x),A=T=fo(S,w),(k>fr||T>fr)&&(M=n*ei(c),I=n*la(c),L=a*ei(l),P=a*la(l),d<Jg)){var te=pT(N,O,L,P,M,I,q,R);if(te){var fe=N-te[0],me=O-te[1],we=M-te[0],Ze=I-te[1],Ie=1/la(dT((fe*we+me*Ze)/(uo(fe*fe+me*me)*uo(we*we+Ze*Ze)))/2),tt=uo(te[0]*te[0]+te[1]*te[1]);C=Or(k,(n-tt)/(Ie+1)),A=Or(T,(a-tt)/(Ie-1))}}}if(!z)t.moveTo(u+N,f+O);else if(C>fr){var Ge=Or(v,C),Me=Or(y,C),re=vl(L,P,N,O,n,Ge,h),he=vl(M,I,q,R,n,Me,h);t.moveTo(u+re.cx+re.x0,f+re.cy+re.y0),C<k&&Ge===Me?t.arc(u+re.cx,f+re.cy,C,bt(re.y0,re.x0),bt(he.y0,he.x0),!h):(Ge>0&&t.arc(u+re.cx,f+re.cy,Ge,bt(re.y0,re.x0),bt(re.y1,re.x1),!h),t.arc(u,f,n,bt(re.cy+re.y1,re.cx+re.x1),bt(he.cy+he.y1,he.cx+he.x1),!h),Me>0&&t.arc(u+he.cx,f+he.cy,Me,bt(he.y1,he.x1),bt(he.y0,he.x0),!h))}else t.moveTo(u+N,f+O),t.arc(u,f,n,l,c,!h);if(!(a>fr)||!z)t.lineTo(u+q,f+R);else if(A>fr){var Ge=Or(m,A),Me=Or(g,A),re=vl(q,R,M,I,a,-Me,h),he=vl(N,O,L,P,a,-Ge,h);t.lineTo(u+re.cx+re.x0,f+re.cy+re.y0),A<T&&Ge===Me?t.arc(u+re.cx,f+re.cy,A,bt(re.y0,re.x0),bt(he.y0,he.x0),!h):(Me>0&&t.arc(u+re.cx,f+re.cy,Me,bt(re.y0,re.x0),bt(re.y1,re.x1),!h),t.arc(u,f,a,bt(re.cy+re.y1,re.cx+re.x1),bt(he.cy+he.y1,he.cx+he.x1),h),Ge>0&&t.arc(u+he.cx,f+he.cy,Ge,bt(he.y1,he.x1),bt(he.y0,he.x0),!h))}else t.lineTo(u+q,f+R),t.arc(u,f,a,c,l,h)}t.closePath()}}}var mT=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t})(),ti=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new mT},e.prototype.buildPath=function(r,n){gT(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e})($e);ti.prototype.type="sector";var yT=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t})(),Af=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new yT},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.PI*2;r.moveTo(a+n.r,i),r.arc(a,i,n.r,0,o,!1),r.moveTo(a+n.r0,i),r.arc(a,i,n.r0,0,o,!0)},e})($e);Af.prototype.type="ring";function _T(t,e,r,n){var a=[],i=[],o=[],s=[],l,c,u,f;if(n){u=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=t.length;h<d;h++)$a(u,u,t[h]),Wa(f,f,t[h]);$a(u,u,n[0]),Wa(f,f,n[1])}for(var h=0,d=t.length;h<d;h++){var p=t[h];if(r)l=t[h?h-1:d-1],c=t[(h+1)%d];else if(h===0||h===d-1){a.push(iS(t[h]));continue}else l=t[h-1],c=t[h+1];oS(i,c,l),Du(i,i,e);var m=Iu(p,l),g=Iu(p,c),v=m+g;v!==0&&(m/=v,g/=v),Du(o,i,-m),Du(s,i,g);var y=Tv([],p,o),b=Tv([],p,s);n&&(Wa(y,y,u),$a(y,y,f),Wa(b,b,u),$a(b,b,f)),a.push(y),a.push(b)}return r&&a.push(a.shift()),a}function tm(t,e,r){var n=e.smooth,a=e.points;if(a&&a.length>=2){if(n){var i=_T(a,n,r,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var o=a.length,s=0;s<(r?o:o-1);s++){var l=i[s*2],c=i[s*2+1],u=a[(s+1)%o];t.bezierCurveTo(l[0],l[1],c[0],c[1],u[0],u[1])}}else{t.moveTo(a[0][0],a[0][1]);for(var s=1,f=a.length;s<f;s++)t.lineTo(a[s][0],a[s][1])}r&&t.closePath()}}var bT=(function(){function t(){this.points=null,this.smooth=0,this.smoothConstraint=null}return t})(),Df=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new bT},e.prototype.buildPath=function(r,n){tm(r,n,!0)},e})($e);Df.prototype.type="polygon";var xT=(function(){function t(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return t})(),If=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new xT},e.prototype.buildPath=function(r,n){tm(r,n,!1)},e})($e);If.prototype.type="polyline";var wT={},ST=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return t})(),xn=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ST},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=tg(wT,n,this.style);a=l.x1,i=l.y1,o=l.x2,s=l.y2}else a=n.x1,i=n.y1,o=n.x2,s=n.y2;var c=n.percent;c!==0&&(r.moveTo(a,i),c<1&&(o=a*(1-c)+o*c,s=i*(1-c)+s*c),r.lineTo(o,s))},e.prototype.pointAt=function(r){var n=this.shape;return[n.x1*(1-r)+n.x2*r,n.y1*(1-r)+n.y2*r]},e})($e);xn.prototype.type="line";var Ot=[],kT=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return t})();function rm(t,e,r){var n=t.cpx2,a=t.cpy2;return n!=null||a!=null?[(r?Lv:gt)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?Lv:gt)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?Rv:Lt)(t.x1,t.cpx1,t.x2,e),(r?Rv:Lt)(t.y1,t.cpy1,t.y2,e)]}var Lf=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new kT},e.prototype.buildPath=function(r,n){var a=n.x1,i=n.y1,o=n.x2,s=n.y2,l=n.cpx1,c=n.cpy1,u=n.cpx2,f=n.cpy2,h=n.percent;h!==0&&(r.moveTo(a,i),u==null||f==null?(h<1&&(Bs(a,l,o,h,Ot),l=Ot[1],o=Ot[2],Bs(i,c,s,h,Ot),c=Ot[1],s=Ot[2]),r.quadraticCurveTo(l,c,o,s)):(h<1&&(Ns(a,l,u,o,h,Ot),l=Ot[1],u=Ot[2],o=Ot[3],Ns(i,c,f,s,h,Ot),c=Ot[1],f=Ot[2],s=Ot[3]),r.bezierCurveTo(l,c,u,f,o,s)))},e.prototype.pointAt=function(r){return rm(this.shape,r,!1)},e.prototype.tangentAt=function(r){var n=rm(this.shape,r,!0);return cS(n,n)},e})($e);Lf.prototype.type="bezier-curve";var TT=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),gl=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new TT},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.max(n.r,0),s=n.startAngle,l=n.endAngle,c=n.clockwise,u=Math.cos(s),f=Math.sin(s);r.moveTo(u*o+a,f*o+i),r.arc(a,i,o,s,l,!c)},e})($e);gl.prototype.type="arc";var CT=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="compound",r}return e.prototype._updatePathDirty=function(){for(var r=this.shape.paths,n=this.shapeChanged(),a=0;a<r.length;a++)n=n||r[a].shapeChanged();n&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var r=this.shape.paths||[],n=this.getGlobalScale(),a=0;a<r.length;a++)r[a].path||r[a].createPathProxy(),r[a].path.setScale(n[0],n[1],r[a].segmentIgnoreThreshold)},e.prototype.buildPath=function(r,n){for(var a=n.paths||[],i=0;i<a.length;i++)a[i].buildPath(r,a[i].shape,!0)},e.prototype.afterBrush=function(){for(var r=this.shape.paths||[],n=0;n<r.length;n++)r[n].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),$e.prototype.getBoundingRect.call(this)},e})($e),nm=(function(){function t(e){this.colorStops=e||[]}return t.prototype.addColorStop=function(e,r){this.colorStops.push({offset:e,color:r})},t})(),am=(function(t){Z(e,t);function e(r,n,a,i,o,s){var l=t.call(this,o)||this;return l.x=r??0,l.y=n??0,l.x2=a??1,l.y2=i??0,l.type="linear",l.global=s||!1,l}return e})(nm),MT=(function(t){Z(e,t);function e(r,n,a,i,o){var s=t.call(this,i)||this;return s.x=r??.5,s.y=n??.5,s.r=a??.5,s.type="radial",s.global=o||!1,s}return e})(nm),ca=[0,0],ua=[0,0],ml=new Ye,yl=new Ye,_l=(function(){function t(e,r){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new Ye;for(var n=0;n<2;n++)this._axes[n]=new Ye;e&&this.fromBoundingRect(e,r)}return t.prototype.fromBoundingRect=function(e,r){var n=this._corners,a=this._axes,i=e.x,o=e.y,s=i+e.width,l=o+e.height;if(n[0].set(i,o),n[1].set(s,o),n[2].set(s,l),n[3].set(i,l),r)for(var c=0;c<4;c++)n[c].transform(r);Ye.sub(a[0],n[1],n[0]),Ye.sub(a[1],n[3],n[0]),a[0].normalize(),a[1].normalize();for(var c=0;c<2;c++)this._origin[c]=a[c].dot(n[0])},t.prototype.intersect=function(e,r){var n=!0,a=!r;return ml.set(1/0,1/0),yl.set(0,0),!this._intersectCheckOneSide(this,e,ml,yl,a,1)&&(n=!1,a)||!this._intersectCheckOneSide(e,this,ml,yl,a,-1)&&(n=!1,a)||a||Ye.copy(r,n?ml:yl),n},t.prototype._intersectCheckOneSide=function(e,r,n,a,i,o){for(var s=!0,l=0;l<2;l++){var c=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,ca),this._getProjMinMaxOnAxis(l,r._corners,ua),ca[1]<ua[0]||ca[0]>ua[1]){if(s=!1,i)return s;var u=Math.abs(ua[0]-ca[1]),f=Math.abs(ca[0]-ua[1]);Math.min(u,f)>a.len()&&(u<f?Ye.scale(a,c,-u*o):Ye.scale(a,c,f*o))}else if(n){var u=Math.abs(ua[0]-ca[1]),f=Math.abs(ca[0]-ua[1]);Math.min(u,f)<n.len()&&(u<f?Ye.scale(n,c,u*o):Ye.scale(n,c,-f*o))}}return s},t.prototype._getProjMinMaxOnAxis=function(e,r,n){for(var a=this._axes[e],i=this._origin,o=r[0].dot(a)+i[e],s=o,l=o,c=1;c<r.length;c++){var u=r[c].dot(a)+i[e];s=Math.min(u,s),l=Math.max(u,l)}n[0]=s,n[1]=l},t})(),AT=[],DT=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.notClear=!0,r.incremental=!0,r._displayables=[],r._temporaryDisplayables=[],r._cursor=0,r}return e.prototype.traverse=function(r,n){r.call(n,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(r,n){n?this._temporaryDisplayables.push(r):this._displayables.push(r),this.markRedraw()},e.prototype.addDisplayables=function(r,n){n=n||!1;for(var a=0;a<r.length;a++)this.addDisplayable(r[a],n)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(r){for(var n=this._cursor;n<this._displayables.length;n++)r&&r(this._displayables[n]);for(var n=0;n<this._temporaryDisplayables.length;n++)r&&r(this._temporaryDisplayables[n])},e.prototype.update=function(){this.updateTransform();for(var r=this._cursor;r<this._displayables.length;r++){var n=this._displayables[r];n.parent=this,n.update(),n.parent=null}for(var r=0;r<this._temporaryDisplayables.length;r++){var n=this._temporaryDisplayables[r];n.parent=this,n.update(),n.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var r=new Fe(1/0,1/0,-1/0,-1/0),n=0;n<this._displayables.length;n++){var a=this._displayables[n],i=a.getBoundingRect().clone();a.needLocalTransform()&&i.applyTransform(a.getLocalTransform(AT)),r.union(i)}this._rect=r}return this._rect},e.prototype.contain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect();if(i.contain(a[0],a[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(r,n))return!0}return!1},e})(eo),IT=it();function LT(t,e,r,n,a){var i;if(e&&e.ecModel){var o=e.ecModel.getUpdatePayload();i=o&&o.animation}var s=e&&e.isAnimationEnabled(),l=t==="update";if(s){var c=void 0,u=void 0,f=void 0;n?(c=Ce(n.duration,200),u=Ce(n.easing,"cubicOut"),f=0):(c=e.getShallow(l?"animationDurationUpdate":"animationDuration"),u=e.getShallow(l?"animationEasingUpdate":"animationEasing"),f=e.getShallow(l?"animationDelayUpdate":"animationDelay")),i&&(i.duration!=null&&(c=i.duration),i.easing!=null&&(u=i.easing),i.delay!=null&&(f=i.delay)),ye(f)&&(f=f(r,a)),ye(c)&&(c=c(r));var h={duration:c||0,delay:f,easing:u};return h}else return null}function Pf(t,e,r,n,a,i,o){var s=!1,l;ye(a)?(o=i,i=a,a=null):ce(a)&&(i=a.cb,o=a.during,s=a.isFrom,l=a.removeOpt,a=a.dataIndex);var c=t==="leave";c||e.stopAnimation("leave");var u=LT(t,n,a,c?l||{}:null,n&&n.getAnimationDelayParams?n.getAnimationDelayParams(e,a):null);if(u&&u.duration>0){var f=u.duration,h=u.delay,d=u.easing,p={duration:f,delay:h||0,easing:d,done:i,force:!!i||!!o,setToFinal:!c,scope:t,during:o};s?e.animateFrom(r,p):e.animateTo(r,p)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),i&&i()}function Ut(t,e,r,n,a,i){Pf("update",t,e,r,n,a,i)}function Qr(t,e,r,n,a,i){Pf("enter",t,e,r,n,a,i)}function ho(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){var r=t.animators[e];if(r.scope==="leave")return!0}return!1}function bl(t,e,r,n,a,i){ho(t)||Pf("leave",t,e,r,n,a,i)}function im(t,e,r,n){t.removeTextContent(),t.removeTextGuideLine(),bl(t,{style:{opacity:0}},e,r,n)}function Rf(t,e,r){function n(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(a){a.isGroup||im(a,e,r,n)}):im(t,e,r,n)}function om(t){IT(t).oldStyle=t.style}var xl=Math.max,wl=Math.min,Ef={};function PT(t){return $e.extend(t)}var RT=cT;function ET(t,e){return RT(t,e)}function hr(t,e){Ef[t]=e}function OT(t){if(Ef.hasOwnProperty(t))return Ef[t]}function Of(t,e,r,n){var a=lT(t,e);return r&&(n==="center"&&(r=lm(r,a.getBoundingRect())),cm(a,r)),a}function sm(t,e,r){var n=new bn({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(a){if(r==="center"){var i={width:a.width,height:a.height};n.setStyle(lm(e,i))}}});return n}function lm(t,e){var r=e.width/e.height,n=t.height*r,a;n<=t.width?a=t.height:(n=t.width,a=n/r);var i=t.x+t.width/2,o=t.y+t.height/2;return{x:i-n/2,y:o-a/2,width:n,height:a}}var NT=uT;function cm(t,e){if(t.applyTransform){var r=t.getBoundingRect(),n=r.calculateTransform(e);t.applyTransform(n)}}function po(t,e){return tg(t,t,{lineWidth:e}),t}function BT(t){return rg(t.shape,t.shape,t.style),t}var zT=aa;function FT(t,e){for(var r=xu([]);t&&t!==e;)Fa(r,t.getLocalTransform(),r),t=t.parent;return r}function Nf(t,e,r){return e&&!Dt(e)&&(e=Ru.getLocalTransform(e)),r&&(e=ku([],e)),jt([],t,e)}function HT(t,e,r){var n=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),a=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),i=[t==="left"?-n:t==="right"?n:0,t==="top"?-a:t==="bottom"?a:0];return i=Nf(i,e,r),Math.abs(i[0])>Math.abs(i[1])?i[0]>0?"right":"left":i[1]>0?"bottom":"top"}function um(t){return!t.isGroup}function VT(t){return t.shape!=null}function fm(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){um(l)&&l.anid&&(s[l.anid]=l)}),s}function a(o){var s={x:o.x,y:o.y,rotation:o.rotation};return VT(o)&&(s.shape=U({},o.shape)),s}var i=n(t);e.traverse(function(o){if(um(o)&&o.anid){var s=i[o.anid];if(s){var l=a(o);o.attr(a(s)),Ut(o,l,r,Ve(o).dataIndex)}}})}function GT(t,e){return ue(t,function(r){var n=r[0];n=xl(n,e.x),n=wl(n,e.x+e.width);var a=r[1];return a=xl(a,e.y),a=wl(a,e.y+e.height),[n,a]})}function $T(t,e){var r=xl(t.x,e.x),n=wl(t.x+t.width,e.x+e.width),a=xl(t.y,e.y),i=wl(t.y+t.height,e.y+e.height);if(n>=r&&i>=a)return{x:r,y:a,width:n-r,height:i-a}}function Bf(t,e,r){var n=U({rectHover:!0},e),a=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(a.image=t.slice(8),Ne(a,r),new bn(n)):Of(t.replace("path://",""),n,r,"center")}function WT(t,e,r,n,a){for(var i=0,o=a[a.length-1];i<a.length;i++){var s=a[i];if(hm(t,e,r,n,s[0],s[1],o[0],o[1]))return!0;o=s}}function hm(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,h=zf(u,f,l,c);if(UT(h))return!1;var d=t-a,p=e-i,m=zf(d,p,l,c)/h;if(m<0||m>1)return!1;var g=zf(d,p,u,f)/h;return!(g<0||g>1)}function zf(t,e,r,n){return t*n-r*e}function UT(t){return t<=1e-6&&t>=-1e-6}function Sl(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,a=ne(e)?{formatter:e}:e,i=r.mainType,o=r.componentIndex,s={componentType:i,name:n,$vars:["name"]};s[i+"Index"]=o;var l=t.formatterParamsExtra;l&&D(Qe(l),function(u){Vn(s,u)||(s[u]=l[u],s.$vars.push(u))});var c=Ve(t.el);c.componentMainType=i,c.componentIndex=o,c.tooltipConfig={name:n,option:Ne({content:n,encodeHTMLContent:!0,formatterParams:s},a)}}function dm(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function kl(t,e){if(t)if(ee(t))for(var r=0;r<t.length;r++)dm(t[r],e);else dm(t,e)}hr("circle",pl),hr("ellipse",Cf),hr("sector",ti),hr("ring",Af),hr("polygon",Df),hr("polyline",If),hr("rect",ft),hr("line",xn),hr("bezierCurve",Lf),hr("arc",gl);const YT=Object.freeze(Object.defineProperty({__proto__:null,Arc:gl,BezierCurve:Lf,BoundingRect:Fe,Circle:pl,CompoundPath:CT,Ellipse:Cf,Group:mt,Image:bn,IncrementalDisplayable:DT,Line:xn,LinearGradient:am,OrientedBoundingRect:_l,Path:$e,Point:Ye,Polygon:Df,Polyline:If,RadialGradient:MT,Rect:ft,Ring:Af,Sector:ti,Text:Pt,applyTransform:Nf,clipPointsByRect:GT,clipRectByRect:$T,createIcon:Bf,extendPath:ET,extendShape:PT,getShapeClass:OT,getTransform:FT,groupTransition:fm,initProps:Qr,isElementRemoved:ho,lineLineIntersect:hm,linePolygonIntersect:WT,makeImage:sm,makePath:Of,mergePath:NT,registerShape:hr,removeElement:bl,removeElementWithFadeOut:Rf,resizePath:cm,setTooltipConfig:Sl,subPixelOptimize:zT,subPixelOptimizeLine:po,subPixelOptimizeRect:BT,transformDirection:HT,traverseElements:kl,updateProps:Ut},Symbol.toStringTag,{value:"Module"}));var Tl={};function qT(t,e){for(var r=0;r<Er.length;r++){var n=Er[r],a=e[n],i=t.ensureState(n);i.style=i.style||{},i.style.text=a}var o=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(o,!0)}function pm(t,e,r){var n=t.labelFetcher,a=t.labelDataIndex,i=t.labelDimIndex,o=e.normal,s;n&&(s=n.getFormattedLabel(a,"normal",null,i,o&&o.get("formatter"),r!=null?{interpolatedValue:r}:null)),s==null&&(s=ye(t.defaultText)?t.defaultText(a,t,r):t.defaultText);for(var l={normal:s},c=0;c<Er.length;c++){var u=Er[c],f=e[u];l[u]=Ce(n?n.getFormattedLabel(a,u,null,i,f&&f.get("formatter")):null,s)}return l}function Cl(t,e,r,n){r=r||Tl;for(var a=t instanceof Pt,i=!1,o=0;o<Dg.length;o++){var s=e[Dg[o]];if(s&&s.getShallow("show")){i=!0;break}}var l=a?t:t.getTextContent();if(i){a||(l||(l=new Pt,t.setTextContent(l)),t.stateProxy&&(l.stateProxy=t.stateProxy));var c=pm(r,e),u=e.normal,f=!!u.getShallow("show"),h=ri(u,n&&n.normal,r,!1,!a);h.text=c.normal,a||t.setTextConfig(vm(u,r,!1));for(var o=0;o<Er.length;o++){var d=Er[o],s=e[d];if(s){var p=l.ensureState(d),m=!!Ce(s.getShallow("show"),f);if(m!==f&&(p.ignore=!m),p.style=ri(s,n&&n[d],r,!0,!a),p.style.text=c[d],!a){var g=t.ensureState(d);g.textConfig=vm(s,r,!0)}}}l.silent=!!u.getShallow("silent"),l.style.x!=null&&(h.x=l.style.x),l.style.y!=null&&(h.y=l.style.y),l.ignore=!f,l.useStyle(h),l.dirty(),r.enableTextSetter&&(Al(l).setLabelText=function(v){var y=pm(r,e,v);qT(l,y)})}else l&&(l.ignore=!0);t.dirty()}function Ml(t,e){e=e||"label";for(var r={normal:t.getModel(e)},n=0;n<Er.length;n++){var a=Er[n];r[a]=t.getModel([a,e])}return r}function ri(t,e,r,n,a){var i={};return XT(i,t,r,n,a),e&&U(i,e),i}function vm(t,e,r){e=e||{};var n={},a,i=t.getShallow("rotate"),o=Ce(t.getShallow("distance"),r?null:5),s=t.getShallow("offset");return a=t.getShallow("position")||(r?null:"inside"),a==="outside"&&(a=e.defaultOutsidePosition||"top"),a!=null&&(n.position=a),s!=null&&(n.offset=s),i!=null&&(i*=Math.PI/180,n.rotation=i),o!=null&&(n.distance=o),n.outsideFill=t.get("color")==="inherit"?e.inheritColor||null:"auto",n}function XT(t,e,r,n,a){r=r||Tl;var i=e.ecModel,o=i&&i.option.textStyle,s=ZT(e),l;if(s){l={};for(var c in s)if(s.hasOwnProperty(c)){var u=e.getModel(["rich",c]);_m(l[c]={},u,o,r,n,a,!1,!0)}}l&&(t.rich=l);var f=e.get("overflow");f&&(t.overflow=f);var h=e.get("minMargin");h!=null&&(t.margin=h),_m(t,e,o,r,n,a,!0,!1)}function ZT(t){for(var e;t&&t!==t.ecModel;){var r=(t.option||Tl).rich;if(r){e=e||{};for(var n=Qe(r),a=0;a<n.length;a++){var i=n[a];e[i]=1}}t=t.parentModel}return e}var gm=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],mm=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],ym=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function _m(t,e,r,n,a,i,o,s){r=!a&&r||Tl;var l=n&&n.inheritColor,c=e.getShallow("color"),u=e.getShallow("textBorderColor"),f=Ce(e.getShallow("opacity"),r.opacity);(c==="inherit"||c==="auto")&&(l?c=l:c=null),(u==="inherit"||u==="auto")&&(l?u=l:u=null),i||(c=c||r.color,u=u||r.textBorderColor),c!=null&&(t.fill=c),u!=null&&(t.stroke=u);var h=Ce(e.getShallow("textBorderWidth"),r.textBorderWidth);h!=null&&(t.lineWidth=h);var d=Ce(e.getShallow("textBorderType"),r.textBorderType);d!=null&&(t.lineDash=d);var p=Ce(e.getShallow("textBorderDashOffset"),r.textBorderDashOffset);p!=null&&(t.lineDashOffset=p),!a&&f==null&&!s&&(f=n&&n.defaultOpacity),f!=null&&(t.opacity=f),!a&&!i&&t.fill==null&&n.inheritColor&&(t.fill=n.inheritColor);for(var m=0;m<gm.length;m++){var g=gm[m],v=Ce(e.getShallow(g),r[g]);v!=null&&(t[g]=v)}for(var m=0;m<mm.length;m++){var g=mm[m],v=e.getShallow(g);v!=null&&(t[g]=v)}if(t.verticalAlign==null){var y=e.getShallow("baseline");y!=null&&(t.verticalAlign=y)}if(!o||!n.disableBox){for(var m=0;m<ym.length;m++){var g=ym[m],v=e.getShallow(g);v!=null&&(t[g]=v)}var b=e.getShallow("borderType");b!=null&&(t.borderDash=b),(t.backgroundColor==="auto"||t.backgroundColor==="inherit")&&l&&(t.backgroundColor=l),(t.borderColor==="auto"||t.borderColor==="inherit")&&l&&(t.borderColor=l)}}function KT(t,e){var r=e&&e.getModel("textStyle");return Mr([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))}var Al=it();function jT(t,e,r,n){if(t){var a=Al(t);a.prevValue=a.value,a.value=r;var i=e.normal;a.valueAnimation=i.get("valueAnimation"),a.valueAnimation&&(a.precision=i.get("precision"),a.defaultInterpolatedText=n,a.statesModels=e)}}var QT=["textStyle","color"],Ff=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Hf=new Pt,JT=(function(){function t(){}return t.prototype.getTextColor=function(e){var r=this.ecModel;return this.getShallow("color")||(!e&&r?r.get(QT):null)},t.prototype.getFont=function(){return KT({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(e){for(var r={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<Ff.length;n++)r[Ff[n]]=this.getShallow(Ff[n]);return Hf.useStyle(r),Hf.update(),Hf.getBoundingRect()},t})(),bm=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],e2=$i(bm),t2=(function(){function t(){}return t.prototype.getLineStyle=function(e){return e2(this,e)},t})(),xm=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],r2=$i(xm),n2=(function(){function t(){}return t.prototype.getItemStyle=function(e,r){return r2(this,e,r)},t})(),et=(function(){function t(e,r,n){this.parentModel=r,this.ecModel=n,this.option=e}return t.prototype.init=function(e,r,n){},t.prototype.mergeOption=function(e,r){De(this.option,e,!0)},t.prototype.get=function(e,r){return e==null?this.option:this._doGet(this.parsePath(e),!r&&this.parentModel)},t.prototype.getShallow=function(e,r){var n=this.option,a=n==null?n:n[e];if(a==null&&!r){var i=this.parentModel;i&&(a=i.getShallow(e))}return a},t.prototype.getModel=function(e,r){var n=e!=null,a=n?this.parsePath(e):null,i=n?this._doGet(a):this.option;return r=r||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(a)),new t(i,r,this.ecModel)},t.prototype.isEmpty=function(){return this.option==null},t.prototype.restoreData=function(){},t.prototype.clone=function(){var e=this.constructor;return new e(Te(this.option))},t.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},t.prototype.resolveParentPath=function(e){return e},t.prototype.isAnimationEnabled=function(){if(!ge.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(e,r){var n=this.option;if(!e)return n;for(var a=0;a<e.length&&!(e[a]&&(n=n&&typeof n=="object"?n[e[a]]:null,n==null));a++);return n==null&&r&&(n=r._doGet(this.resolveParentPath(e),r.parentModel)),n},t})();_u(et),Hw(et),Cr(et,t2),Cr(et,n2),Cr(et,Uw),Cr(et,JT);function vo(t){return t==null?0:t.length||1}function wm(t){return t}var a2=(function(){function t(e,r,n,a,i,o){this._old=e,this._new=r,this._oldKeyGetter=n||wm,this._newKeyGetter=a||wm,this.context=i,this._diffModeMultiple=o==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,n={},a=new Array(e.length),i=new Array(r.length);this._initIndexMap(e,null,a,"_oldKeyGetter"),this._initIndexMap(r,n,i,"_newKeyGetter");for(var o=0;o<e.length;o++){var s=a[o],l=n[s],c=vo(l);if(c>1){var u=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(u,o)}else c===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},a={},i=[],o=[];this._initIndexMap(e,n,i,"_oldKeyGetter"),this._initIndexMap(r,a,o,"_newKeyGetter");for(var s=0;s<i.length;s++){var l=i[s],c=n[l],u=a[l],f=vo(c),h=vo(u);if(f>1&&h===1)this._updateManyToOne&&this._updateManyToOne(u,c),a[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(u,c),a[l]=null;else if(f===1&&h===1)this._update&&this._update(u,c),a[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,c),a[l]=null;else if(f>1)for(var d=0;d<f;d++)this._remove&&this._remove(c[d]);else this._remove&&this._remove(c)}this._performRestAdd(o,a)},t.prototype._performRestAdd=function(e,r){for(var n=0;n<e.length;n++){var a=e[n],i=r[a],o=vo(i);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(i[s]);else o===1&&this._add&&this._add(i);r[a]=null}},t.prototype._initIndexMap=function(e,r,n,a){for(var i=this._diffModeMultiple,o=0;o<e.length;o++){var s="_ec_"+this[a](e[o],o);if(i||(n[o]=s),!!r){var l=r[s],c=vo(l);c===0?(r[s]=o,i&&n.push(s)):c===1?r[s]=[l,o]:l.push(o)}}},t})(),Sm=de(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),nr="original",Nt="arrayRows",Nr="objectRows",Jr="keyedColumns",wn="typedArray",km="unknown",en="column",ni="row",Yt={Must:1,Might:2,Not:3},Tm=it();function i2(t){Tm(t).datasetMap=de()}function o2(t,e,r){var n={},a=Cm(e);if(!a||!t)return n;var i=[],o=[],s=e.ecModel,l=Tm(s).datasetMap,c=a.uid+"_"+r.seriesLayoutBy,u,f;t=t.slice(),D(t,function(m,g){var v=ce(m)?m:t[g]={name:m};v.type==="ordinal"&&u==null&&(u=g,f=p(v)),n[v.name]=[]});var h=l.get(c)||l.set(c,{categoryWayDim:f,valueWayDim:0});D(t,function(m,g){var v=m.name,y=p(m);if(u==null){var b=h.valueWayDim;d(n[v],b,y),d(o,b,y),h.valueWayDim+=y}else if(u===g)d(n[v],0,y),d(i,0,y);else{var b=h.categoryWayDim;d(n[v],b,y),d(o,b,y),h.categoryWayDim+=y}});function d(m,g,v){for(var y=0;y<v;y++)m.push(g+y)}function p(m){var g=m.dimsDef;return g?g.length:1}return i.length&&(n.itemName=i),o.length&&(n.seriesName=o),n}function Cm(t){var e=t.get("data",!0);if(!e)return oo(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},Et).models[0]}function s2(t){return!t.get("transform",!0)&&!t.get("fromTransformResult",!0)?[]:oo(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},Et).models}function Mm(t,e){return l2(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function l2(t,e,r,n,a,i){var o,s=5;if(It(t))return Yt.Not;var l,c;if(n){var u=n[i];ce(u)?(l=u.name,c=u.type):ne(u)&&(l=u)}if(c!=null)return c==="ordinal"?Yt.Must:Yt.Not;if(e===Nt){var f=t;if(r===ni){for(var h=f[i],d=0;d<(h||[]).length&&d<s;d++)if((o=x(h[a+d]))!=null)return o}else for(var d=0;d<f.length&&d<s;d++){var p=f[a+d];if(p&&(o=x(p[i]))!=null)return o}}else if(e===Nr){var m=t;if(!l)return Yt.Not;for(var d=0;d<m.length&&d<s;d++){var g=m[d];if(g&&(o=x(g[l]))!=null)return o}}else if(e===Jr){var v=t;if(!l)return Yt.Not;var h=v[l];if(!h||It(h))return Yt.Not;for(var d=0;d<h.length&&d<s;d++)if((o=x(h[d]))!=null)return o}else if(e===nr)for(var y=t,d=0;d<y.length&&d<s;d++){var g=y[d],b=no(g);if(!ee(b))return Yt.Not;if((o=x(b[i]))!=null)return o}function x(S){var w=ne(S);if(S!=null&&Number.isFinite(Number(S))&&S!=="")return w?Yt.Might:Yt.Not;if(w&&S!=="-")return Yt.Must}return Yt.Not}var Dl=(function(){function t(e){this.data=e.data||(e.sourceFormat===Jr?{}:[]),this.sourceFormat=e.sourceFormat||km,this.seriesLayoutBy=e.seriesLayoutBy||en,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var n=0;n<r.length;n++){var a=r[n];a.type==null&&Mm(this,n)===Yt.Must&&(a.type="ordinal")}}return t})();function Vf(t){return t instanceof Dl}function Gf(t,e,r){r=r||Dm(t);var n=e.seriesLayoutBy,a=u2(t,r,n,e.sourceHeader,e.dimensions),i=new Dl({data:t,sourceFormat:r,seriesLayoutBy:n,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,metaRawOption:Te(e)});return i}function Am(t){return new Dl({data:t,sourceFormat:It(t)?wn:nr})}function c2(t){return new Dl({data:t.data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:Te(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})}function Dm(t){var e=km;if(It(t))e=wn;else if(ee(t)){t.length===0&&(e=Nt);for(var r=0,n=t.length;r<n;r++){var a=t[r];if(a!=null){if(ee(a)||It(a)){e=Nt;break}else if(ce(a)){e=Nr;break}}}}else if(ce(t)){for(var i in t)if(Vn(t,i)&&Dt(t[i])){e=Jr;break}}return e}function u2(t,e,r,n,a){var i,o;if(!t)return{dimensionsDefine:Im(a),startIndex:o,dimensionsDetectedCount:i};if(e===Nt){var s=t;n==="auto"||n==null?Lm(function(c){c!=null&&c!=="-"&&(ne(c)?o==null&&(o=1):o=0)},r,s,10):o=Ke(n)?n:n?1:0,!a&&o===1&&(a=[],Lm(function(c,u){a[u]=c!=null?c+"":""},r,s,1/0)),i=a?a.length:r===ni?s.length:s[0]?s[0].length:null}else if(e===Nr)a||(a=f2(t));else if(e===Jr)a||(a=[],D(t,function(c,u){a.push(u)}));else if(e===nr){var l=no(t[0]);i=ee(l)&&l.length||1}return{startIndex:o,dimensionsDefine:Im(a),dimensionsDetectedCount:i}}function f2(t){for(var e=0,r;e<t.length&&!(r=t[e++]););if(r)return Qe(r)}function Im(t){if(t){var e=de();return ue(t,function(r,n){r=ce(r)?r:{name:r};var a={name:r.name,displayName:r.displayName,type:r.type};if(a.name==null)return a;a.name+="",a.displayName==null&&(a.displayName=a.name);var i=e.get(a.name);return i?a.name+="-"+i.count++:e.set(a.name,{count:1}),a})}}function Lm(t,e,r,n){if(e===ni)for(var a=0;a<r.length&&a<n;a++)t(r[a]?r[a][0]:null,a);else for(var i=r[0]||[],a=0;a<i.length&&a<n;a++)t(i[a],a)}function Pm(t){var e=t.sourceFormat;return e===Nr||e===Jr}var fa,ha,da,Rm,Em,Om=(function(){function t(e,r){var n=Vf(e)?e:Am(e);this._source=n;var a=this._data=n.data;n.sourceFormat===wn&&(this._offset=0,this._dimSize=r,this._data=a),Em(this,a,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(e,r){},t.prototype.appendData=function(e){},t.prototype.clean=function(){},t.protoInitialize=(function(){var e=t.prototype;e.pure=!1,e.persistent=!0})(),t.internalField=(function(){var e;Em=function(o,s,l){var c=l.sourceFormat,u=l.seriesLayoutBy,f=l.startIndex,h=l.dimensionsDefine,d=Rm[Wf(c,u)];if(U(o,d),c===wn)o.getItem=r,o.count=a,o.fillStorage=n;else{var p=Bm(c,u);o.getItem=Le(p,null,s,f,h);var m=Fm(c,u);o.count=Le(m,null,s,f,h)}};var r=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,c=this._dimSize,u=c*o,f=0;f<c;f++)s[f]=l[u+f];return s},n=function(o,s,l,c){for(var u=this._data,f=this._dimSize,h=0;h<f;h++){for(var d=c[h],p=d[0]==null?1/0:d[0],m=d[1]==null?-1/0:d[1],g=s-o,v=l[h],y=0;y<g;y++){var b=u[y*f+h];v[o+y]=b,b<p&&(p=b),b>m&&(m=b)}d[0]=p,d[1]=m}},a=function(){return this._data?this._data.length/this._dimSize:0};Rm=(e={},e[Nt+"_"+en]={pure:!0,appendData:i},e[Nt+"_"+ni]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Nr]={pure:!0,appendData:i},e[Jr]={pure:!0,appendData:function(o){var s=this._data;D(o,function(l,c){for(var u=s[c]||(s[c]=[]),f=0;f<(l||[]).length;f++)u.push(l[f])})}},e[nr]={appendData:i},e[wn]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}})(),t})(),Nm=function(t,e,r,n){return t[n]},h2=(fa={},fa[Nt+"_"+en]=function(t,e,r,n){return t[n+e]},fa[Nt+"_"+ni]=function(t,e,r,n,a){n+=e;for(var i=a||[],o=t,s=0;s<o.length;s++){var l=o[s];i[s]=l?l[n]:null}return i},fa[Nr]=Nm,fa[Jr]=function(t,e,r,n,a){for(var i=a||[],o=0;o<r.length;o++){var s=r[o].name,l=t[s];i[o]=l?l[n]:null}return i},fa[nr]=Nm,fa);function Bm(t,e){var r=h2[Wf(t,e)];return r}var zm=function(t,e,r){return t.length},d2=(ha={},ha[Nt+"_"+en]=function(t,e,r){return Math.max(0,t.length-e)},ha[Nt+"_"+ni]=function(t,e,r){var n=t[0];return n?Math.max(0,n.length-e):0},ha[Nr]=zm,ha[Jr]=function(t,e,r){var n=r[0].name,a=t[n];return a?a.length:0},ha[nr]=zm,ha);function Fm(t,e){var r=d2[Wf(t,e)];return r}var $f=function(t,e,r){return t[e]},p2=(da={},da[Nt]=$f,da[Nr]=function(t,e,r){return t[r]},da[Jr]=$f,da[nr]=function(t,e,r){var n=no(t);return n instanceof Array?n[e]:n},da[wn]=$f,da);function Hm(t){var e=p2[t];return e}function Wf(t,e){return t===Nt?t+"_"+e:t}function ai(t,e,r){if(t){var n=t.getRawDataItem(e);if(n!=null){var a=t.getStore(),i=a.getSource().sourceFormat;if(r!=null){var o=t.getDimensionIndex(r),s=a.getDimensionProperty(o);return Hm(i)(n,o,s)}else{var l=n;return i===nr&&(l=no(n)),l}}}}var v2=(function(){function t(e,r){this._encode=e,this._schema=r}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t})();function g2(t,e){var r={},n=r.encode={},a=de(),i=[],o=[],s={};D(t.dimensions,function(h){var d=t.getDimensionInfo(h),p=d.coordDim;if(p){var m=d.coordDimIndex;Uf(n,p)[m]=h,d.isExtraCoord||(a.set(p,1),y2(d.type)&&(i[0]=h),Uf(s,p)[m]=t.getDimensionIndex(d.name)),d.defaultTooltip&&o.push(h)}Sm.each(function(g,v){var y=Uf(n,v),b=d.otherDims[v];b!=null&&b!==!1&&(y[b]=d.name)})});var l=[],c={};a.each(function(h,d){var p=n[d];c[d]=p[0],l=l.concat(p)}),r.dataDimsOnCoord=l,r.dataDimIndicesOnCoord=ue(l,function(h){return t.getDimensionInfo(h).storeDimIndex}),r.encodeFirstDimNotExtra=c;var u=n.label;u&&u.length&&(i=u.slice());var f=n.tooltip;return f&&f.length?o=f.slice():o.length||(o=i.slice()),n.defaultedLabel=i,n.defaultedTooltip=o,r.userOutput=new v2(s,e),r}function Uf(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function m2(t){return t==="category"?"ordinal":t==="time"?"time":"float"}function y2(t){return!(t==="ordinal"||t==="time")}var Il=(function(){function t(e){this.otherDims={},e!=null&&U(this,e)}return t})();function Ll(t,e){var r=e&&e.type;return r==="ordinal"?t:(r==="time"&&!Ke(t)&&t!=null&&t!=="-"&&(t=+Kr(t)),t==null||t===""?NaN:Number(t))}de({number:function(t){return parseFloat(t)},time:function(t){return+Kr(t)},trim:function(t){return ne(t)?Mr(t):t}});var _2=(function(){function t(e,r){var n=e==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var n=Ke(e)?e:nl(e),a=Ke(r)?r:nl(r),i=isNaN(n),o=isNaN(a);if(i&&(n=this._incomparable),o&&(a=this._incomparable),i&&o){var s=ne(e),l=ne(r);s&&(n=l?e:0),l&&(a=s?r:0)}return n<a?this._resultLT:n>a?-this._resultLT:0},t})(),Pl="undefined",b2=typeof Uint32Array===Pl?Array:Uint32Array,x2=typeof Uint16Array===Pl?Array:Uint16Array,Vm=typeof Int32Array===Pl?Array:Int32Array,Gm=typeof Float64Array===Pl?Array:Float64Array,$m={float:Gm,int:Vm,ordinal:Array,number:Array,time:Gm},Yf;function ii(t){return t>65535?b2:x2}function oi(){return[1/0,-1/0]}function w2(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Wm(t,e,r,n,a){var i=$m[r||"float"];if(a){var o=t[e],s=o&&o.length;if(s!==n){for(var l=new i(n),c=0;c<s;c++)l[c]=o[c];t[e]=l}}else t[e]=new i(n)}var qf=(function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=de()}return t.prototype.initData=function(e,r,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var a=e.getSource(),i=this.defaultDimValueGetter=Yf[a.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[],Pm(a),this._dimensions=ue(r,function(o){return{type:o.type,property:o.property}}),this._initDataFromProvider(0,e.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(e,r){var n=this._calcDimNameToIdx,a=this._dimensions,i=n.get(e);if(i!=null){if(a[i].type===r)return i}else i=a.length;return a[i]={type:r},n.set(e,i),this._chunks[i]=new $m[r||"float"](this._rawCount),this._rawExtent[i]=oi(),i},t.prototype.collectOrdinalMeta=function(e,r){var n=this._chunks[e],a=this._dimensions[e],i=this._rawExtent,o=a.ordinalOffset||0,s=n.length;o===0&&(i[e]=oi());for(var l=i[e],c=o;c<s;c++){var u=n[c]=r.parseAndCollect(n[c]);isNaN(u)||(l[0]=Math.min(u,l[0]),l[1]=Math.max(u,l[1]))}a.ordinalMeta=r,a.ordinalOffset=s,a.type="ordinal"},t.prototype.getOrdinalMeta=function(e){var r=this._dimensions[e],n=r.ordinalMeta;return n},t.prototype.getDimensionProperty=function(e){var r=this._dimensions[e];return r&&r.property},t.prototype.appendData=function(e){var r=this._provider,n=this.count();r.appendData(e);var a=r.count();return r.persistent||(a+=n),n<a&&this._initDataFromProvider(n,a,!0),[n,a]},t.prototype.appendValues=function(e,r){for(var n=this._chunks,a=this._dimensions,i=a.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,r||0),c=0;c<i;c++){var u=a[c];Wm(n,c,u.type,l,!0)}for(var f=[],h=s;h<l;h++)for(var d=h-s,p=0;p<i;p++){var u=a[p],m=Yf.arrayRows.call(this,e[d]||f,u.property,d,p);n[p][h]=m;var g=o[p];m<g[0]&&(g[0]=m),m>g[1]&&(g[1]=m)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var a=this._provider,i=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,c=ue(o,function(y){return y.property}),u=0;u<s;u++){var f=o[u];l[u]||(l[u]=oi()),Wm(i,u,f.type,r,n)}if(a.fillStorage)a.fillStorage(e,r,i,l);else for(var h=[],d=e;d<r;d++){h=a.getItem(d,h);for(var p=0;p<s;p++){var m=i[p],g=this._dimValueGetter(h,c[p],d,p);m[d]=g;var v=l[p];g<v[0]&&(v[0]=g),g>v[1]&&(v[1]=g)}}!a.persistent&&a.clean&&a.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(r)]:NaN},t.prototype.getValues=function(e,r){var n=[],a=[];if(r==null){r=e,e=[];for(var i=0;i<this._dimensions.length;i++)a.push(i)}else a=e;for(var i=0,o=a.length;i<o;i++)n.push(this.get(a[i],r));return n},t.prototype.getByRawIndex=function(e,r){if(!(r>=0&&r<this._rawCount))return NaN;var n=this._chunks[e];return n?n[r]:NaN},t.prototype.getSum=function(e){var r=this._chunks[e],n=0;if(r)for(var a=0,i=this.count();a<i;a++){var o=this.get(e,a);isNaN(o)||(n+=o)}return n},t.prototype.getMedian=function(e){var r=[];this.each([e],function(i){isNaN(i)||r.push(i)});var n=r.sort(function(i,o){return i-o}),a=this.count();return a===0?0:a%2===1?n[(a-1)/2]:(n[a/2]+n[a/2-1])/2},t.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,n=r[e];if(n!=null&&n<this._count&&n===e)return e;for(var a=0,i=this._count-1;a<=i;){var o=(a+i)/2|0;if(r[o]<e)a=o+1;else if(r[o]>e)i=o-1;else return o}return-1},t.prototype.indicesOfNearest=function(e,r,n){var a=this._chunks,i=a[e],o=[];if(!i)return o;n==null&&(n=1/0);for(var s=1/0,l=-1,c=0,u=0,f=this.count();u<f;u++){var h=this.getRawIndex(u),d=r-i[h],p=Math.abs(d);p<=n&&((p<s||p===s&&d>=0&&l<0)&&(s=p,l=d,c=0),d===l&&(o[c++]=u))}return o.length=c,o},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var n=r.constructor,a=this._count;if(n===Array){e=new n(a);for(var i=0;i<a;i++)e[i]=r[i]}else e=new n(r.buffer,0,a)}else{var n=ii(this._rawCount);e=new n(this.count());for(var i=0;i<e.length;i++)e[i]=i}return e},t.prototype.filter=function(e,r){if(!this._count)return this;for(var n=this.clone(),a=n.count(),i=ii(n._rawCount),o=new i(a),s=[],l=e.length,c=0,u=e[0],f=n._chunks,h=0;h<a;h++){var d=void 0,p=n.getRawIndex(h);if(l===0)d=r(h);else if(l===1){var m=f[u][p];d=r(m,h)}else{for(var g=0;g<l;g++)s[g]=f[e[g]][p];s[g]=h,d=r.apply(null,s)}d&&(o[c++]=p)}return c<a&&(n._indices=o),n._count=c,n._extent=[],n._updateGetRawIdx(),n},t.prototype.selectRange=function(e){var r=this.clone(),n=r._count;if(!n)return this;var a=Qe(e),i=a.length;if(!i)return this;var o=r.count(),s=ii(r._rawCount),l=new s(o),c=0,u=a[0],f=e[u][0],h=e[u][1],d=r._chunks,p=!1;if(!r._indices){var m=0;if(i===1){for(var g=d[a[0]],v=0;v<n;v++){var y=g[v];(y>=f&&y<=h||isNaN(y))&&(l[c++]=m),m++}p=!0}else if(i===2){for(var g=d[a[0]],b=d[a[1]],x=e[a[1]][0],S=e[a[1]][1],v=0;v<n;v++){var y=g[v],w=b[v];(y>=f&&y<=h||isNaN(y))&&(w>=x&&w<=S||isNaN(w))&&(l[c++]=m),m++}p=!0}}if(!p)if(i===1)for(var v=0;v<o;v++){var k=r.getRawIndex(v),y=d[a[0]][k];(y>=f&&y<=h||isNaN(y))&&(l[c++]=k)}else for(var v=0;v<o;v++){for(var T=!0,k=r.getRawIndex(v),C=0;C<i;C++){var A=a[C],y=d[A][k];(y<e[A][0]||y>e[A][1])&&(T=!1)}T&&(l[c++]=r.getRawIndex(v))}return c<o&&(r._indices=l),r._count=c,r._extent=[],r._updateGetRawIdx(),r},t.prototype.map=function(e,r){var n=this.clone(e);return this._updateDims(n,e,r),n},t.prototype.modify=function(e,r){this._updateDims(this,e,r)},t.prototype._updateDims=function(e,r,n){for(var a=e._chunks,i=[],o=r.length,s=e.count(),l=[],c=e._rawExtent,u=0;u<r.length;u++)c[r[u]]=oi();for(var f=0;f<s;f++){for(var h=e.getRawIndex(f),d=0;d<o;d++)l[d]=a[r[d]][h];l[o]=f;var p=n&&n.apply(null,l);if(p!=null){typeof p!="object"&&(i[0]=p,p=i);for(var u=0;u<p.length;u++){var m=r[u],g=p[u],v=c[m],y=a[m];y&&(y[h]=g),g<v[0]&&(v[0]=g),g>v[1]&&(v[1]=g)}}}},t.prototype.lttbDownSample=function(e,r){var n=this.clone([e],!0),a=n._chunks,i=a[e],o=this.count(),s=0,l=Math.floor(1/r),c=this.getRawIndex(0),u,f,h,d=new(ii(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=c;for(var p=1;p<o-1;p+=l){for(var m=Math.min(p+l,o-1),g=Math.min(p+l*2,o),v=(g+m)/2,y=0,b=m;b<g;b++){var x=this.getRawIndex(b),S=i[x];isNaN(S)||(y+=S)}y/=g-m;var w=p,k=Math.min(p+l,o),T=p-1,C=i[c];u=-1,h=w;for(var A=-1,M=0,b=w;b<k;b++){var x=this.getRawIndex(b),S=i[x];if(isNaN(S)){M++,A<0&&(A=x);continue}f=Math.abs((T-v)*(S-C)-(T-b)*(y-C)),f>u&&(u=f,h=x)}M>0&&M<k-w&&(d[s++]=Math.min(A,h),h=Math.max(A,h)),d[s++]=h,c=h}return d[s++]=this.getRawIndex(o-1),n._count=s,n._indices=d,n.getRawIndex=this._getRawIdx,n},t.prototype.minmaxDownSample=function(e,r){for(var n=this.clone([e],!0),a=n._chunks,i=Math.floor(1/r),o=a[e],s=this.count(),l=new(ii(this._rawCount))(Math.ceil(s/i)*2),c=0,u=0;u<s;u+=i){var f=u,h=o[this.getRawIndex(f)],d=u,p=o[this.getRawIndex(d)],m=i;u+i>s&&(m=s-u);for(var g=0;g<m;g++){var v=this.getRawIndex(u+g),y=o[v];y<h&&(h=y,f=u+g),y>p&&(p=y,d=u+g)}var b=this.getRawIndex(f),x=this.getRawIndex(d);f<d?(l[c++]=b,l[c++]=x):(l[c++]=x,l[c++]=b)}return n._count=c,n._indices=l,n._updateGetRawIdx(),n},t.prototype.downSample=function(e,r,n,a){for(var i=this.clone([e],!0),o=i._chunks,s=[],l=Math.floor(1/r),c=o[e],u=this.count(),f=i._rawExtent[e]=oi(),h=new(ii(this._rawCount))(Math.ceil(u/l)),d=0,p=0;p<u;p+=l){l>u-p&&(l=u-p,s.length=l);for(var m=0;m<l;m++){var g=this.getRawIndex(p+m);s[m]=c[g]}var v=n(s),y=this.getRawIndex(Math.min(p+a(s,v)||0,u-1));c[y]=v,v<f[0]&&(f[0]=v),v>f[1]&&(f[1]=v),h[d++]=y}return i._count=d,i._indices=h,i._updateGetRawIdx(),i},t.prototype.each=function(e,r){if(this._count)for(var n=e.length,a=this._chunks,i=0,o=this.count();i<o;i++){var s=this.getRawIndex(i);switch(n){case 0:r(i);break;case 1:r(a[e[0]][s],i);break;case 2:r(a[e[0]][s],a[e[1]][s],i);break;default:for(var l=0,c=[];l<n;l++)c[l]=a[e[l]][s];c[l]=i,r.apply(null,c)}}},t.prototype.getDataExtent=function(e){var r=this._chunks[e],n=oi();if(!r)return n;var a=this.count(),i=!this._indices,o;if(i)return this._rawExtent[e].slice();if(o=this._extent[e],o)return o.slice();o=n;for(var s=o[0],l=o[1],c=0;c<a;c++){var u=this.getRawIndex(c),f=r[u];f<s&&(s=f),f>l&&(l=f)}return o=[s,l],this._extent[e]=o,o},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],a=this._chunks,i=0;i<a.length;i++)n.push(a[i][r]);return n},t.prototype.clone=function(e,r){var n=new t,a=this._chunks,i=e&&Ba(e,function(s,l){return s[l]=!0,s},{});if(i)for(var o=0;o<a.length;o++)n._chunks[o]=i[o]?w2(a[o]):a[o];else n._chunks=a;return this._copyCommonProps(n),r||(n._indices=this._cloneIndices()),n._updateGetRawIdx(),n},t.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=Te(this._extent),e._rawExtent=Te(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,r=void 0;if(e===Array){var n=this._indices.length;r=new e(n);for(var a=0;a<n;a++)r[a]=this._indices[a]}else r=new e(this._indices);return r}return null},t.prototype._getRawIdxIdentity=function(e){return e},t.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=(function(){function e(r,n,a,i){return Ll(r[i],this._dimensions[i])}Yf={arrayRows:e,objectRows:function(r,n,a,i){return Ll(r[n],this._dimensions[i])},keyedColumns:e,original:function(r,n,a,i){var o=r&&(r.value==null?r:r.value);return Ll(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(r,n,a,i){return r[i]}}})(),t})(),S2=it(),k2={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},Um=(function(){function t(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=Xm(this.source)))},t.prototype.getSourceDimensionIndex=function(e){return Ce(this._dimNameMap.get(e),-1)},t.prototype.getSourceDimension=function(e){var r=this.source.dimensionsDefine;if(r)return r[e]},t.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,r=Pm(this.source),n=!Zm(e),a="",i=[],o=0,s=0;o<e;o++){var l=void 0,c=void 0,u=void 0,f=this.dimensions[s];if(f&&f.storeDimIndex===o)l=r?f.name:null,c=f.type,u=f.ordinalMeta,s++;else{var h=this.getSourceDimension(o);h&&(l=r?h.name:null,c=h.type)}i.push({property:l,type:c,ordinalMeta:u}),r&&l!=null&&(!f||!f.isCalculationCoord)&&(a+=n?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),a+="$",a+=k2[c]||"f",u&&(a+=u.uid),a+="$"}var d=this.source,p=[d.seriesLayoutBy,d.startIndex,a].join("$$");return{dimensions:i,hash:p}},t.prototype.makeOutputDimensionNames=function(){for(var e=[],r=0,n=0;r<this._fullDimCount;r++){var a=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===r)i.isCalculationCoord||(a=i.name),n++;else{var o=this.getSourceDimension(r);o&&(a=o.name)}e.push(a)}return e},t.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t})();function Ym(t){return t instanceof Um}function qm(t){for(var e=de(),r=0;r<(t||[]).length;r++){var n=t[r],a=ce(n)?n.name:n;a!=null&&e.get(a)==null&&e.set(a,r)}return e}function Xm(t){var e=S2(t);return e.dimNameMap||(e.dimNameMap=qm(t.dimensionsDefine))}function Zm(t){return t>30}var go=ce,Sn=ue,T2=typeof Int32Array>"u"?Array:Int32Array,C2="e\0\0",Km=-1,M2=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],A2=["_approximateExtent"],jm,Rl,mo,yo,Xf,_o,Zf,D2=(function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,a=!1;Ym(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(a=!0,n=e),n=n||["x","y"];for(var i={},o=[],s={},l=!1,c={},u=0;u<n.length;u++){var f=n[u],h=ne(f)?new Il({name:f}):f instanceof Il?f:new Il(f),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),i[d]=h,c[d]!=null&&(l=!0),h.createInvertedIndices&&(s[d]=[]),p.itemName===0&&(this._nameDimIdx=u),p.itemId===0&&(this._idDimIdx=u),a&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(l),this.hostModel=r,this._invertedIndicesMap=s,this._dimOmitted){var m=this._dimIdxToName=de();D(o,function(g){m.set(i[g].storeDimIndex,g)})}}return t.prototype.getDimension=function(e){var r=this._recognizeDimIndex(e);if(r==null)return e;if(r=e,!this._dimOmitted)return this.dimensions[r];var n=this._dimIdxToName.get(r);if(n!=null)return n;var a=this._schema.getSourceDimension(r);if(a)return a.name},t.prototype.getDimensionIndex=function(e){var r=this._recognizeDimIndex(e);if(r!=null)return r;if(e==null)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},t.prototype._recognizeDimIndex=function(e){if(Ke(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},t.prototype._getStoreDimIndex=function(e){var r=this.getDimensionIndex(e);return r},t.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},t.prototype._initGetDimensionInfo=function(e){var r=this._dimInfos;this._getDimInfo=e?function(n){return r.hasOwnProperty(n)?r[n]:void 0}:function(n){return r[n]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(e,r){var n=this._dimSummary;if(r==null)return n.encodeFirstDimNotExtra[e];var a=n.encode[e];return a?a[r]:null},t.prototype.mapDimensionsAll=function(e){var r=this._dimSummary,n=r.encode[e];return(n||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(e,r,n){var a=this,i;if(e instanceof qf&&(i=e),!i){var o=this.dimensions,s=Vf(e)||Dt(e)?new Om(e,o.length):e;i=new qf;var l=Sn(o,function(c){return{type:a._dimInfos[c].type,property:c}});i.initData(s,l,n)}this._store=i,this._nameList=(r||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=g2(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(e){var r=this._store.appendData(e);this._doInit(r[0],r[1])},t.prototype.appendValues=function(e,r){var n=this._store.appendValues(e,r&&r.length),a=n.start,i=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),r)for(var s=a;s<i;s++){var l=s-a;this._nameList[s]=r[l],o&&Zf(this,s)}},t.prototype._updateOrdinalMeta=function(){for(var e=this._store,r=this.dimensions,n=0;n<r.length;n++){var a=this._dimInfos[r[n]];a.ordinalMeta&&e.collectOrdinalMeta(a.storeDimIndex,a.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==wn&&!e.fillStorage},t.prototype._doInit=function(e,r){if(!(e>=r)){var n=this._store,a=n.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList,s=a.getSource().sourceFormat,l=s===nr;if(l&&!a.pure)for(var c=[],u=e;u<r;u++){var f=a.getItem(u,c);if(!this.hasItemOption&&bk(f)&&(this.hasItemOption=!0),f){var h=f.name;i[u]==null&&h!=null&&(i[u]=Rr(h,null));var d=f.id;o[u]==null&&d!=null&&(o[u]=Rr(d,null))}}if(this._shouldMakeIdFromName())for(var u=e;u<r;u++)Zf(this,u);jm(this)}},t.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.setApproximateExtent=function(e,r){r=this.getDimension(r),this._approximateExtent[r]=e.slice()},t.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},t.prototype.setCalculationInfo=function(e,r){go(e)?U(this._calculationInfo,e):this._calculationInfo[e]=r},t.prototype.getName=function(e){var r=this.getRawIndex(e),n=this._nameList[r];return n==null&&this._nameDimIdx!=null&&(n=mo(this,this._nameDimIdx,r)),n==null&&(n=""),n},t.prototype._getCategory=function(e,r){var n=this._store.get(e,r),a=this._store.getOrdinalMeta(e);return a?a.categories[n]:n},t.prototype.getId=function(e){return Rl(this,this.getRawIndex(e))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(e,r){var n=this._store,a=this._dimInfos[e];if(a)return n.get(a.storeDimIndex,r)},t.prototype.getByRawIndex=function(e,r){var n=this._store,a=this._dimInfos[e];if(a)return n.getByRawIndex(a.storeDimIndex,r)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},t.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},t.prototype.getValues=function(e,r){var n=this,a=this._store;return ee(e)?a.getValues(Sn(e,function(i){return n._getStoreDimIndex(i)}),r):a.getValues(e)},t.prototype.hasValue=function(e){for(var r=this._dimSummary.dataDimIndicesOnCoord,n=0,a=r.length;n<a;n++)if(isNaN(this._store.get(r[n],e)))return!1;return!0},t.prototype.indexOfName=function(e){for(var r=0,n=this._store.count();r<n;r++)if(this.getName(r)===e)return r;return-1},t.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},t.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},t.prototype.rawIndexOf=function(e,r){var n=e&&this._invertedIndicesMap[e],a=n&&n[r];return a==null||isNaN(a)?Km:a},t.prototype.indicesOfNearest=function(e,r,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),r,n)},t.prototype.each=function(e,r,n){ye(e)&&(n=r,r=e,e=[]);var a=n||this,i=Sn(yo(e),this._getStoreDimIndex,this);this._store.each(i,a?Le(r,a):r)},t.prototype.filterSelf=function(e,r,n){ye(e)&&(n=r,r=e,e=[]);var a=n||this,i=Sn(yo(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,a?Le(r,a):r),this},t.prototype.selectRange=function(e){var r=this,n={},a=Qe(e);return D(a,function(i){var o=r._getStoreDimIndex(i);n[o]=e[i]}),this._store=this._store.selectRange(n),this},t.prototype.mapArray=function(e,r,n){ye(e)&&(n=r,r=e,e=[]),n=n||this;var a=[];return this.each(e,function(){a.push(r&&r.apply(this,arguments))},n),a},t.prototype.map=function(e,r,n,a){var i=n||a||this,o=Sn(yo(e),this._getStoreDimIndex,this),s=_o(this);return s._store=this._store.map(o,i?Le(r,i):r),s},t.prototype.modify=function(e,r,n,a){var i=n||a||this,o=Sn(yo(e),this._getStoreDimIndex,this);this._store.modify(o,i?Le(r,i):r)},t.prototype.downSample=function(e,r,n,a){var i=_o(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),r,n,a),i},t.prototype.minmaxDownSample=function(e,r){var n=_o(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),r),n},t.prototype.lttbDownSample=function(e,r){var n=_o(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),r),n},t.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},t.prototype.getItemModel=function(e){var r=this.hostModel,n=this.getRawDataItem(e);return new et(n,r,r&&r.ecModel)},t.prototype.diff=function(e){var r=this;return new a2(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(n){return Rl(e,n)},function(n){return Rl(r,n)})},t.prototype.getVisual=function(e){var r=this._visual;return r&&r[e]},t.prototype.setVisual=function(e,r){this._visual=this._visual||{},go(e)?U(this._visual,e):this._visual[e]=r},t.prototype.getItemVisual=function(e,r){var n=this._itemVisuals[e],a=n&&n[r];return a??this.getVisual(r)},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(e,r){var n=this._itemVisuals,a=n[e];a||(a=n[e]={});var i=a[r];return i==null&&(i=this.getVisual(r),ee(i)?i=i.slice():go(i)&&(i=U({},i)),a[r]=i),i},t.prototype.setItemVisual=function(e,r,n){var a=this._itemVisuals[e]||{};this._itemVisuals[e]=a,go(r)?U(a,r):a[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){go(e)?U(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,n){this._itemLayouts[e]=n?U(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var n=this.hostModel&&this.hostModel.seriesIndex;Ok(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){D(this._graphicEls,function(n,a){n&&e&&e.call(r,n,a)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:Sn(this.dimensions,this._getDimInfo,this),this.hostModel)),Xf(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var n=this[e];ye(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var a=n.apply(this,arguments);return r.apply(this,[a].concat(mu(arguments)))})},t.internalField=(function(){jm=function(e){var r=e._invertedIndicesMap;D(r,function(n,a){var i=e._dimInfos[a],o=i.ordinalMeta,s=e._store;if(o){n=r[a]=new T2(o.categories.length);for(var l=0;l<n.length;l++)n[l]=Km;for(var l=0;l<s.count();l++)n[s.get(i.storeDimIndex,l)]=l}})},mo=function(e,r,n){return Rr(e._getCategory(r,n),null)},Rl=function(e,r){var n=e._idList[r];return n==null&&e._idDimIdx!=null&&(n=mo(e,e._idDimIdx,r)),n==null&&(n=C2+r),n},yo=function(e){return ee(e)||(e=e!=null?[e]:[]),e},_o=function(e){var r=new t(e._schema?e._schema:Sn(e.dimensions,e._getDimInfo,e),e.hostModel);return Xf(r,e),r},Xf=function(e,r){D(M2.concat(r.__wrappedMethods||[]),function(n){r.hasOwnProperty(n)&&(e[n]=r[n])}),e.__wrappedMethods=r.__wrappedMethods,D(A2,function(n){e[n]=Te(r[n])}),e._calculationInfo=U({},r._calculationInfo)},Zf=function(e,r){var n=e._nameList,a=e._idList,i=e._nameDimIdx,o=e._idDimIdx,s=n[r],l=a[r];if(s==null&&i!=null&&(n[r]=s=mo(e,i,r)),l==null&&o!=null&&(a[r]=l=mo(e,o,r)),l==null&&s!=null){var c=e._nameRepeatCount,u=c[s]=(c[s]||0)+1;l=s,u>1&&(l+="__ec__"+u),a[r]=l}}})(),t})();function I2(t,e){Vf(t)||(t=Am(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],a=de(),i=[],o=P2(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&Zm(o),l=n===t.dimensionsDefine,c=l?Xm(t):qm(n),u=e.encodeDefine;!u&&e.encodeDefaulter&&(u=e.encodeDefaulter(t,o));for(var f=de(u),h=new Vm(o),d=0;d<h.length;d++)h[d]=-1;function p(C){var A=h[C];if(A<0){var M=n[C],I=ce(M)?M:{name:M},L=new Il,P=I.name;P!=null&&c.get(P)!=null&&(L.name=L.displayName=P),I.type!=null&&(L.type=I.type),I.displayName!=null&&(L.displayName=I.displayName);var N=i.length;return h[C]=N,L.storeDimIndex=C,i.push(L),L}return i[A]}if(!s)for(var d=0;d<o;d++)p(d);f.each(function(C,A){var M=_t(C).slice();if(M.length===1&&!ne(M[0])&&M[0]<0){f.set(A,!1);return}var I=f.set(A,[]);D(M,function(L,P){var N=ne(L)?c.get(L):L;N!=null&&N<o&&(I[P]=N,g(p(N),A,P))})});var m=0;D(r,function(C){var A,M,I,L;if(ne(C))A=C,L={};else{L=C,A=L.name;var P=L.ordinalMeta;L.ordinalMeta=null,L=U({},L),L.ordinalMeta=P,M=L.dimsDef,I=L.otherDims,L.name=L.coordDim=L.coordDimIndex=L.dimsDef=L.otherDims=null}var N=f.get(A);if(N!==!1){if(N=_t(N),!N.length)for(var O=0;O<(M&&M.length||1);O++){for(;m<o&&p(m).coordDim!=null;)m++;m<o&&N.push(m++)}D(N,function(q,R){var z=p(q);if(l&&L.type!=null&&(z.type=L.type),g(Ne(z,L),A,R),z.name==null&&M){var F=M[R];!ce(F)&&(F={name:F}),z.name=z.displayName=F.name,z.defaultTooltip=F.defaultTooltip}I&&Ne(z.otherDims,I)})}});function g(C,A,M){Sm.get(A)!=null?C.otherDims[A]=M:(C.coordDim=A,C.coordDimIndex=M,a.set(A,!0))}var v=e.generateCoord,y=e.generateCoordCount,b=y!=null;y=v?y||1:0;var x=v||"value";function S(C){C.name==null&&(C.name=C.coordDim)}if(s)D(i,function(C){S(C)}),i.sort(function(C,A){return C.storeDimIndex-A.storeDimIndex});else for(var w=0;w<o;w++){var k=p(w),T=k.coordDim;T==null&&(k.coordDim=R2(x,a,b),k.coordDimIndex=0,(!v||y<=0)&&(k.isExtraCoord=!0),y--),S(k),k.type==null&&(Mm(t,w)===Yt.Must||k.isExtraCoord&&(k.otherDims.itemName!=null||k.otherDims.seriesName!=null))&&(k.type="ordinal")}return L2(i),new Um({source:t,dimensions:i,fullDimensionCount:o,dimensionOmitted:s})}function L2(t){for(var e=de(),r=0;r<t.length;r++){var n=t[r],a=n.name,i=e.get(a)||0;i>0&&(n.name=a+(i-1)),i++,e.set(a,i)}}function P2(t,e,r,n){var a=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return D(e,function(i){var o;ce(i)&&(o=i.dimsDef)&&(a=Math.max(a,o.length))}),a}function R2(t,e,r){if(r||e.hasKey(t)){for(var n=0;e.hasKey(t+n);)n++;t+=n}return e.set(t,!0),t}var Kf={},jf=(function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(e,r){var n=[];D(Kf,function(a,i){var o=a.create(e,r);n=n.concat(o||[])}),this._coordinateSystems=n},t.prototype.update=function(e,r){D(this._coordinateSystems,function(n){n.update&&n.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(e,r){Kf[e]=r},t.get=function(e){return Kf[e]},t})(),E2=(function(){function t(e){this.coordSysDims=[],this.axisMap=de(),this.categoryAxisMap=de(),this.coordSysName=e}return t})();function O2(t){var e=t.get("coordinateSystem"),r=new E2(e),n=N2[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var N2={cartesian2d:function(t,e,r,n){var a=t.getReferringComponents("xAxis",Et).models[0],i=t.getReferringComponents("yAxis",Et).models[0];e.coordSysDims=["x","y"],r.set("x",a),r.set("y",i),si(a)&&(n.set("x",a),e.firstCategoryDimIndex=0),si(i)&&(n.set("y",i),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var a=t.getReferringComponents("singleAxis",Et).models[0];e.coordSysDims=["single"],r.set("single",a),si(a)&&(n.set("single",a),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var a=t.getReferringComponents("polar",Et).models[0],i=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",i),r.set("angle",o),si(i)&&(n.set("radius",i),e.firstCategoryDimIndex=0),si(o)&&(n.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,n){var a=t.ecModel,i=a.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=i.dimensions.slice();D(i.parallelAxisIndex,function(s,l){var c=a.getComponent("parallelAxis",s),u=o[l];r.set(u,c),si(c)&&(n.set(u,c),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function si(t){return t.get("type")==="category"}function B2(t,e,r){r=r||{};var n=r.byIndex,a=r.stackedCoordDimension,i,o,s;z2(e)?i=e:(o=e.schema,i=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),c,u,f,h;if(D(i,function(y,b){ne(y)&&(i[b]=y={name:y}),l&&!y.isExtraCoord&&(!n&&!c&&y.ordinalMeta&&(c=y),!u&&y.type!=="ordinal"&&y.type!=="time"&&(!a||a===y.coordDim)&&(u=y))}),u&&!n&&!c&&(n=!0),u){f="__\0ecstackresult_"+t.id,h="__\0ecstackedover_"+t.id,c&&(c.createInvertedIndices=!0);var d=u.coordDim,p=u.type,m=0;D(i,function(y){y.coordDim===d&&m++});var g={name:f,coordDim:d,coordDimIndex:m,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:h,coordDim:h,coordDimIndex:m+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(h,p),v.storeDimIndex=s.ensureCalculationDimension(f,p)),o.appendCalculationDimension(g),o.appendCalculationDimension(v)):(i.push(g),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:c&&c.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function z2(t){return!Ym(t.schema)}function li(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function F2(t,e){return li(t,e)?t.getCalculationInfo("stackResultDimension"):e}function H2(t,e){var r=t.get("coordinateSystem"),n=jf.get(r),a;return e&&e.coordSysDims&&(a=ue(e.coordSysDims,function(i){var o={name:i},s=e.axisMap.get(i);if(s){var l=s.get("type");o.type=m2(l)}return o})),a||(a=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),a}function V2(t,e,r){var n,a;return r&&D(t,function(i,o){var s=i.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),i.ordinalMeta=l.getOrdinalMeta(),e&&(i.createInvertedIndices=!0)),i.otherDims.itemName!=null&&(a=!0)}),!a&&n!=null&&(t[n].otherDims.itemName=0),n}function Qf(t,e,r){r=r||{};var n=e.getSourceManager(),a,i=!1;a=n.getSource(),i=a.sourceFormat===nr;var o=O2(e),s=H2(e,o),l=r.useEncodeDefaulter,c=ye(l)?l:l?at(o2,s,e):null,u={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:c,canOmitUnusedDimensions:!i},f=I2(a,u),h=V2(f.dimensions,r.createInvertedIndices,o),d=i?null:n.getSharedDataStore(f),p=B2(e,{schema:f,store:d}),m=new D2(f,e);m.setCalculationInfo(p);var g=h!=null&&G2(a)?function(v,y,b,x){return x===h?b:this.defaultDimValueGetter(v,y,b,x)}:null;return m.hasItemOption=!1,m.initData(i?a:d,null,g),m}function G2(t){if(t.sourceFormat===nr){var e=$2(t.data||[]);return!ee(no(e))}}function $2(t){for(var e=0;e<t.length&&t[e]==null;)e++;return t[e]}var W2=Math.round(Math.random()*10);function El(t){return[t||"",W2++].join("_")}function U2(t){var e={};t.registerSubTypeDefaulter=function(r,n){var a=Ar(r);e[a.main]=n},t.determineSubType=function(r,n){var a=n.type;if(!a){var i=Ar(r).main;t.hasSubTypes(r)&&e[i]&&(a=e[i](n))}return a}}function Y2(t,e){t.topologicalTravel=function(i,o,s,l){if(!i.length)return;var c=r(o),u=c.graph,f=c.noEntryList,h={};for(D(i,function(y){h[y]=!0});f.length;){var d=f.pop(),p=u[d],m=!!h[d];m&&(s.call(l,d,p.originalDeps.slice()),delete h[d]),D(p.successor,m?v:g)}D(h,function(){var y="";throw new Error(y)});function g(y){u[y].entryCount--,u[y].entryCount===0&&f.push(y)}function v(y){h[y]=!0,g(y)}};function r(i){var o={},s=[];return D(i,function(l){var c=n(o,l),u=c.originalDeps=e(l),f=a(u,i);c.entryCount=f.length,c.entryCount===0&&s.push(l),D(f,function(h){ze(c.predecessor,h)<0&&c.predecessor.push(h);var d=n(o,h);ze(d.successor,h)<0&&d.successor.push(l)})}),{graph:o,noEntryList:s}}function n(i,o){return i[o]||(i[o]={predecessor:[],successor:[]}),i[o]}function a(i,o){var s=[];return D(i,function(l){ze(o,l)>=0&&s.push(l)}),s}}function Jf(t,e){return De(De({},t,!0),e,!0)}var q2=Math.log(2);function eh(t,e,r,n,a,i){var o=n+"-"+a,s=t.length;if(i.hasOwnProperty(o))return i[o];if(e===1){var l=Math.round(Math.log((1<<s)-1&~a)/q2);return t[r][l]}for(var c=n|1<<r,u=r+1;n&1<<u;)u++;for(var f=0,h=0,d=0;h<s;h++){var p=1<<h;p&a||(f+=(d%2?-1:1)*t[r][h]*eh(t,e-1,u,c,a|p,i),d++)}return i[o]=f,f}function Qm(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],n={},a=eh(r,8,0,0,0,n);if(a!==0){for(var i=[],o=0;o<8;o++)for(var s=0;s<8;s++)i[s]==null&&(i[s]=0),i[s]+=((o+s)%2?-1:1)*eh(r,7,o===0?1:0,1<<o,1<<s,n)/a*e[o];return function(l,c,u){var f=c*i[6]+u*i[7]+1;l[0]=(c*i[0]+u*i[1]+i[2])/f,l[1]=(c*i[3]+u*i[4]+i[5])/f}}}var Jm="___zrEVENTSAVED",th=[];function X2(t,e,r,n,a){return rh(th,e,n,a,!0)&&rh(t,r,th[0],th[1])}function rh(t,e,r,n,a){if(e.getBoundingClientRect&&ge.domSupported&&!ey(e)){var i=e[Jm]||(e[Jm]={}),o=Z2(e,i),s=K2(o,i,a);if(s)return s(t,r,n),!0}return!1}function Z2(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var n=["left","right"],a=["top","bottom"],i=0;i<4;i++){var o=document.createElement("div"),s=o.style,l=i%2,c=(i>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",a[c]+":0",n[1-l]+":auto",a[1-c]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return r}function K2(t,e,r){for(var n=r?"invTrans":"trans",a=e[n],i=e.srcCoords,o=[],s=[],l=!0,c=0;c<4;c++){var u=t[c].getBoundingClientRect(),f=2*c,h=u.left,d=u.top;o.push(h,d),l=l&&i&&h===i[f]&&d===i[f+1],s.push(t[c].offsetLeft,t[c].offsetTop)}return l&&a?a:(e.srcCoords=o,e[n]=r?Qm(s,o):Qm(o,s))}function ey(t){return t.nodeName.toUpperCase()==="CANVAS"}var j2=/([&<>"'])/g,Q2={"&":"&","<":"<",">":">",'"':""","'":"'"};function Bt(t){return t==null?"":(t+"").replace(j2,function(e,r){return Q2[r]})}const J2={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},eC={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var Ol="ZH",nh="EN",ci=nh,Nl={},ah={},ty=ge.domSupported?(function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ci).toUpperCase();return t.indexOf(Ol)>-1?Ol:ci})():ci;function ry(t,e){t=t.toUpperCase(),ah[t]=new et(e),Nl[t]=e}function tC(t){if(ne(t)){var e=Nl[t.toUpperCase()]||{};return t===Ol||t===nh?Te(e):De(Te(e),Te(Nl[ci]),!1)}else return De(Te(t),Te(Nl[ci]),!1)}function rC(t){return ah[t]}function nC(){return ah[ci]}ry(nh,J2),ry(Ol,eC);var ih=1e3,oh=ih*60,bo=oh*60,ar=bo*24,ny=ar*365,xo={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Bl="{yyyy}-{MM}-{dd}",ay={year:"{yyyy}",month:"{yyyy}-{MM}",day:Bl,hour:Bl+" "+xo.hour,minute:Bl+" "+xo.minute,second:Bl+" "+xo.second,millisecond:xo.none},sh=["year","month","day","hour","minute","second","millisecond"],iy=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function kn(t,e){return t+="","0000".substr(0,e-t.length)+t}function ui(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function aC(t){return t===ui(t)}function iC(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function zl(t,e,r,n){var a=Kr(t),i=a[lh(r)](),o=a[fi(r)]()+1,s=Math.floor((o-1)/3)+1,l=a[Fl(r)](),c=a["get"+(r?"UTC":"")+"Day"](),u=a[wo(r)](),f=(u-1)%12+1,h=a[Hl(r)](),d=a[Vl(r)](),p=a[Gl(r)](),m=u>=12?"pm":"am",g=m.toUpperCase(),v=n instanceof et?n:rC(n||ty)||nC(),y=v.getModel("time"),b=y.get("month"),x=y.get("monthAbbr"),S=y.get("dayOfWeek"),w=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,m+"").replace(/{A}/g,g+"").replace(/{yyyy}/g,i+"").replace(/{yy}/g,kn(i%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,kn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,kn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[c]).replace(/{ee}/g,w[c]).replace(/{e}/g,c+"").replace(/{HH}/g,kn(u,2)).replace(/{H}/g,u+"").replace(/{hh}/g,kn(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,kn(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,kn(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,kn(p,3)).replace(/{S}/g,p+"")}function oC(t,e,r,n,a){var i=null;if(ne(r))i=r;else if(ye(r))i=r(t.value,e,{level:t.level});else{var o=U({},xo);if(t.level>0)for(var s=0;s<sh.length;++s)o[sh[s]]="{primary|"+o[sh[s]]+"}";var l=r?r.inherit===!1?r:Ne(r,o):o,c=oy(t.value,a);if(l[c])i=l[c];else if(l.inherit){for(var u=iy.indexOf(c),s=u-1;s>=0;--s)if(l[c]){i=l[c];break}i=i||o.none}if(ee(i)){var f=t.level==null?0:t.level>=0?t.level:i.length+t.level;f=Math.min(f,i.length-1),i=i[f]}}return zl(new Date(t.value),i,a,n)}function oy(t,e){var r=Kr(t),n=r[fi(e)]()+1,a=r[Fl(e)](),i=r[wo(e)](),o=r[Hl(e)](),s=r[Vl(e)](),l=r[Gl(e)](),c=l===0,u=c&&s===0,f=u&&o===0,h=f&&i===0,d=h&&a===1,p=d&&n===1;return p?"year":d?"month":h?"day":f?"hour":u?"minute":c?"second":"millisecond"}function sy(t,e,r){var n=Ke(t)?Kr(t):t;switch(e=e||oy(t,r),e){case"year":return n[lh(r)]();case"half-year":return n[fi(r)]()>=6?1:0;case"quarter":return Math.floor((n[fi(r)]()+1)/4);case"month":return n[fi(r)]();case"day":return n[Fl(r)]();case"half-day":return n[wo(r)]()/24;case"hour":return n[wo(r)]();case"minute":return n[Hl(r)]();case"second":return n[Vl(r)]();case"millisecond":return n[Gl(r)]()}}function lh(t){return t?"getUTCFullYear":"getFullYear"}function fi(t){return t?"getUTCMonth":"getMonth"}function Fl(t){return t?"getUTCDate":"getDate"}function wo(t){return t?"getUTCHours":"getHours"}function Hl(t){return t?"getUTCMinutes":"getMinutes"}function Vl(t){return t?"getUTCSeconds":"getSeconds"}function Gl(t){return t?"getUTCMilliseconds":"getMilliseconds"}function sC(t){return t?"setUTCFullYear":"setFullYear"}function ly(t){return t?"setUTCMonth":"setMonth"}function cy(t){return t?"setUTCDate":"setDate"}function uy(t){return t?"setUTCHours":"setHours"}function fy(t){return t?"setUTCMinutes":"setMinutes"}function hy(t){return t?"setUTCSeconds":"setSeconds"}function dy(t){return t?"setUTCMilliseconds":"setMilliseconds"}function py(t){if(!yk(t))return ne(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function vy(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var $l=uv;function ch(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function a(u){return u&&Mr(u)?u:"-"}function i(u){return!!(u!=null&&!isNaN(u)&&isFinite(u))}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?Kr(t):t;if(isNaN(+l)){if(s)return"-"}else return zl(l,n,r)}if(e==="ordinal")return gu(t)?a(t):Ke(t)&&i(t)?t+"":"-";var c=nl(t);return i(c)?py(c):gu(t)?a(t):typeof t=="boolean"?t+"":"-"}var gy=["a","b","c","d","e","f","g"],uh=function(t,e){return"{"+t+(e??"")+"}"};function my(t,e,r){ee(e)||(e=[e]);var n=e.length;if(!n)return"";for(var a=e[0].$vars||[],i=0;i<a.length;i++){var o=gy[i];t=t.replace(uh(o),uh(o,0))}for(var s=0;s<n;s++)for(var l=0;l<a.length;l++){var c=e[s][a[l]];t=t.replace(uh(gy[l],s),r?Bt(c):c)}return t}function lC(t,e){var r=ne(t)?{color:t,extraCssText:e}:t||{},n=r.color,a=r.type;e=r.extraCssText;var i=r.renderMode||"html";if(!n)return"";if(i==="html")return a==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Bt(n)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Bt(n)+";"+(e||"")+'"></span>';var o=r.markerId||"markerX";return{renderMode:i,content:"{"+o+"|} ",style:a==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function pa(t,e){return e=e||"transparent",ne(t)?t:ce(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var Wl=D,cC=["left","right","top","bottom","width","height"],Ul=[["width","left","right"],["height","top","bottom"]];function fh(t,e,r,n,a){var i=0,o=0;n==null&&(n=1/0),a==null&&(a=1/0);var s=0;e.eachChild(function(l,c){var u=l.getBoundingRect(),f=e.childAt(c+1),h=f&&f.getBoundingRect(),d,p;if(t==="horizontal"){var m=u.width+(h?-h.x+u.x:0);d=i+m,d>n||l.newline?(i=0,d=m,o+=s+r,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(h?-h.y+u.y:0);p=o+g,p>a||l.newline?(i+=s+r,o=0,p=g,s=u.width):s=Math.max(s,u.width)}l.newline||(l.x=i,l.y=o,l.markRedraw(),t==="horizontal"?i=d+r:o=p+r)})}var So=fh;at(fh,"vertical"),at(fh,"horizontal");function Yl(t,e,r){r=$l(r||0);var n=e.width,a=e.height,i=At(t.left,n),o=At(t.top,a),s=At(t.right,n),l=At(t.bottom,a),c=At(t.width,n),u=At(t.height,a),f=r[2]+r[0],h=r[1]+r[3],d=t.aspect;switch(isNaN(c)&&(c=n-s-h-i),isNaN(u)&&(u=a-l-f-o),d!=null&&(isNaN(c)&&isNaN(u)&&(d>n/a?c=n*.8:u=a*.8),isNaN(c)&&(c=d*u),isNaN(u)&&(u=c/d)),isNaN(i)&&(i=n-s-c-h),isNaN(o)&&(o=a-l-u-f),t.left||t.right){case"center":i=n/2-c/2-r[3];break;case"right":i=n-c-h;break}switch(t.top||t.bottom){case"middle":case"center":o=a/2-u/2-r[0];break;case"bottom":o=a-u-f;break}i=i||0,o=o||0,isNaN(c)&&(c=n-h-i-(s||0)),isNaN(u)&&(u=a-f-o-(l||0));var p=new Fe(i+r[3],o+r[0],c,u);return p.margin=r,p}function ko(t){var e=t.layoutMode||t.constructor.layoutMode;return ce(e)?e:e?{type:e}:null}function hi(t,e,r){var n=r&&r.ignoreSize;!ee(n)&&(n=[n,n]);var a=o(Ul[0],0),i=o(Ul[1],1);c(Ul[0],t,a),c(Ul[1],t,i);function o(u,f){var h={},d=0,p={},m=0,g=2;if(Wl(u,function(b){p[b]=t[b]}),Wl(u,function(b){s(e,b)&&(h[b]=p[b]=e[b]),l(h,b)&&d++,l(p,b)&&m++}),n[f])return l(e,u[1])?p[u[2]]=null:l(e,u[2])&&(p[u[1]]=null),p;if(m===g||!d)return p;if(d>=g)return h;for(var v=0;v<u.length;v++){var y=u[v];if(!s(h,y)&&s(t,y)){h[y]=t[y];break}}return h}function s(u,f){return u.hasOwnProperty(f)}function l(u,f){return u[f]!=null&&u[f]!=="auto"}function c(u,f,h){Wl(u,function(d){f[d]=h[d]})}}function ql(t){return uC({},t)}function uC(t,e){return e&&t&&Wl(cC,function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var fC=it(),We=(function(t){Z(e,t);function e(r,n,a){var i=t.call(this,r,n,a)||this;return i.uid=El("ec_cpt_model"),i}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=ko(this),i=a?ql(r):{},o=n.getTheme();De(r,o.get(this.mainType)),De(r,this.getDefaultOption()),a&&hi(r,i,a)},e.prototype.mergeOption=function(r,n){De(this.option,r,!0);var a=ko(this);a&&hi(this.option,r,a)},e.prototype.optionUpdated=function(r,n){},e.prototype.getDefaultOption=function(){var r=this.constructor;if(!Bw(r))return r.defaultOption;var n=fC(this);if(!n.defaultOption){for(var a=[],i=r;i;){var o=i.prototype.defaultOption;o&&a.push(o),i=i.superClass}for(var s={},l=a.length-1;l>=0;l--)s=De(s,a[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var a=r+"Index",i=r+"Id";return oo(this.ecModel,r,{index:this.get(a,!0),id:this.get(i,!0)},n)},e.prototype.getBoxLayoutParams=function(){var r=this;return{left:r.get("left"),top:r.get("top"),right:r.get("right"),bottom:r.get("bottom"),width:r.get("width"),height:r.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=(function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0})(),e})(et);vv(We,et),Ms(We),U2(We),Y2(We,hC);function hC(t){var e=[];return D(We.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=ue(e,function(r){return Ar(r).main}),t!=="dataset"&&ze(e,"dataset")<=0&&e.unshift("dataset"),e}var yy=it(),dC=it(),hh=(function(){function t(){}return t.prototype.getColorFromPalette=function(e,r,n){var a=_t(this.get("color",!0)),i=this.get("colorLayer",!0);return by(this,yy,a,i,e,r,n)},t.prototype.clearColorPalette=function(){vC(this,yy)},t})();function _y(t,e,r,n){var a=_t(t.get(["aria","decal","decals"]));return by(t,dC,a,null,e,r,n)}function pC(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n].length>e)return t[n];return t[r-1]}function by(t,e,r,n,a,i,o){i=i||t;var s=e(i),l=s.paletteIdx||0,c=s.paletteNameMap=s.paletteNameMap||{};if(c.hasOwnProperty(a))return c[a];var u=o==null||!n?r:pC(n,o);if(u=u||r,!(!u||!u.length)){var f=u[l];return a&&(c[a]=f),s.paletteIdx=(l+1)%u.length,f}}function vC(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var gC=/\{@(.+?)\}/g,mC=(function(){function t(){}return t.prototype.getDataParams=function(e,r){var n=this.getData(r),a=this.getRawValue(e,r),i=n.getRawIndex(e),o=n.getName(e),s=n.getRawDataItem(e),l=n.getItemVisual(e,"style"),c=l&&l[n.getItemVisual(e,"drawType")||"fill"],u=l&&l.stroke,f=this.mainType,h=f==="series",d=n.userOutput&&n.userOutput.get();return{componentType:f,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:i,data:s,dataType:r,value:a,color:c,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(e,r,n,a,i,o){r=r||"normal";var s=this.getData(n),l=this.getDataParams(e,n);if(o&&(l.value=o.interpolatedValue),a!=null&&ee(l.value)&&(l.value=l.value[a]),!i){var c=s.getItemModel(e);i=c.get(r==="normal"?["label","formatter"]:[r,"label","formatter"])}if(ye(i))return l.status=r,l.dimensionIndex=a,i(l);if(ne(i)){var u=my(i,l);return u.replace(gC,function(f,h){var d=h.length,p=h;p.charAt(0)==="["&&p.charAt(d-1)==="]"&&(p=+p.slice(1,d-1));var m=ai(s,e,p);if(o&&ee(o.interpolatedValue)){var g=s.getDimensionIndex(p);g>=0&&(m=o.interpolatedValue[g])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return ai(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t})();function xy(t){var e,r;return ce(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function To(t){return new yC(t)}var yC=(function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,n=e&&e.skip;if(this._dirty&&r){var a=this.context;a.data=a.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var o=u(this._modBy),s=this._modDataCount||0,l=u(e&&e.modBy),c=e&&e.modDataCount||0;(o!==l||s!==c)&&(i="reset");function u(y){return!(y>=1)&&(y=1),y}var f;(this._dirty||i==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=c;var h=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d<p)){var m=this._progress;if(ee(m))for(var g=0;g<m.length;g++)this._doProgress(m[g],d,p,l,c);else this._doProgress(m,d,p,l,c)}this._dueIndex=p;var v=this._settedOutputEnd!=null?this._settedOutputEnd:p;this._outputDueEnd=v}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(e,r,n,a,i){wy.reset(r,n,a,i),this._callingProgress=e,this._callingProgress({start:r,end:n,count:n-r,next:wy.next},this.context)},t.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var r,n;!e&&this._reset&&(r=this._reset(this.context),r&&r.progress&&(n=r.forceFirstProgress,r=r.progress),ee(r)&&!r.length&&(r=null)),this._progress=r,this._modBy=this._modDataCount=null;var a=this._downstream;return a&&a.dirty(),n},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},t})(),wy=(function(){var t,e,r,n,a,i={reset:function(l,c,u,f){e=l,t=c,r=u,n=f,a=Math.ceil(n/r),i.next=r>1&&n>0?s:o}};return i;function o(){return e<t?e++:null}function s(){var l=e%a*r+Math.ceil(e/a),c=e>=t?null:l<n?l:e;return e++,c}})(),_C=(function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(e){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(e){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(e,r){},t.prototype.retrieveValueFromItem=function(e,r){},t.prototype.convertValue=function(e,r){return Ll(e,r)},t})();function bC(t,e){var r=new _C,n=t.data,a=r.sourceFormat=t.sourceFormat,i=t.startIndex,o="";t.seriesLayoutBy!==en&&Rt(o);var s=[],l={},c=t.dimensionsDefine;if(c)D(c,function(m,g){var v=m.name,y={index:g,name:v,displayName:m.displayName};if(s.push(y),v!=null){var b="";Vn(l,v)&&Rt(b),l[v]=y}});else for(var u=0;u<t.dimensionsDetectedCount;u++)s.push({index:u});var f=Bm(a,en);e.__isBuiltIn&&(r.getRawDataItem=function(m){return f(n,i,s,m)},r.getRawData=Le(xC,null,t)),r.cloneRawData=Le(wC,null,t);var h=Fm(a,en);r.count=Le(h,null,n,i,s);var d=Hm(a);r.retrieveValue=function(m,g){var v=f(n,i,s,m);return p(v,g)};var p=r.retrieveValueFromItem=function(m,g){if(m!=null){var v=s[g];if(v)return d(m,g,v.name)}};return r.getDimensionInfo=Le(SC,null,s,l),r.cloneAllDimensionInfo=Le(kC,null,s),r}function xC(t){var e=t.sourceFormat;if(!dh(e)){var r="";Rt(r)}return t.data}function wC(t){var e=t.sourceFormat,r=t.data;if(!dh(e)){var n="";Rt(n)}if(e===Nt){for(var a=[],i=0,o=r.length;i<o;i++)a.push(r[i].slice());return a}else if(e===Nr){for(var a=[],i=0,o=r.length;i<o;i++)a.push(U({},r[i]));return a}}function SC(t,e,r){if(r!=null){if(Ke(r)||!isNaN(r)&&!Vn(e,r))return t[r];if(Vn(e,r))return e[r]}}function kC(t){return Te(t)}var Sy=de();function TC(t){t=Te(t);var e=t.type,r="";e||Rt(r);var n=e.split(":");n.length!==2&&Rt(r);var a=!1;n[0]==="echarts"&&(e=n[1],a=!0),t.__isBuiltIn=a,Sy.set(e,t)}function CC(t,e,r){var n=_t(t),a=n.length,i="";a||Rt(i);for(var o=0,s=a;o<s;o++){var l=n[o];e=MC(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function MC(t,e,r,n){var a="";e.length||Rt(a),ce(t)||Rt(a);var i=t.type,o=Sy.get(i);o||Rt(a);var s=ue(e,function(c){return bC(c,o)}),l=_t(o.transform({upstream:s[0],upstreamList:s,config:Te(t.config)}));return ue(l,function(c,u){var f="";ce(c)||Rt(f),c.data||Rt(f);var h=Dm(c.data);dh(h)||Rt(f);var d,p=e[0];if(p&&u===0&&!c.dimensions){var m=p.startIndex;m&&(c.data=p.data.slice(0,m).concat(c.data)),d={seriesLayoutBy:en,sourceHeader:m,dimensions:p.metaRawOption.dimensions}}else d={seriesLayoutBy:en,sourceHeader:0,dimensions:c.dimensions};return Gf(c.data,d,null)})}function dh(t){return t===Nt||t===Nr}var AC=(function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,a,i;if(Xl(e)){var o=e,s=void 0,l=void 0,c=void 0;if(n){var u=r[0];u.prepareSource(),c=u.getSource(),s=c.data,l=c.sourceFormat,i=[u._getVersionSign()]}else s=o.get("data",!0),l=It(s)?wn:nr,i=[];var f=this._getSourceMetaRawOption()||{},h=c&&c.metaRawOption||{},d=Ce(f.seriesLayoutBy,h.seriesLayoutBy)||null,p=Ce(f.sourceHeader,h.sourceHeader),m=Ce(f.dimensions,h.dimensions),g=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||m;a=g?[Gf(s,{seriesLayoutBy:d,sourceHeader:p,dimensions:m},l)]:[]}else{var v=e;if(n){var y=this._applyTransform(r);a=y.sourceList,i=y.upstreamSignList}else{var b=v.get("source",!0);a=[Gf(b,this._getSourceMetaRawOption(),null)],i=[]}}this._setLocalSource(a,i)},t.prototype._applyTransform=function(e){var r=this._sourceHost,n=r.get("transform",!0),a=r.get("fromTransformResult",!0);if(a!=null){var i="";e.length!==1&&ky(i)}var o,s=[],l=[];return D(e,function(c){c.prepareSource();var u=c.getSource(a||0),f="";a!=null&&!u&&ky(f),s.push(u),l.push(c._getVersionSign())}),n?o=CC(n,s,{datasetIndex:r.componentIndex}):a!=null&&(o=[c2(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r<e.length;r++){var n=e[r];if(n._isDirty()||this._upstreamSignList[r]!==n._getVersionSign())return!0}},t.prototype.getSource=function(e){e=e||0;var r=this._sourceList[e];if(!r){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return r},t.prototype.getSharedDataStore=function(e){var r=e.makeStoreSchema();return this._innerGetDataStore(r.dimensions,e.source,r.hash)},t.prototype._innerGetDataStore=function(e,r,n){var a=0,i=this._storeList,o=i[a];o||(o=i[a]={});var s=o[n];if(!s){var l=this._getUpstreamSourceManagers()[0];Xl(this._sourceHost)&&l?s=l._innerGetDataStore(e,r,n):(s=new qf,s.initData(new Om(r,e.length),e)),o[n]=s}return s},t.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Xl(e)){var r=Cm(e);return r?[r.getSourceManager()]:[]}else return ue(s2(e),function(n){return n.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,r,n,a;if(Xl(e))r=e.get("seriesLayoutBy",!0),n=e.get("sourceHeader",!0),a=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=e;r=i.get("seriesLayoutBy",!0),n=i.get("sourceHeader",!0),a=i.get("dimensions",!0)}return{seriesLayoutBy:r,sourceHeader:n,dimensions:a}},t})();function Xl(t){return t.mainType==="series"}function ky(t){throw new Error(t)}var DC="line-height:1";function Ty(t){var e=t.lineHeight;return e==null?DC:"line-height:"+Bt(e+"")+"px"}function Cy(t,e){var r=t.color||"#6e7079",n=t.fontSize||12,a=t.fontWeight||"400",i=t.color||"#464646",o=t.fontSize||14,s=t.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+Bt(n+"")+"px;color:"+Bt(r)+";font-weight:"+Bt(a+""),valueStyle:"font-size:"+Bt(o+"")+"px;color:"+Bt(i)+";font-weight:"+Bt(s+"")}:{nameStyle:{fontSize:n,fill:r,fontWeight:a},valueStyle:{fontSize:o,fill:i,fontWeight:s}}}var IC=[0,10,20,30],LC=["",`
|
|
5
|
+
`))}}catch{return{event:e}}},tv=t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):[],fr=t=>new Promise(e=>setTimeout(e,t)),rv={agentName:"Accurix",agentAvatarUrl:"",widgetModule:"assistant",assistantMediaUrl:"https://images.unsplash.com/photo-1494790108377-be9c29b29330",assistantMediaKind:"image",assistantPrivacyUrl:"https://accurix.tech/privacy",soundEnabled:!0,voiceOutputEnabled:!1,talkbackMode:"avatar",avatarProvider:"demo",avatarId:"accurix-demo",greeting:"Hi! I'm Accurix, the AI assistant for Accurix. Ask me anything about products, pricing, or documentation — or book a demo.",allowVoiceInput:!1,memoryEnabled:!0,memoryRetentionDays:30,memoryMessageCap:50,availableActions:["public_book_demo","public_capture_contact","public_submit_inquiry"],agentDescription:"I help with Accurix products, pricing, and documentation.",welcomeSubtitle:"Ask me anything — most answers are instant.",disclaimerText:"Accurix is an AI assistant; answers may be imperfect.",starterQuestions:["What can Accurix help with?","How do I get started?","What's your pricing?"],featuredLinks:[{label:"Accurix founders",url:"https://accurix.tech/about"},{label:"Pricing",url:"https://accurix.tech/pricing"}]},hw=[{match:/demo chart|monthly orders|orders by status/i,result:{answer:"Orders moved in different directions by status in the latest month. The chart below shows one line for submitted, approved, and fulfilled orders.",sources:[],suggestedReplies:["Show a demo KPI","Show a demo table"],handoffOffered:!1,visualization:{version:1,presentation:"chart",type:"line",title:"Monthly orders by status",columns:["month","status","order_count"],rows:[{month:"2025-01-01",status:"Submitted",order_count:12},{month:"2025-01-01",status:"Approved",order_count:16},{month:"2025-01-01",status:"Fulfilled",order_count:14},{month:"2025-02-01",status:"Submitted",order_count:14},{month:"2025-02-01",status:"Approved",order_count:15},{month:"2025-02-01",status:"Fulfilled",order_count:15},{month:"2025-03-01",status:"Submitted",order_count:13},{month:"2025-03-01",status:"Approved",order_count:17},{month:"2025-03-01",status:"Fulfilled",order_count:16},{month:"2025-04-01",status:"Submitted",order_count:15},{month:"2025-04-01",status:"Approved",order_count:16},{month:"2025-04-01",status:"Fulfilled",order_count:17},{month:"2025-05-01",status:"Submitted",order_count:16},{month:"2025-05-01",status:"Approved",order_count:18},{month:"2025-05-01",status:"Fulfilled",order_count:17},{month:"2025-06-01",status:"Submitted",order_count:17},{month:"2025-06-01",status:"Approved",order_count:17},{month:"2025-06-01",status:"Fulfilled",order_count:18},{month:"2025-07-01",status:"Submitted",order_count:18},{month:"2025-07-01",status:"Approved",order_count:19},{month:"2025-07-01",status:"Fulfilled",order_count:18},{month:"2025-08-01",status:"Submitted",order_count:19},{month:"2025-08-01",status:"Approved",order_count:18},{month:"2025-08-01",status:"Fulfilled",order_count:19}],rowCount:24,timezone:"UTC",columnMetadata:[{key:"month",label:"Order month",dataType:"date",semanticRole:"date"},{key:"status",label:"Status",dataType:"text",semanticRole:"dimension"},{key:"order_count",label:"Distinct order count",dataType:"number",semanticRole:"measure",aggregation:"count_distinct"}],chartRecommendation:{type:"line",mode:"time_series",categoryField:"month",valueFields:["order_count"],seriesField:"status"},expandable:!0,tableAvailable:!1,explanation:{headline:"The latest results moved in different directions by status.",summary:"Submitted and fulfilled orders increased, while approved orders decreased.",evidence:["Submitted orders increased from 18 in July to 19 in August.","Approved orders decreased from 19 in July to 18 in August.","Fulfilled orders increased from 18 in July to 19 in August."],businessMeaning:"Overall order activity is steady, but the small approval decline is worth watching if it continues.",followUps:["Which status changed the most?","How does this compare with the prior quarter?"],source:"governed_result"}}}},{match:/demo kpi|active accounts/i,result:{answer:"There are 5,632 active accounts in the current demo result.",sources:[],suggestedReplies:["Show a demo chart","Show a demo table"],handoffOffered:!1,visualization:{version:1,presentation:"kpi",type:"kpi",title:"Active accounts",columns:["active_accounts"],value:"active_accounts",rows:[{active_accounts:5632}],rowCount:1,columnMetadata:[{key:"active_accounts",label:"Active accounts",dataType:"number",semanticRole:"measure",aggregation:"count_distinct"}],explanation:{headline:"Active accounts are 5,632.",summary:"This is the latest value in the demo result.",evidence:["The displayed active-account count is 5,632."],source:"governed_result"}}}},{match:/demo table|account health/i,result:{answer:"Nine accounts are included in this governed result. The table shows a compact preview and can be expanded to inspect every permitted row.",sources:[],suggestedReplies:["Show a demo chart","Test the hidden table response"],handoffOffered:!1,visualization:{version:1,presentation:"table",type:"table",title:"Account health",columns:["account_name","region","health_score","renewal_month"],rows:[{account_name:"Northstar Industries",region:"West",health_score:94,renewal_month:"August"},{account_name:"Apex Group",region:"East",health_score:91,renewal_month:"September"},{account_name:"Summit Retail",region:"North",health_score:88,renewal_month:"August"},{account_name:"Harbor Logistics",region:"South",health_score:86,renewal_month:"October"},{account_name:"Brightline Media",region:"West",health_score:84,renewal_month:"November"},{account_name:"Redwood Labs",region:"East",health_score:82,renewal_month:"September"},{account_name:"Atlas Foods",region:"North",health_score:79,renewal_month:"December"},{account_name:"Cedar Health",region:"South",health_score:77,renewal_month:"October"},{account_name:"Bluewave Energy",region:"West",health_score:74,renewal_month:"December"}],rowCount:9,columnMetadata:[{key:"account_name",label:"Account",dataType:"text",semanticRole:"dimension"},{key:"region",label:"Region",dataType:"text",semanticRole:"geography"},{key:"health_score",label:"Health score",dataType:"number",semanticRole:"measure"},{key:"renewal_month",label:"Renewal month",dataType:"text",semanticRole:"date"}],expandable:!0,tableAvailable:!0,downloadAvailable:!0,explanation:{headline:"Nine accounts are available for review.",summary:"Health scores range from 74 to 94 across four regions.",evidence:["Northstar Industries has the highest health score at 94."],source:"governed_result"}}}},{match:/hidden table|table response/i,result:{answer:"Three accounts need attention. The public widget explains the result without exposing its underlying rows.",sources:[],suggestedReplies:["Show a demo chart","Show a demo KPI"],handoffOffered:!1,visualization:{version:1,presentation:"table",type:"table",columns:["account_name","risk_score"],rows:[{account_name:"Private account A",risk_score:91},{account_name:"Private account B",risk_score:87},{account_name:"Private account C",risk_score:82}],rowCount:3,tableAvailable:!1,explanation:{headline:"Three accounts need attention.",summary:"The written result is available without displaying a public data table.",evidence:["Three accounts matched the approved attention rule."],source:"governed_result"}}}},{match:/^\s*(hi+|hey+|hello|yo|sup|howdy|hola|thanks|thank you|thx|good (morning|afternoon|evening))\b/i,result:{answer:"Hello! 👋 How can I help you today?",sources:[],suggestedReplies:["How do I track a shipment?","How does customs work?"],handoffOffered:!1}},{match:/track|shipment|where|status/i,result:{answer:"Centrinfo can answer from your indexed knowledge base, public website, connected files, and approved organization tools. It keeps answers grounded in your configured sources and can hand a conversation to your team when the AI is not enough.",sources:[{title:"Centrinfo public widget",url:"https://accurix.tech/centrinfo"}],suggestedReplies:["How does the widget work?","Can a human take over?"],handoffOffered:!1}},{match:/custom|clear|duty|tariff|import/i,result:{answer:"Accurix connects your organization knowledge, channels, integrations, and public widget in one place. You can configure which sources the AI can use, which tools visitors can trigger, and when your team should take over live chat.",sources:[{title:"Accurix documentation",url:"https://accurix.tech/docs"}],suggestedReplies:["Which tools can I connect?","How do permissions work?"],handoffOffered:!1}},{match:/price|cost|pricing|plan|quote/i,result:{answer:"Accurix uses a usage-based pricing model. Organizations keep an active subscription and spend credits as the AI answers, searches, and uses tools. Credit top-ups can extend usage when the subscription grant runs low.",sources:[{title:"Pricing",url:"https://accurix.tech/pricing"}],suggestedReplies:["How do credits work?","Can I top up credits?"],handoffOffered:!1}}],pw={answer:"That's a great question — I don't have a confident answer from Accurix's published docs yet. Want me to pass it to the team so a human can follow up? You can also book a quick demo.",sources:[],suggestedReplies:["What can you help with?"],handoffOffered:!0},vw=t=>hw.find(e=>e.match.test(t))?.result??pw;class gw{async history(){return{conversations:[]}}async bootstrap(){return await fr(180),rv}async stream(e,r,n){await fr(550);const a=vw(e),i=a.answer.split(/(\s+)/);for(const o of i){if(n.signal?.aborted)break;n.onChunk(o),await fr(18+Math.min(40,o.length*6))}return{...a,availableActions:rv.availableActions}}async liveEvents(){return{mode:"ai",conversationEnded:!1,events:[]}}async presence(e){}async typing(){await fr(20)}async action(e,r){return await fr(450),{ok:!0,note:{"book-demo":"Demo requested — we'll email you a few times that work. 📅",contact:"Got it — saved your details. ✅","contact-support":"Support request sent. The team can follow up from this chat. ✅",inquiry:"Thanks! We'll get back to you shortly. ✉️","request-callback":"We'll call you back soon. 📞","schedule-callback":"Your callback has been scheduled.","subscribe-newsletter":"You're subscribed. 🎉"}[e]}}async speak(){return await fr(120),{providerReady:!1,message:"Demo voice provider is not connected."}}async transcribe(e,r,n,a){return await fr(700),"How do I track a shipment?"}async uploadAttachment(e,r,n){return{id:`demo-${Date.now()}`,text:`Attached file: ${n}`,analysisFailed:!1}}async identify(e,r){await fr(50)}async endConversation(e){await fr(50)}async sendFeedback(){await fr(50)}async demoSlots(e,r){return await fr(150),{taken:[[11,0],[15,0]].map(([a,i])=>{const o=new Date;return o.setHours(a,i,0,0),o.toISOString()}),busy:[]}}async searchGifs(e){await fr(280);const r=e.trim().toLowerCase(),n=r?ku.filter(i=>i.alt.includes(r)||i.tags.some(o=>o.includes(r)||r.includes(o))):ku;return(n.length>0?n:ku).map(i=>({id:i.id,url:nv(i.emoji,i.anim),preview:nv(i.emoji,i.anim),alt:i.alt}))}}const Hs="<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>",Vs="<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>",nv=(t,e)=>{const r=`<svg xmlns='http://www.w3.org/2000/svg' width='128' height='128'><rect width='128' height='128' rx='14' fill='#eef1f4'/><text x='64' y='88' font-size='64' text-anchor='middle'>${t}${e}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(r)}`},ku=[{id:"g1",emoji:"👍",alt:"thumbs up",tags:["thumbs","yes","ok","great","good"],anim:Hs},{id:"g2",emoji:"🎉",alt:"celebrate",tags:["party","yay","congrats","celebrate"],anim:Vs},{id:"g3",emoji:"👋",alt:"wave hello",tags:["hi","hello","hey","wave","bye"],anim:Vs},{id:"g4",emoji:"❤️",alt:"heart",tags:["love","thanks","heart"],anim:Hs},{id:"g5",emoji:"🤔",alt:"thinking",tags:["hmm","think","thinking"],anim:Vs},{id:"g6",emoji:"😂",alt:"laughing",tags:["lol","funny","haha","laugh"],anim:Hs},{id:"g7",emoji:"🔥",alt:"fire",tags:["fire","hot","lit","awesome"],anim:Hs},{id:"g8",emoji:"🚀",alt:"rocket",tags:["rocket","launch","fast","go"],anim:Vs}],Tu=t=>new Promise(e=>setTimeout(e,t));class mw{constructor(e,r){se(this,"real");se(this,"strings");this.real=e,this.strings=r}bootstrap(){return this.real.bootstrap()}async history(){return{conversations:[]}}async stream(e,r,n){await Tu(300);for(const a of this.strings.previewReply.split(/(\s+)/)){if(n.signal?.aborted)break;n.onChunk(a),await Tu(16)}return{answer:this.strings.previewReply,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1}}async liveEvents(){return{mode:"ai",conversationEnded:!1,events:[]}}async presence(e){}async typing(){}async action(){return await Tu(250),{ok:!0,note:this.strings.previewActionNote}}async speak(){return{providerReady:!1,message:"Preview voice provider is not connected."}}async identify(){}async endConversation(){}async sendFeedback(){}async transcribe(e,r,n,a){return""}async uploadAttachment(e,r,n){return{id:`preview-${Date.now()}`,text:`Attached file: ${n}`,analysisFailed:!1}}async searchGifs(){return[]}async demoSlots(){return{taken:[],busy:[]}}}var oa,nt,Cu,av,eo=0,iv=[],ft=Be,ov=ft.__b,sv=ft.__r,lv=ft.diffed,cv=ft.__c,uv=ft.unmount,fv=ft.__;function to(t,e){ft.__h&&ft.__h(nt,t,eo||e),eo=0;var r=nt.__H||(nt.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function U(t){return eo=1,yw(hv,t)}function yw(t,e,r){var n=to(oa++,2);if(n.t=t,!n.__c&&(n.__=[hv(void 0,e),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=nt,!nt.__f)){var a=function(s,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return h.__c});if(u.every(function(h){return!h.__N}))return!i||i.call(this,s,l,c);var f=n.__c.props!==s;return u.some(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(f=!0)}}),i&&i.call(this,s,l,c)||f};nt.__f=!0;var i=nt.shouldComponentUpdate,o=nt.componentWillUpdate;nt.componentWillUpdate=function(s,l,c){if(this.__e){var u=i;i=void 0,a(s,l,c),i=u}o&&o.call(this,s,l,c)},nt.shouldComponentUpdate=a}return n.__N||n.__}function le(t,e){var r=to(oa++,3);!ft.__s&&Du(r.__H,e)&&(r.__=t,r.u=e,nt.__H.__h.push(r))}function Mu(t,e){var r=to(oa++,4);!ft.__s&&Du(r.__H,e)&&(r.__=t,r.u=e,nt.__h.push(r))}function X(t){return eo=5,Ht(function(){return{current:t}},[])}function Ht(t,e){var r=to(oa++,7);return Du(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Y(t,e){return eo=8,Ht(function(){return t},e)}function _w(t){var e=nt.context[t.__c],r=to(oa++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(nt)),e.props.value):t.__}function bw(){for(var t;t=iv.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Us),e.__h.some(Au),e.__h=[]}catch(r){e.__h=[],ft.__e(r,t.__v)}}}ft.__b=function(t){nt=null,ov&&ov(t)},ft.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),fv&&fv(t,e)},ft.__r=function(t){sv&&sv(t),oa=0;var e=(nt=t.__c).__H;e&&(Cu===nt?(e.__h=[],nt.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(Us),e.__h.some(Au),e.__h=[],oa=0)),Cu=nt},ft.diffed=function(t){lv&&lv(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(iv.push(e)!==1&&av===ft.requestAnimationFrame||((av=ft.requestAnimationFrame)||xw)(bw)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Cu=nt=null},ft.__c=function(t,e){e.some(function(r){try{r.__h.some(Us),r.__h=r.__h.filter(function(n){return!n.__||Au(n)})}catch(n){e.some(function(a){a.__h&&(a.__h=[])}),e=[],ft.__e(n,r.__v)}}),cv&&cv(t,e)},ft.unmount=function(t){uv&&uv(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(n){try{Us(n)}catch(a){e=a}}),r.__H=void 0,e&&ft.__e(e,r.__v))};var dv=typeof requestAnimationFrame=="function";function xw(t){var e,r=function(){clearTimeout(n),dv&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);dv&&(e=requestAnimationFrame(r))}function Us(t){var e=nt,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),nt=e}function Au(t){var e=nt;t.__c=t.__(),nt=e}function Du(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function hv(t,e){return typeof e=="function"?e(t):e}var Iu=function(t,e){return Iu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},Iu(t,e)};function K(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Iu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Lu=12,ww="sans-serif",sa=Lu+"px "+ww,Sw=20,kw=100,Tw="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Cw(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r<t.length;r++){var n=String.fromCharCode(r+32),a=(t.charCodeAt(r)-Sw)/kw;e[n]=a}return e}var Mw=Cw(Tw),ri={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var t,e;return function(r,n){if(!t){var a=ri.createCanvas();t=a&&a.getContext("2d")}if(t)return e!==n&&(e=t.font=n||sa),t.measureText(r);r=r||"",n=n||sa;var i=/((?:\d+)?\.?\d*)px/.exec(n),o=i&&+i[1]||Lu,s=0;if(n.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var c=Mw[r[l]];s+=c==null?o:c*o}return{width:s}}})(),loadImage:function(t,e,r){var n=new Image;return n.onload=e,n.onerror=r,n.src=t,n}},pv=ni(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),vv=ni(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),ro=Object.prototype.toString,Gs=Array.prototype,Aw=Gs.forEach,Dw=Gs.filter,Pu=Gs.slice,Iw=Gs.map,gv=function(){}.constructor,$s=gv?gv.prototype:null,Ru="__proto__",Lw=2311;function mv(){return Lw++}function Eu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function Ie(t){if(t==null||typeof t!="object")return t;var e=t,r=ro.call(t);if(r==="[object Array]"){if(!io(t)){e=[];for(var n=0,a=t.length;n<a;n++)e[n]=Ie(t[n])}}else if(vv[r]){if(!io(t)){var i=t.constructor;if(i.from)e=i.from(t);else{e=new i(t.length);for(var n=0,a=t.length;n<a;n++)e[n]=t[n]}}}else if(!pv[r]&&!io(t)&&!no(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==Ru&&(e[o]=Ie(t[o]))}return e}function Oe(t,e,r){if(!de(e)||!de(t))return r?Ie(e):t;for(var n in e)if(e.hasOwnProperty(n)&&n!==Ru){var a=t[n],i=e[n];de(i)&&de(a)&&!ee(i)&&!ee(a)&&!no(i)&&!no(a)&&!yv(i)&&!yv(a)&&!io(i)&&!io(a)?Oe(a,i,r):(r||!(n in t))&&(t[n]=Ie(e[n]))}return t}function q(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==Ru&&(t[r]=e[r]);return t}function He(t,e,r){for(var n=at(e),a=0,i=n.length;a<i;a++){var o=n[a];t[o]==null&&(t[o]=e[o])}return t}function Ue(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r}return-1}function Pw(t,e){var r=t.prototype;function n(){}n.prototype=e.prototype,t.prototype=new n;for(var a in r)r.hasOwnProperty(a)&&(t.prototype[a]=r[a]);t.prototype.constructor=t,t.superClass=e}function Ur(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(e),a=0;a<n.length;a++){var i=n[a];i!=="constructor"&&t[i]==null&&(t[i]=e[i])}else He(t,e)}function Vt(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function I(t,e,r){if(t&&e)if(t.forEach&&t.forEach===Aw)t.forEach(e,r);else if(t.length===+t.length)for(var n=0,a=t.length;n<a;n++)e.call(r,t[n],n,t);else for(var i in t)t.hasOwnProperty(i)&&e.call(r,t[i],i,t)}function he(t,e,r){if(!t)return[];if(!e)return Nu(t);if(t.map&&t.map===Iw)return t.map(e,r);for(var n=[],a=0,i=t.length;a<i;a++)n.push(e.call(r,t[a],a,t));return n}function ni(t,e,r,n){if(t&&e){for(var a=0,i=t.length;a<i;a++)r=e.call(n,r,t[a],a,t);return r}}function bt(t,e,r){if(!t)return[];if(!e)return Nu(t);if(t.filter&&t.filter===Dw)return t.filter(e,r);for(var n=[],a=0,i=t.length;a<i;a++)e.call(r,t[a],a,t)&&n.push(t[a]);return n}function at(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}function Rw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return function(){return t.apply(e,r.concat(Pu.call(arguments)))}}var Ne=$s&&ke($s.bind)?$s.call.bind($s.bind):Rw;function dt(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(Pu.call(arguments)))}}function ee(t){return Array.isArray?Array.isArray(t):ro.call(t)==="[object Array]"}function ke(t){return typeof t=="function"}function ae(t){return typeof t=="string"}function Ou(t){return ro.call(t)==="[object String]"}function et(t){return typeof t=="number"}function de(t){var e=typeof t;return e==="function"||!!t&&e==="object"}function yv(t){return!!pv[ro.call(t)]}function Ut(t){return!!vv[ro.call(t)]}function no(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function Ws(t){return t.colorStops!=null}function Ew(t){return t.image!=null}function qs(t){return t!==t}function ao(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=t.length;r<n;r++)if(t[r]!=null)return t[r]}function Pe(t,e){return t??e}function Ys(t,e,r){return t??e??r}function Nu(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return Pu.apply(t,e)}function _v(t){if(typeof t=="number")return[t,t,t,t];var e=t.length;return e===2?[t[0],t[1],t[0],t[1]]:e===3?[t[0],t[1],t[2],t[1]]:t}function dn(t,e){if(!t)throw new Error(e)}function Gr(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var bv="__ec_primitive__";function Bu(t){t[bv]=!0}function io(t){return t[bv]}var Ow=(function(){function t(){this.data={}}return t.prototype.delete=function(e){var r=this.has(e);return r&&delete this.data[e],r},t.prototype.has=function(e){return this.data.hasOwnProperty(e)},t.prototype.get=function(e){return this.data[e]},t.prototype.set=function(e,r){return this.data[e]=r,this},t.prototype.keys=function(){return at(this.data)},t.prototype.forEach=function(e){var r=this.data;for(var n in r)r.hasOwnProperty(n)&&e(r[n],n)},t})(),xv=typeof Map=="function";function Nw(){return xv?new Map:new Ow}var Bw=(function(){function t(e){var r=ee(e);this.data=Nw();var n=this;e instanceof t?e.each(a):e&&I(e,a);function a(i,o){r?n.set(i,o):n.set(o,i)}}return t.prototype.hasKey=function(e){return this.data.has(e)},t.prototype.get=function(e){return this.data.get(e)},t.prototype.set=function(e,r){return this.data.set(e,r),r},t.prototype.each=function(e,r){this.data.forEach(function(n,a){e.call(r,n,a)})},t.prototype.keys=function(){var e=this.data.keys();return xv?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t})();function me(t){return new Bw(t)}function zw(t,e){for(var r=new t.constructor(t.length+e.length),n=0;n<t.length;n++)r[n]=t[n];for(var a=t.length,n=0;n<e.length;n++)r[n+a]=e[n];return r}function Xs(t,e){var r;if(Object.create)r=Object.create(t);else{var n=function(){};n.prototype=t,r=new n}return e&&q(r,e),r}function wv(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function la(t,e){return t.hasOwnProperty(e)}function Et(){}var Fw=180/Math.PI,Hw=(function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t})(),Vw=(function(){function t(){this.browser=new Hw,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return t})(),_e=new Vw;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(_e.wxa=!0,_e.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?_e.worker=!0:!_e.hasGlobalWindow||"Deno"in window?(_e.node=!0,_e.svgSupported=!0):Uw(navigator.userAgent,_e);function Uw(t,e){var r=e.browser,n=t.match(/Firefox\/([\d.]+)/),a=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),i=t.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(t);n&&(r.firefox=!0,r.version=n[1]),a&&(r.ie=!0,r.version=a[1]),i&&(r.edge=!0,r.version=i[1],r.newEdge=+i[1].split(".")[0]>18),o&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}var Gw=".",ca="___EC__COMPONENT__CONTAINER___",Sv="___EC__EXTENDED_CLASS___";function $r(t){var e={main:"",sub:""};if(t){var r=t.split(Gw);e.main=r[0]||"",e.sub=r[1]||""}return e}function $w(t){dn(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function Ww(t){return!!(t&&t[Sv])}function zu(t,e){t.$constructor=t,t.extend=function(r){var n=this,a;return qw(n)?a=(function(i){K(o,i);function o(){return i.apply(this,arguments)||this}return o})(n):(a=function(){(r.$constructor||n).apply(this,arguments)},Pw(a,this)),q(a.prototype,r),a[Sv]=!0,a.extend=this.extend,a.superCall=Zw,a.superApply=Kw,a.superClass=n,a}}function qw(t){return ke(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function kv(t,e){t.extend=e.extend}var Yw=Math.round(Math.random()*10);function Xw(t){var e=["__\0is_clz",Yw++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function Zw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.superClass.prototype[e].apply(t,r)}function Kw(t,e,r){return this.superClass.prototype[e].apply(t,r)}function Zs(t){var e={};t.registerClass=function(n){var a=n.type||n.prototype.type;if(a){$w(a),n.prototype.type=a;var i=$r(a);if(!i.sub)e[i.main]=n;else if(i.sub!==ca){var o=r(i);o[i.sub]=n}}return n},t.getClass=function(n,a,i){var o=e[n];if(o&&o[ca]&&(o=a?o[a]:null),i&&!o)throw new Error(a?"Component "+n+"."+(a||"")+" is used but not imported.":n+".type should be specified.");return o},t.getClassesByMainType=function(n){var a=$r(n),i=[],o=e[a.main];return o&&o[ca]?I(o,function(s,l){l!==ca&&i.push(s)}):i.push(o),i},t.hasClass=function(n){var a=$r(n);return!!e[a.main]},t.getAllClassMainTypes=function(){var n=[];return I(e,function(a,i){n.push(i)}),n},t.hasSubTypes=function(n){var a=$r(n),i=e[a.main];return i&&i[ca]};function r(n){var a=e[n.main];return(!a||!a[ca])&&(a=e[n.main]={},a[ca]=!0),a}}function oo(t,e){for(var r=0;r<t.length;r++)t[r][1]||(t[r][1]=t[r][0]);return e=e||!1,function(n,a,i){for(var o={},s=0;s<t.length;s++){var l=t[s][1];if(!(a&&Ue(a,l)>=0||i&&Ue(i,l)<0)){var c=n.getShallow(l,e);c!=null&&(o[t[s][0]]=c)}}return o}}var jw=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Jw=oo(jw),Qw=(function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return Jw(this,e,r)},t})(),Tv=(function(){function t(e){this.value=e}return t})(),eS=(function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new Tv(e);return this.insertEntry(r),r},t.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},t.prototype.remove=function(e){var r=e.prev,n=e.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t})(),so=(function(){function t(e){this._list=new eS,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var n=this._list,a=this._map,i=null;if(a[e]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete a[l.key],i=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new Tv(r),s.key=e,n.insertEntry(s),a[e]=s}return i},t.prototype.get=function(e){var r=this._map[e],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t})(),Fu=new so(50);function tS(t){if(typeof t=="string"){var e=Fu.get(t);return e&&e.image}else return t}function Cv(t,e,r,n,a){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var i=Fu.get(t),o={hostEl:r,cb:n,cbPayload:a};return i?(e=i.image,!Ks(e)&&i.pending.push(o)):(e=ri.loadImage(t,Mv,Mv),e.__zrImageSrc=t,Fu.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function Mv(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var r=t.pending[e],n=r.cb;n&&n(this,r.cbPayload),r.hostEl.dirty()}t.pending.length=0}function Ks(t){return t&&t.width&&t.height}function ai(){return[1,0,0,1,0,0]}function Hu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function rS(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function ii(t,e,r){var n=e[0]*r[0]+e[2]*r[1],a=e[1]*r[0]+e[3]*r[1],i=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t}function Vu(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Uu(t,e,r,n){n===void 0&&(n=[0,0]);var a=e[0],i=e[2],o=e[4],s=e[1],l=e[3],c=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=a*f+s*u,t[1]=-a*u+s*f,t[2]=i*f+l*u,t[3]=-i*u+f*l,t[4]=f*(o-n[0])+u*(c-n[1])+n[0],t[5]=f*(c-n[1])-u*(o-n[0])+n[1],t}function nS(t,e,r){var n=r[0],a=r[1];return t[0]=e[0]*n,t[1]=e[1]*a,t[2]=e[2]*n,t[3]=e[3]*a,t[4]=e[4]*n,t[5]=e[5]*a,t}function Gu(t,e){var r=e[0],n=e[2],a=e[4],i=e[1],o=e[3],s=e[5],l=r*o-i*n;return l?(l=1/l,t[0]=o*l,t[1]=-i*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*a)*l,t[5]=(i*a-r*s)*l,t):null}var Je=(function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,n=this.y-e.y;return Math.sqrt(r*r+n*n)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,n=this.y-e.y;return r*r+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,n=this.y;return this.x=e[0]*r+e[2]*n+e[4],this.y=e[1]*r+e[3]*n+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,n){e.x=r,e.y=n},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,n){e.x=r.x+n.x,e.y=r.y+n.y},t.sub=function(e,r,n){e.x=r.x-n.x,e.y=r.y-n.y},t.scale=function(e,r,n){e.x=r.x*n,e.y=r.y*n},t.scaleAndAdd=function(e,r,n,a){e.x=r.x+n.x*a,e.y=r.y+n.y*a},t.lerp=function(e,r,n,a){var i=1-a;e.x=i*r.x+a*n.x,e.y=i*r.y+a*n.y},t})(),js=Math.min,Js=Math.max,ua=new Je,fa=new Je,da=new Je,ha=new Je,lo=new Je,co=new Je,Ge=(function(){function t(e,r,n,a){n<0&&(e=e+n,n=-n),a<0&&(r=r+a,a=-a),this.x=e,this.y=r,this.width=n,this.height=a}return t.prototype.union=function(e){var r=js(e.x,this.x),n=js(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Js(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Js(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=r,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){var r=this,n=e.width/r.width,a=e.height/r.height,i=ai();return Vu(i,i,[-r.x,-r.y]),nS(i,i,[n,a]),Vu(i,i,[e.x,e.y]),i},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var n=this,a=n.x,i=n.x+n.width,o=n.y,s=n.y+n.height,l=e.x,c=e.x+e.width,u=e.y,f=e.y+e.height,h=!(i<l||c<a||s<u||f<o);if(r){var d=1/0,p=0,m=Math.abs(i-l),g=Math.abs(c-a),v=Math.abs(s-u),y=Math.abs(f-o),b=Math.min(m,g),x=Math.min(v,y);i<l||c<a?b>p&&(p=b,m<g?Je.set(co,-m,0):Je.set(co,g,0)):b<d&&(d=b,m<g?Je.set(lo,m,0):Je.set(lo,-g,0)),s<u||f<o?x>p&&(p=x,v<y?Je.set(co,0,-v):Je.set(co,0,y)):b<d&&(d=b,v<y?Je.set(lo,0,v):Je.set(lo,0,-y))}return r&&Je.copy(r,h?lo:co),h},t.prototype.contain=function(e,r){var n=this;return e>=n.x&&e<=n.x+n.width&&r>=n.y&&r<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(e,r){e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height},t.applyTransform=function(e,r,n){if(!n){e!==r&&t.copy(e,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var a=n[0],i=n[3],o=n[4],s=n[5];e.x=r.x*a+o,e.y=r.y*i+s,e.width=r.width*a,e.height=r.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}ua.x=da.x=r.x,ua.y=ha.y=r.y,fa.x=ha.x=r.x+r.width,fa.y=da.y=r.y+r.height,ua.transform(n),ha.transform(n),fa.transform(n),da.transform(n),e.x=js(ua.x,fa.x,da.x,ha.x),e.y=js(ua.y,fa.y,da.y,ha.y);var l=Js(ua.x,fa.x,da.x,ha.x),c=Js(ua.y,fa.y,da.y,ha.y);e.width=l-e.x,e.height=c-e.y},t})(),Av={};function ar(t,e){e=e||sa;var r=Av[e];r||(r=Av[e]=new so(500));var n=r.get(t);return n==null&&(n=ri.measureText(t,e).width,r.put(t,n)),n}function Dv(t,e,r,n){var a=ar(t,e),i=Wu(e),o=uo(0,a,r),s=oi(0,i,n),l=new Ge(o,s,a,i);return l}function $u(t,e,r,n){var a=((t||"")+"").split(`
|
|
6
|
+
`),i=a.length;if(i===1)return Dv(a[0],e,r,n);for(var o=new Ge(0,0,0,0),s=0;s<a.length;s++){var l=Dv(a[s],e,r,n);s===0?o.copy(l):o.union(l)}return o}function uo(t,e,r){return r==="right"?t-=e:r==="center"&&(t-=e/2),t}function oi(t,e,r){return r==="middle"?t-=e/2:r==="bottom"&&(t-=e),t}function Wu(t){return ar("国",t)}function Pn(t,e){return typeof t=="string"?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function Qs(t,e,r){var n=e.position||"inside",a=e.distance!=null?e.distance:5,i=r.height,o=r.width,s=i/2,l=r.x,c=r.y,u="left",f="top";if(n instanceof Array)l+=Pn(n[0],r.width),c+=Pn(n[1],r.height),u=null,f=null;else switch(n){case"left":l-=a,c+=s,u="right",f="middle";break;case"right":l+=a+o,c+=s,f="middle";break;case"top":l+=o/2,c-=a,u="center",f="bottom";break;case"bottom":l+=o/2,c+=i+a,u="center";break;case"inside":l+=o/2,c+=s,u="center",f="middle";break;case"insideLeft":l+=a,c+=s,f="middle";break;case"insideRight":l+=o-a,c+=s,u="right",f="middle";break;case"insideTop":l+=o/2,c+=a,u="center";break;case"insideBottom":l+=o/2,c+=i-a,u="center",f="bottom";break;case"insideTopLeft":l+=a,c+=a;break;case"insideTopRight":l+=o-a,c+=a,u="right";break;case"insideBottomLeft":l+=a,c+=i-a,f="bottom";break;case"insideBottomRight":l+=o-a,c+=i-a,u="right",f="bottom";break}return t=t||{},t.x=l,t.y=c,t.align=u,t.verticalAlign=f,t}var qu=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function aS(t,e,r,n,a,i){if(!r){t.text="",t.isTruncated=!1;return}var o=(e+"").split(`
|
|
7
|
+
`);i=Iv(r,n,a,i);for(var s=!1,l={},c=0,u=o.length;c<u;c++)Lv(l,o[c],i),o[c]=l.textLine,s=s||l.isTruncated;t.text=o.join(`
|
|
8
|
+
`),t.isTruncated=s}function Iv(t,e,r,n){n=n||{};var a=q({},n);a.font=e,r=Pe(r,"..."),a.maxIterations=Pe(n.maxIterations,2);var i=a.minChar=Pe(n.minChar,0);a.cnCharWidth=ar("国",e);var o=a.ascCharWidth=ar("a",e);a.placeholder=Pe(n.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;l<i&&s>=o;l++)s-=o;var c=ar(r,e);return c>s&&(r="",c=0),s=t-c,a.ellipsis=r,a.ellipsisWidth=c,a.contentWidth=s,a.containerWidth=t,a}function Lv(t,e,r){var n=r.containerWidth,a=r.font,i=r.contentWidth;if(!n){t.textLine="",t.isTruncated=!1;return}var o=ar(e,a);if(o<=n){t.textLine=e,t.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){e+=r.ellipsis;break}var l=s===0?iS(e,i,r.ascCharWidth,r.cnCharWidth):o>0?Math.floor(e.length*i/o):0;e=e.substr(0,l),o=ar(e,a)}e===""&&(e=r.placeholder),t.textLine=e,t.isTruncated=!0}function iS(t,e,r,n){for(var a=0,i=0,o=t.length;i<o&&a<e;i++){var s=t.charCodeAt(i);a+=0<=s&&s<=127?r:n}return i}function oS(t,e){t!=null&&(t+="");var r=e.overflow,n=e.padding,a=e.font,i=r==="truncate",o=Wu(a),s=Pe(e.lineHeight,o),l=!!e.backgroundColor,c=e.lineOverflow==="truncate",u=!1,f=e.width,h;f!=null&&(r==="break"||r==="breakAll")?h=t?Rv(t,e.font,f,r==="breakAll",0).lines:[]:h=t?t.split(`
|
|
9
|
+
`):[];var d=h.length*s,p=Pe(e.height,d);if(d>p&&c){var m=Math.floor(p/s);u=u||h.length>m,h=h.slice(0,m)}if(t&&i&&f!=null)for(var g=Iv(f,a,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),v={},y=0;y<h.length;y++)Lv(v,h[y],g),h[y]=v.textLine,u=u||v.isTruncated;for(var b=p,x=0,y=0;y<h.length;y++)x=Math.max(ar(h[y],a),x);f==null&&(f=x);var w=x;return n&&(b+=n[0]+n[2],w+=n[1]+n[3],f+=n[1]+n[3]),l&&(w=f),{lines:h,height:p,outerWidth:w,outerHeight:b,lineHeight:s,calculatedLineHeight:o,contentWidth:x,contentHeight:d,width:f,isTruncated:u}}var sS=(function(){function t(){}return t})(),Pv=(function(){function t(e){this.tokens=[],e&&(this.tokens=e)}return t})(),lS=(function(){function t(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return t})();function cS(t,e){var r=new lS;if(t!=null&&(t+=""),!t)return r;for(var n=e.width,a=e.height,i=e.overflow,o=(i==="break"||i==="breakAll")&&n!=null?{width:n,accumWidth:0,breakAll:i==="breakAll"}:null,s=qu.lastIndex=0,l;(l=qu.exec(t))!=null;){var c=l.index;c>s&&Yu(r,t.substring(s,c),e,o),Yu(r,l[2],e,o,l[1]),s=qu.lastIndex}s<t.length&&Yu(r,t.substring(s,t.length),e,o);var u=[],f=0,h=0,d=e.padding,p=i==="truncate",m=e.lineOverflow==="truncate",g={};function v(H,Z,re){H.width=Z,H.lineHeight=re,f+=re,h=Math.max(h,Z)}e:for(var y=0;y<r.lines.length;y++){for(var b=r.lines[y],x=0,w=0,S=0;S<b.tokens.length;S++){var k=b.tokens[S],C=k.styleName&&e.rich[k.styleName]||{},A=k.textPadding=C.padding,M=A?A[1]+A[3]:0,T=k.font=C.font||e.font;k.contentHeight=Wu(T);var D=Pe(C.height,k.contentHeight);if(k.innerHeight=D,A&&(D+=A[0]+A[2]),k.height=D,k.lineHeight=Ys(C.lineHeight,e.lineHeight,D),k.align=C&&C.align||e.align,k.verticalAlign=C&&C.verticalAlign||"middle",m&&a!=null&&f+k.lineHeight>a){var L=r.lines.length;S>0?(b.tokens=b.tokens.slice(0,S),v(b,w,x),r.lines=r.lines.slice(0,y+1)):r.lines=r.lines.slice(0,y),r.isTruncated=r.isTruncated||r.lines.length<L;break e}var R=C.width,O=R==null||R==="auto";if(typeof R=="string"&&R.charAt(R.length-1)==="%")k.percentWidth=R,u.push(k),k.contentWidth=ar(k.text,T);else{if(O){var B=C.backgroundColor,j=B&&B.image;j&&(j=tS(j),Ks(j)&&(k.width=Math.max(k.width,j.width*D/j.height)))}var P=p&&n!=null?n-w:null;P!=null&&P<k.width?!O||P<M?(k.text="",k.width=k.contentWidth=0):(aS(g,k.text,P-M,T,e.ellipsis,{minChar:e.truncateMinChar}),k.text=g.text,r.isTruncated=r.isTruncated||g.isTruncated,k.width=k.contentWidth=ar(k.text,T)):k.contentWidth=ar(k.text,T)}k.width+=M,w+=k.width,C&&(x=Math.max(x,k.lineHeight))}v(b,w,x)}r.outerWidth=r.width=Pe(n,h),r.outerHeight=r.height=Pe(a,f),r.contentHeight=f,r.contentWidth=h,d&&(r.outerWidth+=d[1]+d[3],r.outerHeight+=d[0]+d[2]);for(var y=0;y<u.length;y++){var k=u[y],V=k.percentWidth;k.width=parseInt(V,10)/100*r.width}return r}function Yu(t,e,r,n,a){var i=e==="",o=a&&r.rich[a]||{},s=t.lines,l=o.font||r.font,c=!1,u,f;if(n){var h=o.padding,d=h?h[1]+h[3]:0;if(o.width!=null&&o.width!=="auto"){var p=Pn(o.width,n.width)+d;s.length>0&&p+n.accumWidth>n.width&&(u=e.split(`
|
|
10
|
+
`),c=!0),n.accumWidth=p}else{var m=Rv(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+d,f=m.linesWidths,u=m.lines}}else u=e.split(`
|
|
11
|
+
`);for(var g=0;g<u.length;g++){var v=u[g],y=new sS;if(y.styleName=a,y.text=v,y.isLineHolder=!v&&!i,typeof o.width=="number"?y.width=o.width:y.width=f?f[g]:ar(v,l),!g&&!c){var b=(s[s.length-1]||(s[0]=new Pv)).tokens,x=b.length;x===1&&b[0].isLineHolder?b[0]=y:(v||!x||i)&&b.push(y)}else s.push(new Pv([y]))}}function uS(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var fS=ni(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function dS(t){return uS(t)?!!fS[t]:!0}function Rv(t,e,r,n,a){for(var i=[],o=[],s="",l="",c=0,u=0,f=0;f<t.length;f++){var h=t.charAt(f);if(h===`
|
|
12
|
+
`){l&&(s+=l,u+=c),i.push(s),o.push(u),s="",l="",c=0,u=0;continue}var d=ar(h,e),p=n?!1:!dS(h);if(i.length?u+d>r:a+u+d>r){u?(s||l)&&(p?(s||(s=l,l="",c=0,u=c),i.push(s),o.push(u-c),l+=h,c+=d,s="",u=c):(l&&(s+=l,l="",c=0),i.push(s),o.push(u),s=h,u=d)):p?(i.push(l),o.push(c),l=h,c=d):(i.push(h),o.push(d));continue}u+=d,p?(l+=h,c+=d):(l&&(s+=l,l="",c=0),s+=h)}return!i.length&&!s&&(s=t,l="",c=0),l&&(s+=l),s&&(i.push(s),o.push(u)),i.length===1&&(u+=a),{accumWidth:u,lines:i,linesWidths:o}}function si(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function hS(t){return[t[0],t[1]]}function Ev(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function pS(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function vS(t){return Math.sqrt(gS(t))}function gS(t){return t[0]*t[0]+t[1]*t[1]}function Xu(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function mS(t,e){var r=vS(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function Zu(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var yS=Zu;function _S(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var li=_S;function dr(t,e,r){var n=e[0],a=e[1];return t[0]=r[0]*n+r[2]*a+r[4],t[1]=r[1]*n+r[3]*a+r[5],t}function ci(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ui(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var Ov=Hu,Nv=5e-5;function pa(t){return t>Nv||t<-Nv}var va=[],fi=[],Ku=ai(),ju=Math.abs,Ju=(function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return pa(this.rotation)||pa(this.x)||pa(this.y)||pa(this.scaleX-1)||pa(this.scaleY-1)||pa(this.skewX)||pa(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(Ov(n),this.invTransform=null);return}n=n||ai(),r?this.getLocalTransform(n):Ov(n),e&&(r?ii(n,e,n):rS(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(va);var n=va[0]<0?-1:1,a=va[1]<0?-1:1,i=((va[0]-n)*r+n)/va[0]||0,o=((va[1]-a)*r+a)/va[1]||0;e[0]*=i,e[1]*=i,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||ai(),Gu(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],a=Math.atan2(e[1],e[0]),i=Math.PI/2+a-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),r=Math.sqrt(r),this.skewX=i,this.skewY=0,this.rotation=-a,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||ai(),ii(fi,e.invTransform,r),r=fi);var n=this.originX,a=this.originY;(n||a)&&(Ku[4]=n,Ku[5]=a,ii(fi,r,Ku),fi[4]-=n,fi[5]-=a,r=fi),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var n=[e,r],a=this.invTransform;return a&&dr(n,n,a),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],a=this.transform;return a&&dr(n,n,a),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&ju(e[0]-1)>1e-10&&ju(e[3]-1)>1e-10?Math.sqrt(ju(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){bS(this,e)},t.getLocalTransform=function(e,r){r=r||[];var n=e.originX||0,a=e.originY||0,i=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,c=e.rotation||0,u=e.x,f=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||a||s||l){var p=n+s,m=a+l;r[4]=-p*i-h*m*o,r[5]=-m*o-d*p*i}else r[4]=r[5]=0;return r[0]=i,r[3]=o,r[1]=d*i,r[2]=h*o,c&&Uu(r,r,c),r[4]+=n+u,r[5]+=a+f,r},t.initDefaultProps=(function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0})(),t})(),fo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function bS(t,e){for(var r=0;r<fo.length;r++){var n=fo[r];t[n]=e[n]}}var ho={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},elasticOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},elasticInOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-ho.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?ho.bounceIn(t*2)*.5:ho.bounceOut(t*2-1)*.5+.5}},el=Math.pow,Rn=Math.sqrt,tl=1e-8,Bv=1e-4,zv=Rn(3),rl=1/3,Wr=si(),hr=si(),di=si();function En(t){return t>-tl&&t<tl}function Fv(t){return t>tl||t<-tl}function wt(t,e,r,n,a){var i=1-a;return i*i*(i*t+3*a*e)+a*a*(a*n+3*i*r)}function Hv(t,e,r,n,a){var i=1-a;return 3*(((e-t)*i+2*(r-e)*a)*i+(n-r)*a*a)}function nl(t,e,r,n,a,i){var o=n+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),c=t-a,u=s*s-3*o*l,f=s*l-9*o*c,h=l*l-3*s*c,d=0;if(En(u)&&En(f))if(En(s))i[0]=0;else{var p=-l/s;p>=0&&p<=1&&(i[d++]=p)}else{var m=f*f-4*u*h;if(En(m)){var g=f/u,p=-s/o+g,v=-g/2;p>=0&&p<=1&&(i[d++]=p),v>=0&&v<=1&&(i[d++]=v)}else if(m>0){var y=Rn(m),b=u*s+1.5*o*(-f+y),x=u*s+1.5*o*(-f-y);b<0?b=-el(-b,rl):b=el(b,rl),x<0?x=-el(-x,rl):x=el(x,rl);var p=(-s-(b+x))/(3*o);p>=0&&p<=1&&(i[d++]=p)}else{var w=(2*u*s-3*o*f)/(2*Rn(u*u*u)),S=Math.acos(w)/3,k=Rn(u),C=Math.cos(S),p=(-s-2*k*C)/(3*o),v=(-s+k*(C+zv*Math.sin(S)))/(3*o),A=(-s+k*(C-zv*Math.sin(S)))/(3*o);p>=0&&p<=1&&(i[d++]=p),v>=0&&v<=1&&(i[d++]=v),A>=0&&A<=1&&(i[d++]=A)}}return d}function Vv(t,e,r,n,a){var i=6*r-12*e+6*t,o=9*e+3*n-3*t-9*r,s=3*e-3*t,l=0;if(En(o)){if(Fv(i)){var c=-s/i;c>=0&&c<=1&&(a[l++]=c)}}else{var u=i*i-4*o*s;if(En(u))a[0]=-i/(2*o);else if(u>0){var f=Rn(u),c=(-i+f)/(2*o),h=(-i-f)/(2*o);c>=0&&c<=1&&(a[l++]=c),h>=0&&h<=1&&(a[l++]=h)}}return l}function al(t,e,r,n,a,i){var o=(e-t)*a+t,s=(r-e)*a+e,l=(n-r)*a+r,c=(s-o)*a+o,u=(l-s)*a+s,f=(u-c)*a+c;i[0]=t,i[1]=o,i[2]=c,i[3]=f,i[4]=f,i[5]=u,i[6]=l,i[7]=n}function xS(t,e,r,n,a,i,o,s,l,c,u){var f,h=.005,d=1/0,p,m,g,v;Wr[0]=l,Wr[1]=c;for(var y=0;y<1;y+=.05)hr[0]=wt(t,r,a,o,y),hr[1]=wt(e,n,i,s,y),g=li(Wr,hr),g<d&&(f=y,d=g);d=1/0;for(var b=0;b<32&&!(h<Bv);b++)p=f-h,m=f+h,hr[0]=wt(t,r,a,o,p),hr[1]=wt(e,n,i,s,p),g=li(hr,Wr),p>=0&&g<d?(f=p,d=g):(di[0]=wt(t,r,a,o,m),di[1]=wt(e,n,i,s,m),v=li(di,Wr),m<=1&&v<d?(f=m,d=v):h*=.5);return Rn(d)}function wS(t,e,r,n,a,i,o,s,l){for(var c=t,u=e,f=0,h=1/l,d=1;d<=l;d++){var p=d*h,m=wt(t,r,a,o,p),g=wt(e,n,i,s,p),v=m-c,y=g-u;f+=Math.sqrt(v*v+y*y),c=m,u=g}return f}function Gt(t,e,r,n){var a=1-n;return a*(a*t+2*n*e)+n*n*r}function Uv(t,e,r,n){return 2*((1-n)*(e-t)+n*(r-e))}function SS(t,e,r,n,a){var i=t-2*e+r,o=2*(e-t),s=t-n,l=0;if(En(i)){if(Fv(o)){var c=-s/o;c>=0&&c<=1&&(a[l++]=c)}}else{var u=o*o-4*i*s;if(En(u)){var c=-o/(2*i);c>=0&&c<=1&&(a[l++]=c)}else if(u>0){var f=Rn(u),c=(-o+f)/(2*i),h=(-o-f)/(2*i);c>=0&&c<=1&&(a[l++]=c),h>=0&&h<=1&&(a[l++]=h)}}return l}function Gv(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function il(t,e,r,n,a){var i=(e-t)*n+t,o=(r-e)*n+e,s=(o-i)*n+i;a[0]=t,a[1]=i,a[2]=s,a[3]=s,a[4]=o,a[5]=r}function kS(t,e,r,n,a,i,o,s,l){var c,u=.005,f=1/0;Wr[0]=o,Wr[1]=s;for(var h=0;h<1;h+=.05){hr[0]=Gt(t,r,a,h),hr[1]=Gt(e,n,i,h);var d=li(Wr,hr);d<f&&(c=h,f=d)}f=1/0;for(var p=0;p<32&&!(u<Bv);p++){var m=c-u,g=c+u;hr[0]=Gt(t,r,a,m),hr[1]=Gt(e,n,i,m);var d=li(hr,Wr);if(m>=0&&d<f)c=m,f=d;else{di[0]=Gt(t,r,a,g),di[1]=Gt(e,n,i,g);var v=li(di,Wr);g<=1&&v<f?(c=g,f=v):u*=.5}}return Rn(f)}function TS(t,e,r,n,a,i,o){for(var s=t,l=e,c=0,u=1/o,f=1;f<=o;f++){var h=f*u,d=Gt(t,r,a,h),p=Gt(e,n,i,h),m=d-s,g=p-l;c+=Math.sqrt(m*m+g*g),s=d,l=p}return c}var CS=/cubic-bezier\(([0-9,\.e ]+)\)/;function $v(t){var e=t&&CS.exec(t);if(e){var r=e[1].split(","),n=+Gr(r[0]),a=+Gr(r[1]),i=+Gr(r[2]),o=+Gr(r[3]);if(isNaN(n+a+i+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:nl(0,n,i,1,l,s)&&wt(0,a,o,1,s[0])}}}var MS=(function(){function t(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Et,this.ondestroy=e.ondestroy||Et,this.onrestart=e.onrestart||Et,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,a=e-this._startTime-this._pausedTime,i=a/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,s=o?o(i):i;if(this.onframe(s),i===1)if(this.loop){var l=a%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ke(e)?e:ho[e]||$v(e)},t})(),Wv={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function On(t){return t=Math.round(t),t<0?0:t>255?255:t}function Qu(t){return t<0?0:t>1?1:t}function ef(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?On(parseFloat(e)/100*255):On(parseInt(e,10))}function po(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Qu(parseFloat(e)/100):Qu(parseFloat(e))}function tf(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(.6666666666666666-r)*6:t}function ol(t,e,r){return t+(e-t)*r}function pr(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}function rf(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var qv=new so(20),sl=null;function hi(t,e){sl&&rf(sl,e),sl=qv.put(t,sl||e.slice())}function hn(t,e){if(t){e=e||[];var r=qv.get(t);if(r)return rf(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in Wv)return rf(e,Wv[n]),hi(t,e),e;var a=n.length;if(n.charAt(0)==="#"){if(a===4||a===5){var i=parseInt(n.slice(1,4),16);if(!(i>=0&&i<=4095)){pr(e,0,0,0,1);return}return pr(e,(i&3840)>>4|(i&3840)>>8,i&240|(i&240)>>4,i&15|(i&15)<<4,a===5?parseInt(n.slice(4),16)/15:1),hi(t,e),e}else if(a===7||a===9){var i=parseInt(n.slice(1,7),16);if(!(i>=0&&i<=16777215)){pr(e,0,0,0,1);return}return pr(e,(i&16711680)>>16,(i&65280)>>8,i&255,a===9?parseInt(n.slice(7),16)/255:1),hi(t,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===a){var l=n.substr(0,o),c=n.substr(o+1,s-(o+1)).split(","),u=1;switch(l){case"rgba":if(c.length!==4)return c.length===3?pr(e,+c[0],+c[1],+c[2],1):pr(e,0,0,0,1);u=po(c.pop());case"rgb":if(c.length>=3)return pr(e,ef(c[0]),ef(c[1]),ef(c[2]),c.length===3?u:po(c[3])),hi(t,e),e;pr(e,0,0,0,1);return;case"hsla":if(c.length!==4){pr(e,0,0,0,1);return}return c[3]=po(c[3]),Yv(c,e),hi(t,e),e;case"hsl":if(c.length!==3){pr(e,0,0,0,1);return}return Yv(c,e),hi(t,e),e;default:return}}pr(e,0,0,0,1)}}function Yv(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=po(t[1]),a=po(t[2]),i=a<=.5?a*(n+1):a+n-a*n,o=a*2-i;return e=e||[],pr(e,On(tf(o,i,r+.3333333333333333)*255),On(tf(o,i,r)*255),On(tf(o,i,r-.3333333333333333)*255),1),t.length===4&&(e[3]=t[3]),e}function Xv(t,e){var r=hn(t);if(r){for(var n=0;n<3;n++)r[n]=r[n]*(1-e)|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return ll(r,r.length===4?"rgba":"rgb")}}function AS(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var n=t*(e.length-1),a=Math.floor(n),i=Math.ceil(n),o=hn(e[a]),s=hn(e[i]),l=n-a,c=ll([On(ol(o[0],s[0],l)),On(ol(o[1],s[1],l)),On(ol(o[2],s[2],l)),Qu(ol(o[3],s[3],l))],"rgba");return r?{color:c,leftIndex:a,rightIndex:i,value:n}:c}}function ll(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function cl(t,e){var r=hn(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Zv=new so(100);function Kv(t){if(ae(t)){var e=Zv.get(t);return e||(e=Xv(t,-.1),Zv.put(t,e)),e}else if(Ws(t)){var r=q({},t);return r.colorStops=he(t.colorStops,function(n){return{offset:n.offset,color:Xv(n.color,-.1)}}),r}return t}function DS(t){return t.type==="linear"}function IS(t){return t.type==="radial"}(function(){return _e.hasGlobalWindow&&ke(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:typeof Buffer<"u"?function(t){return Buffer.from(t).toString("base64")}:function(t){return null}})();var nf=Array.prototype.slice;function pn(t,e,r){return(e-t)*r+t}function af(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=pn(e[i],r[i],n);return t}function LS(t,e,r,n){for(var a=e.length,i=a&&e[0].length,o=0;o<a;o++){t[o]||(t[o]=[]);for(var s=0;s<i;s++)t[o][s]=pn(e[o][s],r[o][s],n)}return t}function ul(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=e[i]+r[i]*n;return t}function jv(t,e,r,n){for(var a=e.length,i=a&&e[0].length,o=0;o<a;o++){t[o]||(t[o]=[]);for(var s=0;s<i;s++)t[o][s]=e[o][s]+r[o][s]*n}return t}function PS(t,e){for(var r=t.length,n=e.length,a=r>n?e:t,i=Math.min(r,n),o=a[i-1]||{color:[0,0,0,0],offset:0},s=i;s<Math.max(r,n);s++)a.push({offset:o.offset,color:o.color.slice()})}function RS(t,e,r){var n=t,a=e;if(!(!n.push||!a.push)){var i=n.length,o=a.length;if(i!==o){var s=i>o;if(s)n.length=o;else for(var l=i;l<o;l++)n.push(r===1?a[l]:nf.call(a[l]))}for(var c=n[0]&&n[0].length,l=0;l<n.length;l++)if(r===1)isNaN(n[l])&&(n[l]=a[l]);else for(var u=0;u<c;u++)isNaN(n[l][u])&&(n[l][u]=a[l][u])}}function fl(t){if(Vt(t)){var e=t.length;if(Vt(t[0])){for(var r=[],n=0;n<e;n++)r.push(nf.call(t[n]));return r}return nf.call(t)}return t}function dl(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=t[3]==null?1:t[3],"rgba("+t.join(",")+")"}function ES(t){return Vt(t&&t[0])?2:1}var hl=0,pl=1,Jv=2,vo=3,of=4,sf=5,Qv=6;function eg(t){return t===of||t===sf}function vl(t){return t===pl||t===Jv}var go=[0,0,0,0],OS=(function(){function t(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,n){this._needsSort=!0;var a=this.keyframes,i=a.length,o=!1,s=Qv,l=r;if(Vt(r)){var c=ES(r);s=c,(c===1&&!et(r[0])||c===2&&!et(r[0][0]))&&(o=!0)}else if(et(r)&&!qs(r))s=hl;else if(ae(r))if(!isNaN(+r))s=hl;else{var u=hn(r);u&&(l=u,s=vo)}else if(Ws(r)){var f=q({},l);f.colorStops=he(r.colorStops,function(d){return{offset:d.offset,color:hn(d.color)}}),DS(r)?s=of:IS(r)&&(s=sf),l=f}i===0?this.valType=s:(s!==this.valType||s===Qv)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=ke(n)?n:ho[n]||$v(n)),a.push(h),h},t.prototype.prepare=function(e,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,g){return m.time-g.time});for(var a=this.valType,i=n.length,o=n[i-1],s=this.discrete,l=vl(a),c=eg(a),u=0;u<i;u++){var f=n[u],h=f.value,d=o.value;f.percent=f.time/e,s||(l&&u!==i-1?RS(h,d,a):c&&PS(h.colorStops,d.colorStops))}if(!s&&a!==sf&&r&&this.needsAnimate()&&r.needsAnimate()&&a===r.valType&&!r._finished){this._additiveTrack=r;for(var p=n[0].value,u=0;u<i;u++)a===hl?n[u].additiveValue=n[u].value-p:a===vo?n[u].additiveValue=ul([],n[u].value,p,-1):vl(a)&&(n[u].additiveValue=a===pl?ul([],n[u].value,p,-1):jv([],n[u].value,p,-1))}},t.prototype.step=function(e,r){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n=this._additiveTrack!=null,a=n?"additiveValue":"value",i=this.valType,o=this.keyframes,s=o.length,l=this.propName,c=i===vo,u,f=this._lastFr,h=Math.min,d,p;if(s===1)d=p=o[0];else{if(r<0)u=0;else if(r<this._lastFrP){var m=h(f+1,s-1);for(u=m;u>=0&&!(o[u].percent<=r);u--);u=h(u,s-2)}else{for(u=f;u<s&&!(o[u].percent>r);u++);u=h(u-1,s-2)}p=o[u+1],d=o[u]}if(d&&p){this._lastFr=u,this._lastFrP=r;var g=p.percent-d.percent,v=g===0?1:h((r-d.percent)/g,1);p.easingFunc&&(v=p.easingFunc(v));var y=n?this._additiveValue:c?go:e[l];if((vl(i)||c)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=v<1?d.rawValue:p.rawValue;else if(vl(i))i===pl?af(y,d[a],p[a],v):LS(y,d[a],p[a],v);else if(eg(i)){var b=d[a],x=p[a],w=i===of;e[l]={type:w?"linear":"radial",x:pn(b.x,x.x,v),y:pn(b.y,x.y,v),colorStops:he(b.colorStops,function(k,C){var A=x.colorStops[C];return{offset:pn(k.offset,A.offset,v),color:dl(af([],k.color,A.color,v))}}),global:x.global},w?(e[l].x2=pn(b.x2,x.x2,v),e[l].y2=pn(b.y2,x.y2,v)):e[l].r=pn(b.r,x.r,v)}else if(c)af(y,d[a],p[a],v),n||(e[l]=dl(y));else{var S=pn(d[a],p[a],v);n?this._additiveValue=S:e[l]=S}n&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,n=this.propName,a=this._additiveValue;r===hl?e[n]=e[n]+a:r===vo?(hn(e[n],go),ul(go,go,a,1),e[n]=dl(go)):r===pl?ul(e[n],e[n],a,1):r===Jv&&jv(e[n],e[n],a,1)},t})(),lf=(function(){function t(e,r,n,a){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&a){Eu("Can' use additive animation on looped animation.");return}this._additiveAnimators=a,this._allowDiscrete=n}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,n){return this.whenWithKeys(e,r,at(r),n)},t.prototype.whenWithKeys=function(e,r,n,a){for(var i=this._tracks,o=0;o<n.length;o++){var s=n[o],l=i[s];if(!l){l=i[s]=new OS(s);var c=void 0,u=this._getAdditiveTrack(s);if(u){var f=u.keyframes,h=f[f.length-1];c=h&&h.value,u.valType===vo&&c&&(c=dl(c))}else c=this._target[s];if(c==null)continue;e>0&&l.addKeyframe(0,fl(c),a),this._trackKeys.push(s)}l.addKeyframe(e,fl(r[s]),a)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,n=0;n<r;n++)e[n].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,r=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,r)for(var n=0;n<r.length;n++)r[n].call(this)},t.prototype._setTracksFinished=function(){for(var e=this._tracks,r=this._trackKeys,n=0;n<r.length;n++)e[r[n]].setFinished()},t.prototype._getAdditiveTrack=function(e){var r,n=this._additiveAnimators;if(n)for(var a=0;a<n.length;a++){var i=n[a].getTrack(e);i&&(r=i)}return r},t.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var r=this,n=[],a=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],s=this._tracks[o],l=this._getAdditiveTrack(o),c=s.keyframes,u=c.length;if(s.prepare(a,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var f=c[u-1];f&&(r._target[s.propName]=f.rawValue),s.setFinished()}else n.push(s)}if(n.length||this._force){var h=new MS({life:a,loop:this._loop,delay:this._delay||0,onframe:function(d){r._started=2;var p=r._additiveAnimators;if(p){for(var m=!1,g=0;g<p.length;g++)if(p[g]._clip){m=!0;break}m||(r._additiveAnimators=null)}for(var g=0;g<n.length;g++)n[g].step(r._target,d);var v=r._onframeCbs;if(v)for(var g=0;g<v.length;g++)v[g](r._target,d)},ondestroy:function(){r._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},t.prototype.stop=function(e){if(this._clip){var r=this._clip;e&&r.onframe(1),this._abortedCallback()}},t.prototype.delay=function(e){return this._delay=e,this},t.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},t.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},t.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(e){return this._tracks[e]},t.prototype.getTracks=function(){var e=this;return he(this._trackKeys,function(r){return e._tracks[r]})},t.prototype.stopTracks=function(e,r){if(!e.length||!this._clip)return!0;for(var n=this._tracks,a=this._trackKeys,i=0;i<e.length;i++){var o=n[e[i]];o&&!o.isFinished()&&(r?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,i=0;i<a.length;i++)if(!n[a[i]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},t.prototype.saveTo=function(e,r,n){if(e){r=r||this._trackKeys;for(var a=0;a<r.length;a++){var i=r[a],o=this._tracks[i];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[n?0:s.length-1];l&&(e[i]=fl(l.rawValue))}}}},t.prototype.__changeFinalValue=function(e,r){r=r||at(e);for(var n=0;n<r.length;n++){var a=r[n],i=this._tracks[a];if(i){var o=i.keyframes;if(o.length>1){var s=o.pop();i.addKeyframe(s.time,e[a]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},t})(),Ir=(function(){function t(e){e&&(this._$eventProcessor=e)}return t.prototype.on=function(e,r,n,a){this._$handlers||(this._$handlers={});var i=this._$handlers;if(typeof r=="function"&&(a=n,n=r,r=null),!n||!e)return this;var o=this._$eventProcessor;r!=null&&o&&o.normalizeQuery&&(r=o.normalizeQuery(r)),i[e]||(i[e]=[]);for(var s=0;s<i[e].length;s++)if(i[e][s].h===n)return this;var l={h:n,query:r,ctx:a||this,callAtLast:n.zrEventfulCallAtLast},c=i[e].length-1,u=i[e][c];return u&&u.callAtLast?i[e].splice(c,0,l):i[e].push(l),this},t.prototype.isSilent=function(e){var r=this._$handlers;return!r||!r[e]||!r[e].length},t.prototype.off=function(e,r){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(r){if(n[e]){for(var a=[],i=0,o=n[e].length;i<o;i++)n[e][i].h!==r&&a.push(n[e][i]);n[e]=a}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},t.prototype.trigger=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var a=this._$handlers[e],i=this._$eventProcessor;if(a)for(var o=r.length,s=a.length,l=0;l<s;l++){var c=a[l];if(!(i&&i.filter&&c.query!=null&&!i.filter(e,c.query)))switch(o){case 0:c.h.call(c.ctx);break;case 1:c.h.call(c.ctx,r[0]);break;case 2:c.h.call(c.ctx,r[0],r[1]);break;default:c.h.apply(c.ctx,r);break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},t.prototype.triggerWithContext=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var a=this._$handlers[e],i=this._$eventProcessor;if(a)for(var o=r.length,s=r[o-1],l=a.length,c=0;c<l;c++){var u=a[c];if(!(i&&i.filter&&u.query!=null&&!i.filter(e,u.query)))switch(o){case 0:u.h.call(s);break;case 1:u.h.call(s,r[0]);break;case 2:u.h.call(s,r[0],r[1]);break;default:u.h.apply(s,r.slice(1,o-1));break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},t})(),tg=1;_e.hasGlobalWindow&&(tg=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var gl=tg,cf=.4,uf="#333",ff="#ccc",NS="#eee",ir=1,mo=2,pi=4,df="__zr_normal__",hf=fo.concat(["ignore"]),BS=ni(fo,function(t,e){return t[e]=!0,t},{ignore:!1}),vi={},zS=new Ge(0,0,0,0),ml=(function(){function t(e){this.id=mv(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var a=this.transform;a||(a=this.transform=[1,0,0,1,0,0]),a[4]+=e,a[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,a=n.local,i=r.innerTransformable,o=void 0,s=void 0,l=!1;i.parent=a?this:null;var c=!1;if(i.copyTransform(r),n.position!=null){var u=zS;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),a||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(vi,n,u):Qs(vi,n,u),i.x=vi.x,i.y=vi.y,o=vi.align,s=vi.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var h=void 0,d=void 0;f==="center"?(h=u.width*.5,d=u.height*.5):(h=Pn(f[0],u.width),d=Pn(f[1],u.height)),c=!0,i.originX=-i.x+h+(a?0:u.x),i.originY=-i.y+d+(a?0:u.y)}}n.rotation!=null&&(i.rotation=n.rotation);var p=n.offset;p&&(i.x+=p[0],i.y+=p[1],c||(i.originX=-p[0],i.originY=-p[1]));var m=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,y=void 0,b=void 0;m&&this.canBeInsideText()?(v=n.insideFill,y=n.insideStroke,(v==null||v==="auto")&&(v=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(v),b=!0)):(v=n.outsideFill,y=n.outsideStroke,(v==null||v==="auto")&&(v=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(v),b=!0)),v=v||"#000",(v!==g.fill||y!==g.stroke||b!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=v,g.stroke=y,g.autoStroke=b,g.align=o,g.verticalAlign=s,r.setDefaultTextStyle(g)),r.__dirty|=ir,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?ff:uf},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&hn(r);n||(n=[255,255,255,1]);for(var a=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*a+(i?0:255)*(1-a);return n[3]=1,ll(n,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},q(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(de(e))for(var n=e,a=at(n),i=0;i<a.length;i++){var o=a[i];this.attrKV(o,e[o])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var r=this._normalState,n=0;n<this.animators.length;n++){var a=this.animators[n],i=a.__fromStateTransition;if(!(a.getLoop()||i&&i!==df)){var o=a.targetName,s=o?r[o]:r;a.saveTo(s)}}},t.prototype._innerSaveToNormal=function(e){var r=this._normalState;r||(r=this._normalState={}),e.textConfig&&!r.textConfig&&(r.textConfig=this.textConfig),this._savePrimaryToNormal(e,r,hf)},t.prototype._savePrimaryToNormal=function(e,r,n){for(var a=0;a<n.length;a++){var i=n[a];e[i]!=null&&!(i in r)&&(r[i]=this[i])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(df,!1,e)},t.prototype.useState=function(e,r,n,a){var i=e===df,o=this.hasState();if(!(!o&&i)){var s=this.currentStates,l=this.stateTransition;if(!(Ue(s,e)>=0&&(r||s.length===1))){var c;if(this.stateProxy&&!i&&(c=this.stateProxy(e)),c||(c=this.states&&this.states[e]),!c&&!i){Eu("State "+e+" not exists.");return}i||this.saveCurrentToNormalState(c);var u=!!(c&&c.hoverLayer||a);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,c,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(e,r,n,u),h&&h.useState(e,r,n,u),i?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ir),c}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var a=[],i=this.currentStates,o=e.length,s=o===i.length;if(s){for(var l=0;l<o;l++)if(e[l]!==i[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var c=e[l],u=void 0;this.stateProxy&&(u=this.stateProxy(c,e)),u||(u=this.states[c]),u&&a.push(u)}var f=a[o-1],h=!!(f&&f.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(a),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!r&&!this.__inHover&&p&&p.duration>0,p);var m=this._textContent,g=this._textGuide;m&&m.useStates(e,r,h),g&&g.useStates(e,r,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ir)}},t.prototype.isSilent=function(){for(var e=this.silent,r=this.parent;!e&&r;){if(r.silent){e=!0;break}r=r.parent}return e},t.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var r=this.animators[e];r.targetName&&r.changeTarget(this[r.targetName])}},t.prototype.removeState=function(e){var r=Ue(this.currentStates,e);if(r>=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},t.prototype.replaceState=function(e,r,n){var a=this.currentStates.slice(),i=Ue(a,e),o=Ue(a,r)>=0;i>=0?o?a.splice(i,1):a[i]=r:n&&!o&&a.push(r),this.useStates(a)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},n,a=0;a<e.length;a++){var i=e[a];q(r,i),i.textConfig&&(n=n||{},q(n,i.textConfig))}return n&&(r.textConfig=n),r},t.prototype._applyStateObj=function(e,r,n,a,i,o){var s=!(r&&a);r&&r.textConfig?(this.textConfig=q({},a?this.textConfig:n.textConfig),q(this.textConfig,r.textConfig)):s&&n.textConfig&&(this.textConfig=n.textConfig);for(var l={},c=!1,u=0;u<hf.length;u++){var f=hf[u],h=i&&BS[f];r&&r[f]!=null?h?(c=!0,l[f]=r[f]):this[f]=r[f]:s&&n[f]!=null&&(h?(c=!0,l[f]=n[f]):this[f]=n[f])}if(!i)for(var u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(r||n)[p]:r||n)}c&&this._transitionState(e,l,o)},t.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var r=this.__zr;r&&e.addSelfToZr(r),e.__zr=r,e.__hostTarget=this}},t.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},t.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(e){var r=this._textContent;r!==e&&(r&&r!==e&&this.removeTextContent(),e.innerTransformable=new Ju,this._attachComponent(e),this._textContent=e,this.markRedraw())},t.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),q(this.textConfig,e),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=ir;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var r=this._textContent,n=this._textGuide;r&&(r.__inHover=e),n&&(n.__inHover=e)},t.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var r=this.animators;if(r)for(var n=0;n<r.length;n++)e.animation.addAnimator(r[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},t.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var r=this.animators;if(r)for(var n=0;n<r.length;n++)e.animation.removeAnimator(r[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},t.prototype.animate=function(e,r,n){var a=e?this[e]:this,i=new lf(a,r,n);return e&&(i.targetName=e),this.addAnimator(i,e),i},t.prototype.addAnimator=function(e,r){var n=this.__zr,a=this;e.during(function(){a.updateDuringAnimation(r)}).done(function(){var i=a.animators,o=Ue(i,e);o>=0&&i.splice(o,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var n=this.animators,a=n.length,i=[],o=0;o<a;o++){var s=n[o];!e||e===s.scope?s.stop(r):i.push(s)}return this.animators=i,this},t.prototype.animateTo=function(e,r,n){pf(this,e,r,n)},t.prototype.animateFrom=function(e,r,n){pf(this,e,r,n,!0)},t.prototype._transitionState=function(e,r,n,a){for(var i=pf(this,r,n,a),o=0;o<i.length;o++)i[o].__fromStateTransition=e},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=(function(){var e=t.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=ir;function r(n,a,i,o){Object.defineProperty(e,n,{get:function(){if(!this[a]){var l=this[a]=[];s(this,l)}return this[a]},set:function(l){this[i]=l[0],this[o]=l[1],this[a]=l,s(this,l)}});function s(l,c){Object.defineProperty(c,0,{get:function(){return l[i]},set:function(u){l[i]=u}}),Object.defineProperty(c,1,{get:function(){return l[o]},set:function(u){l[o]=u}})}}Object.defineProperty&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))})(),t})();Ur(ml,Ir),Ur(ml,Ju);function pf(t,e,r,n,a){r=r||{};var i=[];rg(t,"",t,e,r,n,i,a);var o=i.length,s=!1,l=r.done,c=r.aborted,u=function(){s=!0,o--,o<=0&&(s?l&&l():c&&c())},f=function(){o--,o<=0&&(s?l&&l():c&&c())};o||l&&l(),i.length>0&&r.during&&i[0].during(function(p,m){r.during(m)});for(var h=0;h<i.length;h++){var d=i[h];u&&d.done(u),f&&d.aborted(f),r.force&&d.duration(r.duration),d.start(r.easing)}return i}function vf(t,e,r){for(var n=0;n<r;n++)t[n]=e[n]}function FS(t){return Vt(t[0])}function HS(t,e,r){if(Vt(e[r]))if(Vt(t[r])||(t[r]=[]),Ut(e[r])){var n=e[r].length;t[r].length!==n&&(t[r]=new e[r].constructor(n),vf(t[r],e[r],n))}else{var a=e[r],i=t[r],o=a.length;if(FS(a))for(var s=a[0].length,l=0;l<o;l++)i[l]?vf(i[l],a[l],s):i[l]=Array.prototype.slice.call(a[l]);else vf(i,a,o);i.length=a.length}else t[r]=e[r]}function VS(t,e){return t===e||Vt(t)&&Vt(e)&&US(t,e)}function US(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function rg(t,e,r,n,a,i,o,s){for(var l=at(n),c=a.duration,u=a.delay,f=a.additive,h=a.setToFinal,d=!de(i),p=t.animators,m=[],g=0;g<l.length;g++){var v=l[g],y=n[v];if(y!=null&&r[v]!=null&&(d||i[v]))if(de(y)&&!Vt(y)&&!Ws(y)){if(e){s||(r[v]=y,t.updateDuringAnimation(e));continue}rg(t,v,r[v],y,a,i&&i[v],o,s)}else m.push(v);else s||(r[v]=y,t.updateDuringAnimation(e),m.push(v))}var b=m.length;if(!f&&b)for(var x=0;x<p.length;x++){var w=p[x];if(w.targetName===e){var S=w.stopTracks(m);if(S){var k=Ue(p,w);p.splice(k,1)}}}if(a.force||(m=bt(m,function(T){return!VS(n[T],r[T])}),b=m.length),b>0||a.force&&!o.length){var C=void 0,A=void 0,M=void 0;if(s){A={},h&&(C={});for(var x=0;x<b;x++){var v=m[x];A[v]=r[v],h?C[v]=n[v]:r[v]=n[v]}}else if(h){M={};for(var x=0;x<b;x++){var v=m[x];M[v]=fl(r[v]),HS(r,n,v)}}var w=new lf(r,!1,!1,f?bt(p,function(D){return D.targetName===e}):null);w.targetName=e,a.scope&&(w.scope=a.scope),h&&C&&w.whenWithKeys(0,C,m),M&&w.whenWithKeys(0,M,m),w.whenWithKeys(c??500,s?A:n,m).delay(u||0),t.addAnimator(w,e),o.push(w)}}var gf="__zr_style_"+Math.round(Math.random()*10),ga={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},yl={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};ga[gf]=!0;var ng=["z","z2","invisible"],GS=["invisible"],yo=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=at(r),a=0;a<n.length;a++){var i=n[a];i==="style"?this.useStyle(r[i]):t.prototype.attrKV.call(this,i,r[i])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(r,n,a,i){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&$S(this,r,n)||o&&!o[0]&&!o[3])return!1;if(a&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(i&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(r,n){return this.rectContain(r,n)},e.prototype.traverse=function(r,n){r.call(n,this)},e.prototype.rectContain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect();return i.contain(a[0],a[1])},e.prototype.getPaintRect=function(){var r=this._paintRect;if(!this._paintRect||this.__dirty){var n=this.transform,a=this.getBoundingRect(),i=this.style,o=i.shadowBlur||0,s=i.shadowOffsetX||0,l=i.shadowOffsetY||0;r=this._paintRect||(this._paintRect=new Ge(0,0,0,0)),n?Ge.applyTransform(r,a,n):r.copy(a),(o||s||l)&&(r.width+=o*2+Math.abs(s),r.height+=o*2+Math.abs(l),r.x=Math.min(r.x,r.x+s-o),r.y=Math.min(r.y,r.y+l-o));var c=this.dirtyRectTolerance;r.isZero()||(r.x=Math.floor(r.x-c),r.y=Math.floor(r.y-c),r.width=Math.ceil(r.width+1+c*2),r.height=Math.ceil(r.height+1+c*2))}return r},e.prototype.setPrevPaintRect=function(r){r?(this._prevPaintRect=this._prevPaintRect||new Ge(0,0,0,0),this._prevPaintRect.copy(r)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(r){return this.animate("style",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(r,n){r!=="style"?t.prototype.attrKV.call(this,r,n):this.style?this.setStyle(n):this.useStyle(n)},e.prototype.setStyle=function(r,n){return typeof r=="string"?this.style[r]=n:q(this.style,r),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(r){r||this.markRedraw(),this.__dirty|=mo,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&mo)},e.prototype.styleUpdated=function(){this.__dirty&=~mo},e.prototype.createStyle=function(r){return Xs(ga,r)},e.prototype.useStyle=function(r){r[gf]||(r=this.createStyle(r)),this.__inHover?this.__hoverStyle=r:this.style=r,this.dirtyStyle()},e.prototype.isStyleObject=function(r){return r[gf]},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(r,n,ng)},e.prototype._applyStateObj=function(r,n,a,i,o,s){t.prototype._applyStateObj.call(this,r,n,a,i,o,s);var l=!(n&&i),c;if(n&&n.style?o?i?c=n.style:(c=this._mergeStyle(this.createStyle(),a.style),this._mergeStyle(c,n.style)):(c=this._mergeStyle(this.createStyle(),i?this.style:a.style),this._mergeStyle(c,n.style)):l&&(c=a.style),c)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var f=at(u),h=0;h<f.length;h++){var d=f[h];d in c&&(c[d]=c[d],this.style[d]=u[d])}for(var p=at(c),h=0;h<p.length;h++){var d=p[h];this.style[d]=this.style[d]}this._transitionState(r,{style:c},s,this.getAnimationStyleProps())}else this.useStyle(c);for(var m=this.__inHover?GS:ng,h=0;h<m.length;h++){var d=m[h];n&&n[d]!=null?this[d]=n[d]:l&&a[d]!=null&&(this[d]=a[d])}},e.prototype._mergeStates=function(r){for(var n=t.prototype._mergeStates.call(this,r),a,i=0;i<r.length;i++){var o=r[i];o.style&&(a=a||{},this._mergeStyle(a,o.style))}return a&&(n.style=a),n},e.prototype._mergeStyle=function(r,n){return q(r,n),r},e.prototype.getAnimationStyleProps=function(){return yl},e.initDefaultProps=(function(){var r=e.prototype;r.type="displayable",r.invisible=!1,r.z=0,r.z2=0,r.zlevel=0,r.culling=!1,r.cursor="pointer",r.rectHover=!1,r.incremental=!1,r._rect=null,r.dirtyRectTolerance=0,r.__dirty=ir|mo})(),e})(ml),mf=new Ge(0,0,0,0),yf=new Ge(0,0,0,0);function $S(t,e,r){return mf.copy(t.getBoundingRect()),t.transform&&mf.applyTransform(t.transform),yf.width=e,yf.height=r,!mf.intersect(yf)}var vr=Math.min,gr=Math.max,_f=Math.sin,bf=Math.cos,ma=Math.PI*2,_l=si(),bl=si(),xl=si();function ag(t,e,r,n,a,i){a[0]=vr(t,r),a[1]=vr(e,n),i[0]=gr(t,r),i[1]=gr(e,n)}var ig=[],og=[];function WS(t,e,r,n,a,i,o,s,l,c){var u=Vv,f=wt,h=u(t,r,a,o,ig);l[0]=1/0,l[1]=1/0,c[0]=-1/0,c[1]=-1/0;for(var d=0;d<h;d++){var p=f(t,r,a,o,ig[d]);l[0]=vr(p,l[0]),c[0]=gr(p,c[0])}h=u(e,n,i,s,og);for(var d=0;d<h;d++){var m=f(e,n,i,s,og[d]);l[1]=vr(m,l[1]),c[1]=gr(m,c[1])}l[0]=vr(t,l[0]),c[0]=gr(t,c[0]),l[0]=vr(o,l[0]),c[0]=gr(o,c[0]),l[1]=vr(e,l[1]),c[1]=gr(e,c[1]),l[1]=vr(s,l[1]),c[1]=gr(s,c[1])}function qS(t,e,r,n,a,i,o,s){var l=Gv,c=Gt,u=gr(vr(l(t,r,a),1),0),f=gr(vr(l(e,n,i),1),0),h=c(t,r,a,u),d=c(e,n,i,f);o[0]=vr(t,a,h),o[1]=vr(e,i,d),s[0]=gr(t,a,h),s[1]=gr(e,i,d)}function YS(t,e,r,n,a,i,o,s,l){var c=ci,u=ui,f=Math.abs(a-i);if(f%ma<1e-4&&f>1e-4){s[0]=t-r,s[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(_l[0]=bf(a)*r+t,_l[1]=_f(a)*n+e,bl[0]=bf(i)*r+t,bl[1]=_f(i)*n+e,c(s,_l,bl),u(l,_l,bl),a=a%ma,a<0&&(a=a+ma),i=i%ma,i<0&&(i=i+ma),a>i&&!o?i+=ma:a<i&&o&&(a+=ma),o){var h=i;i=a,a=h}for(var d=0;d<i;d+=Math.PI/2)d>a&&(xl[0]=bf(d)*r+t,xl[1]=_f(d)*n+e,c(s,xl,s),u(l,xl,l))}var $e={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},ya=[],_a=[],qr=[],Nn=[],Yr=[],Xr=[],xf=Math.min,wf=Math.max,ba=Math.cos,xa=Math.sin,vn=Math.abs,Sf=Math.PI,Bn=Sf*2,kf=typeof Float32Array<"u",_o=[];function Tf(t){var e=Math.round(t/Sf*1e8)/1e8;return e%2*Sf}function XS(t,e){var r=Tf(t[0]);r<0&&(r+=Bn);var n=r-t[0],a=t[1];a+=n,!e&&a-r>=Bn?a=r+Bn:e&&r-a>=Bn?a=r-Bn:!e&&r>a?a=r+(Bn-Tf(r-a)):e&&r<a&&(a=r-(Bn-Tf(a-r))),t[0]=r,t[1]=a}var wa=(function(){function t(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(e,r,n){n=n||0,n>0&&(this._ux=vn(n/gl/e)||0,this._uy=vn(n/gl/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData($e.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var n=vn(e-this._xi),a=vn(r-this._yi),i=n>this._ux||a>this._uy;if(this.addData($e.L,e,r),this._ctx&&i&&this._ctx.lineTo(e,r),i)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=n*n+a*a;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,n,a,i,o){return this._drawPendingPt(),this.addData($e.C,e,r,n,a,i,o),this._ctx&&this._ctx.bezierCurveTo(e,r,n,a,i,o),this._xi=i,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,n,a){return this._drawPendingPt(),this.addData($e.Q,e,r,n,a),this._ctx&&this._ctx.quadraticCurveTo(e,r,n,a),this._xi=n,this._yi=a,this},t.prototype.arc=function(e,r,n,a,i,o){this._drawPendingPt(),_o[0]=a,_o[1]=i,XS(_o,o),a=_o[0],i=_o[1];var s=i-a;return this.addData($e.A,e,r,n,n,a,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,a,i,o),this._xi=ba(i)*n+e,this._yi=xa(i)*n+r,this},t.prototype.arcTo=function(e,r,n,a,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,n,a,i),this},t.prototype.rect=function(e,r,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,n,a),this.addData($e.R,e,r,n,a),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData($e.Z);var e=this._ctx,r=this._x0,n=this._y0;return e&&e.closePath(),this._xi=r,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){var r=e.length;!(this.data&&this.data.length===r)&&kf&&(this.data=new Float32Array(r));for(var n=0;n<r;n++)this.data[n]=e[n];this._len=r},t.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var r=e.length,n=0,a=this._len,i=0;i<r;i++)n+=e[i].len();kf&&this.data instanceof Float32Array&&(this.data=new Float32Array(a+n));for(var i=0;i<r;i++)for(var o=e[i].data,s=0;s<o.length;s++)this.data[a++]=o[s];this._len=a},t.prototype.addData=function(e,r,n,a,i,o,s,l,c){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var f=0;f<arguments.length;f++)u[this._len++]=arguments[f]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r<this._len;r++)e[r]=this.data[r];this.data=e}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,kf&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){qr[0]=qr[1]=Yr[0]=Yr[1]=Number.MAX_VALUE,Nn[0]=Nn[1]=Xr[0]=Xr[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,a=0,i=0,o;for(o=0;o<this._len;){var s=e[o++],l=o===1;switch(l&&(r=e[o],n=e[o+1],a=r,i=n),s){case $e.M:r=a=e[o++],n=i=e[o++],Yr[0]=a,Yr[1]=i,Xr[0]=a,Xr[1]=i;break;case $e.L:ag(r,n,e[o],e[o+1],Yr,Xr),r=e[o++],n=e[o++];break;case $e.C:WS(r,n,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],Yr,Xr),r=e[o++],n=e[o++];break;case $e.Q:qS(r,n,e[o++],e[o++],e[o],e[o+1],Yr,Xr),r=e[o++],n=e[o++];break;case $e.A:var c=e[o++],u=e[o++],f=e[o++],h=e[o++],d=e[o++],p=e[o++]+d;o+=1;var m=!e[o++];l&&(a=ba(d)*f+c,i=xa(d)*h+u),YS(c,u,f,h,d,p,m,Yr,Xr),r=ba(p)*f+c,n=xa(p)*h+u;break;case $e.R:a=r=e[o++],i=n=e[o++];var g=e[o++],v=e[o++];ag(a,i,a+g,i+v,Yr,Xr);break;case $e.Z:r=a,n=i;break}ci(qr,qr,Yr),ui(Nn,Nn,Xr)}return o===0&&(qr[0]=qr[1]=Nn[0]=Nn[1]=0),new Ge(qr[0],qr[1],Nn[0]-qr[0],Nn[1]-qr[1])},t.prototype._calculateLength=function(){var e=this.data,r=this._len,n=this._ux,a=this._uy,i=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var c=this._pathSegLen,u=0,f=0,h=0;h<r;){var d=e[h++],p=h===1;p&&(i=e[h],o=e[h+1],s=i,l=o);var m=-1;switch(d){case $e.M:i=s=e[h++],o=l=e[h++];break;case $e.L:{var g=e[h++],v=e[h++],y=g-i,b=v-o;(vn(y)>n||vn(b)>a||h===r-1)&&(m=Math.sqrt(y*y+b*b),i=g,o=v);break}case $e.C:{var x=e[h++],w=e[h++],g=e[h++],v=e[h++],S=e[h++],k=e[h++];m=wS(i,o,x,w,g,v,S,k,10),i=S,o=k;break}case $e.Q:{var x=e[h++],w=e[h++],g=e[h++],v=e[h++];m=TS(i,o,x,w,g,v,10),i=g,o=v;break}case $e.A:var C=e[h++],A=e[h++],M=e[h++],T=e[h++],D=e[h++],L=e[h++],R=L+D;h+=1,p&&(s=ba(D)*M+C,l=xa(D)*T+A),m=wf(M,T)*xf(Bn,Math.abs(L)),i=ba(R)*M+C,o=xa(R)*T+A;break;case $e.R:{s=i=e[h++],l=o=e[h++];var O=e[h++],B=e[h++];m=O*2+B*2;break}case $e.Z:{var y=s-i,b=l-o;m=Math.sqrt(y*y+b*b),i=s,o=l;break}}m>=0&&(c[f++]=m,u+=m)}return this._pathLen=u,u},t.prototype.rebuildPath=function(e,r){var n=this.data,a=this._ux,i=this._uy,o=this._len,s,l,c,u,f,h,d=r<1,p,m,g=0,v=0,y,b=0,x,w;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,y=r*m,!y)))e:for(var S=0;S<o;){var k=n[S++],C=S===1;switch(C&&(c=n[S],u=n[S+1],s=c,l=u),k!==$e.L&&b>0&&(e.lineTo(x,w),b=0),k){case $e.M:s=c=n[S++],l=u=n[S++],e.moveTo(c,u);break;case $e.L:{f=n[S++],h=n[S++];var A=vn(f-c),M=vn(h-u);if(A>a||M>i){if(d){var T=p[v++];if(g+T>y){var D=(y-g)/T;e.lineTo(c*(1-D)+f*D,u*(1-D)+h*D);break e}g+=T}e.lineTo(f,h),c=f,u=h,b=0}else{var L=A*A+M*M;L>b&&(x=f,w=h,b=L)}break}case $e.C:{var R=n[S++],O=n[S++],B=n[S++],j=n[S++],P=n[S++],V=n[S++];if(d){var T=p[v++];if(g+T>y){var D=(y-g)/T;al(c,R,B,P,D,ya),al(u,O,j,V,D,_a),e.bezierCurveTo(ya[1],_a[1],ya[2],_a[2],ya[3],_a[3]);break e}g+=T}e.bezierCurveTo(R,O,B,j,P,V),c=P,u=V;break}case $e.Q:{var R=n[S++],O=n[S++],B=n[S++],j=n[S++];if(d){var T=p[v++];if(g+T>y){var D=(y-g)/T;il(c,R,B,D,ya),il(u,O,j,D,_a),e.quadraticCurveTo(ya[1],_a[1],ya[2],_a[2]);break e}g+=T}e.quadraticCurveTo(R,O,B,j),c=B,u=j;break}case $e.A:var H=n[S++],Z=n[S++],re=n[S++],Te=n[S++],ge=n[S++],xe=n[S++],Ce=n[S++],be=!n[S++],it=re>Te?re:Te,Qe=vn(re-Te)>.001,ze=ge+xe,oe=!1;if(d){var T=p[v++];g+T>y&&(ze=ge+xe*(y-g)/T,oe=!0),g+=T}if(Qe&&e.ellipse?e.ellipse(H,Z,re,Te,Ce,ge,ze,be):e.arc(H,Z,it,ge,ze,be),oe)break e;C&&(s=ba(ge)*re+H,l=xa(ge)*Te+Z),c=ba(ze)*re+H,u=xa(ze)*Te+Z;break;case $e.R:s=c=n[S],l=u=n[S+1],f=n[S++],h=n[S++];var pe=n[S++],ot=n[S++];if(d){var T=p[v++];if(g+T>y){var Xe=y-g;e.moveTo(f,h),e.lineTo(f+xf(Xe,pe),h),Xe-=pe,Xe>0&&e.lineTo(f+pe,h+xf(Xe,ot)),Xe-=ot,Xe>0&&e.lineTo(f+wf(pe-Xe,0),h+ot),Xe-=pe,Xe>0&&e.lineTo(f,h+wf(ot-Xe,0));break e}g+=T}e.rect(f,h,pe,ot);break;case $e.Z:if(d){var T=p[v++];if(g+T>y){var D=(y-g)/T;e.lineTo(c*(1-D)+s*D,u*(1-D)+l*D);break e}g+=T}e.closePath(),c=s,u=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=$e,t.initDefaultProps=(function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0})(),t})();function gi(t,e,r,n,a,i,o){if(a===0)return!1;var s=a,l=0,c=t;if(o>e+s&&o>n+s||o<e-s&&o<n-s||i>t+s&&i>r+s||i<t-s&&i<r-s)return!1;if(t!==r)l=(e-n)/(t-r),c=(t*n-r*e)/(t-r);else return Math.abs(i-t)<=s/2;var u=l*i-o+c,f=u*u/(l*l+1);return f<=s/2*s/2}function ZS(t,e,r,n,a,i,o,s,l,c,u){if(l===0)return!1;var f=l;if(u>e+f&&u>n+f&&u>i+f&&u>s+f||u<e-f&&u<n-f&&u<i-f&&u<s-f||c>t+f&&c>r+f&&c>a+f&&c>o+f||c<t-f&&c<r-f&&c<a-f&&c<o-f)return!1;var h=xS(t,e,r,n,a,i,o,s,c,u);return h<=f/2}function KS(t,e,r,n,a,i,o,s,l){if(o===0)return!1;var c=o;if(l>e+c&&l>n+c&&l>i+c||l<e-c&&l<n-c&&l<i-c||s>t+c&&s>r+c&&s>a+c||s<t-c&&s<r-c&&s<a-c)return!1;var u=kS(t,e,r,n,a,i,s,l);return u<=c/2}var sg=Math.PI*2;function wl(t){return t%=sg,t<0&&(t+=sg),t}var bo=Math.PI*2;function jS(t,e,r,n,a,i,o,s,l){if(o===0)return!1;var c=o;s-=t,l-=e;var u=Math.sqrt(s*s+l*l);if(u-c>r||u+c<r)return!1;if(Math.abs(n-a)%bo<1e-4)return!0;if(i){var f=n;n=wl(a),a=wl(f)}else n=wl(n),a=wl(a);n>a&&(a+=bo);var h=Math.atan2(l,s);return h<0&&(h+=bo),h>=n&&h<=a||h+bo>=n&&h+bo<=a}function Sa(t,e,r,n,a,i){if(i>e&&i>n||i<e&&i<n||n===e)return 0;var o=(i-e)/(n-e),s=n<e?1:-1;(o===1||o===0)&&(s=n<e?.5:-.5);var l=o*(r-t)+t;return l===a?1/0:l>a?s:0}var zn=wa.CMD,ka=Math.PI*2,JS=1e-4;function QS(t,e){return Math.abs(t-e)<JS}var Ot=[-1,-1,-1],mr=[-1,-1];function ek(){var t=mr[0];mr[0]=mr[1],mr[1]=t}function tk(t,e,r,n,a,i,o,s,l,c){if(c>e&&c>n&&c>i&&c>s||c<e&&c<n&&c<i&&c<s)return 0;var u=nl(e,n,i,s,c,Ot);if(u===0)return 0;for(var f=0,h=-1,d=void 0,p=void 0,m=0;m<u;m++){var g=Ot[m],v=g===0||g===1?.5:1,y=wt(t,r,a,o,g);y<l||(h<0&&(h=Vv(e,n,i,s,mr),mr[1]<mr[0]&&h>1&&ek(),d=wt(e,n,i,s,mr[0]),h>1&&(p=wt(e,n,i,s,mr[1]))),h===2?g<mr[0]?f+=d<e?v:-v:g<mr[1]?f+=p<d?v:-v:f+=s<p?v:-v:g<mr[0]?f+=d<e?v:-v:f+=s<d?v:-v)}return f}function rk(t,e,r,n,a,i,o,s){if(s>e&&s>n&&s>i||s<e&&s<n&&s<i)return 0;var l=SS(e,n,i,s,Ot);if(l===0)return 0;var c=Gv(e,n,i);if(c>=0&&c<=1){for(var u=0,f=Gt(e,n,i,c),h=0;h<l;h++){var d=Ot[h]===0||Ot[h]===1?.5:1,p=Gt(t,r,a,Ot[h]);p<o||(Ot[h]<c?u+=f<e?d:-d:u+=i<f?d:-d)}return u}else{var d=Ot[0]===0||Ot[0]===1?.5:1,p=Gt(t,r,a,Ot[0]);return p<o?0:i<e?d:-d}}function nk(t,e,r,n,a,i,o,s){if(s-=e,s>r||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Ot[0]=-l,Ot[1]=l;var c=Math.abs(n-a);if(c<1e-4)return 0;if(c>=ka-1e-4){n=0,a=ka;var u=i?1:-1;return o>=Ot[0]+t&&o<=Ot[1]+t?u:0}if(n>a){var f=n;n=a,a=f}n<0&&(n+=ka,a+=ka);for(var h=0,d=0;d<2;d++){var p=Ot[d];if(p+t>o){var m=Math.atan2(s,p),u=i?1:-1;m<0&&(m=ka+m),(m>=n&&m<=a||m+ka>=n&&m+ka<=a)&&(m>Math.PI/2&&m<Math.PI*1.5&&(u=-u),h+=u)}}return h}function lg(t,e,r,n,a){for(var i=t.data,o=t.len(),s=0,l=0,c=0,u=0,f=0,h,d,p=0;p<o;){var m=i[p++],g=p===1;switch(m===zn.M&&p>1&&(r||(s+=Sa(l,c,u,f,n,a))),g&&(l=i[p],c=i[p+1],u=l,f=c),m){case zn.M:u=i[p++],f=i[p++],l=u,c=f;break;case zn.L:if(r){if(gi(l,c,i[p],i[p+1],e,n,a))return!0}else s+=Sa(l,c,i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case zn.C:if(r){if(ZS(l,c,i[p++],i[p++],i[p++],i[p++],i[p],i[p+1],e,n,a))return!0}else s+=tk(l,c,i[p++],i[p++],i[p++],i[p++],i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case zn.Q:if(r){if(KS(l,c,i[p++],i[p++],i[p],i[p+1],e,n,a))return!0}else s+=rk(l,c,i[p++],i[p++],i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case zn.A:var v=i[p++],y=i[p++],b=i[p++],x=i[p++],w=i[p++],S=i[p++];p+=1;var k=!!(1-i[p++]);h=Math.cos(w)*b+v,d=Math.sin(w)*x+y,g?(u=h,f=d):s+=Sa(l,c,h,d,n,a);var C=(n-v)*x/b+v;if(r){if(jS(v,y,x,w,w+S,k,e,C,a))return!0}else s+=nk(v,y,x,w,w+S,k,C,a);l=Math.cos(w+S)*b+v,c=Math.sin(w+S)*x+y;break;case zn.R:u=l=i[p++],f=c=i[p++];var A=i[p++],M=i[p++];if(h=u+A,d=f+M,r){if(gi(u,f,h,f,e,n,a)||gi(h,f,h,d,e,n,a)||gi(h,d,u,d,e,n,a)||gi(u,d,u,f,e,n,a))return!0}else s+=Sa(h,f,h,d,n,a),s+=Sa(u,d,u,f,n,a);break;case zn.Z:if(r){if(gi(l,c,u,f,e,n,a))return!0}else s+=Sa(l,c,u,f,n,a);l=u,c=f;break}}return!r&&!QS(c,f)&&(s+=Sa(l,c,u,f,n,a)||0),s!==0}function ak(t,e,r){return lg(t,0,!1,e,r)}function ik(t,e,r,n){return lg(t,e,!0,r,n)}var cg=He({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},ga),ok={style:He({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},yl.style)},Cf=fo.concat(["invisible","culling","z","z2","zlevel","parent"]),qe=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var a=this._decalEl=this._decalEl||new e;a.buildPath===e.prototype.buildPath&&(a.buildPath=function(l){r.buildPath(l,r.shape)}),a.silent=!0;var i=a.style;for(var o in n)i[o]!==n[o]&&(i[o]=n[o]);i.fill=n.fill?n.decal:null,i.decal=null,i.shadowColor=null,n.strokeFirst&&(i.stroke=null);for(var s=0;s<Cf.length;++s)a[Cf[s]]=this[Cf[s]];a.__dirty|=ir}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(r){var n=at(r);this.shape=this.getDefaultShape();var a=this.getDefaultStyle();a&&this.useStyle(a);for(var i=0;i<n.length;i++){var o=n[i],s=r[o];o==="style"?this.style?q(this.style,s):this.useStyle(s):o==="shape"?q(this.shape,s):t.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var r=this.style.fill;if(r!=="none"){if(ae(r)){var n=cl(r,0);return n>.5?uf:n>.2?NS:ff}else if(r)return ff}return uf},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(ae(n)){var a=this.__zr,i=!!(a&&a.isDarkMode()),o=cl(r,0)<cf;if(i===o)return n}},e.prototype.buildPath=function(r,n,a){},e.prototype.pathUpdated=function(){this.__dirty&=~pi},e.prototype.getUpdatedPathProxy=function(r){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,r),this.path},e.prototype.createPathProxy=function(){this.path=new wa(!1)},e.prototype.hasStroke=function(){var r=this.style,n=r.stroke;return!(n==null||n==="none"||!(r.lineWidth>0))},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,a=!r;if(a){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||this.__dirty&pi)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||a){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,c=n.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;c=Math.max(c,u??4)}l>1e-10&&(s.width+=c/l,s.height+=c/l,s.x-=c/l/2,s.y-=c/l/2)}return s}return r},e.prototype.contain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect(),o=this.style;if(r=a[0],n=a[1],i.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,c=o.strokeNoScale?this.getLineScale():1;if(c>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),ik(s,l/c,r,n)))return!0}if(this.hasFill())return ak(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=pi,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):t.prototype.attrKV.call(this,r,n)},e.prototype.setShape=function(r,n){var a=this.shape;return a||(a=this.shape={}),typeof r=="string"?a[r]=n:q(a,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&pi)},e.prototype.createStyle=function(r){return Xs(cg,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=q({},this.shape))},e.prototype._applyStateObj=function(r,n,a,i,o,s){t.prototype._applyStateObj.call(this,r,n,a,i,o,s);var l=!(n&&i),c;if(n&&n.shape?o?i?c=n.shape:(c=q({},a.shape),q(c,n.shape)):(c=q({},i?this.shape:a.shape),q(c,n.shape)):l&&(c=a.shape),c)if(o){this.shape=q({},this.shape);for(var u={},f=at(c),h=0;h<f.length;h++){var d=f[h];typeof c[d]=="object"?this.shape[d]=c[d]:u[d]=c[d]}this._transitionState(r,{shape:u},s)}else this.shape=c,this.dirtyShape()},e.prototype._mergeStates=function(r){for(var n=t.prototype._mergeStates.call(this,r),a,i=0;i<r.length;i++){var o=r[i];o.shape&&(a=a||{},this._mergeStyle(a,o.shape))}return a&&(n.shape=a),n},e.prototype.getAnimationStyleProps=function(){return ok},e.prototype.isZeroArea=function(){return!1},e.extend=function(r){var n=(function(i){K(o,i);function o(s){var l=i.call(this,s)||this;return r.init&&r.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return Ie(r.style)},o.prototype.getDefaultShape=function(){return Ie(r.shape)},o})(e);for(var a in r)typeof r[a]=="function"&&(n.prototype[a]=r[a]);return n},e.initDefaultProps=(function(){var r=e.prototype;r.type="path",r.strokeContainThreshold=5,r.segmentIgnoreThreshold=0,r.subPixelOptimize=!1,r.autoBatch=!1,r.__dirty=ir|mo|pi})(),e})(yo),sk=He({strokeFirst:!0,font:sa,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},cg),Sl=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var r=this.style,n=r.stroke;return n!=null&&n!=="none"&&r.lineWidth>0},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.createStyle=function(r){return Xs(sk,r)},e.prototype.setBoundingRect=function(r){this._rect=r},e.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var n=r.text;n!=null?n+="":n="";var a=$u(n,r.font,r.textAlign,r.textBaseline);if(a.x+=r.x||0,a.y+=r.y||0,this.hasStroke()){var i=r.lineWidth;a.x-=i/2,a.y-=i/2,a.width+=i,a.height+=i}this._rect=a}return this._rect},e.initDefaultProps=(function(){var r=e.prototype;r.dirtyRectTolerance=10})(),e})(yo);Sl.prototype.type="tspan";var lk=He({x:0,y:0},ga),ck={style:He({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},yl.style)};function uk(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var Fn=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return Xs(lk,r)},e.prototype._getSize=function(r){var n=this.style,a=n[r];if(a!=null)return a;var i=uk(n.image)?n.image:this.__image;if(!i)return 0;var o=r==="width"?"height":"width",s=n[o];return s==null?i[r]:i[r]/i[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return ck},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new Ge(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e})(yo);Fn.prototype.type="image";function fk(t,e){var r=e.x,n=e.y,a=e.width,i=e.height,o=e.r,s,l,c,u;a<0&&(r=r+a,a=-a),i<0&&(n=n+i,i=-i),typeof o=="number"?s=l=c=u=o:o instanceof Array?o.length===1?s=l=c=u=o[0]:o.length===2?(s=c=o[0],l=u=o[1]):o.length===3?(s=o[0],l=u=o[1],c=o[2]):(s=o[0],l=o[1],c=o[2],u=o[3]):s=l=c=u=0;var f;s+l>a&&(f=s+l,s*=a/f,l*=a/f),c+u>a&&(f=c+u,c*=a/f,u*=a/f),l+c>i&&(f=l+c,l*=i/f,c*=i/f),s+u>i&&(f=s+u,s*=i/f,u*=i/f),t.moveTo(r+s,n),t.lineTo(r+a-l,n),l!==0&&t.arc(r+a-l,n+l,l,-Math.PI/2,0),t.lineTo(r+a,n+i-c),c!==0&&t.arc(r+a-c,n+i-c,c,0,Math.PI/2),t.lineTo(r+u,n+i),u!==0&&t.arc(r+u,n+i-u,u,Math.PI/2,Math.PI),t.lineTo(r,n+s),s!==0&&t.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var mi=Math.round;function ug(t,e,r){if(e){var n=e.x1,a=e.x2,i=e.y1,o=e.y2;t.x1=n,t.x2=a,t.y1=i,t.y2=o;var s=r&&r.lineWidth;return s&&(mi(n*2)===mi(a*2)&&(t.x1=t.x2=Ta(n,s,!0)),mi(i*2)===mi(o*2)&&(t.y1=t.y2=Ta(i,s,!0))),t}}function fg(t,e,r){if(e){var n=e.x,a=e.y,i=e.width,o=e.height;t.x=n,t.y=a,t.width=i,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=Ta(n,s,!0),t.y=Ta(a,s,!0),t.width=Math.max(Ta(n+i,s,!1)-t.x,i===0?0:1),t.height=Math.max(Ta(a+o,s,!1)-t.y,o===0?0:1)),t}}function Ta(t,e,r){if(!e)return t;var n=mi(t*2);return(n+mi(e))%2===0?n/2:(n+(r?1:-1))/2}var dk=(function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t})(),hk={},_t=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new dk},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=fg(hk,n,this.style);a=l.x,i=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else a=n.x,i=n.y,o=n.width,s=n.height;n.r?fk(r,n):r.rect(a,i,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e})(qe);_t.prototype.type="rect";var dg={fill:"#000"},hg=2,pk={style:He({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},yl.style)},$t=(function(t){K(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=dg,n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r<this._children.length;r++){var n=this._children[r];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},e.prototype.updateTransform=function(){var r=this.innerTransformable;r?(r.updateTransform(),r.transform&&(this.transform=r.transform)):t.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(r){var n=this.innerTransformable;return n?n.getLocalTransform(r):t.prototype.getLocalTransform.call(this,r)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,_k(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var n=0;n<this._children.length;n++)this._children[n].__zr=r},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var r=new Ge(0,0,0,0),n=this._children,a=[],i=null,o=0;o<n.length;o++){var s=n[o],l=s.getBoundingRect(),c=s.getLocalTransform(a);c?(r.copy(l),r.applyTransform(c),i=i||r.clone(),i.union(r)):(i=i||l.clone(),i.union(l))}this._rect=i||r}return this._rect},e.prototype.setDefaultTextStyle=function(r){this._defaultStyle=r||dg},e.prototype.setTextContent=function(r){},e.prototype._mergeStyle=function(r,n){if(!n)return r;var a=n.rich,i=r.rich||a&&{};return q(r,n),a&&i?(this._mergeRich(i,a),r.rich=i):i&&(r.rich=i),r},e.prototype._mergeRich=function(r,n){for(var a=at(n),i=0;i<a.length;i++){var o=a[i];r[o]=r[o]||{},q(r[o],n[o])}},e.prototype.getAnimationStyleProps=function(){return pk},e.prototype._getOrCreateChild=function(r){var n=this._children[this._childCursor];return(!n||!(n instanceof r))&&(n=new r),this._children[this._childCursor++]=n,n.__zr=this.__zr,n.parent=this,n},e.prototype._updatePlainTexts=function(){var r=this.style,n=r.font||sa,a=r.padding,i=bg(r),o=oS(i,r),s=Mf(r),l=!!r.backgroundColor,c=o.outerHeight,u=o.outerWidth,f=o.contentWidth,h=o.lines,d=o.lineHeight,p=this._defaultStyle;this.isTruncated=!!o.isTruncated;var m=r.x||0,g=r.y||0,v=r.align||p.align||"left",y=r.verticalAlign||p.verticalAlign||"top",b=m,x=oi(g,o.contentHeight,y);if(s||a){var w=uo(m,u,v),S=oi(g,c,y);s&&this._renderBackground(r,r,w,S,u,c)}x+=d/2,a&&(b=_g(m,v,a),y==="top"?x+=a[0]:y==="bottom"&&(x-=a[2]));for(var k=0,C=!1,A=yg("fill"in r?r.fill:(C=!0,p.fill)),M=mg("stroke"in r?r.stroke:!l&&(!p.autoStroke||C)?(k=hg,p.stroke):null),T=r.textShadowBlur>0,D=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),L=o.calculatedLineHeight,R=0;R<h.length;R++){var O=this._getOrCreateChild(Sl),B=O.createStyle();O.useStyle(B),B.text=h[R],B.x=b,B.y=x,B.textAlign=v,B.textBaseline="middle",B.opacity=r.opacity,B.strokeFirst=!0,T&&(B.shadowBlur=r.textShadowBlur||0,B.shadowColor=r.textShadowColor||"transparent",B.shadowOffsetX=r.textShadowOffsetX||0,B.shadowOffsetY=r.textShadowOffsetY||0),B.stroke=M,B.fill=A,M&&(B.lineWidth=r.lineWidth||k,B.lineDash=r.lineDash,B.lineDashOffset=r.lineDashOffset||0),B.font=n,vg(B,r),x+=d,D&&O.setBoundingRect(new Ge(uo(B.x,f,B.textAlign),oi(B.y,L,B.textBaseline),f,L))}},e.prototype._updateRichTexts=function(){var r=this.style,n=bg(r),a=cS(n,r),i=a.width,o=a.outerWidth,s=a.outerHeight,l=r.padding,c=r.x||0,u=r.y||0,f=this._defaultStyle,h=r.align||f.align,d=r.verticalAlign||f.verticalAlign;this.isTruncated=!!a.isTruncated;var p=uo(c,o,h),m=oi(u,s,d),g=p,v=m;l&&(g+=l[3],v+=l[0]);var y=g+i;Mf(r)&&this._renderBackground(r,r,p,m,o,s);for(var b=!!r.backgroundColor,x=0;x<a.lines.length;x++){for(var w=a.lines[x],S=w.tokens,k=S.length,C=w.lineHeight,A=w.width,M=0,T=g,D=y,L=k-1,R=void 0;M<k&&(R=S[M],!R.align||R.align==="left");)this._placeToken(R,r,C,v,T,"left",b),A-=R.width,T+=R.width,M++;for(;L>=0&&(R=S[L],R.align==="right");)this._placeToken(R,r,C,v,D,"right",b),A-=R.width,D-=R.width,L--;for(T+=(i-(T-g)-(y-D)-A)/2;M<=L;)R=S[M],this._placeToken(R,r,C,v,T+R.width/2,"center",b),T+=R.width,M++;v+=C}},e.prototype._placeToken=function(r,n,a,i,o,s,l){var c=n.rich[r.styleName]||{};c.text=r.text;var u=r.verticalAlign,f=i+a/2;u==="top"?f=i+r.height/2:u==="bottom"&&(f=i+a-r.height/2);var h=!r.isLineHolder&&Mf(c);h&&this._renderBackground(c,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var d=!!c.backgroundColor,p=r.textPadding;p&&(o=_g(o,s,p),f-=r.height/2-p[0]-r.innerHeight/2);var m=this._getOrCreateChild(Sl),g=m.createStyle();m.useStyle(g);var v=this._defaultStyle,y=!1,b=0,x=yg("fill"in c?c.fill:"fill"in n?n.fill:(y=!0,v.fill)),w=mg("stroke"in c?c.stroke:"stroke"in n?n.stroke:!d&&!l&&(!v.autoStroke||y)?(b=hg,v.stroke):null),S=c.textShadowBlur>0||n.textShadowBlur>0;g.text=r.text,g.x=o,g.y=f,S&&(g.shadowBlur=c.textShadowBlur||n.textShadowBlur||0,g.shadowColor=c.textShadowColor||n.textShadowColor||"transparent",g.shadowOffsetX=c.textShadowOffsetX||n.textShadowOffsetX||0,g.shadowOffsetY=c.textShadowOffsetY||n.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=r.font||sa,g.opacity=Ys(c.opacity,n.opacity,1),vg(g,c),w&&(g.lineWidth=Ys(c.lineWidth,n.lineWidth,b),g.lineDash=Pe(c.lineDash,n.lineDash),g.lineDashOffset=n.lineDashOffset||0,g.stroke=w),x&&(g.fill=x);var k=r.contentWidth,C=r.contentHeight;m.setBoundingRect(new Ge(uo(g.x,k,g.textAlign),oi(g.y,C,g.textBaseline),k,C))},e.prototype._renderBackground=function(r,n,a,i,o,s){var l=r.backgroundColor,c=r.borderWidth,u=r.borderColor,f=l&&l.image,h=l&&!f,d=r.borderRadius,p=this,m,g;if(h||r.lineHeight||c&&u){m=this._getOrCreateChild(_t),m.useStyle(m.createStyle()),m.style.fill=null;var v=m.shape;v.x=a,v.y=i,v.width=o,v.height=s,v.r=d,m.dirtyShape()}if(h){var y=m.style;y.fill=l||null,y.fillOpacity=Pe(r.fillOpacity,1)}else if(f){g=this._getOrCreateChild(Fn),g.onload=function(){p.dirtyStyle()};var b=g.style;b.image=l.image,b.x=a,b.y=i,b.width=o,b.height=s}if(c&&u){var y=m.style;y.lineWidth=c,y.stroke=u,y.strokeOpacity=Pe(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(m||g).style;x.shadowBlur=r.shadowBlur||0,x.shadowColor=r.shadowColor||"transparent",x.shadowOffsetX=r.shadowOffsetX||0,x.shadowOffsetY=r.shadowOffsetY||0,x.opacity=Ys(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return yk(r)&&(n=[r.fontStyle,r.fontWeight,mk(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Gr(n)||r.textFont||r.font},e})(yo),vk={left:!0,right:1,center:1},gk={top:1,bottom:1,middle:1},pg=["fontStyle","fontWeight","fontSize","fontFamily"];function mk(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?Lu+"px":t+"px"}function vg(t,e){for(var r=0;r<pg.length;r++){var n=pg[r],a=e[n];a!=null&&(t[n]=a)}}function yk(t){return t.fontSize!=null||t.fontFamily||t.fontWeight}function _k(t){return gg(t),I(t.rich,gg),t}function gg(t){if(t){t.font=$t.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||vk[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||gk[r]?r:"top";var n=t.padding;n&&(t.padding=_v(t.padding))}}function mg(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function yg(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function _g(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function bg(t){var e=t.text;return e!=null&&(e+=""),e}function Mf(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var xg=1e-4,wg=20;function bk(t){return t.replace(/^\s+|\s+$/g,"")}function Ca(t,e,r,n){var a=e[0],i=e[1],o=r[0],s=r[1],l=i-a,c=s-o;if(l===0)return c===0?o:(o+s)/2;if(n)if(l>0){if(t<=a)return o;if(t>=i)return s}else{if(t>=a)return o;if(t<=i)return s}else{if(t===a)return o;if(t===i)return s}return(t-a)/l*c+o}function Nt(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return ae(t)?bk(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function mt(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),wg),t=(+t).toFixed(e),r?t:+t}function xk(t){return t.sort(function(e,r){return e-r}),t}function gn(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Math.round(t*e)/e===t)return r}return wk(t)}function wk(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),n=r>0?+e.slice(r+1):0,a=r>0?r:e.length,i=e.indexOf("."),o=i<0?0:a-1-i;return Math.max(0,o-n)}function Sg(t,e){var r=Math.log,n=Math.LN10,a=Math.floor(r(t[1]-t[0])/n),i=Math.round(r(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-a+i,0),20);return isFinite(o)?o:20}function Sk(t,e){var r=Math.max(gn(t),gn(e)),n=t+e;return r>wg?n:mt(n,r)}function kg(t){var e=Math.PI*2;return(t%e+e)%e}function kl(t){return t>-xg&&t<xg}var kk=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function mn(t){if(t instanceof Date)return t;if(ae(t)){var e=kk.exec(t);if(!e)return new Date(NaN);if(e[8]){var r=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(r-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,r,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}else return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}else if(t==null)return new Date(NaN);return new Date(Math.round(t))}function Tk(t){return Math.pow(10,Af(t))}function Af(t){if(t===0)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return t/Math.pow(10,e)>=10&&e++,e}function Tg(t,e){var r=Af(t),n=Math.pow(10,r),a=t/n,i;return a<1.5?i=1:a<2.5?i=2:a<4?i=3:a<7?i=5:i=10,t=i*n,r>=-20?+t.toFixed(r<0?-r:0):t}function Tl(t){var e=parseFloat(t);return e==t&&(e!==0||!ae(t)||t.indexOf("x")<=0)?e:NaN}function Ck(t){return!isNaN(Tl(t))}function Cg(){return Math.round(Math.random()*9)}function Mg(t,e){return e===0?t:Mg(e,t%e)}function Ag(t,e){return t==null?e:e==null?t:t*e/Mg(t,e)}function Wt(t){throw new Error(t)}function Dg(t,e,r){return(e-t)*r+t}var Ig="series\0",Mk="\0_ec_\0";function Mt(t){return t instanceof Array?t:t==null?[]:[t]}function Lg(t,e,r){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,a=r.length;n<a;n++){var i=r[n];!t.emphasis[e].hasOwnProperty(i)&&t[e].hasOwnProperty(i)&&(t.emphasis[e][i]=t[e][i])}}}var Pg=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function xo(t){return de(t)&&!ee(t)&&!(t instanceof Date)?t.value:t}function Ak(t){return de(t)&&!(t instanceof Array)}function Dk(t,e,r){var n=r==="normalMerge",a=r==="replaceMerge",i=r==="replaceAll";t=t||[],e=(e||[]).slice();var o=me();I(e,function(l,c){if(!de(l)){e[c]=null;return}});var s=Ik(t,o,r);return(n||a)&&Lk(s,t,o,e),n&&Pk(s,e),n||a?Rk(s,e,a):i&&Ek(s,e),Ok(s),s}function Ik(t,e,r){var n=[];if(r==="replaceAll")return n;for(var a=0;a<t.length;a++){var i=t[a];i&&i.id!=null&&e.set(i.id,a),n.push({existing:r==="replaceMerge"||So(i)?null:i,newOption:null,keyInfo:null,brandNew:null})}return n}function Lk(t,e,r,n){I(n,function(a,i){if(!(!a||a.id==null)){var o=wo(a.id),s=r.get(o);if(s!=null){var l=t[s];dn(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=a,l.existing=e[s],n[i]=null}}})}function Pk(t,e){I(e,function(r,n){if(!(!r||r.name==null))for(var a=0;a<t.length;a++){var i=t[a].existing;if(!t[a].newOption&&i&&(i.id==null||r.id==null)&&!So(r)&&!So(i)&&Rg("name",i,r)){t[a].newOption=r,e[n]=null;return}}})}function Rk(t,e,r){I(e,function(n){if(n){for(var a,i=0;(a=t[i])&&(a.newOption||So(a.existing)||a.existing&&n.id!=null&&!Rg("id",n,a.existing));)i++;a?(a.newOption=n,a.brandNew=r):t.push({newOption:n,brandNew:r,existing:null,keyInfo:null}),i++}})}function Ek(t,e){I(e,function(r){t.push({newOption:r,brandNew:!0,existing:null,keyInfo:null})})}function Ok(t){var e=me();I(t,function(r){var n=r.existing;n&&e.set(n.id,r)}),I(t,function(r){var n=r.newOption;dn(!n||n.id==null||!e.get(n.id)||e.get(n.id)===r,"id duplicates: "+(n&&n.id)),n&&n.id!=null&&e.set(n.id,r),!r.keyInfo&&(r.keyInfo={})}),I(t,function(r,n){var a=r.existing,i=r.newOption,o=r.keyInfo;if(de(i)){if(o.name=i.name!=null?wo(i.name):a?a.name:Ig+n,a)o.id=wo(a.id);else if(i.id!=null)o.id=wo(i.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(e.get(o.id))}e.set(o.id,r)}})}function Rg(t,e,r){var n=Zr(e[t],null),a=Zr(r[t],null);return n!=null&&a!=null&&n===a}function wo(t){return Zr(t,"")}function Zr(t,e){return t==null?e:ae(t)?t:et(t)||Ou(t)?t+"":e}function Df(t){var e=t.name;return!!(e&&e.indexOf(Ig))}function So(t){return t&&t.id!=null&&wo(t.id).indexOf(Mk)===0}function Nk(t,e,r){I(t,function(n){var a=n.newOption;de(a)&&(n.keyInfo.mainType=e,n.keyInfo.subType=Bk(e,a,n.existing,r))})}function Bk(t,e,r,n){var a=e.type?e.type:r?r.subType:n.determineSubType(t,e);return a}function Ma(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return ee(e.dataIndex)?he(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return ee(e.name)?he(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}function ht(){var t="__ec_inner_"+zk++;return function(e){return e[t]||(e[t]={})}}var zk=Cg();function If(t,e,r){var n=Lf(e,r),a=n.mainTypeSpecified,i=n.queryOptionMap,o=n.others,s=o,l=r?r.defaultMainType:null;return!a&&l&&i.set(l,{}),i.each(function(c,u){var f=ko(t,u,c,{useDefault:l===u,enableAll:r&&r.enableAll!=null?r.enableAll:!0,enableNone:r&&r.enableNone!=null?r.enableNone:!0});s[u+"Models"]=f.models,s[u+"Model"]=f.models[0]}),s}function Lf(t,e){var r;if(ae(t)){var n={};n[t+"Index"]=0,r=n}else r=t;var a=me(),i={},o=!1;return I(r,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){i[l]=s;return}var c=l.match(/^(\w+)(Index|Id|Name)$/)||[],u=c[1],f=(c[2]||"").toLowerCase();if(!(!u||!f||e&&e.includeMainTypes&&Ue(e.includeMainTypes,u)<0)){o=o||!!u;var h=a.get(u)||a.set(u,{});h[f]=s}}),{mainTypeSpecified:o,queryOptionMap:a,others:i}}var qt={useDefault:!0,enableAll:!1,enableNone:!1},Fk={useDefault:!1,enableAll:!0,enableNone:!0};function ko(t,e,r,n){n=n||qt;var a=r.index,i=r.id,o=r.name,s={models:null,specified:a!=null||i!=null||o!=null};if(!s.specified){var l=void 0;return s.models=n.useDefault&&(l=t.getComponent(e))?[l]:[],s}return a==="none"||a===!1?(dn(n.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(a==="all"&&(dn(n.enableAll,'`"all"` is not a valid value on index option.'),a=i=o=null),s.models=t.queryComponents({mainType:e,index:a,id:i,name:o}),s)}function Eg(t,e,r){t.setAttribute?t.setAttribute(e,r):t[e]=r}function Hk(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function Vk(t){return t==="auto"?_e.domSupported?"html":"richText":t||"html"}function Uk(t,e,r,n,a){var i=e==null||e==="auto";if(n==null)return n;if(et(n)){var o=Dg(r||0,n,a);return mt(o,i?Math.max(gn(r||0),gn(n)):e)}else{if(ae(n))return a<1?r:n;for(var s=[],l=r,c=n,u=Math.max(l?l.length:0,c.length),f=0;f<u;++f){var h=t.getDimensionInfo(f);if(h&&h.type==="ordinal")s[f]=(a<1&&l?l:c)[f];else{var d=l&&l[f]?l[f]:0,p=c[f],o=Dg(d,p,a);s[f]=mt(o,i?Math.max(gn(d),gn(p)):e)}}return s}}var We=ht(),Gk=function(t,e,r,n){if(n){var a=We(n);a.dataIndex=r,a.dataType=e,a.seriesIndex=t,a.ssrType="chart",n.type==="group"&&n.traverse(function(i){var o=We(i);o.seriesIndex=t,o.dataIndex=r,o.dataType=e,o.ssrType="chart"})}},Og=1,Ng={},Bg=ht(),Pf=ht(),Rf=0,Cl=1,Ml=2,Kr=["emphasis","blur","select"],zg=["normal","emphasis","blur","select"],$k=10,Wk=9,Aa="highlight",Al="downplay",To="select",Dl="unselect",Co="toggleSelect";function yi(t){return t!=null&&t!=="none"}function Il(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function Fg(t){Il(t,"emphasis",Ml)}function Hg(t){t.hoverState===Ml&&Il(t,"normal",Rf)}function Ef(t){Il(t,"blur",Cl)}function Vg(t){t.hoverState===Cl&&Il(t,"normal",Rf)}function qk(t){t.selected=!0}function Yk(t){t.selected=!1}function Ug(t,e,r){e(t,r)}function yn(t,e,r){Ug(t,e,r),t.isGroup&&t.traverse(function(n){Ug(n,e,r)})}function Gg(t,e){switch(e){case"emphasis":t.hoverState=Ml;break;case"normal":t.hoverState=Rf;break;case"blur":t.hoverState=Cl;break;case"select":t.selected=!0}}function Xk(t,e,r,n){for(var a=t.style,i={},o=0;o<e.length;o++){var s=e[o],l=a[s];i[s]=l??(n&&n[s])}for(var o=0;o<t.animators.length;o++){var c=t.animators[o];c.__fromStateTransition&&c.__fromStateTransition.indexOf(r)<0&&c.targetName==="style"&&c.saveTo(i,e)}return i}function Zk(t,e,r,n){var a=r&&Ue(r,"select")>=0,i=!1;if(t instanceof qe){var o=Bg(t),s=a&&o.selectFill||o.normalFill,l=a&&o.selectStroke||o.normalStroke;if(yi(s)||yi(l)){n=n||{};var c=n.style||{};c.fill==="inherit"?(i=!0,n=q({},n),c=q({},c),c.fill=s):!yi(c.fill)&&yi(s)?(i=!0,n=q({},n),c=q({},c),c.fill=Kv(s)):!yi(c.stroke)&&yi(l)&&(i||(n=q({},n),c=q({},c)),c.stroke=Kv(l)),n.style=c}}if(n&&n.z2==null){i||(n=q({},n));var u=t.z2EmphasisLift;n.z2=t.z2+(u??$k)}return n}function Kk(t,e,r){if(r&&r.z2==null){r=q({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??Wk)}return r}function jk(t,e,r){var n=Ue(t.currentStates,e)>=0,a=t.style.opacity,i=n?null:Xk(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=q({},r),o=q({opacity:n?a:i.opacity*.1},o),r.style=o),r}function Of(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return Zk(this,t,e,r);if(t==="blur")return jk(this,t,r);if(t==="select")return Kk(this,t,r)}return r}function Jk(t){t.stateProxy=Of;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=Of),r&&(r.stateProxy=Of)}function $g(t,e){!Zg(t,e)&&!t.__highByOuter&&yn(t,Fg)}function Wg(t,e){!Zg(t,e)&&!t.__highByOuter&&yn(t,Hg)}function Ll(t,e){t.__highByOuter|=1<<(e||0),yn(t,Fg)}function Pl(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&yn(t,Hg)}function Qk(t){yn(t,Ef)}function qg(t){yn(t,Vg)}function Yg(t){yn(t,qk)}function Xg(t){yn(t,Yk)}function Zg(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Kg(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(a,i){var o=Pf(i),s=a==="series",l=s?t.getViewOfSeriesModel(i):t.getViewOfComponentModel(i);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(c){Vg(c)}),s&&r.push(i)),o.isBlured=!1}),I(n,function(a){a&&a.toggleBlurSeries&&a.toggleBlurSeries(r,!1,e)})}function Nf(t,e,r,n){var a=n.getModel();r=r||"coordinateSystem";function i(c,u){for(var f=0;f<u.length;f++){var h=c.getItemGraphicEl(u[f]);h&&qg(h)}}if(t!=null&&!(!e||e==="none")){var o=a.getSeriesByIndex(t),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];a.eachSeries(function(c){var u=o===c,f=c.coordinateSystem;f&&f.master&&(f=f.master);var h=f&&s?f===s:u;if(!(r==="series"&&!u||r==="coordinateSystem"&&!h||e==="series"&&u)){var d=n.getViewOfSeriesModel(c);if(d.group.traverse(function(g){g.__highByOuter&&u&&e==="self"||Ef(g)}),Vt(e))i(c.getData(),e);else if(de(e))for(var p=at(e),m=0;m<p.length;m++)i(c.getData(p[m]),e[p[m]]);l.push(c),Pf(c).isBlured=!0}}),a.eachComponent(function(c,u){if(c!=="series"){var f=n.getViewOfComponentModel(u);f&&f.toggleBlurSeries&&f.toggleBlurSeries(l,!0,a)}})}}function Bf(t,e,r){if(!(t==null||e==null)){var n=r.getModel().getComponent(t,e);if(n){Pf(n).isBlured=!0;var a=r.getViewOfComponentModel(n);!a||!a.focusBlurEnabled||a.group.traverse(function(i){Ef(i)})}}}function e2(t,e,r){var n=t.seriesIndex,a=t.getData(e.dataType);if(a){var i=Ma(a,e);i=(ee(i)?i[0]:i)||0;var o=a.getItemGraphicEl(i);if(!o)for(var s=a.count(),l=0;!o&&l<s;)o=a.getItemGraphicEl(l++);if(o){var c=We(o);Nf(n,c.focus,c.blurScope,r)}else{var u=t.get(["emphasis","focus"]),f=t.get(["emphasis","blurScope"]);u!=null&&Nf(n,u,f,r)}}}function zf(t,e,r,n){var a={focusSelf:!1,dispatchers:null};if(t==null||t==="series"||e==null||r==null)return a;var i=n.getModel().getComponent(t,e);if(!i)return a;var o=n.getViewOfComponentModel(i);if(!o||!o.findHighDownDispatchers)return a;for(var s=o.findHighDownDispatchers(r),l,c=0;c<s.length;c++)if(We(s[c]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function t2(t,e,r){var n=We(t),a=zf(n.componentMainType,n.componentIndex,n.componentHighDownName,r),i=a.dispatchers,o=a.focusSelf;i?(o&&Bf(n.componentMainType,n.componentIndex,r),I(i,function(s){return $g(s,e)})):(Nf(n.seriesIndex,n.focus,n.blurScope,r),n.focus==="self"&&Bf(n.componentMainType,n.componentIndex,r),$g(t,e))}function r2(t,e,r){Kg(r);var n=We(t),a=zf(n.componentMainType,n.componentIndex,n.componentHighDownName,r).dispatchers;a?I(a,function(i){return Wg(i,e)}):Wg(t,e)}function n2(t,e,r){if(Uf(e)){var n=e.dataType,a=t.getData(n),i=Ma(a,e);ee(i)||(i=[i]),t[e.type===Co?"toggleSelect":e.type===To?"select":"unselect"](i,n)}}function jg(t){var e=t.getAllData();I(e,function(r){var n=r.data,a=r.type;n.eachItemGraphicEl(function(i,o){t.isSelected(o,a)?Yg(i):Xg(i)})})}function a2(t){var e=[];return t.eachSeries(function(r){var n=r.getAllData();I(n,function(a){a.data;var i=a.type,o=r.getSelectedDataIndices();if(o.length>0){var s={dataIndex:o,seriesIndex:r.seriesIndex};i!=null&&(s.dataType=i),e.push(s)}})}),e}function Ff(t,e,r){Qg(t,!0),yn(t,Jk),o2(t,e,r)}function i2(t){Qg(t,!1)}function Rl(t,e,r,n){n?i2(t):Ff(t,e,r)}function o2(t,e,r){var n=We(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var Jg=["emphasis","blur","select"],s2={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Hf(t,e,r,n){r=r||"itemStyle";for(var a=0;a<Jg.length;a++){var i=Jg[a],o=e.getModel([i,r]),s=t.ensureState(i);s.style=o[s2[r]]()}}function Qg(t,e){var r=e===!1,n=t;t.highDownSilentOnTouch&&(n.__highDownSilentOnTouch=t.highDownSilentOnTouch),(!r||n.__highDownDispatcher)&&(n.__highByOuter=n.__highByOuter||0,n.__highDownDispatcher=!r)}function Vf(t){return!!(t&&t.__highDownDispatcher)}function l2(t){var e=Ng[t];return e==null&&Og<=32&&(e=Ng[t]=Og++),e}function Uf(t){var e=t.type;return e===To||e===Dl||e===Co}function em(t){var e=t.type;return e===Aa||e===Al}function c2(t){var e=Bg(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var r=t.states.select||{};e.selectFill=r.style&&r.style.fill||null,e.selectStroke=r.style&&r.style.stroke||null}var _i=wa.CMD,u2=[[],[],[]],tm=Math.sqrt,f2=Math.atan2;function d2(t,e){if(e){var r=t.data,n=t.len(),a,i,o,s,l,c,u=_i.M,f=_i.C,h=_i.L,d=_i.R,p=_i.A,m=_i.Q;for(o=0,s=0;o<n;){switch(a=r[o++],s=o,i=0,a){case u:i=1;break;case h:i=1;break;case f:i=3;break;case m:i=2;break;case p:var g=e[4],v=e[5],y=tm(e[0]*e[0]+e[1]*e[1]),b=tm(e[2]*e[2]+e[3]*e[3]),x=f2(-e[1]/b,e[0]/y);r[o]*=y,r[o++]+=g,r[o]*=b,r[o++]+=v,r[o++]*=y,r[o++]*=b,r[o++]+=x,r[o++]+=x,o+=2,s=o;break;case d:c[0]=r[o++],c[1]=r[o++],dr(c,c,e),r[s++]=c[0],r[s++]=c[1],c[0]+=r[o++],c[1]+=r[o++],dr(c,c,e),r[s++]=c[0],r[s++]=c[1]}for(l=0;l<i;l++){var w=u2[l];w[0]=r[o++],w[1]=r[o++],dr(w,w,e),r[s++]=w[0],r[s++]=w[1]}}t.increaseVersion()}}var Gf=Math.sqrt,El=Math.sin,Ol=Math.cos,Mo=Math.PI;function rm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function $f(t,e){return(t[0]*e[0]+t[1]*e[1])/(rm(t)*rm(e))}function nm(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos($f(t,e))}function am(t,e,r,n,a,i,o,s,l,c,u){var f=l*(Mo/180),h=Ol(f)*(t-r)/2+El(f)*(e-n)/2,d=-1*El(f)*(t-r)/2+Ol(f)*(e-n)/2,p=h*h/(o*o)+d*d/(s*s);p>1&&(o*=Gf(p),s*=Gf(p));var m=(a===i?-1:1)*Gf((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,g=m*o*d/s,v=m*-s*h/o,y=(t+r)/2+Ol(f)*g-El(f)*v,b=(e+n)/2+El(f)*g+Ol(f)*v,x=nm([1,0],[(h-g)/o,(d-v)/s]),w=[(h-g)/o,(d-v)/s],S=[(-1*h-g)/o,(-1*d-v)/s],k=nm(w,S);if($f(w,S)<=-1&&(k=Mo),$f(w,S)>=1&&(k=0),k<0){var C=Math.round(k/Mo*1e6)/1e6;k=Mo*2+C%2*Mo}u.addData(c,y,b,o,s,x,k,f,i)}var h2=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,p2=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function v2(t){var e=new wa;if(!t)return e;var r=0,n=0,a=r,i=n,o,s=wa.CMD,l=t.match(h2);if(!l)return e;for(var c=0;c<l.length;c++){for(var u=l[c],f=u.charAt(0),h=void 0,d=u.match(p2)||[],p=d.length,m=0;m<p;m++)d[m]=parseFloat(d[m]);for(var g=0;g<p;){var v=void 0,y=void 0,b=void 0,x=void 0,w=void 0,S=void 0,k=void 0,C=r,A=n,M=void 0,T=void 0;switch(f){case"l":r+=d[g++],n+=d[g++],h=s.L,e.addData(h,r,n);break;case"L":r=d[g++],n=d[g++],h=s.L,e.addData(h,r,n);break;case"m":r+=d[g++],n+=d[g++],h=s.M,e.addData(h,r,n),a=r,i=n,f="l";break;case"M":r=d[g++],n=d[g++],h=s.M,e.addData(h,r,n),a=r,i=n,f="L";break;case"h":r+=d[g++],h=s.L,e.addData(h,r,n);break;case"H":r=d[g++],h=s.L,e.addData(h,r,n);break;case"v":n+=d[g++],h=s.L,e.addData(h,r,n);break;case"V":n=d[g++],h=s.L,e.addData(h,r,n);break;case"C":h=s.C,e.addData(h,d[g++],d[g++],d[g++],d[g++],d[g++],d[g++]),r=d[g-2],n=d[g-1];break;case"c":h=s.C,e.addData(h,d[g++]+r,d[g++]+n,d[g++]+r,d[g++]+n,d[g++]+r,d[g++]+n),r+=d[g-2],n+=d[g-1];break;case"S":v=r,y=n,M=e.len(),T=e.data,o===s.C&&(v+=r-T[M-4],y+=n-T[M-3]),h=s.C,C=d[g++],A=d[g++],r=d[g++],n=d[g++],e.addData(h,v,y,C,A,r,n);break;case"s":v=r,y=n,M=e.len(),T=e.data,o===s.C&&(v+=r-T[M-4],y+=n-T[M-3]),h=s.C,C=r+d[g++],A=n+d[g++],r+=d[g++],n+=d[g++],e.addData(h,v,y,C,A,r,n);break;case"Q":C=d[g++],A=d[g++],r=d[g++],n=d[g++],h=s.Q,e.addData(h,C,A,r,n);break;case"q":C=d[g++]+r,A=d[g++]+n,r+=d[g++],n+=d[g++],h=s.Q,e.addData(h,C,A,r,n);break;case"T":v=r,y=n,M=e.len(),T=e.data,o===s.Q&&(v+=r-T[M-4],y+=n-T[M-3]),r=d[g++],n=d[g++],h=s.Q,e.addData(h,v,y,r,n);break;case"t":v=r,y=n,M=e.len(),T=e.data,o===s.Q&&(v+=r-T[M-4],y+=n-T[M-3]),r+=d[g++],n+=d[g++],h=s.Q,e.addData(h,v,y,r,n);break;case"A":b=d[g++],x=d[g++],w=d[g++],S=d[g++],k=d[g++],C=r,A=n,r=d[g++],n=d[g++],h=s.A,am(C,A,r,n,S,k,b,x,w,h,e);break;case"a":b=d[g++],x=d[g++],w=d[g++],S=d[g++],k=d[g++],C=r,A=n,r+=d[g++],n+=d[g++],h=s.A,am(C,A,r,n,S,k,b,x,w,h,e);break}}(f==="z"||f==="Z")&&(h=s.Z,e.addData(h),r=a,n=i),o=h}return e.toStatic(),e}var im=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.applyTransform=function(r){},e})(qe);function om(t){return t.setData!=null}function sm(t,e){var r=v2(t),n=q({},e);return n.buildPath=function(a){if(om(a)){a.setData(r.data);var i=a.getContext();i&&a.rebuildPath(i,1)}else{var i=a;r.rebuildPath(i,1)}},n.applyTransform=function(a){d2(r,a),this.dirtyShape()},n}function g2(t,e){return new im(sm(t,e))}function m2(t,e){var r=sm(t,e),n=(function(a){K(i,a);function i(o){var s=a.call(this,o)||this;return s.applyTransform=r.applyTransform,s.buildPath=r.buildPath,s}return i})(im);return n}function y2(t,e){for(var r=[],n=t.length,a=0;a<n;a++){var i=t[a];r.push(i.getUpdatedPathProxy(!0))}var o=new qe(e);return o.createPathProxy(),o.buildPath=function(s){if(om(s)){s.appendPath(r);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var St=(function(t){K(e,t);function e(r){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var n=this._children,a=0;a<n.length;a++)if(n[a].name===r)return n[a]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(r){return r&&r!==this&&r.parent!==this&&(this._children.push(r),this._doAdd(r)),this},e.prototype.addBefore=function(r,n){if(r&&r!==this&&r.parent!==this&&n&&n.parent===this){var a=this._children,i=a.indexOf(n);i>=0&&(a.splice(i,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,n){var a=Ue(this._children,r);return a>=0&&this.replaceAt(n,a),this},e.prototype.replaceAt=function(r,n){var a=this._children,i=a[n];if(r&&r!==this&&r.parent!==this&&r!==i){a[n]=r,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(r){var n=this.__zr,a=this._children,i=Ue(a,r);return i<0?this:(a.splice(i,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,a=0;a<r.length;a++){var i=r[a];n&&i.removeSelfFromZr(n),i.parent=null}return r.length=0,this},e.prototype.eachChild=function(r,n){for(var a=this._children,i=0;i<a.length;i++){var o=a[i];r.call(n,o,i)}return this},e.prototype.traverse=function(r,n){for(var a=0;a<this._children.length;a++){var i=this._children[a],o=r.call(n,i);i.isGroup&&!o&&i.traverse(r,n)}return this},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var n=0;n<this._children.length;n++){var a=this._children[n];a.addSelfToZr(r)}},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var n=0;n<this._children.length;n++){var a=this._children[n];a.removeSelfFromZr(r)}},e.prototype.getBoundingRect=function(r){for(var n=new Ge(0,0,0,0),a=r||this._children,i=[],o=null,s=0;s<a.length;s++){var l=a[s];if(!(l.ignore||l.invisible)){var c=l.getBoundingRect(),u=l.getLocalTransform(i);u?(Ge.applyTransform(n,c,u),o=o||n.clone(),o.union(n)):(o=o||c.clone(),o.union(c))}}return o||n},e})(ml);St.prototype.type="group";var _2=(function(){function t(){this.cx=0,this.cy=0,this.r=0}return t})(),Nl=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new _2},e.prototype.buildPath=function(r,n){r.moveTo(n.cx+n.r,n.cy),r.arc(n.cx,n.cy,n.r,0,Math.PI*2)},e})(qe);Nl.prototype.type="circle";var b2=(function(){function t(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return t})(),Wf=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new b2},e.prototype.buildPath=function(r,n){var a=.5522848,i=n.cx,o=n.cy,s=n.rx,l=n.ry,c=s*a,u=l*a;r.moveTo(i-s,o),r.bezierCurveTo(i-s,o-u,i-c,o-l,i,o-l),r.bezierCurveTo(i+c,o-l,i+s,o-u,i+s,o),r.bezierCurveTo(i+s,o+u,i+c,o+l,i,o+l),r.bezierCurveTo(i-c,o+l,i-s,o+u,i-s,o),r.closePath()},e})(qe);Wf.prototype.type="ellipse";var lm=Math.PI,qf=lm*2,Da=Math.sin,bi=Math.cos,x2=Math.acos,At=Math.atan2,cm=Math.abs,Ao=Math.sqrt,Do=Math.max,jr=Math.min,Lr=1e-4;function w2(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,h=f*l-u*c;if(!(h*h<Lr))return h=(u*(e-i)-f*(t-a))/h,[t+h*l,e+h*c]}function Bl(t,e,r,n,a,i,o){var s=t-r,l=e-n,c=(o?i:-i)/Ao(s*s+l*l),u=c*l,f=-c*s,h=t+u,d=e+f,p=r+u,m=n+f,g=(h+p)/2,v=(d+m)/2,y=p-h,b=m-d,x=y*y+b*b,w=a-i,S=h*m-p*d,k=(b<0?-1:1)*Ao(Do(0,w*w*x-S*S)),C=(S*b-y*k)/x,A=(-S*y-b*k)/x,M=(S*b+y*k)/x,T=(-S*y+b*k)/x,D=C-g,L=A-v,R=M-g,O=T-v;return D*D+L*L>R*R+O*O&&(C=M,A=T),{cx:C,cy:A,x0:-u,y0:-f,x1:C*(a/w-1),y1:A*(a/w-1)}}function S2(t){var e;if(ee(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function k2(t,e){var r,n=Do(e.r,0),a=Do(e.r0||0,0),i=n>0,o=a>0;if(!(!i&&!o)){if(i||(n=a,a=0),a>n){var s=n;n=a,a=s}var l=e.startAngle,c=e.endAngle;if(!(isNaN(l)||isNaN(c))){var u=e.cx,f=e.cy,h=!!e.clockwise,d=cm(c-l),p=d>qf&&d%qf;if(p>Lr&&(d=p),!(n>Lr))t.moveTo(u,f);else if(d>qf-Lr)t.moveTo(u+n*bi(l),f+n*Da(l)),t.arc(u,f,n,l,c,!h),a>Lr&&(t.moveTo(u+a*bi(c),f+a*Da(c)),t.arc(u,f,a,c,l,h));else{var m=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0,w=void 0,S=void 0,k=void 0,C=void 0,A=void 0,M=void 0,T=void 0,D=void 0,L=void 0,R=void 0,O=n*bi(l),B=n*Da(l),j=a*bi(c),P=a*Da(c),V=d>Lr;if(V){var H=e.cornerRadius;H&&(r=S2(H),m=r[0],g=r[1],v=r[2],y=r[3]);var Z=cm(n-a)/2;if(b=jr(Z,v),x=jr(Z,y),w=jr(Z,m),S=jr(Z,g),A=k=Do(b,x),M=C=Do(w,S),(k>Lr||C>Lr)&&(T=n*bi(c),D=n*Da(c),L=a*bi(l),R=a*Da(l),d<lm)){var re=w2(O,B,L,R,T,D,j,P);if(re){var Te=O-re[0],ge=B-re[1],xe=T-re[0],Ce=D-re[1],be=1/Da(x2((Te*xe+ge*Ce)/(Ao(Te*Te+ge*ge)*Ao(xe*xe+Ce*Ce)))/2),it=Ao(re[0]*re[0]+re[1]*re[1]);A=jr(k,(n-it)/(be+1)),M=jr(C,(a-it)/(be-1))}}}if(!V)t.moveTo(u+O,f+B);else if(A>Lr){var Qe=jr(v,A),ze=jr(y,A),oe=Bl(L,R,O,B,n,Qe,h),pe=Bl(T,D,j,P,n,ze,h);t.moveTo(u+oe.cx+oe.x0,f+oe.cy+oe.y0),A<k&&Qe===ze?t.arc(u+oe.cx,f+oe.cy,A,At(oe.y0,oe.x0),At(pe.y0,pe.x0),!h):(Qe>0&&t.arc(u+oe.cx,f+oe.cy,Qe,At(oe.y0,oe.x0),At(oe.y1,oe.x1),!h),t.arc(u,f,n,At(oe.cy+oe.y1,oe.cx+oe.x1),At(pe.cy+pe.y1,pe.cx+pe.x1),!h),ze>0&&t.arc(u+pe.cx,f+pe.cy,ze,At(pe.y1,pe.x1),At(pe.y0,pe.x0),!h))}else t.moveTo(u+O,f+B),t.arc(u,f,n,l,c,!h);if(!(a>Lr)||!V)t.lineTo(u+j,f+P);else if(M>Lr){var Qe=jr(m,M),ze=jr(g,M),oe=Bl(j,P,T,D,a,-ze,h),pe=Bl(O,B,L,R,a,-Qe,h);t.lineTo(u+oe.cx+oe.x0,f+oe.cy+oe.y0),M<C&&Qe===ze?t.arc(u+oe.cx,f+oe.cy,M,At(oe.y0,oe.x0),At(pe.y0,pe.x0),!h):(ze>0&&t.arc(u+oe.cx,f+oe.cy,ze,At(oe.y0,oe.x0),At(oe.y1,oe.x1),!h),t.arc(u,f,a,At(oe.cy+oe.y1,oe.cx+oe.x1),At(pe.cy+pe.y1,pe.cx+pe.x1),h),Qe>0&&t.arc(u+pe.cx,f+pe.cy,Qe,At(pe.y1,pe.x1),At(pe.y0,pe.x0),!h))}else t.lineTo(u+j,f+P),t.arc(u,f,a,c,l,h)}t.closePath()}}}var T2=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t})(),xi=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new T2},e.prototype.buildPath=function(r,n){k2(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e})(qe);xi.prototype.type="sector";var C2=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t})(),Yf=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new C2},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.PI*2;r.moveTo(a+n.r,i),r.arc(a,i,n.r,0,o,!1),r.moveTo(a+n.r0,i),r.arc(a,i,n.r0,0,o,!0)},e})(qe);Yf.prototype.type="ring";function M2(t,e,r,n){var a=[],i=[],o=[],s=[],l,c,u,f;if(n){u=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=t.length;h<d;h++)ci(u,u,t[h]),ui(f,f,t[h]);ci(u,u,n[0]),ui(f,f,n[1])}for(var h=0,d=t.length;h<d;h++){var p=t[h];if(r)l=t[h?h-1:d-1],c=t[(h+1)%d];else if(h===0||h===d-1){a.push(hS(t[h]));continue}else l=t[h-1],c=t[h+1];pS(i,c,l),Xu(i,i,e);var m=Zu(p,l),g=Zu(p,c),v=m+g;v!==0&&(m/=v,g/=v),Xu(o,i,-m),Xu(s,i,g);var y=Ev([],p,o),b=Ev([],p,s);n&&(ui(y,y,u),ci(y,y,f),ui(b,b,u),ci(b,b,f)),a.push(y),a.push(b)}return r&&a.push(a.shift()),a}function um(t,e,r){var n=e.smooth,a=e.points;if(a&&a.length>=2){if(n){var i=M2(a,n,r,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var o=a.length,s=0;s<(r?o:o-1);s++){var l=i[s*2],c=i[s*2+1],u=a[(s+1)%o];t.bezierCurveTo(l[0],l[1],c[0],c[1],u[0],u[1])}}else{t.moveTo(a[0][0],a[0][1]);for(var s=1,f=a.length;s<f;s++)t.lineTo(a[s][0],a[s][1])}r&&t.closePath()}}var A2=(function(){function t(){this.points=null,this.smooth=0,this.smoothConstraint=null}return t})(),Xf=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new A2},e.prototype.buildPath=function(r,n){um(r,n,!0)},e})(qe);Xf.prototype.type="polygon";var D2=(function(){function t(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return t})(),Zf=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new D2},e.prototype.buildPath=function(r,n){um(r,n,!1)},e})(qe);Zf.prototype.type="polyline";var I2={},L2=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return t})(),Hn=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new L2},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=ug(I2,n,this.style);a=l.x1,i=l.y1,o=l.x2,s=l.y2}else a=n.x1,i=n.y1,o=n.x2,s=n.y2;var c=n.percent;c!==0&&(r.moveTo(a,i),c<1&&(o=a*(1-c)+o*c,s=i*(1-c)+s*c),r.lineTo(o,s))},e.prototype.pointAt=function(r){var n=this.shape;return[n.x1*(1-r)+n.x2*r,n.y1*(1-r)+n.y2*r]},e})(qe);Hn.prototype.type="line";var Yt=[],P2=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return t})();function fm(t,e,r){var n=t.cpx2,a=t.cpy2;return n!=null||a!=null?[(r?Hv:wt)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?Hv:wt)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?Uv:Gt)(t.x1,t.cpx1,t.x2,e),(r?Uv:Gt)(t.y1,t.cpy1,t.y2,e)]}var Kf=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new P2},e.prototype.buildPath=function(r,n){var a=n.x1,i=n.y1,o=n.x2,s=n.y2,l=n.cpx1,c=n.cpy1,u=n.cpx2,f=n.cpy2,h=n.percent;h!==0&&(r.moveTo(a,i),u==null||f==null?(h<1&&(il(a,l,o,h,Yt),l=Yt[1],o=Yt[2],il(i,c,s,h,Yt),c=Yt[1],s=Yt[2]),r.quadraticCurveTo(l,c,o,s)):(h<1&&(al(a,l,u,o,h,Yt),l=Yt[1],u=Yt[2],o=Yt[3],al(i,c,f,s,h,Yt),c=Yt[1],f=Yt[2],s=Yt[3]),r.bezierCurveTo(l,c,u,f,o,s)))},e.prototype.pointAt=function(r){return fm(this.shape,r,!1)},e.prototype.tangentAt=function(r){var n=fm(this.shape,r,!0);return mS(n,n)},e})(qe);Kf.prototype.type="bezier-curve";var R2=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),zl=(function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new R2},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.max(n.r,0),s=n.startAngle,l=n.endAngle,c=n.clockwise,u=Math.cos(s),f=Math.sin(s);r.moveTo(u*o+a,f*o+i),r.arc(a,i,o,s,l,!c)},e})(qe);zl.prototype.type="arc";var E2=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="compound",r}return e.prototype._updatePathDirty=function(){for(var r=this.shape.paths,n=this.shapeChanged(),a=0;a<r.length;a++)n=n||r[a].shapeChanged();n&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var r=this.shape.paths||[],n=this.getGlobalScale(),a=0;a<r.length;a++)r[a].path||r[a].createPathProxy(),r[a].path.setScale(n[0],n[1],r[a].segmentIgnoreThreshold)},e.prototype.buildPath=function(r,n){for(var a=n.paths||[],i=0;i<a.length;i++)a[i].buildPath(r,a[i].shape,!0)},e.prototype.afterBrush=function(){for(var r=this.shape.paths||[],n=0;n<r.length;n++)r[n].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),qe.prototype.getBoundingRect.call(this)},e})(qe),dm=(function(){function t(e){this.colorStops=e||[]}return t.prototype.addColorStop=function(e,r){this.colorStops.push({offset:e,color:r})},t})(),hm=(function(t){K(e,t);function e(r,n,a,i,o,s){var l=t.call(this,o)||this;return l.x=r??0,l.y=n??0,l.x2=a??1,l.y2=i??0,l.type="linear",l.global=s||!1,l}return e})(dm),O2=(function(t){K(e,t);function e(r,n,a,i,o){var s=t.call(this,i)||this;return s.x=r??.5,s.y=n??.5,s.r=a??.5,s.type="radial",s.global=o||!1,s}return e})(dm),Ia=[0,0],La=[0,0],Fl=new Je,Hl=new Je,Vl=(function(){function t(e,r){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new Je;for(var n=0;n<2;n++)this._axes[n]=new Je;e&&this.fromBoundingRect(e,r)}return t.prototype.fromBoundingRect=function(e,r){var n=this._corners,a=this._axes,i=e.x,o=e.y,s=i+e.width,l=o+e.height;if(n[0].set(i,o),n[1].set(s,o),n[2].set(s,l),n[3].set(i,l),r)for(var c=0;c<4;c++)n[c].transform(r);Je.sub(a[0],n[1],n[0]),Je.sub(a[1],n[3],n[0]),a[0].normalize(),a[1].normalize();for(var c=0;c<2;c++)this._origin[c]=a[c].dot(n[0])},t.prototype.intersect=function(e,r){var n=!0,a=!r;return Fl.set(1/0,1/0),Hl.set(0,0),!this._intersectCheckOneSide(this,e,Fl,Hl,a,1)&&(n=!1,a)||!this._intersectCheckOneSide(e,this,Fl,Hl,a,-1)&&(n=!1,a)||a||Je.copy(r,n?Fl:Hl),n},t.prototype._intersectCheckOneSide=function(e,r,n,a,i,o){for(var s=!0,l=0;l<2;l++){var c=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,Ia),this._getProjMinMaxOnAxis(l,r._corners,La),Ia[1]<La[0]||Ia[0]>La[1]){if(s=!1,i)return s;var u=Math.abs(La[0]-Ia[1]),f=Math.abs(Ia[0]-La[1]);Math.min(u,f)>a.len()&&(u<f?Je.scale(a,c,-u*o):Je.scale(a,c,f*o))}else if(n){var u=Math.abs(La[0]-Ia[1]),f=Math.abs(Ia[0]-La[1]);Math.min(u,f)<n.len()&&(u<f?Je.scale(n,c,u*o):Je.scale(n,c,-f*o))}}return s},t.prototype._getProjMinMaxOnAxis=function(e,r,n){for(var a=this._axes[e],i=this._origin,o=r[0].dot(a)+i[e],s=o,l=o,c=1;c<r.length;c++){var u=r[c].dot(a)+i[e];s=Math.min(u,s),l=Math.max(u,l)}n[0]=s,n[1]=l},t})(),N2=[],B2=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.notClear=!0,r.incremental=!0,r._displayables=[],r._temporaryDisplayables=[],r._cursor=0,r}return e.prototype.traverse=function(r,n){r.call(n,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(r,n){n?this._temporaryDisplayables.push(r):this._displayables.push(r),this.markRedraw()},e.prototype.addDisplayables=function(r,n){n=n||!1;for(var a=0;a<r.length;a++)this.addDisplayable(r[a],n)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(r){for(var n=this._cursor;n<this._displayables.length;n++)r&&r(this._displayables[n]);for(var n=0;n<this._temporaryDisplayables.length;n++)r&&r(this._temporaryDisplayables[n])},e.prototype.update=function(){this.updateTransform();for(var r=this._cursor;r<this._displayables.length;r++){var n=this._displayables[r];n.parent=this,n.update(),n.parent=null}for(var r=0;r<this._temporaryDisplayables.length;r++){var n=this._temporaryDisplayables[r];n.parent=this,n.update(),n.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var r=new Ge(1/0,1/0,-1/0,-1/0),n=0;n<this._displayables.length;n++){var a=this._displayables[n],i=a.getBoundingRect().clone();a.needLocalTransform()&&i.applyTransform(a.getLocalTransform(N2)),r.union(i)}this._rect=r}return this._rect},e.prototype.contain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect();if(i.contain(a[0],a[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(r,n))return!0}return!1},e})(yo),z2=ht();function F2(t,e,r,n,a){var i;if(e&&e.ecModel){var o=e.ecModel.getUpdatePayload();i=o&&o.animation}var s=e&&e.isAnimationEnabled(),l=t==="update";if(s){var c=void 0,u=void 0,f=void 0;n?(c=Pe(n.duration,200),u=Pe(n.easing,"cubicOut"),f=0):(c=e.getShallow(l?"animationDurationUpdate":"animationDuration"),u=e.getShallow(l?"animationEasingUpdate":"animationEasing"),f=e.getShallow(l?"animationDelayUpdate":"animationDelay")),i&&(i.duration!=null&&(c=i.duration),i.easing!=null&&(u=i.easing),i.delay!=null&&(f=i.delay)),ke(f)&&(f=f(r,a)),ke(c)&&(c=c(r));var h={duration:c||0,delay:f,easing:u};return h}else return null}function jf(t,e,r,n,a,i,o){var s=!1,l;ke(a)?(o=i,i=a,a=null):de(a)&&(i=a.cb,o=a.during,s=a.isFrom,l=a.removeOpt,a=a.dataIndex);var c=t==="leave";c||e.stopAnimation("leave");var u=F2(t,n,a,c?l||{}:null,n&&n.getAnimationDelayParams?n.getAnimationDelayParams(e,a):null);if(u&&u.duration>0){var f=u.duration,h=u.delay,d=u.easing,p={duration:f,delay:h||0,easing:d,done:i,force:!!i||!!o,setToFinal:!c,scope:t,during:o};s?e.animateFrom(r,p):e.animateTo(r,p)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),i&&i()}function or(t,e,r,n,a,i){jf("update",t,e,r,n,a,i)}function _n(t,e,r,n,a,i){jf("enter",t,e,r,n,a,i)}function Io(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){var r=t.animators[e];if(r.scope==="leave")return!0}return!1}function Ul(t,e,r,n,a,i){Io(t)||jf("leave",t,e,r,n,a,i)}function pm(t,e,r,n){t.removeTextContent(),t.removeTextGuideLine(),Ul(t,{style:{opacity:0}},e,r,n)}function Jf(t,e,r){function n(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(a){a.isGroup||pm(a,e,r,n)}):pm(t,e,r,n)}function vm(t){z2(t).oldStyle=t.style}var Gl=Math.max,$l=Math.min,Qf={};function H2(t){return qe.extend(t)}var V2=m2;function U2(t,e){return V2(t,e)}function Pr(t,e){Qf[t]=e}function G2(t){if(Qf.hasOwnProperty(t))return Qf[t]}function ed(t,e,r,n){var a=g2(t,e);return r&&(n==="center"&&(r=mm(r,a.getBoundingRect())),ym(a,r)),a}function gm(t,e,r){var n=new Fn({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(a){if(r==="center"){var i={width:a.width,height:a.height};n.setStyle(mm(e,i))}}});return n}function mm(t,e){var r=e.width/e.height,n=t.height*r,a;n<=t.width?a=t.height:(n=t.width,a=n/r);var i=t.x+t.width/2,o=t.y+t.height/2;return{x:i-n/2,y:o-a/2,width:n,height:a}}var $2=y2;function ym(t,e){if(t.applyTransform){var r=t.getBoundingRect(),n=r.calculateTransform(e);t.applyTransform(n)}}function Lo(t,e){return ug(t,t,{lineWidth:e}),t}function W2(t){return fg(t.shape,t.shape,t.style),t}var q2=Ta;function Y2(t,e){for(var r=Hu([]);t&&t!==e;)ii(r,t.getLocalTransform(),r),t=t.parent;return r}function td(t,e,r){return e&&!Vt(e)&&(e=Ju.getLocalTransform(e)),r&&(e=Gu([],e)),dr([],t,e)}function X2(t,e,r){var n=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),a=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),i=[t==="left"?-n:t==="right"?n:0,t==="top"?-a:t==="bottom"?a:0];return i=td(i,e,r),Math.abs(i[0])>Math.abs(i[1])?i[0]>0?"right":"left":i[1]>0?"bottom":"top"}function _m(t){return!t.isGroup}function Z2(t){return t.shape!=null}function bm(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){_m(l)&&l.anid&&(s[l.anid]=l)}),s}function a(o){var s={x:o.x,y:o.y,rotation:o.rotation};return Z2(o)&&(s.shape=q({},o.shape)),s}var i=n(t);e.traverse(function(o){if(_m(o)&&o.anid){var s=i[o.anid];if(s){var l=a(o);o.attr(a(s)),or(o,l,r,We(o).dataIndex)}}})}function K2(t,e){return he(t,function(r){var n=r[0];n=Gl(n,e.x),n=$l(n,e.x+e.width);var a=r[1];return a=Gl(a,e.y),a=$l(a,e.y+e.height),[n,a]})}function j2(t,e){var r=Gl(t.x,e.x),n=$l(t.x+t.width,e.x+e.width),a=Gl(t.y,e.y),i=$l(t.y+t.height,e.y+e.height);if(n>=r&&i>=a)return{x:r,y:a,width:n-r,height:i-a}}function rd(t,e,r){var n=q({rectHover:!0},e),a=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(a.image=t.slice(8),He(a,r),new Fn(n)):ed(t.replace("path://",""),n,r,"center")}function J2(t,e,r,n,a){for(var i=0,o=a[a.length-1];i<a.length;i++){var s=a[i];if(xm(t,e,r,n,s[0],s[1],o[0],o[1]))return!0;o=s}}function xm(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,h=nd(u,f,l,c);if(Q2(h))return!1;var d=t-a,p=e-i,m=nd(d,p,l,c)/h;if(m<0||m>1)return!1;var g=nd(d,p,u,f)/h;return!(g<0||g>1)}function nd(t,e,r,n){return t*n-r*e}function Q2(t){return t<=1e-6&&t>=-1e-6}function Wl(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,a=ae(e)?{formatter:e}:e,i=r.mainType,o=r.componentIndex,s={componentType:i,name:n,$vars:["name"]};s[i+"Index"]=o;var l=t.formatterParamsExtra;l&&I(at(l),function(u){la(s,u)||(s[u]=l[u],s.$vars.push(u))});var c=We(t.el);c.componentMainType=i,c.componentIndex=o,c.tooltipConfig={name:n,option:He({content:n,encodeHTMLContent:!0,formatterParams:s},a)}}function wm(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function ql(t,e){if(t)if(ee(t))for(var r=0;r<t.length;r++)wm(t[r],e);else wm(t,e)}Pr("circle",Nl),Pr("ellipse",Wf),Pr("sector",xi),Pr("ring",Yf),Pr("polygon",Xf),Pr("polyline",Zf),Pr("rect",_t),Pr("line",Hn),Pr("bezierCurve",Kf),Pr("arc",zl);const eT=Object.freeze(Object.defineProperty({__proto__:null,Arc:zl,BezierCurve:Kf,BoundingRect:Ge,Circle:Nl,CompoundPath:E2,Ellipse:Wf,Group:St,Image:Fn,IncrementalDisplayable:B2,Line:Hn,LinearGradient:hm,OrientedBoundingRect:Vl,Path:qe,Point:Je,Polygon:Xf,Polyline:Zf,RadialGradient:O2,Rect:_t,Ring:Yf,Sector:xi,Text:$t,applyTransform:td,clipPointsByRect:K2,clipRectByRect:j2,createIcon:rd,extendPath:U2,extendShape:H2,getShapeClass:G2,getTransform:Y2,groupTransition:bm,initProps:_n,isElementRemoved:Io,lineLineIntersect:xm,linePolygonIntersect:J2,makeImage:gm,makePath:ed,mergePath:$2,registerShape:Pr,removeElement:Ul,removeElementWithFadeOut:Jf,resizePath:ym,setTooltipConfig:Wl,subPixelOptimize:q2,subPixelOptimizeLine:Lo,subPixelOptimizeRect:W2,transformDirection:X2,traverseElements:ql,updateProps:or},Symbol.toStringTag,{value:"Module"}));var Yl={};function tT(t,e){for(var r=0;r<Kr.length;r++){var n=Kr[r],a=e[n],i=t.ensureState(n);i.style=i.style||{},i.style.text=a}var o=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(o,!0)}function Sm(t,e,r){var n=t.labelFetcher,a=t.labelDataIndex,i=t.labelDimIndex,o=e.normal,s;n&&(s=n.getFormattedLabel(a,"normal",null,i,o&&o.get("formatter"),r!=null?{interpolatedValue:r}:null)),s==null&&(s=ke(t.defaultText)?t.defaultText(a,t,r):t.defaultText);for(var l={normal:s},c=0;c<Kr.length;c++){var u=Kr[c],f=e[u];l[u]=Pe(n?n.getFormattedLabel(a,u,null,i,f&&f.get("formatter")):null,s)}return l}function Xl(t,e,r,n){r=r||Yl;for(var a=t instanceof $t,i=!1,o=0;o<zg.length;o++){var s=e[zg[o]];if(s&&s.getShallow("show")){i=!0;break}}var l=a?t:t.getTextContent();if(i){a||(l||(l=new $t,t.setTextContent(l)),t.stateProxy&&(l.stateProxy=t.stateProxy));var c=Sm(r,e),u=e.normal,f=!!u.getShallow("show"),h=wi(u,n&&n.normal,r,!1,!a);h.text=c.normal,a||t.setTextConfig(km(u,r,!1));for(var o=0;o<Kr.length;o++){var d=Kr[o],s=e[d];if(s){var p=l.ensureState(d),m=!!Pe(s.getShallow("show"),f);if(m!==f&&(p.ignore=!m),p.style=wi(s,n&&n[d],r,!0,!a),p.style.text=c[d],!a){var g=t.ensureState(d);g.textConfig=km(s,r,!0)}}}l.silent=!!u.getShallow("silent"),l.style.x!=null&&(h.x=l.style.x),l.style.y!=null&&(h.y=l.style.y),l.ignore=!f,l.useStyle(h),l.dirty(),r.enableTextSetter&&(Kl(l).setLabelText=function(v){var y=Sm(r,e,v);tT(l,y)})}else l&&(l.ignore=!0);t.dirty()}function Zl(t,e){e=e||"label";for(var r={normal:t.getModel(e)},n=0;n<Kr.length;n++){var a=Kr[n];r[a]=t.getModel([a,e])}return r}function wi(t,e,r,n,a){var i={};return rT(i,t,r,n,a),e&&q(i,e),i}function km(t,e,r){e=e||{};var n={},a,i=t.getShallow("rotate"),o=Pe(t.getShallow("distance"),r?null:5),s=t.getShallow("offset");return a=t.getShallow("position")||(r?null:"inside"),a==="outside"&&(a=e.defaultOutsidePosition||"top"),a!=null&&(n.position=a),s!=null&&(n.offset=s),i!=null&&(i*=Math.PI/180,n.rotation=i),o!=null&&(n.distance=o),n.outsideFill=t.get("color")==="inherit"?e.inheritColor||null:"auto",n}function rT(t,e,r,n,a){r=r||Yl;var i=e.ecModel,o=i&&i.option.textStyle,s=nT(e),l;if(s){l={};for(var c in s)if(s.hasOwnProperty(c)){var u=e.getModel(["rich",c]);Am(l[c]={},u,o,r,n,a,!1,!0)}}l&&(t.rich=l);var f=e.get("overflow");f&&(t.overflow=f);var h=e.get("minMargin");h!=null&&(t.margin=h),Am(t,e,o,r,n,a,!0,!1)}function nT(t){for(var e;t&&t!==t.ecModel;){var r=(t.option||Yl).rich;if(r){e=e||{};for(var n=at(r),a=0;a<n.length;a++){var i=n[a];e[i]=1}}t=t.parentModel}return e}var Tm=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Cm=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Mm=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function Am(t,e,r,n,a,i,o,s){r=!a&&r||Yl;var l=n&&n.inheritColor,c=e.getShallow("color"),u=e.getShallow("textBorderColor"),f=Pe(e.getShallow("opacity"),r.opacity);(c==="inherit"||c==="auto")&&(l?c=l:c=null),(u==="inherit"||u==="auto")&&(l?u=l:u=null),i||(c=c||r.color,u=u||r.textBorderColor),c!=null&&(t.fill=c),u!=null&&(t.stroke=u);var h=Pe(e.getShallow("textBorderWidth"),r.textBorderWidth);h!=null&&(t.lineWidth=h);var d=Pe(e.getShallow("textBorderType"),r.textBorderType);d!=null&&(t.lineDash=d);var p=Pe(e.getShallow("textBorderDashOffset"),r.textBorderDashOffset);p!=null&&(t.lineDashOffset=p),!a&&f==null&&!s&&(f=n&&n.defaultOpacity),f!=null&&(t.opacity=f),!a&&!i&&t.fill==null&&n.inheritColor&&(t.fill=n.inheritColor);for(var m=0;m<Tm.length;m++){var g=Tm[m],v=Pe(e.getShallow(g),r[g]);v!=null&&(t[g]=v)}for(var m=0;m<Cm.length;m++){var g=Cm[m],v=e.getShallow(g);v!=null&&(t[g]=v)}if(t.verticalAlign==null){var y=e.getShallow("baseline");y!=null&&(t.verticalAlign=y)}if(!o||!n.disableBox){for(var m=0;m<Mm.length;m++){var g=Mm[m],v=e.getShallow(g);v!=null&&(t[g]=v)}var b=e.getShallow("borderType");b!=null&&(t.borderDash=b),(t.backgroundColor==="auto"||t.backgroundColor==="inherit")&&l&&(t.backgroundColor=l),(t.borderColor==="auto"||t.borderColor==="inherit")&&l&&(t.borderColor=l)}}function aT(t,e){var r=e&&e.getModel("textStyle");return Gr([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))}var Kl=ht();function iT(t,e,r,n){if(t){var a=Kl(t);a.prevValue=a.value,a.value=r;var i=e.normal;a.valueAnimation=i.get("valueAnimation"),a.valueAnimation&&(a.precision=i.get("precision"),a.defaultInterpolatedText=n,a.statesModels=e)}}var oT=["textStyle","color"],ad=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],id=new $t,sT=(function(){function t(){}return t.prototype.getTextColor=function(e){var r=this.ecModel;return this.getShallow("color")||(!e&&r?r.get(oT):null)},t.prototype.getFont=function(){return aT({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(e){for(var r={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<ad.length;n++)r[ad[n]]=this.getShallow(ad[n]);return id.useStyle(r),id.update(),id.getBoundingRect()},t})(),Dm=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],lT=oo(Dm),cT=(function(){function t(){}return t.prototype.getLineStyle=function(e){return lT(this,e)},t})(),Im=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],uT=oo(Im),fT=(function(){function t(){}return t.prototype.getItemStyle=function(e,r){return uT(this,e,r)},t})(),lt=(function(){function t(e,r,n){this.parentModel=r,this.ecModel=n,this.option=e}return t.prototype.init=function(e,r,n){},t.prototype.mergeOption=function(e,r){Oe(this.option,e,!0)},t.prototype.get=function(e,r){return e==null?this.option:this._doGet(this.parsePath(e),!r&&this.parentModel)},t.prototype.getShallow=function(e,r){var n=this.option,a=n==null?n:n[e];if(a==null&&!r){var i=this.parentModel;i&&(a=i.getShallow(e))}return a},t.prototype.getModel=function(e,r){var n=e!=null,a=n?this.parsePath(e):null,i=n?this._doGet(a):this.option;return r=r||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(a)),new t(i,r,this.ecModel)},t.prototype.isEmpty=function(){return this.option==null},t.prototype.restoreData=function(){},t.prototype.clone=function(){var e=this.constructor;return new e(Ie(this.option))},t.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},t.prototype.resolveParentPath=function(e){return e},t.prototype.isAnimationEnabled=function(){if(!_e.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(e,r){var n=this.option;if(!e)return n;for(var a=0;a<e.length&&!(e[a]&&(n=n&&typeof n=="object"?n[e[a]]:null,n==null));a++);return n==null&&r&&(n=r._doGet(this.resolveParentPath(e),r.parentModel)),n},t})();zu(lt),Xw(lt),Ur(lt,cT),Ur(lt,fT),Ur(lt,Qw),Ur(lt,sT);function Po(t){return t==null?0:t.length||1}function Lm(t){return t}var dT=(function(){function t(e,r,n,a,i,o){this._old=e,this._new=r,this._oldKeyGetter=n||Lm,this._newKeyGetter=a||Lm,this.context=i,this._diffModeMultiple=o==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,n={},a=new Array(e.length),i=new Array(r.length);this._initIndexMap(e,null,a,"_oldKeyGetter"),this._initIndexMap(r,n,i,"_newKeyGetter");for(var o=0;o<e.length;o++){var s=a[o],l=n[s],c=Po(l);if(c>1){var u=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(u,o)}else c===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},a={},i=[],o=[];this._initIndexMap(e,n,i,"_oldKeyGetter"),this._initIndexMap(r,a,o,"_newKeyGetter");for(var s=0;s<i.length;s++){var l=i[s],c=n[l],u=a[l],f=Po(c),h=Po(u);if(f>1&&h===1)this._updateManyToOne&&this._updateManyToOne(u,c),a[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(u,c),a[l]=null;else if(f===1&&h===1)this._update&&this._update(u,c),a[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,c),a[l]=null;else if(f>1)for(var d=0;d<f;d++)this._remove&&this._remove(c[d]);else this._remove&&this._remove(c)}this._performRestAdd(o,a)},t.prototype._performRestAdd=function(e,r){for(var n=0;n<e.length;n++){var a=e[n],i=r[a],o=Po(i);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(i[s]);else o===1&&this._add&&this._add(i);r[a]=null}},t.prototype._initIndexMap=function(e,r,n,a){for(var i=this._diffModeMultiple,o=0;o<e.length;o++){var s="_ec_"+this[a](e[o],o);if(i||(n[o]=s),!!r){var l=r[s],c=Po(l);c===0?(r[s]=o,i&&n.push(s)):c===1?r[s]=[l,o]:l.push(o)}}},t})(),Pm=me(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),yr="original",Xt="arrayRows",Jr="objectRows",bn="keyedColumns",Vn="typedArray",Rm="unknown",xn="column",Si="row",sr={Must:1,Might:2,Not:3},Em=ht();function hT(t){Em(t).datasetMap=me()}function pT(t,e,r){var n={},a=Om(e);if(!a||!t)return n;var i=[],o=[],s=e.ecModel,l=Em(s).datasetMap,c=a.uid+"_"+r.seriesLayoutBy,u,f;t=t.slice(),I(t,function(m,g){var v=de(m)?m:t[g]={name:m};v.type==="ordinal"&&u==null&&(u=g,f=p(v)),n[v.name]=[]});var h=l.get(c)||l.set(c,{categoryWayDim:f,valueWayDim:0});I(t,function(m,g){var v=m.name,y=p(m);if(u==null){var b=h.valueWayDim;d(n[v],b,y),d(o,b,y),h.valueWayDim+=y}else if(u===g)d(n[v],0,y),d(i,0,y);else{var b=h.categoryWayDim;d(n[v],b,y),d(o,b,y),h.categoryWayDim+=y}});function d(m,g,v){for(var y=0;y<v;y++)m.push(g+y)}function p(m){var g=m.dimsDef;return g?g.length:1}return i.length&&(n.itemName=i),o.length&&(n.seriesName=o),n}function Om(t){var e=t.get("data",!0);if(!e)return ko(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},qt).models[0]}function vT(t){return!t.get("transform",!0)&&!t.get("fromTransformResult",!0)?[]:ko(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},qt).models}function Nm(t,e){return gT(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function gT(t,e,r,n,a,i){var o,s=5;if(Ut(t))return sr.Not;var l,c;if(n){var u=n[i];de(u)?(l=u.name,c=u.type):ae(u)&&(l=u)}if(c!=null)return c==="ordinal"?sr.Must:sr.Not;if(e===Xt){var f=t;if(r===Si){for(var h=f[i],d=0;d<(h||[]).length&&d<s;d++)if((o=x(h[a+d]))!=null)return o}else for(var d=0;d<f.length&&d<s;d++){var p=f[a+d];if(p&&(o=x(p[i]))!=null)return o}}else if(e===Jr){var m=t;if(!l)return sr.Not;for(var d=0;d<m.length&&d<s;d++){var g=m[d];if(g&&(o=x(g[l]))!=null)return o}}else if(e===bn){var v=t;if(!l)return sr.Not;var h=v[l];if(!h||Ut(h))return sr.Not;for(var d=0;d<h.length&&d<s;d++)if((o=x(h[d]))!=null)return o}else if(e===yr)for(var y=t,d=0;d<y.length&&d<s;d++){var g=y[d],b=xo(g);if(!ee(b))return sr.Not;if((o=x(b[i]))!=null)return o}function x(w){var S=ae(w);if(w!=null&&Number.isFinite(Number(w))&&w!=="")return S?sr.Might:sr.Not;if(S&&w!=="-")return sr.Must}return sr.Not}var jl=(function(){function t(e){this.data=e.data||(e.sourceFormat===bn?{}:[]),this.sourceFormat=e.sourceFormat||Rm,this.seriesLayoutBy=e.seriesLayoutBy||xn,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var n=0;n<r.length;n++){var a=r[n];a.type==null&&Nm(this,n)===sr.Must&&(a.type="ordinal")}}return t})();function od(t){return t instanceof jl}function sd(t,e,r){r=r||zm(t);var n=e.seriesLayoutBy,a=yT(t,r,n,e.sourceHeader,e.dimensions),i=new jl({data:t,sourceFormat:r,seriesLayoutBy:n,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,metaRawOption:Ie(e)});return i}function Bm(t){return new jl({data:t,sourceFormat:Ut(t)?Vn:yr})}function mT(t){return new jl({data:t.data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:Ie(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})}function zm(t){var e=Rm;if(Ut(t))e=Vn;else if(ee(t)){t.length===0&&(e=Xt);for(var r=0,n=t.length;r<n;r++){var a=t[r];if(a!=null){if(ee(a)||Ut(a)){e=Xt;break}else if(de(a)){e=Jr;break}}}}else if(de(t)){for(var i in t)if(la(t,i)&&Vt(t[i])){e=bn;break}}return e}function yT(t,e,r,n,a){var i,o;if(!t)return{dimensionsDefine:Fm(a),startIndex:o,dimensionsDetectedCount:i};if(e===Xt){var s=t;n==="auto"||n==null?Hm(function(c){c!=null&&c!=="-"&&(ae(c)?o==null&&(o=1):o=0)},r,s,10):o=et(n)?n:n?1:0,!a&&o===1&&(a=[],Hm(function(c,u){a[u]=c!=null?c+"":""},r,s,1/0)),i=a?a.length:r===Si?s.length:s[0]?s[0].length:null}else if(e===Jr)a||(a=_T(t));else if(e===bn)a||(a=[],I(t,function(c,u){a.push(u)}));else if(e===yr){var l=xo(t[0]);i=ee(l)&&l.length||1}return{startIndex:o,dimensionsDefine:Fm(a),dimensionsDetectedCount:i}}function _T(t){for(var e=0,r;e<t.length&&!(r=t[e++]););if(r)return at(r)}function Fm(t){if(t){var e=me();return he(t,function(r,n){r=de(r)?r:{name:r};var a={name:r.name,displayName:r.displayName,type:r.type};if(a.name==null)return a;a.name+="",a.displayName==null&&(a.displayName=a.name);var i=e.get(a.name);return i?a.name+="-"+i.count++:e.set(a.name,{count:1}),a})}}function Hm(t,e,r,n){if(e===Si)for(var a=0;a<r.length&&a<n;a++)t(r[a]?r[a][0]:null,a);else for(var i=r[0]||[],a=0;a<i.length&&a<n;a++)t(i[a],a)}function Vm(t){var e=t.sourceFormat;return e===Jr||e===bn}var Pa,Ra,Ea,Um,Gm,$m=(function(){function t(e,r){var n=od(e)?e:Bm(e);this._source=n;var a=this._data=n.data;n.sourceFormat===Vn&&(this._offset=0,this._dimSize=r,this._data=a),Gm(this,a,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(e,r){},t.prototype.appendData=function(e){},t.prototype.clean=function(){},t.protoInitialize=(function(){var e=t.prototype;e.pure=!1,e.persistent=!0})(),t.internalField=(function(){var e;Gm=function(o,s,l){var c=l.sourceFormat,u=l.seriesLayoutBy,f=l.startIndex,h=l.dimensionsDefine,d=Um[cd(c,u)];if(q(o,d),c===Vn)o.getItem=r,o.count=a,o.fillStorage=n;else{var p=qm(c,u);o.getItem=Ne(p,null,s,f,h);var m=Xm(c,u);o.count=Ne(m,null,s,f,h)}};var r=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,c=this._dimSize,u=c*o,f=0;f<c;f++)s[f]=l[u+f];return s},n=function(o,s,l,c){for(var u=this._data,f=this._dimSize,h=0;h<f;h++){for(var d=c[h],p=d[0]==null?1/0:d[0],m=d[1]==null?-1/0:d[1],g=s-o,v=l[h],y=0;y<g;y++){var b=u[y*f+h];v[o+y]=b,b<p&&(p=b),b>m&&(m=b)}d[0]=p,d[1]=m}},a=function(){return this._data?this._data.length/this._dimSize:0};Um=(e={},e[Xt+"_"+xn]={pure:!0,appendData:i},e[Xt+"_"+Si]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Jr]={pure:!0,appendData:i},e[bn]={pure:!0,appendData:function(o){var s=this._data;I(o,function(l,c){for(var u=s[c]||(s[c]=[]),f=0;f<(l||[]).length;f++)u.push(l[f])})}},e[yr]={appendData:i},e[Vn]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}})(),t})(),Wm=function(t,e,r,n){return t[n]},bT=(Pa={},Pa[Xt+"_"+xn]=function(t,e,r,n){return t[n+e]},Pa[Xt+"_"+Si]=function(t,e,r,n,a){n+=e;for(var i=a||[],o=t,s=0;s<o.length;s++){var l=o[s];i[s]=l?l[n]:null}return i},Pa[Jr]=Wm,Pa[bn]=function(t,e,r,n,a){for(var i=a||[],o=0;o<r.length;o++){var s=r[o].name,l=t[s];i[o]=l?l[n]:null}return i},Pa[yr]=Wm,Pa);function qm(t,e){var r=bT[cd(t,e)];return r}var Ym=function(t,e,r){return t.length},xT=(Ra={},Ra[Xt+"_"+xn]=function(t,e,r){return Math.max(0,t.length-e)},Ra[Xt+"_"+Si]=function(t,e,r){var n=t[0];return n?Math.max(0,n.length-e):0},Ra[Jr]=Ym,Ra[bn]=function(t,e,r){var n=r[0].name,a=t[n];return a?a.length:0},Ra[yr]=Ym,Ra);function Xm(t,e){var r=xT[cd(t,e)];return r}var ld=function(t,e,r){return t[e]},wT=(Ea={},Ea[Xt]=ld,Ea[Jr]=function(t,e,r){return t[r]},Ea[bn]=ld,Ea[yr]=function(t,e,r){var n=xo(t);return n instanceof Array?n[e]:n},Ea[Vn]=ld,Ea);function Zm(t){var e=wT[t];return e}function cd(t,e){return t===Xt?t+"_"+e:t}function ki(t,e,r){if(t){var n=t.getRawDataItem(e);if(n!=null){var a=t.getStore(),i=a.getSource().sourceFormat;if(r!=null){var o=t.getDimensionIndex(r),s=a.getDimensionProperty(o);return Zm(i)(n,o,s)}else{var l=n;return i===yr&&(l=xo(n)),l}}}}var ST=(function(){function t(e,r){this._encode=e,this._schema=r}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t})();function kT(t,e){var r={},n=r.encode={},a=me(),i=[],o=[],s={};I(t.dimensions,function(h){var d=t.getDimensionInfo(h),p=d.coordDim;if(p){var m=d.coordDimIndex;ud(n,p)[m]=h,d.isExtraCoord||(a.set(p,1),CT(d.type)&&(i[0]=h),ud(s,p)[m]=t.getDimensionIndex(d.name)),d.defaultTooltip&&o.push(h)}Pm.each(function(g,v){var y=ud(n,v),b=d.otherDims[v];b!=null&&b!==!1&&(y[b]=d.name)})});var l=[],c={};a.each(function(h,d){var p=n[d];c[d]=p[0],l=l.concat(p)}),r.dataDimsOnCoord=l,r.dataDimIndicesOnCoord=he(l,function(h){return t.getDimensionInfo(h).storeDimIndex}),r.encodeFirstDimNotExtra=c;var u=n.label;u&&u.length&&(i=u.slice());var f=n.tooltip;return f&&f.length?o=f.slice():o.length||(o=i.slice()),n.defaultedLabel=i,n.defaultedTooltip=o,r.userOutput=new ST(s,e),r}function ud(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function TT(t){return t==="category"?"ordinal":t==="time"?"time":"float"}function CT(t){return!(t==="ordinal"||t==="time")}var Jl=(function(){function t(e){this.otherDims={},e!=null&&q(this,e)}return t})();function Ql(t,e){var r=e&&e.type;return r==="ordinal"?t:(r==="time"&&!et(t)&&t!=null&&t!=="-"&&(t=+mn(t)),t==null||t===""?NaN:Number(t))}me({number:function(t){return parseFloat(t)},time:function(t){return+mn(t)},trim:function(t){return ae(t)?Gr(t):t}});var MT=(function(){function t(e,r){var n=e==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var n=et(e)?e:Tl(e),a=et(r)?r:Tl(r),i=isNaN(n),o=isNaN(a);if(i&&(n=this._incomparable),o&&(a=this._incomparable),i&&o){var s=ae(e),l=ae(r);s&&(n=l?e:0),l&&(a=s?r:0)}return n<a?this._resultLT:n>a?-this._resultLT:0},t})(),ec="undefined",AT=typeof Uint32Array===ec?Array:Uint32Array,DT=typeof Uint16Array===ec?Array:Uint16Array,Km=typeof Int32Array===ec?Array:Int32Array,jm=typeof Float64Array===ec?Array:Float64Array,Jm={float:jm,int:Km,ordinal:Array,number:Array,time:jm},fd;function Ti(t){return t>65535?AT:DT}function Ci(){return[1/0,-1/0]}function IT(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Qm(t,e,r,n,a){var i=Jm[r||"float"];if(a){var o=t[e],s=o&&o.length;if(s!==n){for(var l=new i(n),c=0;c<s;c++)l[c]=o[c];t[e]=l}}else t[e]=new i(n)}var dd=(function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=me()}return t.prototype.initData=function(e,r,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var a=e.getSource(),i=this.defaultDimValueGetter=fd[a.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[],Vm(a),this._dimensions=he(r,function(o){return{type:o.type,property:o.property}}),this._initDataFromProvider(0,e.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(e,r){var n=this._calcDimNameToIdx,a=this._dimensions,i=n.get(e);if(i!=null){if(a[i].type===r)return i}else i=a.length;return a[i]={type:r},n.set(e,i),this._chunks[i]=new Jm[r||"float"](this._rawCount),this._rawExtent[i]=Ci(),i},t.prototype.collectOrdinalMeta=function(e,r){var n=this._chunks[e],a=this._dimensions[e],i=this._rawExtent,o=a.ordinalOffset||0,s=n.length;o===0&&(i[e]=Ci());for(var l=i[e],c=o;c<s;c++){var u=n[c]=r.parseAndCollect(n[c]);isNaN(u)||(l[0]=Math.min(u,l[0]),l[1]=Math.max(u,l[1]))}a.ordinalMeta=r,a.ordinalOffset=s,a.type="ordinal"},t.prototype.getOrdinalMeta=function(e){var r=this._dimensions[e],n=r.ordinalMeta;return n},t.prototype.getDimensionProperty=function(e){var r=this._dimensions[e];return r&&r.property},t.prototype.appendData=function(e){var r=this._provider,n=this.count();r.appendData(e);var a=r.count();return r.persistent||(a+=n),n<a&&this._initDataFromProvider(n,a,!0),[n,a]},t.prototype.appendValues=function(e,r){for(var n=this._chunks,a=this._dimensions,i=a.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,r||0),c=0;c<i;c++){var u=a[c];Qm(n,c,u.type,l,!0)}for(var f=[],h=s;h<l;h++)for(var d=h-s,p=0;p<i;p++){var u=a[p],m=fd.arrayRows.call(this,e[d]||f,u.property,d,p);n[p][h]=m;var g=o[p];m<g[0]&&(g[0]=m),m>g[1]&&(g[1]=m)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var a=this._provider,i=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,c=he(o,function(y){return y.property}),u=0;u<s;u++){var f=o[u];l[u]||(l[u]=Ci()),Qm(i,u,f.type,r,n)}if(a.fillStorage)a.fillStorage(e,r,i,l);else for(var h=[],d=e;d<r;d++){h=a.getItem(d,h);for(var p=0;p<s;p++){var m=i[p],g=this._dimValueGetter(h,c[p],d,p);m[d]=g;var v=l[p];g<v[0]&&(v[0]=g),g>v[1]&&(v[1]=g)}}!a.persistent&&a.clean&&a.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(r)]:NaN},t.prototype.getValues=function(e,r){var n=[],a=[];if(r==null){r=e,e=[];for(var i=0;i<this._dimensions.length;i++)a.push(i)}else a=e;for(var i=0,o=a.length;i<o;i++)n.push(this.get(a[i],r));return n},t.prototype.getByRawIndex=function(e,r){if(!(r>=0&&r<this._rawCount))return NaN;var n=this._chunks[e];return n?n[r]:NaN},t.prototype.getSum=function(e){var r=this._chunks[e],n=0;if(r)for(var a=0,i=this.count();a<i;a++){var o=this.get(e,a);isNaN(o)||(n+=o)}return n},t.prototype.getMedian=function(e){var r=[];this.each([e],function(i){isNaN(i)||r.push(i)});var n=r.sort(function(i,o){return i-o}),a=this.count();return a===0?0:a%2===1?n[(a-1)/2]:(n[a/2]+n[a/2-1])/2},t.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,n=r[e];if(n!=null&&n<this._count&&n===e)return e;for(var a=0,i=this._count-1;a<=i;){var o=(a+i)/2|0;if(r[o]<e)a=o+1;else if(r[o]>e)i=o-1;else return o}return-1},t.prototype.indicesOfNearest=function(e,r,n){var a=this._chunks,i=a[e],o=[];if(!i)return o;n==null&&(n=1/0);for(var s=1/0,l=-1,c=0,u=0,f=this.count();u<f;u++){var h=this.getRawIndex(u),d=r-i[h],p=Math.abs(d);p<=n&&((p<s||p===s&&d>=0&&l<0)&&(s=p,l=d,c=0),d===l&&(o[c++]=u))}return o.length=c,o},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var n=r.constructor,a=this._count;if(n===Array){e=new n(a);for(var i=0;i<a;i++)e[i]=r[i]}else e=new n(r.buffer,0,a)}else{var n=Ti(this._rawCount);e=new n(this.count());for(var i=0;i<e.length;i++)e[i]=i}return e},t.prototype.filter=function(e,r){if(!this._count)return this;for(var n=this.clone(),a=n.count(),i=Ti(n._rawCount),o=new i(a),s=[],l=e.length,c=0,u=e[0],f=n._chunks,h=0;h<a;h++){var d=void 0,p=n.getRawIndex(h);if(l===0)d=r(h);else if(l===1){var m=f[u][p];d=r(m,h)}else{for(var g=0;g<l;g++)s[g]=f[e[g]][p];s[g]=h,d=r.apply(null,s)}d&&(o[c++]=p)}return c<a&&(n._indices=o),n._count=c,n._extent=[],n._updateGetRawIdx(),n},t.prototype.selectRange=function(e){var r=this.clone(),n=r._count;if(!n)return this;var a=at(e),i=a.length;if(!i)return this;var o=r.count(),s=Ti(r._rawCount),l=new s(o),c=0,u=a[0],f=e[u][0],h=e[u][1],d=r._chunks,p=!1;if(!r._indices){var m=0;if(i===1){for(var g=d[a[0]],v=0;v<n;v++){var y=g[v];(y>=f&&y<=h||isNaN(y))&&(l[c++]=m),m++}p=!0}else if(i===2){for(var g=d[a[0]],b=d[a[1]],x=e[a[1]][0],w=e[a[1]][1],v=0;v<n;v++){var y=g[v],S=b[v];(y>=f&&y<=h||isNaN(y))&&(S>=x&&S<=w||isNaN(S))&&(l[c++]=m),m++}p=!0}}if(!p)if(i===1)for(var v=0;v<o;v++){var k=r.getRawIndex(v),y=d[a[0]][k];(y>=f&&y<=h||isNaN(y))&&(l[c++]=k)}else for(var v=0;v<o;v++){for(var C=!0,k=r.getRawIndex(v),A=0;A<i;A++){var M=a[A],y=d[M][k];(y<e[M][0]||y>e[M][1])&&(C=!1)}C&&(l[c++]=r.getRawIndex(v))}return c<o&&(r._indices=l),r._count=c,r._extent=[],r._updateGetRawIdx(),r},t.prototype.map=function(e,r){var n=this.clone(e);return this._updateDims(n,e,r),n},t.prototype.modify=function(e,r){this._updateDims(this,e,r)},t.prototype._updateDims=function(e,r,n){for(var a=e._chunks,i=[],o=r.length,s=e.count(),l=[],c=e._rawExtent,u=0;u<r.length;u++)c[r[u]]=Ci();for(var f=0;f<s;f++){for(var h=e.getRawIndex(f),d=0;d<o;d++)l[d]=a[r[d]][h];l[o]=f;var p=n&&n.apply(null,l);if(p!=null){typeof p!="object"&&(i[0]=p,p=i);for(var u=0;u<p.length;u++){var m=r[u],g=p[u],v=c[m],y=a[m];y&&(y[h]=g),g<v[0]&&(v[0]=g),g>v[1]&&(v[1]=g)}}}},t.prototype.lttbDownSample=function(e,r){var n=this.clone([e],!0),a=n._chunks,i=a[e],o=this.count(),s=0,l=Math.floor(1/r),c=this.getRawIndex(0),u,f,h,d=new(Ti(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=c;for(var p=1;p<o-1;p+=l){for(var m=Math.min(p+l,o-1),g=Math.min(p+l*2,o),v=(g+m)/2,y=0,b=m;b<g;b++){var x=this.getRawIndex(b),w=i[x];isNaN(w)||(y+=w)}y/=g-m;var S=p,k=Math.min(p+l,o),C=p-1,A=i[c];u=-1,h=S;for(var M=-1,T=0,b=S;b<k;b++){var x=this.getRawIndex(b),w=i[x];if(isNaN(w)){T++,M<0&&(M=x);continue}f=Math.abs((C-v)*(w-A)-(C-b)*(y-A)),f>u&&(u=f,h=x)}T>0&&T<k-S&&(d[s++]=Math.min(M,h),h=Math.max(M,h)),d[s++]=h,c=h}return d[s++]=this.getRawIndex(o-1),n._count=s,n._indices=d,n.getRawIndex=this._getRawIdx,n},t.prototype.minmaxDownSample=function(e,r){for(var n=this.clone([e],!0),a=n._chunks,i=Math.floor(1/r),o=a[e],s=this.count(),l=new(Ti(this._rawCount))(Math.ceil(s/i)*2),c=0,u=0;u<s;u+=i){var f=u,h=o[this.getRawIndex(f)],d=u,p=o[this.getRawIndex(d)],m=i;u+i>s&&(m=s-u);for(var g=0;g<m;g++){var v=this.getRawIndex(u+g),y=o[v];y<h&&(h=y,f=u+g),y>p&&(p=y,d=u+g)}var b=this.getRawIndex(f),x=this.getRawIndex(d);f<d?(l[c++]=b,l[c++]=x):(l[c++]=x,l[c++]=b)}return n._count=c,n._indices=l,n._updateGetRawIdx(),n},t.prototype.downSample=function(e,r,n,a){for(var i=this.clone([e],!0),o=i._chunks,s=[],l=Math.floor(1/r),c=o[e],u=this.count(),f=i._rawExtent[e]=Ci(),h=new(Ti(this._rawCount))(Math.ceil(u/l)),d=0,p=0;p<u;p+=l){l>u-p&&(l=u-p,s.length=l);for(var m=0;m<l;m++){var g=this.getRawIndex(p+m);s[m]=c[g]}var v=n(s),y=this.getRawIndex(Math.min(p+a(s,v)||0,u-1));c[y]=v,v<f[0]&&(f[0]=v),v>f[1]&&(f[1]=v),h[d++]=y}return i._count=d,i._indices=h,i._updateGetRawIdx(),i},t.prototype.each=function(e,r){if(this._count)for(var n=e.length,a=this._chunks,i=0,o=this.count();i<o;i++){var s=this.getRawIndex(i);switch(n){case 0:r(i);break;case 1:r(a[e[0]][s],i);break;case 2:r(a[e[0]][s],a[e[1]][s],i);break;default:for(var l=0,c=[];l<n;l++)c[l]=a[e[l]][s];c[l]=i,r.apply(null,c)}}},t.prototype.getDataExtent=function(e){var r=this._chunks[e],n=Ci();if(!r)return n;var a=this.count(),i=!this._indices,o;if(i)return this._rawExtent[e].slice();if(o=this._extent[e],o)return o.slice();o=n;for(var s=o[0],l=o[1],c=0;c<a;c++){var u=this.getRawIndex(c),f=r[u];f<s&&(s=f),f>l&&(l=f)}return o=[s,l],this._extent[e]=o,o},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],a=this._chunks,i=0;i<a.length;i++)n.push(a[i][r]);return n},t.prototype.clone=function(e,r){var n=new t,a=this._chunks,i=e&&ni(e,function(s,l){return s[l]=!0,s},{});if(i)for(var o=0;o<a.length;o++)n._chunks[o]=i[o]?IT(a[o]):a[o];else n._chunks=a;return this._copyCommonProps(n),r||(n._indices=this._cloneIndices()),n._updateGetRawIdx(),n},t.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=Ie(this._extent),e._rawExtent=Ie(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,r=void 0;if(e===Array){var n=this._indices.length;r=new e(n);for(var a=0;a<n;a++)r[a]=this._indices[a]}else r=new e(this._indices);return r}return null},t.prototype._getRawIdxIdentity=function(e){return e},t.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=(function(){function e(r,n,a,i){return Ql(r[i],this._dimensions[i])}fd={arrayRows:e,objectRows:function(r,n,a,i){return Ql(r[n],this._dimensions[i])},keyedColumns:e,original:function(r,n,a,i){var o=r&&(r.value==null?r:r.value);return Ql(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(r,n,a,i){return r[i]}}})(),t})(),LT=ht(),PT={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},ey=(function(){function t(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=ny(this.source)))},t.prototype.getSourceDimensionIndex=function(e){return Pe(this._dimNameMap.get(e),-1)},t.prototype.getSourceDimension=function(e){var r=this.source.dimensionsDefine;if(r)return r[e]},t.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,r=Vm(this.source),n=!ay(e),a="",i=[],o=0,s=0;o<e;o++){var l=void 0,c=void 0,u=void 0,f=this.dimensions[s];if(f&&f.storeDimIndex===o)l=r?f.name:null,c=f.type,u=f.ordinalMeta,s++;else{var h=this.getSourceDimension(o);h&&(l=r?h.name:null,c=h.type)}i.push({property:l,type:c,ordinalMeta:u}),r&&l!=null&&(!f||!f.isCalculationCoord)&&(a+=n?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),a+="$",a+=PT[c]||"f",u&&(a+=u.uid),a+="$"}var d=this.source,p=[d.seriesLayoutBy,d.startIndex,a].join("$$");return{dimensions:i,hash:p}},t.prototype.makeOutputDimensionNames=function(){for(var e=[],r=0,n=0;r<this._fullDimCount;r++){var a=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===r)i.isCalculationCoord||(a=i.name),n++;else{var o=this.getSourceDimension(r);o&&(a=o.name)}e.push(a)}return e},t.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t})();function ty(t){return t instanceof ey}function ry(t){for(var e=me(),r=0;r<(t||[]).length;r++){var n=t[r],a=de(n)?n.name:n;a!=null&&e.get(a)==null&&e.set(a,r)}return e}function ny(t){var e=LT(t);return e.dimNameMap||(e.dimNameMap=ry(t.dimensionsDefine))}function ay(t){return t>30}var Ro=de,Un=he,RT=typeof Int32Array>"u"?Array:Int32Array,ET="e\0\0",iy=-1,OT=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],NT=["_approximateExtent"],oy,tc,Eo,Oo,hd,No,pd,BT=(function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,a=!1;ty(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(a=!0,n=e),n=n||["x","y"];for(var i={},o=[],s={},l=!1,c={},u=0;u<n.length;u++){var f=n[u],h=ae(f)?new Jl({name:f}):f instanceof Jl?f:new Jl(f),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),i[d]=h,c[d]!=null&&(l=!0),h.createInvertedIndices&&(s[d]=[]),p.itemName===0&&(this._nameDimIdx=u),p.itemId===0&&(this._idDimIdx=u),a&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(l),this.hostModel=r,this._invertedIndicesMap=s,this._dimOmitted){var m=this._dimIdxToName=me();I(o,function(g){m.set(i[g].storeDimIndex,g)})}}return t.prototype.getDimension=function(e){var r=this._recognizeDimIndex(e);if(r==null)return e;if(r=e,!this._dimOmitted)return this.dimensions[r];var n=this._dimIdxToName.get(r);if(n!=null)return n;var a=this._schema.getSourceDimension(r);if(a)return a.name},t.prototype.getDimensionIndex=function(e){var r=this._recognizeDimIndex(e);if(r!=null)return r;if(e==null)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},t.prototype._recognizeDimIndex=function(e){if(et(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},t.prototype._getStoreDimIndex=function(e){var r=this.getDimensionIndex(e);return r},t.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},t.prototype._initGetDimensionInfo=function(e){var r=this._dimInfos;this._getDimInfo=e?function(n){return r.hasOwnProperty(n)?r[n]:void 0}:function(n){return r[n]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(e,r){var n=this._dimSummary;if(r==null)return n.encodeFirstDimNotExtra[e];var a=n.encode[e];return a?a[r]:null},t.prototype.mapDimensionsAll=function(e){var r=this._dimSummary,n=r.encode[e];return(n||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(e,r,n){var a=this,i;if(e instanceof dd&&(i=e),!i){var o=this.dimensions,s=od(e)||Vt(e)?new $m(e,o.length):e;i=new dd;var l=Un(o,function(c){return{type:a._dimInfos[c].type,property:c}});i.initData(s,l,n)}this._store=i,this._nameList=(r||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=kT(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(e){var r=this._store.appendData(e);this._doInit(r[0],r[1])},t.prototype.appendValues=function(e,r){var n=this._store.appendValues(e,r&&r.length),a=n.start,i=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),r)for(var s=a;s<i;s++){var l=s-a;this._nameList[s]=r[l],o&&pd(this,s)}},t.prototype._updateOrdinalMeta=function(){for(var e=this._store,r=this.dimensions,n=0;n<r.length;n++){var a=this._dimInfos[r[n]];a.ordinalMeta&&e.collectOrdinalMeta(a.storeDimIndex,a.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==Vn&&!e.fillStorage},t.prototype._doInit=function(e,r){if(!(e>=r)){var n=this._store,a=n.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList,s=a.getSource().sourceFormat,l=s===yr;if(l&&!a.pure)for(var c=[],u=e;u<r;u++){var f=a.getItem(u,c);if(!this.hasItemOption&&Ak(f)&&(this.hasItemOption=!0),f){var h=f.name;i[u]==null&&h!=null&&(i[u]=Zr(h,null));var d=f.id;o[u]==null&&d!=null&&(o[u]=Zr(d,null))}}if(this._shouldMakeIdFromName())for(var u=e;u<r;u++)pd(this,u);oy(this)}},t.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.setApproximateExtent=function(e,r){r=this.getDimension(r),this._approximateExtent[r]=e.slice()},t.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},t.prototype.setCalculationInfo=function(e,r){Ro(e)?q(this._calculationInfo,e):this._calculationInfo[e]=r},t.prototype.getName=function(e){var r=this.getRawIndex(e),n=this._nameList[r];return n==null&&this._nameDimIdx!=null&&(n=Eo(this,this._nameDimIdx,r)),n==null&&(n=""),n},t.prototype._getCategory=function(e,r){var n=this._store.get(e,r),a=this._store.getOrdinalMeta(e);return a?a.categories[n]:n},t.prototype.getId=function(e){return tc(this,this.getRawIndex(e))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(e,r){var n=this._store,a=this._dimInfos[e];if(a)return n.get(a.storeDimIndex,r)},t.prototype.getByRawIndex=function(e,r){var n=this._store,a=this._dimInfos[e];if(a)return n.getByRawIndex(a.storeDimIndex,r)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},t.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},t.prototype.getValues=function(e,r){var n=this,a=this._store;return ee(e)?a.getValues(Un(e,function(i){return n._getStoreDimIndex(i)}),r):a.getValues(e)},t.prototype.hasValue=function(e){for(var r=this._dimSummary.dataDimIndicesOnCoord,n=0,a=r.length;n<a;n++)if(isNaN(this._store.get(r[n],e)))return!1;return!0},t.prototype.indexOfName=function(e){for(var r=0,n=this._store.count();r<n;r++)if(this.getName(r)===e)return r;return-1},t.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},t.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},t.prototype.rawIndexOf=function(e,r){var n=e&&this._invertedIndicesMap[e],a=n&&n[r];return a==null||isNaN(a)?iy:a},t.prototype.indicesOfNearest=function(e,r,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),r,n)},t.prototype.each=function(e,r,n){ke(e)&&(n=r,r=e,e=[]);var a=n||this,i=Un(Oo(e),this._getStoreDimIndex,this);this._store.each(i,a?Ne(r,a):r)},t.prototype.filterSelf=function(e,r,n){ke(e)&&(n=r,r=e,e=[]);var a=n||this,i=Un(Oo(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,a?Ne(r,a):r),this},t.prototype.selectRange=function(e){var r=this,n={},a=at(e);return I(a,function(i){var o=r._getStoreDimIndex(i);n[o]=e[i]}),this._store=this._store.selectRange(n),this},t.prototype.mapArray=function(e,r,n){ke(e)&&(n=r,r=e,e=[]),n=n||this;var a=[];return this.each(e,function(){a.push(r&&r.apply(this,arguments))},n),a},t.prototype.map=function(e,r,n,a){var i=n||a||this,o=Un(Oo(e),this._getStoreDimIndex,this),s=No(this);return s._store=this._store.map(o,i?Ne(r,i):r),s},t.prototype.modify=function(e,r,n,a){var i=n||a||this,o=Un(Oo(e),this._getStoreDimIndex,this);this._store.modify(o,i?Ne(r,i):r)},t.prototype.downSample=function(e,r,n,a){var i=No(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),r,n,a),i},t.prototype.minmaxDownSample=function(e,r){var n=No(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),r),n},t.prototype.lttbDownSample=function(e,r){var n=No(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),r),n},t.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},t.prototype.getItemModel=function(e){var r=this.hostModel,n=this.getRawDataItem(e);return new lt(n,r,r&&r.ecModel)},t.prototype.diff=function(e){var r=this;return new dT(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(n){return tc(e,n)},function(n){return tc(r,n)})},t.prototype.getVisual=function(e){var r=this._visual;return r&&r[e]},t.prototype.setVisual=function(e,r){this._visual=this._visual||{},Ro(e)?q(this._visual,e):this._visual[e]=r},t.prototype.getItemVisual=function(e,r){var n=this._itemVisuals[e],a=n&&n[r];return a??this.getVisual(r)},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(e,r){var n=this._itemVisuals,a=n[e];a||(a=n[e]={});var i=a[r];return i==null&&(i=this.getVisual(r),ee(i)?i=i.slice():Ro(i)&&(i=q({},i)),a[r]=i),i},t.prototype.setItemVisual=function(e,r,n){var a=this._itemVisuals[e]||{};this._itemVisuals[e]=a,Ro(r)?q(a,r):a[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){Ro(e)?q(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,n){this._itemLayouts[e]=n?q(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var n=this.hostModel&&this.hostModel.seriesIndex;Gk(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){I(this._graphicEls,function(n,a){n&&e&&e.call(r,n,a)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:Un(this.dimensions,this._getDimInfo,this),this.hostModel)),hd(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var n=this[e];ke(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var a=n.apply(this,arguments);return r.apply(this,[a].concat(Nu(arguments)))})},t.internalField=(function(){oy=function(e){var r=e._invertedIndicesMap;I(r,function(n,a){var i=e._dimInfos[a],o=i.ordinalMeta,s=e._store;if(o){n=r[a]=new RT(o.categories.length);for(var l=0;l<n.length;l++)n[l]=iy;for(var l=0;l<s.count();l++)n[s.get(i.storeDimIndex,l)]=l}})},Eo=function(e,r,n){return Zr(e._getCategory(r,n),null)},tc=function(e,r){var n=e._idList[r];return n==null&&e._idDimIdx!=null&&(n=Eo(e,e._idDimIdx,r)),n==null&&(n=ET+r),n},Oo=function(e){return ee(e)||(e=e!=null?[e]:[]),e},No=function(e){var r=new t(e._schema?e._schema:Un(e.dimensions,e._getDimInfo,e),e.hostModel);return hd(r,e),r},hd=function(e,r){I(OT.concat(r.__wrappedMethods||[]),function(n){r.hasOwnProperty(n)&&(e[n]=r[n])}),e.__wrappedMethods=r.__wrappedMethods,I(NT,function(n){e[n]=Ie(r[n])}),e._calculationInfo=q({},r._calculationInfo)},pd=function(e,r){var n=e._nameList,a=e._idList,i=e._nameDimIdx,o=e._idDimIdx,s=n[r],l=a[r];if(s==null&&i!=null&&(n[r]=s=Eo(e,i,r)),l==null&&o!=null&&(a[r]=l=Eo(e,o,r)),l==null&&s!=null){var c=e._nameRepeatCount,u=c[s]=(c[s]||0)+1;l=s,u>1&&(l+="__ec__"+u),a[r]=l}}})(),t})();function zT(t,e){od(t)||(t=Bm(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],a=me(),i=[],o=HT(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&ay(o),l=n===t.dimensionsDefine,c=l?ny(t):ry(n),u=e.encodeDefine;!u&&e.encodeDefaulter&&(u=e.encodeDefaulter(t,o));for(var f=me(u),h=new Km(o),d=0;d<h.length;d++)h[d]=-1;function p(A){var M=h[A];if(M<0){var T=n[A],D=de(T)?T:{name:T},L=new Jl,R=D.name;R!=null&&c.get(R)!=null&&(L.name=L.displayName=R),D.type!=null&&(L.type=D.type),D.displayName!=null&&(L.displayName=D.displayName);var O=i.length;return h[A]=O,L.storeDimIndex=A,i.push(L),L}return i[M]}if(!s)for(var d=0;d<o;d++)p(d);f.each(function(A,M){var T=Mt(A).slice();if(T.length===1&&!ae(T[0])&&T[0]<0){f.set(M,!1);return}var D=f.set(M,[]);I(T,function(L,R){var O=ae(L)?c.get(L):L;O!=null&&O<o&&(D[R]=O,g(p(O),M,R))})});var m=0;I(r,function(A){var M,T,D,L;if(ae(A))M=A,L={};else{L=A,M=L.name;var R=L.ordinalMeta;L.ordinalMeta=null,L=q({},L),L.ordinalMeta=R,T=L.dimsDef,D=L.otherDims,L.name=L.coordDim=L.coordDimIndex=L.dimsDef=L.otherDims=null}var O=f.get(M);if(O!==!1){if(O=Mt(O),!O.length)for(var B=0;B<(T&&T.length||1);B++){for(;m<o&&p(m).coordDim!=null;)m++;m<o&&O.push(m++)}I(O,function(j,P){var V=p(j);if(l&&L.type!=null&&(V.type=L.type),g(He(V,L),M,P),V.name==null&&T){var H=T[P];!de(H)&&(H={name:H}),V.name=V.displayName=H.name,V.defaultTooltip=H.defaultTooltip}D&&He(V.otherDims,D)})}});function g(A,M,T){Pm.get(M)!=null?A.otherDims[M]=T:(A.coordDim=M,A.coordDimIndex=T,a.set(M,!0))}var v=e.generateCoord,y=e.generateCoordCount,b=y!=null;y=v?y||1:0;var x=v||"value";function w(A){A.name==null&&(A.name=A.coordDim)}if(s)I(i,function(A){w(A)}),i.sort(function(A,M){return A.storeDimIndex-M.storeDimIndex});else for(var S=0;S<o;S++){var k=p(S),C=k.coordDim;C==null&&(k.coordDim=VT(x,a,b),k.coordDimIndex=0,(!v||y<=0)&&(k.isExtraCoord=!0),y--),w(k),k.type==null&&(Nm(t,S)===sr.Must||k.isExtraCoord&&(k.otherDims.itemName!=null||k.otherDims.seriesName!=null))&&(k.type="ordinal")}return FT(i),new ey({source:t,dimensions:i,fullDimensionCount:o,dimensionOmitted:s})}function FT(t){for(var e=me(),r=0;r<t.length;r++){var n=t[r],a=n.name,i=e.get(a)||0;i>0&&(n.name=a+(i-1)),i++,e.set(a,i)}}function HT(t,e,r,n){var a=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return I(e,function(i){var o;de(i)&&(o=i.dimsDef)&&(a=Math.max(a,o.length))}),a}function VT(t,e,r){if(r||e.hasKey(t)){for(var n=0;e.hasKey(t+n);)n++;t+=n}return e.set(t,!0),t}var vd={},gd=(function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(e,r){var n=[];I(vd,function(a,i){var o=a.create(e,r);n=n.concat(o||[])}),this._coordinateSystems=n},t.prototype.update=function(e,r){I(this._coordinateSystems,function(n){n.update&&n.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(e,r){vd[e]=r},t.get=function(e){return vd[e]},t})(),UT=(function(){function t(e){this.coordSysDims=[],this.axisMap=me(),this.categoryAxisMap=me(),this.coordSysName=e}return t})();function GT(t){var e=t.get("coordinateSystem"),r=new UT(e),n=$T[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var $T={cartesian2d:function(t,e,r,n){var a=t.getReferringComponents("xAxis",qt).models[0],i=t.getReferringComponents("yAxis",qt).models[0];e.coordSysDims=["x","y"],r.set("x",a),r.set("y",i),Mi(a)&&(n.set("x",a),e.firstCategoryDimIndex=0),Mi(i)&&(n.set("y",i),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var a=t.getReferringComponents("singleAxis",qt).models[0];e.coordSysDims=["single"],r.set("single",a),Mi(a)&&(n.set("single",a),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var a=t.getReferringComponents("polar",qt).models[0],i=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",i),r.set("angle",o),Mi(i)&&(n.set("radius",i),e.firstCategoryDimIndex=0),Mi(o)&&(n.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,n){var a=t.ecModel,i=a.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=i.dimensions.slice();I(i.parallelAxisIndex,function(s,l){var c=a.getComponent("parallelAxis",s),u=o[l];r.set(u,c),Mi(c)&&(n.set(u,c),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function Mi(t){return t.get("type")==="category"}function WT(t,e,r){r=r||{};var n=r.byIndex,a=r.stackedCoordDimension,i,o,s;qT(e)?i=e:(o=e.schema,i=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),c,u,f,h;if(I(i,function(y,b){ae(y)&&(i[b]=y={name:y}),l&&!y.isExtraCoord&&(!n&&!c&&y.ordinalMeta&&(c=y),!u&&y.type!=="ordinal"&&y.type!=="time"&&(!a||a===y.coordDim)&&(u=y))}),u&&!n&&!c&&(n=!0),u){f="__\0ecstackresult_"+t.id,h="__\0ecstackedover_"+t.id,c&&(c.createInvertedIndices=!0);var d=u.coordDim,p=u.type,m=0;I(i,function(y){y.coordDim===d&&m++});var g={name:f,coordDim:d,coordDimIndex:m,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:h,coordDim:h,coordDimIndex:m+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(h,p),v.storeDimIndex=s.ensureCalculationDimension(f,p)),o.appendCalculationDimension(g),o.appendCalculationDimension(v)):(i.push(g),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:c&&c.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function qT(t){return!ty(t.schema)}function Ai(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function YT(t,e){return Ai(t,e)?t.getCalculationInfo("stackResultDimension"):e}function XT(t,e){var r=t.get("coordinateSystem"),n=gd.get(r),a;return e&&e.coordSysDims&&(a=he(e.coordSysDims,function(i){var o={name:i},s=e.axisMap.get(i);if(s){var l=s.get("type");o.type=TT(l)}return o})),a||(a=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),a}function ZT(t,e,r){var n,a;return r&&I(t,function(i,o){var s=i.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),i.ordinalMeta=l.getOrdinalMeta(),e&&(i.createInvertedIndices=!0)),i.otherDims.itemName!=null&&(a=!0)}),!a&&n!=null&&(t[n].otherDims.itemName=0),n}function md(t,e,r){r=r||{};var n=e.getSourceManager(),a,i=!1;a=n.getSource(),i=a.sourceFormat===yr;var o=GT(e),s=XT(e,o),l=r.useEncodeDefaulter,c=ke(l)?l:l?dt(pT,s,e):null,u={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:c,canOmitUnusedDimensions:!i},f=zT(a,u),h=ZT(f.dimensions,r.createInvertedIndices,o),d=i?null:n.getSharedDataStore(f),p=WT(e,{schema:f,store:d}),m=new BT(f,e);m.setCalculationInfo(p);var g=h!=null&&KT(a)?function(v,y,b,x){return x===h?b:this.defaultDimValueGetter(v,y,b,x)}:null;return m.hasItemOption=!1,m.initData(i?a:d,null,g),m}function KT(t){if(t.sourceFormat===yr){var e=jT(t.data||[]);return!ee(xo(e))}}function jT(t){for(var e=0;e<t.length&&t[e]==null;)e++;return t[e]}var JT=Math.round(Math.random()*10);function rc(t){return[t||"",JT++].join("_")}function QT(t){var e={};t.registerSubTypeDefaulter=function(r,n){var a=$r(r);e[a.main]=n},t.determineSubType=function(r,n){var a=n.type;if(!a){var i=$r(r).main;t.hasSubTypes(r)&&e[i]&&(a=e[i](n))}return a}}function eC(t,e){t.topologicalTravel=function(i,o,s,l){if(!i.length)return;var c=r(o),u=c.graph,f=c.noEntryList,h={};for(I(i,function(y){h[y]=!0});f.length;){var d=f.pop(),p=u[d],m=!!h[d];m&&(s.call(l,d,p.originalDeps.slice()),delete h[d]),I(p.successor,m?v:g)}I(h,function(){var y="";throw new Error(y)});function g(y){u[y].entryCount--,u[y].entryCount===0&&f.push(y)}function v(y){h[y]=!0,g(y)}};function r(i){var o={},s=[];return I(i,function(l){var c=n(o,l),u=c.originalDeps=e(l),f=a(u,i);c.entryCount=f.length,c.entryCount===0&&s.push(l),I(f,function(h){Ue(c.predecessor,h)<0&&c.predecessor.push(h);var d=n(o,h);Ue(d.successor,h)<0&&d.successor.push(l)})}),{graph:o,noEntryList:s}}function n(i,o){return i[o]||(i[o]={predecessor:[],successor:[]}),i[o]}function a(i,o){var s=[];return I(i,function(l){Ue(o,l)>=0&&s.push(l)}),s}}function yd(t,e){return Oe(Oe({},t,!0),e,!0)}var tC=Math.log(2);function _d(t,e,r,n,a,i){var o=n+"-"+a,s=t.length;if(i.hasOwnProperty(o))return i[o];if(e===1){var l=Math.round(Math.log((1<<s)-1&~a)/tC);return t[r][l]}for(var c=n|1<<r,u=r+1;n&1<<u;)u++;for(var f=0,h=0,d=0;h<s;h++){var p=1<<h;p&a||(f+=(d%2?-1:1)*t[r][h]*_d(t,e-1,u,c,a|p,i),d++)}return i[o]=f,f}function sy(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],n={},a=_d(r,8,0,0,0,n);if(a!==0){for(var i=[],o=0;o<8;o++)for(var s=0;s<8;s++)i[s]==null&&(i[s]=0),i[s]+=((o+s)%2?-1:1)*_d(r,7,o===0?1:0,1<<o,1<<s,n)/a*e[o];return function(l,c,u){var f=c*i[6]+u*i[7]+1;l[0]=(c*i[0]+u*i[1]+i[2])/f,l[1]=(c*i[3]+u*i[4]+i[5])/f}}}var ly="___zrEVENTSAVED",bd=[];function rC(t,e,r,n,a){return xd(bd,e,n,a,!0)&&xd(t,r,bd[0],bd[1])}function xd(t,e,r,n,a){if(e.getBoundingClientRect&&_e.domSupported&&!cy(e)){var i=e[ly]||(e[ly]={}),o=nC(e,i),s=aC(o,i,a);if(s)return s(t,r,n),!0}return!1}function nC(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var n=["left","right"],a=["top","bottom"],i=0;i<4;i++){var o=document.createElement("div"),s=o.style,l=i%2,c=(i>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",a[c]+":0",n[1-l]+":auto",a[1-c]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return r}function aC(t,e,r){for(var n=r?"invTrans":"trans",a=e[n],i=e.srcCoords,o=[],s=[],l=!0,c=0;c<4;c++){var u=t[c].getBoundingClientRect(),f=2*c,h=u.left,d=u.top;o.push(h,d),l=l&&i&&h===i[f]&&d===i[f+1],s.push(t[c].offsetLeft,t[c].offsetTop)}return l&&a?a:(e.srcCoords=o,e[n]=r?sy(s,o):sy(o,s))}function cy(t){return t.nodeName.toUpperCase()==="CANVAS"}var iC=/([&<>"'])/g,oC={"&":"&","<":"<",">":">",'"':""","'":"'"};function Zt(t){return t==null?"":(t+"").replace(iC,function(e,r){return oC[r]})}const sC={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},lC={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var nc="ZH",wd="EN",Di=wd,ac={},Sd={},uy=_e.domSupported?(function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||Di).toUpperCase();return t.indexOf(nc)>-1?nc:Di})():Di;function fy(t,e){t=t.toUpperCase(),Sd[t]=new lt(e),ac[t]=e}function cC(t){if(ae(t)){var e=ac[t.toUpperCase()]||{};return t===nc||t===wd?Ie(e):Oe(Ie(e),Ie(ac[Di]),!1)}else return Oe(Ie(t),Ie(ac[Di]),!1)}function uC(t){return Sd[t]}function fC(){return Sd[Di]}fy(wd,sC),fy(nc,lC);var kd=1e3,Td=kd*60,Bo=Td*60,_r=Bo*24,dy=_r*365,zo={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},ic="{yyyy}-{MM}-{dd}",hy={year:"{yyyy}",month:"{yyyy}-{MM}",day:ic,hour:ic+" "+zo.hour,minute:ic+" "+zo.minute,second:ic+" "+zo.second,millisecond:zo.none},Cd=["year","month","day","hour","minute","second","millisecond"],py=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Gn(t,e){return t+="","0000".substr(0,e-t.length)+t}function Ii(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function dC(t){return t===Ii(t)}function hC(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function oc(t,e,r,n){var a=mn(t),i=a[Md(r)](),o=a[Li(r)]()+1,s=Math.floor((o-1)/3)+1,l=a[sc(r)](),c=a["get"+(r?"UTC":"")+"Day"](),u=a[Fo(r)](),f=(u-1)%12+1,h=a[lc(r)](),d=a[cc(r)](),p=a[uc(r)](),m=u>=12?"pm":"am",g=m.toUpperCase(),v=n instanceof lt?n:uC(n||uy)||fC(),y=v.getModel("time"),b=y.get("month"),x=y.get("monthAbbr"),w=y.get("dayOfWeek"),S=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,m+"").replace(/{A}/g,g+"").replace(/{yyyy}/g,i+"").replace(/{yy}/g,Gn(i%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,Gn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Gn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,w[c]).replace(/{ee}/g,S[c]).replace(/{e}/g,c+"").replace(/{HH}/g,Gn(u,2)).replace(/{H}/g,u+"").replace(/{hh}/g,Gn(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,Gn(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,Gn(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,Gn(p,3)).replace(/{S}/g,p+"")}function pC(t,e,r,n,a){var i=null;if(ae(r))i=r;else if(ke(r))i=r(t.value,e,{level:t.level});else{var o=q({},zo);if(t.level>0)for(var s=0;s<Cd.length;++s)o[Cd[s]]="{primary|"+o[Cd[s]]+"}";var l=r?r.inherit===!1?r:He(r,o):o,c=vy(t.value,a);if(l[c])i=l[c];else if(l.inherit){for(var u=py.indexOf(c),s=u-1;s>=0;--s)if(l[c]){i=l[c];break}i=i||o.none}if(ee(i)){var f=t.level==null?0:t.level>=0?t.level:i.length+t.level;f=Math.min(f,i.length-1),i=i[f]}}return oc(new Date(t.value),i,a,n)}function vy(t,e){var r=mn(t),n=r[Li(e)]()+1,a=r[sc(e)](),i=r[Fo(e)](),o=r[lc(e)](),s=r[cc(e)](),l=r[uc(e)](),c=l===0,u=c&&s===0,f=u&&o===0,h=f&&i===0,d=h&&a===1,p=d&&n===1;return p?"year":d?"month":h?"day":f?"hour":u?"minute":c?"second":"millisecond"}function gy(t,e,r){var n=et(t)?mn(t):t;switch(e=e||vy(t,r),e){case"year":return n[Md(r)]();case"half-year":return n[Li(r)]()>=6?1:0;case"quarter":return Math.floor((n[Li(r)]()+1)/4);case"month":return n[Li(r)]();case"day":return n[sc(r)]();case"half-day":return n[Fo(r)]()/24;case"hour":return n[Fo(r)]();case"minute":return n[lc(r)]();case"second":return n[cc(r)]();case"millisecond":return n[uc(r)]()}}function Md(t){return t?"getUTCFullYear":"getFullYear"}function Li(t){return t?"getUTCMonth":"getMonth"}function sc(t){return t?"getUTCDate":"getDate"}function Fo(t){return t?"getUTCHours":"getHours"}function lc(t){return t?"getUTCMinutes":"getMinutes"}function cc(t){return t?"getUTCSeconds":"getSeconds"}function uc(t){return t?"getUTCMilliseconds":"getMilliseconds"}function vC(t){return t?"setUTCFullYear":"setFullYear"}function my(t){return t?"setUTCMonth":"setMonth"}function yy(t){return t?"setUTCDate":"setDate"}function _y(t){return t?"setUTCHours":"setHours"}function by(t){return t?"setUTCMinutes":"setMinutes"}function xy(t){return t?"setUTCSeconds":"setSeconds"}function wy(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Sy(t){if(!Ck(t))return ae(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function ky(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var fc=_v;function Ad(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function a(u){return u&&Gr(u)?u:"-"}function i(u){return!!(u!=null&&!isNaN(u)&&isFinite(u))}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?mn(t):t;if(isNaN(+l)){if(s)return"-"}else return oc(l,n,r)}if(e==="ordinal")return Ou(t)?a(t):et(t)&&i(t)?t+"":"-";var c=Tl(t);return i(c)?Sy(c):Ou(t)?a(t):typeof t=="boolean"?t+"":"-"}var Ty=["a","b","c","d","e","f","g"],Dd=function(t,e){return"{"+t+(e??"")+"}"};function Cy(t,e,r){ee(e)||(e=[e]);var n=e.length;if(!n)return"";for(var a=e[0].$vars||[],i=0;i<a.length;i++){var o=Ty[i];t=t.replace(Dd(o),Dd(o,0))}for(var s=0;s<n;s++)for(var l=0;l<a.length;l++){var c=e[s][a[l]];t=t.replace(Dd(Ty[l],s),r?Zt(c):c)}return t}function gC(t,e){var r=ae(t)?{color:t,extraCssText:e}:t||{},n=r.color,a=r.type;e=r.extraCssText;var i=r.renderMode||"html";if(!n)return"";if(i==="html")return a==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Zt(n)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Zt(n)+";"+(e||"")+'"></span>';var o=r.markerId||"markerX";return{renderMode:i,content:"{"+o+"|} ",style:a==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function Oa(t,e){return e=e||"transparent",ae(t)?t:de(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var dc=I,mC=["left","right","top","bottom","width","height"],hc=[["width","left","right"],["height","top","bottom"]];function Id(t,e,r,n,a){var i=0,o=0;n==null&&(n=1/0),a==null&&(a=1/0);var s=0;e.eachChild(function(l,c){var u=l.getBoundingRect(),f=e.childAt(c+1),h=f&&f.getBoundingRect(),d,p;if(t==="horizontal"){var m=u.width+(h?-h.x+u.x:0);d=i+m,d>n||l.newline?(i=0,d=m,o+=s+r,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(h?-h.y+u.y:0);p=o+g,p>a||l.newline?(i+=s+r,o=0,p=g,s=u.width):s=Math.max(s,u.width)}l.newline||(l.x=i,l.y=o,l.markRedraw(),t==="horizontal"?i=d+r:o=p+r)})}var Ho=Id;dt(Id,"vertical"),dt(Id,"horizontal");function pc(t,e,r){r=fc(r||0);var n=e.width,a=e.height,i=Nt(t.left,n),o=Nt(t.top,a),s=Nt(t.right,n),l=Nt(t.bottom,a),c=Nt(t.width,n),u=Nt(t.height,a),f=r[2]+r[0],h=r[1]+r[3],d=t.aspect;switch(isNaN(c)&&(c=n-s-h-i),isNaN(u)&&(u=a-l-f-o),d!=null&&(isNaN(c)&&isNaN(u)&&(d>n/a?c=n*.8:u=a*.8),isNaN(c)&&(c=d*u),isNaN(u)&&(u=c/d)),isNaN(i)&&(i=n-s-c-h),isNaN(o)&&(o=a-l-u-f),t.left||t.right){case"center":i=n/2-c/2-r[3];break;case"right":i=n-c-h;break}switch(t.top||t.bottom){case"middle":case"center":o=a/2-u/2-r[0];break;case"bottom":o=a-u-f;break}i=i||0,o=o||0,isNaN(c)&&(c=n-h-i-(s||0)),isNaN(u)&&(u=a-f-o-(l||0));var p=new Ge(i+r[3],o+r[0],c,u);return p.margin=r,p}function Vo(t){var e=t.layoutMode||t.constructor.layoutMode;return de(e)?e:e?{type:e}:null}function Pi(t,e,r){var n=r&&r.ignoreSize;!ee(n)&&(n=[n,n]);var a=o(hc[0],0),i=o(hc[1],1);c(hc[0],t,a),c(hc[1],t,i);function o(u,f){var h={},d=0,p={},m=0,g=2;if(dc(u,function(b){p[b]=t[b]}),dc(u,function(b){s(e,b)&&(h[b]=p[b]=e[b]),l(h,b)&&d++,l(p,b)&&m++}),n[f])return l(e,u[1])?p[u[2]]=null:l(e,u[2])&&(p[u[1]]=null),p;if(m===g||!d)return p;if(d>=g)return h;for(var v=0;v<u.length;v++){var y=u[v];if(!s(h,y)&&s(t,y)){h[y]=t[y];break}}return h}function s(u,f){return u.hasOwnProperty(f)}function l(u,f){return u[f]!=null&&u[f]!=="auto"}function c(u,f,h){dc(u,function(d){f[d]=h[d]})}}function vc(t){return yC({},t)}function yC(t,e){return e&&t&&dc(mC,function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var _C=ht(),Ye=(function(t){K(e,t);function e(r,n,a){var i=t.call(this,r,n,a)||this;return i.uid=rc("ec_cpt_model"),i}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=Vo(this),i=a?vc(r):{},o=n.getTheme();Oe(r,o.get(this.mainType)),Oe(r,this.getDefaultOption()),a&&Pi(r,i,a)},e.prototype.mergeOption=function(r,n){Oe(this.option,r,!0);var a=Vo(this);a&&Pi(this.option,r,a)},e.prototype.optionUpdated=function(r,n){},e.prototype.getDefaultOption=function(){var r=this.constructor;if(!Ww(r))return r.defaultOption;var n=_C(this);if(!n.defaultOption){for(var a=[],i=r;i;){var o=i.prototype.defaultOption;o&&a.push(o),i=i.superClass}for(var s={},l=a.length-1;l>=0;l--)s=Oe(s,a[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var a=r+"Index",i=r+"Id";return ko(this.ecModel,r,{index:this.get(a,!0),id:this.get(i,!0)},n)},e.prototype.getBoxLayoutParams=function(){var r=this;return{left:r.get("left"),top:r.get("top"),right:r.get("right"),bottom:r.get("bottom"),width:r.get("width"),height:r.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=(function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0})(),e})(lt);kv(Ye,lt),Zs(Ye),QT(Ye),eC(Ye,bC);function bC(t){var e=[];return I(Ye.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=he(e,function(r){return $r(r).main}),t!=="dataset"&&Ue(e,"dataset")<=0&&e.unshift("dataset"),e}var My=ht(),xC=ht(),Ld=(function(){function t(){}return t.prototype.getColorFromPalette=function(e,r,n){var a=Mt(this.get("color",!0)),i=this.get("colorLayer",!0);return Dy(this,My,a,i,e,r,n)},t.prototype.clearColorPalette=function(){SC(this,My)},t})();function Ay(t,e,r,n){var a=Mt(t.get(["aria","decal","decals"]));return Dy(t,xC,a,null,e,r,n)}function wC(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n].length>e)return t[n];return t[r-1]}function Dy(t,e,r,n,a,i,o){i=i||t;var s=e(i),l=s.paletteIdx||0,c=s.paletteNameMap=s.paletteNameMap||{};if(c.hasOwnProperty(a))return c[a];var u=o==null||!n?r:wC(n,o);if(u=u||r,!(!u||!u.length)){var f=u[l];return a&&(c[a]=f),s.paletteIdx=(l+1)%u.length,f}}function SC(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var kC=/\{@(.+?)\}/g,TC=(function(){function t(){}return t.prototype.getDataParams=function(e,r){var n=this.getData(r),a=this.getRawValue(e,r),i=n.getRawIndex(e),o=n.getName(e),s=n.getRawDataItem(e),l=n.getItemVisual(e,"style"),c=l&&l[n.getItemVisual(e,"drawType")||"fill"],u=l&&l.stroke,f=this.mainType,h=f==="series",d=n.userOutput&&n.userOutput.get();return{componentType:f,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:i,data:s,dataType:r,value:a,color:c,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(e,r,n,a,i,o){r=r||"normal";var s=this.getData(n),l=this.getDataParams(e,n);if(o&&(l.value=o.interpolatedValue),a!=null&&ee(l.value)&&(l.value=l.value[a]),!i){var c=s.getItemModel(e);i=c.get(r==="normal"?["label","formatter"]:[r,"label","formatter"])}if(ke(i))return l.status=r,l.dimensionIndex=a,i(l);if(ae(i)){var u=Cy(i,l);return u.replace(kC,function(f,h){var d=h.length,p=h;p.charAt(0)==="["&&p.charAt(d-1)==="]"&&(p=+p.slice(1,d-1));var m=ki(s,e,p);if(o&&ee(o.interpolatedValue)){var g=s.getDimensionIndex(p);g>=0&&(m=o.interpolatedValue[g])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return ki(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t})();function Iy(t){var e,r;return de(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function Uo(t){return new CC(t)}var CC=(function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,n=e&&e.skip;if(this._dirty&&r){var a=this.context;a.data=a.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var o=u(this._modBy),s=this._modDataCount||0,l=u(e&&e.modBy),c=e&&e.modDataCount||0;(o!==l||s!==c)&&(i="reset");function u(y){return!(y>=1)&&(y=1),y}var f;(this._dirty||i==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=c;var h=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d<p)){var m=this._progress;if(ee(m))for(var g=0;g<m.length;g++)this._doProgress(m[g],d,p,l,c);else this._doProgress(m,d,p,l,c)}this._dueIndex=p;var v=this._settedOutputEnd!=null?this._settedOutputEnd:p;this._outputDueEnd=v}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(e,r,n,a,i){Ly.reset(r,n,a,i),this._callingProgress=e,this._callingProgress({start:r,end:n,count:n-r,next:Ly.next},this.context)},t.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var r,n;!e&&this._reset&&(r=this._reset(this.context),r&&r.progress&&(n=r.forceFirstProgress,r=r.progress),ee(r)&&!r.length&&(r=null)),this._progress=r,this._modBy=this._modDataCount=null;var a=this._downstream;return a&&a.dirty(),n},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},t})(),Ly=(function(){var t,e,r,n,a,i={reset:function(l,c,u,f){e=l,t=c,r=u,n=f,a=Math.ceil(n/r),i.next=r>1&&n>0?s:o}};return i;function o(){return e<t?e++:null}function s(){var l=e%a*r+Math.ceil(e/a),c=e>=t?null:l<n?l:e;return e++,c}})(),MC=(function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(e){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(e){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(e,r){},t.prototype.retrieveValueFromItem=function(e,r){},t.prototype.convertValue=function(e,r){return Ql(e,r)},t})();function AC(t,e){var r=new MC,n=t.data,a=r.sourceFormat=t.sourceFormat,i=t.startIndex,o="";t.seriesLayoutBy!==xn&&Wt(o);var s=[],l={},c=t.dimensionsDefine;if(c)I(c,function(m,g){var v=m.name,y={index:g,name:v,displayName:m.displayName};if(s.push(y),v!=null){var b="";la(l,v)&&Wt(b),l[v]=y}});else for(var u=0;u<t.dimensionsDetectedCount;u++)s.push({index:u});var f=qm(a,xn);e.__isBuiltIn&&(r.getRawDataItem=function(m){return f(n,i,s,m)},r.getRawData=Ne(DC,null,t)),r.cloneRawData=Ne(IC,null,t);var h=Xm(a,xn);r.count=Ne(h,null,n,i,s);var d=Zm(a);r.retrieveValue=function(m,g){var v=f(n,i,s,m);return p(v,g)};var p=r.retrieveValueFromItem=function(m,g){if(m!=null){var v=s[g];if(v)return d(m,g,v.name)}};return r.getDimensionInfo=Ne(LC,null,s,l),r.cloneAllDimensionInfo=Ne(PC,null,s),r}function DC(t){var e=t.sourceFormat;if(!Pd(e)){var r="";Wt(r)}return t.data}function IC(t){var e=t.sourceFormat,r=t.data;if(!Pd(e)){var n="";Wt(n)}if(e===Xt){for(var a=[],i=0,o=r.length;i<o;i++)a.push(r[i].slice());return a}else if(e===Jr){for(var a=[],i=0,o=r.length;i<o;i++)a.push(q({},r[i]));return a}}function LC(t,e,r){if(r!=null){if(et(r)||!isNaN(r)&&!la(e,r))return t[r];if(la(e,r))return e[r]}}function PC(t){return Ie(t)}var Py=me();function RC(t){t=Ie(t);var e=t.type,r="";e||Wt(r);var n=e.split(":");n.length!==2&&Wt(r);var a=!1;n[0]==="echarts"&&(e=n[1],a=!0),t.__isBuiltIn=a,Py.set(e,t)}function EC(t,e,r){var n=Mt(t),a=n.length,i="";a||Wt(i);for(var o=0,s=a;o<s;o++){var l=n[o];e=OC(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function OC(t,e,r,n){var a="";e.length||Wt(a),de(t)||Wt(a);var i=t.type,o=Py.get(i);o||Wt(a);var s=he(e,function(c){return AC(c,o)}),l=Mt(o.transform({upstream:s[0],upstreamList:s,config:Ie(t.config)}));return he(l,function(c,u){var f="";de(c)||Wt(f),c.data||Wt(f);var h=zm(c.data);Pd(h)||Wt(f);var d,p=e[0];if(p&&u===0&&!c.dimensions){var m=p.startIndex;m&&(c.data=p.data.slice(0,m).concat(c.data)),d={seriesLayoutBy:xn,sourceHeader:m,dimensions:p.metaRawOption.dimensions}}else d={seriesLayoutBy:xn,sourceHeader:0,dimensions:c.dimensions};return sd(c.data,d,null)})}function Pd(t){return t===Xt||t===Jr}var NC=(function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,a,i;if(gc(e)){var o=e,s=void 0,l=void 0,c=void 0;if(n){var u=r[0];u.prepareSource(),c=u.getSource(),s=c.data,l=c.sourceFormat,i=[u._getVersionSign()]}else s=o.get("data",!0),l=Ut(s)?Vn:yr,i=[];var f=this._getSourceMetaRawOption()||{},h=c&&c.metaRawOption||{},d=Pe(f.seriesLayoutBy,h.seriesLayoutBy)||null,p=Pe(f.sourceHeader,h.sourceHeader),m=Pe(f.dimensions,h.dimensions),g=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||m;a=g?[sd(s,{seriesLayoutBy:d,sourceHeader:p,dimensions:m},l)]:[]}else{var v=e;if(n){var y=this._applyTransform(r);a=y.sourceList,i=y.upstreamSignList}else{var b=v.get("source",!0);a=[sd(b,this._getSourceMetaRawOption(),null)],i=[]}}this._setLocalSource(a,i)},t.prototype._applyTransform=function(e){var r=this._sourceHost,n=r.get("transform",!0),a=r.get("fromTransformResult",!0);if(a!=null){var i="";e.length!==1&&Ry(i)}var o,s=[],l=[];return I(e,function(c){c.prepareSource();var u=c.getSource(a||0),f="";a!=null&&!u&&Ry(f),s.push(u),l.push(c._getVersionSign())}),n?o=EC(n,s,{datasetIndex:r.componentIndex}):a!=null&&(o=[mT(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r<e.length;r++){var n=e[r];if(n._isDirty()||this._upstreamSignList[r]!==n._getVersionSign())return!0}},t.prototype.getSource=function(e){e=e||0;var r=this._sourceList[e];if(!r){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return r},t.prototype.getSharedDataStore=function(e){var r=e.makeStoreSchema();return this._innerGetDataStore(r.dimensions,e.source,r.hash)},t.prototype._innerGetDataStore=function(e,r,n){var a=0,i=this._storeList,o=i[a];o||(o=i[a]={});var s=o[n];if(!s){var l=this._getUpstreamSourceManagers()[0];gc(this._sourceHost)&&l?s=l._innerGetDataStore(e,r,n):(s=new dd,s.initData(new $m(r,e.length),e)),o[n]=s}return s},t.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(gc(e)){var r=Om(e);return r?[r.getSourceManager()]:[]}else return he(vT(e),function(n){return n.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,r,n,a;if(gc(e))r=e.get("seriesLayoutBy",!0),n=e.get("sourceHeader",!0),a=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=e;r=i.get("seriesLayoutBy",!0),n=i.get("sourceHeader",!0),a=i.get("dimensions",!0)}return{seriesLayoutBy:r,sourceHeader:n,dimensions:a}},t})();function gc(t){return t.mainType==="series"}function Ry(t){throw new Error(t)}var BC="line-height:1";function Ey(t){var e=t.lineHeight;return e==null?BC:"line-height:"+Zt(e+"")+"px"}function Oy(t,e){var r=t.color||"#6e7079",n=t.fontSize||12,a=t.fontWeight||"400",i=t.color||"#464646",o=t.fontSize||14,s=t.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+Zt(n+"")+"px;color:"+Zt(r)+";font-weight:"+Zt(a+""),valueStyle:"font-size:"+Zt(o+"")+"px;color:"+Zt(i)+";font-weight:"+Zt(s+"")}:{nameStyle:{fontSize:n,fill:r,fontWeight:a},valueStyle:{fontSize:o,fill:i,fontWeight:s}}}var zC=[0,10,20,30],FC=["",`
|
|
13
13
|
`,`
|
|
14
14
|
|
|
15
15
|
`,`
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
`];function Co(t,e){return e.type=t,e}function ph(t){return t.type==="section"}function My(t){return ph(t)?PC:RC}function Ay(t){if(ph(t)){var e=0,r=t.blocks.length,n=r>1||r>0&&!t.noHeader;return D(t.blocks,function(a){var i=Ay(a);i>=e&&(e=i+ +(n&&(!i||ph(a)&&!a.noHeader)))}),e}return 0}function PC(t,e,r,n){var a=e.noHeader,i=EC(Ay(e)),o=[],s=e.blocks||[];Ur(!s||ee(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(Vn(c,l)){var u=new _2(c[l],null);s.sort(function(m,g){return u.evaluate(m.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}D(s,function(m,g){var v=e.valueFormatter,y=My(m)(v?U(U({},t),{valueFormatter:v}):t,m,g>0?i.html:0,n);y!=null&&o.push(y)});var f=t.renderMode==="richText"?o.join(i.richText):vh(n,o.join(""),a?r:i.html);if(a)return f;var h=ch(e.header,"ordinal",t.useUTC),d=Cy(n,t.renderMode).nameStyle,p=Ty(n);return t.renderMode==="richText"?Iy(t,h,d)+i.richText+f:vh(n,'<div style="'+d+";"+p+';">'+Bt(h)+"</div>"+f,r)}function RC(t,e,r,n){var a=t.renderMode,i=e.noName,o=e.noValue,s=!e.markerType,l=e.name,c=t.useUTC,u=e.valueFormatter||t.valueFormatter||function(x){return x=ee(x)?x:[x],ue(x,function(S,w){return ch(S,ee(d)?d[w]:d,c)})};if(!(i&&o)){var f=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",a),h=i?"":ch(l,"ordinal",c),d=e.valueType,p=o?[]:u(e.value,e.dataIndex),m=!s||!i,g=!s&&i,v=Cy(n,a),y=v.nameStyle,b=v.valueStyle;return a==="richText"?(s?"":f)+(i?"":Iy(t,h,y))+(o?"":BC(t,p,m,g,b)):vh(n,(s?"":f)+(i?"":OC(h,!s,y))+(o?"":NC(p,m,g,b)),r)}}function Dy(t,e,r,n,a,i){if(t){var o=My(t),s={useUTC:a,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,i)}}function EC(t){return{html:IC[t],richText:LC[t]}}function vh(t,e,r){var n='<div style="clear:both"></div>',a="margin: "+r+"px 0 0",i=Ty(t);return'<div style="'+a+";"+i+';">'+e+n+"</div>"}function OC(t,e,r){var n=e?"margin-left:2px":"";return'<span style="'+r+";"+n+'">'+Bt(t)+"</span>"}function NC(t,e,r,n){var a=r?"10px":"20px",i=e?"float:right;margin-left:"+a:"";return t=ee(t)?t:[t],'<span style="'+i+";"+n+'">'+ue(t,function(o){return Bt(o)}).join(" ")+"</span>"}function Iy(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function BC(t,e,r,n,a){var i=[a],o=n?10:20;return r&&i.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ee(e)?e.join(" "):e,i)}function zC(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return pa(n)}function Ly(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var gh=(function(){function t(){this.richTextStyles={},this._nextStyleNameId=mg()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,n){var a=n==="richText"?this._generateStyleName():null,i=lC({color:r,type:e,renderMode:n,markerId:a});return ne(i)?i:(this.richTextStyles[a]=i.style,i.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ee(r)?D(r,function(i){return U(n,i)}):U(n,r);var a=this._generateStyleName();return this.richTextStyles[a]=n,"{"+a+"|"+e+"}"},t})();function FC(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,a=e.getData(),i=a.mapDimensionsAll("defaultedTooltip"),o=i.length,s=e.getRawValue(r),l=ee(s),c=zC(e,r),u,f,h,d;if(o>1||l&&!o){var p=HC(s,e,r,i,c);u=p.inlineValues,f=p.inlineValueTypes,h=p.blocks,d=p.inlineValues[0]}else if(o){var m=a.getDimensionInfo(i[0]);d=u=ai(a,r,i[0]),f=m.type}else d=u=l?s[0]:s;var g=uf(e),v=g&&e.name||"",y=a.getName(r),b=n?v:y;return Co("section",{header:v,noHeader:n||!g,sortParam:d,blocks:[Co("nameValue",{markerType:"item",markerColor:c,name:b,noName:!Mr(b),value:u,valueType:f,dataIndex:r})].concat(h||[])})}function HC(t,e,r,n,a){var i=e.getData(),o=Ba(t,function(f,h,d){var p=i.getDimensionInfo(d);return f=f||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],c=[];n.length?D(n,function(f){u(ai(i,r,f),f)}):D(t,u);function u(f,h){var d=i.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?c.push(Co("nameValue",{markerType:"subItem",markerColor:a,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:c}}var Tn=it();function Zl(t,e){return t.getName(e)||t.getId(e)}var VC="__universalTransitionEnabled",Br=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,n,a){this.seriesIndex=this.componentIndex,this.dataTask=To({count:$C,reset:WC}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,a);var i=Tn(this).sourceManager=new AC(this);i.prepareSource();var o=this.getInitialData(r,a);Ry(o,this),this.dataTask.context.data=o,Tn(this).dataBeforeProcessed=o,Py(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=ko(this),i=a?ql(r):{},o=this.subType;We.hasClass(o)&&(o+="Series"),De(r,n.getTheme().get(this.subType)),De(r,this.getDefaultOption()),wg(r,"label",["show"]),this.fillDataTextStyle(r.data),a&&hi(r,i,a)},e.prototype.mergeOption=function(r,n){r=De(this.option,r,!0),this.fillDataTextStyle(r.data);var a=ko(this);a&&hi(this.option,r,a);var i=Tn(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(r,n);Ry(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Tn(this).dataBeforeProcessed=o,Py(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!It(r))for(var n=["show"],a=0;a<r.length;a++)r[a]&&r[a].label&&wg(r[a],"label",n)},e.prototype.getInitialData=function(r,n){},e.prototype.appendData=function(r){var n=this.getRawData();n.appendData(r.data)},e.prototype.getData=function(r){var n=mh(this);if(n){var a=n.context.data;return r==null||!a.getLinkedData?a:a.getLinkedData(r)}else return Tn(this).data},e.prototype.getAllData=function(){var r=this.getData();return r&&r.getLinkedDataAll?r.getLinkedDataAll():[{data:r}]},e.prototype.setData=function(r){var n=mh(this);if(n){var a=n.context;a.outputData=r,n!==this.dataTask&&(a.data=r)}Tn(this).data=r},e.prototype.getEncode=function(){var r=this.get("encode",!0);if(r)return de(r)},e.prototype.getSourceManager=function(){return Tn(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return Tn(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var r=this.get("colorBy");return r||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var r=this.coordinateSystem;return r&&r.getBaseAxis&&r.getBaseAxis()},e.prototype.formatTooltip=function(r,n,a){return FC({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(ge.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,n,a){var i=this.ecModel,o=hh.prototype.getColorFromPalette.call(this,r,n,a);return o||(o=i.getColorFromPalette(r,n,a)),o},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},e.prototype.unselect=function(r,n){var a=this.option.selectedMap;if(a){var i=this.option.selectedMode,o=this.getData(n);if(i==="series"||a==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<r.length;s++){var l=r[s],c=Zl(o,l);a[c]=!1,this._selectedDataIndicesMap[c]=-1}}},e.prototype.toggleSelect=function(r,n){for(var a=[],i=0;i<r.length;i++)a[0]=r[i],this.isSelected(r[i],n)?this.unselect(a,n):this.select(a,n)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var r=this._selectedDataIndicesMap,n=Qe(r),a=[],i=0;i<n.length;i++){var o=r[n[i]];o>=0&&a.push(o)}return a},e.prototype.isSelected=function(r,n){var a=this.option.selectedMap;if(!a)return!1;var i=this.getData(n);return(a==="all"||a[Zl(i,r)])&&!i.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[VC])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,n){var a,i,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){ce(o.selectedMap)||(o.selectedMap={});for(var c=o.selectedMap,u=0;u<l;u++){var f=n[u],h=Zl(r,f);c[h]=!0,this._selectedDataIndicesMap[h]=r.getRawIndex(f)}}else if(s==="single"||s===!0){var d=n[l-1],h=Zl(r,d);o.selectedMap=(a={},a[h]=!0,a),this._selectedDataIndicesMap=(i={},i[h]=r.getRawIndex(d),i)}}},e.prototype._initSelectedMapFromData=function(r){if(!this.option.selectedMap){var n=[];r.hasItemOption&&r.each(function(a){var i=r.getRawDataItem(a);i&&i.selected&&n.push(a)}),n.length>0&&this._innerSelect(r,n)}},e.registerClass=function(r){return We.registerClass(r)},e.protoInitialize=(function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"})(),e})(We);Cr(Br,mC),Cr(Br,hh),vv(Br,We);function Py(t){var e=t.name;uf(t)||(t.name=GC(t)||e)}function GC(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return D(r,function(a){var i=e.getDimensionInfo(a);i.displayName&&n.push(i.displayName)}),n.join(" ")}function $C(t){return t.model.getRawData().count()}function WC(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),UC}function UC(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Ry(t,e){D(Iw(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,at(YC,e))})}function YC(t,e){var r=mh(t);return r&&r.setOutputEnd((e||this).count()),e}function mh(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var n=r.currentTask;if(n){var a=n.agentStubMap;a&&(n=a.get(t.uid))}return n}}var qC=$e.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,n=e.cy,a=e.width/2,i=e.height/2;t.moveTo(r,n-i),t.lineTo(r+a,n+i),t.lineTo(r-a,n+i),t.closePath()}}),XC=$e.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,n=e.cy,a=e.width/2,i=e.height/2;t.moveTo(r,n-i),t.lineTo(r+a,n),t.lineTo(r,n+i),t.lineTo(r-a,n),t.closePath()}}),ZC=$e.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.x,n=e.y,a=e.width/5*3,i=Math.max(a,e.height),o=a/2,s=o*o/(i-o),l=n-i+o+s,c=Math.asin(s/o),u=Math.cos(c)*o,f=Math.sin(c),h=Math.cos(c),d=o*.6,p=o*.7;t.moveTo(r-u,l+s),t.arc(r,l,o,Math.PI-c,Math.PI*2+c),t.bezierCurveTo(r+u-f*d,l+s+h*d,r,n-p,r,n),t.bezierCurveTo(r,n-p,r-u+f*d,l+s+h*d,r-u,l+s),t.closePath()}}),KC=$e.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.height,n=e.width,a=e.x,i=e.y,o=n/3*2;t.moveTo(a,i),t.lineTo(a+o,i+r),t.lineTo(a,i+r/4*3),t.lineTo(a-o,i+r),t.lineTo(a,i),t.closePath()}}),jC={line:xn,rect:ft,roundRect:ft,square:ft,circle:pl,diamond:XC,pin:ZC,arrow:KC,triangle:qC},QC={line:function(t,e,r,n,a){a.x1=t,a.y1=e+n/2,a.x2=t+r,a.y2=e+n/2},rect:function(t,e,r,n,a){a.x=t,a.y=e,a.width=r,a.height=n},roundRect:function(t,e,r,n,a){a.x=t,a.y=e,a.width=r,a.height=n,a.r=Math.min(r,n)/4},square:function(t,e,r,n,a){var i=Math.min(r,n);a.x=t,a.y=e,a.width=i,a.height=i},circle:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.r=Math.min(r,n)/2},diamond:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.width=r,a.height=n},pin:function(t,e,r,n,a){a.x=t+r/2,a.y=e+n/2,a.width=r,a.height=n},arrow:function(t,e,r,n,a){a.x=t+r/2,a.y=e+n/2,a.width=r,a.height=n},triangle:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.width=r,a.height=n}},yh={};D(jC,function(t,e){yh[e]=new t});var JC=$e.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,r){var n=Ls(t,e,r),a=this.shape;return a&&a.symbolType==="pin"&&e.position==="inside"&&(n.y=r.y+r.height*.4),n},buildPath:function(t,e,r){var n=e.symbolType;if(n!=="none"){var a=yh[n];a||(n="rect",a=yh[n]),QC[n](e.x,e.y,e.width,e.height,a.shape),a.buildPath(t,a.shape,r)}}});function eM(t,e){if(this.type!=="image"){var r=this.style;this.__isEmptyBrush?(r.stroke=t,r.fill=e||"#fff",r.lineWidth=2):this.shape.symbolType==="line"?r.stroke=t:r.fill=t,this.markRedraw()}}function di(t,e,r,n,a,i,o){var s=t.indexOf("empty")===0;s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return t.indexOf("image://")===0?l=sm(t.slice(8),new Fe(e,r,n,a),o?"center":"cover"):t.indexOf("path://")===0?l=Of(t.slice(7),{},new Fe(e,r,n,a),o?"center":"cover"):l=new JC({shape:{symbolType:t,x:e,y:r,width:n,height:a}}),l.__isEmptyBrush=s,l.setColor=eM,i&&l.setColor(i),l}function tM(t){return ee(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function Ey(t,e){if(t!=null)return ee(t)||(t=[t,t]),[At(t[0],e[0])||0,At(Ce(t[1],t[0]),e[1])||0]}var rM=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r){return Qf(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(r){var n=new mt,a=di("line",0,r.itemHeight/2,r.itemWidth,0,r.lineStyle.stroke,!1);n.add(a),a.setStyle(r.lineStyle);var i=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=i==="none"?"circle":i,l=r.itemHeight*.8,c=di(s,(r.itemWidth-l)/2,(r.itemHeight-l)/2,l,l,r.itemStyle.fill);n.add(c),c.setStyle(r.itemStyle);var u=r.iconRotate==="inherit"?o:r.iconRotate||0;return c.rotation=u*Math.PI/180,c.setOrigin([r.itemWidth/2,r.itemHeight/2]),s.indexOf("empty")>-1&&(c.style.stroke=c.style.fill,c.style.fill="#fff",c.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e})(Br);function _h(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var a=ai(t,e,r[0]);return a!=null?a+"":null}else if(n){for(var i=[],o=0;o<r.length;o++)i.push(ai(t,e,r[o]));return i.join(" ")}}function Oy(t,e){var r=t.mapDimensionsAll("defaultedLabel");if(!ee(e))return e+"";for(var n=[],a=0;a<r.length;a++){var i=t.getDimensionIndex(r[a]);i>=0&&n.push(e[i])}return n.join(" ")}var bh=(function(t){Z(e,t);function e(r,n,a,i){var o=t.call(this)||this;return o.updateData(r,n,a,i),o}return e.prototype._createSymbol=function(r,n,a,i,o){this.removeAll();var s=di(r,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),s.drift=nM,this._symbolType=r,this.add(s)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){cl(this.childAt(0))},e.prototype.downplay=function(){ul(this.childAt(0))},e.prototype.setZ=function(r,n){var a=this.childAt(0);a.zlevel=r,a.z=n},e.prototype.setDraggable=function(r,n){var a=this.childAt(0);a.draggable=r,a.cursor=!n&&r?"move":a.cursor},e.prototype.updateData=function(r,n,a,i){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),c=o!==this._symbolType,u=i&&i.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,f)}else{var h=this.childAt(0);h.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};u?h.attr(d):Ut(h,d,s,n),om(h)}if(this._updateCommon(r,n,l,a,i),c){var h=this.childAt(0);if(!u){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,Qr(h,d,s,n)}}u&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,a,i,o){var s=this.childAt(0),l=r.hostModel,c,u,f,h,d,p,m,g,v;if(i&&(c=i.emphasisItemStyle,u=i.blurItemStyle,f=i.selectItemStyle,h=i.focus,d=i.blurScope,m=i.labelStatesModels,g=i.hoverScale,v=i.cursorStyle,p=i.emphasisDisabled),!i||r.hasItemOption){var y=i&&i.itemModel?i.itemModel:r.getItemModel(n),b=y.getModel("emphasis");c=b.getModel("itemStyle").getItemStyle(),f=y.getModel(["select","itemStyle"]).getItemStyle(),u=y.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),p=b.get("disabled"),m=Ml(y),g=b.getShallow("scale"),v=y.getShallow("cursor")}var x=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=Ey(r.getItemVisual(n,"symbolOffset"),a);S&&(s.x=S[0],s.y=S[1]),v&&s.attr("cursor",v);var w=r.getItemVisual(n,"style"),k=w.fill;if(s instanceof bn){var T=s.style;s.useStyle(U({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},w))}else s.__isEmptyBrush?s.useStyle(U({},w)):s.useStyle(w),s.style.decal=null,s.setColor(k,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=r.getItemVisual(n,"liftZ"),A=this._z2;C!=null?A==null&&(this._z2=s.z2,s.z2+=C):A!=null&&(s.z2=A,this._z2=null);var M=o&&o.useNameLabel;Cl(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:I,inheritColor:k,defaultOpacity:w.opacity});function I(N){return M?r.getName(N):_h(r,N)}this._sizeX=a[0]/2,this._sizeY=a[1]/2;var L=s.ensureState("emphasis");L.style=c,s.ensureState("select").style=f,s.ensureState("blur").style=u;var P=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;L.scaleX=this._sizeX*P,L.scaleY=this._sizeY*P,this.setSymbolScale(1),fl(this,h,d,p)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,n,a){var i=this.childAt(0),o=Ve(this).dataIndex,s=a&&a.animation;if(this.silent=i.silent=!0,a&&a.fadeLabel){var l=i.getTextContent();l&&bl(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){i.removeTextContent()}})}else i.removeTextContent();bl(i,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return tM(r.getItemVisual(n,"symbolSize"))},e})(mt);function nM(t,e){this.parent.drift(t,e)}function xh(t,e,r,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function Ny(t){return t!=null&&!ce(t)&&(t={isIgnore:t}),t||{}}function By(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Ml(e),cursorStyle:e.get("cursor")}}var aM=(function(){function t(e){this.group=new mt,this._SymbolCtor=e||bh}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Ny(r);var n=this.group,a=e.hostModel,i=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=By(e),c={disableAnimation:s},u=r.getSymbolPoint||function(f){return e.getItemLayout(f)};i||n.removeAll(),e.diff(i).add(function(f){var h=u(f);if(xh(e,h,f,r)){var d=new o(e,f,l,c);d.setPosition(h),e.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=i.getItemGraphicEl(h),p=u(f);if(!xh(e,p,f,r)){n.remove(d);return}var m=e.getItemVisual(f,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==m)n.remove(d),d=new o(e,f,l,c),d.setPosition(p);else{d.updateData(e,f,l,c);var v={x:p[0],y:p[1]};s?d.attr(v):Ut(d,v,a)}n.add(d),e.setItemGraphicEl(f,d)}).remove(function(f){var h=i.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},a)}).execute(),this._getSymbolPoint=u,this._data=e},t.prototype.updateLayout=function(){var e=this,r=this._data;r&&r.eachItemGraphicEl(function(n,a){var i=e._getSymbolPoint(a);n.setPosition(i),n.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=By(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[],n=Ny(n);function a(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i<e.end;i++){var o=r.getItemLayout(i);if(xh(r,o,i,n)){var s=new this._SymbolCtor(r,i,this._seriesScope);s.traverse(a),s.setPosition(o),this.group.add(s),r.setItemGraphicEl(i,s),this._progressiveEls.push(s)}}},t.prototype.eachRendered=function(e){kl(this._progressiveEls||this.group,e)},t.prototype.remove=function(e){var r=this.group,n=this._data;n&&e?n.eachItemGraphicEl(function(a){a.fadeOut(function(){r.remove(a)},n.hostModel)}):r.removeAll()},t})();function zy(t,e,r){var n=t.getBaseAxis(),a=t.getOtherAxis(n),i=iM(a,r),o=n.dim,s=a.dim,l=e.mapDimension(s),c=e.mapDimension(o),u=s==="x"||s==="radius"?1:0,f=ue(t.dimensions,function(p){return e.mapDimension(p)}),h=!1,d=e.getCalculationInfo("stackResultDimension");return li(e,f[0])&&(h=!0,f[0]=d),li(e,f[1])&&(h=!0,f[1]=d),{dataDimsForPoint:f,valueStart:i,valueAxisDim:s,baseAxisDim:o,stacked:!!h,valueDim:l,baseDim:c,baseDataOffset:u,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function iM(t,e){var r=0,n=t.scale.getExtent();return e==="start"?r=n[0]:e==="end"?r=n[1]:Ke(e)&&!isNaN(e)?r=e:n[0]>0?r=n[0]:n[1]<0&&(r=n[1]),r}function Fy(t,e,r,n){var a=NaN;t.stacked&&(a=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(a)&&(a=t.valueStart);var i=t.baseDataOffset,o=[];return o[i]=r.get(t.baseDim,n),o[1-i]=a,e.dataToPoint(o)}var Hy=typeof Float32Array<"u",oM=Hy?Float32Array:Array;function tn(t){return ee(t)?Hy?new Float32Array(t):t:new oM(t)}function sM(t,e){var r=[];return e.diff(t).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,a){r.push({cmd:"=",idx:a,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function lM(t,e,r,n,a,i,o,s){for(var l=sM(t,e),c=[],u=[],f=[],h=[],d=[],p=[],m=[],g=zy(a,e,o),v=t.getLayout("points")||[],y=e.getLayout("points")||[],b=0;b<l.length;b++){var x=l[b],S=!0,w=void 0,k=void 0;switch(x.cmd){case"=":w=x.idx*2,k=x.idx1*2;var T=v[w],C=v[w+1],A=y[k],M=y[k+1];(isNaN(T)||isNaN(C))&&(T=A,C=M),c.push(T,C),u.push(A,M),f.push(r[w],r[w+1]),h.push(n[k],n[k+1]),m.push(e.getRawIndex(x.idx1));break;case"+":var I=x.idx,L=g.dataDimsForPoint,P=a.dataToPoint([e.get(L[0],I),e.get(L[1],I)]);k=I*2,c.push(P[0],P[1]),u.push(y[k],y[k+1]);var N=Fy(g,a,e,I);f.push(N[0],N[1]),h.push(n[k],n[k+1]),m.push(e.getRawIndex(I));break;case"-":S=!1}S&&(d.push(x),p.push(p.length))}p.sort(function(we,Ze){return m[we]-m[Ze]});for(var O=c.length,q=tn(O),R=tn(O),z=tn(O),F=tn(O),X=[],b=0;b<p.length;b++){var te=p[b],fe=b*2,me=te*2;q[fe]=c[me],q[fe+1]=c[me+1],R[fe]=u[me],R[fe+1]=u[me+1],z[fe]=f[me],z[fe+1]=f[me+1],F[fe]=h[me],F[fe+1]=h[me+1],X[b]=d[te]}return{current:q,next:R,stackedOnCurrent:z,stackedOnNext:F,status:X}}var Cn=Math.min,Mn=Math.max;function va(t,e){return isNaN(t)||isNaN(e)}function wh(t,e,r,n,a,i,o,s,l){for(var c,u,f,h,d,p,m=r,g=0;g<n;g++){var v=e[m*2],y=e[m*2+1];if(m>=a||m<0)break;if(va(v,y)){if(l){m+=i;continue}break}if(m===r)t[i>0?"moveTo":"lineTo"](v,y),f=v,h=y;else{var b=v-c,x=y-u;if(b*b+x*x<.5){m+=i;continue}if(o>0){for(var S=m+i,w=e[S*2],k=e[S*2+1];w===v&&k===y&&g<n;)g++,S+=i,m+=i,w=e[S*2],k=e[S*2+1],v=e[m*2],y=e[m*2+1],b=v-c,x=y-u;var T=g+1;if(l)for(;va(w,k)&&T<n;)T++,S+=i,w=e[S*2],k=e[S*2+1];var C=.5,A=0,M=0,I=void 0,L=void 0;if(T>=n||va(w,k))d=v,p=y;else{A=w-c,M=k-u;var P=v-c,N=w-v,O=y-u,q=k-y,R=void 0,z=void 0;if(s==="x"){R=Math.abs(P),z=Math.abs(N);var F=A>0?1:-1;d=v-F*R*o,p=y,I=v+F*z*o,L=y}else if(s==="y"){R=Math.abs(O),z=Math.abs(q);var X=M>0?1:-1;d=v,p=y-X*R*o,I=v,L=y+X*z*o}else R=Math.sqrt(P*P+O*O),z=Math.sqrt(N*N+q*q),C=z/(z+R),d=v-A*o*(1-C),p=y-M*o*(1-C),I=v+A*o*C,L=y+M*o*C,I=Cn(I,Mn(w,v)),L=Cn(L,Mn(k,y)),I=Mn(I,Cn(w,v)),L=Mn(L,Cn(k,y)),A=I-v,M=L-y,d=v-A*R/z,p=y-M*R/z,d=Cn(d,Mn(c,v)),p=Cn(p,Mn(u,y)),d=Mn(d,Cn(c,v)),p=Mn(p,Cn(u,y)),A=v-d,M=y-p,I=v+A*z/R,L=y+M*z/R}t.bezierCurveTo(f,h,d,p,v,y),f=I,h=L}else t.lineTo(v,y)}c=v,u=y,m+=i}return g}var Vy=(function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t})(),cM=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Vy},e.prototype.buildPath=function(r,n){var a=n.points,i=0,o=a.length/2;if(n.connectNulls){for(;o>0&&va(a[o*2-2],a[o*2-1]);o--);for(;i<o&&va(a[i*2],a[i*2+1]);i++);}for(;i<o;)i+=wh(r,a,i,o,o,1,n.smooth,n.smoothMonotone,n.connectNulls)+1},e.prototype.getPointOn=function(r,n){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var a=this.path,i=a.data,o=ta.CMD,s,l,c=n==="x",u=[],f=0;f<i.length;){var h=i[f++],d=void 0,p=void 0,m=void 0,g=void 0,v=void 0,y=void 0,b=void 0;switch(h){case o.M:s=i[f++],l=i[f++];break;case o.L:if(d=i[f++],p=i[f++],b=c?(r-s)/(d-s):(r-l)/(p-l),b<=1&&b>=0){var x=c?(p-l)*b+l:(d-s)*b+s;return c?[r,x]:[x,r]}s=d,l=p;break;case o.C:d=i[f++],p=i[f++],m=i[f++],g=i[f++],v=i[f++],y=i[f++];var S=c?Os(s,d,m,v,r,u):Os(l,p,g,y,r,u);if(S>0)for(var w=0;w<S;w++){var k=u[w];if(k<=1&&k>=0){var x=c?gt(l,p,g,y,k):gt(s,d,m,v,k);return c?[r,x]:[x,r]}}s=v,l=y;break}}},e})($e),uM=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Vy),fM=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new uM},e.prototype.buildPath=function(r,n){var a=n.points,i=n.stackedOnPoints,o=0,s=a.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&va(a[s*2-2],a[s*2-1]);s--);for(;o<s&&va(a[o*2],a[o*2+1]);o++);}for(;o<s;){var c=wh(r,a,o,s,s,1,n.smooth,l,n.connectNulls);wh(r,i,o+c-1,c,s,-1,n.stackedOnSmooth,l,n.connectNulls),o+=c+1,r.closePath()}},e})($e);function Sh(){var t=it();return function(e){var r=t(e),n=e.pipelineContext,a=!!r.large,i=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(a!==o||i!==s)&&"reset"}}var Gy=it(),hM=Sh(),dr=(function(){function t(){this.group=new mt,this.uid=El("viewChart"),this.renderTask=To({plan:dM,reset:pM}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,a){},t.prototype.highlight=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Wy(i,a,"emphasis")},t.prototype.downplay=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Wy(i,a,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.updateLayout=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.updateVisual=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.eachRendered=function(e){kl(this.group,e)},t.markUpdateMethod=function(e,r){Gy(e).updateMethod=r},t.protoInitialize=(function(){var e=t.prototype;e.type="chart"})(),t})();function $y(t,e,r){t&&wf(t)&&(e==="emphasis"?cl:ul)(t,r)}function Wy(t,e,r){var n=oa(t,e),a=e&&e.highlightKey!=null?eT(e.highlightKey):null;n!=null?D(_t(n),function(i){$y(t.getItemGraphicEl(i),r,a)}):t.eachItemGraphicEl(function(i){$y(i,r,a)})}_u(dr),Ms(dr);function dM(t){return hM(t.model)}function pM(t){var e=t.model,r=t.ecModel,n=t.api,a=t.payload,i=e.pipelineContext.progressiveRender,o=t.view,s=a&&Gy(a).updateMethod,l=i?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,a),vM[l]}var vM={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function Uy(t,e,r,n,a){var i=t.getArea(),o=i.x,s=i.y,l=i.width,c=i.height,u=r.get(["lineStyle","width"])||0;o-=u/2,s-=u/2,l+=u,c+=u,l=Math.ceil(l),o!==Math.floor(o)&&(o=Math.floor(o),l++);var f=new ft({shape:{x:o,y:s,width:l,height:c}});if(e){var h=t.getBaseAxis(),d=h.isHorizontal(),p=h.inverse;d?(p&&(f.shape.x+=l),f.shape.width=0):(p||(f.shape.y+=c),f.shape.height=0);var m=ye(a)?function(g){a(g,f)}:null;Qr(f,{shape:{width:l,height:c,x:o,y:s}},r,null,n,m)}return f}function Yy(t,e,r){var n=t.getArea(),a=lt(n.r0,1),i=lt(n.r,1),o=new ti({shape:{cx:lt(t.cx,1),cy:lt(t.cy,1),r0:a,r:i,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});if(e){var s=t.getBaseAxis().dim==="angle";s?o.shape.endAngle=n.startAngle:o.shape.r=a,Qr(o,{shape:{endAngle:n.endAngle,r:i}},r)}return o}function gM(t,e,r,n,a){if(t){if(t.type==="polar")return Yy(t,e,r);if(t.type==="cartesian2d")return Uy(t,e,r,n,a)}else return null;return null}function kh(t,e){return t.type===e}function qy(t,e){if(t.length===e.length){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return;return!0}}function Xy(t){for(var e=1/0,r=1/0,n=-1/0,a=-1/0,i=0;i<t.length;){var o=t[i++],s=t[i++];isNaN(o)||(e=Math.min(o,e),n=Math.max(o,n)),isNaN(s)||(r=Math.min(s,r),a=Math.max(s,a))}return[[e,r],[n,a]]}function Zy(t,e){var r=Xy(t),n=r[0],a=r[1],i=Xy(e),o=i[0],s=i[1];return Math.max(Math.abs(n[0]-o[0]),Math.abs(n[1]-o[1]),Math.abs(a[0]-s[0]),Math.abs(a[1]-s[1]))}function Ky(t){return Ke(t)?t:t?.5:0}function mM(t,e,r){if(!r.valueDim)return[];for(var n=e.count(),a=tn(n*2),i=0;i<n;i++){var o=Fy(r,t,e,i);a[i*2]=o[0],a[i*2+1]=o[1]}return a}function An(t,e,r,n,a){var i=r.getBaseAxis(),o=i.dim==="x"||i.dim==="radius"?0:1,s=[],l=0,c=[],u=[],f=[],h=[];if(a){for(l=0;l<t.length;l+=2){var d=e||t;!isNaN(d[l])&&!isNaN(d[l+1])&&h.push(t[l],t[l+1])}t=h}for(l=0;l<t.length-2;l+=2)switch(f[0]=t[l+2],f[1]=t[l+3],u[0]=t[l],u[1]=t[l+1],s.push(u[0],u[1]),n){case"end":c[o]=f[o],c[1-o]=u[1-o],s.push(c[0],c[1]);break;case"middle":var p=(u[o]+f[o])/2,m=[];c[o]=m[o]=p,c[1-o]=u[1-o],m[1-o]=f[1-o],s.push(c[0],c[1]),s.push(m[0],m[1]);break;default:c[o]=u[o],c[1-o]=f[1-o],s.push(c[0],c[1])}return s.push(t[l++],t[l++]),s}function yM(t,e){var r=[],n=t.length,a,i;function o(u,f,h){var d=u.coord,p=(h-d)/(f.coord-d),m=bS(p,[u.color,f.color]);return{coord:h,color:m}}for(var s=0;s<n;s++){var l=t[s],c=l.coord;if(c<0)a=l;else if(c>e){i?r.push(o(i,l,e)):a&&r.push(o(a,l,0),o(a,l,e));break}else a&&(r.push(o(a,l,0)),a=null),r.push(l),i=l}return r}function _M(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var a,i,o=n.length-1;o>=0;o--){var s=t.getDimensionInfo(n[o].dimension);if(a=s&&s.coordDim,a==="x"||a==="y"){i=n[o];break}}if(i){var l=e.getAxis(a),c=ue(i.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),u=c.length,f=i.outerColors.slice();u&&c[0].coord>c[u-1].coord&&(c.reverse(),f.reverse());var h=yM(c,a==="x"?r.getWidth():r.getHeight()),d=h.length;if(!d&&u)return c[0].coord<0?f[1]?f[1]:c[u-1].color:f[0]?f[0]:c[0].color;var p=10,m=h[0].coord-p,g=h[d-1].coord+p,v=g-m;if(v<.001)return"transparent";D(h,function(b){b.offset=(b.coord-m)/v}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var y=new am(0,0,0,0,h,!0);return y[a]=m,y[a+"2"]=g,y}}}function bM(t,e,r){var n=t.get("showAllSymbol"),a=n==="auto";if(!(n&&!a)){var i=r.getAxesByScale("ordinal")[0];if(i&&!(a&&xM(i,e))){var o=e.mapDimension(i.dim),s={};return D(i.getViewLabels(),function(l){var c=i.scale.getRawOrdinalNumber(l.tickValue);s[c]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function xM(t,e){var r=t.getExtent(),n=Math.abs(r[1]-r[0])/t.scale.count();isNaN(n)&&(n=0);for(var a=e.count(),i=Math.max(1,Math.round(a/5)),o=0;o<a;o+=i)if(bh.getSymbolSize(e,o)[t.isHorizontal()?1:0]*1.5>n)return!1;return!0}function wM(t,e){return isNaN(t)||isNaN(e)}function SM(t){for(var e=t.length/2;e>0&&wM(t[e*2-2],t[e*2-1]);e--);return e-1}function jy(t,e){return[t[e*2],t[e*2+1]]}function kM(t,e,r){for(var n=t.length/2,a=r==="x"?0:1,i,o,s=0,l=-1,c=0;c<n;c++)if(o=t[c*2+a],!(isNaN(o)||isNaN(t[c*2+1-a]))){if(c===0){i=o;continue}if(i<=e&&o>=e||i>=e&&o<=e){l=c;break}s=c,i=o}return{range:[s,l],t:(e-i)/(o-i)}}function Qy(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<Er.length;e++)if(t.get([Er[e],"endLabel","show"]))return!0;return!1}function Th(t,e,r,n){if(kh(e,"cartesian2d")){var a=n.getModel("endLabel"),i=a.get("valueAnimation"),o=n.getData(),s={lastFrameIndex:0},l=Qy(n)?function(d,p){t._endLabelOnDuring(d,p,o,s,i,a,e)}:null,c=e.getBaseAxis().isHorizontal(),u=Uy(e,r,n,function(){var d=t._endLabel;d&&r&&s.originalX!=null&&d.attr({x:s.originalX,y:s.originalY})},l);if(!n.get("clip",!0)){var f=u.shape,h=Math.max(f.width,f.height);c?(f.y-=h,f.height+=h*2):(f.x-=h,f.width+=h*2)}return l&&l(1,u),u}else return Yy(e,r,n)}function TM(t,e){var r=e.getBaseAxis(),n=r.isHorizontal(),a=r.inverse,i=n?a?"right":"left":"center",o=n?"middle":a?"top":"bottom";return{normal:{align:t.get("align")||i,verticalAlign:t.get("verticalAlign")||o}}}var CM=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(){var r=new mt,n=new aM;this.group.add(n.group),this._symbolDraw=n,this._lineGroup=r,this._changePolyState=Le(this._changePolyState,this)},e.prototype.render=function(r,n,a){var i=r.coordinateSystem,o=this.group,s=r.getData(),l=r.getModel("lineStyle"),c=r.getModel("areaStyle"),u=s.getLayout("points")||[],f=i.type==="polar",h=this._coordSys,d=this._symbolDraw,p=this._polyline,m=this._polygon,g=this._lineGroup,v=!n.ssr&&r.get("animation"),y=!c.isEmpty(),b=c.get("origin"),x=zy(i,s,b),S=y&&mM(i,s,x),w=r.get("showSymbol"),k=r.get("connectNulls"),T=w&&!f&&bM(r,s,i),C=this._data;C&&C.eachItemGraphicEl(function(we,Ze){we.__temp&&(o.remove(we),C.setItemGraphicEl(Ze,null))}),w||d.remove(),o.add(g);var A=f?!1:r.get("step"),M;i&&i.getArea&&r.get("clip",!0)&&(M=i.getArea(),M.width!=null?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var I=_M(s,i,a)||s.getVisual("style")[s.getVisual("drawType")];if(!(p&&h.type===i.type&&A===this._step))w&&d.updateData(s,{isIgnore:T,clipShape:M,disableAnimation:!0,getSymbolPoint:function(we){return[u[we*2],u[we*2+1]]}}),v&&this._initSymbolLabelAnimation(s,i,M),A&&(S&&(S=An(S,u,i,A,k)),u=An(u,null,i,A,k)),p=this._newPolyline(u),y?m=this._newPolygon(u,S):m&&(g.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,pa(I)),g.setClipPath(Th(this,i,!0,r));else{y&&!m?m=this._newPolygon(u,S):m&&!y&&(g.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,pa(I));var L=g.getClipPath();if(L){var P=Th(this,i,!1,r);Qr(L,{shape:P.shape},r)}else g.setClipPath(Th(this,i,!0,r));w&&d.updateData(s,{isIgnore:T,clipShape:M,disableAnimation:!0,getSymbolPoint:function(we){return[u[we*2],u[we*2+1]]}}),(!qy(this._stackedOnPoints,S)||!qy(this._points,u))&&(v?this._doUpdateAnimation(s,S,i,a,A,b,k):(A&&(S&&(S=An(S,u,i,A,k)),u=An(u,null,i,A,k)),p.setShape({points:u}),m&&m.setShape({points:u,stackedOnPoints:S})))}var N=r.getModel("emphasis"),O=N.get("focus"),q=N.get("blurScope"),R=N.get("disabled");if(p.useStyle(Ne(l.getLineStyle(),{fill:"none",stroke:I,lineJoin:"bevel"})),xf(p,r,"lineStyle"),p.style.lineWidth>0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var z=p.getState("emphasis").style;z.lineWidth=+p.style.lineWidth+1}Ve(p).seriesIndex=r.seriesIndex,fl(p,O,q,R);var F=Ky(r.get("smooth")),X=r.get("smoothMonotone");if(p.setShape({smooth:F,smoothMonotone:X,connectNulls:k}),m){var te=s.getCalculationInfo("stackedOnSeries"),fe=0;m.useStyle(Ne(c.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),te&&(fe=Ky(te.get("smooth"))),m.setShape({smooth:F,stackedOnSmooth:fe,smoothMonotone:X,connectNulls:k}),xf(m,r,"areaStyle"),Ve(m).seriesIndex=r.seriesIndex,fl(m,O,q,R)}var me=this._changePolyState;s.eachItemGraphicEl(function(we){we&&(we.onHoverStateChange=me)}),this._polyline.onHoverStateChange=me,this._data=s,this._coordSys=i,this._stackedOnPoints=S,this._points=u,this._step=A,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,p),m&&this.packEventData(r,m))},e.prototype.packEventData=function(r,n){Ve(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},e.prototype.highlight=function(r,n,a,i){var o=r.getData(),s=oa(o,i);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),c=o.getItemGraphicEl(s);if(!c){var u=l[s*2],f=l[s*2+1];if(isNaN(u)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(u,f))return;var h=r.get("zlevel")||0,d=r.get("z")||0;c=new bh(o,s),c.x=u,c.y=f,c.setZ(h,d);var p=c.getSymbolPath().getTextContent();p&&(p.zlevel=h,p.z=d,p.z2=this._polyline.z2+1),c.__temp=!0,o.setItemGraphicEl(s,c),c.stopSymbolAnimation(!0),this.group.add(c)}c.highlight()}else dr.prototype.highlight.call(this,r,n,a,i)},e.prototype.downplay=function(r,n,a,i){var o=r.getData(),s=oa(o,i);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else dr.prototype.downplay.call(this,r,n,a,i)},e.prototype._changePolyState=function(r){var n=this._polygon;Eg(this._polyline,r),n&&Eg(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new cM({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(r,n){var a=this._polygon;return a&&this._lineGroup.remove(a),a=new fM({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(a),this._polygon=a,a},e.prototype._initSymbolLabelAnimation=function(r,n,a){var i,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(i=s.isHorizontal(),o=!1):n.type==="polar"&&(i=s.dim==="angle",o=!0);var c=r.hostModel,u=c.get("animationDuration");ye(u)&&(u=u(null));var f=c.get("animationDelay")||0,h=ye(f)?f(null):f;r.eachItemGraphicEl(function(d,p){var m=d;if(m){var g=[d.x,d.y],v=void 0,y=void 0,b=void 0;if(a)if(o){var x=a,S=n.pointToCoord(g);i?(v=x.startAngle,y=x.endAngle,b=-S[1]/180*Math.PI):(v=x.r0,y=x.r,b=S[0])}else{var w=a;i?(v=w.x,y=w.x+w.width,b=d.x):(v=w.y+w.height,y=w.y,b=d.y)}var k=y===v?0:(b-v)/(y-v);l&&(k=1-k);var T=ye(f)?f(p):u*k+h,C=m.getSymbolPath(),A=C.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),A&&A.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,a){var i=r.getModel("endLabel");if(Qy(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var c=this._endLabel;c||(c=this._endLabel=new Pt({z2:200}),c.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var u=SM(l);u>=0&&(Cl(s,Ml(r,"endLabel"),{inheritColor:a,labelFetcher:r,labelDataIndex:u,defaultText:function(f,h,d){return d!=null?Oy(o,d):_h(o,f)},enableTextSetter:!0},TM(i,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,a,i,o,s,l){var c=this._endLabel,u=this._polyline;if(c){r<1&&i.originalX==null&&(i.originalX=c.x,i.originalY=c.y);var f=a.getLayout("points"),h=a.hostModel,d=h.get("connectNulls"),p=s.get("precision"),m=s.get("distance")||0,g=l.getBaseAxis(),v=g.isHorizontal(),y=g.inverse,b=n.shape,x=y?v?b.x:b.y+b.height:v?b.x+b.width:b.y,S=(v?m:0)*(y?-1:1),w=(v?0:-m)*(y?-1:1),k=v?"x":"y",T=kM(f,x,k),C=T.range,A=C[1]-C[0],M=void 0;if(A>=1){if(A>1&&!d){var I=jy(f,C[0]);c.attr({x:I[0]+S,y:I[1]+w}),o&&(M=h.getRawValue(C[0]))}else{var I=u.getPointOn(x,k);I&&c.attr({x:I[0]+S,y:I[1]+w});var L=h.getRawValue(C[0]),P=h.getRawValue(C[1]);o&&(M=Ek(a,p,L,P,T.t))}i.lastFrameIndex=C[0]}else{var N=r===1||i.lastFrameIndex>0?C[0]:0,I=jy(f,N);o&&(M=h.getRawValue(N)),c.attr({x:I[0]+S,y:I[1]+w})}if(o){var O=Al(c);typeof O.setLabelText=="function"&&O.setLabelText(M)}}},e.prototype._doUpdateAnimation=function(r,n,a,i,o,s,l){var c=this._polyline,u=this._polygon,f=r.hostModel,h=lM(this._data,r,this._stackedOnPoints,n,this._coordSys,a,this._valueOrigin),d=h.current,p=h.stackedOnCurrent,m=h.next,g=h.stackedOnNext;if(o&&(p=An(h.stackedOnCurrent,h.current,a,o,l),d=An(h.current,null,a,o,l),g=An(h.stackedOnNext,h.next,a,o,l),m=An(h.next,null,a,o,l)),Zy(d,m)>3e3||u&&Zy(p,g)>3e3){c.stopAnimation(),c.setShape({points:m}),u&&(u.stopAnimation(),u.setShape({points:m,stackedOnPoints:g}));return}c.shape.__points=h.current,c.shape.points=d;var v={shape:{points:m}};h.current!==d&&(v.shape.__points=h.next),c.stopAnimation(),Ut(c,v,f),u&&(u.setShape({points:d,stackedOnPoints:p}),u.stopAnimation(),Ut(u,{shape:{stackedOnPoints:g}},f),c.shape.points!==u.shape.points&&(u.shape.points=c.shape.points));for(var y=[],b=h.status,x=0;x<b.length;x++){var S=b[x].cmd;if(S==="="){var w=r.getItemGraphicEl(b[x].idx1);w&&y.push({el:w,ptIdx:x})}}c.animators&&c.animators.length&&c.animators[0].during(function(){u&&u.dirtyShape();for(var k=c.shape.__points,T=0;T<y.length;T++){var C=y[T].el,A=y[T].ptIdx*2;C.x=k[A],C.y=k[A+1],C.markRedraw()}})},e.prototype.remove=function(r){var n=this.group,a=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),a&&a.eachItemGraphicEl(function(i,o){i.__temp&&(n.remove(i),a.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e})(dr);function MM(t,e){return{seriesType:t,plan:Sh(),reset:function(r){var n=r.getData(),a=r.coordinateSystem;if(r.pipelineContext,!!a){var i=ue(a.dimensions,function(f){return n.mapDimension(f)}).slice(0,2),o=i.length,s=n.getCalculationInfo("stackResultDimension");li(n,i[0])&&(i[0]=s),li(n,i[1])&&(i[1]=s);var l=n.getStore(),c=n.getDimensionIndex(i[0]),u=n.getDimensionIndex(i[1]);return o&&{progress:function(f,h){for(var d=f.end-f.start,p=tn(d*o),m=[],g=[],v=f.start,y=0;v<f.end;v++){var b=void 0;if(o===1){var x=l.get(c,v);b=a.dataToPoint(x,null,g)}else m[0]=l.get(c,v),m[1]=l.get(u,v),b=a.dataToPoint(m,null,g);p[y++]=b[0],p[y++]=b[1]}h.setLayout("points",p)}}}}}}var AM={average:function(t){for(var e=0,r=0,n=0;n<t.length;n++)isNaN(t[n])||(e+=t[n],r++);return r===0?NaN:e/r},sum:function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r]||0;return e},max:function(t){for(var e=-1/0,r=0;r<t.length;r++)t[r]>e&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r<t.length;r++)t[r]<e&&(e=t[r]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},DM=function(t){return Math.round(t.length/2)};function Jy(t){return{seriesType:t,reset:function(e,r,n){var a=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,s=a.count();if(s>10&&o.type==="cartesian2d"&&i){var l=o.getBaseAxis(),c=o.getOtherAxis(l),u=l.getExtent(),f=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(f||1),d=Math.round(s/h);if(isFinite(d)&&d>1){i==="lttb"?e.setData(a.lttbDownSample(a.mapDimension(c.dim),1/d)):i==="minmax"&&e.setData(a.minmaxDownSample(a.mapDimension(c.dim),1/d));var p=void 0;ne(i)?p=AM[i]:ye(i)&&(p=i),p&&e.setData(a.downSample(a.mapDimension(c.dim),1/d,p,DM))}}}}}function IM(t){t.registerChartView(CM),t.registerSeriesModel(rM),t.registerLayout(MM("line")),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,Jy("line"))}var LM="__ec_stack_";function e0(t){return t.get("stack")||LM+t.seriesIndex}function Ch(t){return t.dim+t.index}function t0(t,e){var r=[];return e.eachSeriesByType(t,function(n){n0(n)&&r.push(n)}),r}function PM(t){var e={};D(t,function(l){var c=l.coordinateSystem,u=c.getBaseAxis();if(!(u.type!=="time"&&u.type!=="value"))for(var f=l.getData(),h=u.dim+"_"+u.index,d=f.getDimensionIndex(f.mapDimension(u.dim)),p=f.getStore(),m=0,g=p.count();m<g;++m){var v=p.get(d,m);e[h]?e[h].push(v):e[h]=[v]}});var r={};for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];if(a){a.sort(function(l,c){return l-c});for(var i=null,o=1;o<a.length;++o){var s=a[o]-a[o-1];s>0&&(i=i===null?s:Math.min(i,s))}r[n]=i}}return r}function r0(t){var e=PM(t),r=[];return D(t,function(n){var a=n.coordinateSystem,i=a.getBaseAxis(),o=i.getExtent(),s;if(i.type==="category")s=i.getBandWidth();else if(i.type==="value"||i.type==="time"){var l=i.dim+"_"+i.index,c=e[l],u=Math.abs(o[1]-o[0]),f=i.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=c?u/h*c:u}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var p=At(n.get("barWidth"),s),m=At(n.get("barMaxWidth"),s),g=At(n.get("barMinWidth")||(a0(n)?.5:1),s),v=n.get("barGap"),y=n.get("barCategoryGap");r.push({bandWidth:s,barWidth:p,barMaxWidth:m,barMinWidth:g,barGap:v,barCategoryGap:y,axisKey:Ch(i),stackId:e0(n)})}),RM(r)}function RM(t){var e={};D(t,function(n,a){var i=n.axisKey,o=n.bandWidth,s=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[i]=s;var c=n.stackId;l[c]||s.autoWidthCount++,l[c]=l[c]||{width:0,maxWidth:0};var u=n.barWidth;u&&!l[c].width&&(l[c].width=u,u=Math.min(s.remainedWidth,u),s.remainedWidth-=u);var f=n.barMaxWidth;f&&(l[c].maxWidth=f);var h=n.barMinWidth;h&&(l[c].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var p=n.barCategoryGap;p!=null&&(s.categoryGap=p)});var r={};return D(e,function(n,a){r[a]={};var i=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=Qe(i).length;s=Math.max(35-l*4,15)+"%"}var c=At(s,o),u=At(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-c)/(h+(h-1)*u);d=Math.max(d,0),D(i,function(v){var y=v.maxWidth,b=v.minWidth;if(v.width){var x=v.width;y&&(x=Math.min(x,y)),b&&(x=Math.max(x,b)),v.width=x,f-=x+u*x,h--}else{var x=d;y&&y<x&&(x=Math.min(y,f)),b&&b>x&&(x=b),x!==d&&(v.width=x,f-=x+u*x,h--)}}),d=(f-c)/(h+(h-1)*u),d=Math.max(d,0);var p=0,m;D(i,function(v,y){v.width||(v.width=d),m=v,p+=v.width*(1+u)}),m&&(p-=m.width*u);var g=-p/2;D(i,function(v,y){r[a][y]=r[a][y]||{bandWidth:o,offset:g,width:v.width},g+=v.width*(1+u)})}),r}function EM(t,e,r){if(t&&e){var n=t[Ch(e)];return n}}function OM(t,e){var r=t0(t,e),n=r0(r);D(r,function(a){var i=a.getData(),o=a.coordinateSystem,s=o.getBaseAxis(),l=e0(a),c=n[Ch(s)][l],u=c.offset,f=c.width;i.setLayout({bandWidth:c.bandWidth,offset:u,size:f})})}function NM(t){return{seriesType:t,plan:Sh(),reset:function(e){if(n0(e)){var r=e.getData(),n=e.coordinateSystem,a=n.getBaseAxis(),i=n.getOtherAxis(a),o=r.getDimensionIndex(r.mapDimension(i.dim)),s=r.getDimensionIndex(r.mapDimension(a.dim)),l=e.get("showBackground",!0),c=r.mapDimension(i.dim),u=r.getCalculationInfo("stackResultDimension"),f=li(r,c)&&!!r.getCalculationInfo("stackedOnSeries"),h=i.isHorizontal(),d=BM(a,i),p=a0(e),m=e.get("barMinHeight")||0,g=u&&r.getDimensionIndex(u),v=r.getLayout("size"),y=r.getLayout("offset");return{progress:function(b,x){for(var S=b.count,w=p&&tn(S*3),k=p&&l&&tn(S*3),T=p&&tn(S),C=n.master.getRect(),A=h?C.width:C.height,M,I=x.getStore(),L=0;(M=b.next())!=null;){var P=I.get(f?g:o,M),N=I.get(s,M),O=d,q=void 0;f&&(q=+P-I.get(o,M));var R=void 0,z=void 0,F=void 0,X=void 0;if(h){var te=n.dataToPoint([P,N]);if(f){var fe=n.dataToPoint([q,N]);O=fe[0]}R=O,z=te[1]+y,F=te[0]-O,X=v,Math.abs(F)<m&&(F=(F<0?-1:1)*m)}else{var te=n.dataToPoint([N,P]);if(f){var fe=n.dataToPoint([N,q]);O=fe[1]}R=te[0]+y,z=O,F=v,X=te[1]-O,Math.abs(X)<m&&(X=(X<=0?-1:1)*m)}p?(w[L]=R,w[L+1]=z,w[L+2]=h?F:X,k&&(k[L]=h?C.x:R,k[L+1]=h?z:C.y,k[L+2]=A),T[M]=M):x.setItemLayout(M,{x:R,y:z,width:F,height:X}),L+=3}p&&x.setLayout({largePoints:w,largeDataIndices:T,largeBackgroundPoints:k,valueAxisHorizontal:h})}}}}}}function n0(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function a0(t){return t.pipelineContext&&t.pipelineContext.large}function BM(t,e){var r=e.model.get("startValue");return r||(r=0),e.toGlobalCoord(e.dataToCoord(e.type==="log"?r>0?r:1:r))}var Mh=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){return Qf(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(r,n,a){var i=this.coordinateSystem;if(i&&i.clampData){var o=i.clampData(r),s=i.dataToPoint(o);if(a)D(i.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var p=h.getTicksCoords(),m=h.getTickModel().get("alignWithLabel"),g=o[d],v=n[d]==="x1"||n[d]==="y1";if(v&&!m&&(g+=1),p.length<2)return;if(p.length===2){s[d]=h.toGlobalCoord(h.getExtent()[v?1:0]);return}for(var y=void 0,b=void 0,x=1,S=0;S<p.length;S++){var w=p[S].coord,k=S===p.length-1?p[S-1].tickValue+x:p[S].tickValue;if(k===g){b=w;break}else if(k<g)y=w;else if(y!=null&&k>g){b=(w+y)/2;break}S===1&&(x=k-p[0].tickValue)}b==null&&(y?y&&(b=p[p.length-1].coord):b=p[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),c=l.getLayout("offset"),u=l.getLayout("size"),f=i.getBaseAxis().isHorizontal()?0:1;s[f]+=c+u/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e})(Br);Br.registerClass(Mh);var zM=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(){return Qf(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},e.prototype.brushSelector=function(r,n,a){return a.rect(n.getItemLayout(r))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Jf(Mh.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e})(Mh),Kl="\0__throttleOriginMethod",i0="\0__throttleRate",o0="\0__throttleType";function Ah(t,e,r){var n,a=0,i=0,o=null,s,l,c,u;e=e||0;function f(){i=new Date().getTime(),o=null,t.apply(l,c||[])}var h=function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];n=new Date().getTime(),l=this,c=d;var m=u||e,g=u||r;u=null,s=n-(g?a:i)-m,clearTimeout(o),g?o=setTimeout(f,m):s>=0?f():o=setTimeout(f,-s),a=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){u=d},h}function Dh(t,e,r,n){var a=t[e];if(a){var i=a[Kl]||a,o=a[o0],s=a[i0];if(s!==r||o!==n){if(r==null||!n)return t[e]=i;a=t[e]=Ah(i,r,n==="debounce"),a[Kl]=i,a[o0]=n,a[i0]=r}return a}}function Ih(t,e){var r=t[e];r&&r[Kl]&&(r.clear&&r.clear(),t[e]=r[Kl])}var FM=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),s0=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new FM},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,c=o+l,u=n.startAngle,f=n.endAngle,h=n.clockwise,d=Math.PI*2,p=h?f-u<d:u-f<d;p||(u=f-(h?d:-d));var m=Math.cos(u),g=Math.sin(u),v=Math.cos(f),y=Math.sin(f);p?(r.moveTo(m*o+a,g*o+i),r.arc(m*c+a,g*c+i,l,-Math.PI+u,u,!h)):r.moveTo(m*s+a,g*s+i),r.arc(a,i,s,u,f,!h),r.arc(v*c+a,y*c+i,l,f-Math.PI*2,f-Math.PI,!h),o!==0&&r.arc(a,i,o,f,u,h)},e})($e);function HM(t,e){e=e||{};var r=e.isRoundCap;return function(n,a,i){var o=a.position;if(!o||o instanceof Array)return Ls(n,a,i);var s=t(o),l=a.distance!=null?a.distance:5,c=this.shape,u=c.cx,f=c.cy,h=c.r,d=c.r0,p=(h+d)/2,m=c.startAngle,g=c.endAngle,v=(m+g)/2,y=r?Math.abs(h-d)/2:0,b=Math.cos,x=Math.sin,S=u+h*b(m),w=f+h*x(m),k="left",T="top";switch(s){case"startArc":S=u+(d-l)*b(v),w=f+(d-l)*x(v),k="center",T="top";break;case"insideStartArc":S=u+(d+l)*b(v),w=f+(d+l)*x(v),k="center",T="bottom";break;case"startAngle":S=u+p*b(m)+jl(m,l+y,!1),w=f+p*x(m)+Ql(m,l+y,!1),k="right",T="middle";break;case"insideStartAngle":S=u+p*b(m)+jl(m,-l+y,!1),w=f+p*x(m)+Ql(m,-l+y,!1),k="left",T="middle";break;case"middle":S=u+p*b(v),w=f+p*x(v),k="center",T="middle";break;case"endArc":S=u+(h+l)*b(v),w=f+(h+l)*x(v),k="center",T="bottom";break;case"insideEndArc":S=u+(h-l)*b(v),w=f+(h-l)*x(v),k="center",T="top";break;case"endAngle":S=u+p*b(g)+jl(g,l+y,!0),w=f+p*x(g)+Ql(g,l+y,!0),k="left",T="middle";break;case"insideEndAngle":S=u+p*b(g)+jl(g,-l+y,!0),w=f+p*x(g)+Ql(g,-l+y,!0),k="right",T="middle";break;default:return Ls(n,a,i)}return n=n||{},n.x=S,n.y=w,n.align=k,n.verticalAlign=T,n}}function VM(t,e,r,n){if(Ke(n)){t.setTextConfig({rotation:n});return}else if(ee(e)){t.setTextConfig({rotation:0});return}var a=t.shape,i=a.clockwise?a.startAngle:a.endAngle,o=a.clockwise?a.endAngle:a.startAngle,s=(i+o)/2,l,c=r(e);switch(c){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=s;break;case"startAngle":case"insideStartAngle":l=i;break;case"endAngle":case"insideEndAngle":l=o;break;default:t.setTextConfig({rotation:0});return}var u=Math.PI*1.5-l;c==="middle"&&u>Math.PI/2&&u<Math.PI*1.5&&(u-=Math.PI),t.setTextConfig({rotation:u})}function jl(t,e,r){return e*Math.sin(t)*(r?-1:1)}function Ql(t,e,r){return e*Math.cos(t)*(r?1:-1)}function GM(t,e,r){var n=t.get("borderRadius");if(n==null)return{cornerRadius:0};ee(n)||(n=[n,n,n,n]);var a=Math.abs(e.r||0-e.r0||0);return{cornerRadius:ue(n,function(i){return dn(i,a)})}}var Lh=Math.max,Ph=Math.min;function $M(t,e){var r=t.getArea&&t.getArea();if(kh(t,"cartesian2d")){var n=t.getBaseAxis();if(n.type!=="category"||!n.onBand){var a=e.getLayout("bandWidth");n.isHorizontal()?(r.x-=a,r.width+=a*2):(r.y-=a,r.height+=a*2)}}return r}var WM=(function(t){Z(e,t);function e(){var r=t.call(this)||this;return r.type=e.type,r._isFirstFrame=!0,r}return e.prototype.render=function(r,n,a,i){this._model=r,this._removeOnRenderedListener(a),this._updateDrawMode(r);var o=r.get("coordinateSystem");(o==="cartesian2d"||o==="polar")&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(r,n,a):this._renderNormal(r,n,a,i))},e.prototype.incrementalPrepareRender=function(r){this._clear(),this._updateDrawMode(r),this._updateLargeClip(r)},e.prototype.incrementalRender=function(r,n){this._progressiveEls=[],this._incrementalRenderLarge(r,n)},e.prototype.eachRendered=function(r){kl(this._progressiveEls||this.group,r)},e.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(r,n,a,i){var o=this.group,s=r.getData(),l=this._data,c=r.coordinateSystem,u=c.getBaseAxis(),f;c.type==="cartesian2d"?f=u.isHorizontal():c.type==="polar"&&(f=u.dim==="angle");var h=r.isAnimationEnabled()?r:null,d=UM(r,c);d&&this._enableRealtimeSort(d,s,a);var p=r.get("clip",!0)||d,m=$M(c,s);o.removeClipPath();var g=r.get("roundCap",!0),v=r.get("showBackground",!0),y=r.getModel("backgroundStyle"),b=y.get("borderRadius")||0,x=[],S=this._backgroundEls,w=i&&i.isInitSort,k=i&&i.type==="changeAxisOrder";function T(M){var I=Jl[c.type](s,M),L=QM(c,f,I);return L.useStyle(y.getItemStyle()),c.type==="cartesian2d"?L.setShape("r",b):L.setShape("cornerRadius",b),x[M]=L,L}s.diff(l).add(function(M){var I=s.getItemModel(M),L=Jl[c.type](s,M,I);if(v&&T(M),!(!s.hasValue(M)||!h0[c.type](L))){var P=!1;p&&(P=l0[c.type](m,L));var N=c0[c.type](r,s,M,L,f,h,u.model,!1,g);d&&(N.forceLabelAnimation=!0),p0(N,s,M,I,L,r,f,c.type==="polar"),w?N.attr({shape:L}):d?u0(d,h,N,L,M,f,!1,!1):Qr(N,{shape:L},r,M),s.setItemGraphicEl(M,N),o.add(N),N.ignore=P}}).update(function(M,I){var L=s.getItemModel(M),P=Jl[c.type](s,M,L);if(v){var N=void 0;S.length===0?N=T(I):(N=S[I],N.useStyle(y.getItemStyle()),c.type==="cartesian2d"?N.setShape("r",b):N.setShape("cornerRadius",b),x[M]=N);var O=Jl[c.type](s,M),q=y0(f,O,c);Ut(N,{shape:q},h,M)}var R=l.getItemGraphicEl(I);if(!s.hasValue(M)||!h0[c.type](P)){o.remove(R);return}var z=!1;if(p&&(z=l0[c.type](m,P),z&&o.remove(R)),R?om(R):R=c0[c.type](r,s,M,P,f,h,u.model,!!R,g),d&&(R.forceLabelAnimation=!0),k){var F=R.getTextContent();if(F){var X=Al(F);X.prevValue!=null&&(X.prevValue=X.value)}}else p0(R,s,M,L,P,r,f,c.type==="polar");w?R.attr({shape:P}):d?u0(d,h,R,P,M,f,!0,k):Ut(R,{shape:P},r,M,null),s.setItemGraphicEl(M,R),R.ignore=z,o.add(R)}).remove(function(M){var I=l.getItemGraphicEl(M);I&&Rf(I,r,M)}).execute();var C=this._backgroundGroup||(this._backgroundGroup=new mt);C.removeAll();for(var A=0;A<x.length;++A)C.add(x[A]);o.add(C),this._backgroundEls=x,this._data=s},e.prototype._renderLarge=function(r,n,a){this._clear(),g0(r,this.group),this._updateLargeClip(r)},e.prototype._incrementalRenderLarge=function(r,n){this._removeBackground(),g0(n,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(r){var n=r.get("clip",!0)&&gM(r.coordinateSystem,!1,r),a=this.group;n?a.setClipPath(n):a.removeClipPath()},e.prototype._enableRealtimeSort=function(r,n,a){var i=this;if(n.count()){var o=r.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(n,r,a),this._isFirstFrame=!1;else{var s=function(l){var c=n.getItemGraphicEl(l),u=c&&c.shape;return u&&Math.abs(o.isHorizontal()?u.height:u.width)||0};this._onRendered=function(){i._updateSortWithinSameData(n,s,o,a)},a.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(r,n,a){var i=[];return r.each(r.mapDimension(n.dim),function(o,s){var l=a(s);l=l??NaN,i.push({dataIndex:s,mappedValue:l,ordinalNumber:o})}),i.sort(function(o,s){return s.mappedValue-o.mappedValue}),{ordinalNumbers:ue(i,function(o){return o.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(r,n,a){for(var i=a.scale,o=r.mapDimension(a.dim),s=Number.MAX_VALUE,l=0,c=i.getOrdinalMeta().categories.length;l<c;++l){var u=r.rawIndexOf(o,i.getRawOrdinalNumber(l)),f=u<0?Number.MIN_VALUE:n(r.indexOfRawIndex(u));if(f>s)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var a=n.scale,i=a.getExtent(),o=Math.max(0,i[0]),s=Math.min(i[1],a.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==a.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(r,n,a,i){if(this._isOrderChangedWithinSameData(r,n,a)){var o=this._dataSort(r,a,n);this._isOrderDifferentInView(o,a)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",axisId:a.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(r,n,a){var i=n.baseAxis,o=this._dataSort(r,i,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:o})},e.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(r){var n=this.group,a=this._data;r&&r.isAnimationEnabled()&&a&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],a.eachItemGraphicEl(function(i){Rf(i,r,Ve(i).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e})(dr),l0={cartesian2d:function(t,e){var r=e.width<0?-1:1,n=e.height<0?-1:1;r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var a=t.x+t.width,i=t.y+t.height,o=Lh(e.x,t.x),s=Ph(e.x+e.width,a),l=Lh(e.y,t.y),c=Ph(e.y+e.height,i),u=s<o,f=c<l;return e.x=u&&o>a?s:o,e.y=f&&l>i?c:l,e.width=u?0:s-o,e.height=f?0:c-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),u||f},polar:function(t,e){var r=e.r0<=e.r?1:-1;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}var a=Ph(e.r,t.r),i=Lh(e.r0,t.r0);e.r=a,e.r0=i;var o=a-i<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},c0={cartesian2d:function(t,e,r,n,a,i,o,s,l){var c=new ft({shape:U({},n),z2:1});if(c.__dataIndex=r,c.name="item",i){var u=c.shape,f=a?"height":"width";u[f]=0}return c},polar:function(t,e,r,n,a,i,o,s,l){var c=!a&&l?s0:ti,u=new c({shape:n,z2:1});u.name="item";var f=d0(a);if(u.calculateTextPosition=HM(f,{isRoundCap:c===s0}),i){var h=u.shape,d=a?"r":"endAngle",p={};h[d]=a?n.r0:n.startAngle,p[d]=n[d],(s?Ut:Qr)(u,{shape:p},i)}return u}};function UM(t,e){var r=t.get("realtimeSort",!0),n=e.getBaseAxis();if(r&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function u0(t,e,r,n,a,i,o,s){var l,c;i?(c={x:n.x,width:n.width},l={y:n.y,height:n.height}):(c={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?Ut:Qr)(r,{shape:l},e,a,null);var u=e?t.baseAxis.model:null;(o?Ut:Qr)(r,{shape:c},u,a)}function f0(t,e){for(var r=0;r<e.length;r++)if(!isFinite(t[e[r]]))return!0;return!1}var YM=["x","y","width","height"],qM=["cx","cy","r","startAngle","endAngle"],h0={cartesian2d:function(t){return!f0(t,YM)},polar:function(t){return!f0(t,qM)}},Jl={cartesian2d:function(t,e,r){var n=t.getItemLayout(e),a=r?ZM(r,n):0,i=n.width>0?1:-1,o=n.height>0?1:-1;return{x:n.x+i*a/2,y:n.y+o*a/2,width:n.width-i*a,height:n.height-o*a}},polar:function(t,e,r){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function XM(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function d0(t){return(function(e){var r=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}})(t)}function p0(t,e,r,n,a,i,o,s){var l=e.getItemVisual(r,"style");if(s){if(!i.get("roundCap")){var u=t.shape,f=GM(n.getModel("itemStyle"),u);U(u,f),t.setShape(u)}}else{var c=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",c)}t.useStyle(l);var h=n.getShallow("cursor");h&&t.attr("cursor",h);var d=s?o?a.r>=a.r0?"endArc":"startArc":a.endAngle>=a.startAngle?"endAngle":"startAngle":o?a.height>=0?"bottom":"top":a.width>=0?"right":"left",p=Ml(n);Cl(t,p,{labelFetcher:i,labelDataIndex:r,defaultText:_h(i.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var m=t.getTextContent();if(s&&m){var g=n.get(["label","position"]);t.textConfig.inside=g==="middle"?!0:null,VM(t,g==="outside"?d:g,d0(o),n.get(["label","rotate"]))}jT(m,p,i.getRawValue(r),function(y){return Oy(e,y)});var v=n.getModel(["emphasis"]);fl(t,v.get("focus"),v.get("blurScope"),v.get("disabled")),xf(t,n),XM(a)&&(t.style.fill="none",t.style.stroke="none",D(t.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function ZM(t,e){var r=t.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=t.get(["itemStyle","borderWidth"])||0,a=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),i=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,a,i)}var KM=(function(){function t(){}return t})(),v0=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new KM},e.prototype.buildPath=function(r,n){for(var a=n.points,i=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],c=this.barWidth,u=0;u<a.length;u+=3)l[i]=c,l[o]=a[u+2],s[i]=a[u+i],s[o]=a[u+o],r.rect(s[0],s[1],l[0],l[1])},e})($e);function g0(t,e,r,n){var a=t.getData(),i=a.getLayout("valueAxisHorizontal")?1:0,o=a.getLayout("largeDataIndices"),s=a.getLayout("size"),l=t.getModel("backgroundStyle"),c=a.getLayout("largeBackgroundPoints");if(c){var u=new v0({shape:{points:c},incremental:!!n,silent:!0,z2:0});u.baseDimIdx=i,u.largeDataIndices=o,u.barWidth=s,u.useStyle(l.getItemStyle()),e.add(u),r&&r.push(u)}var f=new v0({shape:{points:a.getLayout("largePoints")},incremental:!!n,ignoreCoarsePointer:!0,z2:1});f.baseDimIdx=i,f.largeDataIndices=o,f.barWidth=s,e.add(f),f.useStyle(a.getVisual("style")),f.style.stroke=null,Ve(f).seriesIndex=t.seriesIndex,t.get("silent")||(f.on("mousedown",m0),f.on("mousemove",m0)),r&&r.push(f)}var m0=Ah(function(t){var e=this,r=jM(e,t.offsetX,t.offsetY);Ve(e).dataIndex=r>=0?r:null},30,!1);function jM(t,e,r){for(var n=t.baseDimIdx,a=1-n,i=t.shape.points,o=t.largeDataIndices,s=[],l=[],c=t.barWidth,u=0,f=i.length/3;u<f;u++){var h=u*3;if(l[n]=c,l[a]=i[h+2],s[n]=i[h+n],s[a]=i[h+a],l[a]<0&&(s[a]+=l[a],l[a]=-l[a]),e>=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[u]}return-1}function y0(t,e,r){if(kh(r,"cartesian2d")){var n=e,a=r.getArea();return{x:t?n.x:a.x,y:t?a.y:n.y,width:t?n.width:a.width,height:t?a.height:n.height}}else{var a=r.getArea(),i=e;return{cx:a.cx,cy:a.cy,r0:t?a.r0:i.r0,r:t?a.r:i.r,startAngle:t?i.startAngle:0,endAngle:t?i.endAngle:Math.PI*2}}}function QM(t,e,r){var n=t.type==="polar"?ti:ft;return new n({shape:y0(e,r,t),silent:!0,z2:0})}function JM(t){t.registerChartView(WM),t.registerSeriesModel(zM),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,at(OM,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,NM("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,Jy("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,r){var n=e.componentType||"series";r.eachComponent({mainType:n,query:e},function(a){e.sortInfo&&a.axis.setCategorySortInfo(e.sortInfo)})})}function pi(t,e,r,n,a){var i=t+e;r.isSilent(i)||n.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,c=a.selected,u=0;u<c.length;u++)if(c[u].seriesIndex===s){var f=o.getData(),h=oa(f,a.fromActionPayload);r.trigger(i,{type:i,seriesId:o.id,name:ee(h)?f.getName(h[0]):f.getName(h),selected:ne(l)?l:U({},l)})}})}function eA(t,e,r){t.on("selectchanged",function(n){var a=r.getModel();n.isFromClick?(pi("map","selectchanged",e,a,n),pi("pie","selectchanged",e,a,n)):n.fromAction==="select"?(pi("map","selected",e,a,n),pi("pie","selected",e,a,n)):n.fromAction==="unselect"&&(pi("map","unselected",e,a,n),pi("pie","unselected",e,a,n))})}function tA(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if(!n.defaultAttr.ignore){var a=n.label,i=a.getComputedTransform(),o=a.getBoundingRect(),s=!i||i[1]<1e-5&&i[2]<1e-5,l=a.style.margin||0,c=o.clone();c.applyTransform(i),c.x-=l/2,c.y-=l/2,c.width+=l,c.height+=l;var u=s?new _l(o,i):null;e.push({label:a,labelLine:n.labelLine,rect:c,localRect:o,obb:u,priority:n.priority,defaultAttr:n.defaultAttr,layoutOption:n.computedLayoutOption,axisAligned:s,transform:i})}}return e}function rA(t){var e=[];t.sort(function(m,g){return g.priority-m.priority});var r=new Fe(0,0,0,0);function n(m){if(!m.ignore){var g=m.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}m.ignore=!0}for(var a=0;a<t.length;a++){var i=t[a],o=i.axisAligned,s=i.localRect,l=i.transform,c=i.label,u=i.labelLine;r.copy(i.rect),r.width-=.1,r.height-=.1,r.x+=.05,r.y+=.05;for(var f=i.obb,h=!1,d=0;d<e.length;d++){var p=e[d];if(r.intersect(p.rect)){if(o&&p.axisAligned){h=!0;break}if(p.obb||(p.obb=new _l(p.localRect,p.transform)),f||(f=new _l(s,l)),f.intersect(p.obb)){h=!0;break}}}h?(n(c),u&&n(u)):(c.attr("ignore",i.defaultAttr.ignore),u&&u.attr("ignore",i.defaultAttr.labelGuideIgnore),e.push(i))}}var vi=(function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t})(),nA=(function(){function t(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(e){for(var r=e.target;r&&!r.draggable;)r=r.parent||r.__hostTarget;r&&(this._draggingTarget=r,r.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new vi(r,e),"dragstart",e.event))},t.prototype._drag=function(e){var r=this._draggingTarget;if(r){var n=e.offsetX,a=e.offsetY,i=n-this._x,o=a-this._y;this._x=n,this._y=a,r.drift(i,o,e),this.handler.dispatchToElement(new vi(r,e),"drag",e.event);var s=this.handler.findHover(n,a,r).target,l=this._dropTarget;this._dropTarget=s,r!==s&&(l&&s!==l&&this.handler.dispatchToElement(new vi(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new vi(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new vi(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new vi(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t})(),aA=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Rh=[],iA=ge.browser.firefox&&+ge.browser.version.split(".")[0]<39;function Eh(t,e,r,n){return r=r||{},n?_0(t,e,r):iA&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):_0(t,e,r),r}function _0(t,e,r){if(ge.domSupported&&t.getBoundingClientRect){var n=e.clientX,a=e.clientY;if(ey(t)){var i=t.getBoundingClientRect();r.zrX=n-i.left,r.zrY=a-i.top;return}else if(rh(Rh,t,n,a)){r.zrX=Rh[0],r.zrY=Rh[1];return}}r.zrX=r.zrY=0}function Oh(t){return t||window.event}function ir(t,e,r){if(e=Oh(e),e.zrX!=null)return e;var n=e.type,a=n&&n.indexOf("touch")>=0;if(a){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Eh(t,o,e,r)}else{Eh(t,e,e,r);var i=oA(e);e.zrDelta=i?i/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&aA.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function oA(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,n=t.deltaY;if(r==null||n==null)return e;var a=Math.abs(n!==0?n:r),i=n>0?-1:n<0?1:r>0?-1:1;return 3*a*i}function sA(t,e,r,n){t.addEventListener(e,r,n)}function lA(t,e,r,n){t.removeEventListener(e,r,n)}var ec=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function b0(t){return t.which===2||t.which===3}var cA=(function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,n){return this._doTrack(e,r,n),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,n){var a=e.touches;if(a){for(var i={points:[],touches:[],target:r,event:e},o=0,s=a.length;o<s;o++){var l=a[o],c=Eh(n,l,{});i.points.push([c.zrX,c.zrY]),i.touches.push(l)}this._track.push(i)}},t.prototype._recognize=function(e){for(var r in Nh)if(Nh.hasOwnProperty(r)){var n=Nh[r](this._track,e);if(n)return n}},t})();function x0(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function uA(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var Nh={pinch:function(t,e){var r=t.length;if(r){var n=(t[r-1]||{}).points,a=(t[r-2]||{}).points||n;if(a&&a.length>1&&n&&n.length>1){var i=x0(n)/x0(a);!isFinite(i)&&(i=1),e.pinchScale=i;var o=uA(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},w0="silent";function fA(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:hA}}function hA(){ec(this.event)}var dA=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.handler=null,r}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e})(ur),Mo=(function(){function t(e,r){this.x=e,this.y=r}return t})(),pA=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Bh=new Fe(0,0,0,0),S0=(function(t){Z(e,t);function e(r,n,a,i,o){var s=t.call(this)||this;return s._hovered=new Mo(0,0),s.storage=r,s.painter=n,s.painterRoot=i,s._pointerSize=o,a=a||new dA,s.proxy=null,s.setHandlerProxy(a),s._draggingMgr=new nA(s),s}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(D(pA,function(n){r.on&&r.on(n,this[n],this)},this),r.handler=this),this.proxy=r},e.prototype.mousemove=function(r){var n=r.zrX,a=r.zrY,i=T0(this,n,a),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=i?new Mo(n,a):this.findHover(n,a),c=l.target,u=this.proxy;u.setCursor&&u.setCursor(c?c.cursor:"default"),s&&c!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(l,"mousemove",r),c&&c!==s&&this.dispatchToElement(l,"mouseover",r)},e.prototype.mouseout=function(r){var n=r.zrEventControl;n!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),n!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},e.prototype.resize=function(){this._hovered=new Mo(0,0)},e.prototype.dispatch=function(r,n){var a=this[r];a&&a.call(this,n)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(r){var n=this.proxy;n.setCursor&&n.setCursor(r)},e.prototype.dispatchToElement=function(r,n,a){r=r||{};var i=r.target;if(!(i&&i.silent)){for(var o="on"+n,s=fA(n,r,a);i&&(i[o]&&(s.cancelBubble=!!i[o].call(i,s)),i.trigger(n,s),i=i.__hostTarget?i.__hostTarget:i.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(n,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(n,s)}))}},e.prototype.findHover=function(r,n,a){var i=this.storage.getDisplayList(),o=new Mo(r,n);if(k0(i,o,r,n,a),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,c=l/2,u=new Fe(r-c,n-c,l,l),f=i.length-1;f>=0;f--){var h=i[f];h!==a&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(Bh.copy(h.getBoundingRect()),h.transform&&Bh.applyTransform(h.transform),Bh.intersect(u)&&s.push(h))}if(s.length)for(var d=4,p=Math.PI/12,m=Math.PI*2,g=0;g<c;g+=d)for(var v=0;v<m;v+=p){var y=r+g*Math.cos(v),b=n+g*Math.sin(v);if(k0(s,o,y,b,a),o.target)return o}}return o},e.prototype.processGesture=function(r,n){this._gestureMgr||(this._gestureMgr=new cA);var a=this._gestureMgr;n==="start"&&a.clear();var i=a.recognize(r,this.findHover(r.zrX,r.zrY,null).target,this.proxy.dom);if(n==="end"&&a.clear(),i){var o=i.type;r.gestureEvent=o;var s=new Mo;s.target=i.target,this.dispatchToElement(s,o,i.event)}},e})(ur);D(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){S0.prototype[t]=function(e){var r=e.zrX,n=e.zrY,a=T0(this,r,n),i,o;if((t!=="mouseup"||!a)&&(i=this.findHover(r,n),o=i.target),t==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(t==="mouseup")this._upEl=o;else if(t==="click"){if(this._downEl!==this._upEl||!this._downPoint||uS(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}});function vA(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var n=t,a=void 0,i=!1;n;){if(n.ignoreClip&&(i=!0),!i){var o=n.getClipPath();if(o&&!o.contain(e,r))return!1}n.silent&&(a=!0);var s=n.__hostTarget;n=s||n.parent}return a?w0:!0}return!1}function k0(t,e,r,n,a){for(var i=t.length-1;i>=0;i--){var o=t[i],s=void 0;if(o!==a&&!o.ignore&&(s=vA(o,r,n))&&(!e.topTarget&&(e.topTarget=o),s!==w0)){e.target=o;break}}}function T0(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var C0=32,Ao=7;function gA(t){for(var e=0;t>=C0;)e|=t&1,t>>=1;return t+e}function M0(t,e,r,n){var a=e+1;if(a===r)return 1;if(n(t[a++],t[e])<0){for(;a<r&&n(t[a],t[a-1])<0;)a++;mA(t,e,a)}else for(;a<r&&n(t[a],t[a-1])>=0;)a++;return a-e}function mA(t,e,r){for(r--;e<r;){var n=t[e];t[e++]=t[r],t[r--]=n}}function A0(t,e,r,n,a){for(n===e&&n++;n<r;n++){for(var i=t[n],o=e,s=n,l;o<s;)l=o+s>>>1,a(i,t[l])<0?s=l:o=l+1;var c=n-o;switch(c){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;c>0;)t[o+c]=t[o+c-1],c--}t[o]=i}}function zh(t,e,r,n,a,i){var o=0,s=0,l=1;if(i(t,e[r+a])>0){for(s=n-a;l<s&&i(t,e[r+a+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}else{for(s=a+1;l<s&&i(t,e[r+a-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var c=o;o=a-l,l=a-c}for(o++;o<l;){var u=o+(l-o>>>1);i(t,e[r+u])>0?o=u+1:l=u}return l}function Fh(t,e,r,n,a,i){var o=0,s=0,l=1;if(i(t,e[r+a])<0){for(s=a+1;l<s&&i(t,e[r+a-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var c=o;o=a-l,l=a-c}else{for(s=n-a;l<s&&i(t,e[r+a+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}for(o++;o<l;){var u=o+(l-o>>>1);i(t,e[r+u])<0?l=u:o=u+1}return l}function yA(t,e){var r=Ao,n,a,i=0,o=[];n=[],a=[];function s(d,p){n[i]=d,a[i]=p,i+=1}function l(){for(;i>1;){var d=i-2;if(d>=1&&a[d-1]<=a[d]+a[d+1]||d>=2&&a[d-2]<=a[d]+a[d-1])a[d-1]<a[d+1]&&d--;else if(a[d]>a[d+1])break;u(d)}}function c(){for(;i>1;){var d=i-2;d>0&&a[d-1]<a[d+1]&&d--,u(d)}}function u(d){var p=n[d],m=a[d],g=n[d+1],v=a[d+1];a[d]=m+v,d===i-3&&(n[d+1]=n[d+2],a[d+1]=a[d+2]),i--;var y=Fh(t[g],t,p,m,0,e);p+=y,m-=y,m!==0&&(v=zh(t[p+m-1],t,g,v,v-1,e),v!==0&&(m<=v?f(p,m,g,v):h(p,m,g,v)))}function f(d,p,m,g){var v=0;for(v=0;v<p;v++)o[v]=t[d+v];var y=0,b=m,x=d;if(t[x++]=t[b++],--g===0){for(v=0;v<p;v++)t[x+v]=o[y+v];return}if(p===1){for(v=0;v<g;v++)t[x+v]=t[b+v];t[x+g]=o[y];return}for(var S=r,w,k,T;;){w=0,k=0,T=!1;do if(e(t[b],o[y])<0){if(t[x++]=t[b++],k++,w=0,--g===0){T=!0;break}}else if(t[x++]=o[y++],w++,k=0,--p===1){T=!0;break}while((w|k)<S);if(T)break;do{if(w=Fh(t[b],o,y,p,0,e),w!==0){for(v=0;v<w;v++)t[x+v]=o[y+v];if(x+=w,y+=w,p-=w,p<=1){T=!0;break}}if(t[x++]=t[b++],--g===0){T=!0;break}if(k=zh(o[y],t,b,g,0,e),k!==0){for(v=0;v<k;v++)t[x+v]=t[b+v];if(x+=k,b+=k,g-=k,g===0){T=!0;break}}if(t[x++]=o[y++],--p===1){T=!0;break}S--}while(w>=Ao||k>=Ao);if(T)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),p===1){for(v=0;v<g;v++)t[x+v]=t[b+v];t[x+g]=o[y]}else{if(p===0)throw new Error;for(v=0;v<p;v++)t[x+v]=o[y+v]}}function h(d,p,m,g){var v=0;for(v=0;v<g;v++)o[v]=t[m+v];var y=d+p-1,b=g-1,x=m+g-1,S=0,w=0;if(t[x--]=t[y--],--p===0){for(S=x-(g-1),v=0;v<g;v++)t[S+v]=o[v];return}if(g===1){for(x-=p,y-=p,w=x+1,S=y+1,v=p-1;v>=0;v--)t[w+v]=t[S+v];t[x]=o[b];return}for(var k=r;;){var T=0,C=0,A=!1;do if(e(o[b],t[y])<0){if(t[x--]=t[y--],T++,C=0,--p===0){A=!0;break}}else if(t[x--]=o[b--],C++,T=0,--g===1){A=!0;break}while((T|C)<k);if(A)break;do{if(T=p-Fh(o[b],t,d,p,p-1,e),T!==0){for(x-=T,y-=T,p-=T,w=x+1,S=y+1,v=T-1;v>=0;v--)t[w+v]=t[S+v];if(p===0){A=!0;break}}if(t[x--]=o[b--],--g===1){A=!0;break}if(C=g-zh(t[y],o,0,g,g-1,e),C!==0){for(x-=C,b-=C,g-=C,w=x+1,S=b+1,v=0;v<C;v++)t[w+v]=o[S+v];if(g<=1){A=!0;break}}if(t[x--]=t[y--],--p===0){A=!0;break}k--}while(T>=Ao||C>=Ao);if(A)break;k<0&&(k=0),k+=2}if(r=k,r<1&&(r=1),g===1){for(x-=p,y-=p,w=x+1,S=y+1,v=p-1;v>=0;v--)t[w+v]=t[S+v];t[x]=o[b]}else{if(g===0)throw new Error;for(S=x-(g-1),v=0;v<g;v++)t[S+v]=o[v]}}return{mergeRuns:l,forceMergeRuns:c,pushRun:s}}function tc(t,e,r,n){r||(r=0),n||(n=t.length);var a=n-r;if(!(a<2)){var i=0;if(a<C0){i=M0(t,r,n,e),A0(t,r,n,r+i,e);return}var o=yA(t,e),s=gA(a);do{if(i=M0(t,r,n,e),i<s){var l=a;l>s&&(l=s),A0(t,r,r+l,r+i,e),i=l}o.pushRun(r,i),o.mergeRuns(),a-=i,r+=i}while(a!==0);o.forceMergeRuns()}}var D0=!1;function Hh(){D0||(D0=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function I0(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var _A=(function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=I0}return t.prototype.traverse=function(e,r){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,r)},t.prototype.getDisplayList=function(e,r){r=r||!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(r),n},t.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var r=this._roots,n=this._displayList,a=0,i=r.length;a<i;a++)this._updateAndAddDisplayable(r[a],null,e);n.length=this._displayListLen,tc(n,I0)},t.prototype._updateAndAddDisplayable=function(e,r,n){if(!(e.ignore&&!n)){e.beforeUpdate(),e.update(),e.afterUpdate();var a=e.getClipPath();if(e.ignoreClip)r=null;else if(a){r?r=r.slice():r=[];for(var i=a,o=e;i;)i.parent=o,i.updateTransform(),r.push(i),o=i,i=i.getClipPath()}if(e.childrenRef){for(var s=e.childrenRef(),l=0;l<s.length;l++){var c=s[l];e.__dirty&&(c.__dirty|=Wt),this._updateAndAddDisplayable(c,r,n)}e.__dirty=0}else{var u=e;r&&r.length?u.__clipPaths=r:u.__clipPaths&&u.__clipPaths.length>0&&(u.__clipPaths=[]),isNaN(u.z)&&(Hh(),u.z=0),isNaN(u.z2)&&(Hh(),u.z2=0),isNaN(u.zlevel)&&(Hh(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,r,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,r,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,r,n)}},t.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},t.prototype.delRoot=function(e){if(e instanceof Array){for(var r=0,n=e.length;r<n;r++)this.delRoot(e[r]);return}var a=ze(this._roots,e);a>=0&&this._roots.splice(a,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t})(),rc;rc=ge.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};function gi(){return new Date().getTime()}var bA=(function(t){Z(e,t);function e(r){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(r){if(r.animation){var n=r.prev,a=r.next;n?n.next=a:this._head=a,a?a.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},e.prototype.update=function(r){for(var n=gi()-this._pausedTime,a=n-this._time,i=this._head;i;){var o=i.next,s=i.step(n,a);s&&(i.ondestroy(),this.removeClip(i)),i=o}this._time=n,r||(this.trigger("frame",a),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(rc(n),!r._paused&&r.update())}rc(n)},e.prototype.start=function(){this._running||(this._time=gi(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=gi(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=gi()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,n){n=n||{},this.start();var a=new Gu(r,n.loop);return this.addAnimator(a),a},e})(ur),xA=300,Vh=ge.domSupported,Gh=(function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=ue(t,function(a){var i=a.replace("mouse","pointer");return r.hasOwnProperty(i)?i:a});return{mouse:t,touch:e,pointer:n}})(),L0={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},P0=!1;function $h(t){var e=t.pointerType;return e==="pen"||e==="touch"}function wA(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function Wh(t){t&&(t.zrByTouch=!0)}function SA(t,e){return ir(t.dom,new kA(t,e),!0)}function R0(t,e){for(var r=e,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return n}var kA=(function(){function t(e,r){this.stopPropagation=Ct,this.stopImmediatePropagation=Ct,this.preventDefault=Ct,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t})(),pr={mousedown:function(t){t=ir(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=ir(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=ir(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=ir(this.dom,t);var e=t.toElement||t.relatedTarget;R0(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){P0=!0,t=ir(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){P0||(t=ir(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=ir(this.dom,t),Wh(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),pr.mousemove.call(this,t),pr.mousedown.call(this,t)},touchmove:function(t){t=ir(this.dom,t),Wh(t),this.handler.processGesture(t,"change"),pr.mousemove.call(this,t)},touchend:function(t){t=ir(this.dom,t),Wh(t),this.handler.processGesture(t,"end"),pr.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<xA&&pr.click.call(this,t)},pointerdown:function(t){pr.mousedown.call(this,t)},pointermove:function(t){$h(t)||pr.mousemove.call(this,t)},pointerup:function(t){pr.mouseup.call(this,t)},pointerout:function(t){$h(t)||pr.mouseout.call(this,t)}};D(["click","dblclick","contextmenu"],function(t){pr[t]=function(e){e=ir(this.dom,e),this.trigger(t,e)}});var Uh={pointermove:function(t){$h(t)||Uh.mousemove.call(this,t)},pointerup:function(t){Uh.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function TA(t,e){var r=e.domHandlers;ge.pointerEventsSupported?D(Gh.pointer,function(n){nc(e,n,function(a){r[n].call(t,a)})}):(ge.touchEventsSupported&&D(Gh.touch,function(n){nc(e,n,function(a){r[n].call(t,a),wA(e)})}),D(Gh.mouse,function(n){nc(e,n,function(a){a=Oh(a),e.touching||r[n].call(t,a)})}))}function CA(t,e){ge.pointerEventsSupported?D(L0.pointer,r):ge.touchEventsSupported||D(L0.mouse,r);function r(n){function a(i){i=Oh(i),R0(t,i.target)||(i=SA(t,i),e.domHandlers[n].call(t,i))}nc(e,n,a,{capture:!0})}}function nc(t,e,r,n){t.mounted[e]=r,t.listenerOpts[e]=n,sA(t.domTarget,e,r,n)}function Yh(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&lA(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var E0=(function(){function t(e,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=r}return t})(),MA=(function(t){Z(e,t);function e(r,n){var a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=r,a.painterRoot=n,a._localHandlerScope=new E0(r,pr),Vh&&(a._globalHandlerScope=new E0(document,Uh)),TA(a,a._localHandlerScope),a}return e.prototype.dispose=function(){Yh(this._localHandlerScope),Vh&&Yh(this._globalHandlerScope)},e.prototype.setCursor=function(r){this.dom.style&&(this.dom.style.cursor=r||"default")},e.prototype.__togglePointerCapture=function(r){if(this.__mayPointerCapture=null,Vh&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var n=this._globalHandlerScope;r?CA(this,n):Yh(n)}},e})(ur);var ac={},O0={};function AA(t){delete O0[t]}function DA(t){if(!t)return!1;if(typeof t=="string")return Vs(t,1)<$u;if(t.colorStops){for(var e=t.colorStops,r=0,n=e.length,a=0;a<n;a++)r+=Vs(e[a].color,1);return r/=n,r<$u}return!1}var IA=(function(){function t(e,r,n){var a=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=r,this.id=e;var i=new _A,o=n.renderer||"canvas";ac[o]||(o=Qe(ac)[0]),n.useDirtyRect=n.useDirtyRect==null?!1:n.useDirtyRect;var s=new ac[o](r,i,n,e),l=n.ssr||s.ssrOnly;this.storage=i,this.painter=s;var c=!ge.node&&!ge.worker&&!l?new MA(s.getViewportRoot(),s.root):null,u=n.useCoarsePointer,f=u==null||u==="auto"?ge.touchEventsSupported:!!u,h=44,d;f&&(d=Ce(n.pointerSize,h)),this.handler=new S0(i,s,c,s.root,d),this.animation=new bA({stage:{update:l?null:function(){return a._flush(!0)}}}),l||this.animation.start()}return t.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},t.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(e,r){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,r),this.refresh())},t.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=DA(e))},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(e){this._darkMode=e},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},t.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},t.prototype.flush=function(){this._disposed||this._flush(!1)},t.prototype._flush=function(e){var r,n=gi();this._needsRefresh&&(r=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(r=!0,this.refreshHoverImmediately());var a=gi();r?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:a-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},t.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){if(!this._disposed)return this.handler.findHover(e,r)},t.prototype.on=function(e,r,n){return this._disposed||this.handler.on(e,r,n),this},t.prototype.off=function(e,r){this._disposed||this.handler.off(e,r)},t.prototype.trigger=function(e,r){this._disposed||this.handler.trigger(e,r)},t.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),r=0;r<e.length;r++)e[r]instanceof mt&&e[r].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},t.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,AA(this.id))},t})();function N0(t,e){var r=new IA(lv(),t,e);return O0[r.id]=r,r}function LA(t,e){ac[t]=e}var B0="";typeof navigator<"u"&&(B0=navigator.platform||"");var mi="rgba(0, 0, 0, 0.2)";const PA={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:mi,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:mi,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:mi,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:mi,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:mi,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:mi,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:B0.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var RA=de();function EA(t,e,r){var n=RA.get(e);if(!n)return r;var a=n(t);return a?r.concat(a):r}var ic,Do,z0,F0="\0_ec_inner",OA=1,qh=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,a,i,o,s){i=i||{},this.option=null,this._theme=new et(i),this._locale=new et(o),this._optionManager=s},e.prototype.setOption=function(r,n,a){var i=G0(n);this._optionManager.setOption(r,a,i),this._resetOption(null,i)},e.prototype.resetOption=function(r,n){return this._resetOption(r,G0(n))},e.prototype._resetOption=function(r,n){var a=!1,i=this._optionManager;if(!r||r==="recreate"){var o=i.mountOption(r==="recreate");!this.option||r==="recreate"?z0(this,o):(this.restoreData(),this._mergeOption(o,n)),a=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=i.getTimelineOption(this);s&&(a=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=i.getMediaOption(this);l.length&&D(l,function(c){a=!0,this._mergeOption(c,n)},this)}return a},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,n){var a=this.option,i=this._componentsMap,o=this._componentsCount,s=[],l=de(),c=n&&n.replaceMergeMainTypeMap;i2(this),D(r,function(f,h){f!=null&&(We.hasClass(h)?h&&(s.push(h),l.set(h,!0)):a[h]=a[h]==null?Te(f):De(a[h],f,!0))}),c&&c.each(function(f,h){We.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),We.topologicalTravel(s,We.getAllClassMainTypes(),u,this);function u(f){var h=EA(this,f,_t(r[f])),d=i.get(f),p=d?c&&c.get(f)?"replaceMerge":"normalMerge":"replaceAll",m=xk(d,h,p);Ak(m,f,We),a[f]=null,i.set(f,null),o.set(f,0);var g=[],v=[],y=0,b;D(m,function(x,S){var w=x.existing,k=x.newOption;if(!k)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var T=f==="series",C=We.getClass(f,x.keyInfo.subType,!T);if(!C)return;if(f==="tooltip"){if(b)return;b=!0}if(w&&w.constructor===C)w.name=x.keyInfo.name,w.mergeOption(k,this),w.optionUpdated(k,!1);else{var A=U({componentIndex:S},x.keyInfo);w=new C(k,this,this,A),U(w,A),x.brandNew&&(w.__requireNewView=!0),w.init(k,this,this),w.optionUpdated(null,!0)}}w?(g.push(w.option),v.push(w),y++):(g.push(void 0),v.push(void 0))},this),a[f]=g,i.set(f,v),o.set(f,y),f==="series"&&ic(this)}this._seriesIndices||ic(this)},e.prototype.getOption=function(){var r=Te(this.option);return D(r,function(n,a){if(We.hasClass(a)){for(var i=_t(n),o=i.length,s=!1,l=o-1;l>=0;l--)i[l]&&!io(i[l])?s=!0:(i[l]=null,!s&&o--);i.length=o,r[a]=i}}),delete r[F0],r},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,n){var a=this._componentsMap.get(r);if(a){var i=a[n||0];if(i)return i;if(n==null){for(var o=0;o<a.length;o++)if(a[o])return a[o]}}},e.prototype.queryComponents=function(r){var n=r.mainType;if(!n)return[];var a=r.index,i=r.id,o=r.name,s=this._componentsMap.get(n);if(!s||!s.length)return[];var l;return a!=null?(l=[],D(_t(a),function(c){s[c]&&l.push(s[c])})):i!=null?l=H0("id",i,s):o!=null?l=H0("name",o,s):l=dt(s,function(c){return!!c}),V0(l,r)},e.prototype.findComponents=function(r){var n=r.query,a=r.mainType,i=s(n),o=i?this.queryComponents(i):dt(this._componentsMap.get(a),function(c){return!!c});return l(V0(o,r));function s(c){var u=a+"Index",f=a+"Id",h=a+"Name";return c&&(c[u]!=null||c[f]!=null||c[h]!=null)?{mainType:a,index:c[u],id:c[f],name:c[h]}:null}function l(c){return r.filter?dt(c,r.filter):c}},e.prototype.eachComponent=function(r,n,a){var i=this._componentsMap;if(ye(r)){var o=n,s=r;i.each(function(f,h){for(var d=0;f&&d<f.length;d++){var p=f[d];p&&s.call(o,h,p,p.componentIndex)}})}else for(var l=ne(r)?i.get(r):ce(r)?this.findComponents(r):null,c=0;l&&c<l.length;c++){var u=l[c];u&&n.call(a,u,u.componentIndex)}},e.prototype.getSeriesByName=function(r){var n=Rr(r,null);return dt(this._componentsMap.get("series"),function(a){return!!a&&n!=null&&a.name===n})},e.prototype.getSeriesByIndex=function(r){return this._componentsMap.get("series")[r]},e.prototype.getSeriesByType=function(r){return dt(this._componentsMap.get("series"),function(n){return!!n&&n.subType===r})},e.prototype.getSeries=function(){return dt(this._componentsMap.get("series"),function(r){return!!r})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(r,n){Do(this),D(this._seriesIndices,function(a){var i=this._componentsMap.get("series")[a];r.call(n,i,a)},this)},e.prototype.eachRawSeries=function(r,n){D(this._componentsMap.get("series"),function(a){a&&r.call(n,a,a.componentIndex)})},e.prototype.eachSeriesByType=function(r,n,a){Do(this),D(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];o.subType===r&&n.call(a,o,i)},this)},e.prototype.eachRawSeriesByType=function(r,n,a){return D(this.getSeriesByType(r),n,a)},e.prototype.isSeriesFiltered=function(r){return Do(this),this._seriesIndicesMap.get(r.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(r,n){Do(this);var a=[];D(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];r.call(n,o,i)&&a.push(i)},this),this._seriesIndices=a,this._seriesIndicesMap=de(a)},e.prototype.restoreData=function(r){ic(this);var n=this._componentsMap,a=[];n.each(function(i,o){We.hasClass(o)&&a.push(o)}),We.topologicalTravel(a,We.getAllClassMainTypes(),function(i){D(n.get(i),function(o){o&&(i!=="series"||!NA(o,r))&&o.restoreData()})})},e.internalField=(function(){ic=function(r){var n=r._seriesIndices=[];D(r._componentsMap.get("series"),function(a){a&&n.push(a.componentIndex)}),r._seriesIndicesMap=de(n)},Do=function(r){},z0=function(r,n){r.option={},r.option[F0]=OA,r._componentsMap=de({series:[]}),r._componentsCount=de();var a=n.aria;ce(a)&&a.enabled==null&&(a.enabled=!0),BA(n,r._theme.option),De(n,PA,!1),r._mergeOption(n,null)}})(),e})(et);function NA(t,e){if(e){var r=e.seriesIndex,n=e.seriesId,a=e.seriesName;return r!=null&&t.componentIndex!==r||n!=null&&t.id!==n||a!=null&&t.name!==a}}function BA(t,e){var r=t.color&&!t.colorLayer;D(e,function(n,a){a==="colorLayer"&&r||We.hasClass(a)||(typeof n=="object"?t[a]=t[a]?De(t[a],n,!1):Te(n):t[a]==null&&(t[a]=n))})}function H0(t,e,r){if(ee(e)){var n=de();return D(e,function(i){if(i!=null){var o=Rr(i,null);o!=null&&n.set(i,!0)}}),dt(r,function(i){return i&&n.get(i[t])})}else{var a=Rr(e,null);return dt(r,function(i){return i&&a!=null&&i[t]===a})}}function V0(t,e){return e.hasOwnProperty("subType")?dt(t,function(r){return r&&r.subType===e.subType}):t}function G0(t){var e=de();return t&&D(_t(t.replaceMerge),function(r){e.set(r,!0)}),{replaceMergeMainTypeMap:e}}Cr(qh,hh);var zA=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],$0=(function(){function t(e){D(zA,function(r){this[r]=Le(e[r],e)},this)}return t})(),FA=/^(min|max)?(.+)$/,HA=(function(){function t(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return t.prototype.setOption=function(e,r,n){e&&(D(_t(e.series),function(o){o&&o.data&&It(o.data)&&yu(o.data)}),D(_t(e.dataset),function(o){o&&o.source&&It(o.source)&&yu(o.source)})),e=Te(e);var a=this._optionBackup,i=VA(e,r,!a);this._newBaseOption=i.baseOption,a?(i.timelineOptions.length&&(a.timelineOptions=i.timelineOptions),i.mediaList.length&&(a.mediaList=i.mediaList),i.mediaDefault&&(a.mediaDefault=i.mediaDefault)):this._optionBackup=i},t.prototype.mountOption=function(e){var r=this._optionBackup;return this._timelineOptions=r.timelineOptions,this._mediaList=r.mediaList,this._mediaDefault=r.mediaDefault,this._currentMediaIndices=[],Te(e?r.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(e){var r,n=this._timelineOptions;if(n.length){var a=e.getComponent("timeline");a&&(r=Te(n[a.getCurrentIndex()]))}return r},t.prototype.getMediaOption=function(e){var r=this._api.getWidth(),n=this._api.getHeight(),a=this._mediaList,i=this._mediaDefault,o=[],s=[];if(!a.length&&!i)return s;for(var l=0,c=a.length;l<c;l++)GA(a[l].query,r,n)&&o.push(l);return!o.length&&i&&(o=[-1]),o.length&&!WA(o,this._currentMediaIndices)&&(s=ue(o,function(u){return Te(u===-1?i.option:a[u].option)})),this._currentMediaIndices=o,s},t})();function VA(t,e,r){var n=[],a,i,o=t.baseOption,s=t.timeline,l=t.options,c=t.media,u=!!t.media,f=!!(l||s||o&&o.timeline);o?(i=o,i.timeline||(i.timeline=s)):((f||u)&&(t.options=t.media=null),i=t),u&&ee(c)&&D(c,function(d){d&&d.option&&(d.query?n.push(d):a||(a=d))}),h(i),D(l,function(d){return h(d)}),D(n,function(d){return h(d.option)});function h(d){D(e,function(p){p(d,r)})}return{baseOption:i,timelineOptions:l||[],mediaDefault:a,mediaList:n}}function GA(t,e,r){var n={width:e,height:r,aspectratio:e/r},a=!0;return D(t,function(i,o){var s=o.match(FA);if(!(!s||!s[1]||!s[2])){var l=s[1],c=s[2].toLowerCase();$A(n[c],i,l)||(a=!1)}}),a}function $A(t,e,r){return r==="min"?t>=e:r==="max"?t<=e:t===e}function WA(t,e){return t.join(",")===e.join(",")}var vr=D,Io=ce,W0=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Xh(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=W0.length;r<n;r++){var a=W0[r],i=e.normal,o=e.emphasis;i&&i[a]&&(t[a]=t[a]||{},t[a].normal?De(t[a].normal,i[a]):t[a].normal=i[a],i[a]=null),o&&o[a]&&(t[a]=t[a]||{},t[a].emphasis?De(t[a].emphasis,o[a]):t[a].emphasis=o[a],o[a]=null)}}function xt(t,e,r){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var n=t[e].normal,a=t[e].emphasis;n&&(r?(t[e].normal=t[e].emphasis=null,Ne(t[e],n)):t[e]=n),a&&(t.emphasis=t.emphasis||{},t.emphasis[e]=a,a.focus&&(t.emphasis.focus=a.focus),a.blurScope&&(t.emphasis.blurScope=a.blurScope))}}function Lo(t){xt(t,"itemStyle"),xt(t,"lineStyle"),xt(t,"areaStyle"),xt(t,"label"),xt(t,"labelLine"),xt(t,"upperLabel"),xt(t,"edgeLabel")}function ot(t,e){var r=Io(t)&&t[e],n=Io(r)&&r.textStyle;if(n)for(var a=0,i=Sg.length;a<i;a++){var o=Sg[a];n.hasOwnProperty(o)&&(r[o]=n[o])}}function or(t){t&&(Lo(t),ot(t,"label"),t.emphasis&&ot(t.emphasis,"label"))}function UA(t){if(Io(t)){Xh(t),Lo(t),ot(t,"label"),ot(t,"upperLabel"),ot(t,"edgeLabel"),t.emphasis&&(ot(t.emphasis,"label"),ot(t.emphasis,"upperLabel"),ot(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Xh(e),or(e));var r=t.markLine;r&&(Xh(r),or(r));var n=t.markArea;n&&or(n);var a=t.data;if(t.type==="graph"){a=a||t.nodes;var i=t.links||t.edges;if(i&&!It(i))for(var o=0;o<i.length;o++)or(i[o]);D(t.categories,function(c){Lo(c)})}if(a&&!It(a))for(var o=0;o<a.length;o++)or(a[o]);if(e=t.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)or(s[o]);if(r=t.markLine,r&&r.data)for(var l=r.data,o=0;o<l.length;o++)ee(l[o])?(or(l[o][0]),or(l[o][1])):or(l[o]);t.type==="gauge"?(ot(t,"axisLabel"),ot(t,"title"),ot(t,"detail")):t.type==="treemap"?(xt(t.breadcrumb,"itemStyle"),D(t.levels,function(c){Lo(c)})):t.type==="tree"&&Lo(t.leaves)}}function rn(t){return ee(t)?t:t?[t]:[]}function U0(t){return(ee(t)?t[0]:t)||{}}function YA(t,e){vr(rn(t.series),function(n){Io(n)&&UA(n)});var r=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&r.push("valueAxis","categoryAxis","logAxis","timeAxis"),vr(r,function(n){vr(rn(t[n]),function(a){a&&(ot(a,"axisLabel"),ot(a.axisPointer,"label"))})}),vr(rn(t.parallel),function(n){var a=n&&n.parallelAxisDefault;ot(a,"axisLabel"),ot(a&&a.axisPointer,"label")}),vr(rn(t.calendar),function(n){xt(n,"itemStyle"),ot(n,"dayLabel"),ot(n,"monthLabel"),ot(n,"yearLabel")}),vr(rn(t.radar),function(n){ot(n,"name"),n.name&&n.axisName==null&&(n.axisName=n.name,delete n.name),n.nameGap!=null&&n.axisNameGap==null&&(n.axisNameGap=n.nameGap,delete n.nameGap)}),vr(rn(t.geo),function(n){Io(n)&&(or(n),vr(rn(n.regions),function(a){or(a)}))}),vr(rn(t.timeline),function(n){or(n),xt(n,"label"),xt(n,"itemStyle"),xt(n,"controlStyle",!0);var a=n.data;ee(a)&&D(a,function(i){ce(i)&&(xt(i,"label"),xt(i,"itemStyle"))})}),vr(rn(t.toolbox),function(n){xt(n,"iconStyle"),vr(n.feature,function(a){xt(a,"iconStyle")})}),ot(U0(t.axisPointer),"label"),ot(U0(t.tooltip).axisPointer,"label")}function qA(t,e){for(var r=e.split(","),n=t,a=0;a<r.length&&(n=n&&n[r[a]],n!=null);a++);return n}function XA(t,e,r,n){for(var a=e.split(","),i=t,o,s=0;s<a.length-1;s++)o=a[s],i[o]==null&&(i[o]={}),i=i[o];i[a[s]]==null&&(i[a[s]]=r)}function Y0(t){t&&D(ZA,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var ZA=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],KA=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Zh=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Po(t){var e=t&&t.itemStyle;if(e)for(var r=0;r<Zh.length;r++){var n=Zh[r][1],a=Zh[r][0];e[n]!=null&&(e[a]=e[n])}}function q0(t){t&&t.alignTo==="edge"&&t.margin!=null&&t.edgeDistance==null&&(t.edgeDistance=t.margin)}function X0(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function jA(t){t&&t.focusNodeAdjacency!=null&&(t.emphasis=t.emphasis||{},t.emphasis.focus==null&&(t.emphasis.focus="adjacency"))}function Z0(t,e){if(t)for(var r=0;r<t.length;r++)e(t[r]),t[r]&&Z0(t[r].children,e)}function K0(t,e){YA(t,e),t.series=_t(t.series),D(t.series,function(r){if(ce(r)){var n=r.type;if(n==="line")r.clipOverflow!=null&&(r.clip=r.clipOverflow);else if(n==="pie"||n==="gauge"){r.clockWise!=null&&(r.clockwise=r.clockWise),q0(r.label);var a=r.data;if(a&&!It(a))for(var i=0;i<a.length;i++)q0(a[i]);r.hoverOffset!=null&&(r.emphasis=r.emphasis||{},(r.emphasis.scaleSize=null)&&(r.emphasis.scaleSize=r.hoverOffset))}else if(n==="gauge"){var o=qA(r,"pointer.color");o!=null&&XA(r,"itemStyle.color",o)}else if(n==="bar"){Po(r),Po(r.backgroundStyle),Po(r.emphasis);var a=r.data;if(a&&!It(a))for(var i=0;i<a.length;i++)typeof a[i]=="object"&&(Po(a[i]),Po(a[i]&&a[i].emphasis))}else if(n==="sunburst"){var s=r.highlightPolicy;s&&(r.emphasis=r.emphasis||{},r.emphasis.focus||(r.emphasis.focus=s)),X0(r),Z0(r.data,X0)}else n==="graph"||n==="sankey"?jA(r):n==="map"&&(r.mapType&&!r.map&&(r.map=r.mapType),r.mapLocation&&Ne(r,r.mapLocation));r.hoverAnimation!=null&&(r.emphasis=r.emphasis||{},r.emphasis&&r.emphasis.scale==null&&(r.emphasis.scale=r.hoverAnimation)),Y0(r)}}),t.dataRange&&(t.visualMap=t.dataRange),D(KA,function(r){var n=t[r];n&&(ee(n)||(n=[n]),D(n,function(a){Y0(a)}))})}function QA(t){var e=de();t.eachSeries(function(r){var n=r.get("stack");if(n){var a=e.get(n)||e.set(n,[]),i=r.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:r};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;a.length&&i.setCalculationInfo("stackedOnSeries",a[a.length-1].seriesModel),a.push(o)}}),e.each(JA)}function JA(t){D(t,function(e,r){var n=[],a=[NaN,NaN],i=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(i,function(c,u,f){var h=o.get(e.stackedDimension,f);if(isNaN(h))return a;var d,p;s?p=o.getRawIndex(f):d=o.get(e.stackedByDimension,f);for(var m=NaN,g=r-1;g>=0;g--){var v=t[g];if(s||(p=v.data.rawIndexOf(v.stackedByDimension,d)),p>=0){var y=v.data.getByRawIndex(v.stackResultDimension,p);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&h>=0&&y>0||l==="samesign"&&h<=0&&y<0){h=vk(h,y),m=y;break}}}return n[0]=h,n[1]=m,n})})}var gr=(function(){function t(){this.group=new mt,this.uid=El("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,a){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,a){},t.prototype.updateLayout=function(e,r,n,a){},t.prototype.updateVisual=function(e,r,n,a){},t.prototype.toggleBlurSeries=function(e,r,n){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t})();_u(gr),Ms(gr);var j0=it(),Q0={itemStyle:$i(xm,!0),lineStyle:$i(bm,!0)},eD={lineStyle:"stroke",itemStyle:"fill"};function J0(t,e){var r=t.visualStyleMapper||Q0[e];return r||(console.warn("Unknown style type '"+e+"'."),Q0.itemStyle)}function e_(t,e){var r=t.visualDrawType||eD[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var tD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=t.getModel(n),i=J0(t,n),o=i(a),s=a.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=e_(t,n),c=o[l],u=ye(c)?c:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||u||f){var h=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=h,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ye(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||ye(o.stroke)?h:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&u)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var m=t.getDataParams(p),g=U({},o);g[l]=u(m),d.setItemVisual(p,"style",g)}}}},Ro=new et,rD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=J0(t,n),i=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Ro.option=l[n];var c=a(Ro),u=o.ensureUniqueItemVisual(s,"style");U(u,c),Ro.option.decal&&(o.setItemVisual(s,"decal",Ro.option.decal),Ro.option.decal.dirty=!0),i in c&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},nD={performRawSeries:!0,overallReset:function(t){var e=de();t.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var a=r.type+"-"+n,i=e.get(a);i||(i={},e.set(a,i)),j0(r).scope=i}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var n=r.getRawData(),a={},i=r.getData(),o=j0(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=e_(r,s);i.each(function(c){var u=i.getRawIndex(c);a[u]=c}),n.each(function(c){var u=a[c],f=i.getItemVisual(u,"colorFromPalette");if(f){var h=i.ensureUniqueItemVisual(u,"style"),d=n.getName(c)||c+"",p=n.count();h[l]=r.getColorFromPalette(d,o,p)}})}})}},oc=Math.PI;function aD(t,e){e=e||{},Ne(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var r=new mt,n=new ft({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var a=new Pt({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),i=new ft({style:{fill:"none"},textContent:a,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(i);var o;return e.showSpinner&&(o=new gl({shape:{startAngle:-oc/2,endAngle:-oc/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:oc*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:oc*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=a.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,c=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:c,cy:u}),i.setShape({x:c-l,y:u-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var t_=(function(){function t(e,r,n,a){this._stageTaskMap=de(),this.ecInstance=e,this.api=r,n=this._dataProcessorHandlers=n.slice(),a=this._visualHandlers=a.slice(),this._allHandlers=n.concat(a)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(n){var a=n.overallTask;a&&a.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),a=n.context,i=!r&&n.progressiveEnabled&&(!a||a.progressiveRender)&&e.__idxInPipeline>n.blockIndex,o=i?n.step:null,s=a&&a.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var n=this._pipelineMap.get(e.uid),a=e.getData(),i=a.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&i>=n.threshold,s=e.get("large")&&i>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?i:null;e.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},t.prototype.restorePipelines=function(e){var r=this,n=r._pipelineMap=de();e.eachSeries(function(a){var i=a.getProgressive(),o=a.uid;n.set(o,{id:o,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:i&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),r._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;D(this._allHandlers,function(a){var i=e.get(a.uid)||e.set(a.uid,{}),o="";Ur(!(a.reset&&a.overallReset),o),a.reset&&this._createSeriesStageTask(a,i,r,n),a.overallReset&&this._createOverallStageTask(a,i,r,n)},this)},t.prototype.prepareView=function(e,r,n,a){var i=e.renderTask,o=i.context;o.model=r,o.ecModel=n,o.api=a,i.__block=!e.incrementalPrepareRender,this._pipe(r,i)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,n){this._performStageTasks(this._visualHandlers,e,r,n)},t.prototype._performStageTasks=function(e,r,n,a){a=a||{};var i=!1,o=this;D(e,function(l,c){if(!(a.visualType&&a.visualType!==l.visualType)){var u=o._stageTaskMap.get(l.uid),f=u.seriesTaskMap,h=u.overallTask;if(h){var d,p=h.agentStubMap;p.each(function(g){s(a,g)&&(g.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var m=o.getPerformArgs(h,a.block);p.each(function(g){g.perform(m)}),h.perform(m)&&(i=!0)}else f&&f.each(function(g,v){s(a,g)&&g.dirty();var y=o.getPerformArgs(g,a.block);y.skip=!l.performRawSeries&&r.isSeriesFiltered(g.context.model),o.updatePayload(g,n),g.perform(y)&&(i=!0)})}});function s(l,c){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(c.__pipeline.id))}this.unfinished=i||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,n,a){var i=this,o=r.seriesTaskMap,s=r.seriesTaskMap=de(),l=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(u):l?n.eachRawSeriesByType(l,u):c&&c(n,a).each(u);function u(f){var h=f.uid,d=s.set(h,o&&o.get(h)||To({plan:cD,reset:uD,count:hD}));d.context={model:f,ecModel:n,api:a,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(f,d)}},t.prototype._createOverallStageTask=function(e,r,n,a){var i=this,o=r.overallTask=r.overallTask||To({reset:iD});o.context={ecModel:n,api:a,overallReset:e.overallReset,scheduler:i};var s=o.agentStubMap,l=o.agentStubMap=de(),c=e.seriesType,u=e.getTargetSeries,f=!0,h=!1,d="";Ur(!e.createOnAllSeries,d),c?n.eachRawSeriesByType(c,p):u?u(n,a).each(p):(f=!1,D(n.getSeries(),p));function p(m){var g=m.uid,v=l.set(g,s&&s.get(g)||(h=!0,To({reset:oD,onDirty:lD})));v.context={model:m,overallProgress:f},v.agent=o,v.__block=f,i._pipe(m,v)}h&&o.dirty()},t.prototype._pipe=function(e,r){var n=e.uid,a=this._pipelineMap.get(n);!a.head&&(a.head=r),a.tail&&a.tail.pipe(r),a.tail=r,r.__idxInPipeline=a.count++,r.__pipeline=a},t.wrapStageHandler=function(e,r){return ye(e)&&(e={overallReset:e,seriesType:dD(e)}),e.uid=El("stageHandler"),r&&(e.visualType=r),e},t})();function iD(t){t.overallReset(t.ecModel,t.api,t.payload)}function oD(t){return t.overallProgress&&sD}function sD(){this.agent.dirty(),this.getDownstream().dirty()}function lD(){this.agent&&this.agent.dirty()}function cD(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function uD(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=_t(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?ue(e,function(r,n){return r_(n)}):fD}var fD=r_(0);function r_(t){return function(e,r){var n=r.data,a=r.resetDefines[t];if(a&&a.dataEach)for(var i=e.start;i<e.end;i++)a.dataEach(n,i);else a&&a.progress&&a.progress(e,n)}}function hD(t){return t.data.count()}function dD(t){sc=null;try{t(Eo,n_)}catch{}return sc}var Eo={},n_={},sc;a_(Eo,qh),a_(n_,$0),Eo.eachSeriesByType=Eo.eachRawSeriesByType=function(t){sc=t},Eo.eachComponent=function(t){t.mainType==="series"&&t.subType&&(sc=t.subType)};function a_(t,e){for(var r in e.prototype)t[r]=Ct}var i_=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const pD={color:i_,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],i_]};var wt="#B9B8CE",o_="#100C2A",lc=function(){return{axisLine:{lineStyle:{color:wt}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},s_=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],l_={darkMode:!0,color:s_,backgroundColor:o_,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:wt},pageTextStyle:{color:wt}},textStyle:{color:wt},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:wt}},dataZoom:{borderColor:"#71708A",textStyle:{color:wt},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:wt}},timeline:{lineStyle:{color:wt},label:{color:wt},controlStyle:{color:wt,borderColor:wt}},calendar:{itemStyle:{color:o_},dayLabel:{color:wt},monthLabel:{color:wt},yearLabel:{color:wt}},timeAxis:lc(),logAxis:lc(),valueAxis:lc(),categoryAxis:lc(),line:{symbol:"circle"},graph:{color:s_},gauge:{title:{color:wt},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:wt},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};l_.categoryAxis.splitLine.show=!1;var vD=(function(){function t(){}return t.prototype.normalizeQuery=function(e){var r={},n={},a={};if(ne(e)){var i=Ar(e);r.mainType=i.main||null,r.subType=i.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};D(e,function(l,c){for(var u=!1,f=0;f<o.length;f++){var h=o[f],d=c.lastIndexOf(h);if(d>0&&d===c.length-h.length){var p=c.slice(0,d);p!=="data"&&(r.mainType=p,r[h.toLowerCase()]=l,u=!0)}}s.hasOwnProperty(c)&&(n[c]=l,u=!0),u||(a[c]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:a}},t.prototype.filter=function(e,r){var n=this.eventInfo;if(!n)return!0;var a=n.targetEl,i=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,c=r.dataQuery;return u(l,o,"mainType")&&u(l,o,"subType")&&u(l,o,"index","componentIndex")&&u(l,o,"name")&&u(l,o,"id")&&u(c,i,"name")&&u(c,i,"dataIndex")&&u(c,i,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,a,i));function u(f,h,d,p){return f[d]==null||h[p||d]===f[d]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t})(),Kh=["symbol","symbolSize","symbolRotate","symbolOffset"],c_=Kh.concat(["symbolKeepAspect"]),gD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var n={},a={},i=!1,o=0;o<Kh.length;o++){var s=Kh[o],l=t.get(s);ye(l)?(i=!0,a[s]=l):n[s]=l}if(n.symbol=n.symbol||t.defaultSymbol,r.setVisual(U({legendIcon:t.legendIcon||n.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},n)),e.isSeriesFiltered(t))return;var c=Qe(a);function u(f,h){for(var d=t.getRawValue(h),p=t.getDataParams(h),m=0;m<c.length;m++){var g=c[m];f.setItemVisual(h,g,a[g](d,p))}}return{dataEach:i?u:null}}},mD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.hasSymbolVisual||e.isSeriesFiltered(t))return;var r=t.getData();function n(a,i){for(var o=a.getItemModel(i),s=0;s<c_.length;s++){var l=c_[s],c=o.getShallow(l,!0);c!=null&&a.setItemVisual(i,l,c)}}return{dataEach:r.hasItemOption?n:null}}};function yD(t,e,r){switch(r){case"color":var n=t.getItemVisual(e,"style");return n[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,r)}}function _D(t,e){switch(e){case"color":var r=t.getVisual("style");return r[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function Oo(t,e,r){for(var n;t&&!(e(t)&&(n=t,r));)t=t.__hostTarget||t.parent;return n}var bD=Math.round(Math.random()*9),xD=typeof Object.defineProperty=="function",wD=(function(){function t(){this._id="__ec_inner_"+bD++}return t.prototype.get=function(e){return this._guard(e)[this._id]},t.prototype.set=function(e,r){var n=this._guard(e);return xD?Object.defineProperty(n,this._id,{value:r,enumerable:!1,configurable:!0}):n[this._id]=r,this},t.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},t.prototype.has=function(e){return!!this._guard(e)[this._id]},t.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},t})();function ga(t){return isFinite(t)}function SD(t,e,r){var n=e.x==null?0:e.x,a=e.x2==null?1:e.x2,i=e.y==null?0:e.y,o=e.y2==null?0:e.y2;e.global||(n=n*r.width+r.x,a=a*r.width+r.x,i=i*r.height+r.y,o=o*r.height+r.y),n=ga(n)?n:0,a=ga(a)?a:1,i=ga(i)?i:0,o=ga(o)?o:0;var s=t.createLinearGradient(n,i,a,o);return s}function kD(t,e,r){var n=r.width,a=r.height,i=Math.min(n,a),o=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(o=o*n+r.x,s=s*a+r.y,l=l*i),o=ga(o)?o:.5,s=ga(s)?s:.5,l=l>=0&&ga(l)?l:.5;var c=t.createRadialGradient(o,s,0,o,s,l);return c}function jh(t,e,r){for(var n=e.type==="radial"?kD(t,e,r):SD(t,e,r),a=e.colorStops,i=0;i<a.length;i++)n.addColorStop(a[i].offset,a[i].color);return n}function TD(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!0;return!1}function cc(t){return parseInt(t,10)}function uc(t,e,r){var n=["width","height"][e],a=["clientWidth","clientHeight"][e],i=["paddingLeft","paddingTop"][e],o=["paddingRight","paddingBottom"][e];if(r[n]!=null&&r[n]!=="auto")return parseFloat(r[n]);var s=document.defaultView.getComputedStyle(t);return(t[a]||cc(s[n])||cc(t.style[n]))-(cc(s[i])||0)-(cc(s[o])||0)|0}function CD(t,e){return!t||t==="solid"||!(e>0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:Ke(t)?[t]:ee(t)?t:null}function u_(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&CD(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(r){var a=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&a!==1&&(r=ue(r,function(i){return i/a}),n/=a)}return[r,n]}var MD=new ta(!0);function fc(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function f_(t){return typeof t=="string"&&t!=="none"}function hc(t){var e=t.fill;return e!=null&&e!=="none"}function h_(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function d_(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function Qh(t,e,r){var n=mv(e.image,e.__image,r);if(As(n)){var a=t.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&a&&a.setTransform){var i=new DOMMatrix;i.translateSelf(e.x||0,e.y||0),i.rotateSelf(0,0,(e.rotation||0)*Lw),i.scaleSelf(e.scaleX||1,e.scaleY||1),a.setTransform(i)}return a}}function AD(t,e,r,n){var a,i=fc(r),o=hc(r),s=r.strokePercent,l=s<1,c=!e.path;(!e.silent||l)&&c&&e.createPathProxy();var u=e.path||MD,f=e.__dirty;if(!n){var h=r.fill,d=r.stroke,p=o&&!!h.colorStops,m=i&&!!d.colorStops,g=o&&!!h.image,v=i&&!!d.image,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0;(p||m)&&(w=e.getBoundingRect()),p&&(y=f?jh(t,h,w):e.__canvasFillGradient,e.__canvasFillGradient=y),m&&(b=f?jh(t,d,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=b),g&&(x=f||!e.__canvasFillPattern?Qh(t,h,e):e.__canvasFillPattern,e.__canvasFillPattern=x),v&&(S=f||!e.__canvasStrokePattern?Qh(t,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),p?t.fillStyle=y:g&&(x?t.fillStyle=x:o=!1),m?t.strokeStyle=b:v&&(S?t.strokeStyle=S:i=!1)}var k=e.getGlobalScale();u.setScale(k[0],k[1],e.segmentIgnoreThreshold);var T,C;t.setLineDash&&r.lineDash&&(a=u_(e),T=a[0],C=a[1]);var A=!0;(c||f&Xa)&&(u.setDPR(t.dpr),l?u.setContext(null):(u.setContext(t),A=!1),u.reset(),e.buildPath(u,e.shape,n),u.toStatic(),e.pathUpdated()),A&&u.rebuildPath(t,l?s:1),T&&(t.setLineDash(T),t.lineDashOffset=C),n||(r.strokeFirst?(i&&d_(t,r),o&&h_(t,r)):(o&&h_(t,r),i&&d_(t,r))),T&&t.setLineDash([])}function DD(t,e,r){var n=e.__image=mv(r.image,e.__image,e,e.onload);if(!(!n||!As(n))){var a=r.x||0,i=r.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var c=r.sx||0,u=r.sy||0;t.drawImage(n,c,u,r.sWidth,r.sHeight,a,i,o,s)}else if(r.sx&&r.sy){var c=r.sx,u=r.sy,f=o-c,h=s-u;t.drawImage(n,c,u,f,h,a,i,o,s)}else t.drawImage(n,a,i,o,s)}}function ID(t,e,r){var n,a=r.text;if(a!=null&&(a+=""),a){t.font=r.font||Hn,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var i=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=u_(e),i=n[0],o=n[1]),i&&(t.setLineDash(i),t.lineDashOffset=o),r.strokeFirst?(fc(r)&&t.strokeText(a,r.x,r.y),hc(r)&&t.fillText(a,r.x,r.y)):(hc(r)&&t.fillText(a,r.x,r.y),fc(r)&&t.strokeText(a,r.x,r.y)),i&&t.setLineDash([])}}var p_=["shadowBlur","shadowOffsetX","shadowOffsetY"],v_=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function g_(t,e,r,n,a){var i=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){zt(t,a),i=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?Zn.opacity:o}(n||e.blend!==r.blend)&&(i||(zt(t,a),i=!0),t.globalCompositeOperation=e.blend||Zn.blend);for(var s=0;s<p_.length;s++){var l=p_[s];(n||e[l]!==r[l])&&(i||(zt(t,a),i=!0),t[l]=t.dpr*(e[l]||0))}return(n||e.shadowColor!==r.shadowColor)&&(i||(zt(t,a),i=!0),t.shadowColor=e.shadowColor||Zn.shadowColor),i}function m_(t,e,r,n,a){var i=No(e,a.inHover),o=n?null:r&&No(r,a.inHover)||{};if(i===o)return!1;var s=g_(t,i,o,n,a);if((n||i.fill!==o.fill)&&(s||(zt(t,a),s=!0),f_(i.fill)&&(t.fillStyle=i.fill)),(n||i.stroke!==o.stroke)&&(s||(zt(t,a),s=!0),f_(i.stroke)&&(t.strokeStyle=i.stroke)),(n||i.opacity!==o.opacity)&&(s||(zt(t,a),s=!0),t.globalAlpha=i.opacity==null?1:i.opacity),e.hasStroke()){var l=i.lineWidth,c=l/(i.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==c&&(s||(zt(t,a),s=!0),t.lineWidth=c)}for(var u=0;u<v_.length;u++){var f=v_[u],h=f[0];(n||i[h]!==o[h])&&(s||(zt(t,a),s=!0),t[h]=i[h]||f[1])}return s}function LD(t,e,r,n,a){return g_(t,No(e,a.inHover),r&&No(r,a.inHover),n,a)}function y_(t,e){var r=e.transform,n=t.dpr||1;r?t.setTransform(n*r[0],n*r[1],n*r[2],n*r[3],n*r[4],n*r[5]):t.setTransform(n,0,0,n,0,0)}function PD(t,e,r){for(var n=!1,a=0;a<t.length;a++){var i=t[a];n=n||i.isZeroArea(),y_(e,i),e.beginPath(),i.buildPath(e,i.shape),e.clip()}r.allClipped=n}function RD(t,e){return t&&e?t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||t[4]!==e[4]||t[5]!==e[5]:!(!t&&!e)}var __=1,b_=2,x_=3,w_=4;function ED(t){var e=hc(t),r=fc(t);return!(t.lineDash||!(+e^+r)||e&&typeof t.fill!="string"||r&&typeof t.stroke!="string"||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}function zt(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function No(t,e){return e&&t.__hoverStyle||t.style}function S_(t,e){ma(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function ma(t,e,r,n){var a=e.transform;if(!e.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1)){e.__dirty&=~Wt,e.__isRendered=!1;return}var i=e.__clipPaths,o=r.prevElClipPaths,s=!1,l=!1;if((!o||TD(i,o))&&(o&&o.length&&(zt(t,r),t.restore(),l=s=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),i&&i.length&&(zt(t,r),t.save(),PD(i,t,r),s=!0),r.prevElClipPaths=i),r.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var c=r.prevEl;c||(l=s=!0);var u=e instanceof $e&&e.autoBatch&&ED(e.style);s||RD(a,c.transform)?(zt(t,r),y_(t,e)):u||zt(t,r);var f=No(e,r.inHover);e instanceof $e?(r.lastDrawType!==__&&(l=!0,r.lastDrawType=__),m_(t,e,c,l,r),(!u||!r.batchFill&&!r.batchStroke)&&t.beginPath(),AD(t,e,f,u),u&&(r.batchFill=f.fill||"",r.batchStroke=f.stroke||"")):e instanceof tl?(r.lastDrawType!==x_&&(l=!0,r.lastDrawType=x_),m_(t,e,c,l,r),ID(t,e,f)):e instanceof bn?(r.lastDrawType!==b_&&(l=!0,r.lastDrawType=b_),LD(t,e,c,l,r),DD(t,e,f)):e.getTemporalDisplayables&&(r.lastDrawType!==w_&&(l=!0,r.lastDrawType=w_),OD(t,e,r)),u&&n&&zt(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),r.prevEl=e,e.__dirty=0,e.__isRendered=!0}function OD(t,e,r){var n=e.getDisplayables(),a=e.getTemporalDisplayables();t.save();var i={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:r.viewWidth,viewHeight:r.viewHeight,inHover:r.inHover},o,s;for(o=e.getCursor(),s=n.length;o<s;o++){var l=n[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),ma(t,l,i,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}for(var c=0,u=a.length;c<u;c++){var l=a[c];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),ma(t,l,i,c===u-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}var Jh=new wD,k_=new Wi(100),T_=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function ed(t,e){if(t==="none")return null;var r=e.getDevicePixelRatio(),n=e.getZr(),a=n.painter.type==="svg";t.dirty&&Jh.delete(t);var i=Jh.get(t);if(i)return i;var o=Ne(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=a?1:1/r,Jh.set(t,s),t.dirty=!1,s;function l(c){for(var u=[r],f=!0,h=0;h<T_.length;++h){var d=o[T_[h]];if(d!=null&&!ee(d)&&!ne(d)&&!Ke(d)&&typeof d!="boolean"){f=!1;break}u.push(d)}var p;if(f){p=u.join(",")+(a?"-svg":"");var m=k_.get(p);m&&(a?c.svgElement=m:c.image=m)}var g=M_(o.dashArrayX),v=ND(o.dashArrayY),y=C_(o.symbol),b=BD(g),x=A_(v),S=!a&&Na.createCanvas(),w=a&&{tag:"g",attrs:{},key:"dcl",children:[]},k=C(),T;S&&(S.width=k.width*r,S.height=k.height*r,T=S.getContext("2d")),A(),f&&k_.put(p,S||w),c.image=S,c.svgElement=w,c.svgWidth=k.width,c.svgHeight=k.height;function C(){for(var M=1,I=0,L=b.length;I<L;++I)M=_g(M,b[I]);for(var P=1,I=0,L=y.length;I<L;++I)P=_g(P,y[I].length);M*=P;var N=x*b.length*y.length;return{width:Math.max(1,Math.min(M,o.maxTileWidth)),height:Math.max(1,Math.min(N,o.maxTileHeight))}}function A(){T&&(T.clearRect(0,0,S.width,S.height),o.backgroundColor&&(T.fillStyle=o.backgroundColor,T.fillRect(0,0,S.width,S.height)));for(var M=0,I=0;I<v.length;++I)M+=v[I];if(M<=0)return;for(var L=-x,P=0,N=0,O=0;L<k.height;){if(P%2===0){for(var q=N/2%y.length,R=0,z=0,F=0;R<k.width*2;){for(var X=0,I=0;I<g[O].length;++I)X+=g[O][I];if(X<=0)break;if(z%2===0){var te=(1-o.symbolSize)*.5,fe=R+g[O][z]*te,me=L+v[P]*te,we=g[O][z]*o.symbolSize,Ze=v[P]*o.symbolSize,Ie=F/2%y[q].length;tt(fe,me,we,Ze,y[q][Ie])}R+=g[O][z],++F,++z,z===g[O].length&&(z=0)}++O,O===g.length&&(O=0)}L+=v[P],++N,++P,P===v.length&&(P=0)}function tt(Ge,Me,re,he,Be){var pe=a?1:r,Se=di(Be,Ge*pe,Me*pe,re*pe,he*pe,o.color,o.symbolKeepAspect);if(a){var ct=n.painter.renderOneToVNode(Se);ct&&w.children.push(ct)}else S_(T,Se)}}}}function C_(t){if(!t||t.length===0)return[["rect"]];if(ne(t))return[[t]];for(var e=!0,r=0;r<t.length;++r)if(!ne(t[r])){e=!1;break}if(e)return C_([t]);for(var n=[],r=0;r<t.length;++r)ne(t[r])?n.push([t[r]]):n.push(t[r]);return n}function M_(t){if(!t||t.length===0)return[[0,0]];if(Ke(t)){var e=Math.ceil(t);return[[e,e]]}for(var r=!0,n=0;n<t.length;++n)if(!Ke(t[n])){r=!1;break}if(r)return M_([t]);for(var a=[],n=0;n<t.length;++n)if(Ke(t[n])){var e=Math.ceil(t[n]);a.push([e,e])}else{var e=ue(t[n],function(s){return Math.ceil(s)});e.length%2===1?a.push(e.concat(e)):a.push(e)}return a}function ND(t){if(!t||typeof t=="object"&&t.length===0)return[0,0];if(Ke(t)){var e=Math.ceil(t);return[e,e]}var r=ue(t,function(n){return Math.ceil(n)});return t.length%2?r.concat(r):r}function BD(t){return ue(t,function(e){return A_(e)})}function A_(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return t.length%2===1?e*2:e}function zD(t,e){t.eachRawSeries(function(r){if(!t.isSeriesFiltered(r)){var n=r.getData();n.hasItemVisual()&&n.each(function(o){var s=n.getItemVisual(o,"decal");if(s){var l=n.ensureUniqueItemVisual(o,"style");l.decal=ed(s,e)}});var a=n.getVisual("decal");if(a){var i=n.getVisual("style");i.decal=ed(a,e)}}})}var mr=new ur,D_={};function FD(t,e){D_[t]=e}function HD(t){return D_[t]}var VD=1,GD=800,$D=900,WD=1e3,UD=2e3,YD=5e3,I_=1e3,qD=1100,td=2e3,L_=3e3,XD=4e3,dc=4500,ZD=4600,KD=5e3,jD=6e3,P_=7e3,QD={PROCESSOR:{FILTER:WD,SERIES_FILTER:GD,STATISTIC:YD},VISUAL:{LAYOUT:I_,PROGRESSIVE_LAYOUT:qD,GLOBAL:td,CHART:L_,POST_CHART_LAYOUT:ZD,COMPONENT:XD,BRUSH:KD,CHART_ITEM:dc,ARIA:jD,DECAL:P_}},St="__flagInMainProcess",Ft="__pendingUpdate",rd="__needsUpdateStatus",R_=/^[a-zA-Z0-9_]+$/,nd="__connectUpdateStatus",E_=0,JD=1,eI=2;function O_(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isDisposed()){this.id;return}return B_(this,t,e)}}function N_(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return B_(this,t,e)}}function B_(t,e,r){return r[0]=r[0]&&r[0].toLowerCase(),ur.prototype[e].apply(t,r)}var z_=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(ur),F_=z_.prototype;F_.on=N_("on"),F_.off=N_("off");var yi,ad,pc,Dn,id,od,sd,Bo,zo,H_,V_,ld,G_,vc,$_,W_,sr,U_,Y_=(function(t){Z(e,t);function e(r,n,a){var i=t.call(this,new vD)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],a=a||{},ne(n)&&(n=q_[n]),i._dom=r;var o="canvas",s="auto",l=!1;a.ssr;var c=i._zr=N0(r,{renderer:a.renderer||o,devicePixelRatio:a.devicePixelRatio,width:a.width,height:a.height,ssr:a.ssr,useDirtyRect:Ce(a.useDirtyRect,l),useCoarsePointer:Ce(a.useCoarsePointer,s),pointerSize:a.pointerSize});i._ssr=a.ssr,i._throttledZrFlush=Ah(Le(c.flush,c),17),n=Te(n),n&&K0(n,!0),i._theme=n,i._locale=tC(a.locale||ty),i._coordSysMgr=new jf;var u=i._api=$_(i);function f(h,d){return h.__prio-d.__prio}return tc(mc,f),tc(ud,f),i._scheduler=new t_(i,u,ud,mc),i._messageCenter=new z_,i._initEvents(),i.resize=Le(i.resize,i),c.animation.on("frame",i._onframe,i),H_(c,i),V_(c,i),yu(i),i}return e.prototype._onframe=function(){if(!this._disposed){U_(this);var r=this._scheduler;if(this[Ft]){var n=this[Ft].silent;this[St]=!0;try{yi(this),Dn.update.call(this,null,this[Ft].updateParams)}catch(l){throw this[St]=!1,this[Ft]=null,l}this._zr.flush(),this[St]=!1,this[Ft]=null,Bo.call(this,n),zo.call(this,n)}else if(r.unfinished){var a=VD,i=this._model,o=this._api;r.unfinished=!1;do{var s=+new Date;r.performSeriesTasks(i),r.performDataProcessorTasks(i),od(this,i),r.performVisualTasks(i),vc(this,this._model,o,"remain",{}),a-=+new Date-s}while(a>0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,n,a){if(!this[St]){if(this._disposed){this.id;return}var i,o,s;if(ce(n)&&(a=n.lazyUpdate,i=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[St]=!0,!this._model||n){var l=new HA(this._api),c=this._theme,u=this._model=new qh;u.scheduler=this._scheduler,u.ssr=this._ssr,u.init(null,null,null,c,this._locale,l)}this._model.setOption(r,{replaceMerge:o},fd);var f={seriesTransition:s,optionChanged:!0};if(a)this[Ft]={silent:i,updateParams:f},this[St]=!1,this.getZr().wakeUp();else{try{yi(this),Dn.update.call(this,null,f)}catch(h){throw this[Ft]=null,this[St]=!1,h}this._ssr||this._zr.flush(),this[Ft]=null,this[St]=!1,Bo.call(this,i),zo.call(this,i)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||ge.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){if(ge.svgSupported){var r=this._zr,n=r.storage.getDisplayList();return D(n,function(a){a.stopAnimation(null,!0)}),r.painter.toDataURL()}},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,a=this._model,i=[],o=this;D(n,function(l){a.eachComponent({mainType:l},function(c){var u=o._componentsMap[c.__viewId];u.group.ignore||(i.push(u),u.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return D(i,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",a=this.group,i=Math.min,o=Math.max,s=1/0;if(X_[a]){var l=s,c=s,u=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();D(Ho,function(b,x){if(b.group===a){var S=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(Te(r)),w=b.getDom().getBoundingClientRect();l=i(w.left,l),c=i(w.top,c),u=o(w.right,u),f=o(w.bottom,f),h.push({dom:S,left:w.left,top:w.top})}}),l*=d,c*=d,u*=d,f*=d;var p=u-l,m=f-c,g=Na.createCanvas(),v=N0(g,{renderer:n?"svg":"canvas"});if(v.resize({width:p,height:m}),n){var y="";return D(h,function(b){var x=b.left-l,S=b.top-c;y+='<g transform="translate('+x+","+S+')">'+b.dom+"</g>"}),v.painter.getSvgRoot().innerHTML=y,r.connectedBackgroundColor&&v.painter.setBackgroundColor(r.connectedBackgroundColor),v.refreshImmediately(),v.painter.toDataURL()}else return r.connectedBackgroundColor&&v.add(new ft({shape:{x:0,y:0,width:p,height:m},style:{fill:r.connectedBackgroundColor}})),D(h,function(b){var x=new bn({style:{x:b.left*d-l,y:b.top*d-c,image:b.dom}});v.add(x)}),v.refreshImmediately(),g.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,n){return id(this,"convertToPixel",r,n)},e.prototype.convertFromPixel=function(r,n){return id(this,"convertFromPixel",r,n)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var a=this._model,i,o=ff(a,r);return D(o,function(s,l){l.indexOf("Models")>=0&&D(s,function(c){var u=c.coordinateSystem;if(u&&u.containPoint)i=i||!!u.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[c.__viewId];f&&f.containPoint&&(i=i||f.containPoint(n,c))}},this)},this),!!i},e.prototype.getVisual=function(r,n){var a=this._model,i=ff(a,r,{defaultMainType:"series"}),o=i.seriesModel,s=o.getData(),l=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?s.indexOfRawIndex(i.dataIndex):null;return l!=null?yD(s,l,n):_D(s,n)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;D(tI,function(n){var a=function(i){var o=r.getModel(),s=i.target,l,c=n==="globalout";if(c?l={}:s&&Oo(s,function(p){var m=Ve(p);if(m&&m.dataIndex!=null){var g=m.dataModel||o.getSeriesByIndex(m.seriesIndex);return l=g&&g.getDataParams(m.dataIndex,m.dataType,s)||{},!0}else if(m.eventData)return l=U({},m.eventData),!0},!0),l){var u=l.componentType,f=l.componentIndex;(u==="markLine"||u==="markPoint"||u==="markArea")&&(u="series",f=l.seriesIndex);var h=u&&f!=null&&o.getComponent(u,f),d=h&&r[h.mainType==="series"?"_chartsMap":"_componentsMap"][h.__viewId];l.event=i,l.type=n,r._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:h,view:d},r.trigger(n,l)}};a.zrEventfulCallAtLast=!0,r._zr.on(n,a,r)}),D(Fo,function(n,a){r._messageCenter.on(a,function(i){this.trigger(a,i)},r)}),D(["selectchanged"],function(n){r._messageCenter.on(n,function(a){this.trigger(n,a)},r)}),eA(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&Tg(this.getDom(),dd,"");var n=this,a=n._api,i=n._model;D(n._componentsViews,function(o){o.dispose(i,a)}),D(n._chartsViews,function(o){o.dispose(i,a)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete Ho[n.id]},e.prototype.resize=function(r){if(!this[St]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var a=n.resetOption("media"),i=r&&r.silent;this[Ft]&&(i==null&&(i=this[Ft].silent),a=!0,this[Ft]=null),this[St]=!0;try{a&&yi(this),Dn.update.call(this,{type:"resize",animation:U({duration:0},r&&r.animation)})}catch(o){throw this[St]=!1,o}this[St]=!1,Bo.call(this,i),zo.call(this,i)}}},e.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(ce(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!hd[r]){var a=hd[r](this._api,n),i=this._zr;this._loadingFX=a,i.add(a)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var n=U({},r);return n.type=Fo[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ce(n)||(n={silent:!!n}),!!gc[r.type]&&this._model){if(this[St]){this._pendingActions.push(r);return}var a=n.silent;sd.call(this,r,a);var i=n.flush;i?this._zr.flush():i!==!1&&ge.browser.weChat&&this._throttledZrFlush(),Bo.call(this,a),zo.call(this,a)}},e.prototype.updateLabelLayout=function(){mr.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,a=this.getModel(),i=a.getSeriesByIndex(n);i.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=(function(){yi=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),ad(f,!0),ad(f,!1),h.plan()},ad=function(f,h){for(var d=f._model,p=f._scheduler,m=h?f._componentsViews:f._chartsViews,g=h?f._componentsMap:f._chartsMap,v=f._zr,y=f._api,b=0;b<m.length;b++)m[b].__alive=!1;h?d.eachComponent(function(w,k){w!=="series"&&x(k)}):d.eachSeries(x);function x(w){var k=w.__requireNewView;w.__requireNewView=!1;var T="_ec_"+w.id+"_"+w.type,C=!k&&g[T];if(!C){var A=Ar(w.type),M=h?gr.getClass(A.main,A.sub):dr.getClass(A.sub);C=new M,C.init(d,y),g[T]=C,m.push(C),v.add(C.group)}w.__viewId=C.__id=T,C.__alive=!0,C.__model=w,C.group.__ecComponentInfo={mainType:w.mainType,index:w.componentIndex},!h&&p.prepareView(C,w,d,y)}for(var b=0;b<m.length;){var S=m[b];S.__alive?b++:(!h&&S.renderTask.dispose(),v.remove(S.group),S.dispose(d,y),m.splice(b,1),g[S.__id]===S&&delete g[S.__id],S.__id=S.group.__ecComponentInfo=null)}},pc=function(f,h,d,p,m){var g=f._model;if(g.setUpdatePayload(d),!p){D([].concat(f._componentsViews).concat(f._chartsViews),S);return}var v={};v[p+"Id"]=d[p+"Id"],v[p+"Index"]=d[p+"Index"],v[p+"Name"]=d[p+"Name"];var y={mainType:p,query:v};m&&(y.subType=m);var b=d.excludeSeriesId,x;b!=null&&(x=de(),D(_t(b),function(w){var k=Rr(w,null);k!=null&&x.set(k,!0)})),g&&g.eachComponent(y,function(w){var k=x&&x.get(w.id)!=null;if(!k)if(Ug(d))if(w instanceof Br)d.type===sa&&!d.notBlur&&!w.get(["emphasis","disabled"])&&Yk(w,d,f._api);else{var T=_f(w.mainType,w.componentIndex,d.name,f._api),C=T.focusSelf,A=T.dispatchers;d.type===sa&&C&&!d.notBlur&&yf(w.mainType,w.componentIndex,f._api),A&&D(A,function(M){d.type===sa?cl(M):ul(M)})}else Sf(d)&&w instanceof Br&&(Zk(w,d,f._api),Gg(w),sr(f))},f),g&&g.eachComponent(y,function(w){var k=x&&x.get(w.id)!=null;k||S(f[p==="series"?"_chartsMap":"_componentsMap"][w.__viewId])},f);function S(w){w&&w.__alive&&w[h]&&w[h](w.__model,g,f._api,d)}},Dn={prepareAndUpdate:function(f){yi(this),Dn.update.call(this,f,{optionChanged:f.newOption!=null})},update:function(f,h){var d=this._model,p=this._api,m=this._zr,g=this._coordSysMgr,v=this._scheduler;if(d){d.setUpdatePayload(f),v.restoreData(d,f),v.performSeriesTasks(d),g.create(d,p),v.performDataProcessorTasks(d,f),od(this,d),g.update(d,p),r(d),v.performVisualTasks(d,f),ld(this,d,p,f,h);var y=d.get("backgroundColor")||"transparent",b=d.get("darkMode");m.setBackgroundColor(y),b!=null&&b!=="auto"&&m.setDarkMode(b),mr.trigger("afterupdate",d,p)}},updateTransform:function(f){var h=this,d=this._model,p=this._api;if(d){d.setUpdatePayload(f);var m=[];d.eachComponent(function(v,y){if(v!=="series"){var b=h.getViewOfComponentModel(y);if(b&&b.__alive)if(b.updateTransform){var x=b.updateTransform(y,d,p,f);x&&x.update&&m.push(b)}else m.push(b)}});var g=de();d.eachSeries(function(v){var y=h._chartsMap[v.__viewId];if(y.updateTransform){var b=y.updateTransform(v,d,p,f);b&&b.update&&g.set(v.uid,1)}else g.set(v.uid,1)}),r(d),this._scheduler.performVisualTasks(d,f,{setDirty:!0,dirtyMap:g}),vc(this,d,p,f,{},g),mr.trigger("afterupdate",d,p)}},updateView:function(f){var h=this._model;h&&(h.setUpdatePayload(f),dr.markUpdateMethod(f,"updateView"),r(h),this._scheduler.performVisualTasks(h,f,{setDirty:!0}),ld(this,h,this._api,f,{}),mr.trigger("afterupdate",h,this._api))},updateVisual:function(f){var h=this,d=this._model;d&&(d.setUpdatePayload(f),d.eachSeries(function(p){p.getData().clearAllVisual()}),dr.markUpdateMethod(f,"updateVisual"),r(d),this._scheduler.performVisualTasks(d,f,{visualType:"visual",setDirty:!0}),d.eachComponent(function(p,m){if(p!=="series"){var g=h.getViewOfComponentModel(m);g&&g.__alive&&g.updateVisual(m,d,h._api,f)}}),d.eachSeries(function(p){var m=h._chartsMap[p.__viewId];m.updateVisual(p,d,h._api,f)}),mr.trigger("afterupdate",d,this._api))},updateLayout:function(f){Dn.update.call(this,f)}},id=function(f,h,d,p){if(f._disposed){f.id;return}for(var m=f._model,g=f._coordSysMgr.getCoordinateSystems(),v,y=ff(m,d),b=0;b<g.length;b++){var x=g[b];if(x[h]&&(v=x[h](m,y,p))!=null)return v}},od=function(f,h){var d=f._chartsMap,p=f._scheduler;h.eachSeries(function(m){p.updateStreamModes(m,d[m.__viewId])})},sd=function(f,h){var d=this,p=this.getModel(),m=f.type,g=f.escapeConnect,v=gc[m],y=v.actionInfo,b=(y.update||"update").split(":"),x=b.pop(),S=b[0]!=null&&Ar(b[0]);this[St]=!0;var w=[f],k=!1;f.batch&&(k=!0,w=ue(f.batch,function(P){return P=Ne(U({},P),f),P.batch=null,P}));var T=[],C,A=Sf(f),M=Ug(f);if(M&&Vg(this._api),D(w,function(P){if(C=v.action(P,d._model,d._api),C=C||U({},P),C.type=y.event||C.type,T.push(C),M){var N=hf(f),O=N.queryOptionMap,q=N.mainTypeSpecified,R=q?O.keys()[0]:"series";pc(d,x,P,R),sr(d)}else A?(pc(d,x,P,"series"),sr(d)):S&&pc(d,x,P,S.main,S.sub)}),x!=="none"&&!M&&!A&&!S)try{this[Ft]?(yi(this),Dn.update.call(this,f),this[Ft]=null):Dn[x].call(this,f)}catch(P){throw this[St]=!1,P}if(k?C={type:y.event||m,escapeConnect:g,batch:T}:C=T[0],this[St]=!1,!h){var I=this._messageCenter;if(I.trigger(C.type,C),A){var L={type:"selectchanged",escapeConnect:g,selected:Kk(p),isFromClick:f.isFromClick||!1,fromAction:f.type,fromActionPayload:f};I.trigger(L.type,L)}}},Bo=function(f){for(var h=this._pendingActions;h.length;){var d=h.shift();sd.call(this,d,f)}},zo=function(f){!f&&this.trigger("updated")},H_=function(f,h){f.on("rendered",function(d){h.trigger("rendered",d),f.animation.isFinished()&&!h[Ft]&&!h._scheduler.unfinished&&!h._pendingActions.length&&h.trigger("finished")})},V_=function(f,h){f.on("mouseover",function(d){var p=d.target,m=Oo(p,wf);m&&(qk(m,d,h._api),sr(h))}).on("mouseout",function(d){var p=d.target,m=Oo(p,wf);m&&(Xk(m,d,h._api),sr(h))}).on("click",function(d){var p=d.target,m=Oo(p,function(y){return Ve(y).dataIndex!=null},!0);if(m){var g=m.selected?"unselect":"select",v=Ve(m);h._api.dispatchAction({type:g,dataType:v.dataType,dataIndexInside:v.dataIndex,seriesIndex:v.seriesIndex,isFromClick:!0})}})};function r(f){f.clearColorPalette(),f.eachSeries(function(h){h.clearColorPalette()})}function n(f){var h=[],d=[],p=!1;if(f.eachComponent(function(y,b){var x=b.get("zlevel")||0,S=b.get("z")||0,w=b.getZLevelKey();p=p||!!w,(y==="series"?d:h).push({zlevel:x,z:S,idx:b.componentIndex,type:y,key:w})}),p){var m=h.concat(d),g,v;tc(m,function(y,b){return y.zlevel===b.zlevel?y.z-b.z:y.zlevel-b.zlevel}),D(m,function(y){var b=f.getComponent(y.type,y.idx),x=y.zlevel,S=y.key;g!=null&&(x=Math.max(g,x)),S?(x===g&&S!==v&&x++,v=S):v&&(x===g&&x++,v=""),g=x,b.setZLevel(x)})}}ld=function(f,h,d,p,m){n(h),G_(f,h,d,p,m),D(f._chartsViews,function(g){g.__alive=!1}),vc(f,h,d,p,m),D(f._chartsViews,function(g){g.__alive||g.remove(h,d)})},G_=function(f,h,d,p,m,g){D(g||f._componentsViews,function(v){var y=v.__model;c(y,v),v.render(y,h,d,p),s(y,v),u(y,v)})},vc=function(f,h,d,p,m,g){var v=f._scheduler;m=U(m||{},{updatedSeries:h.getSeries()}),mr.trigger("series:beforeupdate",h,d,m);var y=!1;h.eachSeries(function(b){var x=f._chartsMap[b.__viewId];x.__alive=!0;var S=x.renderTask;v.updatePayload(S,p),c(b,x),g&&g.get(b.uid)&&S.dirty(),S.perform(v.getPerformArgs(S))&&(y=!0),x.group.silent=!!b.get("silent"),o(b,x),Gg(b)}),v.unfinished=y||v.unfinished,mr.trigger("series:layoutlabels",h,d,m),mr.trigger("series:transition",h,d,m),h.eachSeries(function(b){var x=f._chartsMap[b.__viewId];s(b,x),u(b,x)}),i(f,h),mr.trigger("series:afterupdate",h,d,m)},sr=function(f){f[rd]=!0,f.getZr().wakeUp()},U_=function(f){f[rd]&&(f.getZr().storage.traverse(function(h){ho(h)||a(h)}),f[rd]=!1)};function a(f){for(var h=[],d=f.currentStates,p=0;p<d.length;p++){var m=d[p];m==="emphasis"||m==="blur"||m==="select"||h.push(m)}f.selected&&f.states.select&&h.push("select"),f.hoverState===il&&f.states.emphasis?h.push("emphasis"):f.hoverState===al&&f.states.blur&&h.push("blur"),f.useStates(h)}function i(f,h){var d=f._zr,p=d.storage,m=0;p.traverse(function(g){g.isGroup||m++}),m>h.get("hoverLayerThreshold")&&!ge.node&&!ge.worker&&h.eachSeries(function(g){if(!g.preventUsingHoverLayer){var v=f._chartsMap[g.__viewId];v.__alive&&v.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function s(f,h){if(!f.preventAutoZ){var d=f.get("z")||0,p=f.get("zlevel")||0;h.eachRendered(function(m){return l(m,d,p,-1/0),!0})}}function l(f,h,d,p){var m=f.getTextContent(),g=f.getTextGuideLine(),v=f.isGroup;if(v)for(var y=f.childrenRef(),b=0;b<y.length;b++)p=Math.max(l(y[b],h,d,p),p);else f.z=h,f.zlevel=d,p=Math.max(f.z2,p);if(m&&(m.z=h,m.zlevel=d,isFinite(p)&&(m.z2=p+2)),g){var x=f.textGuideLineConfig;g.z=h,g.zlevel=d,isFinite(p)&&(g.z2=p+(x&&x.showAbove?1:-1))}return p}function c(f,h){h.eachRendered(function(d){if(!ho(d)){var p=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function u(f,h){var d=f.getModel("stateAnimation"),p=f.isAnimationEnabled(),m=d.get("duration"),g=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(v){if(v.states&&v.states.emphasis){if(ho(v))return;if(v instanceof $e&&tT(v),v.__dirty){var y=v.prevStates;y&&v.useStates(y)}if(p){v.stateTransition=g;var b=v.getTextContent(),x=v.getTextGuideLine();b&&(b.stateTransition=g),x&&(x.stateTransition=g)}v.__dirty&&a(v)}})}$_=function(f){return new((function(h){Z(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(p){for(;p;){var m=p.__ecComponentInfo;if(m!=null)return f._model.getComponent(m.mainType,m.index);p=p.parent}},d.prototype.enterEmphasis=function(p,m){cl(p,m),sr(f)},d.prototype.leaveEmphasis=function(p,m){ul(p,m),sr(f)},d.prototype.enterBlur=function(p){Uk(p),sr(f)},d.prototype.leaveBlur=function(p){Bg(p),sr(f)},d.prototype.enterSelect=function(p){zg(p),sr(f)},d.prototype.leaveSelect=function(p){Fg(p),sr(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(p){return f.getViewOfComponentModel(p)},d.prototype.getViewOfSeriesModel=function(p){return f.getViewOfSeriesModel(p)},d})($0))(f)},W_=function(f){function h(d,p){for(var m=0;m<d.length;m++){var g=d[m];g[nd]=p}}D(Fo,function(d,p){f._messageCenter.on(p,function(m){if(X_[f.group]&&f[nd]!==E_){if(m&&m.escapeConnect)return;var g=f.makeActionFromEvent(m),v=[];D(Ho,function(y){y!==f&&y.group===f.group&&v.push(y)}),h(v,E_),D(v,function(y){y[nd]!==JD&&y.dispatchAction(g)}),h(v,eI)}})})}})(),e})(ur),cd=Y_.prototype;cd.on=O_("on"),cd.off=O_("off"),cd.one=function(t,e,r){var n=this;function a(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];e&&e.apply&&e.apply(this,i),n.off(t,a)}this.on.call(this,t,a,r)};var tI=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function oO(t){}var gc={},Fo={},ud=[],fd=[],mc=[],q_={},hd={},Ho={},X_={},rI=+new Date-0,dd="_echarts_instance_";function nI(t,e,r){var n=!(r&&r.ssr);if(n){var a=aI(t);if(a)return a}var i=new Y_(t,e,r);return i.id="ec_"+rI++,Ho[i.id]=i,n&&Tg(t,dd,i.id),W_(i),mr.trigger("afterinit",i),i}function aI(t){return Ho[Pk(t,dd)]}function Z_(t,e){q_[t]=e}function K_(t){ze(fd,t)<0&&fd.push(t)}function j_(t,e){vd(ud,t,e,UD)}function iI(t){pd("afterinit",t)}function oI(t){pd("afterupdate",t)}function pd(t,e){mr.on(t,e)}function ya(t,e,r){ye(e)&&(r=e,e="");var n=ce(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,!Fo[e]&&(Ur(R_.test(n)&&R_.test(e)),gc[n]||(gc[n]={action:r,actionInfo:t}),Fo[e]=n)}function sI(t,e){jf.register(t,e)}function lI(t,e){vd(mc,t,e,I_,"layout")}function _a(t,e){vd(mc,t,e,L_,"visual")}var Q_=[];function vd(t,e,r,n,a){if((ye(e)||ce(e))&&(r=e,e=n),!(ze(Q_,r)>=0)){Q_.push(r);var i=t_.wrapStageHandler(r,a);i.__prio=e,i.__raw=r,t.push(i)}}function J_(t,e){hd[t]=e}function cI(t,e,r){var n=HD("registerMap");n&&n(t,e,r)}var uI=TC;_a(td,tD),_a(dc,rD),_a(dc,nD),_a(td,gD),_a(dc,mD),_a(P_,zD),K_(K0),j_($D,QA),J_("default",aD),ya({type:sa,event:sa,update:sa},Ct),ya({type:ol,event:ol,update:ol},Ct),ya({type:so,event:so,update:so},Ct),ya({type:sl,event:sl,update:sl},Ct),ya({type:lo,event:lo,update:lo},Ct),Z_("light",pD),Z_("dark",l_);var eb=[],fI={registerPreprocessor:K_,registerProcessor:j_,registerPostInit:iI,registerPostUpdate:oI,registerUpdateLifecycle:pd,registerAction:ya,registerCoordinateSystem:sI,registerLayout:lI,registerVisual:_a,registerTransform:uI,registerLoading:J_,registerMap:cI,registerImpl:FD,PRIORITY:QD,ComponentModel:We,ComponentView:gr,SeriesModel:Br,ChartView:dr,registerComponentModel:function(t){We.registerClass(t)},registerComponentView:function(t){gr.registerClass(t)},registerSeriesModel:function(t){Br.registerClass(t)},registerChartView:function(t){dr.registerClass(t)},registerSubTypeDefaulter:function(t,e){We.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){LA(t,e)}};function In(t){if(ee(t)){D(t,function(e){In(e)});return}ze(eb,t)>=0||(eb.push(t),ye(t)&&(t={install:t}),t.install(fI))}var hI=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e})(We),dI=(function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t})(),gd=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Et).models[0]},e.type="cartesian2dAxis",e})(We);Cr(gd,dI);var tb={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},pI=De({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},tb),md=De({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},tb),vI=De({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},md),gI=Ne({logBase:10},md);const mI={category:pI,value:md,time:vI,log:gI};var yI=0,yd=(function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++yI}return t.createByAxisModel=function(e){var r=e.option,n=r.data,a=n&&ue(n,_I);return new t({categories:a,needCollect:!a,deduplication:r.dedplication!==!1})},t.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},t.prototype.parseAndCollect=function(e){var r,n=this._needCollect;if(!ne(e)&&!n)return e;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=e,r;var a=this._getOrCreateMap();return r=a.get(e),r==null&&(n?(r=this.categories.length,this.categories[r]=e,a.set(e,r)):r=NaN),r},t.prototype._getOrCreateMap=function(){return this._map||(this._map=de(this.categories))},t})();function _I(t){return ce(t)&&t.value!=null?t.value:t+""}var bI={value:1,category:1,time:1,log:1};function rb(t,e,r,n){D(bI,function(a,i){var o=De(De({},mI[i],!0),n,!0),s=(function(l){Z(c,l);function c(){var u=l!==null&&l.apply(this,arguments)||this;return u.type=e+"Axis."+i,u}return c.prototype.mergeDefaultAndTheme=function(u,f){var h=ko(this),d=h?ql(u):{},p=f.getTheme();De(u,p.get(i+"Axis")),De(u,this.getDefaultOption()),u.type=nb(u),h&&hi(u,d,h)},c.prototype.optionUpdated=function(){var u=this.option;u.type==="category"&&(this.__ordinalMeta=yd.createByAxisModel(this))},c.prototype.getCategories=function(u){var f=this.option;if(f.type==="category")return u?f.data:this.__ordinalMeta.categories},c.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},c.type=e+"Axis."+i,c.defaultOption=o,c})(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",nb)}function nb(t){return t.type||(t.data?"category":"value")}var zr=(function(){function t(e){this._setting=e||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(e){return this._setting[e]},t.prototype.unionExtent=function(e){var r=this._extent;e[0]<r[0]&&(r[0]=e[0]),e[1]>r[1]&&(r[1]=e[1])},t.prototype.unionExtentFromData=function(e,r){this.unionExtent(e.getApproximateExtent(r))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(r)||(n[1]=r)},t.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(e){this._isBlank=e},t})();Ms(zr);function _d(t){return t.type==="interval"||t.type==="log"}function xI(t,e,r,n){var a={},i=t[1]-t[0],o=a.interval=gg(i/e);r!=null&&o<r&&(o=a.interval=r),n!=null&&o>n&&(o=a.interval=n);var s=a.intervalPrecision=ab(o),l=a.niceTickExtent=[lt(Math.ceil(t[0]/o)*o,s),lt(Math.floor(t[1]/o)*o,s)];return wI(l,t),a}function bd(t){var e=Math.pow(10,cf(t)),r=t/e;return r?r===2?r=3:r===3?r=5:r*=2:r=1,lt(r*e)}function ab(t){return Zr(t)+2}function ib(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function wI(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),ib(t,0,e),ib(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function yc(t,e){return t>=e[0]&&t<=e[1]}function _c(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function bc(t,e){return t*(e[1]-e[0])+e[0]}var xd=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;n.type="ordinal";var a=n.getSetting("ordinalMeta");return a||(a=new yd({})),ee(a)&&(a=new yd({categories:ue(a,function(i){return ce(i)?i.value:i})})),n._ordinalMeta=a,n._extent=n.getSetting("extent")||[0,a.categories.length-1],n}return e.prototype.parse=function(r){return r==null?NaN:ne(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},e.prototype.contain=function(r){return r=this.parse(r),yc(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),_c(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(bc(r,this._extent)),this.getRawOrdinalNumber(r)},e.prototype.getTicks=function(){for(var r=[],n=this._extent,a=n[0];a<=n[1];)r.push({value:a}),a++;return r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=r.ordinalNumbers,a=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,n.length);o<l;++o){var c=n[o];a[o]=c,i[c]=o}for(var u=0;o<s;++o){for(;i[u]!=null;)u++;a.push(u),i[u]=o}},e.prototype._getTickNumber=function(r){var n=this._ticksByOrdinalNumber;return n&&r>=0&&r<n.length?n[r]:r},e.prototype.getRawOrdinalNumber=function(r){var n=this._ordinalNumbersByTick;return n&&r>=0&&r<n.length?n[r]:r},e.prototype.getLabel=function(r){if(!this.isBlank()){var n=this.getRawOrdinalNumber(r.value),a=this._ordinalMeta.categories[n];return a==null?"":a+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(r,n){this.unionExtent(r.getApproximateExtent(n))},e.prototype.isInExtentRange=function(r){return r=this._getTickNumber(r),this._extent[0]<=r&&this._extent[1]>=r},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e})(zr);zr.registerClass(xd);var ba=lt,_i=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return yc(r,this._extent)},e.prototype.normalize=function(r){return _c(r,this._extent)},e.prototype.scale=function(r){return bc(r,this._extent)},e.prototype.setExtent=function(r,n){var a=this._extent;isNaN(r)||(a[0]=parseFloat(r)),isNaN(n)||(a[1]=parseFloat(n))},e.prototype.unionExtent=function(r){var n=this._extent;r[0]<n[0]&&(n[0]=r[0]),r[1]>n[1]&&(n[1]=r[1]),this.setExtent(n[0],n[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=ab(r)},e.prototype.getTicks=function(r){var n=this._interval,a=this._extent,i=this._niceExtent,o=this._intervalPrecision,s=[];if(!n)return s;var l=1e4;a[0]<i[0]&&(r?s.push({value:ba(i[0]-n,o)}):s.push({value:a[0]}));for(var c=i[0];c<=i[1]&&(s.push({value:c}),c=ba(c+n,o),c!==s[s.length-1].value);)if(s.length>l)return[];var u=s.length?s[s.length-1].value:i[1];return a[1]>u&&(r?s.push({value:ba(u+n,o)}):s.push({value:a[1]})),s},e.prototype.getMinorTicks=function(r){for(var n=this.getTicks(!0),a=[],i=this.getExtent(),o=1;o<n.length;o++){for(var s=n[o],l=n[o-1],c=0,u=[],f=s.value-l.value,h=f/r;c<r-1;){var d=ba(l.value+(c+1)*h);d>i[0]&&d<i[1]&&u.push(d),c++}a.push(u)}return a},e.prototype.getLabel=function(r,n){if(r==null)return"";var a=n&&n.precision;a==null?a=Zr(r.value)||0:a==="auto"&&(a=this._intervalPrecision);var i=ba(r.value,a,!0);return py(i)},e.prototype.calcNiceTicks=function(r,n,a){r=r||5;var i=this._extent,o=i[1]-i[0];if(isFinite(o)){o<0&&(o=-o,i.reverse());var s=xI(i,r,n,a);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(r){var n=this._extent;if(n[0]===n[1])if(n[0]!==0){var a=Math.abs(n[0]);r.fixMax||(n[1]+=a/2),n[0]-=a/2}else n[1]=1;var i=n[1]-n[0];isFinite(i)||(n[0]=0,n[1]=1),this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval);var o=this._interval;r.fixMin||(n[0]=ba(Math.floor(n[0]/o)*o)),r.fixMax||(n[1]=ba(Math.ceil(n[1]/o)*o))},e.prototype.setNiceExtent=function(r,n){this._niceExtent=[r,n]},e.type="interval",e})(zr);zr.registerClass(_i);var SI=function(t,e,r,n){for(;r<n;){var a=r+n>>>1;t[a][1]<e?r=a+1:n=a}return r},ob=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="time",n}return e.prototype.getLabel=function(r){var n=this.getSetting("useUTC");return zl(r.value,ay[iC(ui(this._minLevelUnit))]||ay.second,n,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(r,n,a){var i=this.getSetting("useUTC"),o=this.getSetting("locale");return oC(r,n,a,o,i)},e.prototype.getTicks=function(){var r=this._interval,n=this._extent,a=[];if(!r)return a;a.push({value:n[0],level:0});var i=this.getSetting("useUTC"),o=II(this._minLevelUnit,this._approxInterval,i,n);return a=a.concat(o),a.push({value:n[1],level:0}),a},e.prototype.calcNiceExtent=function(r){var n=this._extent;if(n[0]===n[1]&&(n[0]-=ar,n[1]+=ar),n[1]===-1/0&&n[0]===1/0){var a=new Date;n[1]=+new Date(a.getFullYear(),a.getMonth(),a.getDate()),n[0]=n[1]-ar}this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval)},e.prototype.calcNiceTicks=function(r,n,a){r=r||10;var i=this._extent,o=i[1]-i[0];this._approxInterval=o/r,n!=null&&this._approxInterval<n&&(this._approxInterval=n),a!=null&&this._approxInterval>a&&(this._approxInterval=a);var s=xc.length,l=Math.min(SI(xc,this._approxInterval,0,s),s-1);this._interval=xc[l][1],this._minLevelUnit=xc[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return Ke(r)?r:+Kr(r)},e.prototype.contain=function(r){return yc(this.parse(r),this._extent)},e.prototype.normalize=function(r){return _c(this.parse(r),this._extent)},e.prototype.scale=function(r){return bc(r,this._extent)},e.type="time",e})(_i),xc=[["second",ih],["minute",oh],["hour",bo],["quarter-day",bo*6],["half-day",bo*12],["day",ar*1.2],["half-week",ar*3.5],["week",ar*7],["month",ar*31],["quarter",ar*95],["half-year",ny/2],["year",ny]];function kI(t,e,r,n){var a=Kr(e),i=Kr(r),o=function(p){return sy(a,p,n)===sy(i,p,n)},s=function(){return o("year")},l=function(){return s()&&o("month")},c=function(){return l()&&o("day")},u=function(){return c()&&o("hour")},f=function(){return u()&&o("minute")},h=function(){return f()&&o("second")},d=function(){return h()&&o("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return c();case"hour":return u();case"minute":return f();case"second":return h();case"millisecond":return d()}}function TI(t,e){return t/=ar,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function CI(t){var e=30*ar;return t/=e,t>6?6:t>3?3:t>2?2:1}function MI(t){return t/=bo,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function sb(t,e){return t/=e?oh:ih,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function AI(t){return gg(t)}function DI(t,e,r){var n=new Date(t);switch(ui(e)){case"year":case"month":n[ly(r)](0);case"day":n[cy(r)](1);case"hour":n[uy(r)](0);case"minute":n[fy(r)](0);case"second":n[hy(r)](0),n[dy(r)](0)}return n.getTime()}function II(t,e,r,n){var a=1e4,i=iy,o=0;function s(A,M,I,L,P,N,O){for(var q=new Date(M),R=M,z=q[L]();R<I&&R<=n[1];)O.push({value:R}),z+=A,q[P](z),R=q.getTime();O.push({value:R,notAdd:!0})}function l(A,M,I){var L=[],P=!M.length;if(!kI(ui(A),n[0],n[1],r)){P&&(M=[{value:DI(new Date(n[0]),A,r)},{value:n[1]}]);for(var N=0;N<M.length-1;N++){var O=M[N].value,q=M[N+1].value;if(O!==q){var R=void 0,z=void 0,F=void 0,X=!1;switch(A){case"year":R=Math.max(1,Math.round(e/ar/365)),z=lh(r),F=sC(r);break;case"half-year":case"quarter":case"month":R=CI(e),z=fi(r),F=ly(r);break;case"week":case"half-week":case"day":R=TI(e),z=Fl(r),F=cy(r),X=!0;break;case"half-day":case"quarter-day":case"hour":R=MI(e),z=wo(r),F=uy(r);break;case"minute":R=sb(e,!0),z=Hl(r),F=fy(r);break;case"second":R=sb(e,!1),z=Vl(r),F=hy(r);break;case"millisecond":R=AI(e),z=Gl(r),F=dy(r);break}s(R,O,q,z,F,X,L),A==="year"&&I.length>1&&N===0&&I.unshift({value:I[0].value-R})}}for(var N=0;N<L.length;N++)I.push(L[N]);return L}}for(var c=[],u=[],f=0,h=0,d=0;d<i.length&&o++<a;++d){var p=ui(i[d]);if(aC(i[d])){l(i[d],c[c.length-1]||[],u);var m=i[d+1]?ui(i[d+1]):null;if(p!==m){if(u.length){h=f,u.sort(function(A,M){return A.value-M.value});for(var g=[],v=0;v<u.length;++v){var y=u[v].value;(v===0||u[v-1].value!==y)&&(g.push(u[v]),y>=n[0]&&y<=n[1]&&f++)}var b=(n[1]-n[0])/e;if(f>b*1.5&&h>b/1.5||(c.push(g),f>b||t===i[d]))break}u=[]}}}for(var x=dt(ue(c,function(A){return dt(A,function(M){return M.value>=n[0]&&M.value<=n[1]&&!M.notAdd})}),function(A){return A.length>0}),S=[],w=x.length-1,d=0;d<x.length;++d)for(var k=x[d],T=0;T<k.length;++T)S.push({value:k[T].value,level:w-d});S.sort(function(A,M){return A.value-M.value});for(var C=[],d=0;d<S.length;++d)(d===0||S[d].value!==S[d-1].value)&&C.push(S[d]);return C}zr.registerClass(ob);var lb=zr.prototype,Vo=_i.prototype,LI=lt,PI=Math.floor,RI=Math.ceil,wc=Math.pow,yr=Math.log,wd=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="log",r.base=10,r._originalScale=new _i,r._interval=0,r}return e.prototype.getTicks=function(r){var n=this._originalScale,a=this._extent,i=n.getExtent(),o=Vo.getTicks.call(this,r);return ue(o,function(s){var l=s.value,c=lt(wc(this.base,l));return c=l===a[0]&&this._fixMin?Sc(c,i[0]):c,c=l===a[1]&&this._fixMax?Sc(c,i[1]):c,{value:c}},this)},e.prototype.setExtent=function(r,n){var a=yr(this.base);r=yr(Math.max(0,r))/a,n=yr(Math.max(0,n))/a,Vo.setExtent.call(this,r,n)},e.prototype.getExtent=function(){var r=this.base,n=lb.getExtent.call(this);n[0]=wc(r,n[0]),n[1]=wc(r,n[1]);var a=this._originalScale,i=a.getExtent();return this._fixMin&&(n[0]=Sc(n[0],i[0])),this._fixMax&&(n[1]=Sc(n[1],i[1])),n},e.prototype.unionExtent=function(r){this._originalScale.unionExtent(r);var n=this.base;r[0]=yr(r[0])/yr(n),r[1]=yr(r[1])/yr(n),lb.unionExtent.call(this,r)},e.prototype.unionExtentFromData=function(r,n){this.unionExtent(r.getApproximateExtent(n))},e.prototype.calcNiceTicks=function(r){r=r||10;var n=this._extent,a=n[1]-n[0];if(!(a===1/0||a<=0)){var i=mk(a),o=r/a*i;for(o<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var s=[lt(RI(n[0]/i)*i),lt(PI(n[1]/i)*i)];this._interval=i,this._niceExtent=s}},e.prototype.calcNiceExtent=function(r){Vo.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return r=yr(r)/yr(this.base),yc(r,this._extent)},e.prototype.normalize=function(r){return r=yr(r)/yr(this.base),_c(r,this._extent)},e.prototype.scale=function(r){return r=bc(r,this._extent),wc(this.base,r)},e.type="log",e})(zr),cb=wd.prototype;cb.getMinorTicks=Vo.getMinorTicks,cb.getLabel=Vo.getLabel;function Sc(t,e){return LI(t,Zr(e))}zr.registerClass(wd);var EI=(function(){function t(e,r,n){this._prepareParams(e,r,n)}return t.prototype._prepareParams=function(e,r,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var a=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&r.getNeedCrossZero&&r.getNeedCrossZero();var i=r.get("min",!0);i==null&&(i=r.get("startValue",!0));var o=this._modelMinRaw=i;ye(o)?this._modelMinNum=kc(e,o({min:n[0],max:n[1]})):o!=="dataMin"&&(this._modelMinNum=kc(e,o));var s=this._modelMaxRaw=r.get("max",!0);if(ye(s)?this._modelMaxNum=kc(e,s({min:n[0],max:n[1]})):s!=="dataMax"&&(this._modelMaxNum=kc(e,s)),a)this._axisDataLen=r.getCategories().length;else{var l=r.get("boundaryGap"),c=ee(l)?l:[l||0,l||0];typeof c[0]=="boolean"||typeof c[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[dn(c[0],1),dn(c[1],1)]}},t.prototype.calculate=function(){var e=this._isOrdinal,r=this._dataMin,n=this._dataMax,a=this._axisDataLen,i=this._boundaryGapInner,o=e?null:n-r||Math.abs(r),s=this._modelMinRaw==="dataMin"?r:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?n:this._modelMaxNum,c=s!=null,u=l!=null;s==null&&(s=e?a?0:NaN:r-i[0]*o),l==null&&(l=e?a?a-1:NaN:n+i[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var f=ks(s)||ks(l)||e&&!a;this._needCrossZero&&(s>0&&l>0&&!c&&(s=0),s<0&&l<0&&!u&&(l=0));var h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,c=!0),d!=null&&(l=d,u=!0),{min:s,max:l,minFixed:c,maxFixed:u,isBlank:f}},t.prototype.modifyDataMinMax=function(e,r){this[NI[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var n=OI[e];this[n]=r},t.prototype.freeze=function(){this.frozen=!0},t})(),OI={min:"_determinedMin",max:"_determinedMax"},NI={min:"_dataMin",max:"_dataMax"};function ub(t,e,r){var n=t.rawExtentInfo;return n||(n=new EI(t,e,r),t.rawExtentInfo=n,n)}function kc(t,e){return e==null?null:ks(e)?NaN:t.parse(e)}function fb(t,e){var r=t.type,n=ub(t,e,t.getExtent()).calculate();t.setBlank(n.isBlank);var a=n.min,i=n.max,o=e.ecModel;if(o&&r==="time"){var s=t0("bar",o),l=!1;if(D(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var c=r0(s),u=BI(a,i,e,c);a=u.min,i=u.max}}return{extent:[a,i],fixMin:n.minFixed,fixMax:n.maxFixed}}function BI(t,e,r,n){var a=r.axis.getExtent(),i=Math.abs(a[1]-a[0]),o=EM(n,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;D(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;D(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var c=s+l,u=e-t,f=1-(s+l)/i,h=u/f-u;return e+=h*(l/c),t-=h*(s/c),{min:t,max:e}}function hb(t,e){var r=e,n=fb(t,r),a=n.extent,i=r.get("splitNumber");t instanceof wd&&(t.base=r.get("logBase"));var o=t.type,s=r.get("interval"),l=o==="interval"||o==="time";t.setExtent(a[0],a[1]),t.calcNiceExtent({splitNumber:i,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&t.setInterval&&t.setInterval(s)}function zI(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new xd({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new ob({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(zr.getClass(e)||_i)}}function FI(t){var e=t.scale.getExtent(),r=e[0],n=e[1];return!(r>0&&n>0||r<0&&n<0)}function bi(t){var e=t.getLabelModel().get("formatter"),r=t.type==="category"?t.scale.getExtent()[0]:null;return t.scale.type==="time"?(function(n){return function(a,i){return t.scale.getFormattedLabel(a,i,n)}})(e):ne(e)?(function(n){return function(a){var i=t.scale.getLabel(a),o=n.replace("{value}",i??"");return o}})(e):ye(e)?(function(n){return function(a,i){return r!=null&&(i=a.value-r),n(Sd(t,a),i,a.level!=null?{level:a.level}:null)}})(e):function(n){return t.scale.getLabel(n)}}function Sd(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function HI(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var n,a,i=r.getExtent();r instanceof xd?a=r.count():(n=r.getTicks(),a=n.length);var o=t.getLabelModel(),s=bi(t),l,c=1;a>40&&(c=Math.ceil(a/40));for(var u=0;u<a;u+=c){var f=n?n[u]:{value:i[0]+u},h=s(f,u),d=o.getTextRect(h),p=VI(d,o.get("rotate")||0);l?l.union(p):l=p}return l}}function VI(t,e){var r=e*Math.PI/180,n=t.width,a=t.height,i=n*Math.abs(Math.cos(r))+Math.abs(a*Math.sin(r)),o=n*Math.abs(Math.sin(r))+Math.abs(a*Math.cos(r)),s=new Fe(t.x,t.y,i,o);return s}function kd(t){var e=t.get("interval");return e??"auto"}function db(t){return t.type==="category"&&kd(t.getLabelModel())===0}function pb(t,e){var r={};return D(t.mapDimensionsAll(e),function(n){r[F2(t,n)]=!0}),Qe(r)}function GI(t,e,r){e&&D(pb(e,r),function(n){var a=e.getApproximateExtent(n);a[0]<t[0]&&(t[0]=a[0]),a[1]>t[1]&&(t[1]=a[1])})}var $I=(function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return ue(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),dt(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t})(),Td=["x","y"];function vb(t){return t.type==="interval"||t.type==="time"}var WI=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=Td,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!vb(r)||!vb(n))){var a=r.getExtent(),i=n.getExtent(),o=this.dataToPoint([a[0],i[0]]),s=this.dataToPoint([a[1],i[1]]),l=a[1]-a[0],c=i[1]-i[0];if(!(!l||!c)){var u=(s[0]-o[0])/l,f=(s[1]-o[1])/c,h=o[0]-a[0]*u,d=o[1]-i[0]*f,p=this._transform=[u,0,0,f,h,d];this._invTransform=ku([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var n=this.getAxis("x"),a=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&a.contain(a.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,n){var a=this.dataToPoint(r),i=this.dataToPoint(n),o=this.getArea(),s=new Fe(a[0],a[1],i[0]-a[0],i[1]-a[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,n,a){a=a||[];var i=r[0],o=r[1];if(this._transform&&i!=null&&isFinite(i)&&o!=null&&isFinite(o))return jt(a,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return a[0]=s.toGlobalCoord(s.dataToCoord(i,n)),a[1]=l.toGlobalCoord(l.dataToCoord(o,n)),a},e.prototype.clampData=function(r,n){var a=this.getAxis("x").scale,i=this.getAxis("y").scale,o=a.getExtent(),s=i.getExtent(),l=a.parse(r[0]),c=i.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),c),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(r,n){var a=[];if(this._invTransform)return jt(a,r,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return a[0]=i.coordToData(i.toLocalCoord(r[0]),n),a[1]=o.coordToData(o.toLocalCoord(r[1]),n),a},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),a=this.getAxis("y").getGlobalExtent(),i=Math.min(n[0],n[1])-r,o=Math.min(a[0],a[1])-r,s=Math.max(n[0],n[1])-i+r,l=Math.max(a[0],a[1])-o+r;return new Fe(i,o,s,l)},e})($I),Go=it();function gb(t,e){var r=ue(e,function(n){return t.scale.parse(n)});return t.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function UI(t){var e=t.getLabelModel().get("customValues");if(e){var r=bi(t),n=t.scale.getExtent(),a=gb(t,e),i=dt(a,function(o){return o>=n[0]&&o<=n[1]});return{labels:ue(i,function(o){var s={value:o};return{formattedLabel:r(s),rawLabel:t.scale.getLabel(s),tickValue:o}})}}return t.type==="category"?qI(t):ZI(t)}function YI(t,e){var r=t.getTickModel().get("customValues");if(r){var n=t.scale.getExtent(),a=gb(t,r);return{ticks:dt(a,function(i){return i>=n[0]&&i<=n[1]})}}return t.type==="category"?XI(t,e):{ticks:ue(t.scale.getTicks(),function(i){return i.value})}}function qI(t){var e=t.getLabelModel(),r=mb(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function mb(t,e){var r=yb(t,"labels"),n=kd(e),a=_b(r,n);if(a)return a;var i,o;return ye(n)?i=wb(t,n):(o=n==="auto"?KI(t):n,i=xb(t,o)),bb(r,n,{labels:i,labelCategoryInterval:o})}function XI(t,e){var r=yb(t,"ticks"),n=kd(e),a=_b(r,n);if(a)return a;var i,o;if((!e.get("show")||t.scale.isBlank())&&(i=[]),ye(n))i=wb(t,n,!0);else if(n==="auto"){var s=mb(t,t.getLabelModel());o=s.labelCategoryInterval,i=ue(s.labels,function(l){return l.tickValue})}else o=n,i=xb(t,o,!0);return bb(r,n,{ticks:i,tickCategoryInterval:o})}function ZI(t){var e=t.scale.getTicks(),r=bi(t);return{labels:ue(e,function(n,a){return{level:n.level,formattedLabel:r(n,a),rawLabel:t.scale.getLabel(n),tickValue:n.value}})}}function yb(t,e){return Go(t)[e]||(Go(t)[e]=[])}function _b(t,e){for(var r=0;r<t.length;r++)if(t[r].key===e)return t[r].value}function bb(t,e,r){return t.push({key:e,value:r}),r}function KI(t){var e=Go(t).autoInterval;return e??(Go(t).autoInterval=t.calculateCategoryInterval())}function jI(t){var e=QI(t),r=bi(t),n=(e.axisRotate-e.labelRotate)/180*Math.PI,a=t.scale,i=a.getExtent(),o=a.count();if(i[1]-i[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=i[0],c=t.dataToCoord(l+1)-t.dataToCoord(l),u=Math.abs(c*Math.cos(n)),f=Math.abs(c*Math.sin(n)),h=0,d=0;l<=i[1];l+=s){var p=0,m=0,g=Tu(r({value:l}),e.font,"center","top");p=g.width*1.3,m=g.height*1.3,h=Math.max(h,p,7),d=Math.max(d,m,7)}var v=h/u,y=d/f;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var b=Math.max(0,Math.floor(Math.min(v,y))),x=Go(t.model),S=t.getExtent(),w=x.lastAutoInterval,k=x.lastTickCount;return w!=null&&k!=null&&Math.abs(w-b)<=1&&Math.abs(k-o)<=1&&w>b&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?b=w:(x.lastTickCount=o,x.lastAutoInterval=b,x.axisExtent0=S[0],x.axisExtent1=S[1]),b}function QI(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function xb(t,e,r){var n=bi(t),a=t.scale,i=a.getExtent(),o=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),c=i[0],u=a.count();c!==0&&l>1&&u/l>2&&(c=Math.round(Math.ceil(c/l)*l));var f=db(t),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&c!==i[0]&&m(i[0]);for(var p=c;p<=i[1];p+=l)m(p);d&&p-l!==i[1]&&m(i[1]);function m(g){var v={value:g};s.push(r?g:{formattedLabel:n(v),rawLabel:a.getLabel(v),tickValue:g})}return s}function wb(t,e,r){var n=t.scale,a=bi(t),i=[];return D(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;e(o.value,s)&&i.push(r?l:{formattedLabel:a(o),rawLabel:s,tickValue:l})}),i}var Sb=[0,1],JI=(function(){function t(e,r,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=n||[0,0]}return t.prototype.contain=function(e){var r=this._extent,n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return e>=n&&e<=a},t.prototype.containData=function(e){return this.scale.contain(e)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(e){return pg(e||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(e,r){var n=this._extent;n[0]=e,n[1]=r},t.prototype.dataToCoord=function(e,r){var n=this._extent,a=this.scale;return e=a.normalize(e),this.onBand&&a.type==="ordinal"&&(n=n.slice(),kb(n,a.count())),ia(e,Sb,n,r)},t.prototype.coordToData=function(e,r){var n=this._extent,a=this.scale;this.onBand&&a.type==="ordinal"&&(n=n.slice(),kb(n,a.count()));var i=ia(e,n,Sb,r);return this.scale.scale(i)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),n=YI(this,r),a=n.ticks,i=ue(a,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return eL(this,i,o,e.clamp),i},t.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),a=ue(n,function(i){return ue(i,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return a},t.prototype.getViewLabels=function(){return UI(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var e=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var a=Math.abs(e[1]-e[0]);return Math.abs(a)/n},t.prototype.calculateCategoryInterval=function(){return jI(this)},t})();function kb(t,e){var r=t[1]-t[0],n=e,a=r/n/2;t[0]+=a,t[1]-=a}function eL(t,e,r,n){var a=e.length;if(!t.onBand||r||!a)return;var i=t.getExtent(),o,s;if(a===1)e[0].coord=i[0],o=e[1]={coord:i[1],tickValue:e[0].tickValue};else{var l=e[a-1].tickValue-e[0].tickValue,c=(e[a-1].coord-e[0].coord)/l;D(e,function(d){d.coord-=c/2});var u=t.scale.getExtent();s=1+u[1]-e[a-1].tickValue,o={coord:e[a-1].coord+c*s,tickValue:u[1]+1},e.push(o)}var f=i[0]>i[1];h(e[0].coord,i[0])&&(n?e[0].coord=i[0]:e.shift()),n&&h(i[0],e[0].coord)&&e.unshift({coord:i[0]}),h(i[1],o.coord)&&(n?o.coord=i[1]:e.pop()),n&&h(o.coord,i[1])&&e.push({coord:i[1]});function h(d,p){return d=lt(d),p=lt(p),f?d>p:d<p}}var tL=(function(t){Z(e,t);function e(r,n,a,i,o){var s=t.call(this,r,n,a)||this;return s.index=0,s.type=i||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e})(JI);function Cd(t,e,r){r=r||{};var n=t.coordinateSystem,a=e.axis,i={},o=a.getAxesOnZeroOf()[0],s=a.position,l=o?"onZero":s,c=a.dim,u=n.getRect(),f=[u.x,u.x+u.width,u.y,u.y+u.height],h={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,p=c==="x"?[f[2]-d,f[3]+d]:[f[0]-d,f[1]+d];if(o){var m=o.toGlobalCoord(o.dataToCoord(0));p[h.onZero]=Math.max(Math.min(m,p[1]),p[0])}i.position=[c==="y"?p[h[l]]:f[0],c==="x"?p[h[l]]:f[3]],i.rotation=Math.PI/2*(c==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};i.labelDirection=i.tickDirection=i.nameDirection=g[s],i.labelOffset=o?p[h[s]]-p[h.onZero]:0,e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),Vi(r.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var v=e.get(["axisLabel","rotate"]);return i.labelRotate=l==="top"?-v:v,i.z2=1,i}function Tb(t){return t.get("coordinateSystem")==="cartesian2d"}function Cb(t){var e={xAxisModel:null,yAxisModel:null};return D(e,function(r,n){var a=n.replace(/Model$/,""),i=t.getReferringComponents(a,Et).models[0];e[n]=i}),e}var Md=Math.log;function rL(t,e,r){var n=_i.prototype,a=n.getTicks.call(r),i=n.getTicks.call(r,!0),o=a.length-1,s=n.getInterval.call(r),l=fb(t,e),c=l.extent,u=l.fixMin,f=l.fixMax;if(t.type==="log"){var h=Md(t.base);c=[Md(c[0])/h,Md(c[1])/h]}t.setExtent(c[0],c[1]),t.calcNiceExtent({splitNumber:o,fixMin:u,fixMax:f});var d=n.getExtent.call(t);u&&(c[0]=d[0]),f&&(c[1]=d[1]);var p=n.getInterval.call(t),m=c[0],g=c[1];if(u&&f)p=(g-m)/o;else if(u)for(g=c[0]+p*o;g<c[1]&&isFinite(g)&&isFinite(c[1]);)p=bd(p),g=c[0]+p*o;else if(f)for(m=c[1]-p*o;m>c[0]&&isFinite(m)&&isFinite(c[0]);)p=bd(p),m=c[1]-p*o;else{var v=t.getTicks().length-1;v>o&&(p=bd(p));var y=p*o;g=Math.ceil(c[1]/p)*p,m=lt(g-y),m<0&&c[0]>=0?(m=0,g=lt(y)):g>0&&c[1]<=0&&(g=0,m=-lt(y))}var b=(a[0].value-i[0].value)/s,x=(a[o].value-i[o].value)/s;n.setExtent.call(t,m+p*b,g+p*x),n.setInterval.call(t,p),(b||x)&&n.setNiceExtent.call(t,m+p,g-p)}var nL=(function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Td,this._initCartesian(e,r,n),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var n=this._axesMap;this._updateScale(e,this.model);function a(o){var s,l=Qe(o),c=l.length;if(c){for(var u=[],f=c-1;f>=0;f--){var h=+l[f],d=o[h],p=d.model,m=d.scale;_d(m)&&p.get("alignTicks")&&p.get("interval")==null?u.push(d):(hb(m,p),_d(m)&&(s=d))}u.length&&(s||(s=u.pop(),hb(s.scale,s.model)),D(u,function(g){rL(g.scale,g.model,s.scale)}))}}a(n.x),a(n.y);var i={};D(n.x,function(o){Mb(n,"y",o,i)}),D(n.y,function(o){Mb(n,"x",o,i)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var a=e.getBoxLayoutParams(),i=!n&&e.get("containLabel"),o=Yl(a,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),i&&(D(s,function(c){if(!c.model.get(["axisLabel","inside"])){var u=HI(c);if(u){var f=c.isHorizontal()?"height":"width",h=c.model.get(["axisLabel","margin"]);o[f]-=u[f]+h,c.position==="top"?o.y+=u.height+h:c.position==="left"&&(o.x+=u.width+h)}}}),l()),D(this._coordsList,function(c){c.calcAffineTransform()});function l(){D(s,function(c){var u=c.isHorizontal(),f=u?[0,o.width]:[0,o.height],h=c.inverse?1:0;c.setExtent(f[h],f[1-h]),aL(c,u?o.x:o.y)})}},t.prototype.getAxis=function(e,r){var n=this._axesMap[e];if(n!=null)return n[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var n="x"+e+"y"+r;return this._coordsMap[n]}ce(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var a=0,i=this._coordsList;a<i.length;a++)if(i[a].getAxis("x").index===e||i[a].getAxis("y").index===r)return i[a]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(e,r,n){var a=this._findConvertTarget(r);return a.cartesian?a.cartesian.dataToPoint(n):a.axis?a.axis.toGlobalCoord(a.axis.dataToCoord(n)):null},t.prototype.convertFromPixel=function(e,r,n){var a=this._findConvertTarget(r);return a.cartesian?a.cartesian.pointToData(n):a.axis?a.axis.coordToData(a.axis.toLocalCoord(n)):null},t.prototype._findConvertTarget=function(e){var r=e.seriesModel,n=e.xAxisModel||r&&r.getReferringComponents("xAxis",Et).models[0],a=e.yAxisModel||r&&r.getReferringComponents("yAxis",Et).models[0],i=e.gridModel,o=this._coordsList,s,l;if(r)s=r.coordinateSystem,ze(o,s)<0&&(s=null);else if(n&&a)s=this.getCartesian(n.componentIndex,a.componentIndex);else if(n)l=this.getAxis("x",n.componentIndex);else if(a)l=this.getAxis("y",a.componentIndex);else if(i){var c=i.coordinateSystem;c===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},t.prototype.containPoint=function(e){var r=this._coordsList[0];if(r)return r.containPoint(e)},t.prototype._initCartesian=function(e,r,n){var a=this,i=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(r.eachComponent("xAxis",c("x"),this),r.eachComponent("yAxis",c("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,D(s.x,function(u,f){D(s.y,function(h,d){var p="x"+f+"y"+d,m=new WI(p);m.master=a,m.model=e,a._coordsMap[p]=m,a._coordsList.push(m),m.addAxis(u),m.addAxis(h)})});function c(u){return function(f,h){if(Ad(f,e)){var d=f.get("position");u==="x"?d!=="top"&&d!=="bottom"&&(d=o.bottom?"top":"bottom"):d!=="left"&&d!=="right"&&(d=o.left?"right":"left"),o[d]=!0;var p=new tL(u,zI(f),[0,0],f.get("type"),d),m=p.type==="category";p.onBand=m&&f.get("boundaryGap"),p.inverse=f.get("inverse"),f.axis=p,p.model=f,p.grid=i,p.index=h,i._axesList.push(p),s[u][h]=p,l[u]++}}}},t.prototype._updateScale=function(e,r){D(this._axesList,function(a){if(a.scale.setExtent(1/0,-1/0),a.type==="category"){var i=a.model.get("categorySortInfo");a.scale.setSortInfo(i)}}),e.eachSeries(function(a){if(Tb(a)){var i=Cb(a),o=i.xAxisModel,s=i.yAxisModel;if(!Ad(o,r)||!Ad(s,r))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),c=a.getData(),u=l.getAxis("x"),f=l.getAxis("y");n(c,u),n(c,f)}},this);function n(a,i){D(pb(a,i.dim),function(o){i.scale.unionExtentFromData(a,o)})}},t.prototype.getTooltipAxes=function(e){var r=[],n=[];return D(this.getCartesians(),function(a){var i=e!=null&&e!=="auto"?a.getAxis(e):a.getBaseAxis(),o=a.getOtherAxis(i);ze(r,i)<0&&r.push(i),ze(n,o)<0&&n.push(o)}),{baseAxes:r,otherAxes:n}},t.create=function(e,r){var n=[];return e.eachComponent("grid",function(a,i){var o=new t(a,e,r);o.name="grid_"+i,o.resize(a,r,!0),a.coordinateSystem=o,n.push(o)}),e.eachSeries(function(a){if(Tb(a)){var i=Cb(a),o=i.xAxisModel,s=i.yAxisModel,l=o.getCoordSysModel(),c=l.coordinateSystem;a.coordinateSystem=c.getCartesian(o.componentIndex,s.componentIndex)}}),n},t.dimensions=Td,t})();function Ad(t,e){return t.getCoordSysModel()===e}function Mb(t,e,r,n){r.getAxesOnZeroOf=function(){return i?[i]:[]};var a=t[e],i,o=r.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)Ab(a[l])&&(i=a[l]);else for(var c in a)if(a.hasOwnProperty(c)&&Ab(a[c])&&!n[u(a[c])]){i=a[c];break}i&&(n[u(i)]=!0);function u(f){return f.dim+"_"+f.index}}function Ab(t){return t&&t.type!=="category"&&t.type!=="time"&&FI(t)}function aL(t,e){var r=t.getExtent(),n=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(a){return a+e}:function(a){return n-a+e},t.toLocalCoord=t.dim==="x"?function(a){return a-e}:function(a){return n-a+e}}var Ln=Math.PI,Pn=(function(){function t(e,r){this.group=new mt,this.opt=r,this.axisModel=e,Ne(r,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new mt({x:r.position[0],y:r.position[1],rotation:r.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(e){return!!Db[e]},t.prototype.add=function(e){Db[e](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(e,r,n){var a=vg(r-e),i,o;return rl(a)?(o=n>0?"top":"bottom",i="center"):rl(a-Ln)?(o=n>0?"bottom":"top",i="center"):(o="middle",a>0&&a<Ln?i=n>0?"right":"left":i=n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t})(),Db={axisLine:function(t,e,r,n){var a=e.get(["axisLine","show"]);if(a==="auto"&&t.handleAutoShown&&(a=t.handleAutoShown("axisLine")),!!a){var i=e.axis.getExtent(),o=n.transform,s=[i[0],0],l=[i[1],0],c=s[0]>l[0];o&&(jt(s,s,o),jt(l,l,o));var u=U({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),f=new xn({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});po(f.shape,f.style.lineWidth),f.anid="line",r.add(f);var h=e.get(["axisLine","symbol"]);if(h!=null){var d=e.get(["axisLine","symbolSize"]);ne(h)&&(h=[h,h]),(ne(d)||Ke(d))&&(d=[d,d]);var p=Ey(e.get(["axisLine","symbolOffset"])||0,d),m=d[0],g=d[1];D([{rotate:t.rotation+Math.PI/2,offset:p[0],r:0},{rotate:t.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(v,y){if(h[y]!=="none"&&h[y]!=null){var b=di(h[y],-m/2,-g/2,m,g,u.stroke,!0),x=v.r+v.offset,S=c?l:s;b.attr({rotation:v.rotate,x:S[0]+x*Math.cos(t.rotation),y:S[1]-x*Math.sin(t.rotation),silent:!0,z2:11}),r.add(b)}})}}},axisTickLabel:function(t,e,r,n){var a=sL(r,n,e,t),i=cL(r,n,e,t);if(oL(e,i,a),lL(r,n,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=tA(ue(i,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));rA(o)}},axisName:function(t,e,r,n){var a=Vi(t.axisName,e.get("name"));if(a){var i=e.get("nameLocation"),o=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,c=e.axis.getExtent(),u=c[0]>c[1]?-1:1,f=[i==="start"?c[0]-u*l:i==="end"?c[1]+u*l:(c[0]+c[1])/2,Lb(i)?t.labelOffset+o*l:0],h,d=e.get("nameRotate");d!=null&&(d=d*Ln/180);var p;Lb(i)?h=Pn.innerTextLayout(t.rotation,d??t.rotation,o):(h=iL(t.rotation,i,d||0,c),p=t.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(h.rotation)),!isFinite(p)&&(p=null)));var m=s.getFont(),g=e.get("nameTruncate",!0)||{},v=g.ellipsis,y=Vi(t.nameTruncateMaxWidth,g.maxWidth,p),b=new Pt({x:f[0],y:f[1],rotation:h.rotation,silent:Pn.isLabelSilent(e),style:ri(s,{text:a,font:m,overflow:"truncate",width:y,ellipsis:v,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||h.textAlign,verticalAlign:s.get("verticalAlign")||h.textVerticalAlign}),z2:1});if(Sl({el:b,componentModel:e,itemName:a}),b.__fullText=a,b.anid="name",e.get("triggerEvent")){var x=Pn.makeAxisEventDataBase(e);x.targetType="axisName",x.name=a,Ve(b).eventData=x}n.add(b),b.updateTransform(),r.add(b),b.decomposeTransform()}}};function iL(t,e,r,n){var a=vg(r-t),i,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return rl(a-Ln/2)?(o=l?"bottom":"top",i="center"):rl(a-Ln*1.5)?(o=l?"top":"bottom",i="center"):(o="middle",a<Ln*1.5&&a>Ln/2?i=l?"left":"right":i=l?"right":"left"),{rotation:a,textAlign:i,textVerticalAlign:o}}function oL(t,e,r){if(!db(t.axis)){var n=t.get(["axisLabel","showMinLabel"]),a=t.get(["axisLabel","showMaxLabel"]);e=e||[],r=r||[];var i=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],c=r[0],u=r[1],f=r[r.length-1],h=r[r.length-2];n===!1?(lr(i),lr(c)):Ib(i,o)&&(n?(lr(o),lr(u)):(lr(i),lr(c))),a===!1?(lr(s),lr(f)):Ib(l,s)&&(a?(lr(l),lr(h)):(lr(s),lr(f)))}}function lr(t){t&&(t.ignore=!0)}function Ib(t,e){var r=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!r||!n)){var a=xu([]);return Su(a,a,-t.rotation),r.applyTransform(Fa([],a,t.getLocalTransform())),n.applyTransform(Fa([],a,e.getLocalTransform())),r.intersect(n)}}function Lb(t){return t==="middle"||t==="center"}function Pb(t,e,r,n,a){for(var i=[],o=[],s=[],l=0;l<t.length;l++){var c=t[l].coord;o[0]=c,o[1]=0,s[0]=c,s[1]=r,e&&(jt(o,o,e),jt(s,s,e));var u=new xn({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:n,z2:2,autoBatch:!0,silent:!0});po(u.shape,u.style.lineWidth),u.anid=a+"_"+t[l].tickValue,i.push(u)}return i}function sL(t,e,r,n){var a=r.axis,i=r.getModel("axisTick"),o=i.get("show");if(o==="auto"&&n.handleAutoShown&&(o=n.handleAutoShown("axisTick")),!(!o||a.scale.isBlank())){for(var s=i.getModel("lineStyle"),l=n.tickDirection*i.get("length"),c=a.getTicksCoords(),u=Pb(c,e.transform,l,Ne(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),f=0;f<u.length;f++)t.add(u[f]);return u}}function lL(t,e,r,n){var a=r.axis,i=r.getModel("minorTick");if(!(!i.get("show")||a.scale.isBlank())){var o=a.getMinorTicksCoords();if(o.length)for(var s=i.getModel("lineStyle"),l=n*i.get("length"),c=Ne(s.getLineStyle(),Ne(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),u=0;u<o.length;u++)for(var f=Pb(o[u],e.transform,l,c,"minorticks_"+u),h=0;h<f.length;h++)t.add(f[h])}}function cL(t,e,r,n){var a=r.axis,i=Vi(n.axisLabelShow,r.get(["axisLabel","show"]));if(!(!i||a.scale.isBlank())){var o=r.getModel("axisLabel"),s=o.get("margin"),l=a.getViewLabels(),c=(Vi(n.labelRotate,o.get("rotate"))||0)*Ln/180,u=Pn.innerTextLayout(n.rotation,c,n.labelDirection),f=r.getCategories&&r.getCategories(!0),h=[],d=Pn.isLabelSilent(r),p=r.get("triggerEvent");return D(l,function(m,g){var v=a.scale.type==="ordinal"?a.scale.getRawOrdinalNumber(m.tickValue):m.tickValue,y=m.formattedLabel,b=m.rawLabel,x=o;if(f&&f[v]){var S=f[v];ce(S)&&S.textStyle&&(x=new et(S.textStyle,o,r.ecModel))}var w=x.getTextColor()||r.get(["axisLine","lineStyle","color"]),k=a.dataToCoord(v),T=x.getShallow("align",!0)||u.textAlign,C=Ce(x.getShallow("alignMinLabel",!0),T),A=Ce(x.getShallow("alignMaxLabel",!0),T),M=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||u.textVerticalAlign,I=Ce(x.getShallow("verticalAlignMinLabel",!0),M),L=Ce(x.getShallow("verticalAlignMaxLabel",!0),M),P=new Pt({x:k,y:n.labelOffset+n.labelDirection*s,rotation:u.rotation,silent:d,z2:10+(m.level||0),style:ri(x,{text:y,align:g===0?C:g===l.length-1?A:T,verticalAlign:g===0?I:g===l.length-1?L:M,fill:ye(w)?w(a.type==="category"?b:a.type==="value"?v+"":v,g):w})});if(P.anid="label_"+v,Sl({el:P,componentModel:r,itemName:y,formatterParamsExtra:{isTruncated:function(){return P.isTruncated},value:b,tickIndex:g}}),p){var N=Pn.makeAxisEventDataBase(r);N.targetType="axisLabel",N.value=b,N.tickIndex=g,a.type==="category"&&(N.dataIndex=v),Ve(P).eventData=N}e.add(P),P.updateTransform(),h.push(P),t.add(P),P.decomposeTransform()}),h}}function uL(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return fL(r,t,e),r.seriesInvolved&&dL(r,t),r}function fL(t,e,r){var n=e.getComponent("tooltip"),a=e.getComponent("axisPointer"),i=a.get("link",!0)||[],o=[];D(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=$o(s.model),c=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var u=s.model,f=u.getModel("tooltip",n);if(D(s.getAxes(),at(m,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var h=f.get("trigger")==="axis",d=f.get(["axisPointer","type"])==="cross",p=s.getTooltipAxes(f.get(["axisPointer","axis"]));(h||d)&&D(p.baseAxes,at(m,d?"cross":!0,h)),d&&D(p.otherAxes,at(m,"cross",!1))}function m(g,v,y){var b=y.model.getModel("axisPointer",a),x=b.get("show");if(!(!x||x==="auto"&&!g&&!Ld(b))){v==null&&(v=b.get("triggerTooltip")),b=g?hL(y,f,a,e,g,v):b;var S=b.get("snap"),w=b.get("triggerEmphasis"),k=$o(y.model),T=v||S||y.type==="category",C=t.axesInfo[k]={key:k,axis:y,coordSys:s,axisPointerModel:b,triggerTooltip:v,triggerEmphasis:w,involveSeries:T,snap:S,useHandle:Ld(b),seriesModels:[],linkGroup:null};c[k]=C,t.seriesInvolved=t.seriesInvolved||T;var A=pL(i,y);if(A!=null){var M=o[A]||(o[A]={axesInfo:{}});M.axesInfo[k]=C,M.mapper=i[A].mapper,C.linkGroup=M}}}})}function hL(t,e,r,n,a,i){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};D(s,function(h){l[h]=Te(o.get(h))}),l.snap=t.type!=="category"&&!!i,o.get("type")==="cross"&&(l.type="line");var c=l.label||(l.label={});if(c.show==null&&(c.show=!1),a==="cross"){var u=o.get(["label","show"]);if(c.show=u??!0,!i){var f=l.lineStyle=o.get("crossStyle");f&&Ne(c,f.textStyle)}}return t.model.getModel("axisPointer",new et(l,r,n))}function dL(t,e){e.eachSeries(function(r){var n=r.coordinateSystem,a=r.get(["tooltip","trigger"],!0),i=r.get(["tooltip","show"],!0);!n||a==="none"||a===!1||a==="item"||i===!1||r.get(["axisPointer","show"],!0)===!1||D(t.coordSysAxesInfo[$o(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function pL(t,e){for(var r=e.model,n=e.dim,a=0;a<t.length;a++){var i=t[a]||{};if(Dd(i[n+"AxisId"],r.id)||Dd(i[n+"AxisIndex"],r.componentIndex)||Dd(i[n+"AxisName"],r.name))return a}}function Dd(t,e){return t==="all"||ee(t)&&ze(t,e)>=0||t===e}function vL(t){var e=Id(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,a=r.option,i=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=Ld(r);i==null&&(a.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),a.value=o,s&&(a.status=e.axis.scale.isBlank()?"hide":"show")}}function Id(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[$o(t)]}function gL(t){var e=Id(t);return e&&e.axisPointerModel}function Ld(t){return!!t.get(["handle","show"])}function $o(t){return t.type+"||"+t.id}var Rb={},Eb=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a,i){this.axisPointerClass&&vL(r),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(r,a,!0)},e.prototype.updateAxisPointer=function(r,n,a,i){this._doUpdateAxisPointerClass(r,a,!1)},e.prototype.remove=function(r,n){var a=this._axisPointer;a&&a.remove(n)},e.prototype.dispose=function(r,n){this._disposeAxisPointer(n),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(r,n,a){var i=e.getAxisPointerClass(this.axisPointerClass);if(i){var o=gL(r);o?(this._axisPointer||(this._axisPointer=new i)).render(r,o,n,a):this._disposeAxisPointer(n)}},e.prototype._disposeAxisPointer=function(r){this._axisPointer&&this._axisPointer.dispose(r),this._axisPointer=null},e.registerAxisPointerClass=function(r,n){Rb[r]=n},e.getAxisPointerClass=function(r){return r&&Rb[r]},e.type="axis",e})(gr),Pd=it();function mL(t,e,r,n){var a=r.axis;if(!a.scale.isBlank()){var i=r.getModel("splitArea"),o=i.getModel("areaStyle"),s=o.get("color"),l=n.coordinateSystem.getRect(),c=a.getTicksCoords({tickModel:i,clamp:!0});if(c.length){var u=s.length,f=Pd(t).splitAreaColors,h=de(),d=0;if(f)for(var p=0;p<c.length;p++){var m=f.get(c[p].tickValue);if(m!=null){d=(m+(u-1)*p)%u;break}}var g=a.toGlobalCoord(c[0].coord),v=o.getAreaStyle();s=ee(s)?s:[s];for(var p=1;p<c.length;p++){var y=a.toGlobalCoord(c[p].coord),b=void 0,x=void 0,S=void 0,w=void 0;a.isHorizontal()?(b=g,x=l.y,S=y-b,w=l.height,g=b+S):(b=l.x,x=g,S=l.width,w=y-x,g=x+w);var k=c[p-1].tickValue;k!=null&&h.set(k,d),e.add(new ft({anid:k!=null?"area_"+k:null,shape:{x:b,y:x,width:S,height:w},style:Ne({fill:s[d]},v),autoBatch:!0,silent:!0})),d=(d+1)%u}Pd(t).splitAreaColors=h}}}function yL(t){Pd(t).splitAreaColors=null}var _L=["axisLine","axisTickLabel","axisName"],bL=["splitArea","splitLine","minorSplitLine"],Ob=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="CartesianAxisPointer",r}return e.prototype.render=function(r,n,a,i){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new mt,this.group.add(this._axisGroup),!!r.get("show")){var s=r.getCoordSysModel(),l=Cd(s,r),c=new Pn(r,U({handleAutoShown:function(f){for(var h=s.coordinateSystem.getCartesians(),d=0;d<h.length;d++)if(_d(h[d].getOtherAxis(r.axis).scale))return!0;return!1}},l));D(_L,c.add,c),this._axisGroup.add(c.getGroup()),D(bL,function(f){r.get([f,"show"])&&xL[f](this,this._axisGroup,r,s)},this);var u=i&&i.type==="changeAxisOrder"&&i.isInitSort;u||fm(o,this._axisGroup,r),t.prototype.render.call(this,r,n,a,i)}},e.prototype.remove=function(){yL(this)},e.type="cartesianAxis",e})(Eb),xL={splitLine:function(t,e,r,n){var a=r.axis;if(!a.scale.isBlank()){var i=r.getModel("splitLine"),o=i.getModel("lineStyle"),s=o.get("color"),l=i.get("showMinLine")!==!1,c=i.get("showMaxLine")!==!1;s=ee(s)?s:[s];for(var u=n.coordinateSystem.getRect(),f=a.isHorizontal(),h=0,d=a.getTicksCoords({tickModel:i}),p=[],m=[],g=o.getLineStyle(),v=0;v<d.length;v++){var y=a.toGlobalCoord(d[v].coord);if(!(v===0&&!l||v===d.length-1&&!c)){var b=d[v].tickValue;f?(p[0]=y,p[1]=u.y,m[0]=y,m[1]=u.y+u.height):(p[0]=u.x,p[1]=y,m[0]=u.x+u.width,m[1]=y);var x=h++%s.length,S=new xn({anid:b!=null?"line_"+b:null,autoBatch:!0,shape:{x1:p[0],y1:p[1],x2:m[0],y2:m[1]},style:Ne({stroke:s[x]},g),silent:!0});po(S.shape,g.lineWidth),e.add(S)}}}},minorSplitLine:function(t,e,r,n){var a=r.axis,i=r.getModel("minorSplitLine"),o=i.getModel("lineStyle"),s=n.coordinateSystem.getRect(),l=a.isHorizontal(),c=a.getMinorTicksCoords();if(c.length)for(var u=[],f=[],h=o.getLineStyle(),d=0;d<c.length;d++)for(var p=0;p<c[d].length;p++){var m=a.toGlobalCoord(c[d][p].coord);l?(u[0]=m,u[1]=s.y,f[0]=m,f[1]=s.y+s.height):(u[0]=s.x,u[1]=m,f[0]=s.x+s.width,f[1]=m);var g=new xn({anid:"minor_line_"+c[d][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:f[0],y2:f[1]},style:h,silent:!0});po(g.shape,h.lineWidth),e.add(g)}},splitArea:function(t,e,r,n){mL(t,e,r,n)}},Nb=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="xAxis",e})(Ob),wL=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Nb.type,r}return e.type="yAxis",e})(Ob),SL=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="grid",r}return e.prototype.render=function(r,n){this.group.removeAll(),r.get("show")&&this.group.add(new ft({shape:r.coordinateSystem.getRect(),style:Ne({fill:r.get("backgroundColor")},r.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e})(gr),Bb={offset:0};function kL(t){t.registerComponentView(SL),t.registerComponentModel(hI),t.registerCoordinateSystem("cartesian2d",nL),rb(t,"x",gd,Bb),rb(t,"y",gd,Bb),t.registerComponentView(Nb),t.registerComponentView(wL),t.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var zb="\0_ec_interaction_mutex";function Fb(t,e){return!!TL(t)[e]}function TL(t){return t[zb]||(t[zb]={})}ya({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Ct);var CL=(function(t){Z(e,t);function e(r){var n=t.call(this)||this;n._zr=r;var a=Le(n._mousedownHandler,n),i=Le(n._mousemoveHandler,n),o=Le(n._mouseupHandler,n),s=Le(n._mousewheelHandler,n),l=Le(n._pinchHandler,n);return n.enable=function(c,u){this.disable(),this._opt=Ne(Te(u)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),c==null&&(c=!0),(c===!0||c==="move"||c==="pan")&&(r.on("mousedown",a),r.on("mousemove",i),r.on("mouseup",o)),(c===!0||c==="scale"||c==="zoom")&&(r.on("mousewheel",s),r.on("pinch",l))},n.disable=function(){r.off("mousedown",a),r.off("mousemove",i),r.off("mouseup",o),r.off("mousewheel",s),r.off("pinch",l)},n}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(r){this.pointerChecker=r},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(r){if(!b0(r)){for(var n=r.target;n;){if(n.draggable)return;n=n.__hostTarget||n.parent}var a=r.offsetX,i=r.offsetY;this.pointerChecker&&this.pointerChecker(r,a,i)&&(this._x=a,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(r){if(!(!this._dragging||!Tc("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||Fb(this._zr,"globalPan"))){var n=r.offsetX,a=r.offsetY,i=this._x,o=this._y,s=n-i,l=a-o;this._x=n,this._y=a,this._opt.preventDefaultMouseMove&&ec(r.event),Hb(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:i,oldY:o,newX:n,newY:a,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){b0(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var n=Tc("zoomOnMouseWheel",r,this._opt),a=Tc("moveOnMouseWheel",r,this._opt),i=r.wheelDelta,o=Math.abs(i),s=r.offsetX,l=r.offsetY;if(!(i===0||!n&&!a)){if(n){var c=o>3?1.4:o>1?1.2:1.1,u=i>0?c:1/c;Rd(this,"zoom","zoomOnMouseWheel",r,{scale:u,originX:s,originY:l,isAvailableBehavior:null})}if(a){var f=Math.abs(i),h=(i>0?1:-1)*(f>3?.4:f>1?.15:.05);Rd(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!Fb(this._zr,"globalPan")){var n=r.pinchScale>1?1.1:1/1.1;Rd(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e})(ur);function Rd(t,e,r,n,a){t.pointerChecker&&t.pointerChecker(n,a.originX,a.originY)&&(ec(n.event),Hb(t,e,r,n,a))}function Hb(t,e,r,n,a){a.isAvailableBehavior=Le(Tc,null,r,n),t.trigger(e,a)}function Tc(t,e,r){var n=r[t];return!t||n&&(!ne(n)||e.event[n+"Key"])}function Ed(t,e,r,n,a,i){t=t||0;var o=r[1]-r[0];if(a!=null&&(a=xi(a,[0,o])),i!=null&&(i=Math.max(i,a??0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=xi(s,[0,o]),a=i=xi(s,[a,i]),n=0}e[0]=xi(e[0],r),e[1]=xi(e[1],r);var l=Od(e,n);e[n]+=t;var c=a||0,u=r.slice();l.sign<0?u[0]+=c:u[1]-=c,e[n]=xi(e[n],u);var f;return f=Od(e,n),a!=null&&(f.sign!==l.sign||f.span<a)&&(e[1-n]=e[n]+l.sign*a),f=Od(e,n),i!=null&&f.span>i&&(e[1-n]=e[n]+f.sign*i),e}function Od(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function xi(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var xa=it(),Vb=Te,Nd=Le,ML=(function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,a){var i=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!a&&this._lastValue===i&&this._lastStatus===o)){this._lastValue=i,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var c={};this.makeElOption(c,i,e,r,n);var u=c.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var f=this._moveAnimation=this.determineAnimation(e,r);if(!s)s=this._group=new mt,this.createPointerEl(s,c,e,r),this.createLabelEl(s,c,e,r),n.getZr().add(s);else{var h=at(Gb,r,f);this.updatePointerEl(s,c,h),this.updateLabelEl(s,c,h,r)}Ub(s,r,!0),this._renderHandle(i)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var n=r.get("animation"),a=e.axis,i=a.type==="category",o=r.get("snap");if(!o&&!i)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(i&&a.getBandWidth()>s)return!0;if(o){var l=Id(e).seriesDataCount,c=a.getExtent();return Math.abs(c[0]-c[1])/l>s}return!1}return n===!0},t.prototype.makeElOption=function(e,r,n,a,i){},t.prototype.createPointerEl=function(e,r,n,a){var i=r.pointer;if(i){var o=xa(e).pointerEl=new YT[i.type](Vb(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,a){if(r.label){var i=xa(e).labelEl=new Pt(Vb(r.label));e.add(i),Wb(i,a)}},t.prototype.updatePointerEl=function(e,r,n){var a=xa(e).pointerEl;a&&r.pointer&&(a.setStyle(r.pointer.style),n(a,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,n,a){var i=xa(e).labelEl;i&&(i.setStyle(r.label.style),n(i,{x:r.label.x,y:r.label.y}),Wb(i,a))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),a=this._handle,i=r.getModel("handle"),o=r.get("status");if(!i.get("show")||!o||o==="hide"){a&&n.remove(a),this._handle=null;return}var s;this._handle||(s=!0,a=this._handle=Bf(i.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(c){ec(c.event)},onmousedown:Nd(this._onHandleDragMove,this,0,0),drift:Nd(this._onHandleDragMove,this),ondragend:Nd(this._onHandleDragEnd,this)}),n.add(a)),Ub(a,r,!1),a.setStyle(i.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=i.get("size");ee(l)||(l=[l,l]),a.scaleX=l[0]/2,a.scaleY=l[1]/2,Dh(this,"_doDispatchAxisPointer",i.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){Gb(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Bd(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var n=this._handle;if(n){this._dragging=!0;var a=this.updateHandleTransform(Bd(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=a,n.stopAnimation(),n.attr(Bd(a)),xa(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),n=this._group,a=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),a&&r.remove(a),this._group=null,this._handle=null,this._payloadInfo=null),Ih(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,n){return n=n||0,{x:e[n],y:e[1-n],width:r[n],height:r[1-n]}},t})();function Gb(t,e,r,n){$b(xa(r).lastProp,n)||(xa(r).lastProp=n,e?Ut(r,n,t):(r.stopAnimation(),r.attr(n)))}function $b(t,e){if(ce(t)&&ce(e)){var r=!0;return D(e,function(n,a){r=r&&$b(t[a],n)}),!!r}else return t===e}function Wb(t,e){t[e.get(["label","show"])?"show":"hide"]()}function Bd(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function Ub(t,e,r){var n=e.get("z"),a=e.get("zlevel");t&&t.traverse(function(i){i.type!=="group"&&(n!=null&&(i.z=n),a!=null&&(i.zlevel=a),i.silent=r)})}function AL(t){var e=t.get("type"),r=t.getModel(e+"Style"),n;return e==="line"?(n=r.getLineStyle(),n.fill=null):e==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function DL(t,e,r,n,a){var i=r.get("value"),o=Yb(i,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=$l(s.get("padding")||0),c=s.getFont(),u=Tu(o,c),f=a.position,h=u.width+l[1]+l[3],d=u.height+l[0]+l[2],p=a.align;p==="right"&&(f[0]-=h),p==="center"&&(f[0]-=h/2);var m=a.verticalAlign;m==="bottom"&&(f[1]-=d),m==="middle"&&(f[1]-=d/2),IL(f,h,d,n);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=e.get(["axisLine","lineStyle","color"])),t.label={x:f[0],y:f[1],style:ri(s,{text:o,font:c,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function IL(t,e,r,n){var a=n.getWidth(),i=n.getHeight();t[0]=Math.min(t[0]+e,a)-e,t[1]=Math.min(t[1]+r,i)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Yb(t,e,r,n,a){t=e.scale.parse(t);var i=e.scale.getLabel({value:t},{precision:a.precision}),o=a.formatter;if(o){var s={value:Sd(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};D(n,function(l){var c=r.getSeriesByIndex(l.seriesIndex),u=l.dataIndexInside,f=c&&c.getDataParams(u);f&&s.seriesData.push(f)}),ne(o)?i=o.replace("{value}",i):ye(o)&&(i=o(s))}return i}function qb(t,e,r){var n=za();return Su(n,n,r.rotation),wu(n,n,r.position),Nf([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function LL(t,e,r,n,a,i){var o=Pn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=a.get(["label","margin"]),DL(e,n,a,i,{position:qb(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function PL(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function RL(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}var EL=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,a,i,o){var s=a.axis,l=s.grid,c=i.get("type"),u=Xb(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(c&&c!=="none"){var h=AL(i),d=OL[c](s,f,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var p=Cd(l.model,a);LL(n,r,p,a,i,o)},e.prototype.getHandleTransform=function(r,n,a){var i=Cd(n.axis.grid.model,n,{labelInside:!1});i.labelMargin=a.get(["handle","margin"]);var o=qb(n.axis,r,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,a,i){var o=a.axis,s=o.grid,l=o.getGlobalExtent(!0),c=Xb(s,o).getOtherAxis(o).getGlobalExtent(),u=o.dim==="x"?0:1,f=[r.x,r.y];f[u]+=n[u],f[u]=Math.min(l[1],f[u]),f[u]=Math.max(l[0],f[u]);var h=(c[1]+c[0])/2,d=[h,h];d[u]=f[u];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:d,tooltipOption:p[u]}},e})(ML);function Xb(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var OL={line:function(t,e,r){var n=PL([e,r[0]],[e,r[1]],Zb(t));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(t,e,r){var n=Math.max(1,t.getBandWidth()),a=r[1]-r[0];return{type:"Rect",shape:RL([e-n/2,r[0]],[n,a],Zb(t))}}};function Zb(t){return t.dim==="x"?0:1}var NL=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e})(We),nn=it(),BL=D;function Kb(t,e,r){if(!ge.node){var n=e.getZr();nn(n).records||(nn(n).records={}),zL(n,e);var a=nn(n).records[t]||(nn(n).records[t]={});a.handler=r}}function zL(t,e){if(nn(t).initialized)return;nn(t).initialized=!0,r("click",at(jb,"click")),r("mousemove",at(jb,"mousemove")),r("globalout",HL);function r(n,a){t.on(n,function(i){var o=VL(e);BL(nn(t).records,function(s){s&&a(s,i,o.dispatchAction)}),FL(o.pendings,e)})}}function FL(t,e){var r=t.showTip.length,n=t.hideTip.length,a;r?a=t.showTip[r-1]:n&&(a=t.hideTip[n-1]),a&&(a.dispatchAction=null,e.dispatchAction(a))}function HL(t,e,r){t.handler("leave",null,r)}function jb(t,e,r,n){e.handler(t,r,n)}function VL(t){var e={showTip:[],hideTip:[]},r=function(n){var a=e[n.type];a?a.push(n):(n.dispatchAction=r,t.dispatchAction(n))};return{dispatchAction:r,pendings:e}}function zd(t,e){if(!ge.node){var r=e.getZr(),n=(nn(r).records||{})[t];n&&(nn(r).records[t]=null)}}var GL=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a){var i=n.getComponent("tooltip"),o=r.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";Kb("axisPointer",a,function(s,l,c){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&c({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){zd("axisPointer",n)},e.prototype.dispose=function(r,n){zd("axisPointer",n)},e.type="axisPointer",e})(gr);function Qb(t,e){var r=[],n=t.seriesIndex,a;if(n==null||!(a=e.getSeriesByIndex(n)))return{point:[]};var i=a.getData(),o=oa(i,t);if(o==null||o<0||ee(o))return{point:[]};var s=i.getItemGraphicEl(o),l=a.coordinateSystem;if(a.getTooltipPosition)r=a.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(t.isStacked){var c=l.getBaseAxis(),u=l.getOtherAxis(c),f=u.dim,h=c.dim,d=f==="x"||f==="radius"?1:0,p=i.mapDimension(h),m=[];m[d]=i.get(p,o),m[1-d]=i.get(i.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(i.getValues(ue(l.dimensions,function(v){return i.mapDimension(v)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var Jb=it();function $L(t,e,r){var n=t.currTrigger,a=[t.x,t.y],i=t,o=t.dispatchAction||Le(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Cc(a)&&(a=Qb({seriesIndex:i.seriesIndex,dataIndex:i.dataIndex},e).point);var l=Cc(a),c=i.axesInfo,u=s.axesInfo,f=n==="leave"||Cc(a),h={},d={},p={list:[],map:{}},m={showPointer:at(UL,d),showTooltip:at(YL,p)};D(s.coordSysMap,function(v,y){var b=l||v.containPoint(a);D(s.coordSysAxesInfo[y],function(x,S){var w=x.axis,k=KL(c,x);if(!f&&b&&(!c||k)){var T=k&&k.value;T==null&&!l&&(T=w.pointToData(a)),T!=null&&ex(x,T,m,!1,h)}})});var g={};return D(u,function(v,y){var b=v.linkGroup;b&&!d[y]&&D(b.axesInfo,function(x,S){var w=d[S];if(x!==v&&w){var k=w.value;b.mapper&&(k=v.axis.scale.parse(b.mapper(k,tx(x),tx(v)))),g[v.key]=k}})}),D(g,function(v,y){ex(u[y],v,m,!0,h)}),qL(d,u,h),XL(p,a,t,o),ZL(u,o,r),h}}function ex(t,e,r,n,a){var i=t.axis;if(!(i.scale.isBlank()||!i.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var o=WL(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&a.seriesIndex==null&&U(a,s[0]),!n&&t.snap&&i.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function WL(t,e){var r=e.axis,n=r.dim,a=t,i=[],o=Number.MAX_VALUE,s=-1;return D(e.seriesModels,function(l,c){var u=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(u,t,r);h=d.dataIndices,f=d.nestestValue}else{if(h=l.getData().indicesOfNearest(u[0],t,r.type==="category"?.5:null),!h.length)return;f=l.getData().get(u[0],h[0])}if(!(f==null||!isFinite(f))){var p=t-f,m=Math.abs(p);m<=o&&((m<o||p>=0&&s<0)&&(o=m,s=p,a=f,i.length=0),D(h,function(g){i.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:i,snapToValue:a}}function UL(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function YL(t,e,r,n){var a=r.payloadBatch,i=e.axis,o=i.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!a.length)){var l=e.coordSys.model,c=$o(l),u=t.map[c];u||(u=t.map[c]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(u)),u.dataByAxis.push({axisDim:i.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:a.slice()})}}function qL(t,e,r){var n=r.axesInfo=[];D(e,function(a,i){var o=a.axisPointerModel.option,s=t[i];s?(!a.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!a.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:a.axis.dim,axisIndex:a.axis.model.componentIndex,value:o.value})})}function XL(t,e,r,n){if(Cc(e)||!t.list.length){n({type:"hideTip"});return}var a=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:t.list})}function ZL(t,e,r){var n=r.getZr(),a="axisPointerLastHighlights",i=Jb(n)[a]||{},o=Jb(n)[a]={};D(t,function(c,u){var f=c.axisPointerModel.option;f.status==="show"&&c.triggerEmphasis&&D(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];D(i,function(c,u){!o[u]&&l.push(c)}),D(o,function(c,u){!i[u]&&s.push(c)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function KL(t,e){for(var r=0;r<(t||[]).length;r++){var n=t[r];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function tx(t){var e=t.axis.model,r={},n=r.axisDim=t.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=e.componentIndex,r.axisName=r[n+"AxisName"]=e.name,r.axisId=r[n+"AxisId"]=e.id,r}function Cc(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function rx(t){Eb.registerAxisPointerClass("CartesianAxisPointer",EL),t.registerComponentModel(NL),t.registerComponentView(GL),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!ee(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=uL(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},$L)}function jL(t){In(kL),In(rx)}var nx=["x","y","radius","angle","single"],QL=["cartesian2d","polar","singleAxis"];function JL(t){var e=t.get("coordinateSystem");return ze(QL,e)>=0}function wa(t){return t+"Axis"}function eP(t,e){var r=de(),n=[],a=de();t.eachComponent({mainType:"dataZoom",query:e},function(u){a.get(u.uid)||s(u)});var i;do i=!1,t.eachComponent("dataZoom",o);while(i);function o(u){!a.get(u.uid)&&l(u)&&(s(u),i=!0)}function s(u){a.set(u.uid,!0),n.push(u),c(u)}function l(u){var f=!1;return u.eachTargetAxis(function(h,d){var p=r.get(h);p&&p[d]&&(f=!0)}),f}function c(u){u.eachTargetAxis(function(f,h){(r.get(f)||r.set(f,[]))[h]=!0})}return n}function tP(t){var e=t.ecModel,r={infoList:[],infoMap:de()};return t.eachTargetAxis(function(n,a){var i=e.getComponent(wa(n),a);if(i){var o=i.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(i)}}}),r}var Fd=(function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t})(),ax=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,n,a){var i=ix(r);this.settledOption=i,this.mergeDefaultAndTheme(r,a),this._doInit(i)},e.prototype.mergeOption=function(r){var n=ix(r);De(this.option,r,!0),De(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var a=this.settledOption;D([["start","startValue"],["end","endValue"]],function(i,o){this._rangePropMode[o]==="value"&&(n[i[0]]=a[i[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=de(),a=this._fillSpecifiedTargetAxis(n);a?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(i){i.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return D(nx,function(a){var i=this.getReferringComponents(wa(a),Lk);if(i.specified){n=!0;var o=new Fd;D(i.models,function(s){o.add(s.componentIndex)}),r.set(a,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var a=this.ecModel,i=!0;if(i){var o=n==="vertical"?"y":"x",s=a.findComponents({mainType:o+"Axis"});l(s,o)}if(i){var s=a.findComponents({mainType:"singleAxis",filter:function(u){return u.get("orient",!0)===n}});l(s,"single")}function l(c,u){var f=c[0];if(f){var h=new Fd;if(h.add(f.componentIndex),r.set(u,h),i=!1,u==="x"||u==="y"){var d=f.getReferringComponents("grid",Et).models[0];d&&D(c,function(p){f.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",Et).models[0]&&h.add(p.componentIndex)})}}}i&&D(nx,function(c){if(i){var u=a.findComponents({mainType:wa(c),filter:function(h){return h.get("type",!0)==="category"}});if(u[0]){var f=new Fd;f.add(u[0].componentIndex),r.set(c,f),i=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var n=this._rangePropMode,a=this.get("rangeMode");D([["start","startValue"],["end","endValue"]],function(i,o){var s=r[i[0]]!=null,l=r[i[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":a?n[o]=a[o]:s&&(n[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,a){r==null&&(r=this.ecModel.getComponent(wa(n),a))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(a,i){D(a.indexList,function(o){r.call(n,i,o)})})},e.prototype.getAxisProxy=function(r,n){var a=this.getAxisModel(r,n);if(a)return a.__dzAxisProxy},e.prototype.getAxisModel=function(r,n){var a=this._targetAxisInfoMap.get(r);if(a&&a.indexMap[n])return this.ecModel.getComponent(wa(r),n)},e.prototype.setRawRange=function(r){var n=this.option,a=this.settledOption;D([["start","startValue"],["end","endValue"]],function(i){(r[i[0]]!=null||r[i[1]]!=null)&&(n[i[0]]=a[i[0]]=r[i[0]],n[i[1]]=a[i[1]]=r[i[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var n=this.option;D(["start","startValue","end","endValue"],function(a){n[a]=r[a]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},e.prototype.getValueRange=function(r,n){if(r==null&&n==null){var a=this.findRepresentativeAxisProxy();if(a)return a.getDataValueWindow()}else return this.getAxisProxy(r,n).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var n,a=this._targetAxisInfoMap.keys(),i=0;i<a.length;i++)for(var o=a[i],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var c=this.getAxisProxy(o,s.indexList[l]);if(c.hostedBy(this))return c;n||(n=c)}return n},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e})(We);function ix(t){var e={};return D(["start","end","startValue","endValue","throttle"],function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e}var rP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a,i){this.dataZoomModel=r,this.ecModel=n,this.api=a},e.type="dataZoom",e})(gr),wi=D,ox=dk,nP=(function(){function t(e,r,n,a){this._dimName=e,this._axisIndex=r,this.ecModel=a,this._dataZoomModel=n}return t.prototype.hostedBy=function(e){return this._dataZoomModel===e},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(r){if(JL(r)){var n=wa(this._dimName),a=r.getReferringComponents(n,Et).models[0];a&&this._axisIndex===a.componentIndex&&e.push(r)}},this),e},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return Te(this._minMaxSpan)},t.prototype.calculateDataWindow=function(e){var r=this._dataExtent,n=this.getAxisModel(),a=n.axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],c;wi(["start","end"],function(h,d){var p=e[h],m=e[h+"Value"];i[d]==="percent"?(p==null&&(p=o[d]),m=a.parse(ia(p,o,r))):(c=!0,m=m==null?r[d]:a.parse(m),p=ia(m,r,o)),l[d]=m==null||isNaN(m)?r[d]:m,s[d]=p==null||isNaN(p)?o[d]:p}),ox(l),ox(s);var u=this._minMaxSpan;c?f(l,s,r,o,!1):f(s,l,o,r,!0);function f(h,d,p,m,g){var v=g?"Span":"ValueSpan";Ed(0,h,p,"all",u["min"+v],u["max"+v]);for(var y=0;y<2;y++)d[y]=ia(h[y],p,m,!0),g&&(d[y]=a.parse(d[y]))}return{valueWindow:l,percentWindow:s}},t.prototype.reset=function(e){if(e===this._dataZoomModel){var r=this.getTargetSeriesModels();this._dataExtent=aP(this,this._dimName,r),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(e,r){if(e!==this._dataZoomModel)return;var n=this._dimName,a=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;if(i==="none")return;wi(a,function(l){var c=l.getData(),u=c.mapDimensionsAll(n);if(u.length){if(i==="weakFilter"){var f=c.getStore(),h=ue(u,function(d){return c.getDimensionIndex(d)},c);c.filterSelf(function(d){for(var p,m,g,v=0;v<u.length;v++){var y=f.get(h[v],d),b=!isNaN(y),x=y<o[0],S=y>o[1];if(b&&!x&&!S)return!0;b&&(g=!0),x&&(p=!0),S&&(m=!0)}return g&&p&&m})}else wi(u,function(d){if(i==="empty")l.setData(c=c.map(d,function(m){return s(m)?m:NaN}));else{var p={};p[d]=o,c.selectRange(p)}});wi(u,function(d){c.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;wi(["min","max"],function(a){var i=r.get(a+"Span"),o=r.get(a+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?i=ia(n[0]+o,n,[0,100],!0):i!=null&&(o=ia(i,[0,100],n,!0)-n[0]),e[a+"Span"]=i,e[a+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var e=this.getAxisModel(),r=this._percentWindow,n=this._valueWindow;if(r){var a=pg(n,[0,500]);a=Math.min(a,20);var i=e.axis.scale.rawExtentInfo;r[0]!==0&&i.setDeterminedMinMax("min",+n[0].toFixed(a)),r[1]!==100&&i.setDeterminedMinMax("max",+n[1].toFixed(a)),i.freeze()}},t})();function aP(t,e,r){var n=[1/0,-1/0];wi(r,function(o){GI(n,o.getData(),e)});var a=t.getAxisModel(),i=ub(a.axis.scale,a,n).calculate();return[i.min,i.max]}var iP={getTargetSeries:function(t){function e(a){t.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(o,s){var l=t.getComponent(wa(o),s);a(o,s,l,i)})})}e(function(a,i,o,s){o.__dzAxisProxy=null});var r=[];e(function(a,i,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new nP(a,i,s,t),r.push(o.__dzAxisProxy))});var n=de();return D(r,function(a){D(a.getTargetSeriesModels(),function(i){n.set(i.uid,i)})}),n},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).reset(r)}),r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var a=n.getDataPercentWindow(),i=n.getDataValueWindow();r.setCalculatedRange({start:a[0],end:a[1],startValue:i[0],endValue:i[1]})}})}};function oP(t){t.registerAction("dataZoom",function(e,r){var n=eP(r,e);D(n,function(a){a.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var sx=!1;function sP(t){sx||(sx=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,iP),oP(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function lP(t,e){var r=$l(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),t=new ft({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1}),t}var cP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e})(We);function lx(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function cx(t){if(ge.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r<n;r++)if(t[r]in e)return t[r]}}var ux=cx(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),uP=cx(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function fx(t,e){if(!t)return e;e=vy(e,!0);var r=t.indexOf(e);return t=r===-1?e:"-"+t.slice(0,r)+"-"+e,t.toLowerCase()}function fP(t,e){var r=t.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(t);return r?r[e]:null}var hP=fx(uP,"transition"),Hd=fx(ux,"transform"),dP="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(ge.transform3dSupported?"will-change:transform;":"");function pP(t){return t=t==="left"?"right":t==="right"?"left":t==="top"?"bottom":"top",t}function vP(t,e,r){if(!ne(r)||r==="inside")return"";var n=t.get("backgroundColor"),a=t.get("borderWidth");e=pa(e);var i=pP(r),o=Math.max(Math.round(a)*1.5,6),s="",l=Hd+":",c;ze(["left","right"],i)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(c=i==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(c=i==="top"?225:45)+"deg)");var u=c*Math.PI/180,f=o+a,h=f*Math.abs(Math.cos(u))+f*Math.abs(Math.sin(u)),d=Math.round(((h-Math.SQRT2*a)/2+Math.SQRT2*a-(h-f)/2)*100)/100;s+=";"+i+":-"+d+"px";var p=e+" solid "+a+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+n+";"];return'<div style="'+m.join("")+'"></div>'}function gP(t,e){var r="cubic-bezier(0.23,1,0.32,1)",n=" "+t/2+"s "+r,a="opacity"+n+",visibility"+n;return e||(n=" "+t+"s "+r,a+=ge.transformSupported?","+Hd+n:",left"+n+",top"+n),hP+":"+a}function hx(t,e,r){var n=t.toFixed(0)+"px",a=e.toFixed(0)+"px";if(!ge.transformSupported)return r?"top:"+a+";left:"+n+";":[["top",a],["left",n]];var i=ge.transform3dSupported,o="translate"+(i?"3d":"")+"("+n+","+a+(i?",0":"")+")";return r?"top:0;left:0;"+Hd+":"+o+";":[["top",0],["left",0],[ux,o]]}function mP(t){var e=[],r=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont());var a=Ce(t.get("lineHeight"),Math.round(r*3/2));r&&e.push("line-height:"+a+"px");var i=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return i&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+i),D(["decoration","align"],function(c){var u=t.get(c);u&&e.push("text-"+c+":"+u)}),e.join(";")}function yP(t,e,r){var n=[],a=t.get("transitionDuration"),i=t.get("backgroundColor"),o=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),u=t.getModel("textStyle"),f=Ly(t,"html"),h=l+"px "+c+"px "+o+"px "+s;return n.push("box-shadow:"+h),e&&a&&n.push(gP(a,r)),i&&n.push("background-color:"+i),D(["width","color","radius"],function(d){var p="border-"+d,m=vy(p),g=t.get(m);g!=null&&n.push(p+":"+g+(d==="color"?"":"px"))}),n.push(mP(u)),f!=null&&n.push("padding:"+$l(f).join("px ")+"px"),n.join(";")+";"}function dx(t,e,r,n,a){var i=e&&e.painter;if(r){var o=i&&i.getViewportRoot();o&&X2(t,o,r,n,a)}else{t[0]=n,t[1]=a;var s=i&&i.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var _P=(function(){function t(e,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,ge.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=e.getZr(),i=r.appendTo,o=i&&(ne(i)?document.querySelector(i):Hi(i)?i:ye(i)&&i(e.getDom()));dx(this._styleCoord,a,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var c=a.handler,u=a.painter.getViewportRoot();ir(u,l,!0),c.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),n=fP(r,"position"),a=r.style;a.position!=="absolute"&&n!=="absolute"&&(a.position="relative")}var i=e.get("alwaysShowContent");i&&this._moveIfResized(),this._alwaysShowContent=i,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,a=n.style,i=this._styleCoord;n.innerHTML?a.cssText=dP+yP(e,!this._firstShow,this._longHide)+hx(i[0],i[1],!0)+("border-color:"+pa(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):a.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,n,a,i){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(ne(i)&&n.get("trigger")==="item"&&!lx(n)&&(s=vP(n,a,i)),ne(e))o.innerHTML=e+s;else if(e){o.innerHTML="",ee(e)||(e=[e]);for(var l=0;l<e.length;l++)Hi(e[l])&&e[l].parentNode!==o&&o.appendChild(e[l]);if(s&&o.childNodes.length){var c=document.createElement("div");c.innerHTML=s,o.appendChild(c)}}},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},t.prototype.moveTo=function(e,r){if(this.el){var n=this._styleCoord;if(dx(n,this._zr,this._container,e,r),n[0]!=null&&n[1]!=null){var a=this.el.style,i=hx(n[0],n[1]);D(i,function(o){a[o[0]]=o[1]})}}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){var e=this,r=this.el.style;r.visibility="hidden",r.opacity="0",ge.transform3dSupported&&(r.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Le(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},t})(),bP=(function(){function t(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),vx(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return t.prototype.update=function(e){var r=e.get("alwaysShowContent");r&&this._moveIfResized(),this._alwaysShowContent=r},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(e,r,n,a,i){var o=this;ce(e)&&Rt(""),this.el&&this._zr.remove(this.el);var s=n.getModel("textStyle");this.el=new Pt({style:{rich:r.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:a,textShadowColor:s.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:Ly(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),D(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(c){o.el.style[c]=n.get(c)}),D(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(c){o.el.style[c]=s.get(c)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el,r=this.el.getBoundingRect(),n=px(e.style);return[r.width+n.left+n.right,r.height+n.top+n.bottom]},t.prototype.moveTo=function(e,r){var n=this.el;if(n){var a=this._styleCoord;vx(a,this._zr,e,r),e=a[0],r=a[1];var i=n.style,o=Rn(i.borderWidth||0),s=px(i);n.x=e+o+s.left,n.y=r+o+s.top,n.markRedraw()}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Le(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t})();function Rn(t){return Math.max(0,t)}function px(t){var e=Rn(t.shadowBlur||0),r=Rn(t.shadowOffsetX||0),n=Rn(t.shadowOffsetY||0);return{left:Rn(e-r),right:Rn(e+r),top:Rn(e-n),bottom:Rn(e+n)}}function vx(t,e,r,n){t[0]=r,t[1]=n,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var xP=new ft({shape:{x:-1,y:-1,width:2,height:2}}),wP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){if(!(ge.node||!n.getDom())){var a=r.getComponent("tooltip"),i=this._renderMode=Rk(a.get("renderMode"));this._tooltipContent=i==="richText"?new bP(n):new _P(n,{appendTo:a.get("appendToBody",!0)?"body":a.get("appendTo",!0)})}},e.prototype.render=function(r,n,a){if(!(ge.node||!a.getDom())){this.group.removeAll(),this._tooltipModel=r,this._ecModel=n,this._api=a;var i=this._tooltipContent;i.update(r),i.setEnterable(r.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&r.get("transitionDuration")?Dh(this,"_updatePosition",50,"fixRate"):Ih(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var r=this._tooltipModel,n=r.get("triggerOn");Kb("itemTooltip",this._api,Le(function(a,i,o){n!=="none"&&(n.indexOf(a)>=0?this._tryShow(i,o):a==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,a=this._api,i=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&i!=="none"&&i!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!a.isDisposed()&&o.manuallyShowTip(r,n,a,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,a,i){if(!(i.from===this.uid||ge.node||!a.getDom())){var o=gx(i,a);this._ticket="";var s=i.dataByCoordSys,l=CP(i,n,a);if(l){var c=l.el.getBoundingRect().clone();c.applyTransform(l.el.transform),this._tryShow({offsetX:c.x+c.width/2,offsetY:c.y+c.height/2,target:l.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&i.x!=null&&i.y!=null){var u=xP;u.x=i.x,u.y=i.y,u.update(),Ve(u).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:u},o)}else if(s)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:s,tooltipOption:i.tooltipOption},o);else if(i.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,a,i))return;var f=Qb(i,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.el,position:i.position,positionDefault:"bottom"},o)}else i.x!=null&&i.y!=null&&(a.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:a.getZr().findHover(i.x,i.y).target},o))}},e.prototype.manuallyHideTip=function(r,n,a,i){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(gx(i,a))},e.prototype._manuallyAxisShowTip=function(r,n,a,i){var o=i.seriesIndex,s=i.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var c=n.getSeriesByIndex(o);if(c){var u=c.getData(),f=Wo([u.getItemModel(s),c,(c.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return a.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:i.position}),!0}}},e.prototype._tryShow=function(r,n){var a=r.target,i=this._tooltipModel;if(i){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(a){var s=Ve(a);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,c;Oo(a,function(u){if(Ve(u).dataIndex!=null)return l=u,!0;if(Ve(u).tooltipConfig!=null)return c=u,!0},!0),l?this._showSeriesItemTooltip(r,l,n):c?this._showComponentItemTooltip(r,c,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},e.prototype._showOrMove=function(r,n){var a=r.get("showDelay");n=Le(n,this),clearTimeout(this._showTimout),a>0?this._showTimout=setTimeout(n,a):n()},e.prototype._showAxisTooltip=function(r,n){var a=this._ecModel,i=this._tooltipModel,o=[n.offsetX,n.offsetY],s=Wo([n.tooltipOption],i),l=this._renderMode,c=[],u=Co("section",{blocks:[],noHeader:!0}),f=[],h=new gh;D(r,function(y){D(y.dataByAxis,function(b){var x=a.getComponent(b.axisDim+"Axis",b.axisIndex),S=b.value;if(!(!x||S==null)){var w=Yb(S,x.axis,a,b.seriesDataIndices,b.valueLabelOpt),k=Co("section",{header:w,noHeader:!Mr(w),sortBlocks:!0,blocks:[]});u.blocks.push(k),D(b.seriesDataIndices,function(T){var C=a.getSeriesByIndex(T.seriesIndex),A=T.dataIndexInside,M=C.getDataParams(A);if(!(M.dataIndex<0)){M.axisDim=b.axisDim,M.axisIndex=b.axisIndex,M.axisType=b.axisType,M.axisId=b.axisId,M.axisValue=Sd(x.axis,{value:S}),M.axisValueLabel=w,M.marker=h.makeTooltipMarker("item",pa(M.color),l);var I=xy(C.formatTooltip(A,!0,null)),L=I.frag;if(L){var P=Wo([C],i).get("valueFormatter");k.blocks.push(P?U({valueFormatter:P},L):L)}I.text&&f.push(I.text),c.push(M)}})}})}),u.blocks.reverse(),f.reverse();var d=n.position,p=s.get("order"),m=Dy(u,h,l,p,a.get("useUTC"),s.get("textStyle"));m&&f.unshift(m);var g=l==="richText"?`
|
|
18
|
+
`];function Go(t,e){return e.type=t,e}function Rd(t){return t.type==="section"}function Ny(t){return Rd(t)?HC:VC}function By(t){if(Rd(t)){var e=0,r=t.blocks.length,n=r>1||r>0&&!t.noHeader;return I(t.blocks,function(a){var i=By(a);i>=e&&(e=i+ +(n&&(!i||Rd(a)&&!a.noHeader)))}),e}return 0}function HC(t,e,r,n){var a=e.noHeader,i=UC(By(e)),o=[],s=e.blocks||[];dn(!s||ee(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(la(c,l)){var u=new MT(c[l],null);s.sort(function(m,g){return u.evaluate(m.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}I(s,function(m,g){var v=e.valueFormatter,y=Ny(m)(v?q(q({},t),{valueFormatter:v}):t,m,g>0?i.html:0,n);y!=null&&o.push(y)});var f=t.renderMode==="richText"?o.join(i.richText):Ed(n,o.join(""),a?r:i.html);if(a)return f;var h=Ad(e.header,"ordinal",t.useUTC),d=Oy(n,t.renderMode).nameStyle,p=Ey(n);return t.renderMode==="richText"?Fy(t,h,d)+i.richText+f:Ed(n,'<div style="'+d+";"+p+';">'+Zt(h)+"</div>"+f,r)}function VC(t,e,r,n){var a=t.renderMode,i=e.noName,o=e.noValue,s=!e.markerType,l=e.name,c=t.useUTC,u=e.valueFormatter||t.valueFormatter||function(x){return x=ee(x)?x:[x],he(x,function(w,S){return Ad(w,ee(d)?d[S]:d,c)})};if(!(i&&o)){var f=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",a),h=i?"":Ad(l,"ordinal",c),d=e.valueType,p=o?[]:u(e.value,e.dataIndex),m=!s||!i,g=!s&&i,v=Oy(n,a),y=v.nameStyle,b=v.valueStyle;return a==="richText"?(s?"":f)+(i?"":Fy(t,h,y))+(o?"":WC(t,p,m,g,b)):Ed(n,(s?"":f)+(i?"":GC(h,!s,y))+(o?"":$C(p,m,g,b)),r)}}function zy(t,e,r,n,a,i){if(t){var o=Ny(t),s={useUTC:a,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,i)}}function UC(t){return{html:zC[t],richText:FC[t]}}function Ed(t,e,r){var n='<div style="clear:both"></div>',a="margin: "+r+"px 0 0",i=Ey(t);return'<div style="'+a+";"+i+';">'+e+n+"</div>"}function GC(t,e,r){var n=e?"margin-left:2px":"";return'<span style="'+r+";"+n+'">'+Zt(t)+"</span>"}function $C(t,e,r,n){var a=r?"10px":"20px",i=e?"float:right;margin-left:"+a:"";return t=ee(t)?t:[t],'<span style="'+i+";"+n+'">'+he(t,function(o){return Zt(o)}).join(" ")+"</span>"}function Fy(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function WC(t,e,r,n,a){var i=[a],o=n?10:20;return r&&i.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ee(e)?e.join(" "):e,i)}function qC(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return Oa(n)}function Hy(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var Od=(function(){function t(){this.richTextStyles={},this._nextStyleNameId=Cg()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,n){var a=n==="richText"?this._generateStyleName():null,i=gC({color:r,type:e,renderMode:n,markerId:a});return ae(i)?i:(this.richTextStyles[a]=i.style,i.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ee(r)?I(r,function(i){return q(n,i)}):q(n,r);var a=this._generateStyleName();return this.richTextStyles[a]=n,"{"+a+"|"+e+"}"},t})();function YC(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,a=e.getData(),i=a.mapDimensionsAll("defaultedTooltip"),o=i.length,s=e.getRawValue(r),l=ee(s),c=qC(e,r),u,f,h,d;if(o>1||l&&!o){var p=XC(s,e,r,i,c);u=p.inlineValues,f=p.inlineValueTypes,h=p.blocks,d=p.inlineValues[0]}else if(o){var m=a.getDimensionInfo(i[0]);d=u=ki(a,r,i[0]),f=m.type}else d=u=l?s[0]:s;var g=Df(e),v=g&&e.name||"",y=a.getName(r),b=n?v:y;return Go("section",{header:v,noHeader:n||!g,sortParam:d,blocks:[Go("nameValue",{markerType:"item",markerColor:c,name:b,noName:!Gr(b),value:u,valueType:f,dataIndex:r})].concat(h||[])})}function XC(t,e,r,n,a){var i=e.getData(),o=ni(t,function(f,h,d){var p=i.getDimensionInfo(d);return f=f||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],c=[];n.length?I(n,function(f){u(ki(i,r,f),f)}):I(t,u);function u(f,h){var d=i.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?c.push(Go("nameValue",{markerType:"subItem",markerColor:a,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:c}}var $n=ht();function mc(t,e){return t.getName(e)||t.getId(e)}var ZC="__universalTransitionEnabled",Qr=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,n,a){this.seriesIndex=this.componentIndex,this.dataTask=Uo({count:jC,reset:JC}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,a);var i=$n(this).sourceManager=new NC(this);i.prepareSource();var o=this.getInitialData(r,a);Uy(o,this),this.dataTask.context.data=o,$n(this).dataBeforeProcessed=o,Vy(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=Vo(this),i=a?vc(r):{},o=this.subType;Ye.hasClass(o)&&(o+="Series"),Oe(r,n.getTheme().get(this.subType)),Oe(r,this.getDefaultOption()),Lg(r,"label",["show"]),this.fillDataTextStyle(r.data),a&&Pi(r,i,a)},e.prototype.mergeOption=function(r,n){r=Oe(this.option,r,!0),this.fillDataTextStyle(r.data);var a=Vo(this);a&&Pi(this.option,r,a);var i=$n(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(r,n);Uy(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,$n(this).dataBeforeProcessed=o,Vy(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!Ut(r))for(var n=["show"],a=0;a<r.length;a++)r[a]&&r[a].label&&Lg(r[a],"label",n)},e.prototype.getInitialData=function(r,n){},e.prototype.appendData=function(r){var n=this.getRawData();n.appendData(r.data)},e.prototype.getData=function(r){var n=Nd(this);if(n){var a=n.context.data;return r==null||!a.getLinkedData?a:a.getLinkedData(r)}else return $n(this).data},e.prototype.getAllData=function(){var r=this.getData();return r&&r.getLinkedDataAll?r.getLinkedDataAll():[{data:r}]},e.prototype.setData=function(r){var n=Nd(this);if(n){var a=n.context;a.outputData=r,n!==this.dataTask&&(a.data=r)}$n(this).data=r},e.prototype.getEncode=function(){var r=this.get("encode",!0);if(r)return me(r)},e.prototype.getSourceManager=function(){return $n(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return $n(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var r=this.get("colorBy");return r||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var r=this.coordinateSystem;return r&&r.getBaseAxis&&r.getBaseAxis()},e.prototype.formatTooltip=function(r,n,a){return YC({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(_e.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,n,a){var i=this.ecModel,o=Ld.prototype.getColorFromPalette.call(this,r,n,a);return o||(o=i.getColorFromPalette(r,n,a)),o},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},e.prototype.unselect=function(r,n){var a=this.option.selectedMap;if(a){var i=this.option.selectedMode,o=this.getData(n);if(i==="series"||a==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<r.length;s++){var l=r[s],c=mc(o,l);a[c]=!1,this._selectedDataIndicesMap[c]=-1}}},e.prototype.toggleSelect=function(r,n){for(var a=[],i=0;i<r.length;i++)a[0]=r[i],this.isSelected(r[i],n)?this.unselect(a,n):this.select(a,n)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var r=this._selectedDataIndicesMap,n=at(r),a=[],i=0;i<n.length;i++){var o=r[n[i]];o>=0&&a.push(o)}return a},e.prototype.isSelected=function(r,n){var a=this.option.selectedMap;if(!a)return!1;var i=this.getData(n);return(a==="all"||a[mc(i,r)])&&!i.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[ZC])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,n){var a,i,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){de(o.selectedMap)||(o.selectedMap={});for(var c=o.selectedMap,u=0;u<l;u++){var f=n[u],h=mc(r,f);c[h]=!0,this._selectedDataIndicesMap[h]=r.getRawIndex(f)}}else if(s==="single"||s===!0){var d=n[l-1],h=mc(r,d);o.selectedMap=(a={},a[h]=!0,a),this._selectedDataIndicesMap=(i={},i[h]=r.getRawIndex(d),i)}}},e.prototype._initSelectedMapFromData=function(r){if(!this.option.selectedMap){var n=[];r.hasItemOption&&r.each(function(a){var i=r.getRawDataItem(a);i&&i.selected&&n.push(a)}),n.length>0&&this._innerSelect(r,n)}},e.registerClass=function(r){return Ye.registerClass(r)},e.protoInitialize=(function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"})(),e})(Ye);Ur(Qr,TC),Ur(Qr,Ld),kv(Qr,Ye);function Vy(t){var e=t.name;Df(t)||(t.name=KC(t)||e)}function KC(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return I(r,function(a){var i=e.getDimensionInfo(a);i.displayName&&n.push(i.displayName)}),n.join(" ")}function jC(t){return t.model.getRawData().count()}function JC(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),QC}function QC(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Uy(t,e){I(zw(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,dt(eM,e))})}function eM(t,e){var r=Nd(t);return r&&r.setOutputEnd((e||this).count()),e}function Nd(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var n=r.currentTask;if(n){var a=n.agentStubMap;a&&(n=a.get(t.uid))}return n}}var tM=qe.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,n=e.cy,a=e.width/2,i=e.height/2;t.moveTo(r,n-i),t.lineTo(r+a,n+i),t.lineTo(r-a,n+i),t.closePath()}}),rM=qe.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,n=e.cy,a=e.width/2,i=e.height/2;t.moveTo(r,n-i),t.lineTo(r+a,n),t.lineTo(r,n+i),t.lineTo(r-a,n),t.closePath()}}),nM=qe.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.x,n=e.y,a=e.width/5*3,i=Math.max(a,e.height),o=a/2,s=o*o/(i-o),l=n-i+o+s,c=Math.asin(s/o),u=Math.cos(c)*o,f=Math.sin(c),h=Math.cos(c),d=o*.6,p=o*.7;t.moveTo(r-u,l+s),t.arc(r,l,o,Math.PI-c,Math.PI*2+c),t.bezierCurveTo(r+u-f*d,l+s+h*d,r,n-p,r,n),t.bezierCurveTo(r,n-p,r-u+f*d,l+s+h*d,r-u,l+s),t.closePath()}}),aM=qe.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.height,n=e.width,a=e.x,i=e.y,o=n/3*2;t.moveTo(a,i),t.lineTo(a+o,i+r),t.lineTo(a,i+r/4*3),t.lineTo(a-o,i+r),t.lineTo(a,i),t.closePath()}}),iM={line:Hn,rect:_t,roundRect:_t,square:_t,circle:Nl,diamond:rM,pin:nM,arrow:aM,triangle:tM},oM={line:function(t,e,r,n,a){a.x1=t,a.y1=e+n/2,a.x2=t+r,a.y2=e+n/2},rect:function(t,e,r,n,a){a.x=t,a.y=e,a.width=r,a.height=n},roundRect:function(t,e,r,n,a){a.x=t,a.y=e,a.width=r,a.height=n,a.r=Math.min(r,n)/4},square:function(t,e,r,n,a){var i=Math.min(r,n);a.x=t,a.y=e,a.width=i,a.height=i},circle:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.r=Math.min(r,n)/2},diamond:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.width=r,a.height=n},pin:function(t,e,r,n,a){a.x=t+r/2,a.y=e+n/2,a.width=r,a.height=n},arrow:function(t,e,r,n,a){a.x=t+r/2,a.y=e+n/2,a.width=r,a.height=n},triangle:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.width=r,a.height=n}},Bd={};I(iM,function(t,e){Bd[e]=new t});var sM=qe.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,r){var n=Qs(t,e,r),a=this.shape;return a&&a.symbolType==="pin"&&e.position==="inside"&&(n.y=r.y+r.height*.4),n},buildPath:function(t,e,r){var n=e.symbolType;if(n!=="none"){var a=Bd[n];a||(n="rect",a=Bd[n]),oM[n](e.x,e.y,e.width,e.height,a.shape),a.buildPath(t,a.shape,r)}}});function lM(t,e){if(this.type!=="image"){var r=this.style;this.__isEmptyBrush?(r.stroke=t,r.fill=e||"#fff",r.lineWidth=2):this.shape.symbolType==="line"?r.stroke=t:r.fill=t,this.markRedraw()}}function Ri(t,e,r,n,a,i,o){var s=t.indexOf("empty")===0;s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return t.indexOf("image://")===0?l=gm(t.slice(8),new Ge(e,r,n,a),o?"center":"cover"):t.indexOf("path://")===0?l=ed(t.slice(7),{},new Ge(e,r,n,a),o?"center":"cover"):l=new sM({shape:{symbolType:t,x:e,y:r,width:n,height:a}}),l.__isEmptyBrush=s,l.setColor=lM,i&&l.setColor(i),l}function cM(t){return ee(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function Gy(t,e){if(t!=null)return ee(t)||(t=[t,t]),[Nt(t[0],e[0])||0,Nt(Pe(t[1],t[0]),e[1])||0]}var uM=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r){return md(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(r){var n=new St,a=Ri("line",0,r.itemHeight/2,r.itemWidth,0,r.lineStyle.stroke,!1);n.add(a),a.setStyle(r.lineStyle);var i=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=i==="none"?"circle":i,l=r.itemHeight*.8,c=Ri(s,(r.itemWidth-l)/2,(r.itemHeight-l)/2,l,l,r.itemStyle.fill);n.add(c),c.setStyle(r.itemStyle);var u=r.iconRotate==="inherit"?o:r.iconRotate||0;return c.rotation=u*Math.PI/180,c.setOrigin([r.itemWidth/2,r.itemHeight/2]),s.indexOf("empty")>-1&&(c.style.stroke=c.style.fill,c.style.fill="#fff",c.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e})(Qr);function zd(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var a=ki(t,e,r[0]);return a!=null?a+"":null}else if(n){for(var i=[],o=0;o<r.length;o++)i.push(ki(t,e,r[o]));return i.join(" ")}}function $y(t,e){var r=t.mapDimensionsAll("defaultedLabel");if(!ee(e))return e+"";for(var n=[],a=0;a<r.length;a++){var i=t.getDimensionIndex(r[a]);i>=0&&n.push(e[i])}return n.join(" ")}var Fd=(function(t){K(e,t);function e(r,n,a,i){var o=t.call(this)||this;return o.updateData(r,n,a,i),o}return e.prototype._createSymbol=function(r,n,a,i,o){this.removeAll();var s=Ri(r,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),s.drift=fM,this._symbolType=r,this.add(s)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Ll(this.childAt(0))},e.prototype.downplay=function(){Pl(this.childAt(0))},e.prototype.setZ=function(r,n){var a=this.childAt(0);a.zlevel=r,a.z=n},e.prototype.setDraggable=function(r,n){var a=this.childAt(0);a.draggable=r,a.cursor=!n&&r?"move":a.cursor},e.prototype.updateData=function(r,n,a,i){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),c=o!==this._symbolType,u=i&&i.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,f)}else{var h=this.childAt(0);h.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};u?h.attr(d):or(h,d,s,n),vm(h)}if(this._updateCommon(r,n,l,a,i),c){var h=this.childAt(0);if(!u){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,_n(h,d,s,n)}}u&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,a,i,o){var s=this.childAt(0),l=r.hostModel,c,u,f,h,d,p,m,g,v;if(i&&(c=i.emphasisItemStyle,u=i.blurItemStyle,f=i.selectItemStyle,h=i.focus,d=i.blurScope,m=i.labelStatesModels,g=i.hoverScale,v=i.cursorStyle,p=i.emphasisDisabled),!i||r.hasItemOption){var y=i&&i.itemModel?i.itemModel:r.getItemModel(n),b=y.getModel("emphasis");c=b.getModel("itemStyle").getItemStyle(),f=y.getModel(["select","itemStyle"]).getItemStyle(),u=y.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),p=b.get("disabled"),m=Zl(y),g=b.getShallow("scale"),v=y.getShallow("cursor")}var x=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var w=Gy(r.getItemVisual(n,"symbolOffset"),a);w&&(s.x=w[0],s.y=w[1]),v&&s.attr("cursor",v);var S=r.getItemVisual(n,"style"),k=S.fill;if(s instanceof Fn){var C=s.style;s.useStyle(q({image:C.image,x:C.x,y:C.y,width:C.width,height:C.height},S))}else s.__isEmptyBrush?s.useStyle(q({},S)):s.useStyle(S),s.style.decal=null,s.setColor(k,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var A=r.getItemVisual(n,"liftZ"),M=this._z2;A!=null?M==null&&(this._z2=s.z2,s.z2+=A):M!=null&&(s.z2=M,this._z2=null);var T=o&&o.useNameLabel;Xl(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:D,inheritColor:k,defaultOpacity:S.opacity});function D(O){return T?r.getName(O):zd(r,O)}this._sizeX=a[0]/2,this._sizeY=a[1]/2;var L=s.ensureState("emphasis");L.style=c,s.ensureState("select").style=f,s.ensureState("blur").style=u;var R=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;L.scaleX=this._sizeX*R,L.scaleY=this._sizeY*R,this.setSymbolScale(1),Rl(this,h,d,p)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,n,a){var i=this.childAt(0),o=We(this).dataIndex,s=a&&a.animation;if(this.silent=i.silent=!0,a&&a.fadeLabel){var l=i.getTextContent();l&&Ul(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){i.removeTextContent()}})}else i.removeTextContent();Ul(i,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return cM(r.getItemVisual(n,"symbolSize"))},e})(St);function fM(t,e){this.parent.drift(t,e)}function Hd(t,e,r,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function Wy(t){return t!=null&&!de(t)&&(t={isIgnore:t}),t||{}}function qy(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Zl(e),cursorStyle:e.get("cursor")}}var dM=(function(){function t(e){this.group=new St,this._SymbolCtor=e||Fd}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Wy(r);var n=this.group,a=e.hostModel,i=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=qy(e),c={disableAnimation:s},u=r.getSymbolPoint||function(f){return e.getItemLayout(f)};i||n.removeAll(),e.diff(i).add(function(f){var h=u(f);if(Hd(e,h,f,r)){var d=new o(e,f,l,c);d.setPosition(h),e.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=i.getItemGraphicEl(h),p=u(f);if(!Hd(e,p,f,r)){n.remove(d);return}var m=e.getItemVisual(f,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==m)n.remove(d),d=new o(e,f,l,c),d.setPosition(p);else{d.updateData(e,f,l,c);var v={x:p[0],y:p[1]};s?d.attr(v):or(d,v,a)}n.add(d),e.setItemGraphicEl(f,d)}).remove(function(f){var h=i.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},a)}).execute(),this._getSymbolPoint=u,this._data=e},t.prototype.updateLayout=function(){var e=this,r=this._data;r&&r.eachItemGraphicEl(function(n,a){var i=e._getSymbolPoint(a);n.setPosition(i),n.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=qy(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[],n=Wy(n);function a(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i<e.end;i++){var o=r.getItemLayout(i);if(Hd(r,o,i,n)){var s=new this._SymbolCtor(r,i,this._seriesScope);s.traverse(a),s.setPosition(o),this.group.add(s),r.setItemGraphicEl(i,s),this._progressiveEls.push(s)}}},t.prototype.eachRendered=function(e){ql(this._progressiveEls||this.group,e)},t.prototype.remove=function(e){var r=this.group,n=this._data;n&&e?n.eachItemGraphicEl(function(a){a.fadeOut(function(){r.remove(a)},n.hostModel)}):r.removeAll()},t})();function Yy(t,e,r){var n=t.getBaseAxis(),a=t.getOtherAxis(n),i=hM(a,r),o=n.dim,s=a.dim,l=e.mapDimension(s),c=e.mapDimension(o),u=s==="x"||s==="radius"?1:0,f=he(t.dimensions,function(p){return e.mapDimension(p)}),h=!1,d=e.getCalculationInfo("stackResultDimension");return Ai(e,f[0])&&(h=!0,f[0]=d),Ai(e,f[1])&&(h=!0,f[1]=d),{dataDimsForPoint:f,valueStart:i,valueAxisDim:s,baseAxisDim:o,stacked:!!h,valueDim:l,baseDim:c,baseDataOffset:u,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function hM(t,e){var r=0,n=t.scale.getExtent();return e==="start"?r=n[0]:e==="end"?r=n[1]:et(e)&&!isNaN(e)?r=e:n[0]>0?r=n[0]:n[1]<0&&(r=n[1]),r}function Xy(t,e,r,n){var a=NaN;t.stacked&&(a=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(a)&&(a=t.valueStart);var i=t.baseDataOffset,o=[];return o[i]=r.get(t.baseDim,n),o[1-i]=a,e.dataToPoint(o)}var Zy=typeof Float32Array<"u",pM=Zy?Float32Array:Array;function wn(t){return ee(t)?Zy?new Float32Array(t):t:new pM(t)}function vM(t,e){var r=[];return e.diff(t).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,a){r.push({cmd:"=",idx:a,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function gM(t,e,r,n,a,i,o,s){for(var l=vM(t,e),c=[],u=[],f=[],h=[],d=[],p=[],m=[],g=Yy(a,e,o),v=t.getLayout("points")||[],y=e.getLayout("points")||[],b=0;b<l.length;b++){var x=l[b],w=!0,S=void 0,k=void 0;switch(x.cmd){case"=":S=x.idx*2,k=x.idx1*2;var C=v[S],A=v[S+1],M=y[k],T=y[k+1];(isNaN(C)||isNaN(A))&&(C=M,A=T),c.push(C,A),u.push(M,T),f.push(r[S],r[S+1]),h.push(n[k],n[k+1]),m.push(e.getRawIndex(x.idx1));break;case"+":var D=x.idx,L=g.dataDimsForPoint,R=a.dataToPoint([e.get(L[0],D),e.get(L[1],D)]);k=D*2,c.push(R[0],R[1]),u.push(y[k],y[k+1]);var O=Xy(g,a,e,D);f.push(O[0],O[1]),h.push(n[k],n[k+1]),m.push(e.getRawIndex(D));break;case"-":w=!1}w&&(d.push(x),p.push(p.length))}p.sort(function(xe,Ce){return m[xe]-m[Ce]});for(var B=c.length,j=wn(B),P=wn(B),V=wn(B),H=wn(B),Z=[],b=0;b<p.length;b++){var re=p[b],Te=b*2,ge=re*2;j[Te]=c[ge],j[Te+1]=c[ge+1],P[Te]=u[ge],P[Te+1]=u[ge+1],V[Te]=f[ge],V[Te+1]=f[ge+1],H[Te]=h[ge],H[Te+1]=h[ge+1],Z[b]=d[re]}return{current:j,next:P,stackedOnCurrent:V,stackedOnNext:H,status:Z}}var Wn=Math.min,qn=Math.max;function Na(t,e){return isNaN(t)||isNaN(e)}function Vd(t,e,r,n,a,i,o,s,l){for(var c,u,f,h,d,p,m=r,g=0;g<n;g++){var v=e[m*2],y=e[m*2+1];if(m>=a||m<0)break;if(Na(v,y)){if(l){m+=i;continue}break}if(m===r)t[i>0?"moveTo":"lineTo"](v,y),f=v,h=y;else{var b=v-c,x=y-u;if(b*b+x*x<.5){m+=i;continue}if(o>0){for(var w=m+i,S=e[w*2],k=e[w*2+1];S===v&&k===y&&g<n;)g++,w+=i,m+=i,S=e[w*2],k=e[w*2+1],v=e[m*2],y=e[m*2+1],b=v-c,x=y-u;var C=g+1;if(l)for(;Na(S,k)&&C<n;)C++,w+=i,S=e[w*2],k=e[w*2+1];var A=.5,M=0,T=0,D=void 0,L=void 0;if(C>=n||Na(S,k))d=v,p=y;else{M=S-c,T=k-u;var R=v-c,O=S-v,B=y-u,j=k-y,P=void 0,V=void 0;if(s==="x"){P=Math.abs(R),V=Math.abs(O);var H=M>0?1:-1;d=v-H*P*o,p=y,D=v+H*V*o,L=y}else if(s==="y"){P=Math.abs(B),V=Math.abs(j);var Z=T>0?1:-1;d=v,p=y-Z*P*o,D=v,L=y+Z*V*o}else P=Math.sqrt(R*R+B*B),V=Math.sqrt(O*O+j*j),A=V/(V+P),d=v-M*o*(1-A),p=y-T*o*(1-A),D=v+M*o*A,L=y+T*o*A,D=Wn(D,qn(S,v)),L=Wn(L,qn(k,y)),D=qn(D,Wn(S,v)),L=qn(L,Wn(k,y)),M=D-v,T=L-y,d=v-M*P/V,p=y-T*P/V,d=Wn(d,qn(c,v)),p=Wn(p,qn(u,y)),d=qn(d,Wn(c,v)),p=qn(p,Wn(u,y)),M=v-d,T=y-p,D=v+M*V/P,L=y+T*V/P}t.bezierCurveTo(f,h,d,p,v,y),f=D,h=L}else t.lineTo(v,y)}c=v,u=y,m+=i}return g}var Ky=(function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t})(),mM=(function(t){K(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Ky},e.prototype.buildPath=function(r,n){var a=n.points,i=0,o=a.length/2;if(n.connectNulls){for(;o>0&&Na(a[o*2-2],a[o*2-1]);o--);for(;i<o&&Na(a[i*2],a[i*2+1]);i++);}for(;i<o;)i+=Vd(r,a,i,o,o,1,n.smooth,n.smoothMonotone,n.connectNulls)+1},e.prototype.getPointOn=function(r,n){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var a=this.path,i=a.data,o=wa.CMD,s,l,c=n==="x",u=[],f=0;f<i.length;){var h=i[f++],d=void 0,p=void 0,m=void 0,g=void 0,v=void 0,y=void 0,b=void 0;switch(h){case o.M:s=i[f++],l=i[f++];break;case o.L:if(d=i[f++],p=i[f++],b=c?(r-s)/(d-s):(r-l)/(p-l),b<=1&&b>=0){var x=c?(p-l)*b+l:(d-s)*b+s;return c?[r,x]:[x,r]}s=d,l=p;break;case o.C:d=i[f++],p=i[f++],m=i[f++],g=i[f++],v=i[f++],y=i[f++];var w=c?nl(s,d,m,v,r,u):nl(l,p,g,y,r,u);if(w>0)for(var S=0;S<w;S++){var k=u[S];if(k<=1&&k>=0){var x=c?wt(l,p,g,y,k):wt(s,d,m,v,k);return c?[r,x]:[x,r]}}s=v,l=y;break}}},e})(qe),yM=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Ky),_M=(function(t){K(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new yM},e.prototype.buildPath=function(r,n){var a=n.points,i=n.stackedOnPoints,o=0,s=a.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Na(a[s*2-2],a[s*2-1]);s--);for(;o<s&&Na(a[o*2],a[o*2+1]);o++);}for(;o<s;){var c=Vd(r,a,o,s,s,1,n.smooth,l,n.connectNulls);Vd(r,i,o+c-1,c,s,-1,n.stackedOnSmooth,l,n.connectNulls),o+=c+1,r.closePath()}},e})(qe);function Ud(){var t=ht();return function(e){var r=t(e),n=e.pipelineContext,a=!!r.large,i=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(a!==o||i!==s)&&"reset"}}var jy=ht(),bM=Ud(),Rr=(function(){function t(){this.group=new St,this.uid=rc("viewChart"),this.renderTask=Uo({plan:xM,reset:wM}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,a){},t.prototype.highlight=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Qy(i,a,"emphasis")},t.prototype.downplay=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Qy(i,a,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.updateLayout=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.updateVisual=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.eachRendered=function(e){ql(this.group,e)},t.markUpdateMethod=function(e,r){jy(e).updateMethod=r},t.protoInitialize=(function(){var e=t.prototype;e.type="chart"})(),t})();function Jy(t,e,r){t&&Vf(t)&&(e==="emphasis"?Ll:Pl)(t,r)}function Qy(t,e,r){var n=Ma(t,e),a=e&&e.highlightKey!=null?l2(e.highlightKey):null;n!=null?I(Mt(n),function(i){Jy(t.getItemGraphicEl(i),r,a)}):t.eachItemGraphicEl(function(i){Jy(i,r,a)})}zu(Rr),Zs(Rr);function xM(t){return bM(t.model)}function wM(t){var e=t.model,r=t.ecModel,n=t.api,a=t.payload,i=e.pipelineContext.progressiveRender,o=t.view,s=a&&jy(a).updateMethod,l=i?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,a),SM[l]}var SM={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function e0(t,e,r,n,a){var i=t.getArea(),o=i.x,s=i.y,l=i.width,c=i.height,u=r.get(["lineStyle","width"])||0;o-=u/2,s-=u/2,l+=u,c+=u,l=Math.ceil(l),o!==Math.floor(o)&&(o=Math.floor(o),l++);var f=new _t({shape:{x:o,y:s,width:l,height:c}});if(e){var h=t.getBaseAxis(),d=h.isHorizontal(),p=h.inverse;d?(p&&(f.shape.x+=l),f.shape.width=0):(p||(f.shape.y+=c),f.shape.height=0);var m=ke(a)?function(g){a(g,f)}:null;_n(f,{shape:{width:l,height:c,x:o,y:s}},r,null,n,m)}return f}function t0(t,e,r){var n=t.getArea(),a=mt(n.r0,1),i=mt(n.r,1),o=new xi({shape:{cx:mt(t.cx,1),cy:mt(t.cy,1),r0:a,r:i,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});if(e){var s=t.getBaseAxis().dim==="angle";s?o.shape.endAngle=n.startAngle:o.shape.r=a,_n(o,{shape:{endAngle:n.endAngle,r:i}},r)}return o}function kM(t,e,r,n,a){if(t){if(t.type==="polar")return t0(t,e,r);if(t.type==="cartesian2d")return e0(t,e,r,n,a)}else return null;return null}function Gd(t,e){return t.type===e}function r0(t,e){if(t.length===e.length){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return;return!0}}function n0(t){for(var e=1/0,r=1/0,n=-1/0,a=-1/0,i=0;i<t.length;){var o=t[i++],s=t[i++];isNaN(o)||(e=Math.min(o,e),n=Math.max(o,n)),isNaN(s)||(r=Math.min(s,r),a=Math.max(s,a))}return[[e,r],[n,a]]}function a0(t,e){var r=n0(t),n=r[0],a=r[1],i=n0(e),o=i[0],s=i[1];return Math.max(Math.abs(n[0]-o[0]),Math.abs(n[1]-o[1]),Math.abs(a[0]-s[0]),Math.abs(a[1]-s[1]))}function i0(t){return et(t)?t:t?.5:0}function TM(t,e,r){if(!r.valueDim)return[];for(var n=e.count(),a=wn(n*2),i=0;i<n;i++){var o=Xy(r,t,e,i);a[i*2]=o[0],a[i*2+1]=o[1]}return a}function Yn(t,e,r,n,a){var i=r.getBaseAxis(),o=i.dim==="x"||i.dim==="radius"?0:1,s=[],l=0,c=[],u=[],f=[],h=[];if(a){for(l=0;l<t.length;l+=2){var d=e||t;!isNaN(d[l])&&!isNaN(d[l+1])&&h.push(t[l],t[l+1])}t=h}for(l=0;l<t.length-2;l+=2)switch(f[0]=t[l+2],f[1]=t[l+3],u[0]=t[l],u[1]=t[l+1],s.push(u[0],u[1]),n){case"end":c[o]=f[o],c[1-o]=u[1-o],s.push(c[0],c[1]);break;case"middle":var p=(u[o]+f[o])/2,m=[];c[o]=m[o]=p,c[1-o]=u[1-o],m[1-o]=f[1-o],s.push(c[0],c[1]),s.push(m[0],m[1]);break;default:c[o]=u[o],c[1-o]=f[1-o],s.push(c[0],c[1])}return s.push(t[l++],t[l++]),s}function CM(t,e){var r=[],n=t.length,a,i;function o(u,f,h){var d=u.coord,p=(h-d)/(f.coord-d),m=AS(p,[u.color,f.color]);return{coord:h,color:m}}for(var s=0;s<n;s++){var l=t[s],c=l.coord;if(c<0)a=l;else if(c>e){i?r.push(o(i,l,e)):a&&r.push(o(a,l,0),o(a,l,e));break}else a&&(r.push(o(a,l,0)),a=null),r.push(l),i=l}return r}function MM(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var a,i,o=n.length-1;o>=0;o--){var s=t.getDimensionInfo(n[o].dimension);if(a=s&&s.coordDim,a==="x"||a==="y"){i=n[o];break}}if(i){var l=e.getAxis(a),c=he(i.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),u=c.length,f=i.outerColors.slice();u&&c[0].coord>c[u-1].coord&&(c.reverse(),f.reverse());var h=CM(c,a==="x"?r.getWidth():r.getHeight()),d=h.length;if(!d&&u)return c[0].coord<0?f[1]?f[1]:c[u-1].color:f[0]?f[0]:c[0].color;var p=10,m=h[0].coord-p,g=h[d-1].coord+p,v=g-m;if(v<.001)return"transparent";I(h,function(b){b.offset=(b.coord-m)/v}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var y=new hm(0,0,0,0,h,!0);return y[a]=m,y[a+"2"]=g,y}}}function AM(t,e,r){var n=t.get("showAllSymbol"),a=n==="auto";if(!(n&&!a)){var i=r.getAxesByScale("ordinal")[0];if(i&&!(a&&DM(i,e))){var o=e.mapDimension(i.dim),s={};return I(i.getViewLabels(),function(l){var c=i.scale.getRawOrdinalNumber(l.tickValue);s[c]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function DM(t,e){var r=t.getExtent(),n=Math.abs(r[1]-r[0])/t.scale.count();isNaN(n)&&(n=0);for(var a=e.count(),i=Math.max(1,Math.round(a/5)),o=0;o<a;o+=i)if(Fd.getSymbolSize(e,o)[t.isHorizontal()?1:0]*1.5>n)return!1;return!0}function IM(t,e){return isNaN(t)||isNaN(e)}function LM(t){for(var e=t.length/2;e>0&&IM(t[e*2-2],t[e*2-1]);e--);return e-1}function o0(t,e){return[t[e*2],t[e*2+1]]}function PM(t,e,r){for(var n=t.length/2,a=r==="x"?0:1,i,o,s=0,l=-1,c=0;c<n;c++)if(o=t[c*2+a],!(isNaN(o)||isNaN(t[c*2+1-a]))){if(c===0){i=o;continue}if(i<=e&&o>=e||i>=e&&o<=e){l=c;break}s=c,i=o}return{range:[s,l],t:(e-i)/(o-i)}}function s0(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<Kr.length;e++)if(t.get([Kr[e],"endLabel","show"]))return!0;return!1}function $d(t,e,r,n){if(Gd(e,"cartesian2d")){var a=n.getModel("endLabel"),i=a.get("valueAnimation"),o=n.getData(),s={lastFrameIndex:0},l=s0(n)?function(d,p){t._endLabelOnDuring(d,p,o,s,i,a,e)}:null,c=e.getBaseAxis().isHorizontal(),u=e0(e,r,n,function(){var d=t._endLabel;d&&r&&s.originalX!=null&&d.attr({x:s.originalX,y:s.originalY})},l);if(!n.get("clip",!0)){var f=u.shape,h=Math.max(f.width,f.height);c?(f.y-=h,f.height+=h*2):(f.x-=h,f.width+=h*2)}return l&&l(1,u),u}else return t0(e,r,n)}function RM(t,e){var r=e.getBaseAxis(),n=r.isHorizontal(),a=r.inverse,i=n?a?"right":"left":"center",o=n?"middle":a?"top":"bottom";return{normal:{align:t.get("align")||i,verticalAlign:t.get("verticalAlign")||o}}}var EM=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(){var r=new St,n=new dM;this.group.add(n.group),this._symbolDraw=n,this._lineGroup=r,this._changePolyState=Ne(this._changePolyState,this)},e.prototype.render=function(r,n,a){var i=r.coordinateSystem,o=this.group,s=r.getData(),l=r.getModel("lineStyle"),c=r.getModel("areaStyle"),u=s.getLayout("points")||[],f=i.type==="polar",h=this._coordSys,d=this._symbolDraw,p=this._polyline,m=this._polygon,g=this._lineGroup,v=!n.ssr&&r.get("animation"),y=!c.isEmpty(),b=c.get("origin"),x=Yy(i,s,b),w=y&&TM(i,s,x),S=r.get("showSymbol"),k=r.get("connectNulls"),C=S&&!f&&AM(r,s,i),A=this._data;A&&A.eachItemGraphicEl(function(xe,Ce){xe.__temp&&(o.remove(xe),A.setItemGraphicEl(Ce,null))}),S||d.remove(),o.add(g);var M=f?!1:r.get("step"),T;i&&i.getArea&&r.get("clip",!0)&&(T=i.getArea(),T.width!=null?(T.x-=.1,T.y-=.1,T.width+=.2,T.height+=.2):T.r0&&(T.r0-=.5,T.r+=.5)),this._clipShapeForSymbol=T;var D=MM(s,i,a)||s.getVisual("style")[s.getVisual("drawType")];if(!(p&&h.type===i.type&&M===this._step))S&&d.updateData(s,{isIgnore:C,clipShape:T,disableAnimation:!0,getSymbolPoint:function(xe){return[u[xe*2],u[xe*2+1]]}}),v&&this._initSymbolLabelAnimation(s,i,T),M&&(w&&(w=Yn(w,u,i,M,k)),u=Yn(u,null,i,M,k)),p=this._newPolyline(u),y?m=this._newPolygon(u,w):m&&(g.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,Oa(D)),g.setClipPath($d(this,i,!0,r));else{y&&!m?m=this._newPolygon(u,w):m&&!y&&(g.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,Oa(D));var L=g.getClipPath();if(L){var R=$d(this,i,!1,r);_n(L,{shape:R.shape},r)}else g.setClipPath($d(this,i,!0,r));S&&d.updateData(s,{isIgnore:C,clipShape:T,disableAnimation:!0,getSymbolPoint:function(xe){return[u[xe*2],u[xe*2+1]]}}),(!r0(this._stackedOnPoints,w)||!r0(this._points,u))&&(v?this._doUpdateAnimation(s,w,i,a,M,b,k):(M&&(w&&(w=Yn(w,u,i,M,k)),u=Yn(u,null,i,M,k)),p.setShape({points:u}),m&&m.setShape({points:u,stackedOnPoints:w})))}var O=r.getModel("emphasis"),B=O.get("focus"),j=O.get("blurScope"),P=O.get("disabled");if(p.useStyle(He(l.getLineStyle(),{fill:"none",stroke:D,lineJoin:"bevel"})),Hf(p,r,"lineStyle"),p.style.lineWidth>0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var V=p.getState("emphasis").style;V.lineWidth=+p.style.lineWidth+1}We(p).seriesIndex=r.seriesIndex,Rl(p,B,j,P);var H=i0(r.get("smooth")),Z=r.get("smoothMonotone");if(p.setShape({smooth:H,smoothMonotone:Z,connectNulls:k}),m){var re=s.getCalculationInfo("stackedOnSeries"),Te=0;m.useStyle(He(c.getAreaStyle(),{fill:D,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),re&&(Te=i0(re.get("smooth"))),m.setShape({smooth:H,stackedOnSmooth:Te,smoothMonotone:Z,connectNulls:k}),Hf(m,r,"areaStyle"),We(m).seriesIndex=r.seriesIndex,Rl(m,B,j,P)}var ge=this._changePolyState;s.eachItemGraphicEl(function(xe){xe&&(xe.onHoverStateChange=ge)}),this._polyline.onHoverStateChange=ge,this._data=s,this._coordSys=i,this._stackedOnPoints=w,this._points=u,this._step=M,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,p),m&&this.packEventData(r,m))},e.prototype.packEventData=function(r,n){We(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},e.prototype.highlight=function(r,n,a,i){var o=r.getData(),s=Ma(o,i);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),c=o.getItemGraphicEl(s);if(!c){var u=l[s*2],f=l[s*2+1];if(isNaN(u)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(u,f))return;var h=r.get("zlevel")||0,d=r.get("z")||0;c=new Fd(o,s),c.x=u,c.y=f,c.setZ(h,d);var p=c.getSymbolPath().getTextContent();p&&(p.zlevel=h,p.z=d,p.z2=this._polyline.z2+1),c.__temp=!0,o.setItemGraphicEl(s,c),c.stopSymbolAnimation(!0),this.group.add(c)}c.highlight()}else Rr.prototype.highlight.call(this,r,n,a,i)},e.prototype.downplay=function(r,n,a,i){var o=r.getData(),s=Ma(o,i);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Rr.prototype.downplay.call(this,r,n,a,i)},e.prototype._changePolyState=function(r){var n=this._polygon;Gg(this._polyline,r),n&&Gg(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new mM({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(r,n){var a=this._polygon;return a&&this._lineGroup.remove(a),a=new _M({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(a),this._polygon=a,a},e.prototype._initSymbolLabelAnimation=function(r,n,a){var i,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(i=s.isHorizontal(),o=!1):n.type==="polar"&&(i=s.dim==="angle",o=!0);var c=r.hostModel,u=c.get("animationDuration");ke(u)&&(u=u(null));var f=c.get("animationDelay")||0,h=ke(f)?f(null):f;r.eachItemGraphicEl(function(d,p){var m=d;if(m){var g=[d.x,d.y],v=void 0,y=void 0,b=void 0;if(a)if(o){var x=a,w=n.pointToCoord(g);i?(v=x.startAngle,y=x.endAngle,b=-w[1]/180*Math.PI):(v=x.r0,y=x.r,b=w[0])}else{var S=a;i?(v=S.x,y=S.x+S.width,b=d.x):(v=S.y+S.height,y=S.y,b=d.y)}var k=y===v?0:(b-v)/(y-v);l&&(k=1-k);var C=ke(f)?f(p):u*k+h,A=m.getSymbolPath(),M=A.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:C}),M&&M.animateFrom({style:{opacity:0}},{duration:300,delay:C}),A.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,a){var i=r.getModel("endLabel");if(s0(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var c=this._endLabel;c||(c=this._endLabel=new $t({z2:200}),c.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var u=LM(l);u>=0&&(Xl(s,Zl(r,"endLabel"),{inheritColor:a,labelFetcher:r,labelDataIndex:u,defaultText:function(f,h,d){return d!=null?$y(o,d):zd(o,f)},enableTextSetter:!0},RM(i,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,a,i,o,s,l){var c=this._endLabel,u=this._polyline;if(c){r<1&&i.originalX==null&&(i.originalX=c.x,i.originalY=c.y);var f=a.getLayout("points"),h=a.hostModel,d=h.get("connectNulls"),p=s.get("precision"),m=s.get("distance")||0,g=l.getBaseAxis(),v=g.isHorizontal(),y=g.inverse,b=n.shape,x=y?v?b.x:b.y+b.height:v?b.x+b.width:b.y,w=(v?m:0)*(y?-1:1),S=(v?0:-m)*(y?-1:1),k=v?"x":"y",C=PM(f,x,k),A=C.range,M=A[1]-A[0],T=void 0;if(M>=1){if(M>1&&!d){var D=o0(f,A[0]);c.attr({x:D[0]+w,y:D[1]+S}),o&&(T=h.getRawValue(A[0]))}else{var D=u.getPointOn(x,k);D&&c.attr({x:D[0]+w,y:D[1]+S});var L=h.getRawValue(A[0]),R=h.getRawValue(A[1]);o&&(T=Uk(a,p,L,R,C.t))}i.lastFrameIndex=A[0]}else{var O=r===1||i.lastFrameIndex>0?A[0]:0,D=o0(f,O);o&&(T=h.getRawValue(O)),c.attr({x:D[0]+w,y:D[1]+S})}if(o){var B=Kl(c);typeof B.setLabelText=="function"&&B.setLabelText(T)}}},e.prototype._doUpdateAnimation=function(r,n,a,i,o,s,l){var c=this._polyline,u=this._polygon,f=r.hostModel,h=gM(this._data,r,this._stackedOnPoints,n,this._coordSys,a,this._valueOrigin),d=h.current,p=h.stackedOnCurrent,m=h.next,g=h.stackedOnNext;if(o&&(p=Yn(h.stackedOnCurrent,h.current,a,o,l),d=Yn(h.current,null,a,o,l),g=Yn(h.stackedOnNext,h.next,a,o,l),m=Yn(h.next,null,a,o,l)),a0(d,m)>3e3||u&&a0(p,g)>3e3){c.stopAnimation(),c.setShape({points:m}),u&&(u.stopAnimation(),u.setShape({points:m,stackedOnPoints:g}));return}c.shape.__points=h.current,c.shape.points=d;var v={shape:{points:m}};h.current!==d&&(v.shape.__points=h.next),c.stopAnimation(),or(c,v,f),u&&(u.setShape({points:d,stackedOnPoints:p}),u.stopAnimation(),or(u,{shape:{stackedOnPoints:g}},f),c.shape.points!==u.shape.points&&(u.shape.points=c.shape.points));for(var y=[],b=h.status,x=0;x<b.length;x++){var w=b[x].cmd;if(w==="="){var S=r.getItemGraphicEl(b[x].idx1);S&&y.push({el:S,ptIdx:x})}}c.animators&&c.animators.length&&c.animators[0].during(function(){u&&u.dirtyShape();for(var k=c.shape.__points,C=0;C<y.length;C++){var A=y[C].el,M=y[C].ptIdx*2;A.x=k[M],A.y=k[M+1],A.markRedraw()}})},e.prototype.remove=function(r){var n=this.group,a=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),a&&a.eachItemGraphicEl(function(i,o){i.__temp&&(n.remove(i),a.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e})(Rr);function OM(t,e){return{seriesType:t,plan:Ud(),reset:function(r){var n=r.getData(),a=r.coordinateSystem;if(r.pipelineContext,!!a){var i=he(a.dimensions,function(f){return n.mapDimension(f)}).slice(0,2),o=i.length,s=n.getCalculationInfo("stackResultDimension");Ai(n,i[0])&&(i[0]=s),Ai(n,i[1])&&(i[1]=s);var l=n.getStore(),c=n.getDimensionIndex(i[0]),u=n.getDimensionIndex(i[1]);return o&&{progress:function(f,h){for(var d=f.end-f.start,p=wn(d*o),m=[],g=[],v=f.start,y=0;v<f.end;v++){var b=void 0;if(o===1){var x=l.get(c,v);b=a.dataToPoint(x,null,g)}else m[0]=l.get(c,v),m[1]=l.get(u,v),b=a.dataToPoint(m,null,g);p[y++]=b[0],p[y++]=b[1]}h.setLayout("points",p)}}}}}}var NM={average:function(t){for(var e=0,r=0,n=0;n<t.length;n++)isNaN(t[n])||(e+=t[n],r++);return r===0?NaN:e/r},sum:function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r]||0;return e},max:function(t){for(var e=-1/0,r=0;r<t.length;r++)t[r]>e&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r<t.length;r++)t[r]<e&&(e=t[r]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},BM=function(t){return Math.round(t.length/2)};function l0(t){return{seriesType:t,reset:function(e,r,n){var a=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,s=a.count();if(s>10&&o.type==="cartesian2d"&&i){var l=o.getBaseAxis(),c=o.getOtherAxis(l),u=l.getExtent(),f=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(f||1),d=Math.round(s/h);if(isFinite(d)&&d>1){i==="lttb"?e.setData(a.lttbDownSample(a.mapDimension(c.dim),1/d)):i==="minmax"&&e.setData(a.minmaxDownSample(a.mapDimension(c.dim),1/d));var p=void 0;ae(i)?p=NM[i]:ke(i)&&(p=i),p&&e.setData(a.downSample(a.mapDimension(c.dim),1/d,p,BM))}}}}}function zM(t){t.registerChartView(EM),t.registerSeriesModel(uM),t.registerLayout(OM("line")),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,l0("line"))}var FM="__ec_stack_";function c0(t){return t.get("stack")||FM+t.seriesIndex}function Wd(t){return t.dim+t.index}function u0(t,e){var r=[];return e.eachSeriesByType(t,function(n){d0(n)&&r.push(n)}),r}function HM(t){var e={};I(t,function(l){var c=l.coordinateSystem,u=c.getBaseAxis();if(!(u.type!=="time"&&u.type!=="value"))for(var f=l.getData(),h=u.dim+"_"+u.index,d=f.getDimensionIndex(f.mapDimension(u.dim)),p=f.getStore(),m=0,g=p.count();m<g;++m){var v=p.get(d,m);e[h]?e[h].push(v):e[h]=[v]}});var r={};for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];if(a){a.sort(function(l,c){return l-c});for(var i=null,o=1;o<a.length;++o){var s=a[o]-a[o-1];s>0&&(i=i===null?s:Math.min(i,s))}r[n]=i}}return r}function f0(t){var e=HM(t),r=[];return I(t,function(n){var a=n.coordinateSystem,i=a.getBaseAxis(),o=i.getExtent(),s;if(i.type==="category")s=i.getBandWidth();else if(i.type==="value"||i.type==="time"){var l=i.dim+"_"+i.index,c=e[l],u=Math.abs(o[1]-o[0]),f=i.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=c?u/h*c:u}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var p=Nt(n.get("barWidth"),s),m=Nt(n.get("barMaxWidth"),s),g=Nt(n.get("barMinWidth")||(h0(n)?.5:1),s),v=n.get("barGap"),y=n.get("barCategoryGap");r.push({bandWidth:s,barWidth:p,barMaxWidth:m,barMinWidth:g,barGap:v,barCategoryGap:y,axisKey:Wd(i),stackId:c0(n)})}),VM(r)}function VM(t){var e={};I(t,function(n,a){var i=n.axisKey,o=n.bandWidth,s=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[i]=s;var c=n.stackId;l[c]||s.autoWidthCount++,l[c]=l[c]||{width:0,maxWidth:0};var u=n.barWidth;u&&!l[c].width&&(l[c].width=u,u=Math.min(s.remainedWidth,u),s.remainedWidth-=u);var f=n.barMaxWidth;f&&(l[c].maxWidth=f);var h=n.barMinWidth;h&&(l[c].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var p=n.barCategoryGap;p!=null&&(s.categoryGap=p)});var r={};return I(e,function(n,a){r[a]={};var i=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=at(i).length;s=Math.max(35-l*4,15)+"%"}var c=Nt(s,o),u=Nt(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-c)/(h+(h-1)*u);d=Math.max(d,0),I(i,function(v){var y=v.maxWidth,b=v.minWidth;if(v.width){var x=v.width;y&&(x=Math.min(x,y)),b&&(x=Math.max(x,b)),v.width=x,f-=x+u*x,h--}else{var x=d;y&&y<x&&(x=Math.min(y,f)),b&&b>x&&(x=b),x!==d&&(v.width=x,f-=x+u*x,h--)}}),d=(f-c)/(h+(h-1)*u),d=Math.max(d,0);var p=0,m;I(i,function(v,y){v.width||(v.width=d),m=v,p+=v.width*(1+u)}),m&&(p-=m.width*u);var g=-p/2;I(i,function(v,y){r[a][y]=r[a][y]||{bandWidth:o,offset:g,width:v.width},g+=v.width*(1+u)})}),r}function UM(t,e,r){if(t&&e){var n=t[Wd(e)];return n}}function GM(t,e){var r=u0(t,e),n=f0(r);I(r,function(a){var i=a.getData(),o=a.coordinateSystem,s=o.getBaseAxis(),l=c0(a),c=n[Wd(s)][l],u=c.offset,f=c.width;i.setLayout({bandWidth:c.bandWidth,offset:u,size:f})})}function $M(t){return{seriesType:t,plan:Ud(),reset:function(e){if(d0(e)){var r=e.getData(),n=e.coordinateSystem,a=n.getBaseAxis(),i=n.getOtherAxis(a),o=r.getDimensionIndex(r.mapDimension(i.dim)),s=r.getDimensionIndex(r.mapDimension(a.dim)),l=e.get("showBackground",!0),c=r.mapDimension(i.dim),u=r.getCalculationInfo("stackResultDimension"),f=Ai(r,c)&&!!r.getCalculationInfo("stackedOnSeries"),h=i.isHorizontal(),d=WM(a,i),p=h0(e),m=e.get("barMinHeight")||0,g=u&&r.getDimensionIndex(u),v=r.getLayout("size"),y=r.getLayout("offset");return{progress:function(b,x){for(var w=b.count,S=p&&wn(w*3),k=p&&l&&wn(w*3),C=p&&wn(w),A=n.master.getRect(),M=h?A.width:A.height,T,D=x.getStore(),L=0;(T=b.next())!=null;){var R=D.get(f?g:o,T),O=D.get(s,T),B=d,j=void 0;f&&(j=+R-D.get(o,T));var P=void 0,V=void 0,H=void 0,Z=void 0;if(h){var re=n.dataToPoint([R,O]);if(f){var Te=n.dataToPoint([j,O]);B=Te[0]}P=B,V=re[1]+y,H=re[0]-B,Z=v,Math.abs(H)<m&&(H=(H<0?-1:1)*m)}else{var re=n.dataToPoint([O,R]);if(f){var Te=n.dataToPoint([O,j]);B=Te[1]}P=re[0]+y,V=B,H=v,Z=re[1]-B,Math.abs(Z)<m&&(Z=(Z<=0?-1:1)*m)}p?(S[L]=P,S[L+1]=V,S[L+2]=h?H:Z,k&&(k[L]=h?A.x:P,k[L+1]=h?V:A.y,k[L+2]=M),C[T]=T):x.setItemLayout(T,{x:P,y:V,width:H,height:Z}),L+=3}p&&x.setLayout({largePoints:S,largeDataIndices:C,largeBackgroundPoints:k,valueAxisHorizontal:h})}}}}}}function d0(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function h0(t){return t.pipelineContext&&t.pipelineContext.large}function WM(t,e){var r=e.model.get("startValue");return r||(r=0),e.toGlobalCoord(e.dataToCoord(e.type==="log"?r>0?r:1:r))}var qd=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){return md(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(r,n,a){var i=this.coordinateSystem;if(i&&i.clampData){var o=i.clampData(r),s=i.dataToPoint(o);if(a)I(i.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var p=h.getTicksCoords(),m=h.getTickModel().get("alignWithLabel"),g=o[d],v=n[d]==="x1"||n[d]==="y1";if(v&&!m&&(g+=1),p.length<2)return;if(p.length===2){s[d]=h.toGlobalCoord(h.getExtent()[v?1:0]);return}for(var y=void 0,b=void 0,x=1,w=0;w<p.length;w++){var S=p[w].coord,k=w===p.length-1?p[w-1].tickValue+x:p[w].tickValue;if(k===g){b=S;break}else if(k<g)y=S;else if(y!=null&&k>g){b=(S+y)/2;break}w===1&&(x=k-p[0].tickValue)}b==null&&(y?y&&(b=p[p.length-1].coord):b=p[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),c=l.getLayout("offset"),u=l.getLayout("size"),f=i.getBaseAxis().isHorizontal()?0:1;s[f]+=c+u/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e})(Qr);Qr.registerClass(qd);var qM=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(){return md(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},e.prototype.brushSelector=function(r,n,a){return a.rect(n.getItemLayout(r))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=yd(qd.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e})(qd),yc="\0__throttleOriginMethod",p0="\0__throttleRate",v0="\0__throttleType";function Yd(t,e,r){var n,a=0,i=0,o=null,s,l,c,u;e=e||0;function f(){i=new Date().getTime(),o=null,t.apply(l,c||[])}var h=function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];n=new Date().getTime(),l=this,c=d;var m=u||e,g=u||r;u=null,s=n-(g?a:i)-m,clearTimeout(o),g?o=setTimeout(f,m):s>=0?f():o=setTimeout(f,-s),a=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){u=d},h}function Xd(t,e,r,n){var a=t[e];if(a){var i=a[yc]||a,o=a[v0],s=a[p0];if(s!==r||o!==n){if(r==null||!n)return t[e]=i;a=t[e]=Yd(i,r,n==="debounce"),a[yc]=i,a[v0]=n,a[p0]=r}return a}}function Zd(t,e){var r=t[e];r&&r[yc]&&(r.clear&&r.clear(),t[e]=r[yc])}var YM=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),g0=(function(t){K(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new YM},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,c=o+l,u=n.startAngle,f=n.endAngle,h=n.clockwise,d=Math.PI*2,p=h?f-u<d:u-f<d;p||(u=f-(h?d:-d));var m=Math.cos(u),g=Math.sin(u),v=Math.cos(f),y=Math.sin(f);p?(r.moveTo(m*o+a,g*o+i),r.arc(m*c+a,g*c+i,l,-Math.PI+u,u,!h)):r.moveTo(m*s+a,g*s+i),r.arc(a,i,s,u,f,!h),r.arc(v*c+a,y*c+i,l,f-Math.PI*2,f-Math.PI,!h),o!==0&&r.arc(a,i,o,f,u,h)},e})(qe);function XM(t,e){e=e||{};var r=e.isRoundCap;return function(n,a,i){var o=a.position;if(!o||o instanceof Array)return Qs(n,a,i);var s=t(o),l=a.distance!=null?a.distance:5,c=this.shape,u=c.cx,f=c.cy,h=c.r,d=c.r0,p=(h+d)/2,m=c.startAngle,g=c.endAngle,v=(m+g)/2,y=r?Math.abs(h-d)/2:0,b=Math.cos,x=Math.sin,w=u+h*b(m),S=f+h*x(m),k="left",C="top";switch(s){case"startArc":w=u+(d-l)*b(v),S=f+(d-l)*x(v),k="center",C="top";break;case"insideStartArc":w=u+(d+l)*b(v),S=f+(d+l)*x(v),k="center",C="bottom";break;case"startAngle":w=u+p*b(m)+_c(m,l+y,!1),S=f+p*x(m)+bc(m,l+y,!1),k="right",C="middle";break;case"insideStartAngle":w=u+p*b(m)+_c(m,-l+y,!1),S=f+p*x(m)+bc(m,-l+y,!1),k="left",C="middle";break;case"middle":w=u+p*b(v),S=f+p*x(v),k="center",C="middle";break;case"endArc":w=u+(h+l)*b(v),S=f+(h+l)*x(v),k="center",C="bottom";break;case"insideEndArc":w=u+(h-l)*b(v),S=f+(h-l)*x(v),k="center",C="top";break;case"endAngle":w=u+p*b(g)+_c(g,l+y,!0),S=f+p*x(g)+bc(g,l+y,!0),k="left",C="middle";break;case"insideEndAngle":w=u+p*b(g)+_c(g,-l+y,!0),S=f+p*x(g)+bc(g,-l+y,!0),k="right",C="middle";break;default:return Qs(n,a,i)}return n=n||{},n.x=w,n.y=S,n.align=k,n.verticalAlign=C,n}}function ZM(t,e,r,n){if(et(n)){t.setTextConfig({rotation:n});return}else if(ee(e)){t.setTextConfig({rotation:0});return}var a=t.shape,i=a.clockwise?a.startAngle:a.endAngle,o=a.clockwise?a.endAngle:a.startAngle,s=(i+o)/2,l,c=r(e);switch(c){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=s;break;case"startAngle":case"insideStartAngle":l=i;break;case"endAngle":case"insideEndAngle":l=o;break;default:t.setTextConfig({rotation:0});return}var u=Math.PI*1.5-l;c==="middle"&&u>Math.PI/2&&u<Math.PI*1.5&&(u-=Math.PI),t.setTextConfig({rotation:u})}function _c(t,e,r){return e*Math.sin(t)*(r?-1:1)}function bc(t,e,r){return e*Math.cos(t)*(r?1:-1)}function KM(t,e,r){var n=t.get("borderRadius");if(n==null)return{cornerRadius:0};ee(n)||(n=[n,n,n,n]);var a=Math.abs(e.r||0-e.r0||0);return{cornerRadius:he(n,function(i){return Pn(i,a)})}}var Kd=Math.max,jd=Math.min;function jM(t,e){var r=t.getArea&&t.getArea();if(Gd(t,"cartesian2d")){var n=t.getBaseAxis();if(n.type!=="category"||!n.onBand){var a=e.getLayout("bandWidth");n.isHorizontal()?(r.x-=a,r.width+=a*2):(r.y-=a,r.height+=a*2)}}return r}var JM=(function(t){K(e,t);function e(){var r=t.call(this)||this;return r.type=e.type,r._isFirstFrame=!0,r}return e.prototype.render=function(r,n,a,i){this._model=r,this._removeOnRenderedListener(a),this._updateDrawMode(r);var o=r.get("coordinateSystem");(o==="cartesian2d"||o==="polar")&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(r,n,a):this._renderNormal(r,n,a,i))},e.prototype.incrementalPrepareRender=function(r){this._clear(),this._updateDrawMode(r),this._updateLargeClip(r)},e.prototype.incrementalRender=function(r,n){this._progressiveEls=[],this._incrementalRenderLarge(r,n)},e.prototype.eachRendered=function(r){ql(this._progressiveEls||this.group,r)},e.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(r,n,a,i){var o=this.group,s=r.getData(),l=this._data,c=r.coordinateSystem,u=c.getBaseAxis(),f;c.type==="cartesian2d"?f=u.isHorizontal():c.type==="polar"&&(f=u.dim==="angle");var h=r.isAnimationEnabled()?r:null,d=QM(r,c);d&&this._enableRealtimeSort(d,s,a);var p=r.get("clip",!0)||d,m=jM(c,s);o.removeClipPath();var g=r.get("roundCap",!0),v=r.get("showBackground",!0),y=r.getModel("backgroundStyle"),b=y.get("borderRadius")||0,x=[],w=this._backgroundEls,S=i&&i.isInitSort,k=i&&i.type==="changeAxisOrder";function C(T){var D=xc[c.type](s,T),L=oA(c,f,D);return L.useStyle(y.getItemStyle()),c.type==="cartesian2d"?L.setShape("r",b):L.setShape("cornerRadius",b),x[T]=L,L}s.diff(l).add(function(T){var D=s.getItemModel(T),L=xc[c.type](s,T,D);if(v&&C(T),!(!s.hasValue(T)||!x0[c.type](L))){var R=!1;p&&(R=m0[c.type](m,L));var O=y0[c.type](r,s,T,L,f,h,u.model,!1,g);d&&(O.forceLabelAnimation=!0),S0(O,s,T,D,L,r,f,c.type==="polar"),S?O.attr({shape:L}):d?_0(d,h,O,L,T,f,!1,!1):_n(O,{shape:L},r,T),s.setItemGraphicEl(T,O),o.add(O),O.ignore=R}}).update(function(T,D){var L=s.getItemModel(T),R=xc[c.type](s,T,L);if(v){var O=void 0;w.length===0?O=C(D):(O=w[D],O.useStyle(y.getItemStyle()),c.type==="cartesian2d"?O.setShape("r",b):O.setShape("cornerRadius",b),x[T]=O);var B=xc[c.type](s,T),j=M0(f,B,c);or(O,{shape:j},h,T)}var P=l.getItemGraphicEl(D);if(!s.hasValue(T)||!x0[c.type](R)){o.remove(P);return}var V=!1;if(p&&(V=m0[c.type](m,R),V&&o.remove(P)),P?vm(P):P=y0[c.type](r,s,T,R,f,h,u.model,!!P,g),d&&(P.forceLabelAnimation=!0),k){var H=P.getTextContent();if(H){var Z=Kl(H);Z.prevValue!=null&&(Z.prevValue=Z.value)}}else S0(P,s,T,L,R,r,f,c.type==="polar");S?P.attr({shape:R}):d?_0(d,h,P,R,T,f,!0,k):or(P,{shape:R},r,T,null),s.setItemGraphicEl(T,P),P.ignore=V,o.add(P)}).remove(function(T){var D=l.getItemGraphicEl(T);D&&Jf(D,r,T)}).execute();var A=this._backgroundGroup||(this._backgroundGroup=new St);A.removeAll();for(var M=0;M<x.length;++M)A.add(x[M]);o.add(A),this._backgroundEls=x,this._data=s},e.prototype._renderLarge=function(r,n,a){this._clear(),T0(r,this.group),this._updateLargeClip(r)},e.prototype._incrementalRenderLarge=function(r,n){this._removeBackground(),T0(n,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(r){var n=r.get("clip",!0)&&kM(r.coordinateSystem,!1,r),a=this.group;n?a.setClipPath(n):a.removeClipPath()},e.prototype._enableRealtimeSort=function(r,n,a){var i=this;if(n.count()){var o=r.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(n,r,a),this._isFirstFrame=!1;else{var s=function(l){var c=n.getItemGraphicEl(l),u=c&&c.shape;return u&&Math.abs(o.isHorizontal()?u.height:u.width)||0};this._onRendered=function(){i._updateSortWithinSameData(n,s,o,a)},a.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(r,n,a){var i=[];return r.each(r.mapDimension(n.dim),function(o,s){var l=a(s);l=l??NaN,i.push({dataIndex:s,mappedValue:l,ordinalNumber:o})}),i.sort(function(o,s){return s.mappedValue-o.mappedValue}),{ordinalNumbers:he(i,function(o){return o.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(r,n,a){for(var i=a.scale,o=r.mapDimension(a.dim),s=Number.MAX_VALUE,l=0,c=i.getOrdinalMeta().categories.length;l<c;++l){var u=r.rawIndexOf(o,i.getRawOrdinalNumber(l)),f=u<0?Number.MIN_VALUE:n(r.indexOfRawIndex(u));if(f>s)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var a=n.scale,i=a.getExtent(),o=Math.max(0,i[0]),s=Math.min(i[1],a.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==a.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(r,n,a,i){if(this._isOrderChangedWithinSameData(r,n,a)){var o=this._dataSort(r,a,n);this._isOrderDifferentInView(o,a)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",axisId:a.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(r,n,a){var i=n.baseAxis,o=this._dataSort(r,i,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:o})},e.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(r){var n=this.group,a=this._data;r&&r.isAnimationEnabled()&&a&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],a.eachItemGraphicEl(function(i){Jf(i,r,We(i).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e})(Rr),m0={cartesian2d:function(t,e){var r=e.width<0?-1:1,n=e.height<0?-1:1;r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var a=t.x+t.width,i=t.y+t.height,o=Kd(e.x,t.x),s=jd(e.x+e.width,a),l=Kd(e.y,t.y),c=jd(e.y+e.height,i),u=s<o,f=c<l;return e.x=u&&o>a?s:o,e.y=f&&l>i?c:l,e.width=u?0:s-o,e.height=f?0:c-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),u||f},polar:function(t,e){var r=e.r0<=e.r?1:-1;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}var a=jd(e.r,t.r),i=Kd(e.r0,t.r0);e.r=a,e.r0=i;var o=a-i<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},y0={cartesian2d:function(t,e,r,n,a,i,o,s,l){var c=new _t({shape:q({},n),z2:1});if(c.__dataIndex=r,c.name="item",i){var u=c.shape,f=a?"height":"width";u[f]=0}return c},polar:function(t,e,r,n,a,i,o,s,l){var c=!a&&l?g0:xi,u=new c({shape:n,z2:1});u.name="item";var f=w0(a);if(u.calculateTextPosition=XM(f,{isRoundCap:c===g0}),i){var h=u.shape,d=a?"r":"endAngle",p={};h[d]=a?n.r0:n.startAngle,p[d]=n[d],(s?or:_n)(u,{shape:p},i)}return u}};function QM(t,e){var r=t.get("realtimeSort",!0),n=e.getBaseAxis();if(r&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function _0(t,e,r,n,a,i,o,s){var l,c;i?(c={x:n.x,width:n.width},l={y:n.y,height:n.height}):(c={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?or:_n)(r,{shape:l},e,a,null);var u=e?t.baseAxis.model:null;(o?or:_n)(r,{shape:c},u,a)}function b0(t,e){for(var r=0;r<e.length;r++)if(!isFinite(t[e[r]]))return!0;return!1}var eA=["x","y","width","height"],tA=["cx","cy","r","startAngle","endAngle"],x0={cartesian2d:function(t){return!b0(t,eA)},polar:function(t){return!b0(t,tA)}},xc={cartesian2d:function(t,e,r){var n=t.getItemLayout(e),a=r?nA(r,n):0,i=n.width>0?1:-1,o=n.height>0?1:-1;return{x:n.x+i*a/2,y:n.y+o*a/2,width:n.width-i*a,height:n.height-o*a}},polar:function(t,e,r){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function rA(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function w0(t){return(function(e){var r=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}})(t)}function S0(t,e,r,n,a,i,o,s){var l=e.getItemVisual(r,"style");if(s){if(!i.get("roundCap")){var u=t.shape,f=KM(n.getModel("itemStyle"),u);q(u,f),t.setShape(u)}}else{var c=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",c)}t.useStyle(l);var h=n.getShallow("cursor");h&&t.attr("cursor",h);var d=s?o?a.r>=a.r0?"endArc":"startArc":a.endAngle>=a.startAngle?"endAngle":"startAngle":o?a.height>=0?"bottom":"top":a.width>=0?"right":"left",p=Zl(n);Xl(t,p,{labelFetcher:i,labelDataIndex:r,defaultText:zd(i.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var m=t.getTextContent();if(s&&m){var g=n.get(["label","position"]);t.textConfig.inside=g==="middle"?!0:null,ZM(t,g==="outside"?d:g,w0(o),n.get(["label","rotate"]))}iT(m,p,i.getRawValue(r),function(y){return $y(e,y)});var v=n.getModel(["emphasis"]);Rl(t,v.get("focus"),v.get("blurScope"),v.get("disabled")),Hf(t,n),rA(a)&&(t.style.fill="none",t.style.stroke="none",I(t.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function nA(t,e){var r=t.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=t.get(["itemStyle","borderWidth"])||0,a=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),i=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,a,i)}var aA=(function(){function t(){}return t})(),k0=(function(t){K(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new aA},e.prototype.buildPath=function(r,n){for(var a=n.points,i=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],c=this.barWidth,u=0;u<a.length;u+=3)l[i]=c,l[o]=a[u+2],s[i]=a[u+i],s[o]=a[u+o],r.rect(s[0],s[1],l[0],l[1])},e})(qe);function T0(t,e,r,n){var a=t.getData(),i=a.getLayout("valueAxisHorizontal")?1:0,o=a.getLayout("largeDataIndices"),s=a.getLayout("size"),l=t.getModel("backgroundStyle"),c=a.getLayout("largeBackgroundPoints");if(c){var u=new k0({shape:{points:c},incremental:!!n,silent:!0,z2:0});u.baseDimIdx=i,u.largeDataIndices=o,u.barWidth=s,u.useStyle(l.getItemStyle()),e.add(u),r&&r.push(u)}var f=new k0({shape:{points:a.getLayout("largePoints")},incremental:!!n,ignoreCoarsePointer:!0,z2:1});f.baseDimIdx=i,f.largeDataIndices=o,f.barWidth=s,e.add(f),f.useStyle(a.getVisual("style")),f.style.stroke=null,We(f).seriesIndex=t.seriesIndex,t.get("silent")||(f.on("mousedown",C0),f.on("mousemove",C0)),r&&r.push(f)}var C0=Yd(function(t){var e=this,r=iA(e,t.offsetX,t.offsetY);We(e).dataIndex=r>=0?r:null},30,!1);function iA(t,e,r){for(var n=t.baseDimIdx,a=1-n,i=t.shape.points,o=t.largeDataIndices,s=[],l=[],c=t.barWidth,u=0,f=i.length/3;u<f;u++){var h=u*3;if(l[n]=c,l[a]=i[h+2],s[n]=i[h+n],s[a]=i[h+a],l[a]<0&&(s[a]+=l[a],l[a]=-l[a]),e>=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[u]}return-1}function M0(t,e,r){if(Gd(r,"cartesian2d")){var n=e,a=r.getArea();return{x:t?n.x:a.x,y:t?a.y:n.y,width:t?n.width:a.width,height:t?a.height:n.height}}else{var a=r.getArea(),i=e;return{cx:a.cx,cy:a.cy,r0:t?a.r0:i.r0,r:t?a.r:i.r,startAngle:t?i.startAngle:0,endAngle:t?i.endAngle:Math.PI*2}}}function oA(t,e,r){var n=t.type==="polar"?xi:_t;return new n({shape:M0(e,r,t),silent:!0,z2:0})}function sA(t){t.registerChartView(JM),t.registerSeriesModel(qM),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,dt(GM,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,$M("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,l0("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,r){var n=e.componentType||"series";r.eachComponent({mainType:n,query:e},function(a){e.sortInfo&&a.axis.setCategorySortInfo(e.sortInfo)})})}function Ei(t,e,r,n,a){var i=t+e;r.isSilent(i)||n.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,c=a.selected,u=0;u<c.length;u++)if(c[u].seriesIndex===s){var f=o.getData(),h=Ma(f,a.fromActionPayload);r.trigger(i,{type:i,seriesId:o.id,name:ee(h)?f.getName(h[0]):f.getName(h),selected:ae(l)?l:q({},l)})}})}function lA(t,e,r){t.on("selectchanged",function(n){var a=r.getModel();n.isFromClick?(Ei("map","selectchanged",e,a,n),Ei("pie","selectchanged",e,a,n)):n.fromAction==="select"?(Ei("map","selected",e,a,n),Ei("pie","selected",e,a,n)):n.fromAction==="unselect"&&(Ei("map","unselected",e,a,n),Ei("pie","unselected",e,a,n))})}function cA(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if(!n.defaultAttr.ignore){var a=n.label,i=a.getComputedTransform(),o=a.getBoundingRect(),s=!i||i[1]<1e-5&&i[2]<1e-5,l=a.style.margin||0,c=o.clone();c.applyTransform(i),c.x-=l/2,c.y-=l/2,c.width+=l,c.height+=l;var u=s?new Vl(o,i):null;e.push({label:a,labelLine:n.labelLine,rect:c,localRect:o,obb:u,priority:n.priority,defaultAttr:n.defaultAttr,layoutOption:n.computedLayoutOption,axisAligned:s,transform:i})}}return e}function uA(t){var e=[];t.sort(function(m,g){return g.priority-m.priority});var r=new Ge(0,0,0,0);function n(m){if(!m.ignore){var g=m.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}m.ignore=!0}for(var a=0;a<t.length;a++){var i=t[a],o=i.axisAligned,s=i.localRect,l=i.transform,c=i.label,u=i.labelLine;r.copy(i.rect),r.width-=.1,r.height-=.1,r.x+=.05,r.y+=.05;for(var f=i.obb,h=!1,d=0;d<e.length;d++){var p=e[d];if(r.intersect(p.rect)){if(o&&p.axisAligned){h=!0;break}if(p.obb||(p.obb=new Vl(p.localRect,p.transform)),f||(f=new Vl(s,l)),f.intersect(p.obb)){h=!0;break}}}h?(n(c),u&&n(u)):(c.attr("ignore",i.defaultAttr.ignore),u&&u.attr("ignore",i.defaultAttr.labelGuideIgnore),e.push(i))}}var Oi=(function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t})(),fA=(function(){function t(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(e){for(var r=e.target;r&&!r.draggable;)r=r.parent||r.__hostTarget;r&&(this._draggingTarget=r,r.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new Oi(r,e),"dragstart",e.event))},t.prototype._drag=function(e){var r=this._draggingTarget;if(r){var n=e.offsetX,a=e.offsetY,i=n-this._x,o=a-this._y;this._x=n,this._y=a,r.drift(i,o,e),this.handler.dispatchToElement(new Oi(r,e),"drag",e.event);var s=this.handler.findHover(n,a,r).target,l=this._dropTarget;this._dropTarget=s,r!==s&&(l&&s!==l&&this.handler.dispatchToElement(new Oi(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new Oi(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new Oi(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new Oi(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t})(),dA=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Jd=[],hA=_e.browser.firefox&&+_e.browser.version.split(".")[0]<39;function Qd(t,e,r,n){return r=r||{},n?A0(t,e,r):hA&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):A0(t,e,r),r}function A0(t,e,r){if(_e.domSupported&&t.getBoundingClientRect){var n=e.clientX,a=e.clientY;if(cy(t)){var i=t.getBoundingClientRect();r.zrX=n-i.left,r.zrY=a-i.top;return}else if(xd(Jd,t,n,a)){r.zrX=Jd[0],r.zrY=Jd[1];return}}r.zrX=r.zrY=0}function eh(t){return t||window.event}function br(t,e,r){if(e=eh(e),e.zrX!=null)return e;var n=e.type,a=n&&n.indexOf("touch")>=0;if(a){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Qd(t,o,e,r)}else{Qd(t,e,e,r);var i=pA(e);e.zrDelta=i?i/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&dA.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function pA(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,n=t.deltaY;if(r==null||n==null)return e;var a=Math.abs(n!==0?n:r),i=n>0?-1:n<0?1:r>0?-1:1;return 3*a*i}function vA(t,e,r,n){t.addEventListener(e,r,n)}function gA(t,e,r,n){t.removeEventListener(e,r,n)}var wc=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function D0(t){return t.which===2||t.which===3}var mA=(function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,n){return this._doTrack(e,r,n),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,n){var a=e.touches;if(a){for(var i={points:[],touches:[],target:r,event:e},o=0,s=a.length;o<s;o++){var l=a[o],c=Qd(n,l,{});i.points.push([c.zrX,c.zrY]),i.touches.push(l)}this._track.push(i)}},t.prototype._recognize=function(e){for(var r in th)if(th.hasOwnProperty(r)){var n=th[r](this._track,e);if(n)return n}},t})();function I0(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function yA(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var th={pinch:function(t,e){var r=t.length;if(r){var n=(t[r-1]||{}).points,a=(t[r-2]||{}).points||n;if(a&&a.length>1&&n&&n.length>1){var i=I0(n)/I0(a);!isFinite(i)&&(i=1),e.pinchScale=i;var o=yA(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},L0="silent";function _A(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:bA}}function bA(){wc(this.event)}var xA=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.handler=null,r}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e})(Ir),$o=(function(){function t(e,r){this.x=e,this.y=r}return t})(),wA=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],rh=new Ge(0,0,0,0),P0=(function(t){K(e,t);function e(r,n,a,i,o){var s=t.call(this)||this;return s._hovered=new $o(0,0),s.storage=r,s.painter=n,s.painterRoot=i,s._pointerSize=o,a=a||new xA,s.proxy=null,s.setHandlerProxy(a),s._draggingMgr=new fA(s),s}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(I(wA,function(n){r.on&&r.on(n,this[n],this)},this),r.handler=this),this.proxy=r},e.prototype.mousemove=function(r){var n=r.zrX,a=r.zrY,i=E0(this,n,a),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=i?new $o(n,a):this.findHover(n,a),c=l.target,u=this.proxy;u.setCursor&&u.setCursor(c?c.cursor:"default"),s&&c!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(l,"mousemove",r),c&&c!==s&&this.dispatchToElement(l,"mouseover",r)},e.prototype.mouseout=function(r){var n=r.zrEventControl;n!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),n!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},e.prototype.resize=function(){this._hovered=new $o(0,0)},e.prototype.dispatch=function(r,n){var a=this[r];a&&a.call(this,n)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(r){var n=this.proxy;n.setCursor&&n.setCursor(r)},e.prototype.dispatchToElement=function(r,n,a){r=r||{};var i=r.target;if(!(i&&i.silent)){for(var o="on"+n,s=_A(n,r,a);i&&(i[o]&&(s.cancelBubble=!!i[o].call(i,s)),i.trigger(n,s),i=i.__hostTarget?i.__hostTarget:i.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(n,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(n,s)}))}},e.prototype.findHover=function(r,n,a){var i=this.storage.getDisplayList(),o=new $o(r,n);if(R0(i,o,r,n,a),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,c=l/2,u=new Ge(r-c,n-c,l,l),f=i.length-1;f>=0;f--){var h=i[f];h!==a&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(rh.copy(h.getBoundingRect()),h.transform&&rh.applyTransform(h.transform),rh.intersect(u)&&s.push(h))}if(s.length)for(var d=4,p=Math.PI/12,m=Math.PI*2,g=0;g<c;g+=d)for(var v=0;v<m;v+=p){var y=r+g*Math.cos(v),b=n+g*Math.sin(v);if(R0(s,o,y,b,a),o.target)return o}}return o},e.prototype.processGesture=function(r,n){this._gestureMgr||(this._gestureMgr=new mA);var a=this._gestureMgr;n==="start"&&a.clear();var i=a.recognize(r,this.findHover(r.zrX,r.zrY,null).target,this.proxy.dom);if(n==="end"&&a.clear(),i){var o=i.type;r.gestureEvent=o;var s=new $o;s.target=i.target,this.dispatchToElement(s,o,i.event)}},e})(Ir);I(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){P0.prototype[t]=function(e){var r=e.zrX,n=e.zrY,a=E0(this,r,n),i,o;if((t!=="mouseup"||!a)&&(i=this.findHover(r,n),o=i.target),t==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(t==="mouseup")this._upEl=o;else if(t==="click"){if(this._downEl!==this._upEl||!this._downPoint||yS(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}});function SA(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var n=t,a=void 0,i=!1;n;){if(n.ignoreClip&&(i=!0),!i){var o=n.getClipPath();if(o&&!o.contain(e,r))return!1}n.silent&&(a=!0);var s=n.__hostTarget;n=s||n.parent}return a?L0:!0}return!1}function R0(t,e,r,n,a){for(var i=t.length-1;i>=0;i--){var o=t[i],s=void 0;if(o!==a&&!o.ignore&&(s=SA(o,r,n))&&(!e.topTarget&&(e.topTarget=o),s!==L0)){e.target=o;break}}}function E0(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var O0=32,Wo=7;function kA(t){for(var e=0;t>=O0;)e|=t&1,t>>=1;return t+e}function N0(t,e,r,n){var a=e+1;if(a===r)return 1;if(n(t[a++],t[e])<0){for(;a<r&&n(t[a],t[a-1])<0;)a++;TA(t,e,a)}else for(;a<r&&n(t[a],t[a-1])>=0;)a++;return a-e}function TA(t,e,r){for(r--;e<r;){var n=t[e];t[e++]=t[r],t[r--]=n}}function B0(t,e,r,n,a){for(n===e&&n++;n<r;n++){for(var i=t[n],o=e,s=n,l;o<s;)l=o+s>>>1,a(i,t[l])<0?s=l:o=l+1;var c=n-o;switch(c){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;c>0;)t[o+c]=t[o+c-1],c--}t[o]=i}}function nh(t,e,r,n,a,i){var o=0,s=0,l=1;if(i(t,e[r+a])>0){for(s=n-a;l<s&&i(t,e[r+a+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}else{for(s=a+1;l<s&&i(t,e[r+a-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var c=o;o=a-l,l=a-c}for(o++;o<l;){var u=o+(l-o>>>1);i(t,e[r+u])>0?o=u+1:l=u}return l}function ah(t,e,r,n,a,i){var o=0,s=0,l=1;if(i(t,e[r+a])<0){for(s=a+1;l<s&&i(t,e[r+a-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var c=o;o=a-l,l=a-c}else{for(s=n-a;l<s&&i(t,e[r+a+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}for(o++;o<l;){var u=o+(l-o>>>1);i(t,e[r+u])<0?l=u:o=u+1}return l}function CA(t,e){var r=Wo,n,a,i=0,o=[];n=[],a=[];function s(d,p){n[i]=d,a[i]=p,i+=1}function l(){for(;i>1;){var d=i-2;if(d>=1&&a[d-1]<=a[d]+a[d+1]||d>=2&&a[d-2]<=a[d]+a[d-1])a[d-1]<a[d+1]&&d--;else if(a[d]>a[d+1])break;u(d)}}function c(){for(;i>1;){var d=i-2;d>0&&a[d-1]<a[d+1]&&d--,u(d)}}function u(d){var p=n[d],m=a[d],g=n[d+1],v=a[d+1];a[d]=m+v,d===i-3&&(n[d+1]=n[d+2],a[d+1]=a[d+2]),i--;var y=ah(t[g],t,p,m,0,e);p+=y,m-=y,m!==0&&(v=nh(t[p+m-1],t,g,v,v-1,e),v!==0&&(m<=v?f(p,m,g,v):h(p,m,g,v)))}function f(d,p,m,g){var v=0;for(v=0;v<p;v++)o[v]=t[d+v];var y=0,b=m,x=d;if(t[x++]=t[b++],--g===0){for(v=0;v<p;v++)t[x+v]=o[y+v];return}if(p===1){for(v=0;v<g;v++)t[x+v]=t[b+v];t[x+g]=o[y];return}for(var w=r,S,k,C;;){S=0,k=0,C=!1;do if(e(t[b],o[y])<0){if(t[x++]=t[b++],k++,S=0,--g===0){C=!0;break}}else if(t[x++]=o[y++],S++,k=0,--p===1){C=!0;break}while((S|k)<w);if(C)break;do{if(S=ah(t[b],o,y,p,0,e),S!==0){for(v=0;v<S;v++)t[x+v]=o[y+v];if(x+=S,y+=S,p-=S,p<=1){C=!0;break}}if(t[x++]=t[b++],--g===0){C=!0;break}if(k=nh(o[y],t,b,g,0,e),k!==0){for(v=0;v<k;v++)t[x+v]=t[b+v];if(x+=k,b+=k,g-=k,g===0){C=!0;break}}if(t[x++]=o[y++],--p===1){C=!0;break}w--}while(S>=Wo||k>=Wo);if(C)break;w<0&&(w=0),w+=2}if(r=w,r<1&&(r=1),p===1){for(v=0;v<g;v++)t[x+v]=t[b+v];t[x+g]=o[y]}else{if(p===0)throw new Error;for(v=0;v<p;v++)t[x+v]=o[y+v]}}function h(d,p,m,g){var v=0;for(v=0;v<g;v++)o[v]=t[m+v];var y=d+p-1,b=g-1,x=m+g-1,w=0,S=0;if(t[x--]=t[y--],--p===0){for(w=x-(g-1),v=0;v<g;v++)t[w+v]=o[v];return}if(g===1){for(x-=p,y-=p,S=x+1,w=y+1,v=p-1;v>=0;v--)t[S+v]=t[w+v];t[x]=o[b];return}for(var k=r;;){var C=0,A=0,M=!1;do if(e(o[b],t[y])<0){if(t[x--]=t[y--],C++,A=0,--p===0){M=!0;break}}else if(t[x--]=o[b--],A++,C=0,--g===1){M=!0;break}while((C|A)<k);if(M)break;do{if(C=p-ah(o[b],t,d,p,p-1,e),C!==0){for(x-=C,y-=C,p-=C,S=x+1,w=y+1,v=C-1;v>=0;v--)t[S+v]=t[w+v];if(p===0){M=!0;break}}if(t[x--]=o[b--],--g===1){M=!0;break}if(A=g-nh(t[y],o,0,g,g-1,e),A!==0){for(x-=A,b-=A,g-=A,S=x+1,w=b+1,v=0;v<A;v++)t[S+v]=o[w+v];if(g<=1){M=!0;break}}if(t[x--]=t[y--],--p===0){M=!0;break}k--}while(C>=Wo||A>=Wo);if(M)break;k<0&&(k=0),k+=2}if(r=k,r<1&&(r=1),g===1){for(x-=p,y-=p,S=x+1,w=y+1,v=p-1;v>=0;v--)t[S+v]=t[w+v];t[x]=o[b]}else{if(g===0)throw new Error;for(w=x-(g-1),v=0;v<g;v++)t[w+v]=o[v]}}return{mergeRuns:l,forceMergeRuns:c,pushRun:s}}function Sc(t,e,r,n){r||(r=0),n||(n=t.length);var a=n-r;if(!(a<2)){var i=0;if(a<O0){i=N0(t,r,n,e),B0(t,r,n,r+i,e);return}var o=CA(t,e),s=kA(a);do{if(i=N0(t,r,n,e),i<s){var l=a;l>s&&(l=s),B0(t,r,r+l,r+i,e),i=l}o.pushRun(r,i),o.mergeRuns(),a-=i,r+=i}while(a!==0);o.forceMergeRuns()}}var z0=!1;function ih(){z0||(z0=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function F0(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var MA=(function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=F0}return t.prototype.traverse=function(e,r){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,r)},t.prototype.getDisplayList=function(e,r){r=r||!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(r),n},t.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var r=this._roots,n=this._displayList,a=0,i=r.length;a<i;a++)this._updateAndAddDisplayable(r[a],null,e);n.length=this._displayListLen,Sc(n,F0)},t.prototype._updateAndAddDisplayable=function(e,r,n){if(!(e.ignore&&!n)){e.beforeUpdate(),e.update(),e.afterUpdate();var a=e.getClipPath();if(e.ignoreClip)r=null;else if(a){r?r=r.slice():r=[];for(var i=a,o=e;i;)i.parent=o,i.updateTransform(),r.push(i),o=i,i=i.getClipPath()}if(e.childrenRef){for(var s=e.childrenRef(),l=0;l<s.length;l++){var c=s[l];e.__dirty&&(c.__dirty|=ir),this._updateAndAddDisplayable(c,r,n)}e.__dirty=0}else{var u=e;r&&r.length?u.__clipPaths=r:u.__clipPaths&&u.__clipPaths.length>0&&(u.__clipPaths=[]),isNaN(u.z)&&(ih(),u.z=0),isNaN(u.z2)&&(ih(),u.z2=0),isNaN(u.zlevel)&&(ih(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,r,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,r,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,r,n)}},t.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},t.prototype.delRoot=function(e){if(e instanceof Array){for(var r=0,n=e.length;r<n;r++)this.delRoot(e[r]);return}var a=Ue(this._roots,e);a>=0&&this._roots.splice(a,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t})(),kc;kc=_e.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};function Ni(){return new Date().getTime()}var AA=(function(t){K(e,t);function e(r){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(r){if(r.animation){var n=r.prev,a=r.next;n?n.next=a:this._head=a,a?a.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},e.prototype.update=function(r){for(var n=Ni()-this._pausedTime,a=n-this._time,i=this._head;i;){var o=i.next,s=i.step(n,a);s&&(i.ondestroy(),this.removeClip(i)),i=o}this._time=n,r||(this.trigger("frame",a),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(kc(n),!r._paused&&r.update())}kc(n)},e.prototype.start=function(){this._running||(this._time=Ni(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Ni(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Ni()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,n){n=n||{},this.start();var a=new lf(r,n.loop);return this.addAnimator(a),a},e})(Ir),DA=300,oh=_e.domSupported,sh=(function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=he(t,function(a){var i=a.replace("mouse","pointer");return r.hasOwnProperty(i)?i:a});return{mouse:t,touch:e,pointer:n}})(),H0={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},V0=!1;function lh(t){var e=t.pointerType;return e==="pen"||e==="touch"}function IA(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function ch(t){t&&(t.zrByTouch=!0)}function LA(t,e){return br(t.dom,new PA(t,e),!0)}function U0(t,e){for(var r=e,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return n}var PA=(function(){function t(e,r){this.stopPropagation=Et,this.stopImmediatePropagation=Et,this.preventDefault=Et,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t})(),Er={mousedown:function(t){t=br(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=br(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=br(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=br(this.dom,t);var e=t.toElement||t.relatedTarget;U0(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){V0=!0,t=br(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){V0||(t=br(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=br(this.dom,t),ch(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Er.mousemove.call(this,t),Er.mousedown.call(this,t)},touchmove:function(t){t=br(this.dom,t),ch(t),this.handler.processGesture(t,"change"),Er.mousemove.call(this,t)},touchend:function(t){t=br(this.dom,t),ch(t),this.handler.processGesture(t,"end"),Er.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<DA&&Er.click.call(this,t)},pointerdown:function(t){Er.mousedown.call(this,t)},pointermove:function(t){lh(t)||Er.mousemove.call(this,t)},pointerup:function(t){Er.mouseup.call(this,t)},pointerout:function(t){lh(t)||Er.mouseout.call(this,t)}};I(["click","dblclick","contextmenu"],function(t){Er[t]=function(e){e=br(this.dom,e),this.trigger(t,e)}});var uh={pointermove:function(t){lh(t)||uh.mousemove.call(this,t)},pointerup:function(t){uh.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function RA(t,e){var r=e.domHandlers;_e.pointerEventsSupported?I(sh.pointer,function(n){Tc(e,n,function(a){r[n].call(t,a)})}):(_e.touchEventsSupported&&I(sh.touch,function(n){Tc(e,n,function(a){r[n].call(t,a),IA(e)})}),I(sh.mouse,function(n){Tc(e,n,function(a){a=eh(a),e.touching||r[n].call(t,a)})}))}function EA(t,e){_e.pointerEventsSupported?I(H0.pointer,r):_e.touchEventsSupported||I(H0.mouse,r);function r(n){function a(i){i=eh(i),U0(t,i.target)||(i=LA(t,i),e.domHandlers[n].call(t,i))}Tc(e,n,a,{capture:!0})}}function Tc(t,e,r,n){t.mounted[e]=r,t.listenerOpts[e]=n,vA(t.domTarget,e,r,n)}function fh(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&gA(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var G0=(function(){function t(e,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=r}return t})(),OA=(function(t){K(e,t);function e(r,n){var a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=r,a.painterRoot=n,a._localHandlerScope=new G0(r,Er),oh&&(a._globalHandlerScope=new G0(document,uh)),RA(a,a._localHandlerScope),a}return e.prototype.dispose=function(){fh(this._localHandlerScope),oh&&fh(this._globalHandlerScope)},e.prototype.setCursor=function(r){this.dom.style&&(this.dom.style.cursor=r||"default")},e.prototype.__togglePointerCapture=function(r){if(this.__mayPointerCapture=null,oh&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var n=this._globalHandlerScope;r?EA(this,n):fh(n)}},e})(Ir);var Cc={},$0={};function NA(t){delete $0[t]}function BA(t){if(!t)return!1;if(typeof t=="string")return cl(t,1)<cf;if(t.colorStops){for(var e=t.colorStops,r=0,n=e.length,a=0;a<n;a++)r+=cl(e[a].color,1);return r/=n,r<cf}return!1}var zA=(function(){function t(e,r,n){var a=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=r,this.id=e;var i=new MA,o=n.renderer||"canvas";Cc[o]||(o=at(Cc)[0]),n.useDirtyRect=n.useDirtyRect==null?!1:n.useDirtyRect;var s=new Cc[o](r,i,n,e),l=n.ssr||s.ssrOnly;this.storage=i,this.painter=s;var c=!_e.node&&!_e.worker&&!l?new OA(s.getViewportRoot(),s.root):null,u=n.useCoarsePointer,f=u==null||u==="auto"?_e.touchEventsSupported:!!u,h=44,d;f&&(d=Pe(n.pointerSize,h)),this.handler=new P0(i,s,c,s.root,d),this.animation=new AA({stage:{update:l?null:function(){return a._flush(!0)}}}),l||this.animation.start()}return t.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},t.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(e,r){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,r),this.refresh())},t.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=BA(e))},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(e){this._darkMode=e},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},t.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},t.prototype.flush=function(){this._disposed||this._flush(!1)},t.prototype._flush=function(e){var r,n=Ni();this._needsRefresh&&(r=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(r=!0,this.refreshHoverImmediately());var a=Ni();r?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:a-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},t.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){if(!this._disposed)return this.handler.findHover(e,r)},t.prototype.on=function(e,r,n){return this._disposed||this.handler.on(e,r,n),this},t.prototype.off=function(e,r){this._disposed||this.handler.off(e,r)},t.prototype.trigger=function(e,r){this._disposed||this.handler.trigger(e,r)},t.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),r=0;r<e.length;r++)e[r]instanceof St&&e[r].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},t.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,NA(this.id))},t})();function W0(t,e){var r=new zA(mv(),t,e);return $0[r.id]=r,r}function FA(t,e){Cc[t]=e}var q0="";typeof navigator<"u"&&(q0=navigator.platform||"");var Bi="rgba(0, 0, 0, 0.2)";const HA={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Bi,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Bi,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Bi,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Bi,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Bi,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Bi,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:q0.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var VA=me();function UA(t,e,r){var n=VA.get(e);if(!n)return r;var a=n(t);return a?r.concat(a):r}var Mc,qo,Y0,X0="\0_ec_inner",GA=1,dh=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,a,i,o,s){i=i||{},this.option=null,this._theme=new lt(i),this._locale=new lt(o),this._optionManager=s},e.prototype.setOption=function(r,n,a){var i=j0(n);this._optionManager.setOption(r,a,i),this._resetOption(null,i)},e.prototype.resetOption=function(r,n){return this._resetOption(r,j0(n))},e.prototype._resetOption=function(r,n){var a=!1,i=this._optionManager;if(!r||r==="recreate"){var o=i.mountOption(r==="recreate");!this.option||r==="recreate"?Y0(this,o):(this.restoreData(),this._mergeOption(o,n)),a=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=i.getTimelineOption(this);s&&(a=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=i.getMediaOption(this);l.length&&I(l,function(c){a=!0,this._mergeOption(c,n)},this)}return a},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,n){var a=this.option,i=this._componentsMap,o=this._componentsCount,s=[],l=me(),c=n&&n.replaceMergeMainTypeMap;hT(this),I(r,function(f,h){f!=null&&(Ye.hasClass(h)?h&&(s.push(h),l.set(h,!0)):a[h]=a[h]==null?Ie(f):Oe(a[h],f,!0))}),c&&c.each(function(f,h){Ye.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Ye.topologicalTravel(s,Ye.getAllClassMainTypes(),u,this);function u(f){var h=UA(this,f,Mt(r[f])),d=i.get(f),p=d?c&&c.get(f)?"replaceMerge":"normalMerge":"replaceAll",m=Dk(d,h,p);Nk(m,f,Ye),a[f]=null,i.set(f,null),o.set(f,0);var g=[],v=[],y=0,b;I(m,function(x,w){var S=x.existing,k=x.newOption;if(!k)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var C=f==="series",A=Ye.getClass(f,x.keyInfo.subType,!C);if(!A)return;if(f==="tooltip"){if(b)return;b=!0}if(S&&S.constructor===A)S.name=x.keyInfo.name,S.mergeOption(k,this),S.optionUpdated(k,!1);else{var M=q({componentIndex:w},x.keyInfo);S=new A(k,this,this,M),q(S,M),x.brandNew&&(S.__requireNewView=!0),S.init(k,this,this),S.optionUpdated(null,!0)}}S?(g.push(S.option),v.push(S),y++):(g.push(void 0),v.push(void 0))},this),a[f]=g,i.set(f,v),o.set(f,y),f==="series"&&Mc(this)}this._seriesIndices||Mc(this)},e.prototype.getOption=function(){var r=Ie(this.option);return I(r,function(n,a){if(Ye.hasClass(a)){for(var i=Mt(n),o=i.length,s=!1,l=o-1;l>=0;l--)i[l]&&!So(i[l])?s=!0:(i[l]=null,!s&&o--);i.length=o,r[a]=i}}),delete r[X0],r},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,n){var a=this._componentsMap.get(r);if(a){var i=a[n||0];if(i)return i;if(n==null){for(var o=0;o<a.length;o++)if(a[o])return a[o]}}},e.prototype.queryComponents=function(r){var n=r.mainType;if(!n)return[];var a=r.index,i=r.id,o=r.name,s=this._componentsMap.get(n);if(!s||!s.length)return[];var l;return a!=null?(l=[],I(Mt(a),function(c){s[c]&&l.push(s[c])})):i!=null?l=Z0("id",i,s):o!=null?l=Z0("name",o,s):l=bt(s,function(c){return!!c}),K0(l,r)},e.prototype.findComponents=function(r){var n=r.query,a=r.mainType,i=s(n),o=i?this.queryComponents(i):bt(this._componentsMap.get(a),function(c){return!!c});return l(K0(o,r));function s(c){var u=a+"Index",f=a+"Id",h=a+"Name";return c&&(c[u]!=null||c[f]!=null||c[h]!=null)?{mainType:a,index:c[u],id:c[f],name:c[h]}:null}function l(c){return r.filter?bt(c,r.filter):c}},e.prototype.eachComponent=function(r,n,a){var i=this._componentsMap;if(ke(r)){var o=n,s=r;i.each(function(f,h){for(var d=0;f&&d<f.length;d++){var p=f[d];p&&s.call(o,h,p,p.componentIndex)}})}else for(var l=ae(r)?i.get(r):de(r)?this.findComponents(r):null,c=0;l&&c<l.length;c++){var u=l[c];u&&n.call(a,u,u.componentIndex)}},e.prototype.getSeriesByName=function(r){var n=Zr(r,null);return bt(this._componentsMap.get("series"),function(a){return!!a&&n!=null&&a.name===n})},e.prototype.getSeriesByIndex=function(r){return this._componentsMap.get("series")[r]},e.prototype.getSeriesByType=function(r){return bt(this._componentsMap.get("series"),function(n){return!!n&&n.subType===r})},e.prototype.getSeries=function(){return bt(this._componentsMap.get("series"),function(r){return!!r})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(r,n){qo(this),I(this._seriesIndices,function(a){var i=this._componentsMap.get("series")[a];r.call(n,i,a)},this)},e.prototype.eachRawSeries=function(r,n){I(this._componentsMap.get("series"),function(a){a&&r.call(n,a,a.componentIndex)})},e.prototype.eachSeriesByType=function(r,n,a){qo(this),I(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];o.subType===r&&n.call(a,o,i)},this)},e.prototype.eachRawSeriesByType=function(r,n,a){return I(this.getSeriesByType(r),n,a)},e.prototype.isSeriesFiltered=function(r){return qo(this),this._seriesIndicesMap.get(r.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(r,n){qo(this);var a=[];I(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];r.call(n,o,i)&&a.push(i)},this),this._seriesIndices=a,this._seriesIndicesMap=me(a)},e.prototype.restoreData=function(r){Mc(this);var n=this._componentsMap,a=[];n.each(function(i,o){Ye.hasClass(o)&&a.push(o)}),Ye.topologicalTravel(a,Ye.getAllClassMainTypes(),function(i){I(n.get(i),function(o){o&&(i!=="series"||!$A(o,r))&&o.restoreData()})})},e.internalField=(function(){Mc=function(r){var n=r._seriesIndices=[];I(r._componentsMap.get("series"),function(a){a&&n.push(a.componentIndex)}),r._seriesIndicesMap=me(n)},qo=function(r){},Y0=function(r,n){r.option={},r.option[X0]=GA,r._componentsMap=me({series:[]}),r._componentsCount=me();var a=n.aria;de(a)&&a.enabled==null&&(a.enabled=!0),WA(n,r._theme.option),Oe(n,HA,!1),r._mergeOption(n,null)}})(),e})(lt);function $A(t,e){if(e){var r=e.seriesIndex,n=e.seriesId,a=e.seriesName;return r!=null&&t.componentIndex!==r||n!=null&&t.id!==n||a!=null&&t.name!==a}}function WA(t,e){var r=t.color&&!t.colorLayer;I(e,function(n,a){a==="colorLayer"&&r||Ye.hasClass(a)||(typeof n=="object"?t[a]=t[a]?Oe(t[a],n,!1):Ie(n):t[a]==null&&(t[a]=n))})}function Z0(t,e,r){if(ee(e)){var n=me();return I(e,function(i){if(i!=null){var o=Zr(i,null);o!=null&&n.set(i,!0)}}),bt(r,function(i){return i&&n.get(i[t])})}else{var a=Zr(e,null);return bt(r,function(i){return i&&a!=null&&i[t]===a})}}function K0(t,e){return e.hasOwnProperty("subType")?bt(t,function(r){return r&&r.subType===e.subType}):t}function j0(t){var e=me();return t&&I(Mt(t.replaceMerge),function(r){e.set(r,!0)}),{replaceMergeMainTypeMap:e}}Ur(dh,Ld);var qA=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],J0=(function(){function t(e){I(qA,function(r){this[r]=Ne(e[r],e)},this)}return t})(),YA=/^(min|max)?(.+)$/,XA=(function(){function t(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return t.prototype.setOption=function(e,r,n){e&&(I(Mt(e.series),function(o){o&&o.data&&Ut(o.data)&&Bu(o.data)}),I(Mt(e.dataset),function(o){o&&o.source&&Ut(o.source)&&Bu(o.source)})),e=Ie(e);var a=this._optionBackup,i=ZA(e,r,!a);this._newBaseOption=i.baseOption,a?(i.timelineOptions.length&&(a.timelineOptions=i.timelineOptions),i.mediaList.length&&(a.mediaList=i.mediaList),i.mediaDefault&&(a.mediaDefault=i.mediaDefault)):this._optionBackup=i},t.prototype.mountOption=function(e){var r=this._optionBackup;return this._timelineOptions=r.timelineOptions,this._mediaList=r.mediaList,this._mediaDefault=r.mediaDefault,this._currentMediaIndices=[],Ie(e?r.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(e){var r,n=this._timelineOptions;if(n.length){var a=e.getComponent("timeline");a&&(r=Ie(n[a.getCurrentIndex()]))}return r},t.prototype.getMediaOption=function(e){var r=this._api.getWidth(),n=this._api.getHeight(),a=this._mediaList,i=this._mediaDefault,o=[],s=[];if(!a.length&&!i)return s;for(var l=0,c=a.length;l<c;l++)KA(a[l].query,r,n)&&o.push(l);return!o.length&&i&&(o=[-1]),o.length&&!JA(o,this._currentMediaIndices)&&(s=he(o,function(u){return Ie(u===-1?i.option:a[u].option)})),this._currentMediaIndices=o,s},t})();function ZA(t,e,r){var n=[],a,i,o=t.baseOption,s=t.timeline,l=t.options,c=t.media,u=!!t.media,f=!!(l||s||o&&o.timeline);o?(i=o,i.timeline||(i.timeline=s)):((f||u)&&(t.options=t.media=null),i=t),u&&ee(c)&&I(c,function(d){d&&d.option&&(d.query?n.push(d):a||(a=d))}),h(i),I(l,function(d){return h(d)}),I(n,function(d){return h(d.option)});function h(d){I(e,function(p){p(d,r)})}return{baseOption:i,timelineOptions:l||[],mediaDefault:a,mediaList:n}}function KA(t,e,r){var n={width:e,height:r,aspectratio:e/r},a=!0;return I(t,function(i,o){var s=o.match(YA);if(!(!s||!s[1]||!s[2])){var l=s[1],c=s[2].toLowerCase();jA(n[c],i,l)||(a=!1)}}),a}function jA(t,e,r){return r==="min"?t>=e:r==="max"?t<=e:t===e}function JA(t,e){return t.join(",")===e.join(",")}var Or=I,Yo=de,Q0=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function hh(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=Q0.length;r<n;r++){var a=Q0[r],i=e.normal,o=e.emphasis;i&&i[a]&&(t[a]=t[a]||{},t[a].normal?Oe(t[a].normal,i[a]):t[a].normal=i[a],i[a]=null),o&&o[a]&&(t[a]=t[a]||{},t[a].emphasis?Oe(t[a].emphasis,o[a]):t[a].emphasis=o[a],o[a]=null)}}function Dt(t,e,r){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var n=t[e].normal,a=t[e].emphasis;n&&(r?(t[e].normal=t[e].emphasis=null,He(t[e],n)):t[e]=n),a&&(t.emphasis=t.emphasis||{},t.emphasis[e]=a,a.focus&&(t.emphasis.focus=a.focus),a.blurScope&&(t.emphasis.blurScope=a.blurScope))}}function Xo(t){Dt(t,"itemStyle"),Dt(t,"lineStyle"),Dt(t,"areaStyle"),Dt(t,"label"),Dt(t,"labelLine"),Dt(t,"upperLabel"),Dt(t,"edgeLabel")}function pt(t,e){var r=Yo(t)&&t[e],n=Yo(r)&&r.textStyle;if(n)for(var a=0,i=Pg.length;a<i;a++){var o=Pg[a];n.hasOwnProperty(o)&&(r[o]=n[o])}}function xr(t){t&&(Xo(t),pt(t,"label"),t.emphasis&&pt(t.emphasis,"label"))}function QA(t){if(Yo(t)){hh(t),Xo(t),pt(t,"label"),pt(t,"upperLabel"),pt(t,"edgeLabel"),t.emphasis&&(pt(t.emphasis,"label"),pt(t.emphasis,"upperLabel"),pt(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(hh(e),xr(e));var r=t.markLine;r&&(hh(r),xr(r));var n=t.markArea;n&&xr(n);var a=t.data;if(t.type==="graph"){a=a||t.nodes;var i=t.links||t.edges;if(i&&!Ut(i))for(var o=0;o<i.length;o++)xr(i[o]);I(t.categories,function(c){Xo(c)})}if(a&&!Ut(a))for(var o=0;o<a.length;o++)xr(a[o]);if(e=t.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)xr(s[o]);if(r=t.markLine,r&&r.data)for(var l=r.data,o=0;o<l.length;o++)ee(l[o])?(xr(l[o][0]),xr(l[o][1])):xr(l[o]);t.type==="gauge"?(pt(t,"axisLabel"),pt(t,"title"),pt(t,"detail")):t.type==="treemap"?(Dt(t.breadcrumb,"itemStyle"),I(t.levels,function(c){Xo(c)})):t.type==="tree"&&Xo(t.leaves)}}function Sn(t){return ee(t)?t:t?[t]:[]}function e_(t){return(ee(t)?t[0]:t)||{}}function eD(t,e){Or(Sn(t.series),function(n){Yo(n)&&QA(n)});var r=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&r.push("valueAxis","categoryAxis","logAxis","timeAxis"),Or(r,function(n){Or(Sn(t[n]),function(a){a&&(pt(a,"axisLabel"),pt(a.axisPointer,"label"))})}),Or(Sn(t.parallel),function(n){var a=n&&n.parallelAxisDefault;pt(a,"axisLabel"),pt(a&&a.axisPointer,"label")}),Or(Sn(t.calendar),function(n){Dt(n,"itemStyle"),pt(n,"dayLabel"),pt(n,"monthLabel"),pt(n,"yearLabel")}),Or(Sn(t.radar),function(n){pt(n,"name"),n.name&&n.axisName==null&&(n.axisName=n.name,delete n.name),n.nameGap!=null&&n.axisNameGap==null&&(n.axisNameGap=n.nameGap,delete n.nameGap)}),Or(Sn(t.geo),function(n){Yo(n)&&(xr(n),Or(Sn(n.regions),function(a){xr(a)}))}),Or(Sn(t.timeline),function(n){xr(n),Dt(n,"label"),Dt(n,"itemStyle"),Dt(n,"controlStyle",!0);var a=n.data;ee(a)&&I(a,function(i){de(i)&&(Dt(i,"label"),Dt(i,"itemStyle"))})}),Or(Sn(t.toolbox),function(n){Dt(n,"iconStyle"),Or(n.feature,function(a){Dt(a,"iconStyle")})}),pt(e_(t.axisPointer),"label"),pt(e_(t.tooltip).axisPointer,"label")}function tD(t,e){for(var r=e.split(","),n=t,a=0;a<r.length&&(n=n&&n[r[a]],n!=null);a++);return n}function rD(t,e,r,n){for(var a=e.split(","),i=t,o,s=0;s<a.length-1;s++)o=a[s],i[o]==null&&(i[o]={}),i=i[o];i[a[s]]==null&&(i[a[s]]=r)}function t_(t){t&&I(nD,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var nD=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],aD=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],ph=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Zo(t){var e=t&&t.itemStyle;if(e)for(var r=0;r<ph.length;r++){var n=ph[r][1],a=ph[r][0];e[n]!=null&&(e[a]=e[n])}}function r_(t){t&&t.alignTo==="edge"&&t.margin!=null&&t.edgeDistance==null&&(t.edgeDistance=t.margin)}function n_(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function iD(t){t&&t.focusNodeAdjacency!=null&&(t.emphasis=t.emphasis||{},t.emphasis.focus==null&&(t.emphasis.focus="adjacency"))}function a_(t,e){if(t)for(var r=0;r<t.length;r++)e(t[r]),t[r]&&a_(t[r].children,e)}function i_(t,e){eD(t,e),t.series=Mt(t.series),I(t.series,function(r){if(de(r)){var n=r.type;if(n==="line")r.clipOverflow!=null&&(r.clip=r.clipOverflow);else if(n==="pie"||n==="gauge"){r.clockWise!=null&&(r.clockwise=r.clockWise),r_(r.label);var a=r.data;if(a&&!Ut(a))for(var i=0;i<a.length;i++)r_(a[i]);r.hoverOffset!=null&&(r.emphasis=r.emphasis||{},(r.emphasis.scaleSize=null)&&(r.emphasis.scaleSize=r.hoverOffset))}else if(n==="gauge"){var o=tD(r,"pointer.color");o!=null&&rD(r,"itemStyle.color",o)}else if(n==="bar"){Zo(r),Zo(r.backgroundStyle),Zo(r.emphasis);var a=r.data;if(a&&!Ut(a))for(var i=0;i<a.length;i++)typeof a[i]=="object"&&(Zo(a[i]),Zo(a[i]&&a[i].emphasis))}else if(n==="sunburst"){var s=r.highlightPolicy;s&&(r.emphasis=r.emphasis||{},r.emphasis.focus||(r.emphasis.focus=s)),n_(r),a_(r.data,n_)}else n==="graph"||n==="sankey"?iD(r):n==="map"&&(r.mapType&&!r.map&&(r.map=r.mapType),r.mapLocation&&He(r,r.mapLocation));r.hoverAnimation!=null&&(r.emphasis=r.emphasis||{},r.emphasis&&r.emphasis.scale==null&&(r.emphasis.scale=r.hoverAnimation)),t_(r)}}),t.dataRange&&(t.visualMap=t.dataRange),I(aD,function(r){var n=t[r];n&&(ee(n)||(n=[n]),I(n,function(a){t_(a)}))})}function oD(t){var e=me();t.eachSeries(function(r){var n=r.get("stack");if(n){var a=e.get(n)||e.set(n,[]),i=r.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:r};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;a.length&&i.setCalculationInfo("stackedOnSeries",a[a.length-1].seriesModel),a.push(o)}}),e.each(sD)}function sD(t){I(t,function(e,r){var n=[],a=[NaN,NaN],i=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(i,function(c,u,f){var h=o.get(e.stackedDimension,f);if(isNaN(h))return a;var d,p;s?p=o.getRawIndex(f):d=o.get(e.stackedByDimension,f);for(var m=NaN,g=r-1;g>=0;g--){var v=t[g];if(s||(p=v.data.rawIndexOf(v.stackedByDimension,d)),p>=0){var y=v.data.getByRawIndex(v.stackResultDimension,p);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&h>=0&&y>0||l==="samesign"&&h<=0&&y<0){h=Sk(h,y),m=y;break}}}return n[0]=h,n[1]=m,n})})}var Nr=(function(){function t(){this.group=new St,this.uid=rc("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,a){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,a){},t.prototype.updateLayout=function(e,r,n,a){},t.prototype.updateVisual=function(e,r,n,a){},t.prototype.toggleBlurSeries=function(e,r,n){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t})();zu(Nr),Zs(Nr);var o_=ht(),s_={itemStyle:oo(Im,!0),lineStyle:oo(Dm,!0)},lD={lineStyle:"stroke",itemStyle:"fill"};function l_(t,e){var r=t.visualStyleMapper||s_[e];return r||(console.warn("Unknown style type '"+e+"'."),s_.itemStyle)}function c_(t,e){var r=t.visualDrawType||lD[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var cD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=t.getModel(n),i=l_(t,n),o=i(a),s=a.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=c_(t,n),c=o[l],u=ke(c)?c:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||u||f){var h=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=h,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ke(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||ke(o.stroke)?h:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&u)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var m=t.getDataParams(p),g=q({},o);g[l]=u(m),d.setItemVisual(p,"style",g)}}}},Ko=new lt,uD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=l_(t,n),i=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Ko.option=l[n];var c=a(Ko),u=o.ensureUniqueItemVisual(s,"style");q(u,c),Ko.option.decal&&(o.setItemVisual(s,"decal",Ko.option.decal),Ko.option.decal.dirty=!0),i in c&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},fD={performRawSeries:!0,overallReset:function(t){var e=me();t.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var a=r.type+"-"+n,i=e.get(a);i||(i={},e.set(a,i)),o_(r).scope=i}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var n=r.getRawData(),a={},i=r.getData(),o=o_(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=c_(r,s);i.each(function(c){var u=i.getRawIndex(c);a[u]=c}),n.each(function(c){var u=a[c],f=i.getItemVisual(u,"colorFromPalette");if(f){var h=i.ensureUniqueItemVisual(u,"style"),d=n.getName(c)||c+"",p=n.count();h[l]=r.getColorFromPalette(d,o,p)}})}})}},Ac=Math.PI;function dD(t,e){e=e||{},He(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var r=new St,n=new _t({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var a=new $t({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),i=new _t({style:{fill:"none"},textContent:a,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(i);var o;return e.showSpinner&&(o=new zl({shape:{startAngle:-Ac/2,endAngle:-Ac/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Ac*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Ac*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=a.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,c=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:c,cy:u}),i.setShape({x:c-l,y:u-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var u_=(function(){function t(e,r,n,a){this._stageTaskMap=me(),this.ecInstance=e,this.api=r,n=this._dataProcessorHandlers=n.slice(),a=this._visualHandlers=a.slice(),this._allHandlers=n.concat(a)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(n){var a=n.overallTask;a&&a.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),a=n.context,i=!r&&n.progressiveEnabled&&(!a||a.progressiveRender)&&e.__idxInPipeline>n.blockIndex,o=i?n.step:null,s=a&&a.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var n=this._pipelineMap.get(e.uid),a=e.getData(),i=a.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&i>=n.threshold,s=e.get("large")&&i>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?i:null;e.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},t.prototype.restorePipelines=function(e){var r=this,n=r._pipelineMap=me();e.eachSeries(function(a){var i=a.getProgressive(),o=a.uid;n.set(o,{id:o,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:i&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),r._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;I(this._allHandlers,function(a){var i=e.get(a.uid)||e.set(a.uid,{}),o="";dn(!(a.reset&&a.overallReset),o),a.reset&&this._createSeriesStageTask(a,i,r,n),a.overallReset&&this._createOverallStageTask(a,i,r,n)},this)},t.prototype.prepareView=function(e,r,n,a){var i=e.renderTask,o=i.context;o.model=r,o.ecModel=n,o.api=a,i.__block=!e.incrementalPrepareRender,this._pipe(r,i)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,n){this._performStageTasks(this._visualHandlers,e,r,n)},t.prototype._performStageTasks=function(e,r,n,a){a=a||{};var i=!1,o=this;I(e,function(l,c){if(!(a.visualType&&a.visualType!==l.visualType)){var u=o._stageTaskMap.get(l.uid),f=u.seriesTaskMap,h=u.overallTask;if(h){var d,p=h.agentStubMap;p.each(function(g){s(a,g)&&(g.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var m=o.getPerformArgs(h,a.block);p.each(function(g){g.perform(m)}),h.perform(m)&&(i=!0)}else f&&f.each(function(g,v){s(a,g)&&g.dirty();var y=o.getPerformArgs(g,a.block);y.skip=!l.performRawSeries&&r.isSeriesFiltered(g.context.model),o.updatePayload(g,n),g.perform(y)&&(i=!0)})}});function s(l,c){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(c.__pipeline.id))}this.unfinished=i||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,n,a){var i=this,o=r.seriesTaskMap,s=r.seriesTaskMap=me(),l=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(u):l?n.eachRawSeriesByType(l,u):c&&c(n,a).each(u);function u(f){var h=f.uid,d=s.set(h,o&&o.get(h)||Uo({plan:mD,reset:yD,count:bD}));d.context={model:f,ecModel:n,api:a,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(f,d)}},t.prototype._createOverallStageTask=function(e,r,n,a){var i=this,o=r.overallTask=r.overallTask||Uo({reset:hD});o.context={ecModel:n,api:a,overallReset:e.overallReset,scheduler:i};var s=o.agentStubMap,l=o.agentStubMap=me(),c=e.seriesType,u=e.getTargetSeries,f=!0,h=!1,d="";dn(!e.createOnAllSeries,d),c?n.eachRawSeriesByType(c,p):u?u(n,a).each(p):(f=!1,I(n.getSeries(),p));function p(m){var g=m.uid,v=l.set(g,s&&s.get(g)||(h=!0,Uo({reset:pD,onDirty:gD})));v.context={model:m,overallProgress:f},v.agent=o,v.__block=f,i._pipe(m,v)}h&&o.dirty()},t.prototype._pipe=function(e,r){var n=e.uid,a=this._pipelineMap.get(n);!a.head&&(a.head=r),a.tail&&a.tail.pipe(r),a.tail=r,r.__idxInPipeline=a.count++,r.__pipeline=a},t.wrapStageHandler=function(e,r){return ke(e)&&(e={overallReset:e,seriesType:xD(e)}),e.uid=rc("stageHandler"),r&&(e.visualType=r),e},t})();function hD(t){t.overallReset(t.ecModel,t.api,t.payload)}function pD(t){return t.overallProgress&&vD}function vD(){this.agent.dirty(),this.getDownstream().dirty()}function gD(){this.agent&&this.agent.dirty()}function mD(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function yD(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Mt(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?he(e,function(r,n){return f_(n)}):_D}var _D=f_(0);function f_(t){return function(e,r){var n=r.data,a=r.resetDefines[t];if(a&&a.dataEach)for(var i=e.start;i<e.end;i++)a.dataEach(n,i);else a&&a.progress&&a.progress(e,n)}}function bD(t){return t.data.count()}function xD(t){Dc=null;try{t(jo,d_)}catch{}return Dc}var jo={},d_={},Dc;h_(jo,dh),h_(d_,J0),jo.eachSeriesByType=jo.eachRawSeriesByType=function(t){Dc=t},jo.eachComponent=function(t){t.mainType==="series"&&t.subType&&(Dc=t.subType)};function h_(t,e){for(var r in e.prototype)t[r]=Et}var p_=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const wD={color:p_,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],p_]};var It="#B9B8CE",v_="#100C2A",Ic=function(){return{axisLine:{lineStyle:{color:It}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},g_=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],m_={darkMode:!0,color:g_,backgroundColor:v_,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:It},pageTextStyle:{color:It}},textStyle:{color:It},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:It}},dataZoom:{borderColor:"#71708A",textStyle:{color:It},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:It}},timeline:{lineStyle:{color:It},label:{color:It},controlStyle:{color:It,borderColor:It}},calendar:{itemStyle:{color:v_},dayLabel:{color:It},monthLabel:{color:It},yearLabel:{color:It}},timeAxis:Ic(),logAxis:Ic(),valueAxis:Ic(),categoryAxis:Ic(),line:{symbol:"circle"},graph:{color:g_},gauge:{title:{color:It},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:It},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};m_.categoryAxis.splitLine.show=!1;var SD=(function(){function t(){}return t.prototype.normalizeQuery=function(e){var r={},n={},a={};if(ae(e)){var i=$r(e);r.mainType=i.main||null,r.subType=i.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};I(e,function(l,c){for(var u=!1,f=0;f<o.length;f++){var h=o[f],d=c.lastIndexOf(h);if(d>0&&d===c.length-h.length){var p=c.slice(0,d);p!=="data"&&(r.mainType=p,r[h.toLowerCase()]=l,u=!0)}}s.hasOwnProperty(c)&&(n[c]=l,u=!0),u||(a[c]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:a}},t.prototype.filter=function(e,r){var n=this.eventInfo;if(!n)return!0;var a=n.targetEl,i=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,c=r.dataQuery;return u(l,o,"mainType")&&u(l,o,"subType")&&u(l,o,"index","componentIndex")&&u(l,o,"name")&&u(l,o,"id")&&u(c,i,"name")&&u(c,i,"dataIndex")&&u(c,i,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,a,i));function u(f,h,d,p){return f[d]==null||h[p||d]===f[d]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t})(),vh=["symbol","symbolSize","symbolRotate","symbolOffset"],y_=vh.concat(["symbolKeepAspect"]),kD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var n={},a={},i=!1,o=0;o<vh.length;o++){var s=vh[o],l=t.get(s);ke(l)?(i=!0,a[s]=l):n[s]=l}if(n.symbol=n.symbol||t.defaultSymbol,r.setVisual(q({legendIcon:t.legendIcon||n.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},n)),e.isSeriesFiltered(t))return;var c=at(a);function u(f,h){for(var d=t.getRawValue(h),p=t.getDataParams(h),m=0;m<c.length;m++){var g=c[m];f.setItemVisual(h,g,a[g](d,p))}}return{dataEach:i?u:null}}},TD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.hasSymbolVisual||e.isSeriesFiltered(t))return;var r=t.getData();function n(a,i){for(var o=a.getItemModel(i),s=0;s<y_.length;s++){var l=y_[s],c=o.getShallow(l,!0);c!=null&&a.setItemVisual(i,l,c)}}return{dataEach:r.hasItemOption?n:null}}};function CD(t,e,r){switch(r){case"color":var n=t.getItemVisual(e,"style");return n[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,r)}}function MD(t,e){switch(e){case"color":var r=t.getVisual("style");return r[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function Jo(t,e,r){for(var n;t&&!(e(t)&&(n=t,r));)t=t.__hostTarget||t.parent;return n}var AD=Math.round(Math.random()*9),DD=typeof Object.defineProperty=="function",ID=(function(){function t(){this._id="__ec_inner_"+AD++}return t.prototype.get=function(e){return this._guard(e)[this._id]},t.prototype.set=function(e,r){var n=this._guard(e);return DD?Object.defineProperty(n,this._id,{value:r,enumerable:!1,configurable:!0}):n[this._id]=r,this},t.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},t.prototype.has=function(e){return!!this._guard(e)[this._id]},t.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},t})();function Ba(t){return isFinite(t)}function LD(t,e,r){var n=e.x==null?0:e.x,a=e.x2==null?1:e.x2,i=e.y==null?0:e.y,o=e.y2==null?0:e.y2;e.global||(n=n*r.width+r.x,a=a*r.width+r.x,i=i*r.height+r.y,o=o*r.height+r.y),n=Ba(n)?n:0,a=Ba(a)?a:1,i=Ba(i)?i:0,o=Ba(o)?o:0;var s=t.createLinearGradient(n,i,a,o);return s}function PD(t,e,r){var n=r.width,a=r.height,i=Math.min(n,a),o=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(o=o*n+r.x,s=s*a+r.y,l=l*i),o=Ba(o)?o:.5,s=Ba(s)?s:.5,l=l>=0&&Ba(l)?l:.5;var c=t.createRadialGradient(o,s,0,o,s,l);return c}function gh(t,e,r){for(var n=e.type==="radial"?PD(t,e,r):LD(t,e,r),a=e.colorStops,i=0;i<a.length;i++)n.addColorStop(a[i].offset,a[i].color);return n}function RD(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!0;return!1}function Lc(t){return parseInt(t,10)}function Pc(t,e,r){var n=["width","height"][e],a=["clientWidth","clientHeight"][e],i=["paddingLeft","paddingTop"][e],o=["paddingRight","paddingBottom"][e];if(r[n]!=null&&r[n]!=="auto")return parseFloat(r[n]);var s=document.defaultView.getComputedStyle(t);return(t[a]||Lc(s[n])||Lc(t.style[n]))-(Lc(s[i])||0)-(Lc(s[o])||0)|0}function ED(t,e){return!t||t==="solid"||!(e>0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:et(t)?[t]:ee(t)?t:null}function __(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&ED(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(r){var a=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&a!==1&&(r=he(r,function(i){return i/a}),n/=a)}return[r,n]}var OD=new wa(!0);function Rc(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function b_(t){return typeof t=="string"&&t!=="none"}function Ec(t){var e=t.fill;return e!=null&&e!=="none"}function x_(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function w_(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function mh(t,e,r){var n=Cv(e.image,e.__image,r);if(Ks(n)){var a=t.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&a&&a.setTransform){var i=new DOMMatrix;i.translateSelf(e.x||0,e.y||0),i.rotateSelf(0,0,(e.rotation||0)*Fw),i.scaleSelf(e.scaleX||1,e.scaleY||1),a.setTransform(i)}return a}}function ND(t,e,r,n){var a,i=Rc(r),o=Ec(r),s=r.strokePercent,l=s<1,c=!e.path;(!e.silent||l)&&c&&e.createPathProxy();var u=e.path||OD,f=e.__dirty;if(!n){var h=r.fill,d=r.stroke,p=o&&!!h.colorStops,m=i&&!!d.colorStops,g=o&&!!h.image,v=i&&!!d.image,y=void 0,b=void 0,x=void 0,w=void 0,S=void 0;(p||m)&&(S=e.getBoundingRect()),p&&(y=f?gh(t,h,S):e.__canvasFillGradient,e.__canvasFillGradient=y),m&&(b=f?gh(t,d,S):e.__canvasStrokeGradient,e.__canvasStrokeGradient=b),g&&(x=f||!e.__canvasFillPattern?mh(t,h,e):e.__canvasFillPattern,e.__canvasFillPattern=x),v&&(w=f||!e.__canvasStrokePattern?mh(t,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),p?t.fillStyle=y:g&&(x?t.fillStyle=x:o=!1),m?t.strokeStyle=b:v&&(w?t.strokeStyle=w:i=!1)}var k=e.getGlobalScale();u.setScale(k[0],k[1],e.segmentIgnoreThreshold);var C,A;t.setLineDash&&r.lineDash&&(a=__(e),C=a[0],A=a[1]);var M=!0;(c||f&pi)&&(u.setDPR(t.dpr),l?u.setContext(null):(u.setContext(t),M=!1),u.reset(),e.buildPath(u,e.shape,n),u.toStatic(),e.pathUpdated()),M&&u.rebuildPath(t,l?s:1),C&&(t.setLineDash(C),t.lineDashOffset=A),n||(r.strokeFirst?(i&&w_(t,r),o&&x_(t,r)):(o&&x_(t,r),i&&w_(t,r))),C&&t.setLineDash([])}function BD(t,e,r){var n=e.__image=Cv(r.image,e.__image,e,e.onload);if(!(!n||!Ks(n))){var a=r.x||0,i=r.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var c=r.sx||0,u=r.sy||0;t.drawImage(n,c,u,r.sWidth,r.sHeight,a,i,o,s)}else if(r.sx&&r.sy){var c=r.sx,u=r.sy,f=o-c,h=s-u;t.drawImage(n,c,u,f,h,a,i,o,s)}else t.drawImage(n,a,i,o,s)}}function zD(t,e,r){var n,a=r.text;if(a!=null&&(a+=""),a){t.font=r.font||sa,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var i=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=__(e),i=n[0],o=n[1]),i&&(t.setLineDash(i),t.lineDashOffset=o),r.strokeFirst?(Rc(r)&&t.strokeText(a,r.x,r.y),Ec(r)&&t.fillText(a,r.x,r.y)):(Ec(r)&&t.fillText(a,r.x,r.y),Rc(r)&&t.strokeText(a,r.x,r.y)),i&&t.setLineDash([])}}var S_=["shadowBlur","shadowOffsetX","shadowOffsetY"],k_=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function T_(t,e,r,n,a){var i=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){Kt(t,a),i=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?ga.opacity:o}(n||e.blend!==r.blend)&&(i||(Kt(t,a),i=!0),t.globalCompositeOperation=e.blend||ga.blend);for(var s=0;s<S_.length;s++){var l=S_[s];(n||e[l]!==r[l])&&(i||(Kt(t,a),i=!0),t[l]=t.dpr*(e[l]||0))}return(n||e.shadowColor!==r.shadowColor)&&(i||(Kt(t,a),i=!0),t.shadowColor=e.shadowColor||ga.shadowColor),i}function C_(t,e,r,n,a){var i=Qo(e,a.inHover),o=n?null:r&&Qo(r,a.inHover)||{};if(i===o)return!1;var s=T_(t,i,o,n,a);if((n||i.fill!==o.fill)&&(s||(Kt(t,a),s=!0),b_(i.fill)&&(t.fillStyle=i.fill)),(n||i.stroke!==o.stroke)&&(s||(Kt(t,a),s=!0),b_(i.stroke)&&(t.strokeStyle=i.stroke)),(n||i.opacity!==o.opacity)&&(s||(Kt(t,a),s=!0),t.globalAlpha=i.opacity==null?1:i.opacity),e.hasStroke()){var l=i.lineWidth,c=l/(i.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==c&&(s||(Kt(t,a),s=!0),t.lineWidth=c)}for(var u=0;u<k_.length;u++){var f=k_[u],h=f[0];(n||i[h]!==o[h])&&(s||(Kt(t,a),s=!0),t[h]=i[h]||f[1])}return s}function FD(t,e,r,n,a){return T_(t,Qo(e,a.inHover),r&&Qo(r,a.inHover),n,a)}function M_(t,e){var r=e.transform,n=t.dpr||1;r?t.setTransform(n*r[0],n*r[1],n*r[2],n*r[3],n*r[4],n*r[5]):t.setTransform(n,0,0,n,0,0)}function HD(t,e,r){for(var n=!1,a=0;a<t.length;a++){var i=t[a];n=n||i.isZeroArea(),M_(e,i),e.beginPath(),i.buildPath(e,i.shape),e.clip()}r.allClipped=n}function VD(t,e){return t&&e?t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||t[4]!==e[4]||t[5]!==e[5]:!(!t&&!e)}var A_=1,D_=2,I_=3,L_=4;function UD(t){var e=Ec(t),r=Rc(t);return!(t.lineDash||!(+e^+r)||e&&typeof t.fill!="string"||r&&typeof t.stroke!="string"||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}function Kt(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function Qo(t,e){return e&&t.__hoverStyle||t.style}function P_(t,e){za(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function za(t,e,r,n){var a=e.transform;if(!e.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1)){e.__dirty&=~ir,e.__isRendered=!1;return}var i=e.__clipPaths,o=r.prevElClipPaths,s=!1,l=!1;if((!o||RD(i,o))&&(o&&o.length&&(Kt(t,r),t.restore(),l=s=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),i&&i.length&&(Kt(t,r),t.save(),HD(i,t,r),s=!0),r.prevElClipPaths=i),r.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var c=r.prevEl;c||(l=s=!0);var u=e instanceof qe&&e.autoBatch&&UD(e.style);s||VD(a,c.transform)?(Kt(t,r),M_(t,e)):u||Kt(t,r);var f=Qo(e,r.inHover);e instanceof qe?(r.lastDrawType!==A_&&(l=!0,r.lastDrawType=A_),C_(t,e,c,l,r),(!u||!r.batchFill&&!r.batchStroke)&&t.beginPath(),ND(t,e,f,u),u&&(r.batchFill=f.fill||"",r.batchStroke=f.stroke||"")):e instanceof Sl?(r.lastDrawType!==I_&&(l=!0,r.lastDrawType=I_),C_(t,e,c,l,r),zD(t,e,f)):e instanceof Fn?(r.lastDrawType!==D_&&(l=!0,r.lastDrawType=D_),FD(t,e,c,l,r),BD(t,e,f)):e.getTemporalDisplayables&&(r.lastDrawType!==L_&&(l=!0,r.lastDrawType=L_),GD(t,e,r)),u&&n&&Kt(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),r.prevEl=e,e.__dirty=0,e.__isRendered=!0}function GD(t,e,r){var n=e.getDisplayables(),a=e.getTemporalDisplayables();t.save();var i={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:r.viewWidth,viewHeight:r.viewHeight,inHover:r.inHover},o,s;for(o=e.getCursor(),s=n.length;o<s;o++){var l=n[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),za(t,l,i,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}for(var c=0,u=a.length;c<u;c++){var l=a[c];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),za(t,l,i,c===u-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}var yh=new ID,R_=new so(100),E_=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function _h(t,e){if(t==="none")return null;var r=e.getDevicePixelRatio(),n=e.getZr(),a=n.painter.type==="svg";t.dirty&&yh.delete(t);var i=yh.get(t);if(i)return i;var o=He(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=a?1:1/r,yh.set(t,s),t.dirty=!1,s;function l(c){for(var u=[r],f=!0,h=0;h<E_.length;++h){var d=o[E_[h]];if(d!=null&&!ee(d)&&!ae(d)&&!et(d)&&typeof d!="boolean"){f=!1;break}u.push(d)}var p;if(f){p=u.join(",")+(a?"-svg":"");var m=R_.get(p);m&&(a?c.svgElement=m:c.image=m)}var g=N_(o.dashArrayX),v=$D(o.dashArrayY),y=O_(o.symbol),b=WD(g),x=B_(v),w=!a&&ri.createCanvas(),S=a&&{tag:"g",attrs:{},key:"dcl",children:[]},k=A(),C;w&&(w.width=k.width*r,w.height=k.height*r,C=w.getContext("2d")),M(),f&&R_.put(p,w||S),c.image=w,c.svgElement=S,c.svgWidth=k.width,c.svgHeight=k.height;function A(){for(var T=1,D=0,L=b.length;D<L;++D)T=Ag(T,b[D]);for(var R=1,D=0,L=y.length;D<L;++D)R=Ag(R,y[D].length);T*=R;var O=x*b.length*y.length;return{width:Math.max(1,Math.min(T,o.maxTileWidth)),height:Math.max(1,Math.min(O,o.maxTileHeight))}}function M(){C&&(C.clearRect(0,0,w.width,w.height),o.backgroundColor&&(C.fillStyle=o.backgroundColor,C.fillRect(0,0,w.width,w.height)));for(var T=0,D=0;D<v.length;++D)T+=v[D];if(T<=0)return;for(var L=-x,R=0,O=0,B=0;L<k.height;){if(R%2===0){for(var j=O/2%y.length,P=0,V=0,H=0;P<k.width*2;){for(var Z=0,D=0;D<g[B].length;++D)Z+=g[B][D];if(Z<=0)break;if(V%2===0){var re=(1-o.symbolSize)*.5,Te=P+g[B][V]*re,ge=L+v[R]*re,xe=g[B][V]*o.symbolSize,Ce=v[R]*o.symbolSize,be=H/2%y[j].length;it(Te,ge,xe,Ce,y[j][be])}P+=g[B][V],++H,++V,V===g[B].length&&(V=0)}++B,B===g.length&&(B=0)}L+=v[R],++O,++R,R===v.length&&(R=0)}function it(Qe,ze,oe,pe,ot){var Xe=a?1:r,kt=Ri(ot,Qe*Xe,ze*Xe,oe*Xe,pe*Xe,o.color,o.symbolKeepAspect);if(a){var tt=n.painter.renderOneToVNode(kt);tt&&S.children.push(tt)}else P_(C,kt)}}}}function O_(t){if(!t||t.length===0)return[["rect"]];if(ae(t))return[[t]];for(var e=!0,r=0;r<t.length;++r)if(!ae(t[r])){e=!1;break}if(e)return O_([t]);for(var n=[],r=0;r<t.length;++r)ae(t[r])?n.push([t[r]]):n.push(t[r]);return n}function N_(t){if(!t||t.length===0)return[[0,0]];if(et(t)){var e=Math.ceil(t);return[[e,e]]}for(var r=!0,n=0;n<t.length;++n)if(!et(t[n])){r=!1;break}if(r)return N_([t]);for(var a=[],n=0;n<t.length;++n)if(et(t[n])){var e=Math.ceil(t[n]);a.push([e,e])}else{var e=he(t[n],function(s){return Math.ceil(s)});e.length%2===1?a.push(e.concat(e)):a.push(e)}return a}function $D(t){if(!t||typeof t=="object"&&t.length===0)return[0,0];if(et(t)){var e=Math.ceil(t);return[e,e]}var r=he(t,function(n){return Math.ceil(n)});return t.length%2?r.concat(r):r}function WD(t){return he(t,function(e){return B_(e)})}function B_(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return t.length%2===1?e*2:e}function qD(t,e){t.eachRawSeries(function(r){if(!t.isSeriesFiltered(r)){var n=r.getData();n.hasItemVisual()&&n.each(function(o){var s=n.getItemVisual(o,"decal");if(s){var l=n.ensureUniqueItemVisual(o,"style");l.decal=_h(s,e)}});var a=n.getVisual("decal");if(a){var i=n.getVisual("style");i.decal=_h(a,e)}}})}var Br=new Ir,z_={};function YD(t,e){z_[t]=e}function XD(t){return z_[t]}var ZD=1,KD=800,jD=900,JD=1e3,QD=2e3,eI=5e3,F_=1e3,tI=1100,bh=2e3,H_=3e3,rI=4e3,Oc=4500,nI=4600,aI=5e3,iI=6e3,V_=7e3,oI={PROCESSOR:{FILTER:JD,SERIES_FILTER:KD,STATISTIC:eI},VISUAL:{LAYOUT:F_,PROGRESSIVE_LAYOUT:tI,GLOBAL:bh,CHART:H_,POST_CHART_LAYOUT:nI,COMPONENT:rI,BRUSH:aI,CHART_ITEM:Oc,ARIA:iI,DECAL:V_}},Lt="__flagInMainProcess",jt="__pendingUpdate",xh="__needsUpdateStatus",U_=/^[a-zA-Z0-9_]+$/,wh="__connectUpdateStatus",G_=0,sI=1,lI=2;function $_(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isDisposed()){this.id;return}return q_(this,t,e)}}function W_(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return q_(this,t,e)}}function q_(t,e,r){return r[0]=r[0]&&r[0].toLowerCase(),Ir.prototype[e].apply(t,r)}var Y_=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Ir),X_=Y_.prototype;X_.on=W_("on"),X_.off=W_("off");var zi,Sh,Nc,Xn,kh,Th,Ch,es,ts,Z_,K_,Mh,j_,Bc,J_,Q_,wr,eb,tb=(function(t){K(e,t);function e(r,n,a){var i=t.call(this,new SD)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],a=a||{},ae(n)&&(n=rb[n]),i._dom=r;var o="canvas",s="auto",l=!1;a.ssr;var c=i._zr=W0(r,{renderer:a.renderer||o,devicePixelRatio:a.devicePixelRatio,width:a.width,height:a.height,ssr:a.ssr,useDirtyRect:Pe(a.useDirtyRect,l),useCoarsePointer:Pe(a.useCoarsePointer,s),pointerSize:a.pointerSize});i._ssr=a.ssr,i._throttledZrFlush=Yd(Ne(c.flush,c),17),n=Ie(n),n&&i_(n,!0),i._theme=n,i._locale=cC(a.locale||uy),i._coordSysMgr=new gd;var u=i._api=J_(i);function f(h,d){return h.__prio-d.__prio}return Sc(Fc,f),Sc(Dh,f),i._scheduler=new u_(i,u,Dh,Fc),i._messageCenter=new Y_,i._initEvents(),i.resize=Ne(i.resize,i),c.animation.on("frame",i._onframe,i),Z_(c,i),K_(c,i),Bu(i),i}return e.prototype._onframe=function(){if(!this._disposed){eb(this);var r=this._scheduler;if(this[jt]){var n=this[jt].silent;this[Lt]=!0;try{zi(this),Xn.update.call(this,null,this[jt].updateParams)}catch(l){throw this[Lt]=!1,this[jt]=null,l}this._zr.flush(),this[Lt]=!1,this[jt]=null,es.call(this,n),ts.call(this,n)}else if(r.unfinished){var a=ZD,i=this._model,o=this._api;r.unfinished=!1;do{var s=+new Date;r.performSeriesTasks(i),r.performDataProcessorTasks(i),Th(this,i),r.performVisualTasks(i),Bc(this,this._model,o,"remain",{}),a-=+new Date-s}while(a>0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,n,a){if(!this[Lt]){if(this._disposed){this.id;return}var i,o,s;if(de(n)&&(a=n.lazyUpdate,i=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Lt]=!0,!this._model||n){var l=new XA(this._api),c=this._theme,u=this._model=new dh;u.scheduler=this._scheduler,u.ssr=this._ssr,u.init(null,null,null,c,this._locale,l)}this._model.setOption(r,{replaceMerge:o},Ih);var f={seriesTransition:s,optionChanged:!0};if(a)this[jt]={silent:i,updateParams:f},this[Lt]=!1,this.getZr().wakeUp();else{try{zi(this),Xn.update.call(this,null,f)}catch(h){throw this[jt]=null,this[Lt]=!1,h}this._ssr||this._zr.flush(),this[jt]=null,this[Lt]=!1,es.call(this,i),ts.call(this,i)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||_e.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){if(_e.svgSupported){var r=this._zr,n=r.storage.getDisplayList();return I(n,function(a){a.stopAnimation(null,!0)}),r.painter.toDataURL()}},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,a=this._model,i=[],o=this;I(n,function(l){a.eachComponent({mainType:l},function(c){var u=o._componentsMap[c.__viewId];u.group.ignore||(i.push(u),u.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return I(i,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",a=this.group,i=Math.min,o=Math.max,s=1/0;if(nb[a]){var l=s,c=s,u=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();I(ns,function(b,x){if(b.group===a){var w=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(Ie(r)),S=b.getDom().getBoundingClientRect();l=i(S.left,l),c=i(S.top,c),u=o(S.right,u),f=o(S.bottom,f),h.push({dom:w,left:S.left,top:S.top})}}),l*=d,c*=d,u*=d,f*=d;var p=u-l,m=f-c,g=ri.createCanvas(),v=W0(g,{renderer:n?"svg":"canvas"});if(v.resize({width:p,height:m}),n){var y="";return I(h,function(b){var x=b.left-l,w=b.top-c;y+='<g transform="translate('+x+","+w+')">'+b.dom+"</g>"}),v.painter.getSvgRoot().innerHTML=y,r.connectedBackgroundColor&&v.painter.setBackgroundColor(r.connectedBackgroundColor),v.refreshImmediately(),v.painter.toDataURL()}else return r.connectedBackgroundColor&&v.add(new _t({shape:{x:0,y:0,width:p,height:m},style:{fill:r.connectedBackgroundColor}})),I(h,function(b){var x=new Fn({style:{x:b.left*d-l,y:b.top*d-c,image:b.dom}});v.add(x)}),v.refreshImmediately(),g.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,n){return kh(this,"convertToPixel",r,n)},e.prototype.convertFromPixel=function(r,n){return kh(this,"convertFromPixel",r,n)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var a=this._model,i,o=If(a,r);return I(o,function(s,l){l.indexOf("Models")>=0&&I(s,function(c){var u=c.coordinateSystem;if(u&&u.containPoint)i=i||!!u.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[c.__viewId];f&&f.containPoint&&(i=i||f.containPoint(n,c))}},this)},this),!!i},e.prototype.getVisual=function(r,n){var a=this._model,i=If(a,r,{defaultMainType:"series"}),o=i.seriesModel,s=o.getData(),l=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?s.indexOfRawIndex(i.dataIndex):null;return l!=null?CD(s,l,n):MD(s,n)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;I(cI,function(n){var a=function(i){var o=r.getModel(),s=i.target,l,c=n==="globalout";if(c?l={}:s&&Jo(s,function(p){var m=We(p);if(m&&m.dataIndex!=null){var g=m.dataModel||o.getSeriesByIndex(m.seriesIndex);return l=g&&g.getDataParams(m.dataIndex,m.dataType,s)||{},!0}else if(m.eventData)return l=q({},m.eventData),!0},!0),l){var u=l.componentType,f=l.componentIndex;(u==="markLine"||u==="markPoint"||u==="markArea")&&(u="series",f=l.seriesIndex);var h=u&&f!=null&&o.getComponent(u,f),d=h&&r[h.mainType==="series"?"_chartsMap":"_componentsMap"][h.__viewId];l.event=i,l.type=n,r._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:h,view:d},r.trigger(n,l)}};a.zrEventfulCallAtLast=!0,r._zr.on(n,a,r)}),I(rs,function(n,a){r._messageCenter.on(a,function(i){this.trigger(a,i)},r)}),I(["selectchanged"],function(n){r._messageCenter.on(n,function(a){this.trigger(n,a)},r)}),lA(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&Eg(this.getDom(),Ph,"");var n=this,a=n._api,i=n._model;I(n._componentsViews,function(o){o.dispose(i,a)}),I(n._chartsViews,function(o){o.dispose(i,a)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete ns[n.id]},e.prototype.resize=function(r){if(!this[Lt]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var a=n.resetOption("media"),i=r&&r.silent;this[jt]&&(i==null&&(i=this[jt].silent),a=!0,this[jt]=null),this[Lt]=!0;try{a&&zi(this),Xn.update.call(this,{type:"resize",animation:q({duration:0},r&&r.animation)})}catch(o){throw this[Lt]=!1,o}this[Lt]=!1,es.call(this,i),ts.call(this,i)}}},e.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(de(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!Lh[r]){var a=Lh[r](this._api,n),i=this._zr;this._loadingFX=a,i.add(a)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var n=q({},r);return n.type=rs[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(de(n)||(n={silent:!!n}),!!zc[r.type]&&this._model){if(this[Lt]){this._pendingActions.push(r);return}var a=n.silent;Ch.call(this,r,a);var i=n.flush;i?this._zr.flush():i!==!1&&_e.browser.weChat&&this._throttledZrFlush(),es.call(this,a),ts.call(this,a)}},e.prototype.updateLabelLayout=function(){Br.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,a=this.getModel(),i=a.getSeriesByIndex(n);i.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=(function(){zi=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),Sh(f,!0),Sh(f,!1),h.plan()},Sh=function(f,h){for(var d=f._model,p=f._scheduler,m=h?f._componentsViews:f._chartsViews,g=h?f._componentsMap:f._chartsMap,v=f._zr,y=f._api,b=0;b<m.length;b++)m[b].__alive=!1;h?d.eachComponent(function(S,k){S!=="series"&&x(k)}):d.eachSeries(x);function x(S){var k=S.__requireNewView;S.__requireNewView=!1;var C="_ec_"+S.id+"_"+S.type,A=!k&&g[C];if(!A){var M=$r(S.type),T=h?Nr.getClass(M.main,M.sub):Rr.getClass(M.sub);A=new T,A.init(d,y),g[C]=A,m.push(A),v.add(A.group)}S.__viewId=A.__id=C,A.__alive=!0,A.__model=S,A.group.__ecComponentInfo={mainType:S.mainType,index:S.componentIndex},!h&&p.prepareView(A,S,d,y)}for(var b=0;b<m.length;){var w=m[b];w.__alive?b++:(!h&&w.renderTask.dispose(),v.remove(w.group),w.dispose(d,y),m.splice(b,1),g[w.__id]===w&&delete g[w.__id],w.__id=w.group.__ecComponentInfo=null)}},Nc=function(f,h,d,p,m){var g=f._model;if(g.setUpdatePayload(d),!p){I([].concat(f._componentsViews).concat(f._chartsViews),w);return}var v={};v[p+"Id"]=d[p+"Id"],v[p+"Index"]=d[p+"Index"],v[p+"Name"]=d[p+"Name"];var y={mainType:p,query:v};m&&(y.subType=m);var b=d.excludeSeriesId,x;b!=null&&(x=me(),I(Mt(b),function(S){var k=Zr(S,null);k!=null&&x.set(k,!0)})),g&&g.eachComponent(y,function(S){var k=x&&x.get(S.id)!=null;if(!k)if(em(d))if(S instanceof Qr)d.type===Aa&&!d.notBlur&&!S.get(["emphasis","disabled"])&&e2(S,d,f._api);else{var C=zf(S.mainType,S.componentIndex,d.name,f._api),A=C.focusSelf,M=C.dispatchers;d.type===Aa&&A&&!d.notBlur&&Bf(S.mainType,S.componentIndex,f._api),M&&I(M,function(T){d.type===Aa?Ll(T):Pl(T)})}else Uf(d)&&S instanceof Qr&&(n2(S,d,f._api),jg(S),wr(f))},f),g&&g.eachComponent(y,function(S){var k=x&&x.get(S.id)!=null;k||w(f[p==="series"?"_chartsMap":"_componentsMap"][S.__viewId])},f);function w(S){S&&S.__alive&&S[h]&&S[h](S.__model,g,f._api,d)}},Xn={prepareAndUpdate:function(f){zi(this),Xn.update.call(this,f,{optionChanged:f.newOption!=null})},update:function(f,h){var d=this._model,p=this._api,m=this._zr,g=this._coordSysMgr,v=this._scheduler;if(d){d.setUpdatePayload(f),v.restoreData(d,f),v.performSeriesTasks(d),g.create(d,p),v.performDataProcessorTasks(d,f),Th(this,d),g.update(d,p),r(d),v.performVisualTasks(d,f),Mh(this,d,p,f,h);var y=d.get("backgroundColor")||"transparent",b=d.get("darkMode");m.setBackgroundColor(y),b!=null&&b!=="auto"&&m.setDarkMode(b),Br.trigger("afterupdate",d,p)}},updateTransform:function(f){var h=this,d=this._model,p=this._api;if(d){d.setUpdatePayload(f);var m=[];d.eachComponent(function(v,y){if(v!=="series"){var b=h.getViewOfComponentModel(y);if(b&&b.__alive)if(b.updateTransform){var x=b.updateTransform(y,d,p,f);x&&x.update&&m.push(b)}else m.push(b)}});var g=me();d.eachSeries(function(v){var y=h._chartsMap[v.__viewId];if(y.updateTransform){var b=y.updateTransform(v,d,p,f);b&&b.update&&g.set(v.uid,1)}else g.set(v.uid,1)}),r(d),this._scheduler.performVisualTasks(d,f,{setDirty:!0,dirtyMap:g}),Bc(this,d,p,f,{},g),Br.trigger("afterupdate",d,p)}},updateView:function(f){var h=this._model;h&&(h.setUpdatePayload(f),Rr.markUpdateMethod(f,"updateView"),r(h),this._scheduler.performVisualTasks(h,f,{setDirty:!0}),Mh(this,h,this._api,f,{}),Br.trigger("afterupdate",h,this._api))},updateVisual:function(f){var h=this,d=this._model;d&&(d.setUpdatePayload(f),d.eachSeries(function(p){p.getData().clearAllVisual()}),Rr.markUpdateMethod(f,"updateVisual"),r(d),this._scheduler.performVisualTasks(d,f,{visualType:"visual",setDirty:!0}),d.eachComponent(function(p,m){if(p!=="series"){var g=h.getViewOfComponentModel(m);g&&g.__alive&&g.updateVisual(m,d,h._api,f)}}),d.eachSeries(function(p){var m=h._chartsMap[p.__viewId];m.updateVisual(p,d,h._api,f)}),Br.trigger("afterupdate",d,this._api))},updateLayout:function(f){Xn.update.call(this,f)}},kh=function(f,h,d,p){if(f._disposed){f.id;return}for(var m=f._model,g=f._coordSysMgr.getCoordinateSystems(),v,y=If(m,d),b=0;b<g.length;b++){var x=g[b];if(x[h]&&(v=x[h](m,y,p))!=null)return v}},Th=function(f,h){var d=f._chartsMap,p=f._scheduler;h.eachSeries(function(m){p.updateStreamModes(m,d[m.__viewId])})},Ch=function(f,h){var d=this,p=this.getModel(),m=f.type,g=f.escapeConnect,v=zc[m],y=v.actionInfo,b=(y.update||"update").split(":"),x=b.pop(),w=b[0]!=null&&$r(b[0]);this[Lt]=!0;var S=[f],k=!1;f.batch&&(k=!0,S=he(f.batch,function(R){return R=He(q({},R),f),R.batch=null,R}));var C=[],A,M=Uf(f),T=em(f);if(T&&Kg(this._api),I(S,function(R){if(A=v.action(R,d._model,d._api),A=A||q({},R),A.type=y.event||A.type,C.push(A),T){var O=Lf(f),B=O.queryOptionMap,j=O.mainTypeSpecified,P=j?B.keys()[0]:"series";Nc(d,x,R,P),wr(d)}else M?(Nc(d,x,R,"series"),wr(d)):w&&Nc(d,x,R,w.main,w.sub)}),x!=="none"&&!T&&!M&&!w)try{this[jt]?(zi(this),Xn.update.call(this,f),this[jt]=null):Xn[x].call(this,f)}catch(R){throw this[Lt]=!1,R}if(k?A={type:y.event||m,escapeConnect:g,batch:C}:A=C[0],this[Lt]=!1,!h){var D=this._messageCenter;if(D.trigger(A.type,A),M){var L={type:"selectchanged",escapeConnect:g,selected:a2(p),isFromClick:f.isFromClick||!1,fromAction:f.type,fromActionPayload:f};D.trigger(L.type,L)}}},es=function(f){for(var h=this._pendingActions;h.length;){var d=h.shift();Ch.call(this,d,f)}},ts=function(f){!f&&this.trigger("updated")},Z_=function(f,h){f.on("rendered",function(d){h.trigger("rendered",d),f.animation.isFinished()&&!h[jt]&&!h._scheduler.unfinished&&!h._pendingActions.length&&h.trigger("finished")})},K_=function(f,h){f.on("mouseover",function(d){var p=d.target,m=Jo(p,Vf);m&&(t2(m,d,h._api),wr(h))}).on("mouseout",function(d){var p=d.target,m=Jo(p,Vf);m&&(r2(m,d,h._api),wr(h))}).on("click",function(d){var p=d.target,m=Jo(p,function(y){return We(y).dataIndex!=null},!0);if(m){var g=m.selected?"unselect":"select",v=We(m);h._api.dispatchAction({type:g,dataType:v.dataType,dataIndexInside:v.dataIndex,seriesIndex:v.seriesIndex,isFromClick:!0})}})};function r(f){f.clearColorPalette(),f.eachSeries(function(h){h.clearColorPalette()})}function n(f){var h=[],d=[],p=!1;if(f.eachComponent(function(y,b){var x=b.get("zlevel")||0,w=b.get("z")||0,S=b.getZLevelKey();p=p||!!S,(y==="series"?d:h).push({zlevel:x,z:w,idx:b.componentIndex,type:y,key:S})}),p){var m=h.concat(d),g,v;Sc(m,function(y,b){return y.zlevel===b.zlevel?y.z-b.z:y.zlevel-b.zlevel}),I(m,function(y){var b=f.getComponent(y.type,y.idx),x=y.zlevel,w=y.key;g!=null&&(x=Math.max(g,x)),w?(x===g&&w!==v&&x++,v=w):v&&(x===g&&x++,v=""),g=x,b.setZLevel(x)})}}Mh=function(f,h,d,p,m){n(h),j_(f,h,d,p,m),I(f._chartsViews,function(g){g.__alive=!1}),Bc(f,h,d,p,m),I(f._chartsViews,function(g){g.__alive||g.remove(h,d)})},j_=function(f,h,d,p,m,g){I(g||f._componentsViews,function(v){var y=v.__model;c(y,v),v.render(y,h,d,p),s(y,v),u(y,v)})},Bc=function(f,h,d,p,m,g){var v=f._scheduler;m=q(m||{},{updatedSeries:h.getSeries()}),Br.trigger("series:beforeupdate",h,d,m);var y=!1;h.eachSeries(function(b){var x=f._chartsMap[b.__viewId];x.__alive=!0;var w=x.renderTask;v.updatePayload(w,p),c(b,x),g&&g.get(b.uid)&&w.dirty(),w.perform(v.getPerformArgs(w))&&(y=!0),x.group.silent=!!b.get("silent"),o(b,x),jg(b)}),v.unfinished=y||v.unfinished,Br.trigger("series:layoutlabels",h,d,m),Br.trigger("series:transition",h,d,m),h.eachSeries(function(b){var x=f._chartsMap[b.__viewId];s(b,x),u(b,x)}),i(f,h),Br.trigger("series:afterupdate",h,d,m)},wr=function(f){f[xh]=!0,f.getZr().wakeUp()},eb=function(f){f[xh]&&(f.getZr().storage.traverse(function(h){Io(h)||a(h)}),f[xh]=!1)};function a(f){for(var h=[],d=f.currentStates,p=0;p<d.length;p++){var m=d[p];m==="emphasis"||m==="blur"||m==="select"||h.push(m)}f.selected&&f.states.select&&h.push("select"),f.hoverState===Ml&&f.states.emphasis?h.push("emphasis"):f.hoverState===Cl&&f.states.blur&&h.push("blur"),f.useStates(h)}function i(f,h){var d=f._zr,p=d.storage,m=0;p.traverse(function(g){g.isGroup||m++}),m>h.get("hoverLayerThreshold")&&!_e.node&&!_e.worker&&h.eachSeries(function(g){if(!g.preventUsingHoverLayer){var v=f._chartsMap[g.__viewId];v.__alive&&v.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function s(f,h){if(!f.preventAutoZ){var d=f.get("z")||0,p=f.get("zlevel")||0;h.eachRendered(function(m){return l(m,d,p,-1/0),!0})}}function l(f,h,d,p){var m=f.getTextContent(),g=f.getTextGuideLine(),v=f.isGroup;if(v)for(var y=f.childrenRef(),b=0;b<y.length;b++)p=Math.max(l(y[b],h,d,p),p);else f.z=h,f.zlevel=d,p=Math.max(f.z2,p);if(m&&(m.z=h,m.zlevel=d,isFinite(p)&&(m.z2=p+2)),g){var x=f.textGuideLineConfig;g.z=h,g.zlevel=d,isFinite(p)&&(g.z2=p+(x&&x.showAbove?1:-1))}return p}function c(f,h){h.eachRendered(function(d){if(!Io(d)){var p=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function u(f,h){var d=f.getModel("stateAnimation"),p=f.isAnimationEnabled(),m=d.get("duration"),g=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(v){if(v.states&&v.states.emphasis){if(Io(v))return;if(v instanceof qe&&c2(v),v.__dirty){var y=v.prevStates;y&&v.useStates(y)}if(p){v.stateTransition=g;var b=v.getTextContent(),x=v.getTextGuideLine();b&&(b.stateTransition=g),x&&(x.stateTransition=g)}v.__dirty&&a(v)}})}J_=function(f){return new((function(h){K(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(p){for(;p;){var m=p.__ecComponentInfo;if(m!=null)return f._model.getComponent(m.mainType,m.index);p=p.parent}},d.prototype.enterEmphasis=function(p,m){Ll(p,m),wr(f)},d.prototype.leaveEmphasis=function(p,m){Pl(p,m),wr(f)},d.prototype.enterBlur=function(p){Qk(p),wr(f)},d.prototype.leaveBlur=function(p){qg(p),wr(f)},d.prototype.enterSelect=function(p){Yg(p),wr(f)},d.prototype.leaveSelect=function(p){Xg(p),wr(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(p){return f.getViewOfComponentModel(p)},d.prototype.getViewOfSeriesModel=function(p){return f.getViewOfSeriesModel(p)},d})(J0))(f)},Q_=function(f){function h(d,p){for(var m=0;m<d.length;m++){var g=d[m];g[wh]=p}}I(rs,function(d,p){f._messageCenter.on(p,function(m){if(nb[f.group]&&f[wh]!==G_){if(m&&m.escapeConnect)return;var g=f.makeActionFromEvent(m),v=[];I(ns,function(y){y!==f&&y.group===f.group&&v.push(y)}),h(v,G_),I(v,function(y){y[wh]!==sI&&y.dispatchAction(g)}),h(v,lI)}})})}})(),e})(Ir),Ah=tb.prototype;Ah.on=$_("on"),Ah.off=$_("off"),Ah.one=function(t,e,r){var n=this;function a(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];e&&e.apply&&e.apply(this,i),n.off(t,a)}this.on.call(this,t,a,r)};var cI=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function ZO(t){}var zc={},rs={},Dh=[],Ih=[],Fc=[],rb={},Lh={},ns={},nb={},uI=+new Date-0,Ph="_echarts_instance_";function fI(t,e,r){var n=!(r&&r.ssr);if(n){var a=dI(t);if(a)return a}var i=new tb(t,e,r);return i.id="ec_"+uI++,ns[i.id]=i,n&&Eg(t,Ph,i.id),Q_(i),Br.trigger("afterinit",i),i}function dI(t){return ns[Hk(t,Ph)]}function ab(t,e){rb[t]=e}function ib(t){Ue(Ih,t)<0&&Ih.push(t)}function ob(t,e){Eh(Dh,t,e,QD)}function hI(t){Rh("afterinit",t)}function pI(t){Rh("afterupdate",t)}function Rh(t,e){Br.on(t,e)}function Fa(t,e,r){ke(e)&&(r=e,e="");var n=de(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,!rs[e]&&(dn(U_.test(n)&&U_.test(e)),zc[n]||(zc[n]={action:r,actionInfo:t}),rs[e]=n)}function vI(t,e){gd.register(t,e)}function gI(t,e){Eh(Fc,t,e,F_,"layout")}function Ha(t,e){Eh(Fc,t,e,H_,"visual")}var sb=[];function Eh(t,e,r,n,a){if((ke(e)||de(e))&&(r=e,e=n),!(Ue(sb,r)>=0)){sb.push(r);var i=u_.wrapStageHandler(r,a);i.__prio=e,i.__raw=r,t.push(i)}}function lb(t,e){Lh[t]=e}function mI(t,e,r){var n=XD("registerMap");n&&n(t,e,r)}var yI=RC;Ha(bh,cD),Ha(Oc,uD),Ha(Oc,fD),Ha(bh,kD),Ha(Oc,TD),Ha(V_,qD),ib(i_),ob(jD,oD),lb("default",dD),Fa({type:Aa,event:Aa,update:Aa},Et),Fa({type:Al,event:Al,update:Al},Et),Fa({type:To,event:To,update:To},Et),Fa({type:Dl,event:Dl,update:Dl},Et),Fa({type:Co,event:Co,update:Co},Et),ab("light",wD),ab("dark",m_);var cb=[],_I={registerPreprocessor:ib,registerProcessor:ob,registerPostInit:hI,registerPostUpdate:pI,registerUpdateLifecycle:Rh,registerAction:Fa,registerCoordinateSystem:vI,registerLayout:gI,registerVisual:Ha,registerTransform:yI,registerLoading:lb,registerMap:mI,registerImpl:YD,PRIORITY:oI,ComponentModel:Ye,ComponentView:Nr,SeriesModel:Qr,ChartView:Rr,registerComponentModel:function(t){Ye.registerClass(t)},registerComponentView:function(t){Nr.registerClass(t)},registerSeriesModel:function(t){Qr.registerClass(t)},registerChartView:function(t){Rr.registerClass(t)},registerSubTypeDefaulter:function(t,e){Ye.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){FA(t,e)}};function Zn(t){if(ee(t)){I(t,function(e){Zn(e)});return}Ue(cb,t)>=0||(cb.push(t),ke(t)&&(t={install:t}),t.install(_I))}var bI=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e})(Ye),xI=(function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t})(),Oh=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",qt).models[0]},e.type="cartesian2dAxis",e})(Ye);Ur(Oh,xI);var ub={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},wI=Oe({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},ub),Nh=Oe({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},ub),SI=Oe({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Nh),kI=He({logBase:10},Nh);const TI={category:wI,value:Nh,time:SI,log:kI};var CI=0,Bh=(function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++CI}return t.createByAxisModel=function(e){var r=e.option,n=r.data,a=n&&he(n,MI);return new t({categories:a,needCollect:!a,deduplication:r.dedplication!==!1})},t.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},t.prototype.parseAndCollect=function(e){var r,n=this._needCollect;if(!ae(e)&&!n)return e;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=e,r;var a=this._getOrCreateMap();return r=a.get(e),r==null&&(n?(r=this.categories.length,this.categories[r]=e,a.set(e,r)):r=NaN),r},t.prototype._getOrCreateMap=function(){return this._map||(this._map=me(this.categories))},t})();function MI(t){return de(t)&&t.value!=null?t.value:t+""}var AI={value:1,category:1,time:1,log:1};function fb(t,e,r,n){I(AI,function(a,i){var o=Oe(Oe({},TI[i],!0),n,!0),s=(function(l){K(c,l);function c(){var u=l!==null&&l.apply(this,arguments)||this;return u.type=e+"Axis."+i,u}return c.prototype.mergeDefaultAndTheme=function(u,f){var h=Vo(this),d=h?vc(u):{},p=f.getTheme();Oe(u,p.get(i+"Axis")),Oe(u,this.getDefaultOption()),u.type=db(u),h&&Pi(u,d,h)},c.prototype.optionUpdated=function(){var u=this.option;u.type==="category"&&(this.__ordinalMeta=Bh.createByAxisModel(this))},c.prototype.getCategories=function(u){var f=this.option;if(f.type==="category")return u?f.data:this.__ordinalMeta.categories},c.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},c.type=e+"Axis."+i,c.defaultOption=o,c})(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",db)}function db(t){return t.type||(t.data?"category":"value")}var en=(function(){function t(e){this._setting=e||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(e){return this._setting[e]},t.prototype.unionExtent=function(e){var r=this._extent;e[0]<r[0]&&(r[0]=e[0]),e[1]>r[1]&&(r[1]=e[1])},t.prototype.unionExtentFromData=function(e,r){this.unionExtent(e.getApproximateExtent(r))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(r)||(n[1]=r)},t.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(e){this._isBlank=e},t})();Zs(en);function zh(t){return t.type==="interval"||t.type==="log"}function DI(t,e,r,n){var a={},i=t[1]-t[0],o=a.interval=Tg(i/e);r!=null&&o<r&&(o=a.interval=r),n!=null&&o>n&&(o=a.interval=n);var s=a.intervalPrecision=hb(o),l=a.niceTickExtent=[mt(Math.ceil(t[0]/o)*o,s),mt(Math.floor(t[1]/o)*o,s)];return II(l,t),a}function Fh(t){var e=Math.pow(10,Af(t)),r=t/e;return r?r===2?r=3:r===3?r=5:r*=2:r=1,mt(r*e)}function hb(t){return gn(t)+2}function pb(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function II(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),pb(t,0,e),pb(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function Hc(t,e){return t>=e[0]&&t<=e[1]}function Vc(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function Uc(t,e){return t*(e[1]-e[0])+e[0]}var Hh=(function(t){K(e,t);function e(r){var n=t.call(this,r)||this;n.type="ordinal";var a=n.getSetting("ordinalMeta");return a||(a=new Bh({})),ee(a)&&(a=new Bh({categories:he(a,function(i){return de(i)?i.value:i})})),n._ordinalMeta=a,n._extent=n.getSetting("extent")||[0,a.categories.length-1],n}return e.prototype.parse=function(r){return r==null?NaN:ae(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},e.prototype.contain=function(r){return r=this.parse(r),Hc(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),Vc(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(Uc(r,this._extent)),this.getRawOrdinalNumber(r)},e.prototype.getTicks=function(){for(var r=[],n=this._extent,a=n[0];a<=n[1];)r.push({value:a}),a++;return r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=r.ordinalNumbers,a=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,n.length);o<l;++o){var c=n[o];a[o]=c,i[c]=o}for(var u=0;o<s;++o){for(;i[u]!=null;)u++;a.push(u),i[u]=o}},e.prototype._getTickNumber=function(r){var n=this._ticksByOrdinalNumber;return n&&r>=0&&r<n.length?n[r]:r},e.prototype.getRawOrdinalNumber=function(r){var n=this._ordinalNumbersByTick;return n&&r>=0&&r<n.length?n[r]:r},e.prototype.getLabel=function(r){if(!this.isBlank()){var n=this.getRawOrdinalNumber(r.value),a=this._ordinalMeta.categories[n];return a==null?"":a+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(r,n){this.unionExtent(r.getApproximateExtent(n))},e.prototype.isInExtentRange=function(r){return r=this._getTickNumber(r),this._extent[0]<=r&&this._extent[1]>=r},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e})(en);en.registerClass(Hh);var Va=mt,Fi=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return Hc(r,this._extent)},e.prototype.normalize=function(r){return Vc(r,this._extent)},e.prototype.scale=function(r){return Uc(r,this._extent)},e.prototype.setExtent=function(r,n){var a=this._extent;isNaN(r)||(a[0]=parseFloat(r)),isNaN(n)||(a[1]=parseFloat(n))},e.prototype.unionExtent=function(r){var n=this._extent;r[0]<n[0]&&(n[0]=r[0]),r[1]>n[1]&&(n[1]=r[1]),this.setExtent(n[0],n[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=hb(r)},e.prototype.getTicks=function(r){var n=this._interval,a=this._extent,i=this._niceExtent,o=this._intervalPrecision,s=[];if(!n)return s;var l=1e4;a[0]<i[0]&&(r?s.push({value:Va(i[0]-n,o)}):s.push({value:a[0]}));for(var c=i[0];c<=i[1]&&(s.push({value:c}),c=Va(c+n,o),c!==s[s.length-1].value);)if(s.length>l)return[];var u=s.length?s[s.length-1].value:i[1];return a[1]>u&&(r?s.push({value:Va(u+n,o)}):s.push({value:a[1]})),s},e.prototype.getMinorTicks=function(r){for(var n=this.getTicks(!0),a=[],i=this.getExtent(),o=1;o<n.length;o++){for(var s=n[o],l=n[o-1],c=0,u=[],f=s.value-l.value,h=f/r;c<r-1;){var d=Va(l.value+(c+1)*h);d>i[0]&&d<i[1]&&u.push(d),c++}a.push(u)}return a},e.prototype.getLabel=function(r,n){if(r==null)return"";var a=n&&n.precision;a==null?a=gn(r.value)||0:a==="auto"&&(a=this._intervalPrecision);var i=Va(r.value,a,!0);return Sy(i)},e.prototype.calcNiceTicks=function(r,n,a){r=r||5;var i=this._extent,o=i[1]-i[0];if(isFinite(o)){o<0&&(o=-o,i.reverse());var s=DI(i,r,n,a);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(r){var n=this._extent;if(n[0]===n[1])if(n[0]!==0){var a=Math.abs(n[0]);r.fixMax||(n[1]+=a/2),n[0]-=a/2}else n[1]=1;var i=n[1]-n[0];isFinite(i)||(n[0]=0,n[1]=1),this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval);var o=this._interval;r.fixMin||(n[0]=Va(Math.floor(n[0]/o)*o)),r.fixMax||(n[1]=Va(Math.ceil(n[1]/o)*o))},e.prototype.setNiceExtent=function(r,n){this._niceExtent=[r,n]},e.type="interval",e})(en);en.registerClass(Fi);var LI=function(t,e,r,n){for(;r<n;){var a=r+n>>>1;t[a][1]<e?r=a+1:n=a}return r},vb=(function(t){K(e,t);function e(r){var n=t.call(this,r)||this;return n.type="time",n}return e.prototype.getLabel=function(r){var n=this.getSetting("useUTC");return oc(r.value,hy[hC(Ii(this._minLevelUnit))]||hy.second,n,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(r,n,a){var i=this.getSetting("useUTC"),o=this.getSetting("locale");return pC(r,n,a,o,i)},e.prototype.getTicks=function(){var r=this._interval,n=this._extent,a=[];if(!r)return a;a.push({value:n[0],level:0});var i=this.getSetting("useUTC"),o=zI(this._minLevelUnit,this._approxInterval,i,n);return a=a.concat(o),a.push({value:n[1],level:0}),a},e.prototype.calcNiceExtent=function(r){var n=this._extent;if(n[0]===n[1]&&(n[0]-=_r,n[1]+=_r),n[1]===-1/0&&n[0]===1/0){var a=new Date;n[1]=+new Date(a.getFullYear(),a.getMonth(),a.getDate()),n[0]=n[1]-_r}this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval)},e.prototype.calcNiceTicks=function(r,n,a){r=r||10;var i=this._extent,o=i[1]-i[0];this._approxInterval=o/r,n!=null&&this._approxInterval<n&&(this._approxInterval=n),a!=null&&this._approxInterval>a&&(this._approxInterval=a);var s=Gc.length,l=Math.min(LI(Gc,this._approxInterval,0,s),s-1);this._interval=Gc[l][1],this._minLevelUnit=Gc[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return et(r)?r:+mn(r)},e.prototype.contain=function(r){return Hc(this.parse(r),this._extent)},e.prototype.normalize=function(r){return Vc(this.parse(r),this._extent)},e.prototype.scale=function(r){return Uc(r,this._extent)},e.type="time",e})(Fi),Gc=[["second",kd],["minute",Td],["hour",Bo],["quarter-day",Bo*6],["half-day",Bo*12],["day",_r*1.2],["half-week",_r*3.5],["week",_r*7],["month",_r*31],["quarter",_r*95],["half-year",dy/2],["year",dy]];function PI(t,e,r,n){var a=mn(e),i=mn(r),o=function(p){return gy(a,p,n)===gy(i,p,n)},s=function(){return o("year")},l=function(){return s()&&o("month")},c=function(){return l()&&o("day")},u=function(){return c()&&o("hour")},f=function(){return u()&&o("minute")},h=function(){return f()&&o("second")},d=function(){return h()&&o("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return c();case"hour":return u();case"minute":return f();case"second":return h();case"millisecond":return d()}}function RI(t,e){return t/=_r,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function EI(t){var e=30*_r;return t/=e,t>6?6:t>3?3:t>2?2:1}function OI(t){return t/=Bo,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function gb(t,e){return t/=e?Td:kd,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function NI(t){return Tg(t)}function BI(t,e,r){var n=new Date(t);switch(Ii(e)){case"year":case"month":n[my(r)](0);case"day":n[yy(r)](1);case"hour":n[_y(r)](0);case"minute":n[by(r)](0);case"second":n[xy(r)](0),n[wy(r)](0)}return n.getTime()}function zI(t,e,r,n){var a=1e4,i=py,o=0;function s(M,T,D,L,R,O,B){for(var j=new Date(T),P=T,V=j[L]();P<D&&P<=n[1];)B.push({value:P}),V+=M,j[R](V),P=j.getTime();B.push({value:P,notAdd:!0})}function l(M,T,D){var L=[],R=!T.length;if(!PI(Ii(M),n[0],n[1],r)){R&&(T=[{value:BI(new Date(n[0]),M,r)},{value:n[1]}]);for(var O=0;O<T.length-1;O++){var B=T[O].value,j=T[O+1].value;if(B!==j){var P=void 0,V=void 0,H=void 0,Z=!1;switch(M){case"year":P=Math.max(1,Math.round(e/_r/365)),V=Md(r),H=vC(r);break;case"half-year":case"quarter":case"month":P=EI(e),V=Li(r),H=my(r);break;case"week":case"half-week":case"day":P=RI(e),V=sc(r),H=yy(r),Z=!0;break;case"half-day":case"quarter-day":case"hour":P=OI(e),V=Fo(r),H=_y(r);break;case"minute":P=gb(e,!0),V=lc(r),H=by(r);break;case"second":P=gb(e,!1),V=cc(r),H=xy(r);break;case"millisecond":P=NI(e),V=uc(r),H=wy(r);break}s(P,B,j,V,H,Z,L),M==="year"&&D.length>1&&O===0&&D.unshift({value:D[0].value-P})}}for(var O=0;O<L.length;O++)D.push(L[O]);return L}}for(var c=[],u=[],f=0,h=0,d=0;d<i.length&&o++<a;++d){var p=Ii(i[d]);if(dC(i[d])){l(i[d],c[c.length-1]||[],u);var m=i[d+1]?Ii(i[d+1]):null;if(p!==m){if(u.length){h=f,u.sort(function(M,T){return M.value-T.value});for(var g=[],v=0;v<u.length;++v){var y=u[v].value;(v===0||u[v-1].value!==y)&&(g.push(u[v]),y>=n[0]&&y<=n[1]&&f++)}var b=(n[1]-n[0])/e;if(f>b*1.5&&h>b/1.5||(c.push(g),f>b||t===i[d]))break}u=[]}}}for(var x=bt(he(c,function(M){return bt(M,function(T){return T.value>=n[0]&&T.value<=n[1]&&!T.notAdd})}),function(M){return M.length>0}),w=[],S=x.length-1,d=0;d<x.length;++d)for(var k=x[d],C=0;C<k.length;++C)w.push({value:k[C].value,level:S-d});w.sort(function(M,T){return M.value-T.value});for(var A=[],d=0;d<w.length;++d)(d===0||w[d].value!==w[d-1].value)&&A.push(w[d]);return A}en.registerClass(vb);var mb=en.prototype,as=Fi.prototype,FI=mt,HI=Math.floor,VI=Math.ceil,$c=Math.pow,zr=Math.log,Vh=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="log",r.base=10,r._originalScale=new Fi,r._interval=0,r}return e.prototype.getTicks=function(r){var n=this._originalScale,a=this._extent,i=n.getExtent(),o=as.getTicks.call(this,r);return he(o,function(s){var l=s.value,c=mt($c(this.base,l));return c=l===a[0]&&this._fixMin?Wc(c,i[0]):c,c=l===a[1]&&this._fixMax?Wc(c,i[1]):c,{value:c}},this)},e.prototype.setExtent=function(r,n){var a=zr(this.base);r=zr(Math.max(0,r))/a,n=zr(Math.max(0,n))/a,as.setExtent.call(this,r,n)},e.prototype.getExtent=function(){var r=this.base,n=mb.getExtent.call(this);n[0]=$c(r,n[0]),n[1]=$c(r,n[1]);var a=this._originalScale,i=a.getExtent();return this._fixMin&&(n[0]=Wc(n[0],i[0])),this._fixMax&&(n[1]=Wc(n[1],i[1])),n},e.prototype.unionExtent=function(r){this._originalScale.unionExtent(r);var n=this.base;r[0]=zr(r[0])/zr(n),r[1]=zr(r[1])/zr(n),mb.unionExtent.call(this,r)},e.prototype.unionExtentFromData=function(r,n){this.unionExtent(r.getApproximateExtent(n))},e.prototype.calcNiceTicks=function(r){r=r||10;var n=this._extent,a=n[1]-n[0];if(!(a===1/0||a<=0)){var i=Tk(a),o=r/a*i;for(o<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var s=[mt(VI(n[0]/i)*i),mt(HI(n[1]/i)*i)];this._interval=i,this._niceExtent=s}},e.prototype.calcNiceExtent=function(r){as.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return r=zr(r)/zr(this.base),Hc(r,this._extent)},e.prototype.normalize=function(r){return r=zr(r)/zr(this.base),Vc(r,this._extent)},e.prototype.scale=function(r){return r=Uc(r,this._extent),$c(this.base,r)},e.type="log",e})(en),yb=Vh.prototype;yb.getMinorTicks=as.getMinorTicks,yb.getLabel=as.getLabel;function Wc(t,e){return FI(t,gn(e))}en.registerClass(Vh);var UI=(function(){function t(e,r,n){this._prepareParams(e,r,n)}return t.prototype._prepareParams=function(e,r,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var a=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&r.getNeedCrossZero&&r.getNeedCrossZero();var i=r.get("min",!0);i==null&&(i=r.get("startValue",!0));var o=this._modelMinRaw=i;ke(o)?this._modelMinNum=qc(e,o({min:n[0],max:n[1]})):o!=="dataMin"&&(this._modelMinNum=qc(e,o));var s=this._modelMaxRaw=r.get("max",!0);if(ke(s)?this._modelMaxNum=qc(e,s({min:n[0],max:n[1]})):s!=="dataMax"&&(this._modelMaxNum=qc(e,s)),a)this._axisDataLen=r.getCategories().length;else{var l=r.get("boundaryGap"),c=ee(l)?l:[l||0,l||0];typeof c[0]=="boolean"||typeof c[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[Pn(c[0],1),Pn(c[1],1)]}},t.prototype.calculate=function(){var e=this._isOrdinal,r=this._dataMin,n=this._dataMax,a=this._axisDataLen,i=this._boundaryGapInner,o=e?null:n-r||Math.abs(r),s=this._modelMinRaw==="dataMin"?r:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?n:this._modelMaxNum,c=s!=null,u=l!=null;s==null&&(s=e?a?0:NaN:r-i[0]*o),l==null&&(l=e?a?a-1:NaN:n+i[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var f=qs(s)||qs(l)||e&&!a;this._needCrossZero&&(s>0&&l>0&&!c&&(s=0),s<0&&l<0&&!u&&(l=0));var h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,c=!0),d!=null&&(l=d,u=!0),{min:s,max:l,minFixed:c,maxFixed:u,isBlank:f}},t.prototype.modifyDataMinMax=function(e,r){this[$I[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var n=GI[e];this[n]=r},t.prototype.freeze=function(){this.frozen=!0},t})(),GI={min:"_determinedMin",max:"_determinedMax"},$I={min:"_dataMin",max:"_dataMax"};function _b(t,e,r){var n=t.rawExtentInfo;return n||(n=new UI(t,e,r),t.rawExtentInfo=n,n)}function qc(t,e){return e==null?null:qs(e)?NaN:t.parse(e)}function bb(t,e){var r=t.type,n=_b(t,e,t.getExtent()).calculate();t.setBlank(n.isBlank);var a=n.min,i=n.max,o=e.ecModel;if(o&&r==="time"){var s=u0("bar",o),l=!1;if(I(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var c=f0(s),u=WI(a,i,e,c);a=u.min,i=u.max}}return{extent:[a,i],fixMin:n.minFixed,fixMax:n.maxFixed}}function WI(t,e,r,n){var a=r.axis.getExtent(),i=Math.abs(a[1]-a[0]),o=UM(n,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;I(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;I(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var c=s+l,u=e-t,f=1-(s+l)/i,h=u/f-u;return e+=h*(l/c),t-=h*(s/c),{min:t,max:e}}function xb(t,e){var r=e,n=bb(t,r),a=n.extent,i=r.get("splitNumber");t instanceof Vh&&(t.base=r.get("logBase"));var o=t.type,s=r.get("interval"),l=o==="interval"||o==="time";t.setExtent(a[0],a[1]),t.calcNiceExtent({splitNumber:i,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&t.setInterval&&t.setInterval(s)}function qI(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new Hh({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new vb({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(en.getClass(e)||Fi)}}function YI(t){var e=t.scale.getExtent(),r=e[0],n=e[1];return!(r>0&&n>0||r<0&&n<0)}function Hi(t){var e=t.getLabelModel().get("formatter"),r=t.type==="category"?t.scale.getExtent()[0]:null;return t.scale.type==="time"?(function(n){return function(a,i){return t.scale.getFormattedLabel(a,i,n)}})(e):ae(e)?(function(n){return function(a){var i=t.scale.getLabel(a),o=n.replace("{value}",i??"");return o}})(e):ke(e)?(function(n){return function(a,i){return r!=null&&(i=a.value-r),n(Uh(t,a),i,a.level!=null?{level:a.level}:null)}})(e):function(n){return t.scale.getLabel(n)}}function Uh(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function XI(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var n,a,i=r.getExtent();r instanceof Hh?a=r.count():(n=r.getTicks(),a=n.length);var o=t.getLabelModel(),s=Hi(t),l,c=1;a>40&&(c=Math.ceil(a/40));for(var u=0;u<a;u+=c){var f=n?n[u]:{value:i[0]+u},h=s(f,u),d=o.getTextRect(h),p=ZI(d,o.get("rotate")||0);l?l.union(p):l=p}return l}}function ZI(t,e){var r=e*Math.PI/180,n=t.width,a=t.height,i=n*Math.abs(Math.cos(r))+Math.abs(a*Math.sin(r)),o=n*Math.abs(Math.sin(r))+Math.abs(a*Math.cos(r)),s=new Ge(t.x,t.y,i,o);return s}function Gh(t){var e=t.get("interval");return e??"auto"}function wb(t){return t.type==="category"&&Gh(t.getLabelModel())===0}function Sb(t,e){var r={};return I(t.mapDimensionsAll(e),function(n){r[YT(t,n)]=!0}),at(r)}function KI(t,e,r){e&&I(Sb(e,r),function(n){var a=e.getApproximateExtent(n);a[0]<t[0]&&(t[0]=a[0]),a[1]>t[1]&&(t[1]=a[1])})}var jI=(function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return he(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),bt(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t})(),$h=["x","y"];function kb(t){return t.type==="interval"||t.type==="time"}var JI=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=$h,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!kb(r)||!kb(n))){var a=r.getExtent(),i=n.getExtent(),o=this.dataToPoint([a[0],i[0]]),s=this.dataToPoint([a[1],i[1]]),l=a[1]-a[0],c=i[1]-i[0];if(!(!l||!c)){var u=(s[0]-o[0])/l,f=(s[1]-o[1])/c,h=o[0]-a[0]*u,d=o[1]-i[0]*f,p=this._transform=[u,0,0,f,h,d];this._invTransform=Gu([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var n=this.getAxis("x"),a=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&a.contain(a.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,n){var a=this.dataToPoint(r),i=this.dataToPoint(n),o=this.getArea(),s=new Ge(a[0],a[1],i[0]-a[0],i[1]-a[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,n,a){a=a||[];var i=r[0],o=r[1];if(this._transform&&i!=null&&isFinite(i)&&o!=null&&isFinite(o))return dr(a,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return a[0]=s.toGlobalCoord(s.dataToCoord(i,n)),a[1]=l.toGlobalCoord(l.dataToCoord(o,n)),a},e.prototype.clampData=function(r,n){var a=this.getAxis("x").scale,i=this.getAxis("y").scale,o=a.getExtent(),s=i.getExtent(),l=a.parse(r[0]),c=i.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),c),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(r,n){var a=[];if(this._invTransform)return dr(a,r,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return a[0]=i.coordToData(i.toLocalCoord(r[0]),n),a[1]=o.coordToData(o.toLocalCoord(r[1]),n),a},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),a=this.getAxis("y").getGlobalExtent(),i=Math.min(n[0],n[1])-r,o=Math.min(a[0],a[1])-r,s=Math.max(n[0],n[1])-i+r,l=Math.max(a[0],a[1])-o+r;return new Ge(i,o,s,l)},e})(jI),is=ht();function Tb(t,e){var r=he(e,function(n){return t.scale.parse(n)});return t.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function QI(t){var e=t.getLabelModel().get("customValues");if(e){var r=Hi(t),n=t.scale.getExtent(),a=Tb(t,e),i=bt(a,function(o){return o>=n[0]&&o<=n[1]});return{labels:he(i,function(o){var s={value:o};return{formattedLabel:r(s),rawLabel:t.scale.getLabel(s),tickValue:o}})}}return t.type==="category"?tL(t):nL(t)}function eL(t,e){var r=t.getTickModel().get("customValues");if(r){var n=t.scale.getExtent(),a=Tb(t,r);return{ticks:bt(a,function(i){return i>=n[0]&&i<=n[1]})}}return t.type==="category"?rL(t,e):{ticks:he(t.scale.getTicks(),function(i){return i.value})}}function tL(t){var e=t.getLabelModel(),r=Cb(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function Cb(t,e){var r=Mb(t,"labels"),n=Gh(e),a=Ab(r,n);if(a)return a;var i,o;return ke(n)?i=Lb(t,n):(o=n==="auto"?aL(t):n,i=Ib(t,o)),Db(r,n,{labels:i,labelCategoryInterval:o})}function rL(t,e){var r=Mb(t,"ticks"),n=Gh(e),a=Ab(r,n);if(a)return a;var i,o;if((!e.get("show")||t.scale.isBlank())&&(i=[]),ke(n))i=Lb(t,n,!0);else if(n==="auto"){var s=Cb(t,t.getLabelModel());o=s.labelCategoryInterval,i=he(s.labels,function(l){return l.tickValue})}else o=n,i=Ib(t,o,!0);return Db(r,n,{ticks:i,tickCategoryInterval:o})}function nL(t){var e=t.scale.getTicks(),r=Hi(t);return{labels:he(e,function(n,a){return{level:n.level,formattedLabel:r(n,a),rawLabel:t.scale.getLabel(n),tickValue:n.value}})}}function Mb(t,e){return is(t)[e]||(is(t)[e]=[])}function Ab(t,e){for(var r=0;r<t.length;r++)if(t[r].key===e)return t[r].value}function Db(t,e,r){return t.push({key:e,value:r}),r}function aL(t){var e=is(t).autoInterval;return e??(is(t).autoInterval=t.calculateCategoryInterval())}function iL(t){var e=oL(t),r=Hi(t),n=(e.axisRotate-e.labelRotate)/180*Math.PI,a=t.scale,i=a.getExtent(),o=a.count();if(i[1]-i[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=i[0],c=t.dataToCoord(l+1)-t.dataToCoord(l),u=Math.abs(c*Math.cos(n)),f=Math.abs(c*Math.sin(n)),h=0,d=0;l<=i[1];l+=s){var p=0,m=0,g=$u(r({value:l}),e.font,"center","top");p=g.width*1.3,m=g.height*1.3,h=Math.max(h,p,7),d=Math.max(d,m,7)}var v=h/u,y=d/f;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var b=Math.max(0,Math.floor(Math.min(v,y))),x=is(t.model),w=t.getExtent(),S=x.lastAutoInterval,k=x.lastTickCount;return S!=null&&k!=null&&Math.abs(S-b)<=1&&Math.abs(k-o)<=1&&S>b&&x.axisExtent0===w[0]&&x.axisExtent1===w[1]?b=S:(x.lastTickCount=o,x.lastAutoInterval=b,x.axisExtent0=w[0],x.axisExtent1=w[1]),b}function oL(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function Ib(t,e,r){var n=Hi(t),a=t.scale,i=a.getExtent(),o=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),c=i[0],u=a.count();c!==0&&l>1&&u/l>2&&(c=Math.round(Math.ceil(c/l)*l));var f=wb(t),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&c!==i[0]&&m(i[0]);for(var p=c;p<=i[1];p+=l)m(p);d&&p-l!==i[1]&&m(i[1]);function m(g){var v={value:g};s.push(r?g:{formattedLabel:n(v),rawLabel:a.getLabel(v),tickValue:g})}return s}function Lb(t,e,r){var n=t.scale,a=Hi(t),i=[];return I(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;e(o.value,s)&&i.push(r?l:{formattedLabel:a(o),rawLabel:s,tickValue:l})}),i}var Pb=[0,1],sL=(function(){function t(e,r,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=n||[0,0]}return t.prototype.contain=function(e){var r=this._extent,n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return e>=n&&e<=a},t.prototype.containData=function(e){return this.scale.contain(e)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(e){return Sg(e||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(e,r){var n=this._extent;n[0]=e,n[1]=r},t.prototype.dataToCoord=function(e,r){var n=this._extent,a=this.scale;return e=a.normalize(e),this.onBand&&a.type==="ordinal"&&(n=n.slice(),Rb(n,a.count())),Ca(e,Pb,n,r)},t.prototype.coordToData=function(e,r){var n=this._extent,a=this.scale;this.onBand&&a.type==="ordinal"&&(n=n.slice(),Rb(n,a.count()));var i=Ca(e,n,Pb,r);return this.scale.scale(i)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),n=eL(this,r),a=n.ticks,i=he(a,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return lL(this,i,o,e.clamp),i},t.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),a=he(n,function(i){return he(i,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return a},t.prototype.getViewLabels=function(){return QI(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var e=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var a=Math.abs(e[1]-e[0]);return Math.abs(a)/n},t.prototype.calculateCategoryInterval=function(){return iL(this)},t})();function Rb(t,e){var r=t[1]-t[0],n=e,a=r/n/2;t[0]+=a,t[1]-=a}function lL(t,e,r,n){var a=e.length;if(!t.onBand||r||!a)return;var i=t.getExtent(),o,s;if(a===1)e[0].coord=i[0],o=e[1]={coord:i[1],tickValue:e[0].tickValue};else{var l=e[a-1].tickValue-e[0].tickValue,c=(e[a-1].coord-e[0].coord)/l;I(e,function(d){d.coord-=c/2});var u=t.scale.getExtent();s=1+u[1]-e[a-1].tickValue,o={coord:e[a-1].coord+c*s,tickValue:u[1]+1},e.push(o)}var f=i[0]>i[1];h(e[0].coord,i[0])&&(n?e[0].coord=i[0]:e.shift()),n&&h(i[0],e[0].coord)&&e.unshift({coord:i[0]}),h(i[1],o.coord)&&(n?o.coord=i[1]:e.pop()),n&&h(o.coord,i[1])&&e.push({coord:i[1]});function h(d,p){return d=mt(d),p=mt(p),f?d>p:d<p}}var cL=(function(t){K(e,t);function e(r,n,a,i,o){var s=t.call(this,r,n,a)||this;return s.index=0,s.type=i||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e})(sL);function Wh(t,e,r){r=r||{};var n=t.coordinateSystem,a=e.axis,i={},o=a.getAxesOnZeroOf()[0],s=a.position,l=o?"onZero":s,c=a.dim,u=n.getRect(),f=[u.x,u.x+u.width,u.y,u.y+u.height],h={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,p=c==="x"?[f[2]-d,f[3]+d]:[f[0]-d,f[1]+d];if(o){var m=o.toGlobalCoord(o.dataToCoord(0));p[h.onZero]=Math.max(Math.min(m,p[1]),p[0])}i.position=[c==="y"?p[h[l]]:f[0],c==="x"?p[h[l]]:f[3]],i.rotation=Math.PI/2*(c==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};i.labelDirection=i.tickDirection=i.nameDirection=g[s],i.labelOffset=o?p[h[s]]-p[h.onZero]:0,e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),ao(r.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var v=e.get(["axisLabel","rotate"]);return i.labelRotate=l==="top"?-v:v,i.z2=1,i}function Eb(t){return t.get("coordinateSystem")==="cartesian2d"}function Ob(t){var e={xAxisModel:null,yAxisModel:null};return I(e,function(r,n){var a=n.replace(/Model$/,""),i=t.getReferringComponents(a,qt).models[0];e[n]=i}),e}var qh=Math.log;function uL(t,e,r){var n=Fi.prototype,a=n.getTicks.call(r),i=n.getTicks.call(r,!0),o=a.length-1,s=n.getInterval.call(r),l=bb(t,e),c=l.extent,u=l.fixMin,f=l.fixMax;if(t.type==="log"){var h=qh(t.base);c=[qh(c[0])/h,qh(c[1])/h]}t.setExtent(c[0],c[1]),t.calcNiceExtent({splitNumber:o,fixMin:u,fixMax:f});var d=n.getExtent.call(t);u&&(c[0]=d[0]),f&&(c[1]=d[1]);var p=n.getInterval.call(t),m=c[0],g=c[1];if(u&&f)p=(g-m)/o;else if(u)for(g=c[0]+p*o;g<c[1]&&isFinite(g)&&isFinite(c[1]);)p=Fh(p),g=c[0]+p*o;else if(f)for(m=c[1]-p*o;m>c[0]&&isFinite(m)&&isFinite(c[0]);)p=Fh(p),m=c[1]-p*o;else{var v=t.getTicks().length-1;v>o&&(p=Fh(p));var y=p*o;g=Math.ceil(c[1]/p)*p,m=mt(g-y),m<0&&c[0]>=0?(m=0,g=mt(y)):g>0&&c[1]<=0&&(g=0,m=-mt(y))}var b=(a[0].value-i[0].value)/s,x=(a[o].value-i[o].value)/s;n.setExtent.call(t,m+p*b,g+p*x),n.setInterval.call(t,p),(b||x)&&n.setNiceExtent.call(t,m+p,g-p)}var fL=(function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=$h,this._initCartesian(e,r,n),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var n=this._axesMap;this._updateScale(e,this.model);function a(o){var s,l=at(o),c=l.length;if(c){for(var u=[],f=c-1;f>=0;f--){var h=+l[f],d=o[h],p=d.model,m=d.scale;zh(m)&&p.get("alignTicks")&&p.get("interval")==null?u.push(d):(xb(m,p),zh(m)&&(s=d))}u.length&&(s||(s=u.pop(),xb(s.scale,s.model)),I(u,function(g){uL(g.scale,g.model,s.scale)}))}}a(n.x),a(n.y);var i={};I(n.x,function(o){Nb(n,"y",o,i)}),I(n.y,function(o){Nb(n,"x",o,i)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var a=e.getBoxLayoutParams(),i=!n&&e.get("containLabel"),o=pc(a,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),i&&(I(s,function(c){if(!c.model.get(["axisLabel","inside"])){var u=XI(c);if(u){var f=c.isHorizontal()?"height":"width",h=c.model.get(["axisLabel","margin"]);o[f]-=u[f]+h,c.position==="top"?o.y+=u.height+h:c.position==="left"&&(o.x+=u.width+h)}}}),l()),I(this._coordsList,function(c){c.calcAffineTransform()});function l(){I(s,function(c){var u=c.isHorizontal(),f=u?[0,o.width]:[0,o.height],h=c.inverse?1:0;c.setExtent(f[h],f[1-h]),dL(c,u?o.x:o.y)})}},t.prototype.getAxis=function(e,r){var n=this._axesMap[e];if(n!=null)return n[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var n="x"+e+"y"+r;return this._coordsMap[n]}de(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var a=0,i=this._coordsList;a<i.length;a++)if(i[a].getAxis("x").index===e||i[a].getAxis("y").index===r)return i[a]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(e,r,n){var a=this._findConvertTarget(r);return a.cartesian?a.cartesian.dataToPoint(n):a.axis?a.axis.toGlobalCoord(a.axis.dataToCoord(n)):null},t.prototype.convertFromPixel=function(e,r,n){var a=this._findConvertTarget(r);return a.cartesian?a.cartesian.pointToData(n):a.axis?a.axis.coordToData(a.axis.toLocalCoord(n)):null},t.prototype._findConvertTarget=function(e){var r=e.seriesModel,n=e.xAxisModel||r&&r.getReferringComponents("xAxis",qt).models[0],a=e.yAxisModel||r&&r.getReferringComponents("yAxis",qt).models[0],i=e.gridModel,o=this._coordsList,s,l;if(r)s=r.coordinateSystem,Ue(o,s)<0&&(s=null);else if(n&&a)s=this.getCartesian(n.componentIndex,a.componentIndex);else if(n)l=this.getAxis("x",n.componentIndex);else if(a)l=this.getAxis("y",a.componentIndex);else if(i){var c=i.coordinateSystem;c===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},t.prototype.containPoint=function(e){var r=this._coordsList[0];if(r)return r.containPoint(e)},t.prototype._initCartesian=function(e,r,n){var a=this,i=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(r.eachComponent("xAxis",c("x"),this),r.eachComponent("yAxis",c("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,I(s.x,function(u,f){I(s.y,function(h,d){var p="x"+f+"y"+d,m=new JI(p);m.master=a,m.model=e,a._coordsMap[p]=m,a._coordsList.push(m),m.addAxis(u),m.addAxis(h)})});function c(u){return function(f,h){if(Yh(f,e)){var d=f.get("position");u==="x"?d!=="top"&&d!=="bottom"&&(d=o.bottom?"top":"bottom"):d!=="left"&&d!=="right"&&(d=o.left?"right":"left"),o[d]=!0;var p=new cL(u,qI(f),[0,0],f.get("type"),d),m=p.type==="category";p.onBand=m&&f.get("boundaryGap"),p.inverse=f.get("inverse"),f.axis=p,p.model=f,p.grid=i,p.index=h,i._axesList.push(p),s[u][h]=p,l[u]++}}}},t.prototype._updateScale=function(e,r){I(this._axesList,function(a){if(a.scale.setExtent(1/0,-1/0),a.type==="category"){var i=a.model.get("categorySortInfo");a.scale.setSortInfo(i)}}),e.eachSeries(function(a){if(Eb(a)){var i=Ob(a),o=i.xAxisModel,s=i.yAxisModel;if(!Yh(o,r)||!Yh(s,r))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),c=a.getData(),u=l.getAxis("x"),f=l.getAxis("y");n(c,u),n(c,f)}},this);function n(a,i){I(Sb(a,i.dim),function(o){i.scale.unionExtentFromData(a,o)})}},t.prototype.getTooltipAxes=function(e){var r=[],n=[];return I(this.getCartesians(),function(a){var i=e!=null&&e!=="auto"?a.getAxis(e):a.getBaseAxis(),o=a.getOtherAxis(i);Ue(r,i)<0&&r.push(i),Ue(n,o)<0&&n.push(o)}),{baseAxes:r,otherAxes:n}},t.create=function(e,r){var n=[];return e.eachComponent("grid",function(a,i){var o=new t(a,e,r);o.name="grid_"+i,o.resize(a,r,!0),a.coordinateSystem=o,n.push(o)}),e.eachSeries(function(a){if(Eb(a)){var i=Ob(a),o=i.xAxisModel,s=i.yAxisModel,l=o.getCoordSysModel(),c=l.coordinateSystem;a.coordinateSystem=c.getCartesian(o.componentIndex,s.componentIndex)}}),n},t.dimensions=$h,t})();function Yh(t,e){return t.getCoordSysModel()===e}function Nb(t,e,r,n){r.getAxesOnZeroOf=function(){return i?[i]:[]};var a=t[e],i,o=r.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)Bb(a[l])&&(i=a[l]);else for(var c in a)if(a.hasOwnProperty(c)&&Bb(a[c])&&!n[u(a[c])]){i=a[c];break}i&&(n[u(i)]=!0);function u(f){return f.dim+"_"+f.index}}function Bb(t){return t&&t.type!=="category"&&t.type!=="time"&&YI(t)}function dL(t,e){var r=t.getExtent(),n=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(a){return a+e}:function(a){return n-a+e},t.toLocalCoord=t.dim==="x"?function(a){return a-e}:function(a){return n-a+e}}var Kn=Math.PI,jn=(function(){function t(e,r){this.group=new St,this.opt=r,this.axisModel=e,He(r,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new St({x:r.position[0],y:r.position[1],rotation:r.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(e){return!!zb[e]},t.prototype.add=function(e){zb[e](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(e,r,n){var a=kg(r-e),i,o;return kl(a)?(o=n>0?"top":"bottom",i="center"):kl(a-Kn)?(o=n>0?"bottom":"top",i="center"):(o="middle",a>0&&a<Kn?i=n>0?"right":"left":i=n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t})(),zb={axisLine:function(t,e,r,n){var a=e.get(["axisLine","show"]);if(a==="auto"&&t.handleAutoShown&&(a=t.handleAutoShown("axisLine")),!!a){var i=e.axis.getExtent(),o=n.transform,s=[i[0],0],l=[i[1],0],c=s[0]>l[0];o&&(dr(s,s,o),dr(l,l,o));var u=q({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),f=new Hn({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});Lo(f.shape,f.style.lineWidth),f.anid="line",r.add(f);var h=e.get(["axisLine","symbol"]);if(h!=null){var d=e.get(["axisLine","symbolSize"]);ae(h)&&(h=[h,h]),(ae(d)||et(d))&&(d=[d,d]);var p=Gy(e.get(["axisLine","symbolOffset"])||0,d),m=d[0],g=d[1];I([{rotate:t.rotation+Math.PI/2,offset:p[0],r:0},{rotate:t.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(v,y){if(h[y]!=="none"&&h[y]!=null){var b=Ri(h[y],-m/2,-g/2,m,g,u.stroke,!0),x=v.r+v.offset,w=c?l:s;b.attr({rotation:v.rotate,x:w[0]+x*Math.cos(t.rotation),y:w[1]-x*Math.sin(t.rotation),silent:!0,z2:11}),r.add(b)}})}}},axisTickLabel:function(t,e,r,n){var a=vL(r,n,e,t),i=mL(r,n,e,t);if(pL(e,i,a),gL(r,n,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=cA(he(i,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));uA(o)}},axisName:function(t,e,r,n){var a=ao(t.axisName,e.get("name"));if(a){var i=e.get("nameLocation"),o=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,c=e.axis.getExtent(),u=c[0]>c[1]?-1:1,f=[i==="start"?c[0]-u*l:i==="end"?c[1]+u*l:(c[0]+c[1])/2,Hb(i)?t.labelOffset+o*l:0],h,d=e.get("nameRotate");d!=null&&(d=d*Kn/180);var p;Hb(i)?h=jn.innerTextLayout(t.rotation,d??t.rotation,o):(h=hL(t.rotation,i,d||0,c),p=t.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(h.rotation)),!isFinite(p)&&(p=null)));var m=s.getFont(),g=e.get("nameTruncate",!0)||{},v=g.ellipsis,y=ao(t.nameTruncateMaxWidth,g.maxWidth,p),b=new $t({x:f[0],y:f[1],rotation:h.rotation,silent:jn.isLabelSilent(e),style:wi(s,{text:a,font:m,overflow:"truncate",width:y,ellipsis:v,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||h.textAlign,verticalAlign:s.get("verticalAlign")||h.textVerticalAlign}),z2:1});if(Wl({el:b,componentModel:e,itemName:a}),b.__fullText=a,b.anid="name",e.get("triggerEvent")){var x=jn.makeAxisEventDataBase(e);x.targetType="axisName",x.name=a,We(b).eventData=x}n.add(b),b.updateTransform(),r.add(b),b.decomposeTransform()}}};function hL(t,e,r,n){var a=kg(r-t),i,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return kl(a-Kn/2)?(o=l?"bottom":"top",i="center"):kl(a-Kn*1.5)?(o=l?"top":"bottom",i="center"):(o="middle",a<Kn*1.5&&a>Kn/2?i=l?"left":"right":i=l?"right":"left"),{rotation:a,textAlign:i,textVerticalAlign:o}}function pL(t,e,r){if(!wb(t.axis)){var n=t.get(["axisLabel","showMinLabel"]),a=t.get(["axisLabel","showMaxLabel"]);e=e||[],r=r||[];var i=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],c=r[0],u=r[1],f=r[r.length-1],h=r[r.length-2];n===!1?(Sr(i),Sr(c)):Fb(i,o)&&(n?(Sr(o),Sr(u)):(Sr(i),Sr(c))),a===!1?(Sr(s),Sr(f)):Fb(l,s)&&(a?(Sr(l),Sr(h)):(Sr(s),Sr(f)))}}function Sr(t){t&&(t.ignore=!0)}function Fb(t,e){var r=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!r||!n)){var a=Hu([]);return Uu(a,a,-t.rotation),r.applyTransform(ii([],a,t.getLocalTransform())),n.applyTransform(ii([],a,e.getLocalTransform())),r.intersect(n)}}function Hb(t){return t==="middle"||t==="center"}function Vb(t,e,r,n,a){for(var i=[],o=[],s=[],l=0;l<t.length;l++){var c=t[l].coord;o[0]=c,o[1]=0,s[0]=c,s[1]=r,e&&(dr(o,o,e),dr(s,s,e));var u=new Hn({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:n,z2:2,autoBatch:!0,silent:!0});Lo(u.shape,u.style.lineWidth),u.anid=a+"_"+t[l].tickValue,i.push(u)}return i}function vL(t,e,r,n){var a=r.axis,i=r.getModel("axisTick"),o=i.get("show");if(o==="auto"&&n.handleAutoShown&&(o=n.handleAutoShown("axisTick")),!(!o||a.scale.isBlank())){for(var s=i.getModel("lineStyle"),l=n.tickDirection*i.get("length"),c=a.getTicksCoords(),u=Vb(c,e.transform,l,He(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),f=0;f<u.length;f++)t.add(u[f]);return u}}function gL(t,e,r,n){var a=r.axis,i=r.getModel("minorTick");if(!(!i.get("show")||a.scale.isBlank())){var o=a.getMinorTicksCoords();if(o.length)for(var s=i.getModel("lineStyle"),l=n*i.get("length"),c=He(s.getLineStyle(),He(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),u=0;u<o.length;u++)for(var f=Vb(o[u],e.transform,l,c,"minorticks_"+u),h=0;h<f.length;h++)t.add(f[h])}}function mL(t,e,r,n){var a=r.axis,i=ao(n.axisLabelShow,r.get(["axisLabel","show"]));if(!(!i||a.scale.isBlank())){var o=r.getModel("axisLabel"),s=o.get("margin"),l=a.getViewLabels(),c=(ao(n.labelRotate,o.get("rotate"))||0)*Kn/180,u=jn.innerTextLayout(n.rotation,c,n.labelDirection),f=r.getCategories&&r.getCategories(!0),h=[],d=jn.isLabelSilent(r),p=r.get("triggerEvent");return I(l,function(m,g){var v=a.scale.type==="ordinal"?a.scale.getRawOrdinalNumber(m.tickValue):m.tickValue,y=m.formattedLabel,b=m.rawLabel,x=o;if(f&&f[v]){var w=f[v];de(w)&&w.textStyle&&(x=new lt(w.textStyle,o,r.ecModel))}var S=x.getTextColor()||r.get(["axisLine","lineStyle","color"]),k=a.dataToCoord(v),C=x.getShallow("align",!0)||u.textAlign,A=Pe(x.getShallow("alignMinLabel",!0),C),M=Pe(x.getShallow("alignMaxLabel",!0),C),T=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||u.textVerticalAlign,D=Pe(x.getShallow("verticalAlignMinLabel",!0),T),L=Pe(x.getShallow("verticalAlignMaxLabel",!0),T),R=new $t({x:k,y:n.labelOffset+n.labelDirection*s,rotation:u.rotation,silent:d,z2:10+(m.level||0),style:wi(x,{text:y,align:g===0?A:g===l.length-1?M:C,verticalAlign:g===0?D:g===l.length-1?L:T,fill:ke(S)?S(a.type==="category"?b:a.type==="value"?v+"":v,g):S})});if(R.anid="label_"+v,Wl({el:R,componentModel:r,itemName:y,formatterParamsExtra:{isTruncated:function(){return R.isTruncated},value:b,tickIndex:g}}),p){var O=jn.makeAxisEventDataBase(r);O.targetType="axisLabel",O.value=b,O.tickIndex=g,a.type==="category"&&(O.dataIndex=v),We(R).eventData=O}e.add(R),R.updateTransform(),h.push(R),t.add(R),R.decomposeTransform()}),h}}function yL(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return _L(r,t,e),r.seriesInvolved&&xL(r,t),r}function _L(t,e,r){var n=e.getComponent("tooltip"),a=e.getComponent("axisPointer"),i=a.get("link",!0)||[],o=[];I(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=os(s.model),c=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var u=s.model,f=u.getModel("tooltip",n);if(I(s.getAxes(),dt(m,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var h=f.get("trigger")==="axis",d=f.get(["axisPointer","type"])==="cross",p=s.getTooltipAxes(f.get(["axisPointer","axis"]));(h||d)&&I(p.baseAxes,dt(m,d?"cross":!0,h)),d&&I(p.otherAxes,dt(m,"cross",!1))}function m(g,v,y){var b=y.model.getModel("axisPointer",a),x=b.get("show");if(!(!x||x==="auto"&&!g&&!Kh(b))){v==null&&(v=b.get("triggerTooltip")),b=g?bL(y,f,a,e,g,v):b;var w=b.get("snap"),S=b.get("triggerEmphasis"),k=os(y.model),C=v||w||y.type==="category",A=t.axesInfo[k]={key:k,axis:y,coordSys:s,axisPointerModel:b,triggerTooltip:v,triggerEmphasis:S,involveSeries:C,snap:w,useHandle:Kh(b),seriesModels:[],linkGroup:null};c[k]=A,t.seriesInvolved=t.seriesInvolved||C;var M=wL(i,y);if(M!=null){var T=o[M]||(o[M]={axesInfo:{}});T.axesInfo[k]=A,T.mapper=i[M].mapper,A.linkGroup=T}}}})}function bL(t,e,r,n,a,i){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};I(s,function(h){l[h]=Ie(o.get(h))}),l.snap=t.type!=="category"&&!!i,o.get("type")==="cross"&&(l.type="line");var c=l.label||(l.label={});if(c.show==null&&(c.show=!1),a==="cross"){var u=o.get(["label","show"]);if(c.show=u??!0,!i){var f=l.lineStyle=o.get("crossStyle");f&&He(c,f.textStyle)}}return t.model.getModel("axisPointer",new lt(l,r,n))}function xL(t,e){e.eachSeries(function(r){var n=r.coordinateSystem,a=r.get(["tooltip","trigger"],!0),i=r.get(["tooltip","show"],!0);!n||a==="none"||a===!1||a==="item"||i===!1||r.get(["axisPointer","show"],!0)===!1||I(t.coordSysAxesInfo[os(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function wL(t,e){for(var r=e.model,n=e.dim,a=0;a<t.length;a++){var i=t[a]||{};if(Xh(i[n+"AxisId"],r.id)||Xh(i[n+"AxisIndex"],r.componentIndex)||Xh(i[n+"AxisName"],r.name))return a}}function Xh(t,e){return t==="all"||ee(t)&&Ue(t,e)>=0||t===e}function SL(t){var e=Zh(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,a=r.option,i=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=Kh(r);i==null&&(a.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),a.value=o,s&&(a.status=e.axis.scale.isBlank()?"hide":"show")}}function Zh(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[os(t)]}function kL(t){var e=Zh(t);return e&&e.axisPointerModel}function Kh(t){return!!t.get(["handle","show"])}function os(t){return t.type+"||"+t.id}var Ub={},Gb=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a,i){this.axisPointerClass&&SL(r),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(r,a,!0)},e.prototype.updateAxisPointer=function(r,n,a,i){this._doUpdateAxisPointerClass(r,a,!1)},e.prototype.remove=function(r,n){var a=this._axisPointer;a&&a.remove(n)},e.prototype.dispose=function(r,n){this._disposeAxisPointer(n),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(r,n,a){var i=e.getAxisPointerClass(this.axisPointerClass);if(i){var o=kL(r);o?(this._axisPointer||(this._axisPointer=new i)).render(r,o,n,a):this._disposeAxisPointer(n)}},e.prototype._disposeAxisPointer=function(r){this._axisPointer&&this._axisPointer.dispose(r),this._axisPointer=null},e.registerAxisPointerClass=function(r,n){Ub[r]=n},e.getAxisPointerClass=function(r){return r&&Ub[r]},e.type="axis",e})(Nr),jh=ht();function TL(t,e,r,n){var a=r.axis;if(!a.scale.isBlank()){var i=r.getModel("splitArea"),o=i.getModel("areaStyle"),s=o.get("color"),l=n.coordinateSystem.getRect(),c=a.getTicksCoords({tickModel:i,clamp:!0});if(c.length){var u=s.length,f=jh(t).splitAreaColors,h=me(),d=0;if(f)for(var p=0;p<c.length;p++){var m=f.get(c[p].tickValue);if(m!=null){d=(m+(u-1)*p)%u;break}}var g=a.toGlobalCoord(c[0].coord),v=o.getAreaStyle();s=ee(s)?s:[s];for(var p=1;p<c.length;p++){var y=a.toGlobalCoord(c[p].coord),b=void 0,x=void 0,w=void 0,S=void 0;a.isHorizontal()?(b=g,x=l.y,w=y-b,S=l.height,g=b+w):(b=l.x,x=g,w=l.width,S=y-x,g=x+S);var k=c[p-1].tickValue;k!=null&&h.set(k,d),e.add(new _t({anid:k!=null?"area_"+k:null,shape:{x:b,y:x,width:w,height:S},style:He({fill:s[d]},v),autoBatch:!0,silent:!0})),d=(d+1)%u}jh(t).splitAreaColors=h}}}function CL(t){jh(t).splitAreaColors=null}var ML=["axisLine","axisTickLabel","axisName"],AL=["splitArea","splitLine","minorSplitLine"],$b=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="CartesianAxisPointer",r}return e.prototype.render=function(r,n,a,i){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new St,this.group.add(this._axisGroup),!!r.get("show")){var s=r.getCoordSysModel(),l=Wh(s,r),c=new jn(r,q({handleAutoShown:function(f){for(var h=s.coordinateSystem.getCartesians(),d=0;d<h.length;d++)if(zh(h[d].getOtherAxis(r.axis).scale))return!0;return!1}},l));I(ML,c.add,c),this._axisGroup.add(c.getGroup()),I(AL,function(f){r.get([f,"show"])&&DL[f](this,this._axisGroup,r,s)},this);var u=i&&i.type==="changeAxisOrder"&&i.isInitSort;u||bm(o,this._axisGroup,r),t.prototype.render.call(this,r,n,a,i)}},e.prototype.remove=function(){CL(this)},e.type="cartesianAxis",e})(Gb),DL={splitLine:function(t,e,r,n){var a=r.axis;if(!a.scale.isBlank()){var i=r.getModel("splitLine"),o=i.getModel("lineStyle"),s=o.get("color"),l=i.get("showMinLine")!==!1,c=i.get("showMaxLine")!==!1;s=ee(s)?s:[s];for(var u=n.coordinateSystem.getRect(),f=a.isHorizontal(),h=0,d=a.getTicksCoords({tickModel:i}),p=[],m=[],g=o.getLineStyle(),v=0;v<d.length;v++){var y=a.toGlobalCoord(d[v].coord);if(!(v===0&&!l||v===d.length-1&&!c)){var b=d[v].tickValue;f?(p[0]=y,p[1]=u.y,m[0]=y,m[1]=u.y+u.height):(p[0]=u.x,p[1]=y,m[0]=u.x+u.width,m[1]=y);var x=h++%s.length,w=new Hn({anid:b!=null?"line_"+b:null,autoBatch:!0,shape:{x1:p[0],y1:p[1],x2:m[0],y2:m[1]},style:He({stroke:s[x]},g),silent:!0});Lo(w.shape,g.lineWidth),e.add(w)}}}},minorSplitLine:function(t,e,r,n){var a=r.axis,i=r.getModel("minorSplitLine"),o=i.getModel("lineStyle"),s=n.coordinateSystem.getRect(),l=a.isHorizontal(),c=a.getMinorTicksCoords();if(c.length)for(var u=[],f=[],h=o.getLineStyle(),d=0;d<c.length;d++)for(var p=0;p<c[d].length;p++){var m=a.toGlobalCoord(c[d][p].coord);l?(u[0]=m,u[1]=s.y,f[0]=m,f[1]=s.y+s.height):(u[0]=s.x,u[1]=m,f[0]=s.x+s.width,f[1]=m);var g=new Hn({anid:"minor_line_"+c[d][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:f[0],y2:f[1]},style:h,silent:!0});Lo(g.shape,h.lineWidth),e.add(g)}},splitArea:function(t,e,r,n){TL(t,e,r,n)}},Wb=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="xAxis",e})($b),IL=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Wb.type,r}return e.type="yAxis",e})($b),LL=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="grid",r}return e.prototype.render=function(r,n){this.group.removeAll(),r.get("show")&&this.group.add(new _t({shape:r.coordinateSystem.getRect(),style:He({fill:r.get("backgroundColor")},r.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e})(Nr),qb={offset:0};function PL(t){t.registerComponentView(LL),t.registerComponentModel(bI),t.registerCoordinateSystem("cartesian2d",fL),fb(t,"x",Oh,qb),fb(t,"y",Oh,qb),t.registerComponentView(Wb),t.registerComponentView(IL),t.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var Yb="\0_ec_interaction_mutex";function Xb(t,e){return!!RL(t)[e]}function RL(t){return t[Yb]||(t[Yb]={})}Fa({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Et);var EL=(function(t){K(e,t);function e(r){var n=t.call(this)||this;n._zr=r;var a=Ne(n._mousedownHandler,n),i=Ne(n._mousemoveHandler,n),o=Ne(n._mouseupHandler,n),s=Ne(n._mousewheelHandler,n),l=Ne(n._pinchHandler,n);return n.enable=function(c,u){this.disable(),this._opt=He(Ie(u)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),c==null&&(c=!0),(c===!0||c==="move"||c==="pan")&&(r.on("mousedown",a),r.on("mousemove",i),r.on("mouseup",o)),(c===!0||c==="scale"||c==="zoom")&&(r.on("mousewheel",s),r.on("pinch",l))},n.disable=function(){r.off("mousedown",a),r.off("mousemove",i),r.off("mouseup",o),r.off("mousewheel",s),r.off("pinch",l)},n}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(r){this.pointerChecker=r},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(r){if(!D0(r)){for(var n=r.target;n;){if(n.draggable)return;n=n.__hostTarget||n.parent}var a=r.offsetX,i=r.offsetY;this.pointerChecker&&this.pointerChecker(r,a,i)&&(this._x=a,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(r){if(!(!this._dragging||!Yc("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||Xb(this._zr,"globalPan"))){var n=r.offsetX,a=r.offsetY,i=this._x,o=this._y,s=n-i,l=a-o;this._x=n,this._y=a,this._opt.preventDefaultMouseMove&&wc(r.event),Zb(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:i,oldY:o,newX:n,newY:a,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){D0(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var n=Yc("zoomOnMouseWheel",r,this._opt),a=Yc("moveOnMouseWheel",r,this._opt),i=r.wheelDelta,o=Math.abs(i),s=r.offsetX,l=r.offsetY;if(!(i===0||!n&&!a)){if(n){var c=o>3?1.4:o>1?1.2:1.1,u=i>0?c:1/c;Jh(this,"zoom","zoomOnMouseWheel",r,{scale:u,originX:s,originY:l,isAvailableBehavior:null})}if(a){var f=Math.abs(i),h=(i>0?1:-1)*(f>3?.4:f>1?.15:.05);Jh(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!Xb(this._zr,"globalPan")){var n=r.pinchScale>1?1.1:1/1.1;Jh(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e})(Ir);function Jh(t,e,r,n,a){t.pointerChecker&&t.pointerChecker(n,a.originX,a.originY)&&(wc(n.event),Zb(t,e,r,n,a))}function Zb(t,e,r,n,a){a.isAvailableBehavior=Ne(Yc,null,r,n),t.trigger(e,a)}function Yc(t,e,r){var n=r[t];return!t||n&&(!ae(n)||e.event[n+"Key"])}function Qh(t,e,r,n,a,i){t=t||0;var o=r[1]-r[0];if(a!=null&&(a=Vi(a,[0,o])),i!=null&&(i=Math.max(i,a??0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=Vi(s,[0,o]),a=i=Vi(s,[a,i]),n=0}e[0]=Vi(e[0],r),e[1]=Vi(e[1],r);var l=ep(e,n);e[n]+=t;var c=a||0,u=r.slice();l.sign<0?u[0]+=c:u[1]-=c,e[n]=Vi(e[n],u);var f;return f=ep(e,n),a!=null&&(f.sign!==l.sign||f.span<a)&&(e[1-n]=e[n]+l.sign*a),f=ep(e,n),i!=null&&f.span>i&&(e[1-n]=e[n]+f.sign*i),e}function ep(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function Vi(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var Ua=ht(),Kb=Ie,tp=Ne,OL=(function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,a){var i=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!a&&this._lastValue===i&&this._lastStatus===o)){this._lastValue=i,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var c={};this.makeElOption(c,i,e,r,n);var u=c.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var f=this._moveAnimation=this.determineAnimation(e,r);if(!s)s=this._group=new St,this.createPointerEl(s,c,e,r),this.createLabelEl(s,c,e,r),n.getZr().add(s);else{var h=dt(jb,r,f);this.updatePointerEl(s,c,h),this.updateLabelEl(s,c,h,r)}ex(s,r,!0),this._renderHandle(i)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var n=r.get("animation"),a=e.axis,i=a.type==="category",o=r.get("snap");if(!o&&!i)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(i&&a.getBandWidth()>s)return!0;if(o){var l=Zh(e).seriesDataCount,c=a.getExtent();return Math.abs(c[0]-c[1])/l>s}return!1}return n===!0},t.prototype.makeElOption=function(e,r,n,a,i){},t.prototype.createPointerEl=function(e,r,n,a){var i=r.pointer;if(i){var o=Ua(e).pointerEl=new eT[i.type](Kb(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,a){if(r.label){var i=Ua(e).labelEl=new $t(Kb(r.label));e.add(i),Qb(i,a)}},t.prototype.updatePointerEl=function(e,r,n){var a=Ua(e).pointerEl;a&&r.pointer&&(a.setStyle(r.pointer.style),n(a,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,n,a){var i=Ua(e).labelEl;i&&(i.setStyle(r.label.style),n(i,{x:r.label.x,y:r.label.y}),Qb(i,a))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),a=this._handle,i=r.getModel("handle"),o=r.get("status");if(!i.get("show")||!o||o==="hide"){a&&n.remove(a),this._handle=null;return}var s;this._handle||(s=!0,a=this._handle=rd(i.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(c){wc(c.event)},onmousedown:tp(this._onHandleDragMove,this,0,0),drift:tp(this._onHandleDragMove,this),ondragend:tp(this._onHandleDragEnd,this)}),n.add(a)),ex(a,r,!1),a.setStyle(i.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=i.get("size");ee(l)||(l=[l,l]),a.scaleX=l[0]/2,a.scaleY=l[1]/2,Xd(this,"_doDispatchAxisPointer",i.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){jb(this._axisPointerModel,!r&&this._moveAnimation,this._handle,rp(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var n=this._handle;if(n){this._dragging=!0;var a=this.updateHandleTransform(rp(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=a,n.stopAnimation(),n.attr(rp(a)),Ua(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),n=this._group,a=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),a&&r.remove(a),this._group=null,this._handle=null,this._payloadInfo=null),Zd(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,n){return n=n||0,{x:e[n],y:e[1-n],width:r[n],height:r[1-n]}},t})();function jb(t,e,r,n){Jb(Ua(r).lastProp,n)||(Ua(r).lastProp=n,e?or(r,n,t):(r.stopAnimation(),r.attr(n)))}function Jb(t,e){if(de(t)&&de(e)){var r=!0;return I(e,function(n,a){r=r&&Jb(t[a],n)}),!!r}else return t===e}function Qb(t,e){t[e.get(["label","show"])?"show":"hide"]()}function rp(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function ex(t,e,r){var n=e.get("z"),a=e.get("zlevel");t&&t.traverse(function(i){i.type!=="group"&&(n!=null&&(i.z=n),a!=null&&(i.zlevel=a),i.silent=r)})}function NL(t){var e=t.get("type"),r=t.getModel(e+"Style"),n;return e==="line"?(n=r.getLineStyle(),n.fill=null):e==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function BL(t,e,r,n,a){var i=r.get("value"),o=tx(i,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=fc(s.get("padding")||0),c=s.getFont(),u=$u(o,c),f=a.position,h=u.width+l[1]+l[3],d=u.height+l[0]+l[2],p=a.align;p==="right"&&(f[0]-=h),p==="center"&&(f[0]-=h/2);var m=a.verticalAlign;m==="bottom"&&(f[1]-=d),m==="middle"&&(f[1]-=d/2),zL(f,h,d,n);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=e.get(["axisLine","lineStyle","color"])),t.label={x:f[0],y:f[1],style:wi(s,{text:o,font:c,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function zL(t,e,r,n){var a=n.getWidth(),i=n.getHeight();t[0]=Math.min(t[0]+e,a)-e,t[1]=Math.min(t[1]+r,i)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function tx(t,e,r,n,a){t=e.scale.parse(t);var i=e.scale.getLabel({value:t},{precision:a.precision}),o=a.formatter;if(o){var s={value:Uh(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};I(n,function(l){var c=r.getSeriesByIndex(l.seriesIndex),u=l.dataIndexInside,f=c&&c.getDataParams(u);f&&s.seriesData.push(f)}),ae(o)?i=o.replace("{value}",i):ke(o)&&(i=o(s))}return i}function rx(t,e,r){var n=ai();return Uu(n,n,r.rotation),Vu(n,n,r.position),td([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function FL(t,e,r,n,a,i){var o=jn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=a.get(["label","margin"]),BL(e,n,a,i,{position:rx(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function HL(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function VL(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}var UL=(function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,a,i,o){var s=a.axis,l=s.grid,c=i.get("type"),u=nx(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(c&&c!=="none"){var h=NL(i),d=GL[c](s,f,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var p=Wh(l.model,a);FL(n,r,p,a,i,o)},e.prototype.getHandleTransform=function(r,n,a){var i=Wh(n.axis.grid.model,n,{labelInside:!1});i.labelMargin=a.get(["handle","margin"]);var o=rx(n.axis,r,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,a,i){var o=a.axis,s=o.grid,l=o.getGlobalExtent(!0),c=nx(s,o).getOtherAxis(o).getGlobalExtent(),u=o.dim==="x"?0:1,f=[r.x,r.y];f[u]+=n[u],f[u]=Math.min(l[1],f[u]),f[u]=Math.max(l[0],f[u]);var h=(c[1]+c[0])/2,d=[h,h];d[u]=f[u];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:d,tooltipOption:p[u]}},e})(OL);function nx(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var GL={line:function(t,e,r){var n=HL([e,r[0]],[e,r[1]],ax(t));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(t,e,r){var n=Math.max(1,t.getBandWidth()),a=r[1]-r[0];return{type:"Rect",shape:VL([e-n/2,r[0]],[n,a],ax(t))}}};function ax(t){return t.dim==="x"?0:1}var $L=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e})(Ye),kn=ht(),WL=I;function ix(t,e,r){if(!_e.node){var n=e.getZr();kn(n).records||(kn(n).records={}),qL(n,e);var a=kn(n).records[t]||(kn(n).records[t]={});a.handler=r}}function qL(t,e){if(kn(t).initialized)return;kn(t).initialized=!0,r("click",dt(ox,"click")),r("mousemove",dt(ox,"mousemove")),r("globalout",XL);function r(n,a){t.on(n,function(i){var o=ZL(e);WL(kn(t).records,function(s){s&&a(s,i,o.dispatchAction)}),YL(o.pendings,e)})}}function YL(t,e){var r=t.showTip.length,n=t.hideTip.length,a;r?a=t.showTip[r-1]:n&&(a=t.hideTip[n-1]),a&&(a.dispatchAction=null,e.dispatchAction(a))}function XL(t,e,r){t.handler("leave",null,r)}function ox(t,e,r,n){e.handler(t,r,n)}function ZL(t){var e={showTip:[],hideTip:[]},r=function(n){var a=e[n.type];a?a.push(n):(n.dispatchAction=r,t.dispatchAction(n))};return{dispatchAction:r,pendings:e}}function np(t,e){if(!_e.node){var r=e.getZr(),n=(kn(r).records||{})[t];n&&(kn(r).records[t]=null)}}var KL=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a){var i=n.getComponent("tooltip"),o=r.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";ix("axisPointer",a,function(s,l,c){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&c({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){np("axisPointer",n)},e.prototype.dispose=function(r,n){np("axisPointer",n)},e.type="axisPointer",e})(Nr);function sx(t,e){var r=[],n=t.seriesIndex,a;if(n==null||!(a=e.getSeriesByIndex(n)))return{point:[]};var i=a.getData(),o=Ma(i,t);if(o==null||o<0||ee(o))return{point:[]};var s=i.getItemGraphicEl(o),l=a.coordinateSystem;if(a.getTooltipPosition)r=a.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(t.isStacked){var c=l.getBaseAxis(),u=l.getOtherAxis(c),f=u.dim,h=c.dim,d=f==="x"||f==="radius"?1:0,p=i.mapDimension(h),m=[];m[d]=i.get(p,o),m[1-d]=i.get(i.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(i.getValues(he(l.dimensions,function(v){return i.mapDimension(v)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var lx=ht();function jL(t,e,r){var n=t.currTrigger,a=[t.x,t.y],i=t,o=t.dispatchAction||Ne(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Xc(a)&&(a=sx({seriesIndex:i.seriesIndex,dataIndex:i.dataIndex},e).point);var l=Xc(a),c=i.axesInfo,u=s.axesInfo,f=n==="leave"||Xc(a),h={},d={},p={list:[],map:{}},m={showPointer:dt(QL,d),showTooltip:dt(eP,p)};I(s.coordSysMap,function(v,y){var b=l||v.containPoint(a);I(s.coordSysAxesInfo[y],function(x,w){var S=x.axis,k=aP(c,x);if(!f&&b&&(!c||k)){var C=k&&k.value;C==null&&!l&&(C=S.pointToData(a)),C!=null&&cx(x,C,m,!1,h)}})});var g={};return I(u,function(v,y){var b=v.linkGroup;b&&!d[y]&&I(b.axesInfo,function(x,w){var S=d[w];if(x!==v&&S){var k=S.value;b.mapper&&(k=v.axis.scale.parse(b.mapper(k,ux(x),ux(v)))),g[v.key]=k}})}),I(g,function(v,y){cx(u[y],v,m,!0,h)}),tP(d,u,h),rP(p,a,t,o),nP(u,o,r),h}}function cx(t,e,r,n,a){var i=t.axis;if(!(i.scale.isBlank()||!i.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var o=JL(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&a.seriesIndex==null&&q(a,s[0]),!n&&t.snap&&i.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function JL(t,e){var r=e.axis,n=r.dim,a=t,i=[],o=Number.MAX_VALUE,s=-1;return I(e.seriesModels,function(l,c){var u=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(u,t,r);h=d.dataIndices,f=d.nestestValue}else{if(h=l.getData().indicesOfNearest(u[0],t,r.type==="category"?.5:null),!h.length)return;f=l.getData().get(u[0],h[0])}if(!(f==null||!isFinite(f))){var p=t-f,m=Math.abs(p);m<=o&&((m<o||p>=0&&s<0)&&(o=m,s=p,a=f,i.length=0),I(h,function(g){i.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:i,snapToValue:a}}function QL(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function eP(t,e,r,n){var a=r.payloadBatch,i=e.axis,o=i.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!a.length)){var l=e.coordSys.model,c=os(l),u=t.map[c];u||(u=t.map[c]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(u)),u.dataByAxis.push({axisDim:i.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:a.slice()})}}function tP(t,e,r){var n=r.axesInfo=[];I(e,function(a,i){var o=a.axisPointerModel.option,s=t[i];s?(!a.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!a.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:a.axis.dim,axisIndex:a.axis.model.componentIndex,value:o.value})})}function rP(t,e,r,n){if(Xc(e)||!t.list.length){n({type:"hideTip"});return}var a=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:t.list})}function nP(t,e,r){var n=r.getZr(),a="axisPointerLastHighlights",i=lx(n)[a]||{},o=lx(n)[a]={};I(t,function(c,u){var f=c.axisPointerModel.option;f.status==="show"&&c.triggerEmphasis&&I(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];I(i,function(c,u){!o[u]&&l.push(c)}),I(o,function(c,u){!i[u]&&s.push(c)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function aP(t,e){for(var r=0;r<(t||[]).length;r++){var n=t[r];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function ux(t){var e=t.axis.model,r={},n=r.axisDim=t.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=e.componentIndex,r.axisName=r[n+"AxisName"]=e.name,r.axisId=r[n+"AxisId"]=e.id,r}function Xc(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function fx(t){Gb.registerAxisPointerClass("CartesianAxisPointer",UL),t.registerComponentModel($L),t.registerComponentView(KL),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!ee(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=yL(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},jL)}function iP(t){Zn(PL),Zn(fx)}var dx=["x","y","radius","angle","single"],oP=["cartesian2d","polar","singleAxis"];function sP(t){var e=t.get("coordinateSystem");return Ue(oP,e)>=0}function Ga(t){return t+"Axis"}function lP(t,e){var r=me(),n=[],a=me();t.eachComponent({mainType:"dataZoom",query:e},function(u){a.get(u.uid)||s(u)});var i;do i=!1,t.eachComponent("dataZoom",o);while(i);function o(u){!a.get(u.uid)&&l(u)&&(s(u),i=!0)}function s(u){a.set(u.uid,!0),n.push(u),c(u)}function l(u){var f=!1;return u.eachTargetAxis(function(h,d){var p=r.get(h);p&&p[d]&&(f=!0)}),f}function c(u){u.eachTargetAxis(function(f,h){(r.get(f)||r.set(f,[]))[h]=!0})}return n}function cP(t){var e=t.ecModel,r={infoList:[],infoMap:me()};return t.eachTargetAxis(function(n,a){var i=e.getComponent(Ga(n),a);if(i){var o=i.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(i)}}}),r}var ap=(function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t})(),hx=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,n,a){var i=px(r);this.settledOption=i,this.mergeDefaultAndTheme(r,a),this._doInit(i)},e.prototype.mergeOption=function(r){var n=px(r);Oe(this.option,r,!0),Oe(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var a=this.settledOption;I([["start","startValue"],["end","endValue"]],function(i,o){this._rangePropMode[o]==="value"&&(n[i[0]]=a[i[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=me(),a=this._fillSpecifiedTargetAxis(n);a?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(i){i.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return I(dx,function(a){var i=this.getReferringComponents(Ga(a),Fk);if(i.specified){n=!0;var o=new ap;I(i.models,function(s){o.add(s.componentIndex)}),r.set(a,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var a=this.ecModel,i=!0;if(i){var o=n==="vertical"?"y":"x",s=a.findComponents({mainType:o+"Axis"});l(s,o)}if(i){var s=a.findComponents({mainType:"singleAxis",filter:function(u){return u.get("orient",!0)===n}});l(s,"single")}function l(c,u){var f=c[0];if(f){var h=new ap;if(h.add(f.componentIndex),r.set(u,h),i=!1,u==="x"||u==="y"){var d=f.getReferringComponents("grid",qt).models[0];d&&I(c,function(p){f.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",qt).models[0]&&h.add(p.componentIndex)})}}}i&&I(dx,function(c){if(i){var u=a.findComponents({mainType:Ga(c),filter:function(h){return h.get("type",!0)==="category"}});if(u[0]){var f=new ap;f.add(u[0].componentIndex),r.set(c,f),i=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var n=this._rangePropMode,a=this.get("rangeMode");I([["start","startValue"],["end","endValue"]],function(i,o){var s=r[i[0]]!=null,l=r[i[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":a?n[o]=a[o]:s&&(n[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,a){r==null&&(r=this.ecModel.getComponent(Ga(n),a))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(a,i){I(a.indexList,function(o){r.call(n,i,o)})})},e.prototype.getAxisProxy=function(r,n){var a=this.getAxisModel(r,n);if(a)return a.__dzAxisProxy},e.prototype.getAxisModel=function(r,n){var a=this._targetAxisInfoMap.get(r);if(a&&a.indexMap[n])return this.ecModel.getComponent(Ga(r),n)},e.prototype.setRawRange=function(r){var n=this.option,a=this.settledOption;I([["start","startValue"],["end","endValue"]],function(i){(r[i[0]]!=null||r[i[1]]!=null)&&(n[i[0]]=a[i[0]]=r[i[0]],n[i[1]]=a[i[1]]=r[i[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var n=this.option;I(["start","startValue","end","endValue"],function(a){n[a]=r[a]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},e.prototype.getValueRange=function(r,n){if(r==null&&n==null){var a=this.findRepresentativeAxisProxy();if(a)return a.getDataValueWindow()}else return this.getAxisProxy(r,n).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var n,a=this._targetAxisInfoMap.keys(),i=0;i<a.length;i++)for(var o=a[i],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var c=this.getAxisProxy(o,s.indexList[l]);if(c.hostedBy(this))return c;n||(n=c)}return n},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e})(Ye);function px(t){var e={};return I(["start","end","startValue","endValue","throttle"],function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e}var uP=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a,i){this.dataZoomModel=r,this.ecModel=n,this.api=a},e.type="dataZoom",e})(Nr),Ui=I,vx=xk,fP=(function(){function t(e,r,n,a){this._dimName=e,this._axisIndex=r,this.ecModel=a,this._dataZoomModel=n}return t.prototype.hostedBy=function(e){return this._dataZoomModel===e},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(r){if(sP(r)){var n=Ga(this._dimName),a=r.getReferringComponents(n,qt).models[0];a&&this._axisIndex===a.componentIndex&&e.push(r)}},this),e},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return Ie(this._minMaxSpan)},t.prototype.calculateDataWindow=function(e){var r=this._dataExtent,n=this.getAxisModel(),a=n.axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],c;Ui(["start","end"],function(h,d){var p=e[h],m=e[h+"Value"];i[d]==="percent"?(p==null&&(p=o[d]),m=a.parse(Ca(p,o,r))):(c=!0,m=m==null?r[d]:a.parse(m),p=Ca(m,r,o)),l[d]=m==null||isNaN(m)?r[d]:m,s[d]=p==null||isNaN(p)?o[d]:p}),vx(l),vx(s);var u=this._minMaxSpan;c?f(l,s,r,o,!1):f(s,l,o,r,!0);function f(h,d,p,m,g){var v=g?"Span":"ValueSpan";Qh(0,h,p,"all",u["min"+v],u["max"+v]);for(var y=0;y<2;y++)d[y]=Ca(h[y],p,m,!0),g&&(d[y]=a.parse(d[y]))}return{valueWindow:l,percentWindow:s}},t.prototype.reset=function(e){if(e===this._dataZoomModel){var r=this.getTargetSeriesModels();this._dataExtent=dP(this,this._dimName,r),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(e,r){if(e!==this._dataZoomModel)return;var n=this._dimName,a=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;if(i==="none")return;Ui(a,function(l){var c=l.getData(),u=c.mapDimensionsAll(n);if(u.length){if(i==="weakFilter"){var f=c.getStore(),h=he(u,function(d){return c.getDimensionIndex(d)},c);c.filterSelf(function(d){for(var p,m,g,v=0;v<u.length;v++){var y=f.get(h[v],d),b=!isNaN(y),x=y<o[0],w=y>o[1];if(b&&!x&&!w)return!0;b&&(g=!0),x&&(p=!0),w&&(m=!0)}return g&&p&&m})}else Ui(u,function(d){if(i==="empty")l.setData(c=c.map(d,function(m){return s(m)?m:NaN}));else{var p={};p[d]=o,c.selectRange(p)}});Ui(u,function(d){c.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;Ui(["min","max"],function(a){var i=r.get(a+"Span"),o=r.get(a+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?i=Ca(n[0]+o,n,[0,100],!0):i!=null&&(o=Ca(i,[0,100],n,!0)-n[0]),e[a+"Span"]=i,e[a+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var e=this.getAxisModel(),r=this._percentWindow,n=this._valueWindow;if(r){var a=Sg(n,[0,500]);a=Math.min(a,20);var i=e.axis.scale.rawExtentInfo;r[0]!==0&&i.setDeterminedMinMax("min",+n[0].toFixed(a)),r[1]!==100&&i.setDeterminedMinMax("max",+n[1].toFixed(a)),i.freeze()}},t})();function dP(t,e,r){var n=[1/0,-1/0];Ui(r,function(o){KI(n,o.getData(),e)});var a=t.getAxisModel(),i=_b(a.axis.scale,a,n).calculate();return[i.min,i.max]}var hP={getTargetSeries:function(t){function e(a){t.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(o,s){var l=t.getComponent(Ga(o),s);a(o,s,l,i)})})}e(function(a,i,o,s){o.__dzAxisProxy=null});var r=[];e(function(a,i,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new fP(a,i,s,t),r.push(o.__dzAxisProxy))});var n=me();return I(r,function(a){I(a.getTargetSeriesModels(),function(i){n.set(i.uid,i)})}),n},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).reset(r)}),r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var a=n.getDataPercentWindow(),i=n.getDataValueWindow();r.setCalculatedRange({start:a[0],end:a[1],startValue:i[0],endValue:i[1]})}})}};function pP(t){t.registerAction("dataZoom",function(e,r){var n=lP(r,e);I(n,function(a){a.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var gx=!1;function vP(t){gx||(gx=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,hP),pP(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function gP(t,e){var r=fc(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),t=new _t({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1}),t}var mP=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e})(Ye);function mx(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function yx(t){if(_e.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r<n;r++)if(t[r]in e)return t[r]}}var _x=yx(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),yP=yx(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function bx(t,e){if(!t)return e;e=ky(e,!0);var r=t.indexOf(e);return t=r===-1?e:"-"+t.slice(0,r)+"-"+e,t.toLowerCase()}function _P(t,e){var r=t.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(t);return r?r[e]:null}var bP=bx(yP,"transition"),ip=bx(_x,"transform"),xP="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(_e.transform3dSupported?"will-change:transform;":"");function wP(t){return t=t==="left"?"right":t==="right"?"left":t==="top"?"bottom":"top",t}function SP(t,e,r){if(!ae(r)||r==="inside")return"";var n=t.get("backgroundColor"),a=t.get("borderWidth");e=Oa(e);var i=wP(r),o=Math.max(Math.round(a)*1.5,6),s="",l=ip+":",c;Ue(["left","right"],i)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(c=i==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(c=i==="top"?225:45)+"deg)");var u=c*Math.PI/180,f=o+a,h=f*Math.abs(Math.cos(u))+f*Math.abs(Math.sin(u)),d=Math.round(((h-Math.SQRT2*a)/2+Math.SQRT2*a-(h-f)/2)*100)/100;s+=";"+i+":-"+d+"px";var p=e+" solid "+a+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+n+";"];return'<div style="'+m.join("")+'"></div>'}function kP(t,e){var r="cubic-bezier(0.23,1,0.32,1)",n=" "+t/2+"s "+r,a="opacity"+n+",visibility"+n;return e||(n=" "+t+"s "+r,a+=_e.transformSupported?","+ip+n:",left"+n+",top"+n),bP+":"+a}function xx(t,e,r){var n=t.toFixed(0)+"px",a=e.toFixed(0)+"px";if(!_e.transformSupported)return r?"top:"+a+";left:"+n+";":[["top",a],["left",n]];var i=_e.transform3dSupported,o="translate"+(i?"3d":"")+"("+n+","+a+(i?",0":"")+")";return r?"top:0;left:0;"+ip+":"+o+";":[["top",0],["left",0],[_x,o]]}function TP(t){var e=[],r=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont());var a=Pe(t.get("lineHeight"),Math.round(r*3/2));r&&e.push("line-height:"+a+"px");var i=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return i&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+i),I(["decoration","align"],function(c){var u=t.get(c);u&&e.push("text-"+c+":"+u)}),e.join(";")}function CP(t,e,r){var n=[],a=t.get("transitionDuration"),i=t.get("backgroundColor"),o=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),u=t.getModel("textStyle"),f=Hy(t,"html"),h=l+"px "+c+"px "+o+"px "+s;return n.push("box-shadow:"+h),e&&a&&n.push(kP(a,r)),i&&n.push("background-color:"+i),I(["width","color","radius"],function(d){var p="border-"+d,m=ky(p),g=t.get(m);g!=null&&n.push(p+":"+g+(d==="color"?"":"px"))}),n.push(TP(u)),f!=null&&n.push("padding:"+fc(f).join("px ")+"px"),n.join(";")+";"}function Sx(t,e,r,n,a){var i=e&&e.painter;if(r){var o=i&&i.getViewportRoot();o&&rC(t,o,r,n,a)}else{t[0]=n,t[1]=a;var s=i&&i.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var MP=(function(){function t(e,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,_e.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=e.getZr(),i=r.appendTo,o=i&&(ae(i)?document.querySelector(i):no(i)?i:ke(i)&&i(e.getDom()));Sx(this._styleCoord,a,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var c=a.handler,u=a.painter.getViewportRoot();br(u,l,!0),c.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),n=_P(r,"position"),a=r.style;a.position!=="absolute"&&n!=="absolute"&&(a.position="relative")}var i=e.get("alwaysShowContent");i&&this._moveIfResized(),this._alwaysShowContent=i,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,a=n.style,i=this._styleCoord;n.innerHTML?a.cssText=xP+CP(e,!this._firstShow,this._longHide)+xx(i[0],i[1],!0)+("border-color:"+Oa(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):a.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,n,a,i){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(ae(i)&&n.get("trigger")==="item"&&!mx(n)&&(s=SP(n,a,i)),ae(e))o.innerHTML=e+s;else if(e){o.innerHTML="",ee(e)||(e=[e]);for(var l=0;l<e.length;l++)no(e[l])&&e[l].parentNode!==o&&o.appendChild(e[l]);if(s&&o.childNodes.length){var c=document.createElement("div");c.innerHTML=s,o.appendChild(c)}}},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},t.prototype.moveTo=function(e,r){if(this.el){var n=this._styleCoord;if(Sx(n,this._zr,this._container,e,r),n[0]!=null&&n[1]!=null){var a=this.el.style,i=xx(n[0],n[1]);I(i,function(o){a[o[0]]=o[1]})}}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){var e=this,r=this.el.style;r.visibility="hidden",r.opacity="0",_e.transform3dSupported&&(r.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Ne(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},t})(),AP=(function(){function t(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),Tx(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return t.prototype.update=function(e){var r=e.get("alwaysShowContent");r&&this._moveIfResized(),this._alwaysShowContent=r},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(e,r,n,a,i){var o=this;de(e)&&Wt(""),this.el&&this._zr.remove(this.el);var s=n.getModel("textStyle");this.el=new $t({style:{rich:r.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:a,textShadowColor:s.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:Hy(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),I(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(c){o.el.style[c]=n.get(c)}),I(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(c){o.el.style[c]=s.get(c)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el,r=this.el.getBoundingRect(),n=kx(e.style);return[r.width+n.left+n.right,r.height+n.top+n.bottom]},t.prototype.moveTo=function(e,r){var n=this.el;if(n){var a=this._styleCoord;Tx(a,this._zr,e,r),e=a[0],r=a[1];var i=n.style,o=Jn(i.borderWidth||0),s=kx(i);n.x=e+o+s.left,n.y=r+o+s.top,n.markRedraw()}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Ne(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t})();function Jn(t){return Math.max(0,t)}function kx(t){var e=Jn(t.shadowBlur||0),r=Jn(t.shadowOffsetX||0),n=Jn(t.shadowOffsetY||0);return{left:Jn(e-r),right:Jn(e+r),top:Jn(e-n),bottom:Jn(e+n)}}function Tx(t,e,r,n){t[0]=r,t[1]=n,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var DP=new _t({shape:{x:-1,y:-1,width:2,height:2}}),IP=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){if(!(_e.node||!n.getDom())){var a=r.getComponent("tooltip"),i=this._renderMode=Vk(a.get("renderMode"));this._tooltipContent=i==="richText"?new AP(n):new MP(n,{appendTo:a.get("appendToBody",!0)?"body":a.get("appendTo",!0)})}},e.prototype.render=function(r,n,a){if(!(_e.node||!a.getDom())){this.group.removeAll(),this._tooltipModel=r,this._ecModel=n,this._api=a;var i=this._tooltipContent;i.update(r),i.setEnterable(r.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&r.get("transitionDuration")?Xd(this,"_updatePosition",50,"fixRate"):Zd(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var r=this._tooltipModel,n=r.get("triggerOn");ix("itemTooltip",this._api,Ne(function(a,i,o){n!=="none"&&(n.indexOf(a)>=0?this._tryShow(i,o):a==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,a=this._api,i=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&i!=="none"&&i!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!a.isDisposed()&&o.manuallyShowTip(r,n,a,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,a,i){if(!(i.from===this.uid||_e.node||!a.getDom())){var o=Cx(i,a);this._ticket="";var s=i.dataByCoordSys,l=EP(i,n,a);if(l){var c=l.el.getBoundingRect().clone();c.applyTransform(l.el.transform),this._tryShow({offsetX:c.x+c.width/2,offsetY:c.y+c.height/2,target:l.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&i.x!=null&&i.y!=null){var u=DP;u.x=i.x,u.y=i.y,u.update(),We(u).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:u},o)}else if(s)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:s,tooltipOption:i.tooltipOption},o);else if(i.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,a,i))return;var f=sx(i,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.el,position:i.position,positionDefault:"bottom"},o)}else i.x!=null&&i.y!=null&&(a.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:a.getZr().findHover(i.x,i.y).target},o))}},e.prototype.manuallyHideTip=function(r,n,a,i){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(Cx(i,a))},e.prototype._manuallyAxisShowTip=function(r,n,a,i){var o=i.seriesIndex,s=i.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var c=n.getSeriesByIndex(o);if(c){var u=c.getData(),f=ss([u.getItemModel(s),c,(c.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return a.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:i.position}),!0}}},e.prototype._tryShow=function(r,n){var a=r.target,i=this._tooltipModel;if(i){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(a){var s=We(a);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,c;Jo(a,function(u){if(We(u).dataIndex!=null)return l=u,!0;if(We(u).tooltipConfig!=null)return c=u,!0},!0),l?this._showSeriesItemTooltip(r,l,n):c?this._showComponentItemTooltip(r,c,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},e.prototype._showOrMove=function(r,n){var a=r.get("showDelay");n=Ne(n,this),clearTimeout(this._showTimout),a>0?this._showTimout=setTimeout(n,a):n()},e.prototype._showAxisTooltip=function(r,n){var a=this._ecModel,i=this._tooltipModel,o=[n.offsetX,n.offsetY],s=ss([n.tooltipOption],i),l=this._renderMode,c=[],u=Go("section",{blocks:[],noHeader:!0}),f=[],h=new Od;I(r,function(y){I(y.dataByAxis,function(b){var x=a.getComponent(b.axisDim+"Axis",b.axisIndex),w=b.value;if(!(!x||w==null)){var S=tx(w,x.axis,a,b.seriesDataIndices,b.valueLabelOpt),k=Go("section",{header:S,noHeader:!Gr(S),sortBlocks:!0,blocks:[]});u.blocks.push(k),I(b.seriesDataIndices,function(C){var A=a.getSeriesByIndex(C.seriesIndex),M=C.dataIndexInside,T=A.getDataParams(M);if(!(T.dataIndex<0)){T.axisDim=b.axisDim,T.axisIndex=b.axisIndex,T.axisType=b.axisType,T.axisId=b.axisId,T.axisValue=Uh(x.axis,{value:w}),T.axisValueLabel=S,T.marker=h.makeTooltipMarker("item",Oa(T.color),l);var D=Iy(A.formatTooltip(M,!0,null)),L=D.frag;if(L){var R=ss([A],i).get("valueFormatter");k.blocks.push(R?q({valueFormatter:R},L):L)}D.text&&f.push(D.text),c.push(T)}})}})}),u.blocks.reverse(),f.reverse();var d=n.position,p=s.get("order"),m=zy(u,h,l,p,a.get("useUTC"),s.get("textStyle"));m&&f.unshift(m);var g=l==="richText"?`
|
|
19
19
|
|
|
20
|
-
`:"<br/>",v=f.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,c)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,c):this._showTooltipContent(s,v,c,Math.random()+"",o[0],o[1],d,null,h)})},e.prototype._showSeriesItemTooltip=function(r,n,a){var i=this._ecModel,o=Ve(n),s=o.seriesIndex,l=i.getSeriesByIndex(s),c=o.dataModel||l,u=o.dataIndex,f=o.dataType,h=c.getData(f),d=this._renderMode,p=r.positionDefault,m=Wo([h.getItemModel(u),c,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=m.get("trigger");if(!(g!=null&&g!=="item")){var v=c.getDataParams(u,f),y=new gh;v.marker=y.makeTooltipMarker("item",pa(v.color),d);var b=xy(c.formatTooltip(u,!1,f)),x=m.get("order"),S=m.get("valueFormatter"),w=b.frag,k=w?Dy(S?U({valueFormatter:S},w):w,y,d,x,i.get("useUTC"),m.get("textStyle")):b.text,T="item_"+c.name+"_"+u;this._showOrMove(m,function(){this._showTooltipContent(m,k,v,T,r.offsetX,r.offsetY,r.position,r.target,y)}),a({type:"showTip",dataIndexInside:u,dataIndex:h.getRawIndex(u),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,a){var i=this._renderMode==="html",o=Ve(n),s=o.tooltipConfig,l=s.option||{},c=l.encodeHTMLContent;if(ne(l)){var u=l;l={content:u,formatter:u},c=!0}c&&i&&l.content&&(l=Te(l),l.content=Bt(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=r.positionDefault,p=Wo(f,this._tooltipModel,d?{position:d}:null),m=p.get("content"),g=Math.random()+"",v=new gh;this._showOrMove(p,function(){var y=Te(p.get("formatterParams")||{});this._showTooltipContent(p,m,y,g,r.offsetX,r.offsetY,r.position,n,v)}),a({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,n,a,i,o,s,l,c,u){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var f=this._tooltipContent;f.setEnterable(r.get("enterable"));var h=r.get("formatter");l=l||r.get("position");var d=n,p=this._getNearestPoint([o,s],a,r.get("trigger"),r.get("borderColor")),m=p.color;if(h)if(ne(h)){var g=r.ecModel.get("useUTC"),v=ee(a)?a[0]:a,y=v&&v.axisType&&v.axisType.indexOf("time")>=0;d=h,y&&(d=zl(v.axisValue,d,g)),d=my(d,a,!0)}else if(ye(h)){var b=Le(function(x,S){x===this._ticket&&(f.setContent(S,u,r,m,l),this._updatePosition(r,l,o,s,f,a,c))},this);this._ticket=i,d=h(a,i,b)}else d=h;f.setContent(d,u,r,m,l),f.show(r,m),this._updatePosition(r,l,o,s,f,a,c)}},e.prototype._getNearestPoint=function(r,n,a,i){if(a==="axis"||ee(n))return{color:i||(this._renderMode==="html"?"#fff":"none")};if(!ee(n))return{color:i||n.color||n.borderColor}},e.prototype._updatePosition=function(r,n,a,i,o,s,l){var c=this._api.getWidth(),u=this._api.getHeight();n=n||r.get("position");var f=o.getSize(),h=r.get("align"),d=r.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),ye(n)&&(n=n([a,i],s,o.el,p,{viewSize:[c,u],contentSize:f.slice()})),ee(n))a=At(n[0],c),i=At(n[1],u);else if(ce(n)){var m=n;m.width=f[0],m.height=f[1];var g=Yl(m,{width:c,height:u});a=g.x,i=g.y,h=null,d=null}else if(ne(n)&&l){var v=TP(n,p,f,r.get("borderWidth"));a=v[0],i=v[1]}else{var v=SP(a,i,o,c,u,h?null:20,d?null:20);a=v[0],i=v[1]}if(h&&(a-=mx(h)?f[0]/2:h==="right"?f[0]:0),d&&(i-=mx(d)?f[1]/2:d==="bottom"?f[1]:0),lx(r)){var v=kP(a,i,o,c,u);a=v[0],i=v[1]}o.moveTo(a,i)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var a=this._lastDataByCoordSys,i=this._cbParamsList,o=!!a&&a.length===r.length;return o&&D(a,function(s,l){var c=s.dataByAxis||[],u=r[l]||{},f=u.dataByAxis||[];o=o&&c.length===f.length,o&&D(c,function(h,d){var p=f[d]||{},m=h.seriesDataIndices||[],g=p.seriesDataIndices||[];o=o&&h.value===p.value&&h.axisType===p.axisType&&h.axisId===p.axisId&&m.length===g.length,o&&D(m,function(v,y){var b=g[y];o=o&&v.seriesIndex===b.seriesIndex&&v.dataIndex===b.dataIndex}),i&&D(h.seriesDataIndices,function(v){var y=v.seriesIndex,b=n[y],x=i[y];b&&x&&x.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){ge.node||!n.getDom()||(Ih(this,"_updatePosition"),this._tooltipContent.dispose(),zd("itemTooltip",n))},e.type="tooltip",e})(gr);function Wo(t,e,r){var n=e.ecModel,a;r?(a=new et(r,n,n),a=new et(e.option,a,n)):a=e;for(var i=t.length-1;i>=0;i--){var o=t[i];o&&(o instanceof et&&(o=o.get("tooltip",!0)),ne(o)&&(o={formatter:o}),o&&(a=new et(o,a,n)))}return a}function gx(t,e){return t.dispatchAction||Le(e.dispatchAction,e)}function SP(t,e,r,n,a,i,o){var s=r.getSize(),l=s[0],c=s[1];return i!=null&&(t+l+i+2>n?t-=l+i:t+=i),o!=null&&(e+c+o>a?e-=c+o:e+=o),[t,e]}function kP(t,e,r,n,a){var i=r.getSize(),o=i[0],s=i[1];return t=Math.min(t+o,n)-o,e=Math.min(e+s,a)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function TP(t,e,r,n){var a=r[0],i=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,c=e.width,u=e.height;switch(t){case"inside":s=e.x+c/2-a/2,l=e.y+u/2-i/2;break;case"top":s=e.x+c/2-a/2,l=e.y-i-o;break;case"bottom":s=e.x+c/2-a/2,l=e.y+u+o;break;case"left":s=e.x-a-o,l=e.y+u/2-i/2;break;case"right":s=e.x+c+o,l=e.y+u/2-i/2}return[s,l]}function mx(t){return t==="center"||t==="middle"}function CP(t,e,r){var n=hf(t).queryOptionMap,a=n.keys()[0];if(!(!a||a==="series")){var i=oo(e,a,n.get(a),{useDefault:!1,enableAll:!1,enableNone:!1}),o=i.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(c){var u=Ve(c).tooltipConfig;if(u&&u.name===t.name)return l=c,!0}),l)return{componentMainType:a,componentIndex:o.componentIndex,el:l}}}}function MP(t){In(rx),t.registerComponentModel(cP),t.registerComponentView(wP),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Ct),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Ct)}var AP=function(t,e){if(e==="all")return{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}},Vd=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a),r.selected=r.selected||{},this._updateSelector(r)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),this._updateSelector(r)},e.prototype._updateSelector=function(r){var n=r.selector,a=this.ecModel;n===!0&&(n=r.selector=["all","inverse"]),ee(n)&&D(n,function(i,o){ne(i)&&(i={type:i}),n[o]=De(i,AP(a,i.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var n=!1,a=0;a<r.length;a++){var i=r[a].get("name");if(this.isSelected(i)){this.select(i),n=!0;break}}!n&&this.select(r[0].get("name"))}},e.prototype._updateData=function(r){var n=[],a=[];r.eachRawSeries(function(l){var c=l.name;a.push(c);var u;if(l.legendVisualProvider){var f=l.legendVisualProvider,h=f.getAllNames();r.isSeriesFiltered(l)||(a=a.concat(h)),h.length?n=n.concat(h):u=!0}else u=!0;u&&uf(l)&&n.push(l.name)}),this._availableNames=a;var i=this.get("data")||n,o=de(),s=ue(i,function(l){return(ne(l)||Ke(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new et(l,this,this.ecModel))},this);this._data=dt(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(r){var n=this.option.selected,a=this.get("selectedMode");if(a==="single"){var i=this._data;D(i,function(o){n[o.get("name")]=!1})}n[r]=!0},e.prototype.unSelect=function(r){this.get("selectedMode")!=="single"&&(this.option.selected[r]=!1)},e.prototype.toggleSelected=function(r){var n=this.option.selected;n.hasOwnProperty(r)||(n[r]=!0),this[n[r]?"unSelect":"select"](r)},e.prototype.allSelect=function(){var r=this._data,n=this.option.selected;D(r,function(a){n[a.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var r=this._data,n=this.option.selected;D(r,function(a){var i=a.get("name",!0);n.hasOwnProperty(i)||(n[i]=!0),n[i]=!n[i]})},e.prototype.isSelected=function(r){var n=this.option.selected;return!(n.hasOwnProperty(r)&&!n[r])&&ze(this._availableNames,r)>=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e})(We),Si=at,Gd=D,Mc=mt,yx=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new Mc),this.group.add(this._selectorGroup=new Mc),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,n,a){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),c=r.get("selectorPosition",!0);l&&(!c||c==="auto")&&(c=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,a,l,s,c);var u=r.getBoxLayoutParams(),f={width:a.getWidth(),height:a.getHeight()},h=r.get("padding"),d=Yl(u,f,h),p=this.layoutInner(r,o,d,i,l,c),m=Yl(Ne({width:p.width,height:p.height},u),f,h);this.group.x=m.x-p.x,this.group.y=m.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=lP(p,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,n,a,i,o,s,l){var c=this.getContentGroup(),u=de(),f=n.get("selectedMode"),h=[];a.eachRawSeries(function(d){!d.get("legendHoverLink")&&h.push(d.id)}),Gd(n.getData(),function(d,p){var m=d.get("name");if(!this.newlineDisabled&&(m===""||m===`
|
|
21
|
-
`)){var g=new
|
|
22
|
-
`||a==="")){var i=t.isSelected(a);Vn(r,a)?r[a]=r[a]&&i:r[a]=i}}),r}function PP(t){t.registerAction("legendToggleSelect","legendselectchanged",at(Uo,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",at(Uo,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",at(Uo,"inverseSelect")),t.registerAction("legendSelect","legendselected",at(Uo,"select")),t.registerAction("legendUnSelect","legendunselected",at(Uo,"unSelect"))}function Sx(t){t.registerComponentModel(Vd),t.registerComponentView(yx),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,LP),t.registerSubTypeDefaulter("legend",function(){return"plain"}),PP(t)}var RP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.setScrollDataIndex=function(r){this.option.scrollDataIndex=r},e.prototype.init=function(r,n,a){var i=ql(r);t.prototype.init.call(this,r,n,a),kx(this,r,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),kx(this,this.option,r)},e.type="legend.scroll",e.defaultOption=Jf(Vd.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e})(Vd);function kx(t,e,r){var n=t.getOrient(),a=[1,1];a[n.index]=0,hi(e,r,{type:"box",ignoreSize:!!a})}var Tx=mt,Ud=["width","height"],Yd=["x","y"],EP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!0,r._currentIndex=0,r}return e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new Tx),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Tx)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(r,n,a,i,o,s,l){var c=this;t.prototype.renderInner.call(this,r,n,a,i,o,s,l);var u=this._controllerGroup,f=n.get("pageIconSize",!0),h=ee(f)?f:[f,f];p("pagePrev",0);var d=n.getModel("pageTextStyle");u.add(new Pt({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1);function p(m,g){var v=m+"DataIndex",y=Bf(n.get("pageIcons",!0)[n.getOrient().name][g],{onclick:Le(c._pageGo,c,v,n,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});y.name=m,u.add(y)}},e.prototype.layoutInner=function(r,n,a,i,o,s){var l=this.getSelectorGroup(),c=r.getOrient().index,u=Ud[c],f=Yd[c],h=Ud[1-c],d=Yd[1-c];o&&So("horizontal",l,r.get("selectorItemGap",!0));var p=r.get("selectorButtonGap",!0),m=l.getBoundingRect(),g=[-m.x,-m.y],v=Te(a);o&&(v[u]=a[u]-m[u]-p);var y=this._layoutContentAndController(r,i,v,c,u,h,d,f);if(o){if(s==="end")g[c]+=y[u]+p;else{var b=m[u]+p;g[c]-=b,y[f]-=b}y[u]+=m[u]+p,g[1-c]+=y[d]+y[h]/2-m[h]/2,y[h]=Math.max(y[h],m[h]),y[d]=Math.min(y[d],m[d]+g[1-c]),l.x=g[0],l.y=g[1],l.markRedraw()}return y},e.prototype._layoutContentAndController=function(r,n,a,i,o,s,l,c){var u=this.getContentGroup(),f=this._containerGroup,h=this._controllerGroup;So(r.get("orient"),u,r.get("itemGap"),i?a.width:null,i?null:a.height),So("horizontal",h,r.get("pageButtonItemGap",!0));var d=u.getBoundingRect(),p=h.getBoundingRect(),m=this._showController=d[o]>a[o],g=[-d.x,-d.y];n||(g[i]=u[c]);var v=[0,0],y=[-p.x,-p.y],b=Ce(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var x=r.get("pageButtonPosition",!0);x==="end"?y[i]+=a[o]-p[o]:v[i]+=p[o]+b}y[1-i]+=d[s]/2-p[s]/2,u.setPosition(g),f.setPosition(v),h.setPosition(y);var S={x:0,y:0};if(S[o]=m?a[o]:d[o],S[s]=Math.max(d[s],p[s]),S[l]=Math.min(0,p[l]+y[1-i]),f.__rectSize=a[o],m){var w={x:0,y:0};w[o]=Math.max(a[o]-p[o]-b,0),w[s]=S[s],f.setClipPath(new ft({shape:w})),f.__rectSize=w[o]}else h.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var k=this._getPageInfo(r);return k.pageIndex!=null&&Ut(u,{x:k.contentPosition[0],y:k.contentPosition[1]},m?r:null),this._updatePageInfoView(r,k),S},e.prototype._pageGo=function(r,n,a){var i=this._getPageInfo(n)[r];i!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:n.id})},e.prototype._updatePageInfoView=function(r,n){var a=this._controllerGroup;D(["pagePrev","pageNext"],function(u){var f=u+"DataIndex",h=n[f]!=null,d=a.childOfName(u);d&&(d.setStyle("fill",h?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=h?"pointer":"default")});var i=a.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,c=n.pageCount;i&&o&&i.setStyle("text",ne(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",c==null?"":c+""):o({current:l,total:c}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),a=this.getContentGroup(),i=this._containerGroup.__rectSize,o=r.getOrient().index,s=Ud[o],l=Yd[o],c=this._findTargetItemIndex(n),u=a.children(),f=u[c],h=u.length,d=h?1:0,p={contentPosition:[a.x,a.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return p;var m=x(f);p.contentPosition[o]=-m.s;for(var g=c+1,v=m,y=m,b=null;g<=h;++g)b=x(u[g]),(!b&&y.e>v.s+i||b&&!S(b,v.s))&&(y.i>v.i?v=y:v=b,v&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=v.i),++p.pageCount)),y=b;for(var g=c-1,v=m,y=m,b=null;g>=-1;--g)b=x(u[g]),(!b||!S(y,b.s))&&v.i<y.i&&(y=v,p.pagePrevDataIndex==null&&(p.pagePrevDataIndex=v.i),++p.pageCount,++p.pageIndex),v=b;return p;function x(w){if(w){var k=w.getBoundingRect(),T=k[l]+w[l];return{s:T,e:T+k[s],i:w.__legendDataIndex}}}function S(w,k){return w.e>=k&&w.s<=k+i}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,a=this.getContentGroup(),i;return a.eachChild(function(o,s){var l=o.__legendDataIndex;i==null&&l!=null&&(i=s),l===r&&(n=s)}),n??i},e.type="legend.scroll",e})(yx);function OP(t){t.registerAction("legendScroll","legendscroll",function(e,r){var n=e.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(a){a.setScrollDataIndex(n)})})}function NP(t){In(Sx),t.registerComponentModel(RP),t.registerComponentView(EP),OP(t)}function BP(t){In(Sx),In(NP)}var zP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=Jf(ax.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e})(ax),qd=it();function FP(t,e,r){qd(t).coordSysRecordMap.each(function(n){var a=n.dataZoomInfoMap.get(e.uid);a&&(a.getRange=r)})}function HP(t,e){for(var r=qd(t).coordSysRecordMap,n=r.keys(),a=0;a<n.length;a++){var i=n[a],o=r.get(i),s=o.dataZoomInfoMap;if(s){var l=e.uid,c=s.get(l);c&&(s.removeKey(l),s.keys().length||Cx(r,o))}}}function Cx(t,e){if(e){t.removeKey(e.model.uid);var r=e.controller;r&&r.dispose()}}function VP(t,e){var r={model:e,containsPoint:at($P,e),dispatchAction:at(GP,t),dataZoomInfoMap:null,controller:null},n=r.controller=new CL(t.getZr());return D(["pan","zoom","scrollMove"],function(a){n.on(a,function(i){var o=[];r.dataZoomInfoMap.each(function(s){if(i.isAvailableBehavior(s.model.option)){var l=(s.getRange||{})[a],c=l&&l(s.dzReferCoordSysInfo,r.model.mainType,r.controller,i);!s.model.get("disabled",!0)&&c&&o.push({dataZoomId:s.model.id,start:c[0],end:c[1]})}}),o.length&&r.dispatchAction(o)})}),r}function GP(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function $P(t,e,r,n){return t.coordinateSystem.containPoint([r,n])}function WP(t){var e,r="type_",n={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return t.each(function(i){var o=i.model,s=o.get("disabled",!0)?!1:o.get("zoomLock",!0)?"move":!0;n[r+s]>n[r+e]&&(e=s),a=a&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!a}}}function UP(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var n=qd(r),a=n.coordSysRecordMap||(n.coordSysRecordMap=de());a.each(function(i){i.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(i){var o=tP(i);D(o.infoList,function(s){var l=s.model.uid,c=a.get(l)||a.set(l,VP(r,s.model)),u=c.dataZoomInfoMap||(c.dataZoomInfoMap=de());u.set(i.uid,{dzReferCoordSysInfo:s,model:i,getRange:null})})}),a.each(function(i){var o=i.controller,s,l=i.dataZoomInfoMap;if(l){var c=l.keys()[0];c!=null&&(s=l.get(c))}if(!s){Cx(a,i);return}var u=WP(l);o.enable(u.controlType,u.opt),o.setPointerChecker(i.containsPoint),Dh(i,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var YP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,n,a){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),FP(a,r,{pan:Le(Xd.pan,this),zoom:Le(Xd.zoom,this),scrollMove:Le(Xd.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){HP(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e})(rP),Xd={zoom:function(t,e,r,n){var a=this.range,i=a.slice(),o=t.axisModels[0];if(o){var s=Zd[e](null,[n.originX,n.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(i[1]-i[0])+i[0],c=Math.max(1/n.scale,0);i[0]=(i[0]-l)*c+l,i[1]=(i[1]-l)*c+l;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Ed(0,i,[0,100],0,u.minSpan,u.maxSpan),this.range=i,a[0]!==i[0]||a[1]!==i[1])return i}},pan:Mx(function(t,e,r,n,a,i){var o=Zd[n]([i.oldX,i.oldY],[i.newX,i.newY],e,a,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:Mx(function(t,e,r,n,a,i){var o=Zd[n]([0,0],[i.scrollDelta,i.scrollDelta],e,a,r);return o.signal*(t[1]-t[0])*i.scrollDelta})};function Mx(t){return function(e,r,n,a){var i=this.range,o=i.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,n,a);if(Ed(l,o,[0,100],"all"),this.range=o,i[0]!==o[0]||i[1]!==o[1])return o}}}var Zd={grid:function(t,e,r,n,a){var i=r.axis,o={},s=a.model.coordinateSystem.getRect();return t=t||[0,0],i.dim==="x"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=i.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=i.inverse?-1:1),o},polar:function(t,e,r,n,a){var i=r.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),c=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=i.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=i.inverse?-1:1),o},singleAxis:function(t,e,r,n,a){var i=r.axis,o=a.model.coordinateSystem.getRect(),s={};return t=t||[0,0],i.orient==="horizontal"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=i.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=i.inverse?-1:1),s}};function qP(t){sP(t),t.registerComponentModel(zP),t.registerComponentView(YP),UP(t)}var XP={label:{enabled:!0},decal:{show:!1}},Ax=it(),ZP={};function KP(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=Te(XP);De(n.label,t.getLocaleModel().get("aria"),!1),De(r.option,n,!1),a(),i();function a(){var c=r.getModel("decal"),u=c.get("show");if(u){var f=de();t.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),Ax(h).scope=d}}),t.eachRawSeries(function(h){if(t.isSeriesFiltered(h))return;if(ye(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var y=_y(h.ecModel,h.name,ZP,t.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",x(b,y))}else{var p=h.getRawData(),m={},g=Ax(h).scope;d.each(function(S){var w=d.getRawIndex(S);m[w]=S});var v=p.count();p.each(function(S){var w=m[S],k=p.getName(S)||S+"",T=_y(h.ecModel,k,g,v),C=d.getItemVisual(w,"decal");d.setItemVisual(w,"decal",x(C,T))})}function x(S,w){var k=S?U(U({},w),S):w;return k.dirty=!0,k}})}}function i(){var c=e.getZr().dom;if(c){var u=t.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=Ne(f.option,u),!!f.get("enabled")){if(c.setAttribute("role","img"),f.get("description")){c.setAttribute("aria-label",f.get("description"));return}var h=t.getSeriesCount(),d=f.get(["data","maxCount"])||10,p=f.get(["series","maxCount"])||10,m=Math.min(h,p),g;if(!(h<1)){var v=s();if(v){var y=f.get(["general","withTitle"]);g=o(y,{title:v})}else g=f.get(["general","withoutTitle"]);var b=[],x=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);g+=o(x,{seriesCount:h}),t.eachSeries(function(T,C){if(C<m){var A=void 0,M=T.get("name"),I=M?"withName":"withoutName";A=h>1?f.get(["series","multiple",I]):f.get(["series","single",I]),A=o(A,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var L=T.getData();if(L.count()>d){var P=f.get(["data","partialData"]);A+=o(P,{displayCnt:d})}else A+=f.get(["data","allData"]);for(var N=f.get(["data","separator","middle"]),O=f.get(["data","separator","end"]),q=f.get(["data","excludeDimensionId"]),R=[],z=0;z<L.count();z++)if(z<d){var F=L.getName(z),X=q?dt(L.getValues(z),function(fe,me){return ze(q,me)===-1}):L.getValues(z),te=f.get(["data",F?"withName":"withoutName"]);R.push(o(te,{name:F,value:X.join(N)}))}A+=R.join(N)+O,b.push(A)}});var S=f.getModel(["series","multiple","separator"]),w=S.get("middle"),k=S.get("end");g+=b.join(w)+k,c.setAttribute("aria-label",g)}}}}function o(c,u){if(!ne(c))return c;var f=c;return D(u,function(h,d){f=f.replace(new RegExp("\\{\\s*"+d+"\\s*\\}","g"),h)}),f}function s(){var c=t.get("title");return c&&c.length&&(c=c[0]),c&&c.text}function l(c){var u=t.getLocaleModel().get(["series","typeNames"]);return u[c]||u.chart}}function jP(t){if(!(!t||!t.aria)){var e=t.aria;e.show!=null&&(e.enabled=e.show),e.label=e.label||{},D(["description","general","series","data"],function(r){e[r]!=null&&(e.label[r]=e[r])})}}function QP(t){t.registerPreprocessor(jP),t.registerVisual(t.PRIORITY.VISUAL.ARIA,KP)}function Dx(t,e,r){var n=Na.createCanvas(),a=e.getWidth(),i=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=a+"px",o.height=i+"px",n.setAttribute("data-zr-dom-id",t)),n.width=a*r,n.height=i*r,n}var Kd=(function(t){Z(e,t);function e(r,n,a){var i=t.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var o;a=a||Xs,typeof r=="string"?o=Dx(r,n,a):ce(r)&&(o=r,r=o.id),i.id=r,i.dom=o;var s=o.style;return s&&(dv(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),i.painter=n,i.dpr=a,i}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=Dx("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,a,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,c=new Fe(0,0,0,0);function u(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new Fe(0,0,0,0);b.copy(y),o.push(b)}else{for(var x=!1,S=1/0,w=0,k=0;k<o.length;++k){var T=o[k];if(T.intersect(y)){var C=new Fe(0,0,0,0);C.copy(T),C.union(y),o[k]=C,x=!0;break}else if(l){c.copy(y),c.union(T);var A=y.width*y.height,M=T.width*T.height,I=c.width*c.height,L=I-A-M;L<S&&(S=L,w=k)}}if(l&&(o[w].union(y),x=!0),!x){var b=new Fe(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var f=this.__startIndex;f<this.__endIndex;++f){var h=r[f];if(h){var d=h.shouldBePainted(a,i,!0,!0),p=h.__isRendered&&(h.__dirty&Wt||!d)?h.getPrevPaintRect():null;p&&u(p);var m=d&&(h.__dirty&Wt||!h.__isRendered)?h.getPaintRect():null;m&&u(m)}}for(var f=this.__prevStartIndex;f<this.__prevEndIndex;++f){var h=n[f],d=h&&h.shouldBePainted(a,i,!0,!0);if(h&&(!d||!h.__zr)&&h.__isRendered){var p=h.getPrevPaintRect();p&&u(p)}}var g;do{g=!1;for(var f=0;f<o.length;){if(o[f].isZero()){o.splice(f,1);continue}for(var v=f+1;v<o.length;)o[f].intersect(o[v])?(g=!0,o[f].union(o[v]),o.splice(v,1)):v++;f++}}while(g);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var a=this.dpr,i=this.dom,o=i.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),i.width=r*a,i.height=n*a,s&&(s.width=r*a,s.height=n*a,a!==1&&this.ctxBack.scale(a,a))},e.prototype.clear=function(r,n,a){var i=this.dom,o=this.ctx,s=i.width,l=i.height;n=n||this.clearColor;var c=this.motionBlur&&!r,u=this.lastFrameAlpha,f=this.dpr,h=this;c&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,s/f,l/f));var d=this.domBack;function p(m,g,v,y){if(o.clearRect(m,g,v,y),n&&n!=="transparent"){var b=void 0;if(Ss(n)){var x=n.global||n.__width===v&&n.__height===y;b=x&&n.__canvasGradient||jh(o,n,{x:0,y:0,width:v,height:y}),n.__canvasGradient=b,n.__width=v,n.__height=y}else Cw(n)&&(n.scaleX=n.scaleX||f,n.scaleY=n.scaleY||f,b=Qh(o,n,{dirty:function(){h.setUnpainted(),h.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(m,g,v,y),o.restore()}c&&(o.save(),o.globalAlpha=u,o.drawImage(d,m,g,v,y),o.restore())}!a||c?p(0,0,s,l):a.length&&D(a,function(m){p(m.x*f,m.y*f,m.width*f,m.height*f)})},e})(ur),Ix=1e5,Sa=314159,Ac=.01,JP=.001;function eR(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function tR(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var rR=(function(){function t(e,r,n,a){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=U({},n||{}),this.dpr=n.devicePixelRatio||Xs,this._singleCanvas=i,this.root=e;var o=e.style;o&&(dv(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(i){var u=e,f=u.width,h=u.height;n.width!=null&&(f=n.width),n.height!=null&&(h=n.height),this.dpr=n.devicePixelRatio||1,u.width=f*this.dpr,u.height=h*this.dpr,this._width=f,this._height=h;var d=new Kd(u,this,this.dpr);d.__builtin__=!0,d.initContext(),l[Sa]=d,d.zlevel=Sa,s.push(Sa),this._domRoot=e}else{this._width=uc(e,0,n),this._height=uc(e,1,n);var c=this._domRoot=tR(this._width,this._height);e.appendChild(c)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,a=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var i=0;i<a.length;i++){var o=a[i],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=i===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var a={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(Ix)),i||(i=n.ctx,i.save()),ma(i,s,a,o===r-1))}i&&i.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(Ix)},t.prototype.paintOne=function(e,r){S_(e,r)},t.prototype._paintList=function(e,r,n,a){if(this._redrawId===a){n=n||!1,this._updateLayerStatus(e);var i=this._doPaintList(e,r,n),o=i.finished,s=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(c){c.afterBrush&&c.afterBrush()});else{var l=this;rc(function(){l._paintList(e,r,n,a)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Sa).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(a){a.virtual&&e.drawImage(a.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var a=this,i=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],c=this._layers[l];c.__builtin__&&c!==this._hoverlayer&&(c.__dirty||n)&&i.push(c)}for(var u=!0,f=!1,h=function(m){var g=i[m],v=g.ctx,y=o&&g.createRepaintRects(e,r,d._width,d._height),b=n?g.__startIndex:g.__drawIndex,x=!n&&g.incremental&&Date.now,S=x&&Date.now(),w=g.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(g.__startIndex===g.__endIndex)g.clear(!1,w,y);else if(b===g.__startIndex){var k=e[b];(!k.incremental||!k.notClear||n)&&g.clear(!1,w,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=g.__startIndex);var T,C=function(L){var P={inHover:!1,allClipped:!1,prevEl:null,viewWidth:a._width,viewHeight:a._height};for(T=b;T<g.__endIndex;T++){var N=e[T];if(N.__inHover&&(f=!0),a._doPaintEl(N,g,o,L,P,T===g.__endIndex-1),x){var O=Date.now()-S;if(O>15)break}}P.prevElClipPaths&&v.restore()};if(y)if(y.length===0)T=g.__endIndex;else for(var A=d.dpr,M=0;M<y.length;++M){var I=y[M];v.save(),v.beginPath(),v.rect(I.x*A,I.y*A,I.width*A,I.height*A),v.clip(),C(I),v.restore()}else v.save(),C(),v.restore();g.__drawIndex=T,g.__drawIndex<g.__endIndex&&(u=!1)},d=this,p=0;p<i.length;p++)h(p);return ge.wxa&&D(this._layers,function(m){m&&m.ctx&&m.ctx.draw&&m.ctx.draw()}),{finished:u,needsRefreshHover:f}},t.prototype._doPaintEl=function(e,r,n,a,i,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!a||l&&l.intersect(a))&&(ma(s,e,i,o),e.setPrevPaintRect(l))}else ma(s,e,i,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Sa);var n=this._layers[e];return n||(n=new Kd("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?De(n,this._layerConfig[e],!0):this._layerConfig[e-Ac]&&De(n,this._layerConfig[e-Ac],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,a=this._zlevelList,i=a.length,o=this._domRoot,s=null,l=-1;if(!n[e]&&eR(r)){if(i>0&&e>a[0]){for(l=0;l<i-1&&!(a[l]<e&&a[l+1]>e);l++);s=n[a[l]]}if(a.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var c=s.dom;c.nextSibling?o.insertBefore(r.dom,c.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a];e.call(r,this._layers[i],i)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a],o=this._layers[i];o.__builtin__&&e.call(r,o,i)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a],o=this._layers[i];o.__builtin__||e.call(r,o,i)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(f,h){f.__dirty=f.__used=!1});function r(f){i&&(i.__endIndex!==f&&(i.__dirty=!0),i.__endIndex=f)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var a=e[n];if(a.zlevel!==e[n-1].zlevel||a.incremental){this._needsManuallyCompositing=!0;break}}var i=null,o=0,s,l;for(l=0;l<e.length;l++){var a=e[l],c=a.zlevel,u=void 0;s!==c&&(s=c,o=0),a.incremental?(u=this.getLayer(c+JP,this._needsManuallyCompositing),u.incremental=!0,o=1):u=this.getLayer(c+(o>0?Ac:0),this._needsManuallyCompositing),u.__builtin__||vu("ZLevel "+c+" has been used by unkown layer "+u.id),u!==i&&(u.__used=!0,u.__startIndex!==l&&(u.__dirty=!0),u.__startIndex=l,u.incremental?u.__drawIndex=-1:u.__drawIndex=l,r(l),i=u),a.__dirty&Wt&&!a.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,D(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?De(n[e],r,!0):n[e]=r;for(var a=0;a<this._zlevelList.length;a++){var i=this._zlevelList[a];if(i===e||i===e+Ac){var o=this._layers[i];De(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,a=r[e];a&&(a.dom.parentNode.removeChild(a.dom),delete r[e],n.splice(ze(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var a=this._opts,i=this.root;if(e!=null&&(a.width=e),r!=null&&(a.height=r),e=uc(i,0,a),r=uc(i,1,a),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(Sa).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Sa].dom;var r=new Kd("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var a=r.dom.width,i=r.dom.height;this.eachLayer(function(f){f.__builtin__?n.drawImage(f.dom,0,0,a,i):f.renderToCanvas&&(n.save(),f.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,c=s.length;l<c;l++){var u=s[l];ma(n,u,o,l===c-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t})();function nR(t){t.registerPainter("canvas",rR)}In([QP,JM,nR,qP,jL,BP,IM,MP]);const ka={background:"#ffffff",border:"#dce4e9",muted:"#5b7186",surface:"#ffffff",text:"#0f1e2a",colors:["#2f7f55","#2563eb","#d97706","#7c3aed"]},Lx="cf-widget-category-zoom",Px=.68,ki=t=>({startIndex:0,endIndex:Math.max(0,t-1)}),Yo=(t,e)=>{if(e<=0)return ki(0);let r=e-1,n=Math.max(0,Math.min(r,Math.floor(Math.min(t.startIndex,t.endIndex))));return{startIndex:n,endIndex:Math.max(n,Math.min(r,Math.floor(Math.max(t.startIndex,t.endIndex))))}},Rx=(t,e,r)=>{let n=Yo(t,r);if(r<=2)return ki(r);let a=n.endIndex-n.startIndex+1,i=e==="in"?Math.max(2,Math.floor(a*Px)):Math.min(r,Math.ceil(a/Px));if(i===a)return n;let o=(n.startIndex+n.endIndex)/2,s=r-i,l=Math.max(0,Math.min(s,Math.round(o-(i-1)/2)));return{startIndex:l,endIndex:l+i-1}},aR=(t,e)=>{let r=t.length;if(r===0)return"No chart points";let n=Yo(e,r);if(n.startIndex===0&&n.endIndex===r-1)return`All ${r} ${r===1?"point":"points"}`;let a=n.endIndex-n.startIndex+1;return`${t[n.startIndex]} – ${t[n.endIndex]} · ${a} of ${r} points`},iR=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},oR=t=>{let e=new Set,r=[];return t.forEach(n=>{let a=n?.trim();!a||e.has(a)||(e.add(a),r.push(a))}),r},jd=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()){let e=Number(t);if(Number.isFinite(e))return e}return null},Dc=t=>{if(t===null)return"null:";if(t===void 0)return"undefined:";if(typeof t=="object")try{return`object:${JSON.stringify(t)}`}catch{return"object:"}return`${typeof t}:${String(t)}`},Ic=(t,e)=>e?t.columnMetadata?.find(r=>r.key===e):void 0,Qd=(t,e)=>Ic(t,e)?.label?.trim()||iR(e),Ex=(t,e,r)=>{if(r==null||r==="")return"Not set";let n=Ic(t,e);if(n?.dataType==="boolean"){let a=String(r).trim().toLowerCase();return r===!1||r===0||["0","false","no"].includes(a)?"No":"Yes"}if(n?.dataType==="date"||n?.dataType==="datetime"){let a=new Date(r);if(!Number.isNaN(a.getTime()))try{return new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric",timeZone:t.timezone||"UTC"}).format(a)}catch{return new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric",timeZone:"UTC"}).format(a)}}return String(r)},qo=(t,e,r,n=!1)=>{if(e?.dataType==="currency"){let a=e.currencyCode||r?.currency?.code;if(a)return new Intl.NumberFormat(void 0,{style:"currency",currency:a,notation:n&&Math.abs(t)>=1e4?"compact":"standard",maximumFractionDigits:2}).format(t)}return e?.dataType==="percent"?new Intl.NumberFormat(void 0,{style:"percent",maximumFractionDigits:2}).format(Math.abs(t)>1?t/100:t):new Intl.NumberFormat(void 0,{notation:n&&Math.abs(t)>=1e4?"compact":"standard",maximumFractionDigits:2}).format(t)},sR=(t,e)=>{if(t.presentation==="table"||t.presentation==="kpi")return null;if(e)return e;let r=t.chartRecommendation?.type;return r==="line"||r==="bar"||r==="stacked_bar"?r:t.type==="line"||t.type==="bar"||t.type==="stacked_bar"?t.type:null},lR=t=>t.chartRecommendation?.categoryField?.trim()||t.label?.trim()||t.columnMetadata?.find(e=>["date","dimension","geography","boolean"].includes(e.semanticRole))?.key||t.columns?.[0],cR=t=>t.chartRecommendation?.seriesField?.trim()||t.seriesField?.trim()||t.series?.trim()||void 0,uR=(t,e,r)=>{let n=oR([...t.chartRecommendation?.valueFields??[],...t.valueFields??[],t.value,...t.columnMetadata?.filter(i=>i.semanticRole==="measure").map(i=>i.key)??[]]),a=new Set([...t.columns??[],...t.columnMetadata?.map(i=>i.key)??[],...Object.keys(t.rows?.[0]??{})]);return n.filter(i=>i!==e&&i!==r&&a.has(i)).filter(i=>t.rows?.some(o=>jd(o[i])!==null))},fR=(t,e,r,n,a)=>{let i=a?` Showing 4 of ${n.length+a} series.`:"";if(e==="line"){let s=r.length-1,l=n.map(c=>{let u=c.values[s];return u==null?null:`${c.name}: ${qo(u,c.valueColumn,t)}`}).filter(c=>!!c);return l.length?`Latest (${r[s]}): ${l.join("; ")}.${i}`:`No numeric trend values are available.${i}`}let o;return n.forEach(s=>{s.values.forEach((l,c)=>{l===null||o&&l<=o.value||(o={category:r[c]??"Not set",series:s,value:l})})}),o?`Highest: ${o.category}, ${o.series.name} ${qo(o.value,o.series.valueColumn,t)}.${i}`:`No numeric comparison values are available.${i}`},Jd=(t,e)=>{let r=sR(t,e),n=lR(t),a=t.rows??[];if(!r||!n||a.length===0)return null;let i=cR(t),o=uR(t,n,i);if(o.length===0)return null;let s=o.length===1?i:void 0,l=[],c=new Set;a.forEach(m=>{let g=Dc(m[n]);c.has(g)||(c.add(g),l.push({key:g,label:Ex(t,n,m[n])}))});let u=l.map(m=>m.label),f=0,h;if(s){let m=[],g=new Set;a.forEach(b=>{let x=Dc(b[s]);g.has(x)||(g.add(x),m.push({key:x,label:Ex(t,s,b[s])}))});let v=m.slice(0,4);f=Math.max(0,m.length-v.length);let y=o[0];h=v.map(b=>{let x=new Map;return a.forEach(S=>{if(Dc(S[s])!==b.key)return;let w=Dc(S[n]);x.has(w)||x.set(w,jd(S[y]))}),{field:y,name:b.label,values:l.map(S=>x.get(S.key)??null),valueColumn:Ic(t,y)}})}else f=Math.max(0,o.length-4),h=o.slice(0,4).map(m=>({field:m,name:Qd(t,m),values:a.map(g=>jd(g[m])),valueColumn:Ic(t,m)}));if(h.length===0)return null;let d=Qd(t,n),p="Values";return s?p=Qd(t,o[0]):h.length===1&&(p=h[0].name),{type:r,title:t.title?.trim()||`${p} by ${d}`,xAxisTitle:d,yAxisTitle:p,categories:u,series:h,omittedSeriesCount:f,summary:fR(t,r,u,h,f)}},hR=t=>{if(t.presentation==="table"||t.presentation==="kpi")return[];let e=Jd(t);if(!e)return[];let r=[{type:"line",label:"Line"},{type:"bar",label:"Bar"}];return e.series.length>1&&r.push({type:"stacked_bar",label:"Stacked bar"}),r},dR=(t,{expanded:e=!1,reducedMotion:r=!1,theme:n=ka,zoomWindow:a=ki(t.categories.length)}={})=>{let i=t.series.length>1,o=t.type==="stacked_bar",s=t.categories.length>2,l=Yo(a,t.categories.length);return{animation:!r,animationDuration:r?0:260,aria:{enabled:!0,decal:{show:!0},label:{description:`${t.title}. ${t.summary}`}},backgroundColor:"transparent",color:n.colors,textStyle:{color:n.text,fontFamily:"inherit"},grid:{top:i?e?48:42:14,right:12,bottom:e?18:10,left:10,containLabel:!0},legend:{show:i,type:"scroll",top:0,left:"center",itemWidth:12,itemHeight:8,textStyle:{color:n.muted,fontSize:e?11:10}},tooltip:{trigger:"axis",triggerOn:"mousemove|click",confine:!0,backgroundColor:n.surface,borderColor:n.border,borderWidth:1,textStyle:{color:n.text,fontSize:12},axisPointer:{type:"line",lineStyle:{color:n.muted,opacity:.5}}},dataZoom:s?[{id:Lx,type:"inside",xAxisIndex:0,startValue:l.startIndex,endValue:l.endIndex,minValueSpan:1,filterMode:"filter",disabled:!0}]:void 0,xAxis:{type:"category",data:t.categories,name:t.xAxisTitle,nameLocation:"middle",nameGap:e?38:32,nameTextStyle:{color:n.muted,fontSize:e?11:10},axisLine:{lineStyle:{color:n.border}},axisTick:{show:!1},axisLabel:{color:n.muted,fontSize:e?11:9,hideOverlap:!0,interval:"auto",rotate:!e&&t.categories.length>5?28:0,formatter:c=>c.length>(e?18:11)?`${c.slice(0,e?16:9)}…`:c}},yAxis:{type:"value",name:t.yAxisTitle,nameLocation:"middle",nameGap:e?52:44,nameTextStyle:{color:n.muted,fontSize:e?11:10},axisLabel:{color:n.muted,fontSize:e?11:9,formatter:c=>qo(c,t.series[0]?.valueColumn,void 0,!0)},axisLine:{show:!1},axisTick:{show:!1},splitNumber:4,splitLine:{lineStyle:{color:n.border,opacity:.75}}},series:t.series.map(c=>({type:t.type==="line"?"line":"bar",name:c.name,data:c.values,stack:o?"total":void 0,connectNulls:!1,showSymbol:t.type==="line"&&t.categories.length<=18,symbol:"circle",symbolSize:e?7:6,smooth:!1,maxBarWidth:e?38:28,lineStyle:t.type==="line"?{width:e?3:2.5}:void 0,itemStyle:t.type==="line"?{borderColor:n.background,borderWidth:2}:{borderRadius:o?0:[4,4,0,0]},emphasis:{focus:"series"},tooltip:{valueFormatter:u=>qo(u,c.valueColumn)}}))}},pR=t=>{let e=getComputedStyle(t),r=(a,i)=>e.getPropertyValue(a).trim()||i,n=r("--cf-accent",ka.colors[0]);return{background:r("--cf-bg",ka.background),border:r("--cf-border",ka.border),muted:r("--cf-muted",ka.muted),surface:r("--cf-surface",ka.surface),text:r("--cf-text",ka.text),colors:[n,"#2563eb","#d97706","#7c3aed"]}},vR=({model:t,expanded:e=!1})=>{let r=W(null),n=W(null),[a,i]=V(()=>({model:t,window:ki(t.categories.length)})),[o,s]=V(!1),l=a.model===t?Yo(a.window,t.categories.length):ki(t.categories.length),c=W(l);c.current=l;let u=g=>{let v=Yo(g,t.categories.length);c.current=v,i({model:t,window:v}),n.current?.dispatchAction({type:"dataZoom",dataZoomId:Lx,startValue:v.startIndex,endValue:v.endIndex})};ie(()=>{let g=r.current;if(!(!g||typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("jsdom")))try{let v=nI(g,null,{renderer:"canvas",devicePixelRatio:Math.min(window.devicePixelRatio||1,2)});n.current=v;let y=()=>v.resize(),b=typeof ResizeObserver>"u"?null:new ResizeObserver(y);return b?.observe(g),b||window.addEventListener("resize",y,{passive:!0}),()=>{b?.disconnect(),b||window.removeEventListener("resize",y),v.dispose(),n.current=null}}catch{s(!0);return}},[]),ie(()=>{let g=r.current,v=n.current;if(!g||!v)return;let y=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;v.setOption(dR(t,{expanded:e,reducedMotion:y,theme:pR(g),zoomWindow:c.current}),{lazyUpdate:!0,notMerge:!0}),v.resize()},[e,t]);let f=!o&&t.categories.length>2,h=l.endIndex-l.startIndex+1,d=l.startIndex===0&&l.endIndex===t.categories.length-1,p=f&&h>2,m=f&&!d;return _(Ae,{children:[_("div",{ref:r,class:`cf-analytics-echart${e?" is-expanded":""}`,role:"img","aria-label":`${t.title}. ${t.summary}`,"data-chart-status":o?"fallback":"ready",children:o?_("span",{class:"cf-analytics-echart__fallback",children:t.summary}):null}),f?_("div",{class:"cf-analytics-zoom",children:[_("span",{class:"cf-analytics-zoom__range","aria-live":"polite","aria-atomic":"true",children:aR(t.categories,l)}),_("div",{class:"cf-analytics-zoom__controls",role:"group","aria-label":"Chart zoom controls",children:[_("button",{type:"button","aria-label":"Zoom out chart",title:"Zoom out",disabled:!m,onClick:()=>u(Rx(c.current,"out",t.categories.length)),children:"−"}),_("button",{type:"button",class:"cf-analytics-zoom__reset","aria-label":"Reset chart zoom",title:"Reset zoom",disabled:d,onClick:()=>u(ki(t.categories.length)),children:"Reset"}),_("button",{type:"button","aria-label":"Zoom in chart",title:"Zoom in",disabled:!p,onClick:()=>u(Rx(c.current,"in",t.categories.length)),children:"+"})]})]}):null]})},Ox=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},Nx=(t,e)=>(e?.length?e:Object.keys(t[0]??{})).map(r=>typeof r=="string"?{key:r,label:Ox(r)}:{...r,label:r.label?.trim()||Ox(r.key)}),Bx=(t,e,r)=>{if(t==null||t==="")return"—";if((r?.dataType==="date"||r?.dataType==="datetime")&&typeof t=="string"){let n=new Date(t);if(!Number.isNaN(n.getTime()))return new Intl.DateTimeFormat(e,{dateStyle:"medium",...r.dataType==="datetime"?{timeStyle:"short"}:{}}).format(n)}return r?.dataType==="currency"&&typeof t=="number"?new Intl.NumberFormat(e,{style:"currency",currency:r.currencyCode||"USD",maximumFractionDigits:2}).format(t):typeof t=="number"&&Number.isFinite(t)?new Intl.NumberFormat(e,{maximumFractionDigits:4}).format(t):typeof t=="boolean"?t?"Yes":"No":String(t)},zx=t=>{let e=String(t??"");return/[",\r\n]/.test(e)?`"${e.replaceAll('"','""')}"`:e},gR=(t,e)=>{let r=Nx(t,e);return[r.map(n=>zx(n.label)).join(","),...t.map(n=>r.map(a=>zx(n[a.key])).join(","))].join(`\r
|
|
23
|
-
`)},mR=({rows:t,columns:e,maxRows:r=100,locale:n,expanded:a=!1,classPrefix:i="cr",pageSize:o=10})=>{let s=Kt(()=>Nx(t,e),[e,t]),l=s.map(R=>R.key).join("\0"),[c,u]=V(()=>s.map(R=>R.key)),[f,h]=V(""),[d,p]=V(),[m,g]=V("asc"),[v,y]=V([]),[b,x]=V("table"),[S,w]=V(1),[k,T]=V(o);ie(()=>{u(s.map(R=>R.key)),p(void 0),y([]),w(1)},[l]);let C=s.filter(R=>c.includes(R.key)),A=Kt(()=>{let R=f.toLocaleLowerCase(n),z=t.map((F,X)=>({row:F,index:X})).filter(({row:F})=>C.some(X=>Bx(F[X.key],n,X).toLocaleLowerCase(n).includes(R)));return d?z.sort((F,X)=>{let te=F.row[d],fe=X.row[d],me=typeof te=="number"?te:NaN,we=typeof fe=="number"?fe:NaN,Ze=!Number.isNaN(me)&&!Number.isNaN(we)?me-we:String(te??"").localeCompare(String(fe??""),n,{numeric:!0,sensitivity:"base"});return m==="asc"?Ze:-Ze}):z},[C,n,f,t,m,d]),M=A.slice(0,Math.max(1,r)),I=Math.max(1,Math.ceil(M.length/k)),L=Math.min(S,I),P=a?M:M.slice((L-1)*k,L*k),N=P.length>0&&P.every(({index:R})=>v.includes(R)),O=R=>`${i}-${R}`;if(t.length===0||s.length===0)return _("div",{class:O("table-note"),children:"No rows returned."});let q=R=>{let z=new Set(P.map(({index:F})=>F));y(F=>R?[...new Set([...F,...z])]:F.filter(X=>!z.has(X)))};return _("section",{class:O("data-table"),children:[_("div",{class:O("table-fields"),children:[_("strong",{children:"Fields"}),_("div",{class:O("field-list"),children:s.map(R=>_("span",{class:O("field-chip"),children:R.label},R.key))}),_("span",{class:O("table-field-count"),children:[t.length.toLocaleString(n)," rows"]})]}),_("div",{class:O("table-controls"),children:[_("label",{class:O("table-search"),children:[_("span",{"aria-hidden":"true",children:"⌕"}),_("input",{type:"search",value:f,placeholder:"Search this result...","aria-label":"Search this result",onInput:R=>{h(R.currentTarget.value.trim()),w(1)}})]}),_("div",{class:O("table-modes"),role:"group","aria-label":"Table display mode",children:["table","matrix"].map(R=>_("button",{type:"button",class:`${O("segment")}${b===R?" is-active":""}`,"aria-pressed":b===R,onClick:()=>x(R),children:R==="table"?"Table":"Matrix"},R))})]}),_("div",{class:O("table-column-bar"),children:_("details",{class:O("column-picker"),children:[_("summary",{children:"Columns"}),_("div",{class:O("column-menu"),children:s.map(R=>_("label",{children:[_("input",{type:"checkbox",checked:c.includes(R.key),onChange:z=>{let F=z.currentTarget.checked;u(X=>F?[...new Set([...X,R.key])]:X.length>1?X.filter(te=>te!==R.key):X)}}),_("span",{children:R.label})]},R.key))})]})}),_("div",{class:O("table-wrap"),role:"region","aria-label":"Scrollable result table",tabIndex:0,children:_("table",{class:`${O("table")}${b==="matrix"?" is-matrix":""}`,children:[_("caption",{class:O("visually-hidden"),children:["Result table with ",A.length," ",A.length===1?"row":"rows"]}),_("thead",{children:_("tr",{children:[_("th",{class:O("select-cell"),children:_("input",{type:"checkbox","aria-label":"Select all visible rows",checked:N,onChange:R=>q(R.currentTarget.checked)})}),C.map(R=>_("th",{scope:"col",children:_("button",{type:"button",class:O("table-sort"),"aria-label":`Sort by ${R.label}`,onClick:()=>{d===R.key?g(z=>z==="asc"?"desc":"asc"):(p(R.key),g("asc")),w(1)},children:[_("span",{children:R.label}),_("span",{class:O("sort-direction"),"aria-hidden":"true",children:d===R.key?m==="asc"?"↑":"↓":"↕"})]})},R.key))]})}),_("tbody",{children:P.map(({row:R,index:z})=>_("tr",{class:v.includes(z)?"is-selected":void 0,children:[_("td",{class:O("select-cell"),children:_("input",{type:"checkbox","aria-label":`Select row ${z+1}`,checked:v.includes(z),onChange:F=>y(X=>F.currentTarget.checked?[...new Set([...X,z])]:X.filter(te=>te!==z))})}),C.map(F=>_("td",{children:Bx(R[F.key],n,F)},F.key))]},z))})]})}),_("div",{class:O("table-summary"),children:[_("span",{children:M.length?`${((L-1)*k+1).toLocaleString(n)}-${Math.min(L*k,M.length).toLocaleString(n)} of ${A.length.toLocaleString(n)}`:`0 of ${A.length.toLocaleString(n)}`}),a?_("span",{children:t.length>r?`First ${r.toLocaleString(n)} rows available`:"All returned rows loaded"}):_("div",{class:O("table-pagination"),"aria-label":"Table pagination",children:[_("label",{children:[_("span",{children:"Rows"}),_("select",{"aria-label":"Rows per page",value:k,onChange:R=>{T(Number(R.currentTarget.value)),w(1)},children:[10,25,50].map(R=>_("option",{value:R,children:R},R))})]}),_("button",{type:"button","aria-label":"Previous page",disabled:L<=1,onClick:()=>w(R=>Math.max(1,R-1)),children:"‹"}),_("span",{children:[L," / ",I]}),_("button",{type:"button","aria-label":"Next page",disabled:L>=I,onClick:()=>w(R=>Math.min(I,R+1)),children:"›"})]})]})]})},yR=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/ogg"],_R=()=>{if(typeof navigator>"u"||!navigator.mediaDevices?.getSupportedConstraints)return{};try{return navigator.mediaDevices.getSupportedConstraints()}catch{return{}}},Fx=(t="",e=_R())=>{const r={...t?{deviceId:{exact:t}}:{}};return e.echoCancellation&&(r.echoCancellation={ideal:!0}),e.noiseSuppression&&(r.noiseSuppression={ideal:!0}),e.autoGainControl&&(r.autoGainControl={ideal:!0}),e.channelCount&&(r.channelCount={ideal:1}),e.voiceIsolation&&(r.voiceIsolation={ideal:!0}),r},Hx=(t={})=>{const e=Math.max(2,t.calibrationSamples??6),r=Math.max(e,t.ambientWindowSamples??72),n=Math.min(.5,Math.max(0,t.ambientPercentile??.2)),a=Math.min(1,Math.max(.01,t.smoothing??.22)),i=Math.max(Number.EPSILON,t.minimumNoiseFloor??5e-4),o=Math.max(1.1,t.speechToNoiseRatio??2.7),s=Math.min(o,Math.max(1,t.quietToNoiseRatio??1.55)),l=Math.max(250,t.minimumEndSilenceMs??650),c=Math.max(l,t.maximumEndSilenceMs??1100);let u=[],f=i,h=f*o,d=0;return{observe:g=>{const v=Number.isFinite(g)?Math.max(0,g):0;if(u.length<e||v<=h){u.push(v),u.length>r&&u.shift();const T=[...u].sort((M,I)=>M-I),C=Math.min(T.length-1,Math.floor((T.length-1)*n)),A=Math.max(i,T[C]??i);f+=(A-f)*a}h=f*o;const b=f*s,x=u.length>=e,S=x&&v>=h;S&&(d=Math.max(d,v/Math.max(f,i)));const w=Math.min(1,Math.max(0,(d-o)/o)),k=Math.round(c-(c-l)*w);return{speech:S,quiet:x&&v<=b,calibrated:x,noiseFloor:f,speechThreshold:h,quietThreshold:b,endOfSpeechDelayMs:k}},reset:()=>{u=[],f=i,h=f*o,d=0}}},bR=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result??"").split(",")[1]??""),n.onerror=()=>r(n.error),n.readAsDataURL(t)}),ep=t=>{const e=globalThis.MediaRecorder;if(typeof e?.isTypeSupported=="function"){for(const r of yR)if(e.isTypeSupported(r))try{return new e(t,{mimeType:r})}catch{}}return new e(t)},Fr=t=>{if(!(!t||t.state!=="recording")){try{t.requestData()}catch{}t.stop()}},xR=[{name:"Smileys",emojis:["😀","😃","😄","😁","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😋","😛","😜","🤪","🤗","🤭","🤔","🤐","😐","😶","😏","🙄","😴","🥳","😎","🤓","🥺","😢","😭","😤","😠","🤯","😬","😱","🤩","🥱"]},{name:"Gestures",emojis:["👍","👎","👌","🤌","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","✋","🖐️","👋","🤝","🙏","💪","👏","🙌","👐","🤲","🫶"]},{name:"Hearts & symbols",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","💔","❣️","💕","💖","💘","💝","✨","⭐","🌟","💫","🔥","🎉","🎊","✅","❌","⚡","💯","🚀"]},{name:"Animals & nature",emojis:["🐶","🐱","🦊","🐻","🐼","🐨","🦁","🐮","🐸","🐵","🐧","🦄","🐝","🦋","🐢","🐬","🌷","🌸","🌹","🌻","🌳","🍀"]},{name:"Food & drink",emojis:["🍎","🍌","🍉","🍓","🍒","🥑","🍔","🍟","🍕","🌮","🍿","🍩","🍪","🎂","☕","🍵","🍺","🥂","🍷"]},{name:"Objects & travel",emojis:["🚀","✈️","🚗","🏠","📦","📱","💻","⌚","📷","💡","🔑","🎁","📌","✏️","📝","📞","📧","💰","📈","⏰","🔔","🎯","🏆","🎮","🎵","💬","👀"]}],tp={"contact-support":{title:"Contact support",submit:"Request support",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"subject",label:"Subject",kind:"text",required:!0},{key:"message",label:"Message",kind:"textarea",required:!0,placeholder:"What do you need help with?"}]},inquiry:{title:"Leave a message",submit:"Send message",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"message",label:"Message",kind:"textarea",required:!0,placeholder:"How can we help?"}]},contact:{title:"Share your details",submit:"Save",fields:[{key:"name",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"email",label:"Email",kind:"email",required:!0,identity:"email"},{key:"phone",label:"Phone",kind:"tel",required:!0,identity:"phone"}]},"book-demo":{title:"Book a demo",submit:"Request demo",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"preferredAt",label:"Preferred time",kind:"text",placeholder:"e.g. Thursday 3pm"},{key:"notes",label:"Notes",kind:"textarea",placeholder:"Anything we should know?"}]},"request-callback":{title:"Request a callback",submit:"Request callback",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorPhone",label:"Phone",kind:"tel",required:!0,identity:"phone"},{key:"bestTime",label:"Best time to call",kind:"text",placeholder:"e.g. tomorrow afternoon"},{key:"topic",label:"Topic",kind:"text",placeholder:"What should we call about?"}]},"subscribe-newsletter":{title:"Subscribe",submit:"Subscribe",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"}]}},rp={openChat:"Open chat",closeChat:"Close chat",closeHistory:"Close conversation history",unreadMessage:"1 unread message",unreadMessages:"{count} unread messages",muteSounds:"Mute sounds",unmuteSounds:"Unmute sounds",statusOnline:"Online · replies instantly",statusOffline:"Away · leave a message",liveSupport:"Live support",waitingForTeam:"Waiting for the team",assistantName:"Assistant",chatName:"Chat",welcomeLabel:"{name} welcome",welcomeEyebrow:"Ready when you are",welcomePrompt:"Ask a question, leave a message, or book a demo.",agentTyping:"{name} is typing…",expandedAnalyticsResult:"Expanded analytics result",privacyAndData:"Privacy and local data",muteMicrophone:"Mute microphone",unmuteMicrophone:"Unmute microphone",chooseMicrophone:"Choose microphone",defaultMicrophone:"Default microphone",microphone:"Microphone",talkNow:"Talk now",expandView:"Expand view",exitExpandedView:"Exit expanded view",minimizeVoiceChat:"Minimize voice chat",endVoiceChat:"End voice chat",restoreVoiceChat:"Restore voice chat",reopenVoiceChat:"Reopen voice chat with {name}",voiceConnecting:"Connecting…",voiceListening:"Listening…",voiceProcessing:"Thinking…",voiceSpeaking:"Speaking…",voiceNoise:"Background noise detected",voiceMisunderstood:"I could not understand that audio",voiceDenied:"Microphone access is unavailable",composerPlaceholder:"Type your message…",send:"Send message",emoji:"Emoji",gifs:"GIFs",attachFile:"Attach a file",recordVoice:"Record a voice message",stopRecording:"Stop recording",actionTestMode:"Test mode",stop:"Stop",copy:"Copy",copied:"Copied",retry:"Retry",clearChat:"Clear conversation",clearChatConfirm:"Clear this conversation?",clearChatConfirmBody:"This clears the messages on this device and starts a fresh chat.",clearConfirmCta:"Clear chat",endChat:"End conversation",endChatConfirm:"End this conversation?",endChatConfirmBody:"You won't be able to send more messages in this chat, but you can start a new one anytime.",endConfirmCta:"End conversation",conversationEnded:"This conversation has ended.",startNewChat:"Start a new conversation",pastConversations:"Past conversations",viewingPast:"Viewing a past conversation (read-only)",backToChat:"Back to current chat",historyEnded:"ended",feedbackHelpful:"Helpful",feedbackNotHelpful:"Not helpful",feedbackThanks:"Thanks for the feedback",csatPrompt:"How was this chat?",feedbackCommentPlaceholder:"What went wrong? (optional)",feedbackSend:"Send",cancel:"Cancel",newMessages:"New messages",poweredBy:"Powered by",searchGifs:"Search GIFs…",searchingGifs:"Searching…",noGifs:"No GIFs found",assistantTyping:"Assistant is typing",emptyReply:"Sorry, I couldn't generate a reply.",errorGeneric:"Something went wrong reaching the assistant. Please try again.",errorRateLimit:"You’re sending messages a little fast — give it a second and try again.",attaching:"Reading file…",attachTooLarge:"That file is too large (max 8 MB).",attachFailed:"Couldn’t read that file — try another.",removeAttachment:"Remove attachment",dropFileHere:"Drop the file here",clearDeviceData:"Clear conversations from this device",clearDeviceDataBody:"This removes locally stored conversations and visitor details from this browser. It cannot be undone.",clearDeviceDataCta:"Clear this device",handoffTitle:"Want our team to follow up?",handoffName:"Name (optional)",handoffEmail:"Your email",handoffNotify:"Notify the team",sending:"Sending…",handoffShared:"I’ve shared this with our team — they’ll get back to you at {email}.",formThanks:"Thanks! We’ll be in touch.",formError:"Something went wrong — please try again.",actionContactOptions:"Contact options",actionGetInTouch:"Get in touch",actionMore:"+{count} more",actionNeedHelp:"Need help?",actionChoose:"Choose what you want to do",actionFooter:"We’ll ask for your full name and the best email or phone so the team can reach you.",actionCategorySupport:"Support",actionCategorySales:"Talk to sales",actionCategoryMarketing:"Stay in touch",actionClose:"Close",actionAs:"as {identity}",bookingPickTime:"What time works best?",bookingPickDay:"Pick a day",bookingPickTimeLabel:"Pick a time",bookingDuration:"{count}-minute demo",bookingTimezone:"Times shown in {timezone}",bookingSchedulerFallback:"the scheduler",bookingCheckingAvailability:"Checking calendar availability…",bookingNoSlots:"No available times were found in this booking window.",bookingAvailabilityUnavailable:"Calendar availability is temporarily unavailable. Please try again shortly.",bookingEarlierToday:"Earlier today",bookingCalendarBusy:"Busy on the calendar",bookingAlreadyBooked:"Already booked",bookingNotOffered:"Not offered by the calendar",bookingRequested:"Requested for {when} — we’ll confirm by email.",bookingConfirmed:"You’re booked for {when}! A calendar invite is on its way. 📅",bookingSlotTaken:"That time was just taken — please pick another.",bookingViaProvider:"Pick a time that works for you on {provider}.",bookingOpenScheduler:"Open the scheduler",bookingLinkOpened:"Opening the scheduler — pick a time that suits you. 📅",bookingMeetingLink:"Meeting link",previewReply:"👋 This is a preview — replies here are samples. Publish the widget on your site to chat with the live AI.",previewActionNote:"Preview — nothing was actually sent. This works for real once you publish.",previewBanner:"Preview — sample replies, no AI"},qt=(t,e)=>t.replace(/\{(\w+)\}/g,(r,n)=>e[n]??""),wR=t=>t?{...rp,...t}:rp,Vx=j1(rp),SR=Vx.Provider,_r=()=>fw(Vx),Xe=(t,e)=>_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",...e,children:t}),kR=t=>_("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...t,children:_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 3.25h14A3.75 3.75 0 0 1 22.75 7v6A3.75 3.75 0 0 1 19 16.75h-7.19l-4.26 3.84A.75.75 0 0 1 6.25 20v-3.32A3.75 3.75 0 0 1 2.25 13V7A3.75 3.75 0 0 1 6 3.25Zm3 7.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"})}),Ti=t=>Xe(_("path",{d:"m6 9 6 6 6-6"}),t),TR=t=>Xe(_(Ae,{children:[_("path",{d:"m22 2-7 20-4-9-9-4Z"}),_("path",{d:"M22 2 11 13"})]}),t),Xo=t=>Xe(_(Ae,{children:[_("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),_("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),_("line",{x1:"12",y1:"19",x2:"12",y2:"22"})]}),t),CR=t=>Xe(_(Ae,{children:[_("path",{d:"M9 9v1a3 3 0 0 0 4.24 2.73"}),_("path",{d:"M15 5.5V5a3 3 0 0 0-5.94-.6"}),_("path",{d:"M19 10v2a7 7 0 0 1-9.9 6.36"}),_("path",{d:"M5 10v2a6.98 6.98 0 0 0 1.11 3.79"}),_("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),_("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]}),t),Lc=t=>Xe(_(Ae,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M10 14 21 3"}),_("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]}),t),MR=t=>Xe(_(Ae,{children:[_("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),_("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),_("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),_("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),t),Pc=t=>Xe(_(Ae,{children:[_("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),_("path",{d:"m22 7-10 5L2 7"})]}),t),AR=t=>Xe(_("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92Z"}),t),DR=t=>Xe(_(Ae,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M8.5 14.5a4 4 0 0 0 7 0"}),_("line",{x1:"9",y1:"9.5",x2:"9.01",y2:"9.5"}),_("line",{x1:"15",y1:"9.5",x2:"15.01",y2:"9.5"})]}),t),Ta=t=>Xe(_(Ae,{children:[_("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),t),IR=t=>Xe(_(Ae,{children:[_("path",{d:"M11 5 6 9H2v6h4l5 4z"}),_("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),_("path",{d:"M19 5a9 9 0 0 1 0 14"})]}),t),LR=t=>Xe(_(Ae,{children:[_("path",{d:"M11 5 6 9H2v6h4l5 4z"}),_("line",{x1:"22",y1:"9",x2:"16",y2:"15"}),_("line",{x1:"16",y1:"9",x2:"22",y2:"15"})]}),t),Ca=t=>Xe(_("path",{d:"M20 6 9 17l-5-5"}),t),PR=t=>Xe(_(Ae,{children:[_("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),_("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),t),RR=t=>Xe(_(Ae,{children:[_("path",{d:"M1 4v6h6"}),_("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),t),ER=t=>Xe(_("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"}),t),np=t=>Xe(_("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"}),t),ap=t=>Xe(_(Ae,{children:[_("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),_("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),t),OR=t=>Xe(_(Ae,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M12 7v5l3 2"})]}),t),Gx=t=>Xe(_(Ae,{children:[_("path",{d:"M7 10v12"}),_("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"})]}),t),$x=t=>Xe(_(Ae,{children:[_("path",{d:"M17 14V2"}),_("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"})]}),t),ip=t=>Xe(_(Ae,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M9 21H3v-6"}),_("path",{d:"M21 3l-7 7"}),_("path",{d:"M3 21l7-7"})]}),t),NR=t=>Xe(_(Ae,{children:[_("path",{d:"M9 3v6H3"}),_("path",{d:"M15 21v-6h6"}),_("path",{d:"M9 9 2 2"}),_("path",{d:"M15 15l7 7"})]}),t),BR=t=>Xe(_(Ae,{children:[_("rect",{x:"3",y:"4",width:"18",height:"14",rx:"2"}),_("rect",{x:"11",y:"11",width:"8",height:"6",rx:"1",fill:"currentColor",stroke:"none"})]}),t),zR=t=>Xe(_(Ae,{children:[_("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"}),_("path",{d:"M12 15V9"}),_("path",{d:"m8.5 12.5 3.5-3.5 3.5 3.5"})]}),t),FR=t=>Xe(_(Ae,{children:[_("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_("path",{d:"m19 12-7 7-7-7"})]}),t),Wx=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s)]+)/g,HR=t=>t.replace(/([^\n])\s+((?:[-*•]|\d+\.)\s+)(?=(?:\*\*[^*\n]{1,80}\*\*|[A-Z][A-Za-z0-9/& -]{1,50}:))/g,`$1
|
|
24
|
-
$2`),
|
|
20
|
+
`:"<br/>",v=f.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,c)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,c):this._showTooltipContent(s,v,c,Math.random()+"",o[0],o[1],d,null,h)})},e.prototype._showSeriesItemTooltip=function(r,n,a){var i=this._ecModel,o=We(n),s=o.seriesIndex,l=i.getSeriesByIndex(s),c=o.dataModel||l,u=o.dataIndex,f=o.dataType,h=c.getData(f),d=this._renderMode,p=r.positionDefault,m=ss([h.getItemModel(u),c,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=m.get("trigger");if(!(g!=null&&g!=="item")){var v=c.getDataParams(u,f),y=new Od;v.marker=y.makeTooltipMarker("item",Oa(v.color),d);var b=Iy(c.formatTooltip(u,!1,f)),x=m.get("order"),w=m.get("valueFormatter"),S=b.frag,k=S?zy(w?q({valueFormatter:w},S):S,y,d,x,i.get("useUTC"),m.get("textStyle")):b.text,C="item_"+c.name+"_"+u;this._showOrMove(m,function(){this._showTooltipContent(m,k,v,C,r.offsetX,r.offsetY,r.position,r.target,y)}),a({type:"showTip",dataIndexInside:u,dataIndex:h.getRawIndex(u),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,a){var i=this._renderMode==="html",o=We(n),s=o.tooltipConfig,l=s.option||{},c=l.encodeHTMLContent;if(ae(l)){var u=l;l={content:u,formatter:u},c=!0}c&&i&&l.content&&(l=Ie(l),l.content=Zt(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=r.positionDefault,p=ss(f,this._tooltipModel,d?{position:d}:null),m=p.get("content"),g=Math.random()+"",v=new Od;this._showOrMove(p,function(){var y=Ie(p.get("formatterParams")||{});this._showTooltipContent(p,m,y,g,r.offsetX,r.offsetY,r.position,n,v)}),a({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,n,a,i,o,s,l,c,u){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var f=this._tooltipContent;f.setEnterable(r.get("enterable"));var h=r.get("formatter");l=l||r.get("position");var d=n,p=this._getNearestPoint([o,s],a,r.get("trigger"),r.get("borderColor")),m=p.color;if(h)if(ae(h)){var g=r.ecModel.get("useUTC"),v=ee(a)?a[0]:a,y=v&&v.axisType&&v.axisType.indexOf("time")>=0;d=h,y&&(d=oc(v.axisValue,d,g)),d=Cy(d,a,!0)}else if(ke(h)){var b=Ne(function(x,w){x===this._ticket&&(f.setContent(w,u,r,m,l),this._updatePosition(r,l,o,s,f,a,c))},this);this._ticket=i,d=h(a,i,b)}else d=h;f.setContent(d,u,r,m,l),f.show(r,m),this._updatePosition(r,l,o,s,f,a,c)}},e.prototype._getNearestPoint=function(r,n,a,i){if(a==="axis"||ee(n))return{color:i||(this._renderMode==="html"?"#fff":"none")};if(!ee(n))return{color:i||n.color||n.borderColor}},e.prototype._updatePosition=function(r,n,a,i,o,s,l){var c=this._api.getWidth(),u=this._api.getHeight();n=n||r.get("position");var f=o.getSize(),h=r.get("align"),d=r.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),ke(n)&&(n=n([a,i],s,o.el,p,{viewSize:[c,u],contentSize:f.slice()})),ee(n))a=Nt(n[0],c),i=Nt(n[1],u);else if(de(n)){var m=n;m.width=f[0],m.height=f[1];var g=pc(m,{width:c,height:u});a=g.x,i=g.y,h=null,d=null}else if(ae(n)&&l){var v=RP(n,p,f,r.get("borderWidth"));a=v[0],i=v[1]}else{var v=LP(a,i,o,c,u,h?null:20,d?null:20);a=v[0],i=v[1]}if(h&&(a-=Mx(h)?f[0]/2:h==="right"?f[0]:0),d&&(i-=Mx(d)?f[1]/2:d==="bottom"?f[1]:0),mx(r)){var v=PP(a,i,o,c,u);a=v[0],i=v[1]}o.moveTo(a,i)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var a=this._lastDataByCoordSys,i=this._cbParamsList,o=!!a&&a.length===r.length;return o&&I(a,function(s,l){var c=s.dataByAxis||[],u=r[l]||{},f=u.dataByAxis||[];o=o&&c.length===f.length,o&&I(c,function(h,d){var p=f[d]||{},m=h.seriesDataIndices||[],g=p.seriesDataIndices||[];o=o&&h.value===p.value&&h.axisType===p.axisType&&h.axisId===p.axisId&&m.length===g.length,o&&I(m,function(v,y){var b=g[y];o=o&&v.seriesIndex===b.seriesIndex&&v.dataIndex===b.dataIndex}),i&&I(h.seriesDataIndices,function(v){var y=v.seriesIndex,b=n[y],x=i[y];b&&x&&x.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){_e.node||!n.getDom()||(Zd(this,"_updatePosition"),this._tooltipContent.dispose(),np("itemTooltip",n))},e.type="tooltip",e})(Nr);function ss(t,e,r){var n=e.ecModel,a;r?(a=new lt(r,n,n),a=new lt(e.option,a,n)):a=e;for(var i=t.length-1;i>=0;i--){var o=t[i];o&&(o instanceof lt&&(o=o.get("tooltip",!0)),ae(o)&&(o={formatter:o}),o&&(a=new lt(o,a,n)))}return a}function Cx(t,e){return t.dispatchAction||Ne(e.dispatchAction,e)}function LP(t,e,r,n,a,i,o){var s=r.getSize(),l=s[0],c=s[1];return i!=null&&(t+l+i+2>n?t-=l+i:t+=i),o!=null&&(e+c+o>a?e-=c+o:e+=o),[t,e]}function PP(t,e,r,n,a){var i=r.getSize(),o=i[0],s=i[1];return t=Math.min(t+o,n)-o,e=Math.min(e+s,a)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function RP(t,e,r,n){var a=r[0],i=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,c=e.width,u=e.height;switch(t){case"inside":s=e.x+c/2-a/2,l=e.y+u/2-i/2;break;case"top":s=e.x+c/2-a/2,l=e.y-i-o;break;case"bottom":s=e.x+c/2-a/2,l=e.y+u+o;break;case"left":s=e.x-a-o,l=e.y+u/2-i/2;break;case"right":s=e.x+c+o,l=e.y+u/2-i/2}return[s,l]}function Mx(t){return t==="center"||t==="middle"}function EP(t,e,r){var n=Lf(t).queryOptionMap,a=n.keys()[0];if(!(!a||a==="series")){var i=ko(e,a,n.get(a),{useDefault:!1,enableAll:!1,enableNone:!1}),o=i.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(c){var u=We(c).tooltipConfig;if(u&&u.name===t.name)return l=c,!0}),l)return{componentMainType:a,componentIndex:o.componentIndex,el:l}}}}function OP(t){Zn(fx),t.registerComponentModel(mP),t.registerComponentView(IP),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Et),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Et)}var NP=function(t,e){if(e==="all")return{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}},op=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a),r.selected=r.selected||{},this._updateSelector(r)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),this._updateSelector(r)},e.prototype._updateSelector=function(r){var n=r.selector,a=this.ecModel;n===!0&&(n=r.selector=["all","inverse"]),ee(n)&&I(n,function(i,o){ae(i)&&(i={type:i}),n[o]=Oe(i,NP(a,i.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var n=!1,a=0;a<r.length;a++){var i=r[a].get("name");if(this.isSelected(i)){this.select(i),n=!0;break}}!n&&this.select(r[0].get("name"))}},e.prototype._updateData=function(r){var n=[],a=[];r.eachRawSeries(function(l){var c=l.name;a.push(c);var u;if(l.legendVisualProvider){var f=l.legendVisualProvider,h=f.getAllNames();r.isSeriesFiltered(l)||(a=a.concat(h)),h.length?n=n.concat(h):u=!0}else u=!0;u&&Df(l)&&n.push(l.name)}),this._availableNames=a;var i=this.get("data")||n,o=me(),s=he(i,function(l){return(ae(l)||et(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new lt(l,this,this.ecModel))},this);this._data=bt(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(r){var n=this.option.selected,a=this.get("selectedMode");if(a==="single"){var i=this._data;I(i,function(o){n[o.get("name")]=!1})}n[r]=!0},e.prototype.unSelect=function(r){this.get("selectedMode")!=="single"&&(this.option.selected[r]=!1)},e.prototype.toggleSelected=function(r){var n=this.option.selected;n.hasOwnProperty(r)||(n[r]=!0),this[n[r]?"unSelect":"select"](r)},e.prototype.allSelect=function(){var r=this._data,n=this.option.selected;I(r,function(a){n[a.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var r=this._data,n=this.option.selected;I(r,function(a){var i=a.get("name",!0);n.hasOwnProperty(i)||(n[i]=!0),n[i]=!n[i]})},e.prototype.isSelected=function(r){var n=this.option.selected;return!(n.hasOwnProperty(r)&&!n[r])&&Ue(this._availableNames,r)>=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e})(Ye),Gi=dt,sp=I,Zc=St,Ax=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new Zc),this.group.add(this._selectorGroup=new Zc),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,n,a){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),c=r.get("selectorPosition",!0);l&&(!c||c==="auto")&&(c=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,a,l,s,c);var u=r.getBoxLayoutParams(),f={width:a.getWidth(),height:a.getHeight()},h=r.get("padding"),d=pc(u,f,h),p=this.layoutInner(r,o,d,i,l,c),m=pc(He({width:p.width,height:p.height},u),f,h);this.group.x=m.x-p.x,this.group.y=m.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=gP(p,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,n,a,i,o,s,l){var c=this.getContentGroup(),u=me(),f=n.get("selectedMode"),h=[];a.eachRawSeries(function(d){!d.get("legendHoverLink")&&h.push(d.id)}),sp(n.getData(),function(d,p){var m=d.get("name");if(!this.newlineDisabled&&(m===""||m===`
|
|
21
|
+
`)){var g=new Zc;g.newline=!0,c.add(g);return}var v=a.getSeriesByName(m)[0];if(!u.get(m))if(v){var y=v.getData(),b=y.getVisual("legendLineStyle")||{},x=y.getVisual("legendIcon"),w=y.getVisual("style"),S=this._createItem(v,m,p,d,n,r,b,w,x,f,i);S.on("click",Gi(Dx,m,null,i,h)).on("mouseover",Gi(lp,v.name,null,i,h)).on("mouseout",Gi(cp,v.name,null,i,h)),a.ssr&&S.eachChild(function(k){var C=We(k);C.seriesIndex=v.seriesIndex,C.dataIndex=p,C.ssrType="legend"}),u.set(m,!0)}else a.eachRawSeries(function(k){if(!u.get(m)&&k.legendVisualProvider){var C=k.legendVisualProvider;if(!C.containName(m))return;var A=C.indexOfName(m),M=C.getItemVisual(A,"style"),T=C.getItemVisual(A,"legendIcon"),D=hn(M.fill);D&&D[3]===0&&(D[3]=.2,M=q(q({},M),{fill:ll(D,"rgba")}));var L=this._createItem(k,m,p,d,n,r,{},M,T,f,i);L.on("click",Gi(Dx,null,m,i,h)).on("mouseover",Gi(lp,null,m,i,h)).on("mouseout",Gi(cp,null,m,i,h)),a.ssr&&L.eachChild(function(R){var O=We(R);O.seriesIndex=k.seriesIndex,O.dataIndex=p,O.ssrType="legend"}),u.set(m,!0)}},this)},this),o&&this._createSelector(o,n,i,s,l)},e.prototype._createSelector=function(r,n,a,i,o){var s=this.getSelectorGroup();sp(r,function(c){var u=c.type,f=new $t({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){a.dispatchAction({type:u==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(f);var h=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);Xl(f,{normal:h,emphasis:d},{defaultText:c.title}),Ff(f)})},e.prototype._createItem=function(r,n,a,i,o,s,l,c,u,f,h){var d=r.visualDrawType,p=o.get("itemWidth"),m=o.get("itemHeight"),g=o.isSelected(n),v=i.get("symbolRotate"),y=i.get("symbolKeepAspect"),b=i.get("icon");u=b||u||"roundRect";var x=BP(u,i,l,c,d,g,h),w=new Zc,S=i.getModel("textStyle");if(ke(r.getLegendIcon)&&(!b||b==="inherit"))w.add(r.getLegendIcon({itemWidth:p,itemHeight:m,icon:u,iconRotate:v,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}));else{var k=b==="inherit"&&r.getData().getVisual("symbol")?v==="inherit"?r.getData().getVisual("symbolRotate"):v:0;w.add(zP({itemWidth:p,itemHeight:m,icon:u,iconRotate:k,itemStyle:x.itemStyle,symbolKeepAspect:y}))}var C=s==="left"?p+5:-5,A=s,M=o.get("formatter"),T=n;ae(M)&&M?T=M.replace("{name}",n??""):ke(M)&&(T=M(n));var D=g?S.getTextColor():i.get("inactiveColor");w.add(new $t({style:wi(S,{text:T,x:C,y:m/2,fill:D,align:A,verticalAlign:"middle"},{inheritColor:D})}));var L=new _t({shape:w.getBoundingRect(),style:{fill:"transparent"}}),R=i.getModel("tooltip");return R.get("show")&&Wl({el:L,componentModel:o,itemName:n,itemTooltipOption:R.option}),w.add(L),w.eachChild(function(O){O.silent=!0}),L.silent=!f,this.getContentGroup().add(w),Ff(w),w.__legendDataIndex=a,w},e.prototype.layoutInner=function(r,n,a,i,o,s){var l=this.getContentGroup(),c=this.getSelectorGroup();Ho(r.get("orient"),l,r.get("itemGap"),a.width,a.height);var u=l.getBoundingRect(),f=[-u.x,-u.y];if(c.markRedraw(),l.markRedraw(),o){Ho("horizontal",c,r.get("selectorItemGap",!0));var h=c.getBoundingRect(),d=[-h.x,-h.y],p=r.get("selectorButtonGap",!0),m=r.getOrient().index,g=m===0?"width":"height",v=m===0?"height":"width",y=m===0?"y":"x";s==="end"?d[m]+=u[g]+p:f[m]+=h[g]+p,d[1-m]+=u[v]/2-h[v]/2,c.x=d[0],c.y=d[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[g]=u[g]+p+h[g],b[v]=Math.max(u[v],h[v]),b[y]=Math.min(0,h[y]+d[1-m]),b}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e})(Nr);function BP(t,e,r,n,a,i,o){function s(g,v){g.lineWidth==="auto"&&(g.lineWidth=v.lineWidth>0?2:0),sp(g,function(y,b){g[b]==="inherit"&&(g[b]=v[b])})}var l=e.getModel("itemStyle"),c=l.getItemStyle(),u=t.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");c.decal=!f||f==="inherit"?n.decal:_h(f,o),c.fill==="inherit"&&(c.fill=n[a]),c.stroke==="inherit"&&(c.stroke=n[u]),c.opacity==="inherit"&&(c.opacity=(a==="fill"?n:r).opacity),s(c,n);var h=e.getModel("lineStyle"),d=h.getLineStyle();if(s(d,r),c.fill==="auto"&&(c.fill=n.fill),c.stroke==="auto"&&(c.stroke=n.fill),d.stroke==="auto"&&(d.stroke=n.fill),!i){var p=e.get("inactiveBorderWidth"),m=c[u];c.lineWidth=p==="auto"?n.lineWidth>0&&m?2:0:c.lineWidth,c.fill=e.get("inactiveColor"),c.stroke=e.get("inactiveBorderColor"),d.stroke=h.get("inactiveColor"),d.lineWidth=h.get("inactiveWidth")}return{itemStyle:c,lineStyle:d}}function zP(t){var e=t.icon||"roundRect",r=Ri(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return r.setStyle(t.itemStyle),r.rotation=(t.iconRotate||0)*Math.PI/180,r.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill="#fff",r.style.lineWidth=2),r}function Dx(t,e,r,n){cp(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),lp(t,e,r,n)}function Ix(t){for(var e=t.getZr().storage.getDisplayList(),r,n=0,a=e.length;n<a&&!(r=e[n].states.emphasis);)n++;return r&&r.hoverLayer}function lp(t,e,r,n){Ix(r)||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function cp(t,e,r,n){Ix(r)||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function FP(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var n=0;n<e.length;n++)if(!e[n].isSelected(r.name))return!1;return!0})}function ls(t,e,r){var n=t==="allSelect"||t==="inverseSelect",a={},i=[];r.eachComponent({mainType:"legend",query:e},function(s){n?s[t]():s[t](e.name),Lx(s,a),i.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){I(a,function(l,c){s[l?"select":"unSelect"](c)}),Lx(s,o)}),n?{selected:o,legendIndex:i}:{name:e.name,selected:o}}function Lx(t,e){var r=e||{};return I(t.getData(),function(n){var a=n.get("name");if(!(a===`
|
|
22
|
+
`||a==="")){var i=t.isSelected(a);la(r,a)?r[a]=r[a]&&i:r[a]=i}}),r}function HP(t){t.registerAction("legendToggleSelect","legendselectchanged",dt(ls,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",dt(ls,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",dt(ls,"inverseSelect")),t.registerAction("legendSelect","legendselected",dt(ls,"select")),t.registerAction("legendUnSelect","legendunselected",dt(ls,"unSelect"))}function Px(t){t.registerComponentModel(op),t.registerComponentView(Ax),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,FP),t.registerSubTypeDefaulter("legend",function(){return"plain"}),HP(t)}var VP=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.setScrollDataIndex=function(r){this.option.scrollDataIndex=r},e.prototype.init=function(r,n,a){var i=vc(r);t.prototype.init.call(this,r,n,a),Rx(this,r,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),Rx(this,this.option,r)},e.type="legend.scroll",e.defaultOption=yd(op.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e})(op);function Rx(t,e,r){var n=t.getOrient(),a=[1,1];a[n.index]=0,Pi(e,r,{type:"box",ignoreSize:!!a})}var Ex=St,up=["width","height"],fp=["x","y"],UP=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!0,r._currentIndex=0,r}return e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new Ex),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Ex)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(r,n,a,i,o,s,l){var c=this;t.prototype.renderInner.call(this,r,n,a,i,o,s,l);var u=this._controllerGroup,f=n.get("pageIconSize",!0),h=ee(f)?f:[f,f];p("pagePrev",0);var d=n.getModel("pageTextStyle");u.add(new $t({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1);function p(m,g){var v=m+"DataIndex",y=rd(n.get("pageIcons",!0)[n.getOrient().name][g],{onclick:Ne(c._pageGo,c,v,n,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});y.name=m,u.add(y)}},e.prototype.layoutInner=function(r,n,a,i,o,s){var l=this.getSelectorGroup(),c=r.getOrient().index,u=up[c],f=fp[c],h=up[1-c],d=fp[1-c];o&&Ho("horizontal",l,r.get("selectorItemGap",!0));var p=r.get("selectorButtonGap",!0),m=l.getBoundingRect(),g=[-m.x,-m.y],v=Ie(a);o&&(v[u]=a[u]-m[u]-p);var y=this._layoutContentAndController(r,i,v,c,u,h,d,f);if(o){if(s==="end")g[c]+=y[u]+p;else{var b=m[u]+p;g[c]-=b,y[f]-=b}y[u]+=m[u]+p,g[1-c]+=y[d]+y[h]/2-m[h]/2,y[h]=Math.max(y[h],m[h]),y[d]=Math.min(y[d],m[d]+g[1-c]),l.x=g[0],l.y=g[1],l.markRedraw()}return y},e.prototype._layoutContentAndController=function(r,n,a,i,o,s,l,c){var u=this.getContentGroup(),f=this._containerGroup,h=this._controllerGroup;Ho(r.get("orient"),u,r.get("itemGap"),i?a.width:null,i?null:a.height),Ho("horizontal",h,r.get("pageButtonItemGap",!0));var d=u.getBoundingRect(),p=h.getBoundingRect(),m=this._showController=d[o]>a[o],g=[-d.x,-d.y];n||(g[i]=u[c]);var v=[0,0],y=[-p.x,-p.y],b=Pe(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var x=r.get("pageButtonPosition",!0);x==="end"?y[i]+=a[o]-p[o]:v[i]+=p[o]+b}y[1-i]+=d[s]/2-p[s]/2,u.setPosition(g),f.setPosition(v),h.setPosition(y);var w={x:0,y:0};if(w[o]=m?a[o]:d[o],w[s]=Math.max(d[s],p[s]),w[l]=Math.min(0,p[l]+y[1-i]),f.__rectSize=a[o],m){var S={x:0,y:0};S[o]=Math.max(a[o]-p[o]-b,0),S[s]=w[s],f.setClipPath(new _t({shape:S})),f.__rectSize=S[o]}else h.eachChild(function(C){C.attr({invisible:!0,silent:!0})});var k=this._getPageInfo(r);return k.pageIndex!=null&&or(u,{x:k.contentPosition[0],y:k.contentPosition[1]},m?r:null),this._updatePageInfoView(r,k),w},e.prototype._pageGo=function(r,n,a){var i=this._getPageInfo(n)[r];i!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:n.id})},e.prototype._updatePageInfoView=function(r,n){var a=this._controllerGroup;I(["pagePrev","pageNext"],function(u){var f=u+"DataIndex",h=n[f]!=null,d=a.childOfName(u);d&&(d.setStyle("fill",h?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=h?"pointer":"default")});var i=a.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,c=n.pageCount;i&&o&&i.setStyle("text",ae(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",c==null?"":c+""):o({current:l,total:c}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),a=this.getContentGroup(),i=this._containerGroup.__rectSize,o=r.getOrient().index,s=up[o],l=fp[o],c=this._findTargetItemIndex(n),u=a.children(),f=u[c],h=u.length,d=h?1:0,p={contentPosition:[a.x,a.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return p;var m=x(f);p.contentPosition[o]=-m.s;for(var g=c+1,v=m,y=m,b=null;g<=h;++g)b=x(u[g]),(!b&&y.e>v.s+i||b&&!w(b,v.s))&&(y.i>v.i?v=y:v=b,v&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=v.i),++p.pageCount)),y=b;for(var g=c-1,v=m,y=m,b=null;g>=-1;--g)b=x(u[g]),(!b||!w(y,b.s))&&v.i<y.i&&(y=v,p.pagePrevDataIndex==null&&(p.pagePrevDataIndex=v.i),++p.pageCount,++p.pageIndex),v=b;return p;function x(S){if(S){var k=S.getBoundingRect(),C=k[l]+S[l];return{s:C,e:C+k[s],i:S.__legendDataIndex}}}function w(S,k){return S.e>=k&&S.s<=k+i}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,a=this.getContentGroup(),i;return a.eachChild(function(o,s){var l=o.__legendDataIndex;i==null&&l!=null&&(i=s),l===r&&(n=s)}),n??i},e.type="legend.scroll",e})(Ax);function GP(t){t.registerAction("legendScroll","legendscroll",function(e,r){var n=e.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(a){a.setScrollDataIndex(n)})})}function $P(t){Zn(Px),t.registerComponentModel(VP),t.registerComponentView(UP),GP(t)}function WP(t){Zn(Px),Zn($P)}var qP=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=yd(hx.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e})(hx),dp=ht();function YP(t,e,r){dp(t).coordSysRecordMap.each(function(n){var a=n.dataZoomInfoMap.get(e.uid);a&&(a.getRange=r)})}function XP(t,e){for(var r=dp(t).coordSysRecordMap,n=r.keys(),a=0;a<n.length;a++){var i=n[a],o=r.get(i),s=o.dataZoomInfoMap;if(s){var l=e.uid,c=s.get(l);c&&(s.removeKey(l),s.keys().length||Ox(r,o))}}}function Ox(t,e){if(e){t.removeKey(e.model.uid);var r=e.controller;r&&r.dispose()}}function ZP(t,e){var r={model:e,containsPoint:dt(jP,e),dispatchAction:dt(KP,t),dataZoomInfoMap:null,controller:null},n=r.controller=new EL(t.getZr());return I(["pan","zoom","scrollMove"],function(a){n.on(a,function(i){var o=[];r.dataZoomInfoMap.each(function(s){if(i.isAvailableBehavior(s.model.option)){var l=(s.getRange||{})[a],c=l&&l(s.dzReferCoordSysInfo,r.model.mainType,r.controller,i);!s.model.get("disabled",!0)&&c&&o.push({dataZoomId:s.model.id,start:c[0],end:c[1]})}}),o.length&&r.dispatchAction(o)})}),r}function KP(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function jP(t,e,r,n){return t.coordinateSystem.containPoint([r,n])}function JP(t){var e,r="type_",n={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return t.each(function(i){var o=i.model,s=o.get("disabled",!0)?!1:o.get("zoomLock",!0)?"move":!0;n[r+s]>n[r+e]&&(e=s),a=a&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!a}}}function QP(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var n=dp(r),a=n.coordSysRecordMap||(n.coordSysRecordMap=me());a.each(function(i){i.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(i){var o=cP(i);I(o.infoList,function(s){var l=s.model.uid,c=a.get(l)||a.set(l,ZP(r,s.model)),u=c.dataZoomInfoMap||(c.dataZoomInfoMap=me());u.set(i.uid,{dzReferCoordSysInfo:s,model:i,getRange:null})})}),a.each(function(i){var o=i.controller,s,l=i.dataZoomInfoMap;if(l){var c=l.keys()[0];c!=null&&(s=l.get(c))}if(!s){Ox(a,i);return}var u=JP(l);o.enable(u.controlType,u.opt),o.setPointerChecker(i.containsPoint),Xd(i,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var eR=(function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,n,a){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),YP(a,r,{pan:Ne(hp.pan,this),zoom:Ne(hp.zoom,this),scrollMove:Ne(hp.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){XP(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e})(uP),hp={zoom:function(t,e,r,n){var a=this.range,i=a.slice(),o=t.axisModels[0];if(o){var s=pp[e](null,[n.originX,n.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(i[1]-i[0])+i[0],c=Math.max(1/n.scale,0);i[0]=(i[0]-l)*c+l,i[1]=(i[1]-l)*c+l;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Qh(0,i,[0,100],0,u.minSpan,u.maxSpan),this.range=i,a[0]!==i[0]||a[1]!==i[1])return i}},pan:Nx(function(t,e,r,n,a,i){var o=pp[n]([i.oldX,i.oldY],[i.newX,i.newY],e,a,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:Nx(function(t,e,r,n,a,i){var o=pp[n]([0,0],[i.scrollDelta,i.scrollDelta],e,a,r);return o.signal*(t[1]-t[0])*i.scrollDelta})};function Nx(t){return function(e,r,n,a){var i=this.range,o=i.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,n,a);if(Qh(l,o,[0,100],"all"),this.range=o,i[0]!==o[0]||i[1]!==o[1])return o}}}var pp={grid:function(t,e,r,n,a){var i=r.axis,o={},s=a.model.coordinateSystem.getRect();return t=t||[0,0],i.dim==="x"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=i.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=i.inverse?-1:1),o},polar:function(t,e,r,n,a){var i=r.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),c=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=i.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=i.inverse?-1:1),o},singleAxis:function(t,e,r,n,a){var i=r.axis,o=a.model.coordinateSystem.getRect(),s={};return t=t||[0,0],i.orient==="horizontal"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=i.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=i.inverse?-1:1),s}};function tR(t){vP(t),t.registerComponentModel(qP),t.registerComponentView(eR),QP(t)}var rR={label:{enabled:!0},decal:{show:!1}},Bx=ht(),nR={};function aR(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=Ie(rR);Oe(n.label,t.getLocaleModel().get("aria"),!1),Oe(r.option,n,!1),a(),i();function a(){var c=r.getModel("decal"),u=c.get("show");if(u){var f=me();t.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),Bx(h).scope=d}}),t.eachRawSeries(function(h){if(t.isSeriesFiltered(h))return;if(ke(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var y=Ay(h.ecModel,h.name,nR,t.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",x(b,y))}else{var p=h.getRawData(),m={},g=Bx(h).scope;d.each(function(w){var S=d.getRawIndex(w);m[S]=w});var v=p.count();p.each(function(w){var S=m[w],k=p.getName(w)||w+"",C=Ay(h.ecModel,k,g,v),A=d.getItemVisual(S,"decal");d.setItemVisual(S,"decal",x(A,C))})}function x(w,S){var k=w?q(q({},S),w):S;return k.dirty=!0,k}})}}function i(){var c=e.getZr().dom;if(c){var u=t.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=He(f.option,u),!!f.get("enabled")){if(c.setAttribute("role","img"),f.get("description")){c.setAttribute("aria-label",f.get("description"));return}var h=t.getSeriesCount(),d=f.get(["data","maxCount"])||10,p=f.get(["series","maxCount"])||10,m=Math.min(h,p),g;if(!(h<1)){var v=s();if(v){var y=f.get(["general","withTitle"]);g=o(y,{title:v})}else g=f.get(["general","withoutTitle"]);var b=[],x=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);g+=o(x,{seriesCount:h}),t.eachSeries(function(C,A){if(A<m){var M=void 0,T=C.get("name"),D=T?"withName":"withoutName";M=h>1?f.get(["series","multiple",D]):f.get(["series","single",D]),M=o(M,{seriesId:C.seriesIndex,seriesName:C.get("name"),seriesType:l(C.subType)});var L=C.getData();if(L.count()>d){var R=f.get(["data","partialData"]);M+=o(R,{displayCnt:d})}else M+=f.get(["data","allData"]);for(var O=f.get(["data","separator","middle"]),B=f.get(["data","separator","end"]),j=f.get(["data","excludeDimensionId"]),P=[],V=0;V<L.count();V++)if(V<d){var H=L.getName(V),Z=j?bt(L.getValues(V),function(Te,ge){return Ue(j,ge)===-1}):L.getValues(V),re=f.get(["data",H?"withName":"withoutName"]);P.push(o(re,{name:H,value:Z.join(O)}))}M+=P.join(O)+B,b.push(M)}});var w=f.getModel(["series","multiple","separator"]),S=w.get("middle"),k=w.get("end");g+=b.join(S)+k,c.setAttribute("aria-label",g)}}}}function o(c,u){if(!ae(c))return c;var f=c;return I(u,function(h,d){f=f.replace(new RegExp("\\{\\s*"+d+"\\s*\\}","g"),h)}),f}function s(){var c=t.get("title");return c&&c.length&&(c=c[0]),c&&c.text}function l(c){var u=t.getLocaleModel().get(["series","typeNames"]);return u[c]||u.chart}}function iR(t){if(!(!t||!t.aria)){var e=t.aria;e.show!=null&&(e.enabled=e.show),e.label=e.label||{},I(["description","general","series","data"],function(r){e[r]!=null&&(e.label[r]=e[r])})}}function oR(t){t.registerPreprocessor(iR),t.registerVisual(t.PRIORITY.VISUAL.ARIA,aR)}function zx(t,e,r){var n=ri.createCanvas(),a=e.getWidth(),i=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=a+"px",o.height=i+"px",n.setAttribute("data-zr-dom-id",t)),n.width=a*r,n.height=i*r,n}var vp=(function(t){K(e,t);function e(r,n,a){var i=t.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var o;a=a||gl,typeof r=="string"?o=zx(r,n,a):de(r)&&(o=r,r=o.id),i.id=r,i.dom=o;var s=o.style;return s&&(wv(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),i.painter=n,i.dpr=a,i}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=zx("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,a,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,c=new Ge(0,0,0,0);function u(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new Ge(0,0,0,0);b.copy(y),o.push(b)}else{for(var x=!1,w=1/0,S=0,k=0;k<o.length;++k){var C=o[k];if(C.intersect(y)){var A=new Ge(0,0,0,0);A.copy(C),A.union(y),o[k]=A,x=!0;break}else if(l){c.copy(y),c.union(C);var M=y.width*y.height,T=C.width*C.height,D=c.width*c.height,L=D-M-T;L<w&&(w=L,S=k)}}if(l&&(o[S].union(y),x=!0),!x){var b=new Ge(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var f=this.__startIndex;f<this.__endIndex;++f){var h=r[f];if(h){var d=h.shouldBePainted(a,i,!0,!0),p=h.__isRendered&&(h.__dirty&ir||!d)?h.getPrevPaintRect():null;p&&u(p);var m=d&&(h.__dirty&ir||!h.__isRendered)?h.getPaintRect():null;m&&u(m)}}for(var f=this.__prevStartIndex;f<this.__prevEndIndex;++f){var h=n[f],d=h&&h.shouldBePainted(a,i,!0,!0);if(h&&(!d||!h.__zr)&&h.__isRendered){var p=h.getPrevPaintRect();p&&u(p)}}var g;do{g=!1;for(var f=0;f<o.length;){if(o[f].isZero()){o.splice(f,1);continue}for(var v=f+1;v<o.length;)o[f].intersect(o[v])?(g=!0,o[f].union(o[v]),o.splice(v,1)):v++;f++}}while(g);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var a=this.dpr,i=this.dom,o=i.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),i.width=r*a,i.height=n*a,s&&(s.width=r*a,s.height=n*a,a!==1&&this.ctxBack.scale(a,a))},e.prototype.clear=function(r,n,a){var i=this.dom,o=this.ctx,s=i.width,l=i.height;n=n||this.clearColor;var c=this.motionBlur&&!r,u=this.lastFrameAlpha,f=this.dpr,h=this;c&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,s/f,l/f));var d=this.domBack;function p(m,g,v,y){if(o.clearRect(m,g,v,y),n&&n!=="transparent"){var b=void 0;if(Ws(n)){var x=n.global||n.__width===v&&n.__height===y;b=x&&n.__canvasGradient||gh(o,n,{x:0,y:0,width:v,height:y}),n.__canvasGradient=b,n.__width=v,n.__height=y}else Ew(n)&&(n.scaleX=n.scaleX||f,n.scaleY=n.scaleY||f,b=mh(o,n,{dirty:function(){h.setUnpainted(),h.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(m,g,v,y),o.restore()}c&&(o.save(),o.globalAlpha=u,o.drawImage(d,m,g,v,y),o.restore())}!a||c?p(0,0,s,l):a.length&&I(a,function(m){p(m.x*f,m.y*f,m.width*f,m.height*f)})},e})(Ir),Fx=1e5,$a=314159,Kc=.01,sR=.001;function lR(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function cR(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var uR=(function(){function t(e,r,n,a){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=q({},n||{}),this.dpr=n.devicePixelRatio||gl,this._singleCanvas=i,this.root=e;var o=e.style;o&&(wv(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(i){var u=e,f=u.width,h=u.height;n.width!=null&&(f=n.width),n.height!=null&&(h=n.height),this.dpr=n.devicePixelRatio||1,u.width=f*this.dpr,u.height=h*this.dpr,this._width=f,this._height=h;var d=new vp(u,this,this.dpr);d.__builtin__=!0,d.initContext(),l[$a]=d,d.zlevel=$a,s.push($a),this._domRoot=e}else{this._width=Pc(e,0,n),this._height=Pc(e,1,n);var c=this._domRoot=cR(this._width,this._height);e.appendChild(c)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,a=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var i=0;i<a.length;i++){var o=a[i],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=i===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var a={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(Fx)),i||(i=n.ctx,i.save()),za(i,s,a,o===r-1))}i&&i.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(Fx)},t.prototype.paintOne=function(e,r){P_(e,r)},t.prototype._paintList=function(e,r,n,a){if(this._redrawId===a){n=n||!1,this._updateLayerStatus(e);var i=this._doPaintList(e,r,n),o=i.finished,s=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(c){c.afterBrush&&c.afterBrush()});else{var l=this;kc(function(){l._paintList(e,r,n,a)})}}},t.prototype._compositeManually=function(){var e=this.getLayer($a).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(a){a.virtual&&e.drawImage(a.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var a=this,i=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],c=this._layers[l];c.__builtin__&&c!==this._hoverlayer&&(c.__dirty||n)&&i.push(c)}for(var u=!0,f=!1,h=function(m){var g=i[m],v=g.ctx,y=o&&g.createRepaintRects(e,r,d._width,d._height),b=n?g.__startIndex:g.__drawIndex,x=!n&&g.incremental&&Date.now,w=x&&Date.now(),S=g.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(g.__startIndex===g.__endIndex)g.clear(!1,S,y);else if(b===g.__startIndex){var k=e[b];(!k.incremental||!k.notClear||n)&&g.clear(!1,S,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=g.__startIndex);var C,A=function(L){var R={inHover:!1,allClipped:!1,prevEl:null,viewWidth:a._width,viewHeight:a._height};for(C=b;C<g.__endIndex;C++){var O=e[C];if(O.__inHover&&(f=!0),a._doPaintEl(O,g,o,L,R,C===g.__endIndex-1),x){var B=Date.now()-w;if(B>15)break}}R.prevElClipPaths&&v.restore()};if(y)if(y.length===0)C=g.__endIndex;else for(var M=d.dpr,T=0;T<y.length;++T){var D=y[T];v.save(),v.beginPath(),v.rect(D.x*M,D.y*M,D.width*M,D.height*M),v.clip(),A(D),v.restore()}else v.save(),A(),v.restore();g.__drawIndex=C,g.__drawIndex<g.__endIndex&&(u=!1)},d=this,p=0;p<i.length;p++)h(p);return _e.wxa&&I(this._layers,function(m){m&&m.ctx&&m.ctx.draw&&m.ctx.draw()}),{finished:u,needsRefreshHover:f}},t.prototype._doPaintEl=function(e,r,n,a,i,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!a||l&&l.intersect(a))&&(za(s,e,i,o),e.setPrevPaintRect(l))}else za(s,e,i,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=$a);var n=this._layers[e];return n||(n=new vp("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?Oe(n,this._layerConfig[e],!0):this._layerConfig[e-Kc]&&Oe(n,this._layerConfig[e-Kc],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,a=this._zlevelList,i=a.length,o=this._domRoot,s=null,l=-1;if(!n[e]&&lR(r)){if(i>0&&e>a[0]){for(l=0;l<i-1&&!(a[l]<e&&a[l+1]>e);l++);s=n[a[l]]}if(a.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var c=s.dom;c.nextSibling?o.insertBefore(r.dom,c.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a];e.call(r,this._layers[i],i)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a],o=this._layers[i];o.__builtin__&&e.call(r,o,i)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a],o=this._layers[i];o.__builtin__||e.call(r,o,i)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(f,h){f.__dirty=f.__used=!1});function r(f){i&&(i.__endIndex!==f&&(i.__dirty=!0),i.__endIndex=f)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var a=e[n];if(a.zlevel!==e[n-1].zlevel||a.incremental){this._needsManuallyCompositing=!0;break}}var i=null,o=0,s,l;for(l=0;l<e.length;l++){var a=e[l],c=a.zlevel,u=void 0;s!==c&&(s=c,o=0),a.incremental?(u=this.getLayer(c+sR,this._needsManuallyCompositing),u.incremental=!0,o=1):u=this.getLayer(c+(o>0?Kc:0),this._needsManuallyCompositing),u.__builtin__||Eu("ZLevel "+c+" has been used by unkown layer "+u.id),u!==i&&(u.__used=!0,u.__startIndex!==l&&(u.__dirty=!0),u.__startIndex=l,u.incremental?u.__drawIndex=-1:u.__drawIndex=l,r(l),i=u),a.__dirty&ir&&!a.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,I(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?Oe(n[e],r,!0):n[e]=r;for(var a=0;a<this._zlevelList.length;a++){var i=this._zlevelList[a];if(i===e||i===e+Kc){var o=this._layers[i];Oe(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,a=r[e];a&&(a.dom.parentNode.removeChild(a.dom),delete r[e],n.splice(Ue(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var a=this._opts,i=this.root;if(e!=null&&(a.width=e),r!=null&&(a.height=r),e=Pc(i,0,a),r=Pc(i,1,a),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer($a).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[$a].dom;var r=new vp("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var a=r.dom.width,i=r.dom.height;this.eachLayer(function(f){f.__builtin__?n.drawImage(f.dom,0,0,a,i):f.renderToCanvas&&(n.save(),f.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,c=s.length;l<c;l++){var u=s[l];za(n,u,o,l===c-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t})();function fR(t){t.registerPainter("canvas",uR)}Zn([oR,sA,fR,tR,iP,WP,zM,OP]);const Wa={background:"#ffffff",border:"#dce4e9",muted:"#5b7186",surface:"#ffffff",text:"#0f1e2a",colors:["#2f7f55","#2563eb","#d97706","#7c3aed"]},Hx="cf-widget-category-zoom",Vx=.68,$i=t=>({startIndex:0,endIndex:Math.max(0,t-1)}),cs=(t,e)=>{if(e<=0)return $i(0);let r=e-1,n=Math.max(0,Math.min(r,Math.floor(Math.min(t.startIndex,t.endIndex))));return{startIndex:n,endIndex:Math.max(n,Math.min(r,Math.floor(Math.max(t.startIndex,t.endIndex))))}},Ux=(t,e,r)=>{let n=cs(t,r);if(r<=2)return $i(r);let a=n.endIndex-n.startIndex+1,i=e==="in"?Math.max(2,Math.floor(a*Vx)):Math.min(r,Math.ceil(a/Vx));if(i===a)return n;let o=(n.startIndex+n.endIndex)/2,s=r-i,l=Math.max(0,Math.min(s,Math.round(o-(i-1)/2)));return{startIndex:l,endIndex:l+i-1}},dR=(t,e)=>{let r=t.length;if(r===0)return"No chart points";let n=cs(e,r);if(n.startIndex===0&&n.endIndex===r-1)return`All ${r} ${r===1?"point":"points"}`;let a=n.endIndex-n.startIndex+1;return`${t[n.startIndex]} – ${t[n.endIndex]} · ${a} of ${r} points`},hR=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},pR=t=>{let e=new Set,r=[];return t.forEach(n=>{let a=n?.trim();!a||e.has(a)||(e.add(a),r.push(a))}),r},gp=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()){let e=Number(t);if(Number.isFinite(e))return e}return null},jc=t=>{if(t===null)return"null:";if(t===void 0)return"undefined:";if(typeof t=="object")try{return`object:${JSON.stringify(t)}`}catch{return"object:"}return`${typeof t}:${String(t)}`},Jc=(t,e)=>e?t.columnMetadata?.find(r=>r.key===e):void 0,mp=(t,e)=>Jc(t,e)?.label?.trim()||hR(e),Gx=(t,e,r)=>{if(r==null||r==="")return"Not set";let n=Jc(t,e);if(n?.dataType==="boolean"){let a=String(r).trim().toLowerCase();return r===!1||r===0||["0","false","no"].includes(a)?"No":"Yes"}if(n?.dataType==="date"||n?.dataType==="datetime"){let a=new Date(r);if(!Number.isNaN(a.getTime()))try{return new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric",timeZone:t.timezone||"UTC"}).format(a)}catch{return new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric",timeZone:"UTC"}).format(a)}}return String(r)},us=(t,e,r,n=!1)=>{if(e?.dataType==="currency"){let a=e.currencyCode||r?.currency?.code;if(a)return new Intl.NumberFormat(void 0,{style:"currency",currency:a,notation:n&&Math.abs(t)>=1e4?"compact":"standard",maximumFractionDigits:2}).format(t)}return e?.dataType==="percent"?new Intl.NumberFormat(void 0,{style:"percent",maximumFractionDigits:2}).format(Math.abs(t)>1?t/100:t):new Intl.NumberFormat(void 0,{notation:n&&Math.abs(t)>=1e4?"compact":"standard",maximumFractionDigits:2}).format(t)},vR=(t,e)=>{if(t.presentation==="table"||t.presentation==="kpi")return null;if(e)return e;let r=t.chartRecommendation?.type;return r==="line"||r==="bar"||r==="stacked_bar"?r:t.type==="line"||t.type==="bar"||t.type==="stacked_bar"?t.type:null},gR=t=>t.chartRecommendation?.categoryField?.trim()||t.label?.trim()||t.columnMetadata?.find(e=>["date","dimension","geography","boolean"].includes(e.semanticRole))?.key||t.columns?.[0],mR=t=>t.chartRecommendation?.seriesField?.trim()||t.seriesField?.trim()||t.series?.trim()||void 0,yR=(t,e,r)=>{let n=pR([...t.chartRecommendation?.valueFields??[],...t.valueFields??[],t.value,...t.columnMetadata?.filter(i=>i.semanticRole==="measure").map(i=>i.key)??[]]),a=new Set([...t.columns??[],...t.columnMetadata?.map(i=>i.key)??[],...Object.keys(t.rows?.[0]??{})]);return n.filter(i=>i!==e&&i!==r&&a.has(i)).filter(i=>t.rows?.some(o=>gp(o[i])!==null))},_R=(t,e,r,n,a)=>{let i=a?` Showing 4 of ${n.length+a} series.`:"";if(e==="line"){let s=r.length-1,l=n.map(c=>{let u=c.values[s];return u==null?null:`${c.name}: ${us(u,c.valueColumn,t)}`}).filter(c=>!!c);return l.length?`Latest (${r[s]}): ${l.join("; ")}.${i}`:`No numeric trend values are available.${i}`}let o;return n.forEach(s=>{s.values.forEach((l,c)=>{l===null||o&&l<=o.value||(o={category:r[c]??"Not set",series:s,value:l})})}),o?`Highest: ${o.category}, ${o.series.name} ${us(o.value,o.series.valueColumn,t)}.${i}`:`No numeric comparison values are available.${i}`},yp=(t,e)=>{let r=vR(t,e),n=gR(t),a=t.rows??[];if(!r||!n||a.length===0)return null;let i=mR(t),o=yR(t,n,i);if(o.length===0)return null;let s=o.length===1?i:void 0,l=[],c=new Set;a.forEach(m=>{let g=jc(m[n]);c.has(g)||(c.add(g),l.push({key:g,label:Gx(t,n,m[n])}))});let u=l.map(m=>m.label),f=0,h;if(s){let m=[],g=new Set;a.forEach(b=>{let x=jc(b[s]);g.has(x)||(g.add(x),m.push({key:x,label:Gx(t,s,b[s])}))});let v=m.slice(0,4);f=Math.max(0,m.length-v.length);let y=o[0];h=v.map(b=>{let x=new Map;return a.forEach(w=>{if(jc(w[s])!==b.key)return;let S=jc(w[n]);x.has(S)||x.set(S,gp(w[y]))}),{field:y,name:b.label,values:l.map(w=>x.get(w.key)??null),valueColumn:Jc(t,y)}})}else f=Math.max(0,o.length-4),h=o.slice(0,4).map(m=>({field:m,name:mp(t,m),values:a.map(g=>gp(g[m])),valueColumn:Jc(t,m)}));if(h.length===0)return null;let d=mp(t,n),p="Values";return s?p=mp(t,o[0]):h.length===1&&(p=h[0].name),{type:r,title:t.title?.trim()||`${p} by ${d}`,xAxisTitle:d,yAxisTitle:p,categories:u,series:h,omittedSeriesCount:f,summary:_R(t,r,u,h,f)}},bR=t=>{if(t.presentation==="table"||t.presentation==="kpi")return[];let e=yp(t);if(!e)return[];let r=[{type:"line",label:"Line"},{type:"bar",label:"Bar"}];return e.series.length>1&&r.push({type:"stacked_bar",label:"Stacked bar"}),r},xR=(t,{expanded:e=!1,reducedMotion:r=!1,theme:n=Wa,zoomWindow:a=$i(t.categories.length)}={})=>{let i=t.series.length>1,o=t.type==="stacked_bar",s=t.categories.length>2,l=cs(a,t.categories.length);return{animation:!r,animationDuration:r?0:260,aria:{enabled:!0,decal:{show:!0},label:{description:`${t.title}. ${t.summary}`}},backgroundColor:"transparent",color:n.colors,textStyle:{color:n.text,fontFamily:"inherit"},grid:{top:i?e?48:42:14,right:12,bottom:e?18:10,left:10,containLabel:!0},legend:{show:i,type:"scroll",top:0,left:"center",itemWidth:12,itemHeight:8,textStyle:{color:n.muted,fontSize:e?11:10}},tooltip:{trigger:"axis",triggerOn:"mousemove|click",confine:!0,backgroundColor:n.surface,borderColor:n.border,borderWidth:1,textStyle:{color:n.text,fontSize:12},axisPointer:{type:"line",lineStyle:{color:n.muted,opacity:.5}}},dataZoom:s?[{id:Hx,type:"inside",xAxisIndex:0,startValue:l.startIndex,endValue:l.endIndex,minValueSpan:1,filterMode:"filter",disabled:!0}]:void 0,xAxis:{type:"category",data:t.categories,name:t.xAxisTitle,nameLocation:"middle",nameGap:e?38:32,nameTextStyle:{color:n.muted,fontSize:e?11:10},axisLine:{lineStyle:{color:n.border}},axisTick:{show:!1},axisLabel:{color:n.muted,fontSize:e?11:9,hideOverlap:!0,interval:"auto",rotate:!e&&t.categories.length>5?28:0,formatter:c=>c.length>(e?18:11)?`${c.slice(0,e?16:9)}…`:c}},yAxis:{type:"value",name:t.yAxisTitle,nameLocation:"middle",nameGap:e?52:44,nameTextStyle:{color:n.muted,fontSize:e?11:10},axisLabel:{color:n.muted,fontSize:e?11:9,formatter:c=>us(c,t.series[0]?.valueColumn,void 0,!0)},axisLine:{show:!1},axisTick:{show:!1},splitNumber:4,splitLine:{lineStyle:{color:n.border,opacity:.75}}},series:t.series.map(c=>({type:t.type==="line"?"line":"bar",name:c.name,data:c.values,stack:o?"total":void 0,connectNulls:!1,showSymbol:t.type==="line"&&t.categories.length<=18,symbol:"circle",symbolSize:e?7:6,smooth:!1,maxBarWidth:e?38:28,lineStyle:t.type==="line"?{width:e?3:2.5}:void 0,itemStyle:t.type==="line"?{borderColor:n.background,borderWidth:2}:{borderRadius:o?0:[4,4,0,0]},emphasis:{focus:"series"},tooltip:{valueFormatter:u=>us(u,c.valueColumn)}}))}},wR=t=>{let e=getComputedStyle(t),r=(a,i)=>e.getPropertyValue(a).trim()||i,n=r("--cf-accent",Wa.colors[0]);return{background:r("--cf-bg",Wa.background),border:r("--cf-border",Wa.border),muted:r("--cf-muted",Wa.muted),surface:r("--cf-surface",Wa.surface),text:r("--cf-text",Wa.text),colors:[n,"#2563eb","#d97706","#7c3aed"]}},SR=({model:t,expanded:e=!1})=>{let r=X(null),n=X(null),[a,i]=U(()=>({model:t,window:$i(t.categories.length)})),[o,s]=U(!1),l=a.model===t?cs(a.window,t.categories.length):$i(t.categories.length),c=X(l);c.current=l;let u=g=>{let v=cs(g,t.categories.length);c.current=v,i({model:t,window:v}),n.current?.dispatchAction({type:"dataZoom",dataZoomId:Hx,startValue:v.startIndex,endValue:v.endIndex})};le(()=>{let g=r.current;if(!(!g||typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("jsdom")))try{let v=fI(g,null,{renderer:"canvas",devicePixelRatio:Math.min(window.devicePixelRatio||1,2)});n.current=v;let y=()=>v.resize(),b=typeof ResizeObserver>"u"?null:new ResizeObserver(y);return b?.observe(g),b||window.addEventListener("resize",y,{passive:!0}),()=>{b?.disconnect(),b||window.removeEventListener("resize",y),v.dispose(),n.current=null}}catch{s(!0);return}},[]),le(()=>{let g=r.current,v=n.current;if(!g||!v)return;let y=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;v.setOption(xR(t,{expanded:e,reducedMotion:y,theme:wR(g),zoomWindow:c.current}),{lazyUpdate:!0,notMerge:!0}),v.resize()},[e,t]);let f=!o&&t.categories.length>2,h=l.endIndex-l.startIndex+1,d=l.startIndex===0&&l.endIndex===t.categories.length-1,p=f&&h>2,m=f&&!d;return _(Me,{children:[_("div",{ref:r,class:`cf-analytics-echart${e?" is-expanded":""}`,role:"img","aria-label":`${t.title}. ${t.summary}`,"data-chart-status":o?"fallback":"ready",children:o?_("span",{class:"cf-analytics-echart__fallback",children:t.summary}):null}),f?_("div",{class:"cf-analytics-zoom",children:[_("span",{class:"cf-analytics-zoom__range","aria-live":"polite","aria-atomic":"true",children:dR(t.categories,l)}),_("div",{class:"cf-analytics-zoom__controls",role:"group","aria-label":"Chart zoom controls",children:[_("button",{type:"button","aria-label":"Zoom out chart",title:"Zoom out",disabled:!m,onClick:()=>u(Ux(c.current,"out",t.categories.length)),children:"−"}),_("button",{type:"button",class:"cf-analytics-zoom__reset","aria-label":"Reset chart zoom",title:"Reset zoom",disabled:d,onClick:()=>u($i(t.categories.length)),children:"Reset"}),_("button",{type:"button","aria-label":"Zoom in chart",title:"Zoom in",disabled:!p,onClick:()=>u(Ux(c.current,"in",t.categories.length)),children:"+"})]})]}):null]})},$x=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},Wx=(t,e)=>(e?.length?e:Object.keys(t[0]??{})).map(r=>typeof r=="string"?{key:r,label:$x(r)}:{...r,label:r.label?.trim()||$x(r.key)}),qx=(t,e,r)=>{if(t==null||t==="")return"—";if((r?.dataType==="date"||r?.dataType==="datetime")&&typeof t=="string"){let n=new Date(t);if(!Number.isNaN(n.getTime()))return new Intl.DateTimeFormat(e,{dateStyle:"medium",...r.dataType==="datetime"?{timeStyle:"short"}:{}}).format(n)}return r?.dataType==="currency"&&typeof t=="number"?new Intl.NumberFormat(e,{style:"currency",currency:r.currencyCode||"USD",maximumFractionDigits:2}).format(t):typeof t=="number"&&Number.isFinite(t)?new Intl.NumberFormat(e,{maximumFractionDigits:4}).format(t):typeof t=="boolean"?t?"Yes":"No":String(t)},Yx=t=>{let e=String(t??"");return/[",\r\n]/.test(e)?`"${e.replaceAll('"','""')}"`:e},kR=(t,e)=>{let r=Wx(t,e);return[r.map(n=>Yx(n.label)).join(","),...t.map(n=>r.map(a=>Yx(n[a.key])).join(","))].join(`\r
|
|
23
|
+
`)},TR=({rows:t,columns:e,maxRows:r=100,locale:n,expanded:a=!1,classPrefix:i="cr",pageSize:o=10})=>{let s=Ht(()=>Wx(t,e),[e,t]),l=s.map(P=>P.key).join("\0"),[c,u]=U(()=>s.map(P=>P.key)),[f,h]=U(""),[d,p]=U(),[m,g]=U("asc"),[v,y]=U([]),[b,x]=U("table"),[w,S]=U(1),[k,C]=U(o);le(()=>{u(s.map(P=>P.key)),p(void 0),y([]),S(1)},[l]);let A=s.filter(P=>c.includes(P.key)),M=Ht(()=>{let P=f.toLocaleLowerCase(n),V=t.map((H,Z)=>({row:H,index:Z})).filter(({row:H})=>A.some(Z=>qx(H[Z.key],n,Z).toLocaleLowerCase(n).includes(P)));return d?V.sort((H,Z)=>{let re=H.row[d],Te=Z.row[d],ge=typeof re=="number"?re:NaN,xe=typeof Te=="number"?Te:NaN,Ce=!Number.isNaN(ge)&&!Number.isNaN(xe)?ge-xe:String(re??"").localeCompare(String(Te??""),n,{numeric:!0,sensitivity:"base"});return m==="asc"?Ce:-Ce}):V},[A,n,f,t,m,d]),T=M.slice(0,Math.max(1,r)),D=Math.max(1,Math.ceil(T.length/k)),L=Math.min(w,D),R=a?T:T.slice((L-1)*k,L*k),O=R.length>0&&R.every(({index:P})=>v.includes(P)),B=P=>`${i}-${P}`;if(t.length===0||s.length===0)return _("div",{class:B("table-note"),children:"No rows returned."});let j=P=>{let V=new Set(R.map(({index:H})=>H));y(H=>P?[...new Set([...H,...V])]:H.filter(Z=>!V.has(Z)))};return _("section",{class:B("data-table"),children:[_("div",{class:B("table-fields"),children:[_("strong",{children:"Fields"}),_("div",{class:B("field-list"),children:s.map(P=>_("span",{class:B("field-chip"),children:P.label},P.key))}),_("span",{class:B("table-field-count"),children:[t.length.toLocaleString(n)," rows"]})]}),_("div",{class:B("table-controls"),children:[_("label",{class:B("table-search"),children:[_("span",{"aria-hidden":"true",children:"⌕"}),_("input",{type:"search",value:f,placeholder:"Search this result...","aria-label":"Search this result",onInput:P=>{h(P.currentTarget.value.trim()),S(1)}})]}),_("div",{class:B("table-modes"),role:"group","aria-label":"Table display mode",children:["table","matrix"].map(P=>_("button",{type:"button",class:`${B("segment")}${b===P?" is-active":""}`,"aria-pressed":b===P,onClick:()=>x(P),children:P==="table"?"Table":"Matrix"},P))})]}),_("div",{class:B("table-column-bar"),children:_("details",{class:B("column-picker"),children:[_("summary",{children:"Columns"}),_("div",{class:B("column-menu"),children:s.map(P=>_("label",{children:[_("input",{type:"checkbox",checked:c.includes(P.key),onChange:V=>{let H=V.currentTarget.checked;u(Z=>H?[...new Set([...Z,P.key])]:Z.length>1?Z.filter(re=>re!==P.key):Z)}}),_("span",{children:P.label})]},P.key))})]})}),_("div",{class:B("table-wrap"),role:"region","aria-label":"Scrollable result table",tabIndex:0,children:_("table",{class:`${B("table")}${b==="matrix"?" is-matrix":""}`,children:[_("caption",{class:B("visually-hidden"),children:["Result table with ",M.length," ",M.length===1?"row":"rows"]}),_("thead",{children:_("tr",{children:[_("th",{class:B("select-cell"),children:_("input",{type:"checkbox","aria-label":"Select all visible rows",checked:O,onChange:P=>j(P.currentTarget.checked)})}),A.map(P=>_("th",{scope:"col",children:_("button",{type:"button",class:B("table-sort"),"aria-label":`Sort by ${P.label}`,onClick:()=>{d===P.key?g(V=>V==="asc"?"desc":"asc"):(p(P.key),g("asc")),S(1)},children:[_("span",{children:P.label}),_("span",{class:B("sort-direction"),"aria-hidden":"true",children:d===P.key?m==="asc"?"↑":"↓":"↕"})]})},P.key))]})}),_("tbody",{children:R.map(({row:P,index:V})=>_("tr",{class:v.includes(V)?"is-selected":void 0,children:[_("td",{class:B("select-cell"),children:_("input",{type:"checkbox","aria-label":`Select row ${V+1}`,checked:v.includes(V),onChange:H=>y(Z=>H.currentTarget.checked?[...new Set([...Z,V])]:Z.filter(re=>re!==V))})}),A.map(H=>_("td",{children:qx(P[H.key],n,H)},H.key))]},V))})]})}),_("div",{class:B("table-summary"),children:[_("span",{children:T.length?`${((L-1)*k+1).toLocaleString(n)}-${Math.min(L*k,T.length).toLocaleString(n)} of ${M.length.toLocaleString(n)}`:`0 of ${M.length.toLocaleString(n)}`}),a?_("span",{children:t.length>r?`First ${r.toLocaleString(n)} rows available`:"All returned rows loaded"}):_("div",{class:B("table-pagination"),"aria-label":"Table pagination",children:[_("label",{children:[_("span",{children:"Rows"}),_("select",{"aria-label":"Rows per page",value:k,onChange:P=>{C(Number(P.currentTarget.value)),S(1)},children:[10,25,50].map(P=>_("option",{value:P,children:P},P))})]}),_("button",{type:"button","aria-label":"Previous page",disabled:L<=1,onClick:()=>S(P=>Math.max(1,P-1)),children:"‹"}),_("span",{children:[L," / ",D]}),_("button",{type:"button","aria-label":"Next page",disabled:L>=D,onClick:()=>S(P=>Math.min(D,P+1)),children:"›"})]})]})]})},_p=16e3;class CR{constructor(e){se(this,"ratio");se(this,"position",0);se(this,"carry",[]);this.ratio=e/_p}process(e){if(this.ratio===1)return e.slice();const r=this.carry.length?Float32Array.from([...this.carry,...e]):e,n=[];let a=this.position;for(;a+this.ratio<=r.length;){const o=Math.floor(a),s=Math.min(r.length,Math.floor(a+this.ratio));let l=0;for(let c=o;c<s;c+=1)l+=r[c]??0;n.push(s>o?l/(s-o):0),a+=this.ratio}const i=Math.floor(a);return this.carry=Array.from(r.subarray(i)),this.position=a-i,Float32Array.from(n)}}const MR=(t,e=_p)=>{const r=t.reduce((s,l)=>s+l.length,0),n=new ArrayBuffer(44+r*2),a=new DataView(n),i=(s,l)=>{for(let c=0;c<l.length;c+=1)a.setUint8(s+c,l.charCodeAt(c))};i(0,"RIFF"),a.setUint32(4,36+r*2,!0),i(8,"WAVE"),i(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,e,!0),a.setUint32(28,e*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),i(36,"data"),a.setUint32(40,r*2,!0);let o=44;for(const s of t)for(let l=0;l<s.length;l+=1){const c=Math.max(-1,Math.min(1,s[l]??0));a.setInt16(o,c<0?c*32768:c*32767,!0),o+=2}return new Blob([n],{type:"audio/wav"})},Xx=t=>t.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").split(/\s+/).filter(e=>e.length>1),AR=(t,e)=>{const r=Xx(t);if(r.length===0||!e.trim())return!1;const n=new Set(Xx(e));return r.filter(a=>n.has(a)).length/r.length>=.7},Zx=300,DR=()=>{const t=globalThis;if(t.__voiceDebug)return!0;try{return t.localStorage?.getItem("accurix.voiceDebug")==="1"}catch{return!1}};class IR{constructor(e=()=>Date.now()){se(this,"now");se(this,"entries",[]);se(this,"startedAt");this.now=e,this.startedAt=e(),globalThis.__accurixVoiceLog=()=>this.list()}add(e,r){const n={at:Math.round(this.now()-this.startedAt),event:e,detail:r};this.entries.push(n),this.entries.length>Zx&&this.entries.splice(0,this.entries.length-Zx),DR()&&console.debug(`VOICEDBG ${e} ${r?JSON.stringify(r):""}`)}list(){return this.entries.slice()}}const bp=_p/50,Jt=20,LR=500,PR=120,RR=300,ER=280,OR=600,NR=300,BR=12e3,zR=25e3,FR=300,HR=2e4,VR=60,UR=400,GR=250,xp=8e-4,$R=.1,WR=2.8,qR=1.8,YR=.006,XR=.004,ZR=1.8,KR=1.4,jR=2e3,JR=2e3;class QR{constructor(e){se(this,"options");se(this,"endSilenceMs");se(this,"pending",new Float32Array(0));se(this,"levels",[]);se(this,"framesSinceFloor",0);se(this,"floor",xp*4);se(this,"recentSpeech",[]);se(this,"preroll",[]);se(this,"silentMs",0);se(this,"inputSilent",!1);se(this,"outputActive",!1);se(this,"turns",[]);se(this,"nextTurnId",1);this.options=e,this.endSilenceMs=e.endSilenceMs??JR}get hearing(){return this.current()?.capturing??!1}get processing(){return this.turns.some(e=>!e.capturing&&!e.cancelled)}feed(e){let r=e;this.pending.length&&(r=new Float32Array(this.pending.length+e.length),r.set(this.pending),r.set(e,this.pending.length));let n=0;for(;n+bp<=r.length;)this.frame(r.slice(n,n+bp)),n+=bp;this.pending=r.slice(n)}setOutputActive(e){this.outputActive!==e&&(this.outputActive=e,this.options.log.add("output",{active:e}))}finishTurn(){const e=this.current();e&&(e.capturing?this.endTurn(e,"done"):e.closed||(e.closed=!0,e.endedBy="done",this.options.log.add("turn-done",{turn:e.id})))}reset(e){for(const r of this.turns)r.cancelled=!0;this.turns.length&&this.options.log.add("turns-dropped",{reason:e,count:this.turns.length}),this.turns=[],this.preroll=[],this.recentSpeech=[],this.pending=new Float32Array(0),this.options.onChange()}current(){return this.turns[this.turns.length-1]}frame(e){let r=0,n=0;for(let f=0;f<e.length;f+=1){const h=e[f]??0;r+=h*h,n=Math.max(n,Math.abs(h))}const a=Math.sqrt(r/e.length);this.trackInputSilence(n);const i=this.current();!i?.capturing&&!this.outputActive&&this.trackFloor(a);const o=this.outputActive,s=Math.max(YR,this.floor*WR)*(o?ZR:1),l=Math.max(XR,this.floor*qR)*(o?KR:1),c=a>=s,u=a>=l;if(!i?.capturing){for(this.preroll.push(e);this.preroll.length*Jt>LR;)this.preroll.shift();this.recentSpeech.push(c);const f=(o?OR:RR)/Jt;for(;this.recentSpeech.length>f;)this.recentSpeech.shift();const h=this.recentSpeech.filter(Boolean).length*Jt;h>=(o?ER:PR)&&this.beginCapture(h);return}i.chunk.push(e),i.chunkMs+=Jt,i.durationMs+=Jt,c&&(i.voicedMs+=Jt,i.chunkVoicedMs+=Jt),i.quietMs=u?0:i.quietMs+Jt,o&&(i.overlappedOutput=!0),i.quietMs>=this.endSilenceMs?this.endTurn(i,"silence"):(i.chunkMs>=zR||i.chunkMs>=BR&&i.quietMs>=FR||i.chunkMs>=HR&&i.quietMs>=VR)&&this.cutChunk(i)}trackFloor(e){if(this.levels.push(e),this.levels.length>GR&&this.levels.shift(),this.framesSinceFloor+=1,this.framesSinceFloor<10&&this.levels.length>10)return;this.framesSinceFloor=0;const r=this.levels.slice().sort((n,a)=>n-a);this.floor=Math.max(xp,r[Math.floor(r.length*$R)]??xp)}trackInputSilence(e){this.silentMs=e===0?this.silentMs+Jt:0;const r=this.silentMs>=jR;r!==this.inputSilent&&(this.inputSilent=r,this.options.log.add("input-silent",{silent:r}),this.options.onInputSilent?.(r))}beginCapture(e){const r=this.current();let n;r&&!r.capturing&&!r.closed?(n=r,n.capturing=!0,this.options.log.add("turn-resumed",{turn:n.id})):(n={id:this.nextTurnId++,capturing:!0,closed:!1,endedBy:"silence",chunk:[],chunkMs:0,chunkVoicedMs:0,quietMs:0,voicedMs:0,durationMs:0,overlappedOutput:this.outputActive,results:[],chunkCount:0,cancelled:!1},this.turns.push(n),this.options.log.add("turn-start",{turn:n.id,overOutput:this.outputActive}),this.options.listener.speechStart?.({turnId:n.id,overlappedOutput:this.outputActive})),n.chunk.push(...this.preroll),n.chunkMs+=this.preroll.length*Jt,n.durationMs+=this.preroll.length*Jt,n.voicedMs+=e,n.chunkVoicedMs+=e,n.quietMs=0,this.preroll=[],this.recentSpeech=[],this.options.onChange()}endTurn(e,r){const n=Math.max(0,Math.floor((e.quietMs-UR)/Jt));if(n>0&&(e.chunk.splice(e.chunk.length-Math.min(n,e.chunk.length)),e.chunkMs=e.chunk.length*Jt),e.capturing=!1,e.endedBy=r,r==="done"&&(e.closed=!0),this.options.log.add("turn-end",{turn:e.id,by:r,ms:e.durationMs,voicedMs:e.voicedMs}),e.chunkCount===0&&e.voicedMs<NR){this.turns=this.turns.filter(a=>a!==e),this.options.log.add("turn-noise",{turn:e.id,reason:"too-short"}),this.options.listener.noise?.({id:e.id,reason:"too-short",overlappedOutput:e.overlappedOutput}),this.options.onChange();return}this.cutChunk(e),this.options.onChange(),this.settle()}cutChunk(e){if(e.chunk.length===0)return;const r=e.chunk,n=e.chunkCount;e.chunkCount+=1,e.results[n]=void 0,e.chunk=[];const a=r.length*Jt,i=e.chunkVoicedMs;if(e.chunkMs=0,e.chunkVoicedMs=0,i===0&&n>0){e.results[n]="";return}this.options.log.add("chunk",{turn:e.id,index:n,ms:a}),this.options.transcribe({audio:MR(r),mimeType:"audio/wav",durationSeconds:a/1e3,turnId:e.id,chunkIndex:n}).then(o=>(o??"").trim(),()=>null).then(o=>{if(e.cancelled)return;e.results[n]=o,this.options.log.add("chunk-text",{turn:e.id,index:n,chars:o===null?-1:o.length});const s=[];for(const l of e.results){if(l===void 0)break;l&&s.push(l)}s.length&&this.options.listener.partial?.({turnId:e.id,text:s.join(" ")}),this.settle()})}settle(){for(;this.turns.length;){const e=this.turns[0];if(!e||e.capturing||e.results.some(i=>i===void 0))return;this.turns.shift();const r=e.results.filter(i=>typeof i=="string"&&i!==""),n=e.results.every(i=>i===null),a=r.join(" ").replace(/\s+/g," ").trim();if(a)this.options.log.add("turn",{turn:e.id,chars:a.length,by:e.endedBy}),this.options.listener.turn?.({id:e.id,text:a,durationMs:e.durationMs,endedBy:e.endedBy,overlappedOutput:e.overlappedOutput});else{const i=n?"transcribe-failed":"empty-transcript";this.options.log.add("turn-noise",{turn:e.id,reason:i}),this.options.listener.noise?.({id:e.id,reason:i,overlappedOutput:e.overlappedOutput})}this.options.onChange()}}}const e5=2048,t5=[300,1e3,2500],r5=()=>typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof globalThis.AudioContext=="function",n5=t=>{const e=t?.name;return e==="NotAllowedError"||e==="SecurityError"?"permission-denied":e==="NotFoundError"||e==="OverconstrainedError"?"no-device":"error"};class Kx{constructor(e){se(this,"options");se(this,"log",new IR);se(this,"turns");se(this,"mic","off");se(this,"reason");se(this,"muted",!1);se(this,"inputSilent",!1);se(this,"stream",null);se(this,"context",null);se(this,"source",null);se(this,"processor",null);se(this,"sink",null);se(this,"downsampler",null);se(this,"deviceId");se(this,"generation",0);se(this,"recoveryAttempt",0);se(this,"recoveryTimer",null);se(this,"lastSnapshot","");se(this,"groupId");se(this,"onTrackEnded",()=>{this.log.add("track-ended"),this.recover("track-ended")});se(this,"onTrackMuteChange",()=>{const e=this.stream?.getAudioTracks()[0];this.log.add("track-mute-change",{muted:!!e?.muted}),this.refreshMic()});se(this,"onContextState",()=>{const e=this.context?.state;this.log.add("audio-state",{state:e}),(e==="suspended"||e==="interrupted")&&this.context?.resume().catch(()=>{}),this.refreshMic()});se(this,"onDeviceChange",()=>{this.checkDevices()});this.options=e,this.deviceId=e.deviceId,this.turns=new QR({transcribe:e.transcribe,listener:e.listener,log:this.log,endSilenceMs:e.endSilenceMs,onChange:()=>this.publish(),onInputSilent:r=>{this.inputSilent=r,this.publish()}})}get snapshot(){let e=this.mic,r=this.reason;return e==="listening"&&this.inputSilent&&(e="unavailable",r="input-silent"),e==="listening"&&this.turns.hearing&&(e="hearing"),{mic:e,processing:this.turns.processing,reason:e==="unavailable"?r:void 0}}get active(){return this.mic!=="off"}async start(){this.mic==="off"&&(this.log.add("start"),this.mediaDevices()?.addEventListener("devicechange",this.onDeviceChange),await this.open("start"))}stop(e="stopped"){this.mic!=="off"&&(this.log.add("stop",{reason:e}),this.generation+=1,this.clearRecovery(),this.mediaDevices()?.removeEventListener("devicechange",this.onDeviceChange),this.turns.reset(e),this.close(),this.context?.close().catch(()=>{}),this.context=null,this.setMic("off"))}setMuted(e){if(!(this.muted===e||this.mic==="off")){this.muted=e,this.log.add(e?"mute":"unmute");for(const r of this.stream?.getAudioTracks()??[])r.enabled=!e;e?(this.turns.reset("muted"),this.setMic("muted")):this.refreshMic()}}finishTurn(){this.log.add("done-pressed"),this.turns.finishTurn()}setOutputActive(e){this.turns.setOutputActive(e)}async selectDevice(e){e!==this.deviceId&&(this.deviceId=e,this.mic!=="off"&&(this.log.add("device-selected"),this.turns.reset("device-selected"),this.close(),await this.open("device-selected")))}mediaDevices(){return this.options.media?.mediaDevices??(typeof navigator<"u"?navigator.mediaDevices:void 0)}async open(e){const r=++this.generation;this.setMic("starting");const n=this.options.media?.getUserMedia??(r5()?i=>navigator.mediaDevices.getUserMedia(i):null);if(!n){this.unavailable("unsupported");return}let a;try{a=await n({audio:{...this.deviceId?{deviceId:{exact:this.deviceId}}:{},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1}})}catch(i){if(r!==this.generation)return;const o=n5(i);if(this.log.add("mic-open-failed",{why:e,reason:o}),o==="no-device"&&this.deviceId){this.deviceId=void 0,await this.open("default-device");return}this.unavailable(o);return}if(r!==this.generation){a.getTracks().forEach(i=>i.stop());return}try{this.connect(a)}catch(i){this.log.add("audio-setup-failed",{message:String(i?.name??"error")}),a.getTracks().forEach(o=>o.stop()),this.unavailable("error");return}this.recoveryAttempt=0,this.groupId=a.getAudioTracks()[0]?.getSettings?.().groupId,this.log.add("mic-open",{why:e}),this.refreshMic()}connect(e){this.stream=e;for(const n of e.getAudioTracks())n.enabled=!this.muted,n.addEventListener("ended",this.onTrackEnded),n.addEventListener("mute",this.onTrackMuteChange),n.addEventListener("unmute",this.onTrackMuteChange);const r=this.context??this.options.media?.createAudioContext?.()??new globalThis.AudioContext;this.context||(this.context=r,r.addEventListener("statechange",this.onContextState)),r.state==="suspended"&&r.resume().catch(()=>{}),this.downsampler=new CR(r.sampleRate),this.source=r.createMediaStreamSource(e),this.processor=r.createScriptProcessor(e5,1,1),this.sink=r.createGain(),this.sink.gain.value=0,this.processor.onaudioprocess=n=>{if(this.muted||!this.downsampler)return;const a=this.downsampler.process(n.inputBuffer.getChannelData(0));if(this.turns.feed(a),this.options.listener.level&&a.length){let i=0;for(const o of a)i+=o*o;this.options.listener.level(Math.sqrt(i/a.length))}},this.source.connect(this.processor),this.processor.connect(this.sink),this.sink.connect(r.destination)}close(){this.processor&&(this.processor.onaudioprocess=null),this.source?.disconnect(),this.processor?.disconnect(),this.sink?.disconnect(),this.source=null,this.processor=null,this.sink=null;for(const e of this.stream?.getTracks()??[])e.removeEventListener("ended",this.onTrackEnded),e.removeEventListener("mute",this.onTrackMuteChange),e.removeEventListener("unmute",this.onTrackMuteChange),e.stop();this.stream=null,this.inputSilent=!1}refreshMic(){if(this.mic==="off")return;if(this.muted)return this.setMic("muted");const e=this.stream?.getAudioTracks()[0];if(!e||e.readyState!=="live")return this.unavailable("device-lost");if(e.muted)return this.unavailable("track-muted");if(this.context&&this.context.state!=="running")return this.unavailable("audio-suspended");this.reason=void 0,this.setMic("listening")}unavailable(e){this.reason=e,this.setMic("unavailable")}setMic(e){this.mic!==e&&this.log.add("mic",{state:e,reason:e==="unavailable"?this.reason:void 0}),this.mic=e,this.publish()}publish(){const e=this.snapshot,r=JSON.stringify(e);r!==this.lastSnapshot&&(this.lastSnapshot=r,this.options.listener.state?.(e))}recover(e){if(this.mic==="off"||this.recoveryTimer)return;const r=t5[this.recoveryAttempt];if(this.turns.reset(e),this.close(),r===void 0){this.log.add("mic-recovery-gave-up",{why:e}),this.unavailable("device-lost");return}this.recoveryAttempt+=1,this.unavailable("device-lost"),this.log.add("mic-recovering",{why:e,attempt:this.recoveryAttempt}),this.recoveryTimer=setTimeout(()=>{this.recoveryTimer=null,this.mic!=="off"&&this.open(e)},r)}clearRecovery(){this.recoveryTimer&&clearTimeout(this.recoveryTimer),this.recoveryTimer=null,this.recoveryAttempt=0}async checkDevices(){const e=this.stream?.getAudioTracks()[0];if(!e||e.readyState!=="live"){this.log.add("device-change",{live:!1}),this.recover("device-change");return}let r=[];try{r=(await this.mediaDevices()?.enumerateDevices()??[]).filter(o=>o.kind==="audioinput")}catch{return}const n=r.some(o=>!this.groupId||o.groupId===this.groupId),a=r.find(o=>o.deviceId==="default"),i=!this.deviceId&&a!==void 0&&this.groupId!==void 0&&a.groupId!==this.groupId;this.log.add("device-change",{live:!0,ours:n,defaultMoved:i}),(!n||i)&&this.recover("device-change")}}const a5=[{name:"Smileys",emojis:["😀","😃","😄","😁","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😋","😛","😜","🤪","🤗","🤭","🤔","🤐","😐","😶","😏","🙄","😴","🥳","😎","🤓","🥺","😢","😭","😤","😠","🤯","😬","😱","🤩","🥱"]},{name:"Gestures",emojis:["👍","👎","👌","🤌","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","✋","🖐️","👋","🤝","🙏","💪","👏","🙌","👐","🤲","🫶"]},{name:"Hearts & symbols",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","💔","❣️","💕","💖","💘","💝","✨","⭐","🌟","💫","🔥","🎉","🎊","✅","❌","⚡","💯","🚀"]},{name:"Animals & nature",emojis:["🐶","🐱","🦊","🐻","🐼","🐨","🦁","🐮","🐸","🐵","🐧","🦄","🐝","🦋","🐢","🐬","🌷","🌸","🌹","🌻","🌳","🍀"]},{name:"Food & drink",emojis:["🍎","🍌","🍉","🍓","🍒","🥑","🍔","🍟","🍕","🌮","🍿","🍩","🍪","🎂","☕","🍵","🍺","🥂","🍷"]},{name:"Objects & travel",emojis:["🚀","✈️","🚗","🏠","📦","📱","💻","⌚","📷","💡","🔑","🎁","📌","✏️","📝","📞","📧","💰","📈","⏰","🔔","🎯","🏆","🎮","🎵","💬","👀"]}],Qc={"contact-support":{title:"Contact support",submit:"Request support",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"subject",label:"Subject",kind:"text",required:!0},{key:"message",label:"Message",kind:"textarea",required:!0,placeholder:"Describe what you need help with."}]},inquiry:{title:"Leave a message",submit:"Send message",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"message",label:"Message",kind:"textarea",required:!0,placeholder:"How can we help?"}]},contact:{title:"Share your details",submit:"Save",fields:[{key:"name",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"email",label:"Email",kind:"email",required:!0,identity:"email"},{key:"phone",label:"Phone",kind:"tel",required:!0,identity:"phone"}]},"book-demo":{title:"Book a demo",submit:"Request demo",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"preferredAt",label:"Preferred time",kind:"text",placeholder:"e.g. Thursday 3pm"},{key:"notes",label:"Notes",kind:"textarea",placeholder:"Anything we should know?"}]},"request-callback":{title:"Request a callback",submit:"Request callback",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorPhone",label:"Phone number",kind:"tel",required:!0,identity:"phone"},{key:"topic",label:"Topic",kind:"text",placeholder:"What should we call about?"}]},"schedule-callback":{title:"Schedule a callback",submit:"Schedule callback",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorPhone",label:"Phone number",kind:"tel",required:!0,identity:"phone"},{key:"topic",label:"Topic",kind:"text",placeholder:"What should we call about?"}]},"subscribe-newsletter":{title:"Subscribe",submit:"Subscribe",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"}]}},wp={openChat:"Open chat",closeChat:"Close chat",closeHistory:"Close conversation history",unreadMessage:"1 unread message",unreadMessages:"{count} unread messages",muteSounds:"Mute sounds",unmuteSounds:"Unmute sounds",statusOnline:"Online · replies instantly",statusOffline:"Away · leave a message",liveSupport:"Live support",reconnectSupport:"Reconnect to support",reconnectPrompt:"I can bring a teammate back into this chat.",waitingForTeam:"AI helping · team notified",assistantName:"Assistant",chatName:"Chat",welcomeLabel:"{name} welcome",welcomeEyebrow:"Ready when you are",welcomePrompt:"Ask a question, leave a message, or book a demo.",agentTyping:"{name} is typing…",expandedAnalyticsResult:"Expanded analytics result",privacyAndData:"Privacy and local data",muteMicrophone:"Mute microphone",unmuteMicrophone:"Unmute microphone",chooseMicrophone:"Choose microphone",defaultMicrophone:"Default microphone",microphone:"Microphone",talkNow:"Talk now",expandView:"Expand view",exitExpandedView:"Exit expanded view",minimizeVoiceChat:"Minimize voice chat",endVoiceChat:"End voice chat",restoreVoiceChat:"Restore voice chat",reopenVoiceChat:"Reopen voice chat with {name}",voiceConnecting:"Connecting…",voiceListening:"Listening…",voiceHearing:"Hearing you…",voiceUnavailable:"Can’t hear you — check your microphone.",voiceProcessing:"Transcribing…",voiceSpeaking:"Speaking…",voiceNoise:"No clear speech heard. Move closer to the mic and try again.",voiceMisunderstood:"Could not transcribe that. Please try again or type your message.",voiceDenied:"Microphone unavailable. Allow access or type your message.",composerPlaceholder:"Type your message…",send:"Send message",emoji:"Emoji",gifs:"GIFs",attachFile:"Attach a file",recordVoice:"Record a voice message",stopRecording:"Stop recording",actionTestMode:"Test mode",stop:"Stop",copy:"Copy",copied:"Copied",retry:"Retry",clearChat:"Clear conversation",clearChatConfirm:"Clear this conversation?",clearChatConfirmBody:"This clears the messages on this device and starts a fresh chat.",clearConfirmCta:"Clear chat",endChat:"End conversation",endChatConfirm:"End this conversation?",endChatConfirmBody:"You won't be able to send more messages in this chat, but you can start a new one anytime.",endConfirmCta:"End conversation",conversationEnded:"This conversation has ended.",startNewChat:"Start a new conversation",pastConversations:"Past conversations",viewingPast:"Viewing a past conversation (read-only)",backToChat:"Back to current chat",historyEnded:"ended",feedbackHelpful:"Helpful",feedbackNotHelpful:"Not helpful",feedbackThanks:"Thanks for the feedback",csatPrompt:"How was this chat?",feedbackCommentPlaceholder:"What went wrong? (optional)",feedbackSend:"Send",cancel:"Cancel",newMessages:"New messages",poweredBy:"Powered by",searchGifs:"Search GIFs…",searchingGifs:"Searching…",noGifs:"No GIFs found",assistantTyping:"Assistant is typing",emptyReply:"Sorry, I couldn't generate a reply.",errorGeneric:"Something went wrong reaching the assistant. Please try again.",errorRateLimit:"You’re sending messages a little fast — give it a second and try again.",attaching:"Reading file…",attachTooLarge:"That file is too large (max 5 MB).",attachFailed:"Could not attach that file. Check its type and try again.",attachPreviewTitle:"Preview of {name}",attachOpen:"Preview {name}",attachDownload:"Download",attachPreviewClose:"Close preview",attachPreviewLoading:"Loading file…",attachPreviewFailed:"This file can’t be shown right now. It may have expired.",attachPreviewUnsupported:"This file can’t be previewed here. Download it to open it.",attachAnalysisFailed:"Saved for the team; AI could not read it.",removeAttachment:"Remove attachment",attachLimit:"You can attach up to {count} files to one message.",attachedFiles:"Attached files",removeAttachmentNamed:"Remove {name}",dropFileHere:"Drop the file here",clearDeviceData:"Clear conversations from this device",clearDeviceDataBody:"This removes locally stored conversations and visitor details from this browser. It cannot be undone.",clearDeviceDataCta:"Clear this device",handoffTitle:"Want our team to follow up?",handoffName:"Name (optional)",handoffEmail:"Your email",handoffNotify:"Notify the team",sending:"Sending…",handoffShared:"I’ve shared this with our team — they’ll get back to you at {email}.",formThanks:"Thanks! We’ll be in touch.",caseReference:"Reference: {reference}",formError:"Something went wrong — please try again.",actionContactOptions:"Contact options",actionGetInTouch:"Get in touch",actionMore:"+{count} more",actionNeedHelp:"Need help?",actionChoose:"Choose what you want to do",actionFooter:"We’ll ask for your full name and the best email or phone so the team can reach you.",actionCategorySupport:"Support",actionCategorySales:"Talk to sales",actionCategoryMarketing:"Stay in touch",actionClose:"Close",actionAs:"as {identity}",bookingPickTime:"What time works best?",bookingPickDay:"Pick a day",bookingPickTimeLabel:"Pick a time",bookingDuration:"{count}-minute demo",bookingCallbackDuration:"{count}-minute callback",bookingTimezone:"Times shown in {timezone}",bookingSchedulerFallback:"the scheduler",bookingCheckingAvailability:"Checking calendar availability…",bookingNoSlots:"No available times were found in this booking window.",bookingAvailabilityUnavailable:"Calendar availability is temporarily unavailable. Please try again shortly.",bookingEarlierToday:"Earlier today",bookingCalendarBusy:"Busy on the calendar",bookingAlreadyBooked:"Already booked",bookingNotOffered:"Not offered by the calendar",bookingRequested:"Requested for {when} — we’ll confirm by email.",bookingVerificationPending:"We received your request for {when}, but could not verify the calendar booking. Check your email; the team will follow up. Please do not book this time again.",bookingCallbackRequested:"Callback requested for {when}.",bookingCallbackConfirmed:"Your callback is scheduled for {when}.",bookingConfirmed:"You’re booked for {when}! A calendar invite is on its way. 📅",bookingSlotTaken:"That time was just taken — please pick another.",bookingViaProvider:"Pick a time that works for you on {provider}.",bookingOpenScheduler:"Open the scheduler",bookingLinkOpened:"Opening the scheduler — pick a time that suits you. 📅",bookingScheduled:"Your demo is booked. A calendar invitation has been sent to your email.",bookingBackToChat:"Back to chat",bookingOpenNewTab:"Open in new tab",bookingCloseScheduler:"Close scheduler",bookingLoadingScheduler:"Loading scheduler…",bookingMeetingLink:"Meeting link",bookingManageLink:"Manage booking",bookingCheckingDetails:"Getting your meeting link…",bookingDetailsUnavailable:"Your booking is in Calendly, but we could not load the meeting link. Check your calendar invitation or try again.",bookingRetryDetails:"Retry",previewReply:"👋 This is a preview — replies here are samples. Publish the widget on your site to chat with the live AI.",previewActionNote:"Preview — nothing was actually sent. This works for real once you publish.",previewBanner:"Preview — sample replies, no AI"},ct=(t,e)=>t.replace(/\{(\w+)\}/g,(r,n)=>e[n]??""),fs=(t,e,r)=>!e||t.includes(e)?t:`${t} ${ct(r.caseReference,{reference:e})}`,i5=t=>t?{...wp,...t}:wp,jx=iw(wp),o5=jx.Provider,kr=()=>_w(jx),qa=[["AF","Afghanistan","93"],["AL","Albania","355"],["DZ","Algeria","213"],["AS","American Samoa","1684"],["AD","Andorra","376"],["AO","Angola","244"],["AI","Anguilla","1264"],["AG","Antigua and Barbuda","1268"],["AR","Argentina","54"],["AM","Armenia","374"],["AW","Aruba","297"],["AU","Australia","61"],["AT","Austria","43"],["AZ","Azerbaijan","994"],["BS","Bahamas","1242"],["BH","Bahrain","973"],["BD","Bangladesh","880"],["BB","Barbados","1246"],["BY","Belarus","375"],["BE","Belgium","32"],["BZ","Belize","501"],["BJ","Benin","229"],["BM","Bermuda","1441"],["BT","Bhutan","975"],["BO","Bolivia","591"],["BA","Bosnia and Herzegovina","387"],["BW","Botswana","267"],["BR","Brazil","55"],["BN","Brunei","673"],["BG","Bulgaria","359"],["BF","Burkina Faso","226"],["BI","Burundi","257"],["CV","Cabo Verde","238"],["KH","Cambodia","855"],["CM","Cameroon","237"],["CA","Canada","1"],["KY","Cayman Islands","1345"],["CF","Central African Republic","236"],["TD","Chad","235"],["CL","Chile","56"],["CN","China","86"],["CO","Colombia","57"],["KM","Comoros","269"],["CG","Congo","242"],["CD","Congo, Democratic Republic","243"],["CK","Cook Islands","682"],["CR","Costa Rica","506"],["CI","Cote d'Ivoire","225"],["HR","Croatia","385"],["CU","Cuba","53"],["CW","Curacao","599"],["CY","Cyprus","357"],["CZ","Czechia","420"],["DK","Denmark","45"],["DJ","Djibouti","253"],["DM","Dominica","1767"],["DO","Dominican Republic","1809"],["EC","Ecuador","593"],["EG","Egypt","20"],["SV","El Salvador","503"],["GQ","Equatorial Guinea","240"],["ER","Eritrea","291"],["EE","Estonia","372"],["SZ","Eswatini","268"],["ET","Ethiopia","251"],["FO","Faroe Islands","298"],["FJ","Fiji","679"],["FI","Finland","358"],["FR","France","33"],["GF","French Guiana","594"],["PF","French Polynesia","689"],["GA","Gabon","241"],["GM","Gambia","220"],["GE","Georgia","995"],["DE","Germany","49"],["GH","Ghana","233"],["GI","Gibraltar","350"],["GR","Greece","30"],["GL","Greenland","299"],["GD","Grenada","1473"],["GP","Guadeloupe","590"],["GU","Guam","1671"],["GT","Guatemala","502"],["GG","Guernsey","44"],["GN","Guinea","224"],["GW","Guinea-Bissau","245"],["GY","Guyana","592"],["HT","Haiti","509"],["HN","Honduras","504"],["HK","Hong Kong","852"],["HU","Hungary","36"],["IS","Iceland","354"],["IN","India","91"],["ID","Indonesia","62"],["IR","Iran","98"],["IQ","Iraq","964"],["IE","Ireland","353"],["IM","Isle of Man","44"],["IL","Israel","972"],["IT","Italy","39"],["JM","Jamaica","1876"],["JP","Japan","81"],["JE","Jersey","44"],["JO","Jordan","962"],["KZ","Kazakhstan","7"],["KE","Kenya","254"],["KI","Kiribati","686"],["XK","Kosovo","383"],["KW","Kuwait","965"],["KG","Kyrgyzstan","996"],["LA","Laos","856"],["LV","Latvia","371"],["LB","Lebanon","961"],["LS","Lesotho","266"],["LR","Liberia","231"],["LY","Libya","218"],["LI","Liechtenstein","423"],["LT","Lithuania","370"],["LU","Luxembourg","352"],["MO","Macao","853"],["MG","Madagascar","261"],["MW","Malawi","265"],["MY","Malaysia","60"],["MV","Maldives","960"],["ML","Mali","223"],["MT","Malta","356"],["MH","Marshall Islands","692"],["MQ","Martinique","596"],["MR","Mauritania","222"],["MU","Mauritius","230"],["MX","Mexico","52"],["FM","Micronesia","691"],["MD","Moldova","373"],["MC","Monaco","377"],["MN","Mongolia","976"],["ME","Montenegro","382"],["MS","Montserrat","1664"],["MA","Morocco","212"],["MZ","Mozambique","258"],["MM","Myanmar","95"],["NA","Namibia","264"],["NR","Nauru","674"],["NP","Nepal","977"],["NL","Netherlands","31"],["NC","New Caledonia","687"],["NZ","New Zealand","64"],["NI","Nicaragua","505"],["NE","Niger","227"],["NG","Nigeria","234"],["NU","Niue","683"],["KP","North Korea","850"],["MK","North Macedonia","389"],["MP","Northern Mariana Islands","1670"],["NO","Norway","47"],["OM","Oman","968"],["PK","Pakistan","92"],["PW","Palau","680"],["PS","Palestine","970"],["PA","Panama","507"],["PG","Papua New Guinea","675"],["PY","Paraguay","595"],["PE","Peru","51"],["PH","Philippines","63"],["PL","Poland","48"],["PT","Portugal","351"],["PR","Puerto Rico","1787"],["QA","Qatar","974"],["RE","Reunion","262"],["RO","Romania","40"],["RU","Russia","7"],["RW","Rwanda","250"],["KN","Saint Kitts and Nevis","1869"],["LC","Saint Lucia","1758"],["VC","Saint Vincent and the Grenadines","1784"],["WS","Samoa","685"],["SM","San Marino","378"],["ST","Sao Tome and Principe","239"],["SA","Saudi Arabia","966"],["SN","Senegal","221"],["RS","Serbia","381"],["SC","Seychelles","248"],["SL","Sierra Leone","232"],["SG","Singapore","65"],["SK","Slovakia","421"],["SI","Slovenia","386"],["SB","Solomon Islands","677"],["SO","Somalia","252"],["ZA","South Africa","27"],["KR","South Korea","82"],["SS","South Sudan","211"],["ES","Spain","34"],["LK","Sri Lanka","94"],["SD","Sudan","249"],["SR","Suriname","597"],["SE","Sweden","46"],["CH","Switzerland","41"],["SY","Syria","963"],["TW","Taiwan","886"],["TJ","Tajikistan","992"],["TZ","Tanzania","255"],["TH","Thailand","66"],["TL","Timor-Leste","670"],["TG","Togo","228"],["TO","Tonga","676"],["TT","Trinidad and Tobago","1868"],["TN","Tunisia","216"],["TR","Turkey","90"],["TM","Turkmenistan","993"],["TC","Turks and Caicos Islands","1649"],["TV","Tuvalu","688"],["UG","Uganda","256"],["UA","Ukraine","380"],["AE","United Arab Emirates","971"],["GB","United Kingdom","44"],["US","United States","1"],["UY","Uruguay","598"],["UZ","Uzbekistan","998"],["VU","Vanuatu","678"],["VA","Vatican City","39"],["VE","Venezuela","58"],["VN","Vietnam","84"],["VG","Virgin Islands, British","1284"],["VI","Virgin Islands, U.S.","1340"],["YE","Yemen","967"],["ZM","Zambia","260"],["ZW","Zimbabwe","263"]].map(([t,e,r])=>({iso:t,name:e,dial:r})),Jx=t=>[...t.toUpperCase()].map(e=>String.fromCodePoint(127397+e.charCodeAt(0))).join(""),s5=()=>{let t="";try{if(Intl.DateTimeFormat().resolvedOptions().timeZone==="Africa/Lagos"&&(t="NG"),!t){const e=navigator.languages?.[0]||navigator.language;t=new Intl.Locale(e).region||""}}catch{t=""}return qa.find(e=>e.iso===t)??qa.find(e=>e.iso==="US")},l5=t=>{const e=s5(),r=t?.trim()??"";if(!r.startsWith("+"))return{country:e,national:r.replace(/\D/g,"")};const n=r.replace(/\D/g,""),a=[...qa].sort((i,o)=>o.dial.length-i.dial.length).find(i=>n.startsWith(i.dial))??e;return{country:a,national:n.slice(a.dial.length)}},Qx=(t,e)=>{const r=e.replace(/\D/g,"").replace(/^0+/,"");return r?`+${t.dial}${r}`:""},c5=t=>{const e=t.replace(/\D/g,"");return t.startsWith("+")&&e.length>=8&&e.length<=15},Ve=(t,e)=>_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",...e,children:t}),u5=t=>_("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...t,children:_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 3.25h14A3.75 3.75 0 0 1 22.75 7v6A3.75 3.75 0 0 1 19 16.75h-7.19l-4.26 3.84A.75.75 0 0 1 6.25 20v-3.32A3.75 3.75 0 0 1 2.25 13V7A3.75 3.75 0 0 1 6 3.25Zm3 7.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"})}),Ya=t=>Ve(_("path",{d:"m6 9 6 6 6-6"}),t),f5=t=>Ve(_(Me,{children:[_("path",{d:"m22 2-7 20-4-9-9-4Z"}),_("path",{d:"M22 2 11 13"})]}),t),ds=t=>Ve(_(Me,{children:[_("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),_("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),_("line",{x1:"12",y1:"19",x2:"12",y2:"22"})]}),t),d5=t=>Ve(_(Me,{children:[_("path",{d:"M9 9v1a3 3 0 0 0 4.24 2.73"}),_("path",{d:"M15 5.5V5a3 3 0 0 0-5.94-.6"}),_("path",{d:"M19 10v2a7 7 0 0 1-9.9 6.36"}),_("path",{d:"M5 10v2a6.98 6.98 0 0 0 1.11 3.79"}),_("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),_("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]}),t),hs=t=>Ve(_(Me,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M10 14 21 3"}),_("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]}),t),h5=t=>Ve(_(Me,{children:[_("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),_("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),_("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),_("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),t),Sp=t=>Ve(_(Me,{children:[_("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),_("path",{d:"m22 7-10 5L2 7"})]}),t),p5=t=>Ve(_("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92Z"}),t),e1=t=>Ve(_(Me,{children:[_("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),_("path",{d:"M18 19h-2"}),_("rect",{x:"3",y:"13",width:"4",height:"6",rx:"2"}),_("rect",{x:"17",y:"13",width:"4",height:"6",rx:"2"})]}),t),v5=t=>Ve(_(Me,{children:[_("path",{d:"M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4Z"}),_("path",{d:"M8 9h8M8 13h5"})]}),t),g5=t=>Ve(_(Me,{children:[_("path",{d:"M3 4h18M4 4v12h16V4M12 16v5M8 21h8"}),_("path",{d:"m8 12 2.5-2.5 2 2L16 8"})]}),t),m5=t=>Ve(_(Me,{children:[_("path",{d:"M15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"}),_("path",{d:"M3 9h12M7 2v4M12 2v4"}),_("circle",{cx:"17",cy:"17",r:"4"}),_("path",{d:"M17 15v2l1.5 1"})]}),t),y5=t=>Ve(_(Me,{children:[_("path",{d:"M4 4h16v16H5a3 3 0 0 1-3-3V6"}),_("path",{d:"M8 8h8M8 12h8M8 16h5"})]}),t),_5=t=>Ve(_(Me,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M8.5 14.5a4 4 0 0 0 7 0"}),_("line",{x1:"9",y1:"9.5",x2:"9.01",y2:"9.5"}),_("line",{x1:"15",y1:"9.5",x2:"15.01",y2:"9.5"})]}),t),Qn=t=>Ve(_(Me,{children:[_("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),t),b5=t=>Ve(_(Me,{children:[_("path",{d:"M11 5 6 9H2v6h4l5 4z"}),_("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),_("path",{d:"M19 5a9 9 0 0 1 0 14"})]}),t),x5=t=>Ve(_(Me,{children:[_("path",{d:"M11 5 6 9H2v6h4l5 4z"}),_("line",{x1:"22",y1:"9",x2:"16",y2:"15"}),_("line",{x1:"16",y1:"9",x2:"22",y2:"15"})]}),t),Xa=t=>Ve(_("path",{d:"M20 6 9 17l-5-5"}),t),w5=t=>Ve(_(Me,{children:[_("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),_("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),t),S5=t=>Ve(_(Me,{children:[_("path",{d:"M1 4v6h6"}),_("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),t),k5=t=>Ve(_("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"}),t),eu=t=>Ve(_("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"}),t),kp=t=>Ve(_(Me,{children:[_("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),_("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),t),T5=t=>Ve(_(Me,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M12 7v5l3 2"})]}),t),t1=t=>Ve(_(Me,{children:[_("path",{d:"M7 10v12"}),_("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"})]}),t),r1=t=>Ve(_(Me,{children:[_("path",{d:"M17 14V2"}),_("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"})]}),t),Tp=t=>Ve(_(Me,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M9 21H3v-6"}),_("path",{d:"M21 3l-7 7"}),_("path",{d:"M3 21l7-7"})]}),t),C5=t=>Ve(_(Me,{children:[_("path",{d:"M9 3v6H3"}),_("path",{d:"M15 21v-6h6"}),_("path",{d:"M9 9 2 2"}),_("path",{d:"M15 15l7 7"})]}),t),M5=t=>Ve(_(Me,{children:[_("rect",{x:"3",y:"4",width:"18",height:"14",rx:"2"}),_("rect",{x:"11",y:"11",width:"8",height:"6",rx:"1",fill:"currentColor",stroke:"none"})]}),t),A5=t=>Ve(_(Me,{children:[_("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"}),_("path",{d:"M12 15V9"}),_("path",{d:"m8.5 12.5 3.5-3.5 3.5 3.5"})]}),t),D5=t=>Ve(_(Me,{children:[_("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_("path",{d:"m19 12-7 7-7-7"})]}),t),n1=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(\[[^\]]+\]\([^\s)]+\))|(https?:\/\/[^\s)]+)/g,I5=t=>t.replace(/([^\n])\s+((?:[-*•]|\d+\.)\s+)(?=(?:\*\*[^*\n]{1,80}\*\*|[A-Z][A-Za-z0-9/& -]{1,50}:))/g,`$1
|
|
24
|
+
$2`),Wi=t=>{const e=[];let r=0,n=0,a;for(n1.lastIndex=0;(a=n1.exec(t))!==null;){a.index>r&&e.push(t.slice(r,a.index));const i=a[0];if(i.startsWith("`"))e.push(_("code",{class:"cf-md-code",children:i.slice(1,-1)},n++));else if(i.startsWith("**"))e.push(_("strong",{children:i.slice(2,-2)},n++));else if(i.startsWith("[")&&!/\]\(https?:\/\//.test(i))e.push(/^\[([^\]]+)\]/.exec(i)?.[1]??i);else if(i.startsWith("[")){const o=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(i),s=o?o[1]:i,l=o?o[2]:"#";e.push(_("a",{href:l,target:"_blank",rel:"noopener noreferrer nofollow",children:s},n++))}else e.push(_("a",{href:i,target:"_blank",rel:"noopener noreferrer nofollow",children:i},n++));r=a.index+i.length}return r<t.length&&e.push(t.slice(r)),e},L5=/^(```|#{1,6}\s|\s*[-*•]\s|\s*\d+\.\s)/,P5=(t,e,r)=>{const n=`cf-md-h cf-md-h--${Math.min(t,6)}`;return t<=2?_("h3",{class:n,children:e},r):t===3?_("h4",{class:n,children:e},r):_("h5",{class:n,children:e},r)},R5=t=>{const e=I5(t.replace(/\r\n/g,`
|
|
25
25
|
`)).split(`
|
|
26
26
|
`),r=[];let n=0,a=0;for(;a<e.length;){const i=e[a];if(i.trim().startsWith("```")){const u=[];for(a++;a<e.length&&!e[a].trim().startsWith("```");)u.push(e[a]),a++;a++,r.push(_("pre",{class:"cf-md-pre",children:_("code",{children:u.join(`
|
|
27
|
-
`)})},n++));continue}if(i.trim()===""){a++;continue}const o=/^(#{1,6})\s+(.*)$/.exec(i);if(o){r.push(GR(o[1].length,Ci(o[2]),n++)),a++;continue}if(/^\s*[-*•]\s+/.test(i)){const u=[];for(;a<e.length&&/^\s*[-*•]\s+/.test(e[a]);)u.push(_("li",{children:Ci(e[a].replace(/^\s*[-*•]\s+/,""))},u.length)),a++;r.push(_("ul",{class:"cf-md-list",children:u},n++));continue}if(/^\s*\d+\.\s+/.test(i)){const u=[];for(;a<e.length&&/^\s*\d+\.\s+/.test(e[a]);)u.push(_("li",{children:Ci(e[a].replace(/^\s*\d+\.\s+/,""))},u.length)),a++;r.push(_("ol",{class:"cf-md-list",children:u},n++));continue}const s=[i];for(a++;a<e.length&&e[a].trim()!==""&&!VR.test(e[a]);)s.push(e[a]),a++;const l=s.join(" ");if(/:\s*$/.test(l)&&a<e.length&&/^(?:\s*[-*•]\s+|\s*\d+\.\s+)/.test(e[a])){const u=/^(.*[.!?])\s+([^.!?]{2,120}:)$/.exec(l);u&&r.push(_("p",{children:Ci(u[1])},n++)),r.push(_("p",{class:"cf-md-list-intro",children:Ci(u?.[2]??l)},n++))}else r.push(_("p",{children:Ci(l)},n++))}return r},WR=t=>{const e=(t??"").trim().toLowerCase().replaceAll("-","_");return e==="low"||e==="low_quality"?"Low-confidence forecast":e==="medium"||e==="directional"?"Directional forecast":e==="high"||e==="validated"||e==="trusted"?"Validated forecast":"Forecast estimate"},UR=t=>{if(!t)return"Live data";const e=new Date(t);return Number.isNaN(e.getTime())?"Live data":`Updated ${new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(e)}`},YR=({answeredAt:t,reportingPeriod:e,filters:r=[],rowCount:n})=>_("div",{class:"cf-analytics-meta","data-testid":"analytics-result-meta","aria-label":"Result details",children:[_("span",{children:[_("span",{"aria-hidden":"true",class:"cf-analytics-meta__dot"}),UR(t)]}),e?.label?_("span",{children:e.label}):null,typeof n=="number"?_("span",{children:[n," ",n===1?"row":"rows"]}):null,r.length>0?_("span",{children:[r.length," applied ",r.length===1?"filter":"filters"]}):null]}),qR=({label:t,value:e})=>_("section",{class:"cf-analytics-kpi","aria-label":t,"data-testid":"analytics-kpi",children:[_("div",{class:"cf-analytics-kpi__label",children:t}),_("div",{class:"cf-analytics-kpi__value",children:e})]}),XR=({title:t="No matching data",description:e="No approved records matched this question."})=>_("section",{class:"cf-analytics-empty",role:"status","data-testid":"analytics-empty-state",children:[_("p",{children:t}),_("p",{children:e})]}),ZR=t=>t==="line"?"Best for change over time.":t==="stacked_bar"?"Compare totals and their parts.":"Compare categories or ranked values.",Ux=({type:t,className:e="cf-chart-type-icon"})=>t==="line"?_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 25h21M6 7v18",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),_("path",{d:"M8 21c4-7 7 2 11-6 2.5-5 4.5-2 7-7",fill:"none",stroke:"#2563EB","stroke-width":"2.1","stroke-linecap":"round","stroke-linejoin":"round"})]}):t==="stacked_bar"?_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 26h21M6 7v19",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),[9,15,21].map((r,n)=>_("g",{children:[_("rect",{x:r,y:18-n*2,width:"4",height:8+n*2,fill:"#2563EB",rx:"0.6"}),_("rect",{x:r,y:13-n,width:"4",height:"5",fill:"#F59E0B",rx:"0.6"}),_("rect",{x:r,y:9-n,width:"4",height:"4",fill:"#22C55E",rx:"0.6"})]},r))]}):_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 26h21M6 7v19",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),_("rect",{x:"9",y:"18",width:"4",height:"8",fill:"#2563EB",rx:"0.7"}),_("rect",{x:"15",y:"13",width:"4",height:"13",fill:"#2563EB",rx:"0.7"}),_("rect",{x:"21",y:"8",width:"4",height:"18",fill:"#2563EB",rx:"0.7"})]}),KR=({explanation:t,onFollowUp:e,showLead:r=!1,maxFollowUps:n=3})=>_("section",{class:"cf-analytics-explanation","data-testid":"inline-analytics-explanation","aria-label":"Analysis and supporting evidence",children:[r?_("div",{class:"cf-analytics-explanation__lead","data-testid":"analytics-explanation-lead",children:[t.conversationalPreface?_("p",{class:"cf-analytics-explanation__summary",children:t.conversationalPreface}):null,_("div",{class:"cf-analytics-explanation__lead-meta",children:[_("span",{class:"cf-analytics-explanation__eyebrow",children:"Answer from your data"}),_("span",{class:"cf-analytics-explanation__provenance",children:[_("span",{"aria-hidden":"true",class:"cf-analytics-explanation__provenance-dot"}),t.source==="ai_grounded"?"AI-assisted · evidence checked":"Based on current values"]})]}),_("h3",{class:"cf-analytics-explanation__headline",children:t.headline}),_("p",{class:"cf-analytics-explanation__summary",children:t.summary})]}):null,_("div",{class:"cf-analytics-explanation__body",children:[(t.evidence?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"What the numbers show"}),_("ul",{class:"cf-analytics-explanation__evidence",children:t.evidence?.slice(0,4).map(a=>_("li",{class:"cf-analytics-explanation__evidence-item",children:[_("span",{"aria-hidden":"true",class:"cf-analytics-explanation__evidence-bullet"}),_("span",{children:a})]},a))})]}):null,t.businessMeaning?_("section",{class:"cf-analytics-explanation__meaning",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Why this may matter"}),_("p",{class:"cf-analytics-explanation__paragraph",children:t.businessMeaning})]}):null,(t.possibleDrivers?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("div",{class:"cf-analytics-explanation__section-heading",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Possibilities worth checking"}),_("span",{class:"cf-analytics-explanation__hint",children:"These are not proven causes"})]}),_("div",{class:"cf-analytics-explanation__drivers",children:t.possibleDrivers?.slice(0,2).map(a=>_("article",{class:"cf-analytics-explanation__driver",children:[_("p",{class:"cf-analytics-explanation__driver-title",children:a.hypothesis}),_("p",{class:"cf-analytics-explanation__driver-body",children:[_("span",{class:"cf-analytics-explanation__driver-label",children:"How to check:"})," ",a.howToCheck]})]},`${a.hypothesis}-${a.howToCheck}`))})]}):null,(t.recommendations?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Useful next steps"}),_("div",{class:"cf-analytics-explanation__recommendations",children:t.recommendations?.slice(0,3).map((a,i)=>_("article",{class:"cf-analytics-explanation__recommendation",children:[_("span",{class:"cf-analytics-explanation__recommendation-index",children:i+1}),_("div",{children:[_("p",{class:"cf-analytics-explanation__recommendation-title",children:a.action}),_("p",{class:"cf-analytics-explanation__recommendation-body",children:a.why}),a.successMetric?_("p",{class:"cf-analytics-explanation__recommendation-body",children:[_("span",{class:"cf-analytics-explanation__driver-label",children:"Watch:"})," ",a.successMetric]}):null]})]},`${a.action}-${a.why}`))})]}):null,t.forecast?_("section",{class:"cf-analytics-explanation__outlook",children:[_("div",{class:"cf-analytics-explanation__outlook-header",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Outlook"}),_("span",{class:"cf-analytics-explanation__outlook-badge",children:WR(t.forecast.qualityStatus)})]}),_("p",{class:"cf-analytics-explanation__paragraph",children:t.forecast.text}),t.forecast.limitations?_("p",{class:"cf-analytics-explanation__recommendation-body",children:t.forecast.limitations}):null]}):null,e&&(t.followUps?.length??0)>0?_("section",{class:"cf-analytics-explanation__section cf-analytics-explanation__follow-up",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Ask a follow-up"}),_("div",{class:"cf-analytics-explanation__questions",children:t.followUps?.slice(0,n).map(a=>_("button",{type:"button",class:"cf-analytics-explanation__question",onClick:()=>e(a),children:a},a))})]}):null,(t.limitations?.length??0)>0?_("details",{class:"cf-analytics-explanation__limits",children:[_("summary",{class:"cf-analytics-explanation__limits-summary",children:"Important limits"}),_("ul",{class:"cf-analytics-explanation__limits-list",children:t.limitations?.map(a=>_("li",{children:a},a))})]}):null]}),_("p",{class:"cf-analytics-explanation__source",children:t.source==="ai_grounded"?"AI-assisted wording, checked against the live values shown here.":"Based only on the live values shown here."})]}),op=t=>t.explanation?.source==="ai_grounded"?t.explanation:t.businessAnalysis?.explanation??t.explanation,Yx=()=>{const t=W(null);return ie(()=>{const e=requestAnimationFrame(()=>t.current?.scrollIntoView?.({block:"end"}));return()=>cancelAnimationFrame(e)},[]),t},jR=t=>t.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")||"🤖",Zo=t=>{const e=t?.avatarId?.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-");return e?` cf-avatar-preset--${e}`:""},QR={"support-guide":"SG","sales-host":"SH","calm-advisor":"CA","technical-guide":"TG","school-desk":"SD","front-office":"FO"},Rc=t=>{const e=t?.avatarId?.trim().toLowerCase();return e&&QR[e]||(t?jR(t.agentName):"·")},qx=({persona:t,small:e,hideWhenMissing:r})=>{const n=e?"cf-msg__avatar":"cf-header__avatar",a=t?.agentAvatarUrl?.trim();return a?_("span",{class:n,children:_("img",{src:a,alt:""})}):r?null:_("span",{class:`${n}${Zo(t)}`,children:Rc(t)})},JR=()=>{const t=_r(),[e,r]=V(0),n=["Understanding your question","Checking approved information","Preparing your answer"];return ie(()=>{const a=[window.setTimeout(()=>r(1),1800),window.setTimeout(()=>r(2),5e3)];return()=>a.forEach(i=>window.clearTimeout(i))},[]),_("div",{class:"cf-msg__bubble cf-typing","aria-label":t.assistantTyping,children:[_("span",{class:"cf-typing__label","aria-live":"polite",children:n[e]}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"})]})},e5=3,t5=({msg:t})=>{if(!t.sources||t.sources.length===0)return null;const e=new Set,r=[];for(const i of t.sources){const o=(i.url||i.title||"").toLowerCase();!o||e.has(o)||(e.add(o),r.push(i))}if(r.length===0)return null;const n=r.slice(0,e5),a=r.length-n.length;return _("div",{class:"cf-sources",children:[n.map((i,o)=>i.url?_("a",{class:"cf-source",href:i.url,target:"_blank",rel:"noopener noreferrer nofollow",title:i.title||i.url,children:[_(Lc,{}),_("span",{children:i.title||i.url})]},o):_("span",{class:"cf-source",title:i.title,children:[_(Lc,{}),_("span",{children:i.title})]},o)),a>0&&_("span",{class:"cf-source cf-source--more",children:["+",a," more"]})]})},r5=({replies:t,onPick:e})=>t&&t.length>0?_("div",{class:"cf-chips",children:t.map((r,n)=>_("button",{type:"button",class:"cf-chip",onClick:()=>e(r),children:r},n))}):null,n5=({persona:t,starters:e,onPick:r,onFocusComposer:n,speaking:a,voiceState:i="idle",replyPending:o=!1,pinned:s=!1,muted:l=!1,onToggleMute:c,onEndCall:u,onTalkNow:f,showTalkNow:h=!1,micLevel:d=0,theaterMode:p=!1,onToggleTheater:m,onMinimize:g,audioDevices:v=[],selectedAudioDeviceId:y="",onSelectAudioDevice:b,connectingOnly:x=!1})=>{if(!t||!(t.talkbackMode==="avatar"||t.widgetModule==="assistant"||t.allowVoiceInput))return null;const w=t.agentAvatarUrl?.trim()||"",k=t.assistantMediaUrl?.trim()||w,T=t.assistantMediaKind==="video"&&!!k,C=e.slice(0,3),A=i!=="idle",M=i!=="idle"?"End voice chat":`Speak with ${t.agentName}`,I=s&&!A&&!a,L=i==="connecting"||i==="processing"||A&&o,P=["cf-assistant-card__stage","cf-assistant-card__stage--local",A?"is-live":"",L?"is-thinking":"",i==="listening"&&!l?"is-listening":"",a||i==="speaking"?"is-speaking":"",l?"is-muted":""].filter(Boolean).join(" "),N=i==="listening"&&!l?{"--cf-listen":String(Math.max(.18,Math.min(1,d*8)))}:void 0,O=L&&_("span",{class:"cf-call-ripple","aria-hidden":"true",children:[_("span",{}),_("span",{}),_("span",{})]});if(x)return _("div",{class:"cf-assistant-card cf-assistant-card--connecting","aria-live":"polite",children:[_("div",{class:"cf-assistant-card__connecting-avatar",children:[w?_("img",{src:w,alt:""}):_("span",{class:`cf-assistant-card__connecting-face${Zo(t)}`,children:Rc(t)}),O]}),_("div",{class:"cf-assistant-card__connecting-copy",children:[_("span",{class:"cf-assistant-card__connecting-eyebrow",children:t.agentName}),_("strong",{children:"Connecting with the AI…"})]})]});const q=A&&u&&_(P5,{voiceState:i,muted:l,onToggleMute:c??(()=>{}),onEndCall:u,onTalkNow:f??(()=>{}),showTalkNow:h,micLevel:d,theaterMode:p,onToggleTheater:m??(()=>{}),onMinimize:g??(()=>{}),audioDevices:v,selectedAudioDeviceId:y,onSelectAudioDevice:b??(()=>{})});return I?_("div",{class:"cf-assistant-card cf-assistant-card--pinned cf-assistant-card--compact",children:_("button",{type:"button",class:"cf-assistant-card__compact-speak",onClick:n,children:[w?_("span",{class:"cf-assistant-card__compact-avatar",children:_("img",{src:w,alt:""})}):null,_("span",{class:"cf-assistant-card__compact-mic","aria-hidden":"true",children:_(Xo,{})}),_("span",{class:"cf-assistant-card__compact-label",children:M})]})}):_("div",{class:`cf-assistant-card ${s?"cf-assistant-card--pinned":""} ${a?"is-speaking":""}`,children:[(k||t.allowVoiceInput)&&_("div",{class:P,style:N,children:[_("div",{class:`cf-assistant-card__media ${k?"cf-assistant-card__media--uploaded":"cf-assistant-card__media--generated"}${Zo(t)}`,children:[T?_("video",{src:k,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):k?_("img",{src:k,alt:""}):_("div",{class:`cf-assistant-card__avatar-stage${Zo(t)}`,children:_("div",{class:"cf-assistant-card__face",children:[_("span",{class:"cf-assistant-card__initials",children:Rc(t)}),_("span",{class:"cf-assistant-card__eye cf-assistant-card__eye--left"}),_("span",{class:"cf-assistant-card__eye cf-assistant-card__eye--right"}),_("span",{class:"cf-assistant-card__mouth"})]})}),k&&!T&&_("span",{class:"cf-assistant-card__mouth cf-assistant-card__mouth--overlay"}),_("span",{class:"cf-avatar-aura cf-avatar-aura--one","aria-hidden":"true"}),_("span",{class:"cf-avatar-aura cf-avatar-aura--two","aria-hidden":"true"}),_("span",{class:"cf-avatar-listen-ring","aria-hidden":"true"}),_("span",{class:"cf-avatar-wave","aria-hidden":"true",children:[_("span",{}),_("span",{}),_("span",{}),_("span",{})]})]}),O,t.allowVoiceInput&&(q||_("button",{type:"button",class:"cf-assistant-card__speak",onClick:n,children:[_(Xo,{}),M]}))]}),!s&&_(Ae,{children:[t.agentDescription?_("p",{class:"cf-assistant-card__copy",children:t.agentDescription}):_("p",{class:"cf-assistant-card__copy",children:t.greeting}),C.length>0&&_("div",{class:"cf-assistant-card__chips",children:C.map(R=>_("button",{type:"button",class:"cf-assistant-card__chip",onClick:()=>r(R),children:R},R))}),t.disclaimerText||t.assistantPrivacyUrl?_("p",{class:"cf-assistant-card__privacy",children:[t.disclaimerText||"This chat may be recorded for quality and support.",t.assistantPrivacyUrl?_(Ae,{children:[" ",_("a",{href:t.assistantPrivacyUrl,target:"_blank",rel:"noopener noreferrer nofollow",children:"Privacy Policy"})]}):null]}):null]})]})},a5={calendar:MR,mail:Pc,phone:AR,lifebuoy:Pc},i5=t=>a5[t]??Pc,o5=t=>{if(t.id==="public_contact_support")return"contact-support";switch(t.endpoint){case"book-demo":return"book-demo";case"request-callback":return"request-callback";case"subscribe-newsletter":return"subscribe-newsletter";case"contact":return"contact";default:return"inquiry"}},s5={public_contact_support:{label:"Contact support",description:"Ask a teammate to join this conversation.",category:"support",icon:"lifebuoy",endpoint:"inquiry"},public_submit_inquiry:{label:"Leave a message",description:"Send your question and contact details.",category:"support",icon:"mail",endpoint:"inquiry"},public_book_demo:{label:"Book a demo",description:"Request a demo from the team.",category:"sales",icon:"calendar",endpoint:"book-demo"},public_request_callback:{label:"Request a callback",description:"Share your number and best time to call.",category:"sales",icon:"phone",endpoint:"request-callback"},public_subscribe_newsletter:{label:"Subscribe",description:"Get product updates.",category:"marketing",icon:"mail",endpoint:"subscribe-newsletter"}},l5=(t,e,r={})=>Array.isArray(t)?t.filter(n=>n.readiness!=="unavailable").map(n=>Xx(n,r[n.id])):(e??[]).flatMap(n=>{const a=s5[n];if(!a)return[];const i=o5({...a,id:n}),o=tp[i];return[{...a,id:n,presentation:i==="book-demo"?"booking":"form",formTitle:o.title,submitLabel:o.submit,fields:o.fields,delivery:"",prompt:"",shortLabel:a.label.toLowerCase(),enabled:!0,readiness:"available",legacyFallback:!0}]}).map(n=>Xx(n,r[n.id])),Xx=(t,e)=>{if(!e)return t;const r=e.fields??{};return{...t,...Object.fromEntries(Object.entries(e).filter(([n,a])=>n!=="fields"&&a!==void 0)),fields:t.fields.map(n=>({...n,...r[n.key]}))}},c5=(t,e)=>{const r=t.map(n=>n.label);return r.length===0?e.actionGetInTouch:r.length<=3?r.join(", "):`${r.slice(0,2).join(", ")} ${qt(e.actionMore,{count:String(r.length-2)})}`},u5=({field:t,value:e,onInput:r})=>{const n=t.placeholder??t.label,a={class:"cf-form__input",placeholder:t.required?`${n} *`:n,value:e,"aria-label":t.label,onInput:i=>r(i.target.value)};return t.kind==="textarea"?_("textarea",{rows:2,...a}):_("input",{type:t.kind,...a})},f5=({spec:t,visitor:e,onSubmit:r,onCancel:n})=>{const a=_r(),i=Yx(),[o,s]=V(()=>{const v={};for(const y of t.fields)y.identity&&e[y.identity]&&(v[y.key]=e[y.identity]);return v}),[l,c]=V("idle"),[u,f]=V(""),h=v=>!!(v.identity&&e[v.identity]?.trim()),d=t.fields.filter(v=>!h(v)),p=d.every(v=>!v.required||(o[v.key]?.trim()??"")!==""),m=e.email||e.name||"",g=async()=>{if(!p||l==="submitting")return;c("submitting");const v={},y={};for(const b of t.fields){const x=o[b.key]?.trim();x&&(v[b.key]=x,b.identity&&(y[b.identity]=x))}try{const b=await r(v,y);f(b.note||a.formThanks),c("done")}catch{c("error")}};return l==="done"?_("div",{class:"cf-form cf-form--done",children:[_(Ca,{}),_("span",{children:u})]}):_("div",{class:"cf-form",ref:i,children:[_("div",{class:"cf-form__title",children:t.title}),d.length===0&&m&&_("div",{class:"cf-form__as",children:qt(a.actionAs,{identity:m})}),d.map(v=>_(u5,{field:v,value:o[v.key]??"",onInput:y=>s(b=>({...b,[v.key]:y}))},v.key)),l==="error"&&_("div",{class:"cf-form__err",children:a.formError}),_("div",{class:"cf-form__actions",children:[n&&_("button",{type:"button",class:"cf-form__cancel",onClick:n,children:a.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:!p||l==="submitting",onClick:g,children:l==="submitting"?a.sending:t.submit})]})]})},Zx=t=>String(t).padStart(2,"0"),h5=()=>{const t=[];for(let e=9;e<=17;e++)t.push(`${Zx(e)}:00`),t.push(`${Zx(e)}:30`);return t},d5=t=>{const e=new Date;return e.setHours(0,0,0,0),Array.from({length:t},(r,n)=>{const a=new Date(e);return a.setDate(e.getDate()+n),a})},p5=(t,e)=>{const[r,n]=e.split(":").map(Number),a=new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0);try{return new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"}).format(a)}catch{return`${t.toDateString()} ${e}`}},an=(t,e)=>{const[r,n]=e.split(":").map(Number);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0)},v5=(t,e)=>{const r=an(t,e);try{return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(r)}catch{return e}},Kx=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}},g5=({visitor:t,onSubmit:e,onCancel:r,onDemoSlots:n,scheduler:a,title:i,submitLabel:o})=>{const s=i?.trim()||tp["book-demo"].title,l=o?.trim()||tp["book-demo"].submit,c=_r(),u=Yx(),f=!!(a?.connected&&a.mode==="event"&&(a.availability===void 0||a.availability.calendarIds.length>0)),h=Math.min(60,Math.max(1,a?.availability?.bookingWindowDays??14)),d=Kt(()=>d5(h),[h]),[p,m]=V(null),[g,v]=V(f?"loading":"request_only"),[y,b]=V(a?.availability?.slotDurationMinutes??30),[x,S]=V(Kx()||a?.availability?.timezone||""),w=Kt(()=>f?g!=="available"||p===null?[]:[...new Set([...p].map(G=>{const oe=new Date(G);return`${String(oe.getHours()).padStart(2,"0")}:${String(oe.getMinutes()).padStart(2,"0")}`}))].sort():h5(),[p,g,f]),k=Kt(()=>{const G=Date.now();for(let oe=0;oe<d.length;oe++)if(w.some(_e=>an(d[oe],_e).getTime()>G))return oe;return 0},[d,w]),[T,C]=V(k),[A,M]=V(null),[I,L]=V(t.name??""),[P,N]=V(t.email??""),[O,q]=V("idle"),[R,z]=V(""),[F,X]=V("");ie(()=>{if(!f||g!=="available"||p===null)return;const G=d.findIndex(oe=>w.some(_e=>p.has(an(oe,_e).getTime())));G>=0&&C(G)},[p,g,d,f,w]);const te=a?.connected&&a.mode==="link",fe=async()=>{if(O==="submitting"||!t.name?.trim()&&!I.trim()||!t.email?.trim()&&!P.trim())return;q("submitting");const G={};P.trim()&&(G.email=P.trim()),I.trim()&&(G.name=I.trim());try{const oe=await e({...P.trim()?{visitorEmail:P.trim()}:{},...I.trim()?{visitorName:I.trim()}:{}},G),_e=oe.booking?.schedulingLink||a?.bookingLink||"";if(!_e){q("error");return}try{window.open(_e,"_blank","noopener,noreferrer")}catch{}X(_e),z(oe.note||c.bookingLinkOpened),q("done")}catch{q("error")}},[me,we]=V(new Set),[Ze,Ie]=V([]),[tt,Ge]=V(0),[Me,re]=V(!1);ie(()=>{if(!n)return;let G=!0;const oe=new Date,_e=new Date;return _e.setDate(_e.getDate()+h+1),n(oe.toISOString(),_e.toISOString()).then(Oe=>{if(G)if(we(new Set(Oe.taken.map(Ue=>Date.parse(Ue)).filter(Ue=>!Number.isNaN(Ue)))),Ie(Oe.busy.map(Ue=>[Date.parse(Ue.start),Date.parse(Ue.end)]).filter(([Ue,br])=>!Number.isNaN(Ue)&&!Number.isNaN(br))),b(Oe.slotDurationMinutes??30),S(Kx()||Oe.timezone||""),f){if(Oe.status!=="available"||!Array.isArray(Oe.available)){m(null),v("unavailable");return}m(new Set(Oe.available.map(Ue=>Date.parse(Ue)).filter(Ue=>!Number.isNaN(Ue)))),v("available")}else v(Oe.status??"request_only")}).catch(()=>{!G||!f||(m(null),v("unavailable"))}),()=>{G=!1}},[h,f,n,tt]);const he=!!t.email?.trim(),Be=!!t.name?.trim(),pe=!!A&&(!f||g==="available")&&(Be||I.trim()!=="")&&(he||P.trim()!==""),Se=t.email||t.name||"",ct=G=>me.has(an(d[T],G).getTime()),pt=G=>an(d[T],G).getTime()<=Date.now(),sn=y*60*1e3,cr=G=>{const oe=an(d[T],G).getTime(),_e=oe+sn;return Ze.some(([Oe,Ue])=>oe<Ue&&_e>Oe)},Y=G=>!f||p?.has(an(d[T],G).getTime())===!0,le=async()=>{if(!pe||O==="submitting"||!A)return;q("submitting"),re(!1);const G=an(d[T],A),oe=p5(d[T],A),_e={};P.trim()&&(_e.email=P.trim()),I.trim()&&(_e.name=I.trim());try{const Oe=await e({preferredAt:oe,slotAt:G.toISOString(),...P.trim()?{visitorEmail:P.trim()}:{},...I.trim()?{visitorName:I.trim()}:{}},_e);Oe.booking?.confirmed?(z(Oe.note||qt(c.bookingConfirmed,{when:oe})),X(Oe.booking.meetingUrl||Oe.booking.eventLink||"")):z(Oe.note||qt(c.bookingRequested,{when:oe})),q("done")}catch(Oe){Oe?.status===409?(we(Ue=>new Set(Ue).add(G.getTime())),M(null),re(!0),Ge(Ue=>Ue+1),q("idle")):q("error")}};return O==="done"?_("div",{class:"cf-form cf-form--done",children:[_(Ca,{}),_("span",{children:R}),F&&_("a",{class:"cf-booking__link",href:F,target:"_blank",rel:"noopener noreferrer",children:[te?c.bookingOpenScheduler:c.bookingMeetingLink," ",_(Lc,{})]})]}):te?_("div",{class:"cf-form cf-booking",ref:u,children:[_("div",{class:"cf-form__title",children:s}),_("div",{class:"cf-booking__hint",children:qt(c.bookingViaProvider,{provider:a?.label??c.bookingSchedulerFallback})}),he?Se?_("div",{class:"cf-form__as",children:qt(c.actionAs,{identity:Se})}):null:_(Ae,{children:[!t.name?.trim()&&_("input",{class:"cf-form__input",type:"text",placeholder:`${c.handoffName} *`,value:I,"aria-label":c.handoffName,onInput:G=>L(G.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${c.handoffEmail} *`,value:P,"aria-label":c.handoffEmail,onInput:G=>N(G.target.value)})]}),O==="error"&&_("div",{class:"cf-form__err",children:c.formError}),_("div",{class:"cf-form__actions",children:[r&&_("button",{type:"button",class:"cf-form__cancel",onClick:r,children:c.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:O==="submitting"||!t.name?.trim()&&I.trim()===""||!he&&P.trim()==="",onClick:fe,children:O==="submitting"?c.sending:c.bookingOpenScheduler})]})]}):_("div",{class:"cf-form cf-booking",ref:u,children:[_("div",{class:"cf-form__title",children:s}),_("div",{class:"cf-booking__hint",children:[c.bookingPickTime," ·"," ",_("span",{class:"cf-booking__dur",children:qt(c.bookingDuration,{count:String(y)})}),x?` · ${qt(c.bookingTimezone,{timezone:x})}`:""]}),f&&g==="loading"?_("div",{class:"cf-booking__state",role:"status",children:c.bookingCheckingAvailability}):null,f&&g==="unavailable"?_("div",{class:"cf-form__err",role:"alert",children:c.bookingAvailabilityUnavailable}):null,f&&g==="available"&&w.length===0?_("div",{class:"cf-booking__state",role:"status",children:c.bookingNoSlots}):null,w.length>0?_("div",{class:"cf-booking__dates",role:"tablist","aria-label":c.bookingPickDay,children:d.map((G,oe)=>_("button",{type:"button",role:"tab","aria-selected":oe===T,disabled:f&&g==="available"&&!w.some(_e=>p?.has(an(G,_e).getTime())),class:`cf-booking__date ${oe===T?"is-selected":""}`,onClick:()=>{C(oe),M(null)},children:[_("span",{class:"cf-booking__dow",children:G.toLocaleDateString(void 0,{weekday:"short"})}),_("span",{class:"cf-booking__dom",children:G.getDate()})]},oe))}):null,w.length>0?_("div",{class:"cf-booking__slots",role:"listbox","aria-label":c.bookingPickTimeLabel,children:w.map(G=>{const oe=pt(G),_e=cr(G),Oe=ct(G),Ue=Y(G),br=Oe||oe||_e||!Ue;return _("button",{type:"button",role:"option","aria-selected":A===G,disabled:br,title:oe?c.bookingEarlierToday:_e?c.bookingCalendarBusy:Oe?c.bookingAlreadyBooked:Ue?void 0:c.bookingNotOffered,class:`cf-booking__slot ${A===G?"is-selected":""} ${br?"is-taken":""}`,onClick:()=>M(G),children:v5(d[T],G)},G)})}):null,Me&&_("div",{class:"cf-form__err",children:c.bookingSlotTaken}),Se?_("div",{class:"cf-form__as",children:qt(c.actionAs,{identity:Se})}):null,!Be&&_("input",{class:"cf-form__input",type:"text",placeholder:`${c.handoffName} *`,value:I,"aria-label":c.handoffName,onInput:G=>L(G.target.value)}),!he&&_(Ae,{children:_("input",{class:"cf-form__input",type:"email",placeholder:`${c.handoffEmail} *`,value:P,"aria-label":c.handoffEmail,onInput:G=>N(G.target.value)})}),O==="error"&&_("div",{class:"cf-form__err",children:c.formError}),_("div",{class:"cf-form__actions",children:[r&&_("button",{type:"button",class:"cf-form__cancel",onClick:r,children:c.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:!pe||O==="submitting",onClick:le,children:O==="submitting"?c.sending:l})]})]})},jx=({actions:t,descriptors:e,visitor:r,onSubmitForm:n,onDemoSlots:a,scheduler:i,exclude:o=[],openAction:s,translations:l={}})=>{const c=_r(),[u,f]=V(null),[h,d]=V(!1),p=W(null),m=W(null),g=W(!1),v=Kt(()=>`cf-actions-${Math.random().toString(36).slice(2,9)}`,[]),y=Kt(()=>l5(e,t,l).filter(T=>!o.includes(T.id)&&!o.includes(T.endpoint)),[e,t,o,l]);ie(()=>{s&&y.some(T=>T.id===s)&&(f(s),d(!0))},[s,y]);const b=u?y.find(T=>T.id===u):void 0,x=Q(()=>{g.current=!0,f(null),d(!1)},[]),S=Q(()=>f(null),[]);rv(()=>{h||!g.current||(g.current=!1,p.current?.focus())},[h]);const w=W({drawerOpen:h,activeId:u});if(w.current={drawerOpen:h,activeId:u},ie(()=>{const T=C=>{if(C.key!=="Escape")return;const{drawerOpen:A,activeId:M}=w.current;!A&&!M||(C.stopPropagation(),M?S():x())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[S,x]),ie(()=>{h&&m.current?.querySelector("button, input, textarea, select")?.focus()},[h,u]),y.length===0)return null;const k=h?b?_("div",{ref:m,id:v,class:"cf-action-drawer is-open",role:"dialog","aria-modal":"false","aria-label":b.formTitle||b.label,children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("strong",{children:b.formTitle||b.label}),b.legacyFallback?_("small",{class:"cf-action-test-mode",children:c.actionTestMode}):null]}),_("button",{type:"button",class:"cf-action-drawer__close","aria-label":c.actionClose,onClick:S,children:_(Ta,{})})]}),b.readiness==="degraded"&&b.readinessNote?_("p",{class:"cf-action-drawer__note cf-action-drawer__note--warn",role:"status",children:b.readinessNote}):null,(b.presentation??"form")==="booking"?_(g5,{visitor:r,title:b.formTitle,submitLabel:b.submitLabel,onCancel:S,onSubmit:(T,C)=>n(b.id,T,C,b.endpoint),onDemoSlots:a,scheduler:i}):_(f5,{spec:{title:b.formTitle||b.label,submit:b.submitLabel,fields:b.fields},visitor:r,onCancel:S,onSubmit:(T,C)=>n(b.id,T,C,b.endpoint)})]}):_("div",{ref:m,id:v,class:"cf-action-drawer cf-action-drawer--menu",role:"dialog","aria-modal":"false","aria-label":c.actionChoose,children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("span",{class:"cf-action-drawer__eyebrow",children:c.actionNeedHelp}),_("strong",{children:c.actionChoose})]}),_("button",{type:"button",class:"cf-action-drawer__close","aria-label":c.actionClose,onClick:x,children:_(Ta,{})})]}),_("div",{class:"cf-action-drawer__grid",children:y.map(T=>{const C=i5(T.icon);return _("button",{type:"button",class:"cf-action-card",onClick:()=>f(T.id),children:[_("span",{class:"cf-action-card__icon",children:_(C,{})}),_("span",{class:"cf-action-card__copy",children:[_("strong",{children:T.label}),T.legacyFallback?_("small",{class:"cf-action-test-mode",children:c.actionTestMode}):null,_("small",{children:T.description}),T.readiness==="degraded"&&T.readinessNote?_("small",{class:"cf-action-card__warn",children:T.readinessNote}):null]}),_(Ti,{})]},T.id)})}),_("p",{class:"cf-action-drawer__note",children:c.actionFooter})]}):null;return _("div",{class:"cf-action-shell",children:[_("button",{ref:p,type:"button",class:"cf-action-trigger",hidden:h,"aria-expanded":h,"aria-controls":v,onClick:()=>h?x():d(!0),children:[_("span",{class:"cf-action-trigger__icon",children:_(Pc,{})}),_("span",{class:"cf-action-trigger__copy",children:[_("strong",{children:c.actionContactOptions}),_("small",{children:c5(y,c)})]}),_(Ti,{})]}),k]})},m5=({hasEmail:t,visitor:e,question:r,onSubmitForm:n})=>{const a=_r(),[i,o]=V(!1),[s,l]=V(!1),[c,u]=V(e.name??""),[f,h]=V(e.email??"");if(t)return _("div",{class:"cf-handoff cf-handoff--done",children:[_(Ca,{}),_("span",{children:"We’ve alerted the team. If someone is available, they can continue here."})]});if(i){const p=e.email||f;return _("div",{class:"cf-handoff cf-handoff--done",children:[_(Ca,{}),_("span",{children:qt(a.handoffShared,{email:p})})]})}const d=async()=>{if(!(!f.trim()||s)){l(!0);try{await n("inquiry",{visitorEmail:f.trim(),...c.trim()?{visitorName:c.trim()}:{},message:r||"I had a question the assistant couldn’t answer.",subject:"Help request from chat"},{email:f.trim(),name:c.trim()||void 0}),o(!0)}catch{l(!1)}}};return _("div",{class:"cf-handoff",children:[_("div",{class:"cf-handoff__title",children:a.handoffTitle}),_("input",{class:"cf-form__input",type:"text",placeholder:a.handoffName,value:c,"aria-label":a.handoffName,onInput:p=>u(p.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${a.handoffEmail} *`,value:f,"aria-label":a.handoffEmail,onInput:p=>h(p.target.value)}),_("button",{type:"button",class:"cf-form__submit",disabled:!f.trim()||s,onClick:d,children:s?a.sending:a.handoffNotify})]})},y5=({text:t})=>{const e=_r(),[r,n]=V(!1);return _("button",{type:"button",class:"cf-tool",onClick:async()=>{try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),1500)}catch{}},"aria-label":e.copy,children:[r?_(Ca,{}):_(PR,{}),r?e.copied:e.copy]})},_5=({items:t,onPick:e})=>t.length===0?null:_("div",{class:"cf-starters",children:t.map((r,n)=>_("button",{type:"button",class:"cf-starter",onClick:()=>e(r),children:r},n))}),b5=({items:t})=>{const e=t.filter(r=>r.label.trim()&&r.url.trim()).slice(0,4);return e.length===0?null:_("div",{class:"cf-featured-links",children:e.map((r,n)=>_("a",{class:"cf-featured-link",href:r.url,target:"_blank",rel:"noopener noreferrer nofollow",title:r.label,children:[_(Lc,{}),_("span",{children:r.label})]},`${r.url}-${n}`))})},x5=({msg:t,onRate:e})=>{const r=_r(),[n,a]=V(!1),[i,o]=V(""),s=t.feedback,l=()=>{e(t.id,"up"),a(!1)},c=()=>{e(t.id,"down"),a(!0)},u=()=>{e(t.id,"down",i.trim()),a(!1)};return _("div",{class:"cf-feedback",children:[_("div",{class:"cf-feedback__row",children:[_("button",{type:"button",class:`cf-feedback__btn ${s==="up"?"is-active":""}`,"aria-label":r.feedbackHelpful,"aria-pressed":s==="up",onClick:l,children:_(Gx,{})}),_("button",{type:"button",class:`cf-feedback__btn ${s==="down"?"is-active":""}`,"aria-label":r.feedbackNotHelpful,"aria-pressed":s==="down",onClick:c,children:_($x,{})}),s&&!n&&_("span",{class:"cf-feedback__thanks",children:r.feedbackThanks})]}),n&&s==="down"&&_("div",{class:"cf-feedback__comment",children:[_("textarea",{class:"cf-feedback__input",rows:2,placeholder:r.feedbackCommentPlaceholder,value:i,onInput:f=>o(f.target.value)}),_("button",{type:"button",class:"cf-feedback__send",onClick:u,children:r.feedbackSend})]})]})},w5=({msg:t,persona:e,isLast:r,visitor:n,hasEmail:a,lastQuestion:i,showActions:o,onPickReply:s,onSubmitForm:l,onDemoSlots:c,onRetry:u,ratable:f,onRate:h,onExpandVisualization:d})=>{const p=_r(),m=t.role==="user",g=t.liveEventType??"",v=t.content.trim().toLowerCase(),y=g==="handoff_queued"||g==="agent_joined"||g==="agent_left"||g==="conversation_ended"||v.includes("joined the chat")||v.includes("left the chat")||v.includes("support agents will be with you"),b=t.role==="system"||y,x=t.requestedContactFields?.includes("email")===!0,S=r&&!m&&!b&&!!(t.handoffOffered||x),w=S&&!a?["inquiry"]:[],k=!t.pending&&!t.streaming,T=[...t.artifacts??[],...t.visualization&&!(t.artifacts??[]).some(C=>C.type==="visualization")?[{type:"visualization",visualization:t.visualization}]:[]];return b?_("div",{class:"cf-msg cf-msg--system",children:_("div",{class:"cf-system-event",children:[_("div",{class:"cf-system-event__mark","aria-hidden":"true"}),_("div",{class:"cf-system-event__text",children:t.content}),t.createdAt&&_("div",{class:"cf-system-event__time",children:new Date(t.createdAt).toLocaleString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"})})]})}):_("div",{class:`cf-msg cf-msg--${m?"user":"agent"}`,children:[!m&&_(qx,{persona:e,small:!0}),_("div",{class:"cf-msg__col",children:[t.pending&&t.content===""?_(JR,{}):t.imageUrl?_("div",{class:"cf-msg__bubble cf-msg__bubble--media",children:[_("img",{class:"cf-msg__media",src:t.imageUrl,alt:"GIF"}),t.content&&_("span",{class:"cf-msg__caption",children:t.content})]}):_("div",{class:"cf-msg__bubble",children:[m?t.content:$R(t.content),t.streaming&&_("span",{class:"cf-caret","aria-hidden":"true"})]}),m?null:T.map((C,A)=>C.type==="visualization"&&C.visualization?_(Qx,{visualization:C.visualization,onExpand:d?()=>d(t.id):void 0,expandControlId:t.id},`visualization-${A}`):C.type==="image"&&(C.data||C.uri?.startsWith("https://"))&&["image/png","image/jpeg","image/webp"].includes(C.mimeType??"")?_("figure",{class:"cf-artifact",children:[C.title?_("figcaption",{children:C.title}):null,_("img",{src:C.uri||`data:${C.mimeType};base64,${C.data}`,alt:C.altText||C.caption||C.title||"Tool result"}),C.caption&&C.caption!==C.title?_("p",{children:C.caption}):null]},`image-${A}`):C.type==="resource_link"&&C.uri?.startsWith("https://")?_("a",{class:"cf-artifact-link",href:C.uri,target:"_blank",rel:"noopener noreferrer nofollow",children:[_("strong",{children:C.title||C.name||"Open result"}),C.caption?_("span",{children:C.caption}):null]},`link-${A}`):null),!m&&t.visualization&&op(t.visualization)?_(KR,{explanation:op(t.visualization),onFollowUp:s,showLead:!t.content.toLocaleLowerCase().includes(op(t.visualization).headline.toLocaleLowerCase())}):null,m&&t.attachmentName&&_("div",{class:"cf-attach-chip",title:t.attachmentName,children:[_(np,{}),_("span",{children:t.attachmentName})]}),!m&&_(Ae,{children:[k&&(t.error||t.content)&&_("div",{class:"cf-msg__actions",children:[_("div",{class:"cf-msg__tools",children:t.error?_("button",{type:"button",class:"cf-tool",onClick:()=>u(t.id,t.retryText??""),children:[_(RR,{}),p.retry]}):_(y5,{text:t.content})}),f&&!t.error&&t.content&&_(x5,{msg:t,onRate:h})]}),_(t5,{msg:t}),r&&_(r5,{replies:t.suggestedReplies,onPick:s}),S&&_(m5,{hasEmail:a,visitor:n,question:i,onSubmitForm:l}),o&&_(jx,{actions:t.availableActions,descriptors:t.actions,openAction:t.selectedAction,visitor:n,onSubmitForm:l,onDemoSlots:c,scheduler:e?.scheduler,exclude:w})]})]})]})},Qx=({visualization:t,expanded:e=!1,onExpand:r,onClose:n,expandControlId:a})=>{const i=W(null),o=Kt(()=>Jd(t),[t]),[s,l]=V(o?.type);ie(()=>l(o?.type),[o]);const c=Kt(()=>hR(t),[t]),u=Kt(()=>Jd(t,s),[s,t]),f=s??u?.type??o?.type,h=c.find(b=>b.type===f),d=t.rows??[],p=t.columns?.length?t.columns:Object.keys(d[0]??{}),m=p.map(b=>{const x=t.columnMetadata?.find(S=>S.key===b);return x?{key:b,label:x.label,dataType:x.dataType,currencyCode:x.currencyCode}:b});if(d.length===0)return _(XR,{});const g=_(YR,{answeredAt:t.freshness?.answeredAt,reportingPeriod:t.reportingPeriod,filters:t.appliedFilters,rowCount:t.rowCount??d.length}),v=()=>t.tableAvailable===!1||p.length===0?null:_("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:t.title?.trim()||"Result details"}),g]}),_("div",{class:"cf-analytics-visualization__actions",children:[t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>Jx(p,d),children:"Download"}):null,e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Ta,{})}):r&&t.expandable!==!1?_("button",{type:"button",class:"cf-analytics-visualization__expand","aria-label":"Expand table","data-visualization-message":a,onClick:r,children:_(ip,{})}):null]})]}),_(mR,{rows:d,columns:m,maxRows:100,expanded:e,classPrefix:"cf"})]});if(t.presentation==="table"||!t.presentation&&t.type==="table")return v();const y=t.chartRecommendation?.valueFields?.[0]??t.valueFields?.[0]??t.value??p[1];if(t.presentation==="kpi"||!t.presentation&&t.type==="kpi"){const b=d[0]?.[y??p[0]??""],x=typeof b=="number"?b:Number(b),S=t.columnMetadata?.find(k=>k.key===y),w=Number.isFinite(x)?qo(x,S,t):String(b??"No value");return _("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:"Live metric"}),g]}),e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Ta,{})}):null]}),_(qR,{label:S?.label??y??"Current value",value:w})]})}return u?_("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:u.title}),g]}),_("div",{class:"cf-analytics-visualization__actions",children:[c.length>1?_("details",{ref:i,class:"cf-analytics-chart-picker",children:[_("summary",{"aria-label":"Choose chart type",title:"Choose chart type",children:[_("span",{class:"cf-analytics-chart-picker__current",children:[_(Ux,{type:f??u.type}),_("span",{children:h?.label??"Chart"})]}),_(Ti,{})]}),_("div",{class:"cf-analytics-chart-picker__menu",role:"listbox","aria-label":"Chart type",children:c.map(b=>{const x=b.type===f;return _("button",{type:"button",role:"option","aria-selected":x,class:x?"is-selected":"",onClick:()=>{l(b.type),i.current&&(i.current.open=!1)},children:[_("span",{class:"cf-analytics-chart-picker__icon",children:_(Ux,{type:b.type})}),_("span",{class:"cf-analytics-chart-picker__copy",children:[_("strong",{children:b.label}),_("small",{children:ZR(b.type)})]}),x?_(Ca,{}):null]},b.type)})})]}):null,e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Ta,{})}):r&&t.expandable!==!1?_("button",{type:"button",class:"cf-analytics-visualization__expand","aria-label":"Expand chart","data-visualization-message":a,onClick:r,children:_(ip,{})}):null]})]}),_(vR,{model:u,expanded:e}),t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>Jx(p,d),children:"Download this data"}):null]}):v()},Jx=(t,e)=>{if(typeof document>"u"||t.length===0)return;const r=gR(e,t),n=URL.createObjectURL(new Blob([r],{type:"text/csv;charset=utf-8"})),a=document.createElement("a");a.href=n,a.download="analytics-result.csv",a.click(),URL.revokeObjectURL(n)},e1=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result).split(",")[1]??""),n.onerror=r,n.readAsDataURL(t)}),S5=({onPick:t})=>_("div",{class:"cf-picker cf-emoji",children:xR.map(e=>_("div",{class:"cf-emoji__group",children:[_("div",{class:"cf-emoji__label",children:e.name}),_("div",{class:"cf-emoji__grid",children:e.emojis.map((r,n)=>_("button",{type:"button",class:"cf-emoji__btn",onClick:()=>t(r),"aria-label":r,children:r},n))})]},e.name))}),k5=({onSearch:t,onPick:e})=>{const r=_r(),[n,a]=V(""),[i,o]=V([]),[s,l]=V(!0);return ie(()=>{let c=!0;l(!0);const u=setTimeout(()=>{t(n).then(f=>c&&(o(f),l(!1))).catch(()=>c&&(o([]),l(!1)))},300);return()=>{c=!1,clearTimeout(u)}},[n,t]),_("div",{class:"cf-picker cf-gif",children:[_("input",{class:"cf-gif__search",placeholder:r.searchGifs,value:n,"aria-label":r.searchGifs,onInput:c=>a(c.target.value)}),_("div",{class:"cf-gif__grid",children:s?_("div",{class:"cf-gif__hint",children:r.searchingGifs}):i.length===0?_("div",{class:"cf-gif__hint",children:r.noGifs}):i.map(c=>_("button",{type:"button",class:"cf-gif__item",onClick:()=>e(c.url),"aria-label":c.alt,children:_("img",{src:c.preview,alt:c.alt,loading:"lazy"})},c.id))}),_("div",{class:"cf-gif__powered",children:"via Tenor"})]})},T5=8*1024*1024,C5="image/png,image/jpeg,image/webp,image/gif,application/pdf",M5=12e3,A5=250,D5=t=>{switch(t){case"connecting":return"Connecting with AI…";case"listening":return"Listening now — go ahead.";case"speaking":return"AI is speaking — talk to interrupt.";case"processing":return"Understanding what you said…";case"noise":return"I couldn't hear clear words. Try again closer to the mic.";case"misunderstood":return"I didn't understand that. Please try again.";case"denied":return"Microphone access is blocked. Allow the mic or type your question.";case"muted":return"Muted — tap the mic to unmute.";case"timeout":return"Didn't hear anything for a while — ending the call.";default:return""}},I5=.004,t1=({muted:t,listening:e,micLevel:r,onToggleMute:n})=>{const a=e&&r>=I5;return _("button",{type:"button",class:`cf-call-btn ${t?"is-muted":""} ${e?"is-listening":""} ${a?"is-hot":""}`,"aria-label":t?"Unmute microphone":"Mute microphone","aria-pressed":t,onClick:n,style:e?{"--cf-wave":String(Math.max(.2,Math.min(1,r*6)))}:void 0,children:t?_(CR,{}):_(Xo,{})})},L5=({audioDevices:t,selectedAudioDeviceId:e,onSelectAudioDevice:r})=>{const[n,a]=V(!1),i=W(null);ie(()=>{if(!n)return;const s=l=>{i.current&&!l.composedPath().includes(i.current)&&a(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[n]);const o=[{deviceId:"",label:"Default microphone"},...t];return _("div",{class:"cf-call-more",ref:i,children:[_("button",{type:"button",class:"cf-call-btn cf-call-btn--microphones","aria-label":"Choose microphone","aria-expanded":n,onClick:()=>a(s=>!s),children:_(Ti,{})}),n&&_("div",{class:"cf-call-menu",role:"menu",children:[_("div",{class:"cf-call-menu__label",children:"Microphone"}),o.map(s=>_("button",{type:"button",role:"menuitemradio","aria-checked":s.deviceId===e,class:`cf-call-menu__item ${s.deviceId===e?"is-active":""}`,onClick:()=>{r(s.deviceId),a(!1)},children:[s.deviceId===e?_(Ca,{}):_("span",{class:"cf-call-menu__spacer"}),_("span",{children:s.label})]},s.deviceId))]})]})},P5=({voiceState:t,muted:e,onToggleMute:r,onEndCall:n,onTalkNow:a,showTalkNow:i,micLevel:o,theaterMode:s,onToggleTheater:l,onMinimize:c,audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:h})=>_("div",{class:"cf-call-controls",children:[_(t1,{muted:e,listening:t==="listening"&&!e,micLevel:o,onToggleMute:r}),_(L5,{audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:h}),i&&_("button",{type:"button",class:"cf-call-btn cf-call-btn--talk","aria-label":"Talk now",onClick:a,children:_(Xo,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":s?"Exit expanded view":"Expand view","aria-pressed":s,onClick:l,children:s?_(NR,{}):_(ip,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":"Minimize voice chat",onClick:c,children:_(BR,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:n,children:_(ap,{})})]}),R5=({persona:t,voiceState:e,muted:r,onToggleMute:n,onEndCall:a,micLevel:i,onExpand:o})=>{const s=h=>h.stopPropagation(),l=t?.assistantMediaUrl?.trim()||t?.agentAvatarUrl?.trim()||"",c=t?.assistantMediaKind==="video"&&!!l,u=t?.agentName||"Assistant",f=["cf-floating-call-card",e==="listening"&&!r?"is-listening":"",e==="speaking"?"is-speaking":"",e==="processing"||e==="connecting"?"is-thinking":"",r?"is-muted":""].filter(Boolean).join(" ");return _("div",{class:f,style:e==="listening"&&!r?{"--cf-listen":String(Math.max(.18,Math.min(1,i*8)))}:void 0,role:"button",tabIndex:0,"aria-label":`Reopen voice chat with ${u}`,onClick:o,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),o())},children:[_("div",{class:"cf-floating-call-card__media","aria-hidden":"true",children:l?c?_("video",{src:l,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):_("img",{src:l,alt:""}):_("div",{class:`cf-floating-call-card__avatar${Zo(t)}`,children:[_("span",{children:Rc(t)}),_("span",{class:"cf-floating-call-card__eye cf-floating-call-card__eye--left"}),_("span",{class:"cf-floating-call-card__eye cf-floating-call-card__eye--right"}),_("span",{class:"cf-floating-call-card__mouth"})]})}),_("div",{class:"cf-floating-call-card__shade","aria-hidden":"true"}),_("div",{class:"cf-floating-call-card__controls",onClick:s,onKeyDown:s,role:"presentation",children:[_(t1,{muted:r,listening:e==="listening"&&!r,micLevel:i,onToggleMute:n}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--restore","aria-label":"Restore voice chat",onClick:h=>{s(h),o()},children:_(zR,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:h=>{s(h),a()},children:_(ap,{})})]})]})},E5=(t,e)=>{switch(t){case"connecting":return e.voiceConnecting;case"listening":return e.voiceListening;case"processing":return e.voiceProcessing;case"speaking":return e.voiceSpeaking;case"noise":return e.voiceNoise;case"misunderstood":return e.voiceMisunderstood;case"denied":return e.voiceDenied;default:return D5(t)}},O5=({draftStore:t,onSend:e,onSendGif:r,onTyping:n,disabled:a,allowVoice:i,onTranscribe:o,gifEnabled:s,onSearchGifs:l,allowAttach:c,onExtract:u,voiceStartSignal:f=0,onVoiceStateChange:h})=>{const d=_r(),[p,m]=V(()=>t.value),g=Y=>{const le=typeof Y=="function"?Y(p):Y;t.value=le,m(le)},[v,y]=V(!1),[b,x]=V(!1),[S,w]=V("idle"),[k,T]=V("none"),[C,A]=V(null),[M,I]=V(!1),[L,P]=V(!1),[N,O]=V(""),q=W(null),R=W(null),z=W(null),F=W(0),X=W(null),te=W([]),fe=W(void 0),me=W(null),we=W(void 0),Ze=W(0),Ie=Y=>{w(Y),h?.(Y)},tt=()=>{fe.current&&window.clearTimeout(fe.current),fe.current=void 0,we.current&&cancelAnimationFrame(we.current),we.current=void 0,me.current?.close().catch(()=>{}),me.current=null};ie(()=>{const Y=q.current;Y&&(Y.style.height="auto",Y.style.height=`${Math.min(Y.scrollHeight,110)}px`)},[p]),ie(()=>()=>{C?.previewUrl&&URL.revokeObjectURL(C.previewUrl)},[C?.previewUrl]),ie(()=>{if(k==="none")return;const Y=le=>{R.current&&!le.composedPath().includes(R.current)&&T("none")};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[k]);const Ge=Y=>T(le=>le===Y?"none":Y),Me=Y=>{const le=q.current;if(!le){g(_e=>_e+Y);return}const G=le.selectionStart??p.length,oe=le.selectionEnd??p.length;g(p.slice(0,G)+Y+p.slice(oe)),requestAnimationFrame(()=>{le.focus();const _e=G+Y.length;le.setSelectionRange(_e,_e)})},re=Y=>{T("none"),r(Y)},he=async Y=>{if(!Y)return;const le=++F.current;if(O(""),Y.size>T5){O(d.attachTooLarge);return}I(!0);try{const G=await e1(Y),oe=await u(G,Y.type||"application/octet-stream",Y.name);if(le!==F.current)return;if(!oe){O(d.attachFailed);return}A({name:Y.name,text:oe,mimeType:Y.type||"application/octet-stream",size:Y.size,previewUrl:Y.type.startsWith("image/")?URL.createObjectURL(Y):void 0})}catch{O(d.attachFailed)}finally{le===F.current&&I(!1)}},Be=async Y=>{const le=Y.target,G=le.files?.[0];le.value="",await he(G)},pe=()=>{F.current+=1,I(!1),O("")},Se=(!!p.trim()||!!C)&&!a&&!M&&!b,ct=()=>{Se&&(e(p,C?{attachmentName:C.name,attachmentText:C.text}:void 0),n?.(!1),g(""),A(null),O(""))},pt=Y=>{const le=Y.trim();if(!le||a){Ie("misunderstood"),window.setTimeout(()=>Ie("idle"),2500);return}const G=p.trim(),oe=G?`${G} ${le}`:le;e(oe),n?.(!1),g(""),A(null),O(""),Ie("idle")},sn=Y=>{if(Y.key==="Enter"&&!Y.shiftKey){if(a)return;Y.preventDefault(),ct()}else Y.key==="Escape"&&k!=="none"&&(Y.preventDefault(),Y.stopPropagation(),T("none"))},cr=async()=>{if(v){Fr(X.current);return}try{Ie("connecting");const Y=await navigator.mediaDevices.getUserMedia({audio:Fx()}),le=ep(Y);te.current=[],Ze.current=0;try{const G=window.AudioContext??window.webkitAudioContext;if(G){const oe=new G;me.current=oe;const _e=oe.createMediaStreamSource(Y),Oe=oe.createAnalyser();Oe.fftSize=512,_e.connect(Oe);const Ue=new Uint8Array(Oe.frequencyBinCount),br=()=>{Oe.getByteTimeDomainData(Ue);let Ai=0;for(const ln of Ue){const Di=(ln-128)/128;Ai+=Di*Di}Ze.current=Math.max(Ze.current,Math.sqrt(Ai/Ue.length)),we.current=requestAnimationFrame(br)};br()}}catch{}le.ondataavailable=G=>G.data.size>0&&te.current.push(G.data),le.onstop=async()=>{tt(),Y.getTracks().forEach(oe=>oe.stop()),y(!1);const G=new Blob(te.current,{type:le.mimeType||"audio/webm"});if(G.size===0||G.size<900||Ze.current<.006){Ie("noise"),window.setTimeout(()=>Ie("idle"),3200);return}x(!0),Ie("processing");try{const oe=await e1(G);if(!oe.trim()){Ie("noise"),window.setTimeout(()=>Ie("idle"),3200);return}const _e=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0,Oe=await o(oe,G.type,_e);pt(Oe)}catch{Ie("misunderstood"),window.setTimeout(()=>Ie("idle"),3e3)}finally{x(!1)}},X.current=le,le.start(A5),y(!0),Ie("listening"),fe.current=window.setTimeout(()=>{Fr(X.current)},M5)}catch{Ie("denied"),window.setTimeout(()=>Ie("idle"),3500)}};return ie(()=>{!f||!i||a||v||b||cr()},[f]),ie(()=>()=>{tt();const Y=X.current;if(Y){if(Y.ondataavailable=null,Y.onstop=null,Y.onerror=null,Y.state!=="inactive")try{Y.stop()}catch{}Y.stream.getTracks().forEach(le=>le.stop())}X.current=null,te.current=[]},[]),_("div",{class:`cf-composer ${L?"is-dragging":""}`,ref:R,onDragEnter:Y=>{c&&(Y.preventDefault(),P(!0))},onDragOver:Y=>{c&&Y.preventDefault()},onDragLeave:Y=>{Y.currentTarget===Y.target&&P(!1)},onDrop:Y=>{c&&(Y.preventDefault(),P(!1),he(Y.dataTransfer?.files?.[0]))},children:[k==="emoji"&&_(S5,{onPick:Me}),k==="gif"&&_(k5,{onSearch:l,onPick:re}),(C||M||N)&&_("div",{class:"cf-attach-row",children:M?_("span",{class:"cf-attach-status",children:[_("span",{children:d.attaching}),_("button",{type:"button",onClick:pe,children:d.cancel})]}):N?_("span",{class:"cf-attach-status cf-attach-status--err",children:N}):C&&_("span",{class:"cf-attach-chip",title:C.name,children:[C.previewUrl?_("img",{class:"cf-attach-preview",src:C.previewUrl,alt:""}):_(np,{}),_("span",{class:"cf-attach-copy",children:[_("span",{children:C.name}),_("small",{children:[Math.max(1,Math.ceil(C.size/1024))," KB"]})]}),_("button",{type:"button",class:"cf-attach-x","aria-label":d.removeAttachment,onClick:()=>A(null),children:_(Ta,{})})]})}),S!=="idle"&&_("div",{class:"cf-voice-state","aria-live":"polite",children:[_("span",{class:`cf-voice-state__dot ${v?"is-live":""}`}),E5(S,d)]}),_("div",{class:"cf-composer__field",children:[_("button",{type:"button",class:`cf-iconbtn ${k==="emoji"?"is-active":""}`,"aria-label":d.emoji,"aria-pressed":k==="emoji",onClick:()=>Ge("emoji"),children:k==="emoji"?_(Ta,{}):_(DR,{})}),s&&_("button",{type:"button",class:`cf-iconbtn cf-gifbtn ${k==="gif"?"is-active":""}`,"aria-label":d.gifs,"aria-pressed":k==="gif",onClick:()=>Ge("gif"),children:_("span",{class:"cf-gif-label",children:"GIF"})}),c&&_(Ae,{children:[_("input",{ref:z,type:"file",class:"cf-file-input",accept:C5,onChange:Be,tabIndex:-1,"aria-hidden":"true"}),_("button",{type:"button",class:"cf-iconbtn","aria-label":d.attachFile,disabled:M,onClick:()=>z.current?.click(),children:_(np,{})})]}),_("textarea",{ref:q,class:"cf-textarea",rows:1,placeholder:d.composerPlaceholder,value:p,"aria-label":d.composerPlaceholder,"aria-busy":a,onInput:Y=>{const le=Y.target.value;g(le),n?.(!!le.trim())},onPaste:Y=>{const le=Y.clipboardData?.files?.[0];!c||!le||(Y.preventDefault(),he(le))},onKeyDown:sn}),i&&_("button",{type:"button",class:`cf-iconbtn cf-mic ${v?"is-recording":""}`,"aria-label":v?d.stopRecording:d.recordVoice,"aria-pressed":v,disabled:b||a,onClick:cr,children:_(Xo,{})}),_("button",{type:"button",class:"cf-send","aria-label":d.send,disabled:!Se,onClick:ct,children:_(TR,{})})]})]})};let r1=!0,Ko=null;const N5=t=>{r1=t},B5=()=>{const t=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!t)return null;if(!Ko)try{Ko=new t}catch{return null}return Ko.state==="suspended"&&Ko.resume(),Ko},jo=(t,e,r,n,a,i)=>{const o=t.createOscillator(),s=t.createGain();o.type=a,o.frequency.setValueAtTime(e,r),o.connect(s),s.connect(t.destination),s.gain.setValueAtTime(1e-4,r),s.gain.exponentialRampToValueAtTime(i,r+.012),s.gain.exponentialRampToValueAtTime(1e-4,r+n),o.start(r),o.stop(r+n+.03)},Mi=t=>{if(!r1)return;const e=B5();if(!e)return;const r=e.currentTime;try{t==="open"?(jo(e,523,r,.12,"sine",.05),jo(e,784,r+.08,.16,"sine",.05)):t==="send"?jo(e,660,r,.08,"triangle",.04):t==="receive"&&(jo(e,880,r,.1,"sine",.045),jo(e,1175,r+.09,.14,"sine",.045))}catch{}},z5=(t,e)=>t?.status===429?e.errorRateLimit:e.errorGeneric,sp=()=>typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),lp=(t,e)=>{const r=sp(),n={stage:t,durationMs:Math.max(0,r-e)};try{performance.measure(`centrinfo-widget:${t}`,{start:e,end:r})}catch{}return typeof window<"u"&&typeof CustomEvent<"u"&&window.dispatchEvent(new CustomEvent("centrinfo:performance",{detail:n})),n},F5=/!?\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,H5=/https?:\/\/[^\s)]+/g,V5=t=>t.replace(/```[\s\S]*?```/g,e=>e.replace(/^```[^\n]*\n?/,"").replace(/```$/,"").trim()),G5=t=>V5(t).replace(F5,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/(^|[\s([{])\*([^*\n]{1,120})\*(?=[\s.,;:!?)}\]]|$)/g,"$1$2").replace(/(^|[\s([{])_([^_\n]{1,120})_(?=[\s.,;:!?)}\]]|$)/g,"$1$2").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s{0,3}[-*+]\s+/gm,"").replace(/^\s{0,3}\d+\.\s+/gm,"").replace(/\s+\*/g," ").replace(/\*\s+/g," ").replace(/[*_]{2,}/g,"").replace(H5,e=>e.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,"")).replace(/[ \t]+\n/g,`
|
|
27
|
+
`)})},n++));continue}if(i.trim()===""){a++;continue}const o=/^(#{1,6})\s+(.*)$/.exec(i);if(o){r.push(P5(o[1].length,Wi(o[2]),n++)),a++;continue}if(/^\s*[-*•]\s+/.test(i)){const u=[];for(;a<e.length&&/^\s*[-*•]\s+/.test(e[a]);)u.push(_("li",{children:Wi(e[a].replace(/^\s*[-*•]\s+/,""))},u.length)),a++;r.push(_("ul",{class:"cf-md-list",children:u},n++));continue}if(/^\s*\d+\.\s+/.test(i)){const u=[];for(;a<e.length&&/^\s*\d+\.\s+/.test(e[a]);)u.push(_("li",{children:Wi(e[a].replace(/^\s*\d+\.\s+/,""))},u.length)),a++;r.push(_("ol",{class:"cf-md-list",children:u},n++));continue}const s=[i];for(a++;a<e.length&&e[a].trim()!==""&&!L5.test(e[a]);)s.push(e[a]),a++;const l=s.join(" ");if(/:\s*$/.test(l)&&a<e.length&&/^(?:\s*[-*•]\s+|\s*\d+\.\s+)/.test(e[a])){const u=/^(.*[.!?])\s+([^.!?]{2,120}:)$/.exec(l);u&&r.push(_("p",{children:Wi(u[1])},n++)),r.push(_("p",{class:"cf-md-list-intro",children:Wi(u?.[2]??l)},n++))}else r.push(_("p",{children:Wi(l)},n++))}return r},E5=t=>{const e=(t??"").trim().toLowerCase().replaceAll("-","_");return e==="low"||e==="low_quality"?"Low-confidence forecast":e==="medium"||e==="directional"?"Directional forecast":e==="high"||e==="validated"||e==="trusted"?"Validated forecast":"Forecast estimate"},O5=t=>{if(!t)return"Live data";const e=new Date(t);return Number.isNaN(e.getTime())?"Live data":`Updated ${new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(e)}`},N5=({answeredAt:t,reportingPeriod:e,filters:r=[],rowCount:n})=>_("div",{class:"cf-analytics-meta","data-testid":"analytics-result-meta","aria-label":"Result details",children:[_("span",{children:[_("span",{"aria-hidden":"true",class:"cf-analytics-meta__dot"}),O5(t)]}),e?.label?_("span",{children:e.label}):null,typeof n=="number"?_("span",{children:[n," ",n===1?"row":"rows"]}):null,r.length>0?_("span",{children:[r.length," applied ",r.length===1?"filter":"filters"]}):null]}),B5=({label:t,value:e})=>_("section",{class:"cf-analytics-kpi","aria-label":t,"data-testid":"analytics-kpi",children:[_("div",{class:"cf-analytics-kpi__label",children:t}),_("div",{class:"cf-analytics-kpi__value",children:e})]}),z5=({title:t="No matching data",description:e="No approved records matched this question."})=>_("section",{class:"cf-analytics-empty",role:"status","data-testid":"analytics-empty-state",children:[_("p",{children:t}),_("p",{children:e})]}),F5=t=>t==="line"?"Best for change over time.":t==="stacked_bar"?"Compare totals and their parts.":"Compare categories or ranked values.",a1=({type:t,className:e="cf-chart-type-icon"})=>t==="line"?_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 25h21M6 7v18",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),_("path",{d:"M8 21c4-7 7 2 11-6 2.5-5 4.5-2 7-7",fill:"none",stroke:"#2563EB","stroke-width":"2.1","stroke-linecap":"round","stroke-linejoin":"round"})]}):t==="stacked_bar"?_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 26h21M6 7v19",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),[9,15,21].map((r,n)=>_("g",{children:[_("rect",{x:r,y:18-n*2,width:"4",height:8+n*2,fill:"#2563EB",rx:"0.6"}),_("rect",{x:r,y:13-n,width:"4",height:"5",fill:"#F59E0B",rx:"0.6"}),_("rect",{x:r,y:9-n,width:"4",height:"4",fill:"#22C55E",rx:"0.6"})]},r))]}):_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 26h21M6 7v19",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),_("rect",{x:"9",y:"18",width:"4",height:"8",fill:"#2563EB",rx:"0.7"}),_("rect",{x:"15",y:"13",width:"4",height:"13",fill:"#2563EB",rx:"0.7"}),_("rect",{x:"21",y:"8",width:"4",height:"18",fill:"#2563EB",rx:"0.7"})]}),H5=({explanation:t,onFollowUp:e,showLead:r=!1,maxFollowUps:n=3})=>_("section",{class:"cf-analytics-explanation","data-testid":"inline-analytics-explanation","aria-label":"Analysis and supporting evidence",children:[r?_("div",{class:"cf-analytics-explanation__lead","data-testid":"analytics-explanation-lead",children:[t.conversationalPreface?_("p",{class:"cf-analytics-explanation__summary",children:t.conversationalPreface}):null,_("div",{class:"cf-analytics-explanation__lead-meta",children:[_("span",{class:"cf-analytics-explanation__eyebrow",children:"Answer from your data"}),_("span",{class:"cf-analytics-explanation__provenance",children:[_("span",{"aria-hidden":"true",class:"cf-analytics-explanation__provenance-dot"}),t.source==="ai_grounded"?"AI-assisted · evidence checked":"Based on current values"]})]}),_("h3",{class:"cf-analytics-explanation__headline",children:t.headline}),_("p",{class:"cf-analytics-explanation__summary",children:t.summary})]}):null,_("div",{class:"cf-analytics-explanation__body",children:[(t.evidence?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"What the numbers show"}),_("ul",{class:"cf-analytics-explanation__evidence",children:t.evidence?.slice(0,4).map(a=>_("li",{class:"cf-analytics-explanation__evidence-item",children:[_("span",{"aria-hidden":"true",class:"cf-analytics-explanation__evidence-bullet"}),_("span",{children:a})]},a))})]}):null,t.businessMeaning?_("section",{class:"cf-analytics-explanation__meaning",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Why this may matter"}),_("p",{class:"cf-analytics-explanation__paragraph",children:t.businessMeaning})]}):null,(t.possibleDrivers?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("div",{class:"cf-analytics-explanation__section-heading",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Possibilities worth checking"}),_("span",{class:"cf-analytics-explanation__hint",children:"These are not proven causes"})]}),_("div",{class:"cf-analytics-explanation__drivers",children:t.possibleDrivers?.slice(0,2).map(a=>_("article",{class:"cf-analytics-explanation__driver",children:[_("p",{class:"cf-analytics-explanation__driver-title",children:a.hypothesis}),_("p",{class:"cf-analytics-explanation__driver-body",children:[_("span",{class:"cf-analytics-explanation__driver-label",children:"How to check:"})," ",a.howToCheck]})]},`${a.hypothesis}-${a.howToCheck}`))})]}):null,(t.recommendations?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Useful next steps"}),_("div",{class:"cf-analytics-explanation__recommendations",children:t.recommendations?.slice(0,3).map((a,i)=>_("article",{class:"cf-analytics-explanation__recommendation",children:[_("span",{class:"cf-analytics-explanation__recommendation-index",children:i+1}),_("div",{children:[_("p",{class:"cf-analytics-explanation__recommendation-title",children:a.action}),_("p",{class:"cf-analytics-explanation__recommendation-body",children:a.why}),a.successMetric?_("p",{class:"cf-analytics-explanation__recommendation-body",children:[_("span",{class:"cf-analytics-explanation__driver-label",children:"Watch:"})," ",a.successMetric]}):null]})]},`${a.action}-${a.why}`))})]}):null,t.forecast?_("section",{class:"cf-analytics-explanation__outlook",children:[_("div",{class:"cf-analytics-explanation__outlook-header",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Outlook"}),_("span",{class:"cf-analytics-explanation__outlook-badge",children:E5(t.forecast.qualityStatus)})]}),_("p",{class:"cf-analytics-explanation__paragraph",children:t.forecast.text}),t.forecast.limitations?_("p",{class:"cf-analytics-explanation__recommendation-body",children:t.forecast.limitations}):null]}):null,e&&(t.followUps?.length??0)>0?_("section",{class:"cf-analytics-explanation__section cf-analytics-explanation__follow-up",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Ask a follow-up"}),_("div",{class:"cf-analytics-explanation__questions",children:t.followUps?.slice(0,n).map(a=>_("button",{type:"button",class:"cf-analytics-explanation__question",onClick:()=>e(a),children:a},a))})]}):null,(t.limitations?.length??0)>0?_("details",{class:"cf-analytics-explanation__limits",children:[_("summary",{class:"cf-analytics-explanation__limits-summary",children:"Important limits"}),_("ul",{class:"cf-analytics-explanation__limits-list",children:t.limitations?.map(a=>_("li",{children:a},a))})]}):null]}),_("p",{class:"cf-analytics-explanation__source",children:t.source==="ai_grounded"?"AI-assisted wording, checked against the live values shown here.":"Based only on the live values shown here."})]}),Cp=t=>t.explanation?.source==="ai_grounded"?t.explanation:t.businessAnalysis?.explanation??t.explanation,i1=()=>{const t=X(null);return le(()=>{const e=requestAnimationFrame(()=>t.current?.scrollIntoView?.({block:"end"}));return()=>cancelAnimationFrame(e)},[]),t},V5=t=>t.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")||"🤖",ps=t=>{const e=t?.avatarId?.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-");return e?` cf-avatar-preset--${e}`:""},U5={"support-guide":"SG","sales-host":"SH","calm-advisor":"CA","technical-guide":"TG","school-desk":"SD","front-office":"FO"},tu=t=>{const e=t?.avatarId?.trim().toLowerCase();return e&&U5[e]||(t?V5(t.agentName):"·")},o1=({persona:t,small:e,hideWhenMissing:r})=>{const n=e?"cf-msg__avatar":"cf-header__avatar",a=t?.agentAvatarUrl?.trim();return a?_("span",{class:n,children:_("img",{src:a,alt:""})}):r?null:_("span",{class:`${n}${ps(t)}`,children:tu(t)})},G5=()=>{const t=kr(),[e,r]=U(0),n=["Understanding your question","Checking approved information","Preparing your answer"];return le(()=>{const a=[window.setTimeout(()=>r(1),1800),window.setTimeout(()=>r(2),5e3)];return()=>a.forEach(i=>window.clearTimeout(i))},[]),_("div",{class:"cf-msg__bubble cf-typing","aria-label":t.assistantTyping,children:[_("span",{class:"cf-typing__label","aria-live":"polite",children:n[e]}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"})]})},$5=3,W5=({msg:t})=>{if(!t.sources||t.sources.length===0)return null;const e=new Set,r=[];for(const i of t.sources){const o=(i.url||i.title||"").toLowerCase();!o||e.has(o)||(e.add(o),r.push(i))}if(r.length===0)return null;const n=r.slice(0,$5),a=r.length-n.length;return _("div",{class:"cf-sources",children:[n.map((i,o)=>i.url?_("a",{class:"cf-source",href:i.url,target:"_blank",rel:"noopener noreferrer nofollow",title:i.title||i.url,children:[_(hs,{}),_("span",{children:i.title||i.url})]},o):_("span",{class:"cf-source",title:i.title,children:[_(hs,{}),_("span",{children:i.title})]},o)),a>0&&_("span",{class:"cf-source cf-source--more",children:["+",a," more"]})]})},q5=({replies:t,onPick:e})=>t&&t.length>0?_("div",{class:"cf-chips",children:t.map((r,n)=>_("button",{type:"button",class:"cf-chip",onClick:()=>e(r),children:r},n))}):null,Y5=({persona:t,starters:e,onPick:r,onFocusComposer:n,speaking:a,voiceState:i="idle",replyPending:o=!1,pinned:s=!1,muted:l=!1,onToggleMute:c,onEndCall:u,onTalkNow:f,showTalkNow:h=!1,micLevel:d=0,theaterMode:p=!1,onToggleTheater:m,onMinimize:g,audioDevices:v=[],selectedAudioDeviceId:y="",onSelectAudioDevice:b,connectingOnly:x=!1})=>{if(!t)return null;const w=!!(t.allowVoiceInput&&t.talkbackMode&&t.talkbackMode!=="text");if(!(w||t.widgetModule==="assistant"))return null;const k=t.agentAvatarUrl?.trim()||"",C=t.assistantMediaUrl?.trim()||k,A=t.assistantMediaKind==="video"&&!!C,M=e.slice(0,3),T=i!=="idle",D=i!=="idle"?"End voice chat":`Speak with ${t.agentName}`,L=s&&w&&!T&&!a,R=i==="connecting"||i==="processing"||T&&o,O=["cf-assistant-card__stage","cf-assistant-card__stage--local",T?"is-live":"",R?"is-thinking":"",qi(i)&&!l?"is-listening":"",a||i==="speaking"?"is-speaking":"",l?"is-muted":""].filter(Boolean).join(" "),B=qi(i)&&!l?{"--cf-listen":String(Math.max(.18,Math.min(1,d*8)))}:void 0,j=R&&_("span",{class:"cf-call-ripple","aria-hidden":"true",children:[_("span",{}),_("span",{}),_("span",{})]});if(x)return _("div",{class:"cf-assistant-card cf-assistant-card--connecting","aria-live":"polite",children:[_("div",{class:"cf-assistant-card__connecting-avatar",children:[k?_("img",{src:k,alt:""}):_("span",{class:`cf-assistant-card__connecting-face${ps(t)}`,children:tu(t)}),j]}),_("div",{class:"cf-assistant-card__connecting-copy",children:[_("span",{class:"cf-assistant-card__connecting-eyebrow",children:t.agentName}),_("strong",{children:"Connecting with the AI…"})]})]});const P=T&&u&&_(xE,{voiceState:i,muted:l,onToggleMute:c??(()=>{}),onEndCall:u,onTalkNow:f??(()=>{}),showTalkNow:h,micLevel:d,theaterMode:p,onToggleTheater:m??(()=>{}),onMinimize:g??(()=>{}),audioDevices:v,selectedAudioDeviceId:y,onSelectAudioDevice:b??(()=>{})});return L?_("div",{class:"cf-assistant-card cf-assistant-card--pinned cf-assistant-card--compact",children:_("button",{type:"button",class:"cf-assistant-card__compact-speak",onClick:n,children:[k?_("span",{class:"cf-assistant-card__compact-avatar",children:_("img",{src:k,alt:""})}):null,_("span",{class:"cf-assistant-card__compact-mic","aria-hidden":"true",children:_(ds,{})}),_("span",{class:"cf-assistant-card__compact-label",children:D})]})}):_("div",{class:`cf-assistant-card ${s?"cf-assistant-card--pinned":""} ${a?"is-speaking":""}`,children:[(C||w)&&_("div",{class:O,style:B,children:[_("div",{class:`cf-assistant-card__media ${C?"cf-assistant-card__media--uploaded":"cf-assistant-card__media--generated"}${ps(t)}`,children:[A?_("video",{src:C,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):C?_("img",{src:C,alt:""}):_("div",{class:`cf-assistant-card__avatar-stage${ps(t)}`,children:_("div",{class:"cf-assistant-card__face",children:[_("span",{class:"cf-assistant-card__initials",children:tu(t)}),_("span",{class:"cf-assistant-card__eye cf-assistant-card__eye--left"}),_("span",{class:"cf-assistant-card__eye cf-assistant-card__eye--right"}),_("span",{class:"cf-assistant-card__mouth"})]})}),C&&!A&&_("span",{class:"cf-assistant-card__mouth cf-assistant-card__mouth--overlay"}),_("span",{class:"cf-avatar-aura cf-avatar-aura--one","aria-hidden":"true"}),_("span",{class:"cf-avatar-aura cf-avatar-aura--two","aria-hidden":"true"}),_("span",{class:"cf-avatar-listen-ring","aria-hidden":"true"}),_("span",{class:"cf-avatar-wave","aria-hidden":"true",children:[_("span",{}),_("span",{}),_("span",{}),_("span",{})]})]}),j,T&&_("span",{class:"cf-call-status",role:"status","aria-live":"polite",children:Ap(i)}),w&&(P||_("button",{type:"button",class:"cf-assistant-card__speak",onClick:n,children:[_(ds,{}),D]}))]}),!s&&_(Me,{children:[t.agentDescription?_("p",{class:"cf-assistant-card__copy",children:t.agentDescription}):_("p",{class:"cf-assistant-card__copy",children:t.greeting}),M.length>0&&_("div",{class:"cf-assistant-card__chips",children:M.map(V=>_("button",{type:"button",class:"cf-assistant-card__chip",onClick:()=>r(V),children:V},V))}),t.disclaimerText||t.assistantPrivacyUrl?_("p",{class:"cf-assistant-card__privacy",children:[t.disclaimerText||"This chat may be recorded for quality and support.",t.assistantPrivacyUrl?_(Me,{children:[" ",_("a",{href:t.assistantPrivacyUrl,target:"_blank",rel:"noopener noreferrer nofollow",children:"Privacy Policy"})]}):null]}):null]})]})},X5={calendar:h5,"calendar-clock":m5,headset:e1,mail:Sp,message:v5,newsletter:y5,phone:p5,presentation:g5,lifebuoy:e1},Z5=t=>X5[t]??Sp,K5=t=>{if(t.id==="public_contact_support")return"contact-support";switch(t.endpoint){case"book-demo":return"book-demo";case"request-callback":return"request-callback";case"schedule-callback":return"schedule-callback";case"subscribe-newsletter":return"subscribe-newsletter";case"contact":return"contact";default:return"inquiry"}},j5={public_contact_support:{label:"Contact support",description:"Send your request to the support team.",category:"support",icon:"headset",endpoint:"inquiry"},public_submit_inquiry:{label:"Leave a message",description:"Send your question and contact details.",category:"support",icon:"message",endpoint:"inquiry"},public_book_demo:{label:"Book a demo",description:"Request a demo from the team.",category:"sales",icon:"presentation",endpoint:"book-demo"},public_request_callback:{label:"Request a callback",description:"Ask the next available sales teammate to call you.",category:"sales",icon:"phone",endpoint:"request-callback"},public_schedule_callback:{label:"Schedule a callback",description:"Choose an available date and time for a call.",category:"sales",icon:"calendar-clock",endpoint:"schedule-callback"},public_subscribe_newsletter:{label:"Subscribe",description:"Get product updates.",category:"marketing",icon:"newsletter",endpoint:"subscribe-newsletter"}},J5=(t,e,r={})=>Array.isArray(t)?t.filter(n=>n.readiness!=="unavailable").map(n=>s1(n,r[n.id])):(e??[]).flatMap(n=>{const a=j5[n];if(!a)return[];const i=K5({...a,id:n}),o=Qc[i];return[{...a,id:n,presentation:i==="book-demo"||i==="schedule-callback"?"booking":"form",formTitle:o.title,submitLabel:o.submit,fields:o.fields,delivery:"",prompt:"",shortLabel:a.label.toLowerCase(),enabled:!0,readiness:"available",legacyFallback:!0}]}).map(n=>s1(n,r[n.id])),s1=(t,e)=>{if(!e)return t;const r=e.fields??{};return{...t,...Object.fromEntries(Object.entries(e).filter(([n,a])=>n!=="fields"&&a!==void 0)),fields:t.fields.map(n=>({...n,...r[n.key]}))}},Q5=(t,e)=>{const r=t.map(n=>n.label);return r.length===0?e.actionGetInTouch:r.length<=3?r.join(", "):`${r.slice(0,2).join(", ")} ${ct(e.actionMore,{count:String(r.length-2)})}`},l1=({label:t,required:e,value:r,onInput:n})=>{const a=Ht(()=>l5(r),[]),[i,o]=U(a.country.iso),[s,l]=U(a.national),[c,u]=U(!1),[f,h]=U(""),d=X(null),p=qa.find(v=>v.iso===i)??a.country,m=Ht(()=>{const v=f.trim().toLowerCase().replace(/^\+/,"");return v?qa.filter(y=>y.name.toLowerCase().includes(v)||y.iso.toLowerCase().includes(v)||y.dial.includes(v)):qa},[f]);le(()=>{if(!c)return;const v=b=>{d.current&&!b.composedPath().includes(d.current)&&u(!1)},y=b=>{b.key==="Escape"&&u(!1)};return document.addEventListener("pointerdown",v),document.addEventListener("keydown",y),()=>{document.removeEventListener("pointerdown",v),document.removeEventListener("keydown",y)}},[c]);const g=v=>{const y=qa.find(b=>b.iso===v)??p;o(y.iso),u(!1),h(""),n(Qx(y,s))};return _("div",{class:"cf-phone",role:"group","aria-label":`${t}${e?" *":""}`,ref:d,children:[_("span",{class:"cf-phone__label",children:[t,e?" *":""]}),_("div",{class:"cf-phone__control",children:[_("button",{type:"button",class:"cf-phone__country","aria-label":`${p.name}, +${p.dial}. Choose country and calling code`,"aria-haspopup":"listbox","aria-expanded":c,onClick:()=>u(v=>!v),children:[_("span",{"aria-hidden":"true",children:Jx(p.iso)}),_("span",{class:"cf-phone__country-code",children:["+",p.dial]}),_(Ya,{})]}),_("input",{class:"cf-phone__input",type:"tel",inputMode:"numeric",pattern:"[0-9]*",autoComplete:"tel-national",maxLength:15,placeholder:"8028509941",value:s,"aria-label":t,onInput:v=>{const y=v.target,b=y.value.replace(/\D/g,"");y.value=b,l(b),n(Qx(p,b))}})]}),c?_("div",{class:"cf-phone__menu",children:[_("input",{class:"cf-phone__search",type:"search",placeholder:"Search country or code","aria-label":"Search countries",value:f,autoFocus:!0,onInput:v=>h(v.target.value)}),_("div",{class:"cf-phone__options",role:"listbox","aria-label":"Countries",children:m.length>0?m.map(v=>_("button",{type:"button",class:`cf-phone__option ${v.iso===p.iso?"is-selected":""}`,role:"option","aria-selected":v.iso===p.iso,onClick:()=>g(v.iso),children:[_("span",{"aria-hidden":"true",children:Jx(v.iso)}),_("span",{class:"cf-phone__option-name",children:v.name}),_("span",{class:"cf-phone__option-code",children:["+",v.dial]})]},v.iso)):_("div",{class:"cf-phone__empty",children:"No countries found"})})]}):null]})},eE=({field:t,value:e,onInput:r})=>{if(t.kind==="tel")return _(l1,{label:t.label,required:t.required,value:e,onInput:r});const n=t.placeholder??t.label,a={class:"cf-form__input",placeholder:t.required?`${n} *`:n,value:e,"aria-label":t.label,onInput:i=>r(i.target.value)};return t.kind==="textarea"?_("textarea",{rows:2,...a}):_("input",{type:t.kind,...a})},tE=({spec:t,visitor:e,onSubmit:r,onCancel:n})=>{const a=kr(),i=i1(),[o,s]=U(()=>{const v={};for(const y of t.fields)y.identity&&e[y.identity]&&(v[y.key]=e[y.identity]);return v}),[l,c]=U("idle"),[u,f]=U(""),h=v=>!!(v.identity&&e[v.identity]?.trim()),d=t.fields.filter(v=>!h(v)),p=d.every(v=>!v.required||(o[v.key]?.trim()??"")!==""),m=e.email||e.name||"",g=async()=>{if(!p||l==="submitting")return;c("submitting");const v={},y={};for(const b of t.fields){const x=o[b.key]?.trim();x&&(v[b.key]=x,b.identity&&(y[b.identity]=x))}try{const b=await r(v,y);f(fs(b.note||a.formThanks,b.caseReference,a)),c("done")}catch{c("error")}};return l==="done"?_("div",{class:"cf-form cf-form--done",children:[_(Xa,{}),_("span",{children:u})]}):_("div",{class:"cf-form",ref:i,children:[d.length===0&&m&&_("div",{class:"cf-form__as",children:ct(a.actionAs,{identity:m})}),d.map(v=>_(eE,{field:v,value:o[v.key]??"",onInput:y=>s(b=>({...b,[v.key]:y}))},v.key)),l==="error"&&_("div",{class:"cf-form__err",children:a.formError}),_("div",{class:"cf-form__actions",children:[n&&_("button",{type:"button",class:"cf-form__cancel",onClick:n,children:a.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:!p||l==="submitting",onClick:g,children:l==="submitting"?a.sending:t.submit})]})]})},c1=t=>String(t).padStart(2,"0"),rE=()=>{const t=[];for(let e=9;e<=17;e++)t.push(`${c1(e)}:00`),t.push(`${c1(e)}:30`);return t},nE=t=>{const e=new Date;return e.setHours(0,0,0,0),Array.from({length:t},(r,n)=>{const a=new Date(e);return a.setDate(e.getDate()+n),a})},aE=(t,e)=>{const[r,n]=e.split(":").map(Number),a=new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0);try{return new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"}).format(a)}catch{return`${t.toDateString()} ${e}`}},Tn=(t,e)=>{const[r,n]=e.split(":").map(Number);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0)},iE=(t,e)=>{const r=Tn(t,e);try{return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(r)}catch{return e}},ru=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}},u1=(t,e)=>{try{const r=new URL(t);return r.searchParams.set("embed_type","Inline"),globalThis.location?.hostname&&r.searchParams.set("embed_domain",globalThis.location.hostname),e.name?.trim()&&r.searchParams.set("name",e.name.trim()),e.email?.trim()&&r.searchParams.set("email",e.email.trim()),r.toString()}catch{return t}},oE=(t,e)=>{if(!e?.contentWindow||t.source!==e.contentWindow)return!1;try{const r=new URL(t.origin).hostname;if(r!=="calendly.com"&&!r.endsWith(".calendly.com"))return!1}catch{return!1}return!!(t.data&&typeof t.data=="object"&&typeof t.data.event=="string")},sE=({actionId:t,fields:e=Qc["book-demo"].fields,visitor:r,onSubmit:n,onCancel:a,onDemoSlots:i,onConfirmHostedBooking:o,scheduler:s,title:l,submitLabel:c})=>{const u=t==="public_schedule_callback",f=u?Qc["schedule-callback"]:Qc["book-demo"],h=l?.trim()||f.title,d=kr(),p=i1(),m=!!(!u&&s?.connected&&s.provider==="calendly"),g=m?d.bookingOpenScheduler:c?.trim()||f.submit,v=!!(s?.connected&&s.mode==="event"&&!m&&(s.availability===void 0||s.availability.calendarIds.length>0)),y=Math.min(60,Math.max(1,s?.availability?.bookingWindowDays??14)),b=Ht(()=>nE(y),[y]),[x,w]=U(null),[S,k]=U(v?"loading":"request_only"),[C,A]=U(s?.availability?.slotDurationMinutes??30),[M,T]=U(ru()||s?.availability?.timezone||""),D=Ht(()=>v?S!=="available"||x===null?[]:[...new Set([...x].map(te=>{const Se=new Date(te);return`${String(Se.getHours()).padStart(2,"0")}:${String(Se.getMinutes()).padStart(2,"0")}`}))].sort():rE(),[x,S,v]),L=Ht(()=>{const te=Date.now();for(let Se=0;Se<b.length;Se++)if(D.some(Le=>Tn(b[Se],Le).getTime()>te))return Se;return 0},[b,D]),[R,O]=U(L),[B,j]=U(null),[P,V]=U(r.name??""),[H,Z]=U(r.email??""),[re,Te]=U(r.phone??""),[ge,xe]=U(""),[Ce,be]=U("idle"),[it,Qe]=U(""),[ze,oe]=U(!1),[pe,ot]=U(""),[Xe,kt]=U("scheduler"),[tt,lr]=U(null),[Cr,Tt]=U("idle"),[Pt,Bt]=U(""),[xt,tn]=U(""),[F,ue]=U(""),De=X(null),we=async(te,Se,Le)=>{Tt("loading");try{const ve=await o?.(te,Se,Le),Ae=ve?.meetingUrl||ve?.eventLink||"",cr=ve?.rescheduleUrl||ve?.cancelUrl||"";ot(Ae||cr),kt(Ae?"meeting":"manage"),Tt(Ae||cr?"idle":"error")}catch{Tt("error")}};le(()=>{if(!Pt)return;const te=Se=>{if(!oE(Se,De.current)||Se.data.event!=="calendly.event_scheduled")return;const Le=Se.data.payload,ve=Le?.event?.uri?.trim()||"",Ae=Le?.invitee?.uri?.trim()||"";F&&ve&&Ae?(lr({eventUri:ve,inviteeUri:Ae}),we(F,ve,Ae)):Tt("error"),Bt(""),Qe(fs(d.bookingScheduled,xt,d)),be("done")};return window.addEventListener("message",te),()=>window.removeEventListener("message",te)},[o,xt,F,Pt,d]),le(()=>{if(!v||S!=="available"||x===null)return;const te=b.findIndex(Se=>D.some(Le=>x.has(Tn(Se,Le).getTime())));te>=0&&O(te)},[x,S,b,v,D]);const rt=!!(!u&&s?.connected&&(s.mode==="link"||s.provider==="calendly")),vt=async()=>{if(Ce==="submitting"||Ce==="scheduling"||!r.name?.trim()&&!P.trim()||!r.email?.trim()&&!H.trim())return;be("submitting");const te={};H.trim()&&(te.email=H.trim()),P.trim()&&(te.name=P.trim());try{const Se=await n({...H.trim()?{visitorEmail:H.trim()}:{},...P.trim()?{visitorName:P.trim()}:{}},te),Le=Se.booking?.schedulingLink||s?.bookingLink||"";if(!Le){be("error");return}ot(Le),kt("scheduler"),tn(Se.caseReference||""),ue(Se.inquiryId||""),Bt(u1(Le,{name:P.trim()||r.name,email:H.trim()||r.email})),be("scheduling")}catch{be("error")}},[Mr,rn]=U(new Set),[Fr,bs]=U([]),[Za,Qt]=U(0),[Xi,Zi]=U(!1);le(()=>{if(!i)return;let te=!0;const Se=new Date,Le=new Date;return Le.setDate(Le.getDate()+y+1),i(Se.toISOString(),Le.toISOString()).then(ve=>{if(te)if(rn(new Set(ve.taken.map(Ae=>Date.parse(Ae)).filter(Ae=>!Number.isNaN(Ae)))),bs(ve.busy.map(Ae=>[Date.parse(Ae.start),Date.parse(Ae.end)]).filter(([Ae,cr])=>!Number.isNaN(Ae)&&!Number.isNaN(cr))),A(ve.slotDurationMinutes??30),T(ru()||ve.timezone||""),v){if(ve.status!=="available"||!Array.isArray(ve.available)){w(null),k("unavailable");return}w(new Set(ve.available.map(Ae=>Date.parse(Ae)).filter(Ae=>!Number.isNaN(Ae)))),k("available")}else k(ve.status??"request_only")}).catch(()=>{!te||!v||(w(null),k("unavailable"))}),()=>{te=!1}},[y,v,i,Za]);const nn=!!r.email?.trim(),Cn=!!r.name?.trim(),ea=!!r.phone?.trim(),an=re,Ka=!!B&&(!v||S==="available")&&(Cn||P.trim()!=="")&&(u?ea||c5(an):nn||H.trim()!==""),er=(u?r.phone||r.name:r.email||r.name)||"",tr=te=>e.find(Se=>Se.key===te),Mn=tr("visitorPhone"),zt=tr("topic"),xs=te=>Mr.has(Tn(b[R],te).getTime()),ws=te=>Tn(b[R],te).getTime()<=Date.now(),Ss=C*60*1e3,ks=te=>{const Se=Tn(b[R],te).getTime(),Le=Se+Ss;return Fr.some(([ve,Ae])=>Se<Ae&&Le>ve)},An=te=>!v||x?.has(Tn(b[R],te).getTime())===!0,Ts=async()=>{if(!Ka||Ce==="submitting"||!B)return;be("submitting"),Zi(!1);const te=Tn(b[R],B),Se=aE(b[R],B),Le={};P.trim()&&(Le.name=P.trim()),u?an&&(Le.phone=an):H.trim()&&(Le.email=H.trim());try{const ve=await n(u?{bestTime:Se,slotAt:te.toISOString(),visitorTimezone:ru()||"UTC",...an?{visitorPhone:an}:{},...P.trim()?{visitorName:P.trim()}:{},...ge.trim()?{topic:ge.trim()}:{}}:{preferredAt:Se,slotAt:te.toISOString(),visitorTimezone:ru()||"UTC",...H.trim()?{visitorEmail:H.trim()}:{},...P.trim()?{visitorName:P.trim()}:{}},Le);if(!u&&ve.booking?.mode==="link"&&ve.booking.schedulingLink?.trim()){const Ae=ve.booking.schedulingLink.trim();ot(Ae),tn(ve.caseReference||""),ue(ve.inquiryId||""),Bt(u1(Ae,{name:P.trim()||r.name,email:H.trim()||r.email})),be("scheduling");return}ve.booking?.confirmed?(Qe(fs(ve.note||ct(u?d.bookingCallbackConfirmed:d.bookingConfirmed,{when:Se}),ve.caseReference,d)),ot(ve.booking.meetingUrl||ve.booking.rescheduleUrl||ve.booking.cancelUrl||ve.booking.eventLink||""),kt(ve.booking.meetingUrl||ve.booking.eventLink?"meeting":"manage")):ve.booking?.verificationPending?(oe(!0),Qe(fs(ve.note||ct(d.bookingVerificationPending,{when:Se}),ve.caseReference,d))):Qe(fs(ve.note||ct(u?d.bookingCallbackRequested:d.bookingRequested,{when:Se}),ve.caseReference,d)),be("done")}catch(ve){ve?.status===409?(rn(Ae=>new Set(Ae).add(te.getTime())),j(null),Zi(!0),Qt(Ae=>Ae+1),be("idle")):be("error")}},ja=()=>{Bt(""),be("idle"),a?.()};return Ce==="scheduling"&&Pt?_("div",{class:"cf-scheduler-overlay",role:"dialog","aria-modal":"true","aria-label":h,children:[_("header",{class:"cf-scheduler-overlay__head",children:[_("button",{type:"button",class:"cf-scheduler-overlay__back",onClick:ja,children:d.bookingBackToChat}),_("strong",{children:h}),_("div",{class:"cf-scheduler-overlay__tools",children:[_("a",{href:pe,target:"_blank",rel:"noopener noreferrer",children:[d.bookingOpenNewTab," ",_(hs,{})]}),_("button",{type:"button","aria-label":d.bookingCloseScheduler,onClick:ja,children:_(Qn,{})})]})]}),_("div",{class:"cf-scheduler-overlay__body",children:[_("div",{class:"cf-scheduler-overlay__loading",children:d.bookingLoadingScheduler}),_("iframe",{ref:De,class:"cf-scheduler-overlay__frame",src:Pt,title:h,allow:"camera; microphone; fullscreen; payment"})]})]}):Ce==="done"?_("div",{class:`cf-form cf-form--done${ze?" cf-form--pending":""}`,role:ze?"alert":"status",children:[!ze&&_(Xa,{}),_("span",{children:it}),Cr==="loading"&&_("span",{role:"status",children:d.bookingCheckingDetails}),Cr==="error"&&_("div",{class:"cf-booking__receipt-error",role:"alert",children:[_("span",{children:d.bookingDetailsUnavailable}),tt&&F&&o&&_("button",{type:"button",class:"cf-booking__back",onClick:()=>{we(F,tt.eventUri,tt.inviteeUri)},children:d.bookingRetryDetails})]}),pe&&_("a",{class:"cf-booking__link",href:pe,target:"_blank",rel:"noopener noreferrer",children:[Xe==="meeting"?d.bookingMeetingLink:Xe==="manage"?d.bookingManageLink:d.bookingOpenScheduler," ",_(hs,{}),_("span",{class:"cf-booking__url",children:pe})]}),a&&_("button",{type:"button",class:"cf-booking__back",onClick:a,children:d.bookingBackToChat})]}):rt?_("div",{class:"cf-form cf-booking",ref:p,children:[_("div",{class:"cf-booking__hint",children:ct(d.bookingViaProvider,{provider:s?.label??d.bookingSchedulerFallback})}),nn?er?_("div",{class:"cf-form__as",children:ct(d.actionAs,{identity:er})}):null:_(Me,{children:[!r.name?.trim()&&_("input",{class:"cf-form__input",type:"text",placeholder:`${d.handoffName} *`,value:P,"aria-label":d.handoffName,onInput:te=>V(te.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${d.handoffEmail} *`,value:H,"aria-label":d.handoffEmail,onInput:te=>Z(te.target.value)})]}),Ce==="error"&&_("div",{class:"cf-form__err",children:d.formError}),_("div",{class:"cf-form__actions",children:[a&&_("button",{type:"button",class:"cf-form__cancel",onClick:a,children:d.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:Ce==="submitting"||!r.name?.trim()&&P.trim()===""||!nn&&H.trim()==="",onClick:vt,children:Ce==="submitting"?d.sending:d.bookingOpenScheduler})]})]}):_("div",{class:"cf-form cf-booking",ref:p,children:[_("div",{class:"cf-booking__hint",children:[d.bookingPickTime," ·"," ",_("span",{class:"cf-booking__dur",children:ct(u?d.bookingCallbackDuration:d.bookingDuration,{count:String(C)})}),M?` · ${ct(d.bookingTimezone,{timezone:M})}`:""]}),v&&S==="loading"?_("div",{class:"cf-booking__state",role:"status",children:d.bookingCheckingAvailability}):null,v&&S==="unavailable"?_("div",{class:"cf-form__err",role:"alert",children:d.bookingAvailabilityUnavailable}):null,v&&S==="available"&&D.length===0?_("div",{class:"cf-booking__state",role:"status",children:d.bookingNoSlots}):null,D.length>0?_("div",{class:"cf-booking__dates",role:"tablist","aria-label":d.bookingPickDay,children:b.map((te,Se)=>_("button",{type:"button",role:"tab","aria-selected":Se===R,disabled:v&&S==="available"&&!D.some(Le=>x?.has(Tn(te,Le).getTime())),class:`cf-booking__date ${Se===R?"is-selected":""}`,onClick:()=>{O(Se),j(null)},children:[_("span",{class:"cf-booking__dow",children:te.toLocaleDateString(void 0,{weekday:"short"})}),_("span",{class:"cf-booking__dom",children:te.getDate()})]},Se))}):null,D.length>0?_("div",{class:"cf-booking__slots",role:"listbox","aria-label":d.bookingPickTimeLabel,children:D.map(te=>{const Se=ws(te),Le=ks(te),ve=xs(te),Ae=An(te),cr=ve||Se||Le||!Ae;return _("button",{type:"button",role:"option","aria-selected":B===te,disabled:cr,title:Se?d.bookingEarlierToday:Le?d.bookingCalendarBusy:ve?d.bookingAlreadyBooked:Ae?void 0:d.bookingNotOffered,class:`cf-booking__slot ${B===te?"is-selected":""} ${cr?"is-taken":""}`,onClick:()=>j(te),children:iE(b[R],te)},te)})}):null,Xi&&_("div",{class:"cf-form__err",children:d.bookingSlotTaken}),er?_("div",{class:"cf-form__as",children:ct(d.actionAs,{identity:er})}):null,!Cn&&_("input",{class:"cf-form__input",type:"text",placeholder:`${d.handoffName} *`,value:P,"aria-label":d.handoffName,onInput:te=>V(te.target.value)}),u&&!ea&&_(l1,{label:Mn?.label??"Phone number",required:!0,value:re,onInput:Te}),u&&zt?_("input",{class:"cf-form__input",type:"text",placeholder:zt.placeholder||zt.label,value:ge,"aria-label":zt.label,onInput:te=>xe(te.target.value)}):null,!u&&!nn&&_(Me,{children:_("input",{class:"cf-form__input",type:"email",placeholder:`${d.handoffEmail} *`,value:H,"aria-label":d.handoffEmail,onInput:te=>Z(te.target.value)})}),Ce==="error"&&_("div",{class:"cf-form__err",children:d.formError}),_("div",{class:"cf-form__actions",children:[a&&_("button",{type:"button",class:"cf-form__cancel",onClick:a,children:d.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:!Ka||Ce==="submitting",onClick:Ts,children:Ce==="submitting"?d.sending:g})]})]})},f1=({actions:t,descriptors:e,visitor:r,onSubmitForm:n,onDemoSlots:a,onConfirmHostedBooking:i,scheduler:o,exclude:s=[],openAction:l,translations:c={},onClose:u})=>{const f=kr(),[h,d]=U(null),[p,m]=U(!1),g=X(null),v=X(null),y=X(!1),b=Ht(()=>`cf-actions-${Math.random().toString(36).slice(2,9)}`,[]),x=Ht(()=>J5(e,t,c).filter(M=>!s.includes(M.id)&&!s.includes(M.endpoint)),[e,t,s,c]);le(()=>{l&&x.some(M=>M.id===l)&&(d(l),m(!0))},[l,x]);const w=h?x.find(M=>M.id===h):void 0,S=Y(()=>{if(u){u();return}y.current=!0,d(null),m(!1)},[u]),k=Y(()=>{u?u():d(null)},[u]);Mu(()=>{p||!y.current||(y.current=!1,g.current?.focus())},[p]);const C=X({drawerOpen:p,activeId:h});if(C.current={drawerOpen:p,activeId:h},le(()=>{const M=T=>{if(T.key!=="Escape")return;const{drawerOpen:D,activeId:L}=C.current;!D&&!L||(T.stopPropagation(),L?k():S())};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[k,S]),le(()=>{p&&v.current?.querySelector("button, input, textarea, select")?.focus()},[p,h]),x.length===0)return null;const A=p?w?_("div",{ref:v,id:b,class:"cf-action-drawer is-open",role:"dialog","aria-modal":"false","aria-label":w.formTitle||w.label,children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("strong",{children:w.formTitle||w.label}),w.legacyFallback?_("small",{class:"cf-action-test-mode",children:f.actionTestMode}):null]}),_("button",{type:"button",class:"cf-action-drawer__close","aria-label":f.actionClose,onClick:k,children:_(Qn,{})})]}),w.readiness==="degraded"&&w.readinessNote?_("p",{class:"cf-action-drawer__note cf-action-drawer__note--warn",role:"status",children:w.readinessNote}):null,w.presentation==="booking"||w.endpoint==="book-demo"||w.endpoint==="schedule-callback"?_(sE,{actionId:w.id,fields:w.fields,visitor:r,title:w.formTitle,submitLabel:w.submitLabel,onCancel:k,onSubmit:(M,T)=>n(w.id,M,T,w.endpoint),onDemoSlots:a,onConfirmHostedBooking:i,scheduler:o}):_(tE,{spec:{title:w.formTitle||w.label,submit:w.submitLabel,fields:w.endpoint==="request-callback"?w.fields.filter(M=>M.key!=="bestTime"):w.fields},visitor:r,onCancel:k,onSubmit:(M,T)=>n(w.id,M,T,w.endpoint)})]}):_("div",{ref:v,id:b,class:"cf-action-drawer cf-action-drawer--menu",role:"dialog","aria-modal":"false","aria-label":f.actionChoose,children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("span",{class:"cf-action-drawer__eyebrow",children:f.actionNeedHelp}),_("strong",{children:f.actionChoose})]}),_("button",{type:"button",class:"cf-action-drawer__close","aria-label":f.actionClose,onClick:S,children:_(Qn,{})})]}),_("div",{class:"cf-action-drawer__grid",children:x.map(M=>{const T=Z5(M.icon);return _("button",{type:"button",class:"cf-action-card",onClick:()=>d(M.id),children:[_("span",{class:`cf-action-card__icon cf-action-card__icon--${M.category}`,children:_(T,{})}),_("span",{class:"cf-action-card__copy",children:[_("strong",{children:M.label}),M.legacyFallback?_("small",{class:"cf-action-test-mode",children:f.actionTestMode}):null,_("small",{children:M.description}),M.readiness==="degraded"&&M.readinessNote?_("small",{class:"cf-action-card__warn",children:M.readinessNote}):null]}),_(Ya,{})]},M.id)})}),_("p",{class:"cf-action-drawer__note",children:f.actionFooter})]}):null;return _("div",{class:"cf-action-shell",children:[_("button",{ref:g,type:"button",class:"cf-action-trigger",hidden:p,"aria-expanded":p,"aria-controls":b,onClick:()=>p?S():m(!0),children:[_("span",{class:"cf-action-trigger__icon",children:_(Sp,{})}),_("span",{class:"cf-action-trigger__copy",children:[_("strong",{children:f.actionContactOptions}),_("small",{children:Q5(x,f)})]}),_(Ya,{})]}),A]})},lE=({hasEmail:t,visitor:e,question:r,onSubmitForm:n})=>{const a=kr(),[i,o]=U(!1),[s,l]=U(!1),[c,u]=U(e.name??""),[f,h]=U(e.email??"");if(t)return _("div",{class:"cf-handoff cf-handoff--done",children:[_(Xa,{}),_("span",{children:"We’ve alerted the team. If someone is available, they can continue here."})]});if(i){const p=e.email||f;return _("div",{class:"cf-handoff cf-handoff--done",children:[_(Xa,{}),_("span",{children:ct(a.handoffShared,{email:p})})]})}const d=async()=>{if(!(!f.trim()||s)){l(!0);try{await n("inquiry",{visitorEmail:f.trim(),...c.trim()?{visitorName:c.trim()}:{},message:r||"I had a question the assistant couldn’t answer.",subject:"Help request from chat"},{email:f.trim(),name:c.trim()||void 0}),o(!0)}catch{l(!1)}}};return _("div",{class:"cf-handoff",children:[_("div",{class:"cf-handoff__title",children:a.handoffTitle}),_("input",{class:"cf-form__input",type:"text",placeholder:a.handoffName,value:c,"aria-label":a.handoffName,onInput:p=>u(p.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${a.handoffEmail} *`,value:f,"aria-label":a.handoffEmail,onInput:p=>h(p.target.value)}),_("button",{type:"button",class:"cf-form__submit",disabled:!f.trim()||s,onClick:d,children:s?a.sending:a.handoffNotify})]})},cE=({text:t})=>{const e=kr(),[r,n]=U(!1);return _("button",{type:"button",class:"cf-tool",onClick:async()=>{try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),1500)}catch{}},"aria-label":e.copy,children:[r?_(Xa,{}):_(w5,{}),r?e.copied:e.copy]})},uE=({items:t,onPick:e})=>t.length===0?null:_("div",{class:"cf-starters",children:t.map((r,n)=>_("button",{type:"button",class:"cf-starter",onClick:()=>e(r),children:r},n))}),fE=({items:t})=>{const e=t.filter(r=>r.label.trim()&&r.url.trim()).slice(0,4);return e.length===0?null:_("div",{class:"cf-featured-links",children:e.map((r,n)=>_("a",{class:"cf-featured-link",href:r.url,target:"_blank",rel:"noopener noreferrer nofollow",title:r.label,children:[_(hs,{}),_("span",{children:r.label})]},`${r.url}-${n}`))})},dE=({msg:t,onRate:e})=>{const r=kr(),[n,a]=U(!1),[i,o]=U(""),s=t.feedback,l=()=>{e(t.id,"up"),a(!1)},c=()=>{e(t.id,"down"),a(!0)},u=()=>{e(t.id,"down",i.trim()),a(!1)};return _("div",{class:"cf-feedback",children:[_("div",{class:"cf-feedback__row",children:[_("button",{type:"button",class:`cf-feedback__btn ${s==="up"?"is-active":""}`,"aria-label":r.feedbackHelpful,"aria-pressed":s==="up",onClick:l,children:_(t1,{})}),_("button",{type:"button",class:`cf-feedback__btn ${s==="down"?"is-active":""}`,"aria-label":r.feedbackNotHelpful,"aria-pressed":s==="down",onClick:c,children:_(r1,{})}),s&&!n&&_("span",{class:"cf-feedback__thanks",children:r.feedbackThanks})]}),n&&s==="down"&&_("div",{class:"cf-feedback__comment",children:[_("textarea",{class:"cf-feedback__input",rows:2,placeholder:r.feedbackCommentPlaceholder,value:i,onInput:f=>o(f.target.value)}),_("button",{type:"button",class:"cf-feedback__send",onClick:u,children:r.feedbackSend})]})]})},d1=t=>t.attachments??(t.attachmentName?[{id:t.attachmentId,name:t.attachmentName}]:[]),hE=({msg:t,persona:e,isLast:r,visitor:n,hasEmail:a,lastQuestion:i,showActions:o,onPickReply:s,onSubmitForm:l,onDemoSlots:c,onConfirmHostedBooking:u,onRetry:f,ratable:h,onRate:d,onExpandVisualization:p,onReconnect:m,onOpenAttachment:g})=>{const v=kr(),y=t.role==="user",b=t.liveEventType??"",x=t.content.trim().toLowerCase(),w=b==="handoff_queued"||b==="agent_joined"||b==="agent_left"||b==="ai_handback"||b==="conversation_ended"||x.includes("joined the chat")||x.includes("left the chat")||x.includes("support agents will be with you"),S=t.role==="system"||w,k=t.requestedContactFields?.includes("email")===!0,C=r&&!y&&!S&&!t.reconnectOffer&&!!(t.handoffOffered||k),A=C&&!a?["inquiry"]:[],M=!t.pending&&!t.streaming,T=[...t.artifacts??[],...t.visualization&&!(t.artifacts??[]).some(D=>D.type==="visualization")?[{type:"visualization",visualization:t.visualization}]:[]];return S?_("div",{class:"cf-msg cf-msg--system",children:_("div",{class:"cf-system-event",children:[_("div",{class:"cf-system-event__mark","aria-hidden":"true"}),_("div",{class:"cf-system-event__text",children:t.content}),m&&_("button",{type:"button",class:"cf-system-event__action",onClick:m,children:v.reconnectSupport}),t.createdAt&&_("div",{class:"cf-system-event__time",children:new Date(t.createdAt).toLocaleString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"})})]})}):_("div",{class:`cf-msg cf-msg--${y?"user":"agent"}`,children:[!y&&_(o1,{persona:e,small:!0}),_("div",{class:"cf-msg__col",children:[t.pending&&t.content===""?_(G5,{}):t.imageUrl?_("div",{class:"cf-msg__bubble cf-msg__bubble--media",children:[_("img",{class:"cf-msg__media",src:t.imageUrl,alt:"GIF"}),t.content&&_("span",{class:"cf-msg__caption",children:t.content})]}):_("div",{class:"cf-msg__bubble",children:[y?t.content:R5(t.content),t.streaming&&_("span",{class:"cf-caret","aria-hidden":"true"})]}),y?null:T.map((D,L)=>D.type==="visualization"&&D.visualization?_(h1,{visualization:D.visualization,onExpand:p?()=>p(t.id):void 0,expandControlId:t.id},`visualization-${L}`):D.type==="image"&&(D.data||D.uri?.startsWith("https://"))&&["image/png","image/jpeg","image/webp"].includes(D.mimeType??"")?_("figure",{class:"cf-artifact",children:[D.title?_("figcaption",{children:D.title}):null,_("img",{src:D.uri||`data:${D.mimeType};base64,${D.data}`,alt:D.altText||D.caption||D.title||"Tool result"}),D.caption&&D.caption!==D.title?_("p",{children:D.caption}):null]},`image-${L}`):D.type==="video"&&D.uri?.startsWith("https://")&&(D.mimeType??"").startsWith("video/")?_("figure",{class:"cf-artifact",children:[D.title?_("figcaption",{children:D.title}):null,_("video",{controls:!0,preload:"metadata",playsInline:!0,src:D.uri}),D.caption&&D.caption!==D.title?_("p",{children:D.caption}):null]},`video-${L}`):D.type==="resource_link"&&D.uri?.startsWith("https://")?_("a",{class:"cf-artifact-link",href:D.uri,target:"_blank",rel:"noopener noreferrer nofollow",children:[_("strong",{children:D.title||D.name||"Open result"}),D.caption?_("span",{children:D.caption}):null]},`link-${L}`):null),!y&&t.visualization&&Cp(t.visualization)?_(H5,{explanation:Cp(t.visualization),onFollowUp:s,showLead:!t.content.toLocaleLowerCase().includes(Cp(t.visualization).headline.toLocaleLowerCase())}):null,y&&d1(t).length>0&&_("div",{class:"cf-attach-row cf-attach-row--sent",children:d1(t).map((D,L)=>g?_("button",{type:"button",class:"cf-attach-chip cf-attach-chip--open",title:ct(v.attachOpen,{name:D.name}),"aria-label":ct(v.attachOpen,{name:D.name}),onClick:()=>g(t,D,L),children:[_(eu,{}),_("span",{children:D.name})]},`${D.id??D.name}-${L}`):_("div",{class:"cf-attach-chip",title:D.name,children:[_(eu,{}),_("span",{children:D.name})]},`${D.id??D.name}-${L}`))}),!y&&_(Me,{children:[M&&(t.error||t.content)&&_("div",{class:"cf-msg__actions",children:[_("div",{class:"cf-msg__tools",children:t.error?_("button",{type:"button",class:"cf-tool",onClick:()=>f(t.id,t.retryText??""),children:[_(S5,{}),v.retry]}):_(cE,{text:t.content})}),h&&!t.error&&t.content&&_(dE,{msg:t,onRate:d})]}),_(W5,{msg:t}),r&&_(q5,{replies:t.suggestedReplies,onPick:s}),C&&_(lE,{hasEmail:a,visitor:n,question:i,onSubmitForm:l}),o&&_(f1,{actions:t.availableActions,descriptors:t.actions,openAction:t.selectedAction,visitor:n,onSubmitForm:l,onDemoSlots:c,onConfirmHostedBooking:u,scheduler:e?.scheduler,exclude:A})]})]})]})},h1=({visualization:t,expanded:e=!1,onExpand:r,onClose:n,expandControlId:a})=>{const i=X(null),o=Ht(()=>yp(t),[t]),[s,l]=U(o?.type);le(()=>l(o?.type),[o]);const c=Ht(()=>bR(t),[t]),u=Ht(()=>yp(t,s),[s,t]),f=s??u?.type??o?.type,h=c.find(b=>b.type===f),d=t.rows??[],p=t.columns?.length?t.columns:Object.keys(d[0]??{}),m=p.map(b=>{const x=t.columnMetadata?.find(w=>w.key===b);return x?{key:b,label:x.label,dataType:x.dataType,currencyCode:x.currencyCode}:b});if(d.length===0)return _(z5,{});const g=_(N5,{answeredAt:t.freshness?.answeredAt,reportingPeriod:t.reportingPeriod,filters:t.appliedFilters,rowCount:t.rowCount??d.length}),v=()=>t.tableAvailable===!1||p.length===0?null:_("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:t.title?.trim()||"Result details"}),g]}),_("div",{class:"cf-analytics-visualization__actions",children:[t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>p1(p,d),children:"Download"}):null,e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Qn,{})}):r&&t.expandable!==!1?_("button",{type:"button",class:"cf-analytics-visualization__expand","aria-label":"Expand table","data-visualization-message":a,onClick:r,children:_(Tp,{})}):null]})]}),_(TR,{rows:d,columns:m,maxRows:100,expanded:e,classPrefix:"cf"})]});if(t.presentation==="table"||!t.presentation&&t.type==="table")return v();const y=t.chartRecommendation?.valueFields?.[0]??t.valueFields?.[0]??t.value??p[1];if(t.presentation==="kpi"||!t.presentation&&t.type==="kpi"){const b=d[0]?.[y??p[0]??""],x=typeof b=="number"?b:Number(b),w=t.columnMetadata?.find(k=>k.key===y),S=Number.isFinite(x)?us(x,w,t):String(b??"No value");return _("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:"Live metric"}),g]}),e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Qn,{})}):null]}),_(B5,{label:w?.label??y??"Current value",value:S})]})}return u?_("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:u.title}),g]}),_("div",{class:"cf-analytics-visualization__actions",children:[c.length>1?_("details",{ref:i,class:"cf-analytics-chart-picker",children:[_("summary",{"aria-label":"Choose chart type",title:"Choose chart type",children:[_("span",{class:"cf-analytics-chart-picker__current",children:[_(a1,{type:f??u.type}),_("span",{children:h?.label??"Chart"})]}),_(Ya,{})]}),_("div",{class:"cf-analytics-chart-picker__menu",role:"listbox","aria-label":"Chart type",children:c.map(b=>{const x=b.type===f;return _("button",{type:"button",role:"option","aria-selected":x,class:x?"is-selected":"",onClick:()=>{l(b.type),i.current&&(i.current.open=!1)},children:[_("span",{class:"cf-analytics-chart-picker__icon",children:_(a1,{type:b.type})}),_("span",{class:"cf-analytics-chart-picker__copy",children:[_("strong",{children:b.label}),_("small",{children:F5(b.type)})]}),x?_(Xa,{}):null]},b.type)})})]}):null,e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Qn,{})}):r&&t.expandable!==!1?_("button",{type:"button",class:"cf-analytics-visualization__expand","aria-label":"Expand chart","data-visualization-message":a,onClick:r,children:_(Tp,{})}):null]})]}),_(SR,{model:u,expanded:e}),t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>p1(p,d),children:"Download this data"}):null]}):v()},p1=(t,e)=>{if(typeof document>"u"||t.length===0)return;const r=kR(e,t),n=URL.createObjectURL(new Blob([r],{type:"text/csv;charset=utf-8"})),a=document.createElement("a");a.href=n,a.download="analytics-result.csv",a.click(),URL.revokeObjectURL(n)},v1=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result).split(",")[1]??""),n.onerror=r,n.readAsDataURL(t)}),pE=({onPick:t})=>_("div",{class:"cf-picker cf-emoji",children:a5.map(e=>_("div",{class:"cf-emoji__group",children:[_("div",{class:"cf-emoji__label",children:e.name}),_("div",{class:"cf-emoji__grid",children:e.emojis.map((r,n)=>_("button",{type:"button",class:"cf-emoji__btn",onClick:()=>t(r),"aria-label":r,children:r},n))})]},e.name))}),vE=({onSearch:t,onPick:e})=>{const r=kr(),[n,a]=U(""),[i,o]=U([]),[s,l]=U(!0);return le(()=>{let c=!0;l(!0);const u=setTimeout(()=>{t(n).then(f=>c&&(o(f),l(!1))).catch(()=>c&&(o([]),l(!1)))},300);return()=>{c=!1,clearTimeout(u)}},[n,t]),_("div",{class:"cf-picker cf-gif",children:[_("input",{class:"cf-gif__search",placeholder:r.searchGifs,value:n,"aria-label":r.searchGifs,onInput:c=>a(c.target.value)}),_("div",{class:"cf-gif__grid",children:s?_("div",{class:"cf-gif__hint",children:r.searchingGifs}):i.length===0?_("div",{class:"cf-gif__hint",children:r.noGifs}):i.map(c=>_("button",{type:"button",class:"cf-gif__item",onClick:()=>e(c.url),"aria-label":c.alt,children:_("img",{src:c.preview,alt:c.alt,loading:"lazy"})},c.id))}),_("div",{class:"cf-gif__powered",children:"via Tenor"})]})},gE=5*1024*1024,Mp=5,mE="image/png,image/jpeg,image/webp,image/gif,application/pdf",yE=15e3,qi=t=>t==="listening"||t==="hearing",Ap=t=>{switch(t){case"connecting":return"Connecting with AI…";case"listening":return"Listening now — go ahead.";case"hearing":return"Hearing you…";case"unavailable":return"I can’t hear you — check your microphone.";case"speaking":return"AI is speaking — talk to interrupt.";case"processing":return"Working on it — keep talking to add more.";case"noise":return"I couldn't hear clear words. Try again closer to the mic.";case"misunderstood":return"I didn't understand that. Please try again.";case"denied":return"Microphone access is blocked. Allow the mic or type your question.";case"muted":return"Muted — tap the mic to unmute.";case"timeout":return"Didn't hear anything for a while — ending the call.";default:return""}},_E=.004,g1=({muted:t,listening:e,micLevel:r,onToggleMute:n})=>{const a=e&&r>=_E;return _("button",{type:"button",class:`cf-call-btn ${t?"is-muted":""} ${e?"is-listening":""} ${a?"is-hot":""}`,"aria-label":t?"Unmute microphone":"Mute microphone","aria-pressed":t,onClick:n,style:e?{"--cf-wave":String(Math.max(.2,Math.min(1,r*6)))}:void 0,children:t?_(d5,{}):_(ds,{})})},bE=({audioDevices:t,selectedAudioDeviceId:e,onSelectAudioDevice:r})=>{const[n,a]=U(!1),[i,o]=U(null),s=X(null);le(()=>{if(!n)return;const c=u=>{s.current&&!u.composedPath().includes(s.current)&&a(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),Mu(()=>{if(!n){o(null);return}const c=s.current;if(!c)return;let u=new DOMRect(0,0,window.innerWidth,window.innerHeight);for(let g=c.parentElement;g;g=g.parentElement){const v=getComputedStyle(g);if(v.overflow!=="visible"||v.overflowY!=="visible"){u=g.getBoundingClientRect();break}}const f=c.getBoundingClientRect(),h=8,d=u.bottom-f.bottom-h*2,p=f.top-u.top-h*2,m=p>d;o({up:m,maxHeight:Math.max(72,Math.floor(m?p:d))})},[n]);const l=[{deviceId:"",label:"Default microphone"},...t];return _("div",{class:"cf-call-more",ref:s,children:[_("button",{type:"button",class:"cf-call-btn cf-call-btn--microphones","aria-label":"Choose microphone","aria-expanded":n,onClick:()=>a(c=>!c),children:_(Ya,{})}),n&&_("div",{class:`cf-call-menu${i?.up?" cf-call-menu--up":""}`,role:"menu",style:i?{maxHeight:`${i.maxHeight}px`}:{visibility:"hidden"},children:[_("div",{class:"cf-call-menu__label",children:"Microphone"}),l.map(c=>_("button",{type:"button",role:"menuitemradio","aria-checked":c.deviceId===e,class:`cf-call-menu__item ${c.deviceId===e?"is-active":""}`,onClick:()=>{r(c.deviceId),a(!1)},children:[c.deviceId===e?_(Xa,{}):_("span",{class:"cf-call-menu__spacer"}),_("span",{children:c.label})]},c.deviceId))]})]})},xE=({voiceState:t,muted:e,onToggleMute:r,onEndCall:n,onTalkNow:a,showTalkNow:i,micLevel:o,theaterMode:s,onToggleTheater:l,onMinimize:c,audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:h})=>_("div",{class:"cf-call-controls",children:[_(g1,{muted:e,listening:qi(t)&&!e,micLevel:o,onToggleMute:r}),_(bE,{audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:h}),i&&_("button",{type:"button",class:"cf-call-btn cf-call-btn--talk","aria-label":"Talk now",onClick:a,children:_(ds,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":s?"Exit expanded view":"Expand view","aria-pressed":s,onClick:l,children:s?_(C5,{}):_(Tp,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":"Minimize voice chat",onClick:c,children:_(M5,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:n,children:_(kp,{})})]}),wE=({persona:t,voiceState:e,muted:r,onToggleMute:n,onEndCall:a,micLevel:i,onExpand:o})=>{const s=h=>h.stopPropagation(),l=t?.assistantMediaUrl?.trim()||t?.agentAvatarUrl?.trim()||"",c=t?.assistantMediaKind==="video"&&!!l,u=t?.agentName||"Assistant",f=["cf-floating-call-card",qi(e)&&!r?"is-listening":"",e==="speaking"?"is-speaking":"",e==="processing"||e==="connecting"?"is-thinking":"",r?"is-muted":""].filter(Boolean).join(" ");return _("div",{class:f,style:qi(e)&&!r?{"--cf-listen":String(Math.max(.18,Math.min(1,i*8)))}:void 0,role:"button",tabIndex:0,"aria-label":`Reopen voice chat with ${u}`,onClick:o,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),o())},children:[_("div",{class:"cf-floating-call-card__media","aria-hidden":"true",children:l?c?_("video",{src:l,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):_("img",{src:l,alt:""}):_("div",{class:`cf-floating-call-card__avatar${ps(t)}`,children:[_("span",{children:tu(t)}),_("span",{class:"cf-floating-call-card__eye cf-floating-call-card__eye--left"}),_("span",{class:"cf-floating-call-card__eye cf-floating-call-card__eye--right"}),_("span",{class:"cf-floating-call-card__mouth"})]})}),_("div",{class:"cf-floating-call-card__shade","aria-hidden":"true"}),_("span",{class:"cf-floating-call-card__status",role:"status","aria-live":"polite",children:Ap(e)}),_("div",{class:"cf-floating-call-card__controls",onClick:s,onKeyDown:s,role:"presentation",children:[_(g1,{muted:r,listening:qi(e)&&!r,micLevel:i,onToggleMute:n}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--restore","aria-label":"Restore voice chat",onClick:h=>{s(h),o()},children:_(A5,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:h=>{s(h),a()},children:_(kp,{})})]})]})},SE=(t,e)=>{switch(t){case"connecting":return e.voiceConnecting;case"listening":return e.voiceListening;case"hearing":return e.voiceHearing;case"unavailable":return e.voiceUnavailable;case"processing":return e.voiceProcessing;case"speaking":return e.voiceSpeaking;case"noise":return e.voiceNoise;case"misunderstood":return e.voiceMisunderstood;case"denied":return e.voiceDenied;default:return Ap(t)}},kE=({draftStore:t,onSend:e,onSendGif:r,onTyping:n,disabled:a,allowVoice:i,onTranscribe:o,gifEnabled:s,onSearchGifs:l,allowAttach:c,analyzeAttachments:u=!0,onUpload:f,voiceStartSignal:h=0,onVoiceStateChange:d,onPreviewAttachment:p})=>{const m=kr(),[g,v]=U(()=>t.value),y=F=>{const ue=typeof F=="function"?F(g):F;t.value=ue,v(ue)},[b,x]=U(!1),[w,S]=U(!1),[k,C]=U("idle"),[A,M]=U("none"),[T,D]=U([]),L=X([]);L.current=T;const R=X(0),[O,B]=U(!1),[j,P]=U(!1),[V,H]=U(""),Z=X(null),re=X(null),Te=X(null),ge=X(0),xe=X(null),Ce=X(void 0),be=F=>{C(F),d?.(F)},it=()=>{Ce.current&&window.clearTimeout(Ce.current),Ce.current=void 0};le(()=>{const F=Z.current;F&&(F.style.height="auto",F.style.height=`${Math.min(F.scrollHeight,110)}px`)},[g]),le(()=>()=>{for(const F of L.current)F.previewUrl&&URL.revokeObjectURL(F.previewUrl)},[]);const Qe=F=>{D(ue=>{const De=ue.find(we=>we.key===F);return De?.previewUrl&&URL.revokeObjectURL(De.previewUrl),ue.filter(we=>we.key!==F)})},ze=()=>D([]);le(()=>{if(A==="none")return;const F=ue=>{re.current&&!ue.composedPath().includes(re.current)&&M("none")};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[A]);const oe=F=>M(ue=>ue===F?"none":F),pe=F=>{const ue=Z.current;if(!ue){y(rt=>rt+F);return}const De=ue.selectionStart??g.length,we=ue.selectionEnd??g.length;y(g.slice(0,De)+F+g.slice(we)),requestAnimationFrame(()=>{ue.focus();const rt=De+F.length;ue.setSelectionRange(rt,rt)})},ot=F=>{M("none"),r(F)},Xe=async F=>{if(F.length===0)return;H("");const ue=Mp-L.current.length-R.current;if(ue<=0){H(ct(m.attachLimit,{count:String(Mp)}));return}const De=F.slice(0,ue);for(const we of De){R.current+=1;try{await kt(we)}finally{R.current-=1}}F.length>De.length&&H(ct(m.attachLimit,{count:String(Mp)}))},kt=async F=>{const ue=++ge.current;if(F.size>gE){H(m.attachTooLarge);return}if(!f){H(m.attachFailed);return}B(!0);try{const De=await v1(F),we=await f(De,F.type||"application/octet-stream",F.name,u);if(ue!==ge.current)return;const rt={key:`${we.id||F.name}-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,id:we.id,analysisFailed:we.analysisFailed,name:F.name,text:we.text,mimeType:F.type||"application/octet-stream",size:F.size,previewUrl:F.type.startsWith("image/")?URL.createObjectURL(F):void 0,file:F};D(vt=>[...vt,rt])}catch(De){De instanceof Qi&&De.status===413?H(m.attachTooLarge):De instanceof Qi&&[400,415,503].includes(De.status)?H(De.message):H(m.attachFailed)}finally{ue===ge.current&&B(!1)}},tt=async F=>{const ue=F.target,De=Array.from(ue.files??[]);ue.value="",await Xe(De)},lr=()=>{ge.current+=1,B(!1),H("")},Cr=(!!g.trim()||T.length>0)&&!a&&!O&&!w,Tt=()=>{Cr&&(e(g,T.length>0?{attachments:T.map(F=>({id:F.id,name:F.name,text:F.text,file:F.file}))}:void 0),n?.(!1),y(""),ze(),H(""))},Pt=F=>{const ue=F.trim();if(!ue||a){be("misunderstood");return}const De=g.trim(),we=De?`${De} ${ue}`:ue;e(we),n?.(!1),y(""),ze(),H(""),be("idle")},Bt=F=>{if(F.key==="Enter"&&!F.shiftKey){if(a)return;F.preventDefault(),Tt()}else F.key==="Escape"&&A!=="none"&&(F.preventDefault(),F.stopPropagation(),M("none"))},xt=()=>{it(),xe.current?.stop("dictation-ended"),xe.current=null,x(!1),S(!1)},tn=async()=>{const F=xe.current;if(F){const{mic:we,processing:rt}=F.snapshot;we==="hearing"||rt?F.finishTurn():(xt(),be("idle"));return}const ue=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0;be("connecting");const De=new Kx({transcribe:async({audio:we,mimeType:rt,durationSeconds:vt})=>o(await v1(we),rt,ue,vt),listener:{state:({mic:we,processing:rt,reason:vt})=>{if(xe.current===De){if(we==="unavailable"){if(vt==="permission-denied"||vt==="unsupported"||vt==="no-device"||vt==="error"){xt(),be("denied");return}be("unavailable");return}x(we==="listening"||we==="hearing"),S(rt),we==="starting"?be("connecting"):rt&&we!=="hearing"?be("processing"):we==="hearing"?be("hearing"):we==="listening"&&be("listening")}},speechStart:()=>it(),turn:we=>{xe.current===De&&(xt(),Pt(we.text))},noise:we=>{xe.current===De&&(xt(),be(we.reason==="transcribe-failed"?"misunderstood":"noise"))}}});xe.current=De,Ce.current=window.setTimeout(()=>{xe.current===De&&(xt(),be("noise"))},yE),await De.start()};return le(()=>{!h||!i||a||b||w||tn()},[h]),le(()=>()=>{it(),xe.current?.stop("unmounted"),xe.current=null},[]),_("div",{class:`cf-composer ${j?"is-dragging":""}`,ref:re,onDragEnter:F=>{c&&(F.preventDefault(),P(!0))},onDragOver:F=>{c&&F.preventDefault()},onDragLeave:F=>{F.currentTarget===F.target&&P(!1)},onDrop:F=>{c&&(F.preventDefault(),P(!1),Xe(Array.from(F.dataTransfer?.files??[])))},children:[A==="emoji"&&_(pE,{onPick:pe}),A==="gif"&&_(vE,{onSearch:l,onPick:ot}),(T.length>0||O||V)&&_("div",{class:"cf-attach-row",role:"list","aria-label":m.attachedFiles,children:[T.map(F=>_("span",{class:"cf-attach-chip",role:"listitem",title:F.name,children:[_("button",{type:"button",class:"cf-attach-open","aria-label":ct(m.attachOpen,{name:F.name}),disabled:!p,onClick:()=>p?.(F.file,F.name),children:[F.previewUrl?_("img",{class:"cf-attach-preview",src:F.previewUrl,alt:""}):_(eu,{}),_("span",{class:"cf-attach-copy",children:[_("span",{children:F.name}),_("small",{children:F.analysisFailed?m.attachAnalysisFailed:`${Math.max(1,Math.ceil(F.size/1024))} KB`})]})]}),_("button",{type:"button",class:"cf-attach-x","aria-label":ct(m.removeAttachmentNamed,{name:F.name}),onClick:()=>Qe(F.key),children:_(Qn,{})})]},F.key)),O&&_("span",{class:"cf-attach-status",children:[_("span",{children:m.attaching}),_("button",{type:"button",onClick:lr,children:m.cancel})]}),V&&!O&&_("span",{class:"cf-attach-status cf-attach-status--err",children:V})]}),k!=="idle"&&_("div",{class:"cf-voice-state","aria-live":"polite",children:[_("span",{class:`cf-voice-state__dot ${b?"is-live":""}`}),SE(k,m)]}),_("div",{class:"cf-composer__field",children:[_("button",{type:"button",class:`cf-iconbtn ${A==="emoji"?"is-active":""}`,"aria-label":m.emoji,"aria-pressed":A==="emoji",onClick:()=>oe("emoji"),children:A==="emoji"?_(Qn,{}):_(_5,{})}),s&&_("button",{type:"button",class:`cf-iconbtn cf-gifbtn ${A==="gif"?"is-active":""}`,"aria-label":m.gifs,"aria-pressed":A==="gif",onClick:()=>oe("gif"),children:_("span",{class:"cf-gif-label",children:"GIF"})}),c&&_(Me,{children:[_("input",{ref:Te,type:"file",class:"cf-file-input",accept:mE,multiple:!0,onChange:tt,tabIndex:-1,"aria-hidden":"true"}),_("button",{type:"button",class:"cf-iconbtn","aria-label":m.attachFile,disabled:O,onClick:()=>Te.current?.click(),children:_(eu,{})})]}),_("textarea",{ref:Z,class:"cf-textarea",rows:1,placeholder:m.composerPlaceholder,value:g,"aria-label":m.composerPlaceholder,"aria-busy":a,onInput:F=>{const ue=F.target.value;y(ue),n?.(!!ue.trim())},onPaste:F=>{const ue=Array.from(F.clipboardData?.files??[]);!c||ue.length===0||(F.preventDefault(),Xe(ue))},onKeyDown:Bt}),i&&_("button",{type:"button",class:`cf-iconbtn cf-mic ${b?"is-recording":""}`,"aria-label":b?m.stopRecording:m.recordVoice,"aria-pressed":b,disabled:w||a,onClick:tn,children:_(ds,{})}),_("button",{type:"button",class:"cf-send","aria-label":m.send,disabled:!Cr,onClick:Tt,children:_(f5,{})})]})]})},TE=t=>t.replace(/\[[^\]]{0,60}\]/g," ").replace(/\(([^)]{0,60})\)/g,(e,r)=>m1.has(r.trim().toLowerCase().replace(/[.!?,…]+$/,"").replace(/\s+/g," "))?" ":e).replace(/\*[^*]{0,60}\*/g," ").replace(/\s+/g," ").trim(),m1=new Set(["background noise","engine noise","noise","inaudible","unintelligible","silence","no speech","static","music","laughter","applause","wind","breathing","click","clicks","clicking","mouse click","mouse clicks","beep","beeps","beeping","tap","taps","tapping","typing","keyboard typing","cough","coughing","sigh","hmm","mm","mmm","uh","um","ah","oh"]),CE=/^\d{1,2}:\d{2}(?::\d{2})?(?:[.,]\d+)?(?:\s*(?:-|–|—|to|-->)\s*\d{1,2}:\d{2}(?::\d{2})?(?:[.,]\d+)?)?$/,ME=t=>{const e=t.trim().toLowerCase().replace(/[()[\]*]/g," ").replace(/[.!?,…]+$/,"").replace(/\s+/g," ").trim();return!e||/^(?:sh+\s*)+$/.test(e)||CE.test(e)?!0:m1.has(e)},AE=t=>{const e=t.trim().toLowerCase().replace(/\s+/g," ");return e?/^(?:transcribe|transcription|transcribed text)[.!:]*$/.test(e)?!0:e.includes("transcribe this audio recording verbatim")||e.includes("preserve the spoken language and any code-switching")||e.includes("output only the transcribed text, no commentary"):!1};let y1=!0,vs=null;const DE=t=>{y1=t},IE=()=>{const t=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!t)return null;if(!vs)try{vs=new t}catch{return null}return vs.state==="suspended"&&vs.resume(),vs},gs=(t,e,r,n,a,i)=>{const o=t.createOscillator(),s=t.createGain();o.type=a,o.frequency.setValueAtTime(e,r),o.connect(s),s.connect(t.destination),s.gain.setValueAtTime(1e-4,r),s.gain.exponentialRampToValueAtTime(i,r+.012),s.gain.exponentialRampToValueAtTime(1e-4,r+n),o.start(r),o.stop(r+n+.03)},Yi=t=>{if(!y1)return;const e=IE();if(!e)return;const r=e.currentTime;try{t==="open"?(gs(e,523,r,.12,"sine",.05),gs(e,784,r+.08,.16,"sine",.05)):t==="send"?gs(e,660,r,.08,"triangle",.04):t==="receive"&&(gs(e,880,r,.1,"sine",.045),gs(e,1175,r+.09,.14,"sine",.045))}catch{}},LE=t=>t.startsWith("image/")?"image":t==="application/pdf"?"pdf":"other",PE=({state:t,onClose:e})=>{const r=kr(),n=X(null);le(()=>{n.current?.focus();const i=o=>{o.key==="Escape"&&(o.stopPropagation(),e())};return document.addEventListener("keydown",i,!0),()=>document.removeEventListener("keydown",i,!0)},[e]);const a=t.status==="ready"?LE(t.mimeType):"other";return _("div",{class:"cf-preview",role:"dialog","aria-modal":"true","aria-label":ct(r.attachPreviewTitle,{name:t.name}),onClick:i=>{i.target===i.currentTarget&&e()},children:_("div",{class:"cf-preview__frame",children:[_("div",{class:"cf-preview__bar",children:[_("span",{class:"cf-preview__name",title:t.name,children:t.name}),t.status==="ready"&&_("a",{class:"cf-preview__btn",href:t.url,download:t.name,children:r.attachDownload}),_("button",{ref:n,type:"button",class:"cf-preview__btn cf-preview__close","aria-label":r.attachPreviewClose,onClick:e,children:"✕"})]}),_("div",{class:"cf-preview__body",children:[t.status==="loading"&&_("p",{class:"cf-preview__note",children:r.attachPreviewLoading}),t.status==="error"&&_("p",{class:"cf-preview__note",children:r.attachPreviewFailed}),t.status==="ready"&&a==="image"&&_("img",{class:"cf-preview__image",src:t.url,alt:t.name}),t.status==="ready"&&a==="pdf"&&_("iframe",{class:"cf-preview__pdf",src:t.url,title:t.name}),t.status==="ready"&&a==="other"&&_("p",{class:"cf-preview__note",children:r.attachPreviewUnsupported})]})]})})},RE=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result??"").split(",")[1]??""),n.onerror=()=>r(n.error),n.readAsDataURL(t)}),EE=(t,e)=>t?.status===429?e.errorRateLimit:e.errorGeneric,Dp=()=>typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),nu=(t,e)=>{const r=Dp(),n={stage:t,durationMs:Math.max(0,r-e)};try{performance.measure(`centrinfo-widget:${t}`,{start:e,end:r})}catch{}return typeof window<"u"&&typeof CustomEvent<"u"&&window.dispatchEvent(new CustomEvent("centrinfo:performance",{detail:n})),n},OE=/!?\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,NE=/https?:\/\/[^\s)]+/g,BE=t=>t.replace(/```[\s\S]*?```/g,e=>e.replace(/^```[^\n]*\n?/,"").replace(/```$/,"").trim()),zE=t=>BE(t).replace(OE,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/(^|[\s([{])\*([^*\n]{1,120})\*(?=[\s.,;:!?)}\]]|$)/g,"$1$2").replace(/(^|[\s([{])_([^_\n]{1,120})_(?=[\s.,;:!?)}\]]|$)/g,"$1$2").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s{0,3}[-*+]\s+/gm,"").replace(/^\s{0,3}\d+\.\s+/gm,"").replace(/\s+\*/g," ").replace(/\*\s+/g," ").replace(/[*_]{2,}/g,"").replace(NE,e=>e.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,"")).replace(/[ \t]+\n/g,`
|
|
28
28
|
`).replace(/\n{3,}/g,`
|
|
29
29
|
|
|
30
|
-
`).replace(/[ \t]{2,}/g," ").trim(),on=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,Ec=(t,e)=>{typeof console>"u"||console.warn(`[centrinfo-widget] ${t}`,e??{})},n1=(t,e,r,n,a=1,i,o=!1,s,l)=>{t.current?.pause(),t.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),e.current=null;const c=()=>{const d=i?.trim();if(!o||!d||typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return!1;const p=new SpeechSynthesisUtterance(d);let m=!1;const g=()=>{m||(m=!0,e.current===p&&(e.current=null,l?.()))};return p.rate=a,p.lang=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en-US",p.onend=g,p.onerror=g,e.current=p,s?.(),window.speechSynthesis.cancel(),window.speechSynthesis.speak(p),!0};if(!r||typeof Audio>"u")return c();const u=new Audio(`data:${n||"audio/mpeg"};base64,${r}`);let f=!1;const h=()=>{f||(f=!0,t.current===u&&(t.current=null,l?.()))};return u.playbackRate=a,u.onended=h,u.onerror=h,t.current=u,u.play().then(()=>{if(t.current!==u){h();return}s?.(Number.isFinite(u.duration)?u.duration*1e3:void 0)}).catch(()=>{c()||h()}),!0},$5=t=>{try{return t==="none"?null:t==="session"?sessionStorage:localStorage}catch{return null}},W5=t=>{let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619);return(e>>>0).toString(36)},U5=t=>{try{const e=t?.split(".")[1];if(!e)return;const r=e.replace(/-/g,"+").replace(/_/g,"/"),n=JSON.parse(atob(r.padEnd(Math.ceil(r.length/4)*4,"=")));for(const a of["sub","external_user_id","user_id"]){const i=n[a];if(typeof i=="string"&&i.trim())return i.trim()}}catch{}},Y5=t=>{const e=t.user?.externalId?.trim()||t.user?.userId?.trim()||t.user?.email?.trim().toLowerCase()||U5(t.identityToken)||(t.identityToken||t.getIdentityToken?"authenticated":"anonymous");return`${t.token.slice(0,12)}:${t.chatSurface}:${W5(e)}`},Qo=t=>`${t.chatSurface}:${on()}`,q5=t=>t.slice(0,12),Jo=t=>`centrinfo:session:${t}`,cp=t=>`centrinfo:visitor:${t}`,Oc=(t,e)=>`centrinfo:chat:${t}:${e}`,up=t=>`centrinfo:history:${t}`,a1=20,fp=720*60*60*1e3,X5=1440*60*1e3,Z5=(t,e)=>{try{return JSON.parse(t?.getItem(cp(e))||"{}")}catch{return{}}},K5=(t,e,r)=>{if(!t)return Qo(r);try{const n=Jo(e),a=t.getItem(n);if(a)return a;const i=Qo(r);return t.setItem(n,i),i}catch{return Qo(r)}},i1=(t,e,r)=>{if(!t)return{};try{const n=t.getItem(Oc(e,r));return n?JSON.parse(n):{}}catch{return{}}},o1=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i}=i1(t,e,r);return Array.isArray(i)?typeof a=="number"&&Date.now()>a?[]:typeof n=="number"&&Date.now()-n>fp?[]:i:[]},j5=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i,ended:o}=i1(t,e,r);return!Array.isArray(i)||i.length===0||typeof a=="number"&&Date.now()>a||typeof n=="number"&&Date.now()-n>fp?!1:o===!0||typeof n=="number"&&Date.now()-n>X5},Q5=t=>Number.isFinite(t??NaN)?Math.max(5,Math.min(200,Math.round(t))):50,J5=t=>Number.isFinite(t??NaN)?Math.max(1,Math.min(365,Math.round(t)))*24*60*60*1e3:fp,s1=(t,e,r,n,a,i,o,s)=>{if(t)try{if(!i){t.removeItem(Oc(e,r));return}const l=n.filter(u=>!u.pending).slice(-o);if(l.length===0)return;const c=Date.now();t.setItem(Oc(e,r),JSON.stringify({ts:c,expiresAt:c+s,messages:l,ended:a}))}catch{}},eE=(t,e)=>{if(!t)return[];try{const r=t.getItem(up(e)),n=r?JSON.parse(r):[];return Array.isArray(n)?n:[]}catch{return[]}},Nc=(t,e,r)=>{if(t)try{t.setItem(up(e),JSON.stringify(r.slice(0,a1)))}catch{}},l1=(t,e)=>{if(t)try{const r=`centrinfo:chat:${e}:`,n=new Set([Jo(e),cp(e),up(e)]),a=[];for(let i=0;i<t.length;i++){const o=t.key(i);o&&(n.has(o)||o.startsWith(r))&&a.push(o)}a.forEach(i=>t.removeItem(i))}catch{}},tE=t=>{const n=(t.find(a=>a.role==="user"&&a.content.trim())?.content||t.find(a=>a.content.trim())?.content||"").trim().replace(/\s+/g," ");return n.length>60?n.slice(0,60)+"…":n||"Conversation"},rE=t=>({id:`live:${t.id}`,role:t.type==="chat"||t.type==="ai_resume"?"assistant":"system",content:t.content,authorName:t.authorName,liveEventType:t.type,createdAt:t.createdAt}),nE=(t,e,r=!0)=>{const n=W($5(e.persistence)).current,a=Y5(e),i=W(K5(n,a,e)),o=W(null),s=W(null),l=W(null),c=W(void 0),u=W(null),f=W({}),[h,d]=V(null),[p,m]=V(()=>o1(n,a,i.current)),g=W(p.length>0),v=W(p.some(B=>B.role==="user")),[y,b]=V(!1),[x,S]=V(!1),[w,k]=V(()=>j5(n,a,i.current)),[T,C]=V(()=>Z5(n,a)),[A,M]=V(()=>eE(n,a)),[I,L]=V(null),[P,N]=V([]),[O,q]=V("ai"),[R,z]=V(void 0),[F,X]=V(void 0),te=W(new Date().toISOString()),fe=W(void 0),me=W(!1),we=W(0),Ze=W(T);ie(()=>{Ze.current=T},[T]);const Ie=h?.memoryEnabled!==!1,tt=Q5(h?.memoryMessageCap),Ge=J5(h?.memoryRetentionDays),Me=Q(()=>{o.current?.abort(),l1(n,a),l1(n,q5(e.token));const B=Qo(e);i.current=B;try{n?.setItem(Jo(a),B)}catch{}L(null),N([]),k(!1),M([]),C({}),q("ai"),z(void 0),X(void 0),te.current=new Date().toISOString(),m(h?[{id:on(),role:"assistant",content:h.greeting,availableActions:h.availableActions,actions:h.actions}]:[])},[n,a,e.token,h]),re=Q(B=>{try{n?.setItem(cp(a),JSON.stringify(B))}catch{}},[n,a]),he=Q(B=>{const H=(B.email??"").trim().toLowerCase(),j=(Ze.current.email??"").trim().toLowerCase();H&&j&&H!==j&&Me();const K={};B.email?.trim()&&(K.email=B.email.trim()),B.phone?.trim()&&(K.phone=B.phone.trim());const se=[B.firstName,B.lastName].filter(ke=>!!ke?.trim()).join(" ").trim()||B.name?.trim()||"";se&&(K.name=se),Object.keys(K).length>0&&C(ke=>{const be={...K,...ke};return re(be),be}),t.identify(i.current,B).catch(()=>{})},[t,re,Me]),Be=Q(B=>{d(B),m(H=>{if(H.length===0)return[{id:on(),role:"assistant",content:B.greeting,availableActions:B.availableActions,actions:B.actions}];const j=H.some(ae=>ae.role==="user"),K=H[0];return!j&&K?.role==="assistant"?[{...K,content:B.greeting,availableActions:B.availableActions,actions:B.actions},...H.slice(1)]:H})},[]);ie(()=>{if(h?.memoryEnabled===!1){try{n?.removeItem(Oc(a,i.current))}catch{}Nc(n,a,[]),M([]),L(null),N([]),m(B=>g.current?(g.current=!1,h?[{id:on(),role:"assistant",content:h.greeting,availableActions:h.availableActions,actions:h.actions}]:[]):B)}},[h,n,a]);const pe=Q(async()=>{const B=await t.bootstrap();Be(B)},[Be,t]);ie(()=>{let B=!0;const H=j=>j.messages.map(K=>({id:K.id,role:K.role,content:K.content,authorName:K.authorName,liveEventType:K.messageType,sources:K.sources,visualization:K.visualization,artifacts:K.artifacts,createdAt:K.createdAt}));return t.history().then(j=>{if(!B||j.conversations.length===0)return;const K=j.conversations.map(be=>({sessionId:be.sessionId,ts:Date.parse(be.lastSeenAt)||Date.now(),title:be.title,ended:be.ended}));for(const be of j.conversations)s1(n,a,be.sessionId,H(be),be.ended,!0,tt,Ge);Nc(n,a,K),M(K);const ae=j.conversations.find(be=>be.sessionId===j.activeSessionId);if(!ae||v.current)return;const se=H(ae);i.current=ae.sessionId,g.current=se.length>0;try{n?.setItem(Jo(a),ae.sessionId)}catch{}const ke=se[se.length-1]?.createdAt;ke&&(te.current=ke),k(ae.ended),m(se)}).catch(()=>{}),()=>{B=!1}},[tt,Ge,a,n,t]),ie(()=>{let B=!0;return t.bootstrap().then(H=>{B&&Be(H)}),e.user&&he(e.user),()=>{B=!1}},[Be,t]),ie(()=>{const B=e.configRefreshSeconds;if(!r||B<=0||typeof window>"u")return;let H=!0,j=!1;const K=Math.max(10,B)*1e3,ae=()=>typeof document>"u"||document.visibilityState!=="hidden",se=async()=>{if(!(!H||j||!ae())){j=!0;try{await pe()}catch{}finally{j=!1}}};se();const ke=window.setInterval(se,K),be=()=>{se()},J=()=>{se()};return window.addEventListener("focus",be),document?.addEventListener?.("visibilitychange",J),()=>{H=!1,window.clearInterval(ke),window.removeEventListener("focus",be),document?.removeEventListener?.("visibilitychange",J)}},[r,e.configRefreshSeconds,pe]),ie(()=>{s1(n,a,i.current,p,w,Ie,tt,Ge)},[p,w,n,a,Ie,tt,Ge]),ie(()=>{if(w||I)return;let B=!0,H=!1;const j=async()=>{if(!H){H=!0;try{const ae=await t.liveEvents(i.current,te.current);if(!B)return;if(q(ae.mode),z(ae.assignedAgentName||void 0),X(ae.agentTyping?ae.agentTypingName||ae.assignedAgentName||"Agent":void 0),ae.conversationEnded){k(!0),q("ai"),z(void 0),X(void 0),m(se=>se.some(ke=>ke.id==="live:conversation-ended")?se:[...se,{id:"live:conversation-ended",role:"system",content:e.strings.conversationEnded,liveEventType:"conversation_ended",createdAt:new Date().toISOString()}]);return}if(ae.events.length>0){let se=te.current,ke=Date.parse(se);const be=ae.events.map(J=>{const ht=Date.parse(J.createdAt);return Number.isFinite(ht)&&ht>ke&&(ke=ht,se=J.createdAt),rE(J)});te.current=se,m(J=>{const ht=new Set(J.map(Je=>Je.id)),rt=be.filter(Je=>!ht.has(Je.id));return rt.length>0?[...J,...rt]:J}),be.some(J=>J.role==="assistant")&&Mi("receive")}}catch{}finally{H=!1}}};j();const K=window.setInterval(j,2200);return()=>{B=!1,window.clearInterval(K)}},[e.strings.conversationEnded,t,w,I]),ie(()=>{if(!Ie){Nc(n,a,[]),M(H=>H.length>0?[]:H);return}p.some(H=>H.role==="user")&&M(H=>{const j=i.current,ae=[{sessionId:j,ts:Date.now(),title:tE(p),ended:w},...H.filter(se=>se.sessionId!==j)];return Nc(n,a,ae),ae.slice(0,a1)})},[p,w,n,a,Ie]);const Se=Q((B,H)=>{m(j=>j.map(K=>K.id===B?{...K,...H}:K))},[]),ct=Q(()=>{c.current!==void 0&&typeof window<"u"&&window.clearInterval(c.current),c.current=void 0},[]),pt=Q((B,H)=>{ct(),u.current===B&&(u.current=null),Se(B,{content:H,pending:!1,streaming:!1})},[ct,Se]),sn=Q((B,H,j)=>{const K=H.trim();if(!K||typeof window>"u"){pt(B,K);return}ct(),u.current=B;const ae=K.match(/\S+\s*/g)??[K],se=j&&j>0?j:ae.length*95,ke=Math.max(28,Math.min(150,se/Math.max(ae.length,1)));let be=0;Se(B,{content:"",pending:!1,streaming:!0}),c.current=window.setInterval(()=>{be+=1;const J=ae.slice(0,be).join("");Se(B,{content:J,pending:!1,streaming:be<ae.length}),be>=ae.length&&(ct(),u.current===B&&(u.current=null),Se(B,{content:K,pending:!1,streaming:!1}))},ke)},[ct,pt,Se]),cr=Q(()=>{const B=u.current;ct(),u.current=null,B&&Se(B,{pending:!1,streaming:!1})},[ct,Se]),Y=Q(B=>{if(w||I||O==="ai"||typeof window>"u")return;if(fe.current!==void 0&&window.clearTimeout(fe.current),!B){if(!me.current)return;me.current=!1,we.current=0,t.typing(i.current,!1).catch(()=>{});return}const H=Date.now();(!me.current||H-we.current>2500)&&(me.current=!0,we.current=H,t.typing(i.current,!0).catch(()=>{})),fe.current=window.setTimeout(()=>{me.current&&(me.current=!1,we.current=0,t.typing(i.current,!1).catch(()=>{}))},1600)},[t,w,I,O]);ie(()=>()=>{fe.current!==void 0&&typeof window<"u"&&window.clearTimeout(fe.current)},[]),ie(()=>()=>ct(),[ct]);const le=Q((B,H,j={})=>{cr(),b(!0);const K=sp();let ae=!1;const se=new AbortController;o.current=se;const ke=!!(h?.allowVoiceInput&&h?.voiceOutputEnabled&&h.talkbackMode!=="text"),be=!!(j.forceVoicePlayback&&ke);t.stream(B,i.current,{voicePlaybackRequested:!!j.forceVoicePlayback,signal:se.signal,onChunk:J=>{J&&!ae&&(ae=!0,lp("data-first-chunk",K)),!be&&(j.forceVoicePlayback&&J&&(f.current[H]=!0),m(ht=>ht.map(rt=>rt.id===H?{...rt,content:rt.content+J,pending:!1,streaming:!0}:rt)))}}).then(J=>{if(J.liveMode&&(q(J.liveMode),z(J.assignedAgentName||void 0)),J.liveMode&&J.liveMode!=="ai"&&!J.answer.trim()){m(Je=>Je.filter(ut=>ut.id!==H));return}const ht=!!f.current[H];delete f.current[H];const rt=!!(j.forceVoicePlayback&&ke&&J.audioBase64&&J.answer.trim()&&!ht);if(m(Je=>Je.map(ut=>ut.id===H?{...ut,content:rt?"":J.answer||ut.content||e.strings.emptyReply,pending:!1,streaming:rt,error:!1,retryText:void 0,sources:J.sources,suggestedReplies:J.suggestedReplies,availableActions:J.availableActions,actions:J.actions,selectedAction:J.selectedAction,handoffOffered:J.handoffOffered,requestedContactFields:J.requestedContactFields,visualization:J.visualization,artifacts:J.artifacts}:ut)),Mi("receive"),j.forceVoicePlayback&&!J.audioBase64&&Ec(ke?"Talkback expected backend TTS audio, but the chat response did not include audioBase64.":"Talkback voice was requested, but the loaded widget token config does not enable provider TTS.",{voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode,voiceProvider:h?.voiceProvider,hasAudioBase64:!!J.audioBase64}),j.forceVoicePlayback){const Je=n1(s,l,J.audioBase64,J.mimeType,h?.voiceSpeed??1,J.answer,!0,ut=>{S(!0),rt&&sn(H,J.answer,ut)},()=>{S(!1),rt&&pt(H,J.answer)});rt&&!Je&&pt(H,J.answer)}J.answer&&e.onMessage?.({role:"assistant",content:J.answer}),J.handoffOffered&&e.onHandoff?.(),J.conversationEnded&&k(!0)}).catch(J=>{if(se.signal.aborted){delete f.current[H],Se(H,{pending:!1,streaming:!1});return}delete f.current[H];const ht=z5(J,e.strings);Se(H,{content:ht,pending:!1,streaming:!1,error:!0,retryText:B})}).finally(()=>{lp("data-complete",K),delete f.current[H],b(!1),o.current=null})},[t,e,Se,h?.allowVoiceInput,h?.talkbackMode,h?.voiceOutputEnabled,h?.voiceSpeed,cr]),G=Q((B,H={})=>{const j=B.trim(),{imageUrl:K,attachmentName:ae,attachmentText:se,forceVoicePlayback:ke,userMessageId:be}=H;if(!j&&!K&&!se||y||w)return;v.current=!0;let J=j;if(se){const Je=ae?` "${ae}"`:"";J=`${j}
|
|
30
|
+
`).replace(/[ \t]{2,}/g," ").trim(),Tr=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,au=(t,e)=>{typeof console>"u"||console.warn(`[centrinfo-widget] ${t}`,e??{})},_1=(t,e,r,n,a=1,i,o=!1,s,l)=>{t.current?.pause(),t.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),e.current=null;const c=()=>{const m=i?.trim();if(!o||!m||typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return!1;const g=new SpeechSynthesisUtterance(m);let v=!1;const y=()=>{v||(v=!0,e.current===g&&(e.current=null,l?.()))};return g.rate=a,g.lang=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en-US",g.onend=y,g.onerror=y,e.current=g,s?.(),window.speechSynthesis.cancel(),window.speechSynthesis.speak(g),!0};if(!r||typeof Audio>"u")return c();const u=new Audio(`data:${n||"audio/mpeg"};base64,${r}`);let f=!1,h=!1;const d=()=>{f||(f=!0,t.current===u&&(t.current=null,l?.()))},p=()=>{if(!f){if(h||t.current!==u){d();return}f=!0,t.current=null,c()||l?.()}};return u.playbackRate=a,u.onended=d,u.onerror=p,t.current=u,u.play().then(()=>{if(!f){if(t.current!==u){d();return}h=!0,s?.(Number.isFinite(u.duration)?u.duration*1e3:void 0)}}).catch(p),!0},FE=t=>{try{return t==="none"?null:t==="session"?sessionStorage:localStorage}catch{return null}},HE=t=>{let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619);return(e>>>0).toString(36)},VE=t=>{try{const e=t?.split(".")[1];if(!e)return;const r=e.replace(/-/g,"+").replace(/_/g,"/"),n=JSON.parse(atob(r.padEnd(Math.ceil(r.length/4)*4,"=")));for(const a of["sub","external_user_id","user_id"]){const i=n[a];if(typeof i=="string"&&i.trim())return i.trim()}}catch{}},UE=t=>{const e=t.user?.externalId?.trim()||t.user?.userId?.trim()||t.user?.email?.trim().toLowerCase()||VE(t.identityToken)||(t.identityToken||t.getIdentityToken?"authenticated":"anonymous");return`${t.token.slice(0,12)}:${t.chatSurface}:${HE(e)}`},ms=t=>`${t.chatSurface}:${Tr()}`,GE=t=>t.slice(0,12),ys=t=>`centrinfo:session:${t}`,Ip=t=>`centrinfo:visitor:${t}`,iu=(t,e)=>`centrinfo:chat:${t}:${e}`,Lp=t=>`centrinfo:history:${t}`,b1=20,Pp=720*60*60*1e3,$E=1440*60*1e3,WE=(t,e)=>{try{return JSON.parse(t?.getItem(Ip(e))||"{}")}catch{return{}}},qE=(t,e,r)=>{if(!t)return ms(r);try{const n=ys(e),a=t.getItem(n);if(a)return a;const i=ms(r);return t.setItem(n,i),i}catch{return ms(r)}},x1=(t,e,r)=>{if(!t)return{};try{const n=t.getItem(iu(e,r));return n?JSON.parse(n):{}}catch{return{}}},w1=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i}=x1(t,e,r);return Array.isArray(i)?typeof a=="number"&&Date.now()>a?[]:typeof n=="number"&&Date.now()-n>Pp?[]:i:[]},YE=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i,ended:o}=x1(t,e,r);return!Array.isArray(i)||i.length===0||typeof a=="number"&&Date.now()>a||typeof n=="number"&&Date.now()-n>Pp?!1:o===!0||typeof n=="number"&&Date.now()-n>$E},XE=t=>Number.isFinite(t??NaN)?Math.max(5,Math.min(200,Math.round(t))):50,ZE=t=>Number.isFinite(t??NaN)?Math.max(1,Math.min(365,Math.round(t)))*24*60*60*1e3:Pp,S1=(t,e,r,n,a,i,o,s)=>{if(t)try{if(!i){t.removeItem(iu(e,r));return}const l=n.filter(u=>!u.pending).slice(-o);if(l.length===0)return;const c=Date.now();t.setItem(iu(e,r),JSON.stringify({ts:c,expiresAt:c+s,messages:l,ended:a}))}catch{}},KE=(t,e)=>{if(!t)return[];try{const r=t.getItem(Lp(e)),n=r?JSON.parse(r):[];return Array.isArray(n)?n:[]}catch{return[]}},ou=(t,e,r)=>{if(t)try{t.setItem(Lp(e),JSON.stringify(r.slice(0,b1)))}catch{}},k1=(t,e)=>{if(t)try{const r=`centrinfo:chat:${e}:`,n=new Set([ys(e),Ip(e),Lp(e)]),a=[];for(let i=0;i<t.length;i++){const o=t.key(i);o&&(n.has(o)||o.startsWith(r))&&a.push(o)}a.forEach(i=>t.removeItem(i))}catch{}},jE=t=>{const n=(t.find(a=>a.role==="user"&&a.content.trim())?.content||t.find(a=>a.content.trim())?.content||"").trim().replace(/\s+/g," ");return n.length>60?n.slice(0,60)+"…":n||"Conversation"},JE=t=>({id:`live:${t.id}`,role:t.type==="chat"||t.type==="ai_resume"?"assistant":"system",content:t.content,authorName:t.authorName,liveEventType:t.type,createdAt:t.createdAt,offerReconnect:t.type==="ai_handback"&&t.reconnectOffered===!0}),T1=t=>(t??[]).find(e=>e.category==="support"&&e.enabled&&e.readiness!=="unavailable"&&(e.liveHandoff??e.id==="public_contact_support")),QE=(t,e)=>{if(e==="ai")for(let r=t.length-1;r>=0;r--){const n=t[r];if(n){if(n.reconnectOffer)return;if(n.liveEventType==="ai_handback")return n.offerReconnect?n.id:void 0}}},eO=(t,e,r=!0)=>{const n=X(FE(e.persistence)).current,a=UE(e),i=X(qE(n,a,e)),o=X(null),s=X(null),l=X(null),c=X(null),u=X(null),f=X(null),h=X(new Map),d=X(!1),p=X(void 0),m=X(null),g=X({}),v=X({}),[y,b]=U(null),[x,w]=U(()=>w1(n,a,i.current)),S=X(x.length>0),k=X(x.some(E=>E.role==="user")),[C,A]=U(!1),[M,T]=U(!1),[D,L]=U({status:"idle"}),R=X({}),[O,B]=U(()=>YE(n,a,i.current)),[j,P]=U(()=>WE(n,a)),[V,H]=U(()=>KE(n,a)),[Z,re]=U(null),[Te,ge]=U([]),[xe,Ce]=U("ai"),[be,it]=U(void 0),[Qe,ze]=U(void 0),oe=X(new Date().toISOString()),pe=X(void 0),ot=X(!1),Xe=X(0),kt=X(j);le(()=>{kt.current=j},[j]);const tt=y?.memoryEnabled!==!1,lr=XE(y?.memoryMessageCap),Cr=ZE(y?.memoryRetentionDays),Tt=Y(()=>{o.current?.abort(),k1(n,a),k1(n,GE(e.token));const E=ms(e);i.current=E;try{n?.setItem(ys(a),E)}catch{}re(null),ge([]),B(!1),H([]),P({}),Ce("ai"),it(void 0),ze(void 0),oe.current=new Date().toISOString(),w(y?[{id:Tr(),role:"assistant",content:y.greeting,availableActions:y.availableActions,actions:y.actions}]:[])},[n,a,e.token,y]),Pt=Y(E=>{try{n?.setItem(Ip(a),JSON.stringify(E))}catch{}},[n,a]),Bt=Y(E=>{const z=(E.email??"").trim().toLowerCase(),W=(kt.current.email??"").trim().toLowerCase();z&&W&&z!==W&&Tt();const G={};E.email?.trim()&&(G.email=E.email.trim()),E.phone?.trim()&&(G.phone=E.phone.trim());const ie=[E.firstName,E.lastName].filter(ce=>!!ce?.trim()).join(" ").trim()||E.name?.trim()||"";ie&&(G.name=ie),Object.keys(G).length>0&&P(ce=>{const ye={...G,...ce};return Pt(ye),ye}),t.identify(i.current,E).catch(()=>{})},[t,Pt,Tt]),xt=Y(E=>{b(E),w(z=>{if(z.length===0)return[{id:Tr(),role:"assistant",content:E.greeting,availableActions:E.availableActions,actions:E.actions}];const W=z.some(J=>J.role==="user"),G=z[0];return!W&&G?.role==="assistant"?[{...G,content:E.greeting,availableActions:E.availableActions,actions:E.actions},...z.slice(1)]:z})},[]);le(()=>{if(y?.memoryEnabled===!1){try{n?.removeItem(iu(a,i.current))}catch{}ou(n,a,[]),H([]),re(null),ge([]),w(E=>S.current?(S.current=!1,y?[{id:Tr(),role:"assistant",content:y.greeting,availableActions:y.availableActions,actions:y.actions}]:[]):E)}},[y,n,a]);const tn=Y(async()=>{const E=await t.bootstrap();xt(E)},[xt,t]);le(()=>{let E=!0;const z=W=>W.messages.map(G=>({id:G.id,role:G.role,content:G.content,authorName:G.authorName,liveEventType:G.messageType,offerReconnect:G.messageType==="ai_handback"&&G.reconnectOffered===!0,sources:G.sources,visualization:G.visualization,artifacts:G.artifacts,createdAt:G.createdAt}));return t.history().then(W=>{if(!E||W.conversations.length===0)return;const G=W.conversations.map(ye=>({sessionId:ye.sessionId,ts:Date.parse(ye.lastSeenAt)||Date.now(),title:ye.title,ended:ye.ended}));for(const ye of W.conversations)S1(n,a,ye.sessionId,z(ye),ye.ended,!0,lr,Cr);ou(n,a,G),H(G);const J=W.conversations.find(ye=>ye.sessionId===W.activeSessionId);if(!J||k.current)return;const ie=z(J);i.current=J.sessionId,S.current=ie.length>0;try{n?.setItem(ys(a),J.sessionId)}catch{}const ce=ie[ie.length-1]?.createdAt;ce&&(oe.current=ce),B(J.ended),w(ie)}).catch(()=>{}),()=>{E=!1}},[lr,Cr,a,n,t]),le(()=>{let E=!0;return t.bootstrap().then(z=>{E&&xt(z)}),e.user&&Bt(e.user),()=>{E=!1}},[xt,t]),le(()=>{const E=e.configRefreshSeconds;if(!r||E<=0||typeof window>"u")return;let z=!0,W=!1;const G=Math.max(10,E)*1e3,J=()=>typeof document>"u"||document.visibilityState!=="hidden",ie=async()=>{if(!(!z||W||!J())){W=!0;try{await tn()}catch{}finally{W=!1}}};ie();const ce=window.setInterval(ie,G),ye=()=>{ie()},Fe=()=>{ie()};return window.addEventListener("focus",ye),document?.addEventListener?.("visibilitychange",Fe),()=>{z=!1,window.clearInterval(ce),window.removeEventListener("focus",ye),document?.removeEventListener?.("visibilitychange",Fe)}},[r,e.configRefreshSeconds,tn]),le(()=>{S1(n,a,i.current,x,O,tt,lr,Cr)},[x,O,n,a,tt,lr,Cr]),le(()=>{if(!r||O||Z)return;const E=()=>{document.visibilityState==="visible"&&t.presence(i.current)};E();const z=window.setInterval(E,1e4);return document.addEventListener("visibilitychange",E),()=>{window.clearInterval(z),document.removeEventListener("visibilitychange",E)}},[r,O,t,Z]),le(()=>{if(O||Z)return;let E=!0,z=!1;const W=async()=>{if(!z){z=!0;try{const J=await t.liveEvents(i.current,oe.current);if(!E)return;if(Ce(J.mode),it(J.assignedAgentName||void 0),ze(J.agentTyping?J.agentTypingName||J.assignedAgentName||"Agent":void 0),J.conversationEnded){B(!0),Ce("ai"),it(void 0),ze(void 0),w(ie=>ie.some(ce=>ce.id==="live:conversation-ended")?ie:[...ie,{id:"live:conversation-ended",role:"system",content:e.strings.conversationEnded,liveEventType:"conversation_ended",createdAt:new Date().toISOString()}]);return}if(J.events.length>0){let ie=oe.current,ce=Date.parse(ie);const ye=J.events.map(Fe=>{const ne=Date.parse(Fe.createdAt);return Number.isFinite(ne)&&ne>ce&&(ce=ne,ie=Fe.createdAt),JE(Fe)});oe.current=ie,w(Fe=>{const ne=new Set(Fe.map(yt=>yt.id)),rr=ye.filter(yt=>!ne.has(yt.id));return rr.length>0?[...Fe,...rr]:Fe}),ye.some(Fe=>Fe.role==="assistant")&&Yi("receive")}}catch{}finally{z=!1}}};W();const G=window.setInterval(W,2200);return()=>{E=!1,window.clearInterval(G)}},[e.strings.conversationEnded,t,O,Z]),le(()=>{if(!tt){ou(n,a,[]),H(z=>z.length>0?[]:z);return}x.some(z=>z.role==="user")&&H(z=>{const W=i.current,J=[{sessionId:W,ts:Date.now(),title:jE(x),ended:O},...z.filter(ie=>ie.sessionId!==W)];return ou(n,a,J),J.slice(0,b1)})},[x,O,n,a,tt]);const F=Y((E,z)=>{w(W=>W.map(G=>G.id===E?{...G,...z}:G))},[]),ue=Y(()=>{p.current!==void 0&&typeof window<"u"&&window.clearInterval(p.current),p.current=void 0},[]),De=Y((E,z)=>{ue(),delete g.current[E],m.current===E&&(m.current=null),F(E,{content:z,pending:!1,streaming:!1})},[ue,F]),we=Y((E,z,W)=>{const G=z.trim();if(!G||typeof window>"u"){De(E,G);return}ue(),m.current=E;const J=G.match(/\S+\s*/g)??[G],ie=W&&W>0?W:J.length*95,ce=Math.max(28,Math.min(150,ie/Math.max(J.length,1)));let ye=0;F(E,{content:"",pending:!1,streaming:!0}),p.current=window.setInterval(()=>{ye+=1;const Fe=J.slice(0,ye).join("");F(E,{content:Fe,pending:!1,streaming:ye<J.length}),ye>=J.length&&(ue(),delete g.current[E],m.current===E&&(m.current=null),F(E,{content:G,pending:!1,streaming:!1}))},ce)},[ue,De,F]),rt=Y(()=>{const E=m.current;ue(),m.current=null;const z=g.current;g.current={};for(const[W,G]of Object.entries(z))F(W,{content:G,pending:!1,streaming:!1});E&&!(E in z)&&F(E,{pending:!1,streaming:!1})},[ue,F]),vt=Y(E=>{if(O||Z||xe==="ai"||typeof window>"u")return;if(pe.current!==void 0&&window.clearTimeout(pe.current),!E){if(!ot.current)return;ot.current=!1,Xe.current=0,t.typing(i.current,!1).catch(()=>{});return}const z=Date.now();(!ot.current||z-Xe.current>2500)&&(ot.current=!0,Xe.current=z,t.typing(i.current,!0).catch(()=>{})),pe.current=window.setTimeout(()=>{ot.current&&(ot.current=!1,Xe.current=0,t.typing(i.current,!1).catch(()=>{}))},1600)},[t,O,Z,xe]);le(()=>()=>{pe.current!==void 0&&typeof window<"u"&&window.clearTimeout(pe.current)},[]),le(()=>()=>ue(),[ue]);const Mr=Y((E,z,W={})=>{rt(),A(!0);const G=Dp();let J=!1;const ie=new AbortController;o.current=ie;const ce=!!(y?.allowVoiceInput&&y?.voiceOutputEnabled&&y.talkbackMode!=="text"),ye=!!W.forceVoicePlayback,Fe=Q=>{ye&&L(Ee=>Ee.agentId===z?{status:Q,agentId:z}:Ee)};ye&&L({status:"answering",agentId:z});const ne={pending:new Map,nextSeq:0,highestSeq:-1,playing:!1,ended:!1,started:!1,stopped:!1,utterance:null},rr=()=>{f.current===Ct&&(f.current=null),ne.started&&(ne.started=!1,T(!1),Fe("done"))},yt=()=>{ne.stopped||ne.started||(ne.started=!0,nu("voice-first-audio",G),T(!0),Fe("speaking"))},ra=()=>typeof window<"u"&&"speechSynthesis"in window&&typeof SpeechSynthesisUtterance<"u",Rt=()=>{c.current&&ne.playing&&(c.current.pause(),c.current=null),ne.utterance&&(u.current===ne.utterance&&(u.current=null),ne.utterance=null,ra()&&window.speechSynthesis.cancel()),ne.playing=!1},gt=(Q,Ee)=>{const st=Q?.trim();if(!st||!ra())return!1;const Re=new SpeechSynthesisUtterance(st);return Re.rate=y?.voiceSpeed??1,Re.lang=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en-US",Re.onstart=yt,Re.onend=Ee,Re.onerror=Ee,ne.utterance=Re,u.current=Re,window.speechSynthesis.speak(Re),d.current&&window.speechSynthesis.pause(),!0},Hr=()=>{for(;!ne.stopped&&!ne.playing;){let Q=ne.pending.get(ne.nextSeq);if(!Q&&ne.ended&&ne.pending.size>0&&(ne.nextSeq=Math.min(...ne.pending.keys()),Q=ne.pending.get(ne.nextSeq)),!Q){ne.ended&&rr();return}if(ne.pending.delete(ne.nextSeq),ne.nextSeq+=1,Ze(Q))return}},Ze=Q=>{let Ee=!1;const st=()=>{Ee||(Ee=!0,u.current===ne.utterance&&(u.current=null),ne.utterance=null,ne.playing=!1,Hr())};if(!Q.audioBase64||typeof Audio>"u")return ne.playing=gt(Q.text,st),ne.playing;const Re=new Audio(`data:${Q.mimeType||"audio/mpeg"};base64,${Q.audioBase64}`);Re.playbackRate=y?.voiceSpeed??1,Re.volume=d.current?.2:1,ne.playing=!0,c.current=Re;let Ft=!1,Ar=!1;const Dn=()=>{Ee||Ar||(Ar=!0,c.current===Re&&(c.current=null),!(!Ft&&!ne.stopped&>(Q.text,st))&&st())};return Re.onended=()=>{c.current===Re&&(c.current=null),st()},Re.onerror=Dn,Re.play().then(()=>{Ft=!0,yt()}).catch(Dn),!0},Ct=()=>{ne.stopped=!0,ne.pending.clear(),Rt(),rr()};t.stream(E,i.current,{voicePlaybackRequested:!!W.forceVoicePlayback,clientMessageId:W.clientMessageId,attachmentId:W.attachmentId,attachmentIds:W.attachmentIds,signal:ie.signal,onChunk:Q=>{Q&&!J&&(J=!0,nu("data-first-chunk",G)),W.forceVoicePlayback&&Q&&(v.current[z]=!0),w(Ee=>Ee.map(st=>st.id===z?{...st,content:st.content+Q,pending:!1,streaming:!0}:st))},onTextReady:()=>{w(Q=>Q.map(Ee=>Ee.id===z?{...Ee,pending:!1,streaming:!1}:Ee))},onReset:()=>{w(Q=>Q.map(Ee=>Ee.id===z?{...Ee,content:"",pending:!0,streaming:!1}:Ee)),ne.pending.clear(),ne.nextSeq=ne.highestSeq+1,Rt()},onAudioSegment:Q=>{!ye||ne.stopped||Q.seq<ne.nextSeq||ne.pending.has(Q.seq)||(f.current=Ct,ne.highestSeq=Math.max(ne.highestSeq,Q.seq),ne.pending.set(Q.seq,Q),Hr())}}).then(Q=>{if(r&&!Q.conversationEnded&&typeof document<"u"&&document.visibilityState==="visible"&&t.presence(i.current),Q.liveMode&&(Ce(Q.liveMode),it(Q.assignedAgentName||void 0)),Q.liveMode&&Q.liveMode!=="ai"&&!Q.answer.trim()){w(Re=>Re.filter(Ft=>Ft.id!==z)),Fe("done");return}const Ee=!!v.current[z];delete v.current[z];const st=!!(W.forceVoicePlayback&&ce&&!Q.liveAudio&&Q.audioBase64&&Q.answer.trim()&&!Ee);if(st&&(g.current[z]=Q.answer),w(Re=>Re.map(Ft=>Ft.id===z?{...Ft,content:st?"":Q.answer||Ft.content||e.strings.emptyReply,pending:!1,streaming:st,error:!1,retryText:void 0,sources:Q.sources,suggestedReplies:Q.suggestedReplies,availableActions:Q.availableActions,actions:Q.actions,selectedAction:Q.selectedAction,handoffOffered:Q.handoffOffered,requestedContactFields:Q.requestedContactFields,visualization:Q.visualization,artifacts:Q.artifacts}:Ft)),Yi("receive"),Q.liveAudio?(ne.ended=!0,Hr()):W.forceVoicePlayback&&!Q.audioBase64&&au(ce?"Talkback expected backend TTS audio, but the chat response did not include audioBase64.":"Talkback voice was requested, but the loaded widget token config does not enable provider TTS.",{voiceOutputEnabled:y?.voiceOutputEnabled,talkbackMode:y?.talkbackMode,voiceProvider:y?.voiceProvider,hasAudioBase64:!!Q.audioBase64}),W.forceVoicePlayback&&!Q.liveAudio){const Re=_1(c,u,Q.audioBase64,Q.mimeType,y?.voiceSpeed??1,Q.answer,!0,Ft=>{T(!0),Fe("speaking"),st&&we(z,Q.answer,Ft)},()=>{T(!1),Fe("done"),st&&De(z,Q.answer)});Re||Fe("done"),st&&!Re&&De(z,Q.answer)}Q.answer&&e.onMessage?.({role:"assistant",content:Q.answer}),Q.handoffOffered&&e.onHandoff?.(),Q.conversationEnded&&B(!0)}).catch(Q=>{if(ie.signal.aborted){ne.stopped||Ct(),delete v.current[z],w(st=>st.flatMap(Re=>Re.id!==z?[Re]:Re.content.trim()?[{...Re,pending:!1,streaming:!1}]:[])),Fe("done");return}Fe("failed"),delete v.current[z];const Ee=EE(Q,e.strings);F(z,{content:Ee,pending:!1,streaming:!1,error:!0,retryText:E})}).finally(()=>{nu("data-complete",G),delete v.current[z],o.current===ie&&(A(!1),o.current=null,s.current?.agentId===z&&(s.current=null))})},[t,r,e,F,y?.allowVoiceInput,y?.talkbackMode,y?.voiceOutputEnabled,y?.voiceSpeed,rt]),rn=Y((E,z={})=>{const W=E.trim(),{imageUrl:G,attachmentName:J,attachmentText:ie,attachmentId:ce,attachmentFile:ye,forceVoicePlayback:Fe,userMessageId:ne}=z,rr=z.attachments??(J||ce||ie?[{id:ce,name:J??"",text:ie,file:ye}]:[]);if(!W&&!G&&rr.length===0||o.current&&!o.current.signal.aborted||O)return;k.current=!0;let yt=W;for(const Ze of rr){const Ct=Ze.name?` "${Ze.name}"`:"";Ze.text?yt=`${yt}
|
|
31
31
|
|
|
32
|
-
[Attached file${
|
|
33
|
-
${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,imageUrl:K,attachmentName:ae},rt=on();m(Je=>[...!!(be&&Je.some(Vr=>Vr.id===be))?Je.map(Vr=>Vr.id===be?{...Vr,content:j,pending:!1,streaming:!1,imageUrl:K,attachmentName:ae}:Vr):[...Je,ht],{id:rt,role:"assistant",content:"",pending:!0}]),Mi("send"),e.onMessage?.({role:"user",content:J}),le(J,rt,{forceVoicePlayback:ke})},[y,w,e,le]),oe=Q(()=>o.current?.abort(),[]),_e=Q(()=>{cr(),s.current?.pause(),s.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),l.current=null,S(!1)},[cr]),Oe=Q(B=>{const H=G5(B);if(!H)return Promise.resolve(!1);const j=!!(h?.allowVoiceInput&&h?.voiceOutputEnabled&&h.talkbackMode!=="text"),K=(ae,se)=>new Promise(ke=>{let be=!1;n1(s,l,ae,se,h?.voiceSpeed??1,H,!0,()=>{be=!0,S(!0)},()=>{S(!1),ke(be)})||(S(!1),ke(!1))});return j?t.speak(H).then(ae=>ae.audioBase64?K(ae.audioBase64,ae.mimeType):(Ec("Talkback prompt TTS did not return provider audio.",{providerReady:ae.providerReady,message:ae.message,voiceProvider:h?.voiceProvider,voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode}),K())).catch(ae=>(Ec("Talkback prompt TTS request failed before audio playback.",{error:ae instanceof Error?ae.message:String(ae),voiceProvider:h?.voiceProvider,voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode}),K())):(Ec("Talkback prompt wanted voice, but the loaded widget token config has provider TTS disabled.",{voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode,voiceProvider:h?.voiceProvider}),K())},[h?.allowVoiceInput,h?.talkbackMode,h?.voiceOutputEnabled,h?.voiceSpeed,t]),Ue=Q((B,H)=>{y||w||!H||(Se(B,{content:"",pending:!0,streaming:!1,error:!1}),Mi("send"),le(H,B))},[y,w,Se,le]),br=Q((B,H,j)=>{Se(B,{feedback:H});const K=p.findIndex(ke=>ke.id===B),ae=K>=0?p[K]?.content:void 0;let se;for(let ke=K-1;ke>=0;ke--)if(p[ke]?.role==="user"){se=p[ke]?.content;break}t.sendFeedback({sessionId:i.current,messageId:B,rating:H,comment:j,question:se,answer:ae}).catch(()=>{})},[t,Se,p]),Ai=Q(async(B,H,j={},K)=>{e.onAction?.(B);const ae=await t.action(B,{sessionId:i.current,...H},K),se={};return j.name?.trim()&&(se.name=j.name.trim()),j.email?.trim()&&(se.email=j.email.trim()),j.phone?.trim()&&(se.phone=j.phone.trim()),Object.keys(se).length>0&&(C(ke=>{const be={...ke,...se};return re(be),be}),se.email&&B!=="contact"&&t.action("contact",{sessionId:i.current,...se}).catch(()=>{})),Mi("receive"),ae},[t,e,re]),ln=Q(B=>{const H=B.trim();H&&m(j=>j.some(K=>K.role==="assistant"&&K.content===H)?j:[...j,{id:on(),role:"assistant",content:H}])},[]),Di=Q(B=>{v.current=!0;const H=on();return m(j=>[...j,{id:H,role:"user",content:B.trim(),pending:!0}]),H},[]),zc=Q((B,H)=>{m(j=>j.map(K=>K.id===B?{...K,...H}:K))},[]),gp=Q(B=>{m(H=>H.filter(j=>j.id!==B))},[]),Ma=Q((B,H)=>{t.sendFeedback({sessionId:i.current,messageId:"__csat__",rating:B,comment:H}).catch(()=>{})},[t]),ts=Q(async(B,H,j,K)=>{const ae=sp();try{if(typeof B!="string"&&t.transcribeAudio)return await t.transcribeAudio(B,H,j,K);const se=typeof B=="string"?B:await bR(B);return await t.transcribe(se,H,j,K)}finally{lp("voice-transcription",ae)}},[t]),mp=Q((B,H,j)=>t.extract(B,H,j),[t]),En=Q(B=>t.searchGifs(B),[t]),Fc=Q((B,H)=>t.demoSlots(B,H),[t]),Ii=Q(B=>G("",{imageUrl:B}),[G]),rs=e.demo||!!e.gifApiKey,st=Q(()=>{o.current?.abort(),k(!0),t.endConversation(i.current).catch(()=>{})},[t]),vt=Q(()=>{o.current?.abort();const B=Qo(e);i.current=B;try{n?.setItem(Jo(a),B)}catch{}L(null),N([]),k(!1),q("ai"),z(void 0),X(void 0),te.current=new Date().toISOString(),m(h?[{id:on(),role:"assistant",content:h.greeting,availableActions:h.availableActions,actions:h.actions}]:[])},[n,a,h]),yt=Q(B=>{if(Ie){if(B===i.current){L(null);return}N(o1(n,a,B)),L(B)}},[n,a,Ie]),Hr=Q(()=>{L(null),N([])},[]),Aa=e.starters.length>0?e.starters:h?.starterQuestions??[],xr=h?.featuredLinks??[];return{persona:h,messages:p,sending:y,assistantSpeaking:x,visitor:T,starters:Aa,featuredLinks:xr,hasEmail:!!T.email,liveMode:O,assignedAgentName:R,agentTypingName:F,send:G,sendGif:Ii,notifyTyping:Y,stop:oe,retry:Ue,rateMessage:br,injectAssistant:ln,appendUserDraft:Di,patchMessage:zc,removeMessage:gp,submitCsat:Ma,submitForm:Ai,transcribe:ts,extract:mp,searchGifs:En,demoSlots:Fc,gifEnabled:rs,identify:he,ended:w,endConversation:st,startNew:vt,history:Ie?A:[],viewingSessionId:I,viewMessages:P,openConversation:yt,closeHistoryView:Hr,shutdown:Me,stopSpeaking:_e,speakAssistantText:Oe}},aE=({name:t,greeting:e})=>{const r=_r();return _("section",{class:"cf-empty-welcome","aria-label":qt(r.welcomeLabel,{name:t}),children:[_("span",{class:"cf-empty-welcome__eyebrow",children:r.welcomeEyebrow}),_("h2",{children:t}),_("p",{children:e||r.welcomePrompt})]})},hp=(t,e,r)=>{if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),r();return}if(t.key!=="Tab")return;const n=Array.from(e.querySelectorAll('button, [href], textarea, input, select, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.getAttribute("aria-hidden")!=="true"&&c.tabIndex>=0);if(n.length===0)return;const a=e.getRootNode(),i=t.composedPath()[0],o=i instanceof HTMLElement?i:"activeElement"in a?a.activeElement:document.activeElement,s=n[0],l=n[n.length-1];t.shiftKey&&(o===s||!e.contains(o))?(t.preventDefault(),t.stopPropagation(),l.focus()):!t.shiftKey&&(o===l||!e.contains(o))&&(t.preventDefault(),t.stopPropagation(),s.focus())},Bc=new Map,c1=t=>{if(!t||typeof document>"u"||typeof CanvasRenderingContext2D>"u")return;const e=document.createElement("canvas").getContext("2d");if(!e)return;e.fillStyle="#010203",e.fillStyle=t;const r=e.fillStyle;if(r==="#010203"&&t.trim().toLowerCase()!=="#010203")return;const n=r.match(/^#([\da-f]{6})$/i)?.[1];if(n)return[Number.parseInt(n.slice(0,2),16),Number.parseInt(n.slice(2,4),16),Number.parseInt(n.slice(4,6),16),1];const a=r.match(/^rgba?\(([\d.]+)[, ]+([\d.]+)[, ]+([\d.]+)(?:[, /]+([\d.]+))?\)$/i);if(!a)return;const i=a.slice(1,5).map(Number);if(!i.some(o=>!Number.isFinite(o)))return[i[0],i[1],i[2],i[3]??1]},iE=(t,e="#ffffff")=>{const r=`${t??""}|${e}`;if(Bc.has(r))return Bc.get(r);const n=c1(t),a=c1(e)??[255,255,255,1];if(!n){Bc.set(r,void 0);return}const i=n[3],s=n.slice(0,3).map((h,d)=>h*i+a[d]*(1-i)).map(h=>{const d=h/255;return d<=.04045?d/12.92:((d+.055)/1.055)**2.4}),l=s[0]*.2126+s[1]*.7152+s[2]*.0722,c=1.05/(l+.05),u=(l+.05)/.059,f=c>=u?"#ffffff":"#0f1e2a";return Bc.set(r,f),f},oE=t=>{const[e,r]=V("light");return ie(()=>{if(t!=="auto"||typeof matchMedia>"u")return;const n=matchMedia("(prefers-color-scheme: dark)"),a=()=>r(n.matches?"dark":"light");return a(),n.addEventListener("change",a),()=>n.removeEventListener("change",a)},[t]),t==="auto"?e:t},u1=1e4,sE=1400,f1=550,lE=350,cE=.001,h1=6e4,d1=90,uE=280,fE=250,p1=250,hE=t=>t.replace(/\[[^\]]{0,60}\]/g," ").replace(/\(([^)]{0,60})\)/g,(e,r)=>v1.has(r.trim().toLowerCase().replace(/[.!?,…]+$/,"").replace(/\s+/g," "))?" ":e).replace(/\*[^*]{0,60}\*/g," ").replace(/\s+/g," ").trim(),v1=new Set(["background noise","engine noise","noise","inaudible","unintelligible","silence","no speech","static","music","laughter","applause","wind","breathing","click","clicks","clicking","mouse click","mouse clicks","beep","beeps","beeping","tap","taps","tapping","typing","keyboard typing","cough","coughing","sigh","hmm","mm","mmm","uh","um","ah","oh"]),dE=t=>{const e=t.trim().toLowerCase().replace(/[()[\]*]/g," ").replace(/[.!?,…]+$/,"").replace(/\s+/g," ").trim();return!e||/^(?:sh+\s*)+$/.test(e)?!0:v1.has(e)},pE=t=>{const e=t.trim().toLowerCase().replace(/\s+/g," ");return e?e.includes("transcribe this audio recording verbatim")||e.includes("preserve the spoken language and any code-switching")||e.includes("output only the transcribed text, no commentary"):!1},g1={end:"end the call",mute:"mute your microphone",minimize:"minimize the chat",expand:"expand the view",shrink:"exit the expanded view"},dp=t=>t.trim().toLowerCase().replace(/[^\p{L}\p{N}\s']/gu," ").replace(/\s+/g," ").trim(),vE=[{action:"shrink",re:/\b(?:exit|leave|quit|close)\b[\s\w]*\b(?:full ?screen|expanded|theat(?:er|re))\b|\bshrink\b|\bsmaller view\b/},{action:"end",re:/\b(?:end|close|stop|finish|hang ?up|quit|exit)\b[\s\w]*\b(?:call|chat|conversation|convo|session|talking)\b|\bhang ?up\b|\bgood ?bye\b|^bye(?: bye)?$/},{action:"mute",re:/\bmute\b|\bstop listening\b/},{action:"minimize",re:/\bminimi[sz]e\b|\bhide\b[\s\w]*\b(?:chat|call|window|widget)\b/},{action:"expand",re:/\bexpand\b|\bmaximi[sz]e\b|\bfull ?screen\b|\btheat(?:er|re) mode\b|\bbigger view\b/}],gE=/^(?:yes|yeah|yep|yup|sure|correct|confirm|affirmative|go ahead|do it|please do|ok(?:ay)?)\b/,mE=/^(?:no|nope|nah|cancel|never ?mind|don'?t|stop)\b/,yE=/^(?:end|close|stop|finish|hang ?up|quit|exit|bye|good ?bye)\b/,_E=t=>{const e=dp(t);if(!e)return null;for(const{action:r,re:n}of vE)if(n.test(e)){const a=e.split(" ").length;return{action:r,confident:r==="end"?a<=10:a<=6}}return null},pp=t=>`I didn't catch yes or no. Say yes to ${g1[t]}, or no to keep talking.`,m1=t=>`I caught some audio, but not enough clear words. Try again a little closer to the mic, or type your question for ${t?.agentName?.trim()||"the assistant"}.`,bE=t=>{const e=dp(t).replace(/\b(?:um|uh|erm|hmm)\b/g,"").trim();return!e||e.split(/\s+/).length<=2&&/^(?:can|could|would|will|do|does|is|are|what|why|how|where|when)\b/.test(e)?!0:/\b(?:can you|could you|would you|will you|do you|can i|could i|would i|i want to|i need to|tell me about|what about|how about|about|with|to|for|please)$/i.test(e)},y1=(t,e)=>{const r=window.AudioContext??window.webkitAudioContext;if(!r)return null;let n,a=!1;const i=new r;try{const o=i.createMediaStreamSource(t),s=i.createAnalyser();s.fftSize=512,o.connect(s);const l=new Uint8Array(s.frequencyBinCount),c=()=>{if(a)return;s.getByteTimeDomainData(l);let u=0;for(const f of l){const h=(f-128)/128;u+=h*h}e(Math.sqrt(u/l.length),performance.now()),a||(n=requestAnimationFrame(c))};c()}catch{return i.close().catch(()=>{}),null}return{stop:()=>{a||(a=!0,n!==void 0&&cancelAnimationFrame(n),n=void 0,i.close().catch(()=>{}))}}},_1=t=>Fx(t),xE=({transport:t,config:e,bindControls:r,composerDraftStore:n})=>{const a=e.strings,[i,o]=V(e.openByDefault),{persona:s,messages:l,sending:c,assistantSpeaking:u,visitor:f,hasEmail:h,liveMode:d,assignedAgentName:p,agentTypingName:m,starters:g,featuredLinks:v,send:y,sendGif:b,notifyTyping:x,stop:S,retry:w,rateMessage:k,injectAssistant:T,appendUserDraft:C,patchMessage:A,removeMessage:M,submitCsat:I,submitForm:L,transcribe:P,extract:N,searchGifs:O,demoSlots:q,gifEnabled:R,identify:z,ended:F,endConversation:X,startNew:te,history:fe,viewingSessionId:me,viewMessages:we,openConversation:Ze,closeHistoryView:Ie,shutdown:tt,stopSpeaking:Ge,speakAssistantText:Me}=nE(t,e,i),[re,he]=V(0),[Be,pe]=V("idle"),[Se,ct]=V(!1),[pt,sn]=V(!1),[cr,Y]=V(0),[le,G]=V(!1),[oe,_e]=V(null),[Oe,Ue]=V([]),[br,Ai]=V(""),[ln,Di]=V(()=>{try{return localStorage.getItem("centrinfo:muted")==="1"}catch{return!1}}),zc=oE(e.theme),gp=l.some(E=>E.role==="assistant"&&(E.pending||E.streaming)),Ma=c||gp||u,ts=s?.soundEnabled??!0;ie(()=>{N5(e.sound&&ts&&!ln)},[e.sound,ts,ln]);const mp=Q(()=>{Di(E=>{const $=!E;try{localStorage.setItem("centrinfo:muted",$?"1":"0")}catch{}return $})},[]),En=W(null),Fc=W(null),Ii=W(null),rs=W(0),st=W(!1),vt=W(!1),yt=W(!1),Hr=W(0),Aa=W(!1),xr=W(null),B=W(null),H=W([]),j=W(void 0),K=W(void 0),ae=W(null),se=W(0),ke=W(0),be=W(!1),J=W(0),ht=W(null),rt=W(null),Je=W(0),ut=W(null),ns=W([]),Vr=W(0),cn=W(0),Hc=W(0),Da=W(null),Li=W(!1),Ia=W(null),Gr=W(""),yp=W(()=>{}),_p=W(""),On=W(c),k1=W(u),T1=W(Ma),C1=W(Be),bp=W(0);ie(()=>{On.current=c},[c]),ie(()=>{k1.current=u},[u]),ie(()=>{T1.current=Ma},[Ma]),ie(()=>{C1.current=Be},[Be]);const[M1,as]=V(!0),[RE,Pi]=V(!1),xp=W(0),[un,Ri]=V(!1),[La,Pa]=V(!1),A1=W(null),[Nn,Ra]=V(!1),EE=W({value:""}),OE=n??EE.current,D1=W({confirmEnd:un,confirmClear:La,showHistory:Nn});D1.current={confirmEnd:un,confirmClear:La,showHistory:Nn};const[NE,I1]=V(!1),qe=!!me,wp=qe?we:l,is=wp.find(E=>E.id===oe&&E.visualization)?.visualization;ie(()=>{!oe||is||(_e(null),G(!1))},[is,oe]);const Ei=Q(()=>{o(!0),he(0),Mi("open"),e.onOpen?.(),e.onShow?.()},[e]),$r=Q(()=>{o(!1),G(!1),_e(null),e.onClose?.(),e.onHide?.(),Fc.current?.focus()},[e]),os=Q(()=>i?$r():Ei(),[i,Ei,$r]),BE=Q(()=>Ri(!0),[]),zE=Q(()=>{X(),Ri(!1)},[X]),FE=Q(()=>{te(),Pi(!1),as(!0)},[te]);ie(()=>{un&&A1.current?.focus()},[un]),ie(()=>{r({open:Ei,close:$r,toggle:os,identify:z,startNew:te,endConversation:X,shutdown:tt})},[r,Ei,$r,os,z,te,X,tt]),ie(()=>{const E=l.filter($=>$.role==="assistant"&&!$.pending).length;if(i){rs.current=E;return}E>rs.current&&he(E-rs.current)},[l,i]),ie(()=>{e.onUnreadChange?.(re)},[re,e]),ie(()=>{const E=e.sessionDurationMinutes;if(!E||E<=0)return;const $=setTimeout(()=>tt(),E*60*1e3);return()=>clearTimeout($)},[e.sessionDurationMinutes,l,i,tt]),ie(()=>{const E=e.customLauncherSelector;if(!E||typeof document>"u")return;let $=[];try{$=Array.from(document.querySelectorAll(E))}catch{return}const xe=Pe=>{Pe.preventDefault(),os()};return $.forEach(Pe=>Pe.addEventListener("click",xe)),()=>$.forEach(Pe=>Pe.removeEventListener("click",xe))},[e.customLauncherSelector,os]);const L1=W(!1);ie(()=>{const E=e.proactiveMessage?.trim();if(!E||L1.current)return;const $=e.proactiveOnPaths??[],xe=typeof location<"u"?location.pathname:"";if($.length>0&&!$.some(Re=>xe.includes(Re)))return;const Pe=`centrinfo:proactive:${e.token.slice(0,12)}`;try{if(sessionStorage.getItem(Pe)==="1")return}catch{}const ve=setTimeout(()=>{if(!(i||F||l.some(Re=>Re.role==="user"))){L1.current=!0;try{sessionStorage.setItem(Pe,"1")}catch{}T(E),Ei()}},Math.max(0,e.proactiveDelaySeconds)*1e3);return()=>clearTimeout(ve)},[e.proactiveMessage]),ie(()=>{const E=Ii.current;if(!i||!E)return;const $=l[l.length-1],xe=Date.now()<xp.current;$?.role==="user"||M1||xe?(requestAnimationFrame(()=>{E.scrollTop=E.scrollHeight}),Pi(!1),xe&&as(!0)):Pi(!0)},[l,i,c,M1]);const HE=Q(()=>{const E=Ii.current;if(!E)return;if(st.current&&!qe){as(!0),Pi(!1);return}const $=E.scrollHeight-E.scrollTop-E.clientHeight<80;as($),$&&Pi(!1)},[qe]),Bn=Q(()=>{const E=Ii.current;E&&(E.scrollTop=E.scrollHeight),Pi(!1),as(!0)},[]),Vc=Q(()=>{xp.current=Date.now()+3e3,requestAnimationFrame(Bn)},[Bn]);ie(()=>{if(!i||qe||!Se||Be==="connecting")return;xp.current=Date.now()+6e4,Bn();const E=requestAnimationFrame(()=>{Bn(),requestAnimationFrame(Bn)}),$=[80,180,360].map(xe=>window.setTimeout(Bn,xe));return()=>{cancelAnimationFrame(E),$.forEach(xe=>window.clearTimeout(xe))}},[u,l,i,Bn,c,Se,qe,Be]);const P1=Q(()=>{En.current?.querySelector(".cf-textarea")?.focus()},[]),R1=Q(()=>{j.current&&window.clearTimeout(j.current),j.current=void 0,K.current&&window.clearTimeout(K.current),K.current=void 0,ae.current?.stop(),ae.current=null,Y(0)},[]),wr=Q(()=>{rt.current?.stop(),rt.current=null,Fr(ut.current),ht.current?.getTracks().forEach(E=>E.stop()),ht.current=null,Je.current=0,cn.current=0},[]),Oi=Q(()=>{R1(),B.current?.getTracks().forEach(E=>E.stop()),B.current=null},[R1]),Ht=Q(()=>{st.current=!1,yt.current=!1,vt.current=!1,Aa.current=!1,Da.current=null,Li.current=!1,Ia.current=null,Gr.current="",ct(!1),sn(!1),G(!1),_e(null),wr(),Ge();const E=xr.current;E?.state==="recording"?Fr(E):(Oi(),pe("idle"))},[wr,Ge,Oi]),VE=Q(()=>{le&&_e(null),G(!le)},[le]),GE=Q(E=>{_e(E),G(!0)},[]),$E=Q(()=>{const E=oe;_e(null),G(!1),window.requestAnimationFrame(()=>{Array.from(En.current?.querySelectorAll("[data-visualization-message]")??[]).find(xe=>xe.dataset.visualizationMessage===E)?.focus()})},[oe]),WE=Q(()=>{_e(null),G(!1)},[]),E1=Q((E,$)=>{if(Date.now()-Hr.current>=h1){pe("timeout"),K.current=window.setTimeout(()=>Ht(),2400);return}pe(E),K.current=window.setTimeout(()=>{st.current&&!vt.current&&!k1.current&&$()},sE)},[Ht]),Gc=Q((E,$,xe)=>{Date.now()-Hr.current<h1&&!vt.current&&(yt.current=!0,Me($)),E1(E,xe)},[E1,Me]),O1=Q((E,$)=>{Vc(),Hr.current=Date.now(),yt.current=!0,$&&A($,{content:E,pending:!0,streaming:!1});const xe=()=>{if(st.current){if(On.current){window.setTimeout(xe,80);return}$&&Ia.current===$&&(Ia.current=null),y(E,{forceVoicePlayback:!0,userMessageId:$})}};xe()},[Vc,A,y]),$c=Q(async(E,$,xe,Pe="normal",ve)=>{let Re=null;const kt=Sr=>Re||(Vc(),Re=Ia.current||C(Sr),Ia.current=Re,A(Re,{content:Gr.current||Sr,pending:!0,streaming:!1}),Re),Tt=()=>{Re&&(Ia.current===Re&&(Ia.current=null),Gr.current="",M(Re),Re=null)},zn=()=>{Gr.current="",pe("listening"),window.setTimeout(()=>{st.current&&!vt.current&&!On.current&&!xr.current&&xe()},120)},qc=E.size===0,Ea=E.size<lE&&$<cE;if(qc||Ea){if(Pe==="barge"){zn();return}const Sr=Da.current;Gc("noise",Sr?pp(Sr):m1(s),xe),Gr.current="";return}pe("processing");const nO=++bp.current,Tp=kt("Listening...");try{const Sr=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0;A(Tp,{content:Gr.current?`${Gr.current} ...`:"Transcribing...",pending:!0});const Cp=hE(await P(E,E.type,Sr,ve));if(nO!==bp.current){Tt();return}const fn=[Gr.current,Cp].map(kr=>kr.trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim();if(!fn||dE(fn)||pE(fn)){if(Tt(),Pe==="barge"){zn();return}const kr=Da.current;Gc("misunderstood",kr?pp(kr):m1(s),xe);return}const Xc=Da.current;if(Xc){const kr=dp(fn);if(gE.test(kr)||Xc==="end"&&yE.test(kr)){Tt(),Da.current=null,yp.current(Xc);return}if(mE.test(kr)){Tt(),Da.current=null;const $1="Okay, never mind — what would you like to know?";T($1),yt.current=!0,pe("speaking"),Me($1);return}Tt();const G1=pp(Xc);T(G1),yt.current=!0,pe("speaking"),Me(G1);return}const cs=_E(fn);if(cs){if(Tt(),Hr.current=Date.now(),cs.confident){yp.current(cs.action);return}Da.current=cs.action;const kr=`Just to confirm — you want me to ${g1[cs.action]}? Please say yes or no.`;T(kr),yt.current=!0,pe("speaking"),Me(kr);return}if(A(Tp,{content:fn,pending:!0}),bE(fn)){Gr.current=fn,pe("listening"),xe();return}Gr.current="",O1(fn,Tp)}catch(Sr){if(Tt(),Pe==="barge"){zn();return}const Cp=Sr instanceof Error&&Sr.message.trim()?` (${Sr.message.trim()})`:"";Gc("misunderstood",`I couldn't convert your speech to text. Please check the speech service configuration or type your question.${Cp}`,xe)}},[C,Vc,Gc,T,A,s,M,O1,Me,P]),Xt=Q(async()=>{if(!(!st.current||vt.current)&&!(!s?.allowVoiceInput||F||qe)&&!On.current&&!xr.current){wr(),yt.current=!1;try{pe("connecting");const E=await navigator.mediaDevices.getUserMedia({audio:_1(_p.current)});if(!st.current||vt.current){E.getTracks().forEach(ve=>ve.stop());return}navigator.mediaDevices.enumerateDevices().then(ve=>{Ue(ve.filter(Re=>Re.kind==="audioinput").map((Re,kt)=>({deviceId:Re.deviceId,label:Re.label||`Microphone ${kt+1}`})))}).catch(()=>{});const $=ep(E);xr.current=$,B.current=E,H.current=[],se.current=0,be.current=!1,J.current=0;const xe=performance.now(),Pe=Hx();ae.current=y1(E,(ve,Re)=>{const kt=Pe.observe(ve);if(se.current=Math.max(se.current,ve),kt.speech)be.current=!0,J.current=0;else if(be.current&&kt.quiet){J.current||(J.current=Re);const Tt=Re-J.current,zn=Re-xe;if(Tt>=kt.endOfSpeechDelayMs&&zn>=f1&&$.state==="recording"){Fr($);return}}else J.current=0;Re-ke.current>d1&&(ke.current=Re,Y(ve))}),$.ondataavailable=ve=>{ve.data.size>0&&H.current.push(ve.data)},$.onstop=async()=>{if(Oi(),xr.current=null,Aa.current){Aa.current=!1,st.current&&!vt.current?(pe("idle"),Xt()):pe(st.current&&vt.current?"muted":"idle");return}if(!st.current){pe("idle");return}const ve=new Blob(H.current,{type:$.mimeType||"audio/webm"});await $c(ve,se.current,Xt,"normal",Math.max(0,(performance.now()-xe)/1e3))},$.start(p1),pe("listening"),j.current=window.setTimeout(()=>{Fr(xr.current)},u1)}catch{pe("denied"),K.current=window.setTimeout(()=>Ht(),3500)}}},[F,Ht,$c,s,s?.allowVoiceInput,wr,Oi,qe]),UE=Q(()=>{if(st.current){Ht();return}P1(),!(!s?.allowVoiceInput||On.current||F||qe)&&(Hr.current=Date.now(),yt.current=!1,vt.current=!1,st.current=!0,sn(!1),ct(!0),pe("connecting"),Xt())},[F,Ht,P1,s,s?.allowVoiceInput,Xt,qe]),Wc=Q(()=>{sn(E=>{const $=!E;if(vt.current=$,$){const xe=xr.current;xe?.state==="recording"?(Aa.current=!0,Fr(xe)):(Oi(),pe("muted"))}else st.current&&!F&&!qe&&(pe("idle"),Xt());return $})},[F,Xt,Oi,qe]),ss=Q((E,$)=>{T(E),$&&(yt.current=!0),pe("speaking"),Me(E)},[T,Me]),N1=Q(E=>{switch(Hr.current=Date.now(),E){case"end":yt.current=!1,Li.current=!0,ss("Okay — ending our call now. Goodbye!",!1),window.setTimeout(()=>{Li.current&&(Li.current=!1,Ht())},2e3);break;case"mute":{vt.current||Wc();const $="Muted. Tap the mic button when you want me to listen again.";T($),Me($);break}case"minimize":$r(),ss("Minimized — I'm still listening. Tap the call pill to bring the chat back.",!0);break;case"expand":G(!0),ss("Sure — expanding the view.",!0);break;case"shrink":_e(null),G(!1),ss("Okay — back to the smaller view.",!0);break}},[$r,Ht,T,Me,ss,Wc]);ie(()=>{yp.current=N1},[N1]);const B1=W(!1);ie(()=>{B1.current&&!u&&Li.current&&(Li.current=!1,Ht()),B1.current=u},[u,Ht]);const YE=Q(E=>{_p.current=E,Ai(E);const $=xr.current;$?.state==="recording"&&(Aa.current=!0,Fr($))},[]),qE=Q(()=>{if(!(!st.current||vt.current)){if(wr(),S(),Ge(),Hr.current=Date.now(),pe("listening"),On.current){const E=()=>{if(!(!st.current||vt.current)){if(On.current){window.setTimeout(E,70);return}yt.current=!1,Xt()}};window.setTimeout(E,70);return}yt.current=!1,Xt()}},[Xt,S,wr,Ge]),z1=Q(async()=>{if(!(ht.current||rt.current)&&!(!st.current||vt.current))try{const E=await navigator.mediaDevices.getUserMedia({audio:_1(_p.current)});if(!st.current||vt.current||xr.current||ht.current||!T1.current&&C1.current!=="processing"){E.getTracks().forEach(Pe=>Pe.stop());return}ht.current=E,Je.current=0,cn.current=0,Hc.current=0;const $=()=>{if(ut.current)return;S(),Ge(),bp.current+=1,Hr.current=Date.now(),yt.current=!1,pe("listening");const Pe=ep(E);ut.current=Pe,ns.current=[],Vr.current=performance.now(),cn.current=0,Pe.ondataavailable=ve=>{ve.data.size>0&&ns.current.push(ve.data)},Pe.onstop=async()=>{const ve=ns.current,Re=Hc.current,kt=Pe.mimeType||"audio/webm";if(ut.current=null,ns.current=[],wr(),!st.current)return;const Tt=new Blob(ve,{type:kt});await $c(Tt,Re,Xt,"barge",Math.max(0,(performance.now()-Vr.current)/1e3))},Pe.start(p1)},xe=Hx({speechToNoiseRatio:3.2});rt.current=y1(E,(Pe,ve)=>{const Re=xe.observe(Pe);if(Hc.current=Math.max(Hc.current,Pe),ve-ke.current>d1&&(ke.current=ve,Y(Pe)),Re.speech)Je.current||(Je.current=ve),ve-Je.current>=uE&&$(),cn.current=0;else if(ut.current&&Re.quiet){cn.current||(cn.current=ve);const kt=ve-cn.current,Tt=ve-Vr.current;kt>=Re.endOfSpeechDelayMs&&Tt>=f1&&ut.current.state==="recording"&&Fr(ut.current)}else ut.current&&ve-Vr.current>=u1&&ut.current.state==="recording"?Fr(ut.current):(Je.current=0,cn.current=0)}),rt.current||wr()}catch{}},[$c,Xt,S,wr,Ge]);ie(()=>{if(!(Se&&!pt&&!F&&!qe&&(Ma||Be==="processing"))){wr();return}const $=window.setTimeout(()=>{z1()},fE);return()=>window.clearTimeout($)},[Ma,F,z1,wr,Se,pt,Be,qe]);const XE=Se&&!pt&&(c||u||Be==="processing");ie(()=>{!Se||pt||u&&pe("speaking")},[u,Se,pt]),ie(()=>{if(!Se||pt||!yt.current||c||u||!["processing","speaking","noise","misunderstood"].includes(Be))return;const E=window.setTimeout(()=>{!st.current||vt.current||On.current||(yt.current=!1,Xt())},700);return()=>window.clearTimeout(E)},[u,c,Xt,Se,pt,Be]),ie(()=>()=>Ht(),[Ht]);const[ZE,KE]=V(""),F1=W(!1);ie(()=>{if(F1.current&&!c){const E=[...l].reverse().find($=>$.role==="assistant"&&!$.streaming&&!$.pending&&$.content);E&&KE(E.content)}F1.current=c},[c,l]),rv(()=>{if(!i)return;const E=En.current,$=un||La?E?.querySelector(".cf-confirm__card"):Nn?E?.querySelector(".cf-history"):null;if(!$)return;const xe=$.getRootNode(),Pe="activeElement"in xe?xe.activeElement:document.activeElement;(!Pe||!$.contains(Pe))&&$.querySelector('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])')?.focus()},[La,un,i,Nn]),ie(()=>{if(!i)return;const E=En.current,$=un||La?E?.querySelector(".cf-confirm__card"):Nn?E?.querySelector(".cf-history"):null,xe=E?.querySelectorAll(":scope > .cf-header, :scope > .cf-panel__video, :scope > .cf-panel__chat");xe?.forEach(ve=>{$?(ve.setAttribute("inert",""),ve.setAttribute("aria-hidden","true")):(ve.removeAttribute("inert"),ve.removeAttribute("aria-hidden"))}),$||requestAnimationFrame(()=>E?.querySelector(".cf-textarea")?.focus());const Pe=ve=>{if(ve.key==="Escape"){ve.preventDefault();const Ea=D1.current;if(Ea.confirmEnd){Ri(!1);return}if(Ea.confirmClear){Pa(!1);return}if(Ea.showHistory){Ra(!1);return}$r();return}if(ve.key!=="Tab"||!$)return;const Re=$.querySelectorAll('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])'),kt=Array.from(Re).filter(Ea=>!Ea.hasAttribute("disabled"));if(kt.length===0)return;const Tt=kt[0],zn=kt[kt.length-1],qc=$.getRootNode()instanceof ShadowRoot?$.getRootNode().activeElement:document.activeElement;ve.shiftKey&&qc===Tt?(ve.preventDefault(),zn.focus()):!ve.shiftKey&&qc===zn&&(ve.preventDefault(),Tt.focus())};return E?.addEventListener("keydown",Pe),()=>{E?.removeEventListener("keydown",Pe),xe?.forEach(ve=>{ve.removeAttribute("inert"),ve.removeAttribute("aria-hidden")})}},[i,$r,un,La,Nn]),ie(()=>{const E=En.current;E&&(i?E.removeAttribute("inert"):E.setAttribute("inert",""))},[i]);const Uc=e.accentColor??e.themeTokens?.accent??s?.accentColor,H1=e.themeTokens?.accentText??iE(Uc,e.themeTokens?.background??(zc==="dark"?"#0f1c27":"#ffffff")),jE={zIndex:e.zIndex,"--cf-h-pad":`${e.horizontalPadding}px`,"--cf-v-pad":`${e.verticalPadding}px`,...H1?{"--cf-accent-ink":H1}:{},...e.themeTokens?.accentStrong?{"--cf-accent-2":e.themeTokens.accentStrong}:{},...e.themeTokens?.background?{"--cf-bg":e.themeTokens.background}:{},...e.themeTokens?.surface?{"--cf-surface":e.themeTokens.surface}:{},...e.themeTokens?.surfaceMuted?{"--cf-surface-2":e.themeTokens.surfaceMuted}:{},...e.themeTokens?.text?{"--cf-text":e.themeTokens.text}:{},...e.themeTokens?.mutedText?{"--cf-muted":e.themeTokens.mutedText}:{},...e.themeTokens?.border?{"--cf-border":e.themeTokens.border}:{},...e.themeTokens?.shadow?{"--cf-shadow":e.themeTokens.shadow}:{},...e.themeTokens?.radius?{"--cf-radius":e.themeTokens.radius}:{},...e.themeTokens?.fontFamily?{"--cf-font":e.themeTokens.fontFamily}:{},...e.themeTokens?.success?{"--cf-success":e.themeTokens.success}:{},...e.themeTokens?.warning?{"--cf-warning":e.themeTokens.warning}:{},...e.themeTokens?.danger?{"--cf-danger":e.themeTokens.danger}:{},...Uc?{"--cf-accent":Uc,"--cf-accent-2":e.themeTokens?.accentStrong??`color-mix(in oklab, ${Uc} 76%, #14141f)`}:{}},QE=E=>y(E),JE=[...l].reverse().find(E=>E.role==="user"&&E.content.trim())?.content??"",Yc=l.some(E=>E.role==="user"),V1=s?.talkbackMode==="avatar"||s?.widgetModule==="assistant"||!!s?.allowVoiceInput,ls=!qe&&V1&&!Yc?wp.filter((E,$)=>!($===0&&E.role==="assistant")):wp,eO=d==="human"&&p?p:s?.agentName??a.chatName,tO=d==="human"?a.liveSupport:d==="queued"?a.waitingForTeam:s?.offline?a.statusOffline:a.statusOnline,Sp=!F&&!qe?s?.availableActions:void 0,rO=!F&&!qe?s?.actions:void 0,kp=Se&&Be==="connecting"&&!qe;return _(SR,{value:a,children:_("div",{class:"cf-root","data-theme":zc,"data-align":e.alignment,"data-display":"floating",style:jE,children:[le&&i&&_("div",{class:"cf-theater-backdrop",onClick:WE}),_("div",{ref:En,class:`cf-panel ${i?"is-open":""} ${Se?"cf-panel--call":""} ${kp?"cf-panel--voice-connecting":""} ${le&&i?"cf-panel--theater":""} ${is?"cf-panel--analytics-focus":""}`,role:"dialog","aria-modal":"false","aria-label":`${a.chatName}: ${s?.agentName??a.assistantName}`,"aria-hidden":!i,children:[_("div",{class:"cf-header",children:[_(qx,{persona:s,hideWhenMissing:!0}),_("div",{class:"cf-header__meta",children:[_("div",{class:"cf-header__name",children:eO}),_("div",{class:`cf-header__status ${d==="ai"&&s?.offline?"cf-header__status--offline":""}`,children:_("span",{class:"cf-header__status-text",children:tO})})]}),_("div",{class:"cf-header__actions",children:[fe.length>0&&_("button",{type:"button",class:"cf-header__btn","aria-label":a.pastConversations,title:a.pastConversations,"aria-pressed":Nn,onClick:()=>Ra(E=>!E),children:_(OR,{})}),Yc&&!F&&!qe&&_("button",{type:"button",class:"cf-header__btn","aria-label":a.endChat,title:a.endChat,onClick:BE,children:_(ap,{})}),e.sound&&ts&&_("button",{type:"button",class:"cf-header__btn","aria-label":ln?a.unmuteSounds:a.muteSounds,"aria-pressed":ln,onClick:mp,children:ln?_(LR,{}):_(IR,{})}),_("button",{type:"button",class:"cf-header__btn cf-header__close","aria-label":a.closeChat,onClick:$r,children:_(Ti,{})})]})]}),_("div",{class:"cf-panel__video",children:is?_("div",{class:"cf-analytics-focus",role:"region","aria-label":a.expandedAnalyticsResult,children:_(Qx,{visualization:is,expanded:!0,onClose:$E})}):!qe&&V1?_(n5,{persona:s,starters:[],onPick:y,onFocusComposer:UE,speaking:u,voiceState:Be,replyPending:Se&&c&&!u,pinned:!0,muted:pt,onToggleMute:Wc,onEndCall:Ht,onTalkNow:qE,showTalkNow:XE,micLevel:cr,theaterMode:le,onToggleTheater:VE,onMinimize:$r,audioDevices:Oe,selectedAudioDeviceId:br,onSelectAudioDevice:YE,connectingOnly:kp}):null}),!kp&&_("div",{class:"cf-panel__chat",children:[e.preview&&_("div",{class:"cf-preview-banner",children:a.previewBanner}),qe&&_("div",{class:"cf-viewing-banner",children:a.viewingPast}),_("div",{class:"cf-body",ref:Ii,role:"log",onScroll:HE,children:[ls.map((E,$)=>_(w5,{msg:E,persona:s,isLast:!qe&&$===ls.length-1,visitor:f,hasEmail:h,lastQuestion:JE,showActions:!qe&&$===ls.length-1&&!!E.handoffOffered,onPickReply:QE,onSubmitForm:L,onDemoSlots:q,onRetry:w,ratable:!qe&&ls.slice(0,$).some(xe=>xe.role==="user"),onRate:k,onExpandVisualization:qe?void 0:GE},E.id)),!Yc&&!qe&&_(Ae,{children:[ls.length===0&&_(aE,{name:s?.agentName??a.assistantName,greeting:s?.greeting}),_(_5,{items:g,onPick:y}),_(b5,{items:v})]}),RE&&_("button",{type:"button",class:"cf-newmsg",onClick:Bn,children:[_(FR,{}),a.newMessages]})]}),_("div",{class:"cf-sr-live","aria-live":"polite","aria-atomic":"true",children:ZE}),c&&!F&&!qe&&_("div",{class:"cf-stopbar",children:_("button",{type:"button",class:"cf-stop",onClick:S,children:[_(ER,{}),a.stop]})}),qe?_("div",{class:"cf-ended",children:_("button",{type:"button",class:"cf-ended__btn",onClick:Ie,children:a.backToChat})}):F?_("div",{class:"cf-ended",children:[_("p",{class:"cf-ended__text",children:a.conversationEnded}),e.csat&&Yc?NE?_("p",{class:"cf-ended__text",children:a.feedbackThanks}):_("div",{class:"cf-csat",children:[_("span",{class:"cf-csat__q",children:a.csatPrompt}),_("button",{type:"button",class:"cf-csat__btn","aria-label":a.feedbackHelpful,onClick:()=>{I("up"),I1(!0)},children:_(Gx,{})}),_("button",{type:"button",class:"cf-csat__btn","aria-label":a.feedbackNotHelpful,onClick:()=>{I("down"),I1(!0)},children:_($x,{})})]}):null,_("button",{type:"button",class:"cf-ended__btn",onClick:FE,children:a.startNewChat})]}):_(Ae,{children:[m?_("div",{class:"cf-live-typing","aria-live":"polite",children:qt(a.agentTyping,{name:m})}):null,Sp&&Sp.length>0&&_("div",{class:"cf-footer-actions",children:_(jx,{actions:Sp,descriptors:rO,visitor:f,onSubmitForm:L,onDemoSlots:q,scheduler:s?.scheduler,translations:e.actionTranslations})},"footer-actions"),_(O5,{draftStore:OE,onSend:y,onSendGif:b,onTyping:x,disabled:c,allowVoice:!!s?.allowVoiceInput,onTranscribe:P,gifEnabled:R,onSearchGifs:O,allowAttach:e.attachments,onExtract:N},"composer")]}),!F&&s?.disclaimerText&&_("div",{class:"cf-disclaimer",children:s.disclaimerText}),_("div",{class:"cf-footer",children:[_("button",{type:"button",class:"cf-footer__privacy","aria-label":a.clearDeviceData,onClick:()=>Pa(!0),children:a.privacyAndData}),_("span",{"aria-hidden":"true",children:"·"}),a.poweredBy," ",_("a",{href:"https://accurix.tech/centrinfo",target:"_blank",rel:"noopener noreferrer",children:"Centrinfo"})]})]}),un&&_("div",{class:"cf-confirm",onClick:()=>Ri(!1),children:_("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":a.endChatConfirm,onClick:E=>E.stopPropagation(),onKeyDownCapture:E=>hp(E,E.currentTarget,()=>Ri(!1)),children:[_("div",{class:"cf-confirm__title",children:a.endChatConfirm}),_("div",{class:"cf-confirm__body",children:a.endChatConfirmBody}),_("div",{class:"cf-confirm__actions",children:[_("button",{ref:A1,type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>Ri(!1),children:a.cancel}),_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:zE,children:a.endConfirmCta})]})]})},"confirm-end"),Nn&&_("div",{class:"cf-confirm",onClick:()=>Ra(!1),children:_("div",{class:"cf-history",role:"dialog","aria-modal":"true","aria-label":a.pastConversations,onClick:E=>E.stopPropagation(),onKeyDownCapture:E=>hp(E,E.currentTarget,()=>Ra(!1)),children:[_("div",{class:"cf-history__head",children:[_("span",{children:a.pastConversations}),_("button",{type:"button",class:"cf-header__btn","aria-label":a.closeHistory,onClick:()=>Ra(!1),children:_(Ti,{})})]}),_("div",{class:"cf-history__list",children:fe.map(E=>_("button",{type:"button",class:`cf-history__item ${E.sessionId===me?"is-active":""}`,onClick:()=>{Ze(E.sessionId),Ra(!1)},children:[_("span",{class:"cf-history__title",children:E.title}),_("span",{class:"cf-history__meta",children:[new Date(E.ts).toLocaleDateString(void 0,{month:"short",day:"numeric"}),E.ended?` · ${a.historyEnded}`:""]})]},E.sessionId))}),_("div",{class:"cf-history__footer",children:_("button",{type:"button",class:"cf-history__clear",onClick:()=>{Ra(!1),Pa(!0)},children:a.clearDeviceData})})]})},"history"),La&&_("div",{class:"cf-confirm",onClick:()=>Pa(!1),children:_("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":a.clearDeviceData,onClick:E=>E.stopPropagation(),onKeyDownCapture:E=>hp(E,E.currentTarget,()=>Pa(!1)),children:[_("div",{class:"cf-confirm__title",children:a.clearDeviceData}),_("div",{class:"cf-confirm__body",children:a.clearDeviceDataBody}),_("div",{class:"cf-confirm__actions",children:[_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>Pa(!1),children:a.cancel}),_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:()=>{Pa(!1),tt()},children:a.clearDeviceDataCta})]})]})},"confirm-clear")]}),Se&&!i?_(R5,{persona:s,voiceState:Be,muted:pt,onToggleMute:Wc,onEndCall:Ht,micLevel:cr,onExpand:Ei}):le&&i?null:!e.hideDefaultLauncher&&_("button",{ref:Fc,type:"button",class:"cf-launcher","aria-label":i?a.closeChat:re>0?`${a.openChat}. ${re===1?a.unreadMessage:qt(a.unreadMessages,{count:String(re)})}`:a.openChat,"aria-expanded":i,onClick:os,children:[e.launcherIcon?_("img",{class:"cf-launcher__img",src:e.launcherIcon,alt:""}):_(kR,{}),!i&&re>0&&_("span",{class:"cf-launcher__badge","aria-hidden":"true",children:re>99?"99+":re})]})]})})},wE="https://api.accurixtech.com",SE=()=>typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en",kE=(t,e)=>{if(!t)return;const r=e.trim().toLowerCase(),n=r.split("-")[0]??r,a=Object.entries(t);return a.find(([i])=>i.toLowerCase()===r)?.[1]??a.find(([i])=>i.toLowerCase()===n)?.[1]},TE=t=>{if(!t||typeof t.token!="string"||t.token.length===0)throw new Error("[centrinfo-widget] `token` is required — pass your pub_* token to Centrinfo.init({ token }).");const e=t.locale?.trim()||SE(),r=kE(t.translations,e);return{token:t.token,chatSurface:t.chatSurface??"floating",analyticsContextToken:t.analyticsContextToken,identityToken:t.identityToken,getIdentityToken:t.getIdentityToken,apiBaseUrl:(t.apiBaseUrl??wE).replace(/\/$/,""),accentColor:t.accentColor,themeTokens:t.themeTokens,agentName:t.agentName?.trim()||void 0,agentAvatarUrl:t.agentAvatarUrl?.trim()||void 0,launcherIcon:t.launcherIcon,gifApiKey:t.gifApiKey,theme:t.theme??"auto",openByDefault:t.openByDefault??!1,sound:t.sound??!0,starters:t.starters??[],strings:wR({...r?.labels,...t.labels}),locale:e,actionTranslations:r?.actions??{},persistence:t.persistence??"local",attachments:t.attachments??!0,zIndex:t.zIndex??2147483e3,styleNonce:t.styleNonce?.trim()??"",demo:t.demo??!1,preview:t.preview??!1,alignment:t.alignment==="left"?"left":"right",horizontalPadding:typeof t.horizontalPadding=="number"?t.horizontalPadding:20,verticalPadding:typeof t.verticalPadding=="number"?t.verticalPadding:20,hideDefaultLauncher:t.hideDefaultLauncher??!1,customLauncherSelector:t.customLauncherSelector,sessionDurationMinutes:typeof t.sessionDurationMinutes=="number"?t.sessionDurationMinutes:0,configRefreshSeconds:typeof t.configRefreshSeconds=="number"?t.configRefreshSeconds:30,proactiveMessage:t.proactiveMessage,proactiveDelaySeconds:typeof t.proactiveDelaySeconds=="number"?t.proactiveDelaySeconds:5,proactiveOnPaths:t.proactiveOnPaths,csat:t.csat??!0,user:t.user,onOpen:t.onOpen,onClose:t.onClose,onShow:t.onShow,onHide:t.onHide,onUnreadChange:t.onUnreadChange,onMessage:t.onMessage,onAction:t.onAction,onHandoff:t.onHandoff}},b1=`
|
|
32
|
+
[Attached file${Ct}]:
|
|
33
|
+
${Ze.text}`.trim():Ze.id&&(yt=`${yt}
|
|
34
|
+
|
|
35
|
+
[The visitor attached a file${Ct}. It is saved for staff, but its contents were not available to the AI. Do not claim to have inspected it.]`.trim())}!yt&&G&&(yt=G);const ra=rr.map(Ze=>({id:Ze.id,name:Ze.name})),Rt=rr.flatMap(Ze=>Ze.id?[Ze.id]:[]),gt={id:ne||Tr(),role:"user",content:W,imageUrl:G,attachments:ra.length>0?ra:void 0};rr.forEach((Ze,Ct)=>{Ze.file&&(h.current.set(`${gt.id}:${Ct}`,Ze.file),Ze.id&&h.current.set(Ze.id,Ze.file))});const Hr=Tr();w(Ze=>[...!!(ne&&Ze.some(Ee=>Ee.id===ne))?Ze.map(Ee=>Ee.id===ne?{...Ee,content:W,pending:!1,streaming:!1,imageUrl:G,attachments:gt.attachments}:Ee):[...Ze,gt],{id:Hr,role:"assistant",content:"",pending:!0}]),Yi("send"),e.onMessage?.({role:"user",content:yt}),R.current[Hr]=gt.id,s.current={userId:gt.id,agentId:Hr,text:W,backendText:yt},Mr(yt,Hr,{forceVoicePlayback:Fe,clientMessageId:gt.id,attachmentId:Rt[0],attachmentIds:Rt})},[O,e,Mr]),Fr=Y((E,z,W,G,J)=>{const ie=Tr();w(ce=>[...ce.filter(ye=>ye.id!==E.agentId&&(!G.userMessageId||ye.id!==G.userMessageId)).map(ye=>ye.id===E.userId?{...ye,content:z,pending:!1,streaming:!1}:ye),{id:ie,role:"assistant",content:"",pending:!0}]),J&&e.onMessage?.({role:"user",content:J}),R.current[ie]=E.userId,s.current={userId:E.userId,agentId:ie,text:z,backendText:W},Mr(W,ie,{forceVoicePlayback:G.forceVoicePlayback,clientMessageId:Tr()})},[e,Mr]),bs=Y((E,z={})=>{const W=E.trim();if(!W||O)return;const G=o.current&&!o.current.signal.aborted?s.current:null,J=G??l.current;if(l.current=null,!J){rn(W,z);return}G&&o.current?.abort(),Fr(J,`${J.text} ${W}`.replace(/\s+/g," ").trim(),`${J.backendText}
|
|
36
|
+
${W}`.trim(),z,W)},[O,Fr,rn]),Za=Y(()=>{const E=o.current&&!o.current.signal.aborted?s.current:null;return E?(l.current=E,o.current?.abort(),!0):!1},[]),Qt=Y(()=>{const E=l.current;l.current=null,!(!E||O)&&Fr(E,E.text,E.backendText,{forceVoicePlayback:!0})},[O,Fr]),Xi=Y(()=>o.current?.abort(),[]),Zi=Y(E=>{d.current=E;const z=c.current;z&&(z.volume=E?.2:1),u.current&&typeof window<"u"&&"speechSynthesis"in window&&(E?window.speechSynthesis.pause():window.speechSynthesis.resume())},[]),nn=Y(()=>{f.current?.(),f.current=null,d.current=!1,rt(),L(E=>E.status==="speaking"||E.status==="answering"?{...E,status:"done"}:E),c.current?.pause(),c.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),u.current=null,T(!1)},[rt]),Cn=Y(E=>{const z=zE(E);if(!z)return Promise.resolve(!1);rt();const W=!!(y?.allowVoiceInput&&y?.voiceOutputEnabled&&y.talkbackMode!=="text"),G=(J,ie)=>new Promise(ce=>{let ye=!1;_1(c,u,J,ie,y?.voiceSpeed??1,z,!0,()=>{ye=!0,T(!0)},()=>{T(!1),ce(ye)})||(T(!1),ce(!1))});return W?t.speak(z).then(J=>J.audioBase64?G(J.audioBase64,J.mimeType):(au("Talkback prompt TTS did not return provider audio.",{providerReady:J.providerReady,message:J.message,voiceProvider:y?.voiceProvider,voiceOutputEnabled:y?.voiceOutputEnabled,talkbackMode:y?.talkbackMode}),G())).catch(J=>(au("Talkback prompt TTS request failed before audio playback.",{error:J instanceof Error?J.message:String(J),voiceProvider:y?.voiceProvider,voiceOutputEnabled:y?.voiceOutputEnabled,talkbackMode:y?.talkbackMode}),G())):(au("Talkback prompt wanted voice, but the loaded widget token config has provider TTS disabled.",{voiceOutputEnabled:y?.voiceOutputEnabled,talkbackMode:y?.talkbackMode,voiceProvider:y?.voiceProvider}),G())},[y?.allowVoiceInput,y?.talkbackMode,y?.voiceOutputEnabled,y?.voiceSpeed,rt,t]),ea=Y((E,z,W={})=>{if(C||O||!z)return;F(E,{content:"",pending:!0,streaming:!1,error:!1}),Yi("send");const G=x.findIndex(ie=>ie.id===E),J=G>0?x[G-1]:void 0;Mr(z,E,{...W,clientMessageId:R.current[E]??(J?.role==="user"?J.id:void 0)})},[C,O,x,F,Mr]),an=Y((E,z,W)=>{F(E,{feedback:z});const G=x.findIndex(ce=>ce.id===E),J=G>=0?x[G]?.content:void 0;let ie;for(let ce=G-1;ce>=0;ce--)if(x[ce]?.role==="user"){ie=x[ce]?.content;break}t.sendFeedback({sessionId:i.current,messageId:E,rating:z,comment:W,question:ie,answer:J}).catch(()=>{})},[t,F,x]),Ka=Y(async(E,z,W={},G)=>{e.onAction?.(E);const J=E==="public_contact_support"||E==="public_submit_inquiry"?{actionId:E}:{},ie=await t.action(E,{sessionId:i.current,...z,...J},G),ce={};return W.name?.trim()&&(ce.name=W.name.trim()),W.email?.trim()&&(ce.email=W.email.trim()),W.phone?.trim()&&(ce.phone=W.phone.trim()),Object.keys(ce).length>0&&(P(ye=>{const Fe={...ye,...ce};return Pt(Fe),Fe}),ce.email&&E!=="contact"&&t.action("contact",{sessionId:i.current,...ce}).catch(()=>{})),Yi("receive"),ie},[t,e,Pt]),er=Y((E,z,W)=>t.confirmHostedBooking?.({sessionId:i.current,inquiryId:E,eventUri:z,inviteeUri:W})??Promise.resolve(void 0),[t]),tr=Y(E=>{const z=E.trim();z&&w(W=>W.some(G=>G.role==="assistant"&&G.content===z)?W:[...W,{id:Tr(),role:"assistant",content:z}])},[]),Mn=Y(()=>{const E=T1(y?.actions);return E?(w(z=>[...z,{id:Tr(),role:"assistant",content:e.strings.reconnectPrompt,actions:[E],selectedAction:E.id,handoffOffered:!0,reconnectOffer:!0,createdAt:new Date().toISOString()}]),!0):!1},[e.strings.reconnectPrompt,y?.actions]),zt=Y(E=>{k.current=!0;const z=Tr();return w(W=>[...W,{id:z,role:"user",content:E.trim(),pending:!0}]),z},[]),xs=Y((E,z)=>{w(W=>W.map(G=>G.id===E?{...G,...z}:G))},[]),ws=Y(E=>{w(z=>z.filter(W=>W.id!==E))},[]),Ss=Y((E,z)=>{t.sendFeedback({sessionId:i.current,messageId:"__csat__",rating:E,comment:z}).catch(()=>{})},[t]),ks=Y(async(E,z,W,G)=>{const J=Dp();try{if(typeof E!="string"&&t.transcribeAudio)return await t.transcribeAudio(E,z,W,G);const ie=typeof E=="string"?E:await RE(E);return await t.transcribe(ie,z,W,G)}finally{nu("voice-transcription",J)}},[t]),An=Y(async(E,z,W=0)=>{const G=h.current.get(`${E.id}:${W}`)??(z.id?h.current.get(z.id):void 0);if(G)return G;if(!z.id||!t.fetchAttachment)throw new Error("This file is no longer available.");return t.fetchAttachment(z.id,i.current)},[t]),Ts=Y((E,z,W,G)=>t.uploadAttachment?t.uploadAttachment(E,z,W,i.current,G):Promise.reject(new Error("File upload is unavailable")),[t]),ja=Y(E=>t.searchGifs(E),[t]),te=Y((E,z)=>t.demoSlots(E,z),[t]),Se=Y(E=>rn("",{imageUrl:E}),[rn]),Le=e.demo||!!e.gifApiKey,ve=Y(()=>{o.current?.abort(),B(!0),t.endConversation(i.current).catch(()=>{})},[t]),Ae=Y(()=>{o.current?.abort();const E=ms(e);i.current=E;try{n?.setItem(ys(a),E)}catch{}re(null),ge([]),B(!1),Ce("ai"),it(void 0),ze(void 0),oe.current=new Date().toISOString(),w(y?[{id:Tr(),role:"assistant",content:y.greeting,availableActions:y.availableActions,actions:y.actions}]:[])},[n,a,y]),cr=Y(E=>{if(tt){if(E===i.current){re(null);return}ge(w1(n,a,E)),re(E)}},[n,a,tt]),ta=Y(()=>{re(null),ge([])},[]),on=e.starters.length>0?e.starters:y?.starterQuestions??[],sn=y?.featuredLinks??[];return{persona:y,messages:x,sending:C,assistantSpeaking:M,voiceReply:D,visitor:j,starters:on,featuredLinks:sn,hasEmail:!!j.email,liveMode:xe,assignedAgentName:be,agentTypingName:Qe,send:rn,amend:bs,hold:Za,resumeHeld:Qt,duckSpeaking:Zi,sendGif:Se,notifyTyping:vt,stop:Xi,retry:ea,rateMessage:an,injectAssistant:tr,reconnectSupport:Mn,appendUserDraft:zt,patchMessage:xs,removeMessage:ws,submitCsat:Ss,submitForm:Ka,confirmHostedBooking:er,transcribe:ks,uploadAttachment:Ts,loadAttachment:An,searchGifs:ja,demoSlots:te,gifEnabled:Le,identify:Bt,ended:O,endConversation:ve,startNew:Ae,history:tt?V:[],viewingSessionId:Z,viewMessages:Te,openConversation:cr,closeHistoryView:ta,shutdown:Tt,stopSpeaking:nn,speakAssistantText:Cn}},tO=({name:t,greeting:e})=>{const r=kr();return _("section",{class:"cf-empty-welcome","aria-label":ct(r.welcomeLabel,{name:t}),children:[_("span",{class:"cf-empty-welcome__eyebrow",children:r.welcomeEyebrow}),_("h2",{children:t}),_("p",{children:e||r.welcomePrompt})]})},Rp=(t,e,r)=>{if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),r();return}if(t.key!=="Tab")return;const n=Array.from(e.querySelectorAll('button, [href], textarea, input, select, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.getAttribute("aria-hidden")!=="true"&&c.tabIndex>=0);if(n.length===0)return;const a=e.getRootNode(),i=t.composedPath()[0],o=i instanceof HTMLElement?i:"activeElement"in a?a.activeElement:document.activeElement,s=n[0],l=n[n.length-1];t.shiftKey&&(o===s||!e.contains(o))?(t.preventDefault(),t.stopPropagation(),l.focus()):!t.shiftKey&&(o===l||!e.contains(o))&&(t.preventDefault(),t.stopPropagation(),s.focus())},su=new Map,C1=t=>{if(!t||typeof document>"u"||typeof CanvasRenderingContext2D>"u")return;const e=document.createElement("canvas").getContext("2d");if(!e)return;e.fillStyle="#010203",e.fillStyle=t;const r=e.fillStyle;if(r==="#010203"&&t.trim().toLowerCase()!=="#010203")return;const n=r.match(/^#([\da-f]{6})$/i)?.[1];if(n)return[Number.parseInt(n.slice(0,2),16),Number.parseInt(n.slice(2,4),16),Number.parseInt(n.slice(4,6),16),1];const a=r.match(/^rgba?\(([\d.]+)[, ]+([\d.]+)[, ]+([\d.]+)(?:[, /]+([\d.]+))?\)$/i);if(!a)return;const i=a.slice(1,5).map(Number);if(!i.some(o=>!Number.isFinite(o)))return[i[0],i[1],i[2],i[3]??1]},rO=(t,e="#ffffff")=>{const r=`${t??""}|${e}`;if(su.has(r))return su.get(r);const n=C1(t),a=C1(e)??[255,255,255,1];if(!n){su.set(r,void 0);return}const i=n[3],s=n.slice(0,3).map((h,d)=>h*i+a[d]*(1-i)).map(h=>{const d=h/255;return d<=.04045?d/12.92:((d+.055)/1.055)**2.4}),l=s[0]*.2126+s[1]*.7152+s[2]*.0722,c=1.05/(l+.05),u=(l+.05)/.059,f=c>=u?"#ffffff":"#0f1e2a";return su.set(r,f),f},nO=t=>{const[e,r]=U("light");return le(()=>{if(t!=="auto"||typeof matchMedia>"u")return;const n=matchMedia("(prefers-color-scheme: dark)"),a=()=>r(n.matches?"dark":"light");return a(),n.addEventListener("change",a),()=>n.removeEventListener("change",a)},[t]),t==="auto"?e:t},aO=6e4,iO=90,M1={end:"end the call",mute:"mute your microphone",minimize:"minimize the chat",expand:"expand the view",shrink:"exit the expanded view"},A1=t=>t.trim().toLowerCase().replace(/[^\p{L}\p{N}\s']/gu," ").replace(/\s+/g," ").trim(),oO=[{action:"shrink",re:/\b(?:exit|leave|quit|close)\b[\s\w]*\b(?:full ?screen|expanded|theat(?:er|re))\b|\bshrink\b|\bsmaller view\b/},{action:"end",re:/\b(?:end|close|stop|finish|hang ?up|quit|exit)\b[\s\w]*\b(?:call|chat|conversation|convo|session|talking)\b|\bhang ?up\b|\bgood ?bye\b|^bye(?: bye)?$/},{action:"mute",re:/\bmute\b|\bstop listening\b/},{action:"minimize",re:/\bminimi[sz]e\b|\bhide\b[\s\w]*\b(?:chat|call|window|widget)\b/},{action:"expand",re:/\bexpand\b|\bmaximi[sz]e\b|\bfull ?screen\b|\btheat(?:er|re) mode\b|\bbigger view\b/}],sO=/^(?:yes|yeah|yep|yup|sure|correct|confirm|affirmative|go ahead|do it|please do|ok(?:ay)?)\b/,lO=/^(?:no|nope|nah|cancel|never ?mind|don'?t|stop)\b/,cO=/^(?:end|close|stop|finish|hang ?up|quit|exit|bye|good ?bye)\b/,uO=t=>{const e=A1(t);if(!e)return null;for(const{action:r,re:n}of oO)if(n.test(e)){const a=e.split(" ").length;return{action:r,confident:r==="end"?a<=10:a<=6}}return null},fO=t=>`I didn't catch yes or no. Say yes to ${M1[t]}, or no to keep talking.`,dO=({transport:t,config:e,bindControls:r,composerDraftStore:n})=>{const a=e.strings,[i,o]=U(e.openByDefault),{persona:s,messages:l,sending:c,assistantSpeaking:u,visitor:f,hasEmail:h,liveMode:d,assignedAgentName:p,agentTypingName:m,starters:g,featuredLinks:v,send:y,sendGif:b,notifyTyping:x,stop:w,amend:S,hold:k,resumeHeld:C,duckSpeaking:A,retry:M,rateMessage:T,injectAssistant:D,reconnectSupport:L,appendUserDraft:R,patchMessage:O,removeMessage:B,submitCsat:j,submitForm:P,confirmHostedBooking:V,transcribe:H,uploadAttachment:Z,loadAttachment:re,searchGifs:Te,demoSlots:ge,gifEnabled:xe,identify:Ce,ended:be,endConversation:it,startNew:Qe,history:ze,viewingSessionId:oe,viewMessages:pe,openConversation:ot,closeHistoryView:Xe,shutdown:kt,stopSpeaking:tt,speakAssistantText:lr}=eO(t,e,i),Cr=QE(l,d),[Tt,Pt]=U(null),Bt=X(0),xt=Y((N,$,fe)=>{fe===Bt.current&&Pt({status:"ready",name:$,url:URL.createObjectURL(N),mimeType:N.type||"application/octet-stream"})},[]),tn=Y((N,$,fe)=>{const Ke=$.name,je=++Bt.current;Pt({status:"loading",name:Ke}),re(N,$,fe).then(Dr=>xt(Dr,Ke,je),()=>{je===Bt.current&&Pt({status:"error",name:Ke})})},[re,xt]),F=Y((N,$)=>xt(N,$,++Bt.current),[xt]),ue=Y(()=>{Bt.current+=1,Pt(null)},[]);le(()=>()=>{Tt?.status==="ready"&&URL.revokeObjectURL(Tt.url)},[Tt]);const De=!!T1(s?.actions),[we,rt]=U(0),[vt,Mr]=U({mic:"off",processing:!1}),[rn,Fr]=U(null),[bs,Za]=U(!1),[Qt,Xi]=U(!1),[Zi,nn]=U(!1),[Cn,ea]=U(!1),[an,Ka]=U(0),[er,tr]=U(!1),[Mn,zt]=U(null),[xs,ws]=U([]),[Ss,ks]=U(""),[An,Ts]=U(()=>{try{return localStorage.getItem("centrinfo:muted")==="1"}catch{return!1}}),ja=nO(e.theme),te=s?.soundEnabled??!0;le(()=>{DE(e.sound&&te&&!An)},[e.sound,te,An]);const Se=Y(()=>{Ts(N=>{const $=!N;try{localStorage.setItem("centrinfo:muted",$?"1":"0")}catch{}return $})},[]),Le=X(null),ve=X(null),Ae=X(null),cr=X(0),ta=X(!1),on=X(!1),sn=X(null),E=X(0),z=X(void 0),W=X(0),G=X(null),J=X(!1),ie=X(null),ce=X(""),ye=X(()=>{}),Fe=X(""),ne=X(c),rr=X(y);rr.current=y;const yt=X(S);yt.current=S;const ra=X(H);ra.current=H;const Rt=X(!1),gt=X(!1),Hr=X("");Hr.current=[...l].reverse().find(N=>N.role==="assistant")?.content??"";const Ze=X(u);ne.current=c,Ze.current=u;const Ct=Qt?bs?"timeout":Cn||vt.mic==="muted"?"muted":vt.mic==="unavailable"?vt.reason==="permission-denied"||vt.reason==="unsupported"?"denied":"unavailable":vt.mic==="off"||vt.mic==="starting"?"connecting":vt.mic==="hearing"?"hearing":u?"speaking":rn??(vt.processing||c?"processing":"listening"):"idle",[Q,Ee]=U(!0),[st,Re]=U(!1),Ft=X(0),[Ar,Dn]=U(!1),[Ja,Qa]=U(!1),R1=X(null),[na,ei]=U(!1),kO=X({value:""}),TO=n??kO.current,E1=X({confirmEnd:Ar,confirmClear:Ja,showHistory:na});E1.current={confirmEnd:Ar,confirmClear:Ja,showHistory:na};const[CO,O1]=U(!1),ut=!!oe,Op=ut?pe:l,Cs=Op.find(N=>N.id===Mn&&N.visualization)?.visualization;le(()=>{!Mn||Cs||(zt(null),tr(!1))},[Cs,Mn]);const Ki=Y(()=>{o(!0),rt(0),Yi("open"),e.onOpen?.(),e.onShow?.()},[e]),ln=Y(()=>{o(!1),tr(!1),zt(null),e.onClose?.(),e.onHide?.(),ve.current?.focus()},[e]),Ms=Y(()=>i?ln():Ki(),[i,Ki,ln]),MO=Y(()=>Dn(!0),[]),AO=Y(()=>{it(),Dn(!1)},[it]),DO=Y(()=>{Qe(),Re(!1),Ee(!0)},[Qe]);le(()=>{Ar&&R1.current?.focus()},[Ar]),le(()=>{r({open:Ki,close:ln,toggle:Ms,identify:Ce,startNew:Qe,endConversation:it,shutdown:kt})},[r,Ki,ln,Ms,Ce,Qe,it,kt]),le(()=>{const N=l.filter($=>$.role==="assistant"&&!$.pending).length;if(i){cr.current=N;return}N>cr.current&&rt(N-cr.current)},[l,i]),le(()=>{e.onUnreadChange?.(we)},[we,e]),le(()=>{const N=e.sessionDurationMinutes;if(!N||N<=0)return;const $=setTimeout(()=>kt(),N*60*1e3);return()=>clearTimeout($)},[e.sessionDurationMinutes,l,i,kt]),le(()=>{const N=e.customLauncherSelector;if(!N||typeof document>"u")return;let $=[];try{$=Array.from(document.querySelectorAll(N))}catch{return}const fe=Ke=>{Ke.preventDefault(),Ms()};return $.forEach(Ke=>Ke.addEventListener("click",fe)),()=>$.forEach(Ke=>Ke.removeEventListener("click",fe))},[e.customLauncherSelector,Ms]);const N1=X(!1);le(()=>{const N=e.proactiveMessage?.trim();if(!N||N1.current)return;const $=e.proactiveOnPaths??[],fe=typeof location<"u"?location.pathname:"";if($.length>0&&!$.some(Dr=>fe.includes(Dr)))return;const Ke=`centrinfo:proactive:${e.token.slice(0,12)}`;try{if(sessionStorage.getItem(Ke)==="1")return}catch{}const je=setTimeout(()=>{if(!(i||be||l.some(Dr=>Dr.role==="user"))){N1.current=!0;try{sessionStorage.setItem(Ke,"1")}catch{}D(N),Ki()}},Math.max(0,e.proactiveDelaySeconds)*1e3);return()=>clearTimeout(je)},[e.proactiveMessage]),le(()=>{const N=Ae.current;if(!i||!N)return;const $=l[l.length-1],fe=Date.now()<Ft.current;$?.role==="user"||Q||fe?(requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight}),Re(!1),fe&&Ee(!0)):Re(!0)},[l,i,c,Q]);const IO=Y(()=>{const N=Ae.current;if(!N)return;if(ta.current&&!ut){Ee(!0),Re(!1);return}const $=N.scrollHeight-N.scrollTop-N.clientHeight<80;Ee($),$&&Re(!1)},[ut]),aa=Y(()=>{const N=Ae.current;N&&(N.scrollTop=N.scrollHeight),Re(!1),Ee(!0)},[]),lu=Y(()=>{Ft.current=Date.now()+3e3,requestAnimationFrame(aa)},[aa]);le(()=>{if(!i||ut||!Qt||Ct==="connecting")return;Ft.current=Date.now()+6e4,aa();const N=requestAnimationFrame(()=>{aa(),requestAnimationFrame(aa)}),$=[80,180,360].map(fe=>window.setTimeout(aa,fe));return()=>{cancelAnimationFrame(N),$.forEach(fe=>window.clearTimeout(fe))}},[u,l,i,aa,c,Qt,ut,Ct]);const B1=Y(()=>{Le.current?.querySelector(".cf-textarea")?.focus()},[]),As=Y((N,$)=>{Fr(N),z.current&&window.clearTimeout(z.current),z.current=window.setTimeout(()=>Fr(null),3e3),$&&!on.current&&lr($)},[lr]),cu=Y(N=>{const $=ie.current;if($)return $;lu();const fe=R(N);return ie.current=fe,O(fe,{content:ce.current||N,pending:!0,streaming:!1}),fe},[R,lu,O]),In=Y(()=>{const N=ie.current;if(N){if(ce.current){O(N,{content:ce.current,pending:!0});return}ie.current=null,B(N)}},[O,B]),ia=Y(()=>{gt.current&&(gt.current=!1,A(!1)),Rt.current&&(Rt.current=!1,C())},[A,C]),nr=Y(()=>{ta.current=!1,sn.current?.stop("call-ended"),sn.current=null,Rt.current=!1,gt.current=!1,on.current=!1,G.current=null,J.current=!1;const N=ie.current;ie.current=null,ce.current="",N&&B(N),z.current&&window.clearTimeout(z.current),Fr(null),Za(!1),Mr({mic:"off",processing:!1}),Ka(0),Xi(!1),nn(!1),ea(!1),tr(!1),zt(null),tt()},[B,tt]),LO=Y(()=>{er&&zt(null),tr(!er)},[er]),PO=Y(N=>{zt(N),tr(!0)},[]),RO=Y(()=>{const N=Mn;zt(null),tr(!1),window.requestAnimationFrame(()=>{Array.from(Le.current?.querySelectorAll("[data-visualization-message]")??[]).find(fe=>fe.dataset.visualizationMessage===N)?.focus()})},[Mn]),EO=Y(()=>{zt(null),tr(!1)},[]),z1=Y((N,$,fe=!1)=>{if(lu(),$&&(O($,{content:N,pending:!1,streaming:!1}),ie.current===$&&(ie.current=null)),ce.current="",fe){tt(),yt.current(N,{forceVoicePlayback:!0,userMessageId:$});return}ta.current&&(k()?yt.current(N,{forceVoicePlayback:!0,userMessageId:$}):rr.current(N,{forceVoicePlayback:!0,userMessageId:$}))},[lu,k,O,tt]),cn=Y(N=>{D(N),lr(N)},[D,lr]),F1=Y(()=>{if(E.current=Date.now(),Fr(null),Ze.current){gt.current=!0,A(!0);return}Rt.current||(Rt.current=k()),cu("Listening...")},[A,cu,k]),H1=Y(N=>{const $=ie.current;if(!$||gt.current)return;const fe=[ce.current,N].filter(Boolean).join(" ");O($,{content:`${fe} ...`,pending:!0})},[O]),V1=Y(N=>{E.current=Date.now();const $=[ce.current,N.text].map(un=>un.trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim();if((gt.current||N.overlappedOutput)&&AR(N.text,Hr.current)){In(),ia();return}if(!$||ME($)||AE($)){const un=gt.current||Rt.current;In(),ia(),un||As("misunderstood");return}gt.current&&(gt.current=!1,w(),tt());const Ke=G.current;if(Ke){ce.current="",In();const un=A1($);if(sO.test(un)||Ke==="end"&&cO.test(un)){G.current=null,ye.current(Ke);return}if(lO.test(un)){G.current=null,cn("Okay, never mind — what would you like to know?");return}cn(fO(Ke));return}const je=uO($);if(je){if(ce.current="",In(),ia(),je.confident){ye.current(je.action);return}G.current=je.action,cn(`Just to confirm — you want me to ${M1[je.action]}? Please say yes or no.`);return}const Dr=cu($);O(Dr,{content:$,pending:!0});const ji=Rt.current;Rt.current=!1,z1($,Dr,ji)},[cu,O,ia,z1,In,As,cn,w,tt]),U1=Y(N=>{E.current=Date.now();const $=gt.current||Rt.current;if(In(),ia(),!($||N.overlappedOutput||N.reason==="too-short")){if(N.reason==="transcribe-failed"){As("misunderstood","I couldn't transcribe that. Please try again, or type your question.");return}As("noise")}},[ia,In,As]),Ds=X({speechStart:F1,partial:H1,turn:V1,noise:U1});Ds.current={speechStart:F1,partial:H1,turn:V1,noise:U1};const G1=Y(()=>{navigator.mediaDevices?.enumerateDevices().then(N=>{ws(N.filter($=>$.kind==="audioinput").map(($,fe)=>({deviceId:$.deviceId,label:$.label||`Microphone ${fe+1}`})))}).catch(()=>{})},[]),OO=Y(()=>{if(ta.current){nr();return}if(B1(),!s?.allowVoiceInput||!s.talkbackMode||s.talkbackMode==="text"||ne.current||be||ut)return;E.current=Date.now(),on.current=!1,ta.current=!0,ea(!1),Xi(!0),nn(!1),Za(!1);let N=!1;const $=new Kx({deviceId:Fe.current||void 0,transcribe:async({audio:fe,mimeType:Ke,durationSeconds:je})=>{const Dr=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0;return TE(await ra.current(fe,Ke,Dr,je))},listener:{state:fe=>{Mr(fe),fe.mic!=="starting"&&fe.mic!=="off"&&nn(!0),!N&&fe.mic==="listening"&&(N=!0,G1())},speechStart:()=>Ds.current.speechStart(),partial:({text:fe})=>Ds.current.partial(fe),turn:fe=>Ds.current.turn(fe),noise:fe=>Ds.current.noise(fe),level:fe=>{const Ke=performance.now();Ke-W.current<iO||(W.current=Ke,Ka(fe))}}});sn.current=$,$.setOutputActive(Ze.current),$.start()},[nr,be,B1,s,G1,ut]),uu=Y(()=>{const N=!on.current;on.current=N,ea(N),sn.current?.setMuted(N),N?(ce.current="",In(),ia()):E.current=Date.now()},[ia,In]),$1=Y(N=>{switch(E.current=Date.now(),N){case"end":J.current=!0,cn("Okay — ending our call now. Goodbye!"),window.setTimeout(()=>{J.current&&(J.current=!1,nr())},2e3);break;case"mute":{on.current||uu(),cn("Muted. Tap the mic button when you want me to listen again.");break}case"minimize":ln(),cn("Minimized — I'm still listening. Tap the call pill to bring the chat back.");break;case"expand":tr(!0),cn("Sure — expanding the view.");break;case"shrink":zt(null),tr(!1),cn("Okay — back to the smaller view.");break}},[ln,nr,cn,uu]);le(()=>{ye.current=$1},[$1]);const W1=X(!1);le(()=>{W1.current&&!u&&J.current&&(J.current=!1,nr()),W1.current=u},[u,nr]);const NO=Y(N=>{Fe.current=N,ks(N),sn.current?.selectDevice(N||void 0)},[]),BO=Y(()=>{!ta.current||on.current||(gt.current=!1,Rt.current=!1,w(),tt(),E.current=Date.now())},[w,tt]);le(()=>{sn.current?.setOutputActive(u),E.current=Date.now()},[u]),le(()=>{if(Ct!=="denied")return;const N=window.setTimeout(()=>nr(),3500);return()=>window.clearTimeout(N)},[nr,Ct]),le(()=>{if(!Qt)return;const N=window.setInterval(()=>{const $=sn.current;!$||on.current||ne.current||Ze.current||$.snapshot.mic==="hearing"||$.snapshot.processing||Date.now()-E.current<aO||(sn.current?.log.add("call-timeout"),Za(!0),window.setTimeout(()=>nr(),2400))},5e3);return()=>window.clearInterval(N)},[nr,Qt]);const zO=Qt&&!Cn&&(c||u);le(()=>()=>nr(),[nr]);const[FO,HO]=U(""),q1=X(!1);le(()=>{if(q1.current&&!c){const N=[...l].reverse().find($=>$.role==="assistant"&&!$.streaming&&!$.pending&&$.content);N&&HO(N.content)}q1.current=c},[c,l]),Mu(()=>{if(!i)return;const N=Le.current,$=Ar||Ja?N?.querySelector(".cf-confirm__card"):na?N?.querySelector(".cf-history"):null;if(!$)return;const fe=$.getRootNode(),Ke="activeElement"in fe?fe.activeElement:document.activeElement;(!Ke||!$.contains(Ke))&&$.querySelector('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])')?.focus()},[Ja,Ar,i,na]),le(()=>{if(!i)return;const N=Le.current,$=Ar||Ja?N?.querySelector(".cf-confirm__card"):na?N?.querySelector(".cf-history"):null,fe=N?.querySelectorAll(":scope > .cf-header, :scope > .cf-panel__video, :scope > .cf-panel__chat");fe?.forEach(je=>{$?(je.setAttribute("inert",""),je.setAttribute("aria-hidden","true")):(je.removeAttribute("inert"),je.removeAttribute("aria-hidden"))}),$||requestAnimationFrame(()=>N?.querySelector(".cf-textarea")?.focus());const Ke=je=>{if(je.key==="Escape"){je.preventDefault();const Ls=E1.current;if(Ls.confirmEnd){Dn(!1);return}if(Ls.confirmClear){Qa(!1);return}if(Ls.showHistory){ei(!1);return}ln();return}if(je.key!=="Tab"||!$)return;const Dr=$.querySelectorAll('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])'),ji=Array.from(Dr).filter(Ls=>!Ls.hasAttribute("disabled"));if(ji.length===0)return;const un=ji[0],K1=ji[ji.length-1],j1=$.getRootNode()instanceof ShadowRoot?$.getRootNode().activeElement:document.activeElement;je.shiftKey&&j1===un?(je.preventDefault(),K1.focus()):!je.shiftKey&&j1===K1&&(je.preventDefault(),un.focus())};return N?.addEventListener("keydown",Ke),()=>{N?.removeEventListener("keydown",Ke),fe?.forEach(je=>{je.removeAttribute("inert"),je.removeAttribute("aria-hidden")})}},[i,ln,Ar,Ja,na]),le(()=>{const N=Le.current;N&&(i?N.removeAttribute("inert"):N.setAttribute("inert",""))},[i]);const fu=e.accentColor??e.themeTokens?.accent??s?.accentColor,Y1=e.themeTokens?.accentText??rO(fu,e.themeTokens?.background??(ja==="dark"?"#0f1c27":"#ffffff")),VO={zIndex:e.zIndex,"--cf-h-pad":`${e.horizontalPadding}px`,"--cf-v-pad":`${e.verticalPadding}px`,...Y1?{"--cf-accent-ink":Y1}:{},...e.themeTokens?.accentStrong?{"--cf-accent-2":e.themeTokens.accentStrong}:{},...e.themeTokens?.background?{"--cf-bg":e.themeTokens.background}:{},...e.themeTokens?.surface?{"--cf-surface":e.themeTokens.surface}:{},...e.themeTokens?.surfaceMuted?{"--cf-surface-2":e.themeTokens.surfaceMuted}:{},...e.themeTokens?.text?{"--cf-text":e.themeTokens.text}:{},...e.themeTokens?.mutedText?{"--cf-muted":e.themeTokens.mutedText}:{},...e.themeTokens?.border?{"--cf-border":e.themeTokens.border}:{},...e.themeTokens?.shadow?{"--cf-shadow":e.themeTokens.shadow}:{},...e.themeTokens?.radius?{"--cf-radius":e.themeTokens.radius}:{},...e.themeTokens?.fontFamily?{"--cf-font":e.themeTokens.fontFamily}:{},...e.themeTokens?.success?{"--cf-success":e.themeTokens.success}:{},...e.themeTokens?.warning?{"--cf-warning":e.themeTokens.warning}:{},...e.themeTokens?.danger?{"--cf-danger":e.themeTokens.danger}:{},...fu?{"--cf-accent":fu,"--cf-accent-2":e.themeTokens?.accentStrong??`color-mix(in oklab, ${fu} 76%, #14141f)`}:{}},UO=N=>y(N),GO=[...l].reverse().find(N=>N.role==="user"&&N.content.trim())?.content??"",du=l.some(N=>N.role==="user"),X1=!!(s?.allowVoiceInput&&s?.talkbackMode&&s.talkbackMode!=="text"),Z1=X1,Is=!ut&&Z1&&!du?Op.filter((N,$)=>!($===0&&N.role==="assistant")):Op,$O=d==="human"&&p?p:s?.agentName??a.chatName,WO=d==="human"?a.liveSupport:d==="queued"?a.waitingForTeam:s?.offline?a.statusOffline:a.statusOnline,Np=!be&&!ut?s?.availableActions:void 0,qO=!be&&!ut?s?.actions:void 0,Bp=Qt&&!Zi&&Ct==="connecting"&&!ut;return _(o5,{value:a,children:_("div",{class:"cf-root","data-theme":ja,"data-align":e.alignment,"data-display":"floating",style:VO,children:[er&&i&&_("div",{class:"cf-theater-backdrop",onClick:EO}),_("div",{ref:Le,class:`cf-panel ${i?"is-open":""} ${Qt?"cf-panel--call":""} ${Bp?"cf-panel--voice-connecting":""} ${er&&i?"cf-panel--theater":""} ${Cs?"cf-panel--analytics-focus":""}`,role:"dialog","aria-modal":"false","aria-label":`${a.chatName}: ${s?.agentName??a.assistantName}`,"aria-hidden":!i,children:[Tt&&i&&_(PE,{state:Tt,onClose:ue}),_("div",{class:"cf-header",children:[_(o1,{persona:s,hideWhenMissing:!0}),_("div",{class:"cf-header__meta",children:[_("div",{class:"cf-header__name",children:$O}),_("div",{class:`cf-header__status ${d==="ai"&&s?.offline?"cf-header__status--offline":""}`,children:_("span",{class:"cf-header__status-text",children:WO})})]}),_("div",{class:"cf-header__actions",children:[ze.length>0&&_("button",{type:"button",class:"cf-header__btn","aria-label":a.pastConversations,title:a.pastConversations,"aria-pressed":na,onClick:()=>ei(N=>!N),children:_(T5,{})}),du&&!be&&!ut&&_("button",{type:"button",class:"cf-header__btn","aria-label":a.endChat,title:a.endChat,onClick:MO,children:_(kp,{})}),e.sound&&te&&_("button",{type:"button",class:"cf-header__btn","aria-label":An?a.unmuteSounds:a.muteSounds,"aria-pressed":An,onClick:Se,children:An?_(x5,{}):_(b5,{})}),_("button",{type:"button",class:"cf-header__btn cf-header__close","aria-label":a.closeChat,onClick:ln,children:_(Ya,{})})]})]}),_("div",{class:"cf-panel__video",children:Cs?_("div",{class:"cf-analytics-focus",role:"region","aria-label":a.expandedAnalyticsResult,children:_(h1,{visualization:Cs,expanded:!0,onClose:RO})}):!ut&&Z1?_(Y5,{persona:s,starters:[],onPick:y,onFocusComposer:OO,speaking:u,voiceState:Ct,replyPending:Qt&&c&&!u,pinned:!0,muted:Cn,onToggleMute:uu,onEndCall:nr,onTalkNow:BO,showTalkNow:zO,micLevel:an,theaterMode:er,onToggleTheater:LO,onMinimize:ln,audioDevices:xs,selectedAudioDeviceId:Ss,onSelectAudioDevice:NO,connectingOnly:Bp}):null}),!Bp&&_("div",{class:"cf-panel__chat",children:[e.preview&&_("div",{class:"cf-preview-banner",children:a.previewBanner}),ut&&_("div",{class:"cf-viewing-banner",children:a.viewingPast}),_("div",{class:"cf-body",ref:Ae,role:"log",onScroll:IO,children:[Is.map((N,$)=>_(hE,{msg:N,persona:s,isLast:!ut&&$===Is.length-1,visitor:f,hasEmail:h,lastQuestion:GO,showActions:!ut&&$===Is.length-1&&!!(N.handoffOffered||N.selectedAction),onPickReply:UO,onSubmitForm:P,onDemoSlots:ge,onConfirmHostedBooking:V,onRetry:M,ratable:!ut&&Is.slice(0,$).some(fe=>fe.role==="user"),onRate:T,onExpandVisualization:ut?void 0:PO,onOpenAttachment:tn,onReconnect:!ut&&!be&&De&&N.id===Cr?L:void 0},N.id)),!du&&!ut&&_(Me,{children:[Is.length===0&&_(tO,{name:s?.agentName??a.assistantName,greeting:s?.greeting}),_(uE,{items:g,onPick:y}),_(fE,{items:v})]}),st&&_("button",{type:"button",class:"cf-newmsg",onClick:aa,children:[_(D5,{}),a.newMessages]})]}),_("div",{class:"cf-sr-live","aria-live":"polite","aria-atomic":"true",children:FO}),c&&!be&&!ut&&_("div",{class:"cf-stopbar",children:_("button",{type:"button",class:"cf-stop",onClick:w,children:[_(k5,{}),a.stop]})}),ut?_("div",{class:"cf-ended",children:_("button",{type:"button",class:"cf-ended__btn",onClick:Xe,children:a.backToChat})}):be?_("div",{class:"cf-ended",children:[_("p",{class:"cf-ended__text",children:a.conversationEnded}),e.csat&&du?CO?_("p",{class:"cf-ended__text",children:a.feedbackThanks}):_("div",{class:"cf-csat",children:[_("span",{class:"cf-csat__q",children:a.csatPrompt}),_("button",{type:"button",class:"cf-csat__btn","aria-label":a.feedbackHelpful,onClick:()=>{j("up"),O1(!0)},children:_(t1,{})}),_("button",{type:"button",class:"cf-csat__btn","aria-label":a.feedbackNotHelpful,onClick:()=>{j("down"),O1(!0)},children:_(r1,{})})]}):null,_("button",{type:"button",class:"cf-ended__btn",onClick:DO,children:a.startNewChat})]}):_(Me,{children:[m?_("div",{class:"cf-live-typing","aria-live":"polite",children:ct(a.agentTyping,{name:m})}):null,Np&&Np.length>0&&_("div",{class:"cf-footer-actions",children:_(f1,{actions:Np,descriptors:qO,visitor:f,onSubmitForm:P,onDemoSlots:ge,onConfirmHostedBooking:V,scheduler:s?.scheduler,translations:e.actionTranslations})},"footer-actions"),_(kE,{draftStore:TO,onSend:y,onSendGif:b,onTyping:x,disabled:c,allowVoice:X1,onTranscribe:H,gifEnabled:xe,onSearchGifs:Te,allowAttach:e.attachments,analyzeAttachments:!0,onUpload:Z,onPreviewAttachment:F},"composer")]}),!be&&s?.disclaimerText&&_("div",{class:"cf-disclaimer",children:s.disclaimerText}),_("div",{class:"cf-footer",children:[_("button",{type:"button",class:"cf-footer__privacy","aria-label":a.clearDeviceData,onClick:()=>Qa(!0),children:a.privacyAndData}),_("span",{"aria-hidden":"true",children:"·"}),a.poweredBy," ",_("a",{href:"https://accurix.tech/centrinfo",target:"_blank",rel:"noopener noreferrer",children:"Centrinfo"})]})]}),Ar&&_("div",{class:"cf-confirm",onClick:()=>Dn(!1),children:_("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":a.endChatConfirm,onClick:N=>N.stopPropagation(),onKeyDownCapture:N=>Rp(N,N.currentTarget,()=>Dn(!1)),children:[_("div",{class:"cf-confirm__title",children:a.endChatConfirm}),_("div",{class:"cf-confirm__body",children:a.endChatConfirmBody}),_("div",{class:"cf-confirm__actions",children:[_("button",{ref:R1,type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>Dn(!1),children:a.cancel}),_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:AO,children:a.endConfirmCta})]})]})},"confirm-end"),na&&_("div",{class:"cf-confirm",onClick:()=>ei(!1),children:_("div",{class:"cf-history",role:"dialog","aria-modal":"true","aria-label":a.pastConversations,onClick:N=>N.stopPropagation(),onKeyDownCapture:N=>Rp(N,N.currentTarget,()=>ei(!1)),children:[_("div",{class:"cf-history__head",children:[_("span",{children:a.pastConversations}),_("button",{type:"button",class:"cf-header__btn","aria-label":a.closeHistory,onClick:()=>ei(!1),children:_(Ya,{})})]}),_("div",{class:"cf-history__list",children:ze.map(N=>_("button",{type:"button",class:`cf-history__item ${N.sessionId===oe?"is-active":""}`,onClick:()=>{ot(N.sessionId),ei(!1)},children:[_("span",{class:"cf-history__title",children:N.title}),_("span",{class:"cf-history__meta",children:[new Date(N.ts).toLocaleDateString(void 0,{month:"short",day:"numeric"}),N.ended?` · ${a.historyEnded}`:""]})]},N.sessionId))}),_("div",{class:"cf-history__footer",children:_("button",{type:"button",class:"cf-history__clear",onClick:()=>{ei(!1),Qa(!0)},children:a.clearDeviceData})})]})},"history"),Ja&&_("div",{class:"cf-confirm",onClick:()=>Qa(!1),children:_("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":a.clearDeviceData,onClick:N=>N.stopPropagation(),onKeyDownCapture:N=>Rp(N,N.currentTarget,()=>Qa(!1)),children:[_("div",{class:"cf-confirm__title",children:a.clearDeviceData}),_("div",{class:"cf-confirm__body",children:a.clearDeviceDataBody}),_("div",{class:"cf-confirm__actions",children:[_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>Qa(!1),children:a.cancel}),_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:()=>{Qa(!1),kt()},children:a.clearDeviceDataCta})]})]})},"confirm-clear")]}),Qt&&!i?_(wE,{persona:s,voiceState:Ct,muted:Cn,onToggleMute:uu,onEndCall:nr,micLevel:an,onExpand:Ki}):er&&i?null:!e.hideDefaultLauncher&&_("button",{ref:ve,type:"button",class:"cf-launcher","aria-label":i?a.closeChat:we>0?`${a.openChat}. ${we===1?a.unreadMessage:ct(a.unreadMessages,{count:String(we)})}`:a.openChat,"aria-expanded":i,onClick:Ms,children:[e.launcherIcon?_("img",{class:"cf-launcher__img",src:e.launcherIcon,alt:""}):_(u5,{}),!i&&we>0&&_("span",{class:"cf-launcher__badge","aria-hidden":"true",children:we>99?"99+":we})]})]})})},hO="https://api.accurixtech.com",pO=()=>typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en",vO=(t,e)=>{if(!t)return;const r=e.trim().toLowerCase(),n=r.split("-")[0]??r,a=Object.entries(t);return a.find(([i])=>i.toLowerCase()===r)?.[1]??a.find(([i])=>i.toLowerCase()===n)?.[1]},gO=t=>{if(!t||typeof t.token!="string"||t.token.length===0)throw new Error("[centrinfo-widget] `token` is required — pass your pub_* token to Centrinfo.init({ token }).");const e=t.locale?.trim()||pO(),r=vO(t.translations,e);return{token:t.token,chatSurface:t.chatSurface??"floating",analyticsContextToken:t.analyticsContextToken,identityToken:t.identityToken,getIdentityToken:t.getIdentityToken,apiBaseUrl:(t.apiBaseUrl??hO).replace(/\/$/,""),accentColor:t.accentColor,themeTokens:t.themeTokens,agentName:t.agentName?.trim()||void 0,agentAvatarUrl:t.agentAvatarUrl?.trim()||void 0,launcherIcon:t.launcherIcon,gifApiKey:t.gifApiKey,theme:t.theme??"auto",openByDefault:t.openByDefault??!1,sound:t.sound??!0,starters:t.starters??[],strings:i5({...r?.labels,...t.labels}),locale:e,actionTranslations:r?.actions??{},persistence:t.persistence??"local",attachments:t.attachments??!0,zIndex:t.zIndex??2147483e3,styleNonce:t.styleNonce?.trim()??"",demo:t.demo??!1,preview:t.preview??!1,alignment:t.alignment==="left"?"left":"right",horizontalPadding:typeof t.horizontalPadding=="number"?t.horizontalPadding:20,verticalPadding:typeof t.verticalPadding=="number"?t.verticalPadding:20,hideDefaultLauncher:t.hideDefaultLauncher??!1,customLauncherSelector:t.customLauncherSelector,sessionDurationMinutes:typeof t.sessionDurationMinutes=="number"?t.sessionDurationMinutes:0,configRefreshSeconds:typeof t.configRefreshSeconds=="number"?t.configRefreshSeconds:30,proactiveMessage:t.proactiveMessage,proactiveDelaySeconds:typeof t.proactiveDelaySeconds=="number"?t.proactiveDelaySeconds:5,proactiveOnPaths:t.proactiveOnPaths,csat:t.csat??!0,user:t.user,onOpen:t.onOpen,onClose:t.onClose,onShow:t.onShow,onHide:t.onHide,onUnreadChange:t.onUnreadChange,onMessage:t.onMessage,onAction:t.onAction,onHandoff:t.onHandoff}},D1=`
|
|
34
37
|
:host {
|
|
35
38
|
all: initial;
|
|
36
39
|
}
|
|
@@ -531,7 +534,7 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
531
534
|
background: var(--cf-surface);
|
|
532
535
|
}
|
|
533
536
|
.cf-artifact figcaption { padding: 10px 12px 0; color: var(--cf-text); font-size: 12px; font-weight: 750; }
|
|
534
|
-
.cf-artifact img { display: block; width: 100%; height: auto; margin-top: 9px; }
|
|
537
|
+
.cf-artifact img, .cf-artifact video { display: block; width: 100%; height: auto; margin-top: 9px; }
|
|
535
538
|
.cf-artifact p { margin: 0 !important; padding: 8px 12px 10px; color: var(--cf-muted); font-size: 10px; }
|
|
536
539
|
.cf-artifact-link {
|
|
537
540
|
display: grid;
|
|
@@ -574,6 +577,19 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
574
577
|
color: var(--cf-muted);
|
|
575
578
|
overflow-wrap: break-word;
|
|
576
579
|
}
|
|
580
|
+
.cf-system-event__action {
|
|
581
|
+
padding: 6px 12px;
|
|
582
|
+
border: 1px solid color-mix(in srgb, var(--cf-accent, #2f7f55) 45%, var(--cf-border));
|
|
583
|
+
border-radius: 999px;
|
|
584
|
+
background: var(--cf-bg);
|
|
585
|
+
color: var(--cf-accent, #2f7f55);
|
|
586
|
+
font: inherit;
|
|
587
|
+
font-size: 12.5px;
|
|
588
|
+
font-weight: 650;
|
|
589
|
+
cursor: pointer;
|
|
590
|
+
}
|
|
591
|
+
.cf-system-event__action:hover { background: color-mix(in srgb, var(--cf-accent, #2f7f55) 8%, var(--cf-bg)); }
|
|
592
|
+
.cf-system-event__action:focus-visible { outline: 2px solid var(--cf-accent, #2f7f55); outline-offset: 2px; }
|
|
577
593
|
.cf-system-event__time {
|
|
578
594
|
font-size: 11px;
|
|
579
595
|
line-height: 1.2;
|
|
@@ -976,6 +992,113 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
976
992
|
}
|
|
977
993
|
.cf-form__input:focus { border-color: var(--cf-accent); }
|
|
978
994
|
.cf-form__input::placeholder { color: var(--cf-muted); }
|
|
995
|
+
.cf-phone {
|
|
996
|
+
position: relative;
|
|
997
|
+
display: grid;
|
|
998
|
+
gap: 5px;
|
|
999
|
+
}
|
|
1000
|
+
.cf-phone__label {
|
|
1001
|
+
color: var(--cf-muted);
|
|
1002
|
+
font-size: 11px;
|
|
1003
|
+
font-weight: 600;
|
|
1004
|
+
}
|
|
1005
|
+
.cf-phone__control {
|
|
1006
|
+
display: grid;
|
|
1007
|
+
grid-template-columns: 92px minmax(0, 1fr);
|
|
1008
|
+
overflow: hidden;
|
|
1009
|
+
border: 1.5px solid var(--cf-border);
|
|
1010
|
+
border-radius: 8px;
|
|
1011
|
+
background: var(--cf-bg);
|
|
1012
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
1013
|
+
}
|
|
1014
|
+
.cf-phone__control:focus-within {
|
|
1015
|
+
border-color: var(--cf-accent);
|
|
1016
|
+
box-shadow: 0 0 0 2px color-mix(in oklab, var(--cf-accent) 14%, transparent);
|
|
1017
|
+
}
|
|
1018
|
+
.cf-phone__input {
|
|
1019
|
+
width: 100%;
|
|
1020
|
+
min-width: 0;
|
|
1021
|
+
box-sizing: border-box;
|
|
1022
|
+
border: 0;
|
|
1023
|
+
border-radius: 0;
|
|
1024
|
+
background: transparent;
|
|
1025
|
+
color: var(--cf-text);
|
|
1026
|
+
font: inherit;
|
|
1027
|
+
font-size: 13.5px;
|
|
1028
|
+
padding: 10px;
|
|
1029
|
+
outline: none;
|
|
1030
|
+
}
|
|
1031
|
+
.cf-phone__input::placeholder { color: var(--cf-muted); }
|
|
1032
|
+
.cf-phone__country {
|
|
1033
|
+
display: grid;
|
|
1034
|
+
grid-template-columns: 20px 1fr 14px;
|
|
1035
|
+
align-items: center;
|
|
1036
|
+
gap: 4px;
|
|
1037
|
+
border-right: 1px solid var(--cf-border);
|
|
1038
|
+
padding: 8px 7px;
|
|
1039
|
+
color: var(--cf-text);
|
|
1040
|
+
font-size: 13px;
|
|
1041
|
+
text-align: left;
|
|
1042
|
+
white-space: nowrap;
|
|
1043
|
+
}
|
|
1044
|
+
.cf-phone__country-code { overflow: hidden; text-overflow: clip; }
|
|
1045
|
+
.cf-phone__country svg {
|
|
1046
|
+
width: 13px;
|
|
1047
|
+
height: 13px;
|
|
1048
|
+
color: var(--cf-muted);
|
|
1049
|
+
}
|
|
1050
|
+
.cf-phone__country[aria-expanded="true"] svg { transform: rotate(180deg); }
|
|
1051
|
+
.cf-phone__menu {
|
|
1052
|
+
display: grid;
|
|
1053
|
+
gap: 6px;
|
|
1054
|
+
margin-top: 1px;
|
|
1055
|
+
padding: 7px;
|
|
1056
|
+
border: 1px solid var(--cf-border);
|
|
1057
|
+
border-radius: 8px;
|
|
1058
|
+
background: var(--cf-surface);
|
|
1059
|
+
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
|
|
1060
|
+
}
|
|
1061
|
+
.cf-phone__search {
|
|
1062
|
+
width: 100%;
|
|
1063
|
+
box-sizing: border-box;
|
|
1064
|
+
border: 1px solid var(--cf-border);
|
|
1065
|
+
border-radius: 6px;
|
|
1066
|
+
background: var(--cf-bg);
|
|
1067
|
+
color: var(--cf-text);
|
|
1068
|
+
font: inherit;
|
|
1069
|
+
font-size: 12.5px;
|
|
1070
|
+
outline: none;
|
|
1071
|
+
padding: 8px 9px;
|
|
1072
|
+
}
|
|
1073
|
+
.cf-phone__search:focus { border-color: var(--cf-accent); }
|
|
1074
|
+
.cf-phone__options {
|
|
1075
|
+
display: grid;
|
|
1076
|
+
max-height: 124px;
|
|
1077
|
+
overflow-y: auto;
|
|
1078
|
+
overscroll-behavior: contain;
|
|
1079
|
+
scrollbar-width: thin;
|
|
1080
|
+
}
|
|
1081
|
+
.cf-phone__option {
|
|
1082
|
+
display: grid;
|
|
1083
|
+
grid-template-columns: 22px minmax(0, 1fr) auto;
|
|
1084
|
+
align-items: center;
|
|
1085
|
+
gap: 6px;
|
|
1086
|
+
width: 100%;
|
|
1087
|
+
min-height: 34px;
|
|
1088
|
+
padding: 6px 7px;
|
|
1089
|
+
border-radius: 5px;
|
|
1090
|
+
color: var(--cf-text);
|
|
1091
|
+
font-size: 12.5px;
|
|
1092
|
+
text-align: left;
|
|
1093
|
+
}
|
|
1094
|
+
.cf-phone__option:hover,
|
|
1095
|
+
.cf-phone__option.is-selected {
|
|
1096
|
+
background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-bg));
|
|
1097
|
+
}
|
|
1098
|
+
.cf-phone__option.is-selected { color: var(--cf-accent-strong); font-weight: 600; }
|
|
1099
|
+
.cf-phone__option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1100
|
+
.cf-phone__option-code { color: var(--cf-muted); font-variant-numeric: tabular-nums; }
|
|
1101
|
+
.cf-phone__empty { padding: 12px 8px; color: var(--cf-muted); font-size: 12px; text-align: center; }
|
|
979
1102
|
.cf-form__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
|
|
980
1103
|
.cf-form__submit {
|
|
981
1104
|
padding: 8px 14px;
|
|
@@ -992,17 +1115,23 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
992
1115
|
.cf-form__cancel:hover { color: var(--cf-text); }
|
|
993
1116
|
.cf-form__err { font-size: 12.5px; color: #f25767; }
|
|
994
1117
|
.cf-form--done {
|
|
995
|
-
flex-direction:
|
|
1118
|
+
flex-direction: column;
|
|
996
1119
|
align-items: center;
|
|
997
|
-
|
|
1120
|
+
justify-content: center;
|
|
1121
|
+
gap: 10px;
|
|
1122
|
+
min-height: 112px;
|
|
1123
|
+
padding: 18px 16px;
|
|
998
1124
|
font-size: 13.5px;
|
|
999
1125
|
color: var(--cf-text);
|
|
1126
|
+
text-align: center;
|
|
1000
1127
|
}
|
|
1001
|
-
.cf-form--done svg { width:
|
|
1002
|
-
.cf-form--done {
|
|
1128
|
+
.cf-form--done svg { width: 24px; height: 24px; color: var(--cf-accent); flex-shrink: 0; }
|
|
1129
|
+
.cf-form--done > span { max-width: 28ch; line-height: 1.5; }
|
|
1003
1130
|
.cf-booking__link {
|
|
1004
|
-
display:
|
|
1131
|
+
display: flex;
|
|
1005
1132
|
align-items: center;
|
|
1133
|
+
flex-wrap: wrap;
|
|
1134
|
+
justify-content: center;
|
|
1006
1135
|
gap: 4px;
|
|
1007
1136
|
font-size: 13px;
|
|
1008
1137
|
font-weight: 600;
|
|
@@ -1012,6 +1141,130 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
1012
1141
|
}
|
|
1013
1142
|
.cf-booking__link svg { width: 13px; height: 13px; }
|
|
1014
1143
|
.cf-booking__link:hover { text-decoration: underline; }
|
|
1144
|
+
.cf-booking__url { flex-basis: 100%; overflow-wrap: anywhere; font-size: 11px; font-weight: 400; }
|
|
1145
|
+
.cf-booking__receipt-error { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; line-height: 1.5; color: var(--cf-muted); }
|
|
1146
|
+
.cf-booking__back {
|
|
1147
|
+
flex-basis: 100%;
|
|
1148
|
+
width: fit-content;
|
|
1149
|
+
margin-top: 2px;
|
|
1150
|
+
padding: 7px 11px !important;
|
|
1151
|
+
border: 1px solid var(--cf-border) !important;
|
|
1152
|
+
border-radius: 8px;
|
|
1153
|
+
background: var(--cf-bg) !important;
|
|
1154
|
+
color: var(--cf-text) !important;
|
|
1155
|
+
font-size: 12.5px;
|
|
1156
|
+
font-weight: 650;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
.cf-scheduler-overlay {
|
|
1160
|
+
position: fixed;
|
|
1161
|
+
inset: 0;
|
|
1162
|
+
z-index: 30;
|
|
1163
|
+
display: grid;
|
|
1164
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
1165
|
+
width: 100%;
|
|
1166
|
+
height: 100%;
|
|
1167
|
+
min-width: 0;
|
|
1168
|
+
min-height: 0;
|
|
1169
|
+
overflow: hidden;
|
|
1170
|
+
pointer-events: auto;
|
|
1171
|
+
background: var(--cf-bg);
|
|
1172
|
+
color: var(--cf-text);
|
|
1173
|
+
}
|
|
1174
|
+
.cf-scheduler-overlay__head {
|
|
1175
|
+
display: grid;
|
|
1176
|
+
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
1177
|
+
align-items: center;
|
|
1178
|
+
gap: 12px;
|
|
1179
|
+
min-height: 56px;
|
|
1180
|
+
padding: 8px 14px;
|
|
1181
|
+
border-bottom: 1px solid var(--cf-border);
|
|
1182
|
+
background: var(--cf-bg);
|
|
1183
|
+
}
|
|
1184
|
+
.cf-scheduler-overlay__head strong {
|
|
1185
|
+
overflow: hidden;
|
|
1186
|
+
color: var(--cf-text);
|
|
1187
|
+
font-size: 14px;
|
|
1188
|
+
text-overflow: ellipsis;
|
|
1189
|
+
white-space: nowrap;
|
|
1190
|
+
}
|
|
1191
|
+
.cf-scheduler-overlay__back {
|
|
1192
|
+
justify-self: start;
|
|
1193
|
+
min-height: 34px;
|
|
1194
|
+
padding: 7px 10px !important;
|
|
1195
|
+
border: 1px solid var(--cf-border) !important;
|
|
1196
|
+
border-radius: 8px;
|
|
1197
|
+
background: var(--cf-surface) !important;
|
|
1198
|
+
color: var(--cf-text) !important;
|
|
1199
|
+
font-size: 12.5px;
|
|
1200
|
+
font-weight: 650;
|
|
1201
|
+
}
|
|
1202
|
+
.cf-scheduler-overlay__tools {
|
|
1203
|
+
display: flex;
|
|
1204
|
+
align-items: center;
|
|
1205
|
+
justify-content: flex-end;
|
|
1206
|
+
gap: 8px;
|
|
1207
|
+
min-width: 0;
|
|
1208
|
+
}
|
|
1209
|
+
.cf-scheduler-overlay__tools a {
|
|
1210
|
+
display: inline-flex;
|
|
1211
|
+
align-items: center;
|
|
1212
|
+
gap: 5px;
|
|
1213
|
+
min-height: 34px;
|
|
1214
|
+
padding: 7px 9px;
|
|
1215
|
+
border: 1px solid var(--cf-border);
|
|
1216
|
+
border-radius: 8px;
|
|
1217
|
+
color: var(--cf-text);
|
|
1218
|
+
font-size: 12px;
|
|
1219
|
+
font-weight: 600;
|
|
1220
|
+
text-decoration: none;
|
|
1221
|
+
white-space: nowrap;
|
|
1222
|
+
}
|
|
1223
|
+
.cf-scheduler-overlay__tools a svg { width: 13px; height: 13px; }
|
|
1224
|
+
.cf-scheduler-overlay__tools button {
|
|
1225
|
+
display: inline-grid;
|
|
1226
|
+
place-items: center;
|
|
1227
|
+
flex: 0 0 34px;
|
|
1228
|
+
width: 34px;
|
|
1229
|
+
height: 34px;
|
|
1230
|
+
border: 1px solid var(--cf-border) !important;
|
|
1231
|
+
border-radius: 8px;
|
|
1232
|
+
background: var(--cf-surface) !important;
|
|
1233
|
+
color: var(--cf-muted) !important;
|
|
1234
|
+
}
|
|
1235
|
+
.cf-scheduler-overlay__tools button svg { width: 15px; height: 15px; }
|
|
1236
|
+
.cf-scheduler-overlay__body {
|
|
1237
|
+
position: relative;
|
|
1238
|
+
min-height: 0;
|
|
1239
|
+
background: #ffffff;
|
|
1240
|
+
}
|
|
1241
|
+
.cf-scheduler-overlay__loading {
|
|
1242
|
+
position: absolute;
|
|
1243
|
+
inset: 0;
|
|
1244
|
+
display: grid;
|
|
1245
|
+
place-items: center;
|
|
1246
|
+
color: var(--cf-muted);
|
|
1247
|
+
font-size: 13px;
|
|
1248
|
+
}
|
|
1249
|
+
.cf-scheduler-overlay__frame {
|
|
1250
|
+
position: relative;
|
|
1251
|
+
z-index: 1;
|
|
1252
|
+
display: block;
|
|
1253
|
+
width: 100%;
|
|
1254
|
+
height: 100%;
|
|
1255
|
+
border: 0;
|
|
1256
|
+
background: #ffffff;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
@media (max-width: 520px) {
|
|
1260
|
+
.cf-scheduler-overlay__head {
|
|
1261
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
1262
|
+
gap: 8px;
|
|
1263
|
+
padding-inline: 10px;
|
|
1264
|
+
}
|
|
1265
|
+
.cf-scheduler-overlay__head > strong { display: none; }
|
|
1266
|
+
.cf-scheduler-overlay__tools a { padding-inline: 8px; }
|
|
1267
|
+
}
|
|
1015
1268
|
|
|
1016
1269
|
.cf-handoff {
|
|
1017
1270
|
display: flex;
|
|
@@ -1379,7 +1632,10 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
1379
1632
|
radial-gradient(circle at 18% 0%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 38%),
|
|
1380
1633
|
color-mix(in oklab, var(--cf-bg) 94%, #ffffff);
|
|
1381
1634
|
box-shadow: 0 -10px 34px rgba(15, 23, 42, 0.14);
|
|
1382
|
-
|
|
1635
|
+
/* Do not retain the animation's transform: a transformed ancestor becomes
|
|
1636
|
+
the containing block for the fixed Calendly overlay and clips it to this
|
|
1637
|
+
short drawer instead of the full widget panel. */
|
|
1638
|
+
animation: cf-drawer-up 0.24s cubic-bezier(0.22, 1, 0.36, 1) backwards;
|
|
1383
1639
|
}
|
|
1384
1640
|
.cf-action-drawer__handle {
|
|
1385
1641
|
width: 36px;
|
|
@@ -1434,7 +1690,7 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
1434
1690
|
gap: 8px;
|
|
1435
1691
|
width: 100%;
|
|
1436
1692
|
border: 1px solid var(--cf-border);
|
|
1437
|
-
border-radius:
|
|
1693
|
+
border-radius: 8px;
|
|
1438
1694
|
padding: 7px 8px;
|
|
1439
1695
|
background: color-mix(in oklab, var(--cf-bg-soft) 72%, transparent);
|
|
1440
1696
|
color: var(--cf-text);
|
|
@@ -1462,10 +1718,22 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
1462
1718
|
justify-content: center;
|
|
1463
1719
|
width: 30px;
|
|
1464
1720
|
height: 30px;
|
|
1465
|
-
border-radius:
|
|
1721
|
+
border-radius: 7px;
|
|
1466
1722
|
background: color-mix(in oklab, var(--cf-accent) 14%, transparent);
|
|
1467
1723
|
color: var(--cf-accent);
|
|
1468
1724
|
}
|
|
1725
|
+
.cf-action-card__icon--support {
|
|
1726
|
+
background: color-mix(in oklab, #16a36a 14%, transparent);
|
|
1727
|
+
color: #118354;
|
|
1728
|
+
}
|
|
1729
|
+
.cf-action-card__icon--sales {
|
|
1730
|
+
background: color-mix(in oklab, #2378d4 14%, transparent);
|
|
1731
|
+
color: #1d67b6;
|
|
1732
|
+
}
|
|
1733
|
+
.cf-action-card__icon--marketing {
|
|
1734
|
+
background: color-mix(in oklab, #d88616 16%, transparent);
|
|
1735
|
+
color: #a86208;
|
|
1736
|
+
}
|
|
1469
1737
|
.cf-action-card__icon svg { width: 14px; height: 14px; }
|
|
1470
1738
|
.cf-action-card__copy {
|
|
1471
1739
|
display: grid;
|
|
@@ -2132,6 +2400,25 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
2132
2400
|
box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7);
|
|
2133
2401
|
z-index: 30;
|
|
2134
2402
|
}
|
|
2403
|
+
.cf-call-status,
|
|
2404
|
+
.cf-floating-call-card__status {
|
|
2405
|
+
position: absolute;
|
|
2406
|
+
top: 10px;
|
|
2407
|
+
left: 50%;
|
|
2408
|
+
transform: translateX(-50%);
|
|
2409
|
+
z-index: 30;
|
|
2410
|
+
width: max-content;
|
|
2411
|
+
max-width: calc(100% - 24px);
|
|
2412
|
+
padding: 5px 9px;
|
|
2413
|
+
border-radius: 6px;
|
|
2414
|
+
background: color-mix(in oklab, var(--cf-bg) 94%, transparent);
|
|
2415
|
+
color: var(--cf-text);
|
|
2416
|
+
font-size: 11px;
|
|
2417
|
+
font-weight: 600;
|
|
2418
|
+
line-height: 1.3;
|
|
2419
|
+
text-align: center;
|
|
2420
|
+
pointer-events: none;
|
|
2421
|
+
}
|
|
2135
2422
|
.cf-assistant-card--pinned .cf-call-controls { padding: 4px 6px; gap: 4px; }
|
|
2136
2423
|
.cf-call-btn {
|
|
2137
2424
|
position: relative;
|
|
@@ -2224,6 +2511,10 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
2224
2511
|
box-shadow: 0 18px 45px -20px rgba(0, 0, 0, 0.78);
|
|
2225
2512
|
z-index: 60;
|
|
2226
2513
|
}
|
|
2514
|
+
.cf-call-menu.cf-call-menu--up {
|
|
2515
|
+
top: auto;
|
|
2516
|
+
bottom: calc(100% + 8px);
|
|
2517
|
+
}
|
|
2227
2518
|
.cf-call-menu__label {
|
|
2228
2519
|
margin: 8px 8px 4px;
|
|
2229
2520
|
color: var(--cf-muted);
|
|
@@ -2288,6 +2579,7 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
2288
2579
|
radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.08), transparent 42%);
|
|
2289
2580
|
pointer-events: none;
|
|
2290
2581
|
}
|
|
2582
|
+
.cf-floating-call-card__status { top: 12px; }
|
|
2291
2583
|
.cf-floating-call-card__avatar {
|
|
2292
2584
|
position: absolute;
|
|
2293
2585
|
inset: 0;
|
|
@@ -2569,7 +2861,19 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
2569
2861
|
/* ---------- Attachments ---------- */
|
|
2570
2862
|
.cf-file-input { display: none; }
|
|
2571
2863
|
.cf-iconbtn:disabled { opacity: 0.4; cursor: default; }
|
|
2572
|
-
.cf-attach-row {
|
|
2864
|
+
.cf-attach-row {
|
|
2865
|
+
display: flex;
|
|
2866
|
+
align-items: center;
|
|
2867
|
+
gap: 6px;
|
|
2868
|
+
padding: 0 4px 8px;
|
|
2869
|
+
overflow-x: auto;
|
|
2870
|
+
overscroll-behavior-x: contain;
|
|
2871
|
+
scroll-snap-type: x proximity;
|
|
2872
|
+
scrollbar-width: thin;
|
|
2873
|
+
}
|
|
2874
|
+
.cf-attach-row > * { flex-shrink: 0; scroll-snap-align: start; }
|
|
2875
|
+
.cf-attach-row .cf-attach-chip { max-width: 220px; }
|
|
2876
|
+
.cf-attach-row .cf-attach-status { white-space: nowrap; }
|
|
2573
2877
|
.cf-attach-status { font-size: 12px; color: var(--cf-muted); }
|
|
2574
2878
|
.cf-attach-status--err { color: #f25767; }
|
|
2575
2879
|
.cf-attach-chip {
|
|
@@ -2586,6 +2890,26 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
2586
2890
|
}
|
|
2587
2891
|
.cf-attach-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2588
2892
|
.cf-attach-chip svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--cf-muted); }
|
|
2893
|
+
.cf-attach-row--sent { max-width: 100%; margin-top: 6px; padding: 0 0 2px; }
|
|
2894
|
+
/* Right-aligned without justify-content, so overflowing chips stay scrollable. */
|
|
2895
|
+
.cf-attach-row--sent > :first-child { margin-left: auto; }
|
|
2896
|
+
.cf-attach-chip--open { cursor: pointer; font: inherit; text-align: left; }
|
|
2897
|
+
.cf-attach-chip--open:hover, .cf-attach-open:hover:not(:disabled) { border-color: var(--cf-accent); color: var(--cf-accent); }
|
|
2898
|
+
.cf-attach-chip--open:focus-visible, .cf-attach-open:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 2px; }
|
|
2899
|
+
.cf-attach-open { display: inline-flex; min-width: 0; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
|
|
2900
|
+
.cf-attach-open:disabled { cursor: default; }
|
|
2901
|
+
.cf-preview { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: color-mix(in oklab, #000 55%, transparent); }
|
|
2902
|
+
.cf-preview__frame { display: flex; flex-direction: column; width: 100%; max-width: 720px; height: 100%; max-height: 640px; overflow: hidden; border-radius: 12px; background: var(--cf-surface); border: 1px solid var(--cf-border); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35); }
|
|
2903
|
+
.cf-preview__bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--cf-border); }
|
|
2904
|
+
.cf-preview__name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--cf-text); }
|
|
2905
|
+
.cf-preview__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--cf-border); background: var(--cf-surface-2); color: var(--cf-text); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
|
|
2906
|
+
.cf-preview__btn:hover { border-color: var(--cf-accent); color: var(--cf-accent); }
|
|
2907
|
+
.cf-preview__btn:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 2px; }
|
|
2908
|
+
.cf-preview__close { padding: 0; width: 32px; }
|
|
2909
|
+
.cf-preview__body { display: grid; flex: 1; min-height: 0; place-items: center; overflow: auto; background: var(--cf-surface-2); }
|
|
2910
|
+
.cf-preview__image { max-width: 100%; max-height: 100%; object-fit: contain; }
|
|
2911
|
+
.cf-preview__pdf { width: 100%; height: 100%; border: 0; background: #fff; }
|
|
2912
|
+
.cf-preview__note { margin: 0; padding: 24px; color: var(--cf-muted); font-size: 13px; text-align: center; }
|
|
2589
2913
|
.cf-attach-x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--cf-muted); flex-shrink: 0; }
|
|
2590
2914
|
.cf-attach-x:hover { background: var(--cf-surface); color: var(--cf-text); }
|
|
2591
2915
|
.cf-attach-x svg { width: 11px; height: 11px; }
|
|
@@ -3548,4 +3872,4 @@ ${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,image
|
|
|
3548
3872
|
max-height: calc(100dvh - 24px);
|
|
3549
3873
|
}
|
|
3550
3874
|
}
|
|
3551
|
-
`,
|
|
3875
|
+
`,Ep="centrinfo-widget";class mO extends HTMLElement{constructor(){super(...arguments);se(this,"controls",null);se(this,"composerDraftStore",{value:""})}mountWith(r){const n=gO(r),a=this.shadowRoot??this.attachShadow({mode:"open"});if(this.style.zIndex=String(n.zIndex),"adoptedStyleSheets"in Document.prototype&&typeof CSSStyleSheet<"u"&&typeof CSSStyleSheet.prototype.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(D1),a.adoptedStyleSheets=[o]}else{const o=document.createElement("style");n.styleNonce&&(o.nonce=n.styleNonce),o.textContent=D1,a.appendChild(o)}const i=n.demo?new gw:n.preview?new mw(new ev(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken,n.chatSurface),n.strings):new ev(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken,n.chatSurface);Jp(_(dO,{transport:i,config:n,bindControls:o=>this.controls=o,composerDraftStore:this.composerDraftStore}),a)}open(){this.controls?.open()}close(){this.controls?.close()}toggle(){this.controls?.toggle()}identify(r){this.controls?.identify(r)}clear(){this.controls?.startNew()}shutdown(){this.controls?.shutdown()}unmount(){this.shadowRoot&&Jp(null,this.shadowRoot)}}typeof customElements<"u"&&!customElements.get(Ep)&&customElements.define(Ep,mO);const yO=(t,e=document.body)=>{if(typeof document>"u")throw new Error("[centrinfo-widget] createWidget must run in a browser.");const r=document.createElement(Ep);return r.style.pointerEvents="none",r.style.position="fixed",r.style.inset="0",r.style.width="0",r.style.height="0",e.appendChild(r),r.mountWith(t),{open:()=>r.open(),close:()=>r.close(),toggle:()=>r.toggle(),show:()=>r.open(),hide:()=>r.close(),identify:n=>r.identify(n),update:n=>r.identify(n),clear:()=>r.clear(),shutdown:()=>r.shutdown(),logout:()=>r.shutdown(),destroy:()=>{r.unmount(),r.remove()}}},I1=t=>yO(t);let L1=null;const P1=t=>{L1?.destroy();const e=I1(t);return L1=e,e},_O=t=>t==="light"||t==="dark"||t==="auto"?t:void 0,_s=t=>{if(t==null||t.trim()==="")return;const e=Number(t);return Number.isFinite(e)?e:void 0},bO=t=>{if(t)try{const e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}},xO=t=>{const e=n=>t.getAttribute(n),r=e("data-token");return r?{token:r,apiBaseUrl:e("data-api-base")??void 0,accentColor:e("data-accent")??void 0,agentName:e("data-agent-name")??void 0,agentAvatarUrl:e("data-agent-avatar-url")??void 0,launcherIcon:e("data-launcher-icon")??void 0,gifApiKey:e("data-gif-api-key")??void 0,theme:_O(e("data-theme")),sound:e("data-sound")!=="false",openByDefault:e("data-open")==="true",demo:e("data-demo")==="true",preview:e("data-preview")==="true",alignment:e("data-alignment")==="left"?"left":void 0,horizontalPadding:_s(e("data-horizontal-padding")),verticalPadding:_s(e("data-vertical-padding")),hideDefaultLauncher:e("data-hide-launcher")==="true",styleNonce:(e("data-style-nonce")??t.nonce)||void 0,customLauncherSelector:e("data-custom-launcher-selector")??void 0,sessionDurationMinutes:_s(e("data-session-duration")),configRefreshSeconds:_s(e("data-config-refresh")),proactiveMessage:e("data-proactive-message")??void 0,proactiveDelaySeconds:_s(e("data-proactive-delay")),csat:e("data-csat")==="false"?!1:void 0,user:bO(e("data-user"))}:null},wO=t=>{typeof document>"u"||(document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t,{once:!0}))},SO=()=>{const t=document.currentScript??document.querySelector("script[data-token]");if(!t)return;const e=xO(t);e&&P1(e)};return wO(()=>{try{SO()}catch(t){console.error("[centrinfo-widget]",t)}}),Vr.createWidget=I1,Vr.init=P1,Object.defineProperty(Vr,Symbol.toStringTag,{value:"Module"}),Vr})({});
|