@kong-ui-public/dashboard-renderer 8.2.2 → 8.2.3-pr.2584.b6df8060e.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/dist/{GeoMapRenderer-DZnXCIDi.js → GeoMapRenderer-C93ZFSTu.js} +1 -1
- package/dist/dashboard-renderer.es.js +1 -1
- package/dist/dashboard-renderer.umd.js +69 -4
- package/dist/index-DGMSTd-b.js +37228 -0
- package/dist/style.css +1 -1
- package/dist/types/components/AnalyticsEchartsRenderer.vue.d.ts +20 -0
- package/dist/types/components/AnalyticsEchartsRenderer.vue.d.ts.map +1 -0
- package/dist/types/components/DashboardTile.vue.d.ts +1 -0
- package/dist/types/components/DashboardTile.vue.d.ts.map +1 -1
- package/package.json +8 -7
- package/dist/index-Dqim6Vht.js +0 -4498
|
@@ -1,9 +1,74 @@
|
|
|
1
|
-
(function(v,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/analytics-utilities"),require("@kong-ui-public/analytics-chart"),require("@kong-ui-public/analytics-metric-provider"),require("@kong/icons"),require("@kong-ui-public/analytics-config-store"),require("swrv"),require("axios"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-geo-map")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/analytics-utilities","@kong-ui-public/analytics-chart","@kong-ui-public/analytics-metric-provider","@kong/icons","@kong-ui-public/analytics-config-store","swrv","axios","@kong-ui-public/i18n","@kong-ui-public/analytics-geo-map"],n):(v=typeof globalThis<"u"?globalThis:v||self,n(v["kong-ui-public-dashboard-renderer"]={},v.Vue,v["kong-ui-public-analytics-utilities"],v["kong-ui-public-analytics-chart"],v["kong-ui-public-analytics-metric-provider"],v.KongIcons,v["kong-ui-public-analytics-config-store"],v.swrv,v.axios,v["kong-ui-public-i18n"],v["kong-ui-public-analytics-geo-map"]))})(this,function(v,n,T,ee,Se,he,ye,Nt,$i,Ye,Xe){"use strict";var qi=Object.defineProperty;var xt=v=>{throw TypeError(v)};var Pi=(v,n,T)=>n in v?qi(v,n,{enumerable:!0,configurable:!0,writable:!0,value:T}):v[n]=T;var Ct=(v,n,T)=>Pi(v,typeof n!="symbol"?n+"":n,T),Ke=(v,n,T)=>n.has(v)||xt("Cannot "+T);var b=(v,n,T)=>(Ke(v,n,"read from private field"),T?T.call(v):n.get(v)),B=(v,n,T)=>n.has(v)?xt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(v):n.set(v,T),H=(v,n,T,ee)=>(Ke(v,n,"write to private field"),ee?ee.call(v,T):n.set(v,T),T),P=(v,n,T)=>(Ke(v,n,"access private method"),T);var Re=(v,n,T,ee)=>({set _(Se){H(v,n,Se,T)},get _(){return b(v,n,ee)}});var K,ue,fe,le,ve,me,we,j,ge,F,Ee,Q,pe,ne,xe,He,D,kt,Rt,St,Tt,Dt,Ie,je,Qe,Be,zt,qe;var Ze=(l=>(l.VALIDATING="VALIDATING",l.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",l.PENDING="PENDING",l.SUCCESS="SUCCESS",l.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",l.ERROR="ERROR",l.STALE_IF_ERROR="STALE_IF_ERROR",l))(Ze||{});const Lt=l=>{var e,t,i,s,r;return l?!!((e=Object.keys(l))!=null&&e.length||(t=l.data)!=null&&t.length||(s=(i=l.data)==null?void 0:i.data)!=null&&s.length||!((r=l.data)!=null&&r.data)&&typeof l.data=="object"&&Object.keys(l==null?void 0:l.data).length):!1};function Ot(l=n.ref({}),e,t,i=Lt){const s=n.ref("PENDING");return n.watchEffect(()=>{const r=i(l.value);if(l.value&&r&&t.value){s.value="VALIDATING_HAS_DATA";return}if(l.value&&t.value){s.value="VALIDATING";return}if(l.value&&e.value){s.value="STALE_IF_ERROR";return}if(l.value===void 0&&!e.value){s.value="PENDING";return}if(l.value&&!e.value&&r){s.value="SUCCESS_HAS_DATA";return}if(l.value&&!e.value){s.value="SUCCESS";return}l.value===void 0&&e&&(s.value="ERROR")}),{state:s,swrvState:Ze}}const At={renderer:{noQueryBridge:"No query bridge provided. Unable to render dashboard.",trendRange:{"24h":"Last 24-hour summary","7d":"Last 7-day summary","30d":"Last 30-day summary"},edit:"Edit",duplicateTile:"Duplicate",exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",remove:"Remove",delete:"Delete"},csvExport:{defaultFilename:"Chart export",exportAsCsv:"Export as CSV"},jumpToExplore:"Explore",jumpToRequests:"View requests",query_aged_out_warning:"This tile was configured with {savedGranularity} granularity, which is no longer available. It now shows {currentGranularity} data, the closest available granularity.",granularities:{daily:"1 day",fiveMinutely:"5 minutes",hourly:"1 hour",minutely:"1 minute",tenMinutely:"10 minutes",tenSecondly:"10 seconds",thirtyMinutely:"30 minutes",thirtySecondly:"30 seconds",twelveHourly:"12 hours",twoHourly:"2 hours",weekly:"1 week",unknown:"Unknown"}};function Ht(){const l=Ye.createI18n("en-us",At);return{i18n:l,i18nT:Ye.i18nTComponent(l)}}const ce=170,Pe=6,se="analytics-query-provider",$e="{entity-id}",Je="{cp-id}",et="{timeframe}",tt=30*1e3,it=3e5,st=36e5;function Mt(){const l=n.inject(se);return{evaluateFeatureFlag:(t,i)=>l?l.evaluateFeatureFlagFn(t,i):i}}function It(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var rt={exports:{}};(function(l){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function s(u,d,c){this.fn=u,this.context=d,this.once=c||!1}function r(u,d,c,h,m){if(typeof c!="function")throw new TypeError("The listener must be a function");var g=new s(c,h||u,m),y=t?t+d:d;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],g]:u._events[y].push(g):(u._events[y]=g,u._eventsCount++),u}function a(u,d){--u._eventsCount===0?u._events=new i:delete u._events[d]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],c,h;if(this._eventsCount===0)return d;for(h in c=this._events)e.call(c,h)&&d.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(c)):d},o.prototype.listeners=function(d){var c=t?t+d:d,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,g=h.length,y=new Array(g);m<g;m++)y[m]=h[m].fn;return y},o.prototype.listenerCount=function(d){var c=t?t+d:d,h=this._events[c];return h?h.fn?1:h.length:0},o.prototype.emit=function(d,c,h,m,g,y){var _=t?t+d:d;if(!this._events[_])return!1;var p=this._events[_],C=arguments.length,L,z;if(p.fn){switch(p.once&&this.removeListener(d,p.fn,void 0,!0),C){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,h),!0;case 4:return p.fn.call(p.context,c,h,m),!0;case 5:return p.fn.call(p.context,c,h,m,g),!0;case 6:return p.fn.call(p.context,c,h,m,g,y),!0}for(z=1,L=new Array(C-1);z<C;z++)L[z-1]=arguments[z];p.fn.apply(p.context,L)}else{var Y=p.length,q;for(z=0;z<Y;z++)switch(p[z].once&&this.removeListener(d,p[z].fn,void 0,!0),C){case 1:p[z].fn.call(p[z].context);break;case 2:p[z].fn.call(p[z].context,c);break;case 3:p[z].fn.call(p[z].context,c,h);break;case 4:p[z].fn.call(p[z].context,c,h,m);break;default:if(!L)for(q=1,L=new Array(C-1);q<C;q++)L[q-1]=arguments[q];p[z].fn.apply(p[z].context,L)}}return!0},o.prototype.on=function(d,c,h){return r(this,d,c,h,!1)},o.prototype.once=function(d,c,h){return r(this,d,c,h,!0)},o.prototype.removeListener=function(d,c,h,m){var g=t?t+d:d;if(!this._events[g])return this;if(!c)return a(this,g),this;var y=this._events[g];if(y.fn)y.fn===c&&(!m||y.once)&&(!h||y.context===h)&&a(this,g);else{for(var _=0,p=[],C=y.length;_<C;_++)(y[_].fn!==c||m&&!y[_].once||h&&y[_].context!==h)&&p.push(y[_]);p.length?this._events[g]=p.length===1?p[0]:p:a(this,g)}return this},o.prototype.removeAllListeners=function(d){var c;return d?(c=t?t+d:d,this._events[c]&&a(this,c)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,l.exports=o})(rt);var Bt=rt.exports;const qt=It(Bt);class nt extends Error{constructor(e){super(e),this.name="TimeoutError"}}class Pt extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const ot=l=>globalThis.DOMException===void 0?new Pt(l):new DOMException(l),at=l=>{const e=l.reason===void 0?ot("This operation was aborted."):l.reason;return e instanceof Error?e:ot(e)};function $t(l,e){const{milliseconds:t,fallback:i,message:s,customTimers:r={setTimeout,clearTimeout}}=e;let a,o;const d=new Promise((c,h)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){const{signal:g}=e;g.aborted&&h(at(g)),o=()=>{h(at(g))},g.addEventListener("abort",o,{once:!0})}if(t===Number.POSITIVE_INFINITY){l.then(c,h);return}const m=new nt;a=r.setTimeout.call(void 0,()=>{if(i){try{c(i())}catch(g){h(g)}return}typeof l.cancel=="function"&&l.cancel(),s===!1?c():s instanceof Error?h(s):(m.message=s??`Promise timed out after ${t} milliseconds`,h(m))},t),(async()=>{try{c(await l)}catch(g){h(g)}})()}).finally(()=>{d.clear(),o&&e.signal&&e.signal.removeEventListener("abort",o)});return d.clear=()=>{r.clearTimeout.call(void 0,a),a=void 0},d}function Ft(l,e,t){let i=0,s=l.length;for(;s>0;){const r=Math.trunc(s/2);let a=i+r;t(l[a],e)<=0?(i=++a,s-=r+1):s=r}return i}class Gt{constructor(){B(this,K,[])}enqueue(e,t){t={priority:0,...t};const i={priority:t.priority,id:t.id,run:e};if(this.size===0||b(this,K)[this.size-1].priority>=t.priority){b(this,K).push(i);return}const s=Ft(b(this,K),i,(r,a)=>a.priority-r.priority);b(this,K).splice(s,0,i)}setPriority(e,t){const i=b(this,K).findIndex(r=>r.id===e);if(i===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[s]=b(this,K).splice(i,1);this.enqueue(s.run,{priority:t,id:e})}dequeue(){const e=b(this,K).shift();return e==null?void 0:e.run}filter(e){return b(this,K).filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return b(this,K).length}}K=new WeakMap;class Ut extends qt{constructor(t){var i,s;super();B(this,D);B(this,ue);B(this,fe);B(this,le,0);B(this,ve);B(this,me);B(this,we,0);B(this,j);B(this,ge);B(this,F);B(this,Ee);B(this,Q,0);B(this,pe);B(this,ne);B(this,xe);B(this,He,1n);Ct(this,"timeout");if(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Gt,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${((i=t.intervalCap)==null?void 0:i.toString())??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((s=t.interval)==null?void 0:s.toString())??""}\` (${typeof t.interval})`);H(this,ue,t.carryoverConcurrencyCount),H(this,fe,t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0),H(this,ve,t.intervalCap),H(this,me,t.interval),H(this,F,new t.queueClass),H(this,Ee,t.queueClass),this.concurrency=t.concurrency,this.timeout=t.timeout,H(this,xe,t.throwOnTimeout===!0),H(this,ne,t.autoStart===!1)}get concurrency(){return b(this,pe)}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);H(this,pe,t),P(this,D,Be).call(this)}setPriority(t,i){b(this,F).setPriority(t,i)}async add(t,i={}){return i.id??(i.id=(Re(this,He)._++).toString()),i={timeout:this.timeout,throwOnTimeout:b(this,xe),...i},new Promise((s,r)=>{b(this,F).enqueue(async()=>{var a;Re(this,Q)._++,Re(this,le)._++;try{(a=i.signal)==null||a.throwIfAborted();let o=t({signal:i.signal});i.timeout&&(o=$t(Promise.resolve(o),{milliseconds:i.timeout})),i.signal&&(o=Promise.race([o,P(this,D,zt).call(this,i.signal)]));const u=await o;s(u),this.emit("completed",u)}catch(o){if(o instanceof nt&&!i.throwOnTimeout){s();return}r(o),this.emit("error",o)}finally{P(this,D,St).call(this)}},i),this.emit("add"),P(this,D,Ie).call(this)})}async addAll(t,i){return Promise.all(t.map(async s=>this.add(s,i)))}start(){return b(this,ne)?(H(this,ne,!1),P(this,D,Be).call(this),this):this}pause(){H(this,ne,!0)}clear(){H(this,F,new(b(this,Ee)))}async onEmpty(){b(this,F).size!==0&&await P(this,D,qe).call(this,"empty")}async onSizeLessThan(t){b(this,F).size<t||await P(this,D,qe).call(this,"next",()=>b(this,F).size<t)}async onIdle(){b(this,Q)===0&&b(this,F).size===0||await P(this,D,qe).call(this,"idle")}get size(){return b(this,F).size}sizeBy(t){return b(this,F).filter(t).length}get pending(){return b(this,Q)}get isPaused(){return b(this,ne)}}ue=new WeakMap,fe=new WeakMap,le=new WeakMap,ve=new WeakMap,me=new WeakMap,we=new WeakMap,j=new WeakMap,ge=new WeakMap,F=new WeakMap,Ee=new WeakMap,Q=new WeakMap,pe=new WeakMap,ne=new WeakMap,xe=new WeakMap,He=new WeakMap,D=new WeakSet,kt=function(){return b(this,fe)||b(this,le)<b(this,ve)},Rt=function(){return b(this,Q)<b(this,pe)},St=function(){Re(this,Q)._--,P(this,D,Ie).call(this),this.emit("next")},Tt=function(){P(this,D,Qe).call(this),P(this,D,je).call(this),H(this,ge,void 0)},Dt=function(){const t=Date.now();if(b(this,j)===void 0){const i=b(this,we)-t;if(i<0)H(this,le,b(this,ue)?b(this,Q):0);else return b(this,ge)===void 0&&H(this,ge,setTimeout(()=>{P(this,D,Tt).call(this)},i)),!0}return!1},Ie=function(){if(b(this,F).size===0)return b(this,j)&&clearInterval(b(this,j)),H(this,j,void 0),this.emit("empty"),b(this,Q)===0&&this.emit("idle"),!1;if(!b(this,ne)){const t=!b(this,D,Dt);if(b(this,D,kt)&&b(this,D,Rt)){const i=b(this,F).dequeue();return i?(this.emit("active"),i(),t&&P(this,D,je).call(this),!0):!1}}return!1},je=function(){b(this,fe)||b(this,j)!==void 0||(H(this,j,setInterval(()=>{P(this,D,Qe).call(this)},b(this,me))),H(this,we,Date.now()+b(this,me)))},Qe=function(){b(this,le)===0&&b(this,Q)===0&&b(this,j)&&(clearInterval(b(this,j)),H(this,j,void 0)),H(this,le,b(this,ue)?b(this,Q):0),P(this,D,Be).call(this)},Be=function(){for(;P(this,D,Ie).call(this););},zt=async function(t){return new Promise((i,s)=>{t.addEventListener("abort",()=>{s(t.reason)},{once:!0})})},qe=async function(t,i){return new Promise(s=>{const r=()=>{i&&!i()||(this.off(t,r),s())};this.on(t,r)})};const Wt=()=>{const l=ye.useAnalyticsConfigStore(),e=n.inject(se);if(!e)return;if(e.queryFnOverride){console.warn("Detected incorrect use of useRequestQueue. This composable should not be used in nested components. Please discuss with team-data or report an issue if you feel you have a use case.");return}const t=new Ut({carryoverConcurrencyCount:!0,concurrency:l.maxParallelRequests,interval:l.requestInterval,intervalCap:l.requestIntervalCap}),i={...e,queryFnOverride:!0,queryFn:(s,r)=>t.add(()=>e.queryFn(s,r),{throwOnTimeout:!0})};n.provide(se,i)};function Vt({queryBridge:l,context:e,definition:t,chartData:i}){const s=n.ref(""),r=n.ref(""),a=n.ref(void 0),o=n.ref(void 0),u=ye.useAnalyticsConfigStore();n.onMounted(async()=>{var S,O;s.value=await((S=l==null?void 0:l.exploreBaseUrl)==null?void 0:S.call(l))??"",r.value=await((O=l==null?void 0:l.requestsBaseUrl)==null?void 0:O.call(l))??""});const d=n.computed(()=>u.analytics&&u.percentiles),c=n.computed(()=>!["golden_signals","top_n","gauge"].includes(t.value.chart.type)),h=n.computed(()=>r.value&&t.value.query&&t.value.query.datasource!=="llm_usage"&&d.value),m=n.computed(()=>s.value&&t.value.query&&["basic","api_usage","llm_usage",void 0].includes(t.value.query.datasource)&&d.value),g=n.computed(()=>i.value?T.msToGranularity(i.value.meta.granularity_ms):void 0),y=n.computed(()=>{var U;const S=[...e.value.filters,...t.value.query.filters??[]],O=((U=t.value.query)==null?void 0:U.datasource)??"api_usage";return S.filter(oe=>T.getFieldDataSources(oe.field).some(Ce=>O===Ce))}),_=n.computed(()=>{if(!m.value||!c.value)return"";const S=y.value,O=t.value.query.time_range||e.value.timeSpec,U=Y(O,S);return q(U)}),p=n.computed(()=>{if(!h.value||!c.value)return"";const S=y.value,O=L(t.value.query.time_range||e.value.timeSpec,S);return C(O)}),C=S=>h.value?`${r.value}?q=${JSON.stringify(S)}`:"",L=(S,O)=>{var U,oe;return{filter:O,timeframe:{timePeriodsKey:S.type==="relative"?S.time_range:"custom",start:S.type==="absolute"?(U=i.value)==null?void 0:U.meta.start_ms:void 0,end:S.type==="absolute"?(oe=i.value)==null?void 0:oe.meta.end_ms:void 0}}},z=(S,O)=>({filter:O,timeframe:{timePeriodsKey:S.type==="relative"?S.time_range:"custom",start:S.type==="absolute"?S.start:void 0,end:S.type==="absolute"?S.end:void 0}}),Y=(S,O)=>{const U=t.value.query.dimensions??[];return{filters:O,metrics:t.value.query.metrics??[],dimensions:U,time_range:S,granularity:t.value.query.granularity||g.value}},q=S=>{if(!m.value)return"";const O=["api_usage","llm_usage"].includes(t.value.query.datasource)?t.value.query.datasource:"api_usage";return`${s.value}?q=${JSON.stringify(S)}&d=${O}&c=${t.value.chart.type}`};return n.watch([h,m],([S,O])=>{S&&(a.value={href:""}),O&&(o.value={href:""})}),{exploreLinkKebabMenu:_,requestsLinkKebabMenu:p,canShowKebabMenu:c,canGenerateRequestsLink:h,canGenerateExploreLink:m,requestsLinkZoomActions:a,exploreLinkZoomActions:o,buildExploreQuery:Y,buildRequestsQueryZoomActions:z,buildExploreLink:q,buildRequestLink:C}}const Kt=(l,e,t)=>{const i=[];return e&&i.push(...e),i.push(...T.stripUnknownFilters(l,t)),i};function jt(){const l=n.inject(se),e=new AbortController;return n.onUnmounted(()=>{e.abort()}),{issueQuery:async(i,s,r)=>{if(!l)throw new Error("Query bridge is not defined");const{datasource:a,limit:o,...u}=i,d=a||"basic",c=Kt(d,i.filters,s.filters);let h=i.time_range;h?h.tz||(h={...h,tz:s.tz}):h={...s.timeSpec,tz:s.tz};const m={datasource:d,query:{...u,time_range:h,filters:c,limit:r??o}};return l.queryFn(m,e)}}}function Qt({context:l,globalFilters:e=n.ref([]),isFullscreen:t=n.ref(!1)}){const i=ye.useAnalyticsConfigStore(),s=n.computed(()=>l.value.timeSpec?l.value.timeSpec:{type:"relative",time_range:i.defaultQueryTimeForOrg});return{internalContext:n.computed(()=>{var h,m,g;let{tz:a,refreshInterval:o,editable:u}=l.value;const d=[...l.value.filters??[],...e.value];if(a||(a=new Intl.DateTimeFormat().resolvedOptions().timeZone),o===void 0&&(o=tt),t.value){let y=!1;if(s.value.type==="relative")y=["15m","1h","6h","12h","24h"].includes(s.value.time_range);else{const C=s.value.start.getTime(),L=s.value.end.getTime();y=Math.abs(L-C)<=864e5}const _=new Date().getTime();s.value.type==="absolute"&&s.value.end.getTime()<_||s.value.type==="relative"&&["previous_week","previous_month"].includes(s.value.time_range)?o=0:y?o=it:o=st}u===void 0&&(u=!1);const c=!!((g=(m=(h=n.getCurrentInstance())==null?void 0:h.vnode)==null?void 0:m.props)!=null&&g.onTileTimeRangeZoom);return{filters:d,tz:a,timeSpec:s.value,refreshInterval:o,editable:u,zoomable:c}})}}const re={useContextLinks:Vt,useDashboardInternalContext:Qt,useEvaluateFeatureFlag:Mt,useI18n:Ht,useIssueQuery:jt,useRequestQueue:Wt},Te=n.defineComponent({__name:"QueryDataProvider",props:{context:{},limitOverride:{},query:{},queryReady:{type:Boolean},refreshCounter:{}},emits:["chart-data","queryComplete"],setup(l,{emit:e}){const t=l,i=e,{issueQuery:s}=re.useIssueQuery(),r=n.inject(se),a=()=>t.queryReady&&r?JSON.stringify([t.query,t.context,t.refreshCounter]):null,{data:o,error:u,isValidating:d}=Nt(a,async()=>{try{const _=await s(t.query,t.context,t.limitOverride);return m.value=null,_}catch(_){throw m.value=ee.handleQueryError(_),_}finally{i("queryComplete")}},{refreshInterval:t.context.refreshInterval,revalidateOnFocus:!1,shouldRetryOnError:!1}),{state:c,swrvState:h}=Ot(o,u,d),m=n.ref(null),g=n.computed(()=>c.value===h.ERROR||!!m.value),y=n.computed(()=>!t.queryReady||c.value===h.PENDING);return n.watch([()=>o.value,()=>c.value],([_,p])=>{_&&(p==="SUCCESS_HAS_DATA"||p==="SUCCESS")&&i("chart-data",_)}),(_,p)=>{const C=n.resolveComponent("KSkeleton"),L=n.resolveComponent("KEmptyState");return y.value||!n.unref(o)&&!g.value?(n.openBlock(),n.createBlock(C,{key:0,class:"chart-skeleton",type:"table"})):g.value&&m.value?(n.openBlock(),n.createBlock(L,{key:1,"action-button-visible":!1,"data-testid":"chart-empty-state"},n.createSlots({icon:n.withCtx(()=>[m.value.type==="forbidden"?(n.openBlock(),n.createBlock(n.unref(he.VisibilityOffIcon),{key:0})):(n.openBlock(),n.createBlock(n.unref(he.WarningOutlineIcon),{key:1}))]),title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(m.value.message),1)]),_:2},[m.value.details?{name:"default",fn:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(m.value.details),1)]),key:"0"}:void 0]),1024)):n.unref(o)?n.renderSlot(_.$slots,"default",{key:2,data:n.unref(o)}):n.createCommentVNode("",!0)}}}),Yt=n.defineComponent({__name:"SimpleChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(l){n.useCssVars(i=>({v088169ae:`${i.height}px`}));const e=l,t=n.computed(()=>e.chartOptions.type==="single_value");return(i,s)=>(n.openBlock(),n.createBlock(Te,{context:l.context,query:l.query,"query-ready":l.queryReady,"refresh-counter":l.refreshCounter},{default:n.withCtx(({data:r})=>[n.createElementVNode("div",{class:n.normalizeClass(["analytics-chart",{"single-value":t.value}])},[n.createVNode(n.unref(ee.SimpleChart),{"chart-data":r,"chart-options":l.chartOptions,"synthetics-data-key":t.value?void 0:l.chartOptions.synthetics_data_key},null,8,["chart-data","chart-options","synthetics-data-key"])],2)]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),de=(l,e)=>{const t=l.__vccOpts||l;for(const[i,s]of e)t[i]=s;return t},lt=de(Yt,[["__scopeId","data-v-1e9ff912"]]),Xt={class:"analytics-chart"},Fe=de(n.defineComponent({__name:"BaseAnalyticsChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{},extraProps:{}},emits:["edit-tile","chart-data","zoom-time-range","view-requests","select-chart-range"],setup(l,{emit:e}){const t=l,i=e,{i18n:s}=re.useI18n(),r=n.computed(()=>({type:t.chartOptions.type,stacked:t.chartOptions.stacked??!1,chartDatasetColors:t.chartOptions.chart_dataset_colors,threshold:t.chartOptions.threshold,hideTruncationWarning:t.query.limit!==void 0&&t.query.limit>0})),a=n.computed(()=>t.context.zoomable),o=()=>{i("edit-tile")},u=d=>{i("chart-data",d)};return(d,c)=>{const h=n.resolveComponent("KDropdownItem");return n.openBlock(),n.createBlock(Te,{context:l.context,query:l.query,"query-ready":l.queryReady,"refresh-counter":l.refreshCounter,onChartData:u},{default:n.withCtx(({data:m})=>[n.createElementVNode("div",Xt,[n.createVNode(n.unref(ee.AnalyticsChart),n.mergeProps({"chart-data":m,"chart-options":r.value,"explore-link":l.exploreLink,"legend-position":"bottom","requests-link":l.requestsLink,"synthetics-data-key":l.chartOptions.synthetics_data_key,"timeseries-zoom":a.value,"tooltip-title":""},l.extraProps,{onSelectChartRange:c[0]||(c[0]=g=>i("select-chart-range",g)),onZoomTimeRange:c[1]||(c[1]=g=>i("zoom-time-range",g))}),n.createSlots({_:2},[l.context.editable?{name:"menu-items",fn:n.withCtx(()=>[n.createVNode(h,{onClick:o},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.edit")),1)]),_:1})]),key:"0"}:void 0]),1040,["chart-data","chart-options","explore-link","requests-link","synthetics-data-key","timeseries-zoom"])])]),_:1},8,["context","query","query-ready","refresh-counter"])}}}),[["__scopeId","data-v-52357845"]]),ht=n.defineComponent({__name:"BarChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(l){return(e,t)=>(n.openBlock(),n.createBlock(Fe,{"chart-options":l.chartOptions,context:l.context,"extra-props":{showAnnotations:!1},height:l.height,query:l.query,"query-ready":l.queryReady,"refresh-counter":l.refreshCounter},null,8,["chart-options","context","height","query","query-ready","refresh-counter"]))}}),dt=n.defineComponent({__name:"TimeseriesChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},emits:["zoom-time-range","select-chart-range"],setup(l,{emit:e}){const t=e;return(i,s)=>(n.openBlock(),n.createBlock(Fe,{"chart-options":l.chartOptions,context:l.context,"explore-link":l.exploreLink,height:l.height,query:l.query,"query-ready":l.queryReady,"refresh-counter":l.refreshCounter,"requests-link":l.requestsLink,onSelectChartRange:s[0]||(s[0]=r=>t("select-chart-range",r)),onZoomTimeRange:s[1]||(s[1]=r=>t("zoom-time-range",r))},null,8,["chart-options","context","explore-link","height","query","query-ready","refresh-counter","requests-link"]))}}),Zt={class:"metric-card-tile-wrapper"},Jt=de(n.defineComponent({__name:"GoldenSignalsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(l){const e=l,t=n.computed(()=>{var s,r;const i=(s=e.query)==null?void 0:s.datasource;if(i&&i!=="api_usage"&&i!=="basic")throw new Error(`Invalid datasource value: ${i}`);return{datasource:(r=e.query)==null?void 0:r.datasource,overrideTimeRange:e.context.timeSpec,tz:e.context.tz,additionalFilter:e.context.filters,longCardTitles:e.chartOptions.long_card_titles,percentileLatency:e.chartOptions.percentile_latency,refreshInterval:e.context.refreshInterval,queryReady:e.queryReady,refreshCounter:e.refreshCounter}});return(i,s)=>(n.openBlock(),n.createElementBlock("div",Zt,[n.createVNode(n.unref(Se.MetricsProvider),n.normalizeProps(n.guardReactiveProps(t.value)),{default:n.withCtx(()=>[n.createVNode(n.unref(Se.MetricsConsumer))]),_:1},16)]))}}),[["__scopeId","data-v-86bb2448"]]),ei={class:"fallback-entity-link","data-testid":"entity-link-parent"},ct=n.defineComponent({__name:"FallbackEntityLink",props:{entityLinkData:{}},setup(l){return(e,t)=>(n.openBlock(),n.createElementBlock("div",ei,n.toDisplayString(l.entityLinkData.label),1))}}),ti=n.defineComponent({__name:"TopNTableRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(l){const e=l,t=n.inject(se),i=n.defineAsyncComponent(async()=>{if(t!=null&&t.fetchComponent)try{return await t.fetchComponent("EntityLink")}catch{return ct}return ct}),s=r=>{var a;if((a=e.chartOptions)!=null&&a.entity_link)if(r.id.includes(":")){const[o,u]=r.id.split(":");return e.chartOptions.entity_link.replace(Je,o).replace($e,u)}else return e.chartOptions.entity_link.replace($e,r.id);return""};return(r,a)=>(n.openBlock(),n.createBlock(Te,{context:l.context,query:l.query,"query-ready":l.queryReady,"refresh-counter":l.refreshCounter},{default:n.withCtx(({data:o})=>[n.createVNode(n.unref(ee.TopNTable),{data:o,"synthetics-data-key":l.chartOptions.synthetics_data_key},n.createSlots({_:2},[e.chartOptions.entity_link?{name:"name",fn:n.withCtx(({record:u})=>[n.createVNode(n.unref(i),{"entity-link-data":{id:u.id,label:u.name,deleted:u.deleted},"external-link":s(u)},null,8,["entity-link-data","external-link"])]),key:"0"}:void 0]),1032,["data","synthetics-data-key"])]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),ut="#6c7489",ii="12px",ft="20px",mt="32px",gt="20px",si=n.defineComponent({__name:"DonutChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(l){return(e,t)=>(n.openBlock(),n.createBlock(Fe,{"chart-options":l.chartOptions,context:l.context,height:l.height,query:l.query,"query-ready":l.queryReady,"refresh-counter":l.refreshCounter},null,8,["chart-options","context","height","query","query-ready","refresh-counter"]))}}),ri=["data-testid"],ni={key:0,class:"tile-header"},oi={class:"badge-container"},ai={class:"badge-text"},li={key:0},hi=["data-testid"],di=["data-testid"],ci={class:"delete-option"},ui=["data-testid"],fi=["data-testid"],pt=de(n.defineComponent({__name:"DashboardTile",props:n.mergeModels({context:{},definition:{},height:{default:ce},isFullscreen:{type:Boolean},hideActions:{type:Boolean,default:!1},queryReady:{type:Boolean},showRefresh:{type:Boolean,default:!1},tileId:{}},{refreshCounter:{default:0},refreshCounterModifiers:{}}),emits:n.mergeModels(["edit-tile","duplicate-tile","remove-tile","tile-time-range-zoom","tile-bounds-change"],["update:refreshCounter"]),setup(l,{emit:e}){n.useCssVars(E=>({v47039fac:`${E.height}px`}));const t=parseInt(gt,10),i=l,s=n.useModel(l,"refreshCounter"),r=()=>{_.value=!0,s.value++},a=e,o=n.defineAsyncComponent(()=>Promise.resolve().then(()=>Ri)),u=n.inject(se),{i18n:d}=re.useI18n(),c=n.ref(),h=n.ref({status:"loading"}),m=n.ref(!1),g=n.ref(),y=n.ref(!1),_=n.ref(!0),{exploreLinkKebabMenu:p,requestsLinkKebabMenu:C,canShowKebabMenu:L,canGenerateRequestsLink:z,canGenerateExploreLink:Y,requestsLinkZoomActions:q,exploreLinkZoomActions:S,buildExploreQuery:O,buildExploreLink:U,buildRequestLink:oe,buildRequestsQueryZoomActions:Z}=re.useContextLinks({queryBridge:u,chartData:n.readonly(c),definition:n.readonly(n.toRef(i,"definition")),context:n.readonly(n.toRef(i,"context"))}),{issueQuery:Ce}=re.useIssueQuery();n.watch(()=>i.definition,async(E,R)=>{await n.nextTick(),g.value&&(y.value=g.value.scrollWidth>g.value.clientWidth);try{JSON.stringify(E==null?void 0:E.query)!==JSON.stringify(R==null?void 0:R.query)&&(_.value=!0)}catch{}},{immediate:!0,deep:!0});const We=n.computed(()=>d.t("csvExport.defaultFilename")),Me=n.computed(()=>L.value&&!i.hideActions&&(k.value||i.context.editable)),k=n.computed(()=>!!p.value||("allow_csv_export"in i.definition.chart?i.definition.chart.allow_csv_export:!0)||i.context.editable),A={timeseries_line:dt,timeseries_bar:dt,horizontal_bar:ht,vertical_bar:ht,gauge:lt,donut:si,golden_signals:Jt,top_n:ti,slottable:void 0,single_value:lt,choropleth_map:o},I=n.computed(()=>{var E,R,N;return{...(E=M.value)!=null&&E.rendererEvents.supportsRequests?{"select-chart-range":Bi}:{},...(R=M.value)!=null&&R.rendererEvents.supportsZoom?{"zoom-time-range":Mi}:{},...(N=M.value)!=null&&N.rendererEvents.supportsBounds?{"bounds-change":Ii}:{}}}),M=n.computed(()=>{var J,ae;const E=A[i.definition.chart.type],R=!!((J=E==null?void 0:E.emits)!=null&&J.includes("select-chart-range")),N=!!((ae=E==null?void 0:E.emits)!=null&&ae.includes("zoom-time-range")),V=i.definition.chart.type==="choropleth_map";return E&&{component:E,rendererProps:{query:i.definition.query,context:i.context,queryReady:i.queryReady,chartOptions:i.definition.chart,height:i.height-t*2,refreshCounter:s.value,requestsLink:q.value,exploreLink:S.value},rendererEvents:{supportsRequests:R,supportsZoom:N,supportsBounds:V}}}),W=n.computed(()=>{var R;const E=(R=i.definition.query)==null?void 0:R.time_range;if((E==null?void 0:E.type)==="relative"){const N=T.TimePeriods.get(T.TIMEFRAME_LOOKUP[E.time_range]);return N?N.display:(console.warn("Did not recognize the given relative time range:",E.time_range),E.time_range)}else if((E==null?void 0:E.type)==="absolute"){const N=E.tz||"Etc/UTC";return`${T.formatTime(E.start,{short:!0,tz:N})} - ${T.formatTime(E.end,{short:!0,tz:N})}`}return null}),ke=n.computed(()=>{if(i.definition.chart.type==="slottable")return!1;const E=!!i.definition.chart.chart_title,R=i.definition.chart.type==="golden_signals"&&!!i.definition.chart.description,N=i.showRefresh,V=Me.value&&k.value&&!i.isFullscreen,J=!!W.value;return E||V||J||R||N}),wt=n.computed(()=>c.value?T.msToGranularity(c.value.meta.granularity_ms):void 0),Si=n.computed(()=>["timeseries_line","timeseries_bar"].includes(i.definition.chart.type)),Et=n.computed(()=>{var R,N;if(!Si.value||!i.queryReady||_.value)return!1;const E=(N=(R=i.definition)==null?void 0:R.query)==null?void 0:N.granularity;return!E||!wt.value?!1:E!==wt.value}),Ti=n.computed(()=>{var N,V,J;const E=T.msToGranularity(((N=c.value)==null?void 0:N.meta.granularity_ms)??0)??"unknown",R=((J=(V=i.definition)==null?void 0:V.query)==null?void 0:J.granularity)??"unknown";return d.t("query_aged_out_warning",{currentGranularity:d.t(`granularities.${E}`),savedGranularity:d.t(`granularities.${R}`)})}),Di=n.computed(()=>{var N,V;const E=[...i.context.filters,...i.definition.query.filters??[]],R=((V=(N=i.definition)==null?void 0:N.query)==null?void 0:V.datasource)??"api_usage";return E.filter(J=>T.getFieldDataSources(J.field).some(Ve=>R===Ve))}),zi=()=>{a("edit-tile",i.definition)},Ni=()=>{a("duplicate-tile",i.definition)},Li=()=>{a("remove-tile",i.definition)},Oi=E=>{c.value=E,_.value=!1},Ai=()=>{m.value=!1},Hi=async()=>{var E;if(m.value=!0,h.value={status:"loading"},((E=u==null?void 0:u.staticConfig)==null?void 0:E.increaseCsvExportLimit)??!0)Ce(i.definition.query,i.context,T.EXPORT_RECORD_LIMIT).then(R=>{h.value={status:"success",chartData:R}}).catch(R=>{h.value={status:"error",error:R}});else if(c.value)h.value={status:"success",chartData:c.value};else{const R=n.watch(c,N=>{N&&(h.value={status:"success",chartData:N},R())})}},Mi=E=>{const R={tileId:i.tileId.toString(),timeRange:E};a("tile-time-range-zoom",R)},Ii=E=>{const R={tileId:i.tileId.toString(),bounds:E};a("tile-bounds-change",R)},Bi=E=>{const R=Di.value,N=Z(E,R),V=O(E,R);q.value=z.value?{href:oe(N)}:void 0,S.value=Y.value?{href:U(V)}:void 0};return(E,R)=>{const N=n.resolveComponent("KTooltip"),V=n.resolveComponent("KBadge"),J=n.resolveComponent("KButton"),ae=n.resolveComponent("KDropdownItem"),Ve=n.resolveComponent("KDropdown");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["tile-boundary",{editable:l.context.editable,headless:!ke.value}]),"data-testid":`tile-${l.tileId}`},[ke.value&&l.definition.chart.type!=="slottable"?(n.openBlock(),n.createElementBlock("div",ni,[n.createVNode(N,{class:"title-tooltip",disabled:!y.value,"max-width":"500",text:l.definition.chart.chart_title},{default:n.withCtx(()=>[n.createElementVNode("div",{ref_key:"titleRef",ref:g,class:"title"},n.toDisplayString(l.definition.chart.chart_title),513)]),_:1},8,["disabled","text"]),n.createElementVNode("div",oi,[W.value?(n.openBlock(),n.createBlock(V,{key:0,"data-testid":"time-range-badge",tooltip:Et.value?Ti.value:void 0,"tooltip-attributes":{maxWidth:"320px"}},n.createSlots({default:n.withCtx(()=>[n.createElementVNode("span",ai,n.toDisplayString(W.value),1)]),_:2},[Et.value?{name:"icon",fn:n.withCtx(()=>[n.createVNode(n.unref(he.WarningIcon),{size:n.unref(ii)},null,8,["size"])]),key:"0"}:void 0]),1032,["tooltip"])):n.createCommentVNode("",!0)]),l.showRefresh?(n.openBlock(),n.createElementBlock("div",li,[n.createVNode(J,{appearance:"secondary",class:"refresh-button",disabled:_.value,icon:"",size:"small",onClick:r},{default:n.withCtx(()=>[_.value?(n.openBlock(),n.createBlock(n.unref(he.ProgressIcon),{key:0,role:"button",size:n.unref(mt),tabindex:"0"},null,8,["size"])):(n.openBlock(),n.createBlock(n.unref(he.RefreshIcon),{key:1,role:"button",size:n.unref(mt),tabindex:"0"},null,8,["size"]))]),_:1},8,["disabled"])])):n.createCommentVNode("",!0),Me.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"tile-actions","data-testid":`tile-actions-${l.tileId}`},[n.unref(L)&&l.context.editable&&!l.isFullscreen?(n.openBlock(),n.createBlock(n.unref(he.EditIcon),{key:0,class:"edit-icon",color:n.unref(ut),"data-testid":`edit-tile-${l.tileId}`,size:n.unref(ft),onClick:zi},null,8,["color","data-testid","size"])):n.createCommentVNode("",!0),n.unref(L)&&k.value&&!l.isFullscreen?(n.openBlock(),n.createBlock(Ve,{key:1,class:"dropdown","data-testid":`chart-action-menu-${l.tileId}`,"kpop-attributes":{placement:"bottom-end"}},{items:n.withCtx(()=>[n.unref(p)?(n.openBlock(),n.createBlock(ae,{key:0,"data-testid":`chart-jump-to-explore-${l.tileId}`,item:{label:n.unref(d).t("jumpToExplore"),to:n.unref(p)}},null,8,["data-testid","item"])):n.createCommentVNode("",!0),n.unref(C)?(n.openBlock(),n.createBlock(ae,{key:1,"data-testid":`chart-jump-to-requests-${l.tileId}`,item:{label:n.unref(d).t("jumpToRequests"),to:n.unref(C)}},null,8,["data-testid","item"])):n.createCommentVNode("",!0),!("allow_csv_export"in l.definition.chart)||l.definition.chart.allow_csv_export?(n.openBlock(),n.createBlock(ae,{key:2,class:"chart-export-button","data-testid":`chart-csv-export-${l.tileId}`,onClick:Hi},{default:n.withCtx(()=>[n.createElementVNode("span",{class:"chart-export-trigger","data-testid":`csv-export-button-${l.tileId}`},n.toDisplayString(n.unref(d).t("csvExport.exportAsCsv")),9,di)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0),l.context.editable?(n.openBlock(),n.createBlock(ae,{key:3,"data-testid":`duplicate-tile-${l.tileId}`,onClick:Ni},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(d).t("renderer.duplicateTile")),1)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0),l.context.editable?(n.openBlock(),n.createBlock(ae,{key:4,"data-testid":`remove-tile-${l.tileId}`,onClick:Li},{default:n.withCtx(()=>[n.createElementVNode("span",ci,n.toDisplayString(n.unref(d).t("renderer.delete")),1)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(he.MoreIcon),{class:"kebab-action-menu",color:n.unref(ut),"data-testid":`kebab-action-menu-${l.tileId}`,size:n.unref(ft)},null,8,["color","data-testid","size"])]),_:1},8,["data-testid"])):n.createCommentVNode("",!0)],8,hi)):"description"in l.definition.chart?(n.openBlock(),n.createElementBlock("div",{key:2,class:"header-description","data-testid":`tile-description-${l.tileId}`},n.toDisplayString(l.definition.chart.description),9,ui)):n.createCommentVNode("",!0),m.value?(n.openBlock(),n.createBlock(n.unref(ee.CsvExportModal),{key:3,"data-testid":`csv-export-modal-${l.tileId}`,"export-state":h.value,filename:We.value,onCloseModal:Ai},null,8,["data-testid","export-state","filename"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["tile-content",`type-${l.definition.chart.type}`]),"data-testid":`tile-content-${l.tileId}`},[M.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(M.value.component),n.mergeProps({key:0},M.value.rendererProps,n.toHandlers(I.value),{onChartData:Oi}),null,16)):n.createCommentVNode("",!0)],10,fi)],10,ri)}}}),[["__scopeId","data-v-139d64e3"]]),mi=(l,e)=>{let t=0;const i=new Map;e.forEach(r=>{const a=r.layout.position.row,o=i.get(a),u=r.layout.size.rows===1&&!!r.layout.size.fit_to_content;t=Math.max(t,a+r.layout.size.rows),o===void 0?i.set(a,u):i.set(a,o&&u)});const s=[];for(let r=0;r<t;r++)i.get(r)?s.push("auto"):s.push(`${l}px`);return s},yt=de(n.defineComponent({__name:"GridLayout",props:{tileHeight:{type:Number,required:!1,default:()=>ce},tiles:{type:Array,required:!0}},setup(l){n.useCssVars(o=>({v2a38e79e:n.unref(Pe),v4cc71de6:r.value}));const e=l,t=n.ref(null),i=n.ref(0),s=new ResizeObserver(o=>{window.requestAnimationFrame(()=>{!Array.isArray(o)||!o.length||(i.value=o[0].contentRect.width)})});n.onMounted(()=>{t.value&&s.observe(t.value)}),n.onUnmounted(()=>{t.value&&s.unobserve(t.value)});const r=n.computed(()=>mi(e.tileHeight,e.tiles).join(" ")),a=n.computed(()=>e.tiles.map((o,u)=>({key:`tile-${u}`,tile:o,style:{"grid-column-start":o.layout.position.col+1,"grid-column-end":o.layout.position.col+1+o.layout.size.cols,"grid-row-start":o.layout.position.row+1,"grid-row-end":o.layout.position.row+1+o.layout.size.rows}})));return(o,u)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"gridContainer",ref:t,class:"kong-ui-public-grid-layout"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,d=>(n.openBlock(),n.createElementBlock("div",{key:d.key,class:n.normalizeClass(["grid-cell",{"empty-cell":!d.tile}]),style:n.normalizeStyle(d.style)},[n.renderSlot(o.$slots,"tile",{style:n.normalizeStyle(d.style),tile:d.tile},void 0,!0)],6))),128))],512))}}),[["__scopeId","data-v-354b7177"]]);function gi(l,e,t,i,s){const r=(...a)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(l,a));return r.prototype=e.prototype,r}class f{static getElements(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const r=i.getElementById(e);return r?[r]:[]}let s=t.querySelectorAll(e);return!s.length&&e[0]!=="."&&e[0]!=="#"&&(s=t.querySelectorAll("."+e),s.length||(s=t.querySelectorAll("#"+e))),Array.from(s)}return[e]}static getElement(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(!e.length)return null;if(i&&e[0]==="#")return i.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return t.querySelector(e);if(i&&!isNaN(+e[0]))return i.getElementById(e);let s=t.querySelector(e);return i&&!s&&(s=i.getElementById(e)),s||(s=t.querySelector("."+e)),s}return e}static lazyLoad(e){var t,i;return e.lazyLoad||((i=(t=e.grid)==null?void 0:t.opts)==null?void 0:i.lazyLoad)&&e.lazyLoad!==!1}static createDiv(e,t){const i=document.createElement("div");return e.forEach(s=>{s&&i.classList.add(s)}),t==null||t.appendChild(i),i}static shouldSizeToContent(e,t=!1){return(e==null?void 0:e.grid)&&(t?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return f.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){const i=e.x>t.x?e.x:t.x,s=e.x+e.w<t.x+t.w?e.x+e.w:t.x+t.w;if(s<=i)return 0;const r=e.y>t.y?e.y:t.y,a=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return a<=r?0:(s-i)*(a-r)}static area(e){return e.w*e.h}static sort(e,t=1){return e.sort((s,r)=>{const a=t*((s.y??1e4)-(r.y??1e4));return a===0?t*((s.x??1e4)-(r.x??1e4)):a})}static find(e,t){return t?e.find(i=>i.id===t):void 0}static createStylesheet(e,t,i){const s=document.createElement("style"),r=i==null?void 0:i.nonce;return r&&(s.nonce=r),s.setAttribute("type","text/css"),s.setAttribute("gs-style-id",e),s.styleSheet?s.styleSheet.cssText="":s.appendChild(document.createTextNode("")),t?t.insertBefore(s,t.firstChild):(t=document.getElementsByTagName("head")[0],t.appendChild(s)),s}static removeStylesheet(e,t){const s=(t||document).querySelector("STYLE[gs-style-id="+e+"]");s&&s.parentNode&&s.remove()}static addCSSRule(e,t,i){e.textContent+=`${t} { ${i} } `}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let t,i="px";if(typeof e=="string")if(e==="auto"||e==="")t=0;else{const s=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!s)throw new Error(`Invalid height val = ${e}`);i=s[2]||"px",t=parseFloat(s[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(const s in i){if(!i.hasOwnProperty(s))return;e[s]===null||e[s]===void 0?e[s]=i[s]:typeof i[s]=="object"&&typeof e[s]=="object"&&this.defaults(e[s],i[s])}}),e}static same(e,t){if(typeof e!="object")return e==t;if(typeof e!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}static copyPos(e,t,i=!1){return t.x!==void 0&&(e.x=t.x),t.y!==void 0&&(e.y=t.y),t.w!==void 0&&(e.w=t.w),t.h!==void 0&&(e.h=t.h),i&&(t.minW&&(e.minW=t.minW),t.minH&&(e.minH=t.minH),t.maxW&&(e.maxW=t.maxW),t.maxH&&(e.maxH=t.maxH)),e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&(e.w||1)===(t.w||1)&&(e.h||1)===(t.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,t){if(!(typeof e!="object"||typeof t!="object"))for(let i in e){const s=e[i],r=t[i];i[0]==="_"||s===r?delete e[i]:s&&typeof s=="object"&&r!==void 0&&(f.removeInternalAndSame(s,r),Object.keys(s).length||delete e[i])}}static removeInternalForSave(e,t=!0){for(let i in e)(i[0]==="_"||e[i]===null||e[i]===void 0)&&delete e[i];delete e.grid,t&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,t){let i=!1;return(...s)=>{i||(i=!0,setTimeout(()=>{e(...s),i=!1},t))}}static removePositioningStyles(e){const t=e.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const t=getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowY)?e:this.getScrollElement(e.parentElement)}static updateScrollPosition(e,t,i){const s=e.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>r){const a=s.bottom-r,o=s.top,u=this.getScrollElement(e);if(u!==null){const d=u.scrollTop;s.top<0&&i<0?e.offsetHeight>r?u.scrollTop+=i:u.scrollTop+=Math.abs(o)>Math.abs(i)?i:o:i>0&&(e.offsetHeight>r?u.scrollTop+=i:u.scrollTop+=a>i?i:a),t.top+=u.scrollTop-d}}}static updateScrollResize(e,t,i){const s=this.getScrollElement(t),r=s.clientHeight,a=s===this.getScrollElement()?0:s.getBoundingClientRect().top,o=e.clientY-a,u=o<i,d=o>r-i;u?s.scrollBy({behavior:"smooth",top:o-i}):d&&s.scrollBy({behavior:"smooth",top:i-(r-o)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const t=["parentGrid","el","grid","subGrid","engine"],i=f.clone(e);for(const s in i)i.hasOwnProperty(s)&&typeof i[s]=="object"&&s.substring(0,2)!=="__"&&!t.find(r=>r===s)&&(i[s]=f.cloneDeep(e[s]));return i}static cloneNode(e){const t=e.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(e,t){let i;typeof t=="string"?i=f.getElement(t):i=t,i&&i.appendChild(e)}static addElStyles(e,t){if(t instanceof Object)for(const i in t)t.hasOwnProperty(i)&&(Array.isArray(t[i])?t[i].forEach(s=>{e.style[i]=s}):e.style[i]=t[i])}static initEvent(e,t){const i={type:t.type},s={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(r=>i[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>i[r]=e[r]),{...i,...s}}static simulateMouseEvent(e,t,i){const s=e,r=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:s.ctrlKey??!1,altKey:s.altKey??!1,shiftKey:s.shiftKey??!1,metaKey:s.metaKey??!1,button:0,relatedTarget:e.target});(i||e.target).dispatchEvent(r)}static getValuesFromTransformedElement(e){const t=document.createElement("div");f.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(t);const i=t.getBoundingClientRect();return e.removeChild(t),t.remove(),{xScale:1/i.width,yScale:1/i.height,xOffset:i.left,yOffset:i.top}}static swap(e,t,i){if(!e)return;const s=e[t];e[t]=e[i],e[i]=s}static canBeRotated(e){var t;return!(!e||e.w===e.h||e.locked||e.noResize||(t=e.grid)!=null&&t.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}}class te{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,s={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!s.nested&&!this.float&&this.swap(e,i))return!0;let r=t;!this._loading&&this._useEntireRowArea(e,t)&&(r={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,r,s.skip));let a=!1;const o={nested:!0,pack:!1};let u=0;for(;i=i||this.collide(e,r,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let d;if(i.locked||this._loading||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,{...i,y:e.y},e)||!this.collide(i,{...i,y:t.y-i.h},e))){e._skipDown=e._skipDown||t.y>e.y;const c={...t,y:i.y+i.h,...o};d=this._loading&&f.samePos(e,c)?!0:this.moveNode(e,c),(i.locked||this._loading)&&d?f.copyPos(t,e):!i.locked&&d&&s.pack&&(this._packNodes(),t.y=i.y+i.h,f.copyPos(e,t)),a=a||d}else d=this.moveNode(i,{...i,y:t.y+t.h,skip:e,...o});if(!d)return a;i=void 0}return a}collide(e,t=e,i){const s=e._id,r=i==null?void 0:i._id;return this.nodes.find(a=>a._id!==s&&a._id!==r&&f.isIntercepted(a,t))}collideAll(e,t=e,i){const s=e._id,r=i==null?void 0:i._id;return this.nodes.filter(a=>a._id!==s&&a._id!==r&&f.isIntercepted(a,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;const s=e._rect,r={...t.rect};r.y>s.y?(r.h+=r.y-s.y,r.y=s.y):r.h+=s.y-r.y,r.x>s.x?(r.w+=r.x-s.x,r.x=s.x):r.w+=s.x-r.x;let a,o=.5;for(let u of i){if(u.locked||!u._rect)break;const d=u._rect;let c=Number.MAX_VALUE,h=Number.MAX_VALUE;s.y<d.y?c=(r.y+r.h-d.y)/d.h:s.y+s.h>d.y+d.h&&(c=(d.y+d.h-r.y)/d.h),s.x<d.x?h=(r.x+r.w-d.x)/d.w:s.x+s.w>d.x+d.w&&(h=(d.x+d.w-r.x)/d.w);const m=Math.min(h,c);m>o&&(o=m,a=u)}return t.collide=a,a}cacheRects(e,t,i,s,r,a){return this.nodes.forEach(o=>o._rect={y:o.y*t+i,x:o.x*e+a,w:o.w*e-a-s,h:o.h*t-i-r}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){const r=t.x,a=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=r,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=a):(e.x=r,e.y=a),e._dirty=t._dirty=!0,!0}let s;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(s=f.isTouching(e,t)))return i();if(s!==!1){if(e.w===t.w&&e.x===t.x&&(s||(s=f.isTouching(e,t)))){if(t.y<e.y){const r=e;e=t,t=r}return i()}if(s!==!1){if(e.h===t.h&&e.y===t.y&&(s||(s=f.isTouching(e,t)))){if(t.x<e.x){const r=e;e=t,t=r}return i()}return!1}}}isAreaEmpty(e,t,i,s){const r={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(r)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();const i=this.batchMode;i||this.batchUpdate();const s=this._inColumnResize;s||(this._inColumnResize=!0);const r=this.nodes;return this.nodes=[],r.forEach((a,o,u)=>{let d;a.locked||(a.autoPosition=!0,e==="list"&&o&&(d=u[o-1])),this.addNode(a,!1,d)}),s||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=f.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){const i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){e._id=e._id??te._idSeq++;const i=e.id;if(i){let r=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=i+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const s={x:0,y:0,w:1,h:1};return f.defaults(e,s),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,f.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=s.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=s.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=s.w),isNaN(e.h)&&(e.h=s.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){const i=e._orig||f.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id&&this.findCacheLayout(e,this.defaultColumn)===-1){const r={...e};r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(this.defaultColumn-1,r.x),r.w=Math.min(this.defaultColumn,r.w||1),this.cacheOneLayout(r,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),f.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!f.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=f.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||f.samePos(e,e._orig)||(f.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,s){const r=s?s.y*i+(s.x+s.w):0;let a=!1;for(let o=r;!a;++o){const u=o%i,d=Math.floor(o/i);if(u+e.w>i)continue;const c={x:u,y:d,w:e.w,h:e.h};t.find(h=>f.isIntercepted(c,h))||((e.x!==u||e.y!==d)&&(e._dirty=!0),e.x=u,e.y=d,delete e.autoPosition,a=!0)}return a}addNode(e,t=!1,i){const s=this.nodes.find(a=>a._id===e._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,r=!0),this.nodes.push(e),t&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(s=>s._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(s=>s._removeDOM=!0);const i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i;const s=new te({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(i={...a},i):{...a})});if(!i)return!1;const r=s.moveNode(i,t)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!t.resizing&&t.collide){const a=t.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return r?(s.nodes.filter(a=>a._dirty).forEach(a=>{const o=this.nodes.find(u=>u._id===a._id);o&&(f.copyPos(o,a),o._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const t=new te({column:this.column,float:this.float,nodes:this.nodes.map(s=>({...s}))}),i={...e};return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=f.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){var d,c;if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);const s=e.w!==t.w||e.h!==t.h,r=f.copyPos({},e,!0);if(f.copyPos(r,t),this.nodeBoundFix(r,s),f.copyPos(t,r),!t.forceCollide&&f.samePos(e,t))return!1;const a=f.copyPos({},e),o=this.collideAll(e,r,t.skip);let u=!0;if(o.length){const h=e._moving&&!t.nested;let m=h?this.directionCollideCoverage(e,t,o):o[0];if(h&&m&&((c=(d=e.grid)==null?void 0:d.opts)!=null&&c.subGridDynamic)&&!e.grid._isTemp){const g=f.areaIntercept(t.rect,m._rect),y=f.area(t.rect),_=f.area(m._rect);g/(y<_?y:_)>.8&&(m.grid.makeSubGrid(m.el,void 0,e),m=void 0)}m?u=!this._fixCollisions(e,r,m,t):(u=!1,i&&delete t.pack)}return u&&!f.samePos(e,r)&&(e._dirty=!0,f.copyPos(e,r)),t.pack&&this._packNodes()._notify(),!f.samePos(e,a)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t){var a;const i=(a=this._layouts)==null?void 0:a.length,s=i&&this.column!==i-1?this._layouts[i-1]:null,r=[];return this.sortNodes(),this.nodes.forEach(o=>{const u=s==null?void 0:s.find(c=>c._id===o._id),d={...o,...u||{}};f.removeInternalForSave(d,!e),t&&t(o,d),r.push(d)}),r}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{const s=i/this.column;e.forEach(r=>{if(!r._orig)return;const a=t.find(o=>o._id===r._id);a&&(a.y>=0&&r.y!==r._orig.y&&(a.y+=r.y-r._orig.y),r.x!==r._orig.x&&(a.x=Math.round(r.x*s)),r.w!==r._orig.w&&(a.w=Math.round(r.w*s)))})}}),this)}columnChanged(e,t,i="moveScale"){var o;if(!this.nodes.length||!t||e===t)return this;const s=i==="compact"||i==="list";s&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let r=[],a=s?this.nodes:f.sort(this.nodes,-1);if(t>e&&this._layouts){const u=this._layouts[t]||[],d=this._layouts.length-1;!u.length&&e!==d&&((o=this._layouts[d])!=null&&o.length)&&(e=d,this._layouts[d].forEach(c=>{const h=a.find(m=>m._id===c._id);h&&(!s&&!c.autoPosition&&(h.x=c.x??h.x,h.y=c.y??h.y),h.w=c.w??h.w,(c.x==null||c.y===void 0)&&(h.autoPosition=!0))})),u.forEach(c=>{const h=a.findIndex(m=>m._id===c._id);if(h!==-1){const m=a[h];if(s){m.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(m.x=c.x??m.x,m.y=c.y??m.y,m.w=c.w??m.w,r.push(m)),a.splice(h,1)}})}if(s)this.compact(i,!1);else{if(a.length)if(typeof i=="function")i(t,e,r,a);else{const u=s||i==="none"?1:t/e,d=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";a.forEach(h=>{h.x=t===1?0:d?Math.round(h.x*u):Math.min(h.x,t-1),h.w=t===1||e===1?1:c?Math.round(h.w*u)||1:Math.min(h.w,t),r.push(h)}),a=[]}r=f.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(u=>{this.addNode(u,!1),delete u._orig})}return this.nodes.forEach(u=>delete u._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){const s=[];return e.forEach((r,a)=>{if(r._id===void 0){const o=r.id?this.nodes.find(u=>u.id===r.id):void 0;r._id=(o==null?void 0:o._id)??te._idSeq++}s[a]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=s,this}cacheOneLayout(e,t){e._id=e._id??te._idSeq++;const i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];const s=this.findCacheLayout(e,t);return s===-1?this._layouts[t].push(i):this._layouts[t][s]=i,this}findCacheLayout(e,t){var i,s;return((s=(i=this._layouts)==null?void 0:i[t])==null?void 0:s.findIndex(r=>r._id===e._id))??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){const i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(const t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}te._idSeq=0;const G={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class x{}const X=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class ie{}function De(l,e){l.touches.length>1||(l.cancelable&&l.preventDefault(),f.simulateMouseEvent(l.changedTouches[0],e))}function _t(l,e){l.cancelable&&l.preventDefault(),f.simulateMouseEvent(l,e)}function ze(l){ie.touchHandled||(ie.touchHandled=!0,De(l,"mousedown"))}function Ne(l){ie.touchHandled&&De(l,"mousemove")}function Le(l){if(!ie.touchHandled)return;ie.pointerLeaveTimeout&&(window.clearTimeout(ie.pointerLeaveTimeout),delete ie.pointerLeaveTimeout);const e=!!x.dragElement;De(l,"mouseup"),e||De(l,"click"),ie.touchHandled=!1}function Oe(l){l.pointerType!=="mouse"&&l.target.releasePointerCapture(l.pointerId)}function bt(l){x.dragElement&&l.pointerType!=="mouse"&&_t(l,"mouseenter")}function vt(l){x.dragElement&&l.pointerType!=="mouse"&&(ie.pointerLeaveTimeout=window.setTimeout(()=>{delete ie.pointerLeaveTimeout,_t(l,"mouseleave")},10))}class Ae{constructor(e,t,i){this.host=e,this.dir=t,this.option=i,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const e=this.el=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(`${Ae.prefix}${this.dir}`),e.style.zIndex="100",e.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),X&&(this.el.addEventListener("touchstart",ze),this.el.addEventListener("pointerdown",Oe)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),X&&(this.el.removeEventListener("touchstart",ze),this.el.removeEventListener("pointerdown",Oe)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),X&&(this.el.addEventListener("touchmove",Ne),this.el.addEventListener("touchend",Le)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),X&&(this.el.removeEventListener("touchmove",Ne),this.el.removeEventListener("touchend",Le)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){var t,i;e.key==="Escape"&&((i=(t=this.host.gridstackNode)==null?void 0:t.grid)==null||i.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}Ae.prefix="ui-resizable-";class Ge{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](t)}}class _e extends Ge{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{const s=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||r;return{position:{left:(a.left-s.left)*this.rectScale.x,top:(a.top-s.top)*this.rectScale.y},size:{width:a.width*this.rectScale.x,height:a.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){const t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(s=>this.option[s]=e[s]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),x.overResizeElement===this&&delete x.overResizeElement),this}_mouseOver(e){x.overResizeElement||x.dragElement||(x.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){x.overResizeElement===this&&(delete x.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new Ae(this.el,e,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:t=>{this._resizing(t,e)}})),this}_resizeStart(e){this.sizeToContent=f.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=f.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const t=f.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();const i=f.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){const t=f.initEvent(e,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=_e._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,t=f.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return _e._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){const i=this.startEvent,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=e.clientX-i.clientX,a=this.sizeToContent?0:e.clientY-i.clientY;let o,u;t.indexOf("e")>-1?s.width+=r:t.indexOf("w")>-1&&(s.width-=r,s.left+=r,o=!0),t.indexOf("s")>-1?s.height+=a:t.indexOf("n")>-1&&(s.height-=a,s.top+=a,u=!0);const d=this._constrainSize(s.width,s.height,o,u);return Math.round(s.width)!==Math.round(d.width)&&(t.indexOf("w")>-1&&(s.left+=s.width-d.width),s.width=d.width),Math.round(s.height)!==Math.round(d.height)&&(t.indexOf("n")>-1&&(s.top+=s.height-d.height),s.height=d.height),s}_constrainSize(e,t,i,s){const r=this.option,a=(i?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,o=r.minWidth/this.rectScale.x||e,u=(s?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,d=r.minHeight/this.rectScale.y||t,c=Math.min(a,Math.max(o,e)),h=Math.min(u,Math.max(d,t));return{width:c,height:h}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const t=this.el.parentElement,{left:i,top:s}=t.getBoundingClientRect();e={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{const i=this.temporalRect[t],s=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}_e._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const pi='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class be extends Ge{constructor(e,t={}){var r;super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const i=(r=t==null?void 0:t.handle)==null?void 0:r.substring(1),s=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:s!=null&&s.subGrid?[e.querySelector(t.handle)||e]:Array.from(e.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),X&&(e.addEventListener("touchstart",ze),e.addEventListener("pointerdown",Oe))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),X&&(t.removeEventListener("touchstart",ze),t.removeEventListener("pointerdown",Oe))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(!x.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(pi)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete x.dragElement,delete x.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),X&&(e.currentTarget.addEventListener("touchmove",Ne),e.currentTarget.addEventListener("touchend",Le)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),x.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const t=f.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){var i;const t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),x.pauseDrag){const s=Number.isInteger(x.pauseDrag)?x.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),s)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,x.dragElement=this;const s=(i=this.el.gridstackNode)==null?void 0:i.grid;s?x.dropElement=s.el.ddElement.ddDroppable:delete x.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=f.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const r=f.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(r,this.ui()),this.triggerEvent("dragstart",r),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){var t,i;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),X&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Ne,!0),e.currentTarget.removeEventListener("touchend",Le,!0)),this.dragging){delete this.dragging,(t=this.el.gridstackNode)==null||delete t._origRotate,document.removeEventListener("keydown",this._keyEvent),((i=x.dropElement)==null?void 0:i.el)===this.el.parentElement&&delete x.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const s=f.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(s),this.triggerEvent("dragstop",s),x.dropElement&&x.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete x.dragElement,delete x.dropElement,delete x.mouseHandled,e.preventDefault()}_keyEvent(e){var s,r;const t=this.el.gridstackNode,i=(t==null?void 0:t.grid)||((r=(s=x.dropElement)==null?void 0:s.el)==null?void 0:r.gridstack);if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i==null||i.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!f.canBeRotated(t))return;t._origRotate=t._origRotate||{...t._orig},delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",f.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=f.cloneNode(this.el)),e.parentElement||f.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=be.originStyleProp.map(t=>this.el.style[t]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging");const t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.transition=null)},0),this}_removeHelperStyle(){var t;this.helper.classList.remove("ui-draggable-dragging");const e=(t=this.helper)==null?void 0:t.gridstackNode;if(!(e!=null&&e._isAboutToRemove)&&this.dragElementOriginStyle){const i=this.helper,s=this.dragElementOriginStyle.transition||null;i.style.transition=this.dragElementOriginStyle.transition="none",be.originStyleProp.forEach(r=>i.style[r]=this.dragElementOriginStyle[r]||null),setTimeout(()=>i.style.transition=s,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const t={left:0,top:0},i=this.helper.style,s=this.dragOffset;i.left=(e.clientX+s.offsetLeft-t.left)*this.dragTransform.xScale+"px",i.top=(e.clientY+s.offsetTop-t.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,t,i){let s=0,r=0;i&&(s=this.dragTransform.xOffset,r=this.dragTransform.yOffset);const a=t.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-s,offsetTop:-e.clientY+a.top-r,width:a.width*this.dragTransform.xScale,height:a.height*this.dragTransform.yScale}}ui(){const t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:(i.left-t.left)*this.dragTransform.xScale}}}}be.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class yi extends Ge{constructor(e,t={}){super(),this.el=e,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),X&&(this.el.addEventListener("pointerenter",bt),this.el.addEventListener("pointerleave",vt)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),X&&(this.el.removeEventListener("pointerenter",bt),this.el.removeEventListener("pointerleave",vt)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this._setupAccept(),this}_mouseEnter(e){if(!x.dragElement||!this._canDrop(x.dragElement.el))return;e.preventDefault(),e.stopPropagation(),x.dropElement&&x.dropElement!==this&&x.dropElement._mouseLeave(e,!0),x.dropElement=this;const t=f.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(x.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){var s;if(!x.dragElement||x.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const i=f.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui(x.dragElement)),this.triggerEvent("dropout",i),x.dropElement===this&&(delete x.dropElement,!t)){let r,a=this.el.parentElement;for(;!r&&a;)r=(s=a.ddElement)==null?void 0:s.ddDroppable,a=a.parentElement;r&&r._mouseEnter(e)}}drop(e){e.preventDefault();const t=f.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(x.dragElement)),this.triggerEvent("drop",t)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return{draggable:e.el,...e.ui()}}}class Ue{static init(e){return e.ddElement||(e.ddElement=new Ue(e)),e.ddElement}constructor(e){this.el=e}on(e,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,t),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new be(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new _e(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new yi(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class _i{resizable(e,t,i,s){return this._getDDElements(e,t).forEach(r=>{if(t==="disable"||t==="enable")r.ddResizable&&r.ddResizable[t]();else if(t==="destroy")r.ddResizable&&r.cleanResizable();else if(t==="option")r.setupResizable({[i]:s});else{const o=r.el.gridstackNode.grid;let u=r.el.getAttribute("gs-resize-handles")||o.opts.resizable.handles||"e,s,se";u==="all"&&(u="n,e,s,w,se,sw,ne,nw");const d=!o.opts.alwaysShowResizeHandle;r.setupResizable({...o.opts.resizable,handles:u,autoHide:d,start:t.start,stop:t.stop,resize:t.resize})}}),this}draggable(e,t,i,s){return this._getDDElements(e,t).forEach(r=>{if(t==="disable"||t==="enable")r.ddDraggable&&r.ddDraggable[t]();else if(t==="destroy")r.ddDraggable&&r.cleanDraggable();else if(t==="option")r.setupDraggable({[i]:s});else{const a=r.el.gridstackNode.grid;r.setupDraggable({...a.opts.draggable,start:t.start,stop:t.stop,drag:t.drag})}}),this}dragIn(e,t){return this._getDDElements(e).forEach(i=>i.setupDraggable(t)),this}droppable(e,t,i,s){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=r=>t._accept(r)),this._getDDElements(e,t).forEach(r=>{t==="disable"||t==="enable"?r.ddDroppable&&r.ddDroppable[t]():t==="destroy"?r.ddDroppable&&r.cleanDroppable():t==="option"?r.setupDroppable({[i]:s}):r.setupDroppable(t)}),this}isDroppable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(s=>s.on(t,r=>{i(r,x.dragElement?x.dragElement.el:r.target,x.dragElement?x.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t){const i=e.gridstack||t!=="destroy"&&t!=="disable",s=f.getElements(e);return s.length?s.map(a=>a.ddElement||(i?Ue.init(a):null)).filter(a=>a):[]}}/*!
|
|
1
|
+
(function(se,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("vue"),require("@kong-ui-public/analytics-utilities"),require("@kong-ui-public/analytics-chart"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong-ui-public/analytics-metric-provider"),require("@kong-ui-public/analytics-config-store"),require("swrv"),require("axios"),require("@kong-ui-public/analytics-geo-map")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/analytics-utilities","@kong-ui-public/analytics-chart","@kong-ui-public/i18n","@kong/icons","@kong-ui-public/analytics-metric-provider","@kong-ui-public/analytics-config-store","swrv","axios","@kong-ui-public/analytics-geo-map"],x):(se=typeof globalThis<"u"?globalThis:se||self,x(se["kong-ui-public-dashboard-renderer"]={},se.Vue,se["kong-ui-public-analytics-utilities"],se["kong-ui-public-analytics-chart"],se["kong-ui-public-i18n"],se.KongIcons,se["kong-ui-public-analytics-metric-provider"],se["kong-ui-public-analytics-config-store"],se.swrv,se.axios,se["kong-ui-public-analytics-geo-map"]))})(this,function(se,x,Ie,En,yo,Di,Ey,Oa,Ok,dY,Ny){"use strict";var cY=Object.defineProperty;var Mk=se=>{throw TypeError(se)};var hY=(se,x,Ie)=>x in se?cY(se,x,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):se[x]=Ie;var Ck=(se,x,Ie)=>hY(se,typeof x!="symbol"?x+"":x,Ie),ky=(se,x,Ie)=>x.has(se)||Mk("Cannot "+Ie);var ae=(se,x,Ie)=>(ky(se,x,"read from private field"),Ie?Ie.call(se):x.get(se)),ht=(se,x,Ie)=>x.has(se)?Mk("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(se):x.set(se,Ie),Ke=(se,x,Ie,En)=>(ky(se,x,"write to private field"),En?En.call(se,Ie):x.set(se,Ie),Ie),yt=(se,x,Ie)=>(ky(se,x,"access private method"),Ie);var kl=(se,x,Ie,En)=>({set _(yo){Ke(se,x,yo,Ie)},get _(){return ae(se,x,En)}});var pn,Sa,Ta,cr,bl,Ma,wl,gn,Ca,At,Sl,mn,ka,Mi,Tl,Ch,Ee,kk,Dk,Ik,Ek,Nk,Ah,Dy,Iy,Oh,Ak,Rh;var Ay=(n=>(n.VALIDATING="VALIDATING",n.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",n.PENDING="PENDING",n.SUCCESS="SUCCESS",n.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",n.ERROR="ERROR",n.STALE_IF_ERROR="STALE_IF_ERROR",n))(Ay||{});const Rk=n=>{var e,t,i,r,o;return n?!!((e=Object.keys(n))!=null&&e.length||(t=n.data)!=null&&t.length||(r=(i=n.data)==null?void 0:i.data)!=null&&r.length||!((o=n.data)!=null&&o.data)&&typeof n.data=="object"&&Object.keys(n==null?void 0:n.data).length):!1};function Lk(n=x.ref({}),e,t,i=Rk){const r=x.ref("PENDING");return x.watchEffect(()=>{const o=i(n.value);if(n.value&&o&&t.value){r.value="VALIDATING_HAS_DATA";return}if(n.value&&t.value){r.value="VALIDATING";return}if(n.value&&e.value){r.value="STALE_IF_ERROR";return}if(n.value===void 0&&!e.value){r.value="PENDING";return}if(n.value&&!e.value&&o){r.value="SUCCESS_HAS_DATA";return}if(n.value&&!e.value){r.value="SUCCESS";return}n.value===void 0&&e&&(r.value="ERROR")}),{state:r,swrvState:Ay}}const Pk={renderer:{noQueryBridge:"No query bridge provided. Unable to render dashboard.",trendRange:{"24h":"Last 24-hour summary","7d":"Last 7-day summary","30d":"Last 30-day summary"},edit:"Edit",duplicateTile:"Duplicate",exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",remove:"Remove",delete:"Delete"},csvExport:{defaultFilename:"Chart export",exportAsCsv:"Export as CSV"},jumpToExplore:"Explore",jumpToRequests:"View requests",query_aged_out_warning:"This tile was configured with {savedGranularity} granularity, which is no longer available. It now shows {currentGranularity} data, the closest available granularity.",granularities:{daily:"1 day",fiveMinutely:"5 minutes",hourly:"1 hour",minutely:"1 minute",tenMinutely:"10 minutes",tenSecondly:"10 seconds",thirtyMinutely:"30 minutes",thirtySecondly:"30 seconds",twelveHourly:"12 hours",twoHourly:"2 hours",weekly:"1 week",unknown:"Unknown"}};function zk(){const n=yo.createI18n("en-us",Pk);return{i18n:n,i18nT:yo.i18nTComponent(n)}}const vo=170,Lh=6,ti="analytics-query-provider",Ph="{entity-id}",Oy="{cp-id}",Ry="{timeframe}",Ly=30*1e3,Py=3e5,zy=36e5;function Bk(){const n=x.inject(ti);return{evaluateFeatureFlag:(t,i)=>n?n.evaluateFeatureFlagFn(t,i):i}}function Vk(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var By={exports:{}};(function(n){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function r(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,h,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new r(c,h||l,d),p=t?t+u:u;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],f]:l._events[p].push(f):(l._events[p]=f,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new i:delete l._events[u]}function s(){this._events=new i,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)e.call(c,h)&&u.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=t?t+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var d=0,f=h.length,p=new Array(f);d<f;d++)p[d]=h[d].fn;return p},s.prototype.listenerCount=function(u){var c=t?t+u:u,h=this._events[c];return h?h.fn?1:h.length:0},s.prototype.emit=function(u,c,h,d,f,p){var g=t?t+u:u;if(!this._events[g])return!1;var m=this._events[g],y=arguments.length,v,_;if(m.fn){switch(m.once&&this.removeListener(u,m.fn,void 0,!0),y){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,c),!0;case 3:return m.fn.call(m.context,c,h),!0;case 4:return m.fn.call(m.context,c,h,d),!0;case 5:return m.fn.call(m.context,c,h,d,f),!0;case 6:return m.fn.call(m.context,c,h,d,f,p),!0}for(_=1,v=new Array(y-1);_<y;_++)v[_-1]=arguments[_];m.fn.apply(m.context,v)}else{var b=m.length,T;for(_=0;_<b;_++)switch(m[_].once&&this.removeListener(u,m[_].fn,void 0,!0),y){case 1:m[_].fn.call(m[_].context);break;case 2:m[_].fn.call(m[_].context,c);break;case 3:m[_].fn.call(m[_].context,c,h);break;case 4:m[_].fn.call(m[_].context,c,h,d);break;default:if(!v)for(T=1,v=new Array(y-1);T<y;T++)v[T-1]=arguments[T];m[_].fn.apply(m[_].context,v)}}return!0},s.prototype.on=function(u,c,h){return o(this,u,c,h,!1)},s.prototype.once=function(u,c,h){return o(this,u,c,h,!0)},s.prototype.removeListener=function(u,c,h,d){var f=t?t+u:u;if(!this._events[f])return this;if(!c)return a(this,f),this;var p=this._events[f];if(p.fn)p.fn===c&&(!d||p.once)&&(!h||p.context===h)&&a(this,f);else{for(var g=0,m=[],y=p.length;g<y;g++)(p[g].fn!==c||d&&!p[g].once||h&&p[g].context!==h)&&m.push(p[g]);m.length?this._events[f]=m.length===1?m[0]:m:a(this,f)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=t?t+u:u,this._events[c]&&a(this,c)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=t,s.EventEmitter=s,n.exports=s})(By);var Hk=By.exports;const Fk=Vk(Hk);class Vy extends Error{constructor(e){super(e),this.name="TimeoutError"}}class Gk extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const Hy=n=>globalThis.DOMException===void 0?new Gk(n):new DOMException(n),Fy=n=>{const e=n.reason===void 0?Hy("This operation was aborted."):n.reason;return e instanceof Error?e:Hy(e)};function Wk(n,e){const{milliseconds:t,fallback:i,message:r,customTimers:o={setTimeout,clearTimeout}}=e;let a,s;const u=new Promise((c,h)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){const{signal:f}=e;f.aborted&&h(Fy(f)),s=()=>{h(Fy(f))},f.addEventListener("abort",s,{once:!0})}if(t===Number.POSITIVE_INFINITY){n.then(c,h);return}const d=new Vy;a=o.setTimeout.call(void 0,()=>{if(i){try{c(i())}catch(f){h(f)}return}typeof n.cancel=="function"&&n.cancel(),r===!1?c():r instanceof Error?h(r):(d.message=r??`Promise timed out after ${t} milliseconds`,h(d))},t),(async()=>{try{c(await n)}catch(f){h(f)}})()}).finally(()=>{u.clear(),s&&e.signal&&e.signal.removeEventListener("abort",s)});return u.clear=()=>{o.clearTimeout.call(void 0,a),a=void 0},u}function Uk(n,e,t){let i=0,r=n.length;for(;r>0;){const o=Math.trunc(r/2);let a=i+o;t(n[a],e)<=0?(i=++a,r-=o+1):r=o}return i}class Yk{constructor(){ht(this,pn,[])}enqueue(e,t){t={priority:0,...t};const i={priority:t.priority,id:t.id,run:e};if(this.size===0||ae(this,pn)[this.size-1].priority>=t.priority){ae(this,pn).push(i);return}const r=Uk(ae(this,pn),i,(o,a)=>a.priority-o.priority);ae(this,pn).splice(r,0,i)}setPriority(e,t){const i=ae(this,pn).findIndex(o=>o.id===e);if(i===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[r]=ae(this,pn).splice(i,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){const e=ae(this,pn).shift();return e==null?void 0:e.run}filter(e){return ae(this,pn).filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return ae(this,pn).length}}pn=new WeakMap;class qk extends Fk{constructor(t){var i,r;super();ht(this,Ee);ht(this,Sa);ht(this,Ta);ht(this,cr,0);ht(this,bl);ht(this,Ma);ht(this,wl,0);ht(this,gn);ht(this,Ca);ht(this,At);ht(this,Sl);ht(this,mn,0);ht(this,ka);ht(this,Mi);ht(this,Tl);ht(this,Ch,1n);Ck(this,"timeout");if(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Yk,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${((i=t.intervalCap)==null?void 0:i.toString())??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((r=t.interval)==null?void 0:r.toString())??""}\` (${typeof t.interval})`);Ke(this,Sa,t.carryoverConcurrencyCount),Ke(this,Ta,t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0),Ke(this,bl,t.intervalCap),Ke(this,Ma,t.interval),Ke(this,At,new t.queueClass),Ke(this,Sl,t.queueClass),this.concurrency=t.concurrency,this.timeout=t.timeout,Ke(this,Tl,t.throwOnTimeout===!0),Ke(this,Mi,t.autoStart===!1)}get concurrency(){return ae(this,ka)}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);Ke(this,ka,t),yt(this,Ee,Oh).call(this)}setPriority(t,i){ae(this,At).setPriority(t,i)}async add(t,i={}){return i.id??(i.id=(kl(this,Ch)._++).toString()),i={timeout:this.timeout,throwOnTimeout:ae(this,Tl),...i},new Promise((r,o)=>{ae(this,At).enqueue(async()=>{var a;kl(this,mn)._++,kl(this,cr)._++;try{(a=i.signal)==null||a.throwIfAborted();let s=t({signal:i.signal});i.timeout&&(s=Wk(Promise.resolve(s),{milliseconds:i.timeout})),i.signal&&(s=Promise.race([s,yt(this,Ee,Ak).call(this,i.signal)]));const l=await s;r(l),this.emit("completed",l)}catch(s){if(s instanceof Vy&&!i.throwOnTimeout){r();return}o(s),this.emit("error",s)}finally{yt(this,Ee,Ik).call(this)}},i),this.emit("add"),yt(this,Ee,Ah).call(this)})}async addAll(t,i){return Promise.all(t.map(async r=>this.add(r,i)))}start(){return ae(this,Mi)?(Ke(this,Mi,!1),yt(this,Ee,Oh).call(this),this):this}pause(){Ke(this,Mi,!0)}clear(){Ke(this,At,new(ae(this,Sl)))}async onEmpty(){ae(this,At).size!==0&&await yt(this,Ee,Rh).call(this,"empty")}async onSizeLessThan(t){ae(this,At).size<t||await yt(this,Ee,Rh).call(this,"next",()=>ae(this,At).size<t)}async onIdle(){ae(this,mn)===0&&ae(this,At).size===0||await yt(this,Ee,Rh).call(this,"idle")}get size(){return ae(this,At).size}sizeBy(t){return ae(this,At).filter(t).length}get pending(){return ae(this,mn)}get isPaused(){return ae(this,Mi)}}Sa=new WeakMap,Ta=new WeakMap,cr=new WeakMap,bl=new WeakMap,Ma=new WeakMap,wl=new WeakMap,gn=new WeakMap,Ca=new WeakMap,At=new WeakMap,Sl=new WeakMap,mn=new WeakMap,ka=new WeakMap,Mi=new WeakMap,Tl=new WeakMap,Ch=new WeakMap,Ee=new WeakSet,kk=function(){return ae(this,Ta)||ae(this,cr)<ae(this,bl)},Dk=function(){return ae(this,mn)<ae(this,ka)},Ik=function(){kl(this,mn)._--,yt(this,Ee,Ah).call(this),this.emit("next")},Ek=function(){yt(this,Ee,Iy).call(this),yt(this,Ee,Dy).call(this),Ke(this,Ca,void 0)},Nk=function(){const t=Date.now();if(ae(this,gn)===void 0){const i=ae(this,wl)-t;if(i<0)Ke(this,cr,ae(this,Sa)?ae(this,mn):0);else return ae(this,Ca)===void 0&&Ke(this,Ca,setTimeout(()=>{yt(this,Ee,Ek).call(this)},i)),!0}return!1},Ah=function(){if(ae(this,At).size===0)return ae(this,gn)&&clearInterval(ae(this,gn)),Ke(this,gn,void 0),this.emit("empty"),ae(this,mn)===0&&this.emit("idle"),!1;if(!ae(this,Mi)){const t=!ae(this,Ee,Nk);if(ae(this,Ee,kk)&&ae(this,Ee,Dk)){const i=ae(this,At).dequeue();return i?(this.emit("active"),i(),t&&yt(this,Ee,Dy).call(this),!0):!1}}return!1},Dy=function(){ae(this,Ta)||ae(this,gn)!==void 0||(Ke(this,gn,setInterval(()=>{yt(this,Ee,Iy).call(this)},ae(this,Ma))),Ke(this,wl,Date.now()+ae(this,Ma)))},Iy=function(){ae(this,cr)===0&&ae(this,mn)===0&&ae(this,gn)&&(clearInterval(ae(this,gn)),Ke(this,gn,void 0)),Ke(this,cr,ae(this,Sa)?ae(this,mn):0),yt(this,Ee,Oh).call(this)},Oh=function(){for(;yt(this,Ee,Ah).call(this););},Ak=async function(t){return new Promise((i,r)=>{t.addEventListener("abort",()=>{r(t.reason)},{once:!0})})},Rh=async function(t,i){return new Promise(r=>{const o=()=>{i&&!i()||(this.off(t,o),r())};this.on(t,o)})};const jk=()=>{const n=Oa.useAnalyticsConfigStore(),e=x.inject(ti);if(!e)return;if(e.queryFnOverride){console.warn("Detected incorrect use of useRequestQueue. This composable should not be used in nested components. Please discuss with team-data or report an issue if you feel you have a use case.");return}const t=new qk({carryoverConcurrencyCount:!0,concurrency:n.maxParallelRequests,interval:n.requestInterval,intervalCap:n.requestIntervalCap}),i={...e,queryFnOverride:!0,queryFn:(r,o)=>t.add(()=>e.queryFn(r,o),{throwOnTimeout:!0})};x.provide(ti,i)};function $k({queryBridge:n,context:e,definition:t,chartData:i}){const r=x.ref(""),o=x.ref(""),a=x.ref(void 0),s=x.ref(void 0),l=Oa.useAnalyticsConfigStore();x.onMounted(async()=>{var w,S;r.value=await((w=n==null?void 0:n.exploreBaseUrl)==null?void 0:w.call(n))??"",o.value=await((S=n==null?void 0:n.requestsBaseUrl)==null?void 0:S.call(n))??""});const u=x.computed(()=>l.analytics&&l.percentiles),c=x.computed(()=>!["golden_signals","top_n","gauge"].includes(t.value.chart.type)),h=x.computed(()=>o.value&&t.value.query&&t.value.query.datasource!=="llm_usage"&&u.value),d=x.computed(()=>r.value&&t.value.query&&["basic","api_usage","llm_usage",void 0].includes(t.value.query.datasource)&&u.value),f=x.computed(()=>i.value?Ie.msToGranularity(i.value.meta.granularity_ms):void 0),p=x.computed(()=>{var M;const w=[...e.value.filters,...t.value.query.filters??[]],S=((M=t.value.query)==null?void 0:M.datasource)??"api_usage";return w.filter(C=>Ie.getFieldDataSources(C.field).some(E=>S===E))}),g=x.computed(()=>{if(!d.value||!c.value)return"";const w=p.value,S=t.value.query.time_range||e.value.timeSpec,M=b(S,w);return T(M)}),m=x.computed(()=>{if(!h.value||!c.value)return"";const w=p.value,S=v(t.value.query.time_range||e.value.timeSpec,w);return y(S)}),y=w=>h.value?`${o.value}?q=${JSON.stringify(w)}`:"",v=(w,S)=>{var M,C;return{filter:S,timeframe:{timePeriodsKey:w.type==="relative"?w.time_range:"custom",start:w.type==="absolute"?(M=i.value)==null?void 0:M.meta.start_ms:void 0,end:w.type==="absolute"?(C=i.value)==null?void 0:C.meta.end_ms:void 0}}},_=(w,S)=>({filter:S,timeframe:{timePeriodsKey:w.type==="relative"?w.time_range:"custom",start:w.type==="absolute"?w.start:void 0,end:w.type==="absolute"?w.end:void 0}}),b=(w,S)=>{const M=t.value.query.dimensions??[];return{filters:S,metrics:t.value.query.metrics??[],dimensions:M,time_range:w,granularity:t.value.query.granularity||f.value}},T=w=>{if(!d.value)return"";const S=["api_usage","llm_usage"].includes(t.value.query.datasource)?t.value.query.datasource:"api_usage";return`${r.value}?q=${JSON.stringify(w)}&d=${S}&c=${t.value.chart.type}`};return x.watch([h,d],([w,S])=>{w&&(a.value={href:""}),S&&(s.value={href:""})}),{exploreLinkKebabMenu:g,requestsLinkKebabMenu:m,canShowKebabMenu:c,canGenerateRequestsLink:h,canGenerateExploreLink:d,requestsLinkZoomActions:a,exploreLinkZoomActions:s,buildExploreQuery:b,buildRequestsQueryZoomActions:_,buildExploreLink:T,buildRequestLink:y}}const Zk=(n,e,t)=>{const i=[];return e&&i.push(...e),i.push(...Ie.stripUnknownFilters(n,t)),i};function Xk(){const n=x.inject(ti),e=new AbortController;return x.onUnmounted(()=>{e.abort()}),{issueQuery:async(i,r,o)=>{if(!n)throw new Error("Query bridge is not defined");const{datasource:a,limit:s,...l}=i,u=a||"basic",c=Zk(u,i.filters,r.filters);let h=i.time_range;h?h.tz||(h={...h,tz:r.tz}):h={...r.timeSpec,tz:r.tz};const d={datasource:u,query:{...l,time_range:h,filters:c,limit:o??s}};return n.queryFn(d,e)}}}function Kk({context:n,globalFilters:e=x.ref([]),isFullscreen:t=x.ref(!1)}){const i=Oa.useAnalyticsConfigStore(),r=x.computed(()=>n.value.timeSpec?n.value.timeSpec:{type:"relative",time_range:i.defaultQueryTimeForOrg});return{internalContext:x.computed(()=>{var h,d,f;let{tz:a,refreshInterval:s,editable:l}=n.value;const u=[...n.value.filters??[],...e.value];if(a||(a=new Intl.DateTimeFormat().resolvedOptions().timeZone),s===void 0&&(s=Ly),t.value){let p=!1;if(r.value.type==="relative")p=["15m","1h","6h","12h","24h"].includes(r.value.time_range);else{const y=r.value.start.getTime(),v=r.value.end.getTime();p=Math.abs(v-y)<=864e5}const g=new Date().getTime();r.value.type==="absolute"&&r.value.end.getTime()<g||r.value.type==="relative"&&["previous_week","previous_month"].includes(r.value.time_range)?s=0:p?s=Py:s=zy}l===void 0&&(l=!1);const c=!!((f=(d=(h=x.getCurrentInstance())==null?void 0:h.vnode)==null?void 0:d.props)!=null&&f.onTileTimeRangeZoom);return{filters:u,tz:a,timeSpec:r.value,refreshInterval:s,editable:l,zoomable:c}})}}const ni={useContextLinks:$k,useDashboardInternalContext:Kk,useEvaluateFeatureFlag:Bk,useI18n:zk,useIssueQuery:Xk,useRequestQueue:jk},Ra=x.defineComponent({__name:"QueryDataProvider",props:{context:{},limitOverride:{},query:{},queryReady:{type:Boolean},refreshCounter:{}},emits:["chart-data","queryComplete"],setup(n,{emit:e}){const t=n,i=e,{issueQuery:r}=ni.useIssueQuery(),o=x.inject(ti),a=()=>t.queryReady&&o?JSON.stringify([t.query,t.context,t.refreshCounter]):null,{data:s,error:l,isValidating:u}=Ok(a,async()=>{try{const g=await r(t.query,t.context,t.limitOverride);return d.value=null,g}catch(g){throw d.value=En.handleQueryError(g),g}finally{i("queryComplete")}},{refreshInterval:t.context.refreshInterval,revalidateOnFocus:!1,shouldRetryOnError:!1}),{state:c,swrvState:h}=Lk(s,l,u),d=x.ref(null),f=x.computed(()=>c.value===h.ERROR||!!d.value),p=x.computed(()=>!t.queryReady||c.value===h.PENDING);return x.watch([()=>s.value,()=>c.value],([g,m])=>{g&&(m==="SUCCESS_HAS_DATA"||m==="SUCCESS")&&i("chart-data",g)}),(g,m)=>{const y=x.resolveComponent("KSkeleton"),v=x.resolveComponent("KEmptyState");return p.value||!x.unref(s)&&!f.value?(x.openBlock(),x.createBlock(y,{key:0,class:"chart-skeleton",type:"table"})):f.value&&d.value?(x.openBlock(),x.createBlock(v,{key:1,"action-button-visible":!1,"data-testid":"chart-empty-state"},x.createSlots({icon:x.withCtx(()=>[d.value.type==="forbidden"?(x.openBlock(),x.createBlock(x.unref(Di.VisibilityOffIcon),{key:0})):(x.openBlock(),x.createBlock(x.unref(Di.WarningOutlineIcon),{key:1}))]),title:x.withCtx(()=>[x.createElementVNode("p",null,x.toDisplayString(d.value.message),1)]),_:2},[d.value.details?{name:"default",fn:x.withCtx(()=>[x.createElementVNode("p",null,x.toDisplayString(d.value.details),1)]),key:"0"}:void 0]),1024)):x.unref(s)?x.renderSlot(g.$slots,"default",{key:2,data:x.unref(s)}):x.createCommentVNode("",!0)}}}),Qk=x.defineComponent({__name:"SimpleChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(n){x.useCssVars(i=>({v088169ae:`${i.height}px`}));const e=n,t=x.computed(()=>e.chartOptions.type==="single_value");return(i,r)=>(x.openBlock(),x.createBlock(Ra,{context:n.context,query:n.query,"query-ready":n.queryReady,"refresh-counter":n.refreshCounter},{default:x.withCtx(({data:o})=>[x.createElementVNode("div",{class:x.normalizeClass(["analytics-chart",{"single-value":t.value}])},[x.createVNode(x.unref(En.SimpleChart),{"chart-data":o,"chart-options":n.chartOptions,"synthetics-data-key":t.value?void 0:n.chartOptions.synthetics_data_key},null,8,["chart-data","chart-options","synthetics-data-key"])],2)]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),Ii=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},Gy=Ii(Qk,[["__scopeId","data-v-1e9ff912"]]),Jk={class:"analytics-chart"},Wy=Ii(x.defineComponent({__name:"BaseAnalyticsChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{},extraProps:{}},emits:["edit-tile","chart-data","zoom-time-range","view-requests","select-chart-range"],setup(n,{emit:e}){const t=n,i=e,{i18n:r}=ni.useI18n(),o=x.computed(()=>({type:t.chartOptions.type,stacked:t.chartOptions.stacked??!1,chartDatasetColors:t.chartOptions.chart_dataset_colors,threshold:t.chartOptions.threshold,hideTruncationWarning:t.query.limit!==void 0&&t.query.limit>0})),a=x.computed(()=>t.context.zoomable),s=()=>{i("edit-tile")},l=u=>{i("chart-data",u)};return(u,c)=>{const h=x.resolveComponent("KDropdownItem");return x.openBlock(),x.createBlock(Ra,{context:n.context,query:n.query,"query-ready":n.queryReady,"refresh-counter":n.refreshCounter,onChartData:l},{default:x.withCtx(({data:d})=>[x.createElementVNode("div",Jk,[x.createVNode(x.unref(En.AnalyticsChart),x.mergeProps({"chart-data":d,"chart-options":o.value,"explore-link":n.exploreLink,"legend-position":"bottom","requests-link":n.requestsLink,"synthetics-data-key":n.chartOptions.synthetics_data_key,"timeseries-zoom":a.value,"tooltip-title":""},n.extraProps,{onSelectChartRange:c[0]||(c[0]=f=>i("select-chart-range",f)),onZoomTimeRange:c[1]||(c[1]=f=>i("zoom-time-range",f))}),x.createSlots({_:2},[n.context.editable?{name:"menu-items",fn:x.withCtx(()=>[x.createVNode(h,{onClick:s},{default:x.withCtx(()=>[x.createTextVNode(x.toDisplayString(x.unref(r).t("renderer.edit")),1)]),_:1})]),key:"0"}:void 0]),1040,["chart-data","chart-options","explore-link","requests-link","synthetics-data-key","timeseries-zoom"])])]),_:1},8,["context","query","query-ready","refresh-counter"])}}}),[["__scopeId","data-v-52357845"]]),Uy=x.defineComponent({__name:"BarChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(n){return(e,t)=>(x.openBlock(),x.createBlock(Wy,{"chart-options":n.chartOptions,context:n.context,"extra-props":{showAnnotations:!1},height:n.height,query:n.query,"query-ready":n.queryReady,"refresh-counter":n.refreshCounter},null,8,["chart-options","context","height","query","query-ready","refresh-counter"]))}});var eD=Object.defineProperty,tD=(n,e,t)=>e in n?eD(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,nD=(n,e,t)=>tD(n,e+"",t),iD=Object.defineProperty,rD=(n,e,t)=>e in n?iD(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Qt=(n,e,t)=>rD(n,typeof e!="symbol"?e+"":e,t),re=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(re||{});const oD=["in","not_in","selector"],aD=["empty","not_empty"],sD=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],lD=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],La=n=>n.filter(e=>e!=="time"),Yy=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],qy=La(Yy),uD=[...Yy,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],jy=La(uD),cD=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],$y=La(cD);La(["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),La(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(qy),new Set(jy),new Set($y);const Zy=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];Zy.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:oD},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:aD}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...jy,...qy,...$y])]);let hD={};function dD(){return hD}const fD=60,pD=3600,Xy=Symbol.for("constructDateFrom");function Pa(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&Xy in n?n[Xy](e):n instanceof Date?new n.constructor(e):new Date(e)}function _o(n,e){return Pa(e||n,n)}function zh(n,e){const t=_o(n,void 0);return t.setHours(0,0,0,0),t}function Dl(n,e){var t,i,r,o;const a=dD(),s=(e==null?void 0:e.weekStartsOn)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((o=(r=a.locale)==null?void 0:r.options)==null?void 0:o.weekStartsOn)??0,l=_o(n,e==null?void 0:e.in),u=l.getDay(),c=(u<s?7:0)+u-s;return l.setDate(l.getDate()-c),l.setHours(0,0,0,0),l}function Bh(n,e,t){const i=_o(n,void 0);return isNaN(e)?Pa(n,NaN):(i.setDate(i.getDate()+e),i)}function gD(n,e,t){const i=_o(n,void 0);if(isNaN(e))return Pa(n,NaN);const r=i.getDate(),o=Pa(n,i.getTime());o.setMonth(i.getMonth()+e+1,0);const a=o.getDate();return r>=a?o:(i.setFullYear(o.getFullYear(),o.getMonth(),r),i)}function xo(n,e){const t=_o(n,void 0);return t.setDate(1),t.setHours(0,0,0,0),t}function mD(n,e){const t=_o(n,void 0),i=t.getFullYear(),r=t.getMonth(),o=Pa(t,0);return o.setFullYear(i,r+1,0),o.setHours(0,0,0,0),o.getDate()}function Ky(n){return Math.trunc(n*pD)}function yD(n){const e=n/fD;return Math.trunc(e)}function Qy(n,e,t){return gD(n,-1)}function vD(n,e){const t=SD(e);return"formatToParts"in t?xD(t,n):bD(t,n)}const _D={year:0,month:1,day:2,hour:3,minute:4,second:5};function xD(n,e){try{const t=n.formatToParts(e),i=[];for(let r=0;r<t.length;r++){const o=_D[t[r].type];o!==void 0&&(i[o]=parseInt(t[r].value,10))}return i}catch(t){if(t instanceof RangeError)return[NaN];throw t}}function bD(n,e){const t=n.format(e),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Vh={},Jy=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),wD=Jy==="06/25/2014, 00:00:00"||Jy==="06/25/2014 00:00:00";function SD(n){return Vh[n]||(Vh[n]=wD?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Vh[n]}function Hh(n,e,t,i,r,o,a){const s=new Date(0);return s.setUTCFullYear(n,e,t),s.setUTCHours(i,r,o,a),s}const ev=36e5,TD=6e4,Fh={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Il(n,e,t){if(!n)return 0;let i=Fh.timezoneZ.exec(n);if(i)return 0;let r,o;if(i=Fh.timezoneHH.exec(n),i)return r=parseInt(i[1],10),tv(r)?-(r*ev):NaN;if(i=Fh.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return tv(r,a)?(o=Math.abs(r)*ev+a*TD,i[1]==="+"?-o:o):NaN}if(kD(n)){e=new Date(e||Date.now());const a=t?e:MD(e),s=Gh(a,n);return-(t?s:CD(e,s,n))}return NaN}function MD(n){return Hh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Gh(n,e){const t=vD(n,e),i=Hh(t[0],t[1]-1,t[2],t[3]%24,t[4],t[5],0).getTime();let r=n.getTime();const o=r%1e3;return r-=o>=0?o:1e3+o,i-r}function CD(n,e,t){let i=n.getTime()-e;const r=Gh(new Date(i),t);if(e===r)return e;i-=r-e;const o=Gh(new Date(i),t);return r===o?r:Math.max(r,o)}function tv(n,e){return-23<=n&&n<=23&&(e==null||0<=e&&e<=59)}const nv={};function kD(n){if(nv[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),nv[n]=!0,!0}catch{return!1}}function iv(n){const e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+n-+e}const rv=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Wh=36e5,ov=6e4,DD=2,Tt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:rv};function Uh(n,e={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const t=e.additionalDigits==null?DD:Number(e.additionalDigits);if(t!==2&&t!==1&&t!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=ID(n),{year:r,restDateString:o}=ED(i.date,t),a=ND(o,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const s=a.getTime();let l=0,u;if(i.time&&(l=AD(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||e.timeZone){if(u=Il(i.timeZone||e.timeZone,new Date(s+l)),isNaN(u))return new Date(NaN)}else u=iv(new Date(s+l)),u=iv(new Date(s+l+u));return new Date(s+l+u)}else return new Date(NaN)}function ID(n){const e={};let t=Tt.dateTimePattern.exec(n),i;if(t?(e.date=t[1],i=t[3]):(t=Tt.datePattern.exec(n),t?(e.date=t[1],i=t[2]):(e.date=null,i=n)),i){const r=Tt.timeZone.exec(i);r?(e.time=i.replace(r[1],""),e.timeZone=r[1].trim()):e.time=i}return e}function ED(n,e){if(n){const t=Tt.YYY[e],i=Tt.YYYYY[e];let r=Tt.YYYY.exec(n)||i.exec(n);if(r){const o=r[1];return{year:parseInt(o,10),restDateString:n.slice(o.length)}}if(r=Tt.YY.exec(n)||t.exec(n),r){const o=r[1];return{year:parseInt(o,10)*100,restDateString:n.slice(o.length)}}}return{year:null}}function ND(n,e){if(e===null)return null;let t,i,r;if(!n||!n.length)return t=new Date(0),t.setUTCFullYear(e),t;let o=Tt.MM.exec(n);if(o)return t=new Date(0),i=parseInt(o[1],10)-1,lv(e,i)?(t.setUTCFullYear(e,i),t):new Date(NaN);if(o=Tt.DDD.exec(n),o){t=new Date(0);const a=parseInt(o[1],10);return LD(e,a)?(t.setUTCFullYear(e,0,a),t):new Date(NaN)}if(o=Tt.MMDD.exec(n),o){t=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return lv(e,i,a)?(t.setUTCFullYear(e,i,a),t):new Date(NaN)}if(o=Tt.Www.exec(n),o)return r=parseInt(o[1],10)-1,uv(r)?av(e,r):new Date(NaN);if(o=Tt.WwwD.exec(n),o){r=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return uv(r,a)?av(e,r,a):new Date(NaN)}return null}function AD(n){let e,t,i=Tt.HH.exec(n);if(i)return e=parseFloat(i[1].replace(",",".")),Yh(e)?e%24*Wh:NaN;if(i=Tt.HHMM.exec(n),i)return e=parseInt(i[1],10),t=parseFloat(i[2].replace(",",".")),Yh(e,t)?e%24*Wh+t*ov:NaN;if(i=Tt.HHMMSS.exec(n),i){e=parseInt(i[1],10),t=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Yh(e,t,r)?e%24*Wh+t*ov+r*1e3:NaN}return null}function av(n,e,t){e=e||0,t=t||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,o=e*7+t+1-r;return i.setUTCDate(i.getUTCDate()+o),i}const OD=[31,28,31,30,31,30,31,31,30,31,30,31],RD=[31,29,31,30,31,30,31,31,30,31,30,31];function sv(n){return n%400===0||n%4===0&&n%100!==0}function lv(n,e,t){if(e<0||e>11)return!1;if(t!=null){if(t<1)return!1;const i=sv(n);if(i&&t>RD[e]||!i&&t>OD[e])return!1}return!0}function LD(n,e){if(e<1)return!1;const t=sv(n);return!(t&&e>366||!t&&e>365)}function uv(n,e){return!(n<0||n>52||e!=null&&(e<0||e>6))}function Yh(n,e,t){return!(n<0||n>=25||e!=null&&(e<0||e>=60)||t!=null&&(t<0||t>=60))}function PD(n,e,t){n=Uh(n,t);const i=Il(e,n,!0),r=new Date(n.getTime()-i),o=new Date(0);return o.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),o.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),o}function zD(n,e,t){if(typeof n=="string"&&!n.match(rv))return Uh(n,{...t,timeZone:e});n=Uh(n,t);const i=Hh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=Il(e,new Date(i));return new Date(i+r)}function BD(n,e){return-Il(n,e)}const VD={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function cv(n){return n&&lD.find(e=>n<=VD[e])||null}var El=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nl={exports:{}};Nl.exports,function(n,e){var t=200,i="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",c="[object Function]",h="[object GeneratorFunction]",d="[object Map]",f="[object Number]",p="[object Object]",g="[object Promise]",m="[object RegExp]",y="[object Set]",v="[object String]",_="[object Symbol]",b="[object WeakMap]",T="[object ArrayBuffer]",w="[object DataView]",S="[object Float32Array]",M="[object Float64Array]",C="[object Int8Array]",I="[object Int16Array]",E="[object Int32Array]",k="[object Uint8Array]",D="[object Uint8ClampedArray]",A="[object Uint16Array]",R="[object Uint32Array]",L=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,z=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,F={};F[o]=F[a]=F[T]=F[w]=F[s]=F[l]=F[S]=F[M]=F[C]=F[I]=F[E]=F[d]=F[f]=F[p]=F[m]=F[y]=F[v]=F[_]=F[k]=F[D]=F[A]=F[R]=!0,F[u]=F[c]=F[b]=!1;var j=typeof El=="object"&&El&&El.Object===Object&&El,Y=typeof self=="object"&&self&&self.Object===Object&&self,ee=j||Y||Function("return this")(),pe=e&&!e.nodeType&&e,Te=pe&&!0&&n&&!n.nodeType&&n,qe=Te&&Te.exports===pe;function Je(O,B){return O.set(B[0],B[1]),O}function We(O,B){return O.add(B),O}function He(O,B){for(var G=-1,ie=O?O.length:0;++G<ie&&B(O[G],G,O)!==!1;);return O}function Be(O,B){for(var G=-1,ie=B.length,mt=O.length;++G<ie;)O[mt+G]=B[G];return O}function oe(O,B,G,ie){for(var mt=-1,Ht=O?O.length:0;++mt<Ht;)G=B(G,O[mt],mt,O);return G}function xe(O,B){for(var G=-1,ie=Array(O);++G<O;)ie[G]=B(G);return ie}function ct(O,B){return O==null?void 0:O[B]}function X(O){var B=!1;if(O!=null&&typeof O.toString!="function")try{B=!!(O+"")}catch{}return B}function de(O){var B=-1,G=Array(O.size);return O.forEach(function(ie,mt){G[++B]=[mt,ie]}),G}function ge(O,B){return function(G){return O(B(G))}}function Fe(O){var B=-1,G=Array(O.size);return O.forEach(function(ie){G[++B]=ie}),G}var tt=Array.prototype,je=Function.prototype,Kt=Object.prototype,ei=ee["__core-js_shared__"],Da=function(){var O=/[^.]+$/.exec(ei&&ei.keys&&ei.keys.IE_PROTO||"");return O?"Symbol(src)_1."+O:""}(),sk=je.toString,hr=Kt.hasOwnProperty,kh=Kt.toString,tU=RegExp("^"+sk.call(hr).replace(L,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lk=qe?ee.Buffer:void 0,uk=ee.Symbol,ck=ee.Uint8Array,nU=ge(Object.getPrototypeOf,Object),iU=Object.create,rU=Kt.propertyIsEnumerable,oU=tt.splice,hk=Object.getOwnPropertySymbols,aU=lk?lk.isBuffer:void 0,sU=ge(Object.keys,Object),vy=Na(ee,"DataView"),Ml=Na(ee,"Map"),_y=Na(ee,"Promise"),xy=Na(ee,"Set"),by=Na(ee,"WeakMap"),Cl=Na(Object,"create"),lU=mo(vy),uU=mo(Ml),cU=mo(_y),hU=mo(xy),dU=mo(by),dk=uk?uk.prototype:void 0,fk=dk?dk.valueOf:void 0;function po(O){var B=-1,G=O?O.length:0;for(this.clear();++B<G;){var ie=O[B];this.set(ie[0],ie[1])}}function fU(){this.__data__=Cl?Cl(null):{}}function pU(O){return this.has(O)&&delete this.__data__[O]}function gU(O){var B=this.__data__;if(Cl){var G=B[O];return G===i?void 0:G}return hr.call(B,O)?B[O]:void 0}function mU(O){var B=this.__data__;return Cl?B[O]!==void 0:hr.call(B,O)}function yU(O,B){var G=this.__data__;return G[O]=Cl&&B===void 0?i:B,this}po.prototype.clear=fU,po.prototype.delete=pU,po.prototype.get=gU,po.prototype.has=mU,po.prototype.set=yU;function Ci(O){var B=-1,G=O?O.length:0;for(this.clear();++B<G;){var ie=O[B];this.set(ie[0],ie[1])}}function vU(){this.__data__=[]}function _U(O){var B=this.__data__,G=Dh(B,O);if(G<0)return!1;var ie=B.length-1;return G==ie?B.pop():oU.call(B,G,1),!0}function xU(O){var B=this.__data__,G=Dh(B,O);return G<0?void 0:B[G][1]}function bU(O){return Dh(this.__data__,O)>-1}function wU(O,B){var G=this.__data__,ie=Dh(G,O);return ie<0?G.push([O,B]):G[ie][1]=B,this}Ci.prototype.clear=vU,Ci.prototype.delete=_U,Ci.prototype.get=xU,Ci.prototype.has=bU,Ci.prototype.set=wU;function Ia(O){var B=-1,G=O?O.length:0;for(this.clear();++B<G;){var ie=O[B];this.set(ie[0],ie[1])}}function SU(){this.__data__={hash:new po,map:new(Ml||Ci),string:new po}}function TU(O){return Ih(this,O).delete(O)}function MU(O){return Ih(this,O).get(O)}function CU(O){return Ih(this,O).has(O)}function kU(O,B){return Ih(this,O).set(O,B),this}Ia.prototype.clear=SU,Ia.prototype.delete=TU,Ia.prototype.get=MU,Ia.prototype.has=CU,Ia.prototype.set=kU;function Ea(O){this.__data__=new Ci(O)}function DU(){this.__data__=new Ci}function IU(O){return this.__data__.delete(O)}function EU(O){return this.__data__.get(O)}function NU(O){return this.__data__.has(O)}function AU(O,B){var G=this.__data__;if(G instanceof Ci){var ie=G.__data__;if(!Ml||ie.length<t-1)return ie.push([O,B]),this;G=this.__data__=new Ia(ie)}return G.set(O,B),this}Ea.prototype.clear=DU,Ea.prototype.delete=IU,Ea.prototype.get=EU,Ea.prototype.has=NU,Ea.prototype.set=AU;function OU(O,B){var G=Ty(O)||iY(O)?xe(O.length,String):[],ie=G.length,mt=!!ie;for(var Ht in O)hr.call(O,Ht)&&!(mt&&(Ht=="length"||JU(Ht,ie)))&&G.push(Ht);return G}function pk(O,B,G){var ie=O[B];(!(hr.call(O,B)&&vk(ie,G))||G===void 0&&!(B in O))&&(O[B]=G)}function Dh(O,B){for(var G=O.length;G--;)if(vk(O[G][0],B))return G;return-1}function RU(O,B){return O&&gk(B,My(B),O)}function wy(O,B,G,ie,mt,Ht,ki){var Ft;if(ie&&(Ft=Ht?ie(O,mt,Ht,ki):ie(O)),Ft!==void 0)return Ft;if(!Eh(O))return O;var bk=Ty(O);if(bk){if(Ft=XU(O),!B)return jU(O,Ft)}else{var Aa=go(O),wk=Aa==c||Aa==h;if(oY(O))return HU(O,B);if(Aa==p||Aa==o||wk&&!Ht){if(X(O))return Ht?O:{};if(Ft=KU(wk?{}:O),!B)return $U(O,RU(Ft,O))}else{if(!F[Aa])return Ht?O:{};Ft=QU(O,Aa,wy,B)}}ki||(ki=new Ea);var Sk=ki.get(O);if(Sk)return Sk;if(ki.set(O,Ft),!bk)var Tk=G?ZU(O):My(O);return He(Tk||O,function(Cy,Nh){Tk&&(Nh=Cy,Cy=O[Nh]),pk(Ft,Nh,wy(Cy,B,G,ie,Nh,O,ki))}),Ft}function LU(O){return Eh(O)?iU(O):{}}function PU(O,B,G){var ie=B(O);return Ty(O)?ie:Be(ie,G(O))}function zU(O){return kh.call(O)}function BU(O){if(!Eh(O)||tY(O))return!1;var B=xk(O)||X(O)?tU:z;return B.test(mo(O))}function VU(O){if(!yk(O))return sU(O);var B=[];for(var G in Object(O))hr.call(O,G)&&G!="constructor"&&B.push(G);return B}function HU(O,B){if(B)return O.slice();var G=new O.constructor(O.length);return O.copy(G),G}function Sy(O){var B=new O.constructor(O.byteLength);return new ck(B).set(new ck(O)),B}function FU(O,B){var G=B?Sy(O.buffer):O.buffer;return new O.constructor(G,O.byteOffset,O.byteLength)}function GU(O,B,G){var ie=B?G(de(O),!0):de(O);return oe(ie,Je,new O.constructor)}function WU(O){var B=new O.constructor(O.source,V.exec(O));return B.lastIndex=O.lastIndex,B}function UU(O,B,G){var ie=B?G(Fe(O),!0):Fe(O);return oe(ie,We,new O.constructor)}function YU(O){return fk?Object(fk.call(O)):{}}function qU(O,B){var G=B?Sy(O.buffer):O.buffer;return new O.constructor(G,O.byteOffset,O.length)}function jU(O,B){var G=-1,ie=O.length;for(B||(B=Array(ie));++G<ie;)B[G]=O[G];return B}function gk(O,B,G,ie){G||(G={});for(var mt=-1,Ht=B.length;++mt<Ht;){var ki=B[mt],Ft=void 0;pk(G,ki,Ft===void 0?O[ki]:Ft)}return G}function $U(O,B){return gk(O,mk(O),B)}function ZU(O){return PU(O,My,mk)}function Ih(O,B){var G=O.__data__;return eY(B)?G[typeof B=="string"?"string":"hash"]:G.map}function Na(O,B){var G=ct(O,B);return BU(G)?G:void 0}var mk=hk?ge(hk,Object):lY,go=zU;(vy&&go(new vy(new ArrayBuffer(1)))!=w||Ml&&go(new Ml)!=d||_y&&go(_y.resolve())!=g||xy&&go(new xy)!=y||by&&go(new by)!=b)&&(go=function(O){var B=kh.call(O),G=B==p?O.constructor:void 0,ie=G?mo(G):void 0;if(ie)switch(ie){case lU:return w;case uU:return d;case cU:return g;case hU:return y;case dU:return b}return B});function XU(O){var B=O.length,G=O.constructor(B);return B&&typeof O[0]=="string"&&hr.call(O,"index")&&(G.index=O.index,G.input=O.input),G}function KU(O){return typeof O.constructor=="function"&&!yk(O)?LU(nU(O)):{}}function QU(O,B,G,ie){var mt=O.constructor;switch(B){case T:return Sy(O);case s:case l:return new mt(+O);case w:return FU(O,ie);case S:case M:case C:case I:case E:case k:case D:case A:case R:return qU(O,ie);case d:return GU(O,ie,G);case f:case v:return new mt(O);case m:return WU(O);case y:return UU(O,ie,G);case _:return YU(O)}}function JU(O,B){return B=B??r,!!B&&(typeof O=="number"||H.test(O))&&O>-1&&O%1==0&&O<B}function eY(O){var B=typeof O;return B=="string"||B=="number"||B=="symbol"||B=="boolean"?O!=="__proto__":O===null}function tY(O){return!!Da&&Da in O}function yk(O){var B=O&&O.constructor,G=typeof B=="function"&&B.prototype||Kt;return O===G}function mo(O){if(O!=null){try{return sk.call(O)}catch{}try{return O+""}catch{}}return""}function nY(O){return wy(O,!0,!0)}function vk(O,B){return O===B||O!==O&&B!==B}function iY(O){return rY(O)&&hr.call(O,"callee")&&(!rU.call(O,"callee")||kh.call(O)==o)}var Ty=Array.isArray;function _k(O){return O!=null&&aY(O.length)&&!xk(O)}function rY(O){return sY(O)&&_k(O)}var oY=aU||uY;function xk(O){var B=Eh(O)?kh.call(O):"";return B==c||B==h}function aY(O){return typeof O=="number"&&O>-1&&O%1==0&&O<=r}function Eh(O){var B=typeof O;return!!O&&(B=="object"||B=="function")}function sY(O){return!!O&&typeof O=="object"}function My(O){return _k(O)?OU(O):VU(O)}function lY(){return[]}function uY(){return!1}n.exports=nY}(Nl,Nl.exports),Nl.exports;const ii=(n,e)=>new Date(n.getTime()-BD(e,n));class vt{constructor(e){Qt(this,"timeframeText"),Qt(this,"key"),Qt(this,"display"),Qt(this,"timeframeLength"),Qt(this,"allowedTiers"),Qt(this,"defaultResponseGranularity"),Qt(this,"dataGranularity"),Qt(this,"isRelative"),Qt(this,"fineGrainedDefaultGranularity"),Qt(this,"_startCustom"),Qt(this,"_endCustom"),Qt(this,"_allowedGranularitiesOverride"),this.display=e.display,this.timeframeText=e.timeframeText,this.key=e.key,this.timeframeLength=e.timeframeLength,this.allowedTiers=e.allowedTiers,this.defaultResponseGranularity=e.defaultResponseGranularity,this.dataGranularity=e.dataGranularity,this.isRelative=e.isRelative,this._startCustom=e.startCustom,this._endCustom=e.endCustom,this._allowedGranularitiesOverride=e.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=e.fineGrainedDefaultGranularity}rawEnd(e){return this._endCustom||new Date}rawStart(e){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(e){if(this._allowedGranularitiesOverride&&e)return new Set(this._allowedGranularitiesOverride);const t=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&t.add("minutely"),i>=2&&i<=7*24&&t.add("hourly"),i>=2*24&&t.add("daily"),i>=2*24*14&&t.add("weekly"),t}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(e){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:e};if(sD.includes(this.key))return{type:"relative",time_range:this.key,tz:e};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(e){if(!e)return new Date;const t=zD(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return PD(t,e)}}class HD extends vt{rawStart(e){let t=Dl(this.tzAdjustedDate(e),{weekStartsOn:1});return e&&(t=ii(t,e)),t}maximumTimeframeLength(){return 60*60*24*7}}class FD extends vt{rawStart(e){let t=xo(this.tzAdjustedDate(e));return e&&(t=ii(t,e)),t}maximumTimeframeLength(){return 60*60*24*31}}class GD extends vt{rawStart(e){let t=new Date(this.tzAdjustedDate(e).getFullYear(),0,1);return e&&(t=ii(t,e)),t}maximumTimeframeLength(){return 60*60*24*366}}class WD extends vt{rawEnd(e){let t=Dl(this.tzAdjustedDate(e),{weekStartsOn:1});return e&&(t=ii(t,e)),t}rawStart(e){const t=this.tzAdjustedDate(e);let i=Dl(t.setDate(t.getDate()-7),{weekStartsOn:1});return e&&(i=ii(i,e)),i}}class UD extends vt{rawEnd(e){let t=xo(this.tzAdjustedDate(e));return e&&(t=ii(t,e)),t}rawStart(e){let t=xo(Qy(this.tzAdjustedDate(e)));return e&&(t=ii(t,e)),t}}class YD extends vt{rawEnd(e){let t=new Date(this.tzAdjustedDate(e).getFullYear(),0,1);return e&&(t=ii(t,e)),t}rawStart(e){let t=new Date(this.tzAdjustedDate(e).getFullYear()-1,0,1);return e&&(t=ii(t,e)),t}}re.FIFTEEN_MIN,new vt({key:re.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),re.ONE_HOUR,new vt({key:re.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),re.SIX_HOUR,new vt({key:re.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),re.TWELVE_HOUR,new vt({key:re.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),re.ONE_DAY,new vt({key:re.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),re.SEVEN_DAY,new vt({key:re.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),re.THIRTY_DAY,new vt({key:re.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),re.NINETY_DAY,new vt({key:re.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),re.ONE_HUNDRED_EIGHTY_DAY,new vt({key:re.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),re.ONE_YEAR,new vt({key:re.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),re.CURRENT_WEEK,new HD({key:re.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Dl(new Date,{weekStartsOn:1});return(zh(Bh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),re.CURRENT_MONTH,new FD({key:re.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=xo(new Date);return(zh(Bh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),re.CURRENT_YEAR,new GD({key:re.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(zh(Bh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),re.PREVIOUS_WEEK,new WD({key:re.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),re.PREVIOUS_MONTH,new UD({key:re.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const e=xo(new Date),t=xo(Qy(new Date));return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=hv(e,t)),60*60*24*mD(new Date().setMonth(new Date().getMonth()-1))+Ky(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),re.PREVIOUS_YEAR,new YD({key:re.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),e=new Date(new Date().getFullYear()-1,0,1);let t=0;return n.getTimezoneOffset()!==e.getTimezoneOffset()&&(t=hv(n,e)),60*60*24*(365+(e.getFullYear()%4===0?1:0))+Ky(t)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function hv(n,e){return yD(n.getTimezoneOffset()-e.getTimezoneOffset())}re.FIFTEEN_MIN,re.ONE_HOUR,re.SIX_HOUR,re.TWELVE_HOUR,re.ONE_DAY,re.SEVEN_DAY,re.FIFTEEN_MIN,re.ONE_HOUR,re.SIX_HOUR,re.TWELVE_HOUR,re.ONE_DAY,re.SEVEN_DAY,re.THIRTY_DAY,re.NINETY_DAY,re.ONE_HUNDRED_EIGHTY_DAY,re.ONE_YEAR,re.CURRENT_WEEK,re.CURRENT_MONTH,re.CURRENT_YEAR,re.PREVIOUS_WEEK,re.PREVIOUS_MONTH,re.PREVIOUS_YEAR;const qD=new Map(Zy.map(n=>[n.code,{code:n.code,name:n.name}])),qh=n=>{var e;return((e=qD.get(n))==null?void 0:e.name)||n};var jD={exports:{}};(function(n){(function(){function e(u,c){if(c.separator===!1||u<1e3)return u.toString();var h=typeof c.separator=="string"?c.separator:",",d=[],f=Math.round(u).toString().split("");return f.reverse().forEach(function(p,g){g&&g%3===0&&d.push(h),d.push(p)}),d.reverse().join("")}function t(u,c,h){var d=u/c,f=h.round?"round":"floor";return h.decimal===!1?(u=Math[f](d),u.toString()):(h.precision?u=d:u=d<10?Math[f](d*10)/10:Math[f](d),u=u.toString(),typeof h.decimal=="string"&&(u=u.replace(".",h.decimal)),u)}var i=1e3,r=1e4,o=1e6,a=1e9,s=1e12;function l(u,c){var h;c=c||{};var d=u<0;d&&(u=Math.abs(u)),c.precision&&(u=parseFloat(u.toPrecision(c.precision)));var f=c.min10k?r:i;return u<f||c.precision&&c.precision>Math.log10(u)?h=e(t(u,1,c),c):u<o?h=t(u,i,c)+"k":u<a?h=t(u,o,c)+"m":u<s?h=e(t(u,a,c),c)+"b":h=e(t(u,s,c),c)+"t",d&&(h="-"+h),c.capital&&(h=h.toUpperCase()),c.prefix&&(h=c.prefix+h),c.suffix&&(h=h+c.suffix),h}l.addCommas=e,n.exports=l})()})(jD);var dv;new Intl.NumberFormat(((dv=document==null?void 0:document.documentElement)==null?void 0:dv.lang)||"en-US");const fv=6048e5,$D=864e5,pv=6e4,gv=36e5,mv=Symbol.for("constructDateFrom");function ri(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&mv in n?n[mv](e):n instanceof Date?new n.constructor(e):new Date(e)}function Gt(n,e){return ri(e||n,n)}let ZD={};function za(){return ZD}function Ba(n,e){var t,i,r,o;const a=za(),s=(e==null?void 0:e.weekStartsOn)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((o=(r=a.locale)==null?void 0:r.options)==null?void 0:o.weekStartsOn)??0,l=Gt(n,e==null?void 0:e.in),u=l.getDay(),c=(u<s?7:0)+u-s;return l.setDate(l.getDate()-c),l.setHours(0,0,0,0),l}function Al(n,e){return Ba(n,{...e,weekStartsOn:1})}function yv(n,e){const t=Gt(n,void 0),i=t.getFullYear(),r=ri(t,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const o=Al(r),a=ri(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const s=Al(a);return t.getTime()>=o.getTime()?i+1:t.getTime()>=s.getTime()?i:i-1}function vv(n){const e=Gt(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function XD(n,...e){const t=ri.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function _v(n,e){const t=Gt(n,void 0);return t.setHours(0,0,0,0),t}function KD(n,e,t){const[i,r]=XD(void 0,n,e),o=_v(i),a=_v(r),s=+o-vv(o),l=+a-vv(a);return Math.round((s-l)/$D)}function QD(n,e){const t=yv(n),i=ri(n,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),Al(i)}function JD(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function eI(n){return!(!JD(n)&&typeof n!="number"||isNaN(+Gt(n)))}function tI(n,e){const t=Gt(n,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const nI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},iI=(n,e,t)=>{let i;const r=nI[n];return typeof r=="string"?i=r:e===1?i=r.one:i=r.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function jh(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const rI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},oI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},aI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},sI={date:jh({formats:rI,defaultWidth:"full"}),time:jh({formats:oI,defaultWidth:"full"}),dateTime:jh({formats:aI,defaultWidth:"full"})},lI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},uI=(n,e,t,i)=>lI[n];function Va(n){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,s=t!=null&&t.width?String(t.width):a;r=n.formattingValues[s]||n.formattingValues[a]}else{const a=n.defaultWidth,s=t!=null&&t.width?String(t.width):n.defaultWidth;r=n.values[s]||n.values[a]}const o=n.argumentCallback?n.argumentCallback(e):e;return r[o]}}const cI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},hI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dI={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},pI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mI=(n,e)=>{const t=Number(n),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},yI={ordinalNumber:mI,era:Va({values:cI,defaultWidth:"wide"}),quarter:Va({values:hI,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Va({values:dI,defaultWidth:"wide"}),day:Va({values:fI,defaultWidth:"wide"}),dayPeriod:Va({values:pI,defaultWidth:"wide",formattingValues:gI,defaultFormattingWidth:"wide"})};function Ha(n){return(e,t={})=>{const i=t.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=e.match(r);if(!o)return null;const a=o[0],s=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(s)?_I(s,h=>h.test(a)):vI(s,h=>h.test(a));let u;u=n.valueCallback?n.valueCallback(l):l,u=t.valueCallback?t.valueCallback(u):u;const c=e.slice(a.length);return{value:u,rest:c}}}function vI(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function _I(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function xI(n){return(e,t={})=>{const i=e.match(n.matchPattern);if(!i)return null;const r=i[0],o=e.match(n.parsePattern);if(!o)return null;let a=n.valueCallback?n.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;const s=e.slice(r.length);return{value:a,rest:s}}}const bI=/^(\d+)(th|st|nd|rd)?/i,wI=/\d+/i,SI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},TI={any:[/^b/i,/^(a|c)/i]},MI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},CI={any:[/1/i,/2/i,/3/i,/4/i]},kI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},DI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},II={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},EI={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},NI={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},AI={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},OI={ordinalNumber:xI({matchPattern:bI,parsePattern:wI,valueCallback:n=>parseInt(n,10)}),era:Ha({matchPatterns:SI,defaultMatchWidth:"wide",parsePatterns:TI,defaultParseWidth:"any"}),quarter:Ha({matchPatterns:MI,defaultMatchWidth:"wide",parsePatterns:CI,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ha({matchPatterns:kI,defaultMatchWidth:"wide",parsePatterns:DI,defaultParseWidth:"any"}),day:Ha({matchPatterns:II,defaultMatchWidth:"wide",parsePatterns:EI,defaultParseWidth:"any"}),dayPeriod:Ha({matchPatterns:NI,defaultMatchWidth:"any",parsePatterns:AI,defaultParseWidth:"any"})},RI={code:"en-US",formatDistance:iI,formatLong:sI,formatRelative:uI,localize:yI,match:OI,options:{weekStartsOn:0,firstWeekContainsDate:1}};function LI(n,e){const t=Gt(n,void 0);return KD(t,tI(t))+1}function PI(n,e){const t=Gt(n,void 0),i=+Al(t)-+QD(t);return Math.round(i/fv)+1}function xv(n,e){var t,i,r,o;const a=Gt(n,e==null?void 0:e.in),s=a.getFullYear(),l=za(),u=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((o=(r=l.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,c=ri((e==null?void 0:e.in)||n,0);c.setFullYear(s+1,0,u),c.setHours(0,0,0,0);const h=Ba(c,e),d=ri((e==null?void 0:e.in)||n,0);d.setFullYear(s,0,u),d.setHours(0,0,0,0);const f=Ba(d,e);return+a>=+h?s+1:+a>=+f?s:s-1}function zI(n,e){var t,i,r,o;const a=za(),s=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((o=(r=a.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,l=xv(n,e),u=ri((e==null?void 0:e.in)||n,0);return u.setFullYear(l,0,s),u.setHours(0,0,0,0),Ba(u,e)}function BI(n,e){const t=Gt(n,e==null?void 0:e.in),i=+Ba(t,e)-+zI(t,e);return Math.round(i/fv)+1}function Le(n,e){const t=n<0?"-":"",i=Math.abs(n).toString().padStart(e,"0");return t+i}const Ei={y(n,e){const t=n.getFullYear(),i=t>0?t:1-t;return Le(e==="yy"?i%100:i,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):Le(t+1,2)},d(n,e){return Le(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return Le(n.getHours()%12||12,e.length)},H(n,e){return Le(n.getHours(),e.length)},m(n,e){return Le(n.getMinutes(),e.length)},s(n,e){return Le(n.getSeconds(),e.length)},S(n,e){const t=e.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,t-3));return Le(r,e.length)}},bo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bv={G:function(n,e,t){const i=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return t.ordinalNumber(r,{unit:"year"})}return Ei.y(n,e)},Y:function(n,e,t,i){const r=xv(n,i),o=r>0?r:1-r;if(e==="YY"){const a=o%100;return Le(a,2)}return e==="Yo"?t.ordinalNumber(o,{unit:"year"}):Le(o,e.length)},R:function(n,e){const t=yv(n);return Le(t,e.length)},u:function(n,e){const t=n.getFullYear();return Le(t,e.length)},Q:function(n,e,t){const i=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return Le(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,e,t){const i=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return Le(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,e,t){const i=n.getMonth();switch(e){case"M":case"MM":return Ei.M(n,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(n,e,t){const i=n.getMonth();switch(e){case"L":return String(i+1);case"LL":return Le(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(n,e,t,i){const r=BI(n,i);return e==="wo"?t.ordinalNumber(r,{unit:"week"}):Le(r,e.length)},I:function(n,e,t){const i=PI(n);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):Le(i,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):Ei.d(n,e)},D:function(n,e,t){const i=LI(n);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):Le(i,e.length)},E:function(n,e,t){const i=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(n,e,t,i){const r=n.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return Le(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(r,{width:"short",context:"formatting"});case"eeee":default:return t.day(r,{width:"wide",context:"formatting"})}},c:function(n,e,t,i){const r=n.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return Le(o,e.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(r,{width:"narrow",context:"standalone"});case"cccccc":return t.day(r,{width:"short",context:"standalone"});case"cccc":default:return t.day(r,{width:"wide",context:"standalone"})}},i:function(n,e,t){const i=n.getDay(),r=i===0?7:i;switch(e){case"i":return String(r);case"ii":return Le(r,e.length);case"io":return t.ordinalNumber(r,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(n,e,t){const i=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,e,t){const i=n.getHours();let r;switch(i===12?r=bo.noon:i===0?r=bo.midnight:r=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,e,t){const i=n.getHours();let r;switch(i>=17?r=bo.evening:i>=12?r=bo.afternoon:i>=4?r=bo.morning:r=bo.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let i=n.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return Ei.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):Ei.H(n,e)},K:function(n,e,t){const i=n.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):Le(i,e.length)},k:function(n,e,t){let i=n.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):Le(i,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ei.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):Ei.s(n,e)},S:function(n,e){return Ei.S(n,e)},X:function(n,e,t){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Sv(i);case"XXXX":case"XX":return dr(i);case"XXXXX":case"XXX":default:return dr(i,":")}},x:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"x":return Sv(i);case"xxxx":case"xx":return dr(i);case"xxxxx":case"xxx":default:return dr(i,":")}},O:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+wv(i,":");case"OOOO":default:return"GMT"+dr(i,":")}},z:function(n,e,t){const i=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+wv(i,":");case"zzzz":default:return"GMT"+dr(i,":")}},t:function(n,e,t){const i=Math.trunc(+n/1e3);return Le(i,e.length)},T:function(n,e,t){return Le(+n,e.length)}};function wv(n,e=""){const t=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),o=i%60;return o===0?t+String(r):t+String(r)+e+Le(o,2)}function Sv(n,e){return n%60===0?(n>0?"-":"+")+Le(Math.abs(n)/60,2):dr(n,e)}function dr(n,e=""){const t=n>0?"-":"+",i=Math.abs(n),r=Le(Math.trunc(i/60),2),o=Le(i%60,2);return t+r+e+o}const Tv=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Mv=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},VI=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],i=t[1],r=t[2];if(!r)return Tv(n,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Tv(i,e)).replace("{{time}}",Mv(r,e))},HI={p:Mv,P:VI},FI=/^D+$/,GI=/^Y+$/,WI=["D","DD","YY","YYYY"];function UI(n){return FI.test(n)}function YI(n){return GI.test(n)}function qI(n,e,t){const i=jI(n,e,t);if(console.warn(i),WI.includes(n))throw new RangeError(i)}function jI(n,e,t){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $I=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ZI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,XI=/^'([^]*?)'?$/,KI=/''/g,QI=/[a-zA-Z]/;function JI(n,e,t){var i,r,o,a,s,l,u,c;const h=za(),d=(t==null?void 0:t.locale)??h.locale??RI,f=(t==null?void 0:t.firstWeekContainsDate)??((r=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:r.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(o=h.locale)==null?void 0:o.options)==null?void 0:a.firstWeekContainsDate)??1,p=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((c=(u=h.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,g=Gt(n,t==null?void 0:t.in);if(!eI(g))throw new RangeError("Invalid time value");let m=e.match(ZI).map(v=>{const _=v[0];if(_==="p"||_==="P"){const b=HI[_];return b(v,d.formatLong)}return v}).join("").match($I).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const _=v[0];if(_==="'")return{isToken:!1,value:eE(v)};if(bv[_])return{isToken:!0,value:v};if(_.match(QI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:v}});d.localize.preprocessor&&(m=d.localize.preprocessor(g,m));const y={firstWeekContainsDate:f,weekStartsOn:p,locale:d};return m.map(v=>{if(!v.isToken)return v.value;const _=v.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&YI(_)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&UI(_))&&qI(_,e,String(n));const b=bv[_[0]];return b(g,_,d.localize,y)}).join("")}function eE(n){const e=n.match(XI);return e?e[1].replace(KI,"'"):n}function tE(){return Object.assign({},za())}function nE(n,e){const t=()=>ri(void 0,NaN),i=aE(n);let r;if(i.date){const l=sE(i.date,2);r=lE(l.restDateString,l.year)}if(!r||isNaN(+r))return t();const o=+r;let a=0,s;if(i.time&&(a=uE(i.time),isNaN(a)))return t();if(i.timezone){if(s=cE(i.timezone),isNaN(s))return t()}else{const l=new Date(o+a),u=Gt(0,void 0);return u.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),u.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),u}return Gt(o+a+s,void 0)}const Ol={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},iE=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,rE=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,oE=/^([+-])(\d{2})(?::?(\d{2}))?$/;function aE(n){const e={},t=n.split(Ol.dateTimeDelimiter);let i;if(t.length>2)return e;if(/:/.test(t[0])?i=t[0]:(e.date=t[0],i=t[1],Ol.timeZoneDelimiter.test(e.date)&&(e.date=n.split(Ol.timeZoneDelimiter)[0],i=n.substr(e.date.length,n.length))),i){const r=Ol.timezone.exec(i);r?(e.time=i.replace(r[1],""),e.timezone=r[1]):e.time=i}return e}function sE(n,e){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),i=n.match(t);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?r:o*100,restDateString:n.slice((i[1]||i[2]).length)}}function lE(n,e){if(e===null)return new Date(NaN);const t=n.match(iE);if(!t)return new Date(NaN);const i=!!t[4],r=Fa(t[1]),o=Fa(t[2])-1,a=Fa(t[3]),s=Fa(t[4]),l=Fa(t[5])-1;if(i)return gE(e,s,l)?hE(e,s,l):new Date(NaN);{const u=new Date(0);return!fE(e,o,a)||!pE(e,r)?new Date(NaN):(u.setUTCFullYear(e,o,Math.max(r,a)),u)}}function Fa(n){return n?parseInt(n):1}function uE(n){const e=n.match(rE);if(!e)return NaN;const t=$h(e[1]),i=$h(e[2]),r=$h(e[3]);return mE(t,i,r)?t*gv+i*pv+r*1e3:NaN}function $h(n){return n&&parseFloat(n.replace(",","."))||0}function cE(n){if(n==="Z")return 0;const e=n.match(oE);if(!e)return 0;const t=e[1]==="+"?-1:1,i=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return yE(i,r)?t*(i*gv+r*pv):NaN}function hE(n,e,t){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,o=(e-1)*7+t+1-r;return i.setUTCDate(i.getUTCDate()+o),i}const dE=[31,null,31,30,31,30,31,31,30,31,30,31];function Cv(n){return n%400===0||n%4===0&&n%100!==0}function fE(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(dE[e]||(Cv(n)?29:28))}function pE(n,e){return e>=1&&e<=(Cv(n)?366:365)}function gE(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function mE(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function yE(n,e){return e>=0&&e<=59}const kv="#6c7489",vE="#d60027",_E="#6c7489",xE="#ffc400",bE="16px",fr=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Dv=(n,e)=>(e||fr)[n%fr.length],wE="#afb7c5",Rl=(n,e,t,i)=>{let r;return t?r=wE:Array.isArray(i)?r=Dv(n,i):r=i[e],r||Dv(n)},SE=n=>{switch(n){case"error":return vE;case"warning":return xE;case"neutral":return kv;default:return kv}};function Iv(n,e,t){const i=tE(),r=CE(n,t.timeZone,t.locale??i.locale);return"formatToParts"in r?TE(r,e):ME(r,e)}function TE(n,e){const t=n.formatToParts(e);for(let i=t.length-1;i>=0;--i)if(t[i].type==="timeZoneName")return t[i].value}function ME(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(t);return i?i[0].substr(1):""}function CE(n,e,t){return new Intl.DateTimeFormat(t?[t.code,"en-US"]:void 0,{timeZone:e,timeZoneName:n})}function kE(n,e){const t=AE(e);return"formatToParts"in t?IE(t,n):EE(t,n)}const DE={year:0,month:1,day:2,hour:3,minute:4,second:5};function IE(n,e){try{const t=n.formatToParts(e),i=[];for(let r=0;r<t.length;r++){const o=DE[t[r].type];o!==void 0&&(i[o]=parseInt(t[r].value,10))}return i}catch(t){if(t instanceof RangeError)return[NaN];throw t}}function EE(n,e){const t=n.format(e),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Zh={},Ev=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),NE=Ev==="06/25/2014, 00:00:00"||Ev==="06/25/2014 00:00:00";function AE(n){return Zh[n]||(Zh[n]=NE?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Zh[n]}function Nv(n,e,t,i,r,o,a){const s=new Date(0);return s.setUTCFullYear(n,e,t),s.setUTCHours(i,r,o,a),s}const Av=36e5,OE=6e4,Xh={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Kh(n,e,t){if(!n)return 0;let i=Xh.timezoneZ.exec(n);if(i)return 0;let r,o;if(i=Xh.timezoneHH.exec(n),i)return r=parseInt(i[1],10),Ov(r)?-(r*Av):NaN;if(i=Xh.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Ov(r,a)?(o=Math.abs(r)*Av+a*OE,i[1]==="+"?-o:o):NaN}if(PE(n)){e=new Date(e||Date.now());const a=t?e:RE(e),s=Qh(a,n);return-(t?s:LE(e,s,n))}return NaN}function RE(n){return Nv(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Qh(n,e){const t=kE(n,e),i=Nv(t[0],t[1]-1,t[2],t[3]%24,t[4],t[5],0).getTime();let r=n.getTime();const o=r%1e3;return r-=o>=0?o:1e3+o,i-r}function LE(n,e,t){let i=n.getTime()-e;const r=Qh(new Date(i),t);if(e===r)return e;i-=r-e;const o=Qh(new Date(i),t);return r===o?r:Math.max(r,o)}function Ov(n,e){return-23<=n&&n<=23&&(e==null||0<=e&&e<=59)}const Rv={};function PE(n){if(Rv[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Rv[n]=!0,!0}catch{return!1}}const zE=60*1e3,BE={X:function(n,e,t){const i=Jh(t.timeZone,n);if(i===0)return"Z";switch(e){case"X":return Lv(i);case"XXXX":case"XX":return wo(i);case"XXXXX":case"XXX":default:return wo(i,":")}},x:function(n,e,t){const i=Jh(t.timeZone,n);switch(e){case"x":return Lv(i);case"xxxx":case"xx":return wo(i);case"xxxxx":case"xxx":default:return wo(i,":")}},O:function(n,e,t){const i=Jh(t.timeZone,n);switch(e){case"O":case"OO":case"OOO":return"GMT"+VE(i,":");case"OOOO":default:return"GMT"+wo(i,":")}},z:function(n,e,t){switch(e){case"z":case"zz":case"zzz":return Iv("short",n,t);case"zzzz":default:return Iv("long",n,t)}}};function Jh(n,e){const t=n?Kh(n,e,!0)/zE:(e==null?void 0:e.getTimezoneOffset())??0;if(Number.isNaN(t))throw new RangeError("Invalid time zone specified: "+n);return t}function Ll(n,e){const t=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<e;)i="0"+i;return t+i}function wo(n,e=""){const t=n>0?"-":"+",i=Math.abs(n),r=Ll(Math.floor(i/60),2),o=Ll(Math.floor(i%60),2);return t+r+e+o}function Lv(n,e){return n%60===0?(n>0?"-":"+")+Ll(Math.abs(n)/60,2):wo(n,e)}function VE(n,e=""){const t=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),o=i%60;return o===0?t+String(r):t+String(r)+e+Ll(o,2)}function Pv(n){const e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+n-+e}const HE=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ed=36e5,zv=6e4,FE=2,Mt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:HE};function Bv(n,e={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const t=e.additionalDigits==null?FE:Number(e.additionalDigits);if(t!==2&&t!==1&&t!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=GE(n),{year:r,restDateString:o}=WE(i.date,t),a=UE(o,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const s=a.getTime();let l=0,u;if(i.time&&(l=YE(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||e.timeZone){if(u=Kh(i.timeZone||e.timeZone,new Date(s+l)),isNaN(u))return new Date(NaN)}else u=Pv(new Date(s+l)),u=Pv(new Date(s+l+u));return new Date(s+l+u)}else return new Date(NaN)}function GE(n){const e={};let t=Mt.dateTimePattern.exec(n),i;if(t?(e.date=t[1],i=t[3]):(t=Mt.datePattern.exec(n),t?(e.date=t[1],i=t[2]):(e.date=null,i=n)),i){const r=Mt.timeZone.exec(i);r?(e.time=i.replace(r[1],""),e.timeZone=r[1].trim()):e.time=i}return e}function WE(n,e){if(n){const t=Mt.YYY[e],i=Mt.YYYYY[e];let r=Mt.YYYY.exec(n)||i.exec(n);if(r){const o=r[1];return{year:parseInt(o,10),restDateString:n.slice(o.length)}}if(r=Mt.YY.exec(n)||t.exec(n),r){const o=r[1];return{year:parseInt(o,10)*100,restDateString:n.slice(o.length)}}}return{year:null}}function UE(n,e){if(e===null)return null;let t,i,r;if(!n||!n.length)return t=new Date(0),t.setUTCFullYear(e),t;let o=Mt.MM.exec(n);if(o)return t=new Date(0),i=parseInt(o[1],10)-1,Fv(e,i)?(t.setUTCFullYear(e,i),t):new Date(NaN);if(o=Mt.DDD.exec(n),o){t=new Date(0);const a=parseInt(o[1],10);return $E(e,a)?(t.setUTCFullYear(e,0,a),t):new Date(NaN)}if(o=Mt.MMDD.exec(n),o){t=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return Fv(e,i,a)?(t.setUTCFullYear(e,i,a),t):new Date(NaN)}if(o=Mt.Www.exec(n),o)return r=parseInt(o[1],10)-1,Gv(r)?Vv(e,r):new Date(NaN);if(o=Mt.WwwD.exec(n),o){r=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return Gv(r,a)?Vv(e,r,a):new Date(NaN)}return null}function YE(n){let e,t,i=Mt.HH.exec(n);if(i)return e=parseFloat(i[1].replace(",",".")),td(e)?e%24*ed:NaN;if(i=Mt.HHMM.exec(n),i)return e=parseInt(i[1],10),t=parseFloat(i[2].replace(",",".")),td(e,t)?e%24*ed+t*zv:NaN;if(i=Mt.HHMMSS.exec(n),i){e=parseInt(i[1],10),t=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return td(e,t,r)?e%24*ed+t*zv+r*1e3:NaN}return null}function Vv(n,e,t){e=e||0,t=t||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,o=e*7+t+1-r;return i.setUTCDate(i.getUTCDate()+o),i}const qE=[31,28,31,30,31,30,31,31,30,31,30,31],jE=[31,29,31,30,31,30,31,31,30,31,30,31];function Hv(n){return n%400===0||n%4===0&&n%100!==0}function Fv(n,e,t){if(e<0||e>11)return!1;if(t!=null){if(t<1)return!1;const i=Hv(n);if(i&&t>jE[e]||!i&&t>qE[e])return!1}return!0}function $E(n,e){if(e<1)return!1;const t=Hv(n);return!(t&&e>366||!t&&e>365)}function Gv(n,e){return!(n<0||n>52||e!=null&&(e<0||e>6))}function td(n,e,t){return!(n<0||n>=25||e!=null&&(e<0||e>=60)||t!=null&&(t<0||t>=60))}const ZE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function XE(n,e,t={}){e=String(e);const i=e.match(ZE);if(i){const r=Bv(t.originalDate||n,t);e=i.reduce(function(o,a){if(a[0]==="'")return o;const s=o.indexOf(a),l=o[s-1]==="'",u=o.replace(a,"'"+BE[a[0]](r,a,t)+"'");return l?u.substring(0,s-1)+u.substring(s+1):u},e)}return JI(n,e,t)}function KE(n,e,t){n=Bv(n,t);const i=Kh(e,n,!0),r=new Date(n.getTime()-i),o=new Date(0);return o.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),o.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),o}function Ga(n,e,t,i){return i={...i,timeZone:e,originalDate:n},XE(KE(n,e,{timeZone:i.timeZone}),t,i)}const QE=(n,e)=>`${Ga(n,e,"yyyy")} W${Ga(n,e,"II")}`,nd="MMM dd, yyyy h:mm:ss a",Ni="MMM dd, yyyy h:mm a",JE={secondly:()=>nd,tenSecondly:()=>nd,thirtySecondly:()=>nd,minutely:()=>Ni,fiveMinutely:()=>Ni,tenMinutely:()=>Ni,thirtyMinutely:()=>Ni,hourly:()=>Ni,twoHourly:()=>Ni,twelveHourly:()=>Ni,daily:()=>Ni};function e2({tickValue:n,granularity:e,timezone:t,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:o,defaultFormat:a}){const s=t||Intl.DateTimeFormat().resolvedOptions().timeZone;if(e==="weekly")return QE(n,s);if(r&&r[e]){const l=r[e](i);return Ga(n,s,l)}if(o&&o[e]){const l=o[e]();return Ga(n,s,l)}return Ga(n,s,a)}const Pl=({tickValue:n,granularity:e,timezone:t})=>e2({tickValue:n,granularity:e,timezone:t,tooltipMap:JE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),t2=(n,e,t=1)=>{const i=Math.max(0,Math.ceil((e-n)/t));return Array(i).fill(n).map((r,o)=>r+o*t)},n2=n=>{if(typeof n=="string"){const e=+n;if(e)return e;const t=nE(n).valueOf();return Number.isFinite(t)?t:0}return n},i2=(n,e,t,i,r)=>{const o=r&&r.length?Math.max(...r.map(u=>new Date(u.timestamp).valueOf())):e-6e4,a=Math.max(e-6e4,o),s=Math.floor((n-i)/t)*t+i,l=Math.floor((a-i)/t)*t+i+t;return t2(s,l,t)},Wv=(n,e,t)=>{const i=e[1]-n[1];if(i===0)return e[0];const r=(t-n[1])/i;return n[0]+r*(e[0]-n[0])},r2=(n,e)=>{const t=[];return e.filter(i=>i.highlightIntersections).forEach(i=>{const r=n.map(([a,s])=>({ts:a,aboveThreshold:s>=i.value}));let o=r[0].aboveThreshold?n[0][0]:void 0;for(let a=1;a<r.length;a++)!r[a-1].aboveThreshold&&r[a].aboveThreshold?o=Wv(n[a-1],n[a],i.value):r[a-1].aboveThreshold&&!r[a].aboveThreshold&&o!==void 0&&(t.push({start:o,end:Wv(n[a-1],n[a],i.value),type:i.type}),o=void 0);o!==void 0&&t.push({start:o,end:r[r.length-1].ts,type:i.type})}),t};function o2({exploreResult:n,chartType:e,tooltipState:t,stacked:i=x.ref(!1),threshold:r=x.ref(void 0),colorPalette:o=x.ref(fr)}){const{i18n:a}=Wa.useI18n();return{option:x.computed(()=>{try{if(!n.value||!("meta"in n.value)||!("data"in n.value))return{};const s=n.value.data,{display:l,metric_names:u,start_ms:c,end_ms:h,granularity_ms:d}=n.value.meta;if(!u)return console.error("Missing metric names"),{};if(typeof d!="number"||isNaN(d)||!isFinite(d)||d===0)return console.error("Invalid step value:",d),{};if(!s||!s.length)return{};const f=l&&Object.keys(l)||u,p=f[0],g=l==null?void 0:l[p];let m=g&&Object.keys(g).map(w=>({id:w,name:g[w].name}))||u.map(w=>({id:w,name:w}));p==="country_code"&&(m=m.map(w=>({...w,name:qh(w.id)||w.name})));const y=n2(c),v=i2(c,h,d,y,s),_=s.reduce((w,S)=>{const M=new Date(S.timestamp).valueOf(),C=S.event;if(M in w||(w[M]={}),f.length===0)for(const I of u)I in w[M]||(w[M][I]={}),C[I]!==void 0&&(w[M][I][I]=Math.round(Number(C[I])*1e3)/1e3);else for(const I of u)I in w[M]||(w[M][I]={}),m.forEach(E=>{if(C[p]===E.id||I===E.id){const k=C[I];k!==void 0&&(w[M][I][E.name]=Math.round(Number(k)*1e3)/1e3)}});return w},{}),b=(u.length===1?u.flatMap(w=>m.map(S=>[w,S.name,S.id==="empty"])):m.map(w=>[w.name,w.name,w.id==="empty"])).map(([w,S,M],C)=>{const I=v.map(V=>{var z,H;const F=((H=(z=_[V])==null?void 0:z[w])==null?void 0:H[S])??0;return[V,F]}),E=Rl(C,S,M,o.value),k=I.reduce((V,[,z])=>V+Number(z),0),D=a&&typeof a.te=="function"&&a.te(`chartLabels.${S}`)?a.t(`chartLabels.${S}`):S,A={timeseries_line:"line",timeseries_bar:"bar"};let R=[],L=[];return r.value&&(R=Object.values(r.value).flatMap(V=>r2(I,V)).map(V=>{const{start:z,end:H}=V;return[{xAxis:z,yAxis:0,itemStyle:{color:"rgba(255, 0, 0, 0.2)"}},{xAxis:H,yAxis:1/0}]}),L=Object.values(r.value).flatMap(V=>V.map(z=>({yAxis:z.value,label:{show:!1,position:"middle",formatter:`${z.type}: ${z.value}`},lineStyle:{color:SE(z.type),type:"dashed"}})))),{type:A[e.value],name:D,data:I,showSymbol:!1,smooth:!1,sampling:"lttb",lineStyle:{width:i.value?0:2},itemStyle:{color:E,borderColor:E},areaStyle:i.value?{}:void 0,emphasis:{focus:"series"},stack:i.value?"total":void 0,z:k,isSegmentEmpty:M,markLine:{data:C===0?L:[]},markArea:{silent:!0,data:R}}});p==="status_code"||p==="status_code_grouped"?b.sort((w,S)=>String(w.name)<String(S.name)?-1:1):b.sort((w,S)=>{const M=C=>{var I;return((I=C.data)==null?void 0:I.reduce((E,[,k])=>E+Number(k),0))||0};return M(w)<M(S)?-1:1});const T={tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:w=>{var S;t.value.entries=w.map(M=>({label:M.seriesName,value:M.value[1],backgroundColor:M.color,borderColor:M.borderColor})),t.value.visible=!0,t.value.subtitle=(S=w[0])==null?void 0:S.axisValueLabel}},xAxis:{type:"time",scale:!0,name:"@timestamp per 5 minuntes",nameGap:30,nameLocation:"middle",axisLabel:{margin:6}},yAxis:{type:"value",axisLine:{show:!0},name:"Request count",nameGap:50,nameLocation:"middle",axisLabel:{margin:6}},legend:{type:"scroll",bottom:0,left:"center"},series:b,toolbox:{show:!1},brush:{brushType:"lineX",xAxisIndex:[0]},media:[{query:{maxHeight:200},option:{grid:{bottom:0,top:0,left:0,right:0},xAxis:{show:!1},yAxis:{show:!1},legend:{show:!1}}},{query:{minHeight:201},option:{grid:{top:25,left:25,right:25,bottom:50,containLabel:!0},xAxis:{name:"@timestamp per 5 minutes",show:!0},yAxis:{name:"Request count",show:!0},legend:{show:!0}}},{query:{maxWidth:500},option:{grid:{left:0},yAxis:{show:!1}}}]};return console.log("EChart option generated:",T),T}catch(s){return console.error(s),{}}})}}function a2({exploreResult:n,chartType:e,tooltipState:t,stacked:i=x.ref(!0),colorPalette:r=x.ref(fr)}){const{i18n:o}=Wa.useI18n(),a=x.computed(()=>{try{if(!n.value||!("meta"in n.value)||!("data"in n.value))return{};const u=n.value.data,{display:c,metric_names:h}=n.value.meta,d=c&&Object.keys(c),f=h&&h.length>1,p=c&&d&&d.length>0;if(!u.length||!h)return{series:[],xAxis:{},yAxis:{}};const g=p&&d||h,m=g[0],y=g.length>1?g[1]:g[0],v=Object.fromEntries(f?u.flatMap(k=>h.map((D,A)=>{const R=k.event[m],L=p?`${R},${D}`:`${A},${D}`,V=k.event[D];return[L,V]})):u.map(k=>{const D=p?`${k.event[m]},${k.event[y]}`:`${m},${y}`,A=k.event[h[0]];return[D,A]})),_=Object.keys(v).reduce((k,D)=>{const[A]=D.split(","),R=v[D];return k[A]?k[A]+=R:k[A]=R,k},{}),b=Object.entries(_).sort(([,k],[,D])=>Number(D)-Number(k)).map(([k])=>k),T=c[m],w=c[y];let S=p&&T&&Object.entries(T).map(([k,D])=>({id:k,name:D.name}))||h.map(k=>({id:k,name:k})),M=p&&w&&Object.entries(w).map(([k,D])=>({id:k,name:D.name}))||h.map(k=>({id:k,name:k}));if(p&&m==="country_code"&&(S=S.map(k=>({...k,name:qh(k.id)||k.name}))),p&&y==="country_code"&&(M=M.map(k=>({...k,name:qh(k.id)||k.name}))),m!=="status_code"&&m!=="status_code_grouped"&&(S.sort((k,D)=>b.indexOf(k.id)-b.indexOf(D.id)),M.sort((k,D)=>b.indexOf(k.id)-b.indexOf(D.id))),!S||!M)return{series:[],xAxis:{},yAxis:{}};if(e.value==="donut"){const k=S.map((D,A)=>{const R=M.reduce((V,z)=>{const H=p?v[`${D.id},${z.id}`]:v[`${A},${z.id}`];return V+(Number(H)||0)},0),L=Rl(A,D.name,D.id==="empty",Array.isArray(r)?r:fr);return{name:o&&typeof o.te=="function"&&o.te(`chartLabels.${D.name}`)?o.t(`chartLabels.${D.name}`):D.name,value:R,itemStyle:{color:L}}});return{tooltip:{trigger:"item",formatter:D=>{t.value.entries=[{label:D.name,value:D.value,backgroundColor:D.color,borderColor:D.color,rawValue:0}],t.value.visible=!0,t.value.subtitle=`${D.percent}%`}},legend:{type:"scroll",bottom:0,left:"center"},series:[{type:"pie",radius:["40%","70%"],data:k,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}}const C=f?h.map((k,D)=>{const A=S.map((L,V)=>p?v[`${L.id},${k}`]||0:v[`${V},${k}`]||null),R=Rl(D,k,!1,Array.isArray(r)?r:fr);return{name:o&&typeof o.te=="function"&&o.te(`chartLabels.${k}`)?o.t(`chartLabels.${k}`):k,type:"bar",data:A,itemStyle:{color:R},stack:i.value?"total":void 0,label:{show:!0,position:i.value?"inside":"top",formatter:"{c}"},selectedMode:"single",select:{itemStyle:{borderColor:"#000",borderWidth:3,shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}},emphasis:{focus:"self",itemStyle:{borderColor:"#000",borderWidth:2}}}}):M.map((k,D)=>{if(!k)return null;const A=Rl(D,k.name,k.id==="empty",Array.isArray(r)?r:fr),R=S.map(L=>v[`${L.id},${k.id}`]||null);return{name:o&&typeof o.te=="function"&&o.te(`chartLabels.${k.name}`)?o.t(`chartLabels.${k.name}`):k.name,type:"bar",data:R,itemStyle:{color:A},stack:i.value?"total":void 0,isSegmentEmpty:k.id==="empty",label:{show:!0,position:"top",formatter:"{c} requests"},selectedMode:"single",select:{itemStyle:{borderColor:"#000",borderWidth:3,shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}},emphasis:{focus:"self",itemStyle:{borderColor:"#000",borderWidth:2}}}}).filter(k=>k!==null),I=p?S.map(k=>o&&typeof o.te=="function"&&o.te(`chartLabels.${k.name}`)?o.t(`chartLabels.${k.name}`):k.name):h.map(k=>o&&typeof o.te=="function"&&o.te(`chartLabels.${k}`)?o.t(`chartLabels.${k}`):k),E=e.value==="horizontal_bar";return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:k=>{var D;const A=k.filter(R=>R.value!==null&&R.value!==void 0&&R.value!==0);A.length!==0&&(t.value.entries=A.map(R=>({label:R.seriesName,value:R.value,backgroundColor:R.color,borderColor:R.color,rawValue:R.value})),t.value.visible=!0,t.value.subtitle=(D=k[0])==null?void 0:D.axisValueLabel)}},legend:{type:"scroll",bottom:0,left:"center"},grid:{left:"3%",right:"4%",bottom:"50px",top:"25px",containLabel:!0},xAxis:E?{type:"value",axisLine:{show:!0}}:{type:"category",data:I,axisLine:{show:!0}},yAxis:E?{type:"category",data:I,axisLine:{show:!0}}:{type:"value",axisLine:{show:!0}},series:C}}catch(u){return console.error(u),{}}}),s=x.computed(()=>{if(!n.value||!("meta"in n.value))return!1;const{display:u}=n.value.meta,c=u&&Object.keys(u);return u&&c&&c.length>0&&c.length>1}),l=x.computed(()=>{if(!n.value||!("meta"in n.value))return[];const{display:u,metric_names:c}=n.value.meta,h=u&&Object.keys(u);if(!(u&&h&&h.length>0))return[];const d=h[0],f=u[d];return(f&&Object.entries(f).map(([p,g])=>({id:p,name:g.name}))||(c==null?void 0:c.map(p=>({id:p,name:p})))||[]).map(p=>p.id==="empty")});return{option:a,isMultiDimension:s,isLabelEmpty:l}}const s2={title:"Title of the header",content:"Content of the header"},l2={zoom:"Zoom in",explore:"Explore",view_requests:"View requests"},u2={from:"From",to:"To"},c2={header:s2,zoom_action_items:l2,zoom_time_range:u2};function h2(){const n=yo.createI18n("en-us",c2);return{i18n:n,i18nT:yo.i18nTComponent(n)}}const Wa={useI18n:h2,useExploreResultToEchartTimeseries:o2,useExploreResultToEChartCrossSectional:a2};/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */var id=function(n,e){return id=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])},id(n,e)};function W(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");id(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var rd=12,Uv="sans-serif",oi=rd+"px "+Uv,d2=20,f2=100,p2="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function g2(n){var e={};if(typeof JSON>"u")return e;for(var t=0;t<n.length;t++){var i=String.fromCharCode(t+32),r=(n.charCodeAt(t)-d2)/f2;e[i]=r}return e}var m2=g2(p2),ai={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var n,e;return function(t,i){if(!n){var r=ai.createCanvas();n=r&&r.getContext("2d")}if(n)return e!==i&&(e=n.font=i||oi),n.measureText(t);t=t||"",i=i||oi;var o=/((?:\d+)?\.?\d*)px/.exec(i),a=o&&+o[1]||rd,s=0;if(i.indexOf("mono")>=0)s=a*t.length;else for(var l=0;l<t.length;l++){var u=m2[t[l]];s+=u==null?a:u*a}return{width:s}}}(),loadImage:function(n,e,t){var i=new Image;return i.onload=e,i.onerror=t,i.src=n,i}},Yv=Ai(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(n,e){return n["[object "+e+"]"]=!0,n},{}),qv=Ai(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(n,e){return n["[object "+e+"Array]"]=!0,n},{}),So=Object.prototype.toString,zl=Array.prototype,y2=zl.forEach,v2=zl.filter,od=zl.slice,_2=zl.map,jv=(function(){}).constructor,Bl=jv?jv.prototype:null,ad="__proto__",x2=2311;function $v(){return x2++}function Nn(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];typeof console<"u"&&console.error.apply(console,n)}function ue(n){if(n==null||typeof n!="object")return n;var e=n,t=So.call(n);if(t==="[object Array]"){if(!Ua(n)){e=[];for(var i=0,r=n.length;i<r;i++)e[i]=ue(n[i])}}else if(qv[t]){if(!Ua(n)){var o=n.constructor;if(o.from)e=o.from(n);else{e=new o(n.length);for(var i=0,r=n.length;i<r;i++)e[i]=n[i]}}}else if(!Yv[t]&&!Ua(n)&&!pr(n)){e={};for(var a in n)n.hasOwnProperty(a)&&a!==ad&&(e[a]=ue(n[a]))}return e}function _e(n,e,t){if(!ne(e)||!ne(n))return t?ue(e):n;for(var i in e)if(e.hasOwnProperty(i)&&i!==ad){var r=n[i],o=e[i];ne(o)&&ne(r)&&!q(o)&&!q(r)&&!pr(o)&&!pr(r)&&!Zv(o)&&!Zv(r)&&!Ua(o)&&!Ua(r)?_e(r,o,t):(t||!(i in n))&&(n[i]=ue(e[i]))}return n}function b2(n,e){for(var t=n[0],i=1,r=n.length;i<r;i++)t=_e(t,n[i],e);return t}function U(n,e){if(Object.assign)Object.assign(n,e);else for(var t in e)e.hasOwnProperty(t)&&t!==ad&&(n[t]=e[t]);return n}function Me(n,e,t){for(var i=Ce(e),r=0,o=i.length;r<o;r++){var a=i[r];n[a]==null&&(n[a]=e[a])}return n}function be(n,e){if(n){if(n.indexOf)return n.indexOf(e);for(var t=0,i=n.length;t<i;t++)if(n[t]===e)return t}return-1}function w2(n,e){var t=n.prototype;function i(){}i.prototype=e.prototype,n.prototype=new i;for(var r in t)t.hasOwnProperty(r)&&(n.prototype[r]=t[r]);n.prototype.constructor=n,n.superClass=e}function yn(n,e,t){if(n="prototype"in n?n.prototype:n,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),r=0;r<i.length;r++){var o=i[r];o!=="constructor"&&n[o]==null&&(n[o]=e[o])}else Me(n,e)}function Ot(n){return!n||typeof n=="string"?!1:typeof n.length=="number"}function N(n,e,t){if(n&&e)if(n.forEach&&n.forEach===y2)n.forEach(e,t);else if(n.length===+n.length)for(var i=0,r=n.length;i<r;i++)e.call(t,n[i],i,n);else for(var o in n)n.hasOwnProperty(o)&&e.call(t,n[o],o,n)}function $(n,e,t){if(!n)return[];if(!e)return sd(n);if(n.map&&n.map===_2)return n.map(e,t);for(var i=[],r=0,o=n.length;r<o;r++)i.push(e.call(t,n[r],r,n));return i}function Ai(n,e,t,i){if(n&&e){for(var r=0,o=n.length;r<o;r++)t=e.call(i,t,n[r],r,n);return t}}function $e(n,e,t){if(!n)return[];if(!e)return sd(n);if(n.filter&&n.filter===v2)return n.filter(e,t);for(var i=[],r=0,o=n.length;r<o;r++)e.call(t,n[r],r,n)&&i.push(n[r]);return i}function S2(n,e,t){if(n&&e){for(var i=0,r=n.length;i<r;i++)if(e.call(t,n[i],i,n))return n[i]}}function Ce(n){if(!n)return[];if(Object.keys)return Object.keys(n);var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push(t);return e}function T2(n,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return function(){return n.apply(e,t.concat(od.call(arguments)))}}var ke=Bl&&ce(Bl.bind)?Bl.call.bind(Bl.bind):T2;function we(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return function(){return n.apply(this,e.concat(od.call(arguments)))}}function q(n){return Array.isArray?Array.isArray(n):So.call(n)==="[object Array]"}function ce(n){return typeof n=="function"}function Q(n){return typeof n=="string"}function Vl(n){return So.call(n)==="[object String]"}function Ne(n){return typeof n=="number"}function ne(n){var e=typeof n;return e==="function"||!!n&&e==="object"}function Zv(n){return!!Yv[So.call(n)]}function Ct(n){return!!qv[So.call(n)]}function pr(n){return typeof n=="object"&&typeof n.nodeType=="number"&&typeof n.ownerDocument=="object"}function Hl(n){return n.colorStops!=null}function M2(n){return n.image!=null}function C2(n){return So.call(n)==="[object RegExp]"}function To(n){return n!==n}function vn(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=0,i=n.length;t<i;t++)if(n[t]!=null)return n[t]}function te(n,e){return n??e}function si(n,e,t){return n??e??t}function sd(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return od.apply(n,e)}function ld(n){if(typeof n=="number")return[n,n,n,n];var e=n.length;return e===2?[n[0],n[1],n[0],n[1]]:e===3?[n[0],n[1],n[2],n[1]]:n}function J(n,e){if(!n)throw new Error(e)}function An(n){return n==null?null:typeof n.trim=="function"?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var Xv="__ec_primitive__";function ud(n){n[Xv]=!0}function Ua(n){return n[Xv]}var k2=function(){function n(){this.data={}}return n.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},n.prototype.has=function(e){return this.data.hasOwnProperty(e)},n.prototype.get=function(e){return this.data[e]},n.prototype.set=function(e,t){return this.data[e]=t,this},n.prototype.keys=function(){return Ce(this.data)},n.prototype.forEach=function(e){var t=this.data;for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},n}(),Kv=typeof Map=="function";function D2(){return Kv?new Map:new k2}var I2=function(){function n(e){var t=q(e);this.data=D2();var i=this;e instanceof n?e.each(r):e&&N(e,r);function r(o,a){t?i.set(o,a):i.set(a,o)}}return n.prototype.hasKey=function(e){return this.data.has(e)},n.prototype.get=function(e){return this.data.get(e)},n.prototype.set=function(e,t){return this.data.set(e,t),t},n.prototype.each=function(e,t){this.data.forEach(function(i,r){e.call(t,i,r)})},n.prototype.keys=function(){var e=this.data.keys();return Kv?Array.from(e):e},n.prototype.removeKey=function(e){this.data.delete(e)},n}();function me(n){return new I2(n)}function E2(n,e){for(var t=new n.constructor(n.length+e.length),i=0;i<n.length;i++)t[i]=n[i];for(var r=n.length,i=0;i<e.length;i++)t[i+r]=e[i];return t}function Fl(n,e){var t;if(Object.create)t=Object.create(n);else{var i=function(){};i.prototype=n,t=new i}return e&&U(t,e),t}function Qv(n){var e=n.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function _n(n,e){return n.hasOwnProperty(e)}function nt(){}var Gl=180/Math.PI,N2=function(){function n(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return n}(),A2=function(){function n(){this.browser=new N2,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 n}(),fe=new A2;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(fe.wxa=!0,fe.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?fe.worker=!0:!fe.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(fe.node=!0,fe.svgSupported=!0):O2(navigator.userAgent,fe);function O2(n,e){var t=e.browser,i=n.match(/Firefox\/([\d.]+)/),r=n.match(/MSIE\s([\d.]+)/)||n.match(/Trident\/.+?rv:(([\d.]+))/),o=n.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(n);i&&(t.firefox=!0,t.version=i[1]),r&&(t.ie=!0,t.version=r[1]),o&&(t.edge=!0,t.version=o[1],t.newEdge=+o[1].split(".")[0]>18),a&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11);var s=e.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in l||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}}var R2=".",gr="___EC__COMPONENT__CONTAINER___",Jv="___EC__EXTENDED_CLASS___";function On(n){var e={main:"",sub:""};if(n){var t=n.split(R2);e.main=t[0]||"",e.sub=t[1]||""}return e}function L2(n){J(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n),'componentType "'+n+'" illegal')}function P2(n){return!!(n&&n[Jv])}function cd(n,e){n.$constructor=n,n.extend=function(t){process.env.NODE_ENV!=="production"&&N(e,function(o){t[o]||console.warn("Method `"+o+"` should be implemented"+(t.type?" in "+t.type:"")+".")});var i=this,r;return z2(i)?r=function(o){W(a,o);function a(){return o.apply(this,arguments)||this}return a}(i):(r=function(){(t.$constructor||i).apply(this,arguments)},w2(r,this)),U(r.prototype,t),r[Jv]=!0,r.extend=this.extend,r.superCall=H2,r.superApply=F2,r.superClass=i,r}}function z2(n){return ce(n)&&/^class\s/.test(Function.prototype.toString.call(n))}function e0(n,e){n.extend=e.extend}var B2=Math.round(Math.random()*10);function V2(n){var e=["__\0is_clz",B2++].join("_");n.prototype[e]=!0,process.env.NODE_ENV!=="production"&&J(!n.isInstance,'The method "is" can not be defined.'),n.isInstance=function(t){return!!(t&&t[e])}}function H2(n,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return this.superClass.prototype[e].apply(n,t)}function F2(n,e,t){return this.superClass.prototype[e].apply(n,t)}function Wl(n){var e={};n.registerClass=function(i){var r=i.type||i.prototype.type;if(r){L2(r),i.prototype.type=r;var o=On(r);if(!o.sub)process.env.NODE_ENV!=="production"&&e[o.main]&&console.warn(o.main+" exists."),e[o.main]=i;else if(o.sub!==gr){var a=t(o);a[o.sub]=i}}return i},n.getClass=function(i,r,o){var a=e[i];if(a&&a[gr]&&(a=r?a[r]:null),o&&!a)throw new Error(r?"Component "+i+"."+(r||"")+" is used but not imported.":i+".type should be specified.");return a},n.getClassesByMainType=function(i){var r=On(i),o=[],a=e[r.main];return a&&a[gr]?N(a,function(s,l){l!==gr&&o.push(s)}):o.push(a),o},n.hasClass=function(i){var r=On(i);return!!e[r.main]},n.getAllClassMainTypes=function(){var i=[];return N(e,function(r,o){i.push(o)}),i},n.hasSubTypes=function(i){var r=On(i),o=e[r.main];return o&&o[gr]};function t(i){var r=e[i.main];return(!r||!r[gr])&&(r=e[i.main]={},r[gr]=!0),r}}function Ya(n,e){for(var t=0;t<n.length;t++)n[t][1]||(n[t][1]=n[t][0]);return e=e||!1,function(i,r,o){for(var a={},s=0;s<n.length;s++){var l=n[s][1];if(!(r&&be(r,l)>=0||o&&be(o,l)<0)){var u=i.getShallow(l,e);u!=null&&(a[n[s][0]]=u)}}return a}}var G2=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],W2=Ya(G2),U2=function(){function n(){}return n.prototype.getAreaStyle=function(e,t){return W2(this,e,t)},n}(),t0=function(){function n(e){this.value=e}return n}(),Y2=function(){function n(){this._len=0}return n.prototype.insert=function(e){var t=new t0(e);return this.insertEntry(t),t},n.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++},n.prototype.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},n.prototype.len=function(){return this._len},n.prototype.clear=function(){this.head=this.tail=null,this._len=0},n}(),Mo=function(){function n(e){this._list=new Y2,this._maxSize=10,this._map={},this._maxSize=e}return n.prototype.put=function(e,t){var i=this._list,r=this._map,o=null;if(r[e]==null){var a=i.len(),s=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var l=i.head;i.remove(l),delete r[l.key],o=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new t0(t),s.key=e,i.insertEntry(s),r[e]=s}return o},n.prototype.get=function(e){var t=this._map[e],i=this._list;if(t!=null)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},n.prototype.clear=function(){this._list.clear(),this._map={}},n.prototype.len=function(){return this._list.len()},n}(),hd=new Mo(50);function q2(n){if(typeof n=="string"){var e=hd.get(n);return e&&e.image}else return n}function dd(n,e,t,i,r){if(n)if(typeof n=="string"){if(e&&e.__zrImageSrc===n||!t)return e;var o=hd.get(n),a={hostEl:t,cb:i,cbPayload:r};return o?(e=o.image,!Ul(e)&&o.pending.push(a)):(e=ai.loadImage(n,n0,n0),e.__zrImageSrc=n,hd.put(n,e.__cachedImgObj={image:e,pending:[a]})),e}else return n;else return e}function n0(){var n=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<n.pending.length;e++){var t=n.pending[e],i=t.cb;i&&i(this,t.cbPayload),t.hostEl.dirty()}n.pending.length=0}function Ul(n){return n&&n.width&&n.height}function li(){return[1,0,0,1,0,0]}function fd(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,n}function i0(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function qa(n,e,t){var i=e[0]*t[0]+e[2]*t[1],r=e[1]*t[0]+e[3]*t[1],o=e[0]*t[2]+e[2]*t[3],a=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return n[0]=i,n[1]=r,n[2]=o,n[3]=a,n[4]=s,n[5]=l,n}function pd(n,e,t){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4]+t[0],n[5]=e[5]+t[1],n}function gd(n,e,t,i){i===void 0&&(i=[0,0]);var r=e[0],o=e[2],a=e[4],s=e[1],l=e[3],u=e[5],c=Math.sin(t),h=Math.cos(t);return n[0]=r*h+s*c,n[1]=-r*c+s*h,n[2]=o*h+l*c,n[3]=-o*c+h*l,n[4]=h*(a-i[0])+c*(u-i[1])+i[0],n[5]=h*(u-i[1])-c*(a-i[0])+i[1],n}function j2(n,e,t){var i=t[0],r=t[1];return n[0]=e[0]*i,n[1]=e[1]*r,n[2]=e[2]*i,n[3]=e[3]*r,n[4]=e[4]*i,n[5]=e[5]*r,n}function ja(n,e){var t=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],l=t*a-o*i;return l?(l=1/l,n[0]=a*l,n[1]=-o*l,n[2]=-i*l,n[3]=t*l,n[4]=(i*s-a*r)*l,n[5]=(o*r-t*s)*l,n):null}var ye=function(){function n(e,t){this.x=e||0,this.y=t||0}return n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.set=function(e,t){return this.x=e,this.y=t,this},n.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},n.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},n.prototype.scale=function(e){this.x*=e,this.y*=e},n.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},n.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},n.prototype.dot=function(e){return this.x*e.x+this.y*e.y},n.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},n.prototype.distance=function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},n.prototype.distanceSquare=function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},n.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},n.prototype.transform=function(e){if(e){var t=this.x,i=this.y;return this.x=e[0]*t+e[2]*i+e[4],this.y=e[1]*t+e[3]*i+e[5],this}},n.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},n.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},n.set=function(e,t,i){e.x=t,e.y=i},n.copy=function(e,t){e.x=t.x,e.y=t.y},n.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},n.lenSquare=function(e){return e.x*e.x+e.y*e.y},n.dot=function(e,t){return e.x*t.x+e.y*t.y},n.add=function(e,t,i){e.x=t.x+i.x,e.y=t.y+i.y},n.sub=function(e,t,i){e.x=t.x-i.x,e.y=t.y-i.y},n.scale=function(e,t,i){e.x=t.x*i,e.y=t.y*i},n.scaleAndAdd=function(e,t,i,r){e.x=t.x+i.x*r,e.y=t.y+i.y*r},n.lerp=function(e,t,i,r){var o=1-r;e.x=o*t.x+r*i.x,e.y=o*t.y+r*i.y},n}(),mr=Math.min,Co=Math.max,md=Math.abs,r0=["x","y"],$2=["width","height"],yr=new ye,vr=new ye,_r=new ye,xr=new ye,Wt=a0(),$a=Wt.minTv,yd=Wt.maxTv,Za=[0,0],ve=function(){function n(e,t,i,r){n.set(this,e,t,i,r)}return n.set=function(e,t,i,r,o){return r<0&&(t=t+r,r=-r),o<0&&(i=i+o,o=-o),e.x=t,e.y=i,e.width=r,e.height=o,e},n.prototype.union=function(e){var t=mr(e.x,this.x),i=mr(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Co(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Co(e.y+e.height,this.y+this.height)-i:this.height=e.height,this.x=t,this.y=i},n.prototype.applyTransform=function(e){n.applyTransform(this,this,e)},n.prototype.calculateTransform=function(e){var t=this,i=e.width/t.width,r=e.height/t.height,o=li();return pd(o,o,[-t.x,-t.y]),j2(o,o,[i,r]),pd(o,o,[e.x,e.y]),o},n.prototype.intersect=function(e,t,i){return n.intersect(this,e,t,i)},n.intersect=function(e,t,i,r){i&&ye.set(i,0,0);var o=r&&r.outIntersectRect||null,a=r&&r.clamp;if(o&&(o.x=o.y=o.width=o.height=NaN),!e||!t)return!1;e instanceof n||(e=n.set(Z2,e.x,e.y,e.width,e.height)),t instanceof n||(t=n.set(X2,t.x,t.y,t.width,t.height));var s=!!i;Wt.reset(r,s);var l=Wt.touchThreshold,u=e.x+l,c=e.x+e.width-l,h=e.y+l,d=e.y+e.height-l,f=t.x+l,p=t.x+t.width-l,g=t.y+l,m=t.y+t.height-l;if(u>c||h>d||f>p||g>m)return!1;var y=!(c<f||p<u||d<g||m<h);return(s||o)&&(Za[0]=1/0,Za[1]=0,o0(u,c,f,p,0,s,o,a),o0(h,d,g,m,1,s,o,a),s&&ye.copy(i,y?Wt.useDir?Wt.dirMinTv:$a:yd)),y},n.contain=function(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height},n.prototype.contain=function(e,t){return n.contain(this,e,t)},n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.copy=function(e){n.copy(this,e)},n.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},n.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},n.prototype.isZero=function(){return this.width===0||this.height===0},n.create=function(e){return new n(e.x,e.y,e.width,e.height)},n.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},n.applyTransform=function(e,t,i){if(!i){e!==t&&n.copy(e,t);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];e.x=t.x*r+a,e.y=t.y*o+s,e.width=t.width*r,e.height=t.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}yr.x=_r.x=t.x,yr.y=xr.y=t.y,vr.x=xr.x=t.x+t.width,vr.y=_r.y=t.y+t.height,yr.transform(i),xr.transform(i),vr.transform(i),_r.transform(i),e.x=mr(yr.x,vr.x,_r.x,xr.x),e.y=mr(yr.y,vr.y,_r.y,xr.y);var l=Co(yr.x,vr.x,_r.x,xr.x),u=Co(yr.y,vr.y,_r.y,xr.y);e.width=l-e.x,e.height=u-e.y},n}(),Z2=new ve(0,0,0,0),X2=new ve(0,0,0,0);function o0(n,e,t,i,r,o,a,s){var l=md(e-t),u=md(i-n),c=mr(l,u),h=r0[r],d=r0[1-r],f=$2[r];e<t||i<n?l<u?(o&&(yd[h]=-l),s&&(a[h]=e,a[f]=0)):(o&&(yd[h]=u),s&&(a[h]=n,a[f]=0)):(a&&(a[h]=Co(n,t),a[f]=mr(e,i)-a[h]),o&&(c<Za[0]||Wt.useDir)&&(Za[0]=mr(c,Za[0]),(l<u||!Wt.bidirectional)&&($a[h]=l,$a[d]=0,Wt.useDir&&Wt.calcDirMTV()),(l>=u||!Wt.bidirectional)&&($a[h]=-u,$a[d]=0,Wt.useDir&&Wt.calcDirMTV())))}function a0(){var n=0,e=new ye,t=new ye,i={minTv:new ye,maxTv:new ye,useDir:!1,dirMinTv:new ye,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(o,a){i.touchThreshold=0,o&&o.touchThreshold!=null&&(i.touchThreshold=Co(0,o.touchThreshold)),i.negativeSize=!1,a&&(i.minTv.set(1/0,1/0),i.maxTv.set(0,0),i.useDir=!1,o&&o.direction!=null&&(i.useDir=!0,i.dirMinTv.copy(i.minTv),t.copy(i.minTv),n=o.direction,i.bidirectional=o.bidirectional==null||!!o.bidirectional,i.bidirectional||e.set(Math.cos(n),Math.sin(n))))},calcDirMTV:function(){var o=i.minTv,a=i.dirMinTv,s=o.y*o.y+o.x*o.x,l=Math.sin(n),u=Math.cos(n),c=l*o.y+u*o.x;if(r(c)){r(o.x)&&r(o.y)&&a.set(0,0);return}if(t.x=s*u/c,t.y=s*l/c,r(t.x)&&r(t.y)){a.set(0,0);return}(i.bidirectional||e.dot(t)>0)&&t.len()<a.len()&&a.copy(t)}};function r(o){return md(o)<1e-10}return i}function Rn(n){Yl||(Yl=new Mo(100)),n=n||oi;var e=Yl.get(n);return e||(e={font:n,strWidthCache:new Mo(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:ai.measureText("国",n).width,asciiCharWidth:ai.measureText("a",n).width},Yl.put(n,e)),e}var Yl;function K2(n){if(!(vd>=s0)){n=n||oi;for(var e=[],t=+new Date,i=0;i<=127;i++)e[i]=ai.measureText(String.fromCharCode(i),n).width;var r=+new Date-t;return r>16?vd=s0:r>2&&vd++,e}}var vd=0,s0=5;function l0(n,e){return n.asciiWidthMapTried||(n.asciiWidthMap=K2(n.font),n.asciiWidthMapTried=!0),0<=e&&e<=127?n.asciiWidthMap!=null?n.asciiWidthMap[e]:n.asciiCharWidth:n.stWideCharWidth}function Ln(n,e){var t=n.strWidthCache,i=t.get(e);return i==null&&(i=ai.measureText(e,n.font).width,t.put(e,i)),i}function u0(n,e,t,i){var r=Ln(Rn(e),n),o=Xa(e),a=ko(0,r,t),s=br(0,o,i),l=new ve(a,s,r,o);return l}function _d(n,e,t,i){var r=((n||"")+"").split(`
|
|
15
|
+
`),o=r.length;if(o===1)return u0(r[0],e,t,i);for(var a=new ve(0,0,0,0),s=0;s<r.length;s++){var l=u0(r[s],e,t,i);s===0?a.copy(l):a.union(l)}return a}function ko(n,e,t,i){return t==="right"?i?n+=e:n-=e:t==="center"&&(i?n+=e/2:n-=e/2),n}function br(n,e,t,i){return t==="middle"?i?n+=e/2:n-=e/2:t==="bottom"&&(i?n+=e:n-=e),n}function Xa(n){return Rn(n).stWideCharWidth}function Oi(n,e){return typeof n=="string"?n.lastIndexOf("%")>=0?parseFloat(n)/100*e:parseFloat(n):n}function ql(n,e,t){var i=e.position||"inside",r=e.distance!=null?e.distance:5,o=t.height,a=t.width,s=o/2,l=t.x,u=t.y,c="left",h="top";if(i instanceof Array)l+=Oi(i[0],t.width),u+=Oi(i[1],t.height),c=null,h=null;else switch(i){case"left":l-=r,u+=s,c="right",h="middle";break;case"right":l+=r+a,u+=s,h="middle";break;case"top":l+=a/2,u-=r,c="center",h="bottom";break;case"bottom":l+=a/2,u+=o+r,c="center";break;case"inside":l+=a/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=r,u+=s,h="middle";break;case"insideRight":l+=a-r,u+=s,c="right",h="middle";break;case"insideTop":l+=a/2,u+=r,c="center";break;case"insideBottom":l+=a/2,u+=o-r,c="center",h="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=a-r,u+=r,c="right";break;case"insideBottomLeft":l+=r,u+=o-r,h="bottom";break;case"insideBottomRight":l+=a-r,u+=o-r,c="right",h="bottom";break}return n=n||{},n.x=l,n.y=u,n.align=c,n.verticalAlign=h,n}var xd=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Q2(n,e,t,i,r,o){if(!t){n.text="",n.isTruncated=!1;return}var a=(e+"").split(`
|
|
16
|
+
`);o=c0(t,i,r,o);for(var s=!1,l={},u=0,c=a.length;u<c;u++)h0(l,a[u],o),a[u]=l.textLine,s=s||l.isTruncated;n.text=a.join(`
|
|
17
|
+
`),n.isTruncated=s}function c0(n,e,t,i){i=i||{};var r=U({},i);t=te(t,"..."),r.maxIterations=te(i.maxIterations,2);var o=r.minChar=te(i.minChar,0),a=r.fontMeasureInfo=Rn(e),s=a.asciiCharWidth;r.placeholder=te(i.placeholder,"");for(var l=n=Math.max(0,n-1),u=0;u<o&&l>=s;u++)l-=s;var c=Ln(a,t);return c>l&&(t="",c=0),l=n-c,r.ellipsis=t,r.ellipsisWidth=c,r.contentWidth=l,r.containerWidth=n,r}function h0(n,e,t){var i=t.containerWidth,r=t.contentWidth,o=t.fontMeasureInfo;if(!i){n.textLine="",n.isTruncated=!1;return}var a=Ln(o,e);if(a<=i){n.textLine=e,n.isTruncated=!1;return}for(var s=0;;s++){if(a<=r||s>=t.maxIterations){e+=t.ellipsis;break}var l=s===0?J2(e,r,o):a>0?Math.floor(e.length*r/a):0;e=e.substr(0,l),a=Ln(o,e)}e===""&&(e=t.placeholder),n.textLine=e,n.isTruncated=!0}function J2(n,e,t){for(var i=0,r=0,o=n.length;r<o&&i<e;r++)i+=l0(t,n.charCodeAt(r));return r}function eN(n,e,t,i){var r=wd(n),o=e.overflow,a=e.padding,s=a?a[1]+a[3]:0,l=a?a[0]+a[2]:0,u=e.font,c=o==="truncate",h=Xa(u),d=te(e.lineHeight,h),f=e.lineOverflow==="truncate",p=!1,g=e.width;g==null&&t!=null&&(g=t-s);var m=e.height;m==null&&i!=null&&(m=i-l);var y;g!=null&&(o==="break"||o==="breakAll")?y=r?f0(r,e.font,g,o==="breakAll",0).lines:[]:y=r?r.split(`
|
|
18
|
+
`):[];var v=y.length*d;if(m==null&&(m=v),v>m&&f){var _=Math.floor(m/d);p=p||y.length>_,y=y.slice(0,_),v=y.length*d}if(r&&c&&g!=null)for(var b=c0(g,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),T={},w=0;w<y.length;w++)h0(T,y[w],b),y[w]=T.textLine,p=p||T.isTruncated;for(var S=m,M=0,C=Rn(u),w=0;w<y.length;w++)M=Math.max(Ln(C,y[w]),M);g==null&&(g=M);var I=g;return S+=l,I+=s,{lines:y,height:m,outerWidth:I,outerHeight:S,lineHeight:d,calculatedLineHeight:h,contentWidth:M,contentHeight:v,width:g,isTruncated:p}}var tN=function(){function n(){}return n}(),d0=function(){function n(e){this.tokens=[],e&&(this.tokens=e)}return n}(),nN=function(){function n(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return n}();function iN(n,e,t,i,r){var o=new nN,a=wd(n);if(!a)return o;var s=e.padding,l=s?s[1]+s[3]:0,u=s?s[0]+s[2]:0,c=e.width;c==null&&t!=null&&(c=t-l);var h=e.height;h==null&&i!=null&&(h=i-u);for(var d=e.overflow,f=(d==="break"||d==="breakAll")&&c!=null?{width:c,accumWidth:0,breakAll:d==="breakAll"}:null,p=xd.lastIndex=0,g;(g=xd.exec(a))!=null;){var m=g.index;m>p&&bd(o,a.substring(p,m),e,f),bd(o,g[2],e,f,g[1]),p=xd.lastIndex}p<a.length&&bd(o,a.substring(p,a.length),e,f);var y=[],v=0,_=0,b=d==="truncate",T=e.lineOverflow==="truncate",w={};function S(qe,Je,We){qe.width=Je,qe.lineHeight=We,v+=We,_=Math.max(_,Je)}e:for(var M=0;M<o.lines.length;M++){for(var C=o.lines[M],I=0,E=0,k=0;k<C.tokens.length;k++){var D=C.tokens[k],A=D.styleName&&e.rich[D.styleName]||{},R=D.textPadding=A.padding,L=R?R[1]+R[3]:0,V=D.font=A.font||e.font;D.contentHeight=Xa(V);var z=te(A.height,D.contentHeight);if(D.innerHeight=z,R&&(z+=R[0]+R[2]),D.height=z,D.lineHeight=si(A.lineHeight,e.lineHeight,z),D.align=A&&A.align||r,D.verticalAlign=A&&A.verticalAlign||"middle",T&&h!=null&&v+D.lineHeight>h){var H=o.lines.length;k>0?(C.tokens=C.tokens.slice(0,k),S(C,E,I),o.lines=o.lines.slice(0,M+1)):o.lines=o.lines.slice(0,M),o.isTruncated=o.isTruncated||o.lines.length<H;break e}var F=A.width,j=F==null||F==="auto";if(typeof F=="string"&&F.charAt(F.length-1)==="%")D.percentWidth=F,y.push(D),D.contentWidth=Ln(Rn(V),D.text);else{if(j){var Y=A.backgroundColor,ee=Y&&Y.image;ee&&(ee=q2(ee),Ul(ee)&&(D.width=Math.max(D.width,ee.width*z/ee.height)))}var pe=b&&c!=null?c-E:null;pe!=null&&pe<D.width?!j||pe<L?(D.text="",D.width=D.contentWidth=0):(Q2(w,D.text,pe-L,V,e.ellipsis,{minChar:e.truncateMinChar}),D.text=w.text,o.isTruncated=o.isTruncated||w.isTruncated,D.width=D.contentWidth=Ln(Rn(V),D.text)):D.contentWidth=Ln(Rn(V),D.text)}D.width+=L,E+=D.width,A&&(I=Math.max(I,D.lineHeight))}S(C,E,I)}o.outerWidth=o.width=te(c,_),o.outerHeight=o.height=te(h,v),o.contentHeight=v,o.contentWidth=_,o.outerWidth+=l,o.outerHeight+=u;for(var M=0;M<y.length;M++){var D=y[M],Te=D.percentWidth;D.width=parseInt(Te,10)/100*o.width}return o}function bd(n,e,t,i,r){var o=e==="",a=r&&t.rich[r]||{},s=n.lines,l=a.font||t.font,u=!1,c,h;if(i){var d=a.padding,f=d?d[1]+d[3]:0;if(a.width!=null&&a.width!=="auto"){var p=Oi(a.width,i.width)+f;s.length>0&&p+i.accumWidth>i.width&&(c=e.split(`
|
|
19
|
+
`),u=!0),i.accumWidth=p}else{var g=f0(e,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+f,h=g.linesWidths,c=g.lines}}c||(c=e.split(`
|
|
20
|
+
`));for(var m=Rn(l),y=0;y<c.length;y++){var v=c[y],_=new tN;if(_.styleName=r,_.text=v,_.isLineHolder=!v&&!o,typeof a.width=="number"?_.width=a.width:_.width=h?h[y]:Ln(m,v),!y&&!u){var b=(s[s.length-1]||(s[0]=new d0)).tokens,T=b.length;T===1&&b[0].isLineHolder?b[0]=_:(v||!T||o)&&b.push(_)}else s.push(new d0([_]))}}function rN(n){var e=n.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var oN=Ai(",&?/;] ".split(""),function(n,e){return n[e]=!0,n},{});function aN(n){return rN(n)?!!oN[n]:!0}function f0(n,e,t,i,r){for(var o=[],a=[],s="",l="",u=0,c=0,h=Rn(e),d=0;d<n.length;d++){var f=n.charAt(d);if(f===`
|
|
21
|
+
`){l&&(s+=l,c+=u),o.push(s),a.push(c),s="",l="",u=0,c=0;continue}var p=l0(h,f.charCodeAt(0)),g=i?!1:!aN(f);if(o.length?c+p>t:r+c+p>t){c?(s||l)&&(g?(s||(s=l,l="",u=0,c=u),o.push(s),a.push(c-u),l+=f,u+=p,s="",c=u):(l&&(s+=l,l="",u=0),o.push(s),a.push(c),s=f,c=p)):g?(o.push(l),a.push(u),l=f,u=p):(o.push(f),a.push(p));continue}c+=p,g?(l+=f,u+=p):(l&&(s+=l,l="",u=0),s+=f)}return l&&(s+=l),s&&(o.push(s),a.push(c)),o.length===1&&(c+=r),{accumWidth:c,lines:o,linesWidths:a}}function p0(n,e,t,i,r,o){if(n.baseX=t,n.baseY=i,n.outerWidth=n.outerHeight=null,!!e){var a=e.width*2,s=e.height*2;ve.set(g0,ko(t,a,r),br(i,s,o),a,s),ve.intersect(e,g0,null,m0);var l=m0.outIntersectRect;n.outerWidth=l.width,n.outerHeight=l.height,n.baseX=ko(l.x,l.width,r,!0),n.baseY=br(l.y,l.height,o,!0)}}var g0=new ve(0,0,0,0),m0={outIntersectRect:{},clamp:!0};function wd(n){return n!=null?n+="":n=""}function sN(n){var e=wd(n.text),t=n.font,i=Ln(Rn(t),e),r=Xa(t);return Sd(n,i,r,null)}function Sd(n,e,t,i){var r=new ve(ko(n.x||0,e,n.textAlign),br(n.y||0,t,n.textBaseline),e,t),o=i??(y0(n)?n.lineWidth:0);return o>0&&(r.x-=o/2,r.y-=o/2,r.width+=o,r.height+=o),r}function y0(n){var e=n.stroke;return e!=null&&e!=="none"&&n.lineWidth>0}function Do(n,e){return n==null&&(n=0),e==null&&(e=0),[n,e]}function lN(n){return[n[0],n[1]]}function v0(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n}function _0(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function uN(n){return Math.sqrt(cN(n))}function cN(n){return n[0]*n[0]+n[1]*n[1]}function Td(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n}function Md(n,e){var t=uN(e);return t===0?(n[0]=0,n[1]=0):(n[0]=e[0]/t,n[1]=e[1]/t),n}function Cd(n,e){return Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]))}var kd=Cd;function hN(n,e){return(n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])}var Io=hN;function Dd(n,e,t,i){return n[0]=e[0]+i*(t[0]-e[0]),n[1]=e[1]+i*(t[1]-e[1]),n}function Jt(n,e,t){var i=e[0],r=e[1];return n[0]=t[0]*i+t[2]*r+t[4],n[1]=t[1]*i+t[3]*r+t[5],n}function Eo(n,e,t){return n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n}function No(n,e,t){return n[0]=Math.max(e[0],t[0]),n[1]=Math.max(e[1],t[1]),n}var x0=fd,b0=5e-5;function wr(n){return n>b0||n<-b0}var Sr=[],Ao=[],Id=li(),Ed=Math.abs,Nd=function(){function n(){}return n.prototype.getLocalTransform=function(e){return n.getLocalTransform(this,e)},n.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},n.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},n.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},n.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},n.prototype.needLocalTransform=function(){return wr(this.rotation)||wr(this.x)||wr(this.y)||wr(this.scaleX-1)||wr(this.scaleY-1)||wr(this.skewX)||wr(this.skewY)},n.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),i=this.transform;if(!(t||e)){i&&(x0(i),this.invTransform=null);return}i=i||li(),t?this.getLocalTransform(i):x0(i),e&&(t?qa(i,e,i):i0(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i)},n.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Sr);var i=Sr[0]<0?-1:1,r=Sr[1]<0?-1:1,o=((Sr[0]-i)*t+i)/Sr[0]||0,a=((Sr[1]-r)*t+r)/Sr[1]||0;e[0]*=o,e[1]*=o,e[2]*=a,e[3]*=a}this.invTransform=this.invTransform||li(),ja(this.invTransform,e)},n.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},n.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),o=Math.PI/2+r-Math.atan2(e[3],e[2]);i=Math.sqrt(i)*Math.cos(o),t=Math.sqrt(t),this.skewX=o,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=i,this.originX=0,this.originY=0}},n.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||li(),qa(Ao,e.invTransform,t),t=Ao);var i=this.originX,r=this.originY;(i||r)&&(Id[4]=i,Id[5]=r,qa(Ao,t,Id),Ao[4]-=i,Ao[5]-=r,t=Ao),this.setLocalTransform(t)}},n.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},n.prototype.transformCoordToLocal=function(e,t){var i=[e,t],r=this.invTransform;return r&&Jt(i,i,r),i},n.prototype.transformCoordToGlobal=function(e,t){var i=[e,t],r=this.transform;return r&&Jt(i,i,r),i},n.prototype.getLineScale=function(){var e=this.transform;return e&&Ed(e[0]-1)>1e-10&&Ed(e[3]-1)>1e-10?Math.sqrt(Ed(e[0]*e[3]-e[2]*e[1])):1},n.prototype.copyTransform=function(e){jl(this,e)},n.getLocalTransform=function(e,t){t=t||[];var i=e.originX||0,r=e.originY||0,o=e.scaleX,a=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,c=e.x,h=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(i||r||s||l){var p=i+s,g=r+l;t[4]=-p*o-d*g*a,t[5]=-g*a-f*p*o}else t[4]=t[5]=0;return t[0]=o,t[3]=a,t[1]=f*o,t[2]=d*a,u&&gd(t,t,u),t[4]+=i+c,t[5]+=r+h,t},n.initDefaultProps=function(){var e=n.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}(),n}(),Ka=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function jl(n,e){for(var t=0;t<Ka.length;t++){var i=Ka[t];n[i]=e[i]}}var Qa={linear:function(n){return n},quadraticIn:function(n){return n*n},quadraticOut:function(n){return n*(2-n)},quadraticInOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},cubicIn:function(n){return n*n*n},cubicOut:function(n){return--n*n*n+1},cubicInOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},quarticIn:function(n){return n*n*n*n},quarticOut:function(n){return 1- --n*n*n*n},quarticInOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)},quinticIn:function(n){return n*n*n*n*n},quinticOut:function(n){return--n*n*n*n*n+1},quinticInOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)},sinusoidalIn:function(n){return 1-Math.cos(n*Math.PI/2)},sinusoidalOut:function(n){return Math.sin(n*Math.PI/2)},sinusoidalInOut:function(n){return .5*(1-Math.cos(Math.PI*n))},exponentialIn:function(n){return n===0?0:Math.pow(1024,n-1)},exponentialOut:function(n){return n===1?1:1-Math.pow(2,-10*n)},exponentialInOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)},circularIn:function(n){return 1-Math.sqrt(1-n*n)},circularOut:function(n){return Math.sqrt(1- --n*n)},circularInOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)},elasticIn:function(n){var e,t=.1,i=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/i)))},elasticOut:function(n){var e,t=.1,i=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*n)*Math.sin((n-e)*(2*Math.PI)/i)+1)},elasticInOut:function(n){var e,t=.1,i=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),(n*=2)<1?-.5*(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/i)):t*Math.pow(2,-10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/i)*.5+1)},backIn:function(n){var e=1.70158;return n*n*((e+1)*n-e)},backOut:function(n){var e=1.70158;return--n*n*((e+1)*n+e)+1},backInOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)},bounceIn:function(n){return 1-Qa.bounceOut(1-n)},bounceOut:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},bounceInOut:function(n){return n<.5?Qa.bounceIn(n*2)*.5:Qa.bounceOut(n*2-1)*.5+.5}},$l=Math.pow,Ri=Math.sqrt,Zl=1e-8,w0=1e-4,S0=Ri(3),Xl=1/3,Pn=Do(),en=Do(),Oo=Do();function Li(n){return n>-Zl&&n<Zl}function T0(n){return n>Zl||n<-Zl}function dt(n,e,t,i,r){var o=1-r;return o*o*(o*n+3*r*e)+r*r*(r*i+3*o*t)}function M0(n,e,t,i,r){var o=1-r;return 3*(((e-n)*o+2*(t-e)*r)*o+(i-t)*r*r)}function Kl(n,e,t,i,r,o){var a=i+3*(e-t)-n,s=3*(t-e*2+n),l=3*(e-n),u=n-r,c=s*s-3*a*l,h=s*l-9*a*u,d=l*l-3*s*u,f=0;if(Li(c)&&Li(h))if(Li(s))o[0]=0;else{var p=-l/s;p>=0&&p<=1&&(o[f++]=p)}else{var g=h*h-4*c*d;if(Li(g)){var m=h/c,p=-s/a+m,y=-m/2;p>=0&&p<=1&&(o[f++]=p),y>=0&&y<=1&&(o[f++]=y)}else if(g>0){var v=Ri(g),_=c*s+1.5*a*(-h+v),b=c*s+1.5*a*(-h-v);_<0?_=-$l(-_,Xl):_=$l(_,Xl),b<0?b=-$l(-b,Xl):b=$l(b,Xl);var p=(-s-(_+b))/(3*a);p>=0&&p<=1&&(o[f++]=p)}else{var T=(2*c*s-3*a*h)/(2*Ri(c*c*c)),w=Math.acos(T)/3,S=Ri(c),M=Math.cos(w),p=(-s-2*S*M)/(3*a),y=(-s+S*(M+S0*Math.sin(w)))/(3*a),C=(-s+S*(M-S0*Math.sin(w)))/(3*a);p>=0&&p<=1&&(o[f++]=p),y>=0&&y<=1&&(o[f++]=y),C>=0&&C<=1&&(o[f++]=C)}}return f}function C0(n,e,t,i,r){var o=6*t-12*e+6*n,a=9*e+3*i-3*n-9*t,s=3*e-3*n,l=0;if(Li(a)){if(T0(o)){var u=-s/o;u>=0&&u<=1&&(r[l++]=u)}}else{var c=o*o-4*a*s;if(Li(c))r[0]=-o/(2*a);else if(c>0){var h=Ri(c),u=(-o+h)/(2*a),d=(-o-h)/(2*a);u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function Ql(n,e,t,i,r,o){var a=(e-n)*r+n,s=(t-e)*r+e,l=(i-t)*r+t,u=(s-a)*r+a,c=(l-s)*r+s,h=(c-u)*r+u;o[0]=n,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=i}function dN(n,e,t,i,r,o,a,s,l,u,c){var h,d=.005,f=1/0,p,g,m,y;Pn[0]=l,Pn[1]=u;for(var v=0;v<1;v+=.05)en[0]=dt(n,t,r,a,v),en[1]=dt(e,i,o,s,v),m=Io(Pn,en),m<f&&(h=v,f=m);f=1/0;for(var _=0;_<32&&!(d<w0);_++)p=h-d,g=h+d,en[0]=dt(n,t,r,a,p),en[1]=dt(e,i,o,s,p),m=Io(en,Pn),p>=0&&m<f?(h=p,f=m):(Oo[0]=dt(n,t,r,a,g),Oo[1]=dt(e,i,o,s,g),y=Io(Oo,Pn),g<=1&&y<f?(h=g,f=y):d*=.5);return Ri(f)}function fN(n,e,t,i,r,o,a,s,l){for(var u=n,c=e,h=0,d=1/l,f=1;f<=l;f++){var p=f*d,g=dt(n,t,r,a,p),m=dt(e,i,o,s,p),y=g-u,v=m-c;h+=Math.sqrt(y*y+v*v),u=g,c=m}return h}function Rt(n,e,t,i){var r=1-i;return r*(r*n+2*i*e)+i*i*t}function k0(n,e,t,i){return 2*((1-i)*(e-n)+i*(t-e))}function pN(n,e,t,i,r){var o=n-2*e+t,a=2*(e-n),s=n-i,l=0;if(Li(o)){if(T0(a)){var u=-s/a;u>=0&&u<=1&&(r[l++]=u)}}else{var c=a*a-4*o*s;if(Li(c)){var u=-a/(2*o);u>=0&&u<=1&&(r[l++]=u)}else if(c>0){var h=Ri(c),u=(-a+h)/(2*o),d=(-a-h)/(2*o);u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function D0(n,e,t){var i=n+t-2*e;return i===0?.5:(n-e)/i}function Jl(n,e,t,i,r){var o=(e-n)*i+n,a=(t-e)*i+e,s=(a-o)*i+o;r[0]=n,r[1]=o,r[2]=s,r[3]=s,r[4]=a,r[5]=t}function gN(n,e,t,i,r,o,a,s,l){var u,c=.005,h=1/0;Pn[0]=a,Pn[1]=s;for(var d=0;d<1;d+=.05){en[0]=Rt(n,t,r,d),en[1]=Rt(e,i,o,d);var f=Io(Pn,en);f<h&&(u=d,h=f)}h=1/0;for(var p=0;p<32&&!(c<w0);p++){var g=u-c,m=u+c;en[0]=Rt(n,t,r,g),en[1]=Rt(e,i,o,g);var f=Io(en,Pn);if(g>=0&&f<h)u=g,h=f;else{Oo[0]=Rt(n,t,r,m),Oo[1]=Rt(e,i,o,m);var y=Io(Oo,Pn);m<=1&&y<h?(u=m,h=y):c*=.5}}return Ri(h)}function mN(n,e,t,i,r,o,a){for(var s=n,l=e,u=0,c=1/a,h=1;h<=a;h++){var d=h*c,f=Rt(n,t,r,d),p=Rt(e,i,o,d),g=f-s,m=p-l;u+=Math.sqrt(g*g+m*m),s=f,l=p}return u}var yN=/cubic-bezier\(([0-9,\.e ]+)\)/;function Ad(n){var e=n&&yN.exec(n);if(e){var t=e[1].split(","),i=+An(t[0]),r=+An(t[1]),o=+An(t[2]),a=+An(t[3]);if(isNaN(i+r+o+a))return;var s=[];return function(l){return l<=0?0:l>=1?1:Kl(0,i,o,1,l,s)&&dt(0,r,a,1,s[0])}}}var vN=function(){function n(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||nt,this.ondestroy=e.ondestroy||nt,this.onrestart=e.onrestart||nt,e.easing&&this.setEasing(e.easing)}return n.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var i=this._life,r=e-this._startTime-this._pausedTime,o=r/i;o<0&&(o=0),o=Math.min(o,1);var a=this.easingFunc,s=a?a(o):o;if(this.onframe(s),o===1)if(this.loop){var l=r%i;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){this._paused=!1},n.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ce(e)?e:Qa[e]||Ad(e)},n}(),I0={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 xn(n){return n=Math.round(n),n<0?0:n>255?255:n}function _N(n){return n=Math.round(n),n<0?0:n>360?360:n}function Ja(n){return n<0?0:n>1?1:n}function Od(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?xn(parseFloat(e)/100*255):xn(parseInt(e,10))}function Tr(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?Ja(parseFloat(e)/100):Ja(parseFloat(e))}function Rd(n,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?n+(e-n)*t*6:t*2<1?e:t*3<2?n+(e-n)*(2/3-t)*6:n}function Pi(n,e,t){return n+(e-n)*t}function tn(n,e,t,i,r){return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n}function Ld(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n}var E0=new Mo(20),eu=null;function Ro(n,e){eu&&Ld(eu,e),eu=E0.put(n,eu||e.slice())}function Ut(n,e){if(n){e=e||[];var t=E0.get(n);if(t)return Ld(e,t);n=n+"";var i=n.replace(/ /g,"").toLowerCase();if(i in I0)return Ld(e,I0[i]),Ro(n,e),e;var r=i.length;if(i.charAt(0)==="#"){if(r===4||r===5){var o=parseInt(i.slice(1,4),16);if(!(o>=0&&o<=4095)){tn(e,0,0,0,1);return}return tn(e,(o&3840)>>4|(o&3840)>>8,o&240|(o&240)>>4,o&15|(o&15)<<4,r===5?parseInt(i.slice(4),16)/15:1),Ro(n,e),e}else if(r===7||r===9){var o=parseInt(i.slice(1,7),16);if(!(o>=0&&o<=16777215)){tn(e,0,0,0,1);return}return tn(e,(o&16711680)>>16,(o&65280)>>8,o&255,r===9?parseInt(i.slice(7),16)/255:1),Ro(n,e),e}return}var a=i.indexOf("("),s=i.indexOf(")");if(a!==-1&&s+1===r){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?tn(e,+u[0],+u[1],+u[2],1):tn(e,0,0,0,1);c=Tr(u.pop());case"rgb":if(u.length>=3)return tn(e,Od(u[0]),Od(u[1]),Od(u[2]),u.length===3?c:Tr(u[3])),Ro(n,e),e;tn(e,0,0,0,1);return;case"hsla":if(u.length!==4){tn(e,0,0,0,1);return}return u[3]=Tr(u[3]),Pd(u,e),Ro(n,e),e;case"hsl":if(u.length!==3){tn(e,0,0,0,1);return}return Pd(u,e),Ro(n,e),e;default:return}}tn(e,0,0,0,1)}}function Pd(n,e){var t=(parseFloat(n[0])%360+360)%360/360,i=Tr(n[1]),r=Tr(n[2]),o=r<=.5?r*(i+1):r+i-r*i,a=r*2-o;return e=e||[],tn(e,xn(Rd(a,o,t+1/3)*255),xn(Rd(a,o,t)*255),xn(Rd(a,o,t-1/3)*255),1),n.length===4&&(e[3]=n[3]),e}function xN(n){if(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.min(e,t,i),o=Math.max(e,t,i),a=o-r,s=(o+r)/2,l,u;if(a===0)l=0,u=0;else{s<.5?u=a/(o+r):u=a/(2-o-r);var c=((o-e)/6+a/2)/a,h=((o-t)/6+a/2)/a,d=((o-i)/6+a/2)/a;e===o?l=d-h:t===o?l=1/3+c-d:i===o&&(l=2/3+h-c),l<0&&(l+=1),l>1&&(l-=1)}var f=[l*360,u,s];return n[3]!=null&&f.push(n[3]),f}}function N0(n,e){var t=Ut(n);if(t){for(var i=0;i<3;i++)t[i]=t[i]*(1-e)|0,t[i]>255?t[i]=255:t[i]<0&&(t[i]=0);return ui(t,t.length===4?"rgba":"rgb")}}function zd(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){t=t||[];var i=n*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return t[0]=xn(Pi(a[0],s[0],l)),t[1]=xn(Pi(a[1],s[1],l)),t[2]=xn(Pi(a[2],s[2],l)),t[3]=Ja(Pi(a[3],s[3],l)),t}}function bN(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){var i=n*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=Ut(e[r]),s=Ut(e[o]),l=i-r,u=ui([xn(Pi(a[0],s[0],l)),xn(Pi(a[1],s[1],l)),xn(Pi(a[2],s[2],l)),Ja(Pi(a[3],s[3],l))],"rgba");return t?{color:u,leftIndex:r,rightIndex:o,value:i}:u}}function Lo(n,e,t,i){var r=Ut(n);if(n)return r=xN(r),e!=null&&(r[0]=_N(ce(e)?e(r[0]):e)),t!=null&&(r[1]=Tr(ce(t)?t(r[1]):t)),i!=null&&(r[2]=Tr(ce(i)?i(r[2]):i)),ui(Pd(r),"rgba")}function Bd(n,e){var t=Ut(n);if(t&&e!=null)return t[3]=Ja(e),ui(t,"rgba")}function ui(n,e){if(!(!n||!n.length)){var t=n[0]+","+n[1]+","+n[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+n[3]),e+"("+t+")"}}function tu(n,e){var t=Ut(n);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var A0=new Mo(100);function Vd(n){if(Q(n)){var e=A0.get(n);return e||(e=N0(n,-.1),A0.put(n,e)),e}else if(Hl(n)){var t=U({},n);return t.colorStops=$(n.colorStops,function(i){return{offset:i.offset,color:N0(i.color,-.1)}}),t}return n}var nu=Math.round;function es(n){var e;if(!n||n==="transparent")n="none";else if(typeof n=="string"&&n.indexOf("rgba")>-1){var t=Ut(n);t&&(n="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:n,opacity:e??1}}var O0=1e-4;function zi(n){return n<O0&&n>-O0}function iu(n){return nu(n*1e3)/1e3}function Hd(n){return nu(n*1e4)/1e4}function wN(n){return"matrix("+iu(n[0])+","+iu(n[1])+","+iu(n[2])+","+iu(n[3])+","+Hd(n[4])+","+Hd(n[5])+")"}var SN={left:"start",right:"end",center:"middle",middle:"middle"};function TN(n,e,t){return t==="top"?n+=e/2:t==="bottom"&&(n-=e/2),n}function MN(n){return n&&(n.shadowBlur||n.shadowOffsetX||n.shadowOffsetY)}function CN(n){var e=n.style,t=n.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function R0(n){return n&&!!n.image}function kN(n){return n&&!!n.svgElement}function Fd(n){return R0(n)||kN(n)}function L0(n){return n.type==="linear"}function P0(n){return n.type==="radial"}function z0(n){return n&&(n.type==="linear"||n.type==="radial")}function ru(n){return"url(#"+n+")"}function B0(n){var e=n.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function V0(n){var e=n.x||0,t=n.y||0,i=(n.rotation||0)*Gl,r=te(n.scaleX,1),o=te(n.scaleY,1),a=n.skewX||0,s=n.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),i&&l.push("rotate("+i+")"),(r!==1||o!==1)&&l.push("scale("+r+","+o+")"),(a||s)&&l.push("skew("+nu(a*Gl)+"deg, "+nu(s*Gl)+"deg)"),l.join(" ")}var DN=function(){return fe.hasGlobalWindow&&ce(window.btoa)?function(n){return window.btoa(unescape(encodeURIComponent(n)))}:typeof Buffer<"u"?function(n){return Buffer.from(n).toString("base64")}:function(n){return process.env.NODE_ENV!=="production"&&Nn("Base64 isn't natively supported in the current environment."),null}}(),Gd=Array.prototype.slice;function ci(n,e,t){return(e-n)*t+n}function Wd(n,e,t,i){for(var r=e.length,o=0;o<r;o++)n[o]=ci(e[o],t[o],i);return n}function IN(n,e,t,i){for(var r=e.length,o=r&&e[0].length,a=0;a<r;a++){n[a]||(n[a]=[]);for(var s=0;s<o;s++)n[a][s]=ci(e[a][s],t[a][s],i)}return n}function ou(n,e,t,i){for(var r=e.length,o=0;o<r;o++)n[o]=e[o]+t[o]*i;return n}function H0(n,e,t,i){for(var r=e.length,o=r&&e[0].length,a=0;a<r;a++){n[a]||(n[a]=[]);for(var s=0;s<o;s++)n[a][s]=e[a][s]+t[a][s]*i}return n}function EN(n,e){for(var t=n.length,i=e.length,r=t>i?e:n,o=Math.min(t,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;s<Math.max(t,i);s++)r.push({offset:a.offset,color:a.color.slice()})}function NN(n,e,t){var i=n,r=e;if(!(!i.push||!r.push)){var o=i.length,a=r.length;if(o!==a){var s=o>a;if(s)i.length=a;else for(var l=o;l<a;l++)i.push(t===1?r[l]:Gd.call(r[l]))}for(var u=i[0]&&i[0].length,l=0;l<i.length;l++)if(t===1)isNaN(i[l])&&(i[l]=r[l]);else for(var c=0;c<u;c++)isNaN(i[l][c])&&(i[l][c]=r[l][c])}}function au(n){if(Ot(n)){var e=n.length;if(Ot(n[0])){for(var t=[],i=0;i<e;i++)t.push(Gd.call(n[i]));return t}return Gd.call(n)}return n}function su(n){return n[0]=Math.floor(n[0])||0,n[1]=Math.floor(n[1])||0,n[2]=Math.floor(n[2])||0,n[3]=n[3]==null?1:n[3],"rgba("+n.join(",")+")"}function AN(n){return Ot(n&&n[0])?2:1}var lu=0,uu=1,F0=2,ts=3,Ud=4,Yd=5,G0=6;function W0(n){return n===Ud||n===Yd}function cu(n){return n===uu||n===F0}var ns=[0,0,0,0],ON=function(){function n(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return n.prototype.isFinished=function(){return this._finished},n.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},n.prototype.needsAnimate=function(){return this.keyframes.length>=1},n.prototype.getAdditiveTrack=function(){return this._additiveTrack},n.prototype.addKeyframe=function(e,t,i){this._needsSort=!0;var r=this.keyframes,o=r.length,a=!1,s=G0,l=t;if(Ot(t)){var u=AN(t);s=u,(u===1&&!Ne(t[0])||u===2&&!Ne(t[0][0]))&&(a=!0)}else if(Ne(t)&&!To(t))s=lu;else if(Q(t))if(!isNaN(+t))s=lu;else{var c=Ut(t);c&&(l=c,s=ts)}else if(Hl(t)){var h=U({},l);h.colorStops=$(t.colorStops,function(f){return{offset:f.offset,color:Ut(f.color)}}),L0(t)?s=Ud:P0(t)&&(s=Yd),l=h}o===0?this.valType=s:(s!==this.valType||s===G0)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:l,rawValue:t,percent:0};return i&&(d.easing=i,d.easingFunc=ce(i)?i:Qa[i]||Ad(i)),r.push(d),d},n.prototype.prepare=function(e,t){var i=this.keyframes;this._needsSort&&i.sort(function(g,m){return g.time-m.time});for(var r=this.valType,o=i.length,a=i[o-1],s=this.discrete,l=cu(r),u=W0(r),c=0;c<o;c++){var h=i[c],d=h.value,f=a.value;h.percent=h.time/e,s||(l&&c!==o-1?NN(d,f,r):u&&EN(d.colorStops,f.colorStops))}if(!s&&r!==Yd&&t&&this.needsAnimate()&&t.needsAnimate()&&r===t.valType&&!t._finished){this._additiveTrack=t;for(var p=i[0].value,c=0;c<o;c++)r===lu?i[c].additiveValue=i[c].value-p:r===ts?i[c].additiveValue=ou([],i[c].value,p,-1):cu(r)&&(i[c].additiveValue=r===uu?ou([],i[c].value,p,-1):H0([],i[c].value,p,-1))}},n.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var i=this._additiveTrack!=null,r=i?"additiveValue":"value",o=this.valType,a=this.keyframes,s=a.length,l=this.propName,u=o===ts,c,h=this._lastFr,d=Math.min,f,p;if(s===1)f=p=a[0];else{if(t<0)c=0;else if(t<this._lastFrP){var g=d(h+1,s-1);for(c=g;c>=0&&!(a[c].percent<=t);c--);c=d(c,s-2)}else{for(c=h;c<s&&!(a[c].percent>t);c++);c=d(c-1,s-2)}p=a[c+1],f=a[c]}if(f&&p){this._lastFr=c,this._lastFrP=t;var m=p.percent-f.percent,y=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(y=p.easingFunc(y));var v=i?this._additiveValue:u?ns:e[l];if((cu(o)||u)&&!v&&(v=this._additiveValue=[]),this.discrete)e[l]=y<1?f.rawValue:p.rawValue;else if(cu(o))o===uu?Wd(v,f[r],p[r],y):IN(v,f[r],p[r],y);else if(W0(o)){var _=f[r],b=p[r],T=o===Ud;e[l]={type:T?"linear":"radial",x:ci(_.x,b.x,y),y:ci(_.y,b.y,y),colorStops:$(_.colorStops,function(S,M){var C=b.colorStops[M];return{offset:ci(S.offset,C.offset,y),color:su(Wd([],S.color,C.color,y))}}),global:b.global},T?(e[l].x2=ci(_.x2,b.x2,y),e[l].y2=ci(_.y2,b.y2,y)):e[l].r=ci(_.r,b.r,y)}else if(u)Wd(v,f[r],p[r],y),i||(e[l]=su(v));else{var w=ci(f[r],p[r],y);i?this._additiveValue=w:e[l]=w}i&&this._addToTarget(e)}}},n.prototype._addToTarget=function(e){var t=this.valType,i=this.propName,r=this._additiveValue;t===lu?e[i]=e[i]+r:t===ts?(Ut(e[i],ns),ou(ns,ns,r,1),e[i]=su(ns)):t===uu?ou(e[i],e[i],r,1):t===F0&&H0(e[i],e[i],r,1)},n}(),qd=function(){function n(e,t,i,r){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r){Nn("Can' use additive animation on looped animation.");return}this._additiveAnimators=r,this._allowDiscrete=i}return n.prototype.getMaxTime=function(){return this._maxTime},n.prototype.getDelay=function(){return this._delay},n.prototype.getLoop=function(){return this._loop},n.prototype.getTarget=function(){return this._target},n.prototype.changeTarget=function(e){this._target=e},n.prototype.when=function(e,t,i){return this.whenWithKeys(e,t,Ce(t),i)},n.prototype.whenWithKeys=function(e,t,i,r){for(var o=this._tracks,a=0;a<i.length;a++){var s=i[a],l=o[s];if(!l){l=o[s]=new ON(s);var u=void 0,c=this._getAdditiveTrack(s);if(c){var h=c.keyframes,d=h[h.length-1];u=d&&d.value,c.valType===ts&&u&&(u=su(u))}else u=this._target[s];if(u==null)continue;e>0&&l.addKeyframe(0,au(u),r),this._trackKeys.push(s)}l.addKeyframe(e,au(t[s]),r)}return this._maxTime=Math.max(this._maxTime,e),this},n.prototype.pause=function(){this._clip.pause(),this._paused=!0},n.prototype.resume=function(){this._clip.resume(),this._paused=!1},n.prototype.isPaused=function(){return!!this._paused},n.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},n.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,i=0;i<t;i++)e[i].call(this)},n.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var i=0;i<t.length;i++)t[i].call(this)},n.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,i=0;i<t.length;i++)e[t[i]].setFinished()},n.prototype._getAdditiveTrack=function(e){var t,i=this._additiveAnimators;if(i)for(var r=0;r<i.length;r++){var o=i[r].getTrack(e);o&&(t=o)}return t},n.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,i=[],r=this._maxTime||0,o=0;o<this._trackKeys.length;o++){var a=this._trackKeys[o],s=this._tracks[a],l=this._getAdditiveTrack(a),u=s.keyframes,c=u.length;if(s.prepare(r,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var h=u[c-1];h&&(t._target[s.propName]=h.rawValue),s.setFinished()}else i.push(s)}if(i.length||this._force){var d=new vN({life:r,loop:this._loop,delay:this._delay||0,onframe:function(f){t._started=2;var p=t._additiveAnimators;if(p){for(var g=!1,m=0;m<p.length;m++)if(p[m]._clip){g=!0;break}g||(t._additiveAnimators=null)}for(var m=0;m<i.length;m++)i[m].step(t._target,f);var y=t._onframeCbs;if(y)for(var m=0;m<y.length;m++)y[m](t._target,f)},ondestroy:function(){t._doneCallback()}});this._clip=d,this.animation&&this.animation.addClip(d),e&&d.setEasing(e)}else this._doneCallback();return this}},n.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},n.prototype.delay=function(e){return this._delay=e,this},n.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},n.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},n.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},n.prototype.getClip=function(){return this._clip},n.prototype.getTrack=function(e){return this._tracks[e]},n.prototype.getTracks=function(){var e=this;return $(this._trackKeys,function(t){return e._tracks[t]})},n.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var i=this._tracks,r=this._trackKeys,o=0;o<e.length;o++){var a=i[e[o]];a&&!a.isFinished()&&(t?a.step(this._target,1):this._started===1&&a.step(this._target,0),a.setFinished())}for(var s=!0,o=0;o<r.length;o++)if(!i[r[o]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},n.prototype.saveTo=function(e,t,i){if(e){t=t||this._trackKeys;for(var r=0;r<t.length;r++){var o=t[r],a=this._tracks[o];if(!(!a||a.isFinished())){var s=a.keyframes,l=s[i?0:s.length-1];l&&(e[o]=au(l.rawValue))}}}},n.prototype.__changeFinalValue=function(e,t){t=t||Ce(e);for(var i=0;i<t.length;i++){var r=t[i],o=this._tracks[r];if(o){var a=o.keyframes;if(a.length>1){var s=a.pop();o.addKeyframe(s.time,e[r]),o.prepare(this._maxTime,o.getAdditiveTrack())}}}},n}(),bn=function(){function n(e){e&&(this._$eventProcessor=e)}return n.prototype.on=function(e,t,i,r){this._$handlers||(this._$handlers={});var o=this._$handlers;if(typeof t=="function"&&(r=i,i=t,t=null),!i||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),o[e]||(o[e]=[]);for(var s=0;s<o[e].length;s++)if(o[e][s].h===i)return this;var l={h:i,query:t,ctx:r||this,callAtLast:i.zrEventfulCallAtLast},u=o[e].length-1,c=o[e][u];return c&&c.callAtLast?o[e].splice(u,0,l):o[e].push(l),this},n.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},n.prototype.off=function(e,t){var i=this._$handlers;if(!i)return this;if(!e)return this._$handlers={},this;if(t){if(i[e]){for(var r=[],o=0,a=i[e].length;o<a;o++)i[e][o].h!==t&&r.push(i[e][o]);i[e]=r}i[e]&&i[e].length===0&&delete i[e]}else delete i[e];return this},n.prototype.trigger=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(!this._$handlers)return this;var r=this._$handlers[e],o=this._$eventProcessor;if(r)for(var a=t.length,s=r.length,l=0;l<s;l++){var u=r[l];if(!(o&&o.filter&&u.query!=null&&!o.filter(e,u.query)))switch(a){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,t[0]);break;case 2:u.h.call(u.ctx,t[0],t[1]);break;default:u.h.apply(u.ctx,t);break}}return o&&o.afterTrigger&&o.afterTrigger(e),this},n.prototype.triggerWithContext=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(!this._$handlers)return this;var r=this._$handlers[e],o=this._$eventProcessor;if(r)for(var a=t.length,s=t[a-1],l=r.length,u=0;u<l;u++){var c=r[u];if(!(o&&o.filter&&c.query!=null&&!o.filter(e,c.query)))switch(a){case 0:c.h.call(s);break;case 1:c.h.call(s,t[0]);break;case 2:c.h.call(s,t[0],t[1]);break;default:c.h.apply(s,t.slice(1,a-1));break}}return o&&o.afterTrigger&&o.afterTrigger(e),this},n}(),U0=1;fe.hasGlobalWindow&&(U0=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var hu=U0,jd=.4,$d="#333",Zd="#ccc",RN="#eee",Yt=1,is=2,Po=4,Xd="__zr_normal__",Kd=Ka.concat(["ignore"]),LN=Ai(Ka,function(n,e){return n[e]=!0,n},{ignore:!1}),zo={},PN=new ve(0,0,0,0),du=[],fu=function(){function n(e){this.id=$v(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return n.prototype._init=function(e){this.attr(e)},n.prototype.drift=function(e,t,i){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},n.prototype.beforeUpdate=function(){},n.prototype.afterUpdate=function(){},n.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},n.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var i=this.textConfig,r=i.local,o=t.innerTransformable,a=void 0,s=void 0,l=!1;o.parent=r?this:null;var u=!1;o.copyTransform(t);var c=i.position!=null,h=i.autoOverflowArea,d=void 0;if((h||c)&&(d=PN,i.layoutRect?d.copy(i.layoutRect):d.copy(this.getBoundingRect()),r||d.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(zo,i,d):ql(zo,i,d),o.x=zo.x,o.y=zo.y,a=zo.align,s=zo.verticalAlign;var f=i.origin;if(f&&i.rotation!=null){var p=void 0,g=void 0;f==="center"?(p=d.width*.5,g=d.height*.5):(p=Oi(f[0],d.width),g=Oi(f[1],d.height)),u=!0,o.originX=-o.x+p+(r?0:d.x),o.originY=-o.y+g+(r?0:d.y)}}i.rotation!=null&&(o.rotation=i.rotation);var m=i.offset;m&&(o.x+=m[0],o.y+=m[1],u||(o.originX=-m[0],o.originY=-m[1]));var y=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var v=y.overflowRect=y.overflowRect||new ve(0,0,0,0);o.getLocalTransform(du),ja(du,du),ve.copy(v,d),v.applyTransform(du)}else y.overflowRect=null;var _=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,b=void 0,T=void 0,w=void 0;_&&this.canBeInsideText()?(b=i.insideFill,T=i.insideStroke,(b==null||b==="auto")&&(b=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(b),w=!0)):(b=i.outsideFill,T=i.outsideStroke,(b==null||b==="auto")&&(b=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(b),w=!0)),b=b||"#000",(b!==y.fill||T!==y.stroke||w!==y.autoStroke||a!==y.align||s!==y.verticalAlign)&&(l=!0,y.fill=b,y.stroke=T,y.autoStroke=w,y.align=a,y.verticalAlign=s,t.setDefaultTextStyle(y)),t.__dirty|=Yt,l&&t.dirtyStyle(!0)}},n.prototype.canBeInsideText=function(){return!0},n.prototype.getInsideTextFill=function(){return"#fff"},n.prototype.getInsideTextStroke=function(e){return"#000"},n.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Zd:$d},n.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),i=typeof t=="string"&&Ut(t);i||(i=[255,255,255,1]);for(var r=i[3],o=this.__zr.isDarkMode(),a=0;a<3;a++)i[a]=i[a]*r+(o?0:255)*(1-r);return i[3]=1,ui(i,"rgba")},n.prototype.traverse=function(e,t){},n.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},U(this.extra,t)):this[e]=t},n.prototype.hide=function(){this.ignore=!0,this.markRedraw()},n.prototype.show=function(){this.ignore=!1,this.markRedraw()},n.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(ne(e))for(var i=e,r=Ce(i),o=0;o<r.length;o++){var a=r[o];this.attrKV(a,e[a])}return this.markRedraw(),this},n.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,i=0;i<this.animators.length;i++){var r=this.animators[i],o=r.__fromStateTransition;if(!(r.getLoop()||o&&o!==Xd)){var a=r.targetName,s=a?t[a]:t;r.saveTo(s)}}},n.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,Kd)},n.prototype._savePrimaryToNormal=function(e,t,i){for(var r=0;r<i.length;r++){var o=i[r];e[o]!=null&&!(o in t)&&(t[o]=this[o])}},n.prototype.hasState=function(){return this.currentStates.length>0},n.prototype.getState=function(e){return this.states[e]},n.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},n.prototype.clearStates=function(e){this.useState(Xd,!1,e)},n.prototype.useState=function(e,t,i,r){var o=e===Xd,a=this.hasState();if(!(!a&&o)){var s=this.currentStates,l=this.stateTransition;if(!(be(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!o&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!o){Nn("State "+e+" not exists.");return}o||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||r);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!i&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,d=this._textGuide;return h&&h.useState(e,t,i,c),d&&d.useState(e,t,i,c),o?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Yt),u}}},n.prototype.useStates=function(e,t,i){if(!e.length)this.clearStates();else{var r=[],o=this.currentStates,a=e.length,s=a===o.length;if(s){for(var l=0;l<a;l++)if(e[l]!==o[l]){s=!1;break}}if(s)return;for(var l=0;l<a;l++){var u=e[l],c=void 0;this.stateProxy&&(c=this.stateProxy(u,e)),c||(c=this.states[u]),c&&r.push(c)}var h=r[a-1],d=!!(h&&h.hoverLayer||i);d&&this._toggleHoverLayerFlag(!0);var f=this._mergeStates(r),p=this.stateTransition;this.saveCurrentToNormalState(f),this._applyStateObj(e.join(","),f,this._normalState,!1,!t&&!this.__inHover&&p&&p.duration>0,p);var g=this._textContent,m=this._textGuide;g&&g.useStates(e,t,d),m&&m.useStates(e,t,d),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!d&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Yt)}},n.prototype.isSilent=function(){for(var e=this;e;){if(e.silent)return!0;var t=e.__hostTarget;e=t?e.ignoreHostSilent?null:t:e.parent}return!1},n.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},n.prototype.removeState=function(e){var t=be(this.currentStates,e);if(t>=0){var i=this.currentStates.slice();i.splice(t,1),this.useStates(i)}},n.prototype.replaceState=function(e,t,i){var r=this.currentStates.slice(),o=be(r,e),a=be(r,t)>=0;o>=0?a?r.splice(o,1):r[o]=t:i&&!a&&r.push(t),this.useStates(r)},n.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},n.prototype._mergeStates=function(e){for(var t={},i,r=0;r<e.length;r++){var o=e[r];U(t,o),o.textConfig&&(i=i||{},U(i,o.textConfig))}return i&&(t.textConfig=i),t},n.prototype._applyStateObj=function(e,t,i,r,o,a){var s=!(t&&r);t&&t.textConfig?(this.textConfig=U({},r?this.textConfig:i.textConfig),U(this.textConfig,t.textConfig)):s&&i.textConfig&&(this.textConfig=i.textConfig);for(var l={},u=!1,c=0;c<Kd.length;c++){var h=Kd[c],d=o&&LN[h];t&&t[h]!=null?d?(u=!0,l[h]=t[h]):this[h]=t[h]:s&&i[h]!=null&&(d?(u=!0,l[h]=i[h]):this[h]=i[h])}if(!o)for(var c=0;c<this.animators.length;c++){var f=this.animators[c],p=f.targetName;f.getLoop()||f.__changeFinalValue(p?(t||i)[p]:t||i)}u&&this._transitionState(e,l,a)},n.prototype._attachComponent=function(e){if(e.__zr&&!e.__hostTarget){if(process.env.NODE_ENV!=="production")throw new Error("Text element has been added to zrender.");return}if(e===this){if(process.env.NODE_ENV!=="production")throw new Error("Recursive component attachment.");return}var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this},n.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},n.prototype.getClipPath=function(){return this._clipPath},n.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},n.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},n.prototype.getTextContent=function(){return this._textContent},n.prototype.setTextContent=function(e){var t=this._textContent;if(t!==e){if(t&&t!==e&&this.removeTextContent(),process.env.NODE_ENV!=="production"&&e.__zr&&!e.__hostTarget)throw new Error("Text element has been added to zrender.");e.innerTransformable=new Nd,this._attachComponent(e),this._textContent=e,this.markRedraw()}},n.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),U(this.textConfig,e),this.markRedraw()},n.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},n.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},n.prototype.getTextGuideLine=function(){return this._textGuide},n.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},n.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},n.prototype.markRedraw=function(){this.__dirty|=Yt;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},n.prototype.dirty=function(){this.markRedraw()},n.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,i=this._textGuide;t&&(t.__inHover=e),i&&(i.__inHover=e)},n.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.addAnimator(t[i]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},n.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.removeAnimator(t[i]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},n.prototype.animate=function(e,t,i){var r=e?this[e]:this;if(process.env.NODE_ENV!=="production"&&!r){Nn('Property "'+e+'" is not existed in element '+this.id);return}var o=new qd(r,t,i);return e&&(o.targetName=e),this.addAnimator(o,e),o},n.prototype.addAnimator=function(e,t){var i=this.__zr,r=this;e.during(function(){r.updateDuringAnimation(t)}).done(function(){var o=r.animators,a=be(o,e);a>=0&&o.splice(a,1)}),this.animators.push(e),i&&i.animation.addAnimator(e),i&&i.wakeUp()},n.prototype.updateDuringAnimation=function(e){this.markRedraw()},n.prototype.stopAnimation=function(e,t){for(var i=this.animators,r=i.length,o=[],a=0;a<r;a++){var s=i[a];!e||e===s.scope?s.stop(t):o.push(s)}return this.animators=o,this},n.prototype.animateTo=function(e,t,i){Qd(this,e,t,i)},n.prototype.animateFrom=function(e,t,i){Qd(this,e,t,i,!0)},n.prototype._transitionState=function(e,t,i,r){for(var o=Qd(this,t,i,r),a=0;a<o.length;a++)o[a].__fromStateTransition=e},n.prototype.getBoundingRect=function(){return null},n.prototype.getPaintRect=function(){return null},n.initDefaultProps=function(){var e=n.prototype;e.type="element",e.name="",e.ignore=e.silent=e.ignoreHostSilent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=Yt;var t={};function i(o,a,s){t[o+a+s]||(console.warn("DEPRECATED: '"+o+"' has been deprecated. use '"+a+"', '"+s+"' instead"),t[o+a+s]=!0)}function r(o,a,s,l){Object.defineProperty(e,o,{get:function(){if(process.env.NODE_ENV!=="production"&&i(o,s,l),!this[a]){var c=this[a]=[];u(this,c)}return this[a]},set:function(c){process.env.NODE_ENV!=="production"&&i(o,s,l),this[s]=c[0],this[l]=c[1],this[a]=c,u(this,c)}});function u(c,h){Object.defineProperty(h,0,{get:function(){return c[s]},set:function(d){c[s]=d}}),Object.defineProperty(h,1,{get:function(){return c[l]},set:function(d){c[l]=d}})}}Object.defineProperty&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))}(),n}();yn(fu,bn),yn(fu,Nd);function Qd(n,e,t,i,r){t=t||{};var o=[];Y0(n,"",n,e,t,i,o,r);var a=o.length,s=!1,l=t.done,u=t.aborted,c=function(){s=!0,a--,a<=0&&(s?l&&l():u&&u())},h=function(){a--,a<=0&&(s?l&&l():u&&u())};a||l&&l(),o.length>0&&t.during&&o[0].during(function(p,g){t.during(g)});for(var d=0;d<o.length;d++){var f=o[d];c&&f.done(c),h&&f.aborted(h),t.force&&f.duration(t.duration),f.start(t.easing)}return o}function Jd(n,e,t){for(var i=0;i<t;i++)n[i]=e[i]}function zN(n){return Ot(n[0])}function BN(n,e,t){if(Ot(e[t]))if(Ot(n[t])||(n[t]=[]),Ct(e[t])){var i=e[t].length;n[t].length!==i&&(n[t]=new e[t].constructor(i),Jd(n[t],e[t],i))}else{var r=e[t],o=n[t],a=r.length;if(zN(r))for(var s=r[0].length,l=0;l<a;l++)o[l]?Jd(o[l],r[l],s):o[l]=Array.prototype.slice.call(r[l]);else Jd(o,r,a);o.length=r.length}else n[t]=e[t]}function VN(n,e){return n===e||Ot(n)&&Ot(e)&&HN(n,e)}function HN(n,e){var t=n.length;if(t!==e.length)return!1;for(var i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function Y0(n,e,t,i,r,o,a,s){for(var l=Ce(i),u=r.duration,c=r.delay,h=r.additive,d=r.setToFinal,f=!ne(o),p=n.animators,g=[],m=0;m<l.length;m++){var y=l[m],v=i[y];if(v!=null&&t[y]!=null&&(f||o[y]))if(ne(v)&&!Ot(v)&&!Hl(v)){if(e){s||(t[y]=v,n.updateDuringAnimation(e));continue}Y0(n,y,t[y],v,r,o&&o[y],a,s)}else g.push(y);else s||(t[y]=v,n.updateDuringAnimation(e),g.push(y))}var _=g.length;if(!h&&_)for(var b=0;b<p.length;b++){var T=p[b];if(T.targetName===e){var w=T.stopTracks(g);if(w){var S=be(p,T);p.splice(S,1)}}}if(r.force||(g=$e(g,function(E){return!VN(i[E],t[E])}),_=g.length),_>0||r.force&&!a.length){var M=void 0,C=void 0,I=void 0;if(s){C={},d&&(M={});for(var b=0;b<_;b++){var y=g[b];C[y]=t[y],d?M[y]=i[y]:t[y]=i[y]}}else if(d){I={};for(var b=0;b<_;b++){var y=g[b];I[y]=au(t[y]),BN(t,i,y)}}var T=new qd(t,!1,!1,h?$e(p,function(k){return k.targetName===e}):null);T.targetName=e,r.scope&&(T.scope=r.scope),d&&M&&T.whenWithKeys(0,M,g),I&&T.whenWithKeys(0,I,g),T.whenWithKeys(u??500,s?C:i,g).delay(c||0),n.addAnimator(T,e),a.push(T)}}var ef="__zr_style_"+Math.round(Math.random()*10),Mr={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},pu={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Mr[ef]=!0;var q0=["z","z2","invisible"],FN=["invisible"],rs=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype._init=function(t){for(var i=Ce(t),r=0;r<i.length;r++){var o=i[r];o==="style"?this.useStyle(t[o]):n.prototype.attrKV.call(this,o,t[o])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,i,r,o){var a=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&GN(this,t,i)||a&&!a[0]&&!a[3])return!1;if(r&&this.__clipPaths&&this.__clipPaths.length){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(o&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(t,i){return this.rectContain(t,i)},e.prototype.traverse=function(t,i){t.call(i,this)},e.prototype.rectContain=function(t,i){var r=this.transformCoordToLocal(t,i),o=this.getBoundingRect();return o.contain(r[0],r[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var i=this.transform,r=this.getBoundingRect(),o=this.style,a=o.shadowBlur||0,s=o.shadowOffsetX||0,l=o.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new ve(0,0,0,0)),i?ve.applyTransform(t,r,i):t.copy(r),(a||s||l)&&(t.width+=a*2+Math.abs(s),t.height+=a*2+Math.abs(l),t.x=Math.min(t.x,t.x+s-a),t.y=Math.min(t.y,t.y+l-a));var u=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-u),t.y=Math.floor(t.y-u),t.width=Math.ceil(t.width+1+u*2),t.height=Math.ceil(t.height+1+u*2))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new ve(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(t,i){t!=="style"?n.prototype.attrKV.call(this,t,i):this.style?this.setStyle(i):this.useStyle(i)},e.prototype.setStyle=function(t,i){return typeof t=="string"?this.style[t]=i:U(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=is,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&is)},e.prototype.styleUpdated=function(){this.__dirty&=~is},e.prototype.createStyle=function(t){return Fl(Mr,t)},e.prototype.useStyle=function(t){t[ef]||(t=this.createStyle(t)),this.__inHover?this.__hoverStyle=t:this.style=t,this.dirtyStyle()},e.prototype.isStyleObject=function(t){return t[ef]},e.prototype._innerSaveToNormal=function(t){n.prototype._innerSaveToNormal.call(this,t);var i=this._normalState;t.style&&!i.style&&(i.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,i,q0)},e.prototype._applyStateObj=function(t,i,r,o,a,s){n.prototype._applyStateObj.call(this,t,i,r,o,a,s);var l=!(i&&o),u;if(i&&i.style?a?o?u=i.style:(u=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(u,i.style)):(u=this._mergeStyle(this.createStyle(),o?this.style:r.style),this._mergeStyle(u,i.style)):l&&(u=r.style),u)if(a){var c=this.style;if(this.style=this.createStyle(l?{}:c),l)for(var h=Ce(c),d=0;d<h.length;d++){var f=h[d];f in u&&(u[f]=u[f],this.style[f]=c[f])}for(var p=Ce(u),d=0;d<p.length;d++){var f=p[d];this.style[f]=this.style[f]}this._transitionState(t,{style:u},s,this.getAnimationStyleProps())}else this.useStyle(u);for(var g=this.__inHover?FN:q0,d=0;d<g.length;d++){var f=g[d];i&&i[f]!=null?this[f]=i[f]:l&&r[f]!=null&&(this[f]=r[f])}},e.prototype._mergeStates=function(t){for(var i=n.prototype._mergeStates.call(this,t),r,o=0;o<t.length;o++){var a=t[o];a.style&&(r=r||{},this._mergeStyle(r,a.style))}return r&&(i.style=r),i},e.prototype._mergeStyle=function(t,i){return U(t,i),t},e.prototype.getAnimationStyleProps=function(){return pu},e.initDefaultProps=function(){var t=e.prototype;t.type="displayable",t.invisible=!1,t.z=0,t.z2=0,t.zlevel=0,t.culling=!1,t.cursor="pointer",t.rectHover=!1,t.incremental=!1,t._rect=null,t.dirtyRectTolerance=0,t.__dirty=Yt|is}(),e}(fu),tf=new ve(0,0,0,0),nf=new ve(0,0,0,0);function GN(n,e,t){return tf.copy(n.getBoundingRect()),n.transform&&tf.applyTransform(n.transform),nf.width=e,nf.height=t,!tf.intersect(nf)}var nn=Math.min,rn=Math.max,rf=Math.sin,of=Math.cos,Cr=Math.PI*2,gu=Do(),mu=Do(),yu=Do();function j0(n,e,t,i,r,o){r[0]=nn(n,t),r[1]=nn(e,i),o[0]=rn(n,t),o[1]=rn(e,i)}var $0=[],Z0=[];function WN(n,e,t,i,r,o,a,s,l,u){var c=C0,h=dt,d=c(n,t,r,a,$0);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var f=0;f<d;f++){var p=h(n,t,r,a,$0[f]);l[0]=nn(p,l[0]),u[0]=rn(p,u[0])}d=c(e,i,o,s,Z0);for(var f=0;f<d;f++){var g=h(e,i,o,s,Z0[f]);l[1]=nn(g,l[1]),u[1]=rn(g,u[1])}l[0]=nn(n,l[0]),u[0]=rn(n,u[0]),l[0]=nn(a,l[0]),u[0]=rn(a,u[0]),l[1]=nn(e,l[1]),u[1]=rn(e,u[1]),l[1]=nn(s,l[1]),u[1]=rn(s,u[1])}function UN(n,e,t,i,r,o,a,s){var l=D0,u=Rt,c=rn(nn(l(n,t,r),1),0),h=rn(nn(l(e,i,o),1),0),d=u(n,t,r,c),f=u(e,i,o,h);a[0]=nn(n,r,d),a[1]=nn(e,o,f),s[0]=rn(n,r,d),s[1]=rn(e,o,f)}function YN(n,e,t,i,r,o,a,s,l){var u=Eo,c=No,h=Math.abs(r-o);if(h%Cr<1e-4&&h>1e-4){s[0]=n-t,s[1]=e-i,l[0]=n+t,l[1]=e+i;return}if(gu[0]=of(r)*t+n,gu[1]=rf(r)*i+e,mu[0]=of(o)*t+n,mu[1]=rf(o)*i+e,u(s,gu,mu),c(l,gu,mu),r=r%Cr,r<0&&(r=r+Cr),o=o%Cr,o<0&&(o=o+Cr),r>o&&!a?o+=Cr:r<o&&a&&(r+=Cr),a){var d=o;o=r,r=d}for(var f=0;f<o;f+=Math.PI/2)f>r&&(yu[0]=of(f)*t+n,yu[1]=rf(f)*i+e,u(s,yu,s),c(l,yu,l))}var Oe={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},kr=[],Dr=[],zn=[],Bi=[],Bn=[],Vn=[],af=Math.min,sf=Math.max,Ir=Math.cos,Er=Math.sin,hi=Math.abs,lf=Math.PI,Vi=lf*2,uf=typeof Float32Array<"u",os=[];function cf(n){var e=Math.round(n/lf*1e8)/1e8;return e%2*lf}function X0(n,e){var t=cf(n[0]);t<0&&(t+=Vi);var i=t-n[0],r=n[1];r+=i,!e&&r-t>=Vi?r=t+Vi:e&&t-r>=Vi?r=t-Vi:!e&&t>r?r=t+(Vi-cf(t-r)):e&&t<r&&(r=t-(Vi-cf(r-t))),n[0]=t,n[1]=r}var Hi=function(){function n(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 n.prototype.increaseVersion=function(){this._version++},n.prototype.getVersion=function(){return this._version},n.prototype.setScale=function(e,t,i){i=i||0,i>0&&(this._ux=hi(i/hu/e)||0,this._uy=hi(i/hu/t)||0)},n.prototype.setDPR=function(e){this.dpr=e},n.prototype.setContext=function(e){this._ctx=e},n.prototype.getContext=function(){return this._ctx},n.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},n.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},n.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Oe.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},n.prototype.lineTo=function(e,t){var i=hi(e-this._xi),r=hi(t-this._yi),o=i>this._ux||r>this._uy;if(this.addData(Oe.L,e,t),this._ctx&&o&&this._ctx.lineTo(e,t),o)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=i*i+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},n.prototype.bezierCurveTo=function(e,t,i,r,o,a){return this._drawPendingPt(),this.addData(Oe.C,e,t,i,r,o,a),this._ctx&&this._ctx.bezierCurveTo(e,t,i,r,o,a),this._xi=o,this._yi=a,this},n.prototype.quadraticCurveTo=function(e,t,i,r){return this._drawPendingPt(),this.addData(Oe.Q,e,t,i,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,i,r),this._xi=i,this._yi=r,this},n.prototype.arc=function(e,t,i,r,o,a){this._drawPendingPt(),os[0]=r,os[1]=o,X0(os,a),r=os[0],o=os[1];var s=o-r;return this.addData(Oe.A,e,t,i,i,r,s,0,a?0:1),this._ctx&&this._ctx.arc(e,t,i,r,o,a),this._xi=Ir(o)*i+e,this._yi=Er(o)*i+t,this},n.prototype.arcTo=function(e,t,i,r,o){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,i,r,o),this},n.prototype.rect=function(e,t,i,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,i,r),this.addData(Oe.R,e,t,i,r),this},n.prototype.closePath=function(){this._drawPendingPt(),this.addData(Oe.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&e.closePath(),this._xi=t,this._yi=i,this},n.prototype.fill=function(e){e&&e.fill(),this.toStatic()},n.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},n.prototype.len=function(){return this._len},n.prototype.setData=function(e){if(this._saveData){var t=e.length;!(this.data&&this.data.length===t)&&uf&&(this.data=new Float32Array(t));for(var i=0;i<t;i++)this.data[i]=e[i];this._len=t}},n.prototype.appendPath=function(e){if(this._saveData){e instanceof Array||(e=[e]);for(var t=e.length,i=0,r=this._len,o=0;o<t;o++)i+=e[o].len();var a=this.data;if(uf&&(a instanceof Float32Array||!a)&&(this.data=new Float32Array(r+i),r>0&&a))for(var s=0;s<r;s++)this.data[s]=a[s];for(var o=0;o<t;o++)for(var l=e[o].data,s=0;s<l.length;s++)this.data[r++]=l[s];this._len=r}},n.prototype.addData=function(e,t,i,r,o,a,s,l,u){if(this._saveData){var c=this.data;this._len+arguments.length>c.length&&(this._expandData(),c=this.data);for(var h=0;h<arguments.length;h++)c[this._len++]=arguments[h]}},n.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},n.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},n.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,uf&&this._len>11&&(this.data=new Float32Array(e)))}},n.prototype.getBoundingRect=function(){zn[0]=zn[1]=Bn[0]=Bn[1]=Number.MAX_VALUE,Bi[0]=Bi[1]=Vn[0]=Vn[1]=-Number.MAX_VALUE;var e=this.data,t=0,i=0,r=0,o=0,a;for(a=0;a<this._len;){var s=e[a++],l=a===1;switch(l&&(t=e[a],i=e[a+1],r=t,o=i),s){case Oe.M:t=r=e[a++],i=o=e[a++],Bn[0]=r,Bn[1]=o,Vn[0]=r,Vn[1]=o;break;case Oe.L:j0(t,i,e[a],e[a+1],Bn,Vn),t=e[a++],i=e[a++];break;case Oe.C:WN(t,i,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1],Bn,Vn),t=e[a++],i=e[a++];break;case Oe.Q:UN(t,i,e[a++],e[a++],e[a],e[a+1],Bn,Vn),t=e[a++],i=e[a++];break;case Oe.A:var u=e[a++],c=e[a++],h=e[a++],d=e[a++],f=e[a++],p=e[a++]+f;a+=1;var g=!e[a++];l&&(r=Ir(f)*h+u,o=Er(f)*d+c),YN(u,c,h,d,f,p,g,Bn,Vn),t=Ir(p)*h+u,i=Er(p)*d+c;break;case Oe.R:r=t=e[a++],o=i=e[a++];var m=e[a++],y=e[a++];j0(r,o,r+m,o+y,Bn,Vn);break;case Oe.Z:t=r,i=o;break}Eo(zn,zn,Bn),No(Bi,Bi,Vn)}return a===0&&(zn[0]=zn[1]=Bi[0]=Bi[1]=0),new ve(zn[0],zn[1],Bi[0]-zn[0],Bi[1]-zn[1])},n.prototype._calculateLength=function(){var e=this.data,t=this._len,i=this._ux,r=this._uy,o=0,a=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var u=this._pathSegLen,c=0,h=0,d=0;d<t;){var f=e[d++],p=d===1;p&&(o=e[d],a=e[d+1],s=o,l=a);var g=-1;switch(f){case Oe.M:o=s=e[d++],a=l=e[d++];break;case Oe.L:{var m=e[d++],y=e[d++],v=m-o,_=y-a;(hi(v)>i||hi(_)>r||d===t-1)&&(g=Math.sqrt(v*v+_*_),o=m,a=y);break}case Oe.C:{var b=e[d++],T=e[d++],m=e[d++],y=e[d++],w=e[d++],S=e[d++];g=fN(o,a,b,T,m,y,w,S,10),o=w,a=S;break}case Oe.Q:{var b=e[d++],T=e[d++],m=e[d++],y=e[d++];g=mN(o,a,b,T,m,y,10),o=m,a=y;break}case Oe.A:var M=e[d++],C=e[d++],I=e[d++],E=e[d++],k=e[d++],D=e[d++],A=D+k;d+=1,p&&(s=Ir(k)*I+M,l=Er(k)*E+C),g=sf(I,E)*af(Vi,Math.abs(D)),o=Ir(A)*I+M,a=Er(A)*E+C;break;case Oe.R:{s=o=e[d++],l=a=e[d++];var R=e[d++],L=e[d++];g=R*2+L*2;break}case Oe.Z:{var v=s-o,_=l-a;g=Math.sqrt(v*v+_*_),o=s,a=l;break}}g>=0&&(u[h++]=g,c+=g)}return this._pathLen=c,c},n.prototype.rebuildPath=function(e,t){var i=this.data,r=this._ux,o=this._uy,a=this._len,s,l,u,c,h,d,f=t<1,p,g,m=0,y=0,v,_=0,b,T;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,g=this._pathLen,v=t*g,!v)))e:for(var w=0;w<a;){var S=i[w++],M=w===1;switch(M&&(u=i[w],c=i[w+1],s=u,l=c),S!==Oe.L&&_>0&&(e.lineTo(b,T),_=0),S){case Oe.M:s=u=i[w++],l=c=i[w++],e.moveTo(u,c);break;case Oe.L:{h=i[w++],d=i[w++];var C=hi(h-u),I=hi(d-c);if(C>r||I>o){if(f){var E=p[y++];if(m+E>v){var k=(v-m)/E;e.lineTo(u*(1-k)+h*k,c*(1-k)+d*k);break e}m+=E}e.lineTo(h,d),u=h,c=d,_=0}else{var D=C*C+I*I;D>_&&(b=h,T=d,_=D)}break}case Oe.C:{var A=i[w++],R=i[w++],L=i[w++],V=i[w++],z=i[w++],H=i[w++];if(f){var E=p[y++];if(m+E>v){var k=(v-m)/E;Ql(u,A,L,z,k,kr),Ql(c,R,V,H,k,Dr),e.bezierCurveTo(kr[1],Dr[1],kr[2],Dr[2],kr[3],Dr[3]);break e}m+=E}e.bezierCurveTo(A,R,L,V,z,H),u=z,c=H;break}case Oe.Q:{var A=i[w++],R=i[w++],L=i[w++],V=i[w++];if(f){var E=p[y++];if(m+E>v){var k=(v-m)/E;Jl(u,A,L,k,kr),Jl(c,R,V,k,Dr),e.quadraticCurveTo(kr[1],Dr[1],kr[2],Dr[2]);break e}m+=E}e.quadraticCurveTo(A,R,L,V),u=L,c=V;break}case Oe.A:var F=i[w++],j=i[w++],Y=i[w++],ee=i[w++],pe=i[w++],Te=i[w++],qe=i[w++],Je=!i[w++],We=Y>ee?Y:ee,He=hi(Y-ee)>.001,Be=pe+Te,oe=!1;if(f){var E=p[y++];m+E>v&&(Be=pe+Te*(v-m)/E,oe=!0),m+=E}if(He&&e.ellipse?e.ellipse(F,j,Y,ee,qe,pe,Be,Je):e.arc(F,j,We,pe,Be,Je),oe)break e;M&&(s=Ir(pe)*Y+F,l=Er(pe)*ee+j),u=Ir(Be)*Y+F,c=Er(Be)*ee+j;break;case Oe.R:s=u=i[w],l=c=i[w+1],h=i[w++],d=i[w++];var xe=i[w++],ct=i[w++];if(f){var E=p[y++];if(m+E>v){var X=v-m;e.moveTo(h,d),e.lineTo(h+af(X,xe),d),X-=xe,X>0&&e.lineTo(h+xe,d+af(X,ct)),X-=ct,X>0&&e.lineTo(h+sf(xe-X,0),d+ct),X-=xe,X>0&&e.lineTo(h,d+sf(ct-X,0));break e}m+=E}e.rect(h,d,xe,ct);break;case Oe.Z:if(f){var E=p[y++];if(m+E>v){var k=(v-m)/E;e.lineTo(u*(1-k)+s*k,c*(1-k)+l*k);break e}m+=E}e.closePath(),u=s,c=l}}},n.prototype.clone=function(){var e=new n,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},n.prototype.canSave=function(){return!!this._saveData},n.CMD=Oe,n.initDefaultProps=function(){var e=n.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),n}();function Bo(n,e,t,i,r,o,a){if(r===0)return!1;var s=r,l=0,u=n;if(a>e+s&&a>i+s||a<e-s&&a<i-s||o>n+s&&o>t+s||o<n-s&&o<t-s)return!1;if(n!==t)l=(e-i)/(n-t),u=(n*i-t*e)/(n-t);else return Math.abs(o-n)<=s/2;var c=l*o-a+u,h=c*c/(l*l+1);return h<=s/2*s/2}function qN(n,e,t,i,r,o,a,s,l,u,c){if(l===0)return!1;var h=l;if(c>e+h&&c>i+h&&c>o+h&&c>s+h||c<e-h&&c<i-h&&c<o-h&&c<s-h||u>n+h&&u>t+h&&u>r+h&&u>a+h||u<n-h&&u<t-h&&u<r-h&&u<a-h)return!1;var d=dN(n,e,t,i,r,o,a,s,u,c);return d<=h/2}function jN(n,e,t,i,r,o,a,s,l){if(a===0)return!1;var u=a;if(l>e+u&&l>i+u&&l>o+u||l<e-u&&l<i-u&&l<o-u||s>n+u&&s>t+u&&s>r+u||s<n-u&&s<t-u&&s<r-u)return!1;var c=gN(n,e,t,i,r,o,s,l);return c<=u/2}var K0=Math.PI*2;function vu(n){return n%=K0,n<0&&(n+=K0),n}var as=Math.PI*2;function $N(n,e,t,i,r,o,a,s,l){if(a===0)return!1;var u=a;s-=n,l-=e;var c=Math.sqrt(s*s+l*l);if(c-u>t||c+u<t)return!1;if(Math.abs(i-r)%as<1e-4)return!0;if(o){var h=i;i=vu(r),r=vu(h)}else i=vu(i),r=vu(r);i>r&&(r+=as);var d=Math.atan2(l,s);return d<0&&(d+=as),d>=i&&d<=r||d+as>=i&&d+as<=r}function di(n,e,t,i,r,o){if(o>e&&o>i||o<e&&o<i||i===e)return 0;var a=(o-e)/(i-e),s=i<e?1:-1;(a===1||a===0)&&(s=i<e?.5:-.5);var l=a*(t-n)+n;return l===r?1/0:l>r?s:0}var Fi=Hi.CMD,Nr=Math.PI*2,ZN=1e-4;function XN(n,e){return Math.abs(n-e)<ZN}var kt=[-1,-1,-1],on=[-1,-1];function KN(){var n=on[0];on[0]=on[1],on[1]=n}function QN(n,e,t,i,r,o,a,s,l,u){if(u>e&&u>i&&u>o&&u>s||u<e&&u<i&&u<o&&u<s)return 0;var c=Kl(e,i,o,s,u,kt);if(c===0)return 0;for(var h=0,d=-1,f=void 0,p=void 0,g=0;g<c;g++){var m=kt[g],y=m===0||m===1?.5:1,v=dt(n,t,r,a,m);v<l||(d<0&&(d=C0(e,i,o,s,on),on[1]<on[0]&&d>1&&KN(),f=dt(e,i,o,s,on[0]),d>1&&(p=dt(e,i,o,s,on[1]))),d===2?m<on[0]?h+=f<e?y:-y:m<on[1]?h+=p<f?y:-y:h+=s<p?y:-y:m<on[0]?h+=f<e?y:-y:h+=s<f?y:-y)}return h}function JN(n,e,t,i,r,o,a,s){if(s>e&&s>i&&s>o||s<e&&s<i&&s<o)return 0;var l=pN(e,i,o,s,kt);if(l===0)return 0;var u=D0(e,i,o);if(u>=0&&u<=1){for(var c=0,h=Rt(e,i,o,u),d=0;d<l;d++){var f=kt[d]===0||kt[d]===1?.5:1,p=Rt(n,t,r,kt[d]);p<a||(kt[d]<u?c+=h<e?f:-f:c+=o<h?f:-f)}return c}else{var f=kt[0]===0||kt[0]===1?.5:1,p=Rt(n,t,r,kt[0]);return p<a?0:o<e?f:-f}}function eA(n,e,t,i,r,o,a,s){if(s-=e,s>t||s<-t)return 0;var l=Math.sqrt(t*t-s*s);kt[0]=-l,kt[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=Nr-1e-4){i=0,r=Nr;var c=o?1:-1;return a>=kt[0]+n&&a<=kt[1]+n?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=Nr,r+=Nr);for(var d=0,f=0;f<2;f++){var p=kt[f];if(p+n>a){var g=Math.atan2(s,p),c=o?1:-1;g<0&&(g=Nr+g),(g>=i&&g<=r||g+Nr>=i&&g+Nr<=r)&&(g>Math.PI/2&&g<Math.PI*1.5&&(c=-c),d+=c)}}return d}function Q0(n,e,t,i,r){for(var o=n.data,a=n.len(),s=0,l=0,u=0,c=0,h=0,d,f,p=0;p<a;){var g=o[p++],m=p===1;switch(g===Fi.M&&p>1&&(t||(s+=di(l,u,c,h,i,r))),m&&(l=o[p],u=o[p+1],c=l,h=u),g){case Fi.M:c=o[p++],h=o[p++],l=c,u=h;break;case Fi.L:if(t){if(Bo(l,u,o[p],o[p+1],e,i,r))return!0}else s+=di(l,u,o[p],o[p+1],i,r)||0;l=o[p++],u=o[p++];break;case Fi.C:if(t){if(qN(l,u,o[p++],o[p++],o[p++],o[p++],o[p],o[p+1],e,i,r))return!0}else s+=QN(l,u,o[p++],o[p++],o[p++],o[p++],o[p],o[p+1],i,r)||0;l=o[p++],u=o[p++];break;case Fi.Q:if(t){if(jN(l,u,o[p++],o[p++],o[p],o[p+1],e,i,r))return!0}else s+=JN(l,u,o[p++],o[p++],o[p],o[p+1],i,r)||0;l=o[p++],u=o[p++];break;case Fi.A:var y=o[p++],v=o[p++],_=o[p++],b=o[p++],T=o[p++],w=o[p++];p+=1;var S=!!(1-o[p++]);d=Math.cos(T)*_+y,f=Math.sin(T)*b+v,m?(c=d,h=f):s+=di(l,u,d,f,i,r);var M=(i-y)*b/_+y;if(t){if($N(y,v,b,T,T+w,S,e,M,r))return!0}else s+=eA(y,v,b,T,T+w,S,M,r);l=Math.cos(T+w)*_+y,u=Math.sin(T+w)*b+v;break;case Fi.R:c=l=o[p++],h=u=o[p++];var C=o[p++],I=o[p++];if(d=c+C,f=h+I,t){if(Bo(c,h,d,h,e,i,r)||Bo(d,h,d,f,e,i,r)||Bo(d,f,c,f,e,i,r)||Bo(c,f,c,h,e,i,r))return!0}else s+=di(d,h,d,f,i,r),s+=di(c,f,c,h,i,r);break;case Fi.Z:if(t){if(Bo(l,u,c,h,e,i,r))return!0}else s+=di(l,u,c,h,i,r);l=c,u=h;break}}return!t&&!XN(u,h)&&(s+=di(l,u,c,h,i,r)||0),s!==0}function tA(n,e,t){return Q0(n,0,!1,e,t)}function nA(n,e,t,i){return Q0(n,e,!0,t,i)}var _u=Me({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Mr),iA={style:Me({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},pu.style)},hf=Ka.concat(["invisible","culling","z","z2","zlevel","parent"]),Ae=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.update=function(){var t=this;n.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(l){t.buildPath(l,t.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s<hf.length;++s)r[hf[s]]=this[hf[s]];r.__dirty|=Yt}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(t){var i=Ce(t);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var o=0;o<i.length;o++){var a=i[o],s=t[a];a==="style"?this.style?U(this.style,s):this.useStyle(s):a==="shape"?U(this.shape,s):n.prototype.attrKV.call(this,a,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 t=this.style.fill;if(t!=="none"){if(Q(t)){var i=tu(t,0);return i>.5?$d:i>.2?RN:Zd}else if(t)return Zd}return $d},e.prototype.getInsideTextStroke=function(t){var i=this.style.fill;if(Q(i)){var r=this.__zr,o=!!(r&&r.isDarkMode()),a=tu(t,0)<jd;if(o===a)return i}},e.prototype.buildPath=function(t,i,r){},e.prototype.pathUpdated=function(){this.__dirty&=~Po},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Hi(!1)},e.prototype.hasStroke=function(){var t=this.style,i=t.stroke;return!(i==null||i==="none"||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style,i=t.fill;return i!=null&&i!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,i=this.style,r=!t;if(r){var o=!1;this.path||(o=!0,this.createPathProxy());var a=this.path;(o||this.__dirty&Po)&&(a.beginPath(),this.buildPath(a,this.shape,!1),this.pathUpdated()),t=a.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||r){s.copy(t);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,i){var r=this.transformCoordToLocal(t,i),o=this.getBoundingRect(),a=this.style;if(t=r[0],i=r[1],o.contain(t,i)){var s=this.path;if(this.hasStroke()){var l=a.lineWidth,u=a.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),nA(s,l/u,t,i)))return!0}if(this.hasFill())return tA(s,t,i)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Po,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,i){t==="shape"?this.setShape(i):n.prototype.attrKV.call(this,t,i)},e.prototype.setShape=function(t,i){var r=this.shape;return r||(r=this.shape={}),typeof t=="string"?r[t]=i:U(r,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Po)},e.prototype.createStyle=function(t){return Fl(_u,t)},e.prototype._innerSaveToNormal=function(t){n.prototype._innerSaveToNormal.call(this,t);var i=this._normalState;t.shape&&!i.shape&&(i.shape=U({},this.shape))},e.prototype._applyStateObj=function(t,i,r,o,a,s){n.prototype._applyStateObj.call(this,t,i,r,o,a,s);var l=!(i&&o),u;if(i&&i.shape?a?o?u=i.shape:(u=U({},r.shape),U(u,i.shape)):(u=U({},o?this.shape:r.shape),U(u,i.shape)):l&&(u=r.shape),u)if(a){this.shape=U({},this.shape);for(var c={},h=Ce(u),d=0;d<h.length;d++){var f=h[d];typeof u[f]=="object"?this.shape[f]=u[f]:c[f]=u[f]}this._transitionState(t,{shape:c},s)}else this.shape=u,this.dirtyShape()},e.prototype._mergeStates=function(t){for(var i=n.prototype._mergeStates.call(this,t),r,o=0;o<t.length;o++){var a=t[o];a.shape&&(r=r||{},this._mergeStyle(r,a.shape))}return r&&(i.shape=r),i},e.prototype.getAnimationStyleProps=function(){return iA},e.prototype.isZeroArea=function(){return!1},e.extend=function(t){var i=function(o){W(a,o);function a(s){var l=o.call(this,s)||this;return t.init&&t.init.call(l,s),l}return a.prototype.getDefaultStyle=function(){return ue(t.style)},a.prototype.getDefaultShape=function(){return ue(t.shape)},a}(e);for(var r in t)typeof t[r]=="function"&&(i.prototype[r]=t[r]);return i},e.initDefaultProps=function(){var t=e.prototype;t.type="path",t.strokeContainThreshold=5,t.segmentIgnoreThreshold=0,t.subPixelOptimize=!1,t.autoBatch=!1,t.__dirty=Yt|is|Po}(),e}(rs),rA=Me({strokeFirst:!0,font:oi,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},_u),ss=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.hasStroke=function(){return y0(this.style)},e.prototype.hasFill=function(){var t=this.style,i=t.fill;return i!=null&&i!=="none"},e.prototype.createStyle=function(t){return Fl(rA,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){return this._rect||(this._rect=sN(this.style)),this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(rs);ss.prototype.type="tspan";var oA=Me({x:0,y:0},Mr),aA={style:Me({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},pu.style)};function sA(n){return!!(n&&typeof n!="string"&&n.width&&n.height)}var Hn=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return Fl(oA,t)},e.prototype._getSize=function(t){var i=this.style,r=i[t];if(r!=null)return r;var o=sA(i.image)?i.image:this.__image;if(!o)return 0;var a=t==="width"?"height":"width",s=i[a];return s==null?o[t]:o[t]/o[a]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return aA},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new ve(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(rs);Hn.prototype.type="image";function lA(n,e){var t=e.x,i=e.y,r=e.width,o=e.height,a=e.r,s,l,u,c;r<0&&(t=t+r,r=-r),o<0&&(i=i+o,o=-o),typeof a=="number"?s=l=u=c=a:a instanceof Array?a.length===1?s=l=u=c=a[0]:a.length===2?(s=u=a[0],l=c=a[1]):a.length===3?(s=a[0],l=c=a[1],u=a[2]):(s=a[0],l=a[1],u=a[2],c=a[3]):s=l=u=c=0;var h;s+l>r&&(h=s+l,s*=r/h,l*=r/h),u+c>r&&(h=u+c,u*=r/h,c*=r/h),l+u>o&&(h=l+u,l*=o/h,u*=o/h),s+c>o&&(h=s+c,s*=o/h,c*=o/h),n.moveTo(t+s,i),n.lineTo(t+r-l,i),l!==0&&n.arc(t+r-l,i+l,l,-Math.PI/2,0),n.lineTo(t+r,i+o-u),u!==0&&n.arc(t+r-u,i+o-u,u,0,Math.PI/2),n.lineTo(t+c,i+o),c!==0&&n.arc(t+c,i+o-c,c,Math.PI/2,Math.PI),n.lineTo(t,i+s),s!==0&&n.arc(t+s,i+s,s,Math.PI,Math.PI*1.5)}var Vo=Math.round;function J0(n,e,t){if(e){var i=e.x1,r=e.x2,o=e.y1,a=e.y2;n.x1=i,n.x2=r,n.y1=o,n.y2=a;var s=t&&t.lineWidth;return s&&(Vo(i*2)===Vo(r*2)&&(n.x1=n.x2=Ar(i,s,!0)),Vo(o*2)===Vo(a*2)&&(n.y1=n.y2=Ar(o,s,!0))),n}}function e_(n,e,t){if(e){var i=e.x,r=e.y,o=e.width,a=e.height;n.x=i,n.y=r,n.width=o,n.height=a;var s=t&&t.lineWidth;return s&&(n.x=Ar(i,s,!0),n.y=Ar(r,s,!0),n.width=Math.max(Ar(i+o,s,!1)-n.x,o===0?0:1),n.height=Math.max(Ar(r+a,s,!1)-n.y,a===0?0:1)),n}}function Ar(n,e,t){if(!e)return n;var i=Vo(n*2);return(i+Vo(e))%2===0?i/2:(i+(t?1:-1))/2}var uA=function(){function n(){this.x=0,this.y=0,this.width=0,this.height=0}return n}(),cA={},Ue=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new uA},e.prototype.buildPath=function(t,i){var r,o,a,s;if(this.subPixelOptimize){var l=e_(cA,i,this.style);r=l.x,o=l.y,a=l.width,s=l.height,l.r=i.r,i=l}else r=i.x,o=i.y,a=i.width,s=i.height;i.r?lA(t,i):t.rect(r,o,a,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Ae);Ue.prototype.type="rect";var t_={fill:"#000"},n_=2,Fn={},hA={style:Me({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},pu.style)},it=function(n){W(e,n);function e(t){var i=n.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=t_,i.attr(t),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){n.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var i=this._children[t];i.zlevel=this.zlevel,i.z=this.z,i.z2=this.z2,i.culling=this.culling,i.cursor=this.cursor,i.invisible=this.invisible}},e.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):n.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(t){var i=this.innerTransformable;return i?i.getLocalTransform(t):n.prototype.getLocalTransform.call(this,t)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),n.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,pA(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(t){n.prototype.addSelfToZr.call(this,t);for(var i=0;i<this._children.length;i++)this._children[i].__zr=t},e.prototype.removeSelfFromZr=function(t){n.prototype.removeSelfFromZr.call(this,t);for(var i=0;i<this._children.length;i++)this._children[i].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new ve(0,0,0,0),i=this._children,r=[],o=null,a=0;a<i.length;a++){var s=i[a],l=s.getBoundingRect(),u=s.getLocalTransform(r);u?(t.copy(l),t.applyTransform(u),o=o||t.clone(),o.union(t)):(o=o||l.clone(),o.union(l))}this._rect=o||t}return this._rect},e.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||t_},e.prototype.setTextContent=function(t){if(process.env.NODE_ENV!=="production")throw new Error("Can't attach text on another text")},e.prototype._mergeStyle=function(t,i){if(!i)return t;var r=i.rich,o=t.rich||r&&{};return U(t,i),r&&o?(this._mergeRich(o,r),t.rich=o):o&&(t.rich=o),t},e.prototype._mergeRich=function(t,i){for(var r=Ce(i),o=0;o<r.length;o++){var a=r[o];t[a]=t[a]||{},U(t[a],i[a])}},e.prototype.getAnimationStyleProps=function(){return hA},e.prototype._getOrCreateChild=function(t){var i=this._children[this._childCursor];return(!i||!(i instanceof t))&&(i=new t),this._children[this._childCursor++]=i,i.__zr=this.__zr,i.parent=this,i},e.prototype._updatePlainTexts=function(){var t=this.style,i=t.font||oi,r=t.padding,o=this._defaultStyle,a=t.x||0,s=t.y||0,l=t.align||o.align||"left",u=t.verticalAlign||o.verticalAlign||"top";p0(Fn,o.overflowRect,a,s,l,u),a=Fn.baseX,s=Fn.baseY;var c=h_(t),h=eN(c,t,Fn.outerWidth,Fn.outerHeight),d=df(t),f=!!t.backgroundColor,p=h.outerHeight,g=h.outerWidth,m=h.lines,y=h.lineHeight;this.isTruncated=!!h.isTruncated;var v=a,_=br(s,h.contentHeight,u);if(d||r){var b=ko(a,g,l),T=br(s,p,u);d&&this._renderBackground(t,t,b,T,g,p)}_+=y/2,r&&(v=c_(a,l,r),u==="top"?_+=r[0]:u==="bottom"&&(_-=r[2]));for(var w=0,S=!1,M=!1,C=u_("fill"in t?t.fill:(M=!0,o.fill)),I=l_("stroke"in t?t.stroke:!f&&(!o.autoStroke||M)?(w=n_,S=!0,o.stroke):null),E=t.textShadowBlur>0,k=0;k<m.length;k++){var D=this._getOrCreateChild(ss),A=D.createStyle();D.useStyle(A),A.text=m[k],A.x=v,A.y=_,A.textAlign=l,A.textBaseline="middle",A.opacity=t.opacity,A.strokeFirst=!0,E&&(A.shadowBlur=t.textShadowBlur||0,A.shadowColor=t.textShadowColor||"transparent",A.shadowOffsetX=t.textShadowOffsetX||0,A.shadowOffsetY=t.textShadowOffsetY||0),A.stroke=I,A.fill=C,I&&(A.lineWidth=t.lineWidth||w,A.lineDash=t.lineDash,A.lineDashOffset=t.lineDashOffset||0),A.font=i,o_(A,t),_+=y,D.setBoundingRect(Sd(A,h.contentWidth,h.calculatedLineHeight,S?0:null))}},e.prototype._updateRichTexts=function(){var t=this.style,i=this._defaultStyle,r=t.align||i.align,o=t.verticalAlign||i.verticalAlign,a=t.x||0,s=t.y||0;p0(Fn,i.overflowRect,a,s,r,o),a=Fn.baseX,s=Fn.baseY;var l=h_(t),u=iN(l,t,Fn.outerWidth,Fn.outerHeight,r),c=u.width,h=u.outerWidth,d=u.outerHeight,f=t.padding;this.isTruncated=!!u.isTruncated;var p=ko(a,h,r),g=br(s,d,o),m=p,y=g;f&&(m+=f[3],y+=f[0]);var v=m+c;df(t)&&this._renderBackground(t,t,p,g,h,d);for(var _=!!t.backgroundColor,b=0;b<u.lines.length;b++){for(var T=u.lines[b],w=T.tokens,S=w.length,M=T.lineHeight,C=T.width,I=0,E=m,k=v,D=S-1,A=void 0;I<S&&(A=w[I],!A.align||A.align==="left");)this._placeToken(A,t,M,y,E,"left",_),C-=A.width,E+=A.width,I++;for(;D>=0&&(A=w[D],A.align==="right");)this._placeToken(A,t,M,y,k,"right",_),C-=A.width,k-=A.width,D--;for(E+=(c-(E-m)-(v-k)-C)/2;I<=D;)A=w[I],this._placeToken(A,t,M,y,E+A.width/2,"center",_),E+=A.width,I++;y+=M}},e.prototype._placeToken=function(t,i,r,o,a,s,l){var u=i.rich[t.styleName]||{};u.text=t.text;var c=t.verticalAlign,h=o+r/2;c==="top"?h=o+t.height/2:c==="bottom"&&(h=o+r-t.height/2);var d=!t.isLineHolder&&df(u);d&&this._renderBackground(u,i,s==="right"?a-t.width:s==="center"?a-t.width/2:a,h-t.height/2,t.width,t.height);var f=!!u.backgroundColor,p=t.textPadding;p&&(a=c_(a,s,p),h-=t.height/2-p[0]-t.innerHeight/2);var g=this._getOrCreateChild(ss),m=g.createStyle();g.useStyle(m);var y=this._defaultStyle,v=!1,_=0,b=!1,T=u_("fill"in u?u.fill:"fill"in i?i.fill:(v=!0,y.fill)),w=l_("stroke"in u?u.stroke:"stroke"in i?i.stroke:!f&&!l&&(!y.autoStroke||v)?(_=n_,b=!0,y.stroke):null),S=u.textShadowBlur>0||i.textShadowBlur>0;m.text=t.text,m.x=a,m.y=h,S&&(m.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,m.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",m.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,m.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),m.textAlign=s,m.textBaseline="middle",m.font=t.font||oi,m.opacity=si(u.opacity,i.opacity,1),o_(m,u),w&&(m.lineWidth=si(u.lineWidth,i.lineWidth,_),m.lineDash=te(u.lineDash,i.lineDash),m.lineDashOffset=i.lineDashOffset||0,m.stroke=w),T&&(m.fill=T),g.setBoundingRect(Sd(m,t.contentWidth,t.contentHeight,b?0:null))},e.prototype._renderBackground=function(t,i,r,o,a,s){var l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,h=l&&l.image,d=l&&!h,f=t.borderRadius,p=this,g,m;if(d||t.lineHeight||u&&c){g=this._getOrCreateChild(Ue),g.useStyle(g.createStyle()),g.style.fill=null;var y=g.shape;y.x=r,y.y=o,y.width=a,y.height=s,y.r=f,g.dirtyShape()}if(d){var v=g.style;v.fill=l||null,v.fillOpacity=te(t.fillOpacity,1)}else if(h){m=this._getOrCreateChild(Hn),m.onload=function(){p.dirtyStyle()};var _=m.style;_.image=l.image,_.x=r,_.y=o,_.width=a,_.height=s}if(u&&c){var v=g.style;v.lineWidth=u,v.stroke=c,v.strokeOpacity=te(t.strokeOpacity,1),v.lineDash=t.borderDash,v.lineDashOffset=t.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(v.strokeFirst=!0,v.lineWidth*=2)}var b=(g||m).style;b.shadowBlur=t.shadowBlur||0,b.shadowColor=t.shadowColor||"transparent",b.shadowOffsetX=t.shadowOffsetX||0,b.shadowOffsetY=t.shadowOffsetY||0,b.opacity=si(t.opacity,i.opacity,1)},e.makeFont=function(t){var i="";return a_(t)&&(i=[t.fontStyle,t.fontWeight,r_(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),i&&An(i)||t.textFont||t.font},e}(rs),dA={left:!0,right:1,center:1},fA={top:1,bottom:1,middle:1},i_=["fontStyle","fontWeight","fontSize","fontFamily"];function r_(n){return typeof n=="string"&&(n.indexOf("px")!==-1||n.indexOf("rem")!==-1||n.indexOf("em")!==-1)?n:isNaN(+n)?rd+"px":n+"px"}function o_(n,e){for(var t=0;t<i_.length;t++){var i=i_[t],r=e[i];r!=null&&(n[i]=r)}}function a_(n){return n.fontSize!=null||n.fontFamily||n.fontWeight}function pA(n){return s_(n),N(n.rich,s_),n}function s_(n){if(n){n.font=it.makeFont(n);var e=n.align;e==="middle"&&(e="center"),n.align=e==null||dA[e]?e:"left";var t=n.verticalAlign;t==="center"&&(t="middle"),n.verticalAlign=t==null||fA[t]?t:"top";var i=n.padding;i&&(n.padding=ld(n.padding))}}function l_(n,e){return n==null||e<=0||n==="transparent"||n==="none"?null:n.image||n.colorStops?"#000":n}function u_(n){return n==null||n==="none"?null:n.image||n.colorStops?"#000":n}function c_(n,e,t){return e==="right"?n-t[1]:e==="center"?n+t[3]/2-t[1]/2:n+t[3]}function h_(n){var e=n.text;return e!=null&&(e+=""),e}function df(n){return!!(n.backgroundColor||n.lineHeight||n.borderWidth&&n.borderColor)}var d_=1e-4,f_=20;function gA(n){return n.replace(/^\s+|\s+$/g,"")}var ls=Math.min,qt=Math.max,Gn=Math.abs;function jt(n,e,t,i){var r=e[0],o=e[1],a=t[0],s=t[1],l=o-r,u=s-a;if(l===0)return u===0?a:(a+s)/2;if(i)if(l>0){if(n<=r)return a;if(n>=o)return s}else{if(n>=r)return a;if(n<=o)return s}else{if(n===r)return a;if(n===o)return s}return(n-r)/l*u+a}var Pe=mA;function mA(n,e,t){switch(n){case"center":case"middle":n="50%";break;case"left":case"top":n="0%";break;case"right":case"bottom":n="100%";break}return ff(n,e,t)}function ff(n,e,t){return Q(n)?gA(n).match(/%$/)?parseFloat(n)/100*e+(t||0):parseFloat(n):n==null?NaN:+n}function at(n,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),f_),n=(+n).toFixed(e),t?n:+n}function pf(n){return n.sort(function(e,t){return e-t}),n}function Wn(n){if(n=+n,isNaN(n))return 0;if(n>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(n*e)/e===n)return t}return gf(n)}function gf(n){var e=n.toString().toLowerCase(),t=e.indexOf("e"),i=t>0?+e.slice(t+1):0,r=t>0?t:e.length,o=e.indexOf("."),a=o<0?0:r-1-o;return Math.max(0,a-i)}function p_(n,e){var t=Math.log,i=Math.LN10,r=Math.floor(t(n[1]-n[0])/i),o=Math.round(t(Gn(e[1]-e[0]))/i),a=Math.min(Math.max(-r+o,0),20);return isFinite(a)?a:20}function yA(n,e){var t=Ai(n,function(f,p){return f+(isNaN(p)?0:p)},0);if(t===0)return[];for(var i=Math.pow(10,e),r=$(n,function(f){return(isNaN(f)?0:f)/t*i*100}),o=i*100,a=$(r,function(f){return Math.floor(f)}),s=Ai(a,function(f,p){return f+p},0),l=$(r,function(f,p){return f-a[p]});s<o;){for(var u=Number.NEGATIVE_INFINITY,c=null,h=0,d=l.length;h<d;++h)l[h]>u&&(u=l[h],c=h);++a[c],l[c]=0,++s}return $(a,function(f){return f/i})}function vA(n,e){var t=Math.max(Wn(n),Wn(e)),i=n+e;return t>f_?i:at(i,t)}function g_(n){var e=Math.PI*2;return(n%e+e)%e}function xu(n){return n>-d_&&n<d_}var _A=/^(?:(\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 Ho(n){if(n instanceof Date)return n;if(Q(n)){var e=_A.exec(n);if(!e)return new Date(NaN);if(e[8]){var t=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(t-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,t,+(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(n==null)return new Date(NaN);return new Date(Math.round(n))}function xA(n){return Math.pow(10,bu(n))}function bu(n){if(n===0)return 0;var e=Math.floor(Math.log(n)/Math.LN10);return n/Math.pow(10,e)>=10&&e++,e}function m_(n,e){var t=bu(n),i=Math.pow(10,t),r=n/i,o;return r<1.5?o=1:r<2.5?o=2:r<4?o=3:r<7?o=5:o=10,n=o*i,t>=-20?+n.toFixed(t<0?-t:0):n}function wu(n){var e=parseFloat(n);return e==n&&(e!==0||!Q(n)||n.indexOf("x")<=0)?e:NaN}function y_(n){return!isNaN(wu(n))}function v_(){return Math.round(Math.random()*9)}function __(n,e){return e===0?n:__(e,n%e)}function x_(n,e){return n==null?e:e==null?n:n*e/__(n,e)}var bA="[ECharts] ",b_={},wA=typeof console<"u"&&console.warn&&console.log;function Su(n,e,t){if(wA){if(t){if(b_[e])return;b_[e]=!0}console[n](bA+e)}}function w_(n,e){Su("log",n,e)}function st(n,e){Su("warn",n,e)}function ze(n,e){Su("error",n,e)}function fi(n){process.env.NODE_ENV!=="production"&&Su("warn","DEPRECATED: "+n,!0)}function rt(n,e,t){process.env.NODE_ENV!=="production"&&fi((t?"["+t+"]":"")+(n+" is deprecated; use "+e+" instead."))}function Tu(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t="";if(process.env.NODE_ENV!=="production"){var i=function(r){return r===void 0?"undefined":r===1/0?"Infinity":r===-1/0?"-Infinity":To(r)?"NaN":r instanceof Date?"Date("+r.toISOString()+")":ce(r)?"function () { ... }":C2(r)?r+"":null};t=$(n,function(r){if(Q(r))return r;var o=i(r);if(o!=null)return o;if(typeof JSON<"u"&&JSON.stringify)try{return JSON.stringify(r,function(a,s){var l=i(s);return l??s})}catch{return"?"}else return"?"}).join(" ")}return t}function Lt(n){throw new Error(n)}function S_(n,e,t){return(e-n)*t+n}var T_="series\0",M_="\0_ec_\0";function _t(n){return n instanceof Array?n:n==null?[]:[n]}function Mu(n,e,t){if(n){n[e]=n[e]||{},n.emphasis=n.emphasis||{},n.emphasis[e]=n.emphasis[e]||{};for(var i=0,r=t.length;i<r;i++){var o=t[i];!n.emphasis[e].hasOwnProperty(o)&&n[e].hasOwnProperty(o)&&(n.emphasis[e][o]=n[e][o])}}}var C_=["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 us(n){return ne(n)&&!q(n)&&!(n instanceof Date)?n.value:n}function SA(n){return ne(n)&&!(n instanceof Array)}function TA(n,e,t){var i=t==="normalMerge",r=t==="replaceMerge",o=t==="replaceAll";n=n||[],e=(e||[]).slice();var a=me();N(e,function(l,u){if(!ne(l)){e[u]=null;return}process.env.NODE_ENV!=="production"&&(l.id!=null&&!I_(l.id)&&D_(l.id),l.name!=null&&!I_(l.name)&&D_(l.name))});var s=MA(n,a,t);return(i||r)&&CA(s,n,a,e),i&&kA(s,e),i||r?DA(s,e,r):o&&IA(s,e),EA(s),s}function MA(n,e,t){var i=[];if(t==="replaceAll")return i;for(var r=0;r<n.length;r++){var o=n[r];o&&o.id!=null&&e.set(o.id,r),i.push({existing:t==="replaceMerge"||Fo(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return i}function CA(n,e,t,i){N(i,function(r,o){if(!(!r||r.id==null)){var a=cs(r.id),s=t.get(a);if(s!=null){var l=n[s];J(!l.newOption,'Duplicated option on id "'+a+'".'),l.newOption=r,l.existing=e[s],i[o]=null}}})}function kA(n,e){N(e,function(t,i){if(!(!t||t.name==null))for(var r=0;r<n.length;r++){var o=n[r].existing;if(!n[r].newOption&&o&&(o.id==null||t.id==null)&&!Fo(t)&&!Fo(o)&&k_("name",o,t)){n[r].newOption=t,e[i]=null;return}}})}function DA(n,e,t){N(e,function(i){if(i){for(var r,o=0;(r=n[o])&&(r.newOption||Fo(r.existing)||r.existing&&i.id!=null&&!k_("id",i,r.existing));)o++;r?(r.newOption=i,r.brandNew=t):n.push({newOption:i,brandNew:t,existing:null,keyInfo:null}),o++}})}function IA(n,e){N(e,function(t){n.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})})}function EA(n){var e=me();N(n,function(t){var i=t.existing;i&&e.set(i.id,t)}),N(n,function(t){var i=t.newOption;J(!i||i.id==null||!e.get(i.id)||e.get(i.id)===t,"id duplicates: "+(i&&i.id)),i&&i.id!=null&&e.set(i.id,t),!t.keyInfo&&(t.keyInfo={})}),N(n,function(t,i){var r=t.existing,o=t.newOption,a=t.keyInfo;if(ne(o)){if(a.name=o.name!=null?cs(o.name):r?r.name:T_+i,r)a.id=cs(r.id);else if(o.id!=null)a.id=cs(o.id);else{var s=0;do a.id="\0"+a.name+"\0"+s++;while(e.get(a.id))}e.set(a.id,t)}})}function k_(n,e,t){var i=Un(e[n],null),r=Un(t[n],null);return i!=null&&r!=null&&i===r}function cs(n){if(process.env.NODE_ENV!=="production"&&n==null)throw new Error;return Un(n,"")}function Un(n,e){return n==null?e:Q(n)?n:Ne(n)||Vl(n)?n+"":e}function D_(n){process.env.NODE_ENV!=="production"&&st("`"+n+"` is invalid id or name. Must be a string or number.")}function I_(n){return Vl(n)||y_(n)}function mf(n){var e=n.name;return!!(e&&e.indexOf(T_))}function Fo(n){return n&&n.id!=null&&cs(n.id).indexOf(M_)===0}function NA(n){return M_+n}function AA(n,e,t){N(n,function(i){var r=i.newOption;ne(r)&&(i.keyInfo.mainType=e,i.keyInfo.subType=OA(e,r,i.existing,t))})}function OA(n,e,t,i){var r=e.type?e.type:t?t.subType:i.determineSubType(n,e);return r}function Or(n,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return q(e.dataIndex)?$(e.dataIndex,function(t){return n.indexOfRawIndex(t)}):n.indexOfRawIndex(e.dataIndex);if(e.name!=null)return q(e.name)?$(e.name,function(t){return n.indexOfName(t)}):n.indexOfName(e.name)}function Re(){var n="__ec_inner_"+RA++;return function(e){return e[n]||(e[n]={})}}var RA=v_();function hs(n,e,t){var i=yf(e,t),r=i.mainTypeSpecified,o=i.queryOptionMap,a=i.others,s=a,l=t?t.defaultMainType:null;return!r&&l&&o.set(l,{}),o.each(function(u,c){var h=ds(n,c,u,{useDefault:l===c,enableAll:t&&t.enableAll!=null?t.enableAll:!0,enableNone:t&&t.enableNone!=null?t.enableNone:!0});s[c+"Models"]=h.models,s[c+"Model"]=h.models[0]}),s}function yf(n,e){var t;if(Q(n)){var i={};i[n+"Index"]=0,t=i}else t=n;var r=me(),o={},a=!1;return N(t,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){o[l]=s;return}var u=l.match(/^(\w+)(Index|Id|Name)$/)||[],c=u[1],h=(u[2]||"").toLowerCase();if(!(!c||!h||e&&e.includeMainTypes&&be(e.includeMainTypes,c)<0)){a=a||!!c;var d=r.get(c)||r.set(c,{});d[h]=s}}),{mainTypeSpecified:a,queryOptionMap:r,others:o}}var xt={useDefault:!0,enableAll:!1,enableNone:!1},LA={useDefault:!1,enableAll:!0,enableNone:!0};function ds(n,e,t,i){i=i||xt;var r=t.index,o=t.id,a=t.name,s={models:null,specified:r!=null||o!=null||a!=null};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=n.getComponent(e))?[l]:[],s}if(r==="none"||r===!1){if(i.enableNone)return s.models=[],s;process.env.NODE_ENV!=="production"&&ze('`"none"` or `false` is not a valid value on index option.'),r=-1}return r==="all"&&(i.enableAll?r=o=a=null:(process.env.NODE_ENV!=="production"&&ze('`"all"` is not a valid value on index option.'),r=-1)),s.models=n.queryComponents({mainType:e,index:r,id:o,name:a}),s}function E_(n,e,t){n.setAttribute?n.setAttribute(e,t):n[e]=t}function PA(n,e){return n.getAttribute?n.getAttribute(e):n[e]}function zA(n){return n==="auto"?fe.domSupported?"html":"richText":n||"html"}function BA(n,e,t,i,r){var o=e==null||e==="auto";if(i==null)return i;if(Ne(i)){var a=S_(t||0,i,r);return at(a,o?Math.max(Wn(t||0),Wn(i)):e)}else{if(Q(i))return r<1?t:i;for(var s=[],l=t,u=i,c=Math.max(l?l.length:0,u.length),h=0;h<c;++h){var d=n.getDimensionInfo(h);if(d&&d.type==="ordinal")s[h]=(r<1&&l?l:u)[h];else{var f=l&&l[h]?l[h]:0,p=u[h],a=S_(f,p,r);s[h]=at(a,o?Math.max(Wn(f),Wn(p)):e)}}return s}}var Se=Re(),VA=function(n,e,t,i){if(i){var r=Se(i);r.dataIndex=t,r.dataType=e,r.seriesIndex=n,r.ssrType="chart",i.type==="group"&&i.traverse(function(o){var a=Se(o);a.seriesIndex=n,a.dataIndex=t,a.dataType=e,a.ssrType="chart"})}},N_=1,A_={},O_=Re(),vf=Re(),_f=0,Cu=1,ku=2,Pt=["emphasis","blur","select"],Du=["normal","emphasis","blur","select"],HA=10,FA=9,Rr="highlight",Iu="downplay",Eu="select",xf="unselect",Nu="toggleSelect",bf="selectchanged";function Go(n){return n!=null&&n!=="none"}function Au(n,e,t){n.onHoverStateChange&&(n.hoverState||0)!==t&&n.onHoverStateChange(e),n.hoverState=t}function R_(n){Au(n,"emphasis",ku)}function L_(n){n.hoverState===ku&&Au(n,"normal",_f)}function wf(n){Au(n,"blur",Cu)}function P_(n){n.hoverState===Cu&&Au(n,"normal",_f)}function GA(n){n.selected=!0}function WA(n){n.selected=!1}function z_(n,e,t){e(n,t)}function pi(n,e,t){z_(n,e,t),n.isGroup&&n.traverse(function(i){z_(i,e,t)})}function B_(n,e){switch(e){case"emphasis":n.hoverState=ku;break;case"normal":n.hoverState=_f;break;case"blur":n.hoverState=Cu;break;case"select":n.selected=!0}}function UA(n,e,t,i){for(var r=n.style,o={},a=0;a<e.length;a++){var s=e[a],l=r[s];o[s]=l??(i&&i[s])}for(var a=0;a<n.animators.length;a++){var u=n.animators[a];u.__fromStateTransition&&u.__fromStateTransition.indexOf(t)<0&&u.targetName==="style"&&u.saveTo(o,e)}return o}function YA(n,e,t,i){var r=t&&be(t,"select")>=0,o=!1;if(n instanceof Ae){var a=O_(n),s=r&&a.selectFill||a.normalFill,l=r&&a.selectStroke||a.normalStroke;if(Go(s)||Go(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(o=!0,i=U({},i),u=U({},u),u.fill=s):!Go(u.fill)&&Go(s)?(o=!0,i=U({},i),u=U({},u),u.fill=Vd(s)):!Go(u.stroke)&&Go(l)&&(o||(i=U({},i),u=U({},u)),u.stroke=Vd(l)),i.style=u}}if(i&&i.z2==null){o||(i=U({},i));var c=n.z2EmphasisLift;i.z2=n.z2+(c??HA)}return i}function qA(n,e,t){if(t&&t.z2==null){t=U({},t);var i=n.z2SelectLift;t.z2=n.z2+(i??FA)}return t}function jA(n,e,t){var i=be(n.currentStates,e)>=0,r=n.style.opacity,o=i?null:UA(n,["opacity"],e,{opacity:1});t=t||{};var a=t.style||{};return a.opacity==null&&(t=U({},t),a=U({opacity:i?r:o.opacity*.1},a),t.style=a),t}function Sf(n,e){var t=this.states[n];if(this.style){if(n==="emphasis")return YA(this,n,e,t);if(n==="blur")return jA(this,n,t);if(n==="select")return qA(this,n,t)}return t}function $A(n){n.stateProxy=Sf;var e=n.getTextContent(),t=n.getTextGuideLine();e&&(e.stateProxy=Sf),t&&(t.stateProxy=Sf)}function V_(n,e){!U_(n,e)&&!n.__highByOuter&&pi(n,R_)}function H_(n,e){!U_(n,e)&&!n.__highByOuter&&pi(n,L_)}function Lr(n,e){n.__highByOuter|=1<<(e||0),pi(n,R_)}function Pr(n,e){!(n.__highByOuter&=~(1<<(e||0)))&&pi(n,L_)}function F_(n){pi(n,wf)}function Tf(n){pi(n,P_)}function G_(n){pi(n,GA)}function W_(n){pi(n,WA)}function U_(n,e){return n.__highDownSilentOnTouch&&e.zrByTouch}function Y_(n){var e=n.getModel(),t=[],i=[];e.eachComponent(function(r,o){var a=vf(o),s=r==="series",l=s?n.getViewOfSeriesModel(o):n.getViewOfComponentModel(o);!s&&i.push(l),a.isBlured&&(l.group.traverse(function(u){P_(u)}),s&&t.push(o)),a.isBlured=!1}),N(i,function(r){r&&r.toggleBlurSeries&&r.toggleBlurSeries(t,!1,e)})}function Mf(n,e,t,i){var r=i.getModel();t=t||"coordinateSystem";function o(u,c){for(var h=0;h<c.length;h++){var d=u.getItemGraphicEl(c[h]);d&&Tf(d)}}if(n!=null&&!(!e||e==="none")){var a=r.getSeriesByIndex(n),s=a.coordinateSystem;s&&s.master&&(s=s.master);var l=[];r.eachSeries(function(u){var c=a===u,h=u.coordinateSystem;h&&h.master&&(h=h.master);var d=h&&s?h===s:c;if(!(t==="series"&&!c||t==="coordinateSystem"&&!d||e==="series"&&c)){var f=i.getViewOfSeriesModel(u);if(f.group.traverse(function(m){m.__highByOuter&&c&&e==="self"||wf(m)}),Ot(e))o(u.getData(),e);else if(ne(e))for(var p=Ce(e),g=0;g<p.length;g++)o(u.getData(p[g]),e[p[g]]);l.push(u),vf(u).isBlured=!0}}),r.eachComponent(function(u,c){if(u!=="series"){var h=i.getViewOfComponentModel(c);h&&h.toggleBlurSeries&&h.toggleBlurSeries(l,!0,r)}})}}function Cf(n,e,t){if(!(n==null||e==null)){var i=t.getModel().getComponent(n,e);if(i){vf(i).isBlured=!0;var r=t.getViewOfComponentModel(i);!r||!r.focusBlurEnabled||r.group.traverse(function(o){wf(o)})}}}function ZA(n,e,t){var i=n.seriesIndex,r=n.getData(e.dataType);if(!r){process.env.NODE_ENV!=="production"&&ze("Unknown dataType "+e.dataType);return}var o=Or(r,e);o=(q(o)?o[0]:o)||0;var a=r.getItemGraphicEl(o);if(!a)for(var s=r.count(),l=0;!a&&l<s;)a=r.getItemGraphicEl(l++);if(a){var u=Se(a);Mf(i,u.focus,u.blurScope,t)}else{var c=n.get(["emphasis","focus"]),h=n.get(["emphasis","blurScope"]);c!=null&&Mf(i,c,h,t)}}function kf(n,e,t,i){var r={focusSelf:!1,dispatchers:null};if(n==null||n==="series"||e==null||t==null)return r;var o=i.getModel().getComponent(n,e);if(!o)return r;var a=i.getViewOfComponentModel(o);if(!a||!a.findHighDownDispatchers)return r;for(var s=a.findHighDownDispatchers(t),l,u=0;u<s.length;u++)if(process.env.NODE_ENV!=="production"&&!Wo(s[u])&&ze("param should be highDownDispatcher"),Se(s[u]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function XA(n,e,t){process.env.NODE_ENV!=="production"&&!Wo(n)&&ze("param should be highDownDispatcher");var i=Se(n),r=kf(i.componentMainType,i.componentIndex,i.componentHighDownName,t),o=r.dispatchers,a=r.focusSelf;o?(a&&Cf(i.componentMainType,i.componentIndex,t),N(o,function(s){return V_(s,e)})):(Mf(i.seriesIndex,i.focus,i.blurScope,t),i.focus==="self"&&Cf(i.componentMainType,i.componentIndex,t),V_(n,e))}function KA(n,e,t){process.env.NODE_ENV!=="production"&&!Wo(n)&&ze("param should be highDownDispatcher"),Y_(t);var i=Se(n),r=kf(i.componentMainType,i.componentIndex,i.componentHighDownName,t).dispatchers;r?N(r,function(o){return H_(o,e)}):H_(n,e)}function QA(n,e,t){if(If(e)){var i=e.dataType,r=n.getData(i),o=Or(r,e);q(o)||(o=[o]),n[e.type===Nu?"toggleSelect":e.type===Eu?"select":"unselect"](o,i)}}function q_(n){var e=n.getAllData();N(e,function(t){var i=t.data,r=t.type;i.eachItemGraphicEl(function(o,a){n.isSelected(a,r)?G_(o):W_(o)})})}function JA(n){var e=[];return n.eachSeries(function(t){var i=t.getAllData();N(i,function(r){r.data;var o=r.type,a=t.getSelectedDataIndices();if(a.length>0){var s={dataIndex:a,seriesIndex:t.seriesIndex};o!=null&&(s.dataType=o),e.push(s)}})}),e}function Df(n,e,t){$_(n,!0),pi(n,$A),tO(n,e,t)}function eO(n){$_(n,!1)}function zr(n,e,t,i){i?eO(n):Df(n,e,t)}function tO(n,e,t){var i=Se(n);e!=null?(i.focus=e,i.blurScope=t):i.focus&&(i.focus=null)}var j_=["emphasis","blur","select"],nO={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function fs(n,e,t,i){t=t||"itemStyle";for(var r=0;r<j_.length;r++){var o=j_[r],a=e.getModel([o,t]),s=n.ensureState(o);s.style=a[nO[t]]()}}function $_(n,e){var t=e===!1,i=n;n.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=n.highDownSilentOnTouch),(!t||i.__highDownDispatcher)&&(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!t)}function Wo(n){return!!(n&&n.__highDownDispatcher)}function iO(n){var e=A_[n];return e==null&&N_<=32&&(e=A_[n]=N_++),e}function If(n){var e=n.type;return e===Eu||e===xf||e===Nu}function Z_(n){var e=n.type;return e===Rr||e===Iu}function rO(n){var e=O_(n);e.normalFill=n.style.fill,e.normalStroke=n.style.stroke;var t=n.states.select||{};e.selectFill=t.style&&t.style.fill||null,e.selectStroke=t.style&&t.style.stroke||null}var Uo=Hi.CMD,oO=[[],[],[]],X_=Math.sqrt,aO=Math.atan2;function sO(n,e){if(e){var t=n.data,i=n.len(),r,o,a,s,l,u,c=Uo.M,h=Uo.C,d=Uo.L,f=Uo.R,p=Uo.A,g=Uo.Q;for(a=0,s=0;a<i;){switch(r=t[a++],s=a,o=0,r){case c:o=1;break;case d:o=1;break;case h:o=3;break;case g:o=2;break;case p:var m=e[4],y=e[5],v=X_(e[0]*e[0]+e[1]*e[1]),_=X_(e[2]*e[2]+e[3]*e[3]),b=aO(-e[1]/_,e[0]/v);t[a]*=v,t[a++]+=m,t[a]*=_,t[a++]+=y,t[a++]*=v,t[a++]*=_,t[a++]+=b,t[a++]+=b,a+=2,s=a;break;case f:u[0]=t[a++],u[1]=t[a++],Jt(u,u,e),t[s++]=u[0],t[s++]=u[1],u[0]+=t[a++],u[1]+=t[a++],Jt(u,u,e),t[s++]=u[0],t[s++]=u[1]}for(l=0;l<o;l++){var T=oO[l];T[0]=t[a++],T[1]=t[a++],Jt(T,T,e),t[s++]=T[0],t[s++]=T[1]}}n.increaseVersion()}}var Ef=Math.sqrt,Ou=Math.sin,Ru=Math.cos,ps=Math.PI;function K_(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function Nf(n,e){return(n[0]*e[0]+n[1]*e[1])/(K_(n)*K_(e))}function Q_(n,e){return(n[0]*e[1]<n[1]*e[0]?-1:1)*Math.acos(Nf(n,e))}function J_(n,e,t,i,r,o,a,s,l,u,c){var h=l*(ps/180),d=Ru(h)*(n-t)/2+Ou(h)*(e-i)/2,f=-1*Ou(h)*(n-t)/2+Ru(h)*(e-i)/2,p=d*d/(a*a)+f*f/(s*s);p>1&&(a*=Ef(p),s*=Ef(p));var g=(r===o?-1:1)*Ef((a*a*(s*s)-a*a*(f*f)-s*s*(d*d))/(a*a*(f*f)+s*s*(d*d)))||0,m=g*a*f/s,y=g*-s*d/a,v=(n+t)/2+Ru(h)*m-Ou(h)*y,_=(e+i)/2+Ou(h)*m+Ru(h)*y,b=Q_([1,0],[(d-m)/a,(f-y)/s]),T=[(d-m)/a,(f-y)/s],w=[(-1*d-m)/a,(-1*f-y)/s],S=Q_(T,w);if(Nf(T,w)<=-1&&(S=ps),Nf(T,w)>=1&&(S=0),S<0){var M=Math.round(S/ps*1e6)/1e6;S=ps*2+M%2*ps}c.addData(u,v,_,a,s,b,S,h,o)}var lO=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,uO=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function cO(n){var e=new Hi;if(!n)return e;var t=0,i=0,r=t,o=i,a,s=Hi.CMD,l=n.match(lO);if(!l)return e;for(var u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),d=void 0,f=c.match(uO)||[],p=f.length,g=0;g<p;g++)f[g]=parseFloat(f[g]);for(var m=0;m<p;){var y=void 0,v=void 0,_=void 0,b=void 0,T=void 0,w=void 0,S=void 0,M=t,C=i,I=void 0,E=void 0;switch(h){case"l":t+=f[m++],i+=f[m++],d=s.L,e.addData(d,t,i);break;case"L":t=f[m++],i=f[m++],d=s.L,e.addData(d,t,i);break;case"m":t+=f[m++],i+=f[m++],d=s.M,e.addData(d,t,i),r=t,o=i,h="l";break;case"M":t=f[m++],i=f[m++],d=s.M,e.addData(d,t,i),r=t,o=i,h="L";break;case"h":t+=f[m++],d=s.L,e.addData(d,t,i);break;case"H":t=f[m++],d=s.L,e.addData(d,t,i);break;case"v":i+=f[m++],d=s.L,e.addData(d,t,i);break;case"V":i=f[m++],d=s.L,e.addData(d,t,i);break;case"C":d=s.C,e.addData(d,f[m++],f[m++],f[m++],f[m++],f[m++],f[m++]),t=f[m-2],i=f[m-1];break;case"c":d=s.C,e.addData(d,f[m++]+t,f[m++]+i,f[m++]+t,f[m++]+i,f[m++]+t,f[m++]+i),t+=f[m-2],i+=f[m-1];break;case"S":y=t,v=i,I=e.len(),E=e.data,a===s.C&&(y+=t-E[I-4],v+=i-E[I-3]),d=s.C,M=f[m++],C=f[m++],t=f[m++],i=f[m++],e.addData(d,y,v,M,C,t,i);break;case"s":y=t,v=i,I=e.len(),E=e.data,a===s.C&&(y+=t-E[I-4],v+=i-E[I-3]),d=s.C,M=t+f[m++],C=i+f[m++],t+=f[m++],i+=f[m++],e.addData(d,y,v,M,C,t,i);break;case"Q":M=f[m++],C=f[m++],t=f[m++],i=f[m++],d=s.Q,e.addData(d,M,C,t,i);break;case"q":M=f[m++]+t,C=f[m++]+i,t+=f[m++],i+=f[m++],d=s.Q,e.addData(d,M,C,t,i);break;case"T":y=t,v=i,I=e.len(),E=e.data,a===s.Q&&(y+=t-E[I-4],v+=i-E[I-3]),t=f[m++],i=f[m++],d=s.Q,e.addData(d,y,v,t,i);break;case"t":y=t,v=i,I=e.len(),E=e.data,a===s.Q&&(y+=t-E[I-4],v+=i-E[I-3]),t+=f[m++],i+=f[m++],d=s.Q,e.addData(d,y,v,t,i);break;case"A":_=f[m++],b=f[m++],T=f[m++],w=f[m++],S=f[m++],M=t,C=i,t=f[m++],i=f[m++],d=s.A,J_(M,C,t,i,w,S,_,b,T,d,e);break;case"a":_=f[m++],b=f[m++],T=f[m++],w=f[m++],S=f[m++],M=t,C=i,t+=f[m++],i+=f[m++],d=s.A,J_(M,C,t,i,w,S,_,b,T,d,e);break}}(h==="z"||h==="Z")&&(d=s.Z,e.addData(d),t=r,i=o),a=d}return e.toStatic(),e}var ex=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.applyTransform=function(t){},e}(Ae);function tx(n){return n.setData!=null}function nx(n,e){var t=cO(n),i=U({},e);return i.buildPath=function(r){var o=tx(r);if(o&&r.canSave()){r.appendPath(t);var a=r.getContext();a&&r.rebuildPath(a,1)}else{var a=o?r.getContext():r;a&&t.rebuildPath(a,1)}},i.applyTransform=function(r){sO(t,r),this.dirtyShape()},i}function hO(n,e){return new ex(nx(n,e))}function dO(n,e){var t=nx(n,e),i=function(r){W(o,r);function o(a){var s=r.call(this,a)||this;return s.applyTransform=t.applyTransform,s.buildPath=t.buildPath,s}return o}(ex);return i}function fO(n,e){for(var t=[],i=n.length,r=0;r<i;r++){var o=n[r];t.push(o.getUpdatedPathProxy(!0))}var a=new Ae(e);return a.createPathProxy(),a.buildPath=function(s){if(tx(s)){s.appendPath(t);var l=s.getContext();l&&s.rebuildPath(l,1)}},a}var Ye=function(n){W(e,n);function e(t){var i=n.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(t),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var i=this._children,r=0;r<i.length;r++)if(i[r].name===t)return i[r]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(t){if(t&&(t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),process.env.NODE_ENV!=="production"&&t.__hostTarget))throw"This elemenet has been used as an attachment";return this},e.prototype.addBefore=function(t,i){if(t&&t!==this&&t.parent!==this&&i&&i.parent===this){var r=this._children,o=r.indexOf(i);o>=0&&(r.splice(o,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,i){var r=be(this._children,t);return r>=0&&this.replaceAt(i,r),this},e.prototype.replaceAt=function(t,i){var r=this._children,o=r[i];if(t&&t!==this&&t.parent!==this&&t!==o){r[i]=t,o.parent=null;var a=this.__zr;a&&o.removeSelfFromZr(a),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var i=this.__zr;i&&i!==t.__zr&&t.addSelfToZr(i),i&&i.refresh()},e.prototype.remove=function(t){var i=this.__zr,r=this._children,o=be(r,t);return o<0?this:(r.splice(o,1),t.parent=null,i&&t.removeSelfFromZr(i),i&&i.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,i=this.__zr,r=0;r<t.length;r++){var o=t[r];i&&o.removeSelfFromZr(i),o.parent=null}return t.length=0,this},e.prototype.eachChild=function(t,i){for(var r=this._children,o=0;o<r.length;o++){var a=r[o];t.call(i,a,o)}return this},e.prototype.traverse=function(t,i){for(var r=0;r<this._children.length;r++){var o=this._children[r],a=t.call(i,o);o.isGroup&&!a&&o.traverse(t,i)}return this},e.prototype.addSelfToZr=function(t){n.prototype.addSelfToZr.call(this,t);for(var i=0;i<this._children.length;i++){var r=this._children[i];r.addSelfToZr(t)}},e.prototype.removeSelfFromZr=function(t){n.prototype.removeSelfFromZr.call(this,t);for(var i=0;i<this._children.length;i++){var r=this._children[i];r.removeSelfFromZr(t)}},e.prototype.getBoundingRect=function(t){for(var i=new ve(0,0,0,0),r=t||this._children,o=[],a=null,s=0;s<r.length;s++){var l=r[s];if(!(l.ignore||l.invisible)){var u=l.getBoundingRect(),c=l.getLocalTransform(o);c?(ve.applyTransform(i,u,c),a=a||i.clone(),a.union(i)):(a=a||u.clone(),a.union(u))}}return a||i},e}(fu);Ye.prototype.type="group";var pO=function(){function n(){this.cx=0,this.cy=0,this.r=0}return n}(),Lu=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new pO},e.prototype.buildPath=function(t,i){t.moveTo(i.cx+i.r,i.cy),t.arc(i.cx,i.cy,i.r,0,Math.PI*2)},e}(Ae);Lu.prototype.type="circle";var gO=function(){function n(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return n}(),Af=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new gO},e.prototype.buildPath=function(t,i){var r=.5522848,o=i.cx,a=i.cy,s=i.rx,l=i.ry,u=s*r,c=l*r;t.moveTo(o-s,a),t.bezierCurveTo(o-s,a-c,o-u,a-l,o,a-l),t.bezierCurveTo(o+u,a-l,o+s,a-c,o+s,a),t.bezierCurveTo(o+s,a+c,o+u,a+l,o,a+l),t.bezierCurveTo(o-u,a+l,o-s,a+c,o-s,a),t.closePath()},e}(Ae);Af.prototype.type="ellipse";var ix=Math.PI,Of=ix*2,Br=Math.sin,Yo=Math.cos,mO=Math.acos,bt=Math.atan2,rx=Math.abs,gs=Math.sqrt,ms=Math.max,Yn=Math.min,wn=1e-4;function yO(n,e,t,i,r,o,a,s){var l=t-n,u=i-e,c=a-r,h=s-o,d=h*l-c*u;if(!(d*d<wn))return d=(c*(e-o)-h*(n-r))/d,[n+d*l,e+d*u]}function Pu(n,e,t,i,r,o,a){var s=n-t,l=e-i,u=(a?o:-o)/gs(s*s+l*l),c=u*l,h=-u*s,d=n+c,f=e+h,p=t+c,g=i+h,m=(d+p)/2,y=(f+g)/2,v=p-d,_=g-f,b=v*v+_*_,T=r-o,w=d*g-p*f,S=(_<0?-1:1)*gs(ms(0,T*T*b-w*w)),M=(w*_-v*S)/b,C=(-w*v-_*S)/b,I=(w*_+v*S)/b,E=(-w*v+_*S)/b,k=M-m,D=C-y,A=I-m,R=E-y;return k*k+D*D>A*A+R*R&&(M=I,C=E),{cx:M,cy:C,x0:-c,y0:-h,x1:M*(r/T-1),y1:C*(r/T-1)}}function vO(n){var e;if(q(n)){var t=n.length;if(!t)return n;t===1?e=[n[0],n[0],0,0]:t===2?e=[n[0],n[0],n[1],n[1]]:t===3?e=n.concat(n[2]):e=n}else e=[n,n,n,n];return e}function _O(n,e){var t,i=ms(e.r,0),r=ms(e.r0||0,0),o=i>0,a=r>0;if(!(!o&&!a)){if(o||(i=r,r=0),r>i){var s=i;i=r,r=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var c=e.cx,h=e.cy,d=!!e.clockwise,f=rx(u-l),p=f>Of&&f%Of;if(p>wn&&(f=p),!(i>wn))n.moveTo(c,h);else if(f>Of-wn)n.moveTo(c+i*Yo(l),h+i*Br(l)),n.arc(c,h,i,l,u,!d),r>wn&&(n.moveTo(c+r*Yo(u),h+r*Br(u)),n.arc(c,h,r,u,l,d));else{var g=void 0,m=void 0,y=void 0,v=void 0,_=void 0,b=void 0,T=void 0,w=void 0,S=void 0,M=void 0,C=void 0,I=void 0,E=void 0,k=void 0,D=void 0,A=void 0,R=i*Yo(l),L=i*Br(l),V=r*Yo(u),z=r*Br(u),H=f>wn;if(H){var F=e.cornerRadius;F&&(t=vO(F),g=t[0],m=t[1],y=t[2],v=t[3]);var j=rx(i-r)/2;if(_=Yn(j,y),b=Yn(j,v),T=Yn(j,g),w=Yn(j,m),C=S=ms(_,b),I=M=ms(T,w),(S>wn||M>wn)&&(E=i*Yo(u),k=i*Br(u),D=r*Yo(l),A=r*Br(l),f<ix)){var Y=yO(R,L,D,A,E,k,V,z);if(Y){var ee=R-Y[0],pe=L-Y[1],Te=E-Y[0],qe=k-Y[1],Je=1/Br(mO((ee*Te+pe*qe)/(gs(ee*ee+pe*pe)*gs(Te*Te+qe*qe)))/2),We=gs(Y[0]*Y[0]+Y[1]*Y[1]);C=Yn(S,(i-We)/(Je+1)),I=Yn(M,(r-We)/(Je-1))}}}if(!H)n.moveTo(c+R,h+L);else if(C>wn){var He=Yn(y,C),Be=Yn(v,C),oe=Pu(D,A,R,L,i,He,d),xe=Pu(E,k,V,z,i,Be,d);n.moveTo(c+oe.cx+oe.x0,h+oe.cy+oe.y0),C<S&&He===Be?n.arc(c+oe.cx,h+oe.cy,C,bt(oe.y0,oe.x0),bt(xe.y0,xe.x0),!d):(He>0&&n.arc(c+oe.cx,h+oe.cy,He,bt(oe.y0,oe.x0),bt(oe.y1,oe.x1),!d),n.arc(c,h,i,bt(oe.cy+oe.y1,oe.cx+oe.x1),bt(xe.cy+xe.y1,xe.cx+xe.x1),!d),Be>0&&n.arc(c+xe.cx,h+xe.cy,Be,bt(xe.y1,xe.x1),bt(xe.y0,xe.x0),!d))}else n.moveTo(c+R,h+L),n.arc(c,h,i,l,u,!d);if(!(r>wn)||!H)n.lineTo(c+V,h+z);else if(I>wn){var He=Yn(g,I),Be=Yn(m,I),oe=Pu(V,z,E,k,r,-Be,d),xe=Pu(R,L,D,A,r,-He,d);n.lineTo(c+oe.cx+oe.x0,h+oe.cy+oe.y0),I<M&&He===Be?n.arc(c+oe.cx,h+oe.cy,I,bt(oe.y0,oe.x0),bt(xe.y0,xe.x0),!d):(Be>0&&n.arc(c+oe.cx,h+oe.cy,Be,bt(oe.y0,oe.x0),bt(oe.y1,oe.x1),!d),n.arc(c,h,r,bt(oe.cy+oe.y1,oe.cx+oe.x1),bt(xe.cy+xe.y1,xe.cx+xe.x1),d),He>0&&n.arc(c+xe.cx,h+xe.cy,He,bt(xe.y1,xe.x1),bt(xe.y0,xe.x0),!d))}else n.lineTo(c+V,h+z),n.arc(c,h,r,u,l,d)}n.closePath()}}}var xO=function(){function n(){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 n}(),Gi=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new xO},e.prototype.buildPath=function(t,i){_O(t,i)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Ae);Gi.prototype.type="sector";var bO=function(){function n(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return n}(),Rf=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new bO},e.prototype.buildPath=function(t,i){var r=i.cx,o=i.cy,a=Math.PI*2;t.moveTo(r+i.r,o),t.arc(r,o,i.r,0,a,!1),t.moveTo(r+i.r0,o),t.arc(r,o,i.r0,0,a,!0)},e}(Ae);Rf.prototype.type="ring";function wO(n,e,t,i){var r=[],o=[],a=[],s=[],l,u,c,h;if(i){c=[1/0,1/0],h=[-1/0,-1/0];for(var d=0,f=n.length;d<f;d++)Eo(c,c,n[d]),No(h,h,n[d]);Eo(c,c,i[0]),No(h,h,i[1])}for(var d=0,f=n.length;d<f;d++){var p=n[d];if(t)l=n[d?d-1:f-1],u=n[(d+1)%f];else if(d===0||d===f-1){r.push(lN(n[d]));continue}else l=n[d-1],u=n[d+1];_0(o,u,l),Td(o,o,e);var g=Cd(p,l),m=Cd(p,u),y=g+m;y!==0&&(g/=y,m/=y),Td(a,o,-g),Td(s,o,m);var v=v0([],p,a),_=v0([],p,s);i&&(No(v,v,c),Eo(v,v,h),No(_,_,c),Eo(_,_,h)),r.push(v),r.push(_)}return t&&r.push(r.shift()),r}function ox(n,e,t){var i=e.smooth,r=e.points;if(r&&r.length>=2){if(i){var o=wO(r,i,t,e.smoothConstraint);n.moveTo(r[0][0],r[0][1]);for(var a=r.length,s=0;s<(t?a:a-1);s++){var l=o[s*2],u=o[s*2+1],c=r[(s+1)%a];n.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{n.moveTo(r[0][0],r[0][1]);for(var s=1,h=r.length;s<h;s++)n.lineTo(r[s][0],r[s][1])}t&&n.closePath()}}var SO=function(){function n(){this.points=null,this.smooth=0,this.smoothConstraint=null}return n}(),qo=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new SO},e.prototype.buildPath=function(t,i){ox(t,i,!0)},e}(Ae);qo.prototype.type="polygon";var TO=function(){function n(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return n}(),jo=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new TO},e.prototype.buildPath=function(t,i){ox(t,i,!1)},e}(Ae);jo.prototype.type="polyline";var MO={},CO=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return n}(),gi=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new CO},e.prototype.buildPath=function(t,i){var r,o,a,s;if(this.subPixelOptimize){var l=J0(MO,i,this.style);r=l.x1,o=l.y1,a=l.x2,s=l.y2}else r=i.x1,o=i.y1,a=i.x2,s=i.y2;var u=i.percent;u!==0&&(t.moveTo(r,o),u<1&&(a=r*(1-u)+a*u,s=o*(1-u)+s*u),t.lineTo(a,s))},e.prototype.pointAt=function(t){var i=this.shape;return[i.x1*(1-t)+i.x2*t,i.y1*(1-t)+i.y2*t]},e}(Ae);gi.prototype.type="line";var zt=[],kO=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return n}();function ax(n,e,t){var i=n.cpx2,r=n.cpy2;return i!=null||r!=null?[(t?M0:dt)(n.x1,n.cpx1,n.cpx2,n.x2,e),(t?M0:dt)(n.y1,n.cpy1,n.cpy2,n.y2,e)]:[(t?k0:Rt)(n.x1,n.cpx1,n.x2,e),(t?k0:Rt)(n.y1,n.cpy1,n.y2,e)]}var zu=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new kO},e.prototype.buildPath=function(t,i){var r=i.x1,o=i.y1,a=i.x2,s=i.y2,l=i.cpx1,u=i.cpy1,c=i.cpx2,h=i.cpy2,d=i.percent;d!==0&&(t.moveTo(r,o),c==null||h==null?(d<1&&(Jl(r,l,a,d,zt),l=zt[1],a=zt[2],Jl(o,u,s,d,zt),u=zt[1],s=zt[2]),t.quadraticCurveTo(l,u,a,s)):(d<1&&(Ql(r,l,c,a,d,zt),l=zt[1],c=zt[2],a=zt[3],Ql(o,u,h,s,d,zt),u=zt[1],h=zt[2],s=zt[3]),t.bezierCurveTo(l,u,c,h,a,s)))},e.prototype.pointAt=function(t){return ax(this.shape,t,!1)},e.prototype.tangentAt=function(t){var i=ax(this.shape,t,!0);return Md(i,i)},e}(Ae);zu.prototype.type="bezier-curve";var DO=function(){function n(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return n}(),Bu=function(n){W(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new DO},e.prototype.buildPath=function(t,i){var r=i.cx,o=i.cy,a=Math.max(i.r,0),s=i.startAngle,l=i.endAngle,u=i.clockwise,c=Math.cos(s),h=Math.sin(s);t.moveTo(c*a+r,h*a+o),t.arc(r,o,a,s,l,!u)},e}(Ae);Bu.prototype.type="arc";var sx=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="compound",t}return e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,i=this.shapeChanged(),r=0;r<t.length;r++)i=i||t[r].shapeChanged();i&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],i=this.getGlobalScale(),r=0;r<t.length;r++)t[r].path||t[r].createPathProxy(),t[r].path.setScale(i[0],i[1],t[r].segmentIgnoreThreshold)},e.prototype.buildPath=function(t,i){for(var r=i.paths||[],o=0;o<r.length;o++)r[o].buildPath(t,r[o].shape,!0)},e.prototype.afterBrush=function(){for(var t=this.shape.paths||[],i=0;i<t.length;i++)t[i].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Ae.prototype.getBoundingRect.call(this)},e}(Ae),lx=function(){function n(e){this.colorStops=e||[]}return n.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},n}(),ux=function(n){W(e,n);function e(t,i,r,o,a,s){var l=n.call(this,a)||this;return l.x=t??0,l.y=i??0,l.x2=r??1,l.y2=o??0,l.type="linear",l.global=s||!1,l}return e}(lx),IO=function(n){W(e,n);function e(t,i,r,o,a){var s=n.call(this,o)||this;return s.x=t??.5,s.y=i??.5,s.r=r??.5,s.type="radial",s.global=a||!1,s}return e}(lx),Lf=Math.min,EO=Math.max,Vu=Math.abs,Vr=[0,0],Hr=[0,0],lt=a0(),Hu=lt.minTv,Fu=lt.maxTv,cx=function(){function n(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var i=0;i<4;i++)this._corners[i]=new ye;for(var i=0;i<2;i++)this._axes[i]=new ye;e&&this.fromBoundingRect(e,t)}return n.prototype.fromBoundingRect=function(e,t){var i=this._corners,r=this._axes,o=e.x,a=e.y,s=o+e.width,l=a+e.height;if(i[0].set(o,a),i[1].set(s,a),i[2].set(s,l),i[3].set(o,l),t)for(var u=0;u<4;u++)i[u].transform(t);ye.sub(r[0],i[1],i[0]),ye.sub(r[1],i[3],i[0]),r[0].normalize(),r[1].normalize();for(var u=0;u<2;u++)this._origin[u]=r[u].dot(i[0])},n.prototype.intersect=function(e,t,i){var r=!0,o=!t;return t&&ye.set(t,0,0),lt.reset(i,!o),!this._intersectCheckOneSide(this,e,o,1)&&(r=!1,o)||!this._intersectCheckOneSide(e,this,o,-1)&&(r=!1,o)||!o&&!lt.negativeSize&&ye.copy(t,r?lt.useDir?lt.dirMinTv:Hu:Fu),r},n.prototype._intersectCheckOneSide=function(e,t,i,r){for(var o=!0,a=0;a<2;a++){var s=e._axes[a];if(e._getProjMinMaxOnAxis(a,e._corners,Vr),e._getProjMinMaxOnAxis(a,t._corners,Hr),lt.negativeSize||Vr[1]<Hr[0]||Vr[0]>Hr[1]){if(o=!1,lt.negativeSize||i)return o;var l=Vu(Hr[0]-Vr[1]),u=Vu(Vr[0]-Hr[1]);Lf(l,u)>Fu.len()&&(l<u?ye.scale(Fu,s,-l*r):ye.scale(Fu,s,u*r))}else if(!i){var l=Vu(Hr[0]-Vr[1]),u=Vu(Vr[0]-Hr[1]);(lt.useDir||Lf(l,u)<Hu.len())&&((l<u||!lt.bidirectional)&&(ye.scale(Hu,s,l*r),lt.useDir&<.calcDirMTV()),(l>=u||!lt.bidirectional)&&(ye.scale(Hu,s,-u*r),lt.useDir&<.calcDirMTV()))}}return o},n.prototype._getProjMinMaxOnAxis=function(e,t,i){for(var r=this._axes[e],o=this._origin,a=t[0].dot(r)+o[e],s=a,l=a,u=1;u<t.length;u++){var c=t[u].dot(r)+o[e];s=Lf(c,s),l=EO(c,l)}i[0]=s+lt.touchThreshold,i[1]=l-lt.touchThreshold,lt.negativeSize=i[1]<i[0]},n}(),NO=[],AO=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return e.prototype.traverse=function(t,i){t.call(i,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(t,i){i?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},e.prototype.addDisplayables=function(t,i){i=i||!1;for(var r=0;r<t.length;r++)this.addDisplayable(t[r],i)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(t){for(var i=this._cursor;i<this._displayables.length;i++)t&&t(this._displayables[i]);for(var i=0;i<this._temporaryDisplayables.length;i++)t&&t(this._temporaryDisplayables[i])},e.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){var i=this._displayables[t];i.parent=this,i.update(),i.parent=null}for(var t=0;t<this._temporaryDisplayables.length;t++){var i=this._temporaryDisplayables[t];i.parent=this,i.update(),i.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new ve(1/0,1/0,-1/0,-1/0),i=0;i<this._displayables.length;i++){var r=this._displayables[i],o=r.getBoundingRect().clone();r.needLocalTransform()&&o.applyTransform(r.getLocalTransform(NO)),t.union(o)}this._rect=t}return this._rect},e.prototype.contain=function(t,i){var r=this.transformCoordToLocal(t,i),o=this.getBoundingRect();if(o.contain(r[0],r[1]))for(var a=0;a<this._displayables.length;a++){var s=this._displayables[a];if(s.contain(t,i))return!0}return!1},e}(rs),OO=Re();function RO(n,e,t,i,r){var o;if(e&&e.ecModel){var a=e.ecModel.getUpdatePayload();o=a&&a.animation}var s=e&&e.isAnimationEnabled(),l=n==="update";if(s){var u=void 0,c=void 0,h=void 0;i?(u=te(i.duration,200),c=te(i.easing,"cubicOut"),h=0):(u=e.getShallow(l?"animationDurationUpdate":"animationDuration"),c=e.getShallow(l?"animationEasingUpdate":"animationEasing"),h=e.getShallow(l?"animationDelayUpdate":"animationDelay")),o&&(o.duration!=null&&(u=o.duration),o.easing!=null&&(c=o.easing),o.delay!=null&&(h=o.delay)),ce(h)&&(h=h(t,r)),ce(u)&&(u=u(t));var d={duration:u||0,delay:h,easing:c};return d}else return null}function Pf(n,e,t,i,r,o,a){var s=!1,l;ce(r)?(a=o,o=r,r=null):ne(r)&&(o=r.cb,a=r.during,s=r.isFrom,l=r.removeOpt,r=r.dataIndex);var u=n==="leave";u||e.stopAnimation("leave");var c=RO(n,i,r,u?l||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(e,r):null);if(c&&c.duration>0){var h=c.duration,d=c.delay,f=c.easing,p={duration:h,delay:d||0,easing:f,done:o,force:!!o||!!a,setToFinal:!u,scope:n,during:a};s?e.animateFrom(t,p):e.animateTo(t,p)}else e.stopAnimation(),!s&&e.attr(t),a&&a(1),o&&o()}function ft(n,e,t,i,r,o){Pf("update",n,e,t,i,r,o)}function $t(n,e,t,i,r,o){Pf("enter",n,e,t,i,r,o)}function ys(n){if(!n.__zr)return!0;for(var e=0;e<n.animators.length;e++){var t=n.animators[e];if(t.scope==="leave")return!0}return!1}function Gu(n,e,t,i,r,o){ys(n)||Pf("leave",n,e,t,i,r,o)}function hx(n,e,t,i){n.removeTextContent(),n.removeTextGuideLine(),Gu(n,{style:{opacity:0}},e,t,i)}function vs(n,e,t){function i(){n.parent&&n.parent.remove(n)}n.isGroup?n.traverse(function(r){r.isGroup||hx(r,e,t,i)}):hx(n,e,t,i)}function zf(n){OO(n).oldStyle=n.style}var Bf={},Wi=["x","y"],$o=["width","height"];function LO(n){return Ae.extend(n)}var PO=dO;function zO(n,e){return PO(n,e)}function Sn(n,e){Bf[n]=e}function BO(n){if(Bf.hasOwnProperty(n))return Bf[n]}function Vf(n,e,t,i){var r=hO(n,e);return t&&(i==="center"&&(t=fx(t,r.getBoundingRect())),px(r,t)),r}function dx(n,e,t){var i=new Hn({style:{image:n,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(r){if(t==="center"){var o={width:r.width,height:r.height};i.setStyle(fx(e,o))}}});return i}function fx(n,e){var t=e.width/e.height,i=n.height*t,r;i<=n.width?r=n.height:(i=n.width,r=i/t);var o=n.x+n.width/2,a=n.y+n.height/2;return{x:o-i/2,y:a-r/2,width:i,height:r}}var VO=fO;function px(n,e){if(n.applyTransform){var t=n.getBoundingRect(),i=t.calculateTransform(e);n.applyTransform(i)}}function _s(n,e){return J0(n,n,{lineWidth:e}),n}function HO(n,e){return e_(n,n,e),n}var FO=Ar;function Hf(n,e){for(var t=fd([]);n&&n!==e;)qa(t,n.getLocalTransform(),t),n=n.parent;return t}function Ff(n,e,t){return e&&!Ot(e)&&(e=Nd.getLocalTransform(e)),t&&(e=ja([],e)),Jt([],n,e)}function gx(n,e,t){var i=e[4]===0||e[5]===0||e[0]===0?1:Gn(2*e[4]/e[0]),r=e[4]===0||e[5]===0||e[2]===0?1:Gn(2*e[4]/e[2]),o=[n==="left"?-i:n==="right"?i:0,n==="top"?-r:n==="bottom"?r:0];return o=Ff(o,e,t),Gn(o[0])>Gn(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function mx(n){return!n.isGroup}function GO(n){return n.shape!=null}function yx(n,e,t){if(!n||!e)return;function i(a){var s={};return a.traverse(function(l){mx(l)&&l.anid&&(s[l.anid]=l)}),s}function r(a){var s={x:a.x,y:a.y,rotation:a.rotation};return GO(a)&&(s.shape=ue(a.shape)),s}var o=i(n);e.traverse(function(a){if(mx(a)&&a.anid){var s=o[a.anid];if(s){var l=r(a);a.attr(r(s)),ft(a,l,t,Se(a).dataIndex)}}})}function vx(n,e){return $(n,function(t){var i=t[0];i=qt(i,e.x),i=ls(i,e.x+e.width);var r=t[1];return r=qt(r,e.y),r=ls(r,e.y+e.height),[i,r]})}function WO(n,e){var t=qt(n.x,e.x),i=ls(n.x+n.width,e.x+e.width),r=qt(n.y,e.y),o=ls(n.y+n.height,e.y+e.height);if(i>=t&&o>=r)return{x:t,y:r,width:i-t,height:o-r}}function Wu(n,e,t){var i=U({rectHover:!0},e),r=i.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},n)return n.indexOf("image://")===0?(r.image=n.slice(8),Me(r,t),new Hn(i)):Vf(n.replace("path://",""),i,t,"center")}function xs(n,e,t,i,r){for(var o=0,a=r[r.length-1];o<r.length;o++){var s=r[o];if(_x(n,e,t,i,s[0],s[1],a[0],a[1]))return!0;a=s}}function _x(n,e,t,i,r,o,a,s){var l=t-n,u=i-e,c=a-r,h=s-o,d=Gf(c,h,l,u);if(UO(d))return!1;var f=n-r,p=e-o,g=Gf(f,p,l,u)/d;if(g<0||g>1)return!1;var m=Gf(f,p,c,h)/d;return!(m<0||m>1)}function Gf(n,e,t,i){return n*i-t*e}function UO(n){return n<=1e-6&&n>=-1e-6}function Uu(n,e,t,i,r){return e==null||(Ne(e)?Ve[0]=Ve[1]=Ve[2]=Ve[3]=e:(process.env.NODE_ENV!=="production"&&J(e.length===4),Ve[0]=e[0],Ve[1]=e[1],Ve[2]=e[2],Ve[3]=e[3]),i&&(Ve[0]=qt(0,Ve[0]),Ve[1]=qt(0,Ve[1]),Ve[2]=qt(0,Ve[2]),Ve[3]=qt(0,Ve[3])),t&&(Ve[0]=-Ve[0],Ve[1]=-Ve[1],Ve[2]=-Ve[2],Ve[3]=-Ve[3]),xx(n,Ve,"x","width",3,1,r&&r[0]||0),xx(n,Ve,"y","height",0,2,r&&r[1]||0)),n}var Ve=[0,0,0,0];function xx(n,e,t,i,r,o,a){var s=e[o]+e[r],l=n[i];n[i]+=s,a=qt(0,ls(a,l)),n[i]<a?(n[i]=a,n[t]+=e[r]>=0?-e[r]:e[o]>=0?l+e[o]:Gn(s)>1e-8?(l-a)*e[r]/s:0):n[t]-=e[r]}function bs(n){var e=n.itemTooltipOption,t=n.componentModel,i=n.itemName,r=Q(e)?{formatter:e}:e,o=t.mainType,a=t.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=n.formatterParamsExtra;l&&N(Ce(l),function(c){_n(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=Se(n.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:Me({content:i,encodeHTMLContent:!0,formatterParams:s},r)}}function Wf(n,e){var t;n.isGroup&&(t=e(n)),t||n.traverse(e)}function ws(n,e){if(n)if(q(n))for(var t=0;t<n.length;t++)Wf(n[t],e);else Wf(n,e)}function Uf(n){return!n||Gn(n[1])<Yu&&Gn(n[2])<Yu||Gn(n[0])<Yu&&Gn(n[3])<Yu}var Yu=1e-5;function Ss(n,e){return n?ve.copy(n,e):e.clone()}function Yf(n,e){return e?i0(n||li(),e):void 0}function Ts(n){return{z:n.get("z")||0,zlevel:n.get("zlevel")||0}}function YO(n){var e=-1/0,t=1/0;Wf(n,function(o){i(o),i(o.getTextContent()),i(o.getTextGuideLine())});function i(o){if(!(!o||o.isGroup)){var a=o.currentStates;if(a.length)for(var s=0;s<a.length;s++)r(o.states[a[s]]);r(o)}}function r(o){if(o){var a=o.z2;a>e&&(e=a),a<t&&(t=a)}}return t>e&&(t=e=0),{min:t,max:e}}function qf(n,e,t){bx(n,e,t,-1/0)}function bx(n,e,t,i){if(n.ignoreModelZ)return i;var r=n.getTextContent(),o=n.getTextGuideLine(),a=n.isGroup;if(a)for(var s=n.childrenRef(),l=0;l<s.length;l++)i=qt(bx(s[l],e,t,i),i);else n.z=e,n.zlevel=t,i=qt(n.z2||0,i);if(r&&(r.z=e,r.zlevel=t,isFinite(i)&&(r.z2=i+2)),o){var u=n.textGuideLineConfig;o.z=e,o.zlevel=t,isFinite(i)&&(o.z2=i+(u&&u.showAbove?1:-1))}return i}Sn("circle",Lu),Sn("ellipse",Af),Sn("sector",Gi),Sn("ring",Rf),Sn("polygon",qo),Sn("polyline",jo),Sn("rect",Ue),Sn("line",gi),Sn("bezierCurve",zu),Sn("arc",Bu);const qO=Object.freeze(Object.defineProperty({__proto__:null,Arc:Bu,BezierCurve:zu,BoundingRect:ve,Circle:Lu,CompoundPath:sx,Ellipse:Af,Group:Ye,Image:Hn,IncrementalDisplayable:AO,Line:gi,LinearGradient:ux,OrientedBoundingRect:cx,Path:Ae,Point:ye,Polygon:qo,Polyline:jo,RadialGradient:IO,Rect:Ue,Ring:Rf,Sector:Gi,Text:it,WH:$o,XY:Wi,applyTransform:Ff,calcZ2Range:YO,clipPointsByRect:vx,clipRectByRect:WO,createIcon:Wu,ensureCopyRect:Ss,ensureCopyTransform:Yf,expandOrShrinkRect:Uu,extendPath:zO,extendShape:LO,getShapeClass:BO,getTransform:Hf,groupTransition:yx,initProps:$t,isBoundingRectAxisAligned:Uf,isElementRemoved:ys,lineLineIntersect:_x,linePolygonIntersect:xs,makeImage:dx,makePath:Vf,mergePath:VO,registerShape:Sn,removeElement:Gu,removeElementWithFadeOut:vs,resizePath:px,retrieveZInfo:Ts,setTooltipConfig:bs,subPixelOptimize:FO,subPixelOptimizeLine:_s,subPixelOptimizeRect:HO,transformDirection:gx,traverseElements:ws,traverseUpdateZ:qf,updateProps:ft},Symbol.toStringTag,{value:"Module"}));var qu={};function jO(n,e){for(var t=0;t<Pt.length;t++){var i=Pt[t],r=e[i],o=n.ensureState(i);o.style=o.style||{},o.style.text=r}var a=n.currentStates.slice();n.clearStates(!0),n.setStyle({text:e.normal}),n.useStates(a,!0)}function Sx(n,e,t){var i=n.labelFetcher,r=n.labelDataIndex,o=n.labelDimIndex,a=e.normal,s;i&&(s=i.getFormattedLabel(r,"normal",null,o,a&&a.get("formatter"),t!=null?{interpolatedValue:t}:null)),s==null&&(s=ce(n.defaultText)?n.defaultText(r,n,t):n.defaultText);for(var l={normal:s},u=0;u<Pt.length;u++){var c=Pt[u],h=e[c];l[c]=te(i?i.getFormattedLabel(r,c,null,o,h&&h.get("formatter")):null,s)}return l}function Fr(n,e,t,i){t=t||qu;for(var r=n instanceof it,o=!1,a=0;a<Du.length;a++){var s=e[Du[a]];if(s&&s.getShallow("show")){o=!0;break}}var l=r?n:n.getTextContent();if(o){r||(l||(l=new it,n.setTextContent(l)),n.stateProxy&&(l.stateProxy=n.stateProxy));var u=Sx(t,e),c=e.normal,h=!!c.getShallow("show"),d=Yi(c,i&&i.normal,t,!1,!r);d.text=u.normal,r||n.setTextConfig(Tx(c,t,!1));for(var a=0;a<Pt.length;a++){var f=Pt[a],s=e[f];if(s){var p=l.ensureState(f),g=!!te(s.getShallow("show"),h);if(g!==h&&(p.ignore=!g),p.style=Yi(s,i&&i[f],t,!0,!r),p.style.text=u[f],!r){var m=n.ensureState(f);m.textConfig=Tx(s,t,!0)}}}l.silent=!!c.getShallow("silent"),l.style.x!=null&&(d.x=l.style.x),l.style.y!=null&&(d.y=l.style.y),l.ignore=!h,l.useStyle(d),l.dirty(),t.enableTextSetter&&(ju(l).setLabelText=function(y){var v=Sx(t,e,y);jO(l,v)})}else l&&(l.ignore=!0);n.dirty()}function Ui(n,e){e=e||"label";for(var t={normal:n.getModel(e)},i=0;i<Pt.length;i++){var r=Pt[i];t[r]=n.getModel([r,e])}return t}function Yi(n,e,t,i,r){var o={};return $O(o,n,t,i,r),e&&U(o,e),o}function Tx(n,e,t){e=e||{};var i={},r,o=n.getShallow("rotate"),a=te(n.getShallow("distance"),t?null:5),s=n.getShallow("offset");return r=n.getShallow("position")||(t?null:"inside"),r==="outside"&&(r=e.defaultOutsidePosition||"top"),r!=null&&(i.position=r),s!=null&&(i.offset=s),o!=null&&(o*=Math.PI/180,i.rotation=o),a!=null&&(i.distance=a),i.outsideFill=n.get("color")==="inherit"?e.inheritColor||null:"auto",e.autoOverflowArea!=null&&(i.autoOverflowArea=e.autoOverflowArea),e.layoutRect!=null&&(i.layoutRect=e.layoutRect),i}function $O(n,e,t,i,r){t=t||qu;var o=e.ecModel,a=o&&o.option.textStyle,s=ZO(e),l;if(s){l={};var u="richInheritPlainLabel",c=te(e.get(u),o?o.get(u):void 0);for(var h in s)if(s.hasOwnProperty(h)){var d=e.getModel(["rich",h]);Dx(l[h]={},d,a,e,c,t,i,r,!1,!0)}}l&&(n.rich=l);var f=e.get("overflow");f&&(n.overflow=f);var p=e.get("lineOverflow");p&&(n.lineOverflow=p);var g=n,m=e.get("minMargin");if(m!=null)m=Ne(m)?m/2:0,g.margin=[m,m,m,m],g.__marginType=Zo.minMargin;else{var y=e.get("textMargin");y!=null&&(g.margin=ld(y),g.__marginType=Zo.textMargin)}Dx(n,e,a,null,null,t,i,r,!0,!1)}function ZO(n){for(var e;n&&n!==n.ecModel;){var t=(n.option||qu).rich;if(t){e=e||{};for(var i=Ce(t),r=0;r<i.length;r++){var o=i[r];e[o]=1}}n=n.parentModel}return e}var Mx=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Cx=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],kx=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function Dx(n,e,t,i,r,o,a,s,l,u){t=!a&&t||qu;var c=o&&o.inheritColor,h=e.getShallow("color"),d=e.getShallow("textBorderColor"),f=te(e.getShallow("opacity"),t.opacity);(h==="inherit"||h==="auto")&&(process.env.NODE_ENV!=="production"&&h==="auto"&&rt("color: 'auto'","color: 'inherit'"),c?h=c:h=null),(d==="inherit"||d==="auto")&&(process.env.NODE_ENV!=="production"&&d==="auto"&&rt("color: 'auto'","color: 'inherit'"),c?d=c:d=null),s||(h=h||t.color,d=d||t.textBorderColor),h!=null&&(n.fill=h),d!=null&&(n.stroke=d);var p=te(e.getShallow("textBorderWidth"),t.textBorderWidth);p!=null&&(n.lineWidth=p);var g=te(e.getShallow("textBorderType"),t.textBorderType);g!=null&&(n.lineDash=g);var m=te(e.getShallow("textBorderDashOffset"),t.textBorderDashOffset);m!=null&&(n.lineDashOffset=m),!a&&f==null&&!u&&(f=o&&o.defaultOpacity),f!=null&&(n.opacity=f),!a&&!s&&n.fill==null&&o.inheritColor&&(n.fill=o.inheritColor);for(var y=0;y<Mx.length;y++){var v=Mx[y],_=r!==!1&&i?si(e.getShallow(v),i.getShallow(v),t[v]):te(e.getShallow(v),t[v]);_!=null&&(n[v]=_)}for(var y=0;y<Cx.length;y++){var v=Cx[y],_=e.getShallow(v);_!=null&&(n[v]=_)}if(n.verticalAlign==null){var b=e.getShallow("baseline");b!=null&&(n.verticalAlign=b)}if(!l||!o.disableBox){for(var y=0;y<kx.length;y++){var v=kx[y],_=e.getShallow(v);_!=null&&(n[v]=_)}var T=e.getShallow("borderType");T!=null&&(n.borderDash=T),(n.backgroundColor==="auto"||n.backgroundColor==="inherit")&&c&&(process.env.NODE_ENV!=="production"&&n.backgroundColor==="auto"&&rt("backgroundColor: 'auto'","backgroundColor: 'inherit'"),n.backgroundColor=c),(n.borderColor==="auto"||n.borderColor==="inherit")&&c&&(process.env.NODE_ENV!=="production"&&n.borderColor==="auto"&&rt("borderColor: 'auto'","borderColor: 'inherit'"),n.borderColor=c)}}function Ix(n,e){var t=e&&e.getModel("textStyle");return An([n.fontStyle||t&&t.getShallow("fontStyle")||"",n.fontWeight||t&&t.getShallow("fontWeight")||"",(n.fontSize||t&&t.getShallow("fontSize")||12)+"px",n.fontFamily||t&&t.getShallow("fontFamily")||"sans-serif"].join(" "))}var ju=Re();function XO(n,e,t,i){if(n){var r=ju(n);r.prevValue=r.value,r.value=t;var o=e.normal;r.valueAnimation=o.get("valueAnimation"),r.valueAnimation&&(r.precision=o.get("precision"),r.defaultInterpolatedText=i,r.statesModels=e)}}var Zo={minMargin:1,textMargin:2},KO=["textStyle","color"],jf=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],$f=new it,QO=function(){function n(){}return n.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(KO):null)},n.prototype.getFont=function(){return Ix({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},n.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},i=0;i<jf.length;i++)t[jf[i]]=this.getShallow(jf[i]);return $f.useStyle(t),$f.update(),$f.getBoundingRect()},n}(),Ex=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],JO=Ya(Ex),eR=function(){function n(){}return n.prototype.getLineStyle=function(e){return JO(this,e)},n}(),Nx=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],tR=Ya(Nx),nR=function(){function n(){}return n.prototype.getItemStyle=function(e,t){return tR(this,e,t)},n}(),Ge=function(){function n(e,t,i){this.parentModel=t,this.ecModel=i,this.option=e}return n.prototype.init=function(e,t,i){},n.prototype.mergeOption=function(e,t){_e(this.option,e,!0)},n.prototype.get=function(e,t){return e==null?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},n.prototype.getShallow=function(e,t){var i=this.option,r=i==null?i:i[e];if(r==null&&!t){var o=this.parentModel;o&&(r=o.getShallow(e))}return r},n.prototype.getModel=function(e,t){var i=e!=null,r=i?this.parsePath(e):null,o=i?this._doGet(r):this.option;return t=t||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(r)),new n(o,t,this.ecModel)},n.prototype.isEmpty=function(){return this.option==null},n.prototype.restoreData=function(){},n.prototype.clone=function(){var e=this.constructor;return new e(ue(this.option))},n.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},n.prototype.resolveParentPath=function(e){return e},n.prototype.isAnimationEnabled=function(){if(!fe.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},n.prototype._doGet=function(e,t){var i=this.option;if(!e)return i;for(var r=0;r<e.length&&!(e[r]&&(i=i&&typeof i=="object"?i[e[r]]:null,i==null));r++);return i==null&&t&&(i=t._doGet(this.resolveParentPath(e),t.parentModel)),i},n}();cd(Ge),V2(Ge),yn(Ge,eR),yn(Ge,nR),yn(Ge,U2),yn(Ge,QO);function Ms(n){return n==null?0:n.length||1}function Ax(n){return n}var Zf=function(){function n(e,t,i,r,o,a){this._old=e,this._new=t,this._oldKeyGetter=i||Ax,this._newKeyGetter=r||Ax,this.context=o,this._diffModeMultiple=a==="multiple"}return n.prototype.add=function(e){return this._add=e,this},n.prototype.update=function(e){return this._update=e,this},n.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},n.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},n.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},n.prototype.remove=function(e){return this._remove=e,this},n.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},n.prototype._executeOneToOne=function(){var e=this._old,t=this._new,i={},r=new Array(e.length),o=new Array(t.length);this._initIndexMap(e,null,r,"_oldKeyGetter"),this._initIndexMap(t,i,o,"_newKeyGetter");for(var a=0;a<e.length;a++){var s=r[a],l=i[s],u=Ms(l);if(u>1){var c=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(c,a)}else u===1?(i[s]=null,this._update&&this._update(l,a)):this._remove&&this._remove(a)}this._performRestAdd(o,i)},n.prototype._executeMultiple=function(){var e=this._old,t=this._new,i={},r={},o=[],a=[];this._initIndexMap(e,i,o,"_oldKeyGetter"),this._initIndexMap(t,r,a,"_newKeyGetter");for(var s=0;s<o.length;s++){var l=o[s],u=i[l],c=r[l],h=Ms(u),d=Ms(c);if(h>1&&d===1)this._updateManyToOne&&this._updateManyToOne(c,u),r[l]=null;else if(h===1&&d>1)this._updateOneToMany&&this._updateOneToMany(c,u),r[l]=null;else if(h===1&&d===1)this._update&&this._update(c,u),r[l]=null;else if(h>1&&d>1)this._updateManyToMany&&this._updateManyToMany(c,u),r[l]=null;else if(h>1)for(var f=0;f<h;f++)this._remove&&this._remove(u[f]);else this._remove&&this._remove(u)}this._performRestAdd(a,r)},n.prototype._performRestAdd=function(e,t){for(var i=0;i<e.length;i++){var r=e[i],o=t[r],a=Ms(o);if(a>1)for(var s=0;s<a;s++)this._add&&this._add(o[s]);else a===1&&this._add&&this._add(o);t[r]=null}},n.prototype._initIndexMap=function(e,t,i,r){for(var o=this._diffModeMultiple,a=0;a<e.length;a++){var s="_ec_"+this[r](e[a],a);if(o||(i[a]=s),!!t){var l=t[s],u=Ms(l);u===0?(t[s]=a,o&&i.push(s)):u===1?t[s]=[l,a]:l.push(a)}}},n}(),Xf=me(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Zt="original",wt="arrayRows",an="objectRows",Tn="keyedColumns",mi="typedArray",Ox="unknown",qn="column",Gr="row",pt={Must:1,Might:2,Not:3},Rx=Re();function iR(n){Rx(n).datasetMap=me()}function rR(n,e,t){var i={},r=Kf(e);if(!r||!n)return i;var o=[],a=[],s=e.ecModel,l=Rx(s).datasetMap,u=r.uid+"_"+t.seriesLayoutBy,c,h;n=n.slice(),N(n,function(g,m){var y=ne(g)?g:n[m]={name:g};y.type==="ordinal"&&c==null&&(c=m,h=p(y)),i[y.name]=[]});var d=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});N(n,function(g,m){var y=g.name,v=p(g);if(c==null){var _=d.valueWayDim;f(i[y],_,v),f(a,_,v),d.valueWayDim+=v}else if(c===m)f(i[y],0,v),f(o,0,v);else{var _=d.categoryWayDim;f(i[y],_,v),f(a,_,v),d.categoryWayDim+=v}});function f(g,m,y){for(var v=0;v<y;v++)g.push(m+v)}function p(g){var m=g.dimsDef;return m?m.length:1}return o.length&&(i.itemName=o),a.length&&(i.seriesName=a),i}function oR(n,e,t){var i={},r=Kf(n);if(!r)return i;var o=e.sourceFormat,a=e.dimensionsDefine,s;(o===an||o===Tn)&&N(a,function(c,h){(ne(c)?c.name:c)==="name"&&(s=h)});var l=function(){for(var c={},h={},d=[],f=0,p=Math.min(5,t);f<p;f++){var g=Px(e.data,o,e.seriesLayoutBy,a,e.startIndex,f);d.push(g);var m=g===pt.Not;if(m&&c.v==null&&f!==s&&(c.v=f),(c.n==null||c.n===c.v||!m&&d[c.n]===pt.Not)&&(c.n=f),y(c)&&d[c.n]!==pt.Not)return c;m||(g===pt.Might&&h.v==null&&f!==s&&(h.v=f),(h.n==null||h.n===h.v)&&(h.n=f))}function y(v){return v.v!=null&&v.n!=null}return y(c)?c:y(h)?h:null}();if(l){i.value=[l.v];var u=s??l.n;i.itemName=[u],i.seriesName=[u]}return i}function Kf(n){var e=n.get("data",!0);if(!e)return ds(n.ecModel,"dataset",{index:n.get("datasetIndex",!0),id:n.get("datasetId",!0)},xt).models[0]}function aR(n){return!n.get("transform",!0)&&!n.get("fromTransformResult",!0)?[]:ds(n.ecModel,"dataset",{index:n.get("fromDatasetIndex",!0),id:n.get("fromDatasetId",!0)},xt).models}function Lx(n,e){return Px(n.data,n.sourceFormat,n.seriesLayoutBy,n.dimensionsDefine,n.startIndex,e)}function Px(n,e,t,i,r,o){var a,s=5;if(Ct(n))return pt.Not;var l,u;if(i){var c=i[o];ne(c)?(l=c.name,u=c.type):Q(c)&&(l=c)}if(u!=null)return u==="ordinal"?pt.Must:pt.Not;if(e===wt){var h=n;if(t===Gr){for(var d=h[o],f=0;f<(d||[]).length&&f<s;f++)if((a=b(d[r+f]))!=null)return a}else for(var f=0;f<h.length&&f<s;f++){var p=h[r+f];if(p&&(a=b(p[o]))!=null)return a}}else if(e===an){var g=n;if(!l)return pt.Not;for(var f=0;f<g.length&&f<s;f++){var m=g[f];if(m&&(a=b(m[l]))!=null)return a}}else if(e===Tn){var y=n;if(!l)return pt.Not;var d=y[l];if(!d||Ct(d))return pt.Not;for(var f=0;f<d.length&&f<s;f++)if((a=b(d[f]))!=null)return a}else if(e===Zt)for(var v=n,f=0;f<v.length&&f<s;f++){var m=v[f],_=us(m);if(!q(_))return pt.Not;if((a=b(_[o]))!=null)return a}function b(T){var w=Q(T);if(T!=null&&Number.isFinite(Number(T))&&T!=="")return w?pt.Might:pt.Not;if(w&&T!=="-")return pt.Must}return pt.Not}var $u=function(){function n(e){this.data=e.data||(e.sourceFormat===Tn?{}:[]),this.sourceFormat=e.sourceFormat||Ox,this.seriesLayoutBy=e.seriesLayoutBy||qn,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var i=0;i<t.length;i++){var r=t[i];r.type==null&&Lx(this,i)===pt.Must&&(r.type="ordinal")}}return n}();function Qf(n){return n instanceof $u}function Jf(n,e,t){t=t||Bx(n);var i=e.seriesLayoutBy,r=lR(n,t,i,e.sourceHeader,e.dimensions),o=new $u({data:n,sourceFormat:t,seriesLayoutBy:i,dimensionsDefine:r.dimensionsDefine,startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount,metaRawOption:ue(e)});return o}function zx(n){return new $u({data:n,sourceFormat:Ct(n)?mi:Zt})}function sR(n){return new $u({data:n.data,sourceFormat:n.sourceFormat,seriesLayoutBy:n.seriesLayoutBy,dimensionsDefine:ue(n.dimensionsDefine),startIndex:n.startIndex,dimensionsDetectedCount:n.dimensionsDetectedCount})}function Bx(n){var e=Ox;if(Ct(n))e=mi;else if(q(n)){n.length===0&&(e=wt);for(var t=0,i=n.length;t<i;t++){var r=n[t];if(r!=null){if(q(r)||Ct(r)){e=wt;break}else if(ne(r)){e=an;break}}}}else if(ne(n)){for(var o in n)if(_n(n,o)&&Ot(n[o])){e=Tn;break}}return e}function lR(n,e,t,i,r){var o,a;if(!n)return{dimensionsDefine:Vx(r),startIndex:a,dimensionsDetectedCount:o};if(e===wt){var s=n;i==="auto"||i==null?Hx(function(u){u!=null&&u!=="-"&&(Q(u)?a==null&&(a=1):a=0)},t,s,10):a=Ne(i)?i:i?1:0,!r&&a===1&&(r=[],Hx(function(u,c){r[c]=u!=null?u+"":""},t,s,1/0)),o=r?r.length:t===Gr?s.length:s[0]?s[0].length:null}else if(e===an)r||(r=uR(n));else if(e===Tn)r||(r=[],N(n,function(u,c){r.push(c)}));else if(e===Zt){var l=us(n[0]);o=q(l)&&l.length||1}else e===mi&&process.env.NODE_ENV!=="production"&&J(!!r,"dimensions must be given if data is TypedArray.");return{startIndex:a,dimensionsDefine:Vx(r),dimensionsDetectedCount:o}}function uR(n){for(var e=0,t;e<n.length&&!(t=n[e++]););if(t)return Ce(t)}function Vx(n){if(n){var e=me();return $(n,function(t,i){t=ne(t)?t:{name:t};var r={name:t.name,displayName:t.displayName,type:t.type};if(r.name==null)return r;r.name+="",r.displayName==null&&(r.displayName=r.name);var o=e.get(r.name);return o?r.name+="-"+o.count++:e.set(r.name,{count:1}),r})}}function Hx(n,e,t,i){if(e===Gr)for(var r=0;r<t.length&&r<i;r++)n(t[r]?t[r][0]:null,r);else for(var o=t[0]||[],r=0;r<o.length&&r<i;r++)n(o[r],r)}function Fx(n){var e=n.sourceFormat;return e===an||e===Tn}var Wr,Ur,Yr,qr,Gx,Wx,Ux=function(){function n(e,t){var i=Qf(e)?e:zx(e);this._source=i;var r=this._data=i.data,o=i.sourceFormat,a=i.seriesLayoutBy;if(o===mi){if(process.env.NODE_ENV!=="production"&&t==null)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=t,this._data=r}if(process.env.NODE_ENV!=="production"){var s=cR[Xu(o,a)];s&&s(r,i.dimensionsDefine)}Wx(this,r,i)}return n.prototype.getSource=function(){return this._source},n.prototype.count=function(){return 0},n.prototype.getItem=function(e,t){},n.prototype.appendData=function(e){},n.prototype.clean=function(){},n.protoInitialize=function(){var e=n.prototype;e.pure=!1,e.persistent=!0}(),n.internalField=function(){var e;Wx=function(a,s,l){var u=l.sourceFormat,c=l.seriesLayoutBy,h=l.startIndex,d=l.dimensionsDefine,f=Gx[Xu(u,c)];if(process.env.NODE_ENV!=="production"&&J(f,"Invalide sourceFormat: "+u),U(a,f),u===mi)a.getItem=t,a.count=r,a.fillStorage=i;else{var p=qx(u,c);a.getItem=ke(p,null,s,h,d);var g=$x(u,c);a.count=ke(g,null,s,h,d)}};var t=function(a,s){a=a-this._offset,s=s||[];for(var l=this._data,u=this._dimSize,c=u*a,h=0;h<u;h++)s[h]=l[c+h];return s},i=function(a,s,l,u){for(var c=this._data,h=this._dimSize,d=0;d<h;d++){for(var f=u[d],p=f[0]==null?1/0:f[0],g=f[1]==null?-1/0:f[1],m=s-a,y=l[d],v=0;v<m;v++){var _=c[v*h+d];y[a+v]=_,_<p&&(p=_),_>g&&(g=_)}f[0]=p,f[1]=g}},r=function(){return this._data?this._data.length/this._dimSize:0};Gx=(e={},e[wt+"_"+qn]={pure:!0,appendData:o},e[wt+"_"+Gr]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[an]={pure:!0,appendData:o},e[Tn]={pure:!0,appendData:function(a){var s=this._data;N(a,function(l,u){for(var c=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},e[Zt]={appendData:o},e[mi]={persistent:!1,pure:!0,appendData:function(a){process.env.NODE_ENV!=="production"&&J(Ct(a),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=a},clean:function(){this._offset+=this.count(),this._data=null}},e);function o(a){for(var s=0;s<a.length;s++)this._data.push(a[s])}}(),n}(),Zu=function(n){q(n)||ze("series.data or dataset.source must be an array.")},cR=(Wr={},Wr[wt+"_"+qn]=Zu,Wr[wt+"_"+Gr]=Zu,Wr[an]=Zu,Wr[Tn]=function(n,e){for(var t=0;t<e.length;t++){var i=e[t].name;i==null&&ze("dimension name must not be null/undefined.")}},Wr[Zt]=Zu,Wr),Yx=function(n,e,t,i){return n[i]},hR=(Ur={},Ur[wt+"_"+qn]=function(n,e,t,i){return n[i+e]},Ur[wt+"_"+Gr]=function(n,e,t,i,r){i+=e;for(var o=r||[],a=n,s=0;s<a.length;s++){var l=a[s];o[s]=l?l[i]:null}return o},Ur[an]=Yx,Ur[Tn]=function(n,e,t,i,r){for(var o=r||[],a=0;a<t.length;a++){var s=t[a].name,l=s!=null?n[s]:null;o[a]=l?l[i]:null}return o},Ur[Zt]=Yx,Ur);function qx(n,e){var t=hR[Xu(n,e)];return process.env.NODE_ENV!=="production"&&J(t,'Do not support get item on "'+n+'", "'+e+'".'),t}var jx=function(n,e,t){return n.length},dR=(Yr={},Yr[wt+"_"+qn]=function(n,e,t){return Math.max(0,n.length-e)},Yr[wt+"_"+Gr]=function(n,e,t){var i=n[0];return i?Math.max(0,i.length-e):0},Yr[an]=jx,Yr[Tn]=function(n,e,t){var i=t[0].name,r=i!=null?n[i]:null;return r?r.length:0},Yr[Zt]=jx,Yr);function $x(n,e){var t=dR[Xu(n,e)];return process.env.NODE_ENV!=="production"&&J(t,'Do not support count on "'+n+'", "'+e+'".'),t}var ep=function(n,e,t){return n[e]},fR=(qr={},qr[wt]=ep,qr[an]=function(n,e,t){return n[t]},qr[Tn]=ep,qr[Zt]=function(n,e,t){var i=us(n);return i instanceof Array?i[e]:i},qr[mi]=ep,qr);function Zx(n){var e=fR[n];return process.env.NODE_ENV!=="production"&&J(e,'Do not support get value on "'+n+'".'),e}function Xu(n,e){return n===wt?n+"_"+e:n}function Xo(n,e,t){if(n){var i=n.getRawDataItem(e);if(i!=null){var r=n.getStore(),o=r.getSource().sourceFormat;if(t!=null){var a=n.getDimensionIndex(t),s=r.getDimensionProperty(a);return Zx(o)(i,a,s)}else{var l=i;return o===Zt&&(l=us(i)),l}}}}var pR=function(){function n(e,t){this._encode=e,this._schema=t}return n.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},n.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},n}();function gR(n,e){var t={},i=t.encode={},r=me(),o=[],a=[],s={};N(n.dimensions,function(d){var f=n.getDimensionInfo(d),p=f.coordDim;if(p){process.env.NODE_ENV!=="production"&&J(Xf.get(p)==null);var g=f.coordDimIndex;tp(i,p)[g]=d,f.isExtraCoord||(r.set(p,1),yR(f.type)&&(o[0]=d),tp(s,p)[g]=n.getDimensionIndex(f.name)),f.defaultTooltip&&a.push(d)}Xf.each(function(m,y){var v=tp(i,y),_=f.otherDims[y];_!=null&&_!==!1&&(v[_]=f.name)})});var l=[],u={};r.each(function(d,f){var p=i[f];u[f]=p[0],l=l.concat(p)}),t.dataDimsOnCoord=l,t.dataDimIndicesOnCoord=$(l,function(d){return n.getDimensionInfo(d).storeDimIndex}),t.encodeFirstDimNotExtra=u;var c=i.label;c&&c.length&&(o=c.slice());var h=i.tooltip;return h&&h.length?a=h.slice():a.length||(a=o.slice()),i.defaultedLabel=o,i.defaultedTooltip=a,t.userOutput=new pR(s,e),t}function tp(n,e){return n.hasOwnProperty(e)||(n[e]=[]),n[e]}function mR(n){return n==="category"?"ordinal":n==="time"?"time":"float"}function yR(n){return!(n==="ordinal"||n==="time")}var Ku=function(){function n(e){this.otherDims={},e!=null&&U(this,e)}return n}();function qi(n,e){var t=e&&e.type;return t==="ordinal"?n:(t==="time"&&!Ne(n)&&n!=null&&n!=="-"&&(n=+Ho(n)),n==null||n===""?NaN:Number(n))}me({number:function(n){return parseFloat(n)},time:function(n){return+Ho(n)},trim:function(n){return Q(n)?An(n):n}});var vR=function(){function n(e,t){var i=e==="desc";this._resultLT=i?1:-1,t==null&&(t=i?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return n.prototype.evaluate=function(e,t){var i=Ne(e)?e:wu(e),r=Ne(t)?t:wu(t),o=isNaN(i),a=isNaN(r);if(o&&(i=this._incomparable),a&&(r=this._incomparable),o&&a){var s=Q(e),l=Q(t);s&&(i=l?e:0),l&&(r=s?t:0)}return i<r?this._resultLT:i>r?-this._resultLT:0},n}(),Qu="undefined",_R=typeof Uint32Array===Qu?Array:Uint32Array,xR=typeof Uint16Array===Qu?Array:Uint16Array,Xx=typeof Int32Array===Qu?Array:Int32Array,Kx=typeof Float64Array===Qu?Array:Float64Array,Qx={float:Kx,int:Xx,ordinal:Array,number:Array,time:Kx},np;function Ko(n){return n>65535?_R:xR}function Qo(){return[1/0,-1/0]}function bR(n){var e=n.constructor;return e===Array?n.slice():new e(n)}function Jx(n,e,t,i,r){var o=Qx[t||"float"];if(r){var a=n[e],s=a&&a.length;if(s!==i){for(var l=new o(i),u=0;u<s;u++)l[u]=a[u];n[e]=l}}else n[e]=new o(i)}var ip=function(){function n(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=me()}return n.prototype.initData=function(e,t,i){process.env.NODE_ENV!=="production"&&J(ce(e.getItem)&&ce(e.count),"Invalid data provider."),this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var r=e.getSource(),o=this.defaultDimValueGetter=np[r.sourceFormat];this._dimValueGetter=i||o,this._rawExtent=[];var a=Fx(r);this._dimensions=$(t,function(s){return process.env.NODE_ENV!=="production"&&a&&J(s.property!=null),{type:s.type,property:s.property}}),this._initDataFromProvider(0,e.count())},n.prototype.getProvider=function(){return this._provider},n.prototype.getSource=function(){return this._provider.getSource()},n.prototype.ensureCalculationDimension=function(e,t){var i=this._calcDimNameToIdx,r=this._dimensions,o=i.get(e);if(o!=null){if(r[o].type===t)return o}else o=r.length;return r[o]={type:t},i.set(e,o),this._chunks[o]=new Qx[t||"float"](this._rawCount),this._rawExtent[o]=Qo(),o},n.prototype.collectOrdinalMeta=function(e,t){var i=this._chunks[e],r=this._dimensions[e],o=this._rawExtent,a=r.ordinalOffset||0,s=i.length;a===0&&(o[e]=Qo());for(var l=o[e],u=a;u<s;u++){var c=i[u]=t.parseAndCollect(i[u]);isNaN(c)||(l[0]=Math.min(c,l[0]),l[1]=Math.max(c,l[1]))}r.ordinalMeta=t,r.ordinalOffset=s,r.type="ordinal"},n.prototype.getOrdinalMeta=function(e){var t=this._dimensions[e],i=t.ordinalMeta;return i},n.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},n.prototype.appendData=function(e){process.env.NODE_ENV!=="production"&&J(!this._indices,"appendData can only be called on raw data.");var t=this._provider,i=this.count();t.appendData(e);var r=t.count();return t.persistent||(r+=i),i<r&&this._initDataFromProvider(i,r,!0),[i,r]},n.prototype.appendValues=function(e,t){for(var i=this._chunks,r=this._dimensions,o=r.length,a=this._rawExtent,s=this.count(),l=s+Math.max(e.length,t||0),u=0;u<o;u++){var c=r[u];Jx(i,u,c.type,l,!0)}for(var h=[],d=s;d<l;d++)for(var f=d-s,p=0;p<o;p++){var c=r[p],g=np.arrayRows.call(this,e[f]||h,c.property,f,p);i[p][d]=g;var m=a[p];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},n.prototype._initDataFromProvider=function(e,t,i){for(var r=this._provider,o=this._chunks,a=this._dimensions,s=a.length,l=this._rawExtent,u=$(a,function(v){return v.property}),c=0;c<s;c++){var h=a[c];l[c]||(l[c]=Qo()),Jx(o,c,h.type,t,i)}if(r.fillStorage)r.fillStorage(e,t,o,l);else for(var d=[],f=e;f<t;f++){d=r.getItem(f,d);for(var p=0;p<s;p++){var g=o[p],m=this._dimValueGetter(d,u[p],f,p);g[f]=m;var y=l[p];m<y[0]&&(y[0]=m),m>y[1]&&(y[1]=m)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},n.prototype.count=function(){return this._count},n.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var i=this._chunks[e];return i?i[this.getRawIndex(t)]:NaN},n.prototype.getValues=function(e,t){var i=[],r=[];if(t==null){t=e,e=[];for(var o=0;o<this._dimensions.length;o++)r.push(o)}else r=e;for(var o=0,a=r.length;o<a;o++)i.push(this.get(r[o],t));return i},n.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var i=this._chunks[e];return i?i[t]:NaN},n.prototype.getSum=function(e){var t=this._chunks[e],i=0;if(t)for(var r=0,o=this.count();r<o;r++){var a=this.get(e,r);isNaN(a)||(i+=a)}return i},n.prototype.getMedian=function(e){var t=[];this.each([e],function(o){isNaN(o)||t.push(o)});var i=t.sort(function(o,a){return o-a}),r=this.count();return r===0?0:r%2===1?i[(r-1)/2]:(i[r/2]+i[r/2-1])/2},n.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(i!=null&&i<this._count&&i===e)return e;for(var r=0,o=this._count-1;r<=o;){var a=(r+o)/2|0;if(t[a]<e)r=a+1;else if(t[a]>e)o=a-1;else return a}return-1},n.prototype.getIndices=function(){var e,t=this._indices;if(t){var i=t.constructor,r=this._count;if(i===Array){e=new i(r);for(var o=0;o<r;o++)e[o]=t[o]}else e=new i(t.buffer,0,r)}else{var i=Ko(this._rawCount);e=new i(this.count());for(var o=0;o<e.length;o++)e[o]=o}return e},n.prototype.filter=function(e,t){if(!this._count)return this;for(var i=this.clone(),r=i.count(),o=Ko(i._rawCount),a=new o(r),s=[],l=e.length,u=0,c=e[0],h=i._chunks,d=0;d<r;d++){var f=void 0,p=i.getRawIndex(d);if(l===0)f=t(d);else if(l===1){var g=h[c][p];f=t(g,d)}else{for(var m=0;m<l;m++)s[m]=h[e[m]][p];s[m]=d,f=t.apply(null,s)}f&&(a[u++]=p)}return u<r&&(i._indices=a),i._count=u,i._extent=[],i._updateGetRawIdx(),i},n.prototype.selectRange=function(e){var t=this.clone(),i=t._count;if(!i)return this;var r=Ce(e),o=r.length;if(!o)return this;var a=t.count(),s=Ko(t._rawCount),l=new s(a),u=0,c=r[0],h=e[c][0],d=e[c][1],f=t._chunks,p=!1;if(!t._indices){var g=0;if(o===1){for(var m=f[r[0]],y=0;y<i;y++){var v=m[y];(v>=h&&v<=d||isNaN(v))&&(l[u++]=g),g++}p=!0}else if(o===2){for(var m=f[r[0]],_=f[r[1]],b=e[r[1]][0],T=e[r[1]][1],y=0;y<i;y++){var v=m[y],w=_[y];(v>=h&&v<=d||isNaN(v))&&(w>=b&&w<=T||isNaN(w))&&(l[u++]=g),g++}p=!0}}if(!p)if(o===1)for(var y=0;y<a;y++){var S=t.getRawIndex(y),v=f[r[0]][S];(v>=h&&v<=d||isNaN(v))&&(l[u++]=S)}else for(var y=0;y<a;y++){for(var M=!0,S=t.getRawIndex(y),C=0;C<o;C++){var I=r[C],v=f[I][S];(v<e[I][0]||v>e[I][1])&&(M=!1)}M&&(l[u++]=t.getRawIndex(y))}return u<a&&(t._indices=l),t._count=u,t._extent=[],t._updateGetRawIdx(),t},n.prototype.map=function(e,t){var i=this.clone(e);return this._updateDims(i,e,t),i},n.prototype.modify=function(e,t){this._updateDims(this,e,t)},n.prototype._updateDims=function(e,t,i){for(var r=e._chunks,o=[],a=t.length,s=e.count(),l=[],u=e._rawExtent,c=0;c<t.length;c++)u[t[c]]=Qo();for(var h=0;h<s;h++){for(var d=e.getRawIndex(h),f=0;f<a;f++)l[f]=r[t[f]][d];l[a]=h;var p=i&&i.apply(null,l);if(p!=null){typeof p!="object"&&(o[0]=p,p=o);for(var c=0;c<p.length;c++){var g=t[c],m=p[c],y=u[g],v=r[g];v&&(v[d]=m),m<y[0]&&(y[0]=m),m>y[1]&&(y[1]=m)}}}},n.prototype.lttbDownSample=function(e,t){var i=this.clone([e],!0),r=i._chunks,o=r[e],a=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),c,h,d,f=new(Ko(this._rawCount))(Math.min((Math.ceil(a/l)+2)*2,a));f[s++]=u;for(var p=1;p<a-1;p+=l){for(var g=Math.min(p+l,a-1),m=Math.min(p+l*2,a),y=(m+g)/2,v=0,_=g;_<m;_++){var b=this.getRawIndex(_),T=o[b];isNaN(T)||(v+=T)}v/=m-g;var w=p,S=Math.min(p+l,a),M=p-1,C=o[u];c=-1,d=w;for(var I=-1,E=0,_=w;_<S;_++){var b=this.getRawIndex(_),T=o[b];if(isNaN(T)){E++,I<0&&(I=b);continue}h=Math.abs((M-y)*(T-C)-(M-_)*(v-C)),h>c&&(c=h,d=b)}E>0&&E<S-w&&(f[s++]=Math.min(I,d),d=Math.max(I,d)),f[s++]=d,u=d}return f[s++]=this.getRawIndex(a-1),i._count=s,i._indices=f,i.getRawIndex=this._getRawIdx,i},n.prototype.minmaxDownSample=function(e,t){for(var i=this.clone([e],!0),r=i._chunks,o=Math.floor(1/t),a=r[e],s=this.count(),l=new(Ko(this._rawCount))(Math.ceil(s/o)*2),u=0,c=0;c<s;c+=o){var h=c,d=a[this.getRawIndex(h)],f=c,p=a[this.getRawIndex(f)],g=o;c+o>s&&(g=s-c);for(var m=0;m<g;m++){var y=this.getRawIndex(c+m),v=a[y];v<d&&(d=v,h=c+m),v>p&&(p=v,f=c+m)}var _=this.getRawIndex(h),b=this.getRawIndex(f);h<f?(l[u++]=_,l[u++]=b):(l[u++]=b,l[u++]=_)}return i._count=u,i._indices=l,i._updateGetRawIdx(),i},n.prototype.downSample=function(e,t,i,r){for(var o=this.clone([e],!0),a=o._chunks,s=[],l=Math.floor(1/t),u=a[e],c=this.count(),h=o._rawExtent[e]=Qo(),d=new(Ko(this._rawCount))(Math.ceil(c/l)),f=0,p=0;p<c;p+=l){l>c-p&&(l=c-p,s.length=l);for(var g=0;g<l;g++){var m=this.getRawIndex(p+g);s[g]=u[m]}var y=i(s),v=this.getRawIndex(Math.min(p+r(s,y)||0,c-1));u[v]=y,y<h[0]&&(h[0]=y),y>h[1]&&(h[1]=y),d[f++]=v}return o._count=f,o._indices=d,o._updateGetRawIdx(),o},n.prototype.each=function(e,t){if(this._count)for(var i=e.length,r=this._chunks,o=0,a=this.count();o<a;o++){var s=this.getRawIndex(o);switch(i){case 0:t(o);break;case 1:t(r[e[0]][s],o);break;case 2:t(r[e[0]][s],r[e[1]][s],o);break;default:for(var l=0,u=[];l<i;l++)u[l]=r[e[l]][s];u[l]=o,t.apply(null,u)}}},n.prototype.getDataExtent=function(e){var t=this._chunks[e],i=Qo();if(!t)return i;var r=this.count(),o=!this._indices,a;if(o)return this._rawExtent[e].slice();if(a=this._extent[e],a)return a.slice();a=i;for(var s=a[0],l=a[1],u=0;u<r;u++){var c=this.getRawIndex(u),h=t[c];h<s&&(s=h),h>l&&(l=h)}return a=[s,l],this._extent[e]=a,a},n.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var i=[],r=this._chunks,o=0;o<r.length;o++)i.push(r[o][t]);return i},n.prototype.clone=function(e,t){var i=new n,r=this._chunks,o=e&&Ai(e,function(s,l){return s[l]=!0,s},{});if(o)for(var a=0;a<r.length;a++)i._chunks[a]=o[a]?bR(r[a]):r[a];else i._chunks=r;return this._copyCommonProps(i),t||(i._indices=this._cloneIndices()),i._updateGetRawIdx(),i},n.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=ue(this._extent),e._rawExtent=ue(this._rawExtent)},n.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var i=this._indices.length;t=new e(i);for(var r=0;r<i;r++)t[r]=this._indices[r]}else t=new e(this._indices);return t}return null},n.prototype._getRawIdxIdentity=function(e){return e},n.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},n.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},n.internalField=function(){function e(t,i,r,o){return qi(t[o],this._dimensions[o])}np={arrayRows:e,objectRows:function(t,i,r,o){return qi(t[i],this._dimensions[o])},keyedColumns:e,original:function(t,i,r,o){var a=t&&(t.value==null?t:t.value);return qi(a instanceof Array?a[o]:a,this._dimensions[o])},typedArray:function(t,i,r,o){return t[o]}}}(),n}(),wR=Re(),SR={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},e1=function(){function n(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return n.prototype.isDimensionOmitted=function(){return this._dimOmitted},n.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=i1(this.source)))},n.prototype.getSourceDimensionIndex=function(e){return te(this._dimNameMap.get(e),-1)},n.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},n.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Fx(this.source),i=!r1(e),r="",o=[],a=0,s=0;a<e;a++){var l=void 0,u=void 0,c=void 0,h=this.dimensions[s];if(h&&h.storeDimIndex===a)l=t?h.name:null,u=h.type,c=h.ordinalMeta,s++;else{var d=this.getSourceDimension(a);d&&(l=t?d.name:null,u=d.type)}o.push({property:l,type:u,ordinalMeta:c}),t&&l!=null&&(!h||!h.isCalculationCoord)&&(r+=i?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),r+="$",r+=SR[u]||"f",c&&(r+=c.uid),r+="$"}var f=this.source,p=[f.seriesLayoutBy,f.startIndex,r].join("$$");return{dimensions:o,hash:p}},n.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,i=0;t<this._fullDimCount;t++){var r=void 0,o=this.dimensions[i];if(o&&o.storeDimIndex===t)o.isCalculationCoord||(r=o.name),i++;else{var a=this.getSourceDimension(t);a&&(r=a.name)}e.push(r)}return e},n.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},n}();function t1(n){return n instanceof e1}function n1(n){for(var e=me(),t=0;t<(n||[]).length;t++){var i=n[t],r=ne(i)?i.name:i;r!=null&&e.get(r)==null&&e.set(r,t)}return e}function i1(n){var e=wR(n);return e.dimNameMap||(e.dimNameMap=n1(n.dimensionsDefine))}function r1(n){return n>30}var Cs=ne,ji=$,TR=typeof Int32Array>"u"?Array:Int32Array,MR="e\0\0",o1=-1,CR=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],kR=["_approximateExtent"],a1,Ju,ks,Jo,rp,Ds,op,jr=function(){function n(e,t){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 i,r=!1;t1(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,i=e),i=i||["x","y"];for(var o={},a=[],s={},l=!1,u={},c=0;c<i.length;c++){var h=i[c],d=Q(h)?new Ku({name:h}):h instanceof Ku?h:new Ku(h),f=d.name;d.type=d.type||"float",d.coordDim||(d.coordDim=f,d.coordDimIndex=0);var p=d.otherDims=d.otherDims||{};a.push(f),o[f]=d,u[f]!=null&&(l=!0),d.createInvertedIndices&&(s[f]=[]);var g=c;Ne(d.storeDimIndex)&&(g=d.storeDimIndex),p.itemName===0&&(this._nameDimIdx=g),p.itemId===0&&(this._idDimIdx=g),process.env.NODE_ENV!=="production"&&J(r||d.storeDimIndex>=0),r&&(d.storeDimIndex=c)}if(this.dimensions=a,this._dimInfos=o,this._initGetDimensionInfo(l),this.hostModel=t,this._invertedIndicesMap=s,this._dimOmitted){var m=this._dimIdxToName=me();N(a,function(y){m.set(o[y].storeDimIndex,y)})}}return n.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(t==null)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var i=this._dimIdxToName.get(t);if(i!=null)return i;var r=this._schema.getSourceDimension(t);if(r)return r.name},n.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(t!=null)return t;if(e==null)return-1;var i=this._getDimInfo(e);return i?i.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},n.prototype._recognizeDimIndex=function(e){if(Ne(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},n.prototype._getStoreDimIndex=function(e){var t=this.getDimensionIndex(e);if(process.env.NODE_ENV!=="production"&&t==null)throw new Error("Unknown dimension "+e);return t},n.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},n.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(i){return t.hasOwnProperty(i)?t[i]:void 0}:function(i){return t[i]}},n.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},n.prototype.mapDimension=function(e,t){var i=this._dimSummary;if(t==null)return i.encodeFirstDimNotExtra[e];var r=i.encode[e];return r?r[t]:null},n.prototype.mapDimensionsAll=function(e){var t=this._dimSummary,i=t.encode[e];return(i||[]).slice()},n.prototype.getStore=function(){return this._store},n.prototype.initData=function(e,t,i){var r=this,o;if(e instanceof ip&&(o=e),!o){var a=this.dimensions,s=Qf(e)||Ot(e)?new Ux(e,a.length):e;o=new ip;var l=ji(a,function(u){return{type:r._dimInfos[u].type,property:u}});o.initData(s,l,i)}this._store=o,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,o.count()),this._dimSummary=gR(this,this._schema),this.userOutput=this._dimSummary.userOutput},n.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},n.prototype.appendValues=function(e,t){var i=this._store.appendValues(e,t&&t.length),r=i.start,o=i.end,a=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var s=r;s<o;s++){var l=s-r;this._nameList[s]=t[l],a&&op(this,s)}},n.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,i=0;i<t.length;i++){var r=this._dimInfos[t[i]];r.ordinalMeta&&e.collectOrdinalMeta(r.storeDimIndex,r.ordinalMeta)}},n.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==mi&&!e.fillStorage},n.prototype._doInit=function(e,t){if(!(e>=t)){var i=this._store,r=i.getProvider();this._updateOrdinalMeta();var o=this._nameList,a=this._idList,s=r.getSource().sourceFormat,l=s===Zt;if(l&&!r.pure)for(var u=[],c=e;c<t;c++){var h=r.getItem(c,u);if(!this.hasItemOption&&SA(h)&&(this.hasItemOption=!0),h){var d=h.name;o[c]==null&&d!=null&&(o[c]=Un(d,null));var f=h.id;a[c]==null&&f!=null&&(a[c]=Un(f,null))}}if(this._shouldMakeIdFromName())for(var c=e;c<t;c++)op(this,c);a1(this)}},n.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},n.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},n.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},n.prototype.setCalculationInfo=function(e,t){Cs(e)?U(this._calculationInfo,e):this._calculationInfo[e]=t},n.prototype.getName=function(e){var t=this.getRawIndex(e),i=this._nameList[t];return i==null&&this._nameDimIdx!=null&&(i=ks(this,this._nameDimIdx,t)),i==null&&(i=""),i},n.prototype._getCategory=function(e,t){var i=this._store.get(e,t),r=this._store.getOrdinalMeta(e);return r?r.categories[i]:i},n.prototype.getId=function(e){return Ju(this,this.getRawIndex(e))},n.prototype.count=function(){return this._store.count()},n.prototype.get=function(e,t){var i=this._store,r=this._dimInfos[e];if(r)return i.get(r.storeDimIndex,t)},n.prototype.getByRawIndex=function(e,t){var i=this._store,r=this._dimInfos[e];if(r)return i.getByRawIndex(r.storeDimIndex,t)},n.prototype.getIndices=function(){return this._store.getIndices()},n.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},n.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},n.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},n.prototype.getValues=function(e,t){var i=this,r=this._store;return q(e)?r.getValues(ji(e,function(o){return i._getStoreDimIndex(o)}),t):r.getValues(e)},n.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,i=0,r=t.length;i<r;i++)if(isNaN(this._store.get(t[i],e)))return!1;return!0},n.prototype.indexOfName=function(e){for(var t=0,i=this._store.count();t<i;t++)if(this.getName(t)===e)return t;return-1},n.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},n.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},n.prototype.rawIndexOf=function(e,t){var i=e&&this._invertedIndicesMap[e];if(process.env.NODE_ENV!=="production"&&!i)throw new Error("Do not supported yet");var r=i&&i[t];return r==null||isNaN(r)?o1:r},n.prototype.each=function(e,t,i){ce(e)&&(i=t,t=e,e=[]);var r=i||this,o=ji(Jo(e),this._getStoreDimIndex,this);this._store.each(o,r?ke(t,r):t)},n.prototype.filterSelf=function(e,t,i){ce(e)&&(i=t,t=e,e=[]);var r=i||this,o=ji(Jo(e),this._getStoreDimIndex,this);return this._store=this._store.filter(o,r?ke(t,r):t),this},n.prototype.selectRange=function(e){var t=this,i={},r=Ce(e);return N(r,function(o){var a=t._getStoreDimIndex(o);i[a]=e[o]}),this._store=this._store.selectRange(i),this},n.prototype.mapArray=function(e,t,i){ce(e)&&(i=t,t=e,e=[]),i=i||this;var r=[];return this.each(e,function(){r.push(t&&t.apply(this,arguments))},i),r},n.prototype.map=function(e,t,i,r){var o=i||r||this,a=ji(Jo(e),this._getStoreDimIndex,this),s=Ds(this);return s._store=this._store.map(a,o?ke(t,o):t),s},n.prototype.modify=function(e,t,i,r){var o=this,a=i||r||this;process.env.NODE_ENV!=="production"&&N(Jo(e),function(l){var u=o.getDimensionInfo(l);u.isCalculationCoord||console.error("Danger: only stack dimension can be modified")});var s=ji(Jo(e),this._getStoreDimIndex,this);this._store.modify(s,a?ke(t,a):t)},n.prototype.downSample=function(e,t,i,r){var o=Ds(this);return o._store=this._store.downSample(this._getStoreDimIndex(e),t,i,r),o},n.prototype.minmaxDownSample=function(e,t){var i=Ds(this);return i._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),t),i},n.prototype.lttbDownSample=function(e,t){var i=Ds(this);return i._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),i},n.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},n.prototype.getItemModel=function(e){var t=this.hostModel,i=this.getRawDataItem(e);return new Ge(i,t,t&&t.ecModel)},n.prototype.diff=function(e){var t=this;return new Zf(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(i){return Ju(e,i)},function(i){return Ju(t,i)})},n.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},n.prototype.setVisual=function(e,t){this._visual=this._visual||{},Cs(e)?U(this._visual,e):this._visual[e]=t},n.prototype.getItemVisual=function(e,t){var i=this._itemVisuals[e],r=i&&i[t];return r??this.getVisual(t)},n.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},n.prototype.ensureUniqueItemVisual=function(e,t){var i=this._itemVisuals,r=i[e];r||(r=i[e]={});var o=r[t];return o==null&&(o=this.getVisual(t),q(o)?o=o.slice():Cs(o)&&(o=U({},o)),r[t]=o),o},n.prototype.setItemVisual=function(e,t,i){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,Cs(t)?U(r,t):r[t]=i},n.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},n.prototype.setLayout=function(e,t){Cs(e)?U(this._layout,e):this._layout[e]=t},n.prototype.getLayout=function(e){return this._layout[e]},n.prototype.getItemLayout=function(e){return this._itemLayouts[e]},n.prototype.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?U(this._itemLayouts[e]||{},t):t},n.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},n.prototype.setItemGraphicEl=function(e,t){var i=this.hostModel&&this.hostModel.seriesIndex;VA(i,this.dataType,e,t),this._graphicEls[e]=t},n.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},n.prototype.eachItemGraphicEl=function(e,t){N(this._graphicEls,function(i,r){i&&e&&e.call(t,i,r)})},n.prototype.cloneShallow=function(e){return e||(e=new n(this._schema?this._schema:ji(this.dimensions,this._getDimInfo,this),this.hostModel)),rp(e,this),e._store=this._store,e},n.prototype.wrapMethod=function(e,t){var i=this[e];ce(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var r=i.apply(this,arguments);return t.apply(this,[r].concat(sd(arguments)))})},n.internalField=function(){a1=function(e){var t=e._invertedIndicesMap;N(t,function(i,r){var o=e._dimInfos[r],a=o.ordinalMeta,s=e._store;if(a){i=t[r]=new TR(a.categories.length);for(var l=0;l<i.length;l++)i[l]=o1;for(var l=0;l<s.count();l++)i[s.get(o.storeDimIndex,l)]=l}})},ks=function(e,t,i){return Un(e._getCategory(t,i),null)},Ju=function(e,t){var i=e._idList[t];return i==null&&e._idDimIdx!=null&&(i=ks(e,e._idDimIdx,t)),i==null&&(i=MR+t),i},Jo=function(e){return q(e)||(e=e!=null?[e]:[]),e},Ds=function(e){var t=new n(e._schema?e._schema:ji(e.dimensions,e._getDimInfo,e),e.hostModel);return rp(t,e),t},rp=function(e,t){N(CR.concat(t.__wrappedMethods||[]),function(i){t.hasOwnProperty(i)&&(e[i]=t[i])}),e.__wrappedMethods=t.__wrappedMethods,N(kR,function(i){e[i]=ue(t[i])}),e._calculationInfo=U({},t._calculationInfo)},op=function(e,t){var i=e._nameList,r=e._idList,o=e._nameDimIdx,a=e._idDimIdx,s=i[t],l=r[t];if(s==null&&o!=null&&(i[t]=s=ks(e,o,t)),l==null&&a!=null&&(r[t]=l=ks(e,a,t)),l==null&&s!=null){var u=e._nameRepeatCount,c=u[s]=(u[s]||0)+1;l=s,c>1&&(l+="__ec__"+c),r[t]=l}}}(),n}();function s1(n,e){Qf(n)||(n=zx(n)),e=e||{};var t=e.coordDimensions||[],i=e.dimensionsDefine||n.dimensionsDefine||[],r=me(),o=[],a=IR(n,t,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&r1(a),l=i===n.dimensionsDefine,u=l?i1(n):n1(i),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(n,a));for(var h=me(c),d=new Xx(a),f=0;f<d.length;f++)d[f]=-1;function p(C){var I=d[C];if(I<0){var E=i[C],k=ne(E)?E:{name:E},D=new Ku,A=k.name;A!=null&&u.get(A)!=null&&(D.name=D.displayName=A),k.type!=null&&(D.type=k.type),k.displayName!=null&&(D.displayName=k.displayName);var R=o.length;return d[C]=R,D.storeDimIndex=C,o.push(D),D}return o[I]}if(!s)for(var f=0;f<a;f++)p(f);h.each(function(C,I){var E=_t(C).slice();if(E.length===1&&!Q(E[0])&&E[0]<0){h.set(I,!1);return}var k=h.set(I,[]);N(E,function(D,A){var R=Q(D)?u.get(D):D;R!=null&&R<a&&(k[A]=R,m(p(R),I,A))})});var g=0;N(t,function(C){var I,E,k,D;if(Q(C))I=C,D={};else{D=C,I=D.name;var A=D.ordinalMeta;D.ordinalMeta=null,D=U({},D),D.ordinalMeta=A,E=D.dimsDef,k=D.otherDims,D.name=D.coordDim=D.coordDimIndex=D.dimsDef=D.otherDims=null}var R=h.get(I);if(R!==!1){if(R=_t(R),!R.length)for(var L=0;L<(E&&E.length||1);L++){for(;g<a&&p(g).coordDim!=null;)g++;g<a&&R.push(g++)}N(R,function(V,z){var H=p(V);if(l&&D.type!=null&&(H.type=D.type),m(Me(H,D),I,z),H.name==null&&E){var F=E[z];!ne(F)&&(F={name:F}),H.name=H.displayName=F.name,H.defaultTooltip=F.defaultTooltip}k&&Me(H.otherDims,k)})}});function m(C,I,E){Xf.get(I)!=null?C.otherDims[I]=E:(C.coordDim=I,C.coordDimIndex=E,r.set(I,!0))}var y=e.generateCoord,v=e.generateCoordCount,_=v!=null;v=y?v||1:0;var b=y||"value";function T(C){C.name==null&&(C.name=C.coordDim)}if(s)N(o,function(C){T(C)}),o.sort(function(C,I){return C.storeDimIndex-I.storeDimIndex});else for(var w=0;w<a;w++){var S=p(w),M=S.coordDim;M==null&&(S.coordDim=ER(b,r,_),S.coordDimIndex=0,(!y||v<=0)&&(S.isExtraCoord=!0),v--),T(S),S.type==null&&(Lx(n,w)===pt.Must||S.isExtraCoord&&(S.otherDims.itemName!=null||S.otherDims.seriesName!=null))&&(S.type="ordinal")}return DR(o),new e1({source:n,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function DR(n){for(var e=me(),t=0;t<n.length;t++){var i=n[t],r=i.name,o=e.get(r)||0;o>0&&(i.name=r+(o-1)),o++,e.set(r,o)}}function IR(n,e,t,i){var r=Math.max(n.dimensionsDetectedCount||1,e.length,t.length,i||0);return N(e,function(o){var a;ne(o)&&(a=o.dimsDef)&&(r=Math.max(r,a.length))}),r}function ER(n,e,t){if(t||e.hasKey(n)){for(var i=0;e.hasKey(n+i);)i++;n+=i}return e.set(n,!0),n}var ec={},ap={},sp=function(){function n(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return n.prototype.create=function(e,t){this._nonSeriesBoxMasterList=i(ec,!0),this._normalMasterList=i(ap,!1);function i(r,o){var a=[];return N(r,function(s,l){var u=s.create(e,t);a=a.concat(u||[]),process.env.NODE_ENV!=="production"&&o&&N(u,function(c){return J(!c.update)})}),a}},n.prototype.update=function(e,t){N(this._normalMasterList,function(i){i.update&&i.update(e,t)})},n.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},n.register=function(e,t){if(e==="matrix"||e==="calendar"){ec[e]=t;return}ap[e]=t},n.get=function(e){return ap[e]||ec[e]},n}();function NR(n){return!!ec[n]}var lp={coord:1,coord2:2};function AR(n){process.env.NODE_ENV!=="production"&&J(!up.get(n.fullType)),up.set(n.fullType,{getCoord2:void 0}).getCoord2=n.getCoord2}var up=me();function OR(n){var e=n.getShallow("coord",!0),t=lp.coord;if(e==null){var i=up.get(n.type);i&&i.getCoord2&&(t=lp.coord2,e=i.getCoord2(n))}return{coord:e,from:t}}var yi={none:0,dataCoordSys:1,boxCoordSys:2};function RR(n,e){var t=n.getShallow("coordinateSystem"),i=n.getShallow("coordinateSystemUsage",!0),r=i!=null,o=yi.none;if(t){var a=n.mainType==="series";i==null&&(i=a?"data":"box"),i==="data"?(o=yi.dataCoordSys,a||(process.env.NODE_ENV!=="production"&&r&&e&&ze('coordinateSystemUsage "data" is not supported in non-series components.'),o=yi.none)):i==="box"&&(o=yi.boxCoordSys,!a&&!NR(t)&&(process.env.NODE_ENV!=="production"&&r&&e&&ze('coordinateSystem "'+t+'" cannot be used'+(' as coordinateSystemUsage "box" for "'+n.type+'" yet.')),o=yi.none))}return{coordSysType:t,kind:o}}function LR(n){var e=n.targetModel,t=n.coordSysType,i=n.coordSysProvider,r=n.isDefaultDataCoordSys,o=n.allowNotFound;process.env.NODE_ENV!=="production"&&J(!!t);var a=RR(e,!0),s=a.kind,l=a.coordSysType;if(r&&s!==yi.dataCoordSys&&(s=yi.dataCoordSys,l=t),s===yi.none||l!==t)return!1;var u=i(t,e);return u?(s===yi.dataCoordSys?(process.env.NODE_ENV!=="production"&&J(e.mainType==="series"),e.coordinateSystem=u):e.boxCoordinateSystem=u,!0):(process.env.NODE_ENV!=="production"&&(o||ze(t+" cannot be found for"+(" "+e.type+" (index: "+e.componentIndex+")."))),!1)}var PR=function(){function n(e){this.coordSysDims=[],this.axisMap=me(),this.categoryAxisMap=me(),this.coordSysName=e}return n}();function zR(n){var e=n.get("coordinateSystem"),t=new PR(e),i=BR[e];if(i)return i(n,t,t.axisMap,t.categoryAxisMap),t}var BR={cartesian2d:function(n,e,t,i){var r=n.getReferringComponents("xAxis",xt).models[0],o=n.getReferringComponents("yAxis",xt).models[0];if(process.env.NODE_ENV!=="production"){if(!r)throw new Error('xAxis "'+vn(n.get("xAxisIndex"),n.get("xAxisId"),0)+'" not found');if(!o)throw new Error('yAxis "'+vn(n.get("xAxisIndex"),n.get("yAxisId"),0)+'" not found')}e.coordSysDims=["x","y"],t.set("x",r),t.set("y",o),ea(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),ea(o)&&(i.set("y",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(n,e,t,i){var r=n.getReferringComponents("singleAxis",xt).models[0];if(process.env.NODE_ENV!=="production"&&!r)throw new Error("singleAxis should be specified.");e.coordSysDims=["single"],t.set("single",r),ea(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(n,e,t,i){var r=n.getReferringComponents("polar",xt).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");if(process.env.NODE_ENV!=="production"){if(!a)throw new Error("angleAxis option not found");if(!o)throw new Error("radiusAxis option not found")}e.coordSysDims=["radius","angle"],t.set("radius",o),t.set("angle",a),ea(o)&&(i.set("radius",o),e.firstCategoryDimIndex=0),ea(a)&&(i.set("angle",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(n,e,t,i){e.coordSysDims=["lng","lat"]},parallel:function(n,e,t,i){var r=n.ecModel,o=r.getComponent("parallel",n.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();N(o.parallelAxisIndex,function(s,l){var u=r.getComponent("parallelAxis",s),c=a[l];t.set(c,u),ea(u)&&(i.set(c,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})},matrix:function(n,e,t,i){var r=n.getReferringComponents("matrix",xt).models[0];if(process.env.NODE_ENV!=="production"&&!r)throw new Error("matrix coordinate system should be specified.");e.coordSysDims=["x","y"];var o=r.getDimensionModel("x"),a=r.getDimensionModel("y");t.set("x",o),t.set("y",a),i.set("x",o),i.set("y",a)}};function ea(n){return n.get("type")==="category"}function VR(n,e,t){t=t||{};var i=t.byIndex,r=t.stackedCoordDimension,o,a,s;HR(e)?o=e:(a=e.schema,o=a.dimensions,s=e.store);var l=!!(n&&n.get("stack")),u,c,h,d;if(N(o,function(v,_){Q(v)&&(o[_]=v={name:v}),l&&!v.isExtraCoord&&(!i&&!u&&v.ordinalMeta&&(u=v),!c&&v.type!=="ordinal"&&v.type!=="time"&&(!r||r===v.coordDim)&&(c=v))}),c&&!i&&!u&&(i=!0),c){h="__\0ecstackresult_"+n.id,d="__\0ecstackedover_"+n.id,u&&(u.createInvertedIndices=!0);var f=c.coordDim,p=c.type,g=0;N(o,function(v){v.coordDim===f&&g++});var m={name:h,coordDim:f,coordDimIndex:g,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:o.length},y={name:d,coordDim:d,coordDimIndex:g+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:o.length+1};a?(s&&(m.storeDimIndex=s.ensureCalculationDimension(d,p),y.storeDimIndex=s.ensureCalculationDimension(h,p)),a.appendCalculationDimension(m),a.appendCalculationDimension(y)):(o.push(m),o.push(y))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:d,stackResultDimension:h}}function HR(n){return!t1(n.schema)}function $r(n,e){return!!e&&e===n.getCalculationInfo("stackedDimension")}function l1(n,e){return $r(n,e)?n.getCalculationInfo("stackResultDimension"):e}function FR(n,e){var t=n.get("coordinateSystem"),i=sp.get(t),r;return e&&e.coordSysDims&&(r=$(e.coordSysDims,function(o){var a={name:o},s=e.axisMap.get(o);if(s){var l=s.get("type");a.type=mR(l)}return a})),r||(r=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),r}function GR(n,e,t){var i,r;return t&&N(n,function(o,a){var s=o.coordDim,l=t.categoryAxisMap.get(s);l&&(i==null&&(i=a),o.ordinalMeta=l.getOrdinalMeta(),e&&(o.createInvertedIndices=!0)),o.otherDims.itemName!=null&&(r=!0)}),!r&&i!=null&&(n[i].otherDims.itemName=0),i}function cp(n,e,t){t=t||{};var i=e.getSourceManager(),r,o=!1;r=i.getSource(),o=r.sourceFormat===Zt;var a=zR(e),s=FR(e,a),l=t.useEncodeDefaulter,u=ce(l)?l:l?we(rR,s,e):null,c={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o},h=s1(r,c),d=GR(h.dimensions,t.createInvertedIndices,a),f=o?null:i.getSharedDataStore(h),p=VR(e,{schema:h,store:f}),g=new jr(h,e);g.setCalculationInfo(p);var m=d!=null&&WR(r)?function(y,v,_,b){return b===d?_:this.defaultDimValueGetter(y,v,_,b)}:null;return g.hasItemOption=!1,g.initData(o?r:f,null,m),g}function WR(n){if(n.sourceFormat===Zt){var e=UR(n.data||[]);return!q(us(e))}}function UR(n){for(var e=0;e<n.length&&n[e]==null;)e++;return n[e]}var YR=Math.round(Math.random()*10);function Is(n){return[n||"",YR++].join("_")}function qR(n){var e={};n.registerSubTypeDefaulter=function(t,i){var r=On(t);e[r.main]=i},n.determineSubType=function(t,i){var r=i.type;if(!r){var o=On(t).main;n.hasSubTypes(t)&&e[o]&&(r=e[o](i))}return r}}function jR(n,e){n.topologicalTravel=function(o,a,s,l){if(!o.length)return;var u=t(a),c=u.graph,h=u.noEntryList,d={};for(N(o,function(v){d[v]=!0});h.length;){var f=h.pop(),p=c[f],g=!!d[f];g&&(s.call(l,f,p.originalDeps.slice()),delete d[f]),N(p.successor,g?y:m)}N(d,function(){var v="";throw process.env.NODE_ENV!=="production"&&(v=Tu("Circular dependency may exists: ",d,o,a)),new Error(v)});function m(v){c[v].entryCount--,c[v].entryCount===0&&h.push(v)}function y(v){d[v]=!0,m(v)}};function t(o){var a={},s=[];return N(o,function(l){var u=i(a,l),c=u.originalDeps=e(l),h=r(c,o);u.entryCount=h.length,u.entryCount===0&&s.push(l),N(h,function(d){be(u.predecessor,d)<0&&u.predecessor.push(d);var f=i(a,d);be(f.successor,d)<0&&f.successor.push(l)})}),{graph:a,noEntryList:s}}function i(o,a){return o[a]||(o[a]={predecessor:[],successor:[]}),o[a]}function r(o,a){var s=[];return N(o,function(l){be(a,l)>=0&&s.push(l)}),s}}function u1(n,e){return _e(_e({},n,!0),e,!0)}var $R=Math.log(2);function hp(n,e,t,i,r,o){var a=i+"-"+r,s=n.length;if(o.hasOwnProperty(a))return o[a];if(e===1){var l=Math.round(Math.log((1<<s)-1&~r)/$R);return n[t][l]}for(var u=i|1<<t,c=t+1;i&1<<c;)c++;for(var h=0,d=0,f=0;d<s;d++){var p=1<<d;p&r||(h+=(f%2?-1:1)*n[t][d]*hp(n,e-1,c,u,r|p,o),f++)}return o[a]=h,h}function c1(n,e){var t=[[n[0],n[1],1,0,0,0,-e[0]*n[0],-e[0]*n[1]],[0,0,0,n[0],n[1],1,-e[1]*n[0],-e[1]*n[1]],[n[2],n[3],1,0,0,0,-e[2]*n[2],-e[2]*n[3]],[0,0,0,n[2],n[3],1,-e[3]*n[2],-e[3]*n[3]],[n[4],n[5],1,0,0,0,-e[4]*n[4],-e[4]*n[5]],[0,0,0,n[4],n[5],1,-e[5]*n[4],-e[5]*n[5]],[n[6],n[7],1,0,0,0,-e[6]*n[6],-e[6]*n[7]],[0,0,0,n[6],n[7],1,-e[7]*n[6],-e[7]*n[7]]],i={},r=hp(t,8,0,0,0,i);if(r!==0){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)o[s]==null&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*hp(t,7,a===0?1:0,1<<a,1<<s,i)/r*e[a];return function(l,u,c){var h=u*o[6]+c*o[7]+1;l[0]=(u*o[0]+c*o[1]+o[2])/h,l[1]=(u*o[3]+c*o[4]+o[5])/h}}}var tc="___zrEVENTSAVED",dp=[];function ZR(n,e,t,i,r){return fp(dp,e,i,r,!0)&&fp(n,t,dp[0],dp[1])}function XR(n,e){n&&t(n),e&&t(e);function t(i){var r=i[tc];r&&(r.clearMarkers&&r.clearMarkers(),delete i[tc])}}function fp(n,e,t,i,r){if(e.getBoundingClientRect&&fe.domSupported&&!h1(e)){var o=e[tc]||(e[tc]={}),a=KR(e,o),s=QR(a,o,r);if(s)return s(n,t,i),!0}return!1}function KR(n,e){var t=e.markers;if(t)return t;t=e.markers=[];for(var i=["left","right"],r=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=a.style,l=o%2,u=(o>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),n.appendChild(a),t.push(a)}return e.clearMarkers=function(){N(t,function(c){c.parentNode&&c.parentNode.removeChild(c)})},t}function QR(n,e,t){for(var i=t?"invTrans":"trans",r=e[i],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var c=n[u].getBoundingClientRect(),h=2*u,d=c.left,f=c.top;a.push(d,f),l=l&&o&&d===o[h]&&f===o[h+1],s.push(n[u].offsetLeft,n[u].offsetTop)}return l&&r?r:(e.srcCoords=a,e[i]=t?c1(s,a):c1(a,s))}function h1(n){return n.nodeName.toUpperCase()==="CANVAS"}var JR=/([&<>"'])/g,eL={"&":"&","<":"<",">":">",'"':""","'":"'"};function Dt(n){return n==null?"":(n+"").replace(JR,function(e,t){return eL[t]})}const tL={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:". "}}}},nL={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",pp="EN",ta=pp,ic={},gp={},d1=fe.domSupported?function(){var n=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ta).toUpperCase();return n.indexOf(nc)>-1?nc:ta}():ta;function f1(n,e){n=n.toUpperCase(),gp[n]=new Ge(e),ic[n]=e}function iL(n){if(Q(n)){var e=ic[n.toUpperCase()]||{};return n===nc||n===pp?ue(e):_e(ue(e),ue(ic[ta]),!1)}else return _e(ue(n),ue(ic[ta]),!1)}function rL(n){return gp[n]}function oL(){return gp[ta]}f1(pp,tL),f1(nc,nL);var aL=null;function mp(){return aL}var yp=1e3,vp=yp*60,Es=vp*60,sn=Es*24,p1=sn*365,sL={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},rc={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},lL="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",oc="{yyyy}-{MM}-{dd}",g1={year:"{yyyy}",month:"{yyyy}-{MM}",day:oc,hour:oc+" "+rc.hour,minute:oc+" "+rc.minute,second:oc+" "+rc.second,millisecond:lL},Zr=["year","month","day","hour","minute","second","millisecond"],uL=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function cL(n){return!Q(n)&&!ce(n)?hL(n):n}function hL(n){n=n||{};var e={},t=!0;return N(Zr,function(i){t&&(t=n[i]==null)}),N(Zr,function(i,r){var o=n[i];e[i]={};for(var a=null,s=r;s>=0;s--){var l=Zr[s],u=ne(o)&&!q(o)?o[l]:o,c=void 0;q(u)?(c=u.slice(),a=c[0]||""):Q(u)?(a=u,c=[a]):(a==null?a=rc[i]:sL[l].test(a)||(a=e[l][l][0]+" "+a),c=[a],t&&(c[1]="{primary|"+a+"}")),e[i][l]=c}}),e}function $i(n,e){return n+="","0000".substr(0,e-n.length)+n}function Ns(n){switch(n){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return n}}function dL(n){return n===Ns(n)}function fL(n){switch(n){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function ac(n,e,t,i){var r=Ho(n),o=r[m1(t)](),a=r[xp(t)]()+1,s=Math.floor((a-1)/3)+1,l=r[bp(t)](),u=r["get"+(t?"UTC":"")+"Day"](),c=r[wp(t)](),h=(c-1)%12+1,d=r[Sp(t)](),f=r[Tp(t)](),p=r[Mp(t)](),g=c>=12?"pm":"am",m=g.toUpperCase(),y=i instanceof Ge?i:rL(i||d1)||oL(),v=y.getModel("time"),_=v.get("month"),b=v.get("monthAbbr"),T=v.get("dayOfWeek"),w=v.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,$i(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[a-1]).replace(/{MMM}/g,b[a-1]).replace(/{MM}/g,$i(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,$i(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,w[u]).replace(/{e}/g,u+"").replace(/{HH}/g,$i(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,$i(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,$i(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,$i(f,2)).replace(/{s}/g,f+"").replace(/{SSS}/g,$i(p,3)).replace(/{S}/g,p+"")}function pL(n,e,t,i,r){var o=null;if(Q(t))o=t;else if(ce(t)){var a={time:n.time,level:n.time.level},s=mp();s&&s.makeAxisLabelFormatterParamBreak(a,n.break),o=t(n.value,e,a)}else{var l=n.time;if(l){var u=t[l.lowerTimeUnit][l.upperTimeUnit];o=u[Math.min(l.level,u.length-1)]||""}else{var c=sc(n.value,r);o=t[c][c][0]}}return ac(new Date(n.value),o,r,i)}function sc(n,e){var t=Ho(n),i=t[xp(e)]()+1,r=t[bp(e)](),o=t[wp(e)](),a=t[Sp(e)](),s=t[Tp(e)](),l=t[Mp(e)](),u=l===0,c=u&&s===0,h=c&&a===0,d=h&&o===0,f=d&&r===1,p=f&&i===1;return p?"year":f?"month":d?"day":h?"hour":c?"minute":u?"second":"millisecond"}function _p(n,e,t){switch(e){case"year":n[y1(t)](0);case"month":n[v1(t)](1);case"day":n[_1(t)](0);case"hour":n[x1(t)](0);case"minute":n[b1(t)](0);case"second":n[w1(t)](0)}return n}function m1(n){return n?"getUTCFullYear":"getFullYear"}function xp(n){return n?"getUTCMonth":"getMonth"}function bp(n){return n?"getUTCDate":"getDate"}function wp(n){return n?"getUTCHours":"getHours"}function Sp(n){return n?"getUTCMinutes":"getMinutes"}function Tp(n){return n?"getUTCSeconds":"getSeconds"}function Mp(n){return n?"getUTCMilliseconds":"getMilliseconds"}function gL(n){return n?"setUTCFullYear":"setFullYear"}function y1(n){return n?"setUTCMonth":"setMonth"}function v1(n){return n?"setUTCDate":"setDate"}function _1(n){return n?"setUTCHours":"setHours"}function x1(n){return n?"setUTCMinutes":"setMinutes"}function b1(n){return n?"setUTCSeconds":"setSeconds"}function w1(n){return n?"setUTCMilliseconds":"setMilliseconds"}function S1(n){if(!y_(n))return Q(n)?n:"-";var e=(n+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function T1(n,e){return n=(n||"").toLowerCase().replace(/-(.)/g,function(t,i){return i.toUpperCase()}),e&&n&&(n=n.charAt(0).toUpperCase()+n.slice(1)),n}var lc=ld;function Cp(n,e,t){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function r(c){return c&&An(c)?c:"-"}function o(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var a=e==="time",s=n instanceof Date;if(a||s){var l=a?Ho(n):n;if(isNaN(+l)){if(s)return"-"}else return ac(l,i,t)}if(e==="ordinal")return Vl(n)?r(n):Ne(n)&&o(n)?n+"":"-";var u=wu(n);return o(u)?S1(u):Vl(n)?r(n):typeof n=="boolean"?n+"":"-"}var M1=["a","b","c","d","e","f","g"],kp=function(n,e){return"{"+n+(e??"")+"}"};function C1(n,e,t){q(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o<r.length;o++){var a=M1[o];n=n.replace(kp(a),kp(a,0))}for(var s=0;s<i;s++)for(var l=0;l<r.length;l++){var u=e[s][r[l]];n=n.replace(kp(M1[l],s),t?Dt(u):u)}return n}function mL(n,e){var t=Q(n)?{color:n,extraCssText:e}:n||{},i=t.color,r=t.type;e=t.extraCssText;var o=t.renderMode||"html";if(!i)return"";if(o==="html")return r==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Dt(i)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Dt(i)+";"+(e||"")+'"></span>';var a=t.markerId||"markerX";return{renderMode:o,content:"{"+a+"|} ",style:r==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function Xr(n,e){return e=e||"transparent",Q(n)?n:ne(n)&&n.colorStops&&(n.colorStops[0]||{}).color||e}function k1(n,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=n}else window.open(n,e)}var uc=N,yL=["left","right","top","bottom","width","height"],cc=[["width","left","right"],["height","top","bottom"]];function Dp(n,e,t,i,r){var o=0,a=0;i==null&&(i=1/0),r==null&&(r=1/0);var s=0;e.eachChild(function(l,u){var c=l.getBoundingRect(),h=e.childAt(u+1),d=h&&h.getBoundingRect(),f,p;if(n==="horizontal"){var g=c.width+(d?-d.x+c.x:0);f=o+g,f>i||l.newline?(o=0,f=g,a+=s+t,s=c.height):s=Math.max(s,c.height)}else{var m=c.height+(d?-d.y+c.y:0);p=a+m,p>r||l.newline?(o+=s+t,a=0,p=m,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),n==="horizontal"?o=f+t:a=p+t)})}var na=Dp;we(Dp,"vertical"),we(Dp,"horizontal");function vL(n,e){return{left:n.getShallow("left",e),top:n.getShallow("top",e),right:n.getShallow("right",e),bottom:n.getShallow("bottom",e),width:n.getShallow("width",e),height:n.getShallow("height",e)}}function _L(n,e){var t=Os(n,e,{enableLayoutOnlyByCenter:!0}),i=n.getBoxLayoutParams(),r,o;if(t.type===As.point)o=t.refPoint,r=jn(i,{width:e.getWidth(),height:e.getHeight()});else{var a=n.get("center"),s=q(a)?a:[a,a];r=jn(i,t.refContainer),o=t.boxCoordFrom===lp.coord2?t.refPoint:[Pe(s[0],r.width)+r.x,Pe(s[1],r.height)+r.y]}return{viewRect:r,center:o}}function xL(n,e){var t=_L(n,e),i=t.viewRect,r=t.center,o=n.get("radius");q(o)||(o=[0,o]);var a=Pe(i.width,e.getWidth()),s=Pe(i.height,e.getHeight()),l=Math.min(a,s),u=Pe(o[0],l/2),c=Pe(o[1],l/2);return{cx:r[0],cy:r[1],r0:u,r:c,viewRect:i}}function jn(n,e,t){t=lc(t||0);var i=e.width,r=e.height,o=Pe(n.left,i),a=Pe(n.top,r),s=Pe(n.right,i),l=Pe(n.bottom,r),u=Pe(n.width,i),c=Pe(n.height,r),h=t[2]+t[0],d=t[1]+t[3],f=n.aspect;switch(isNaN(u)&&(u=i-s-d-o),isNaN(c)&&(c=r-l-h-a),f!=null&&(isNaN(u)&&isNaN(c)&&(f>i/r?u=i*.8:c=r*.8),isNaN(u)&&(u=f*c),isNaN(c)&&(c=u/f)),isNaN(o)&&(o=i-s-u-d),isNaN(a)&&(a=r-l-c-h),n.left||n.right){case"center":o=i/2-u/2-t[3];break;case"right":o=i-u-d;break}switch(n.top||n.bottom){case"middle":case"center":a=r/2-c/2-t[0];break;case"bottom":a=r-c-h;break}o=o||0,a=a||0,isNaN(u)&&(u=i-d-o-(s||0)),isNaN(c)&&(c=r-h-a-(l||0));var p=new ve((e.x||0)+o+t[3],(e.y||0)+a+t[0],u,c);return p.margin=t,p}var As={rect:1,point:2};function Os(n,e,t){var i,r,o,a=n.boxCoordinateSystem,s;if(a){var l=OR(n),u=l.coord,c=l.from;if(a.dataToLayout){o=As.rect,s=c;var h=a.dataToLayout(u);i=h.contentRect||h.rect}else t&&t.enableLayoutOnlyByCenter&&a.dataToPoint?(o=As.point,s=c,r=a.dataToPoint(u)):process.env.NODE_ENV!=="production"&&ze(n.type+"["+n.componentIndex+"]"+(" layout based on "+a.type+" is not supported."))}return o==null&&(o=As.rect),o===As.rect&&(i||(i={x:0,y:0,width:e.getWidth(),height:e.getHeight()}),r=[i.x+i.width/2,i.y+i.height/2]),{type:o,refContainer:i,refPoint:r,boxCoordFrom:s}}function bL(n,e,t,i,r,o){o=o||n,o.x=n.x,o.y=n.y;var a;if(a=n.getBoundingRect(),n.needLocalTransform()){var s=n.getLocalTransform();a=a.clone(),a.applyTransform(s)}var l=jn(Me({width:a.width,height:a.height},e),t,i),u=l.x-a.x,c=l.y-a.y;return o.x+=u,o.y+=c,o===n&&n.markRedraw(),!0}function Rs(n){var e=n.layoutMode||n.constructor.layoutMode;return ne(e)?e:e?{type:e}:null}function Zi(n,e,t){var i=t&&t.ignoreSize;!q(i)&&(i=[i,i]);var r=a(cc[0],0),o=a(cc[1],1);l(cc[0],n,r),l(cc[1],n,o);function a(u,c){var h={},d=0,f={},p=0,g=2;if(uc(u,function(v){f[v]=n[v]}),uc(u,function(v){_n(e,v)&&(h[v]=f[v]=e[v]),s(h,v)&&d++,s(f,v)&&p++}),i[c])return s(e,u[1])?f[u[2]]=null:s(e,u[2])&&(f[u[1]]=null),f;if(p===g||!d)return f;if(d>=g)return h;for(var m=0;m<u.length;m++){var y=u[m];if(!_n(h,y)&&_n(n,y)){h[y]=n[y];break}}return h}function s(u,c){return u[c]!=null&&u[c]!=="auto"}function l(u,c,h){uc(u,function(d){c[d]=h[d]})}}function Ls(n){return wL({},n)}function wL(n,e){return e&&n&&uc(yL,function(t){_n(e,t)&&(n[t]=e[t])}),n}var SL=Re(),De=function(n){W(e,n);function e(t,i,r){var o=n.call(this,t,i,r)||this;return o.uid=Is("ec_cpt_model"),o}return e.prototype.init=function(t,i,r){this.mergeDefaultAndTheme(t,r)},e.prototype.mergeDefaultAndTheme=function(t,i){var r=Rs(this),o=r?Ls(t):{},a=i.getTheme();_e(t,a.get(this.mainType)),_e(t,this.getDefaultOption()),r&&Zi(t,o,r)},e.prototype.mergeOption=function(t,i){_e(this.option,t,!0);var r=Rs(this);r&&Zi(this.option,t,r)},e.prototype.optionUpdated=function(t,i){},e.prototype.getDefaultOption=function(){var t=this.constructor;if(!P2(t))return t.defaultOption;var i=SL(this);if(!i.defaultOption){for(var r=[],o=t;o;){var a=o.prototype.defaultOption;a&&r.push(a),o=o.superClass}for(var s={},l=r.length-1;l>=0;l--)s=_e(s,r[l],!0);i.defaultOption=s}return i.defaultOption},e.prototype.getReferringComponents=function(t,i){var r=t+"Index",o=t+"Id";return ds(this.ecModel,t,{index:this.get(r,!0),id:this.get(o,!0)},i)},e.prototype.getBoxLayoutParams=function(){return vL(this,!1)},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(Ge);e0(De,Ge),Wl(De),qR(De),jR(De,TL);function TL(n){var e=[];return N(De.getClassesByMainType(n),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=$(e,function(t){return On(t).main}),n!=="dataset"&&be(e,"dataset")<=0&&e.unshift("dataset"),e}var D1=Re();Re();var Ip=function(){function n(){}return n.prototype.getColorFromPalette=function(e,t,i){var r=_t(this.get("color",!0)),o=this.get("colorLayer",!0);return CL(this,D1,r,o,e,t,i)},n.prototype.clearColorPalette=function(){kL(this,D1)},n}();function ML(n,e){for(var t=n.length,i=0;i<t;i++)if(n[i].length>e)return n[i];return n[t-1]}function CL(n,e,t,i,r,o,a){o=o||n;var s=e(o),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(r))return u[r];var c=a==null||!i?t:ML(i,a);if(c=c||t,!(!c||!c.length)){var h=c[l];return r&&(u[r]=h),s.paletteIdx=(l+1)%c.length,h}}function kL(n,e){e(n).paletteIdx=0,e(n).paletteNameMap={}}var DL=/\{@(.+?)\}/g,Ep=function(){function n(){}return n.prototype.getDataParams=function(e,t){var i=this.getData(t),r=this.getRawValue(e,t),o=i.getRawIndex(e),a=i.getName(e),s=i.getRawDataItem(e),l=i.getItemVisual(e,"style"),u=l&&l[i.getItemVisual(e,"drawType")||"fill"],c=l&&l.stroke,h=this.mainType,d=h==="series",f=i.userOutput&&i.userOutput.get();return{componentType:h,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:a,dataIndex:o,data:s,dataType:t,value:r,color:u,borderColor:c,dimensionNames:f?f.fullDimensions:null,encode:f?f.encode:null,$vars:["seriesName","name","value"]}},n.prototype.getFormattedLabel=function(e,t,i,r,o,a){t=t||"normal";var s=this.getData(i),l=this.getDataParams(e,i);if(a&&(l.value=a.interpolatedValue),r!=null&&q(l.value)&&(l.value=l.value[r]),!o){var u=s.getItemModel(e);o=u.get(t==="normal"?["label","formatter"]:[t,"label","formatter"])}if(ce(o))return l.status=t,l.dimensionIndex=r,o(l);if(Q(o)){var c=C1(o,l);return c.replace(DL,function(h,d){var f=d.length,p=d;p.charAt(0)==="["&&p.charAt(f-1)==="]"&&(p=+p.slice(1,f-1),process.env.NODE_ENV!=="production"&&isNaN(p)&&ze("Invalide label formatter: @"+d+", only support @[0], @[1], @[2], ..."));var g=Xo(s,e,p);if(a&&q(a.interpolatedValue)){var m=s.getDimensionIndex(p);m>=0&&(g=a.interpolatedValue[m])}return g!=null?g+"":""})}},n.prototype.getRawValue=function(e,t){return Xo(this.getData(t),e)},n.prototype.formatTooltip=function(e,t,i){},n}();function I1(n){var e,t;return ne(n)?n.type?t=n:process.env.NODE_ENV!=="production"&&console.warn("The return type of `formatTooltip` is not supported: "+Tu(n)):e=n,{text:e,frag:t}}function Ps(n){return new IL(n)}var IL=function(){function n(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return n.prototype.perform=function(e){var t=this._upstream,i=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var o;this._plan&&!i&&(o=this._plan(this.context));var a=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;(a!==l||s!==u)&&(o="reset");function c(v){return!(v>=1)&&(v=1),v}var h;(this._dirty||o==="reset")&&(this._dirty=!1,h=this._doReset(i)),this._modBy=l,this._modDataCount=u;var d=e&&e.step;if(t?(process.env.NODE_ENV!=="production"&&J(t._outputDueEnd!=null),this._dueEnd=t._outputDueEnd):(process.env.NODE_ENV!=="production"&&J(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var f=this._dueIndex,p=Math.min(d!=null?this._dueIndex+d:1/0,this._dueEnd);if(!i&&(h||f<p)){var g=this._progress;if(q(g))for(var m=0;m<g.length;m++)this._doProgress(g[m],f,p,l,u);else this._doProgress(g,f,p,l,u)}this._dueIndex=p;var y=this._settedOutputEnd!=null?this._settedOutputEnd:p;process.env.NODE_ENV!=="production"&&J(y>=this._outputDueEnd),this._outputDueEnd=y}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},n.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},n.prototype._doProgress=function(e,t,i,r,o){E1.reset(t,i,r,o),this._callingProgress=e,this._callingProgress({start:t,end:i,count:i-t,next:E1.next},this.context)},n.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var t,i;!e&&this._reset&&(t=this._reset(this.context),t&&t.progress&&(i=t.forceFirstProgress,t=t.progress),q(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var r=this._downstream;return r&&r.dirty(),i},n.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},n.prototype.pipe=function(e){process.env.NODE_ENV!=="production"&&J(e&&!e._disposed&&e!==this),(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},n.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},n.prototype.getUpstream=function(){return this._upstream},n.prototype.getDownstream=function(){return this._downstream},n.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},n}(),E1=function(){var n,e,t,i,r,o={reset:function(l,u,c,h){e=l,n=u,t=c,i=h,r=Math.ceil(i/t),o.next=t>1&&i>0?s:a}};return o;function a(){return e<n?e++:null}function s(){var l=e%r*t+Math.ceil(e/r),u=e>=n?null:l<i?l:e;return e++,u}}(),EL=function(){function n(){}return n.prototype.getRawData=function(){throw new Error("not supported")},n.prototype.getRawDataItem=function(e){throw new Error("not supported")},n.prototype.cloneRawData=function(){},n.prototype.getDimensionInfo=function(e){},n.prototype.cloneAllDimensionInfo=function(){},n.prototype.count=function(){},n.prototype.retrieveValue=function(e,t){},n.prototype.retrieveValueFromItem=function(e,t){},n.prototype.convertValue=function(e,t){return qi(e,t)},n}();function NL(n,e){var t=new EL,i=n.data,r=t.sourceFormat=n.sourceFormat,o=n.startIndex,a="";n.seriesLayoutBy!==qn&&(process.env.NODE_ENV!=="production"&&(a='`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'),Lt(a));var s=[],l={},u=n.dimensionsDefine;if(u)N(u,function(g,m){var y=g.name,v={index:m,name:y,displayName:g.displayName};if(s.push(v),y!=null){var _="";_n(l,y)&&(process.env.NODE_ENV!=="production"&&(_='dimension name "'+y+'" duplicated.'),Lt(_)),l[y]=v}});else for(var c=0;c<n.dimensionsDetectedCount;c++)s.push({index:c});var h=qx(r,qn);e.__isBuiltIn&&(t.getRawDataItem=function(g){return h(i,o,s,g)},t.getRawData=ke(AL,null,n)),t.cloneRawData=ke(OL,null,n);var d=$x(r,qn);t.count=ke(d,null,i,o,s);var f=Zx(r);t.retrieveValue=function(g,m){var y=h(i,o,s,g);return p(y,m)};var p=t.retrieveValueFromItem=function(g,m){if(g!=null){var y=s[m];if(y)return f(g,m,y.name)}};return t.getDimensionInfo=ke(RL,null,s,l),t.cloneAllDimensionInfo=ke(LL,null,s),t}function AL(n){var e=n.sourceFormat;if(!Np(e)){var t="";process.env.NODE_ENV!=="production"&&(t="`getRawData` is not supported in source format "+e),Lt(t)}return n.data}function OL(n){var e=n.sourceFormat,t=n.data;if(!Np(e)){var i="";process.env.NODE_ENV!=="production"&&(i="`cloneRawData` is not supported in source format "+e),Lt(i)}if(e===wt){for(var r=[],o=0,a=t.length;o<a;o++)r.push(t[o].slice());return r}else if(e===an){for(var r=[],o=0,a=t.length;o<a;o++)r.push(U({},t[o]));return r}}function RL(n,e,t){if(t!=null){if(Ne(t)||!isNaN(t)&&!_n(e,t))return n[t];if(_n(e,t))return e[t]}}function LL(n){return ue(n)}var N1=me();function PL(n){n=ue(n);var e=n.type,t="";e||(process.env.NODE_ENV!=="production"&&(t="Must have a `type` when `registerTransform`."),Lt(t));var i=e.split(":");i.length!==2&&(process.env.NODE_ENV!=="production"&&(t='Name must include namespace like "ns:regression".'),Lt(t));var r=!1;i[0]==="echarts"&&(e=i[1],r=!0),n.__isBuiltIn=r,N1.set(e,n)}function zL(n,e,t){var i=_t(n),r=i.length,o="";r||(process.env.NODE_ENV!=="production"&&(o="If `transform` declared, it should at least contain one transform."),Lt(o));for(var a=0,s=r;a<s;a++){var l=i[a];e=BL(l,e,t,r===1?null:a),a!==s-1&&(e.length=Math.max(e.length,1))}return e}function BL(n,e,t,i){var r="";e.length||(process.env.NODE_ENV!=="production"&&(r="Must have at least one upstream dataset."),Lt(r)),ne(n)||(process.env.NODE_ENV!=="production"&&(r="transform declaration must be an object rather than "+typeof n+"."),Lt(r));var o=n.type,a=N1.get(o);a||(process.env.NODE_ENV!=="production"&&(r='Can not find transform on type "'+o+'".'),Lt(r));var s=$(e,function(c){return NL(c,a)}),l=_t(a.transform({upstream:s[0],upstreamList:s,config:ue(n.config)}));if(process.env.NODE_ENV!=="production"&&n.print){var u=$(l,function(c){var h=i!=null?" === pipe index: "+i:"";return["=== dataset index: "+t.datasetIndex+h+" ===","- transform result data:",Tu(c.data),"- transform result dimensions:",Tu(c.dimensions)].join(`
|
|
22
|
+
`)}).join(`
|
|
23
|
+
`);w_(u)}return $(l,function(c,h){var d="";ne(c)||(process.env.NODE_ENV!=="production"&&(d="A transform should not return some empty results."),Lt(d)),c.data||(process.env.NODE_ENV!=="production"&&(d="Transform result data should be not be null or undefined"),Lt(d));var f=Bx(c.data);Np(f)||(process.env.NODE_ENV!=="production"&&(d="Transform result data should be array rows or object rows."),Lt(d));var p,g=e[0];if(g&&h===0&&!c.dimensions){var m=g.startIndex;m&&(c.data=g.data.slice(0,m).concat(c.data)),p={seriesLayoutBy:qn,sourceHeader:m,dimensions:g.metaRawOption.dimensions}}else p={seriesLayoutBy:qn,sourceHeader:0,dimensions:c.dimensions};return Jf(c.data,p,null)})}function Np(n){return n===wt||n===an}var VL=function(){function n(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return n.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},n.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},n.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},n.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},n.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),i=!!t.length,r,o;if(zs(e)){var a=e,s=void 0,l=void 0,u=void 0;if(i){var c=t[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,o=[c._getVersionSign()]}else s=a.get("data",!0),l=Ct(s)?mi:Zt,o=[];var h=this._getSourceMetaRawOption()||{},d=u&&u.metaRawOption||{},f=te(h.seriesLayoutBy,d.seriesLayoutBy)||null,p=te(h.sourceHeader,d.sourceHeader),g=te(h.dimensions,d.dimensions),m=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||g;r=m?[Jf(s,{seriesLayoutBy:f,sourceHeader:p,dimensions:g},l)]:[]}else{var y=e;if(i){var v=this._applyTransform(t);r=v.sourceList,o=v.upstreamSignList}else{var _=y.get("source",!0);r=[Jf(_,this._getSourceMetaRawOption(),null)],o=[]}}process.env.NODE_ENV!=="production"&&J(r&&o),this._setLocalSource(r,o)},n.prototype._applyTransform=function(e){var t=this._sourceHost,i=t.get("transform",!0),r=t.get("fromTransformResult",!0);if(process.env.NODE_ENV!=="production"&&J(r!=null||i!=null),r!=null){var o="";e.length!==1&&(process.env.NODE_ENV!=="production"&&(o="When using `fromTransformResult`, there should be only one upstream dataset"),A1(o))}var a,s=[],l=[];return N(e,function(u){u.prepareSource();var c=u.getSource(r||0),h="";r!=null&&!c&&(process.env.NODE_ENV!=="production"&&(h="Can not retrieve result by `fromTransformResult`: "+r),A1(h)),s.push(c),l.push(u._getVersionSign())}),i?a=zL(i,s,{datasetIndex:t.componentIndex}):r!=null&&(a=[sR(s[0])]),{sourceList:a,upstreamSignList:l}},n.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var i=e[t];if(i._isDirty()||this._upstreamSignList[t]!==i._getVersionSign())return!0}},n.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var i=this._getUpstreamSourceManagers();return i[0]&&i[0].getSource(e)}return t},n.prototype.getSharedDataStore=function(e){process.env.NODE_ENV!=="production"&&J(zs(this._sourceHost),"Can only call getDataStore on series source manager.");var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},n.prototype._innerGetDataStore=function(e,t,i){var r=0,o=this._storeList,a=o[r];a||(a=o[r]={});var s=a[i];if(!s){var l=this._getUpstreamSourceManagers()[0];zs(this._sourceHost)&&l?s=l._innerGetDataStore(e,t,i):(s=new ip,s.initData(new Ux(t,e.length),e)),a[i]=s}return s},n.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(zs(e)){var t=Kf(e);return t?[t.getSourceManager()]:[]}else return $(aR(e),function(i){return i.getSourceManager()})},n.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,t,i,r;if(zs(e))t=e.get("seriesLayoutBy",!0),i=e.get("sourceHeader",!0),r=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var o=e;t=o.get("seriesLayoutBy",!0),i=o.get("sourceHeader",!0),r=o.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:i,dimensions:r}},n}();function zs(n){return n.mainType==="series"}function A1(n){throw new Error(n)}var Z={color:{},darkColor:{},size:{}},Ze=Z.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};U(Ze,{primary:Ze.neutral80,secondary:Ze.neutral70,tertiary:Ze.neutral60,quaternary:Ze.neutral50,disabled:Ze.neutral20,border:Ze.neutral30,borderTint:Ze.neutral20,borderShade:Ze.neutral40,background:Ze.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:Ze.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:Ze.neutral70,axisLineTint:Ze.neutral40,axisTick:Ze.neutral70,axisTickMinor:Ze.neutral60,axisLabel:Ze.neutral70,axisSplitLine:Ze.neutral15,axisMinorSplitLine:Ze.neutral05});for(var Kr in Ze)if(Ze.hasOwnProperty(Kr)){var O1=Ze[Kr];Kr==="theme"?Z.darkColor.theme=Ze.theme.slice():Kr==="highlight"?Z.darkColor.highlight="rgba(255,231,130,0.4)":Kr.indexOf("accent")===0?Z.darkColor[Kr]=Lo(O1,null,function(n){return n*.5},function(n){return Math.min(1,1.3-n)}):Z.darkColor[Kr]=Lo(O1,null,function(n){return n*.9},function(n){return 1-Math.pow(n,1.5)})}Z.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var HL="line-height:1";function R1(n){var e=n.lineHeight;return e==null?HL:"line-height:"+Dt(e+"")+"px"}function L1(n,e){var t=n.color||Z.color.tertiary,i=n.fontSize||12,r=n.fontWeight||"400",o=n.color||Z.color.secondary,a=n.fontSize||14,s=n.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+Dt(i+"")+"px;color:"+Dt(t)+";font-weight:"+Dt(r+""),valueStyle:"font-size:"+Dt(a+"")+"px;color:"+Dt(o)+";font-weight:"+Dt(s+"")}:{nameStyle:{fontSize:i,fill:t,fontWeight:r},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var FL=[0,10,20,30],GL=["",`
|
|
24
|
+
`,`
|
|
25
|
+
|
|
26
|
+
`,`
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
`];function Qr(n,e){return e.type=n,e}function Ap(n){return n.type==="section"}function P1(n){return Ap(n)?WL:UL}function z1(n){if(Ap(n)){var e=0,t=n.blocks.length,i=t>1||t>0&&!n.noHeader;return N(n.blocks,function(r){var o=z1(r);o>=e&&(e=o+ +(i&&(!o||Ap(r)&&!r.noHeader)))}),e}return 0}function WL(n,e,t,i){var r=e.noHeader,o=YL(z1(e)),a=[],s=e.blocks||[];J(!s||q(s)),s=s||[];var l=n.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(_n(u,l)){var c=new vR(u[l],null);s.sort(function(g,m){return c.evaluate(g.sortParam,m.sortParam)})}else l==="seriesDesc"&&s.reverse()}N(s,function(g,m){var y=e.valueFormatter,v=P1(g)(y?U(U({},n),{valueFormatter:y}):n,g,m>0?o.html:0,i);v!=null&&a.push(v)});var h=n.renderMode==="richText"?a.join(o.richText):Op(i,a.join(""),r?t:o.html);if(r)return h;var d=Cp(e.header,"ordinal",n.useUTC),f=L1(i,n.renderMode).nameStyle,p=R1(i);return n.renderMode==="richText"?V1(n,d,f)+o.richText+h:Op(i,'<div style="'+f+";"+p+';">'+Dt(d)+"</div>"+h,t)}function UL(n,e,t,i){var r=n.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=n.useUTC,c=e.valueFormatter||n.valueFormatter||function(b){return b=q(b)?b:[b],$(b,function(T,w){return Cp(T,q(f)?f[w]:f,u)})};if(!(o&&a)){var h=s?"":n.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||Z.color.secondary,r),d=o?"":Cp(l,"ordinal",u),f=e.valueType,p=a?[]:c(e.value,e.dataIndex),g=!s||!o,m=!s&&o,y=L1(i,r),v=y.nameStyle,_=y.valueStyle;return r==="richText"?(s?"":h)+(o?"":V1(n,d,v))+(a?"":$L(n,p,g,m,_)):Op(i,(s?"":h)+(o?"":qL(d,!s,v))+(a?"":jL(p,g,m,_)),t)}}function B1(n,e,t,i,r,o){if(n){var a=P1(n),s={useUTC:r,renderMode:t,orderMode:i,markupStyleCreator:e,valueFormatter:n.valueFormatter};return a(s,n,0,o)}}function YL(n){return{html:FL[n],richText:GL[n]}}function Op(n,e,t){var i='<div style="clear:both"></div>',r="margin: "+t+"px 0 0",o=R1(n);return'<div style="'+r+";"+o+';">'+e+i+"</div>"}function qL(n,e,t){var i=e?"margin-left:2px":"";return'<span style="'+t+";"+i+'">'+Dt(n)+"</span>"}function jL(n,e,t,i){var r=t?"10px":"20px",o=e?"float:right;margin-left:"+r:"";return n=q(n)?n:[n],'<span style="'+o+";"+i+'">'+$(n,function(a){return Dt(a)}).join(" ")+"</span>"}function V1(n,e,t){return n.markupStyleCreator.wrapRichTextStyle(e,t)}function $L(n,e,t,i,r){var o=[r],a=i?10:20;return t&&o.push({padding:[0,0,0,a],align:"right"}),n.markupStyleCreator.wrapRichTextStyle(q(e)?e.join(" "):e,o)}function ZL(n,e){var t=n.getData().getItemVisual(e,"style"),i=t[n.visualDrawType];return Xr(i)}function H1(n,e){var t=n.get("padding");return t??(e==="richText"?[8,10]:10)}var Rp=function(){function n(){this.richTextStyles={},this._nextStyleNameId=v_()}return n.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},n.prototype.makeTooltipMarker=function(e,t,i){var r=i==="richText"?this._generateStyleName():null,o=mL({color:t,type:e,renderMode:i,markerId:r});return Q(o)?o:(process.env.NODE_ENV!=="production"&&J(r),this.richTextStyles[r]=o.style,o.content)},n.prototype.wrapRichTextStyle=function(e,t){var i={};q(t)?N(t,function(o){return U(i,o)}):U(i,t);var r=this._generateStyleName();return this.richTextStyles[r]=i,"{"+r+"|"+e+"}"},n}();function XL(n){var e=n.series,t=n.dataIndex,i=n.multipleSeries,r=e.getData(),o=r.mapDimensionsAll("defaultedTooltip"),a=o.length,s=e.getRawValue(t),l=q(s),u=ZL(e,t),c,h,d,f;if(a>1||l&&!a){var p=KL(s,e,t,o,u);c=p.inlineValues,h=p.inlineValueTypes,d=p.blocks,f=p.inlineValues[0]}else if(a){var g=r.getDimensionInfo(o[0]);f=c=Xo(r,t,o[0]),h=g.type}else f=c=l?s[0]:s;var m=mf(e),y=m&&e.name||"",v=r.getName(t),_=i?y:v;return Qr("section",{header:y,noHeader:i||!m,sortParam:f,blocks:[Qr("nameValue",{markerType:"item",markerColor:u,name:_,noName:!An(_),value:c,valueType:h,dataIndex:t})].concat(d||[])})}function KL(n,e,t,i,r){var o=e.getData(),a=Ai(n,function(h,d,f){var p=o.getDimensionInfo(f);return h=h||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],u=[];i.length?N(i,function(h){c(Xo(o,t,h),h)}):N(n,c);function c(h,d){var f=o.getDimensionInfo(d);!f||f.otherDims.tooltip===!1||(a?u.push(Qr("nameValue",{markerType:"subItem",markerColor:r,name:f.displayName,value:h,valueType:f.type})):(s.push(h),l.push(f.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Xi=Re();function hc(n,e){return n.getName(e)||n.getId(e)}var QL="__universalTransitionEnabled",Mn=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,i,r){this.seriesIndex=this.componentIndex,this.dataTask=Ps({count:eP,reset:tP}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,r);var o=Xi(this).sourceManager=new VL(this);o.prepareSource();var a=this.getInitialData(t,r);G1(a,this),this.dataTask.context.data=a,process.env.NODE_ENV!=="production"&&J(a,"getInitialData returned invalid data."),Xi(this).dataBeforeProcessed=a,F1(this),this._initSelectedMapFromData(a)},e.prototype.mergeDefaultAndTheme=function(t,i){var r=Rs(this),o=r?Ls(t):{},a=this.subType;De.hasClass(a)&&(a+="Series"),_e(t,i.getTheme().get(this.subType)),_e(t,this.getDefaultOption()),Mu(t,"label",["show"]),this.fillDataTextStyle(t.data),r&&Zi(t,o,r)},e.prototype.mergeOption=function(t,i){t=_e(this.option,t,!0),this.fillDataTextStyle(t.data);var r=Rs(this);r&&Zi(this.option,t,r);var o=Xi(this).sourceManager;o.dirty(),o.prepareSource();var a=this.getInitialData(t,i);G1(a,this),this.dataTask.dirty(),this.dataTask.context.data=a,Xi(this).dataBeforeProcessed=a,F1(this),this._initSelectedMapFromData(a)},e.prototype.fillDataTextStyle=function(t){if(t&&!Ct(t))for(var i=["show"],r=0;r<t.length;r++)t[r]&&t[r].label&&Mu(t[r],"label",i)},e.prototype.getInitialData=function(t,i){},e.prototype.appendData=function(t){var i=this.getRawData();i.appendData(t.data)},e.prototype.getData=function(t){var i=Lp(this);if(i){var r=i.context.data;return t==null||!r.getLinkedData?r:r.getLinkedData(t)}else return Xi(this).data},e.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},e.prototype.setData=function(t){var i=Lp(this);if(i){var r=i.context;r.outputData=t,i!==this.dataTask&&(r.data=t)}Xi(this).data=t},e.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return me(t)},e.prototype.getSourceManager=function(){return Xi(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return Xi(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var t=this.get("colorBy");return t||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},e.prototype.indicesOfNearest=function(t,i,r,o){var a=this.getData(),s=this.coordinateSystem,l=s&&s.getAxis(t);if(!s||!l)return[];var u=l.dataToCoord(r);o==null&&(o=1/0);var c=[],h=1/0,d=-1,f=0;return a.each(i,function(p,g){var m=l.dataToCoord(p),y=u-m,v=Math.abs(y);v<=o&&((v<h||v===h&&y>=0&&d<0)&&(h=v,d=y,f=0),y===d&&(c[f++]=g))}),c.length=f,c},e.prototype.formatTooltip=function(t,i,r){return XL({series:this,dataIndex:t,multipleSeries:i})},e.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(fe.node&&!(t&&t.ssr))return!1;var i=this.getShallow("animation");return i&&this.getData().count()>this.getShallow("animationThreshold")&&(i=!1),!!i},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,i,r){var o=this.ecModel,a=Ip.prototype.getColorFromPalette.call(this,t,i,r);return a||(a=o.getColorFromPalette(t,i,r)),a},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,i){this._innerSelect(this.getData(i),t)},e.prototype.unselect=function(t,i){var r=this.option.selectedMap;if(r){var o=this.option.selectedMode,a=this.getData(i);if(o==="series"||r==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<t.length;s++){var l=t[s],u=hc(a,l);r[u]=!1,this._selectedDataIndicesMap[u]=-1}}},e.prototype.toggleSelect=function(t,i){for(var r=[],o=0;o<t.length;o++)r[0]=t[o],this.isSelected(t[o],i)?this.unselect(r,i):this.select(r,i)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,i=Ce(t),r=[],o=0;o<i.length;o++){var a=t[i[o]];a>=0&&r.push(a)}return r},e.prototype.isSelected=function(t,i){var r=this.option.selectedMap;if(!r)return!1;var o=this.getData(i);return(r==="all"||r[hc(o,t)])&&!o.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[QL])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,i){var r,o,a=this.option,s=a.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")a.selectedMap="all";else if(s==="multiple"){ne(a.selectedMap)||(a.selectedMap={});for(var u=a.selectedMap,c=0;c<l;c++){var h=i[c],d=hc(t,h);u[d]=!0,this._selectedDataIndicesMap[d]=t.getRawIndex(h)}}else if(s==="single"||s===!0){var f=i[l-1],d=hc(t,f);a.selectedMap=(r={},r[d]=!0,r),this._selectedDataIndicesMap=(o={},o[d]=t.getRawIndex(f),o)}}},e.prototype._initSelectedMapFromData=function(t){if(!this.option.selectedMap){var i=[];t.hasItemOption&&t.each(function(r){var o=t.getRawDataItem(r);o&&o.selected&&i.push(r)}),i.length>0&&this._innerSelect(t,i)}},e.registerClass=function(t){return De.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(De);yn(Mn,Ep),yn(Mn,Ip),e0(Mn,De);function F1(n){var e=n.name;mf(n)||(n.name=JL(n)||e)}function JL(n){var e=n.getRawData(),t=e.mapDimensionsAll("seriesName"),i=[];return N(t,function(r){var o=e.getDimensionInfo(r);o.displayName&&i.push(o.displayName)}),i.join(" ")}function eP(n){return n.model.getRawData().count()}function tP(n){var e=n.model;return e.setData(e.getRawData().cloneShallow()),nP}function nP(n,e){e.outputData&&n.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function G1(n,e){N(E2(n.CHANGABLE_METHODS,n.DOWNSAMPLE_METHODS),function(t){n.wrapMethod(t,we(iP,e))})}function iP(n,e){var t=Lp(n);return t&&t.setOutputEnd((e||this).count()),e}function Lp(n){var e=(n.ecModel||{}).scheduler,t=e&&e.getPipeline(n.uid);if(t){var i=t.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(n.uid))}return i}}var rP=Ae.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(n,e){var t=e.cx,i=e.cy,r=e.width/2,o=e.height/2;n.moveTo(t,i-o),n.lineTo(t+r,i+o),n.lineTo(t-r,i+o),n.closePath()}}),oP=Ae.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(n,e){var t=e.cx,i=e.cy,r=e.width/2,o=e.height/2;n.moveTo(t,i-o),n.lineTo(t+r,i),n.lineTo(t,i+o),n.lineTo(t-r,i),n.closePath()}}),aP=Ae.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(n,e){var t=e.x,i=e.y,r=e.width/5*3,o=Math.max(r,e.height),a=r/2,s=a*a/(o-a),l=i-o+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,h=Math.sin(u),d=Math.cos(u),f=a*.6,p=a*.7;n.moveTo(t-c,l+s),n.arc(t,l,a,Math.PI-u,Math.PI*2+u),n.bezierCurveTo(t+c-h*f,l+s+d*f,t,i-p,t,i),n.bezierCurveTo(t,i-p,t-c+h*f,l+s+d*f,t-c,l+s),n.closePath()}}),sP=Ae.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(n,e){var t=e.height,i=e.width,r=e.x,o=e.y,a=i/3*2;n.moveTo(r,o),n.lineTo(r+a,o+t),n.lineTo(r,o+t/4*3),n.lineTo(r-a,o+t),n.lineTo(r,o),n.closePath()}}),lP={line:gi,rect:Ue,roundRect:Ue,square:Ue,circle:Lu,diamond:oP,pin:aP,arrow:sP,triangle:rP},uP={line:function(n,e,t,i,r){r.x1=n,r.y1=e+i/2,r.x2=n+t,r.y2=e+i/2},rect:function(n,e,t,i,r){r.x=n,r.y=e,r.width=t,r.height=i},roundRect:function(n,e,t,i,r){r.x=n,r.y=e,r.width=t,r.height=i,r.r=Math.min(t,i)/4},square:function(n,e,t,i,r){var o=Math.min(t,i);r.x=n,r.y=e,r.width=o,r.height=o},circle:function(n,e,t,i,r){r.cx=n+t/2,r.cy=e+i/2,r.r=Math.min(t,i)/2},diamond:function(n,e,t,i,r){r.cx=n+t/2,r.cy=e+i/2,r.width=t,r.height=i},pin:function(n,e,t,i,r){r.x=n+t/2,r.y=e+i/2,r.width=t,r.height=i},arrow:function(n,e,t,i,r){r.x=n+t/2,r.y=e+i/2,r.width=t,r.height=i},triangle:function(n,e,t,i,r){r.cx=n+t/2,r.cy=e+i/2,r.width=t,r.height=i}},Pp={};N(lP,function(n,e){Pp[e]=new n});var cP=Ae.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(n,e,t){var i=ql(n,e,t),r=this.shape;return r&&r.symbolType==="pin"&&e.position==="inside"&&(i.y=t.y+t.height*.4),i},buildPath:function(n,e,t){var i=e.symbolType;if(i!=="none"){var r=Pp[i];r||(i="rect",r=Pp[i]),uP[i](e.x,e.y,e.width,e.height,r.shape),r.buildPath(n,r.shape,t)}}});function hP(n,e){if(this.type!=="image"){var t=this.style;this.__isEmptyBrush?(t.stroke=n,t.fill=e||Z.color.neutral00,t.lineWidth=2):this.shape.symbolType==="line"?t.stroke=n:t.fill=n,this.markRedraw()}}function Jr(n,e,t,i,r,o,a){var s=n.indexOf("empty")===0;s&&(n=n.substr(5,1).toLowerCase()+n.substr(6));var l;return n.indexOf("image://")===0?l=dx(n.slice(8),new ve(e,t,i,r),a?"center":"cover"):n.indexOf("path://")===0?l=Vf(n.slice(7),{},new ve(e,t,i,r),a?"center":"cover"):l=new cP({shape:{symbolType:n,x:e,y:t,width:i,height:r}}),l.__isEmptyBrush=s,l.setColor=hP,o&&l.setColor(o),l}function zp(n){return q(n)||(n=[+n,+n]),[n[0]||0,n[1]||0]}function dc(n,e){if(n!=null)return q(n)||(n=[n,n]),[Pe(n[0],e[0])||0,Pe(te(n[1],n[0]),e[1])||0]}var dP=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t){if(process.env.NODE_ENV!=="production"){var i=t.coordinateSystem;if(i!=="polar"&&i!=="cartesian2d")throw new Error("Line not support coordinateSystem besides cartesian and polar")}return cp(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var i=new Ye,r=Jr("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);i.add(r),r.setStyle(t.lineStyle);var o=this.getData().getVisual("symbol"),a=this.getData().getVisual("symbolRotate"),s=o==="none"?"circle":o,l=t.itemHeight*.8,u=Jr(s,(t.itemWidth-l)/2,(t.itemHeight-l)/2,l,l,t.itemStyle.fill);i.add(u),u.setStyle(t.itemStyle);var c=t.iconRotate==="inherit"?a:t.iconRotate||0;return u.rotation=c*Math.PI/180,u.setOrigin([t.itemWidth/2,t.itemHeight/2]),s.indexOf("empty")>-1&&(u.style.stroke=u.style.fill,u.style.fill=Z.color.neutral00,u.style.lineWidth=2),i},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:6,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Mn);function Bp(n,e){var t=n.mapDimensionsAll("defaultedLabel"),i=t.length;if(i===1){var r=Xo(n,e,t[0]);return r!=null?r+"":null}else if(i){for(var o=[],a=0;a<t.length;a++)o.push(Xo(n,e,t[a]));return o.join(" ")}}function W1(n,e){var t=n.mapDimensionsAll("defaultedLabel");if(!q(e))return e+"";for(var i=[],r=0;r<t.length;r++){var o=n.getDimensionIndex(t[r]);o>=0&&i.push(e[o])}return i.join(" ")}var Vp=function(n){W(e,n);function e(t,i,r,o){var a=n.call(this)||this;return a.updateData(t,i,r,o),a}return e.prototype._createSymbol=function(t,i,r,o,a,s){this.removeAll();var l=Jr(t,-1,-1,2,2,null,s);l.attr({z2:te(a,100),culling:!0,scaleX:o[0]/2,scaleY:o[1]/2}),l.drift=fP,this._symbolType=t,this.add(l)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Lr(this.childAt(0))},e.prototype.downplay=function(){Pr(this.childAt(0))},e.prototype.setZ=function(t,i){var r=this.childAt(0);r.zlevel=t,r.z=i},e.prototype.setDraggable=function(t,i){var r=this.childAt(0);r.draggable=t,r.cursor=!i&&t?"move":r.cursor},e.prototype.updateData=function(t,i,r,o){this.silent=!1;var a=t.getItemVisual(i,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,i),u=e.getSymbolZ2(t,i),c=a!==this._symbolType,h=o&&o.disableAnimation;if(c){var d=t.getItemVisual(i,"symbolKeepAspect");this._createSymbol(a,t,i,l,u,d)}else{var f=this.childAt(0);f.silent=!1;var p={scaleX:l[0]/2,scaleY:l[1]/2};h?f.attr(p):ft(f,p,s,i),zf(f)}if(this._updateCommon(t,i,l,r,o),c){var f=this.childAt(0);if(!h){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,$t(f,p,s,i)}}h&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,i,r,o,a){var s=this.childAt(0),l=t.hostModel,u,c,h,d,f,p,g,m,y;if(o&&(u=o.emphasisItemStyle,c=o.blurItemStyle,h=o.selectItemStyle,d=o.focus,f=o.blurScope,g=o.labelStatesModels,m=o.hoverScale,y=o.cursorStyle,p=o.emphasisDisabled),!o||t.hasItemOption){var v=o&&o.itemModel?o.itemModel:t.getItemModel(i),_=v.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),h=v.getModel(["select","itemStyle"]).getItemStyle(),c=v.getModel(["blur","itemStyle"]).getItemStyle(),d=_.get("focus"),f=_.get("blurScope"),p=_.get("disabled"),g=Ui(v),m=_.getShallow("scale"),y=v.getShallow("cursor")}var b=t.getItemVisual(i,"symbolRotate");s.attr("rotation",(b||0)*Math.PI/180||0);var T=dc(t.getItemVisual(i,"symbolOffset"),r);T&&(s.x=T[0],s.y=T[1]),y&&s.attr("cursor",y);var w=t.getItemVisual(i,"style"),S=w.fill;if(s instanceof Hn){var M=s.style;s.useStyle(U({image:M.image,x:M.x,y:M.y,width:M.width,height:M.height},w))}else s.__isEmptyBrush?s.useStyle(U({},w)):s.useStyle(w),s.style.decal=null,s.setColor(S,a&&a.symbolInnerColor),s.style.strokeNoScale=!0;var C=t.getItemVisual(i,"liftZ"),I=this._z2;C!=null?I==null&&(this._z2=s.z2,s.z2+=C):I!=null&&(s.z2=I,this._z2=null);var E=a&&a.useNameLabel;Fr(s,g,{labelFetcher:l,labelDataIndex:i,defaultText:k,inheritColor:S,defaultOpacity:w.opacity});function k(R){return E?t.getName(R):Bp(t,R)}this._sizeX=r[0]/2,this._sizeY=r[1]/2;var D=s.ensureState("emphasis");D.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=c;var A=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;D.scaleX=this._sizeX*A,D.scaleY=this._sizeY*A,this.setSymbolScale(1),zr(this,d,f,p)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,i,r){var o=this.childAt(0),a=Se(this).dataIndex,s=r&&r.animation;if(this.silent=o.silent=!0,r&&r.fadeLabel){var l=o.getTextContent();l&&Gu(l,{style:{opacity:0}},i,{dataIndex:a,removeOpt:s,cb:function(){o.removeTextContent()}})}else o.removeTextContent();Gu(o,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:a,cb:t,removeOpt:s})},e.getSymbolSize=function(t,i){return zp(t.getItemVisual(i,"symbolSize"))},e.getSymbolZ2=function(t,i){return t.getItemVisual(i,"z2")},e}(Ye);function fP(n,e){this.parent.drift(n,e)}function Hp(n,e,t,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(t))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&n.getItemVisual(t,"symbol")!=="none"}function U1(n){return n!=null&&!ne(n)&&(n={isIgnore:n}),n||{}}function Y1(n){var e=n.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:Ui(e),cursorStyle:e.get("cursor")}}var pP=function(){function n(e){this.group=new Ye,this._SymbolCtor=e||Vp}return n.prototype.updateData=function(e,t){this._progressiveEls=null,t=U1(t);var i=this.group,r=e.hostModel,o=this._data,a=this._SymbolCtor,s=t.disableAnimation,l=Y1(e),u={disableAnimation:s},c=t.getSymbolPoint||function(h){return e.getItemLayout(h)};o||i.removeAll(),e.diff(o).add(function(h){var d=c(h);if(Hp(e,d,h,t)){var f=new a(e,h,l,u);f.setPosition(d),e.setItemGraphicEl(h,f),i.add(f)}}).update(function(h,d){var f=o.getItemGraphicEl(d),p=c(h);if(!Hp(e,p,h,t)){i.remove(f);return}var g=e.getItemVisual(h,"symbol")||"circle",m=f&&f.getSymbolType&&f.getSymbolType();if(!f||m&&m!==g)i.remove(f),f=new a(e,h,l,u),f.setPosition(p);else{f.updateData(e,h,l,u);var y={x:p[0],y:p[1]};s?f.attr(y):ft(f,y,r)}i.add(f),e.setItemGraphicEl(h,f)}).remove(function(h){var d=o.getItemGraphicEl(h);d&&d.fadeOut(function(){i.remove(d)},r)}).execute(),this._getSymbolPoint=c,this._data=e},n.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(i,r){var o=e._getSymbolPoint(r);i.setPosition(o),i.markRedraw()})},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=Y1(e),this._data=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t,i){this._progressiveEls=[],i=U1(i);function r(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var o=e.start;o<e.end;o++){var a=t.getItemLayout(o);if(Hp(t,a,o,i)){var s=new this._SymbolCtor(t,o,this._seriesScope);s.traverse(r),s.setPosition(a),this.group.add(s),t.setItemGraphicEl(o,s),this._progressiveEls.push(s)}}},n.prototype.eachRendered=function(e){ws(this._progressiveEls||this.group,e)},n.prototype.remove=function(e){var t=this.group,i=this._data;i&&e?i.eachItemGraphicEl(function(r){r.fadeOut(function(){t.remove(r)},i.hostModel)}):t.removeAll()},n}();function q1(n,e,t){var i=n.getBaseAxis(),r=n.getOtherAxis(i),o=gP(r,t),a=i.dim,s=r.dim,l=e.mapDimension(s),u=e.mapDimension(a),c=s==="x"||s==="radius"?1:0,h=$(n.dimensions,function(p){return e.mapDimension(p)}),d=!1,f=e.getCalculationInfo("stackResultDimension");return $r(e,h[0])&&(d=!0,h[0]=f),$r(e,h[1])&&(d=!0,h[1]=f),{dataDimsForPoint:h,valueStart:o,valueAxisDim:s,baseAxisDim:a,stacked:!!d,valueDim:l,baseDim:u,baseDataOffset:c,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function gP(n,e){var t=0,i=n.scale.getExtent();return e==="start"?t=i[0]:e==="end"?t=i[1]:Ne(e)&&!isNaN(e)?t=e:i[0]>0?t=i[0]:i[1]<0&&(t=i[1]),t}function j1(n,e,t,i){var r=NaN;n.stacked&&(r=t.get(t.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=n.valueStart);var o=n.baseDataOffset,a=[];return a[o]=t.get(n.baseDim,i),a[1-o]=r,e.dataToPoint(a)}var $1=typeof Float32Array<"u",mP=$1?Float32Array:Array;function vi(n){return q(n)?$1?new Float32Array(n):n:new mP(n)}function yP(n,e){var t=[];return e.diff(n).add(function(i){t.push({cmd:"+",idx:i})}).update(function(i,r){t.push({cmd:"=",idx:r,idx1:i})}).remove(function(i){t.push({cmd:"-",idx:i})}).execute(),t}function vP(n,e,t,i,r,o,a,s){for(var l=yP(n,e),u=[],c=[],h=[],d=[],f=[],p=[],g=[],m=q1(r,e,a),y=n.getLayout("points")||[],v=e.getLayout("points")||[],_=0;_<l.length;_++){var b=l[_],T=!0,w=void 0,S=void 0;switch(b.cmd){case"=":w=b.idx*2,S=b.idx1*2;var M=y[w],C=y[w+1],I=v[S],E=v[S+1];(isNaN(M)||isNaN(C))&&(M=I,C=E),u.push(M,C),c.push(I,E),h.push(t[w],t[w+1]),d.push(i[S],i[S+1]),g.push(e.getRawIndex(b.idx1));break;case"+":var k=b.idx,D=m.dataDimsForPoint,A=r.dataToPoint([e.get(D[0],k),e.get(D[1],k)]);S=k*2,u.push(A[0],A[1]),c.push(v[S],v[S+1]);var R=j1(m,r,e,k);h.push(R[0],R[1]),d.push(i[S],i[S+1]),g.push(e.getRawIndex(k));break;case"-":T=!1}T&&(f.push(b),p.push(p.length))}p.sort(function(Te,qe){return g[Te]-g[qe]});for(var L=u.length,V=vi(L),z=vi(L),H=vi(L),F=vi(L),j=[],_=0;_<p.length;_++){var Y=p[_],ee=_*2,pe=Y*2;V[ee]=u[pe],V[ee+1]=u[pe+1],z[ee]=c[pe],z[ee+1]=c[pe+1],H[ee]=h[pe],H[ee+1]=h[pe+1],F[ee]=d[pe],F[ee+1]=d[pe+1],j[_]=f[Y]}return{current:V,next:z,stackedOnCurrent:H,stackedOnNext:F,status:j}}var Ki=Math.min,Qi=Math.max;function eo(n,e){return isNaN(n)||isNaN(e)}function Fp(n,e,t,i,r,o,a,s,l){for(var u,c,h,d,f,p,g=t,m=0;m<i;m++){var y=e[g*2],v=e[g*2+1];if(g>=r||g<0)break;if(eo(y,v)){if(l){g+=o;continue}break}if(g===t)n[o>0?"moveTo":"lineTo"](y,v),h=y,d=v;else{var _=y-u,b=v-c;if(_*_+b*b<.5){g+=o;continue}if(a>0){for(var T=g+o,w=e[T*2],S=e[T*2+1];w===y&&S===v&&m<i;)m++,T+=o,g+=o,w=e[T*2],S=e[T*2+1],y=e[g*2],v=e[g*2+1],_=y-u,b=v-c;var M=m+1;if(l)for(;eo(w,S)&&M<i;)M++,T+=o,w=e[T*2],S=e[T*2+1];var C=.5,I=0,E=0,k=void 0,D=void 0;if(M>=i||eo(w,S))f=y,p=v;else{I=w-u,E=S-c;var A=y-u,R=w-y,L=v-c,V=S-v,z=void 0,H=void 0;if(s==="x"){z=Math.abs(A),H=Math.abs(R);var F=I>0?1:-1;f=y-F*z*a,p=v,k=y+F*H*a,D=v}else if(s==="y"){z=Math.abs(L),H=Math.abs(V);var j=E>0?1:-1;f=y,p=v-j*z*a,k=y,D=v+j*H*a}else z=Math.sqrt(A*A+L*L),H=Math.sqrt(R*R+V*V),C=H/(H+z),f=y-I*a*(1-C),p=v-E*a*(1-C),k=y+I*a*C,D=v+E*a*C,k=Ki(k,Qi(w,y)),D=Ki(D,Qi(S,v)),k=Qi(k,Ki(w,y)),D=Qi(D,Ki(S,v)),I=k-y,E=D-v,f=y-I*z/H,p=v-E*z/H,f=Ki(f,Qi(u,y)),p=Ki(p,Qi(c,v)),f=Qi(f,Ki(u,y)),p=Qi(p,Ki(c,v)),I=y-f,E=v-p,k=y+I*H/z,D=v+E*H/z}n.bezierCurveTo(h,d,f,p,y,v),h=k,d=D}else n.lineTo(y,v)}u=y,c=v,g+=o}return m}var Z1=function(){function n(){this.smooth=0,this.smoothConstraint=!0}return n}(),_P=function(n){W(e,n);function e(t){var i=n.call(this,t)||this;return i.type="ec-polyline",i}return e.prototype.getDefaultStyle=function(){return{stroke:Z.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new Z1},e.prototype.buildPath=function(t,i){var r=i.points,o=0,a=r.length/2;if(i.connectNulls){for(;a>0&&eo(r[a*2-2],r[a*2-1]);a--);for(;o<a&&eo(r[o*2],r[o*2+1]);o++);}for(;o<a;)o+=Fp(t,r,o,a,a,1,i.smooth,i.smoothMonotone,i.connectNulls)+1},e.prototype.getPointOn=function(t,i){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var r=this.path,o=r.data,a=Hi.CMD,s,l,u=i==="x",c=[],h=0;h<o.length;){var d=o[h++],f=void 0,p=void 0,g=void 0,m=void 0,y=void 0,v=void 0,_=void 0;switch(d){case a.M:s=o[h++],l=o[h++];break;case a.L:if(f=o[h++],p=o[h++],_=u?(t-s)/(f-s):(t-l)/(p-l),_<=1&&_>=0){var b=u?(p-l)*_+l:(f-s)*_+s;return u?[t,b]:[b,t]}s=f,l=p;break;case a.C:f=o[h++],p=o[h++],g=o[h++],m=o[h++],y=o[h++],v=o[h++];var T=u?Kl(s,f,g,y,t,c):Kl(l,p,m,v,t,c);if(T>0)for(var w=0;w<T;w++){var S=c[w];if(S<=1&&S>=0){var b=u?dt(l,p,m,v,S):dt(s,f,g,y,S);return u?[t,b]:[b,t]}}s=y,l=v;break}}},e}(Ae),xP=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(Z1),bP=function(n){W(e,n);function e(t){var i=n.call(this,t)||this;return i.type="ec-polygon",i}return e.prototype.getDefaultShape=function(){return new xP},e.prototype.buildPath=function(t,i){var r=i.points,o=i.stackedOnPoints,a=0,s=r.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&eo(r[s*2-2],r[s*2-1]);s--);for(;a<s&&eo(r[a*2],r[a*2+1]);a++);}for(;a<s;){var u=Fp(t,r,a,s,s,1,i.smooth,l,i.connectNulls);Fp(t,o,a+u-1,u,s,-1,i.stackedOnSmooth,l,i.connectNulls),a+=u+1,t.closePath()}},e}(Ae);function Gp(){var n=Re();return function(e){var t=n(e),i=e.pipelineContext,r=!!t.large,o=!!t.progressiveRender,a=t.large=!!(i&&i.large),s=t.progressiveRender=!!(i&&i.progressiveRender);return(r!==a||o!==s)&&"reset"}}var X1=Re(),wP=Gp(),ln=function(){function n(){this.group=new Ye,this.uid=Is("viewChart"),this.renderTask=Ps({plan:SP,reset:TP}),this.renderTask.context={view:this}}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,i,r){if(process.env.NODE_ENV!=="production")throw new Error("render method must been implemented")},n.prototype.highlight=function(e,t,i,r){var o=e.getData(r&&r.dataType);if(!o){process.env.NODE_ENV!=="production"&&ze("Unknown dataType "+r.dataType);return}Q1(o,r,"emphasis")},n.prototype.downplay=function(e,t,i,r){var o=e.getData(r&&r.dataType);if(!o){process.env.NODE_ENV!=="production"&&ze("Unknown dataType "+r.dataType);return}Q1(o,r,"normal")},n.prototype.remove=function(e,t){this.group.removeAll()},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,i,r){this.render(e,t,i,r)},n.prototype.updateLayout=function(e,t,i,r){this.render(e,t,i,r)},n.prototype.updateVisual=function(e,t,i,r){this.render(e,t,i,r)},n.prototype.eachRendered=function(e){ws(this.group,e)},n.markUpdateMethod=function(e,t){X1(e).updateMethod=t},n.protoInitialize=function(){var e=n.prototype;e.type="chart"}(),n}();function K1(n,e,t){n&&Wo(n)&&(e==="emphasis"?Lr:Pr)(n,t)}function Q1(n,e,t){var i=Or(n,e),r=e&&e.highlightKey!=null?iO(e.highlightKey):null;i!=null?N(_t(i),function(o){K1(n.getItemGraphicEl(o),t,r)}):n.eachItemGraphicEl(function(o){K1(o,t,r)})}cd(ln,["dispose"]),Wl(ln);function SP(n){return wP(n.model)}function TP(n){var e=n.model,t=n.ecModel,i=n.api,r=n.payload,o=e.pipelineContext.progressiveRender,a=n.view,s=r&&X1(r).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return l!=="render"&&a[l](e,t,i,r),MP[l]}var MP={incrementalPrepareRender:{progress:function(n,e){e.view.incrementalRender(n,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(n,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function J1(n,e,t,i,r){var o=n.getArea(),a=o.x,s=o.y,l=o.width,u=o.height,c=t.get(["lineStyle","width"])||0;a-=c/2,s-=c/2,l+=c,u+=c,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var h=new Ue({shape:{x:a,y:s,width:l,height:u}});if(e){var d=n.getBaseAxis(),f=d.isHorizontal(),p=d.inverse;f?(p&&(h.shape.x+=l),h.shape.width=0):(p||(h.shape.y+=u),h.shape.height=0);var g=ce(r)?function(m){r(m,h)}:null;$t(h,{shape:{width:l,height:u,x:a,y:s}},t,null,i,g)}return h}function eb(n,e,t){var i=n.getArea(),r=at(i.r0,1),o=at(i.r,1),a=new Gi({shape:{cx:at(n.cx,1),cy:at(n.cy,1),r0:r,r:o,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});if(e){var s=n.getBaseAxis().dim==="angle";s?a.shape.endAngle=i.startAngle:a.shape.r=r,$t(a,{shape:{endAngle:i.endAngle,r:o}},t)}return a}function CP(n,e,t,i,r){if(n){if(n.type==="polar")return eb(n,e,t);if(n.type==="cartesian2d")return J1(n,e,t,i,r)}else return null;return null}function ia(n,e){return n.type===e}function tb(n,e){if(n.length===e.length){for(var t=0;t<n.length;t++)if(n[t]!==e[t])return;return!0}}function nb(n){for(var e=1/0,t=1/0,i=-1/0,r=-1/0,o=0;o<n.length;){var a=n[o++],s=n[o++];isNaN(a)||(e=Math.min(a,e),i=Math.max(a,i)),isNaN(s)||(t=Math.min(s,t),r=Math.max(s,r))}return[[e,t],[i,r]]}function ib(n,e){var t=nb(n),i=t[0],r=t[1],o=nb(e),a=o[0],s=o[1];return Math.max(Math.abs(i[0]-a[0]),Math.abs(i[1]-a[1]),Math.abs(r[0]-s[0]),Math.abs(r[1]-s[1]))}function rb(n){return Ne(n)?n:n?.5:0}function kP(n,e,t){if(!t.valueDim)return[];for(var i=e.count(),r=vi(i*2),o=0;o<i;o++){var a=j1(t,n,e,o);r[o*2]=a[0],r[o*2+1]=a[1]}return r}function Ji(n,e,t,i,r){var o=t.getBaseAxis(),a=o.dim==="x"||o.dim==="radius"?0:1,s=[],l=0,u=[],c=[],h=[],d=[];if(r){for(l=0;l<n.length;l+=2){var f=e||n;!isNaN(f[l])&&!isNaN(f[l+1])&&d.push(n[l],n[l+1])}n=d}for(l=0;l<n.length-2;l+=2)switch(h[0]=n[l+2],h[1]=n[l+3],c[0]=n[l],c[1]=n[l+1],s.push(c[0],c[1]),i){case"end":u[a]=h[a],u[1-a]=c[1-a],s.push(u[0],u[1]);break;case"middle":var p=(c[a]+h[a])/2,g=[];u[a]=g[a]=p,u[1-a]=c[1-a],g[1-a]=h[1-a],s.push(u[0],u[1]),s.push(g[0],g[1]);break;default:u[a]=c[a],u[1-a]=h[1-a],s.push(u[0],u[1])}return s.push(n[l++],n[l++]),s}function DP(n,e){var t=[],i=n.length,r,o;function a(c,h,d){var f=c.coord,p=(d-f)/(h.coord-f),g=bN(p,[c.color,h.color]);return{coord:d,color:g}}for(var s=0;s<i;s++){var l=n[s],u=l.coord;if(u<0)r=l;else if(u>e){o?t.push(a(o,l,e)):r&&t.push(a(r,l,0),a(r,l,e));break}else r&&(t.push(a(r,l,0)),r=null),t.push(l),o=l}return t}function IP(n,e,t){var i=n.getVisual("visualMeta");if(!(!i||!i.length||!n.count())){if(e.type!=="cartesian2d"){process.env.NODE_ENV!=="production"&&console.warn("Visual map on line style is only supported on cartesian2d.");return}for(var r,o,a=i.length-1;a>=0;a--){var s=n.getDimensionInfo(i[a].dimension);if(r=s&&s.coordDim,r==="x"||r==="y"){o=i[a];break}}if(!o){process.env.NODE_ENV!=="production"&&console.warn("Visual map on line style only support x or y dimension.");return}var l=e.getAxis(r),u=$(o.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),c=u.length,h=o.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var d=DP(u,r==="x"?t.getWidth():t.getHeight()),f=d.length;if(!f&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var p=10,g=d[0].coord-p,m=d[f-1].coord+p,y=m-g;if(y<.001)return"transparent";N(d,function(_){_.offset=(_.coord-g)/y}),d.push({offset:f?d[f-1].offset:.5,color:h[1]||"transparent"}),d.unshift({offset:f?d[0].offset:.5,color:h[0]||"transparent"});var v=new ux(0,0,0,0,d,!0);return v[r]=g,v[r+"2"]=m,v}}function EP(n,e,t){var i=n.get("showAllSymbol"),r=i==="auto";if(!(i&&!r)){var o=t.getAxesByScale("ordinal")[0];if(o&&!(r&&NP(o,e))){var a=e.mapDimension(o.dim),s={};return N(o.getViewLabels(),function(l){var u=o.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(a,l))}}}}function NP(n,e){var t=n.getExtent(),i=Math.abs(t[1]-t[0])/n.scale.count();isNaN(i)&&(i=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),a=0;a<r;a+=o)if(Vp.getSymbolSize(e,a)[n.isHorizontal()?1:0]*1.5>i)return!1;return!0}function AP(n,e){return isNaN(n)||isNaN(e)}function OP(n){for(var e=n.length/2;e>0&&AP(n[e*2-2],n[e*2-1]);e--);return e-1}function ob(n,e){return[n[e*2],n[e*2+1]]}function RP(n,e,t){for(var i=n.length/2,r=t==="x"?0:1,o,a,s=0,l=-1,u=0;u<i;u++)if(a=n[u*2+r],!(isNaN(a)||isNaN(n[u*2+1-r]))){if(u===0){o=a;continue}if(o<=e&&a>=e||o>=e&&a<=e){l=u;break}s=u,o=a}return{range:[s,l],t:(e-o)/(a-o)}}function ab(n){if(n.get(["endLabel","show"]))return!0;for(var e=0;e<Pt.length;e++)if(n.get([Pt[e],"endLabel","show"]))return!0;return!1}function Wp(n,e,t,i){if(ia(e,"cartesian2d")){var r=i.getModel("endLabel"),o=r.get("valueAnimation"),a=i.getData(),s={lastFrameIndex:0},l=ab(i)?function(f,p){n._endLabelOnDuring(f,p,a,s,o,r,e)}:null,u=e.getBaseAxis().isHorizontal(),c=J1(e,t,i,function(){var f=n._endLabel;f&&t&&s.originalX!=null&&f.attr({x:s.originalX,y:s.originalY})},l);if(!i.get("clip",!0)){var h=c.shape,d=Math.max(h.width,h.height);u?(h.y-=d,h.height+=d*2):(h.x-=d,h.width+=d*2)}return l&&l(1,c),c}else return process.env.NODE_ENV!=="production"&&i.get(["endLabel","show"])&&console.warn("endLabel is not supported for lines in polar systems."),eb(e,t,i)}function LP(n,e){var t=e.getBaseAxis(),i=t.isHorizontal(),r=t.inverse,o=i?r?"right":"left":"center",a=i?"middle":r?"top":"bottom";return{normal:{align:n.get("align")||o,verticalAlign:n.get("verticalAlign")||a}}}var PP=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(){var t=new Ye,i=new pP;this.group.add(i.group),this._symbolDraw=i,this._lineGroup=t,this._changePolyState=ke(this._changePolyState,this)},e.prototype.render=function(t,i,r){var o=t.coordinateSystem,a=this.group,s=t.getData(),l=t.getModel("lineStyle"),u=t.getModel("areaStyle"),c=s.getLayout("points")||[],h=o.type==="polar",d=this._coordSys,f=this._symbolDraw,p=this._polyline,g=this._polygon,m=this._lineGroup,y=!i.ssr&&t.get("animation"),v=!u.isEmpty(),_=u.get("origin"),b=q1(o,s,_),T=v&&kP(o,s,b),w=t.get("showSymbol"),S=t.get("connectNulls"),M=w&&!h&&EP(t,s,o),C=this._data;C&&C.eachItemGraphicEl(function(Te,qe){Te.__temp&&(a.remove(Te),C.setItemGraphicEl(qe,null))}),w||f.remove(),a.add(m);var I=h?!1:t.get("step"),E;o&&o.getArea&&t.get("clip",!0)&&(E=o.getArea(),E.width!=null?(E.x-=.1,E.y-=.1,E.width+=.2,E.height+=.2):E.r0&&(E.r0-=.5,E.r+=.5)),this._clipShapeForSymbol=E;var k=IP(s,o,r)||s.getVisual("style")[s.getVisual("drawType")];if(!(p&&d.type===o.type&&I===this._step))w&&f.updateData(s,{isIgnore:M,clipShape:E,disableAnimation:!0,getSymbolPoint:function(Te){return[c[Te*2],c[Te*2+1]]}}),y&&this._initSymbolLabelAnimation(s,o,E),I&&(T&&(T=Ji(T,c,o,I,S)),c=Ji(c,null,o,I,S)),p=this._newPolyline(c),v?g=this._newPolygon(c,T):g&&(m.remove(g),g=this._polygon=null),h||this._initOrUpdateEndLabel(t,o,Xr(k)),m.setClipPath(Wp(this,o,!0,t));else{v&&!g?g=this._newPolygon(c,T):g&&!v&&(m.remove(g),g=this._polygon=null),h||this._initOrUpdateEndLabel(t,o,Xr(k));var D=m.getClipPath();if(D){var A=Wp(this,o,!1,t);$t(D,{shape:A.shape},t)}else m.setClipPath(Wp(this,o,!0,t));w&&f.updateData(s,{isIgnore:M,clipShape:E,disableAnimation:!0,getSymbolPoint:function(Te){return[c[Te*2],c[Te*2+1]]}}),(!tb(this._stackedOnPoints,T)||!tb(this._points,c))&&(y?this._doUpdateAnimation(s,T,o,r,I,_,S):(I&&(T&&(T=Ji(T,c,o,I,S)),c=Ji(c,null,o,I,S)),p.setShape({points:c}),g&&g.setShape({points:c,stackedOnPoints:T})))}var R=t.getModel("emphasis"),L=R.get("focus"),V=R.get("blurScope"),z=R.get("disabled");if(p.useStyle(Me(l.getLineStyle(),{fill:"none",stroke:k,lineJoin:"bevel"})),fs(p,t,"lineStyle"),p.style.lineWidth>0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var H=p.getState("emphasis").style;H.lineWidth=+p.style.lineWidth+1}Se(p).seriesIndex=t.seriesIndex,zr(p,L,V,z);var F=rb(t.get("smooth")),j=t.get("smoothMonotone");if(p.setShape({smooth:F,smoothMonotone:j,connectNulls:S}),g){var Y=s.getCalculationInfo("stackedOnSeries"),ee=0;g.useStyle(Me(u.getAreaStyle(),{fill:k,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Y&&(ee=rb(Y.get("smooth"))),g.setShape({smooth:F,stackedOnSmooth:ee,smoothMonotone:j,connectNulls:S}),fs(g,t,"areaStyle"),Se(g).seriesIndex=t.seriesIndex,zr(g,L,V,z)}var pe=this._changePolyState;s.eachItemGraphicEl(function(Te){Te&&(Te.onHoverStateChange=pe)}),this._polyline.onHoverStateChange=pe,this._data=s,this._coordSys=o,this._stackedOnPoints=T,this._points=c,this._step=I,this._valueOrigin=_,t.get("triggerLineEvent")&&(this.packEventData(t,p),g&&this.packEventData(t,g))},e.prototype.packEventData=function(t,i){Se(i).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,i,r,o){var a=t.getData(),s=Or(a,o);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=a.getLayout("points"),u=a.getItemGraphicEl(s);if(!u){var c=l[s*2],h=l[s*2+1];if(isNaN(c)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,h))return;var d=t.get("zlevel")||0,f=t.get("z")||0;u=new Vp(a,s),u.x=c,u.y=h,u.setZ(d,f);var p=u.getSymbolPath().getTextContent();p&&(p.zlevel=d,p.z=f,p.z2=this._polyline.z2+1),u.__temp=!0,a.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else ln.prototype.highlight.call(this,t,i,r,o)},e.prototype.downplay=function(t,i,r,o){var a=t.getData(),s=Or(a,o);if(this._changePolyState("normal"),s!=null&&s>=0){var l=a.getItemGraphicEl(s);l&&(l.__temp?(a.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else ln.prototype.downplay.call(this,t,i,r,o)},e.prototype._changePolyState=function(t){var i=this._polygon;B_(this._polyline,t),i&&B_(i,t)},e.prototype._newPolyline=function(t){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new _P({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},e.prototype._newPolygon=function(t,i){var r=this._polygon;return r&&this._lineGroup.remove(r),r=new bP({shape:{points:t,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(r),this._polygon=r,r},e.prototype._initSymbolLabelAnimation=function(t,i,r){var o,a,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(o=s.isHorizontal(),a=!1):i.type==="polar"&&(o=s.dim==="angle",a=!0);var u=t.hostModel,c=u.get("animationDuration");ce(c)&&(c=c(null));var h=u.get("animationDelay")||0,d=ce(h)?h(null):h;t.eachItemGraphicEl(function(f,p){var g=f;if(g){var m=[f.x,f.y],y=void 0,v=void 0,_=void 0;if(r)if(a){var b=r,T=i.pointToCoord(m);o?(y=b.startAngle,v=b.endAngle,_=-T[1]/180*Math.PI):(y=b.r0,v=b.r,_=T[0])}else{var w=r;o?(y=w.x,v=w.x+w.width,_=f.x):(y=w.y+w.height,v=w.y,_=f.y)}var S=v===y?0:(_-y)/(v-y);l&&(S=1-S);var M=ce(h)?h(p):c*S+d,C=g.getSymbolPath(),I=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:M}),I&&I.animateFrom({style:{opacity:0}},{duration:300,delay:M}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,i,r){var o=t.getModel("endLabel");if(ab(t)){var a=t.getData(),s=this._polyline,l=a.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new it({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=OP(l);c>=0&&(Fr(s,Ui(t,"endLabel"),{inheritColor:r,labelFetcher:t,labelDataIndex:c,defaultText:function(h,d,f){return f!=null?W1(a,f):Bp(a,h)},enableTextSetter:!0},LP(o,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,i,r,o,a,s,l){var u=this._endLabel,c=this._polyline;if(u){t<1&&o.originalX==null&&(o.originalX=u.x,o.originalY=u.y);var h=r.getLayout("points"),d=r.hostModel,f=d.get("connectNulls"),p=s.get("precision"),g=s.get("distance")||0,m=l.getBaseAxis(),y=m.isHorizontal(),v=m.inverse,_=i.shape,b=v?y?_.x:_.y+_.height:y?_.x+_.width:_.y,T=(y?g:0)*(v?-1:1),w=(y?0:-g)*(v?-1:1),S=y?"x":"y",M=RP(h,b,S),C=M.range,I=C[1]-C[0],E=void 0;if(I>=1){if(I>1&&!f){var k=ob(h,C[0]);u.attr({x:k[0]+T,y:k[1]+w}),a&&(E=d.getRawValue(C[0]))}else{var k=c.getPointOn(b,S);k&&u.attr({x:k[0]+T,y:k[1]+w});var D=d.getRawValue(C[0]),A=d.getRawValue(C[1]);a&&(E=BA(r,p,D,A,M.t))}o.lastFrameIndex=C[0]}else{var R=t===1||o.lastFrameIndex>0?C[0]:0,k=ob(h,R);a&&(E=d.getRawValue(R)),u.attr({x:k[0]+T,y:k[1]+w})}if(a){var L=ju(u);typeof L.setLabelText=="function"&&L.setLabelText(E)}}},e.prototype._doUpdateAnimation=function(t,i,r,o,a,s,l){var u=this._polyline,c=this._polygon,h=t.hostModel,d=vP(this._data,t,this._stackedOnPoints,i,this._coordSys,r,this._valueOrigin),f=d.current,p=d.stackedOnCurrent,g=d.next,m=d.stackedOnNext;if(a&&(p=Ji(d.stackedOnCurrent,d.current,r,a,l),f=Ji(d.current,null,r,a,l),m=Ji(d.stackedOnNext,d.next,r,a,l),g=Ji(d.next,null,r,a,l)),ib(f,g)>3e3||c&&ib(p,m)>3e3){u.stopAnimation(),u.setShape({points:g}),c&&(c.stopAnimation(),c.setShape({points:g,stackedOnPoints:m}));return}u.shape.__points=d.current,u.shape.points=f;var y={shape:{points:g}};d.current!==f&&(y.shape.__points=d.next),u.stopAnimation(),ft(u,y,h),c&&(c.setShape({points:f,stackedOnPoints:p}),c.stopAnimation(),ft(c,{shape:{stackedOnPoints:m}},h),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var v=[],_=d.status,b=0;b<_.length;b++){var T=_[b].cmd;if(T==="="){var w=t.getItemGraphicEl(_[b].idx1);w&&v.push({el:w,ptIdx:b})}}u.animators&&u.animators.length&&u.animators[0].during(function(){c&&c.dirtyShape();for(var S=u.shape.__points,M=0;M<v.length;M++){var C=v[M].el,I=v[M].ptIdx*2;C.x=S[I],C.y=S[I+1],C.markRedraw()}})},e.prototype.remove=function(t){var i=this.group,r=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),r&&r.eachItemGraphicEl(function(o,a){o.__temp&&(i.remove(o),r.setItemGraphicEl(a,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(ln);function zP(n,e){return{seriesType:n,plan:Gp(),reset:function(t){var i=t.getData(),r=t.coordinateSystem;if(t.pipelineContext,!!r){var o=$(r.dimensions,function(h){return i.mapDimension(h)}).slice(0,2),a=o.length,s=i.getCalculationInfo("stackResultDimension");$r(i,o[0])&&(o[0]=s),$r(i,o[1])&&(o[1]=s);var l=i.getStore(),u=i.getDimensionIndex(o[0]),c=i.getDimensionIndex(o[1]);return a&&{progress:function(h,d){for(var f=h.end-h.start,p=vi(f*a),g=[],m=[],y=h.start,v=0;y<h.end;y++){var _=void 0;if(a===1){var b=l.get(u,y);_=r.dataToPoint(b,null,m)}else g[0]=l.get(u,y),g[1]=l.get(c,y),_=r.dataToPoint(g,null,m);p[v++]=_[0],p[v++]=_[1]}d.setLayout("points",p)}}}}}}var BP={average:function(n){for(var e=0,t=0,i=0;i<n.length;i++)isNaN(n[i])||(e+=n[i],t++);return t===0?NaN:e/t},sum:function(n){for(var e=0,t=0;t<n.length;t++)e+=n[t]||0;return e},max:function(n){for(var e=-1/0,t=0;t<n.length;t++)n[t]>e&&(e=n[t]);return isFinite(e)?e:NaN},min:function(n){for(var e=1/0,t=0;t<n.length;t++)n[t]<e&&(e=n[t]);return isFinite(e)?e:NaN},nearest:function(n){return n[0]}},VP=function(n){return Math.round(n.length/2)};function sb(n){return{seriesType:n,reset:function(e,t,i){var r=e.getData(),o=e.get("sampling"),a=e.coordinateSystem,s=r.count();if(s>10&&a.type==="cartesian2d"&&o){var l=a.getBaseAxis(),u=a.getOtherAxis(l),c=l.getExtent(),h=i.getDevicePixelRatio(),d=Math.abs(c[1]-c[0])*(h||1),f=Math.round(s/d);if(isFinite(f)&&f>1){o==="lttb"?e.setData(r.lttbDownSample(r.mapDimension(u.dim),1/f)):o==="minmax"&&e.setData(r.minmaxDownSample(r.mapDimension(u.dim),1/f));var p=void 0;Q(o)?p=BP[o]:ce(o)&&(p=o),p&&e.setData(r.downSample(r.mapDimension(u.dim),1/f,p,VP))}}}}}function HP(n){n.registerChartView(PP),n.registerSeriesModel(dP),n.registerLayout(zP("line")),n.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),i=e.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",i)}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,sb("line"))}var FP="__ec_stack_";function lb(n){return n.get("stack")||FP+n.seriesIndex}function Up(n){return n.dim+n.index}function ub(n,e){var t=[];return e.eachSeriesByType(n,function(i){hb(i)&&t.push(i)}),t}function GP(n){var e={};N(n,function(l){var u=l.coordinateSystem,c=u.getBaseAxis();if(!(c.type!=="time"&&c.type!=="value"))for(var h=l.getData(),d=c.dim+"_"+c.index,f=h.getDimensionIndex(h.mapDimension(c.dim)),p=h.getStore(),g=0,m=p.count();g<m;++g){var y=p.get(f,g);e[d]?e[d].push(y):e[d]=[y]}});var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(r){r.sort(function(l,u){return l-u});for(var o=null,a=1;a<r.length;++a){var s=r[a]-r[a-1];s>0&&(o=o===null?s:Math.min(o,s))}t[i]=o}}return t}function cb(n){var e=GP(n),t=[];return N(n,function(i){var r=i.coordinateSystem,o=r.getBaseAxis(),a=o.getExtent(),s;if(o.type==="category")s=o.getBandWidth();else if(o.type==="value"||o.type==="time"){var l=o.dim+"_"+o.index,u=e[l],c=Math.abs(a[1]-a[0]),h=o.scale.getExtent(),d=Math.abs(h[1]-h[0]);s=u?c/d*u:c}else{var f=i.getData();s=Math.abs(a[1]-a[0])/f.count()}var p=Pe(i.get("barWidth"),s),g=Pe(i.get("barMaxWidth"),s),m=Pe(i.get("barMinWidth")||(db(i)?.5:1),s),y=i.get("barGap"),v=i.get("barCategoryGap"),_=i.get("defaultBarGap");t.push({bandWidth:s,barWidth:p,barMaxWidth:g,barMinWidth:m,barGap:y,barCategoryGap:v,defaultBarGap:_,axisKey:Up(o),stackId:lb(i)})}),WP(t)}function WP(n){var e={};N(n,function(i,r){var o=i.axisKey,a=i.bandWidth,s=e[o]||{bandWidth:a,remainedWidth:a,autoWidthCount:0,categoryGap:null,gap:i.defaultBarGap||0,stacks:{}},l=s.stacks;e[o]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=i.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var h=i.barMaxWidth;h&&(l[u].maxWidth=h);var d=i.barMinWidth;d&&(l[u].minWidth=d);var f=i.barGap;f!=null&&(s.gap=f);var p=i.barCategoryGap;p!=null&&(s.categoryGap=p)});var t={};return N(e,function(i,r){t[r]={};var o=i.stacks,a=i.bandWidth,s=i.categoryGap;if(s==null){var l=Ce(o).length;s=Math.max(35-l*4,15)+"%"}var u=Pe(s,a),c=Pe(i.gap,1),h=i.remainedWidth,d=i.autoWidthCount,f=(h-u)/(d+(d-1)*c);f=Math.max(f,0),N(o,function(y){var v=y.maxWidth,_=y.minWidth;if(y.width){var b=y.width;v&&(b=Math.min(b,v)),_&&(b=Math.max(b,_)),y.width=b,h-=b+c*b,d--}else{var b=f;v&&v<b&&(b=Math.min(v,h)),_&&_>b&&(b=_),b!==f&&(y.width=b,h-=b+c*b,d--)}}),f=(h-u)/(d+(d-1)*c),f=Math.max(f,0);var p=0,g;N(o,function(y,v){y.width||(y.width=f),g=y,p+=y.width*(1+c)}),g&&(p-=g.width*c);var m=-p/2;N(o,function(y,v){t[r][v]=t[r][v]||{bandWidth:a,offset:m,width:y.width},m+=y.width*(1+c)})}),t}function UP(n,e,t){if(n&&e){var i=n[Up(e)];return i}}function YP(n,e){var t=ub(n,e),i=cb(t);N(t,function(r){var o=r.getData(),a=r.coordinateSystem,s=a.getBaseAxis(),l=lb(r),u=i[Up(s)][l],c=u.offset,h=u.width;o.setLayout({bandWidth:u.bandWidth,offset:c,size:h})})}function qP(n){return{seriesType:n,plan:Gp(),reset:function(e){if(hb(e)){var t=e.getData(),i=e.coordinateSystem,r=i.getBaseAxis(),o=i.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(o.dim)),s=t.getDimensionIndex(t.mapDimension(r.dim)),l=e.get("showBackground",!0),u=t.mapDimension(o.dim),c=t.getCalculationInfo("stackResultDimension"),h=$r(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),d=o.isHorizontal(),f=jP(r,o),p=db(e),g=e.get("barMinHeight")||0,m=c&&t.getDimensionIndex(c),y=t.getLayout("size"),v=t.getLayout("offset");return{progress:function(_,b){for(var T=_.count,w=p&&vi(T*3),S=p&&l&&vi(T*3),M=p&&vi(T),C=i.master.getRect(),I=d?C.width:C.height,E,k=b.getStore(),D=0;(E=_.next())!=null;){var A=k.get(h?m:a,E),R=k.get(s,E),L=f,V=void 0;h&&(V=+A-k.get(a,E));var z=void 0,H=void 0,F=void 0,j=void 0;if(d){var Y=i.dataToPoint([A,R]);if(h){var ee=i.dataToPoint([V,R]);L=ee[0]}z=L,H=Y[1]+v,F=Y[0]-L,j=y,Math.abs(F)<g&&(F=(F<0?-1:1)*g)}else{var Y=i.dataToPoint([R,A]);if(h){var ee=i.dataToPoint([R,V]);L=ee[1]}z=Y[0]+v,H=L,F=y,j=Y[1]-L,Math.abs(j)<g&&(j=(j<=0?-1:1)*g)}p?(w[D]=z,w[D+1]=H,w[D+2]=d?F:j,S&&(S[D]=d?C.x:z,S[D+1]=d?H:C.y,S[D+2]=I),M[E]=E):b.setItemLayout(E,{x:z,y:H,width:F,height:j}),D+=3}p&&b.setLayout({largePoints:w,largeDataIndices:M,largeBackgroundPoints:S,valueAxisHorizontal:d})}}}}}}function hb(n){return n.coordinateSystem&&n.coordinateSystem.type==="cartesian2d"}function db(n){return n.pipelineContext&&n.pipelineContext.large}function jP(n,e){var t=e.model.get("startValue");return t||(t=0),e.toGlobalCoord(e.dataToCoord(e.type==="log"?t>0?t:1:t))}var Yp=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){return cp(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,i,r){var o=this.coordinateSystem;if(o&&o.clampData){var a=o.clampData(t),s=o.dataToPoint(a);if(r)N(o.getAxes(),function(d,f){if(d.type==="category"&&i!=null){var p=d.getTicksCoords(),g=d.getTickModel().get("alignWithLabel"),m=a[f],y=i[f]==="x1"||i[f]==="y1";if(y&&!g&&(m+=1),p.length<2)return;if(p.length===2){s[f]=d.toGlobalCoord(d.getExtent()[y?1:0]);return}for(var v=void 0,_=void 0,b=1,T=0;T<p.length;T++){var w=p[T].coord,S=T===p.length-1?p[T-1].tickValue+b:p[T].tickValue;if(S===m){_=w;break}else if(S<m)v=w;else if(v!=null&&S>m){_=(w+v)/2;break}T===1&&(b=S-p[0].tickValue)}_==null&&(v?v&&(_=p[p.length-1].coord):_=p[0].coord),s[f]=d.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=o.getBaseAxis().isHorizontal()?0:1;s[h]+=u+c/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",defaultBarGap:"10%"},e}(Mn);Mn.registerClass(Yp);var $P=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return cp(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 t=this.get("progressiveThreshold"),i=this.get("largeThreshold");return i>t&&(t=i),t},e.prototype.brushSelector=function(t,i,r){return r.rect(i.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=u1(Yp.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:Z.color.primary,borderWidth:2}},realtimeSort:!1}),e}(Yp),fc="\0__throttleOriginMethod",fb="\0__throttleRate",pb="\0__throttleType";function pc(n,e,t){var i,r=0,o=0,a=null,s,l,u,c;e=e||0;function h(){o=new Date().getTime(),a=null,n.apply(l,u||[])}var d=function(){for(var f=[],p=0;p<arguments.length;p++)f[p]=arguments[p];i=new Date().getTime(),l=this,u=f;var g=c||e,m=c||t;c=null,s=i-(m?r:o)-g,clearTimeout(a),m?a=setTimeout(h,g):s>=0?h():a=setTimeout(h,-s),r=i};return d.clear=function(){a&&(clearTimeout(a),a=null)},d.debounceNextCall=function(f){c=f},d}function qp(n,e,t,i){var r=n[e];if(r){var o=r[fc]||r,a=r[pb],s=r[fb];if(s!==t||a!==i){if(t==null||!i)return n[e]=o;r=n[e]=pc(o,t,i==="debounce"),r[fc]=o,r[pb]=i,r[fb]=t}return r}}function jp(n,e){var t=n[e];t&&t[fc]&&(t.clear&&t.clear(),n[e]=t[fc])}var ZP=function(){function n(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return n}(),gb=function(n){W(e,n);function e(t){var i=n.call(this,t)||this;return i.type="sausage",i}return e.prototype.getDefaultShape=function(){return new ZP},e.prototype.buildPath=function(t,i){var r=i.cx,o=i.cy,a=Math.max(i.r0||0,0),s=Math.max(i.r,0),l=(s-a)*.5,u=a+l,c=i.startAngle,h=i.endAngle,d=i.clockwise,f=Math.PI*2,p=d?h-c<f:c-h<f;p||(c=h-(d?f:-f));var g=Math.cos(c),m=Math.sin(c),y=Math.cos(h),v=Math.sin(h);p?(t.moveTo(g*a+r,m*a+o),t.arc(g*u+r,m*u+o,l,-Math.PI+c,c,!d)):t.moveTo(g*s+r,m*s+o),t.arc(r,o,s,c,h,!d),t.arc(y*u+r,v*u+o,l,h-Math.PI*2,h-Math.PI,!d),a!==0&&t.arc(r,o,a,h,c,d)},e}(Ae);function XP(n,e){e=e||{};var t=e.isRoundCap;return function(i,r,o){var a=r.position;if(!a||a instanceof Array)return ql(i,r,o);var s=n(a),l=r.distance!=null?r.distance:5,u=this.shape,c=u.cx,h=u.cy,d=u.r,f=u.r0,p=(d+f)/2,g=u.startAngle,m=u.endAngle,y=(g+m)/2,v=t?Math.abs(d-f)/2:0,_=Math.cos,b=Math.sin,T=c+d*_(g),w=h+d*b(g),S="left",M="top";switch(s){case"startArc":T=c+(f-l)*_(y),w=h+(f-l)*b(y),S="center",M="top";break;case"insideStartArc":T=c+(f+l)*_(y),w=h+(f+l)*b(y),S="center",M="bottom";break;case"startAngle":T=c+p*_(g)+gc(g,l+v,!1),w=h+p*b(g)+mc(g,l+v,!1),S="right",M="middle";break;case"insideStartAngle":T=c+p*_(g)+gc(g,-l+v,!1),w=h+p*b(g)+mc(g,-l+v,!1),S="left",M="middle";break;case"middle":T=c+p*_(y),w=h+p*b(y),S="center",M="middle";break;case"endArc":T=c+(d+l)*_(y),w=h+(d+l)*b(y),S="center",M="bottom";break;case"insideEndArc":T=c+(d-l)*_(y),w=h+(d-l)*b(y),S="center",M="top";break;case"endAngle":T=c+p*_(m)+gc(m,l+v,!0),w=h+p*b(m)+mc(m,l+v,!0),S="left",M="middle";break;case"insideEndAngle":T=c+p*_(m)+gc(m,-l+v,!0),w=h+p*b(m)+mc(m,-l+v,!0),S="right",M="middle";break;default:return ql(i,r,o)}return i=i||{},i.x=T,i.y=w,i.align=S,i.verticalAlign=M,i}}function KP(n,e,t,i){if(Ne(i)){n.setTextConfig({rotation:i});return}else if(q(e)){n.setTextConfig({rotation:0});return}var r=n.shape,o=r.clockwise?r.startAngle:r.endAngle,a=r.clockwise?r.endAngle:r.startAngle,s=(o+a)/2,l,u=t(e);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=s;break;case"startAngle":case"insideStartAngle":l=o;break;case"endAngle":case"insideEndAngle":l=a;break;default:n.setTextConfig({rotation:0});return}var c=Math.PI*1.5-l;u==="middle"&&c>Math.PI/2&&c<Math.PI*1.5&&(c-=Math.PI),n.setTextConfig({rotation:c})}function gc(n,e,t){return e*Math.sin(n)*(t?-1:1)}function mc(n,e,t){return e*Math.cos(n)*(t?1:-1)}function Bs(n,e,t){var i=n.get("borderRadius");if(i==null)return t?{cornerRadius:0}:null;q(i)||(i=[i,i,i,i]);var r=Math.abs(e.r||0-e.r0||0);return{cornerRadius:$(i,function(o){return Oi(o,r)})}}var $p=Math.max,Zp=Math.min;function QP(n,e){var t=n.getArea&&n.getArea();if(ia(n,"cartesian2d")){var i=n.getBaseAxis();if(i.type!=="category"||!i.onBand){var r=e.getLayout("bandWidth");i.isHorizontal()?(t.x-=r,t.width+=r*2):(t.y-=r,t.height+=r*2)}}return t}var JP=function(n){W(e,n);function e(){var t=n.call(this)||this;return t.type=e.type,t._isFirstFrame=!0,t}return e.prototype.render=function(t,i,r,o){this._model=t,this._removeOnRenderedListener(r),this._updateDrawMode(t);var a=t.get("coordinateSystem");a==="cartesian2d"||a==="polar"?(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,i,r):this._renderNormal(t,i,r,o)):process.env.NODE_ENV!=="production"&&st("Only cartesian2d and polar supported for bar.")},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,i){this._progressiveEls=[],this._incrementalRenderLarge(t,i)},e.prototype.eachRendered=function(t){ws(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var i=t.pipelineContext.large;(this._isLargeDraw==null||i!==this._isLargeDraw)&&(this._isLargeDraw=i,this._clear())},e.prototype._renderNormal=function(t,i,r,o){var a=this.group,s=t.getData(),l=this._data,u=t.coordinateSystem,c=u.getBaseAxis(),h;u.type==="cartesian2d"?h=c.isHorizontal():u.type==="polar"&&(h=c.dim==="angle");var d=t.isAnimationEnabled()?t:null,f=ez(t,u);f&&this._enableRealtimeSort(f,s,r);var p=t.get("clip",!0)||f,g=QP(u,s);a.removeClipPath();var m=t.get("roundCap",!0),y=t.get("showBackground",!0),v=t.getModel("backgroundStyle"),_=v.get("borderRadius")||0,b=[],T=this._backgroundEls,w=o&&o.isInitSort,S=o&&o.type==="changeAxisOrder";function M(E){var k=yc[u.type](s,E);if(!k)return null;var D=sz(u,h,k);return D.useStyle(v.getItemStyle()),u.type==="cartesian2d"?D.setShape("r",_):D.setShape("cornerRadius",_),b[E]=D,D}s.diff(l).add(function(E){var k=s.getItemModel(E),D=yc[u.type](s,E,k);if(D&&(y&&M(E),!(!s.hasValue(E)||!xb[u.type](D)))){var A=!1;p&&(A=mb[u.type](g,D));var R=yb[u.type](t,s,E,D,h,d,c.model,!1,m);f&&(R.forceLabelAnimation=!0),wb(R,s,E,k,D,t,h,u.type==="polar"),w?R.attr({shape:D}):f?vb(f,d,R,D,E,h,!1,!1):$t(R,{shape:D},t,E),s.setItemGraphicEl(E,R),a.add(R),R.ignore=A}}).update(function(E,k){var D=s.getItemModel(E),A=yc[u.type](s,E,D);if(A){if(y){var R=void 0;T.length===0?R=M(k):(R=T[k],R.useStyle(v.getItemStyle()),u.type==="cartesian2d"?R.setShape("r",_):R.setShape("cornerRadius",_),b[E]=R);var L=yc[u.type](s,E),V=Cb(h,L,u);ft(R,{shape:V},d,E)}var z=l.getItemGraphicEl(k);if(!s.hasValue(E)||!xb[u.type](A)){a.remove(z);return}var H=!1;p&&(H=mb[u.type](g,A),H&&a.remove(z));var F=z&&(z.type==="sector"&&m||z.type==="sausage"&&!m);if(F&&(z&&vs(z,t,k),z=null),z?zf(z):z=yb[u.type](t,s,E,A,h,d,c.model,!0,m),f&&(z.forceLabelAnimation=!0),S){var j=z.getTextContent();if(j){var Y=ju(j);Y.prevValue!=null&&(Y.prevValue=Y.value)}}else wb(z,s,E,D,A,t,h,u.type==="polar");w?z.attr({shape:A}):f?vb(f,d,z,A,E,h,!0,S):ft(z,{shape:A},t,E,null),s.setItemGraphicEl(E,z),z.ignore=H,a.add(z)}}).remove(function(E){var k=l.getItemGraphicEl(E);k&&vs(k,t,E)}).execute();var C=this._backgroundGroup||(this._backgroundGroup=new Ye);C.removeAll();for(var I=0;I<b.length;++I)C.add(b[I]);a.add(C),this._backgroundEls=b,this._data=s},e.prototype._renderLarge=function(t,i,r){this._clear(),Tb(t,this.group),this._updateLargeClip(t)},e.prototype._incrementalRenderLarge=function(t,i){this._removeBackground(),Tb(i,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(t){var i=t.get("clip",!0)&&CP(t.coordinateSystem,!1,t),r=this.group;i?r.setClipPath(i):r.removeClipPath()},e.prototype._enableRealtimeSort=function(t,i,r){var o=this;if(i.count()){var a=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(i,t,r),this._isFirstFrame=!1;else{var s=function(l){var u=i.getItemGraphicEl(l),c=u&&u.shape;return c&&Math.abs(a.isHorizontal()?c.height:c.width)||0};this._onRendered=function(){o._updateSortWithinSameData(i,s,a,r)},r.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(t,i,r){var o=[];return t.each(t.mapDimension(i.dim),function(a,s){var l=r(s);l=l??NaN,o.push({dataIndex:s,mappedValue:l,ordinalNumber:a})}),o.sort(function(a,s){return s.mappedValue-a.mappedValue}),{ordinalNumbers:$(o,function(a){return a.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(t,i,r){for(var o=r.scale,a=t.mapDimension(r.dim),s=Number.MAX_VALUE,l=0,u=o.getOrdinalMeta().categories.length;l<u;++l){var c=t.rawIndexOf(a,o.getRawOrdinalNumber(l)),h=c<0?Number.MIN_VALUE:i(t.indexOfRawIndex(c));if(h>s)return!0;s=h}return!1},e.prototype._isOrderDifferentInView=function(t,i){for(var r=i.scale,o=r.getExtent(),a=Math.max(0,o[0]),s=Math.min(o[1],r.getOrdinalMeta().categories.length-1);a<=s;++a)if(t.ordinalNumbers[a]!==r.getRawOrdinalNumber(a))return!0},e.prototype._updateSortWithinSameData=function(t,i,r,o){if(this._isOrderChangedWithinSameData(t,i,r)){var a=this._dataSort(t,r,i);this._isOrderDifferentInView(a,r)&&(this._removeOnRenderedListener(o),o.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",axisId:r.index,sortInfo:a}))}},e.prototype._dispatchInitSort=function(t,i,r){var o=i.baseAxis,a=this._dataSort(t,o,function(s){return t.get(t.mapDimension(i.otherAxis.dim),s)});r.dispatchAction({type:"changeAxisOrder",componentType:o.dim+"Axis",isInitSort:!0,axisId:o.index,sortInfo:a})},e.prototype.remove=function(t,i){this._clear(this._model),this._removeOnRenderedListener(i)},e.prototype.dispose=function(t,i){this._removeOnRenderedListener(i)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var i=this.group,r=this._data;t&&t.isAnimationEnabled()&&r&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],r.eachItemGraphicEl(function(o){vs(o,t,Se(o).dataIndex)})):i.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(ln),mb={cartesian2d:function(n,e){var t=e.width<0?-1:1,i=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var r=n.x+n.width,o=n.y+n.height,a=$p(e.x,n.x),s=Zp(e.x+e.width,r),l=$p(e.y,n.y),u=Zp(e.y+e.height,o),c=s<a,h=u<l;return e.x=c&&a>r?s:a,e.y=h&&l>o?u:l,e.width=c?0:s-a,e.height=h?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),c||h},polar:function(n,e){var t=e.r0<=e.r?1:-1;if(t<0){var i=e.r;e.r=e.r0,e.r0=i}var r=Zp(e.r,n.r),o=$p(e.r0,n.r0);e.r=r,e.r0=o;var a=r-o<0;if(t<0){var i=e.r;e.r=e.r0,e.r0=i}return a}},yb={cartesian2d:function(n,e,t,i,r,o,a,s,l){var u=new Ue({shape:U({},i),z2:1});if(u.__dataIndex=t,u.name="item",o){var c=u.shape,h=r?"height":"width";c[h]=0}return u},polar:function(n,e,t,i,r,o,a,s,l){var u=!r&&l?gb:Gi,c=new u({shape:i,z2:1});c.name="item";var h=bb(r);if(c.calculateTextPosition=XP(h,{isRoundCap:u===gb}),o){var d=c.shape,f=r?"r":"endAngle",p={};d[f]=r?i.r0:i.startAngle,p[f]=i[f],(s?ft:$t)(c,{shape:p},o)}return c}};function ez(n,e){var t=n.get("realtimeSort",!0),i=e.getBaseAxis();if(process.env.NODE_ENV!=="production"&&t&&(i.type!=="category"&&st("`realtimeSort` will not work because this bar series is not based on a category axis."),e.type!=="cartesian2d"&&st("`realtimeSort` will not work because this bar series is not on cartesian2d.")),t&&i.type==="category"&&e.type==="cartesian2d")return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}function vb(n,e,t,i,r,o,a,s){var l,u;o?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(a?ft:$t)(t,{shape:l},e,r,null);var c=e?n.baseAxis.model:null;(a?ft:$t)(t,{shape:u},c,r)}function _b(n,e){for(var t=0;t<e.length;t++)if(!isFinite(n[e[t]]))return!0;return!1}var tz=["x","y","width","height"],nz=["cx","cy","r","startAngle","endAngle"],xb={cartesian2d:function(n){return!_b(n,tz)},polar:function(n){return!_b(n,nz)}},yc={cartesian2d:function(n,e,t){var i=n.getItemLayout(e);if(!i)return null;var r=t?rz(t,i):0,o=i.width>0?1:-1,a=i.height>0?1:-1;return{x:i.x+o*r/2,y:i.y+a*r/2,width:i.width-o*r,height:i.height-a*r}},polar:function(n,e,t){var i=n.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function iz(n){return n.startAngle!=null&&n.endAngle!=null&&n.startAngle===n.endAngle}function bb(n){return function(e){var t=e?"Arc":"Angle";return function(i){switch(i){case"start":case"insideStart":case"end":case"insideEnd":return i+t;default:return i}}}(n)}function wb(n,e,t,i,r,o,a,s){var l=e.getItemVisual(t,"style");if(s){if(!o.get("roundCap")){var u=n.shape,c=Bs(i.getModel("itemStyle"),u,!0);U(u,c),n.setShape(u)}}else{var h=i.get(["itemStyle","borderRadius"])||0;n.setShape("r",h)}n.useStyle(l);var d=i.getShallow("cursor");d&&n.attr("cursor",d);var f=s?a?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?r.height>=0?"bottom":"top":r.width>=0?"right":"left",p=Ui(i);Fr(n,p,{labelFetcher:o,labelDataIndex:t,defaultText:Bp(o.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:f});var g=n.getTextContent();if(s&&g){var m=i.get(["label","position"]);n.textConfig.inside=m==="middle"?!0:null,KP(n,m==="outside"?f:m,bb(a),i.get(["label","rotate"]))}XO(g,p,o.getRawValue(t),function(v){return W1(e,v)});var y=i.getModel(["emphasis"]);zr(n,y.get("focus"),y.get("blurScope"),y.get("disabled")),fs(n,i),iz(r)&&(n.style.fill="none",n.style.stroke="none",N(n.states,function(v){v.style&&(v.style.fill=v.style.stroke="none")}))}function rz(n,e){var t=n.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var i=n.get(["itemStyle","borderWidth"])||0,r=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),o=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(i,r,o)}var oz=function(){function n(){}return n}(),Sb=function(n){W(e,n);function e(t){var i=n.call(this,t)||this;return i.type="largeBar",i}return e.prototype.getDefaultShape=function(){return new oz},e.prototype.buildPath=function(t,i){for(var r=i.points,o=this.baseDimIdx,a=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c<r.length;c+=3)l[o]=u,l[a]=r[c+2],s[o]=r[c+o],s[a]=r[c+a],t.rect(s[0],s[1],l[0],l[1])},e}(Ae);function Tb(n,e,t,i){var r=n.getData(),o=r.getLayout("valueAxisHorizontal")?1:0,a=r.getLayout("largeDataIndices"),s=r.getLayout("size"),l=n.getModel("backgroundStyle"),u=r.getLayout("largeBackgroundPoints");if(u){var c=new Sb({shape:{points:u},incremental:!!i,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),e.add(c),t&&t.push(c)}var h=new Sb({shape:{points:r.getLayout("largePoints")},incremental:!!i,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=a,h.barWidth=s,e.add(h),h.useStyle(r.getVisual("style")),h.style.stroke=null,Se(h).seriesIndex=n.seriesIndex,n.get("silent")||(h.on("mousedown",Mb),h.on("mousemove",Mb)),t&&t.push(h)}var Mb=pc(function(n){var e=this,t=az(e,n.offsetX,n.offsetY);Se(e).dataIndex=t>=0?t:null},30,!1);function az(n,e,t){for(var i=n.baseDimIdx,r=1-i,o=n.shape.points,a=n.largeDataIndices,s=[],l=[],u=n.barWidth,c=0,h=o.length/3;c<h;c++){var d=c*3;if(l[i]=u,l[r]=o[d+2],s[i]=o[d+i],s[r]=o[d+r],l[r]<0&&(s[r]+=l[r],l[r]=-l[r]),e>=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return a[c]}return-1}function Cb(n,e,t){if(ia(t,"cartesian2d")){var i=e,r=t.getArea();return{x:n?i.x:r.x,y:n?r.y:i.y,width:n?i.width:r.width,height:n?r.height:i.height}}else{var r=t.getArea(),o=e;return{cx:r.cx,cy:r.cy,r0:n?r.r0:o.r0,r:n?r.r:o.r,startAngle:n?o.startAngle:0,endAngle:n?o.endAngle:Math.PI*2}}}function sz(n,e,t){var i=n.type==="polar"?Gi:Ue;return new i({shape:Cb(e,t,n),silent:!0,z2:0})}function lz(n){n.registerChartView(JP),n.registerSeriesModel($P),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,we(YP,"bar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,qP("bar")),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,sb("bar")),n.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},function(r){e.sortInfo&&r.axis.setCategorySortInfo(e.sortInfo)})})}function uz(n,e){function t(i,r){var o=[];return i.eachComponent({mainType:"series",subType:n,query:r},function(a){o.push(a.seriesIndex)}),o}N([[n+"ToggleSelect","toggleSelect"],[n+"Select","select"],[n+"UnSelect","unselect"]],function(i){e(i[0],function(r,o,a){r=U({},r),process.env.NODE_ENV!=="production"&&rt(r.type,i[1]),a.dispatchAction(U(r,{type:i[1],seriesIndex:t(o,r)}))})})}function ra(n,e,t,i,r){var o=n+e;t.isSilent(o)||(process.env.NODE_ENV!=="production"&&fi("event "+o+" is deprecated."),i.eachComponent({mainType:"series",subType:"pie"},function(a){for(var s=a.seriesIndex,l=a.option.selectedMap,u=r.selected,c=0;c<u.length;c++)if(u[c].seriesIndex===s){var h=a.getData(),d=Or(h,r.fromActionPayload);t.trigger(o,{type:o,seriesId:a.id,name:q(d)?h.getName(d[0]):h.getName(d),selected:Q(l)?l:U({},l)})}}))}function cz(n,e,t){n.on("selectchanged",function(i){var r=t.getModel();i.isFromClick?(ra("map","selectchanged",e,r,i),ra("pie","selectchanged",e,r,i)):i.fromAction==="select"?(ra("map","selected",e,r,i),ra("pie","selected",e,r,i)):i.fromAction==="unselect"&&(ra("map","unselected",e,r,i),ra("pie","unselected",e,r,i))})}var kb=Math.PI*2,vc=Math.PI/180;function hz(n,e,t){e.eachSeriesByType(n,function(i){var r=i.getData(),o=r.mapDimension("value"),a=xL(i,t),s=a.cx,l=a.cy,u=a.r,c=a.r0,h=a.viewRect,d=-i.get("startAngle")*vc,f=i.get("endAngle"),p=i.get("padAngle")*vc;f=f==="auto"?d-kb:-f*vc;var g=i.get("minAngle")*vc,m=g+p,y=0;r.each(o,function(V){!isNaN(V)&&y++});var v=r.getSum(o),_=Math.PI/(v||y)*2,b=i.get("clockwise"),T=i.get("roseType"),w=i.get("stillShowZeroSum"),S=r.getDataExtent(o);S[0]=0;var M=b?1:-1,C=[d,f],I=M*p/2;X0(C,!b),d=C[0],f=C[1];var E=Db(i);E.startAngle=d,E.endAngle=f,E.clockwise=b,E.cx=s,E.cy=l,E.r=u,E.r0=c;var k=Math.abs(f-d),D=k,A=0,R=d;if(r.setLayout({viewRect:h,r:u}),r.each(o,function(V,z){var H;if(isNaN(V)){r.setItemLayout(z,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:b,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?H=v===0&&w?_:V*_:H=k/y,H<m?(H=m,D-=m):A+=V;var F=R+M*H,j=0,Y=0;p>H?(j=R+M*H/2,Y=j):(j=R+I,Y=F-I),r.setItemLayout(z,{angle:H,startAngle:j,endAngle:Y,clockwise:b,cx:s,cy:l,r0:c,r:T?jt(V,S,[c,u]):u}),R=F}),D<kb&&y)if(D<=.001){var L=k/y;r.each(o,function(V,z){if(!isNaN(V)){var H=r.getItemLayout(z);H.angle=L;var F=0,j=0;L<p?(F=d+M*(z+1/2)*L,j=F):(F=d+M*z*L+I,j=d+M*(z+1)*L-I),H.startAngle=F,H.endAngle=j}})}else _=D/A,R=d,r.each(o,function(V,z){if(!isNaN(V)){var H=r.getItemLayout(z),F=H.angle===m?m:V*_,j=0,Y=0;F<p?(j=R+M*F/2,Y=j):(j=R+I,Y=R+M*F-I),H.startAngle=j,H.endAngle=Y,R+=M*F}})})}var Db=Re();function dz(n){return{seriesType:n,reset:function(e,t){var i=t.findComponents({mainType:"legend"});if(!(!i||!i.length)){var r=e.getData();r.filterSelf(function(o){for(var a=r.getName(o),s=0;s<i.length;s++)if(!i[s].isSelected(a))return!1;return!0})}}}}function Ib(n,e,t,i,r,o,a,s){var l=r-n,u=o-e,c=t-n,h=i-e,d=Math.sqrt(c*c+h*h);c/=d,h/=d;var f=l*c+u*h,p=f/d;p*=d;var g=a[0]=n+p*c,m=a[1]=e+p*h;return Math.sqrt((g-r)*(g-r)+(m-o)*(m-o))}var er=new ye,Xe=new ye,gt=new ye,tr=new ye,$n=new ye,_c=[],It=new ye;function fz(n,e){if(e<=180&&e>0){e=e/180*Math.PI,er.fromArray(n[0]),Xe.fromArray(n[1]),gt.fromArray(n[2]),ye.sub(tr,er,Xe),ye.sub($n,gt,Xe);var t=tr.len(),i=$n.len();if(!(t<.001||i<.001)){tr.scale(1/t),$n.scale(1/i);var r=tr.dot($n),o=Math.cos(e);if(o<r){var a=Ib(Xe.x,Xe.y,gt.x,gt.y,er.x,er.y,_c);It.fromArray(_c),It.scaleAndAdd($n,a/Math.tan(Math.PI-e));var s=gt.x!==Xe.x?(It.x-Xe.x)/(gt.x-Xe.x):(It.y-Xe.y)/(gt.y-Xe.y);if(isNaN(s))return;s<0?ye.copy(It,Xe):s>1&&ye.copy(It,gt),It.toArray(n[1])}}}}function pz(n,e,t){if(t<=180&&t>0){t=t/180*Math.PI,er.fromArray(n[0]),Xe.fromArray(n[1]),gt.fromArray(n[2]),ye.sub(tr,Xe,er),ye.sub($n,gt,Xe);var i=tr.len(),r=$n.len();if(!(i<.001||r<.001)){tr.scale(1/i),$n.scale(1/r);var o=tr.dot(e),a=Math.cos(t);if(o<a){var s=Ib(Xe.x,Xe.y,gt.x,gt.y,er.x,er.y,_c);It.fromArray(_c);var l=Math.PI/2,u=Math.acos($n.dot(e)),c=l+u-t;if(c>=l)ye.copy(It,gt);else{It.scaleAndAdd($n,s/Math.tan(Math.PI/2-c));var h=gt.x!==Xe.x?(It.x-Xe.x)/(gt.x-Xe.x):(It.y-Xe.y)/(gt.y-Xe.y);if(isNaN(h))return;h<0?ye.copy(It,Xe):h>1&&ye.copy(It,gt)}It.toArray(n[1])}}}}function Xp(n,e,t,i){var r=t==="normal",o=r?n:n.ensureState(t);o.ignore=e;var a=i.get("smooth");a&&a===!0&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?n.useStyle(s):o.style=s}function gz(n,e){var t=e.smooth,i=e.points;if(i)if(n.moveTo(i[0][0],i[0][1]),t>0&&i.length>=3){var r=kd(i[0],i[1]),o=kd(i[1],i[2]);if(!r||!o){n.lineTo(i[1][0],i[1][1]),n.lineTo(i[2][0],i[2][1]);return}var a=Math.min(r,o)*t,s=Dd([],i[1],i[0],a/r),l=Dd([],i[1],i[2],a/o),u=Dd([],s,l,.5);n.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),n.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c<i.length;c++)n.lineTo(i[c][0],i[c][1])}function mz(n,e,t){var i=n.getTextGuideLine(),r=n.getTextContent();if(!r){i&&n.removeTextGuideLine();return}for(var o=e.normal,a=o.get("show"),s=r.ignore,l=0;l<Du.length;l++){var u=Du[l],c=e[u],h=u==="normal";if(c){var d=c.get("show"),f=h?s:te(r.states[u]&&r.states[u].ignore,s);if(f||!te(d,a)){var p=h?i:i&&i.states[u];p&&(p.ignore=!0),i&&Xp(i,!0,u,c);continue}i||(i=new jo,n.setTextGuideLine(i),!h&&(s||!a)&&Xp(i,!0,"normal",e.normal),n.stateProxy&&(i.stateProxy=n.stateProxy)),Xp(i,!1,u,c)}}if(i){Me(i.style,t),i.style.fill=null;var g=o.get("showAbove"),m=n.textGuideLineConfig=n.textGuideLineConfig||{};m.showAbove=g||!1,i.buildPath=gz}}function yz(n,e){e=e||"labelLine";for(var t={normal:n.getModel(e)},i=0;i<Pt.length;i++){var r=Pt[i];t[r]=n.getModel([r,e])}return t}var Eb=["label","labelLine","layoutOption","priority","defaultAttr","marginForce","minMarginForce","marginDefault","suggestIgnore"],vz=1,xc=2,Nb=vz|xc;function bc(n,e,t){t=t||Nb,e?n.dirty|=t:n.dirty&=~t}function Ab(n,e){return e=e||Nb,n.dirty==null||!!(n.dirty&e)}function nr(n){if(n)return Ab(n)&&Ob(n,n.label,n),n}function Ob(n,e,t){var i=e.getComputedTransform();n.transform=Yf(n.transform,i);var r=n.localRect=Ss(n.localRect,e.getBoundingRect()),o=e.style,a=o.margin,s=t&&t.marginForce,l=t&&t.minMarginForce,u=t&&t.marginDefault,c=o.__marginType;c==null&&u&&(a=u,c=Zo.textMargin);for(var h=0;h<4;h++)Kp[h]=c===Zo.minMargin&&l&&l[h]!=null?l[h]:s&&s[h]!=null?s[h]:a?a[h]:0;c===Zo.textMargin&&Uu(r,Kp,!1,!1);var d=n.rect=Ss(n.rect,r);return i&&d.applyTransform(i),c===Zo.minMargin&&Uu(d,Kp,!1,!1),n.axisAligned=Uf(i),(n.label=n.label||{}).ignore=e.ignore,bc(n,!1),bc(n,!0,xc),n}var Kp=[0,0,0,0];function _z(n,e,t){return n.transform=Yf(n.transform,t),n.localRect=Ss(n.localRect,e),n.rect=Ss(n.rect,e),t&&n.rect.applyTransform(t),n.axisAligned=Uf(t),n.obb=void 0,(n.label=n.label||{}).ignore=!1,n}function xz(n,e){if(n){n.label.x+=e.x,n.label.y+=e.y,n.label.markRedraw();var t=n.transform;t&&(t[4]+=e.x,t[5]+=e.y);var i=n.rect;i&&(i.x+=e.x,i.y+=e.y);var r=n.obb;r&&r.fromBoundingRect(n.localRect,t)}}function Rb(n,e){for(var t=0;t<Eb.length;t++){var i=Eb[t];n[i]==null&&(n[i]=e[i])}return nr(n)}function Lb(n){var e=n.obb;return(!e||Ab(n,xc))&&(n.obb=e=e||new cx,e.fromBoundingRect(n.localRect,n.transform),bc(n,!1,xc)),e}function bz(n,e,t,i,r){var o=n.length,a=Wi[e],s=$o[e];if(o<2)return!1;n.sort(function(S,M){return S.rect[a]-M.rect[a]});for(var l=0,u,c=!1,h=0;h<o;h++){var d=n[h],f=d.rect;u=f[a]-l,u<0&&(f[a]-=u,d.label[a]-=u,c=!0),l=f[a]+f[s]}var p=n[0],g=n[o-1],m,y;v(),m<0&&T(-m,.8),y<0&&T(y,.8),v(),_(m,y,1),_(y,m,-1),v(),m<0&&w(-m),y<0&&w(y);function v(){m=p.rect[a]-t,y=i-g.rect[a]-g.rect[s]}function _(S,M,C){if(S<0){var I=Math.min(M,-S);if(I>0){b(I*C,0,o);var E=I+S;E<0&&T(-E*C,1)}else T(-S*C,1)}}function b(S,M,C){S!==0&&(c=!0);for(var I=M;I<C;I++){var E=n[I],k=E.rect;k[a]+=S,E.label[a]+=S}}function T(S,M){for(var C=[],I=0,E=1;E<o;E++){var k=n[E-1].rect,D=Math.max(n[E].rect[a]-k[a]-k[s],0);C.push(D),I+=D}if(I){var A=Math.min(Math.abs(S)/I,M);if(S>0)for(var E=0;E<o-1;E++){var R=C[E]*A;b(R,0,E+1)}else for(var E=o-1;E>0;E--){var R=C[E-1]*A;b(-R,E,o)}}}function w(S){var M=S<0?-1:1;S=Math.abs(S);for(var C=Math.ceil(S/(o-1)),I=0;I<o-1;I++)if(M>0?b(C,0,I+1):b(-C,o-I-1,o),S-=C,S<=0)return}return c}function wz(n){var e=[];n.sort(function(u,c){return(c.suggestIgnore?1:0)-(u.suggestIgnore?1:0)||c.priority-u.priority});function t(u){if(!u.ignore){var c=u.ensureState("emphasis");c.ignore==null&&(c.ignore=!1)}u.ignore=!0}for(var i=0;i<n.length;i++){var r=nr(n[i]);if(!r.label.ignore){for(var o=r.label,a=r.labelLine,s=!1,l=0;l<e.length;l++)if(Qp(r,e[l],null,{touchThreshold:.05})){s=!0;break}s?(t(o),a&&t(a)):e.push(r)}}}function Qp(n,e,t,i){return!n||!e||n.label&&n.label.ignore||e.label&&e.label.ignore||!n.rect.intersect(e.rect,t,i)?!1:n.axisAligned&&e.axisAligned?!0:Lb(n).intersect(Lb(e),t,i)}var Sz=Math.PI/180;function Pb(n,e,t,i,r,o,a,s,l,u){if(n.length<2)return;function c(g){for(var m=g.rB,y=m*m,v=0;v<g.list.length;v++){var _=g.list[v],b=Math.abs(_.label.y-t),T=i+_.len,w=T*T,S=Math.sqrt(Math.abs((1-b*b/y)*w)),M=e+(S+_.len2)*r,C=M-_.label.x,I=_.targetTextWidth-C*r;zb(_,I,!0),_.label.x=M}}function h(g){for(var m={list:[],maxY:0},y={list:[],maxY:0},v=0;v<g.length;v++)if(g[v].labelAlignTo==="none"){var _=g[v],b=_.label.y>t?y:m,T=Math.abs(_.label.y-t);if(T>=b.maxY){var w=_.label.x-e-_.len2*r,S=i+_.len,M=Math.abs(w)<S?Math.sqrt(T*T/(1-w*w/S/S)):S;b.rB=M,b.maxY=T}b.list.push(_)}c(m),c(y)}for(var d=n.length,f=0;f<d;f++)if(n[f].position==="outer"&&n[f].labelAlignTo==="labelLine"){var p=n[f].label.x-u;n[f].linePoints[1][0]+=p,n[f].label.x=u}bz(n,1,l,l+a)&&h(n)}function Tz(n,e,t,i,r,o,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<n.length;d++){var f=n[d].label;Jp(n[d])||(f.x<e?(c=Math.min(c,f.x),l.push(n[d])):(h=Math.max(h,f.x),u.push(n[d])))}for(var d=0;d<n.length;d++){var p=n[d];if(!Jp(p)&&p.linePoints){if(p.labelStyleWidth!=null)continue;var f=p.label,g=p.linePoints,m=void 0;p.labelAlignTo==="edge"?f.x<e?m=g[2][0]-p.labelDistance-a-p.edgeDistance:m=a+r-p.edgeDistance-g[2][0]-p.labelDistance:p.labelAlignTo==="labelLine"?f.x<e?m=c-a-p.bleedMargin:m=a+r-h-p.bleedMargin:f.x<e?m=f.x-a-p.bleedMargin:m=a+r-f.x-p.bleedMargin,p.targetTextWidth=m,zb(p,m,!1)}}Pb(u,e,t,i,1,r,o,a,s,h),Pb(l,e,t,i,-1,r,o,a,s,c);for(var d=0;d<n.length;d++){var p=n[d];if(!Jp(p)&&p.linePoints){var f=p.label,g=p.linePoints,y=p.labelAlignTo==="edge",v=f.style.padding,_=v?v[1]+v[3]:0,b=f.style.backgroundColor?0:_,T=p.rect.width+b,w=g[1][0]-g[2][0];y?f.x<e?g[2][0]=a+p.edgeDistance+T+p.labelDistance:g[2][0]=a+r-p.edgeDistance-T-p.labelDistance:(f.x<e?g[2][0]=f.x+p.labelDistance:g[2][0]=f.x-p.labelDistance,g[1][0]=g[2][0]+w),g[1][1]=g[2][1]=f.y}}}function zb(n,e,t){if(n.labelStyleWidth==null){var i=n.label,r=i.style,o=n.rect,a=r.backgroundColor,s=r.padding,l=s?s[1]+s[3]:0,u=r.overflow,c=o.width+(a?0:l);if(e<c||t){if(u&&u.match("break")){i.setStyle("backgroundColor",null),i.setStyle("width",e-l);var h=i.getBoundingRect();i.setStyle("width",Math.ceil(h.width)),i.setStyle("backgroundColor",a)}else{var d=e-l,f=e<c?d:t?d>n.unconstrainedWidth?null:d:null;i.setStyle("width",f)}Bb(o,i)}}}function Bb(n,e){Vb.rect=n,Ob(Vb,e,Mz)}var Mz={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},Vb={};function Jp(n){return n.position==="center"}function Cz(n){var e=n.getData(),t=[],i,r,o=!1,a=(n.get("minShowLabelAngle")||0)*Sz,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,c=s.x,h=s.y,d=s.height;function f(w){w.ignore=!0}function p(w){if(!w.ignore)return!0;for(var S in w.states)if(w.states[S].ignore===!1)return!0;return!1}e.each(function(w){var S=e.getItemGraphicEl(w),M=S.shape,C=S.getTextContent(),I=S.getTextGuideLine(),E=e.getItemModel(w),k=E.getModel("label"),D=k.get("position")||E.get(["emphasis","label","position"]),A=k.get("distanceToLabelLine"),R=k.get("alignTo"),L=Pe(k.get("edgeDistance"),u),V=k.get("bleedMargin");V==null&&(V=Math.min(u,d)>200?10:2);var z=E.getModel("labelLine"),H=z.get("length");H=Pe(H,u);var F=z.get("length2");if(F=Pe(F,u),Math.abs(M.endAngle-M.startAngle)<a){N(C.states,f),C.ignore=!0,I&&(N(I.states,f),I.ignore=!0);return}if(p(C)){var j=(M.startAngle+M.endAngle)/2,Y=Math.cos(j),ee=Math.sin(j),pe,Te,qe,Je;i=M.cx,r=M.cy;var We=D==="inside"||D==="inner";if(D==="center")pe=M.cx,Te=M.cy,Je="center";else{var He=(We?(M.r+M.r0)/2*Y:M.r*Y)+i,Be=(We?(M.r+M.r0)/2*ee:M.r*ee)+r;if(pe=He+Y*3,Te=Be+ee*3,!We){var oe=He+Y*(H+l-M.r),xe=Be+ee*(H+l-M.r),ct=oe+(Y<0?-1:1)*F,X=xe;R==="edge"?pe=Y<0?c+L:c+u-L:pe=ct+(Y<0?-A:A),Te=X,qe=[[He,Be],[oe,xe],[ct,X]]}Je=We?"center":R==="edge"?Y>0?"right":"left":Y>0?"left":"right"}var de=Math.PI,ge=0,Fe=k.get("rotate");if(Ne(Fe))ge=Fe*(de/180);else if(D==="center")ge=0;else if(Fe==="radial"||Fe===!0){var tt=Y<0?-j+de:-j;ge=tt}else if(Fe==="tangential"&&D!=="outside"&&D!=="outer"){var je=Math.atan2(Y,ee);je<0&&(je=de*2+je);var Kt=ee>0;Kt&&(je=de+je),ge=je-de}if(o=!!ge,C.x=pe,C.y=Te,C.rotation=ge,C.setStyle({verticalAlign:"middle"}),We){C.setStyle({align:Je});var ei=C.states.select;ei&&(ei.x+=C.x,ei.y+=C.y)}else{var Da=new ve(0,0,0,0);Bb(Da,C),t.push({label:C,labelLine:I,position:D,len:H,len2:F,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new ye(Y,ee),linePoints:qe,textAlign:Je,labelDistance:A,labelAlignTo:R,edgeDistance:L,bleedMargin:V,rect:Da,unconstrainedWidth:Da.width,labelStyleWidth:C.style.width})}S.setTextConfig({inside:We})}}),!o&&n.get("avoidLabelOverlap")&&Tz(t,i,r,l,u,d,c,h);for(var g=0;g<t.length;g++){var m=t[g],y=m.label,v=m.labelLine,_=isNaN(y.x)||isNaN(y.y);if(y){y.setStyle({align:m.textAlign}),_&&(N(y.states,f),y.ignore=!0);var b=y.states.select;b&&(b.x+=y.x,b.y+=y.y)}if(v){var T=m.linePoints;_||!T?(N(v.states,f),v.ignore=!0):(fz(T,m.minTurnAngle),pz(T,m.surfaceNormal,m.maxSurfaceAngle),v.setShape({points:T}),y.__hostTarget.textGuideLineConfig={anchor:new ye(T[0][0],T[0][1])})}}}var kz=function(n){W(e,n);function e(t,i,r){var o=n.call(this)||this;o.z2=2;var a=new it;return o.setTextContent(a),o.updateData(t,i,r,!0),o}return e.prototype.updateData=function(t,i,r,o){var a=this,s=t.hostModel,l=t.getItemModel(i),u=l.getModel("emphasis"),c=t.getItemLayout(i),h=U(Bs(l.getModel("itemStyle"),c,!0),c);if(isNaN(h.startAngle)){a.setShape(h);return}if(o){a.setShape(h);var d=s.getShallow("animationType");s.ecModel.ssr?($t(a,{scaleX:0,scaleY:0},s,{dataIndex:i,isFrom:!0}),a.originX=h.cx,a.originY=h.cy):d==="scale"?(a.shape.r=c.r0,$t(a,{shape:{r:c.r}},s,i)):r!=null?(a.setShape({startAngle:r,endAngle:r}),$t(a,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},s,i)):(a.shape.endAngle=c.startAngle,ft(a,{shape:{endAngle:c.endAngle}},s,i))}else zf(a),ft(a,{shape:h},s,i);a.useStyle(t.getItemVisual(i,"style")),fs(a,l);var f=(c.startAngle+c.endAngle)/2,p=s.get("selectedOffset"),g=Math.cos(f)*p,m=Math.sin(f)*p,y=l.getShallow("cursor");y&&a.attr("cursor",y),this._updateLabel(s,t,i),a.ensureState("emphasis").shape=U({r:c.r+(u.get("scale")&&u.get("scaleSize")||0)},Bs(u.getModel("itemStyle"),c)),U(a.ensureState("select"),{x:g,y:m,shape:Bs(l.getModel(["select","itemStyle"]),c)}),U(a.ensureState("blur"),{shape:Bs(l.getModel(["blur","itemStyle"]),c)});var v=a.getTextGuideLine(),_=a.getTextContent();v&&U(v.ensureState("select"),{x:g,y:m}),U(_.ensureState("select"),{x:g,y:m}),zr(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,i,r){var o=this,a=i.getItemModel(r),s=a.getModel("labelLine"),l=i.getItemVisual(r,"style"),u=l&&l.fill,c=l&&l.opacity;Fr(o,Ui(a),{labelFetcher:i.hostModel,labelDataIndex:r,inheritColor:u,defaultOpacity:c,defaultText:t.getFormattedLabel(r,"normal")||i.getName(r)});var h=o.getTextContent();o.setTextConfig({position:null,rotation:null}),h.attr({z2:10});var d=a.get(["label","position"]);if(d!=="outside"&&d!=="outer")o.removeTextGuideLine();else{var f=this.getTextGuideLine();f||(f=new jo,this.setTextGuideLine(f)),mz(this,yz(a),{stroke:u,opacity:si(s.get(["lineStyle","opacity"]),c,1)})}},e}(Gi),Dz=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,i,r,o){var a=t.getData(),s=this._data,l=this.group,u;if(!s&&a.count()>0){for(var c=a.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h<a.count();++h)c=a.getItemLayout(h);c&&(u=c.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),a.count()===0&&t.get("showEmptyCircle")){var d=Db(t),f=new Gi({shape:ue(d)});f.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=f,l.add(f)}a.diff(s).add(function(p){var g=new kz(a,p,u);a.setItemGraphicEl(p,g),l.add(g)}).update(function(p,g){var m=s.getItemGraphicEl(g);m.updateData(a,p,u),m.off("click"),l.add(m),a.setItemGraphicEl(p,m)}).remove(function(p){var g=s.getItemGraphicEl(p);vs(g,t,p)}).execute(),Cz(t),t.get("animationTypeUpdate")!=="expansion"&&(this._data=a)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,i){var r=i.getData(),o=r.getItemLayout(0);if(o){var a=t[0]-o.cx,s=t[1]-o.cy,l=Math.sqrt(a*a+s*s);return l<=o.r&&l>=o.r0}},e.type="pie",e}(ln);function Iz(n,e,t){e=q(e)&&{coordDimensions:e}||U({encodeDefine:n.getEncode()},e);var i=n.getSource(),r=s1(i,e).dimensions,o=new jr(r,n);return o.initData(i,t),o}var Ez=function(){function n(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return n.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},n.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},n.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},n.prototype.getItemVisual=function(e,t){var i=this._getDataWithEncodedVisual();return i.getItemVisual(e,t)},n}(),Nz=Re(),Hb=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ez(ke(this.getData,this),ke(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){n.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Iz(this,{coordDimensions:["value"],encodeDefaulter:we(oR,this)})},e.prototype.getDataParams=function(t){var i=this.getData(),r=Nz(i),o=r.seats;if(!o){var a=[];i.each(i.mapDimension("value"),function(l){a.push(l)}),o=r.seats=yA(a,i.hostModel.get("percentPrecision"))}var s=n.prototype.getDataParams.call(this,t);return s.percent=o[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){Mu(t,"labelLine",["show"]);var i=t.labelLine,r=t.emphasis.labelLine;i.show=i.show&&t.label.show,r.show=r.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"50%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:"box",left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Mn);AR({fullType:Hb.type,getCoord2:function(n){return n.getShallow("center")}});function Az(n){return{seriesType:n,reset:function(e,t){var i=e.getData();i.filterSelf(function(r){var o=i.mapDimension("value"),a=i.get(o,r);return!(Ne(a)&&!isNaN(a)&&a<0)})}}}function Oz(n){n.registerChartView(Dz),n.registerSeriesModel(Hb),uz("pie",n.registerAction),n.registerLayout(we(hz,"pie")),n.registerProcessor(dz("pie")),n.registerProcessor(Az("pie"))}var oa=function(){function n(e,t){this.target=e,this.topTarget=t&&t.topTarget}return n}(),Rz=function(){function n(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return n.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new oa(t,e),"dragstart",e.event))},n.prototype._drag=function(e){var t=this._draggingTarget;if(t){var i=e.offsetX,r=e.offsetY,o=i-this._x,a=r-this._y;this._x=i,this._y=r,t.drift(o,a,e),this.handler.dispatchToElement(new oa(t,e),"drag",e.event);var s=this.handler.findHover(i,r,t).target,l=this._dropTarget;this._dropTarget=s,t!==s&&(l&&s!==l&&this.handler.dispatchToElement(new oa(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new oa(s,e),"dragenter",e.event))}},n.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new oa(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new oa(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},n}(),Lz=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,eg=[],Pz=fe.browser.firefox&&+fe.browser.version.split(".")[0]<39;function tg(n,e,t,i){return t=t||{},i?Fb(n,e,t):Pz&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):Fb(n,e,t),t}function Fb(n,e,t){if(fe.domSupported&&n.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(h1(n)){var o=n.getBoundingClientRect();t.zrX=i-o.left,t.zrY=r-o.top;return}else if(fp(eg,n,i,r)){t.zrX=eg[0],t.zrY=eg[1];return}}t.zrX=t.zrY=0}function ng(n){return n||window.event}function un(n,e,t){if(e=ng(e),e.zrX!=null)return e;var i=e.type,r=i&&i.indexOf("touch")>=0;if(r){var o=i!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&tg(n,o,e,t)}else{tg(n,e,e,t);var a=zz(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&Lz.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function zz(n){var e=n.wheelDelta;if(e)return e;var t=n.deltaX,i=n.deltaY;if(t==null||i==null)return e;var r=Math.abs(i!==0?i:t),o=i>0?-1:i<0?1:t>0?-1:1;return 3*r*o}function ig(n,e,t,i){n.addEventListener(e,t,i)}function Bz(n,e,t,i){n.removeEventListener(e,t,i)}var Gb=function(n){n.preventDefault(),n.stopPropagation(),n.cancelBubble=!0},Vz=function(){function n(){this._track=[]}return n.prototype.recognize=function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},n.prototype.clear=function(){return this._track.length=0,this},n.prototype._doTrack=function(e,t,i){var r=e.touches;if(r){for(var o={points:[],touches:[],target:t,event:e},a=0,s=r.length;a<s;a++){var l=r[a],u=tg(i,l,{});o.points.push([u.zrX,u.zrY]),o.touches.push(l)}this._track.push(o)}},n.prototype._recognize=function(e){for(var t in rg)if(rg.hasOwnProperty(t)){var i=rg[t](this._track,e);if(i)return i}},n}();function Wb(n){var e=n[1][0]-n[0][0],t=n[1][1]-n[0][1];return Math.sqrt(e*e+t*t)}function Hz(n){return[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]}var rg={pinch:function(n,e){var t=n.length;if(t){var i=(n[t-1]||{}).points,r=(n[t-2]||{}).points||i;if(r&&r.length>1&&i&&i.length>1){var o=Wb(i)/Wb(r);!isFinite(o)&&(o=1),e.pinchScale=o;var a=Hz(i);return e.pinchX=a[0],e.pinchY=a[1],{type:"pinch",target:n[0].target,event:e}}}}},Ub="silent";function Fz(n,e,t){return{type:n,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:Gz}}function Gz(){Gb(this.event)}var Wz=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(bn),Vs=function(){function n(e,t){this.x=e,this.y=t}return n}(),Uz=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],og=new ve(0,0,0,0),Yb=function(n){W(e,n);function e(t,i,r,o,a){var s=n.call(this)||this;return s._hovered=new Vs(0,0),s.storage=t,s.painter=i,s.painterRoot=o,s._pointerSize=a,r=r||new Wz,s.proxy=null,s.setHandlerProxy(r),s._draggingMgr=new Rz(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(N(Uz,function(i){t.on&&t.on(i,this[i],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var i=t.zrX,r=t.zrY,o=jb(this,i,r),a=this._hovered,s=a.target;s&&!s.__zr&&(a=this.findHover(a.x,a.y),s=a.target);var l=this._hovered=o?new Vs(i,r):this.findHover(i,r),u=l.target,c=this.proxy;c.setCursor&&c.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(a,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var i=t.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Vs(0,0)},e.prototype.dispatch=function(t,i){var r=this[t];r&&r.call(this,i)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var i=this.proxy;i.setCursor&&i.setCursor(t)},e.prototype.dispatchToElement=function(t,i,r){t=t||{};var o=t.target;if(!(o&&o.silent)){for(var a="on"+i,s=Fz(i,t,r);o&&(o[a]&&(s.cancelBubble=!!o[a].call(o,s)),o.trigger(i,s),o=o.__hostTarget?o.__hostTarget:o.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[a]=="function"&&l[a].call(l,s),l.trigger&&l.trigger(i,s)}))}},e.prototype.findHover=function(t,i,r){var o=this.storage.getDisplayList(),a=new Vs(t,i);if(qb(o,a,t,i,r),this._pointerSize&&!a.target){for(var s=[],l=this._pointerSize,u=l/2,c=new ve(t-u,i-u,l,l),h=o.length-1;h>=0;h--){var d=o[h];d!==r&&!d.ignore&&!d.ignoreCoarsePointer&&(!d.parent||!d.parent.ignoreCoarsePointer)&&(og.copy(d.getBoundingRect()),d.transform&&og.applyTransform(d.transform),og.intersect(c)&&s.push(d))}if(s.length)for(var f=4,p=Math.PI/12,g=Math.PI*2,m=0;m<u;m+=f)for(var y=0;y<g;y+=p){var v=t+m*Math.cos(y),_=i+m*Math.sin(y);if(qb(s,a,v,_,r),a.target)return a}}return a},e.prototype.processGesture=function(t,i){this._gestureMgr||(this._gestureMgr=new Vz);var r=this._gestureMgr;i==="start"&&r.clear();var o=r.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if(i==="end"&&r.clear(),o){var a=o.type;t.gestureEvent=a;var s=new Vs;s.target=o.target,this.dispatchToElement(s,a,o.event)}},e}(bn);N(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(n){Yb.prototype[n]=function(e){var t=e.zrX,i=e.zrY,r=jb(this,t,i),o,a;if((n!=="mouseup"||!r)&&(o=this.findHover(t,i),a=o.target),n==="mousedown")this._downEl=a,this._downPoint=[e.zrX,e.zrY],this._upEl=a;else if(n==="mouseup")this._upEl=a;else if(n==="click"){if(this._downEl!==this._upEl||!this._downPoint||kd(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(o,n,e)}});function Yz(n,e,t){if(n[n.rectHover?"rectContain":"contain"](e,t)){for(var i=n,r=void 0,o=!1;i;){if(i.ignoreClip&&(o=!0),!o){var a=i.getClipPath();if(a&&!a.contain(e,t))return!1}i.silent&&(r=!0);var s=i.__hostTarget;i=s?i.ignoreHostSilent?null:s:i.parent}return r?Ub:!0}return!1}function qb(n,e,t,i,r){for(var o=n.length-1;o>=0;o--){var a=n[o],s=void 0;if(a!==r&&!a.ignore&&(s=Yz(a,t,i))&&(!e.topTarget&&(e.topTarget=a),s!==Ub)){e.target=a;break}}}function jb(n,e,t){var i=n.painter;return e<0||e>i.getWidth()||t<0||t>i.getHeight()}var $b=32,Hs=7;function qz(n){for(var e=0;n>=$b;)e|=n&1,n>>=1;return n+e}function Zb(n,e,t,i){var r=e+1;if(r===t)return 1;if(i(n[r++],n[e])<0){for(;r<t&&i(n[r],n[r-1])<0;)r++;jz(n,e,r)}else for(;r<t&&i(n[r],n[r-1])>=0;)r++;return r-e}function jz(n,e,t){for(t--;e<t;){var i=n[e];n[e++]=n[t],n[t--]=i}}function Xb(n,e,t,i,r){for(i===e&&i++;i<t;i++){for(var o=n[i],a=e,s=i,l;a<s;)l=a+s>>>1,r(o,n[l])<0?s=l:a=l+1;var u=i-a;switch(u){case 3:n[a+3]=n[a+2];case 2:n[a+2]=n[a+1];case 1:n[a+1]=n[a];break;default:for(;u>0;)n[a+u]=n[a+u-1],u--}n[a]=o}}function ag(n,e,t,i,r,o){var a=0,s=0,l=1;if(o(n,e[t+r])>0){for(s=i-r;l<s&&o(n,e[t+r+l])>0;)a=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{for(s=r+1;l<s&&o(n,e[t+r-l])<=0;)a=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=a;a=r-l,l=r-u}for(a++;a<l;){var c=a+(l-a>>>1);o(n,e[t+c])>0?a=c+1:l=c}return l}function sg(n,e,t,i,r,o){var a=0,s=0,l=1;if(o(n,e[t+r])<0){for(s=r+1;l<s&&o(n,e[t+r-l])<0;)a=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=a;a=r-l,l=r-u}else{for(s=i-r;l<s&&o(n,e[t+r+l])>=0;)a=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}for(a++;a<l;){var c=a+(l-a>>>1);o(n,e[t+c])<0?l=c:a=c+1}return l}function $z(n,e){var t=Hs,i,r,o=0,a=[];i=[],r=[];function s(f,p){i[o]=f,r[o]=p,o+=1}function l(){for(;o>1;){var f=o-2;if(f>=1&&r[f-1]<=r[f]+r[f+1]||f>=2&&r[f-2]<=r[f]+r[f-1])r[f-1]<r[f+1]&&f--;else if(r[f]>r[f+1])break;c(f)}}function u(){for(;o>1;){var f=o-2;f>0&&r[f-1]<r[f+1]&&f--,c(f)}}function c(f){var p=i[f],g=r[f],m=i[f+1],y=r[f+1];r[f]=g+y,f===o-3&&(i[f+1]=i[f+2],r[f+1]=r[f+2]),o--;var v=sg(n[m],n,p,g,0,e);p+=v,g-=v,g!==0&&(y=ag(n[p+g-1],n,m,y,y-1,e),y!==0&&(g<=y?h(p,g,m,y):d(p,g,m,y)))}function h(f,p,g,m){var y=0;for(y=0;y<p;y++)a[y]=n[f+y];var v=0,_=g,b=f;if(n[b++]=n[_++],--m===0){for(y=0;y<p;y++)n[b+y]=a[v+y];return}if(p===1){for(y=0;y<m;y++)n[b+y]=n[_+y];n[b+m]=a[v];return}for(var T=t,w,S,M;;){w=0,S=0,M=!1;do if(e(n[_],a[v])<0){if(n[b++]=n[_++],S++,w=0,--m===0){M=!0;break}}else if(n[b++]=a[v++],w++,S=0,--p===1){M=!0;break}while((w|S)<T);if(M)break;do{if(w=sg(n[_],a,v,p,0,e),w!==0){for(y=0;y<w;y++)n[b+y]=a[v+y];if(b+=w,v+=w,p-=w,p<=1){M=!0;break}}if(n[b++]=n[_++],--m===0){M=!0;break}if(S=ag(a[v],n,_,m,0,e),S!==0){for(y=0;y<S;y++)n[b+y]=n[_+y];if(b+=S,_+=S,m-=S,m===0){M=!0;break}}if(n[b++]=a[v++],--p===1){M=!0;break}T--}while(w>=Hs||S>=Hs);if(M)break;T<0&&(T=0),T+=2}if(t=T,t<1&&(t=1),p===1){for(y=0;y<m;y++)n[b+y]=n[_+y];n[b+m]=a[v]}else{if(p===0)throw new Error;for(y=0;y<p;y++)n[b+y]=a[v+y]}}function d(f,p,g,m){var y=0;for(y=0;y<m;y++)a[y]=n[g+y];var v=f+p-1,_=m-1,b=g+m-1,T=0,w=0;if(n[b--]=n[v--],--p===0){for(T=b-(m-1),y=0;y<m;y++)n[T+y]=a[y];return}if(m===1){for(b-=p,v-=p,w=b+1,T=v+1,y=p-1;y>=0;y--)n[w+y]=n[T+y];n[b]=a[_];return}for(var S=t;;){var M=0,C=0,I=!1;do if(e(a[_],n[v])<0){if(n[b--]=n[v--],M++,C=0,--p===0){I=!0;break}}else if(n[b--]=a[_--],C++,M=0,--m===1){I=!0;break}while((M|C)<S);if(I)break;do{if(M=p-sg(a[_],n,f,p,p-1,e),M!==0){for(b-=M,v-=M,p-=M,w=b+1,T=v+1,y=M-1;y>=0;y--)n[w+y]=n[T+y];if(p===0){I=!0;break}}if(n[b--]=a[_--],--m===1){I=!0;break}if(C=m-ag(n[v],a,0,m,m-1,e),C!==0){for(b-=C,_-=C,m-=C,w=b+1,T=_+1,y=0;y<C;y++)n[w+y]=a[T+y];if(m<=1){I=!0;break}}if(n[b--]=n[v--],--p===0){I=!0;break}S--}while(M>=Hs||C>=Hs);if(I)break;S<0&&(S=0),S+=2}if(t=S,t<1&&(t=1),m===1){for(b-=p,v-=p,w=b+1,T=v+1,y=p-1;y>=0;y--)n[w+y]=n[T+y];n[b]=a[_]}else{if(m===0)throw new Error;for(T=b-(m-1),y=0;y<m;y++)n[T+y]=a[y]}}return{mergeRuns:l,forceMergeRuns:u,pushRun:s}}function wc(n,e,t,i){t||(t=0),i||(i=n.length);var r=i-t;if(!(r<2)){var o=0;if(r<$b){o=Zb(n,t,i,e),Xb(n,t,i,t+o,e);return}var a=$z(n,e),s=qz(r);do{if(o=Zb(n,t,i,e),o<s){var l=r;l>s&&(l=s),Xb(n,t,t+l,t+o,e),o=l}a.pushRun(t,o),a.mergeRuns(),r-=o,t+=o}while(r!==0);a.forceMergeRuns()}}var Kb=!1;function lg(){Kb||(Kb=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Qb(n,e){return n.zlevel===e.zlevel?n.z===e.z?n.z2-e.z2:n.z-e.z:n.zlevel-e.zlevel}var Zz=function(){function n(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Qb}return n.prototype.traverse=function(e,t){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,t)},n.prototype.getDisplayList=function(e,t){t=t||!1;var i=this._displayList;return(e||!i.length)&&this.updateDisplayList(t),i},n.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,i=this._displayList,r=0,o=t.length;r<o;r++)this._updateAndAddDisplayable(t[r],null,e);i.length=this._displayListLen,wc(i,Qb)},n.prototype._updateAndAddDisplayable=function(e,t,i){if(!(e.ignore&&!i)){e.beforeUpdate(),e.update(),e.afterUpdate();var r=e.getClipPath(),o=t&&t.length,a=0,s=e.__clipPaths;if(!e.ignoreClip&&(o||r)){if(s||(s=e.__clipPaths=[]),o)for(var l=0;l<t.length;l++)s[a++]=t[l];for(var u=r,c=e;u;)u.parent=c,u.updateTransform(),s[a++]=u,c=u,u=u.getClipPath()}if(s&&(s.length=a),e.childrenRef){for(var h=e.childrenRef(),d=0;d<h.length;d++){var f=h[d];e.__dirty&&(f.__dirty|=Yt),this._updateAndAddDisplayable(f,s,i)}e.__dirty=0}else{var p=e;isNaN(p.z)&&(lg(),p.z=0),isNaN(p.z2)&&(lg(),p.z2=0),isNaN(p.zlevel)&&(lg(),p.zlevel=0),this._displayList[this._displayListLen++]=p}var g=e.getDecalElement&&e.getDecalElement();g&&this._updateAndAddDisplayable(g,s,i);var m=e.getTextGuideLine();m&&this._updateAndAddDisplayable(m,s,i);var y=e.getTextContent();y&&this._updateAndAddDisplayable(y,s,i)}},n.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},n.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,i=e.length;t<i;t++)this.delRoot(e[t]);return}var r=be(this._roots,e);r>=0&&this._roots.splice(r,1)},n.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},n.prototype.getRoots=function(){return this._roots},n.prototype.dispose=function(){this._displayList=null,this._roots=null},n}(),Sc;Sc=fe.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(n){return setTimeout(n,16)};function aa(){return new Date().getTime()}var Xz=function(n){W(e,n);function e(t){var i=n.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,t=t||{},i.stage=t.stage||{},i}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var i=t.getClip();i&&this.addClip(i)},e.prototype.removeClip=function(t){if(t.animation){var i=t.prev,r=t.next;i?i.next=r:this._head=r,r?r.prev=i:this._tail=i,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var i=t.getClip();i&&this.removeClip(i),t.animation=null},e.prototype.update=function(t){for(var i=aa()-this._pausedTime,r=i-this._time,o=this._head;o;){var a=o.next,s=o.step(i,r);s&&(o.ondestroy(),this.removeClip(o)),o=a}this._time=i,t||(this.trigger("frame",r),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function i(){t._running&&(Sc(i),!t._paused&&t.update())}Sc(i)},e.prototype.start=function(){this._running||(this._time=aa(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=aa(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=aa()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var i=t.next;t.prev=t.next=t.animation=null,t=i}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,i){i=i||{},this.start();var r=new qd(t,i.loop);return this.addAnimator(r),r},e}(bn),Kz=300,ug=fe.domSupported,cg=function(){var n=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=$(n,function(r){var o=r.replace("mouse","pointer");return t.hasOwnProperty(o)?o:r});return{mouse:n,touch:e,pointer:i}}(),Jb={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},ew=!1;function hg(n){var e=n.pointerType;return e==="pen"||e==="touch"}function Qz(n){n.touching=!0,n.touchTimer!=null&&(clearTimeout(n.touchTimer),n.touchTimer=null),n.touchTimer=setTimeout(function(){n.touching=!1,n.touchTimer=null},700)}function dg(n){n&&(n.zrByTouch=!0)}function Jz(n,e){return un(n.dom,new eB(n,e),!0)}function tw(n,e){for(var t=e,i=!1;t&&t.nodeType!==9&&!(i=t.domBelongToZr||t!==e&&t===n.painterRoot);)t=t.parentNode;return i}var eB=function(){function n(e,t){this.stopPropagation=nt,this.stopImmediatePropagation=nt,this.preventDefault=nt,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return n}(),Cn={mousedown:function(n){n=un(this.dom,n),this.__mayPointerCapture=[n.zrX,n.zrY],this.trigger("mousedown",n)},mousemove:function(n){n=un(this.dom,n);var e=this.__mayPointerCapture;e&&(n.zrX!==e[0]||n.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",n)},mouseup:function(n){n=un(this.dom,n),this.__togglePointerCapture(!1),this.trigger("mouseup",n)},mouseout:function(n){n=un(this.dom,n);var e=n.toElement||n.relatedTarget;tw(this,e)||(this.__pointerCapturing&&(n.zrEventControl="no_globalout"),this.trigger("mouseout",n))},wheel:function(n){ew=!0,n=un(this.dom,n),this.trigger("mousewheel",n)},mousewheel:function(n){ew||(n=un(this.dom,n),this.trigger("mousewheel",n))},touchstart:function(n){n=un(this.dom,n),dg(n),this.__lastTouchMoment=new Date,this.handler.processGesture(n,"start"),Cn.mousemove.call(this,n),Cn.mousedown.call(this,n)},touchmove:function(n){n=un(this.dom,n),dg(n),this.handler.processGesture(n,"change"),Cn.mousemove.call(this,n)},touchend:function(n){n=un(this.dom,n),dg(n),this.handler.processGesture(n,"end"),Cn.mouseup.call(this,n),+new Date-+this.__lastTouchMoment<Kz&&Cn.click.call(this,n)},pointerdown:function(n){Cn.mousedown.call(this,n)},pointermove:function(n){hg(n)||Cn.mousemove.call(this,n)},pointerup:function(n){Cn.mouseup.call(this,n)},pointerout:function(n){hg(n)||Cn.mouseout.call(this,n)}};N(["click","dblclick","contextmenu"],function(n){Cn[n]=function(e){e=un(this.dom,e),this.trigger(n,e)}});var fg={pointermove:function(n){hg(n)||fg.mousemove.call(this,n)},pointerup:function(n){fg.mouseup.call(this,n)},mousemove:function(n){this.trigger("mousemove",n)},mouseup:function(n){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",n),e&&(n.zrEventControl="only_globalout",this.trigger("mouseout",n))}};function tB(n,e){var t=e.domHandlers;fe.pointerEventsSupported?N(cg.pointer,function(i){Tc(e,i,function(r){t[i].call(n,r)})}):(fe.touchEventsSupported&&N(cg.touch,function(i){Tc(e,i,function(r){t[i].call(n,r),Qz(e)})}),N(cg.mouse,function(i){Tc(e,i,function(r){r=ng(r),e.touching||t[i].call(n,r)})}))}function nB(n,e){fe.pointerEventsSupported?N(Jb.pointer,t):fe.touchEventsSupported||N(Jb.mouse,t);function t(i){function r(o){o=ng(o),tw(n,o.target)||(o=Jz(n,o),e.domHandlers[i].call(n,o))}Tc(e,i,r,{capture:!0})}}function Tc(n,e,t,i){n.mounted[e]=t,n.listenerOpts[e]=i,ig(n.domTarget,e,t,i)}function pg(n){var e=n.mounted;for(var t in e)e.hasOwnProperty(t)&&Bz(n.domTarget,t,e[t],n.listenerOpts[t]);n.mounted={}}var nw=function(){function n(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t}return n}(),iB=function(n){W(e,n);function e(t,i){var r=n.call(this)||this;return r.__pointerCapturing=!1,r.dom=t,r.painterRoot=i,r._localHandlerScope=new nw(t,Cn),ug&&(r._globalHandlerScope=new nw(document,fg)),tB(r,r._localHandlerScope),r}return e.prototype.dispose=function(){pg(this._localHandlerScope),ug&&pg(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,ug&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var i=this._globalHandlerScope;t?nB(this,i):pg(i)}},e}(bn);/*!
|
|
30
|
+
* ZRender, a high performance 2d drawing library.
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) 2013, Baidu Inc.
|
|
33
|
+
* All rights reserved.
|
|
34
|
+
*
|
|
35
|
+
* LICENSE
|
|
36
|
+
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
|
37
|
+
*/var Fs={},iw={};function rB(n){delete iw[n]}function oB(n){if(!n)return!1;if(typeof n=="string")return tu(n,1)<jd;if(n.colorStops){for(var e=n.colorStops,t=0,i=e.length,r=0;r<i;r++)t+=tu(e[r].color,1);return t/=i,t<jd}return!1}var aB=function(){function n(e,t,i){var r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=t,this.id=e;var o=new Zz,a=i.renderer||"canvas";if(Fs[a]||(a=Ce(Fs)[0]),process.env.NODE_ENV!=="production"&&!Fs[a])throw new Error("Renderer '"+a+"' is not imported. Please import it first.");i.useDirtyRect=i.useDirtyRect==null?!1:i.useDirtyRect;var s=new Fs[a](t,o,i,e),l=i.ssr||s.ssrOnly;this.storage=o,this.painter=s;var u=!fe.node&&!fe.worker&&!l?new iB(s.getViewportRoot(),s.root):null,c=i.useCoarsePointer,h=c==null||c==="auto"?fe.touchEventsSupported:!!c,d=44,f;h&&(f=te(i.pointerSize,d)),this.handler=new Yb(o,s,u,s.root,f),this.animation=new Xz({stage:{update:l?null:function(){return r._flush(!0)}}}),l||this.animation.start()}return n.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},n.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},n.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},n.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=oB(e))},n.prototype.getBackgroundColor=function(){return this._backgroundColor},n.prototype.setDarkMode=function(e){this._darkMode=e},n.prototype.isDarkMode=function(){return this._darkMode},n.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},n.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},n.prototype.flush=function(){this._disposed||this._flush(!1)},n.prototype._flush=function(e){var t,i=aa();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var r=aa();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:r-i})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},n.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},n.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},n.prototype.refreshHover=function(){this._needsRefreshHover=!0},n.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},n.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},n.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},n.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},n.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},n.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},n.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},n.prototype.on=function(e,t,i){return this._disposed||this.handler.on(e,t,i),this},n.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},n.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},n.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Ye&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},n.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,rB(this.id))},n}();function rw(n,e){var t=new aB($v(),n,e);return iw[t.id]=t,t}function sB(n,e){Fs[n]=e}var gg;function lB(n){if(typeof gg=="function")return gg(n)}function uB(n){gg=n}var ow="";typeof navigator<"u"&&(ow=navigator.platform||"");var sa="rgba(0, 0, 0, 0.2)",aw=Z.color.theme[0],cB=Lo(aw,null,null,.9);const hB={darkMode:"auto",colorBy:"series",color:Z.color.theme,gradientColor:[cB,aw],aria:{decal:{decals:[{color:sa,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:sa,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:sa,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:sa,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:sa,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:sa,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:ow.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 mg=me();function dB(n,e){J(mg.get(n)==null&&e),mg.set(n,e)}function fB(n,e,t){var i=mg.get(e);if(!i)return t;var r=i(n);if(!r)return t;if(process.env.NODE_ENV!=="production")for(var o=0;o<r.length;o++)J(Fo(r[o]));return t.concat(r)}var Mc,Gs,sw,yg="\0_ec_inner",lw=1,pB={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",matrix:"MatrixComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},gB={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",chord:"ChordChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},Cc={};function mB(n){N(n,function(e,t){if(!De.hasClass(t)){var i=pB[t];i&&!Cc[i]&&(ze("Component "+t+` is used but not imported.
|
|
38
|
+
import { `+i+` } from 'echarts/components';
|
|
39
|
+
echarts.use([`+i+"]);"),Cc[i]=!0)}})}var vg=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t,i,r,o,a,s){o=o||{},this.option=null,this._theme=new Ge(o),this._locale=new Ge(a),this._optionManager=s},e.prototype.setOption=function(t,i,r){process.env.NODE_ENV!=="production"&&(J(t!=null,"option is null/undefined"),J(t[yg]!==lw,"please use chart.getOption()"));var o=hw(i);this._optionManager.setOption(t,r,o),this._resetOption(null,o)},e.prototype.resetOption=function(t,i){return this._resetOption(t,hw(i))},e.prototype._resetOption=function(t,i){var r=!1,o=this._optionManager;if(!t||t==="recreate"){var a=o.mountOption(t==="recreate");process.env.NODE_ENV!=="production"&&mB(a),!this.option||t==="recreate"?sw(this,a):(this.restoreData(),this._mergeOption(a,i)),r=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=o.getTimelineOption(this);s&&(r=!0,this._mergeOption(s,i))}if(!t||t==="recreate"||t==="media"){var l=o.getMediaOption(this);l.length&&N(l,function(u){r=!0,this._mergeOption(u,i)},this)}return r},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,i){var r=this.option,o=this._componentsMap,a=this._componentsCount,s=[],l=me(),u=i&&i.replaceMergeMainTypeMap;iR(this),N(t,function(h,d){h!=null&&(De.hasClass(d)?d&&(s.push(d),l.set(d,!0)):r[d]=r[d]==null?ue(h):_e(r[d],h,!0))}),u&&u.each(function(h,d){De.hasClass(d)&&!l.get(d)&&(s.push(d),l.set(d,!0))}),De.topologicalTravel(s,De.getAllClassMainTypes(),c,this);function c(h){var d=fB(this,h,_t(t[h])),f=o.get(h),p=f?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",g=TA(f,d,p);AA(g,h,De),r[h]=null,o.set(h,null),a.set(h,0);var m=[],y=[],v=0,_,b;N(g,function(T,w){var S=T.existing,M=T.newOption;if(!M)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var C=h==="series",I=De.getClass(h,T.keyInfo.subType,!C);if(!I){if(process.env.NODE_ENV!=="production"){var E=T.keyInfo.subType,k=gB[E];Cc[E]||(Cc[E]=!0,ze(k?"Series "+E+` is used but not imported.
|
|
40
|
+
import { `+k+` } from 'echarts/charts';
|
|
41
|
+
echarts.use([`+k+"]);":"Unknown series "+E))}return}if(h==="tooltip"){if(_){process.env.NODE_ENV!=="production"&&(b||(st("Currently only one tooltip component is allowed."),b=!0));return}_=!0}if(S&&S.constructor===I)S.name=T.keyInfo.name,S.mergeOption(M,this),S.optionUpdated(M,!1);else{var D=U({componentIndex:w},T.keyInfo);S=new I(M,this,this,D),U(S,D),T.brandNew&&(S.__requireNewView=!0),S.init(M,this,this),S.optionUpdated(null,!0)}}S?(m.push(S.option),y.push(S),v++):(m.push(void 0),y.push(void 0))},this),r[h]=m,o.set(h,y),a.set(h,v),h==="series"&&Mc(this)}this._seriesIndices||Mc(this)},e.prototype.getOption=function(){var t=ue(this.option);return N(t,function(i,r){if(De.hasClass(r)){for(var o=_t(i),a=o.length,s=!1,l=a-1;l>=0;l--)o[l]&&!Fo(o[l])?s=!0:(o[l]=null,!s&&a--);o.length=a,t[r]=o}}),delete t[yg],t},e.prototype.setTheme=function(t){this._theme=new Ge(t),this._resetOption("recreate",null)},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,i){var r=this._componentsMap.get(t);if(r){var o=r[i||0];if(o)return o;if(i==null){for(var a=0;a<r.length;a++)if(r[a])return r[a]}}},e.prototype.queryComponents=function(t){var i=t.mainType;if(!i)return[];var r=t.index,o=t.id,a=t.name,s=this._componentsMap.get(i);if(!s||!s.length)return[];var l;return r!=null?(l=[],N(_t(r),function(u){s[u]&&l.push(s[u])})):o!=null?l=uw("id",o,s):a!=null?l=uw("name",a,s):l=$e(s,function(u){return!!u}),cw(l,t)},e.prototype.findComponents=function(t){var i=t.query,r=t.mainType,o=s(i),a=o?this.queryComponents(o):$e(this._componentsMap.get(r),function(u){return!!u});return l(cw(a,t));function s(u){var c=r+"Index",h=r+"Id",d=r+"Name";return u&&(u[c]!=null||u[h]!=null||u[d]!=null)?{mainType:r,index:u[c],id:u[h],name:u[d]}:null}function l(u){return t.filter?$e(u,t.filter):u}},e.prototype.eachComponent=function(t,i,r){var o=this._componentsMap;if(ce(t)){var a=i,s=t;o.each(function(h,d){for(var f=0;h&&f<h.length;f++){var p=h[f];p&&s.call(a,d,p,p.componentIndex)}})}else for(var l=Q(t)?o.get(t):ne(t)?this.findComponents(t):null,u=0;l&&u<l.length;u++){var c=l[u];c&&i.call(r,c,c.componentIndex)}},e.prototype.getSeriesByName=function(t){var i=Un(t,null);return $e(this._componentsMap.get("series"),function(r){return!!r&&i!=null&&r.name===i})},e.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},e.prototype.getSeriesByType=function(t){return $e(this._componentsMap.get("series"),function(i){return!!i&&i.subType===t})},e.prototype.getSeries=function(){return $e(this._componentsMap.get("series"),function(t){return!!t})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(t,i){Gs(this),N(this._seriesIndices,function(r){var o=this._componentsMap.get("series")[r];t.call(i,o,r)},this)},e.prototype.eachRawSeries=function(t,i){N(this._componentsMap.get("series"),function(r){r&&t.call(i,r,r.componentIndex)})},e.prototype.eachSeriesByType=function(t,i,r){Gs(this),N(this._seriesIndices,function(o){var a=this._componentsMap.get("series")[o];a.subType===t&&i.call(r,a,o)},this)},e.prototype.eachRawSeriesByType=function(t,i,r){return N(this.getSeriesByType(t),i,r)},e.prototype.isSeriesFiltered=function(t){return Gs(this),this._seriesIndicesMap.get(t.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(t,i){Gs(this);var r=[];N(this._seriesIndices,function(o){var a=this._componentsMap.get("series")[o];t.call(i,a,o)&&r.push(o)},this),this._seriesIndices=r,this._seriesIndicesMap=me(r)},e.prototype.restoreData=function(t){Mc(this);var i=this._componentsMap,r=[];i.each(function(o,a){De.hasClass(a)&&r.push(a)}),De.topologicalTravel(r,De.getAllClassMainTypes(),function(o){N(i.get(o),function(a){a&&(o!=="series"||!yB(a,t))&&a.restoreData()})})},e.internalField=function(){Mc=function(t){var i=t._seriesIndices=[];N(t._componentsMap.get("series"),function(r){r&&i.push(r.componentIndex)}),t._seriesIndicesMap=me(i)},Gs=function(t){if(process.env.NODE_ENV!=="production"&&!t._seriesIndices)throw new Error("Option should contains series.")},sw=function(t,i){t.option={},t.option[yg]=lw,t._componentsMap=me({series:[]}),t._componentsCount=me();var r=i.aria;ne(r)&&r.enabled==null&&(r.enabled=!0),vB(i,t._theme.option),_e(i,hB,!1),t._mergeOption(i,null)}}(),e}(Ge);function yB(n,e){if(e){var t=e.seriesIndex,i=e.seriesId,r=e.seriesName;return t!=null&&n.componentIndex!==t||i!=null&&n.id!==i||r!=null&&n.name!==r}}function vB(n,e){var t=n.color&&!n.colorLayer;N(e,function(i,r){r==="colorLayer"&&t||r==="color"&&n.color||De.hasClass(r)||(typeof i=="object"?n[r]=n[r]?_e(n[r],i,!1):ue(i):n[r]==null&&(n[r]=i))})}function uw(n,e,t){if(q(e)){var i=me();return N(e,function(o){if(o!=null){var a=Un(o,null);a!=null&&i.set(o,!0)}}),$e(t,function(o){return o&&i.get(o[n])})}else{var r=Un(e,null);return $e(t,function(o){return o&&r!=null&&o[n]===r})}}function cw(n,e){return e.hasOwnProperty("subType")?$e(n,function(t){return t&&t.subType===e.subType}):n}function hw(n){var e=me();return n&&N(_t(n.replaceMerge),function(t){process.env.NODE_ENV!=="production"&&J(De.hasClass(t),'"'+t+'" is not valid component main type in "replaceMerge"'),e.set(t,!0)}),{replaceMergeMainTypeMap:e}}yn(vg,Ip);var _B=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],dw=function(){function n(e){N(_B,function(t){this[t]=ke(e[t],e)},this)}return n}(),xB=/^(min|max)?(.+)$/,bB=function(){function n(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return n.prototype.setOption=function(e,t,i){e&&(N(_t(e.series),function(a){a&&a.data&&Ct(a.data)&&ud(a.data)}),N(_t(e.dataset),function(a){a&&a.source&&Ct(a.source)&&ud(a.source)})),e=ue(e);var r=this._optionBackup,o=wB(e,t,!r);this._newBaseOption=o.baseOption,r?(o.timelineOptions.length&&(r.timelineOptions=o.timelineOptions),o.mediaList.length&&(r.mediaList=o.mediaList),o.mediaDefault&&(r.mediaDefault=o.mediaDefault)):this._optionBackup=o},n.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],ue(e?t.baseOption:this._newBaseOption)},n.prototype.getTimelineOption=function(e){var t,i=this._timelineOptions;if(i.length){var r=e.getComponent("timeline");r&&(t=ue(i[r.getCurrentIndex()]))}return t},n.prototype.getMediaOption=function(e){var t=this._api.getWidth(),i=this._api.getHeight(),r=this._mediaList,o=this._mediaDefault,a=[],s=[];if(!r.length&&!o)return s;for(var l=0,u=r.length;l<u;l++)SB(r[l].query,t,i)&&a.push(l);return!a.length&&o&&(a=[-1]),a.length&&!MB(a,this._currentMediaIndices)&&(s=$(a,function(c){return ue(c===-1?o.option:r[c].option)})),this._currentMediaIndices=a,s},n}();function wB(n,e,t){var i=[],r,o,a=n.baseOption,s=n.timeline,l=n.options,u=n.media,c=!!n.media,h=!!(l||s||a&&a.timeline);a?(o=a,o.timeline||(o.timeline=s)):((h||c)&&(n.options=n.media=null),o=n),c&&(q(u)?N(u,function(f){process.env.NODE_ENV!=="production"&&f&&!f.option&&ne(f.query)&&ne(f.query.option)&&ze("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"),f&&f.option&&(f.query?i.push(f):r||(r=f))}):process.env.NODE_ENV!=="production"&&ze("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }")),d(o),N(l,function(f){return d(f)}),N(i,function(f){return d(f.option)});function d(f){N(e,function(p){p(f,t)})}return{baseOption:o,timelineOptions:l||[],mediaDefault:r,mediaList:i}}function SB(n,e,t){var i={width:e,height:t,aspectratio:e/t},r=!0;return N(n,function(o,a){var s=a.match(xB);if(!(!s||!s[1]||!s[2])){var l=s[1],u=s[2].toLowerCase();TB(i[u],o,l)||(r=!1)}}),r}function TB(n,e,t){return t==="min"?n>=e:t==="max"?n<=e:n===e}function MB(n,e){return n.join(",")===e.join(",")}var cn=N,Ws=ne,fw=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function _g(n){var e=n&&n.itemStyle;if(e)for(var t=0,i=fw.length;t<i;t++){var r=fw[t],o=e.normal,a=e.emphasis;o&&o[r]&&(process.env.NODE_ENV!=="production"&&rt("itemStyle.normal."+r,r),n[r]=n[r]||{},n[r].normal?_e(n[r].normal,o[r]):n[r].normal=o[r],o[r]=null),a&&a[r]&&(process.env.NODE_ENV!=="production"&&rt("itemStyle.emphasis."+r,"emphasis."+r),n[r]=n[r]||{},n[r].emphasis?_e(n[r].emphasis,a[r]):n[r].emphasis=a[r],a[r]=null)}}function St(n,e,t){if(n&&n[e]&&(n[e].normal||n[e].emphasis)){var i=n[e].normal,r=n[e].emphasis;i&&(process.env.NODE_ENV!=="production"&&fi("'normal' hierarchy in "+e+" has been removed since 4.0. All style properties are configured in "+e+" directly now."),t?(n[e].normal=n[e].emphasis=null,Me(n[e],i)):n[e]=i),r&&(process.env.NODE_ENV!=="production"&&fi(e+".emphasis has been changed to emphasis."+e+" since 4.0"),n.emphasis=n.emphasis||{},n.emphasis[e]=r,r.focus&&(n.emphasis.focus=r.focus),r.blurScope&&(n.emphasis.blurScope=r.blurScope))}}function Us(n){St(n,"itemStyle"),St(n,"lineStyle"),St(n,"areaStyle"),St(n,"label"),St(n,"labelLine"),St(n,"upperLabel"),St(n,"edgeLabel")}function Qe(n,e){var t=Ws(n)&&n[e],i=Ws(t)&&t.textStyle;if(i){process.env.NODE_ENV!=="production"&&fi("textStyle hierarchy in "+e+" has been removed since 4.0. All textStyle properties are configured in "+e+" directly now.");for(var r=0,o=C_.length;r<o;r++){var a=C_[r];i.hasOwnProperty(a)&&(t[a]=i[a])}}}function hn(n){n&&(Us(n),Qe(n,"label"),n.emphasis&&Qe(n.emphasis,"label"))}function CB(n){if(Ws(n)){_g(n),Us(n),Qe(n,"label"),Qe(n,"upperLabel"),Qe(n,"edgeLabel"),n.emphasis&&(Qe(n.emphasis,"label"),Qe(n.emphasis,"upperLabel"),Qe(n.emphasis,"edgeLabel"));var e=n.markPoint;e&&(_g(e),hn(e));var t=n.markLine;t&&(_g(t),hn(t));var i=n.markArea;i&&hn(i);var r=n.data;if(n.type==="graph"){r=r||n.nodes;var o=n.links||n.edges;if(o&&!Ct(o))for(var a=0;a<o.length;a++)hn(o[a]);N(n.categories,function(u){Us(u)})}if(r&&!Ct(r))for(var a=0;a<r.length;a++)hn(r[a]);if(e=n.markPoint,e&&e.data)for(var s=e.data,a=0;a<s.length;a++)hn(s[a]);if(t=n.markLine,t&&t.data)for(var l=t.data,a=0;a<l.length;a++)q(l[a])?(hn(l[a][0]),hn(l[a][1])):hn(l[a]);n.type==="gauge"?(Qe(n,"axisLabel"),Qe(n,"title"),Qe(n,"detail")):n.type==="treemap"?(St(n.breadcrumb,"itemStyle"),N(n.levels,function(u){Us(u)})):n.type==="tree"&&Us(n.leaves)}}function _i(n){return q(n)?n:n?[n]:[]}function pw(n){return(q(n)?n[0]:n)||{}}function kB(n,e){cn(_i(n.series),function(i){Ws(i)&&CB(i)});var t=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&t.push("valueAxis","categoryAxis","logAxis","timeAxis"),cn(t,function(i){cn(_i(n[i]),function(r){r&&(Qe(r,"axisLabel"),Qe(r.axisPointer,"label"))})}),cn(_i(n.parallel),function(i){var r=i&&i.parallelAxisDefault;Qe(r,"axisLabel"),Qe(r&&r.axisPointer,"label")}),cn(_i(n.calendar),function(i){St(i,"itemStyle"),Qe(i,"dayLabel"),Qe(i,"monthLabel"),Qe(i,"yearLabel")}),cn(_i(n.radar),function(i){Qe(i,"name"),i.name&&i.axisName==null&&(i.axisName=i.name,delete i.name,process.env.NODE_ENV!=="production"&&fi("name property in radar component has been changed to axisName")),i.nameGap!=null&&i.axisNameGap==null&&(i.axisNameGap=i.nameGap,delete i.nameGap,process.env.NODE_ENV!=="production"&&fi("nameGap property in radar component has been changed to axisNameGap")),process.env.NODE_ENV!=="production"&&cn(i.indicator,function(r){r.text&&rt("text","name","radar.indicator")})}),cn(_i(n.geo),function(i){Ws(i)&&(hn(i),cn(_i(i.regions),function(r){hn(r)}))}),cn(_i(n.timeline),function(i){hn(i),St(i,"label"),St(i,"itemStyle"),St(i,"controlStyle",!0);var r=i.data;q(r)&&N(r,function(o){ne(o)&&(St(o,"label"),St(o,"itemStyle"))})}),cn(_i(n.toolbox),function(i){St(i,"iconStyle"),cn(i.feature,function(r){St(r,"iconStyle")})}),Qe(pw(n.axisPointer),"label"),Qe(pw(n.tooltip).axisPointer,"label")}function DB(n,e){for(var t=e.split(","),i=n,r=0;r<t.length&&(i=i&&i[t[r]],i!=null);r++);return i}function IB(n,e,t,i){for(var r=e.split(","),o=n,a,s=0;s<r.length-1;s++)a=r[s],o[a]==null&&(o[a]={}),o=o[a];o[r[s]]==null&&(o[r[s]]=t)}function gw(n){n&&N(EB,function(e){e[0]in n&&!(e[1]in n)&&(n[e[1]]=n[e[0]])})}var EB=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],NB=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],xg=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Ys(n){var e=n&&n.itemStyle;if(e)for(var t=0;t<xg.length;t++){var i=xg[t][1],r=xg[t][0];e[i]!=null&&(e[r]=e[i],process.env.NODE_ENV!=="production"&&rt(i,r))}}function mw(n){n&&n.alignTo==="edge"&&n.margin!=null&&n.edgeDistance==null&&(process.env.NODE_ENV!=="production"&&rt("label.margin","label.edgeDistance","pie"),n.edgeDistance=n.margin)}function yw(n){n&&n.downplay&&!n.blur&&(n.blur=n.downplay,process.env.NODE_ENV!=="production"&&rt("downplay","blur","sunburst"))}function AB(n){n&&n.focusNodeAdjacency!=null&&(n.emphasis=n.emphasis||{},n.emphasis.focus==null&&(process.env.NODE_ENV!=="production"&&rt("focusNodeAdjacency","emphasis: { focus: 'adjacency'}","graph/sankey"),n.emphasis.focus="adjacency"))}function vw(n,e){if(n)for(var t=0;t<n.length;t++)e(n[t]),n[t]&&vw(n[t].children,e)}function _w(n,e){kB(n,e),n.series=_t(n.series),N(n.series,function(t){if(ne(t)){var i=t.type;if(i==="line")t.clipOverflow!=null&&(t.clip=t.clipOverflow,process.env.NODE_ENV!=="production"&&rt("clipOverflow","clip","line"));else if(i==="pie"||i==="gauge"){t.clockWise!=null&&(t.clockwise=t.clockWise,process.env.NODE_ENV!=="production"&&rt("clockWise","clockwise")),mw(t.label);var r=t.data;if(r&&!Ct(r))for(var o=0;o<r.length;o++)mw(r[o]);t.hoverOffset!=null&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&(process.env.NODE_ENV!=="production"&&rt("hoverOffset","emphasis.scaleSize"),t.emphasis.scaleSize=t.hoverOffset))}else if(i==="gauge"){var a=DB(t,"pointer.color");a!=null&&IB(t,"itemStyle.color",a)}else if(i==="bar"){Ys(t),Ys(t.backgroundStyle),Ys(t.emphasis);var r=t.data;if(r&&!Ct(r))for(var o=0;o<r.length;o++)typeof r[o]=="object"&&(Ys(r[o]),Ys(r[o]&&r[o].emphasis))}else if(i==="sunburst"){var s=t.highlightPolicy;s&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=s,process.env.NODE_ENV!=="production"&&rt("highlightPolicy","emphasis.focus","sunburst"))),yw(t),vw(t.data,yw)}else i==="graph"||i==="sankey"?AB(t):i==="map"&&(t.mapType&&!t.map&&(process.env.NODE_ENV!=="production"&&rt("mapType","map","map"),t.map=t.mapType),t.mapLocation&&(process.env.NODE_ENV!=="production"&&fi("`mapLocation` is not used anymore."),Me(t,t.mapLocation)));t.hoverAnimation!=null&&(t.emphasis=t.emphasis||{},t.emphasis&&t.emphasis.scale==null&&(process.env.NODE_ENV!=="production"&&rt("hoverAnimation","emphasis.scale"),t.emphasis.scale=t.hoverAnimation)),gw(t)}}),n.dataRange&&(n.visualMap=n.dataRange),N(NB,function(t){var i=n[t];i&&(q(i)||(i=[i]),N(i,function(r){gw(r)}))})}function OB(n){var e=me();n.eachSeries(function(t){var i=t.get("stack");if(i){var r=e.get(i)||e.set(i,[]),o=t.getData(),a={stackResultDimension:o.getCalculationInfo("stackResultDimension"),stackedOverDimension:o.getCalculationInfo("stackedOverDimension"),stackedDimension:o.getCalculationInfo("stackedDimension"),stackedByDimension:o.getCalculationInfo("stackedByDimension"),isStackedByIndex:o.getCalculationInfo("isStackedByIndex"),data:o,seriesModel:t};if(!a.stackedDimension||!(a.isStackedByIndex||a.stackedByDimension))return;r.push(a)}}),e.each(function(t){if(t.length!==0){var i=t[0].seriesModel,r=i.get("stackOrder")||"seriesAsc";r==="seriesDesc"&&t.reverse(),N(t,function(o,a){o.data.setCalculationInfo("stackedOnSeries",a>0?t[a-1].seriesModel:null)}),RB(t)}})}function RB(n){N(n,function(e,t){var i=[],r=[NaN,NaN],o=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";a.modify(o,function(u,c,h){var d=a.get(e.stackedDimension,h);if(isNaN(d))return r;var f,p;s?p=a.getRawIndex(h):f=a.get(e.stackedByDimension,h);for(var g=NaN,m=t-1;m>=0;m--){var y=n[m];if(s||(p=y.data.rawIndexOf(y.stackedByDimension,f)),p>=0){var v=y.data.getByRawIndex(y.stackResultDimension,p);if(l==="all"||l==="positive"&&v>0||l==="negative"&&v<0||l==="samesign"&&d>=0&&v>0||l==="samesign"&&d<=0&&v<0){d=vA(d,v),g=v;break}}}return i[0]=d,i[1]=g,i})})}var Et=function(){function n(){this.group=new Ye,this.uid=Is("viewComponent")}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,i,r){},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,i,r){},n.prototype.updateLayout=function(e,t,i,r){},n.prototype.updateVisual=function(e,t,i,r){},n.prototype.toggleBlurSeries=function(e,t,i){},n.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},n}();cd(Et),Wl(Et);var xw=Re(),bw={itemStyle:Ya(Nx,!0),lineStyle:Ya(Ex,!0)},LB={lineStyle:"stroke",itemStyle:"fill"};function ww(n,e){var t=n.visualStyleMapper||bw[e];return t||(console.warn("Unknown style type '"+e+"'."),bw.itemStyle)}function Sw(n,e){var t=n.visualDrawType||LB[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var PB={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData(),i=n.visualStyleAccessPath||"itemStyle",r=n.getModel(i),o=ww(n,i),a=o(r),s=r.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=Sw(n,i),u=a[l],c=ce(u)?u:null,h=a.fill==="auto"||a.stroke==="auto";if(!a[l]||c||h){var d=n.getColorFromPalette(n.name,null,e.getSeriesCount());a[l]||(a[l]=d,t.setVisual("colorFromPalette",!0)),a.fill=a.fill==="auto"||ce(a.fill)?d:a.fill,a.stroke=a.stroke==="auto"||ce(a.stroke)?d:a.stroke}if(t.setVisual("style",a),t.setVisual("drawType",l),!e.isSeriesFiltered(n)&&c)return t.setVisual("colorFromPalette",!1),{dataEach:function(f,p){var g=n.getDataParams(p),m=U({},a);m[l]=c(g),f.setItemVisual(p,"style",m)}}}},qs=new Ge,zB={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){if(!(n.ignoreStyleOnData||e.isSeriesFiltered(n))){var t=n.getData(),i=n.visualStyleAccessPath||"itemStyle",r=ww(n,i),o=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(a,s){var l=a.getRawDataItem(s);if(l&&l[i]){qs.option=l[i];var u=r(qs),c=a.ensureUniqueItemVisual(s,"style");U(c,u),qs.option.decal&&(a.setItemVisual(s,"decal",qs.option.decal),qs.option.decal.dirty=!0),o in u&&a.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},BB={performRawSeries:!0,overallReset:function(n){var e=me();n.eachSeries(function(t){var i=t.getColorBy();if(!t.isColorBySeries()){var r=t.type+"-"+i,o=e.get(r);o||(o={},e.set(r,o)),xw(t).scope=o}}),n.eachSeries(function(t){if(!(t.isColorBySeries()||n.isSeriesFiltered(t))){var i=t.getRawData(),r={},o=t.getData(),a=xw(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=Sw(t,s);o.each(function(u){var c=o.getRawIndex(u);r[c]=u}),i.each(function(u){var c=r[u],h=o.getItemVisual(c,"colorFromPalette");if(h){var d=o.ensureUniqueItemVisual(c,"style"),f=i.getName(u)||u+"",p=i.count();d[l]=t.getColorFromPalette(f,a,p)}})}})}},kc=Math.PI;function VB(n,e){e=e||{},Me(e,{text:"loading",textColor:Z.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:Z.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var t=new Ye,i=new Ue({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(i);var r=new it({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),o=new Ue({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(o);var a;return e.showSpinner&&(a=new Bu({shape:{startAngle:-kc/2,endAngle:-kc/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),a.animateShape(!0).when(1e3,{endAngle:kc*3/2}).start("circularInOut"),a.animateShape(!0).when(1e3,{startAngle:kc*3/2}).delay(300).start("circularInOut"),t.add(a)),t.resize=function(){var s=r.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(n.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),c=n.getHeight()/2;e.showSpinner&&a.setShape({cx:u,cy:c}),o.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:n.getWidth(),height:n.getHeight()})},t.resize(),t}var Tw=function(){function n(e,t,i,r){this._stageTaskMap=me(),this.ecInstance=e,this.api=t,i=this._dataProcessorHandlers=i.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=i.concat(r)}return n.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(i){var r=i.overallTask;r&&r.dirty()})},n.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),r=i.context,o=!t&&i.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>i.blockIndex,a=o?i.step:null,s=r&&r.modDataCount,l=s!=null?Math.ceil(s/a):null;return{step:a,modBy:l,modDataCount:s}}},n.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},n.prototype.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),r=e.getData(),o=r.count(),a=i.progressiveEnabled&&t.incrementalPrepareRender&&o>=i.threshold,s=e.get("large")&&o>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?o:null;e.pipelineContext=i.context={progressiveRender:a,modDataCount:l,large:s}},n.prototype.restorePipelines=function(e){var t=this,i=t._pipelineMap=me();e.eachSeries(function(r){var o=r.getProgressive(),a=r.uid;i.set(a,{id:a,head:null,tail:null,threshold:r.getProgressiveThreshold(),progressiveEnabled:o&&!(r.preventIncremental&&r.preventIncremental()),blockIndex:-1,step:Math.round(o||700),count:0}),t._pipe(r,r.dataTask)})},n.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),i=this.api;N(this._allHandlers,function(r){var o=e.get(r.uid)||e.set(r.uid,{}),a="";process.env.NODE_ENV!=="production"&&(a='"reset" and "overallReset" must not be both specified.'),J(!(r.reset&&r.overallReset),a),r.reset&&this._createSeriesStageTask(r,o,t,i),r.overallReset&&this._createOverallStageTask(r,o,t,i)},this)},n.prototype.prepareView=function(e,t,i,r){var o=e.renderTask,a=o.context;a.model=t,a.ecModel=i,a.api=r,o.__block=!e.incrementalPrepareRender,this._pipe(t,o)},n.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},n.prototype.performVisualTasks=function(e,t,i){this._performStageTasks(this._visualHandlers,e,t,i)},n.prototype._performStageTasks=function(e,t,i,r){r=r||{};var o=!1,a=this;N(e,function(l,u){if(!(r.visualType&&r.visualType!==l.visualType)){var c=a._stageTaskMap.get(l.uid),h=c.seriesTaskMap,d=c.overallTask;if(d){var f,p=d.agentStubMap;p.each(function(m){s(r,m)&&(m.dirty(),f=!0)}),f&&d.dirty(),a.updatePayload(d,i);var g=a.getPerformArgs(d,r.block);p.each(function(m){m.perform(g)}),d.perform(g)&&(o=!0)}else h&&h.each(function(m,y){s(r,m)&&m.dirty();var v=a.getPerformArgs(m,r.block);v.skip=!l.performRawSeries&&t.isSeriesFiltered(m.context.model),a.updatePayload(m,i),m.perform(v)&&(o=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=o||this.unfinished},n.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(i){t=i.dataTask.perform()||t}),this.unfinished=t||this.unfinished},n.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},n.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},n.prototype._createSeriesStageTask=function(e,t,i,r){var o=this,a=t.seriesTaskMap,s=t.seriesTaskMap=me(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?i.eachRawSeries(c):l?i.eachRawSeriesByType(l,c):u&&u(i,r).each(c);function c(h){var d=h.uid,f=s.set(d,a&&a.get(d)||Ps({plan:UB,reset:YB,count:jB}));f.context={model:h,ecModel:i,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:o},o._pipe(h,f)}},n.prototype._createOverallStageTask=function(e,t,i,r){var o=this,a=t.overallTask=t.overallTask||Ps({reset:HB});a.context={ecModel:i,api:r,overallReset:e.overallReset,scheduler:o};var s=a.agentStubMap,l=a.agentStubMap=me(),u=e.seriesType,c=e.getTargetSeries,h=!0,d=!1,f="";process.env.NODE_ENV!=="production"&&(f='"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),J(!e.createOnAllSeries,f),u?i.eachRawSeriesByType(u,p):c?c(i,r).each(p):(h=!1,N(i.getSeries(),p));function p(g){var m=g.uid,y=l.set(m,s&&s.get(m)||(d=!0,Ps({reset:FB,onDirty:WB})));y.context={model:g,overallProgress:h},y.agent=a,y.__block=h,o._pipe(g,y)}d&&a.dirty()},n.prototype._pipe=function(e,t){var i=e.uid,r=this._pipelineMap.get(i);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},n.wrapStageHandler=function(e,t){return ce(e)&&(e={overallReset:e,seriesType:$B(e)}),e.uid=Is("stageHandler"),t&&(e.visualType=t),e},n}();function HB(n){n.overallReset(n.ecModel,n.api,n.payload)}function FB(n){return n.overallProgress&&GB}function GB(){this.agent.dirty(),this.getDownstream().dirty()}function WB(){this.agent&&this.agent.dirty()}function UB(n){return n.plan?n.plan(n.model,n.ecModel,n.api,n.payload):null}function YB(n){n.useClearVisual&&n.data.clearAllVisual();var e=n.resetDefines=_t(n.reset(n.model,n.ecModel,n.api,n.payload));return e.length>1?$(e,function(t,i){return Mw(i)}):qB}var qB=Mw(0);function Mw(n){return function(e,t){var i=t.data,r=t.resetDefines[n];if(r&&r.dataEach)for(var o=e.start;o<e.end;o++)r.dataEach(i,o);else r&&r.progress&&r.progress(e,i)}}function jB(n){return n.data.count()}function $B(n){Dc=null;try{n(js,Cw)}catch{}return Dc}var js={},Cw={},Dc;kw(js,vg),kw(Cw,dw),js.eachSeriesByType=js.eachRawSeriesByType=function(n){Dc=n},js.eachComponent=function(n){n.mainType==="series"&&n.subType&&(Dc=n.subType)};function kw(n,e){for(var t in e.prototype)n[t]=nt}var K=Z.darkColor,ZB=K.background,$s=function(){return{axisLine:{lineStyle:{color:K.axisLine}},splitLine:{lineStyle:{color:K.axisSplitLine}},splitArea:{areaStyle:{color:[K.backgroundTint,K.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:K.axisMinorSplitLine}},axisLabel:{color:K.axisLabel},axisName:{}}},Dw={label:{color:K.secondary},itemStyle:{borderColor:K.borderTint},dividerLineStyle:{color:K.border}},Iw={darkMode:!0,color:K.theme,backgroundColor:ZB,axisPointer:{lineStyle:{color:K.border},crossStyle:{color:K.borderShade},label:{color:K.tertiary}},legend:{textStyle:{color:K.secondary},pageTextStyle:{color:K.tertiary}},textStyle:{color:K.secondary},title:{textStyle:{color:K.primary},subtextStyle:{color:K.quaternary}},toolbox:{iconStyle:{borderColor:K.accent50}},tooltip:{backgroundColor:K.neutral20,defaultBorderColor:K.border,textStyle:{color:K.tertiary}},dataZoom:{borderColor:K.accent10,textStyle:{color:K.tertiary},brushStyle:{color:K.backgroundTint},handleStyle:{color:K.neutral00,borderColor:K.accent20},moveHandleStyle:{color:K.accent40},emphasis:{handleStyle:{borderColor:K.accent50}},dataBackground:{lineStyle:{color:K.accent30},areaStyle:{color:K.accent20}},selectedDataBackground:{lineStyle:{color:K.accent50},areaStyle:{color:K.accent30}}},visualMap:{textStyle:{color:K.secondary},handleStyle:{borderColor:K.neutral30}},timeline:{lineStyle:{color:K.accent10},label:{color:K.tertiary},controlStyle:{color:K.accent30,borderColor:K.accent30}},calendar:{itemStyle:{color:K.neutral00,borderColor:K.neutral20},dayLabel:{color:K.tertiary},monthLabel:{color:K.secondary},yearLabel:{color:K.secondary}},matrix:{x:Dw,y:Dw,backgroundColor:{borderColor:K.axisLine},body:{itemStyle:{borderColor:K.borderTint}}},timeAxis:$s(),logAxis:$s(),valueAxis:$s(),categoryAxis:$s(),line:{symbol:"circle"},graph:{color:K.theme},gauge:{title:{color:K.secondary},axisLine:{lineStyle:{color:[[1,K.neutral05]]}},axisLabel:{color:K.axisLabel},detail:{color:K.primary}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}},funnel:{itemStyle:{borderColor:K.background}},radar:function(){var n=$s();return n.axisName={color:K.axisLabel},n.axisLine.lineStyle.color=K.neutral20,n}(),treemap:{breadcrumb:{itemStyle:{color:K.neutral20,textStyle:{color:K.secondary}},emphasis:{itemStyle:{color:K.neutral30}}}},sunburst:{itemStyle:{borderColor:K.background}},map:{itemStyle:{borderColor:K.border,areaColor:K.neutral10},label:{color:K.tertiary},emphasis:{label:{color:K.primary},itemStyle:{areaColor:K.highlight}},select:{label:{color:K.primary},itemStyle:{areaColor:K.highlight}}},geo:{itemStyle:{borderColor:K.border,areaColor:K.neutral10},emphasis:{label:{color:K.primary},itemStyle:{areaColor:K.highlight}},select:{label:{color:K.primary},itemStyle:{color:K.highlight}}}};Iw.categoryAxis.splitLine.show=!1;var XB=function(){function n(){}return n.prototype.normalizeQuery=function(e){var t={},i={},r={};if(Q(e)){var o=On(e);t.mainType=o.main||null,t.subType=o.sub||null}else{var a=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};N(e,function(l,u){for(var c=!1,h=0;h<a.length;h++){var d=a[h],f=u.lastIndexOf(d);if(f>0&&f===u.length-d.length){var p=u.slice(0,f);p!=="data"&&(t.mainType=p,t[d.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(i[u]=l,c=!0),c||(r[u]=l)})}return{cptQuery:t,dataQuery:i,otherQuery:r}},n.prototype.filter=function(e,t){var i=this.eventInfo;if(!i)return!0;var r=i.targetEl,o=i.packedEvent,a=i.model,s=i.view;if(!a||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return c(l,a,"mainType")&&c(l,a,"subType")&&c(l,a,"index","componentIndex")&&c(l,a,"name")&&c(l,a,"id")&&c(u,o,"name")&&c(u,o,"dataIndex")&&c(u,o,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,r,o));function c(h,d,f,p){return h[f]==null||d[p||f]===h[f]}},n.prototype.afterTrigger=function(){this.eventInfo=null},n}(),bg=["symbol","symbolSize","symbolRotate","symbolOffset"],Ew=bg.concat(["symbolKeepAspect"]),KB={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData();if(n.legendIcon&&t.setVisual("legendIcon",n.legendIcon),!n.hasSymbolVisual)return;for(var i={},r={},o=!1,a=0;a<bg.length;a++){var s=bg[a],l=n.get(s);ce(l)?(o=!0,r[s]=l):i[s]=l}if(i.symbol=i.symbol||n.defaultSymbol,t.setVisual(U({legendIcon:n.legendIcon||i.symbol,symbolKeepAspect:n.get("symbolKeepAspect")},i)),e.isSeriesFiltered(n))return;var u=Ce(r);function c(h,d){for(var f=n.getRawValue(d),p=n.getDataParams(d),g=0;g<u.length;g++){var m=u[g];h.setItemVisual(d,m,r[m](f,p))}}return{dataEach:o?c:null}}},QB={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){if(!n.hasSymbolVisual||e.isSeriesFiltered(n))return;var t=n.getData();function i(r,o){for(var a=r.getItemModel(o),s=0;s<Ew.length;s++){var l=Ew[s],u=a.getShallow(l,!0);u!=null&&r.setItemVisual(o,l,u)}}return{dataEach:t.hasItemOption?i:null}}};function Nw(n,e,t){switch(t){case"color":var i=n.getItemVisual(e,"style");return i[n.getVisual("drawType")];case"opacity":return n.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return n.getItemVisual(e,t);default:process.env.NODE_ENV!=="production"&&console.warn("Unknown visual type "+t)}}function wg(n,e){switch(e){case"color":var t=n.getVisual("style");return t[n.getVisual("drawType")];case"opacity":return n.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return n.getVisual(e);default:process.env.NODE_ENV!=="production"&&console.warn("Unknown visual type "+e)}}function JB(n,e,t,i){switch(t){case"color":var r=n.ensureUniqueItemVisual(e,"style");r[n.getVisual("drawType")]=i,n.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":n.ensureUniqueItemVisual(e,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":n.setItemVisual(e,t,i);break;default:process.env.NODE_ENV!=="production"&&console.warn("Unknown visual type "+t)}}function Zs(n,e,t){for(var i;n&&!(e(n)&&(i=n,t));)n=n.__hostTarget||n.parent;return i}var eV=Math.round(Math.random()*9),tV=typeof Object.defineProperty=="function",nV=function(){function n(){this._id="__ec_inner_"+eV++}return n.prototype.get=function(e){return this._guard(e)[this._id]},n.prototype.set=function(e,t){var i=this._guard(e);return tV?Object.defineProperty(i,this._id,{value:t,enumerable:!1,configurable:!0}):i[this._id]=t,this},n.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},n.prototype.has=function(e){return!!this._guard(e)[this._id]},n.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},n}();function to(n){return isFinite(n)}function iV(n,e,t){var i=e.x==null?0:e.x,r=e.x2==null?1:e.x2,o=e.y==null?0:e.y,a=e.y2==null?0:e.y2;e.global||(i=i*t.width+t.x,r=r*t.width+t.x,o=o*t.height+t.y,a=a*t.height+t.y),i=to(i)?i:0,r=to(r)?r:1,o=to(o)?o:0,a=to(a)?a:0;var s=n.createLinearGradient(i,o,r,a);return s}function rV(n,e,t){var i=t.width,r=t.height,o=Math.min(i,r),a=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(a=a*i+t.x,s=s*r+t.y,l=l*o),a=to(a)?a:.5,s=to(s)?s:.5,l=l>=0&&to(l)?l:.5;var u=n.createRadialGradient(a,s,0,a,s,l);return u}function Sg(n,e,t){for(var i=e.type==="radial"?rV(n,e,t):iV(n,e,t),r=e.colorStops,o=0;o<r.length;o++)i.addColorStop(r[o].offset,r[o].color);return i}function oV(n,e){if(n===e||!n&&!e)return!1;if(!n||!e||n.length!==e.length)return!0;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!0;return!1}function Ic(n){return parseInt(n,10)}function la(n,e,t){var i=["width","height"][e],r=["clientWidth","clientHeight"][e],o=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(t[i]!=null&&t[i]!=="auto")return parseFloat(t[i]);var s=document.defaultView.getComputedStyle(n);return(n[r]||Ic(s[i])||Ic(n.style[i]))-(Ic(s[o])||0)-(Ic(s[a])||0)|0}function aV(n,e){return!n||n==="solid"||!(e>0)?null:n==="dashed"?[4*e,2*e]:n==="dotted"?[e]:Ne(n)?[n]:q(n)?n:null}function Tg(n){var e=n.style,t=e.lineDash&&e.lineWidth>0&&aV(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(t){var r=e.strokeNoScale&&n.getLineScale?n.getLineScale():1;r&&r!==1&&(t=$(t,function(o){return o/r}),i/=r)}return[t,i]}var sV=new Hi(!0);function Ec(n){var e=n.stroke;return!(e==null||e==="none"||!(n.lineWidth>0))}function Aw(n){return typeof n=="string"&&n!=="none"}function Nc(n){var e=n.fill;return e!=null&&e!=="none"}function Ow(n,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.fillOpacity*e.opacity,n.fill(),n.globalAlpha=t}else n.fill()}function Rw(n,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.strokeOpacity*e.opacity,n.stroke(),n.globalAlpha=t}else n.stroke()}function Mg(n,e,t){var i=dd(e.image,e.__image,t);if(Ul(i)){var r=n.createPattern(i,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*Gl),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}function lV(n,e,t,i){var r,o=Ec(t),a=Nc(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var c=e.path||sV,h=e.__dirty;if(!i){var d=t.fill,f=t.stroke,p=a&&!!d.colorStops,g=o&&!!f.colorStops,m=a&&!!d.image,y=o&&!!f.image,v=void 0,_=void 0,b=void 0,T=void 0,w=void 0;(p||g)&&(w=e.getBoundingRect()),p&&(v=h?Sg(n,d,w):e.__canvasFillGradient,e.__canvasFillGradient=v),g&&(_=h?Sg(n,f,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),m&&(b=h||!e.__canvasFillPattern?Mg(n,d,e):e.__canvasFillPattern,e.__canvasFillPattern=b),y&&(T=h||!e.__canvasStrokePattern?Mg(n,f,e):e.__canvasStrokePattern,e.__canvasStrokePattern=T),p?n.fillStyle=v:m&&(b?n.fillStyle=b:a=!1),g?n.strokeStyle=_:y&&(T?n.strokeStyle=T:o=!1)}var S=e.getGlobalScale();c.setScale(S[0],S[1],e.segmentIgnoreThreshold);var M,C;n.setLineDash&&t.lineDash&&(r=Tg(e),M=r[0],C=r[1]);var I=!0;(u||h&Po)&&(c.setDPR(n.dpr),l?c.setContext(null):(c.setContext(n),I=!1),c.reset(),e.buildPath(c,e.shape,i),c.toStatic(),e.pathUpdated()),I&&c.rebuildPath(n,l?s:1),M&&(n.setLineDash(M),n.lineDashOffset=C),i||(t.strokeFirst?(o&&Rw(n,t),a&&Ow(n,t)):(a&&Ow(n,t),o&&Rw(n,t))),M&&n.setLineDash([])}function uV(n,e,t){var i=e.__image=dd(t.image,e.__image,e,e.onload);if(!(!i||!Ul(i))){var r=t.x||0,o=t.y||0,a=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(a==null&&s!=null?a=s*l:s==null&&a!=null?s=a/l:a==null&&s==null&&(a=i.width,s=i.height),t.sWidth&&t.sHeight){var u=t.sx||0,c=t.sy||0;n.drawImage(i,u,c,t.sWidth,t.sHeight,r,o,a,s)}else if(t.sx&&t.sy){var u=t.sx,c=t.sy,h=a-u,d=s-c;n.drawImage(i,u,c,h,d,r,o,a,s)}else n.drawImage(i,r,o,a,s)}}function cV(n,e,t){var i,r=t.text;if(r!=null&&(r+=""),r){n.font=t.font||oi,n.textAlign=t.textAlign,n.textBaseline=t.textBaseline;var o=void 0,a=void 0;n.setLineDash&&t.lineDash&&(i=Tg(e),o=i[0],a=i[1]),o&&(n.setLineDash(o),n.lineDashOffset=a),t.strokeFirst?(Ec(t)&&n.strokeText(r,t.x,t.y),Nc(t)&&n.fillText(r,t.x,t.y)):(Nc(t)&&n.fillText(r,t.x,t.y),Ec(t)&&n.strokeText(r,t.x,t.y)),o&&n.setLineDash([])}}var Lw=["shadowBlur","shadowOffsetX","shadowOffsetY"],Pw=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function zw(n,e,t,i,r){var o=!1;if(!i&&(t=t||{},e===t))return!1;if(i||e.opacity!==t.opacity){Bt(n,r),o=!0;var a=Math.max(Math.min(e.opacity,1),0);n.globalAlpha=isNaN(a)?Mr.opacity:a}(i||e.blend!==t.blend)&&(o||(Bt(n,r),o=!0),n.globalCompositeOperation=e.blend||Mr.blend);for(var s=0;s<Lw.length;s++){var l=Lw[s];(i||e[l]!==t[l])&&(o||(Bt(n,r),o=!0),n[l]=n.dpr*(e[l]||0))}return(i||e.shadowColor!==t.shadowColor)&&(o||(Bt(n,r),o=!0),n.shadowColor=e.shadowColor||Mr.shadowColor),o}function Bw(n,e,t,i,r){var o=Xs(e,r.inHover),a=i?null:t&&Xs(t,r.inHover)||{};if(o===a)return!1;var s=zw(n,o,a,i,r);if((i||o.fill!==a.fill)&&(s||(Bt(n,r),s=!0),Aw(o.fill)&&(n.fillStyle=o.fill)),(i||o.stroke!==a.stroke)&&(s||(Bt(n,r),s=!0),Aw(o.stroke)&&(n.strokeStyle=o.stroke)),(i||o.opacity!==a.opacity)&&(s||(Bt(n,r),s=!0),n.globalAlpha=o.opacity==null?1:o.opacity),e.hasStroke()){var l=o.lineWidth,u=l/(o.strokeNoScale&&e.getLineScale?e.getLineScale():1);n.lineWidth!==u&&(s||(Bt(n,r),s=!0),n.lineWidth=u)}for(var c=0;c<Pw.length;c++){var h=Pw[c],d=h[0];(i||o[d]!==a[d])&&(s||(Bt(n,r),s=!0),n[d]=o[d]||h[1])}return s}function hV(n,e,t,i,r){return zw(n,Xs(e,r.inHover),t&&Xs(t,r.inHover),i,r)}function Vw(n,e){var t=e.transform,i=n.dpr||1;t?n.setTransform(i*t[0],i*t[1],i*t[2],i*t[3],i*t[4],i*t[5]):n.setTransform(i,0,0,i,0,0)}function dV(n,e,t){for(var i=!1,r=0;r<n.length;r++){var o=n[r];i=i||o.isZeroArea(),Vw(e,o),e.beginPath(),o.buildPath(e,o.shape),e.clip()}t.allClipped=i}function fV(n,e){return n&&e?n[0]!==e[0]||n[1]!==e[1]||n[2]!==e[2]||n[3]!==e[3]||n[4]!==e[4]||n[5]!==e[5]:!(!n&&!e)}var Hw=1,Fw=2,Gw=3,Ww=4;function pV(n){var e=Nc(n),t=Ec(n);return!(n.lineDash||!(+e^+t)||e&&typeof n.fill!="string"||t&&typeof n.stroke!="string"||n.strokePercent<1||n.strokeOpacity<1||n.fillOpacity<1)}function Bt(n,e){e.batchFill&&n.fill(),e.batchStroke&&n.stroke(),e.batchFill="",e.batchStroke=""}function Xs(n,e){return e&&n.__hoverStyle||n.style}function Uw(n,e){no(n,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function no(n,e,t,i){var r=e.transform;if(!e.shouldBePainted(t.viewWidth,t.viewHeight,!1,!1)){e.__dirty&=~Yt,e.__isRendered=!1;return}var o=e.__clipPaths,a=t.prevElClipPaths,s=!1,l=!1;if((!a||oV(o,a))&&(a&&a.length&&(Bt(n,t),n.restore(),l=s=!0,t.prevElClipPaths=null,t.allClipped=!1,t.prevEl=null),o&&o.length&&(Bt(n,t),n.save(),dV(o,n,t),s=!0),t.prevElClipPaths=o),t.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var u=t.prevEl;u||(l=s=!0);var c=e instanceof Ae&&e.autoBatch&&pV(e.style);s||fV(r,u.transform)?(Bt(n,t),Vw(n,e)):c||Bt(n,t);var h=Xs(e,t.inHover);e instanceof Ae?(t.lastDrawType!==Hw&&(l=!0,t.lastDrawType=Hw),Bw(n,e,u,l,t),(!c||!t.batchFill&&!t.batchStroke)&&n.beginPath(),lV(n,e,h,c),c&&(t.batchFill=h.fill||"",t.batchStroke=h.stroke||"")):e instanceof ss?(t.lastDrawType!==Gw&&(l=!0,t.lastDrawType=Gw),Bw(n,e,u,l,t),cV(n,e,h)):e instanceof Hn?(t.lastDrawType!==Fw&&(l=!0,t.lastDrawType=Fw),hV(n,e,u,l,t),uV(n,e,h)):e.getTemporalDisplayables&&(t.lastDrawType!==Ww&&(l=!0,t.lastDrawType=Ww),gV(n,e,t)),c&&i&&Bt(n,t),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),t.prevEl=e,e.__dirty=0,e.__isRendered=!0}function gV(n,e,t){var i=e.getDisplayables(),r=e.getTemporalDisplayables();n.save();var o={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:t.viewWidth,viewHeight:t.viewHeight,inHover:t.inHover},a,s;for(a=e.getCursor(),s=i.length;a<s;a++){var l=i[a];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),no(n,l,o,a===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),o.prevEl=l}for(var u=0,c=r.length;u<c;u++){var l=r[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),no(n,l,o,u===c-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),o.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,n.restore()}var Cg=new nV,Yw=new Mo(100),qw=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function kg(n,e){if(n==="none")return null;var t=e.getDevicePixelRatio(),i=e.getZr(),r=i.painter.type==="svg";n.dirty&&Cg.delete(n);var o=Cg.get(n);if(o)return o;var a=Me(n,{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});a.backgroundColor==="none"&&(a.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=a.rotation,s.scaleX=s.scaleY=r?1:1/t,Cg.set(n,s),n.dirty=!1,s;function l(u){for(var c=[t],h=!0,d=0;d<qw.length;++d){var f=a[qw[d]];if(f!=null&&!q(f)&&!Q(f)&&!Ne(f)&&typeof f!="boolean"){h=!1;break}c.push(f)}var p;if(h){p=c.join(",")+(r?"-svg":"");var g=Yw.get(p);g&&(r?u.svgElement=g:u.image=g)}var m=$w(a.dashArrayX),y=mV(a.dashArrayY),v=jw(a.symbol),_=yV(m),b=Zw(y),T=!r&&ai.createCanvas(),w=r&&{tag:"g",attrs:{},key:"dcl",children:[]},S=C(),M;T&&(T.width=S.width*t,T.height=S.height*t,M=T.getContext("2d")),I(),h&&Yw.put(p,T||w),u.image=T,u.svgElement=w,u.svgWidth=S.width,u.svgHeight=S.height;function C(){for(var E=1,k=0,D=_.length;k<D;++k)E=x_(E,_[k]);for(var A=1,k=0,D=v.length;k<D;++k)A=x_(A,v[k].length);E*=A;var R=b*_.length*v.length;if(process.env.NODE_ENV!=="production"){var L=function(V){console.warn("Calculated decal size is greater than "+V+" due to decal option settings so "+V+" is used for the decal size. Please consider changing the decal option to make a smaller decal or set "+V+" to be larger to avoid incontinuity.")};E>a.maxTileWidth&&L("maxTileWidth"),R>a.maxTileHeight&&L("maxTileHeight")}return{width:Math.max(1,Math.min(E,a.maxTileWidth)),height:Math.max(1,Math.min(R,a.maxTileHeight))}}function I(){M&&(M.clearRect(0,0,T.width,T.height),a.backgroundColor&&(M.fillStyle=a.backgroundColor,M.fillRect(0,0,T.width,T.height)));for(var E=0,k=0;k<y.length;++k)E+=y[k];if(E<=0)return;for(var D=-b,A=0,R=0,L=0;D<S.height;){if(A%2===0){for(var V=R/2%v.length,z=0,H=0,F=0;z<S.width*2;){for(var j=0,k=0;k<m[L].length;++k)j+=m[L][k];if(j<=0)break;if(H%2===0){var Y=(1-a.symbolSize)*.5,ee=z+m[L][H]*Y,pe=D+y[A]*Y,Te=m[L][H]*a.symbolSize,qe=y[A]*a.symbolSize,Je=F/2%v[V].length;We(ee,pe,Te,qe,v[V][Je])}z+=m[L][H],++F,++H,H===m[L].length&&(H=0)}++L,L===m.length&&(L=0)}D+=y[A],++R,++A,A===y.length&&(A=0)}function We(He,Be,oe,xe,ct){var X=r?1:t,de=Jr(ct,He*X,Be*X,oe*X,xe*X,a.color,a.symbolKeepAspect);if(r){var ge=i.painter.renderOneToVNode(de);ge&&w.children.push(ge)}else Uw(M,de)}}}}function jw(n){if(!n||n.length===0)return[["rect"]];if(Q(n))return[[n]];for(var e=!0,t=0;t<n.length;++t)if(!Q(n[t])){e=!1;break}if(e)return jw([n]);for(var i=[],t=0;t<n.length;++t)Q(n[t])?i.push([n[t]]):i.push(n[t]);return i}function $w(n){if(!n||n.length===0)return[[0,0]];if(Ne(n)){var e=Math.ceil(n);return[[e,e]]}for(var t=!0,i=0;i<n.length;++i)if(!Ne(n[i])){t=!1;break}if(t)return $w([n]);for(var r=[],i=0;i<n.length;++i)if(Ne(n[i])){var e=Math.ceil(n[i]);r.push([e,e])}else{var e=$(n[i],function(s){return Math.ceil(s)});e.length%2===1?r.push(e.concat(e)):r.push(e)}return r}function mV(n){if(!n||typeof n=="object"&&n.length===0)return[0,0];if(Ne(n)){var e=Math.ceil(n);return[e,e]}var t=$(n,function(i){return Math.ceil(i)});return n.length%2?t.concat(t):t}function yV(n){return $(n,function(e){return Zw(e)})}function Zw(n){for(var e=0,t=0;t<n.length;++t)e+=n[t];return n.length%2===1?e*2:e}function vV(n,e){n.eachRawSeries(function(t){if(!n.isSeriesFiltered(t)){var i=t.getData();i.hasItemVisual()&&i.each(function(a){var s=i.getItemVisual(a,"decal");if(s){var l=i.ensureUniqueItemVisual(a,"style");l.decal=kg(s,e)}});var r=i.getVisual("decal");if(r){var o=i.getVisual("style");o.decal=kg(r,e)}}})}var kn=new bn,Ac={};function _V(n,e){process.env.NODE_ENV!=="production"&&Ac[n]&&ze("Already has an implementation of "+n+"."),Ac[n]=e}function xV(n){return process.env.NODE_ENV!=="production"&&(Ac[n]||ze("Implementation of "+n+" doesn't exists.")),Ac[n]}var bV=1,wV=800,SV=900,TV=1e3,MV=2e3,CV=5e3,Xw=1e3,kV=1100,Dg=2e3,Kw=3e3,DV=4e3,Oc=4500,IV=4600,EV=5e3,NV=6e3,Qw=7e3,AV={PROCESSOR:{FILTER:TV,SERIES_FILTER:wV,STATISTIC:CV},VISUAL:{LAYOUT:Xw,PROGRESSIVE_LAYOUT:kV,GLOBAL:Dg,CHART:Kw,POST_CHART_LAYOUT:IV,COMPONENT:DV,BRUSH:EV,CHART_ITEM:Oc,ARIA:NV,DECAL:Qw}},et="__flagInMainProcess",Rc="__mainProcessVersion",ut="__pendingUpdate",Ig="__needsUpdateStatus",Jw=/^[a-zA-Z0-9_]+$/,Eg="__connectUpdateStatus",eS=0,OV=1,RV=2;function tS(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.isDisposed()){Vt(this.id);return}return iS(this,n,e)}}function nS(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return iS(this,n,e)}}function iS(n,e,t){return t[0]=t[0]&&t[0].toLowerCase(),bn.prototype[e].apply(n,t)}var rS=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(bn),oS=rS.prototype;oS.on=nS("on"),oS.off=nS("off");var io,Ng,Lc,xi,Pc,Ag,Og,ua,ca,aS,sS,Rg,lS,zc,uS,cS,dn,hS,ha,dS=function(n){W(e,n);function e(t,i,r){var o=n.call(this,new XB)||this;o._chartsViews=[],o._chartsMap={},o._componentsViews=[],o._componentsMap={},o._pendingActions=[],r=r||{},o._dom=t;var a="canvas",s="auto",l=!1;if(o[Rc]=1,process.env.NODE_ENV!=="production"){var u=fe.hasGlobalWindow?window:global;u&&(a=te(u.__ECHARTS__DEFAULT__RENDERER__,a),s=te(u.__ECHARTS__DEFAULT__COARSE_POINTER,s),l=te(u.__ECHARTS__DEFAULT__USE_DIRTY_RECT__,l))}r.ssr&&uB(function(f){var p=Se(f),g=p.dataIndex;if(g!=null){var m=me();return m.set("series_index",p.seriesIndex),m.set("data_index",g),p.ssrType&&m.set("ssr_type",p.ssrType),m}});var c=o._zr=rw(t,{renderer:r.renderer||a,devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height,ssr:r.ssr,useDirtyRect:te(r.useDirtyRect,l),useCoarsePointer:te(r.useCoarsePointer,s),pointerSize:r.pointerSize});o._ssr=r.ssr,o._throttledZrFlush=pc(ke(c.flush,c),17),o._updateTheme(i),o._locale=iL(r.locale||d1),o._coordSysMgr=new sp;var h=o._api=uS(o);function d(f,p){return f.__prio-p.__prio}return wc(Hc,d),wc(zg,d),o._scheduler=new Tw(o,h,zg,Hc),o._messageCenter=new rS,o._initEvents(),o.resize=ke(o.resize,o),c.animation.on("frame",o._onframe,o),aS(c,o),sS(c,o),ud(o),o}return e.prototype._onframe=function(){if(!this._disposed){hS(this);var t=this._scheduler;if(this[ut]){var i=this[ut].silent;this[et]=!0,ha(this);try{io(this),xi.update.call(this,null,this[ut].updateParams)}catch(l){throw this[et]=!1,this[ut]=null,l}this._zr.flush(),this[et]=!1,this[ut]=null,ua.call(this,i),ca.call(this,i)}else if(t.unfinished){var r=bV,o=this._model,a=this._api;t.unfinished=!1;do{var s=+new Date;t.performSeriesTasks(o),t.performDataProcessorTasks(o),Ag(this,o),t.performVisualTasks(o),zc(this,this._model,a,"remain",{}),r-=+new Date-s}while(r>0&&t.unfinished);t.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(t,i,r){if(this[et]){process.env.NODE_ENV!=="production"&&ze("`setOption` should not be called during main process.");return}if(this._disposed){Vt(this.id);return}var o,a,s;if(ne(i)&&(r=i.lazyUpdate,o=i.silent,a=i.replaceMerge,s=i.transition,i=i.notMerge),this[et]=!0,ha(this),!this._model||i){var l=new bB(this._api),u=this._theme,c=this._model=new vg;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:a},Bg);var h={seriesTransition:s,optionChanged:!0};if(r)this[ut]={silent:o,updateParams:h},this[et]=!1,this.getZr().wakeUp();else{try{io(this),xi.update.call(this,null,h)}catch(d){throw this[ut]=null,this[et]=!1,d}this._ssr||this._zr.flush(),this[ut]=null,this[et]=!1,ua.call(this,o),ca.call(this,o)}},e.prototype.setTheme=function(t,i){if(this[et]){process.env.NODE_ENV!=="production"&&ze("`setTheme` should not be called during main process.");return}if(this._disposed){Vt(this.id);return}var r=this._model;if(r){var o=i&&i.silent,a=null;this[ut]&&(o==null&&(o=this[ut].silent),a=this[ut].updateParams,this[ut]=null),this[et]=!0,ha(this);try{this._updateTheme(t),r.setTheme(this._theme),io(this),xi.update.call(this,{type:"setTheme"},a)}catch(s){throw this[et]=!1,s}this[et]=!1,ua.call(this,o),ca.call(this,o)}},e.prototype._updateTheme=function(t){Q(t)&&(t=fS[t]),t&&(t=ue(t),t&&_w(t,!0),this._theme=t)},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||fe.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return process.env.NODE_ENV!=="production"&&rt("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var i=this._zr.painter;if(process.env.NODE_ENV!=="production"&&i.type!=="canvas")throw new Error("renderToCanvas can only be used in the canvas renderer.");return i.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var i=this._zr.painter;if(process.env.NODE_ENV!=="production"&&i.type!=="svg")throw new Error("renderToSVGString can only be used in the svg renderer.");return i.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){var t=this._zr,i=t.storage.getDisplayList();return N(i,function(r){r.stopAnimation(null,!0)}),t.painter.toDataURL()},e.prototype.getDataURL=function(t){if(this._disposed){Vt(this.id);return}t=t||{};var i=t.excludeComponents,r=this._model,o=[],a=this;N(i,function(l){r.eachComponent({mainType:l},function(u){var c=a._componentsMap[u.__viewId];c.group.ignore||(o.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return N(o,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){Vt(this.id);return}var i=t.type==="svg",r=this.group,o=Math.min,a=Math.max,s=1/0;if(pS[r]){var l=s,u=s,c=-s,h=-s,d=[],f=t&&t.pixelRatio||this.getDevicePixelRatio();N(Ks,function(_,b){if(_.group===r){var T=i?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(ue(t)),w=_.getDom().getBoundingClientRect();l=o(w.left,l),u=o(w.top,u),c=a(w.right,c),h=a(w.bottom,h),d.push({dom:T,left:w.left,top:w.top})}}),l*=f,u*=f,c*=f,h*=f;var p=c-l,g=h-u,m=ai.createCanvas(),y=rw(m,{renderer:i?"svg":"canvas"});if(y.resize({width:p,height:g}),i){var v="";return N(d,function(_){var b=_.left-l,T=_.top-u;v+='<g transform="translate('+b+","+T+')">'+_.dom+"</g>"}),y.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}else return t.connectedBackgroundColor&&y.add(new Ue({shape:{x:0,y:0,width:p,height:g},style:{fill:t.connectedBackgroundColor}})),N(d,function(_){var b=new Hn({style:{x:_.left*f-l,y:_.top*f-u,image:_.dom}});y.add(b)}),y.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,i,r){return Pc(this,"convertToPixel",t,i,r)},e.prototype.convertToLayout=function(t,i,r){return Pc(this,"convertToLayout",t,i,r)},e.prototype.convertFromPixel=function(t,i,r){return Pc(this,"convertFromPixel",t,i,r)},e.prototype.containPixel=function(t,i){if(this._disposed){Vt(this.id);return}var r=this._model,o,a=hs(r,t);return N(a,function(s,l){l.indexOf("Models")>=0&&N(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)o=o||!!c.containPoint(i);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint?o=o||h.containPoint(i,u):process.env.NODE_ENV!=="production"&&st(l+": "+(h?"The found component do not support containPoint.":"No view mapping to the found component."))}else process.env.NODE_ENV!=="production"&&st(l+": containPoint is not supported")},this)},this),!!o},e.prototype.getVisual=function(t,i){var r=this._model,o=hs(r,t,{defaultMainType:"series"}),a=o.seriesModel;process.env.NODE_ENV!=="production"&&(a||st("There is no specified series model"));var s=a.getData(),l=o.hasOwnProperty("dataIndexInside")?o.dataIndexInside:o.hasOwnProperty("dataIndex")?s.indexOfRawIndex(o.dataIndex):null;return l!=null?Nw(s,l,i):wg(s,i)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;N(LV,function(r){var o=function(a){var s=t.getModel(),l=a.target,u,c=r==="globalout";if(c?u={}:l&&Zs(l,function(g){var m=Se(g);if(m&&m.dataIndex!=null){var y=m.dataModel||s.getSeriesByIndex(m.seriesIndex);return u=y&&y.getDataParams(m.dataIndex,m.dataType,l)||{},!0}else if(m.eventData)return u=U({},m.eventData),!0},!0),u){var h=u.componentType,d=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",d=u.seriesIndex);var f=h&&d!=null&&s.getComponent(h,d),p=f&&t[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];process.env.NODE_ENV!=="production"&&!c&&!(f&&p)&&st("model or view can not be found by params"),u.event=a,u.type=r,t._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:f,view:p},t.trigger(r,u)}};o.zrEventfulCallAtLast=!0,t._zr.on(r,o,t)});var i=this._messageCenter;N(Pg,function(r,o){i.on(o,function(a){t.trigger(o,a)})}),cz(i,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){Vt(this.id);return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){Vt(this.id);return}this._disposed=!0;var t=this.getDom();t&&E_(this.getDom(),Hg,"");var i=this,r=i._api,o=i._model;N(i._componentsViews,function(a){a.dispose(o,r)}),N(i._chartsViews,function(a){a.dispose(o,r)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete Ks[i.id]},e.prototype.resize=function(t){if(this[et]){process.env.NODE_ENV!=="production"&&ze("`resize` should not be called during main process.");return}if(this._disposed){Vt(this.id);return}this._zr.resize(t);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var r=i.resetOption("media"),o=t&&t.silent;this[ut]&&(o==null&&(o=this[ut].silent),r=!0,this[ut]=null),this[et]=!0,ha(this);try{r&&io(this),xi.update.call(this,{type:"resize",animation:U({duration:0},t&&t.animation)})}catch(a){throw this[et]=!1,a}this[et]=!1,ua.call(this,o),ca.call(this,o)}},e.prototype.showLoading=function(t,i){if(this._disposed){Vt(this.id);return}if(ne(t)&&(i=t,t=""),t=t||"default",this.hideLoading(),!Vg[t]){process.env.NODE_ENV!=="production"&&st("Loading effects "+t+" not exists.");return}var r=Vg[t](this._api,i),o=this._zr;this._loadingFX=r,o.add(r)},e.prototype.hideLoading=function(){if(this._disposed){Vt(this.id);return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var i=U({},t);return i.type=Vc[t.type],i},e.prototype.dispatchAction=function(t,i){if(this._disposed){Vt(this.id);return}if(ne(i)||(i={silent:!!i}),!!Bc[t.type]&&this._model){if(this[et]){this._pendingActions.push(t);return}var r=i.silent;Og.call(this,t,r);var o=i.flush;o?this._zr.flush():o!==!1&&fe.browser.weChat&&this._throttledZrFlush(),ua.call(this,r),ca.call(this,r)}},e.prototype.updateLabelLayout=function(){kn.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){Vt(this.id);return}var i=t.seriesIndex,r=this.getModel(),o=r.getSeriesByIndex(i);process.env.NODE_ENV!=="production"&&J(t.data&&o),o.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){io=function(h){var d=h._scheduler;d.restorePipelines(h._model),d.prepareStageTasks(),Ng(h,!0),Ng(h,!1),d.plan()},Ng=function(h,d){for(var f=h._model,p=h._scheduler,g=d?h._componentsViews:h._chartsViews,m=d?h._componentsMap:h._chartsMap,y=h._zr,v=h._api,_=0;_<g.length;_++)g[_].__alive=!1;d?f.eachComponent(function(w,S){w!=="series"&&b(S)}):f.eachSeries(b);function b(w){var S=w.__requireNewView;w.__requireNewView=!1;var M="_ec_"+w.id+"_"+w.type,C=!S&&m[M];if(!C){var I=On(w.type),E=d?Et.getClass(I.main,I.sub):ln.getClass(I.sub);process.env.NODE_ENV!=="production"&&J(E,I.sub+" does not exist."),C=new E,C.init(f,v),m[M]=C,g.push(C),y.add(C.group)}w.__viewId=C.__id=M,C.__alive=!0,C.__model=w,C.group.__ecComponentInfo={mainType:w.mainType,index:w.componentIndex},!d&&p.prepareView(C,w,f,v)}for(var _=0;_<g.length;){var T=g[_];T.__alive?_++:(!d&&T.renderTask.dispose(),y.remove(T.group),T.dispose(f,v),g.splice(_,1),m[T.__id]===T&&delete m[T.__id],T.__id=T.group.__ecComponentInfo=null)}},Lc=function(h,d,f,p,g){var m=h._model;if(m.setUpdatePayload(f),!p){N([].concat(h._componentsViews).concat(h._chartsViews),T);return}var y={};y[p+"Id"]=f[p+"Id"],y[p+"Index"]=f[p+"Index"],y[p+"Name"]=f[p+"Name"];var v={mainType:p,query:y};g&&(v.subType=g);var _=f.excludeSeriesId,b;_!=null&&(b=me(),N(_t(_),function(w){var S=Un(w,null);S!=null&&b.set(S,!0)})),m&&m.eachComponent(v,function(w){var S=b&&b.get(w.id)!=null;if(!S)if(Z_(f))if(w instanceof Mn)f.type===Rr&&!f.notBlur&&!w.get(["emphasis","disabled"])&&ZA(w,f,h._api);else{var M=kf(w.mainType,w.componentIndex,f.name,h._api),C=M.focusSelf,I=M.dispatchers;f.type===Rr&&C&&!f.notBlur&&Cf(w.mainType,w.componentIndex,h._api),I&&N(I,function(E){f.type===Rr?Lr(E):Pr(E)})}else If(f)&&w instanceof Mn&&(QA(w,f,h._api),q_(w),dn(h))},h),m&&m.eachComponent(v,function(w){var S=b&&b.get(w.id)!=null;S||T(h[p==="series"?"_chartsMap":"_componentsMap"][w.__viewId])},h);function T(w){w&&w.__alive&&w[d]&&w[d](w.__model,m,h._api,f)}},xi={prepareAndUpdate:function(h){io(this),xi.update.call(this,h,h&&{optionChanged:h.newOption!=null})},update:function(h,d){var f=this._model,p=this._api,g=this._zr,m=this._coordSysMgr,y=this._scheduler;if(f){f.setUpdatePayload(h),y.restoreData(f,h),y.performSeriesTasks(f),m.create(f,p),y.performDataProcessorTasks(f,h),Ag(this,f),m.update(f,p),i(f),y.performVisualTasks(f,h);var v=f.get("backgroundColor")||"transparent";g.setBackgroundColor(v);var _=f.get("darkMode");_!=null&&_!=="auto"&&g.setDarkMode(_),Rg(this,f,p,h,d),kn.trigger("afterupdate",f,p)}},updateTransform:function(h){var d=this,f=this._model,p=this._api;if(f){f.setUpdatePayload(h);var g=[];f.eachComponent(function(y,v){if(y!=="series"){var _=d.getViewOfComponentModel(v);if(_&&_.__alive)if(_.updateTransform){var b=_.updateTransform(v,f,p,h);b&&b.update&&g.push(_)}else g.push(_)}});var m=me();f.eachSeries(function(y){var v=d._chartsMap[y.__viewId];if(v.updateTransform){var _=v.updateTransform(y,f,p,h);_&&_.update&&m.set(y.uid,1)}else m.set(y.uid,1)}),i(f),this._scheduler.performVisualTasks(f,h,{setDirty:!0,dirtyMap:m}),zc(this,f,p,h,{},m),kn.trigger("afterupdate",f,p)}},updateView:function(h){var d=this._model;d&&(d.setUpdatePayload(h),ln.markUpdateMethod(h,"updateView"),i(d),this._scheduler.performVisualTasks(d,h,{setDirty:!0}),Rg(this,d,this._api,h,{}),kn.trigger("afterupdate",d,this._api))},updateVisual:function(h){var d=this,f=this._model;f&&(f.setUpdatePayload(h),f.eachSeries(function(p){p.getData().clearAllVisual()}),ln.markUpdateMethod(h,"updateVisual"),i(f),this._scheduler.performVisualTasks(f,h,{visualType:"visual",setDirty:!0}),f.eachComponent(function(p,g){if(p!=="series"){var m=d.getViewOfComponentModel(g);m&&m.__alive&&m.updateVisual(g,f,d._api,h)}}),f.eachSeries(function(p){var g=d._chartsMap[p.__viewId];g.updateVisual(p,f,d._api,h)}),kn.trigger("afterupdate",f,this._api))},updateLayout:function(h){xi.update.call(this,h)}};function t(h,d,f,p,g){if(h._disposed){Vt(h.id);return}for(var m=h._model,y=h._coordSysMgr.getCoordinateSystems(),v,_=hs(m,f),b=0;b<y.length;b++){var T=y[b];if(T[d]&&(v=T[d](m,_,p,g))!=null)return v}process.env.NODE_ENV!=="production"&&st("No coordinate system that supports "+d+" found by the given finder.")}Pc=t,Ag=function(h,d){var f=h._chartsMap,p=h._scheduler;d.eachSeries(function(g){p.updateStreamModes(g,f[g.__viewId])})},Og=function(h,d){var f=this,p=this.getModel(),g=h.type,m=h.escapeConnect,y=Bc[g],v=(y.update||"update").split(":"),_=v.pop(),b=v[0]!=null&&On(v[0]);this[et]=!0,ha(this);var T=[h],w=!1;h.batch&&(w=!0,T=$(h.batch,function(L){return L=Me(U({},L),h),L.batch=null,L}));var S=[],M,C=[],I=y.nonRefinedEventType,E=If(h),k=Z_(h);if(k&&Y_(this._api),N(T,function(L){var V=y.action(L,p,f._api);if(y.refineEvent?C.push(V):M=V,M=M||U({},L),M.type=I,S.push(M),k){var z=yf(h),H=z.queryOptionMap,F=z.mainTypeSpecified,j=F?H.keys()[0]:"series";Lc(f,_,L,j),dn(f)}else E?(Lc(f,_,L,"series"),dn(f)):b&&Lc(f,_,L,b.main,b.sub)}),_!=="none"&&!k&&!E&&!b)try{this[ut]?(io(this),xi.update.call(this,h),this[ut]=null):xi[_].call(this,h)}catch(L){throw this[et]=!1,L}if(w?M={type:I,escapeConnect:m,batch:S}:M=S[0],this[et]=!1,!d){var D=void 0;if(y.refineEvent){var A=y.refineEvent(C,h,p,this._api).eventContent;J(ne(A)),D=Me({type:y.refinedEventType},A),D.fromAction=h.type,D.fromActionPayload=h,D.escapeConnect=!0}var R=this._messageCenter;R.trigger(M.type,M),D&&R.trigger(D.type,D)}},ua=function(h){for(var d=this._pendingActions;d.length;){var f=d.shift();Og.call(this,f,h)}},ca=function(h){!h&&this.trigger("updated")},aS=function(h,d){h.on("rendered",function(f){d.trigger("rendered",f),h.animation.isFinished()&&!d[ut]&&!d._scheduler.unfinished&&!d._pendingActions.length&&d.trigger("finished")})},sS=function(h,d){h.on("mouseover",function(f){var p=f.target,g=Zs(p,Wo);g&&(XA(g,f,d._api),dn(d))}).on("mouseout",function(f){var p=f.target,g=Zs(p,Wo);g&&(KA(g,f,d._api),dn(d))}).on("click",function(f){var p=f.target,g=Zs(p,function(v){return Se(v).dataIndex!=null},!0);if(g){var m=g.selected?"unselect":"select",y=Se(g);d._api.dispatchAction({type:m,dataType:y.dataType,dataIndexInside:y.dataIndex,seriesIndex:y.seriesIndex,isFromClick:!0})}})};function i(h){h.clearColorPalette(),h.eachSeries(function(d){d.clearColorPalette()})}function r(h){var d=[],f=[],p=!1;if(h.eachComponent(function(v,_){var b=_.get("zlevel")||0,T=_.get("z")||0,w=_.getZLevelKey();p=p||!!w,(v==="series"?f:d).push({zlevel:b,z:T,idx:_.componentIndex,type:v,key:w})}),p){var g=d.concat(f),m,y;wc(g,function(v,_){return v.zlevel===_.zlevel?v.z-_.z:v.zlevel-_.zlevel}),N(g,function(v){var _=h.getComponent(v.type,v.idx),b=v.zlevel,T=v.key;m!=null&&(b=Math.max(m,b)),T?(b===m&&T!==y&&b++,y=T):y&&(b===m&&b++,y=""),m=b,_.setZLevel(b)})}}Rg=function(h,d,f,p,g){r(d),lS(h,d,f,p,g),N(h._chartsViews,function(m){m.__alive=!1}),zc(h,d,f,p,g),N(h._chartsViews,function(m){m.__alive||m.remove(d,f)})},lS=function(h,d,f,p,g,m){N(m||h._componentsViews,function(y){var v=y.__model;u(v,y),y.render(v,d,f,p),l(v,y),c(v,y)})},zc=function(h,d,f,p,g,m){var y=h._scheduler;g=U(g||{},{updatedSeries:d.getSeries()}),kn.trigger("series:beforeupdate",d,f,g);var v=!1;d.eachSeries(function(_){var b=h._chartsMap[_.__viewId];b.__alive=!0;var T=b.renderTask;y.updatePayload(T,p),u(_,b),m&&m.get(_.uid)&&T.dirty(),T.perform(y.getPerformArgs(T))&&(v=!0),b.group.silent=!!_.get("silent"),s(_,b),q_(_)}),y.unfinished=v||y.unfinished,kn.trigger("series:layoutlabels",d,f,g),kn.trigger("series:transition",d,f,g),d.eachSeries(function(_){var b=h._chartsMap[_.__viewId];l(_,b),c(_,b)}),a(h,d),kn.trigger("series:afterupdate",d,f,g)},dn=function(h){h[Ig]=!0,h.getZr().wakeUp()},ha=function(h){h[Rc]=(h[Rc]+1)%1e3},hS=function(h){h[Ig]&&(h.getZr().storage.traverse(function(d){ys(d)||o(d)}),h[Ig]=!1)};function o(h){for(var d=[],f=h.currentStates,p=0;p<f.length;p++){var g=f[p];g==="emphasis"||g==="blur"||g==="select"||d.push(g)}h.selected&&h.states.select&&d.push("select"),h.hoverState===ku&&h.states.emphasis?d.push("emphasis"):h.hoverState===Cu&&h.states.blur&&d.push("blur"),h.useStates(d)}function a(h,d){var f=h._zr,p=f.storage,g=0;p.traverse(function(m){m.isGroup||g++}),g>d.get("hoverLayerThreshold")&&!fe.node&&!fe.worker&&d.eachSeries(function(m){if(!m.preventUsingHoverLayer){var y=h._chartsMap[m.__viewId];y.__alive&&y.eachRendered(function(v){v.states.emphasis&&(v.states.emphasis.hoverLayer=!0)})}})}function s(h,d){var f=h.get("blendMode")||null;d.eachRendered(function(p){p.isGroup||(p.style.blend=f)})}function l(h,d){if(!h.preventAutoZ){var f=Ts(h);d.eachRendered(function(p){return qf(p,f.z,f.zlevel),!0})}}function u(h,d){d.eachRendered(function(f){if(!ys(f)){var p=f.getTextContent(),g=f.getTextGuideLine();f.stateTransition&&(f.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),f.hasState()?(f.prevStates=f.currentStates,f.clearStates()):f.prevStates&&(f.prevStates=null)}})}function c(h,d){var f=h.getModel("stateAnimation"),p=h.isAnimationEnabled(),g=f.get("duration"),m=g>0?{duration:g,delay:f.get("delay"),easing:f.get("easing")}:null;d.eachRendered(function(y){if(y.states&&y.states.emphasis){if(ys(y))return;if(y instanceof Ae&&rO(y),y.__dirty){var v=y.prevStates;v&&y.useStates(v)}if(p){y.stateTransition=m;var _=y.getTextContent(),b=y.getTextGuideLine();_&&(_.stateTransition=m),b&&(b.stateTransition=m)}y.__dirty&&o(y)}})}uS=function(h){return new(function(d){W(f,d);function f(){return d!==null&&d.apply(this,arguments)||this}return f.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},f.prototype.getComponentByElement=function(p){for(;p;){var g=p.__ecComponentInfo;if(g!=null)return h._model.getComponent(g.mainType,g.index);p=p.parent}},f.prototype.enterEmphasis=function(p,g){Lr(p,g),dn(h)},f.prototype.leaveEmphasis=function(p,g){Pr(p,g),dn(h)},f.prototype.enterBlur=function(p){F_(p),dn(h)},f.prototype.leaveBlur=function(p){Tf(p),dn(h)},f.prototype.enterSelect=function(p){G_(p),dn(h)},f.prototype.leaveSelect=function(p){W_(p),dn(h)},f.prototype.getModel=function(){return h.getModel()},f.prototype.getViewOfComponentModel=function(p){return h.getViewOfComponentModel(p)},f.prototype.getViewOfSeriesModel=function(p){return h.getViewOfSeriesModel(p)},f.prototype.getMainProcessVersion=function(){return h[Rc]},f}(dw))(h)},cS=function(h){function d(f,p){for(var g=0;g<f.length;g++){var m=f[g];m[Eg]=p}}N(Vc,function(f,p){h._messageCenter.on(p,function(g){if(pS[h.group]&&h[Eg]!==eS){if(g&&g.escapeConnect)return;var m=h.makeActionFromEvent(g),y=[];N(Ks,function(v){v!==h&&v.group===h.group&&y.push(v)}),d(y,eS),N(y,function(v){v[Eg]!==OV&&v.dispatchAction(m)}),d(y,RV)}})})}}(),e}(bn),Lg=dS.prototype;Lg.on=tS("on"),Lg.off=tS("off"),Lg.one=function(n,e,t){var i=this;fi("ECharts#one is deprecated.");function r(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];e&&e.apply&&e.apply(this,o),i.off(n,r)}this.on.call(this,n,r,t)};var LV=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Vt(n){process.env.NODE_ENV!=="production"&&st("Instance "+n+" has been disposed")}var Bc={},Vc={},Pg={},zg=[],Bg=[],Hc=[],fS={},Vg={},Ks={},pS={},PV=+new Date-0,Hg="_echarts_instance_";function zV(n,e,t){var i=!(t&&t.ssr);if(i){if(process.env.NODE_ENV!=="production"&&!n)throw new Error("Initialize failed: invalid dom.");var r=BV(n);if(r)return process.env.NODE_ENV!=="production"&&st("There is a chart instance already initialized on the dom."),r;process.env.NODE_ENV!=="production"&&pr(n)&&n.nodeName.toUpperCase()!=="CANVAS"&&(!n.clientWidth&&(!t||t.width==null)||!n.clientHeight&&(!t||t.height==null))&&st("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload.")}var o=new dS(n,e,t);return o.id="ec_"+PV++,Ks[o.id]=o,i&&E_(n,Hg,o.id),cS(o),kn.trigger("afterinit",o),o}function BV(n){return Ks[PA(n,Hg)]}function gS(n,e){fS[n]=e}function mS(n){be(Bg,n)<0&&Bg.push(n)}function yS(n,e){Gg(zg,n,e,MV)}function VV(n){Fg("afterinit",n)}function HV(n){Fg("afterupdate",n)}function Fg(n,e){kn.on(n,e)}function Zn(n,e,t){var i,r,o,a,s;ce(e)&&(t=e,e=""),ne(n)?(i=n.type,r=n.event,a=n.update,s=n.publishNonRefinedEvent,t||(t=n.action),o=n.refineEvent):(i=n,r=e);function l(c){return c.toLowerCase()}r=l(r||i);var u=o?l(i):r;Bc[i]||(J(Jw.test(i)&&Jw.test(r)),o&&J(r!==i),Bc[i]={actionType:i,refinedEventType:r,nonRefinedEventType:u,update:a,action:t,refineEvent:o},Pg[r]=1,o&&s&&(Pg[u]=1),process.env.NODE_ENV!=="production"&&Vc[u]&&ze(u+' must not be shared; use "refineEvent" if you intend to share an event name.'),Vc[u]=i)}function FV(n,e){sp.register(n,e)}function GV(n,e){Gg(Hc,n,e,Xw,"layout")}function ro(n,e){Gg(Hc,n,e,Kw,"visual")}var vS=[];function Gg(n,e,t,i,r){if((ce(e)||ne(e))&&(t=e,e=i),process.env.NODE_ENV!=="production"){if(isNaN(e)||e==null)throw new Error("Illegal priority");N(n,function(a){J(a.__raw!==t)})}if(!(be(vS,t)>=0)){vS.push(t);var o=Tw.wrapStageHandler(t,r);o.__prio=e,o.__raw=t,n.push(o)}}function _S(n,e){Vg[n]=e}function WV(n,e,t){var i=xV("registerMap");i&&i(n,e,t)}var UV=PL;ro(Dg,PB),ro(Oc,zB),ro(Oc,BB),ro(Dg,KB),ro(Oc,QB),ro(Qw,vV),mS(_w),yS(SV,OB),_S("default",VB),Zn({type:Rr,event:Rr,update:Rr},nt),Zn({type:Iu,event:Iu,update:Iu},nt),Zn({type:Eu,event:bf,update:Eu,action:nt,refineEvent:Wg,publishNonRefinedEvent:!0}),Zn({type:xf,event:bf,update:xf,action:nt,refineEvent:Wg,publishNonRefinedEvent:!0}),Zn({type:Nu,event:bf,update:Nu,action:nt,refineEvent:Wg,publishNonRefinedEvent:!0});function Wg(n,e,t,i){return{eventContent:{selected:JA(t),isFromClick:e.isFromClick||!1}}}gS("default",{}),gS("dark",Iw);var xS=[],YV={registerPreprocessor:mS,registerProcessor:yS,registerPostInit:VV,registerPostUpdate:HV,registerUpdateLifecycle:Fg,registerAction:Zn,registerCoordinateSystem:FV,registerLayout:GV,registerVisual:ro,registerTransform:UV,registerLoading:_S,registerMap:WV,registerImpl:_V,PRIORITY:AV,ComponentModel:De,ComponentView:Et,SeriesModel:Mn,ChartView:ln,registerComponentModel:function(n){De.registerClass(n)},registerComponentView:function(n){Et.registerClass(n)},registerSeriesModel:function(n){Mn.registerClass(n)},registerChartView:function(n){ln.registerClass(n)},registerCustomSeries:function(n,e){},registerSubTypeDefaulter:function(n,e){De.registerSubTypeDefaulter(n,e)},registerPainter:function(n,e){sB(n,e)}};function bi(n){if(q(n)){N(n,function(e){bi(e)});return}be(xS,n)>=0||(xS.push(n),ce(n)&&(n={install:n}),n.install(YV))}var bS={left:0,right:0,top:0,bottom:0},Fc=["25%","25%"],qV=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.mergeDefaultAndTheme=function(t,i){var r=Ls(t.outerBounds);n.prototype.mergeDefaultAndTheme.apply(this,arguments),r&&t.outerBounds&&Zi(t.outerBounds,r)},e.prototype.mergeOption=function(t,i){n.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&t.outerBounds&&Zi(this.option.outerBounds,t.outerBounds)},e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:bS,outerBoundsContain:"all",outerBoundsClampWidth:Fc[0],outerBoundsClampHeight:Fc[1],backgroundColor:Z.color.transparent,borderWidth:1,borderColor:Z.color.neutral30},e}(De),jV=function(){function n(){}return n.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},n.prototype.getCoordSysModel=function(){},n}(),Ug=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",xt).models[0]},e.type="cartesian2dAxis",e}(De);yn(Ug,jV);var wS={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:Z.color.axisLine,width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15],breakLine:!0},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,color:Z.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:Z.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[Z.color.backgroundTint,Z.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:Z.color.neutral00,borderColor:Z.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},$V=_e({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},wS),Yg=_e({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:Z.color.axisMinorSplitLine,width:1}}},wS),ZV=_e({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Yg),XV=Me({logBase:10},Yg);const KV={category:$V,value:Yg,time:ZV,log:XV};var QV=0,qg=function(){function n(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++QV,this._onCollect=e.onCollect}return n.createByAxisModel=function(e){var t=e.option,i=t.data,r=i&&$(i,JV);return new n({categories:r,needCollect:!r,deduplication:t.dedplication!==!1})},n.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},n.prototype.parseAndCollect=function(e){var t,i=this._needCollect;if(!Q(e)&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,this._onCollect&&this._onCollect(e,t),t;var r=this._getOrCreateMap();return t=r.get(e),t==null&&(i?(t=this.categories.length,this.categories[t]=e,r.set(e,t),this._onCollect&&this._onCollect(e,t)):t=NaN),t},n.prototype._getOrCreateMap=function(){return this._map||(this._map=me(this.categories))},n}();function JV(n){return ne(n)&&n.value!=null?n.value:n+""}var e5={value:1,category:1,time:1,log:1},t5=null;function n5(){return t5}function SS(n,e,t,i){N(e5,function(r,o){var a=_e(_e({},KV[o],!0),i,!0),s=function(l){W(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=e+"Axis."+o,c}return u.prototype.mergeDefaultAndTheme=function(c,h){var d=Rs(this),f=d?Ls(c):{},p=h.getTheme();_e(c,p.get(o+"Axis")),_e(c,this.getDefaultOption()),c.type=TS(c),d&&Zi(c,f,d)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=qg.createByAxisModel(this))},u.prototype.getCategories=function(c){var h=this.option;if(h.type==="category")return c?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){return{breaks:[]}},u.type=e+"Axis."+o,u.defaultOption=a,u}(t);n.registerComponentModel(s)}),n.registerSubTypeDefaulter(e+"Axis",TS)}function TS(n){return n.type||(n.data?"category":"value")}function i5(n){var e=Math.pow(10,bu(Math.abs(n))),t=Math.abs(n/e);return t===0||t===1||t===2||t===3||t===5}function jg(n){return n.type==="interval"||n.type==="log"}function r5(n,e,t,i,r){var o={},a=o.interval=m_(e/t);i!=null&&a<i&&(a=o.interval=i),r!=null&&a>r&&(a=o.interval=r);var s=o.intervalPrecision=Qs(a),l=o.niceTickExtent=[at(Math.ceil(n[0]/a)*a,s),at(Math.floor(n[1]/a)*a,s)];return o5(l,n),o}function $g(n){var e=Math.pow(10,bu(n)),t=n/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,at(t*e)}function Qs(n){return Wn(n)+2}function MS(n,e,t){n[e]=Math.max(Math.min(n[e],t[1]),t[0])}function o5(n,e){!isFinite(n[0])&&(n[0]=e[0]),!isFinite(n[1])&&(n[1]=e[1]),MS(n,0,e),MS(n,1,e),n[0]>n[1]&&(n[0]=n[1])}function Zg(n,e){return n>=e[0]&&n<=e[1]}var a5=function(){function n(){this.normalize=CS,this.scale=kS}return n.prototype.updateMethods=function(e){e.hasBreaks()?(this.normalize=ke(e.normalize,e),this.scale=ke(e.scale,e)):(this.normalize=CS,this.scale=kS)},n}();function CS(n,e){return e[1]===e[0]?.5:(n-e[0])/(e[1]-e[0])}function kS(n,e){return n*(e[1]-e[0])+e[0]}function Xg(n,e,t){var i=Math.log(n);return[Math.log(t?e[0]:Math.max(0,e[0]))/i,Math.log(t?e[1]:Math.max(0,e[1]))/i]}var ir=function(){function n(e){this._calculator=new a5,this._setting=e||{},this._extent=[1/0,-1/0]}return n.prototype.getSetting=function(e){return this._setting[e]},n.prototype._innerUnionExtent=function(e){var t=this._extent;this._innerSetExtent(e[0]<t[0]?e[0]:t[0],e[1]>t[1]?e[1]:t[1])},n.prototype.unionExtentFromData=function(e,t){this._innerUnionExtent(e.getApproximateExtent(t))},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.setExtent=function(e,t){this._innerSetExtent(e,t)},n.prototype._innerSetExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t),this._brkCtx&&this._brkCtx.update(i)},n.prototype.setBreaksFromOption=function(e){},n.prototype._innerSetBreak=function(e){this._brkCtx&&(this._brkCtx.setBreaks(e),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},n.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},n.prototype.hasBreaks=function(){return this._brkCtx?this._brkCtx.hasBreaks():!1},n.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},n.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},n.prototype.isBlank=function(){return this._isBlank},n.prototype.setBlank=function(e){this._isBlank=e},n}();Wl(ir);var DS=function(n){W(e,n);function e(t){var i=n.call(this,t)||this;i.type="ordinal";var r=i.getSetting("ordinalMeta");return r||(r=new qg({})),q(r)&&(r=new qg({categories:$(r,function(o){return ne(o)?o.value:o})})),i._ordinalMeta=r,i._extent=i.getSetting("extent")||[0,r.categories.length-1],i}return e.prototype.parse=function(t){return t==null?NaN:Q(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return Zg(t,this._extent)&&t>=0&&t<this._ordinalMeta.categories.length},e.prototype.normalize=function(t){return t=this._getTickNumber(t),this._calculator.normalize(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(this._calculator.scale(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],i=this._extent,r=i[0];r<=i[1];)t.push({value:r}),r++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=t.ordinalNumbers,r=this._ordinalNumbersByTick=[],o=this._ticksByOrdinalNumber=[],a=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);a<l;++a){var u=i[a];r[a]=u,o[u]=a}for(var c=0;a<s;++a){for(;o[c]!=null;)c++;r.push(c),o[c]=a}},e.prototype._getTickNumber=function(t){var i=this._ticksByOrdinalNumber;return i&&t>=0&&t<i.length?i[t]:t},e.prototype.getRawOrdinalNumber=function(t){var i=this._ordinalNumbersByTick;return i&&t>=0&&t<i.length?i[t]:t},e.prototype.getLabel=function(t){if(!this.isBlank()){var i=this.getRawOrdinalNumber(t.value),r=this._ordinalMeta.categories[i];return r==null?"":r+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.isInExtentRange=function(t){return t=this._getTickNumber(t),this._extent[0]<=t&&this._extent[1]>=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(ir);ir.registerClass(DS);var rr=at,da=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t==null||t===""?NaN:Number(t)},e.prototype.contain=function(t){return Zg(t,this._extent)},e.prototype.normalize=function(t){return this._calculator.normalize(t,this._extent)},e.prototype.scale=function(t){return this._calculator.scale(t,this._extent)},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Qs(t)},e.prototype.getTicks=function(t){t=t||{};var i=this._interval,r=this._extent,o=this._niceExtent,a=this._intervalPrecision,s=[];if(!i)return s;t.breakTicks;var l=1e4;r[0]<o[0]&&(t.expandToNicedExtent?s.push({value:rr(o[0]-i,a)}):s.push({value:r[0]}));for(var u=function(f,p){return Math.round((p-f)/i)},c=o[0];c<=o[1];){if(s.push({value:c}),c=rr(c+i,a),this._brkCtx){var h=this._brkCtx.calcNiceTickMultiple(c,u);h>=0&&(c=rr(c+h*i,a))}if(s.length>0&&c===s[s.length-1].value)break;if(s.length>l)return[]}var d=s.length?s[s.length-1].value:o[1];return r[1]>d&&(t.expandToNicedExtent?s.push({value:rr(d+i,a)}):s.push({value:r[1]})),t.breakTicks,s},e.prototype.getMinorTicks=function(t){for(var i=this.getTicks({expandToNicedExtent:!0}),r=[],o=this.getExtent(),a=1;a<i.length;a++){var s=i[a],l=i[a-1];if(!(l.break||s.break)){for(var u=0,c=[],h=s.value-l.value,d=h/t,f=Qs(d);u<t-1;){var p=rr(l.value+(u+1)*d,f);p>o[0]&&p<o[1]&&c.push(p),u++}var g=mp();g&&g.pruneTicksByBreak("auto",c,this._getNonTransBreaks(),function(m){return m},this._interval,o),r.push(c)}}return r},e.prototype._getNonTransBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},e.prototype.getLabel=function(t,i){if(t==null)return"";var r=i&&i.precision;r==null?r=Wn(t.value)||0:r==="auto"&&(r=this._intervalPrecision);var o=rr(t.value,r,!0);return S1(o)},e.prototype.calcNiceTicks=function(t,i,r){t=t||5;var o=this._extent.slice(),a=this._getExtentSpanWithBreaks();if(isFinite(a)){a<0&&(a=-a,o.reverse(),this._innerSetExtent(o[0],o[1]),o=this._extent.slice());var s=r5(o,a,t,i,r);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(t){var i=this._extent.slice();if(i[0]===i[1])if(i[0]!==0){var r=Math.abs(i[0]);t.fixMax||(i[1]+=r/2),i[0]-=r/2}else i[1]=1;var o=i[1]-i[0];isFinite(o)||(i[0]=0,i[1]=1),this._innerSetExtent(i[0],i[1]),i=this._extent.slice(),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var a=this._interval,s=this._intervalPrecision;t.fixMin||(i[0]=rr(Math.floor(i[0]/a)*a,s)),t.fixMax||(i[1]=rr(Math.ceil(i[1]/a)*a,s)),this._innerSetExtent(i[0],i[1])},e.prototype.setNiceExtent=function(t,i){this._niceExtent=[t,i]},e.type="interval",e}(ir);ir.registerClass(da);var s5=function(n,e,t,i){for(;t<i;){var r=t+i>>>1;n[r][1]<e?t=r+1:i=r}return t},IS=function(n){W(e,n);function e(t){var i=n.call(this,t)||this;return i.type="time",i}return e.prototype.getLabel=function(t){var i=this.getSetting("useUTC");return ac(t.value,g1[fL(Ns(this._minLevelUnit))]||g1.second,i,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,i,r){var o=this.getSetting("useUTC"),a=this.getSetting("locale");return pL(t,i,r,a,o)},e.prototype.getTicks=function(t){var i=this._interval,r=this._extent,o=[];if(!i)return o;var a=this.getSetting("useUTC"),s=sc(r[1],a);o.push({value:r[0],time:{level:0,upperTimeUnit:s,lowerTimeUnit:s}});var l=g5(this._minLevelUnit,this._approxInterval,a,r,this._getExtentSpanWithBreaks(),this._brkCtx);o=o.concat(l);var u=sc(r[1],a);o.push({value:r[1],time:{level:0,upperTimeUnit:u,lowerTimeUnit:u}}),this.getSetting("useUTC");var c=Zr.length-1,h=0;return N(o,function(d){c=Math.min(c,be(Zr,d.time.upperTimeUnit)),h=Math.max(h,d.time.level)}),o},e.prototype.calcNiceExtent=function(t){var i=this.getExtent();if(i[0]===i[1]&&(i[0]-=sn,i[1]+=sn),i[1]===-1/0&&i[0]===1/0){var r=new Date;i[1]=+new Date(r.getFullYear(),r.getMonth(),r.getDate()),i[0]=i[1]-sn}this._innerSetExtent(i[0],i[1]),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval)},e.prototype.calcNiceTicks=function(t,i,r){t=t||10;var o=this._getExtentSpanWithBreaks();this._approxInterval=o/t,i!=null&&this._approxInterval<i&&(this._approxInterval=i),r!=null&&this._approxInterval>r&&(this._approxInterval=r);var a=Gc.length,s=Math.min(s5(Gc,this._approxInterval,0,a),a-1);this._interval=Gc[s][1],this._intervalPrecision=Qs(this._interval),this._minLevelUnit=Gc[Math.max(s-1,0)][0]},e.prototype.parse=function(t){return Ne(t)?t:+Ho(t)},e.prototype.contain=function(t){return Zg(t,this._extent)},e.prototype.normalize=function(t){return this._calculator.normalize(t,this._extent)},e.prototype.scale=function(t){return this._calculator.scale(t,this._extent)},e.type="time",e}(da),Gc=[["second",yp],["minute",vp],["hour",Es],["quarter-day",Es*6],["half-day",Es*12],["day",sn*1.2],["half-week",sn*3.5],["week",sn*7],["month",sn*31],["quarter",sn*95],["half-year",p1/2],["year",p1]];function l5(n,e,t,i){return _p(new Date(e),n,i).getTime()===_p(new Date(t),n,i).getTime()}function u5(n,e){return n/=sn,n>16?16:n>7.5?7:n>3.5?4:n>1.5?2:1}function c5(n){var e=30*sn;return n/=e,n>6?6:n>3?3:n>2?2:1}function h5(n){return n/=Es,n>12?12:n>6?6:n>3.5?4:n>2?2:1}function ES(n,e){return n/=e?vp:yp,n>30?30:n>20?20:n>15?15:n>10?10:n>5?5:n>2?2:1}function d5(n){return m_(n)}function f5(n,e,t){var i=Math.max(0,be(Zr,e)-1);return _p(new Date(n),Zr[i],t).getTime()}function p5(n,e){var t=new Date(0);t[n](1);var i=t.getTime();t[n](1+e);var r=t.getTime()-i;return function(o,a){return Math.max(0,Math.round((a-o)/r))}}function g5(n,e,t,i,r,o){var a=1e4,s=uL,l=0;function u(D,A,R,L,V,z,H){for(var F=p5(V,D),j=A,Y=new Date(j);j<R&&j<=i[1];){if(H.push({value:j}),l++>a){process.env.NODE_ENV!=="production"&&st("Exceed safe limit in time scale.");break}if(Y[V](Y[L]()+D),j=Y.getTime(),o){var ee=o.calcNiceTickMultiple(j,F);ee>0&&(Y[V](Y[L]()+ee*D),j=Y.getTime())}}H.push({value:j,notAdd:!0})}function c(D,A,R){var L=[],V=!A.length;if(!l5(Ns(D),i[0],i[1],t)){V&&(A=[{value:f5(i[0],D,t)},{value:i[1]}]);for(var z=0;z<A.length-1;z++){var H=A[z].value,F=A[z+1].value;if(H!==F){var j=void 0,Y=void 0,ee=void 0,pe=!1;switch(D){case"year":j=Math.max(1,Math.round(e/sn/365)),Y=m1(t),ee=gL(t);break;case"half-year":case"quarter":case"month":j=c5(e),Y=xp(t),ee=y1(t);break;case"week":case"half-week":case"day":j=u5(e),Y=bp(t),ee=v1(t),pe=!0;break;case"half-day":case"quarter-day":case"hour":j=h5(e),Y=wp(t),ee=_1(t);break;case"minute":j=ES(e,!0),Y=Sp(t),ee=x1(t);break;case"second":j=ES(e,!1),Y=Tp(t),ee=b1(t);break;case"millisecond":j=d5(e),Y=Mp(t),ee=w1(t);break}F>=i[0]&&H<=i[1]&&u(j,H,F,Y,ee,pe,L),D==="year"&&R.length>1&&z===0&&R.unshift({value:R[0].value-j})}}for(var z=0;z<L.length;z++)R.push(L[z])}}for(var h=[],d=[],f=0,p=0,g=0;g<s.length;++g){var m=Ns(s[g]);if(dL(s[g])){c(s[g],h[h.length-1]||[],d);var y=s[g+1]?Ns(s[g+1]):null;if(m!==y){if(d.length){p=f,d.sort(function(D,A){return D.value-A.value});for(var v=[],_=0;_<d.length;++_){var b=d[_].value;(_===0||d[_-1].value!==b)&&(v.push(d[_]),b>=i[0]&&b<=i[1]&&f++)}var T=r/e;if(f>T*1.5&&p>T/1.5||(h.push(v),f>T||n===s[g]))break}d=[]}}}for(var w=$e($(h,function(A){return $e(A,function(R){return R.value>=i[0]&&R.value<=i[1]&&!R.notAdd})}),function(A){return A.length>0}),S=[],M=w.length-1,g=0;g<w.length;++g)for(var C=w[g],I=0;I<C.length;++I){var E=sc(C[I].value,t);S.push({value:C[I].value,time:{level:M-g,upperTimeUnit:E,lowerTimeUnit:E}})}S.sort(function(D,A){return D.value-A.value});for(var k=[],g=0;g<S.length;++g)(g===0||S[g].value!==S[g-1].value)&&k.push(S[g]);return k}ir.registerClass(IS);var Kg=at,m5=Math.floor,y5=Math.ceil,Wc=Math.pow,Uc=Math.log,NS=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new da,t}return e.prototype.getTicks=function(t){t=t||{};var i=this._extent.slice(),r=this._originalScale.getExtent(),o=n.prototype.getTicks.call(this,t),a=this.base;return this._originalScale._innerGetBreaks(),$(o,function(s){var l=s.value,u=null,c=Wc(a,l);l===i[0]&&this._fixMin?u=r[0]:l===i[1]&&this._fixMax&&(u=r[1]);var h;return u!=null&&(c=Qg(c,u)),{value:c,break:h}},this)},e.prototype._getNonTransBreaks=function(){return this._originalScale._innerGetBreaks()},e.prototype.setExtent=function(t,i){this._originalScale.setExtent(t,i);var r=Xg(this.base,[t,i]);n.prototype.setExtent.call(this,r[0],r[1])},e.prototype.getExtent=function(){var t=this.base,i=n.prototype.getExtent.call(this);i[0]=Wc(t,i[0]),i[1]=Wc(t,i[1]);var r=this._originalScale.getExtent();return this._fixMin&&(i[0]=Qg(i[0],r[0])),this._fixMax&&(i[1]=Qg(i[1],r[1])),i},e.prototype.unionExtentFromData=function(t,i){this._originalScale.unionExtentFromData(t,i);var r=Xg(this.base,t.getApproximateExtent(i),!0);this._innerUnionExtent(r)},e.prototype.calcNiceTicks=function(t){t=t||10;var i=this._extent.slice(),r=this._getExtentSpanWithBreaks();if(!(!isFinite(r)||r<=0)){var o=xA(r),a=t/r*o;for(a<=.5&&(o*=10);!isNaN(o)&&Math.abs(o)<1&&Math.abs(o)>0;)o*=10;var s=[Kg(y5(i[0]/o)*o),Kg(m5(i[1]/o)*o)];this._interval=o,this._intervalPrecision=Qs(o),this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){n.prototype.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.contain=function(t){return t=Uc(t)/Uc(this.base),n.prototype.contain.call(this,t)},e.prototype.normalize=function(t){return t=Uc(t)/Uc(this.base),n.prototype.normalize.call(this,t)},e.prototype.scale=function(t){return t=n.prototype.scale.call(this,t),Wc(this.base,t)},e.prototype.setBreaksFromOption=function(t){},e.type="log",e}(da);function Qg(n,e){return Kg(n,Wn(e))}ir.registerClass(NS);var v5=function(){function n(e,t,i){this._prepareParams(e,t,i)}return n.prototype._prepareParams=function(e,t,i){i[1]<i[0]&&(i=[NaN,NaN]),this._dataMin=i[0],this._dataMax=i[1];var r=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&t.getNeedCrossZero&&t.getNeedCrossZero();var o=t.get("min",!0);o==null&&(o=t.get("startValue",!0));var a=this._modelMinRaw=o;ce(a)?this._modelMinNum=Yc(e,a({min:i[0],max:i[1]})):a!=="dataMin"&&(this._modelMinNum=Yc(e,a));var s=this._modelMaxRaw=t.get("max",!0);if(ce(s)?this._modelMaxNum=Yc(e,s({min:i[0],max:i[1]})):s!=="dataMax"&&(this._modelMaxNum=Yc(e,s)),r)this._axisDataLen=t.getCategories().length;else{var l=t.get("boundaryGap"),u=q(l)?l:[l||0,l||0];typeof u[0]=="boolean"||typeof u[1]=="boolean"?(process.env.NODE_ENV!=="production"&&console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'),this._boundaryGapInner=[0,0]):this._boundaryGapInner=[Oi(u[0],1),Oi(u[1],1)]}},n.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,i=this._dataMax,r=this._axisDataLen,o=this._boundaryGapInner,a=e?null:i-t||Math.abs(t),s=this._modelMinRaw==="dataMin"?t:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?i:this._modelMaxNum,u=s!=null,c=l!=null;s==null&&(s=e?r?0:NaN:t-o[0]*a),l==null&&(l=e?r?r-1:NaN:i+o[1]*a),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var h=To(s)||To(l)||e&&!r;this._needCrossZero&&(s>0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var d=this._determinedMin,f=this._determinedMax;return d!=null&&(s=d,u=!0),f!=null&&(l=f,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:h}},n.prototype.modifyDataMinMax=function(e,t){process.env.NODE_ENV!=="production"&&J(!this.frozen),this[x5[e]]=t},n.prototype.setDeterminedMinMax=function(e,t){var i=_5[e];process.env.NODE_ENV!=="production"&&J(!this.frozen&&this[i]==null),this[i]=t},n.prototype.freeze=function(){this.frozen=!0},n}(),_5={min:"_determinedMin",max:"_determinedMax"},x5={min:"_dataMin",max:"_dataMax"};function AS(n,e,t){var i=n.rawExtentInfo;return i||(i=new v5(n,e,t),n.rawExtentInfo=i,i)}function Yc(n,e){return e==null?null:To(e)?NaN:n.parse(e)}function OS(n,e){var t=n.type,i=AS(n,e,n.getExtent()).calculate();n.setBlank(i.isBlank);var r=i.min,o=i.max,a=e.ecModel;if(a&&t==="time"){var s=ub("bar",a),l=!1;if(N(s,function(h){l=l||h.getBaseAxis()===e.axis}),l){var u=cb(s),c=b5(r,o,e,u);r=c.min,o=c.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function b5(n,e,t,i){var r=t.axis.getExtent(),o=Math.abs(r[1]-r[0]),a=UP(i,t.axis);if(a===void 0)return{min:n,max:e};var s=1/0;N(a,function(f){s=Math.min(f.offset,s)});var l=-1/0;N(a,function(f){l=Math.max(f.offset+f.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=e-n,h=1-(s+l)/o,d=c/h-c;return e+=d*(l/u),n-=d*(s/u),{min:n,max:e}}function RS(n,e){var t=e,i=OS(n,t),r=i.extent,o=t.get("splitNumber");n instanceof NS&&(n.base=t.get("logBase"));var a=n.type,s=t.get("interval"),l=a==="interval"||a==="time";n.setBreaksFromOption(zS(t)),n.setExtent(r[0],r[1]),n.calcNiceExtent({splitNumber:o,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&n.setInterval&&n.setInterval(s)}function w5(n,e){if(e=e||n.get("type"),e)switch(e){case"category":return new DS({ordinalMeta:n.getOrdinalMeta?n.getOrdinalMeta():n.getCategories(),extent:[1/0,-1/0]});case"time":return new IS({locale:n.ecModel.getLocaleModel(),useUTC:n.ecModel.get("useUTC")});default:return new(ir.getClass(e)||da)}}function S5(n){var e=n.scale.getExtent(),t=e[0],i=e[1];return!(t>0&&i>0||t<0&&i<0)}function Js(n){var e=n.getLabelModel().get("formatter");if(n.type==="time"){var t=cL(e);return function(r,o){return n.scale.getFormattedLabel(r,o,t)}}else{if(Q(e))return function(r){var o=n.scale.getLabel(r),a=e.replace("{value}",o??"");return a};if(ce(e)){if(n.type==="category")return function(r,o){return e(qc(n,r),r.value-n.scale.getExtent()[0],null)};var i=mp();return function(r,o){var a=null;return i&&(a=i.makeAxisLabelFormatterParamBreak(a,r.break)),e(qc(n,r),o,a)}}else return function(r){return n.scale.getLabel(r)}}}function qc(n,e){return n.type==="category"?n.scale.getLabel(e):e.value}function Jg(n){var e=n.get("interval");return e??"auto"}function LS(n){return n.type==="category"&&Jg(n.getLabelModel())===0}function PS(n,e){var t={};return N(n.mapDimensionsAll(e),function(i){t[l1(n,i)]=!0}),Ce(t)}function T5(n,e,t){e&&N(PS(e,t),function(i){var r=e.getApproximateExtent(i);r[0]<n[0]&&(n[0]=r[0]),r[1]>n[1]&&(n[1]=r[1])})}function fa(n){return n==="middle"||n==="center"}function el(n){return n.getShallow("show")}function zS(n){var e=n.get("breaks",!0);if(e!=null){process.env.NODE_ENV!=="production"&&ze('Must `import {AxisBreak} from "echarts/features.js"; use(AxisBreak);` first if using breaks option.');return}}var M5=function(){function n(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return n.prototype.getAxis=function(e){return this._axes[e]},n.prototype.getAxes=function(){return $(this._dimList,function(e){return this._axes[e]},this)},n.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),$e(this.getAxes(),function(t){return t.scale.type===e})},n.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},n}(),em=["x","y"];function BS(n){return(n.type==="interval"||n.type==="time")&&!n.hasBreaks()}var C5=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=em,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!BS(t)||!BS(i))){var r=t.getExtent(),o=i.getExtent(),a=this.dataToPoint([r[0],o[0]]),s=this.dataToPoint([r[1],o[1]]),l=r[1]-r[0],u=o[1]-o[0];if(!(!l||!u)){var c=(s[0]-a[0])/l,h=(s[1]-a[1])/u,d=a[0]-r[0]*c,f=a[1]-o[0]*h,p=this._transform=[c,0,0,h,d,f];this._invTransform=ja([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var i=this.getAxis("x"),r=this.getAxis("y");return i.contain(i.toLocalCoord(t[0]))&&r.contain(r.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,i){var r=this.dataToPoint(t),o=this.dataToPoint(i),a=this.getArea(),s=new ve(r[0],r[1],o[0]-r[0],o[1]-r[1]);return a.intersect(s)},e.prototype.dataToPoint=function(t,i,r){r=r||[];var o=t[0],a=t[1];if(this._transform&&o!=null&&isFinite(o)&&a!=null&&isFinite(a))return Jt(r,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return r[0]=s.toGlobalCoord(s.dataToCoord(o,i)),r[1]=l.toGlobalCoord(l.dataToCoord(a,i)),r},e.prototype.clampData=function(t,i){var r=this.getAxis("x").scale,o=this.getAxis("y").scale,a=r.getExtent(),s=o.getExtent(),l=r.parse(t[0]),u=o.parse(t[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(a[0],a[1]),l),Math.max(a[0],a[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},e.prototype.pointToData=function(t,i,r){if(r=r||[],this._invTransform)return Jt(r,t,this._invTransform);var o=this.getAxis("x"),a=this.getAxis("y");return r[0]=o.coordToData(o.toLocalCoord(t[0]),i),r[1]=a.coordToData(a.toLocalCoord(t[1]),i),r},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var i=this.getAxis("x").getGlobalExtent(),r=this.getAxis("y").getGlobalExtent(),o=Math.min(i[0],i[1])-t,a=Math.min(r[0],r[1])-t,s=Math.max(i[0],i[1])-o+t,l=Math.max(r[0],r[1])-a+t;return new ve(o,a,s,l)},e}(M5),k5=Re(),tl=Re(),Dn={estimate:1,determine:2};function jc(n){return{out:{noPxChangeTryDetermine:[]},kind:n}}function VS(n,e){var t=$(e,function(i){return n.scale.parse(i)});return n.type==="time"&&t.length>0&&(t.sort(),t.unshift(t[0]),t.push(t[t.length-1])),t}function D5(n,e){var t=n.getLabelModel().get("customValues");if(t){var i=Js(n),r=n.scale.getExtent(),o=VS(n,t),a=$e(o,function(s){return s>=r[0]&&s<=r[1]});return{labels:$(a,function(s){var l={value:s};return{formattedLabel:i(l),rawLabel:n.scale.getLabel(l),tickValue:s,time:void 0,break:void 0}})}}return n.type==="category"?E5(n,e):A5(n)}function I5(n,e,t){var i=n.getTickModel().get("customValues");if(i){var r=n.scale.getExtent(),o=VS(n,i);return{ticks:$e(o,function(a){return a>=r[0]&&a<=r[1]})}}return n.type==="category"?N5(n,e):{ticks:$(n.scale.getTicks(t),function(a){return a.value})}}function E5(n,e){var t=n.getLabelModel(),i=HS(n,t,e);return!t.get("show")||n.scale.isBlank()?{labels:[]}:i}function HS(n,e,t){var i=R5(n),r=Jg(e),o=t.kind===Dn.estimate;if(!o){var a=GS(i,r);if(a)return a}var s,l;ce(r)?s=YS(n,r):(l=r==="auto"?L5(n,t):r,s=US(n,l));var u={labels:s,labelCategoryInterval:l};return o?t.out.noPxChangeTryDetermine.push(function(){return tm(i,r,u),!0}):tm(i,r,u),u}function N5(n,e){var t=O5(n),i=Jg(e),r=GS(t,i);if(r)return r;var o,a;if((!e.get("show")||n.scale.isBlank())&&(o=[]),ce(i))o=YS(n,i,!0);else if(i==="auto"){var s=HS(n,n.getLabelModel(),jc(Dn.determine));a=s.labelCategoryInterval,o=$(s.labels,function(l){return l.tickValue})}else a=i,o=US(n,a,!0);return tm(t,i,{ticks:o,tickCategoryInterval:a})}function A5(n){var e=n.scale.getTicks(),t=Js(n);return{labels:$(e,function(i,r){return{formattedLabel:t(i,r),rawLabel:n.scale.getLabel(i),tickValue:i.value,time:i.time,break:i.break}})}}var O5=FS("axisTick"),R5=FS("axisLabel");function FS(n){return function(e){return tl(e)[n]||(tl(e)[n]={list:[]})}}function GS(n,e){for(var t=0;t<n.list.length;t++)if(n.list[t].key===e)return n.list[t].value}function tm(n,e,t){return n.list.push({key:e,value:t}),t}function L5(n,e){if(e.kind===Dn.estimate){var t=n.calculateCategoryInterval(e);return e.out.noPxChangeTryDetermine.push(function(){return tl(n).autoInterval=t,!0}),t}var i=tl(n).autoInterval;return i??(tl(n).autoInterval=n.calculateCategoryInterval(e))}function P5(n,e){var t=e.kind,i=B5(n),r=Js(n),o=(i.axisRotate-i.labelRotate)/180*Math.PI,a=n.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1,c=40;l>c&&(u=Math.max(1,Math.floor(l/c)));for(var h=s[0],d=n.dataToCoord(h+1)-n.dataToCoord(h),f=Math.abs(d*Math.cos(o)),p=Math.abs(d*Math.sin(o)),g=0,m=0;h<=s[1];h+=u){var y=0,v=0,_=_d(r({value:h}),i.font,"center","top");y=_.width*1.3,v=_.height*1.3,g=Math.max(g,y,7),m=Math.max(m,v,7)}var b=g/f,T=m/p;isNaN(b)&&(b=1/0),isNaN(T)&&(T=1/0);var w=Math.max(0,Math.floor(Math.min(b,T)));if(t===Dn.estimate)return e.out.noPxChangeTryDetermine.push(ke(z5,null,n,w,l)),w;var S=WS(n,w,l);return S??w}function z5(n,e,t){return WS(n,e,t)==null}function WS(n,e,t){var i=k5(n.model),r=n.getExtent(),o=i.lastAutoInterval,a=i.lastTickCount;if(o!=null&&a!=null&&Math.abs(o-e)<=1&&Math.abs(a-t)<=1&&o>e&&i.axisExtent0===r[0]&&i.axisExtent1===r[1])return o;i.lastTickCount=t,i.lastAutoInterval=e,i.axisExtent0=r[0],i.axisExtent1=r[1]}function B5(n){var e=n.getLabelModel();return{axisRotate:n.getRotate?n.getRotate():n.isHorizontal&&!n.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function US(n,e,t){var i=Js(n),r=n.scale,o=r.getExtent(),a=n.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=o[0],c=r.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=LS(n),d=a.get("showMinLabel")||h,f=a.get("showMaxLabel")||h;d&&u!==o[0]&&g(o[0]);for(var p=u;p<=o[1];p+=l)g(p);f&&p-l!==o[1]&&g(o[1]);function g(m){var y={value:m};s.push(t?m:{formattedLabel:i(y),rawLabel:r.getLabel(y),tickValue:m,time:void 0,break:void 0})}return s}function YS(n,e,t){var i=n.scale,r=Js(n),o=[];return N(i.getTicks(),function(a){var s=i.getLabel(a),l=a.value;e(a.value,s)&&o.push(t?l:{formattedLabel:r(a),rawLabel:s,tickValue:l,time:void 0,break:void 0})}),o}var qS=[0,1],V5=function(){function n(e,t,i){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=i||[0,0]}return n.prototype.contain=function(e){var t=this._extent,i=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=i&&e<=r},n.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.getPixelPrecision=function(e){return p_(e||this.scale.getExtent(),this._extent)},n.prototype.setExtent=function(e,t){var i=this._extent;i[0]=e,i[1]=t},n.prototype.dataToCoord=function(e,t){var i=this._extent,r=this.scale;return e=r.normalize(r.parse(e)),this.onBand&&r.type==="ordinal"&&(i=i.slice(),jS(i,r.count())),jt(e,qS,i,t)},n.prototype.coordToData=function(e,t){var i=this._extent,r=this.scale;this.onBand&&r.type==="ordinal"&&(i=i.slice(),jS(i,r.count()));var o=jt(e,i,qS,t);return this.scale.scale(o)},n.prototype.pointToData=function(e,t){},n.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),i=I5(this,t,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}),r=i.ticks,o=$(r,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),a=t.get("alignWithLabel");return H5(this,o,a,e.clamp),o},n.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var i=this.scale.getMinorTicks(t),r=$(i,function(o){return $(o,function(a){return{coord:this.dataToCoord(a),tickValue:a}},this)},this);return r},n.prototype.getViewLabels=function(e){return e=e||jc(Dn.determine),D5(this,e).labels},n.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},n.prototype.getTickModel=function(){return this.model.getModel("axisTick")},n.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);i===0&&(i=1);var r=Math.abs(e[1]-e[0]);return Math.abs(r)/i},n.prototype.calculateCategoryInterval=function(e){return e=e||jc(Dn.determine),P5(this,e)},n}();function jS(n,e){var t=n[1]-n[0],i=e,r=t/i/2;n[0]+=r,n[1]-=r}function H5(n,e,t,i){var r=e.length;if(!n.onBand||t||!r)return;var o=n.getExtent(),a,s;if(r===1)e[0].coord=o[0],e[0].onBand=!0,a=e[1]={coord:o[1],tickValue:e[0].tickValue,onBand:!0};else{var l=e[r-1].tickValue-e[0].tickValue,u=(e[r-1].coord-e[0].coord)/l;N(e,function(f){f.coord-=u/2,f.onBand=!0});var c=n.scale.getExtent();s=1+c[1]-e[r-1].tickValue,a={coord:e[r-1].coord+u*s,tickValue:c[1]+1,onBand:!0},e.push(a)}var h=o[0]>o[1];d(e[0].coord,o[0])&&(i?e[0].coord=o[0]:e.shift()),i&&d(o[0],e[0].coord)&&e.unshift({coord:o[0],onBand:!0}),d(o[1],a.coord)&&(i?a.coord=o[1]:e.pop()),i&&d(a.coord,o[1])&&e.push({coord:o[1],onBand:!0});function d(f,p){return f=at(f),p=at(p),h?f>p:f<p}}var F5=function(n){W(e,n);function e(t,i,r,o,a){var s=n.call(this,t,i,r)||this;return s.index=0,s.type=o||"value",s.position=a||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),t&&i[0]>i[1]&&i.reverse(),i},e.prototype.pointToData=function(t,i){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),i)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(V5),G5="expandAxisBreak",or=Math.PI,W5=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],U5=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],nl=Re(),$S=Re(),ZS=function(){function n(e){this.recordMap={},this.resolveAxisNameOverlap=e}return n.prototype.ensureRecord=function(e){var t=e.axis.dim,i=e.componentIndex,r=this.recordMap,o=r[t]||(r[t]=[]);return o[i]||(o[i]={ready:{}})},n}();function Y5(n,e,t,i){var r=t.axis,o=e.ensureRecord(t),a=[],s,l=im(n.axisName)&&fa(n.nameLocation);N(i,function(p){var g=nr(p);if(!(!g||g.label.ignore)){a.push(g);var m=o.transGroup;l&&(m.transform?ja(il,m.transform):fd(il),g.transform&&qa(il,il,g.transform),ve.copy($c,g.localRect),$c.applyTransform(il),s?s.union($c):ve.copy(s=new ve(0,0,0,0),$c))}});var u=Math.abs(o.dirVec.x)>.1?"x":"y",c=o.transGroup[u];if(a.sort(function(p,g){return Math.abs(p.label[u]-c)-Math.abs(g.label[u]-c)}),l&&s){var h=r.getExtent(),d=Math.min(h[0],h[1]),f=Math.max(h[0],h[1])-d;s.union(new ve(d,0,f,1))}o.stOccupiedRect=s,o.labelInfoList=a}var il=li(),$c=new ve(0,0,0,0),XS=function(n,e,t,i,r,o){if(fa(n.nameLocation)){var a=o.stOccupiedRect;a&&KS(_z({},a,o.transGroup.transform),i,r)}else QS(o.labelInfoList,o.dirVec,i,r)};function KS(n,e,t){var i=new ye;Qp(n,e,i,{direction:Math.atan2(t.y,t.x),bidirectional:!1,touchThreshold:.05})&&xz(e,i)}function QS(n,e,t,i){for(var r=ye.dot(i,e)>=0,o=0,a=n.length;o<a;o++){var s=n[r?o:a-1-o];s.label.ignore||KS(s,t,i)}}var ar=function(){function n(e,t,i,r){this.group=new Ye,this._axisModel=e,this._api=t,this._local={},this._shared=r||new ZS(XS),this._resetCfgDetermined(i)}return n.prototype.updateCfg=function(e){if(process.env.NODE_ENV!=="production"){var t=this._shared.ensureRecord(this._axisModel).ready;J(!t.axisLine&&!t.axisTickLabelDetermine),t.axisName=t.axisTickLabelEstimate=!1}var i=this._cfg.raw;i.position=e.position,i.labelOffset=e.labelOffset,this._resetCfgDetermined(i)},n.prototype.__getRawCfg=function(){return this._cfg.raw},n.prototype._resetCfgDetermined=function(e){var t=this._axisModel,i=t.getDefaultOption?t.getDefaultOption():{},r=te(e.axisName,t.get("name")),o=t.get("nameMoveOverlap");(o==null||o==="auto")&&(o=te(e.defaultNameMoveOverlap,!0));var a={raw:e,position:e.position,rotation:e.rotation,nameDirection:te(e.nameDirection,1),tickDirection:te(e.tickDirection,1),labelDirection:te(e.labelDirection,1),labelOffset:te(e.labelOffset,0),silent:te(e.silent,!0),axisName:r,nameLocation:si(t.get("nameLocation"),i.nameLocation,"end"),shouldNameMoveOverlap:im(r)&&o,optionHideOverlap:t.get(["axisLabel","hideOverlap"]),showMinorTicks:t.get(["minorTick","show"])};process.env.NODE_ENV!=="production"&&(J(a.position!=null),J(a.rotation!=null)),this._cfg=a;var s=new Ye({x:a.position[0],y:a.position[1],rotation:a.rotation});s.updateTransform(),this._transformGroup=s;var l=this._shared.ensureRecord(t);l.transGroup=this._transformGroup,l.dirVec=new ye(Math.cos(-a.rotation),Math.sin(-a.rotation))},n.prototype.build=function(e,t){var i=this;return e||(e={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0}),N(q5,function(r){e[r]&&j5[r](i._cfg,i._local,i._shared,i._axisModel,i.group,i._transformGroup,i._api,t||{})}),this},n.innerTextLayout=function(e,t,i){var r=g_(t-e),o,a;return xu(r)?(a=i>0?"top":"bottom",o="center"):xu(r-or)?(a=i>0?"bottom":"top",o="center"):(a="middle",r>0&&r<or?o=i>0?"right":"left":o=i>0?"left":"right"),{rotation:r,textAlign:o,textVerticalAlign:a}},n.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},n.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},n}(),q5=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],j5={axisLine:function(n,e,t,i,r,o,a){if(process.env.NODE_ENV!=="production"){var s=t.ensureRecord(i).ready;J(!s.axisLine),s.axisLine=!0}var l=i.get(["axisLine","show"]);if(l==="auto"&&(l=!0,n.raw.axisLineAutoShow!=null&&(l=!!n.raw.axisLineAutoShow)),!!l){var u=i.axis.getExtent(),c=o.transform,h=[u[0],0],d=[u[1],0],f=h[0]>d[0];c&&(Jt(h,h,c),Jt(d,d,c));var p=U({lineCap:"round"},i.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:n.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(i.get(["axisLine","breakLine"])&&i.axis.scale.hasBreaks())n5().buildAxisBreakLine(i,r,o,g);else{var m=new gi(U({shape:{x1:h[0],y1:h[1],x2:d[0],y2:d[1]}},g));_s(m.shape,m.style.lineWidth),m.anid="line",r.add(m)}var y=i.get(["axisLine","symbol"]);if(y!=null){var v=i.get(["axisLine","symbolSize"]);Q(y)&&(y=[y,y]),(Q(v)||Ne(v))&&(v=[v,v]);var _=dc(i.get(["axisLine","symbolOffset"])||0,v),b=v[0],T=v[1];N([{rotate:n.rotation+Math.PI/2,offset:_[0],r:0},{rotate:n.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((h[0]-d[0])*(h[0]-d[0])+(h[1]-d[1])*(h[1]-d[1]))}],function(w,S){if(y[S]!=="none"&&y[S]!=null){var M=Jr(y[S],-b/2,-T/2,b,T,p.stroke,!0),C=w.r+w.offset,I=f?d:h;M.attr({rotation:w.rotate,x:I[0]+C*Math.cos(n.rotation),y:I[1]-C*Math.sin(n.rotation),silent:!0,z2:11}),r.add(M)}})}}},axisTickLabelEstimate:function(n,e,t,i,r,o,a,s){if(process.env.NODE_ENV!=="production"){var l=t.ensureRecord(i).ready;J(!l.axisTickLabelDetermine),l.axisTickLabelEstimate=!0}var u=tT(e,r,s);u&&JS(n,e,t,i,r,o,a,Dn.estimate)},axisTickLabelDetermine:function(n,e,t,i,r,o,a,s){if(process.env.NODE_ENV!=="production"){var l=t.ensureRecord(i).ready;l.axisTickLabelDetermine=!0}var u=tT(e,r,s);u&&JS(n,e,t,i,r,o,a,Dn.determine);var c=K5(n,r,o,i);X5(n,e.labelLayoutList,c),Q5(n,r,o,i,n.tickDirection)},axisName:function(n,e,t,i,r,o,a,s){var l=t.ensureRecord(i);if(process.env.NODE_ENV!=="production"){var u=l.ready;J(u.axisTickLabelEstimate||u.axisTickLabelDetermine),u.axisName=!0}e.nameEl&&(r.remove(e.nameEl),e.nameEl=l.nameLayout=l.nameLocation=null);var c=n.axisName;if(im(c)){var h=n.nameLocation,d=n.nameDirection,f=i.getModel("nameTextStyle"),p=i.get("nameGap")||0,g=i.axis.getExtent(),m=i.axis.inverse?-1:1,y=new ye(0,0),v=new ye(0,0);h==="start"?(y.x=g[0]-m*p,v.x=-m):h==="end"?(y.x=g[1]+m*p,v.x=m):(y.x=(g[0]+g[1])/2,y.y=n.labelOffset+d*p,v.y=d);var _=li();v.transform(gd(_,_,n.rotation));var b=i.get("nameRotate");b!=null&&(b=b*or/180);var T,w;fa(h)?T=ar.innerTextLayout(n.rotation,b??n.rotation,d):(T=$5(n.rotation,h,b||0,g),w=n.raw.axisNameAvailableWidth,w!=null&&(w=Math.abs(w/Math.sin(T.rotation)),!isFinite(w)&&(w=null)));var S=f.getFont(),M=i.get("nameTruncate",!0)||{},C=M.ellipsis,I=vn(n.raw.nameTruncateMaxWidth,M.maxWidth,w),E=s.nameMarginLevel||0,k=new it({x:y.x,y:y.y,rotation:T.rotation,silent:ar.isLabelSilent(i),style:Yi(f,{text:c,font:S,overflow:"truncate",width:I,ellipsis:C,fill:f.getTextColor()||i.get(["axisLine","lineStyle","color"]),align:f.get("align")||T.textAlign,verticalAlign:f.get("verticalAlign")||T.textVerticalAlign}),z2:1});if(bs({el:k,componentModel:i,itemName:c}),k.__fullText=c,k.anid="name",i.get("triggerEvent")){var D=ar.makeAxisEventDataBase(i);D.targetType="axisName",D.name=c,Se(k).eventData=D}o.add(k),k.updateTransform(),e.nameEl=k;var A=l.nameLayout=nr({label:k,priority:k.z2,defaultAttr:{ignore:k.ignore},marginDefault:fa(h)?W5[E]:U5[E]});if(l.nameLocation=h,r.add(k),k.decomposeTransform(),n.shouldNameMoveOverlap&&A){var R=t.ensureRecord(i);process.env.NODE_ENV!=="production"&&J(R.labelInfoList),t.resolveAxisNameOverlap(n,t,i,A,v,R)}}}};function JS(n,e,t,i,r,o,a,s){nT(e)||J5(n,e,r,s,i,a);var l=e.labelLayoutList;eH(n,i,l,o),n.rotation;var u=n.optionHideOverlap;Z5(i,l,u),u&&wz($e(l,function(c){return c&&!c.label.ignore})),Y5(n,t,i,l)}function $5(n,e,t,i){var r=g_(t-n),o,a,s=i[0]>i[1],l=e==="start"&&!s||e!=="start"&&s;return xu(r-or/2)?(a=l?"bottom":"top",o="center"):xu(r-or*1.5)?(a=l?"top":"bottom",o="center"):(a="middle",r<or*1.5&&r>or/2?o=l?"left":"right":o=l?"right":"left"),{rotation:r,textAlign:o,textVerticalAlign:a}}function Z5(n,e,t){if(LS(n.axis))return;function i(s,l,u){var c=nr(e[l]),h=nr(e[u]);if(!(!c||!h)){if(s===!1||c.suggestIgnore){Zc(c.label);return}if(h.suggestIgnore){Zc(h.label);return}var d=.1;if(!t){var f=[0,0,0,0];c=Rb({marginForce:f},c),h=Rb({marginForce:f},h)}Qp(c,h,null,{touchThreshold:d})&&Zc(s?h.label:c.label)}}var r=n.get(["axisLabel","showMinLabel"]),o=n.get(["axisLabel","showMaxLabel"]),a=e.length;i(r,0,1),i(o,a-1,a-2)}function X5(n,e,t){n.showMinorTicks||N(e,function(i){if(i&&i.label.ignore)for(var r=0;r<t.length;r++){var o=t[r],a=$S(o),s=nl(i.label);if(a.tickValue!=null&&!a.onBand&&a.tickValue===s.tickValue){Zc(o);return}}})}function Zc(n){n&&(n.ignore=!0)}function eT(n,e,t,i,r){for(var o=[],a=[],s=[],l=0;l<n.length;l++){var u=n[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=t,e&&(Jt(a,a,e),Jt(s,s,e));var c=new gi({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});_s(c.shape,c.style.lineWidth),c.anid=r+"_"+n[l].tickValue,o.push(c);var h=$S(c);h.onBand=!!n[l].onBand,h.tickValue=n[l].tickValue}return o}function K5(n,e,t,i){var r=i.axis,o=i.getModel("axisTick"),a=o.get("show");if(a==="auto"&&(a=!0,n.raw.axisTickAutoShow!=null&&(a=!!n.raw.axisTickAutoShow)),!a||r.scale.isBlank())return[];for(var s=o.getModel("lineStyle"),l=n.tickDirection*o.get("length"),u=r.getTicksCoords(),c=eT(u,t.transform,l,Me(s.getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;h<c.length;h++)e.add(c[h]);return c}function Q5(n,e,t,i,r){var o=i.axis,a=i.getModel("minorTick");if(!(!n.showMinorTicks||o.scale.isBlank())){var s=o.getMinorTicksCoords();if(s.length)for(var l=a.getModel("lineStyle"),u=r*a.get("length"),c=Me(l.getLineStyle(),Me(i.getModel("axisTick").getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])})),h=0;h<s.length;h++)for(var d=eT(s[h],t.transform,u,c,"minorticks_"+h),f=0;f<d.length;f++)e.add(d[f])}}function tT(n,e,t){if(nT(n)){var i=n.axisLabelsCreationContext;process.env.NODE_ENV!=="production"&&J(n.labelGroup&&i);var r=i.out.noPxChangeTryDetermine;if(t.noPxChange){for(var o=!0,a=0;a<r.length;a++)o=o&&r[a]();if(o)return!1}r.length&&(e.remove(n.labelGroup),nm(n,null,null,null))}return!0}function J5(n,e,t,i,r,o){var a=r.axis,s=vn(n.raw.axisLabelShow,r.get(["axisLabel","show"])),l=new Ye;t.add(l);var u=jc(i);if(!s||a.scale.isBlank()){nm(e,[],l,u);return}var c=r.getModel("axisLabel"),h=a.getViewLabels(u),d=(vn(n.raw.labelRotate,c.get("rotate"))||0)*or/180,f=ar.innerTextLayout(n.rotation,d,n.labelDirection),p=r.getCategories&&r.getCategories(!0),g=[],m=r.get("triggerEvent"),y=1/0,v=-1/0;N(h,function(b,T){var w,S=a.scale.type==="ordinal"?a.scale.getRawOrdinalNumber(b.tickValue):b.tickValue,M=b.formattedLabel,C=b.rawLabel,I=c;if(p&&p[S]){var E=p[S];ne(E)&&E.textStyle&&(I=new Ge(E.textStyle,c,r.ecModel))}var k=I.getTextColor()||r.get(["axisLine","lineStyle","color"]),D=I.getShallow("align",!0)||f.textAlign,A=te(I.getShallow("alignMinLabel",!0),D),R=te(I.getShallow("alignMaxLabel",!0),D),L=I.getShallow("verticalAlign",!0)||I.getShallow("baseline",!0)||f.textVerticalAlign,V=te(I.getShallow("verticalAlignMinLabel",!0),L),z=te(I.getShallow("verticalAlignMaxLabel",!0),L),H=10+(((w=b.time)===null||w===void 0?void 0:w.level)||0);y=Math.min(y,H),v=Math.max(v,H);var F=new it({x:0,y:0,rotation:0,silent:ar.isLabelSilent(r),z2:H,style:Yi(I,{text:M,align:T===0?A:T===h.length-1?R:D,verticalAlign:T===0?V:T===h.length-1?z:L,fill:ce(k)?k(a.type==="category"?C:a.type==="value"?S+"":S,T):k})});F.anid="label_"+S;var j=nl(F);if(j.break=b.break,j.tickValue=S,j.layoutRotation=f.rotation,bs({el:F,componentModel:r,itemName:M,formatterParamsExtra:{isTruncated:function(){return F.isTruncated},value:C,tickIndex:T}}),m){var Y=ar.makeAxisEventDataBase(r);Y.targetType="axisLabel",Y.value=C,Y.tickIndex=T,b.break&&(Y.break={start:b.break.parsedBreak.vmin,end:b.break.parsedBreak.vmax}),a.type==="category"&&(Y.dataIndex=S),Se(F).eventData=Y,b.break&&nH(r,o,F,b.break)}g.push(F),l.add(F)});var _=$(g,function(b){return{label:b,priority:nl(b).break?b.z2+(v-y+1):b.z2,defaultAttr:{ignore:b.ignore}}});nm(e,_,l,u)}function nT(n){return!!n.labelLayoutList}function nm(n,e,t,i){n.labelLayoutList=e,n.labelGroup=t,n.axisLabelsCreationContext=i}function eH(n,e,t,i){var r=e.get(["axisLabel","margin"]);N(t,function(o,a){var s=nr(o);if(s){var l=s.label,u=nl(l);s.suggestIgnore=l.ignore,l.ignore=!1,jl(wi,tH),wi.x=e.axis.dataToCoord(u.tickValue),wi.y=n.labelOffset+n.labelDirection*r,wi.rotation=u.layoutRotation,i.add(wi),wi.updateTransform(),i.remove(wi),wi.decomposeTransform(),jl(l,wi),l.markRedraw(),bc(s,!0),nr(s)}})}var wi=new Ue,tH=new Ue;function im(n){return!!n}function nH(n,e,t,i){t.on("click",function(r){var o={type:G5,breaks:[{start:i.parsedBreak.breakOption.start,end:i.parsedBreak.breakOption.end}]};o[n.axis.dim+"AxisIndex"]=n.componentIndex,e.dispatchAction(o)})}function Xc(n,e,t){t=t||{};var i=e.axis,r={},o=i.getAxesOnZeroOf()[0],a=i.position,s=o?"onZero":a,l=i.dim,u=[n.x,n.x+n.width,n.y,n.y+n.height],c={left:0,right:1,top:0,bottom:1,onZero:2},h=e.get("offset")||0,d=l==="x"?[u[2]-h,u[3]+h]:[u[0]-h,u[1]+h];if(o){var f=o.toGlobalCoord(o.dataToCoord(0));d[c.onZero]=Math.max(Math.min(f,d[1]),d[0])}r.position=[l==="y"?d[c[s]]:u[0],l==="x"?d[c[s]]:u[3]],r.rotation=Math.PI/2*(l==="x"?0:1);var p={top:-1,bottom:1,left:-1,right:1};r.labelDirection=r.tickDirection=r.nameDirection=p[a],r.labelOffset=o?d[c[a]]-d[c.onZero]:0,e.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),vn(t.labelInside,e.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var g=e.get(["axisLabel","rotate"]);return r.labelRotate=s==="top"?-g:g,r.z2=1,r}function iH(n){return n.coordinateSystem&&n.coordinateSystem.type==="cartesian2d"}function iT(n){var e={xAxisModel:null,yAxisModel:null};return N(e,function(t,i){var r=i.replace(/Model$/,""),o=n.getReferringComponents(r,xt).models[0];if(process.env.NODE_ENV!=="production"&&!o)throw new Error(r+' "'+si(n.get(r+"Index"),n.get(r+"Id"),0)+'" not found');e[i]=o}),e}function rH(n,e,t,i,r,o){for(var a=Xc(n,t),s=!1,l=!1,u=0;u<e.length;u++)jg(e[u].getOtherAxis(t.axis).scale)&&(s=l=!0,t.axis.type==="category"&&t.axis.onBand&&(l=!1));return a.axisLineAutoShow=s,a.axisTickAutoShow=l,a.defaultNameMoveOverlap=o,new ar(t,i,a,r)}function oH(n,e,t){var i=Xc(e,t);if(process.env.NODE_ENV!=="production"){var r=n.__getRawCfg();N(Ce(i),function(o){o!=="position"&&o!=="labelOffset"&&J(i[o]===r[o])})}n.updateCfg(i)}function aH(n,e,t){var i,r=da.prototype,o=r.getTicks.call(t),a=r.getTicks.call(t,{expandToNicedExtent:!0}),s=o.length-1,l=r.getInterval.call(t),u=OS(n,e),c=u.extent,h=u.fixMin,d=u.fixMax;n.type==="log"&&(c=Xg(n.base,c,!0)),n.setBreaksFromOption(zS(e)),n.setExtent(c[0],c[1]),n.calcNiceExtent({splitNumber:s,fixMin:h,fixMax:d});var f=r.getExtent.call(n);h&&(c[0]=f[0]),d&&(c[1]=f[1]);var p=r.getInterval.call(n),g=c[0],m=c[1];if(h&&d)p=(m-g)/s;else if(h)for(m=c[0]+p*s;m<c[1]&&isFinite(m)&&isFinite(c[1]);)p=$g(p),m=c[0]+p*s;else if(d)for(g=c[1]-p*s;g>c[0]&&isFinite(g)&&isFinite(c[0]);)p=$g(p),g=c[1]-p*s;else{var y=n.getTicks().length-1;y>s&&(p=$g(p));var v=p*s;m=Math.ceil(c[1]/p)*p,g=at(m-v),g<0&&c[0]>=0?(g=0,m=at(v)):m>0&&c[1]<=0&&(m=0,g=-at(v))}var _=(o[0].value-a[0].value)/l,b=(o[s].value-a[s].value)/l;if(r.setExtent.call(n,g+p*_,m+p*b),r.setInterval.call(n,p),(_||b)&&r.setNiceExtent.call(n,g+p,m-p),process.env.NODE_ENV!=="production"){var T=r.getTicks.call(n);T[1]&&(!i5(p)||gf(T[1].value)>gf(p))&&st("The ticks may be not readable when set min: "+e.get("min")+", max: "+e.get("max")+(" and alignTicks: true. ("+((i=e.axis)===null||i===void 0?void 0:i.dim)+"AxisIndex: "+e.componentIndex+")"),!0)}}var rT=[[3,1],[0,2]],sH=function(){function n(e,t,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=em,this._initCartesian(e,t,i),this.model=e}return n.prototype.getRect=function(){return this._rect},n.prototype.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model);function r(a){var s,l=Ce(a),u=l.length;if(u){for(var c=[],h=u-1;h>=0;h--){var d=+l[h],f=a[d],p=f.model,g=f.scale;jg(g)&&p.get("alignTicks")&&p.get("interval")==null?c.push(f):(RS(g,p),jg(g)&&(s=f))}c.length&&(s||(s=c.pop(),RS(s.scale,s.model)),N(c,function(m){aH(m.scale,m.model,s.scale)}))}}r(i.x),r(i.y);var o={};N(i.x,function(a){oT(i,"y",a,o)}),N(i.y,function(a){oT(i,"x",a,o)}),this.resize(this.model,t)},n.prototype.resize=function(e,t,i){var r=Os(e,t),o=this._rect=jn(e.getBoxLayoutParams(),r.refContainer),a=this._axesMap,s=this._coordsList,l=e.get("containLabel");if(sT(a,o),!i){var u=uH(o,s,a,l,t),c=void 0;if(l)process.env.NODE_ENV!=="production"&&w_("Specified `grid.containLabel` but no `use(LegacyGridContainLabel)`;use `grid.outerBounds` instead.",!0),c=uT(o.clone(),"axisLabel",null,o,a,u,r);else{var h=cH(e,o,r),d=h.outerBoundsRect,f=h.parsedOuterBoundsContain,p=h.outerBoundsClamp;d&&(c=uT(d,f,p,o,a,u,r))}cT(o,a,Dn.determine,null,c,r)}N(this._coordsList,function(g){g.calcAffineTransform()})},n.prototype.getAxis=function(e,t){var i=this._axesMap[e];if(i!=null)return i[t||0]},n.prototype.getAxes=function(){return this._axesList.slice()},n.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var i="x"+e+"y"+t;return this._coordsMap[i]}ne(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,o=this._coordsList;r<o.length;r++)if(o[r].getAxis("x").index===e||o[r].getAxis("y").index===t)return o[r]},n.prototype.getCartesians=function(){return this._coordsList.slice()},n.prototype.convertToPixel=function(e,t,i){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.dataToPoint(i):r.axis?r.axis.toGlobalCoord(r.axis.dataToCoord(i)):null},n.prototype.convertFromPixel=function(e,t,i){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.pointToData(i):r.axis?r.axis.coordToData(r.axis.toLocalCoord(i)):null},n.prototype._findConvertTarget=function(e){var t=e.seriesModel,i=e.xAxisModel||t&&t.getReferringComponents("xAxis",xt).models[0],r=e.yAxisModel||t&&t.getReferringComponents("yAxis",xt).models[0],o=e.gridModel,a=this._coordsList,s,l;if(t)s=t.coordinateSystem,be(a,s)<0&&(s=null);else if(i&&r)s=this.getCartesian(i.componentIndex,r.componentIndex);else if(i)l=this.getAxis("x",i.componentIndex);else if(r)l=this.getAxis("y",r.componentIndex);else if(o){var u=o.coordinateSystem;u===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},n.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},n.prototype._initCartesian=function(e,t,i){var r=this,o=this,a={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(t.eachComponent("xAxis",u("x"),this),t.eachComponent("yAxis",u("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,N(s.x,function(c,h){N(s.y,function(d,f){var p="x"+h+"y"+f,g=new C5(p);g.master=r,g.model=e,r._coordsMap[p]=g,r._coordsList.push(g),g.addAxis(c),g.addAxis(d)})});function u(c){return function(h,d){if(rm(h,e)){var f=h.get("position");c==="x"?f!=="top"&&f!=="bottom"&&(f=a.bottom?"top":"bottom"):f!=="left"&&f!=="right"&&(f=a.left?"right":"left"),a[f]=!0;var p=new F5(c,w5(h),[0,0],h.get("type"),f),g=p.type==="category";p.onBand=g&&h.get("boundaryGap"),p.inverse=h.get("inverse"),h.axis=p,p.model=h,p.grid=o,p.index=d,o._axesList.push(p),s[c][d]=p,l[c]++}}}},n.prototype._updateScale=function(e,t){N(this._axesList,function(r){if(r.scale.setExtent(1/0,-1/0),r.type==="category"){var o=r.model.get("categorySortInfo");r.scale.setSortInfo(o)}}),e.eachSeries(function(r){if(iH(r)){var o=iT(r),a=o.xAxisModel,s=o.yAxisModel;if(!rm(a,t)||!rm(s,t))return;var l=this.getCartesian(a.componentIndex,s.componentIndex),u=r.getData(),c=l.getAxis("x"),h=l.getAxis("y");i(u,c),i(u,h)}},this);function i(r,o){N(PS(r,o.dim),function(a){o.scale.unionExtentFromData(r,a)})}},n.prototype.getTooltipAxes=function(e){var t=[],i=[];return N(this.getCartesians(),function(r){var o=e!=null&&e!=="auto"?r.getAxis(e):r.getBaseAxis(),a=r.getOtherAxis(o);be(t,o)<0&&t.push(o),be(i,a)<0&&i.push(a)}),{baseAxes:t,otherAxes:i}},n.create=function(e,t){var i=[];return e.eachComponent("grid",function(r,o){var a=new n(r,e,t);a.name="grid_"+o,a.resize(r,t,!0),r.coordinateSystem=a,i.push(a)}),e.eachSeries(function(r){LR({targetModel:r,coordSysType:"cartesian2d",coordSysProvider:o});function o(){var a=iT(r),s=a.xAxisModel,l=a.yAxisModel,u=s.getCoordSysModel();if(process.env.NODE_ENV!=="production"){if(!u)throw new Error('Grid "'+si(s.get("gridIndex"),s.get("gridId"),0)+'" not found');if(s.getCoordSysModel()!==l.getCoordSysModel())throw new Error("xAxis and yAxis must use the same grid")}var c=u.coordinateSystem;return c.getCartesian(s.componentIndex,l.componentIndex)}}),i},n.dimensions=em,n}();function rm(n,e){return n.getCoordSysModel()===e}function oT(n,e,t,i){t.getAxesOnZeroOf=function(){return o?[o]:[]};var r=n[e],o,a=t.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)aT(r[l])&&(o=r[l]);else for(var u in r)if(r.hasOwnProperty(u)&&aT(r[u])&&!i[c(r[u])]){o=r[u];break}o&&(i[c(o)]=!0);function c(h){return h.dim+"_"+h.index}}function aT(n){return n&&n.type!=="category"&&n.type!=="time"&&S5(n)}function lH(n,e){var t=n.getExtent(),i=t[0]+t[1];n.toGlobalCoord=n.dim==="x"?function(r){return r+e}:function(r){return i-r+e},n.toLocalCoord=n.dim==="x"?function(r){return r-e}:function(r){return i-r+e}}function sT(n,e){N(n.x,function(t){return lT(t,e.x,e.width)}),N(n.y,function(t){return lT(t,e.y,e.height)})}function lT(n,e,t){var i=[0,t],r=n.inverse?1:0;n.setExtent(i[r],i[1-r]),lH(n,e)}function uT(n,e,t,i,r,o,a){process.env.NODE_ENV!=="production"&&J(e==="all"||e==="axisLabel"),cT(i,r,Dn.estimate,e,!1,a);var s=[0,0,0,0];u(0),u(1),c(i,0,NaN),c(i,1,NaN);var l=S2(s,function(d){return d>0})==null;return Uu(i,s,!0,!0,t),sT(r,i),l;function u(d){N(r[Wi[d]],function(f){if(el(f.model)){var p=o.ensureRecord(f.model),g=p.labelInfoList;if(g)for(var m=0;m<g.length;m++){var y=g[m],v=f.scale.normalize(nl(y.label).tickValue);v=d===1?1-v:v,c(y.rect,d,v),c(y.rect,1-d,NaN)}var _=p.nameLayout;if(_){var v=fa(p.nameLocation)?.5:NaN;c(_.rect,d,v),c(_.rect,1-d,NaN)}}})}function c(d,f,p){var g=n[Wi[f]]-d[Wi[f]],m=d[$o[f]]+d[Wi[f]]-(n[$o[f]]+n[Wi[f]]);g=h(g,1-p),m=h(m,p);var y=rT[f][0],v=rT[f][1];s[y]=qt(s[y],g),s[v]=qt(s[v],m)}function h(d,f){return d>0&&!To(f)&&f>1e-4&&(d/=f),d}}function uH(n,e,t,i,r){var o=new ZS(hH);return N(t,function(a){return N(a,function(s){if(el(s.model)){var l=!i;s.axisBuilder=rH(n,e,s.model,r,o,l)}})}),o}function cT(n,e,t,i,r,o){var a=t===Dn.determine;N(e,function(u){return N(u,function(c){el(c.model)&&(oH(c.axisBuilder,n,c.model),c.axisBuilder.build(a?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:r}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[Wi[1-u]]=n[$o[u]]<=o.refContainer[$o[u]]*.5?0:1-u===1?2:1}N(e,function(u,c){return N(u,function(h){el(h.model)&&((i==="all"||a)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),a&&h.axisBuilder.build({axisLine:!0}))})})}function cH(n,e,t){var i,r=n.get("outerBoundsMode",!0);r==="same"?i=e.clone():r==null||r==="auto"?i=jn(n.get("outerBounds",!0)||bS,t.refContainer):r!=="none"&&process.env.NODE_ENV!=="production"&&ze("Invalid grid["+n.componentIndex+"].outerBoundsMode.");var o=n.get("outerBoundsContain",!0),a;o==null||o==="auto"?a="all":be(["all","axisLabel"],o)<0?(process.env.NODE_ENV!=="production"&&ze("Invalid grid["+n.componentIndex+"].outerBoundsContain."),a="all"):a=o;var s=[ff(te(n.get("outerBoundsClampWidth",!0),Fc[0]),e.width),ff(te(n.get("outerBoundsClampHeight",!0),Fc[1]),e.height)];return{outerBoundsRect:i,parsedOuterBoundsContain:a,outerBoundsClamp:s}}var hH=function(n,e,t,i,r,o){var a=t.axis.dim==="x"?"y":"x";XS(n,e,t,i,r,o),fa(n.nameLocation)||N(e.recordMap[a],function(s){s&&s.labelInfoList&&s.dirVec&&QS(s.labelInfoList,s.dirVec,i,r)})};function dH(n,e){var t={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return fH(t,n,e),t.seriesInvolved&&gH(t,n),t}function fH(n,e,t){var i=e.getComponent("tooltip"),r=e.getComponent("axisPointer"),o=r.get("link",!0)||[],a=[];N(t.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=rl(s.model),u=n.coordSysAxesInfo[l]={};n.coordSysMap[l]=s;var c=s.model,h=c.getModel("tooltip",i);if(N(s.getAxes(),we(g,!1,null)),s.getTooltipAxes&&i&&h.get("show")){var d=h.get("trigger")==="axis",f=h.get(["axisPointer","type"])==="cross",p=s.getTooltipAxes(h.get(["axisPointer","axis"]));(d||f)&&N(p.baseAxes,we(g,f?"cross":!0,d)),f&&N(p.otherAxes,we(g,"cross",!1))}function g(m,y,v){var _=v.model.getModel("axisPointer",r),b=_.get("show");if(!(!b||b==="auto"&&!m&&!sm(_))){y==null&&(y=_.get("triggerTooltip")),_=m?pH(v,h,r,e,m,y):_;var T=_.get("snap"),w=_.get("triggerEmphasis"),S=rl(v.model),M=y||T||v.type==="category",C=n.axesInfo[S]={key:S,axis:v,coordSys:s,axisPointerModel:_,triggerTooltip:y,triggerEmphasis:w,involveSeries:M,snap:T,useHandle:sm(_),seriesModels:[],linkGroup:null};u[S]=C,n.seriesInvolved=n.seriesInvolved||M;var I=mH(o,v);if(I!=null){var E=a[I]||(a[I]={axesInfo:{}});E.axesInfo[S]=C,E.mapper=o[I].mapper,C.linkGroup=E}}}})}function pH(n,e,t,i,r,o){var a=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};N(s,function(d){l[d]=ue(a.get(d))}),l.snap=n.type!=="category"&&!!o,a.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),r==="cross"){var c=a.get(["label","show"]);if(u.show=c??!0,!o){var h=l.lineStyle=a.get("crossStyle");h&&Me(u,h.textStyle)}}return n.model.getModel("axisPointer",new Ge(l,t,i))}function gH(n,e){e.eachSeries(function(t){var i=t.coordinateSystem,r=t.get(["tooltip","trigger"],!0),o=t.get(["tooltip","show"],!0);!i||!i.model||r==="none"||r===!1||r==="item"||o===!1||t.get(["axisPointer","show"],!0)===!1||N(n.coordSysAxesInfo[rl(i.model)],function(a){var s=a.axis;i.getAxis(s.dim)===s&&(a.seriesModels.push(t),a.seriesDataCount==null&&(a.seriesDataCount=0),a.seriesDataCount+=t.getData().count())})})}function mH(n,e){for(var t=e.model,i=e.dim,r=0;r<n.length;r++){var o=n[r]||{};if(om(o[i+"AxisId"],t.id)||om(o[i+"AxisIndex"],t.componentIndex)||om(o[i+"AxisName"],t.name))return r}}function om(n,e){return n==="all"||q(n)&&be(n,e)>=0||n===e}function yH(n){var e=am(n);if(e){var t=e.axisPointerModel,i=e.axis.scale,r=t.option,o=t.get("status"),a=t.get("value");a!=null&&(a=i.parse(a));var s=sm(t);o==null&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(a==null||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),r.value=a,s&&(r.status=e.axis.scale.isBlank()?"hide":"show")}}function am(n){var e=(n.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[rl(n)]}function vH(n){var e=am(n);return e&&e.axisPointerModel}function sm(n){return!!n.get(["handle","show"])}function rl(n){return n.type+"||"+n.id}var lm={},hT=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,r,o){this.axisPointerClass&&yH(t),n.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,r,!0)},e.prototype.updateAxisPointer=function(t,i,r,o){this._doUpdateAxisPointerClass(t,r,!1)},e.prototype.remove=function(t,i){var r=this._axisPointer;r&&r.remove(i)},e.prototype.dispose=function(t,i){this._disposeAxisPointer(i),n.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(t,i,r){var o=e.getAxisPointerClass(this.axisPointerClass);if(o){var a=vH(t);a?(this._axisPointer||(this._axisPointer=new o)).render(t,a,i,r):this._disposeAxisPointer(i)}},e.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},e.registerAxisPointerClass=function(t,i){if(process.env.NODE_ENV!=="production"&&lm[t])throw new Error("axisPointer "+t+" exists");lm[t]=i},e.getAxisPointerClass=function(t){return t&&lm[t]},e.type="axis",e}(Et),um=Re();function _H(n,e,t,i){var r=t.axis;if(!r.scale.isBlank()){var o=t.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=i.coordinateSystem.getRect(),u=r.getTicksCoords({tickModel:o,clamp:!0,breakTicks:"none",pruneByBreak:"preserve_extent_bound"});if(u.length){var c=s.length,h=um(n).splitAreaColors,d=me(),f=0;if(h)for(var p=0;p<u.length;p++){var g=h.get(u[p].tickValue);if(g!=null){f=(g+(c-1)*p)%c;break}}var m=r.toGlobalCoord(u[0].coord),y=a.getAreaStyle();s=q(s)?s:[s];for(var p=1;p<u.length;p++){var v=r.toGlobalCoord(u[p].coord),_=void 0,b=void 0,T=void 0,w=void 0;r.isHorizontal()?(_=m,b=l.y,T=v-_,w=l.height,m=_+T):(_=l.x,b=m,T=l.width,w=v-b,m=b+w);var S=u[p-1].tickValue;S!=null&&d.set(S,f),e.add(new Ue({anid:S!=null?"area_"+S:null,shape:{x:_,y:b,width:T,height:w},style:Me({fill:s[f]},y),autoBatch:!0,silent:!0})),f=(f+1)%c}um(n).splitAreaColors=d}}}function xH(n){um(n).splitAreaColors=null}var bH=["splitArea","splitLine","minorSplitLine","breakArea"],dT=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="CartesianAxisPointer",t}return e.prototype.render=function(t,i,r,o){this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new Ye,this.group.add(this._axisGroup),!!el(t)){this._axisGroup.add(t.axis.axisBuilder.group),N(bH,function(l){t.get([l,"show"])&&wH[l](this,this._axisGroup,t,t.getCoordSysModel(),r)},this);var s=o&&o.type==="changeAxisOrder"&&o.isInitSort;s||yx(a,this._axisGroup,t),n.prototype.render.call(this,t,i,r,o)}},e.prototype.remove=function(){xH(this)},e.type="cartesianAxis",e}(hT),wH={splitLine:function(n,e,t,i,r){var o=t.axis;if(!o.scale.isBlank()){var a=t.getModel("splitLine"),s=a.getModel("lineStyle"),l=s.get("color"),u=a.get("showMinLine")!==!1,c=a.get("showMaxLine")!==!1;l=q(l)?l:[l];for(var h=i.coordinateSystem.getRect(),d=o.isHorizontal(),f=0,p=o.getTicksCoords({tickModel:a,breakTicks:"none",pruneByBreak:"preserve_extent_bound"}),g=[],m=[],y=s.getLineStyle(),v=0;v<p.length;v++){var _=o.toGlobalCoord(p[v].coord);if(!(v===0&&!u||v===p.length-1&&!c)){var b=p[v].tickValue;d?(g[0]=_,g[1]=h.y,m[0]=_,m[1]=h.y+h.height):(g[0]=h.x,g[1]=_,m[0]=h.x+h.width,m[1]=_);var T=f++%l.length,w=new gi({anid:b!=null?"line_"+b:null,autoBatch:!0,shape:{x1:g[0],y1:g[1],x2:m[0],y2:m[1]},style:Me({stroke:l[T]},y),silent:!0});_s(w.shape,y.lineWidth),e.add(w)}}}},minorSplitLine:function(n,e,t,i,r){var o=t.axis,a=t.getModel("minorSplitLine"),s=a.getModel("lineStyle"),l=i.coordinateSystem.getRect(),u=o.isHorizontal(),c=o.getMinorTicksCoords();if(c.length)for(var h=[],d=[],f=s.getLineStyle(),p=0;p<c.length;p++)for(var g=0;g<c[p].length;g++){var m=o.toGlobalCoord(c[p][g].coord);u?(h[0]=m,h[1]=l.y,d[0]=m,d[1]=l.y+l.height):(h[0]=l.x,h[1]=m,d[0]=l.x+l.width,d[1]=m);var y=new gi({anid:"minor_line_"+c[p][g].tickValue,autoBatch:!0,shape:{x1:h[0],y1:h[1],x2:d[0],y2:d[1]},style:f,silent:!0});_s(y.shape,f.lineWidth),e.add(y)}},splitArea:function(n,e,t,i,r){_H(n,e,t,i)},breakArea:function(n,e,t,i,r){t.axis.scale}},fT=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="xAxis",e}(dT),SH=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=fT.type,t}return e.type="yAxis",e}(dT),TH=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="grid",t}return e.prototype.render=function(t,i){this.group.removeAll(),t.get("show")&&this.group.add(new Ue({shape:t.coordinateSystem.getRect(),style:Me({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(Et),pT={offset:0};function MH(n){n.registerComponentView(TH),n.registerComponentModel(qV),n.registerCoordinateSystem("cartesian2d",sH),SS(n,"x",Ug,pT),SS(n,"y",Ug,pT),n.registerComponentView(fT),n.registerComponentView(SH),n.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var gT=Re();function CH(n,e,t){gT(n)[e]=t}function kH(n,e,t){var i=gT(n),r=i[e];r===t&&(i[e]=null)}Zn({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},nt);var DH={axisPointer:1,tooltip:1,brush:1};function IH(n,e,t){var i=e.getComponentByElement(n.topTarget);if(!i||i===t||DH.hasOwnProperty(i.mainType))return!1;var r=i.coordinateSystem;if(!r||r.model===t)return!1;var o=Ts(i),a=Ts(t);return!((o.zlevel-a.zlevel||o.z-a.z)<=0)}var EH=1e-8;function mT(n,e){return Math.abs(n-e)<EH}function ol(n,e,t){var i=0,r=n[0];if(!r)return!1;for(var o=1;o<n.length;o++){var a=n[o];i+=di(r[0],r[1],a[0],a[1],e,t),r=a}var s=n[0];return(!mT(r[0],s[0])||!mT(r[1],s[1]))&&(i+=di(r[0],r[1],s[0],s[1],e,t)),i!==0}var al=N,NH=ne,Kc=-1,pa=function(){function n(e){var t=e.mappingMethod,i=e.type,r=this.option=ue(e);this.type=i,this.mappingMethod=t,this._normalizeData=RH[t];var o=n.visualHandlers[i];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[t],t==="piecewise"?(cm(r),AH(r)):t==="category"?r.categories?OH(r):cm(r,!0):(J(t!=="linear"||r.dataExtent),cm(r))}return n.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},n.prototype.getNormalizer=function(){return ke(this._normalizeData,this)},n.listVisualTypes=function(){return Ce(n.visualHandlers)},n.isValidType=function(e){return n.visualHandlers.hasOwnProperty(e)},n.eachVisual=function(e,t,i){ne(e)?N(e,t,i):t.call(i,e)},n.mapVisual=function(e,t,i){var r,o=q(e)?[]:ne(e)?{}:(r=!0,null);return n.eachVisual(e,function(a,s){var l=t.call(i,a,s);r?o=l:o[s]=l}),o},n.retrieveVisuals=function(e){var t={},i;return e&&al(n.visualHandlers,function(r,o){e.hasOwnProperty(o)&&(t[o]=e[o],i=!0)}),i?t:null},n.prepareVisualTypes=function(e){if(q(e))e=e.slice();else if(NH(e)){var t=[];al(e,function(i,r){t.push(r)}),e=t}else return[];return e.sort(function(i,r){return r==="color"&&i!=="color"&&i.indexOf("color")===0?1:-1}),e},n.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},n.findPieceIndex=function(e,t,i){for(var r,o=1/0,a=0,s=t.length;a<s;a++){var l=t[a].value;if(l!=null){if(l===e||Q(l)&&l===e+"")return a;i&&d(l,a)}}for(var a=0,s=t.length;a<s;a++){var u=t[a],c=u.interval,h=u.close;if(c){if(c[0]===-1/0){if(Jc(h[1],e,c[1]))return a}else if(c[1]===1/0){if(Jc(h[0],c[0],e))return a}else if(Jc(h[0],c[0],e)&&Jc(h[1],e,c[1]))return a;i&&d(c[0],a),i&&d(c[1],a)}}if(i)return e===1/0?t.length-1:e===-1/0?0:r;function d(f,p){var g=Math.abs(f-e);g<o&&(o=g,r=p)}},n.visualHandlers={color:{applyVisual:sl("color"),getColorMapper:function(){var e=this.option;return ke(e.mappingMethod==="category"?function(t,i){return!i&&(t=this._normalizeData(t)),ll.call(this,t)}:function(t,i,r){var o=!!r;return!i&&(t=this._normalizeData(t)),r=zd(t,e.parsedVisual,r),o?r:ui(r,"rgba")},this)},_normalizedToVisual:{linear:function(e){return ui(zd(e,this.option.parsedVisual),"rgba")},category:ll,piecewise:function(e,t){var i=dm.call(this,t);return i==null&&(i=ui(zd(e,this.option.parsedVisual),"rgba")),i},fixed:oo}},colorHue:Qc(function(e,t){return Lo(e,t)}),colorSaturation:Qc(function(e,t){return Lo(e,null,t)}),colorLightness:Qc(function(e,t){return Lo(e,null,null,t)}),colorAlpha:Qc(function(e,t){return Bd(e,t)}),decal:{applyVisual:sl("decal"),_normalizedToVisual:{linear:null,category:ll,piecewise:null,fixed:null}},opacity:{applyVisual:sl("opacity"),_normalizedToVisual:hm([0,1])},liftZ:{applyVisual:sl("liftZ"),_normalizedToVisual:{linear:oo,category:oo,piecewise:oo,fixed:oo}},symbol:{applyVisual:function(e,t,i){var r=this.mapValueToVisual(e);i("symbol",r)},_normalizedToVisual:{linear:yT,category:ll,piecewise:function(e,t){var i=dm.call(this,t);return i==null&&(i=yT.call(this,e)),i},fixed:oo}},symbolSize:{applyVisual:sl("symbolSize"),_normalizedToVisual:hm([0,1])}},n}();function AH(n){var e=n.pieceList;n.hasSpecialVisual=!1,N(e,function(t,i){t.originIndex=i,t.visual!=null&&(n.hasSpecialVisual=!0)})}function OH(n){var e=n.categories,t=n.categoryMap={},i=n.visual;if(al(e,function(a,s){t[a]=s}),!q(i)){var r=[];ne(i)?al(i,function(a,s){var l=t[s];r[l??Kc]=a}):r[Kc]=i,i=vT(n,r)}for(var o=e.length-1;o>=0;o--)i[o]==null&&(delete t[e[o]],e.pop())}function cm(n,e){var t=n.visual,i=[];ne(t)?al(t,function(o){i.push(o)}):t!=null&&i.push(t);var r={color:1,symbol:1};!e&&i.length===1&&!r.hasOwnProperty(n.type)&&(i[1]=i[0]),vT(n,i)}function Qc(n){return{applyVisual:function(e,t,i){var r=this.mapValueToVisual(e);i("color",n(t("color"),r))},_normalizedToVisual:hm([0,1])}}function yT(n){var e=this.option.visual;return e[Math.round(jt(n,[0,1],[0,e.length-1],!0))]||{}}function sl(n){return function(e,t,i){i(n,this.mapValueToVisual(e))}}function ll(n){var e=this.option.visual;return e[this.option.loop&&n!==Kc?n%e.length:n]}function oo(){return this.option.visual[0]}function hm(n){return{linear:function(e){return jt(e,n,this.option.visual,!0)},category:ll,piecewise:function(e,t){var i=dm.call(this,t);return i==null&&(i=jt(e,n,this.option.visual,!0)),i},fixed:oo}}function dm(n){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var i=pa.findPieceIndex(n,t),r=t[i];if(r&&r.visual)return r.visual[this.type]}}function vT(n,e){return n.visual=e,n.type==="color"&&(n.parsedVisual=$(e,function(t){var i=Ut(t);return!i&&process.env.NODE_ENV!=="production"&&st("'"+t+"' is an illegal color, fallback to '#000000'",!0),i||[0,0,0,1]})),e}var RH={linear:function(n){return jt(n,this.option.dataExtent,[0,1],!0)},piecewise:function(n){var e=this.option.pieceList,t=pa.findPieceIndex(n,e,!0);if(t!=null)return jt(t,[0,e.length-1],[0,1],!0)},category:function(n){var e=this.option.categories?this.option.categoryMap[n]:n;return e??Kc},fixed:nt};function Jc(n,e,t){return n?e<=t:e<t}var _T=gi.prototype,fm=zu.prototype,xT=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return n}();(function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e})(xT);function pm(n){return isNaN(+n.cpx1)||isNaN(+n.cpy1)}var LH=function(n){W(e,n);function e(t){var i=n.call(this,t)||this;return i.type="ec-line",i}return e.prototype.getDefaultStyle=function(){return{stroke:Z.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new xT},e.prototype.buildPath=function(t,i){pm(i)?_T.buildPath.call(this,t,i):fm.buildPath.call(this,t,i)},e.prototype.pointAt=function(t){return pm(this.shape)?_T.pointAt.call(this,t):fm.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var i=this.shape,r=pm(i)?[i.x2-i.x1,i.y2-i.y1]:fm.tangentAt.call(this,t);return Md(r,r)},e}(Ae),gm=["fromSymbol","toSymbol"];function bT(n){return"_"+n+"Type"}function wT(n,e,t){var i=e.getItemVisual(t,n);if(!i||i==="none")return i;var r=e.getItemVisual(t,n+"Size"),o=e.getItemVisual(t,n+"Rotate"),a=e.getItemVisual(t,n+"Offset"),s=e.getItemVisual(t,n+"KeepAspect"),l=zp(r),u=dc(a||0,l);return i+l+u+(o||"")+(s||"")}function ST(n,e,t){var i=e.getItemVisual(t,n);if(!(!i||i==="none")){var r=e.getItemVisual(t,n+"Size"),o=e.getItemVisual(t,n+"Rotate"),a=e.getItemVisual(t,n+"Offset"),s=e.getItemVisual(t,n+"KeepAspect"),l=zp(r),u=dc(a||0,l),c=Jr(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=o==null||isNaN(o)?void 0:+o*Math.PI/180||0,c.name=n,c}}function PH(n){var e=new LH({name:"line",subPixelOptimize:!0});return mm(e.shape,n),e}function mm(n,e){n.x1=e[0][0],n.y1=e[0][1],n.x2=e[1][0],n.y2=e[1][1],n.percent=1;var t=e[2];t?(n.cpx1=t[0],n.cpy1=t[1]):(n.cpx1=NaN,n.cpy1=NaN)}var zH=function(n){W(e,n);function e(t,i,r){var o=n.call(this)||this;return o._createLine(t,i,r),o}return e.prototype._createLine=function(t,i,r){var o=t.hostModel,a=t.getItemLayout(i),s=t.getItemVisual(i,"z2"),l=PH(a);l.shape.percent=0,$t(l,{z2:te(s,0),shape:{percent:1}},o,i),this.add(l),N(gm,function(u){var c=ST(u,t,i);this.add(c),this[bT(u)]=wT(u,t,i)},this),this._updateCommonStl(t,i,r)},e.prototype.updateData=function(t,i,r){var o=t.hostModel,a=this.childOfName("line"),s=t.getItemLayout(i),l={shape:{}};mm(l.shape,s),ft(a,l,o,i),N(gm,function(u){var c=wT(u,t,i),h=bT(u);if(this[h]!==c){this.remove(this.childOfName(u));var d=ST(u,t,i);this.add(d)}this[h]=c},this),this._updateCommonStl(t,i,r)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,i,r){var o=t.hostModel,a=this.childOfName("line"),s=r&&r.emphasisLineStyle,l=r&&r.blurLineStyle,u=r&&r.selectLineStyle,c=r&&r.labelStatesModels,h=r&&r.emphasisDisabled,d=r&&r.focus,f=r&&r.blurScope;if(!r||t.hasItemOption){var p=t.getItemModel(i),g=p.getModel("emphasis");s=g.getModel("lineStyle").getLineStyle(),l=p.getModel(["blur","lineStyle"]).getLineStyle(),u=p.getModel(["select","lineStyle"]).getLineStyle(),h=g.get("disabled"),d=g.get("focus"),f=g.get("blurScope"),c=Ui(p)}var m=t.getItemVisual(i,"style"),y=m.stroke;a.useStyle(m),a.style.fill=null,a.style.strokeNoScale=!0,a.ensureState("emphasis").style=s,a.ensureState("blur").style=l,a.ensureState("select").style=u,N(gm,function(w){var S=this.childOfName(w);if(S){S.setColor(y),S.style.opacity=m.opacity;for(var M=0;M<Pt.length;M++){var C=Pt[M],I=a.getState(C);if(I){var E=I.style||{},k=S.ensureState(C),D=k.style||(k.style={});E.stroke!=null&&(D[S.__isEmptyBrush?"stroke":"fill"]=E.stroke),E.opacity!=null&&(D.opacity=E.opacity)}}S.markRedraw()}},this);var v=o.getRawValue(i);Fr(this,c,{labelDataIndex:i,labelFetcher:{getFormattedLabel:function(w,S){return o.getFormattedLabel(w,S,t.dataType)}},inheritColor:y||Z.color.neutral99,defaultOpacity:m.opacity,defaultText:(v==null?t.getName(i):isFinite(v)?at(v):v)+""});var _=this.getTextContent();if(_){var b=c.normal;_.__align=_.style.align,_.__verticalAlign=_.style.verticalAlign,_.__position=b.get("position")||"middle";var T=b.get("distance");q(T)||(T=[T,T]),_.__labelDistance=T}this.setTextConfig({position:null,local:!0,inside:!1}),zr(this,d,f,h)},e.prototype.highlight=function(){Lr(this)},e.prototype.downplay=function(){Pr(this)},e.prototype.updateLayout=function(t,i){this.setLinePoints(t.getItemLayout(i))},e.prototype.setLinePoints=function(t){var i=this.childOfName("line");mm(i.shape,t),i.dirty()},e.prototype.beforeUpdate=function(){var t=this,i=t.childOfName("fromSymbol"),r=t.childOfName("toSymbol"),o=t.getTextContent();if(!i&&!r&&(!o||o.ignore))return;for(var a=1,s=this.parent;s;)s.scaleX&&(a/=s.scaleX),s=s.parent;var l=t.childOfName("line");if(!this.__dirty&&!l.__dirty)return;var u=l.shape.percent,c=l.pointAt(0),h=l.pointAt(u),d=_0([],h,c);Md(d,d);function f(I,E){var k=I.__specifiedRotation;if(k==null){var D=l.tangentAt(E);I.attr("rotation",(E===1?-1:1)*Math.PI/2-Math.atan2(D[1],D[0]))}else I.attr("rotation",k)}if(i&&(i.setPosition(c),f(i,0),i.scaleX=i.scaleY=a*u,i.markRedraw()),r&&(r.setPosition(h),f(r,1),r.scaleX=r.scaleY=a*u,r.markRedraw()),o&&!o.ignore){o.x=o.y=0,o.originX=o.originY=0;var p=void 0,g=void 0,m=o.__labelDistance,y=m[0]*a,v=m[1]*a,_=u/2,b=l.tangentAt(_),T=[b[1],-b[0]],w=l.pointAt(_);T[1]>0&&(T[0]=-T[0],T[1]=-T[1]);var S=b[0]<0?-1:1;if(o.__position!=="start"&&o.__position!=="end"){var M=-Math.atan2(b[1],b[0]);h[0]<c[0]&&(M=Math.PI+M),o.rotation=M}var C=void 0;switch(o.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":C=-v,g="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":C=v,g="top";break;default:C=0,g="middle"}switch(o.__position){case"end":o.x=d[0]*y+h[0],o.y=d[1]*v+h[1],p=d[0]>.8?"left":d[0]<-.8?"right":"center",g=d[1]>.8?"top":d[1]<-.8?"bottom":"middle";break;case"start":o.x=-d[0]*y+c[0],o.y=-d[1]*v+c[1],p=d[0]>.8?"right":d[0]<-.8?"left":"center",g=d[1]>.8?"bottom":d[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":o.x=y*S+c[0],o.y=c[1]+C,p=b[0]<0?"right":"left",o.originX=-y*S,o.originY=-C;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":o.x=w[0],o.y=w[1]+C,p="center",o.originY=-C;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":o.x=-y*S+h[0],o.y=h[1]+C,p=b[0]>=0?"right":"left",o.originX=y*S,o.originY=-C;break}o.scaleX=o.scaleY=a,o.setStyle({verticalAlign:o.__verticalAlign||g,align:o.__align||p})}},e}(Ye),BH=function(){function n(e){this.group=new Ye,this._LineCtor=e||zH}return n.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var i=this,r=i.group,o=i._lineData;i._lineData=e,o||r.removeAll();var a=TT(e);e.diff(o).add(function(s){t._doAdd(e,s,a)}).update(function(s,l){t._doUpdate(o,e,l,s,a)}).remove(function(s){r.remove(o.getItemGraphicEl(s))}).execute()},n.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,i){t.updateLayout(e,i)},this)},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=TT(e),this._lineData=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function i(s){!s.isGroup&&!VH(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var r=e.start;r<e.end;r++){var o=t.getItemLayout(r);if(ym(o)){var a=new this._LineCtor(t,r,this._seriesScope);a.traverse(i),this.group.add(a),t.setItemGraphicEl(r,a),this._progressiveEls.push(a)}}},n.prototype.remove=function(){this.group.removeAll()},n.prototype.eachRendered=function(e){ws(this._progressiveEls||this.group,e)},n.prototype._doAdd=function(e,t,i){var r=e.getItemLayout(t);if(ym(r)){var o=new this._LineCtor(e,t,i);e.setItemGraphicEl(t,o),this.group.add(o)}},n.prototype._doUpdate=function(e,t,i,r,o){var a=e.getItemGraphicEl(i);if(!ym(t.getItemLayout(r))){this.group.remove(a);return}a?a.updateData(t,r,o):a=new this._LineCtor(t,r,o),t.setItemGraphicEl(r,a),this.group.add(a)},n}();function VH(n){return n.animators&&n.animators.length>0}function TT(n){var e=n.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:Ui(e)}}function MT(n){return isNaN(n[0])||isNaN(n[1])}function ym(n){return n&&!MT(n[0])&&!MT(n[1])}function CT(n,e,t,i,r,o){n=n||0;var a=t[1]-t[0];if(r!=null&&(r=ga(r,[0,a])),o!=null&&(o=Math.max(o,r??0)),i==="all"){var s=Math.abs(e[1]-e[0]);s=ga(s,[0,a]),r=o=ga(s,[r,o]),i=0}e[0]=ga(e[0],t),e[1]=ga(e[1],t);var l=vm(e,i);e[i]+=n;var u=r||0,c=t.slice();l.sign<0?c[0]+=u:c[1]-=u,e[i]=ga(e[i],c);var h;return h=vm(e,i),r!=null&&(h.sign!==l.sign||h.span<r)&&(e[1-i]=e[i]+l.sign*r),h=vm(e,i),o!=null&&h.span>o&&(e[1-i]=e[i]+h.sign*o),e}function vm(n,e){var t=n[e]-n[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function ga(n,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,n))}var ao=!0,ul=Math.min,ma=Math.max,HH=Math.pow,FH=1e4,GH=6,WH=6,kT="globalPan",UH={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},YH={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},DT={brushStyle:{lineWidth:2,stroke:Z.color.backgroundTint,fill:Z.color.borderTint},transformable:!0,brushMode:"single",removeOnClick:!1},qH=0,IT=function(n){W(e,n);function e(t){var i=n.call(this)||this;return i._track=[],i._covers=[],i._handlers={},process.env.NODE_ENV!=="production"&&J(t),i._zr=t,i.group=new Ye,i._uid="brushController_"+qH++,N(JH,function(r,o){this._handlers[o]=ke(r,this)},i),i}return e.prototype.enableBrush=function(t){return process.env.NODE_ENV!=="production"&&J(this._mounted),this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},e.prototype._doEnableBrush=function(t){var i=this._zr;this._enableGlobalPan||CH(i,kT,this._uid),N(this._handlers,function(r,o){i.on(o,r)}),this._brushType=t.brushType,this._brushOption=_e(ue(DT),t,!0)},e.prototype._doDisableBrush=function(){var t=this._zr;kH(t,kT,this._uid),N(this._handlers,function(i,r){t.off(r,i)}),this._brushType=this._brushOption=null},e.prototype.setPanels=function(t){if(t&&t.length){var i=this._panels={};N(t,function(r){i[r.panelId]=ue(r)})}else this._panels=null;return this},e.prototype.mount=function(t){t=t||{},process.env.NODE_ENV!=="production"&&(this._mounted=!0),this._enableGlobalPan=t.enableGlobalPan;var i=this.group;return this._zr.add(i),i.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=i.getLocalTransform(),this},e.prototype.updateCovers=function(t){process.env.NODE_ENV!=="production"&&J(this._mounted),t=$(t,function(d){return _e(ue(DT),d,!0)});var i="\0-brush-index-",r=this._covers,o=this._covers=[],a=this,s=this._creatingCover;return new Zf(r,t,u,l).add(c).update(c).remove(h).execute(),this;function l(d,f){return(d.id!=null?d.id:i+f)+"-"+d.brushType}function u(d,f){return l(d.__brushOption,f)}function c(d,f){var p=t[d];if(f!=null&&r[f]===s)o[d]=r[f];else{var g=o[d]=f!=null?(r[f].__brushOption=p,r[f]):NT(a,ET(a,p));_m(a,g)}}function h(d){r[d]!==s&&a.group.remove(r[d])}},e.prototype.unmount=function(){if(!(process.env.NODE_ENV!=="production"&&!this._mounted))return this.enableBrush(!1),wm(this),this._zr.remove(this.group),process.env.NODE_ENV!=="production"&&(this._mounted=!1),this},e.prototype.dispose=function(){this.unmount(),this.off()},e}(bn);function ET(n,e){var t=eh[e.brushType].createCover(n,e);return t.__brushOption=e,OT(t,e),n.group.add(t),t}function NT(n,e){var t=xm(e);return t.endCreating&&(t.endCreating(n,e),OT(e,e.__brushOption)),e}function AT(n,e){var t=e.__brushOption;xm(e).updateCoverShape(n,e,t.range,t)}function OT(n,e){var t=e.z;t==null&&(t=FH),n.traverse(function(i){i.z=t,i.z2=t})}function _m(n,e){xm(e).updateCommon(n,e),AT(n,e)}function xm(n){return eh[n.__brushOption.brushType]}function bm(n,e,t){var i=n._panels;if(!i)return ao;var r,o=n._transform;return N(i,function(a){a.isTargetByCursor(e,t,o)&&(r=a)}),r}function RT(n,e){var t=n._panels;if(!t)return ao;var i=e.__brushOption.panelId;return i!=null?t[i]:ao}function wm(n){var e=n._covers,t=e.length;return N(e,function(i){n.group.remove(i)},n),e.length=0,!!t}function so(n,e){var t=$(n._covers,function(i){var r=i.__brushOption,o=ue(r.range);return{brushType:r.brushType,panelId:r.panelId,range:o}});n.trigger("brush",{areas:t,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function jH(n){var e=n._track;if(!e.length)return!1;var t=e[e.length-1],i=e[0],r=t[0]-i[0],o=t[1]-i[1],a=HH(r*r+o*o,.5);return a>GH}function LT(n){var e=n.length-1;return e<0&&(e=0),[n[0],n[e]]}function PT(n,e,t,i){var r=new Ye;return r.add(new Ue({name:"main",style:Tm(t),silent:!0,draggable:!0,cursor:"move",drift:we(VT,n,e,r,["n","s","w","e"]),ondragend:we(so,e,{isEnd:!0})})),N(i,function(o){r.add(new Ue({name:o.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:we(VT,n,e,r,o),ondragend:we(so,e,{isEnd:!0})}))}),r}function zT(n,e,t,i){var r=i.brushStyle.lineWidth||0,o=ma(r,WH),a=t[0][0],s=t[1][0],l=a-r/2,u=s-r/2,c=t[0][1],h=t[1][1],d=c-o+r/2,f=h-o+r/2,p=c-a,g=h-s,m=p+r,y=g+r;Si(n,e,"main",a,s,p,g),i.transformable&&(Si(n,e,"w",l,u,o,y),Si(n,e,"e",d,u,o,y),Si(n,e,"n",l,u,m,o),Si(n,e,"s",l,f,m,o),Si(n,e,"nw",l,u,o,o),Si(n,e,"ne",d,u,o,o),Si(n,e,"sw",l,f,o,o),Si(n,e,"se",d,f,o,o))}function Sm(n,e){var t=e.__brushOption,i=t.transformable,r=e.childAt(0);r.useStyle(Tm(t)),r.attr({silent:!i,cursor:i?"move":"default"}),N([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(o){var a=e.childOfName(o.join("")),s=o.length===1?Mm(n,o[0]):ZH(n,o);a&&a.attr({silent:!i,invisible:!i,cursor:i?YH[s]+"-resize":null})})}function Si(n,e,t,i,r,o,a){var s=e.childOfName(t);s&&s.setShape(KH(Cm(n,e,[[i,r],[i+o,r+a]])))}function Tm(n){return Me({strokeNoScale:!0},n.brushStyle)}function BT(n,e,t,i){var r=[ul(n,t),ul(e,i)],o=[ma(n,t),ma(e,i)];return[[r[0],o[0]],[r[1],o[1]]]}function $H(n){return Hf(n.group)}function Mm(n,e){var t={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},r=gx(t[e],$H(n));return i[r]}function ZH(n,e){var t=[Mm(n,e[0]),Mm(n,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function VT(n,e,t,i,r,o){var a=t.__brushOption,s=n.toRectRange(a.range),l=HT(e,r,o);N(i,function(u){var c=UH[u];s[c[0]][c[1]]+=l[c[0]]}),a.range=n.fromRectRange(BT(s[0][0],s[1][0],s[0][1],s[1][1])),_m(e,t),so(e,{isEnd:!1})}function XH(n,e,t,i){var r=e.__brushOption.range,o=HT(n,t,i);N(r,function(a){a[0]+=o[0],a[1]+=o[1]}),_m(n,e),so(n,{isEnd:!1})}function HT(n,e,t){var i=n.group,r=i.transformCoordToLocal(e,t),o=i.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function Cm(n,e,t){var i=RT(n,e);return i&&i!==ao?i.clipPath(t,n._transform):ue(t)}function KH(n){var e=ul(n[0][0],n[1][0]),t=ul(n[0][1],n[1][1]),i=ma(n[0][0],n[1][0]),r=ma(n[0][1],n[1][1]);return{x:e,y:t,width:i-e,height:r-t}}function QH(n,e,t){if(!(!n._brushType||e3(n,e.offsetX,e.offsetY))){var i=n._zr,r=n._covers,o=bm(n,e,t);if(!n._dragging)for(var a=0;a<r.length;a++){var s=r[a].__brushOption;if(o&&(o===ao||s.panelId===o.panelId)&&eh[s.brushType].contain(r[a],t[0],t[1]))return}o&&i.setCursorStyle("crosshair")}}function km(n){var e=n.event;e.preventDefault&&e.preventDefault()}function Dm(n,e,t){return n.childOfName("main").contain(e,t)}function FT(n,e,t,i){var r=n._creatingCover,o=n._creatingPanel,a=n._brushOption,s;if(n._track.push(t.slice()),jH(n)||r){if(o&&!r){a.brushMode==="single"&&wm(n);var l=ue(a);l.brushType=GT(l.brushType,o),l.panelId=o===ao?null:o.panelId,r=n._creatingCover=ET(n,l),n._covers.push(r)}if(r){var u=eh[GT(n._brushType,o)],c=r.__brushOption;c.range=u.getCreatingRange(Cm(n,r,n._track)),i&&(NT(n,r),u.updateCommon(n,r)),AT(n,r),s={isEnd:i}}}else i&&a.brushMode==="single"&&a.removeOnClick&&bm(n,e,t)&&wm(n)&&(s={isEnd:i,removeOnClick:!0});return s}function GT(n,e){return n==="auto"?(process.env.NODE_ENV!=="production"&&J(e&&e.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),e.defaultBrushType):n}var JH={mousedown:function(n){if(this._dragging)WT(this,n);else if(!n.target||!n.target.draggable){km(n);var e=this.group.transformCoordToLocal(n.offsetX,n.offsetY);this._creatingCover=null;var t=this._creatingPanel=bm(this,n,e);t&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(n){var e=n.offsetX,t=n.offsetY,i=this.group.transformCoordToLocal(e,t);if(QH(this,n,i),this._dragging){km(n);var r=FT(this,n,i,!1);r&&so(this,r)}},mouseup:function(n){WT(this,n)}};function WT(n,e){if(n._dragging){km(e);var t=e.offsetX,i=e.offsetY,r=n.group.transformCoordToLocal(t,i),o=FT(n,e,r,!0);n._dragging=!1,n._track=[],n._creatingCover=null,o&&so(n,o)}}function e3(n,e,t){var i=n._zr;return e<0||e>i.getWidth()||t<0||t>i.getHeight()}var eh={lineX:UT(0),lineY:UT(1),rect:{createCover:function(n,e){function t(i){return i}return PT({toRectRange:t,fromRectRange:t},n,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(n){var e=LT(n);return BT(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(n,e,t,i){zT(n,e,t,i)},updateCommon:Sm,contain:Dm},polygon:{createCover:function(n,e){var t=new Ye;return t.add(new jo({name:"main",style:Tm(e),silent:!0})),t},getCreatingRange:function(n){return n},endCreating:function(n,e){e.remove(e.childAt(0)),e.add(new qo({name:"main",draggable:!0,drift:we(XH,n,e),ondragend:we(so,n,{isEnd:!0})}))},updateCoverShape:function(n,e,t,i){e.childAt(0).setShape({points:Cm(n,e,t)})},updateCommon:Sm,contain:Dm}};function UT(n){return{createCover:function(e,t){return PT({toRectRange:function(i){var r=[i,[0,100]];return n&&r.reverse(),r},fromRectRange:function(i){return i[n]}},e,t,[[["w"],["e"]],[["n"],["s"]]][n])},getCreatingRange:function(e){var t=LT(e),i=ul(t[0][n],t[1][n]),r=ma(t[0][n],t[1][n]);return[i,r]},updateCoverShape:function(e,t,i,r){var o,a=RT(e,t);if(a!==ao&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(n);else{var s=e._zr;o=[0,[s.getWidth(),s.getHeight()][1-n]]}var l=[i,o];n&&l.reverse(),zT(e,t,l,r)},updateCommon:Sm,contain:Dm}}function t3(n){return n=Im(n),function(e){return vx(e,n)}}function n3(n,e){return n=Im(n),function(t){var i=t,r=i?n.width:n.height,o=i?n.x:n.y;return[o,o+(r||0)]}}function i3(n,e,t){var i=Im(n);return function(r,o){return i.contain(o[0],o[1])&&!IH(r,e,t)}}function Im(n){return ve.create(n)}const r3=["getWidth","getHeight","getDom","getOption","resize","dispatchAction","convertToPixel","convertFromPixel","containPixel","getDataURL","getConnectedDataURL","appendData","clear","isDisposed","dispose"];function o3(n){function e(t){return function(...i){if(!n.value)throw new Error("ECharts is not initialized yet.");return Reflect.apply(n.value[t],n.value,i)}}return r3.reduce((t,i)=>(t[i]=e(i),t),{})}function a3(n,e,t){x.watch([t,n,e],([i,r,o],a,s)=>{let l=null;if(i&&r&&o){const{offsetWidth:u,offsetHeight:c}=i,{throttle:h=100,onResize:d}=o===!0?{}:o;let f=!1;const p=()=>{r.resize(),d==null||d()},g=h?pc(p,h):p;l=new ResizeObserver(()=>{!f&&(f=!0,i.offsetWidth===u&&i.offsetHeight===c)||i.offsetWidth===0||i.offsetHeight===0||g()}),l.observe(i)}s(()=>{l&&(l.disconnect(),l=null)})})}const s3={autoresize:[Boolean,Object]},l3=Symbol();function u3(n,e,t){const i=x.inject(l3,{}),r=x.computed(()=>({...x.toValue(i),...t==null?void 0:t.value}));x.watchEffect(()=>{const o=n.value;o&&(e.value?o.showLoading(r.value):o.hideLoading())})}const c3={loading:Boolean,loadingOptions:Object};function YT(){return typeof window<"u"&&typeof document<"u"}const h3=/^on[^a-z]/,qT=n=>h3.test(n);function d3(n){const e={};for(const t in n)qT(t)||(e[t]=n[t]);return e}function f3(n){const e=Number(n);return Number.isInteger(e)&&e>=0&&e<Math.pow(2,32)-1&&String(e)===n}function p3(n,e){const t=new Set(n),i=new Set(e);if(t.size!==i.size)return!1;for(const r of t)if(!i.has(r))return!1;return!0}function jT(n){return n!=null&&typeof n=="object"&&!Array.isArray(n)}const g3="[vue-echarts]";function Em(n){x.warn(`${g3} ${n}`)}const $T={tooltip:["tooltip","formatter"],dataView:["toolbox","feature","dataView","optionToContent"]},m3=Object.keys($T);function Nm(n){return m3.some(e=>n===e||n.startsWith(e+"-"))}function y3(n,e){const t=YT()?document.createElement("div"):void 0,i=x.shallowReactive({}),r=x.shallowReactive({}),o=x.shallowReactive({}),a=x.shallowRef(!1),s=()=>a.value&&t?x.h(x.Teleport,{to:t},Object.entries(n).filter(([h])=>Nm(h)).map(([h,d])=>{const f=h;return x.h("div",{ref:p=>{p instanceof HTMLElement&&(i[f]=p)},style:{display:"contents"}},r[f]?d==null?void 0:d(o[f]):void 0)})):void 0;function l(h){return h!==null&&typeof h=="object"&&!Array.isArray(h)}function u(h){const d={...h},f=(p,g)=>{const m=p[g];if(Array.isArray(m))return p[g]=[...m],p[g];if(l(m))return p[g]={...m},p[g];if(m===void 0)return p[g]=f3(g)?[]:{},p[g]};return Object.keys(n).filter(p=>{const g=Nm(p);return g||Em(`Invalid slot name: ${p}`),g}).forEach(p=>{const[g,...m]=p.split("-"),y=$T[g];if(!y)return;const v=[...m,...y];if(v.length===0)return;let _=d;for(let b=0;b<v.length-1;b++)if(_=f(_,v[b]),!_)return;_[v[v.length-1]]=b=>(r[p]=!0,o[p]=b,i[p])}),d}let c=[];return x.onUpdated(()=>{const h=Object.keys(n).filter(Nm);p3(h,c)||(c.forEach(d=>{h.includes(d)||(delete o[d],delete r[d],delete i[d])}),c=h,e())}),x.onMounted(()=>{a.value=!0}),x.onUnmounted(()=>{t==null||t.remove()}),{teleportedSlots:s,patchOption:u}}let sr=null;const Am="x-vue-echarts";function v3(){if(sr!=null)return sr;const n=globalThis.customElements;if(!YT()||!(n!=null&&n.get))return sr=!1,sr;if(!n.get(Am))try{class e extends HTMLElement{constructor(){super(...arguments),nD(this,"__dispose",null)}disconnectedCallback(){this.__dispose&&(this.__dispose(),this.__dispose=null)}}n.define(Am,e)}catch{return sr=!1,sr}return sr=!0,sr}function _3(n){if(!jT(n))return;const e=n.id;if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e))return String(e)}function ZT(n){const e=n,t=Array.isArray(e.options)?e.options.length:0,i=Array.isArray(e.media)?e.media.length:0,r=Object.create(null),o=[],a=[];for(const s of Object.keys(e)){if(s==="options"||s==="media")continue;const l=e[s];if(Array.isArray(l)){const u=l,c=new Set;let h=0;for(let d=0;d<u.length;d++){const f=_3(u[d]);f!==void 0?c.add(f):h++}r[s]={idsSorted:c.size>0?Array.from(c).sort():[],noIdCount:h}}else jT(l)?o.push(s):l!==void 0&&a.push(s)}return o.length>1&&o.sort(),a.length>1&&a.sort(),{optionsLength:t,mediaLength:i,arrays:r,objects:o,scalars:a}}function XT(n,e){if(n.length===0)return[];if(e.length===0)return n.slice();const t=new Set(e),i=[];for(let r=0;r<n.length;r++){const o=n[r];t.has(o)||i.push(o)}return i}function x3(n,e){if(n.length===0)return!1;if(e.length===0)return!0;const t=new Set(e);for(let i=0;i<n.length;i++)if(!t.has(n[i]))return!0;return!1}function b3(n,e){const t=ZT(e);if(!n)return{option:e,signature:t,plan:{notMerge:!1}};if(t.optionsLength<n.optionsLength)return{option:e,signature:t,plan:{notMerge:!0}};if(t.mediaLength<n.mediaLength)return{option:e,signature:t,plan:{notMerge:!0}};if(XT(n.scalars,t.scalars).length>0)return{option:e,signature:t,plan:{notMerge:!0}};const i=new Set,r=new Map,o=XT(n.objects,t.objects);for(let u=0;u<o.length;u++)r.set(o[u],null);for(const u of Object.keys(n.arrays)){const c=n.arrays[u];if(!c)continue;const h=t.arrays[u];if(!h){(c.idsSorted.length>0||c.noIdCount>0)&&(r.set(u,[]),i.add(u));continue}if(x3(c.idsSorted,h.idsSorted)){i.add(u);continue}h.noIdCount<c.noIdCount&&i.add(u)}let a=e,s=t;if(r.size>0){const u={...e};r.forEach((c,h)=>{u[h]=c}),a=u,s=ZT(a)}const l=i.size>0?Array.from(i).sort():void 0;return{option:a,signature:s,plan:l?{notMerge:!1,replaceMerge:l}:{notMerge:!1}}}var KT=`x-vue-echarts{display:block;width:100%;height:100%;min-width:0;}
|
|
42
|
+
x-vue-echarts>:first-child,x-vue-echarts>:first-child>canvas{border-radius:inherit;}
|
|
43
|
+
`;if(typeof document<"u")if(Array.isArray(document.adoptedStyleSheets)&&"replaceSync"in CSSStyleSheet.prototype){const n=new CSSStyleSheet;n.replaceSync(KT),document.adoptedStyleSheets=[...document.adoptedStyleSheets,n]}else{const n=document.createElement("style");n.textContent=KT,document.head.appendChild(n)}const w3=v3(),QT=Symbol(),S3=Symbol(),T3=Symbol();var M3=x.defineComponent({name:"Echarts",inheritAttrs:!1,props:{option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean,...s3,...c3},emits:{},slots:Object,setup(n,{attrs:e,expose:t,slots:i}){const r=x.shallowRef(),o=x.shallowRef(),a=x.inject(QT,null),s=x.inject(S3,null),l=x.inject(T3,null),{autoresize:u,manualUpdate:c,loading:h,loadingOptions:d}=x.toRefs(n),f=x.computed(()=>n.theme||x.toValue(a)),p=x.computed(()=>n.initOptions||x.toValue(s)||void 0),g=x.computed(()=>n.updateOptions||x.toValue(l)),m=x.computed(()=>d3(e)),y={},v=new Map,{teleportedSlots:_,patchOption:b}=y3(i,()=>{!c.value&&n.option&&o.value&&S(o.value,n.option)});let T;function w(k){const D={},A=((k==null?void 0:k.replaceMerge)??[]).filter(R=>R!=null);return A.length>0&&(D.replaceMerge=[...new Set(A)]),(k==null?void 0:k.notMerge)!==void 0&&(D.notMerge=k.notMerge),D}function S(k,D,A,R=!1){const L=b(D);if(R){k.setOption(L,A??{}),T=void 0;return}if(g.value){const H=A??g.value;k.setOption(L,H),T=void 0;return}const V=b3(T,L),z=w(V.plan);k.setOption(V.option,z),T=V.signature}Object.keys(e).filter(k=>qT(k)).forEach(k=>{if(k.indexOf("Native:")===2){const L=`on${k.charAt(9).toUpperCase()}${k.slice(10)}`;y[L]=e[k];return}let D=k.charAt(2).toLowerCase()+k.slice(3),A;D.indexOf("zr:")===0&&(A=!0,D=D.substring(3));let R;D.substring(D.length-4)==="Once"&&(R=!0,D=D.substring(0,D.length-4)),v.set({event:D,zr:A,once:R},e[k])});function M(){if(!r.value)return;const k=o.value=zV(r.value,f.value,p.value);n.group&&(k.group=n.group),v.forEach((R,{zr:L,once:V,event:z})=>{if(!R)return;const H=L?k.getZr():k;if(V){const F=R;let j=!1;R=(...Y)=>{j||(j=!0,F(...Y),H.off(z,R))}}H.on(z,R)});function D(){k&&!k.isDisposed()&&k.resize()}function A(){const{option:R}=n;if(c.value){R&&S(k,R,void 0,!0);return}R&&S(k,R)}u.value?x.nextTick(()=>{D(),A()}):A()}const C=(k,D,A)=>{if(!n.manualUpdate){Em("`setOption` is only available when `manual-update` is `true`.");return}const R=typeof D=="boolean"?{notMerge:D,lazyUpdate:A}:D;o.value&&S(o.value,k,R??void 0,!0)};function I(){o.value&&(o.value.dispose(),o.value=void 0),T=void 0}x.watch(()=>n.option,k=>{if(!k){T=void 0;return}if(c.value){Em("`option` prop changes are ignored when `manual-update` is `true`.");return}o.value&&S(o.value,k)},{deep:!0}),x.watch([c,p],()=>{I(),M()},{deep:!0}),x.watch(f,k=>{var D;(D=o.value)==null||D.setTheme(k||{})},{deep:!0}),x.watchEffect(()=>{n.group&&o.value&&(o.value.group=n.group)});const E=o3(o);return u3(o,h,d),a3(o,u,r),x.onMounted(()=>{M()}),x.onBeforeUnmount(()=>{w3&&r.value?r.value.__dispose=I:I()}),t({setOption:C,root:r,chart:o,...E}),()=>x.h(Am,{...m.value,...y,ref:r,class:["echarts",m.value.class]},_())}}),C3=M3,Om=Math.sin,Rm=Math.cos,JT=Math.PI,lo=Math.PI*2,k3=180/JT,eM=function(){function n(){}return n.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},n.prototype.moveTo=function(e,t){this._add("M",e,t)},n.prototype.lineTo=function(e,t){this._add("L",e,t)},n.prototype.bezierCurveTo=function(e,t,i,r,o,a){this._add("C",e,t,i,r,o,a)},n.prototype.quadraticCurveTo=function(e,t,i,r){this._add("Q",e,t,i,r)},n.prototype.arc=function(e,t,i,r,o,a){this.ellipse(e,t,i,i,0,r,o,a)},n.prototype.ellipse=function(e,t,i,r,o,a,s,l){var u=s-a,c=!l,h=Math.abs(u),d=zi(h-lo)||(c?u>=lo:-u>=lo),f=u>0?u%lo:u%lo+lo,p=!1;d?p=!0:zi(h)?p=!1:p=f>=JT==!!c;var g=e+i*Rm(a),m=t+r*Om(a);this._start&&this._add("M",g,m);var y=Math.round(o*k3);if(d){var v=1/this._p,_=(c?1:-1)*(lo-v);this._add("A",i,r,y,1,+c,e+i*Rm(a+_),t+r*Om(a+_)),v>.01&&this._add("A",i,r,y,0,+c,g,m)}else{var b=e+i*Rm(s),T=t+r*Om(s);this._add("A",i,r,y,+p,+c,b,T)}},n.prototype.rect=function(e,t,i,r){this._add("M",e,t),this._add("l",i,0),this._add("l",0,r),this._add("l",-i,0),this._add("Z")},n.prototype.closePath=function(){this._d.length>0&&this._add("Z")},n.prototype._add=function(e,t,i,r,o,a,s,l,u){for(var c=[],h=this._p,d=1;d<arguments.length;d++){var f=arguments[d];if(isNaN(f)){this._invalid=!0;return}c.push(Math.round(f*h)/h)}this._d.push(e+c.join(" ")),this._start=e==="Z"},n.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},n.prototype.getStr=function(){return this._str},n}(),Lm="none",D3=Math.round;function I3(n){var e=n.fill;return e!=null&&e!==Lm}function E3(n){var e=n.stroke;return e!=null&&e!==Lm}var Pm=["lineCap","miterLimit","lineJoin"],N3=$(Pm,function(n){return"stroke-"+n.toLowerCase()});function A3(n,e,t,i){var r=e.opacity==null?1:e.opacity;if(t instanceof Hn){n("opacity",r);return}if(I3(e)){var o=es(e.fill);n("fill",o.color);var a=e.fillOpacity!=null?e.fillOpacity*o.opacity*r:o.opacity*r;a<1&&n("fill-opacity",a)}else n("fill",Lm);if(E3(e)){var s=es(e.stroke);n("stroke",s.color);var l=e.strokeNoScale?t.getLineScale():1,u=l?(e.lineWidth||0)/l:0,c=e.strokeOpacity!=null?e.strokeOpacity*s.opacity*r:s.opacity*r,h=e.strokeFirst;if(u!==1&&n("stroke-width",u),h&&n("paint-order",h?"stroke":"fill"),c<1&&n("stroke-opacity",c),e.lineDash){var d=Tg(t),f=d[0],p=d[1];f&&(p=D3(p||0),n("stroke-dasharray",f.join(",")),(p||i)&&n("stroke-dashoffset",p))}for(var g=0;g<Pm.length;g++){var m=Pm[g];if(e[m]!==_u[m]){var y=e[m]||_u[m];y&&n(N3[g],y)}}}}var tM="http://www.w3.org/2000/svg",nM="http://www.w3.org/1999/xlink",O3="http://www.w3.org/2000/xmlns/",R3="http://www.w3.org/XML/1998/namespace",iM="ecmeta_";function rM(n){return document.createElementNS(tM,n)}function ot(n,e,t,i,r){return{tag:n,attrs:t||{},children:i,text:r,key:e}}function L3(n,e){var t=[];if(e)for(var i in e){var r=e[i],o=i;r!==!1&&(r!==!0&&r!=null&&(o+='="'+r+'"'),t.push(o))}return"<"+n+" "+t.join(" ")+">"}function P3(n){return"</"+n+">"}function zm(n,e){e=e||{};var t=e.newline?`
|
|
44
|
+
`:"";function i(r){var o=r.children,a=r.tag,s=r.attrs,l=r.text;return L3(a,s)+(a!=="style"?Dt(l):l||"")+(o?""+t+$(o,function(u){return i(u)}).join(t)+t:"")+P3(a)}return i(n)}function z3(n,e,t){t=t||{};var i=t.newline?`
|
|
45
|
+
`:"",r=" {"+i,o=i+"}",a=$(Ce(n),function(l){return l+r+$(Ce(n[l]),function(u){return u+":"+n[l][u]+";"}).join(i)+o}).join(i),s=$(Ce(e),function(l){return"@keyframes "+l+r+$(Ce(e[l]),function(u){return u+r+$(Ce(e[l][u]),function(c){var h=e[l][u][c];return c==="d"&&(h='path("'+h+'")'),c+":"+h+";"}).join(i)+o}).join(i)+o}).join(i);return!a&&!s?"":["<![CDATA[",a,s,"]]>"].join(i)}function Bm(n){return{zrId:n,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function oM(n,e,t,i){return ot("svg","root",{width:n,height:e,xmlns:tM,"xmlns:xlink":nM,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+n+" "+e:!1},t)}var B3=0;function aM(){return B3++}var sM={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},uo="transform-origin";function V3(n,e,t){var i=U({},n.shape);U(i,e),n.buildPath(t,i);var r=new eM;return r.reset(B0(n)),t.rebuildPath(r,1),r.generateStr(),r.getStr()}function H3(n,e){var t=e.originX,i=e.originY;(t||i)&&(n[uo]=t+"px "+i+"px")}var F3={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function lM(n,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=n,t}function G3(n,e,t){var i=n.shape.paths,r={},o,a;if(N(i,function(l){var u=Bm(t.zrId);u.animation=!0,th(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,d=Ce(c),f=d.length;if(f){a=d[f-1];var p=c[a];for(var g in p){var m=p[g];r[g]=r[g]||{d:""},r[g].d+=m.d||""}for(var y in h){var v=h[y].animation;v.indexOf(a)>=0&&(o=v)}}}),!!o){e.d=!1;var s=lM(r,t);return o.replace(a,s)}}function uM(n){return Q(n)?sM[n]?"cubic-bezier("+sM[n]+")":Ad(n)?n:"":""}function th(n,e,t,i){var r=n.animators,o=r.length,a=[];if(n instanceof sx){var s=G3(n,e,t);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u<o;u++){var c=r[u],h=[c.getMaxTime()/1e3+"s"],d=uM(c.getClip().easing),f=c.getDelay();d?h.push(d):h.push("linear"),f&&h.push(f/1e3+"s"),c.getLoop()&&h.push("infinite");var p=h.join(" ");l[p]=l[p]||[p,[]],l[p][1].push(c)}function g(v){var _=v[1],b=_.length,T={},w={},S={},M="animation-timing-function";function C(We,He,Be){for(var oe=We.getTracks(),xe=We.getMaxTime(),ct=0;ct<oe.length;ct++){var X=oe[ct];if(X.needsAnimate()){var de=X.keyframes,ge=X.propName;if(Be&&(ge=Be(ge)),ge)for(var Fe=0;Fe<de.length;Fe++){var tt=de[Fe],je=Math.round(tt.time/xe*100)+"%",Kt=uM(tt.easing),ei=tt.rawValue;(Q(ei)||Ne(ei))&&(He[je]=He[je]||{},He[je][ge]=tt.rawValue,Kt&&(He[je][M]=Kt))}}}}for(var I=0;I<b;I++){var E=_[I],k=E.targetName;k?k==="shape"&&C(E,w):!i&&C(E,T)}for(var D in T){var A={};jl(A,n),U(A,T[D]);var R=V0(A),L=T[D][M];S[D]=R?{transform:R}:{},H3(S[D],A),L&&(S[D][M]=L)}var V,z=!0;for(var D in w){S[D]=S[D]||{};var H=!V,L=w[D][M];H&&(V=new Hi);var F=V.len();V.reset(),S[D].d=V3(n,w[D],V);var j=V.len();if(!H&&F!==j){z=!1;break}L&&(S[D][M]=L)}if(!z)for(var D in S)delete S[D].d;if(!i)for(var I=0;I<b;I++){var E=_[I],k=E.targetName;k==="style"&&C(E,S,function(oe){return F3[oe]})}for(var Y=Ce(S),ee=!0,pe,I=1;I<Y.length;I++){var Te=Y[I-1],qe=Y[I];if(S[Te][uo]!==S[qe][uo]){ee=!1;break}pe=S[Te][uo]}if(ee&&pe){for(var D in S)S[D][uo]&&delete S[D][uo];e[uo]=pe}if($e(Y,function(We){return Ce(S[We]).length>0}).length){var Je=lM(S,t);return Je+" "+v[0]+" both"}}for(var m in l){var s=g(l[m]);s&&a.push(s)}if(a.length){var y=t.zrId+"-cls-"+aM();t.cssNodes["."+y]={animation:a.join(",")},e.class=y}}function W3(n,e,t){if(!n.ignore)if(n.isSilent()){var i={"pointer-events":"none"};cM(i,e,t)}else{var r=n.states.emphasis&&n.states.emphasis.style?n.states.emphasis.style:{},o=r.fill;if(!o){var a=n.style&&n.style.fill,s=n.states.select&&n.states.select.style&&n.states.select.style.fill,l=n.currentStates.indexOf("select")>=0&&s||a;l&&(o=Vd(l))}var u=r.lineWidth;if(u){var c=!r.strokeNoScale&&n.transform?n.transform[0]:1;u=u/c}var i={cursor:"pointer"};o&&(i.fill=o),r.stroke&&(i.stroke=r.stroke),u&&(i["stroke-width"]=u),cM(i,e,t)}}function cM(n,e,t,i){var r=JSON.stringify(n),o=t.cssStyleCache[r];o||(o=t.zrId+"-cls-"+aM(),t.cssStyleCache[r]=o,t.cssNodes["."+o+":hover"]=n),e.class=e.class?e.class+" "+o:o}var cl=Math.round;function hM(n){return n&&Q(n.src)}function dM(n){return n&&ce(n.toDataURL)}function Vm(n,e,t,i){A3(function(r,o){var a=r==="fill"||r==="stroke";a&&z0(o)?vM(e,n,r,i):a&&Fd(o)?_M(t,n,r,i):n[r]=o,a&&i.ssr&&o==="none"&&(n["pointer-events"]="visible")},e,t,!1),X3(t,n,i)}function Hm(n,e){var t=lB(e);t&&(t.each(function(i,r){i!=null&&(n[(iM+r).toLowerCase()]=i+"")}),e.isSilent()&&(n[iM+"silent"]="true"))}function fM(n){return zi(n[0]-1)&&zi(n[1])&&zi(n[2])&&zi(n[3]-1)}function U3(n){return zi(n[4])&&zi(n[5])}function Fm(n,e,t){if(e&&!(U3(e)&&fM(e))){var i=1e4;n.transform=fM(e)?"translate("+cl(e[4]*i)/i+" "+cl(e[5]*i)/i+")":wN(e)}}function pM(n,e,t){for(var i=n.points,r=[],o=0;o<i.length;o++)r.push(cl(i[o][0]*t)/t),r.push(cl(i[o][1]*t)/t);e.points=r.join(" ")}function gM(n){return!n.smooth}function Y3(n){var e=$(n,function(t){return typeof t=="string"?[t,t]:t});return function(t,i,r){for(var o=0;o<e.length;o++){var a=e[o],s=t[a[0]];s!=null&&(i[a[1]]=cl(s*r)/r)}}}var q3={circle:[Y3(["cx","cy","r"])],polyline:[pM,gM],polygon:[pM,gM]};function j3(n){for(var e=n.animators,t=0;t<e.length;t++)if(e[t].targetName==="shape")return!0;return!1}function mM(n,e){var t=n.style,i=n.shape,r=q3[n.type],o={},a=e.animation,s="path",l=n.style.strokePercent,u=e.compress&&B0(n)||4;if(r&&!e.willUpdate&&!(r[1]&&!r[1](i))&&!(a&&j3(n))&&!(l<1)){s=n.type;var c=Math.pow(10,u);r[0](i,o,c)}else{var h=!n.path||n.shapeChanged();n.path||n.createPathProxy();var d=n.path;h&&(d.beginPath(),n.buildPath(d,n.shape),n.pathUpdated());var f=d.getVersion(),p=n,g=p.__svgPathBuilder;(p.__svgPathVersion!==f||!g||l!==p.__svgPathStrokePercent)&&(g||(g=p.__svgPathBuilder=new eM),g.reset(u),d.rebuildPath(g,l),g.generateStr(),p.__svgPathVersion=f,p.__svgPathStrokePercent=l),o.d=g.getStr()}return Fm(o,n.transform),Vm(o,t,n,e),Hm(o,n),e.animation&&th(n,o,e),e.emphasis&&W3(n,o,e),ot(s,n.id+"",o)}function $3(n,e){var t=n.style,i=t.image;if(i&&!Q(i)&&(hM(i)?i=i.src:dM(i)&&(i=i.toDataURL())),!!i){var r=t.x||0,o=t.y||0,a=t.width,s=t.height,l={href:i,width:a,height:s};return r&&(l.x=r),o&&(l.y=o),Fm(l,n.transform),Vm(l,t,n,e),Hm(l,n),e.animation&&th(n,l,e),ot("image",n.id+"",l)}}function Z3(n,e){var t=n.style,i=t.text;if(i!=null&&(i+=""),!(!i||isNaN(t.x)||isNaN(t.y))){var r=t.font||oi,o=t.x||0,a=TN(t.y||0,Xa(r),t.textBaseline),s=SN[t.textAlign]||t.textAlign,l={"dominant-baseline":"central","text-anchor":s};if(a_(t)){var u="",c=t.fontStyle,h=r_(t.fontSize);if(!parseFloat(h))return;var d=t.fontFamily||Uv,f=t.fontWeight;u+="font-size:"+h+";font-family:"+d+";",c&&c!=="normal"&&(u+="font-style:"+c+";"),f&&f!=="normal"&&(u+="font-weight:"+f+";"),l.style=u}else l.style="font: "+r;return i.match(/\s/)&&(l["xml:space"]="preserve"),o&&(l.x=o),a&&(l.y=a),Fm(l,n.transform),Vm(l,t,n,e),Hm(l,n),e.animation&&th(n,l,e),ot("text",n.id+"",l,void 0,i)}}function yM(n,e){if(n instanceof Ae)return mM(n,e);if(n instanceof Hn)return $3(n,e);if(n instanceof ss)return Z3(n,e)}function X3(n,e,t){var i=n.style;if(MN(i)){var r=CN(n),o=t.shadowCache,a=o[r];if(!a){var s=n.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var c=i.shadowOffsetX||0,h=i.shadowOffsetY||0,d=i.shadowBlur,f=es(i.shadowColor),p=f.opacity,g=f.color,m=d/2/l,y=d/2/u,v=m+" "+y;a=t.zrId+"-s"+t.shadowIdx++,t.defs[a]=ot("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[ot("feDropShadow","",{dx:c/l,dy:h/u,stdDeviation:v,"flood-color":g,"flood-opacity":p})]),o[r]=a}e.filter=ru(a)}}function vM(n,e,t,i){var r=n[t],o,a={gradientUnits:r.global?"userSpaceOnUse":"objectBoundingBox"};if(L0(r))o="linearGradient",a.x1=r.x,a.y1=r.y,a.x2=r.x2,a.y2=r.y2;else if(P0(r))o="radialGradient",a.cx=te(r.x,.5),a.cy=te(r.y,.5),a.r=te(r.r,.5);else{process.env.NODE_ENV!=="production"&&Nn("Illegal gradient type.");return}for(var s=r.colorStops,l=[],u=0,c=s.length;u<c;++u){var h=Hd(s[u].offset)*100+"%",d=s[u].color,f=es(d),p=f.color,g=f.opacity,m={offset:h};m["stop-color"]=p,g<1&&(m["stop-opacity"]=g),l.push(ot("stop",u+"",m))}var y=ot(o,"",a,l),v=zm(y),_=i.gradientCache,b=_[v];b||(b=i.zrId+"-g"+i.gradientIdx++,_[v]=b,a.id=b,i.defs[b]=ot(o,b,a,l)),e[t]=ru(b)}function _M(n,e,t,i){var r=n.style[t],o=n.getBoundingRect(),a={},s=r.repeat,l=s==="no-repeat",u=s==="repeat-x",c=s==="repeat-y",h;if(R0(r)){var d=r.imageWidth,f=r.imageHeight,p=void 0,g=r.image;if(Q(g)?p=g:hM(g)?p=g.src:dM(g)&&(p=g.toDataURL()),typeof Image>"u"){var m="Image width/height must been given explictly in svg-ssr renderer.";J(d,m),J(f,m)}else if(d==null||f==null){var y=function(I,E){if(I){var k=I.elm,D=d||E.width,A=f||E.height;I.tag==="pattern"&&(u?(A=1,D/=o.width):c&&(D=1,A/=o.height)),I.attrs.width=D,I.attrs.height=A,k&&(k.setAttribute("width",D),k.setAttribute("height",A))}},v=dd(p,null,n,function(I){l||y(w,I),y(h,I)});v&&v.width&&v.height&&(d=d||v.width,f=f||v.height)}h=ot("image","img",{href:p,width:d,height:f}),a.width=d,a.height=f}else r.svgElement&&(h=ue(r.svgElement),a.width=r.svgWidth,a.height=r.svgHeight);if(h){var _,b;l?_=b=1:u?(b=1,_=a.width/o.width):c?(_=1,b=a.height/o.height):a.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(a.width=_),b!=null&&!isNaN(b)&&(a.height=b);var T=V0(r);T&&(a.patternTransform=T);var w=ot("pattern","",a,[h]),S=zm(w),M=i.patternCache,C=M[S];C||(C=i.zrId+"-p"+i.patternIdx++,M[S]=C,a.id=C,w=i.defs[C]=ot("pattern",C,a,[h])),e[t]=ru(C)}}function K3(n,e,t){var i=t.clipPathCache,r=t.defs,o=i[n.id];if(!o){o=t.zrId+"-c"+t.clipPathIdx++;var a={id:o};i[n.id]=o,r[o]=ot("clipPath",o,a,[mM(n,t)])}e["clip-path"]=ru(o)}function xM(n){return document.createTextNode(n)}function co(n,e,t){n.insertBefore(e,t)}function bM(n,e){n.removeChild(e)}function wM(n,e){n.appendChild(e)}function SM(n){return n.parentNode}function TM(n){return n.nextSibling}function Gm(n,e){n.textContent=e}var MM=58,Q3=120,J3=ot("","");function Wm(n){return n===void 0}function Xn(n){return n!==void 0}function eF(n,e,t){for(var i={},r=e;r<=t;++r){var o=n[r].key;o!==void 0&&(process.env.NODE_ENV!=="production"&&i[o]!=null&&console.error("Duplicate key "+o),i[o]=r)}return i}function hl(n,e){var t=n.key===e.key,i=n.tag===e.tag;return i&&t}function dl(n){var e,t=n.children,i=n.tag;if(Xn(i)){var r=n.elm=rM(i);if(Um(J3,n),q(t))for(e=0;e<t.length;++e){var o=t[e];o!=null&&wM(r,dl(o))}else Xn(n.text)&&!ne(n.text)&&wM(r,xM(n.text))}else n.elm=xM(n.text);return n.elm}function CM(n,e,t,i,r){for(;i<=r;++i){var o=t[i];o!=null&&co(n,dl(o),e)}}function nh(n,e,t,i){for(;t<=i;++t){var r=e[t];if(r!=null)if(Xn(r.tag)){var o=SM(r.elm);bM(o,r.elm)}else bM(n,r.elm)}}function Um(n,e){var t,i=e.elm,r=n&&n.attrs||{},o=e.attrs||{};if(r!==o){for(t in o){var a=o[t],s=r[t];s!==a&&(a===!0?i.setAttribute(t,""):a===!1?i.removeAttribute(t):t==="style"?i.style.cssText=a:t.charCodeAt(0)!==Q3?i.setAttribute(t,a):t==="xmlns:xlink"||t==="xmlns"?i.setAttributeNS(O3,t,a):t.charCodeAt(3)===MM?i.setAttributeNS(R3,t,a):t.charCodeAt(5)===MM?i.setAttributeNS(nM,t,a):i.setAttribute(t,a))}for(t in r)t in o||i.removeAttribute(t)}}function tF(n,e,t){for(var i=0,r=0,o=e.length-1,a=e[0],s=e[o],l=t.length-1,u=t[0],c=t[l],h,d,f,p;i<=o&&r<=l;)a==null?a=e[++i]:s==null?s=e[--o]:u==null?u=t[++r]:c==null?c=t[--l]:hl(a,u)?(ya(a,u),a=e[++i],u=t[++r]):hl(s,c)?(ya(s,c),s=e[--o],c=t[--l]):hl(a,c)?(ya(a,c),co(n,a.elm,TM(s.elm)),a=e[++i],c=t[--l]):hl(s,u)?(ya(s,u),co(n,s.elm,a.elm),s=e[--o],u=t[++r]):(Wm(h)&&(h=eF(e,i,o)),d=h[u.key],Wm(d)?co(n,dl(u),a.elm):(f=e[d],f.tag!==u.tag?co(n,dl(u),a.elm):(ya(f,u),e[d]=void 0,co(n,f.elm,a.elm))),u=t[++r]);(i<=o||r<=l)&&(i>o?(p=t[l+1]==null?null:t[l+1].elm,CM(n,p,t,r,l)):nh(n,e,i,o))}function ya(n,e){var t=e.elm=n.elm,i=n.children,r=e.children;n!==e&&(Um(n,e),Wm(e.text)?Xn(i)&&Xn(r)?i!==r&&tF(t,i,r):Xn(r)?(Xn(n.text)&&Gm(t,""),CM(t,null,r,0,r.length-1)):Xn(i)?nh(t,i,0,i.length-1):Xn(n.text)&&Gm(t,""):n.text!==e.text&&(Xn(i)&&nh(t,i,0,i.length-1),Gm(t,e.text)))}function nF(n,e){if(hl(n,e))ya(n,e);else{var t=n.elm,i=SM(t);dl(e),i!==null&&(co(i,e.elm,TM(t)),nh(i,[n],0,0))}return e}var iF=0,rF=function(){function n(e,t,i){if(this.type="svg",this.refreshHover=kM("refreshHover"),this.configLayer=kM("configLayer"),this.storage=t,this._opts=i=U({},i),this.root=e,this._id="zr"+iF++,this._oldVNode=oM(i.width,i.height),e&&!i.ssr){var r=this._viewport=document.createElement("div");r.style.cssText="position:relative;overflow:hidden";var o=this._svgDom=this._oldVNode.elm=rM("svg");Um(null,this._oldVNode),r.appendChild(o),e.appendChild(r)}this.resize(i.width,i.height)}return n.prototype.getType=function(){return this.type},n.prototype.getViewportRoot=function(){return this._viewport},n.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},n.prototype.getSvgDom=function(){return this._svgDom},n.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",nF(this._oldVNode,e),this._oldVNode=e}},n.prototype.renderOneToVNode=function(e){return yM(e,Bm(this._id))},n.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),i=this._width,r=this._height,o=Bm(this._id);o.animation=e.animation,o.willUpdate=e.willUpdate,o.compress=e.compress,o.emphasis=e.emphasis,o.ssr=this._opts.ssr;var a=[],s=this._bgVNode=oF(i,r,this._backgroundColor,o);s&&a.push(s);var l=e.compress?null:this._mainVNode=ot("g","main",{},[]);this._paintList(t,o,l?l.children:a),l&&a.push(l);var u=$(Ce(o.defs),function(d){return o.defs[d]});if(u.length&&a.push(ot("defs","defs",{},u)),e.animation){var c=z3(o.cssNodes,o.cssAnims,{newline:!0});if(c){var h=ot("style","stl",{},[],c);a.push(h)}}return oM(i,r,a,e.useViewBox)},n.prototype.renderToString=function(e){return e=e||{},zm(this.renderToVNode({animation:te(e.cssAnimation,!0),emphasis:te(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:te(e.useViewBox,!0)}),{newline:!0})},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e},n.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},n.prototype._paintList=function(e,t,i){for(var r=e.length,o=[],a=0,s,l,u=0,c=0;c<r;c++){var h=e[c];if(!h.invisible){var d=h.__clipPaths,f=d&&d.length||0,p=l&&l.length||0,g=void 0;for(g=Math.max(f-1,p-1);g>=0&&!(d&&l&&d[g]===l[g]);g--);for(var m=p-1;m>g;m--)a--,s=o[a-1];for(var y=g+1;y<f;y++){var v={};K3(d[y],v,t);var _=ot("g","clip-g-"+u++,v,[]);(s?s.children:i).push(_),o[a++]=_,s=_}l=d;var b=yM(h,t);b&&(s?s.children:i).push(b)}}},n.prototype.resize=function(e,t){var i=this._opts,r=this.root,o=this._viewport;if(e!=null&&(i.width=e),t!=null&&(i.height=t),r&&o&&(o.style.display="none",e=la(r,0,i),t=la(r,1,i),o.style.display=""),this._width!==e||this._height!==t){if(this._width=e,this._height=t,o){var a=o.style;a.width=e+"px",a.height=t+"px"}if(Fd(this._backgroundColor))this.refresh();else{var s=this._svgDom;s&&(s.setAttribute("width",e),s.setAttribute("height",t));var l=this._bgVNode&&this._bgVNode.elm;l&&(l.setAttribute("width",e),l.setAttribute("height",t))}}},n.prototype.getWidth=function(){return this._width},n.prototype.getHeight=function(){return this._height},n.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},n.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},n.prototype.toDataURL=function(e){var t=this.renderToString(),i="data:image/svg+xml;";return e?(t=DN(t),t&&i+"base64,"+t):i+"charset=UTF-8,"+encodeURIComponent(t)},n}();function kM(n){return function(){process.env.NODE_ENV!=="production"&&Nn('In SVG mode painter not support method "'+n+'"')}}function oF(n,e,t,i){var r;if(t&&t!=="none")if(r=ot("rect","bg",{width:n,height:e,x:"0",y:"0"}),z0(t))vM({fill:t},r.attrs,"fill",i);else if(Fd(t))_M({style:{fill:t},dirty:nt,getBoundingRect:function(){return{width:n,height:e}}},r.attrs,"fill",i);else{var o=es(t),a=o.color,s=o.opacity;r.attrs.fill=a,s<1&&(r.attrs["fill-opacity"]=s)}return r}function aF(n){n.registerPainter("svg",rF)}function DM(n,e,t){var i=ai.createCanvas(),r=e.getWidth(),o=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=r+"px",a.height=o+"px",i.setAttribute("data-zr-dom-id",n)),i.width=r*t,i.height=o*t,i}var Ym=function(n){W(e,n);function e(t,i,r){var o=n.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null;var a;r=r||hu,typeof t=="string"?a=DM(t,i,r):ne(t)&&(a=t,t=a.id),o.id=t,o.dom=a;var s=a.style;return s&&(Qv(a),a.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),o.painter=i,o.dpr=r,o}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 t=this.dpr;this.domBack=DM("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),t!==1&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,i,r,o){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var a=[],s=this.maxRepaintRectCount,l=!1,u=new ve(0,0,0,0);function c(v){if(!(!v.isFinite()||v.isZero()))if(a.length===0){var _=new ve(0,0,0,0);_.copy(v),a.push(_)}else{for(var b=!1,T=1/0,w=0,S=0;S<a.length;++S){var M=a[S];if(M.intersect(v)){var C=new ve(0,0,0,0);C.copy(M),C.union(v),a[S]=C,b=!0;break}else if(l){u.copy(v),u.union(M);var I=v.width*v.height,E=M.width*M.height,k=u.width*u.height,D=k-I-E;D<T&&(T=D,w=S)}}if(l&&(a[w].union(v),b=!0),!b){var _=new ve(0,0,0,0);_.copy(v),a.push(_)}l||(l=a.length>=s)}}for(var h=this.__startIndex;h<this.__endIndex;++h){var d=t[h];if(d){var f=d.shouldBePainted(r,o,!0,!0),p=d.__isRendered&&(d.__dirty&Yt||!f)?d.getPrevPaintRect():null;p&&c(p);var g=f&&(d.__dirty&Yt||!d.__isRendered)?d.getPaintRect():null;g&&c(g)}}for(var h=this.__prevStartIndex;h<this.__prevEndIndex;++h){var d=i[h],f=d&&d.shouldBePainted(r,o,!0,!0);if(d&&(!f||!d.__zr)&&d.__isRendered){var p=d.getPrevPaintRect();p&&c(p)}}var m;do{m=!1;for(var h=0;h<a.length;){if(a[h].isZero()){a.splice(h,1);continue}for(var y=h+1;y<a.length;)a[h].intersect(a[y])?(m=!0,a[h].union(a[y]),a.splice(y,1)):y++;h++}}while(m);return this._paintRects=a,a},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(t,i){var r=this.dpr,o=this.dom,a=o.style,s=this.domBack;a&&(a.width=t+"px",a.height=i+"px"),o.width=t*r,o.height=i*r,s&&(s.width=t*r,s.height=i*r,r!==1&&this.ctxBack.scale(r,r))},e.prototype.clear=function(t,i,r){var o=this.dom,a=this.ctx,s=o.width,l=o.height;i=i||this.clearColor;var u=this.motionBlur&&!t,c=this.lastFrameAlpha,h=this.dpr,d=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(o,0,0,s/h,l/h));var f=this.domBack;function p(g,m,y,v){if(a.clearRect(g,m,y,v),i&&i!=="transparent"){var _=void 0;if(Hl(i)){var b=i.global||i.__width===y&&i.__height===v;_=b&&i.__canvasGradient||Sg(a,i,{x:0,y:0,width:y,height:v}),i.__canvasGradient=_,i.__width=y,i.__height=v}else M2(i)&&(i.scaleX=i.scaleX||h,i.scaleY=i.scaleY||h,_=Mg(a,i,{dirty:function(){d.setUnpainted(),d.painter.refresh()}}));a.save(),a.fillStyle=_||i,a.fillRect(g,m,y,v),a.restore()}u&&(a.save(),a.globalAlpha=c,a.drawImage(f,g,m,y,v),a.restore())}!r||u?p(0,0,s,l):r.length&&N(r,function(g){p(g.x*h,g.y*h,g.width*h,g.height*h)})},e}(bn),IM=1e5,ho=314159,ih=.01,sF=.001;function lF(n){return n?n.__builtin__?!0:!(typeof n.resize!="function"||typeof n.refresh!="function"):!1}function uF(n,e){var t=document.createElement("div");return t.style.cssText=["position:relative","width:"+n+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",t}var cF=function(){function n(e,t,i,r){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var o=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=i=U({},i||{}),this.dpr=i.devicePixelRatio||hu,this._singleCanvas=o,this.root=e;var a=e.style;a&&(Qv(e),e.innerHTML=""),this.storage=t;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(o){var u=e,c=u.width,h=u.height;i.width!=null&&(c=i.width),i.height!=null&&(h=i.height),this.dpr=i.devicePixelRatio||1,u.width=c*this.dpr,u.height=h*this.dpr,this._width=c,this._height=h;var d=new Ym(u,this,this.dpr);d.__builtin__=!0,d.initContext(),l[ho]=d,d.zlevel=ho,s.push(ho),this._domRoot=e}else{this._width=la(e,0,i),this._height=la(e,1,i);var f=this._domRoot=uF(this._width,this._height);e.appendChild(f)}}return n.prototype.getType=function(){return"canvas"},n.prototype.isSingleCanvas=function(){return this._singleCanvas},n.prototype.getViewportRoot=function(){return this._domRoot},n.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},n.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),i=this._prevDisplayList,r=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,i,e,this._redrawId);for(var o=0;o<r.length;o++){var a=r[o],s=this._layers[a];if(!s.__builtin__&&s.refresh){var l=o===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},n.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},n.prototype._paintHoverList=function(e){var t=e.length,i=this._hoverlayer;if(i&&i.clear(),!!t){for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height},o,a=0;a<t;a++){var s=e[a];s.__inHover&&(i||(i=this._hoverlayer=this.getLayer(IM)),o||(o=i.ctx,o.save()),no(o,s,r,a===t-1))}o&&o.restore()}},n.prototype.getHoverLayer=function(){return this.getLayer(IM)},n.prototype.paintOne=function(e,t){Uw(e,t)},n.prototype._paintList=function(e,t,i,r){if(this._redrawId===r){i=i||!1,this._updateLayerStatus(e);var o=this._doPaintList(e,t,i),a=o.finished,s=o.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),a)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;Sc(function(){l._paintList(e,t,i,r)})}}},n.prototype._compositeManually=function(){var e=this.getLayer(ho).ctx,t=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,t,i),this.eachBuiltinLayer(function(r){r.virtual&&e.drawImage(r.dom,0,0,t,i)})},n.prototype._doPaintList=function(e,t,i){for(var r=this,o=[],a=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||i)&&o.push(u)}for(var c=!0,h=!1,d=function(g){var m=o[g],y=m.ctx,v=a&&m.createRepaintRects(e,t,f._width,f._height),_=i?m.__startIndex:m.__drawIndex,b=!i&&m.incremental&&Date.now,T=b&&Date.now(),w=m.zlevel===f._zlevelList[0]?f._backgroundColor:null;if(m.__startIndex===m.__endIndex)m.clear(!1,w,v);else if(_===m.__startIndex){var S=e[_];(!S.incremental||!S.notClear||i)&&m.clear(!1,w,v)}_===-1&&(console.error("For some unknown reason. drawIndex is -1"),_=m.__startIndex);var M,C=function(D){var A={inHover:!1,allClipped:!1,prevEl:null,viewWidth:r._width,viewHeight:r._height};for(M=_;M<m.__endIndex;M++){var R=e[M];if(R.__inHover&&(h=!0),r._doPaintEl(R,m,a,D,A,M===m.__endIndex-1),b){var L=Date.now()-T;if(L>15)break}}A.prevElClipPaths&&y.restore()};if(v)if(v.length===0)M=m.__endIndex;else for(var I=f.dpr,E=0;E<v.length;++E){var k=v[E];y.save(),y.beginPath(),y.rect(k.x*I,k.y*I,k.width*I,k.height*I),y.clip(),C(k),y.restore()}else y.save(),C(),y.restore();m.__drawIndex=M,m.__drawIndex<m.__endIndex&&(c=!1)},f=this,p=0;p<o.length;p++)d(p);return fe.wxa&&N(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:c,needsRefreshHover:h}},n.prototype._doPaintEl=function(e,t,i,r,o,a){var s=t.ctx;if(i){var l=e.getPaintRect();(!r||l&&l.intersect(r))&&(no(s,e,o,a),e.setPrevPaintRect(l))}else no(s,e,o,a)},n.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=ho);var i=this._layers[e];return i||(i=new Ym("zr_"+e,this,this.dpr),i.zlevel=e,i.__builtin__=!0,this._layerConfig[e]?_e(i,this._layerConfig[e],!0):this._layerConfig[e-ih]&&_e(i,this._layerConfig[e-ih],!0),t&&(i.virtual=t),this.insertLayer(e,i),i.initContext()),i},n.prototype.insertLayer=function(e,t){var i=this._layers,r=this._zlevelList,o=r.length,a=this._domRoot,s=null,l=-1;if(i[e]){process.env.NODE_ENV!=="production"&&Nn("ZLevel "+e+" has been used already");return}if(!lF(t)){process.env.NODE_ENV!=="production"&&Nn("Layer of zlevel "+e+" is not valid");return}if(o>0&&e>r[0]){for(l=0;l<o-1&&!(r[l]<e&&r[l+1]>e);l++);s=i[r[l]]}if(r.splice(l+1,0,e),i[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?a.insertBefore(t.dom,u.nextSibling):a.appendChild(t.dom)}else a.firstChild?a.insertBefore(t.dom,a.firstChild):a.appendChild(t.dom);t.painter||(t.painter=this)},n.prototype.eachLayer=function(e,t){for(var i=this._zlevelList,r=0;r<i.length;r++){var o=i[r];e.call(t,this._layers[o],o)}},n.prototype.eachBuiltinLayer=function(e,t){for(var i=this._zlevelList,r=0;r<i.length;r++){var o=i[r],a=this._layers[o];a.__builtin__&&e.call(t,a,o)}},n.prototype.eachOtherLayer=function(e,t){for(var i=this._zlevelList,r=0;r<i.length;r++){var o=i[r],a=this._layers[o];a.__builtin__||e.call(t,a,o)}},n.prototype.getLayers=function(){return this._layers},n.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(h,d){h.__dirty=h.__used=!1});function t(h){o&&(o.__endIndex!==h&&(o.__dirty=!0),o.__endIndex=h)}if(this._singleCanvas)for(var i=1;i<e.length;i++){var r=e[i];if(r.zlevel!==e[i-1].zlevel||r.incremental){this._needsManuallyCompositing=!0;break}}var o=null,a=0,s,l;for(l=0;l<e.length;l++){var r=e[l],u=r.zlevel,c=void 0;s!==u&&(s=u,a=0),r.incremental?(c=this.getLayer(u+sF,this._needsManuallyCompositing),c.incremental=!0,a=1):c=this.getLayer(u+(a>0?ih:0),this._needsManuallyCompositing),c.__builtin__||Nn("ZLevel "+u+" has been used by unkown layer "+c.id),c!==o&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,t(l),o=c),r.__dirty&Yt&&!r.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(h,d){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},n.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},n.prototype._clearLayer=function(e){e.clear()},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e,N(this._layers,function(t){t.setUnpainted()})},n.prototype.configLayer=function(e,t){if(t){var i=this._layerConfig;i[e]?_e(i[e],t,!0):i[e]=t;for(var r=0;r<this._zlevelList.length;r++){var o=this._zlevelList[r];if(o===e||o===e+ih){var a=this._layers[o];_e(a,i[e],!0)}}}},n.prototype.delLayer=function(e){var t=this._layers,i=this._zlevelList,r=t[e];r&&(r.dom.parentNode.removeChild(r.dom),delete t[e],i.splice(be(i,e),1))},n.prototype.resize=function(e,t){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var r=this._opts,o=this.root;if(e!=null&&(r.width=e),t!=null&&(r.height=t),e=la(o,0,r),t=la(o,1,r),i.style.display="",this._width!==e||t!==this._height){i.style.width=e+"px",i.style.height=t+"px";for(var a in this._layers)this._layers.hasOwnProperty(a)&&this._layers[a].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this.getLayer(ho).resize(e,t)}return this},n.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},n.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},n.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[ho].dom;var t=new Ym("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var i=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,o=t.dom.height;this.eachLayer(function(h){h.__builtin__?i.drawImage(h.dom,0,0,r,o):h.renderToCanvas&&(i.save(),h.renderToCanvas(i),i.restore())})}else for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var c=s[l];no(i,c,a,l===u-1)}return t.dom},n.prototype.getWidth=function(){return this._width},n.prototype.getHeight=function(){return this._height},n}();function hF(n){n.registerPainter("canvas",cF)}var fo=Re(),EM=ue,qm=ke,dF=function(){function n(){this._dragging=!1,this.animationThreshold=15}return n.prototype.render=function(e,t,i,r){var o=t.get("value"),a=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,!(!r&&this._lastValue===o&&this._lastStatus===a)){this._lastValue=o,this._lastStatus=a;var s=this._group,l=this._handle;if(!a||a==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,o,e,t,i);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=c;var h=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new Ye,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),i.getZr().add(s);else{var d=we(NM,t,h);this.updatePointerEl(s,u,d),this.updateLabelEl(s,u,d,t)}RM(s,t,!0),this._renderHandle(o)}},n.prototype.remove=function(e){this.clear(e)},n.prototype.dispose=function(e){this.clear(e)},n.prototype.determineAnimation=function(e,t){var i=t.get("animation"),r=e.axis,o=r.type==="category",a=t.get("snap");if(!a&&!o)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(o&&r.getBandWidth()>s)return!0;if(a){var l=am(e).seriesDataCount,u=r.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},n.prototype.makeElOption=function(e,t,i,r,o){},n.prototype.createPointerEl=function(e,t,i,r){var o=t.pointer;if(o){var a=fo(e).pointerEl=new qO[o.type](EM(t.pointer));e.add(a)}},n.prototype.createLabelEl=function(e,t,i,r){if(t.label){var o=fo(e).labelEl=new it(EM(t.label));e.add(o),OM(o,r)}},n.prototype.updatePointerEl=function(e,t,i){var r=fo(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),i(r,{shape:t.pointer.shape}))},n.prototype.updateLabelEl=function(e,t,i,r){var o=fo(e).labelEl;o&&(o.setStyle(t.label.style),i(o,{x:t.label.x,y:t.label.y}),OM(o,r))},n.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=t.getModel("handle"),a=t.get("status");if(!o.get("show")||!a||a==="hide"){r&&i.remove(r),this._handle=null;return}var s;this._handle||(s=!0,r=this._handle=Wu(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Gb(u.event)},onmousedown:qm(this._onHandleDragMove,this,0,0),drift:qm(this._onHandleDragMove,this),ondragend:qm(this._onHandleDragEnd,this)}),i.add(r)),RM(r,t,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=o.get("size");q(l)||(l=[l,l]),r.scaleX=l[0]/2,r.scaleY=l[1]/2,qp(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},n.prototype._moveHandleToValue=function(e,t){NM(this._axisPointerModel,!t&&this._moveAnimation,this._handle,jm(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},n.prototype._onHandleDragMove=function(e,t){var i=this._handle;if(i){this._dragging=!0;var r=this.updateHandleTransform(jm(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,i.stopAnimation(),i.attr(jm(r)),fo(i).lastProp=null,this._doDispatchAxisPointer()}},n.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},n.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},n.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,r=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),jp(this,"_doDispatchAxisPointer")},n.prototype.doClear=function(){},n.prototype.buildLabel=function(e,t,i){return i=i||0,{x:e[i],y:e[1-i],width:t[i],height:t[1-i]}},n}();function NM(n,e,t,i){AM(fo(t).lastProp,i)||(fo(t).lastProp=i,e?ft(t,i,n):(t.stopAnimation(),t.attr(i)))}function AM(n,e){if(ne(n)&&ne(e)){var t=!0;return N(e,function(i,r){t=t&&AM(n[r],i)}),!!t}else return n===e}function OM(n,e){n[e.get(["label","show"])?"show":"hide"]()}function jm(n){return{x:n.x||0,y:n.y||0,rotation:n.rotation||0}}function RM(n,e,t){var i=e.get("z"),r=e.get("zlevel");n&&n.traverse(function(o){o.type!=="group"&&(i!=null&&(o.z=i),r!=null&&(o.zlevel=r),o.silent=t)})}function fF(n){var e=n.get("type"),t=n.getModel(e+"Style"),i;return e==="line"?(i=t.getLineStyle(),i.fill=null):e==="shadow"&&(i=t.getAreaStyle(),i.stroke=null),i}function pF(n,e,t,i,r){var o=t.get("value"),a=LM(o,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=lc(s.get("padding")||0),u=s.getFont(),c=_d(a,u),h=r.position,d=c.width+l[1]+l[3],f=c.height+l[0]+l[2],p=r.align;p==="right"&&(h[0]-=d),p==="center"&&(h[0]-=d/2);var g=r.verticalAlign;g==="bottom"&&(h[1]-=f),g==="middle"&&(h[1]-=f/2),gF(h,d,f,i);var m=s.get("backgroundColor");(!m||m==="auto")&&(m=e.get(["axisLine","lineStyle","color"])),n.label={x:h[0],y:h[1],style:Yi(s,{text:a,font:u,fill:s.getTextColor(),padding:l,backgroundColor:m}),z2:10}}function gF(n,e,t,i){var r=i.getWidth(),o=i.getHeight();n[0]=Math.min(n[0]+e,r)-e,n[1]=Math.min(n[1]+t,o)-t,n[0]=Math.max(n[0],0),n[1]=Math.max(n[1],0)}function LM(n,e,t,i,r){n=e.scale.parse(n);var o=e.scale.getLabel({value:n},{precision:r.precision}),a=r.formatter;if(a){var s={value:qc(e,{value:n}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};N(i,function(l){var u=t.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&s.seriesData.push(h)}),Q(a)?o=a.replace("{value}",o):ce(a)&&(o=a(s))}return o}function PM(n,e,t){var i=li();return gd(i,i,t.rotation),pd(i,i,t.position),Ff([n.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],i)}function mF(n,e,t,i,r,o){var a=ar.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=r.get(["label","margin"]),pF(e,i,r,o,{position:PM(i.axis,n,t),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function yF(n,e,t){return t=t||0,{x1:n[t],y1:n[1-t],x2:e[t],y2:e[1-t]}}function vF(n,e,t){return t=t||0,{x:n[t],y:n[1-t],width:e[t],height:e[1-t]}}var _F=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,r,o,a){var s=r.axis,l=s.grid,u=o.get("type"),c=zM(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var d=fF(o),f=xF[u](s,h,c);f.style=d,t.graphicKey=f.type,t.pointer=f}var p=Xc(l.getRect(),r);mF(i,t,p,r,o,a)},e.prototype.getHandleTransform=function(t,i,r){var o=Xc(i.axis.grid.getRect(),i,{labelInside:!1});o.labelMargin=r.get(["handle","margin"]);var a=PM(i.axis,t,o);return{x:a[0],y:a[1],rotation:o.rotation+(o.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,i,r,o){var a=r.axis,s=a.grid,l=a.getGlobalExtent(!0),u=zM(s,a).getOtherAxis(a).getGlobalExtent(),c=a.dim==="x"?0:1,h=[t.x,t.y];h[c]+=i[c],h[c]=Math.min(l[1],h[c]),h[c]=Math.max(l[0],h[c]);var d=(u[1]+u[0])/2,f=[d,d];f[c]=h[c];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:t.rotation,cursorPoint:f,tooltipOption:p[c]}},e}(dF);function zM(n,e){var t={};return t[e.dim+"AxisIndex"]=e.index,n.getCartesian(t)}var xF={line:function(n,e,t){var i=yF([e,t[0]],[e,t[1]],BM(n));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(n,e,t){var i=Math.max(1,n.getBandWidth()),r=t[1]-t[0];return{type:"Rect",shape:vF([e-i/2,t[0]],[i,r],BM(n))}}};function BM(n){return n.dim==="x"?0:1}var bF=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}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:Z.color.border,width:1,type:"dashed"},shadowStyle:{color:Z.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:Z.color.neutral00,padding:[5,7,5,7],backgroundColor:Z.color.accent60,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:Z.color.accent40,throttle:40}},e}(De),Ti=Re(),wF=N;function VM(n,e,t){if(!fe.node){var i=e.getZr();Ti(i).records||(Ti(i).records={}),SF(i,e);var r=Ti(i).records[n]||(Ti(i).records[n]={});r.handler=t}}function SF(n,e){if(Ti(n).initialized)return;Ti(n).initialized=!0,t("click",we(HM,"click")),t("mousemove",we(HM,"mousemove")),t("globalout",MF);function t(i,r){n.on(i,function(o){var a=CF(e);wF(Ti(n).records,function(s){s&&r(s,o,a.dispatchAction)}),TF(a.pendings,e)})}}function TF(n,e){var t=n.showTip.length,i=n.hideTip.length,r;t?r=n.showTip[t-1]:i&&(r=n.hideTip[i-1]),r&&(r.dispatchAction=null,e.dispatchAction(r))}function MF(n,e,t){n.handler("leave",null,t)}function HM(n,e,t,i){e.handler(n,t,i)}function CF(n){var e={showTip:[],hideTip:[]},t=function(i){var r=e[i.type];r?r.push(i):(i.dispatchAction=t,n.dispatchAction(i))};return{dispatchAction:t,pendings:e}}function $m(n,e){if(!fe.node){var t=e.getZr(),i=(Ti(t).records||{})[n];i&&(Ti(t).records[n]=null)}}var kF=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,r){var o=i.getComponent("tooltip"),a=t.get("triggerOn")||o&&o.get("triggerOn")||"mousemove|click";VM("axisPointer",r,function(s,l,u){a!=="none"&&(s==="leave"||a.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,i){$m("axisPointer",i)},e.prototype.dispose=function(t,i){$m("axisPointer",i)},e.type="axisPointer",e}(Et);function FM(n,e){var t=[],i=n.seriesIndex,r;if(i==null||!(r=e.getSeriesByIndex(i)))return{point:[]};var o=r.getData(),a=Or(o,n);if(a==null||a<0||q(a))return{point:[]};var s=o.getItemGraphicEl(a),l=r.coordinateSystem;if(r.getTooltipPosition)t=r.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(n.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),h=c.dim,d=u.dim,f=h==="x"||h==="radius"?1:0,p=o.mapDimension(d),g=[];g[f]=o.get(p,a),g[1-f]=o.get(o.getCalculationInfo("stackResultDimension"),a),t=l.dataToPoint(g)||[]}else t=l.dataToPoint(o.getValues($(l.dimensions,function(y){return o.mapDimension(y)}),a))||[];else if(s){var m=s.getBoundingRect().clone();m.applyTransform(s.transform),t=[m.x+m.width/2,m.y+m.height/2]}return{point:t,el:s}}var GM=Re();function DF(n,e,t){var i=n.currTrigger,r=[n.x,n.y],o=n,a=n.dispatchAction||ke(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){rh(r)&&(r=FM({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=rh(r),u=o.axesInfo,c=s.axesInfo,h=i==="leave"||rh(r),d={},f={},p={list:[],map:{}},g={showPointer:we(EF,f),showTooltip:we(NF,p)};N(s.coordSysMap,function(y,v){var _=l||y.containPoint(r);N(s.coordSysAxesInfo[v],function(b,T){var w=b.axis,S=LF(u,b);if(!h&&_&&(!u||S)){var M=S&&S.value;M==null&&!l&&(M=w.pointToData(r)),M!=null&&WM(b,M,g,!1,d)}})});var m={};return N(c,function(y,v){var _=y.linkGroup;_&&!f[v]&&N(_.axesInfo,function(b,T){var w=f[T];if(b!==y&&w){var S=w.value;_.mapper&&(S=y.axis.scale.parse(_.mapper(S,UM(b),UM(y)))),m[y.key]=S}})}),N(m,function(y,v){WM(c[v],y,g,!0,d)}),AF(f,c,d),OF(p,r,n,a),RF(c,a,t),d}}function WM(n,e,t,i,r){var o=n.axis;if(!(o.scale.isBlank()||!o.containData(e))){if(!n.involveSeries){t.showPointer(n,e);return}var a=IF(e,n),s=a.payloadBatch,l=a.snapToValue;s[0]&&r.seriesIndex==null&&U(r,s[0]),!i&&n.snap&&o.containData(l)&&l!=null&&(e=l),t.showPointer(n,e,s),t.showTooltip(n,a,l)}}function IF(n,e){var t=e.axis,i=t.dim,r=n,o=[],a=Number.MAX_VALUE,s=-1;return N(e.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(i),h,d;if(l.getAxisTooltipData){var f=l.getAxisTooltipData(c,n,t);d=f.dataIndices,h=f.nestestValue}else{if(d=l.indicesOfNearest(i,c[0],n,t.type==="category"?.5:null),!d.length)return;h=l.getData().get(c[0],d[0])}if(!(h==null||!isFinite(h))){var p=n-h,g=Math.abs(p);g<=a&&((g<a||p>=0&&s<0)&&(a=g,s=p,r=h,o.length=0),N(d,function(m){o.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:o,snapToValue:r}}function EF(n,e,t,i){n[e.key]={value:t,payloadBatch:i}}function NF(n,e,t,i){var r=t.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!r.length)){var l=e.coordSys.model,u=rl(l),c=n.map[u];c||(c=n.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},n.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function AF(n,e,t){var i=t.axesInfo=[];N(e,function(r,o){var a=r.axisPointerModel.option,s=n[o];s?(!r.useHandle&&(a.status="show"),a.value=s.value,a.seriesDataIndices=(s.payloadBatch||[]).slice()):!r.useHandle&&(a.status="hide"),a.status==="show"&&i.push({axisDim:r.axis.dim,axisIndex:r.axis.model.componentIndex,value:a.value})})}function OF(n,e,t,i){if(rh(e)||!n.list.length){i({type:"hideTip"});return}var r=((n.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:n.list})}function RF(n,e,t){var i=t.getZr(),r="axisPointerLastHighlights",o=GM(i)[r]||{},a=GM(i)[r]={};N(n,function(u,c){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&N(h.seriesDataIndices,function(d){var f=d.seriesIndex+" | "+d.dataIndex;a[f]=d})});var s=[],l=[];N(o,function(u,c){!a[c]&&l.push(u)}),N(a,function(u,c){!o[c]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function LF(n,e){for(var t=0;t<(n||[]).length;t++){var i=n[t];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function UM(n){var e=n.axis.model,t={},i=t.axisDim=n.axis.dim;return t.axisIndex=t[i+"AxisIndex"]=e.componentIndex,t.axisName=t[i+"AxisName"]=e.name,t.axisId=t[i+"AxisId"]=e.id,t}function rh(n){return!n||n[0]==null||isNaN(n[0])||n[1]==null||isNaN(n[1])}function YM(n){hT.registerAxisPointerClass("CartesianAxisPointer",_F),n.registerComponentModel(bF),n.registerComponentView(kF),n.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!q(t)&&(e.axisPointer.link=[t])}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=dH(e,t)}),n.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},DF)}function PF(n){bi(MH),bi(YM)}var qM=["x","y","radius","angle","single"],zF=["cartesian2d","polar","singleAxis"];function BF(n){var e=n.get("coordinateSystem");return be(zF,e)>=0}function va(n){return process.env.NODE_ENV!=="production"&&J(n),n+"Axis"}function VF(n,e){var t=me(),i=[],r=me();n.eachComponent({mainType:"dataZoom",query:e},function(c){r.get(c.uid)||s(c)});var o;do o=!1,n.eachComponent("dataZoom",a);while(o);function a(c){!r.get(c.uid)&&l(c)&&(s(c),o=!0)}function s(c){r.set(c.uid,!0),i.push(c),u(c)}function l(c){var h=!1;return c.eachTargetAxis(function(d,f){var p=t.get(d);p&&p[f]&&(h=!0)}),h}function u(c){c.eachTargetAxis(function(h,d){(t.get(h)||t.set(h,[]))[d]=!0})}return i}var Zm=function(){function n(){this.indexList=[],this.indexMap=[]}return n.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},n}(),HF=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,i,r){var o=jM(t);this.settledOption=o,this.mergeDefaultAndTheme(t,r),this._doInit(o)},e.prototype.mergeOption=function(t){var i=jM(t);_e(this.option,t,!0),_e(this.settledOption,i,!0),this._doInit(i)},e.prototype._doInit=function(t){var i=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var r=this.settledOption;N([["start","startValue"],["end","endValue"]],function(o,a){this._rangePropMode[a]==="value"&&(i[o[0]]=r[o[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),i=this._targetAxisInfoMap=me(),r=this._fillSpecifiedTargetAxis(i);r?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(o){o.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var i=!1;return N(qM,function(r){var o=this.getReferringComponents(va(r),LA);if(o.specified){i=!0;var a=new Zm;N(o.models,function(s){a.add(s.componentIndex)}),t.set(r,a)}},this),i},e.prototype._fillAutoTargetAxisByOrient=function(t,i){var r=this.ecModel,o=!0;if(o){var a=i==="vertical"?"y":"x",s=r.findComponents({mainType:a+"Axis"});l(s,a)}if(o){var s=r.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===i}});l(s,"single")}function l(u,c){var h=u[0];if(h){var d=new Zm;if(d.add(h.componentIndex),t.set(c,d),o=!1,c==="x"||c==="y"){var f=h.getReferringComponents("grid",xt).models[0];f&&N(u,function(p){h.componentIndex!==p.componentIndex&&f===p.getReferringComponents("grid",xt).models[0]&&d.add(p.componentIndex)})}}}o&&N(qM,function(u){if(o){var c=r.findComponents({mainType:va(u),filter:function(d){return d.get("type",!0)==="category"}});if(c[0]){var h=new Zm;h.add(c[0].componentIndex),t.set(u,h),o=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(i){!t&&(t=i)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var i=this._rangePropMode,r=this.get("rangeMode");N([["start","startValue"],["end","endValue"]],function(o,a){var s=t[o[0]]!=null,l=t[o[1]]!=null;s&&!l?i[a]="percent":!s&&l?i[a]="value":r?i[a]=r[a]:s&&(i[a]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(i,r){t==null&&(t=this.ecModel.getComponent(va(i),r))},this),t},e.prototype.eachTargetAxis=function(t,i){this._targetAxisInfoMap.each(function(r,o){N(r.indexList,function(a){t.call(i,o,a)})})},e.prototype.getAxisProxy=function(t,i){var r=this.getAxisModel(t,i);if(r)return r.__dzAxisProxy},e.prototype.getAxisModel=function(t,i){process.env.NODE_ENV!=="production"&&J(t&&i!=null);var r=this._targetAxisInfoMap.get(t);if(r&&r.indexMap[i])return this.ecModel.getComponent(va(t),i)},e.prototype.setRawRange=function(t){var i=this.option,r=this.settledOption;N([["start","startValue"],["end","endValue"]],function(o){(t[o[0]]!=null||t[o[1]]!=null)&&(i[o[0]]=r[o[0]]=t[o[0]],i[o[1]]=r[o[1]]=t[o[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var i=this.option;N(["start","startValue","end","endValue"],function(r){i[r]=t[r]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,i){if(t==null&&i==null){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataValueWindow()}else return this.getAxisProxy(t,i).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var i,r=this._targetAxisInfoMap.keys(),o=0;o<r.length;o++)for(var a=r[o],s=this._targetAxisInfoMap.get(a),l=0;l<s.indexList.length;l++){var u=this.getAxisProxy(a,s.indexList[l]);if(u.hostedBy(this))return u;i||(i=u)}return i},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return process.env.NODE_ENV!=="production"&&J(this._orient),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}(De);function jM(n){var e={};return N(["start","end","startValue","endValue","throttle"],function(t){n.hasOwnProperty(t)&&(e[t]=n[t])}),e}var FF=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.select",e}(HF),GF=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,r,o){this.dataZoomModel=t,this.ecModel=i,this.api=r},e.type="dataZoom",e}(Et),WF=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.select",e}(GF),_a=N,$M=pf,UF=function(){function n(e,t,i,r){this._dimName=e,this._axisIndex=t,this.ecModel=r,this._dataZoomModel=i}return n.prototype.hostedBy=function(e){return this._dataZoomModel===e},n.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},n.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},n.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(BF(t)){var i=va(this._dimName),r=t.getReferringComponents(i,xt).models[0];r&&this._axisIndex===r.componentIndex&&e.push(t)}},this),e},n.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},n.prototype.getMinMaxSpan=function(){return ue(this._minMaxSpan)},n.prototype.calculateDataWindow=function(e){var t=this._dataExtent,i=this.getAxisModel(),r=i.axis.scale,o=this._dataZoomModel.getRangePropMode(),a=[0,100],s=[],l=[],u;_a(["start","end"],function(d,f){var p=e[d],g=e[d+"Value"];o[f]==="percent"?(p==null&&(p=a[f]),g=r.parse(jt(p,a,t))):(u=!0,g=g==null?t[f]:r.parse(g),p=jt(g,t,a)),l[f]=g==null||isNaN(g)?t[f]:g,s[f]=p==null||isNaN(p)?a[f]:p}),$M(l),$M(s);var c=this._minMaxSpan;u?h(l,s,t,a,!1):h(s,l,a,t,!0);function h(d,f,p,g,m){var y=m?"Span":"ValueSpan";CT(0,d,p,"all",c["min"+y],c["max"+y]);for(var v=0;v<2;v++)f[v]=jt(d[v],p,g,!0),m&&(f[v]=r.parse(f[v]))}return{valueWindow:l,percentWindow:s}},n.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=YF(this,this._dimName,t),this._updateMinMaxSpan();var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,this._setAxisModel()}},n.prototype.filterData=function(e,t){if(e!==this._dataZoomModel)return;var i=this._dimName,r=this.getTargetSeriesModels(),o=e.get("filterMode"),a=this._valueWindow;if(o==="none")return;_a(r,function(l){var u=l.getData(),c=u.mapDimensionsAll(i);if(c.length){if(o==="weakFilter"){var h=u.getStore(),d=$(c,function(f){return u.getDimensionIndex(f)},u);u.filterSelf(function(f){for(var p,g,m,y=0;y<c.length;y++){var v=h.get(d[y],f),_=!isNaN(v),b=v<a[0],T=v>a[1];if(_&&!b&&!T)return!0;_&&(m=!0),b&&(p=!0),T&&(g=!0)}return m&&p&&g})}else _a(c,function(f){if(o==="empty")l.setData(u=u.map(f,function(g){return s(g)?g:NaN}));else{var p={};p[f]=a,u.selectRange(p)}});_a(c,function(f){u.setApproximateExtent(a,f)})}});function s(l){return l>=a[0]&&l<=a[1]}},n.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,i=this._dataExtent;_a(["min","max"],function(r){var o=t.get(r+"Span"),a=t.get(r+"ValueSpan");a!=null&&(a=this.getAxisModel().axis.scale.parse(a)),a!=null?o=jt(i[0]+a,i,[0,100],!0):o!=null&&(a=jt(o,[0,100],i,!0)-i[0]),e[r+"Span"]=o,e[r+"ValueSpan"]=a},this)},n.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,i=this._valueWindow;if(t){var r=p_(i,[0,500]);r=Math.min(r,20);var o=e.axis.scale.rawExtentInfo;t[0]!==0&&o.setDeterminedMinMax("min",+i[0].toFixed(r)),t[1]!==100&&o.setDeterminedMinMax("max",+i[1].toFixed(r)),o.freeze()}},n}();function YF(n,e,t){var i=[1/0,-1/0];_a(t,function(a){T5(i,a.getData(),e)});var r=n.getAxisModel(),o=AS(r.axis.scale,r,i).calculate();return[o.min,o.max]}var qF={getTargetSeries:function(n){function e(r){n.eachComponent("dataZoom",function(o){o.eachTargetAxis(function(a,s){var l=n.getComponent(va(a),s);r(a,s,l,o)})})}e(function(r,o,a,s){a.__dzAxisProxy=null});var t=[];e(function(r,o,a,s){a.__dzAxisProxy||(a.__dzAxisProxy=new UF(r,o,s,n),t.push(a.__dzAxisProxy))});var i=me();return N(t,function(r){N(r.getTargetSeriesModels(),function(o){i.set(o.uid,o)})}),i},overallReset:function(n,e){n.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(i,r){t.getAxisProxy(i,r).reset(t)}),t.eachTargetAxis(function(i,r){t.getAxisProxy(i,r).filterData(t,e)})}),n.eachComponent("dataZoom",function(t){var i=t.findRepresentativeAxisProxy();if(i){var r=i.getDataPercentWindow(),o=i.getDataValueWindow();t.setCalculatedRange({start:r[0],end:r[1],startValue:o[0],endValue:o[1]})}})}};function jF(n){n.registerAction("dataZoom",function(e,t){var i=VF(t,e);N(i,function(r){r.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var ZM=!1;function $F(n){ZM||(ZM=!0,n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,qF),jF(n),n.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function ZF(n){n.registerComponentModel(FF),n.registerComponentView(WF),$F(n)}var fn=function(){function n(){}return n}(),XM={};function xa(n,e){XM[n]=e}function KM(n){return XM[n]}var XF=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){n.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;N(this.option.feature,function(i,r){var o=KM(r);o&&(o.getDefaultOption&&(o.defaultOption=o.getDefaultOption(t)),_e(i,o.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:Z.color.border,borderRadius:0,borderWidth:0,padding:Z.size.m,itemSize:15,itemGap:Z.size.s,showTitle:!0,iconStyle:{borderColor:Z.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:Z.color.accent50}},tooltip:{show:!1,position:"bottom"}},e}(De);function QM(n,e){var t=lc(e.get("padding")),i=e.getItemStyle(["color","opacity"]);i.fill=e.get("backgroundColor");var r=new Ue({shape:{x:n.x-t[3],y:n.y-t[0],width:n.width+t[1]+t[3],height:n.height+t[0]+t[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1});return r}var KF=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,i,r,o){var a=this.group;if(a.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},c=this._features||(this._features={}),h=[];N(u,function(v,_){h.push(_)}),new Zf(this._featureNames||[],h).add(d).update(d).remove(we(d,null)).execute(),this._featureNames=h;function d(v,_){var b=h[v],T=h[_],w=u[b],S=new Ge(w,t,t.ecModel),M;if(o&&o.newTitle!=null&&o.featureName===b&&(w.title=o.newTitle),b&&!T){if(QF(b))M={onclick:S.option.onclick,featureName:b};else{var C=KM(b);if(!C)return;M=new C}c[b]=M}else if(M=c[T],!M)return;M.uid=Is("toolbox-feature"),M.model=S,M.ecModel=i,M.api=r;var I=M instanceof fn;if(!b&&T){I&&M.dispose&&M.dispose(i,r);return}if(!S.get("show")||I&&M.unusable){I&&M.remove&&M.remove(i,r);return}f(S,M,b),S.setIconStatus=function(E,k){var D=this.option,A=this.iconPaths;D.iconStatus=D.iconStatus||{},D.iconStatus[E]=k,A[E]&&(k==="emphasis"?Lr:Pr)(A[E])},M instanceof fn&&M.render&&M.render(S,i,r,o)}function f(v,_,b){var T=v.getModel("iconStyle"),w=v.getModel(["emphasis","iconStyle"]),S=_ instanceof fn&&_.getIcons?_.getIcons():v.get("icon"),M=v.get("title")||{},C,I;Q(S)?(C={},C[b]=S):C=S,Q(M)?(I={},I[b]=M):I=M;var E=v.iconPaths={};N(C,function(k,D){var A=Wu(k,{},{x:-s/2,y:-s/2,width:s,height:s});A.setStyle(T.getItemStyle());var R=A.ensureState("emphasis");R.style=w.getItemStyle();var L=new it({style:{text:I[D],align:w.get("textAlign"),borderRadius:w.get("textBorderRadius"),padding:w.get("textPadding"),fill:null,font:Ix({fontStyle:w.get("textFontStyle"),fontFamily:w.get("textFontFamily"),fontSize:w.get("textFontSize"),fontWeight:w.get("textFontWeight")},i)},ignore:!0});A.setTextContent(L),bs({el:A,componentModel:t,itemName:D,formatterParamsExtra:{title:I[D]}}),A.__title=I[D],A.on("mouseover",function(){var V=w.getItemStyle(),z=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";L.setStyle({fill:w.get("textFill")||V.fill||V.stroke||Z.color.neutral99,backgroundColor:w.get("textBackgroundColor")}),A.setTextConfig({position:w.get("textPosition")||z}),L.ignore=!t.get("showTitle"),r.enterEmphasis(this)}).on("mouseout",function(){v.get(["iconStatus",D])!=="emphasis"&&r.leaveEmphasis(this),L.hide()}),(v.get(["iconStatus",D])==="emphasis"?Lr:Pr)(A),a.add(A),A.on("click",ke(_.onclick,_,i,r,D)),E[D]=A})}var p=Os(t,r).refContainer,g=t.getBoxLayoutParams(),m=t.get("padding"),y=jn(g,p,m);na(t.get("orient"),a,t.get("itemGap"),y.width,y.height),bL(a,g,p,m),a.add(QM(a.getBoundingRect(),t)),l||a.eachChild(function(v){var _=v.__title,b=v.ensureState("emphasis"),T=b.textConfig||(b.textConfig={}),w=v.getTextContent(),S=w&&w.ensureState("emphasis");if(S&&!ce(S)&&_){var M=S.style||(S.style={}),C=_d(_,it.makeFont(M)),I=v.x+a.x,E=v.y+a.y+s,k=!1;E+C.height>r.getHeight()&&(T.position="top",k=!0);var D=k?-5-C.height:s+10;I+C.width/2>r.getWidth()?(T.position=["100%",D],M.align="right"):I-C.width/2<0&&(T.position=[0,D],M.align="left")}})},e.prototype.updateView=function(t,i,r,o){N(this._features,function(a){a instanceof fn&&a.updateView&&a.updateView(a.model,i,r,o)})},e.prototype.remove=function(t,i){N(this._features,function(r){r instanceof fn&&r.remove&&r.remove(t,i)}),this.group.removeAll()},e.prototype.dispose=function(t,i){N(this._features,function(r){r instanceof fn&&r.dispose&&r.dispose(t,i)})},e.type="toolbox",e}(Et);function QF(n){return n.indexOf("my")===0}var JF=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){var r=this.model,o=r.get("name")||t.get("title.0.text")||"echarts",a=i.getZr().painter.getType()==="svg",s=a?"svg":r.get("type",!0)||"png",l=i.getConnectedDataURL({type:s,backgroundColor:r.get("backgroundColor",!0)||t.get("backgroundColor")||Z.color.neutral00,connectedBackgroundColor:r.get("connectedBackgroundColor"),excludeComponents:r.get("excludeComponents"),pixelRatio:r.get("pixelRatio")}),u=fe.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=o+"."+s,c.target="_blank",c.href=l;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||a){var d=l.split(","),f=d[0].indexOf("base64")>-1,p=a?decodeURIComponent(d[1]):d[1];f&&(p=window.atob(p));var g=o+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var m=p.length,y=new Uint8Array(m);m--;)y[m]=p.charCodeAt(m);var v=new Blob([y]);window.navigator.msSaveOrOpenBlob(v,g)}else{var _=document.createElement("iframe");document.body.appendChild(_);var b=_.contentWindow,T=b.document;T.open("image/svg+xml","replace"),T.write(p),T.close(),b.focus(),T.execCommand("SaveAs",!0,g),document.body.removeChild(_)}}else{var w=r.get("lang"),S='<body style="margin:0;"><img src="'+l+'" style="max-width:100%;" title="'+(w&&w[0]||"")+'" /></body>',M=window.open();M.document.write(S),M.document.title=o}},e.getDefaultOption=function(t){var i={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:Z.color.neutral00,name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return i},e}(fn),JM="__ec_magicType_stack__",eG=[["line","bar"],["stack"]],tG=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,i=t.get("icon"),r={};return N(t.get("type"),function(o){i[o]&&(r[o]=i[o])}),r},e.getDefaultOption=function(t){var i={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return i},e.prototype.onclick=function(t,i,r){var o=this.model,a=o.get(["seriesIndex",r]);if(eC[r]){var s={series:[]},l=function(h){var d=h.subType,f=h.id,p=eC[r](d,f,h,o);p&&(Me(p,h.option),s.series.push(p));var g=h.coordinateSystem;if(g&&g.type==="cartesian2d"&&(r==="line"||r==="bar")){var m=g.getAxesByScale("ordinal")[0];if(m){var y=m.dim,v=y+"Axis",_=h.getReferringComponents(v,xt).models[0],b=_.componentIndex;s[v]=s[v]||[];for(var T=0;T<=b;T++)s[v][b]=s[v][b]||{};s[v][b].boundaryGap=r==="bar"}}};N(eG,function(h){be(h,r)>=0&&N(h,function(d){o.setIconStatus(d,"normal")})}),o.setIconStatus(r,"emphasis"),t.eachComponent({mainType:"series",query:a==null?null:{seriesIndex:a}},l);var u,c=r;r==="stack"&&(u=_e({stack:o.option.title.tiled,tiled:o.option.title.stack},o.option.title),o.get(["iconStatus",r])!=="emphasis"&&(c="tiled")),i.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},e}(fn),eC={line:function(n,e,t,i){if(n==="bar")return _e({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(n,e,t,i){if(n==="line")return _e({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(n,e,t,i){var r=t.get("stack")===JM;if(n==="line"||n==="bar")return i.setIconStatus("stack",r?"normal":"emphasis"),_e({id:e,stack:r?"":JM},i.get(["option","stack"])||{},!0)}};Zn({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(n,e){e.mergeOption(n.newOption)});var oh=new Array(60).join("-"),ba=" ";function nG(n){var e={},t=[],i=[];return n.eachRawSeries(function(r){var o=r.coordinateSystem;if(o&&(o.type==="cartesian2d"||o.type==="polar")){var a=o.getBaseAxis();if(a.type==="category"){var s=a.dim+"_"+a.index;e[s]||(e[s]={categoryAxis:a,valueAxis:o.getOtherAxis(a),series:[]},i.push({axisDim:a.dim,axisIndex:a.index})),e[s].series.push(r)}else t.push(r)}else t.push(r)}),{seriesGroupByCategoryAxis:e,other:t,meta:i}}function iG(n){var e=[];return N(n,function(t,i){var r=t.categoryAxis,o=t.valueAxis,a=o.dim,s=[" "].concat($(t.series,function(f){return f.name})),l=[r.model.getCategories()];N(t.series,function(f){var p=f.getRawData();l.push(f.getRawData().mapArray(p.mapDimension(a),function(g){return g}))});for(var u=[s.join(ba)],c=0;c<l[0].length;c++){for(var h=[],d=0;d<l.length;d++)h.push(l[d][c]);u.push(h.join(ba))}e.push(u.join(`
|
|
46
|
+
`))}),e.join(`
|
|
47
|
+
|
|
48
|
+
`+oh+`
|
|
49
|
+
|
|
50
|
+
`)}function rG(n){return $(n,function(e){var t=e.getRawData(),i=[e.name],r=[];return t.each(t.dimensions,function(){for(var o=arguments.length,a=arguments[o-1],s=t.getName(a),l=0;l<o-1;l++)r[l]=arguments[l];i.push((s?s+ba:"")+r.join(ba))}),i.join(`
|
|
51
|
+
`)}).join(`
|
|
52
|
+
|
|
53
|
+
`+oh+`
|
|
54
|
+
|
|
55
|
+
`)}function oG(n){var e=nG(n);return{value:$e([iG(e.seriesGroupByCategoryAxis),rG(e.other)],function(t){return!!t.replace(/[\n\t\s]/g,"")}).join(`
|
|
56
|
+
|
|
57
|
+
`+oh+`
|
|
58
|
+
|
|
59
|
+
`),meta:e.meta}}function ah(n){return n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function aG(n){var e=n.slice(0,n.indexOf(`
|
|
60
|
+
`));if(e.indexOf(ba)>=0)return!0}var Xm=new RegExp("["+ba+"]+","g");function sG(n){for(var e=n.split(/\n+/g),t=ah(e.shift()).split(Xm),i=[],r=$(t,function(l){return{name:l,data:[]}}),o=0;o<e.length;o++){var a=ah(e[o]).split(Xm);i.push(a.shift());for(var s=0;s<a.length;s++)r[s]&&(r[s].data[o]=a[s])}return{series:r,categories:i}}function lG(n){for(var e=n.split(/\n+/g),t=ah(e.shift()),i=[],r=0;r<e.length;r++){var o=ah(e[r]);if(o){var a=o.split(Xm),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),i[r]={name:s,value:[]},l=i[r].value):l=i[r]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);l.length===1&&(u?i[r].value=l[0]:i[r]=l[0])}}return{name:t,data:i}}function uG(n,e){var t=n.split(new RegExp(`
|
|
61
|
+
*`+oh+`
|
|
62
|
+
*`,"g")),i={series:[]};return N(t,function(r,o){if(aG(r)){var a=sG(r),s=e[o],l=s.axisDim+"Axis";s&&(i[l]=i[l]||[],i[l][s.axisIndex]={data:a.categories},i.series=i.series.concat(a.series))}else{var a=lG(r);i.series.push(a)}}),i}var cG=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){setTimeout(function(){i.dispatchAction({type:"hideTip"})});var r=i.getDom(),o=this.model;this._dom&&r.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",a.style.backgroundColor=o.get("backgroundColor")||Z.color.neutral00;var s=document.createElement("h4"),l=o.get("lang")||[];s.innerHTML=l[0]||o.get("title"),s.style.cssText="margin:10px 20px",s.style.color=o.get("textColor");var u=document.createElement("div"),c=document.createElement("textarea");u.style.cssText="overflow:auto";var h=o.get("optionToContent"),d=o.get("contentToOption"),f=oG(t);if(ce(h)){var p=h(i.getOption());Q(p)?u.innerHTML=p:pr(p)&&u.appendChild(p)}else{c.readOnly=o.get("readOnly");var g=c.style;g.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",g.color=o.get("textColor"),g.borderColor=o.get("textareaBorderColor"),g.backgroundColor=o.get("textareaColor"),c.value=f.value,u.appendChild(c)}var m=f.meta,y=document.createElement("div");y.style.cssText="position:absolute;bottom:5px;left:0;right:0";var v="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",_=document.createElement("div"),b=document.createElement("div");v+=";background-color:"+o.get("buttonColor"),v+=";color:"+o.get("buttonTextColor");var T=this;function w(){r.removeChild(a),T._dom=null}ig(_,"click",w),ig(b,"click",function(){if(d==null&&h!=null||d!=null&&h==null){process.env.NODE_ENV!=="production"&&st("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."),w();return}var S;try{ce(d)?S=d(u,i.getOption()):S=uG(c.value,m)}catch(M){throw w(),new Error("Data view format error "+M)}S&&i.dispatchAction({type:"changeDataView",newOption:S}),w()}),_.innerHTML=l[1],b.innerHTML=l[2],b.style.cssText=_.style.cssText=v,!o.get("readOnly")&&y.appendChild(b),y.appendChild(_),a.appendChild(s),a.appendChild(u),a.appendChild(y),u.style.height=r.clientHeight-80+"px",r.appendChild(a),this._dom=a},e.prototype.remove=function(t,i){this._dom&&i.getDom().removeChild(this._dom)},e.prototype.dispose=function(t,i){this.remove(t,i)},e.getDefaultOption=function(t){var i={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:Z.color.background,textColor:Z.color.primary,textareaColor:Z.color.background,textareaBorderColor:Z.color.border,buttonColor:Z.color.accent50,buttonTextColor:Z.color.neutral00};return i},e}(fn);function hG(n,e){return $(n,function(t,i){var r=e&&e[i];if(ne(r)&&!q(r)){var o=ne(t)&&!q(t);o||(t={value:t});var a=r.name!=null&&t.name==null;return t=Me(t,r),a&&delete t.name,t}else return t})}Zn({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(n,e){var t=[];N(n.newOption.series,function(i){var r=e.getSeriesByName(i.name)[0];if(!r)t.push(U({type:"scatter"},i));else{var o=r.get("data");t.push({name:i.name,data:hG(i.data,o)})}}),e.mergeOption(Me({series:t},n.newOption))});var tC=N,nC=Re();function dG(n,e){var t=Km(n);tC(e,function(i,r){for(var o=t.length-1;o>=0;o--){var a=t[o];if(a[r])break}if(o<0){var s=n.queryComponents({mainType:"dataZoom",subType:"select",id:r})[0];if(s){var l=s.getPercentRange();t[0][r]={dataZoomId:r,start:l[0],end:l[1]}}}}),t.push(e)}function fG(n){var e=Km(n),t=e[e.length-1];e.length>1&&e.pop();var i={};return tC(t,function(r,o){for(var a=e.length-1;a>=0;a--)if(r=e[a][o],r){i[o]=r;break}}),i}function pG(n){nC(n).snapshots=null}function gG(n){return Km(n).length}function Km(n){var e=nC(n);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var mG=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){pG(t),i.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var i={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return i},e}(fn);Zn({type:"restore",event:"restore",update:"prepareAndUpdate"},function(n,e){e.resetOption("recreate")});var yG=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],Qm=function(){function n(e,t,i){var r=this;this._targetInfoList=[];var o=iC(t,e);N(vG,function(a,s){(!i||!i.include||be(i.include,s)>=0)&&a(o,r._targetInfoList)})}return n.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(i,r,o){if((i.coordRanges||(i.coordRanges=[])).push(r),!i.coordRange){i.coordRange=r;var a=ey[i.brushType](0,o,r);i.__rangeOffset={offset:sC[i.brushType](a.values,i.range,[1,1]),xyMinMax:a.xyMinMax}}}),e},n.prototype.matchOutputRanges=function(e,t,i){N(e,function(r){var o=this.findTargetInfo(r,t);o&&o!==!0&&N(o.coordSyses,function(a){var s=ey[r.brushType](1,a,r.range,!0);i(r,s.values,a,t)})},this)},n.prototype.setInputRanges=function(e,t){N(e,function(i){var r=this.findTargetInfo(i,t);if(process.env.NODE_ENV!=="production"&&(J(!r||r===!0||i.coordRange,"coordRange must be specified when coord index specified."),J(!r||r!==!0||i.range,"range must be specified in global brush.")),i.range=i.range||[],r&&r!==!0){i.panelId=r.panelId;var o=ey[i.brushType](0,r.coordSys,i.coordRange),a=i.__rangeOffset;i.range=a?sC[i.brushType](o.values,a.offset,_G(o.xyMinMax,a.xyMinMax)):o.values}},this)},n.prototype.makePanelOpts=function(e,t){return $(this._targetInfoList,function(i){var r=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t?t(i):null,clipPath:t3(r),isTargetByCursor:i3(r,e,i.coordSysModel),getLinearBrushOtherExtent:n3(r)}})},n.prototype.controlSeries=function(e,t,i){var r=this.findTargetInfo(e,i);return r===!0||r&&be(r.coordSyses,t.coordinateSystem)>=0},n.prototype.findTargetInfo=function(e,t){for(var i=this._targetInfoList,r=iC(t,e),o=0;o<i.length;o++){var a=i[o],s=e.panelId;if(s){if(a.panelId===s)return a}else for(var l=0;l<rC.length;l++)if(rC[l](r,a))return a}return!0},n}();function Jm(n){return n[0]>n[1]&&n.reverse(),n}function iC(n,e){return hs(n,e,{includeMainTypes:yG})}var vG={grid:function(n,e){var t=n.xAxisModels,i=n.yAxisModels,r=n.gridModels,o=me(),a={},s={};!t&&!i&&!r||(N(t,function(l){var u=l.axis.grid.model;o.set(u.id,u),a[u.id]=!0}),N(i,function(l){var u=l.axis.grid.model;o.set(u.id,u),s[u.id]=!0}),N(r,function(l){o.set(l.id,l),a[l.id]=!0,s[l.id]=!0}),o.each(function(l){var u=l.coordinateSystem,c=[];N(u.getCartesians(),function(h,d){(be(t,h.getAxis("x").model)>=0||be(i,h.getAxis("y").model)>=0)&&c.push(h)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:oC.grid,xAxisDeclared:a[l.id],yAxisDeclared:s[l.id]})}))},geo:function(n,e){N(n.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:oC.geo})})}},rC=[function(n,e){var t=n.xAxisModel,i=n.yAxisModel,r=n.gridModel;return!r&&t&&(r=t.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===e.gridModel},function(n,e){var t=n.geoModel;return t&&t===e.geoModel}],oC={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var n=this.coordSys,e=n.getBoundingRect().clone();return e.applyTransform(Hf(n)),e}},ey={lineX:we(aC,0),lineY:we(aC,1),rect:function(n,e,t,i){var r=n?e.pointToData([t[0][0],t[1][0]],i):e.dataToPoint([t[0][0],t[1][0]],i),o=n?e.pointToData([t[0][1],t[1][1]],i):e.dataToPoint([t[0][1],t[1][1]],i),a=[Jm([r[0],o[0]]),Jm([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(n,e,t,i){var r=[[1/0,-1/0],[1/0,-1/0]],o=$(t,function(a){var s=n?e.pointToData(a,i):e.dataToPoint(a,i);return r[0][0]=Math.min(r[0][0],s[0]),r[1][0]=Math.min(r[1][0],s[1]),r[0][1]=Math.max(r[0][1],s[0]),r[1][1]=Math.max(r[1][1],s[1]),s});return{values:o,xyMinMax:r}}};function aC(n,e,t,i){process.env.NODE_ENV!=="production"&&J(t.type==="cartesian2d","lineX/lineY brush is available only in cartesian2d.");var r=t.getAxis(["x","y"][n]),o=Jm($([0,1],function(s){return e?r.coordToData(r.toLocalCoord(i[s]),!0):r.toGlobalCoord(r.dataToCoord(i[s]))})),a=[];return a[n]=o,a[1-n]=[NaN,NaN],{values:o,xyMinMax:a}}var sC={lineX:we(lC,0),lineY:we(lC,1),rect:function(n,e,t){return[[n[0][0]-t[0]*e[0][0],n[0][1]-t[0]*e[0][1]],[n[1][0]-t[1]*e[1][0],n[1][1]-t[1]*e[1][1]]]},polygon:function(n,e,t){return $(n,function(i,r){return[i[0]-t[0]*e[r][0],i[1]-t[1]*e[r][1]]})}};function lC(n,e,t,i){return[e[0]-i[n]*t[0],e[1]-i[n]*t[1]]}function _G(n,e){var t=uC(n),i=uC(e),r=[t[0]/i[0],t[1]/i[1]];return isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r}function uC(n){return n?[n[0][1]-n[0][0],n[1][1]-n[1][0]]:[NaN,NaN]}var ty=N,xG=NA("toolbox-dataZoom_"),bG=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,i,r,o){this._brushController||(this._brushController=new IT(r.getZr()),this._brushController.on("brush",ke(this._onBrush,this)).mount()),TG(t,i,this,o,r),SG(t,i)},e.prototype.onclick=function(t,i,r){wG[r].call(this)},e.prototype.remove=function(t,i){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,i){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var i=t.areas;if(!t.isEnd||!i.length)return;var r={},o=this.ecModel;this._brushController.updateCovers([]);var a=new Qm(ny(this.model),o,{include:["grid"]});a.matchOutputRanges(i,o,function(u,c,h){if(h.type==="cartesian2d"){var d=u.brushType;d==="rect"?(s("x",h,c[0]),s("y",h,c[1])):s({lineX:"x",lineY:"y"}[d],h,c)}}),dG(o,r),this._dispatchZoomAction(r);function s(u,c,h){var d=c.getAxis(u),f=d.model,p=l(u,f,o),g=p.findRepresentativeAxisProxy(f).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(h=CT(0,h.slice(),d.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),p&&(r[p.id]={dataZoomId:p.id,startValue:h[0],endValue:h[1]})}function l(u,c,h){var d;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(f){var p=f.getAxisModel(u,c.componentIndex);p&&(d=f)}),d}},e.prototype._dispatchZoomAction=function(t){var i=[];ty(t,function(r,o){i.push(ue(r))}),i.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:i})},e.getDefaultOption=function(t){var i={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:Z.color.backgroundTint}};return i},e}(fn),wG={zoom:function(){var n=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:n})},back:function(){this._dispatchZoomAction(fG(this.ecModel))}};function ny(n){var e={xAxisIndex:n.get("xAxisIndex",!0),yAxisIndex:n.get("yAxisIndex",!0),xAxisId:n.get("xAxisId",!0),yAxisId:n.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function SG(n,e){n.setIconStatus("back",gG(e)>1?"emphasis":"normal")}function TG(n,e,t,i,r){var o=t._isZoomActive;i&&i.type==="takeGlobalCursor"&&(o=i.key==="dataZoomSelect"?i.dataZoomSelectActive:!1),t._isZoomActive=o,n.setIconStatus("zoom",o?"emphasis":"normal");var a=new Qm(ny(n),e,{include:["grid"]}),s=a.makePanelOpts(r,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(o&&s.length?{brushType:"auto",brushStyle:n.getModel("brushStyle").getItemStyle()}:!1)}dB("dataZoom",function(n){var e=n.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var i=e.getModel(t),r=[],o=ny(i),a=hs(n,o);ty(a.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),ty(a.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var h=l.componentIndex,d={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:xG+u+h};d[c]=h,r.push(d)}return r});function MG(n){n.registerComponentModel(XF),n.registerComponentView(KF),xa("saveAsImage",JF),xa("magicType",tG),xa("dataView",cG),xa("dataZoom",bG),xa("restore",mG),bi(ZF)}var CG=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:Z.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:Z.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:Z.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:Z.color.tertiary,fontSize:14}},e}(De);function cC(n){var e=n.get("confine");return e!=null?!!e:n.get("renderMode")==="richText"}function hC(n){if(fe.domSupported){for(var e=document.documentElement.style,t=0,i=n.length;t<i;t++)if(n[t]in e)return n[t]}}var dC=hC(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),kG=hC(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function fC(n,e){if(!n)return e;e=T1(e,!0);var t=n.indexOf(e);return n=t===-1?e:"-"+n.slice(0,t)+"-"+e,n.toLowerCase()}function DG(n,e){var t=n.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(n);return t?t[e]:null}var IG=fC(kG,"transition"),iy=fC(dC,"transform"),EG="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(fe.transform3dSupported?"will-change:transform;":"");function NG(n){return n=n==="left"?"right":n==="right"?"left":n==="top"?"bottom":"top",n}function AG(n,e,t){if(!Q(t)||t==="inside")return"";var i=n.get("backgroundColor"),r=n.get("borderWidth");e=Xr(e);var o=NG(t),a=Math.max(Math.round(r)*1.5,6),s="",l=iy+":",u;be(["left","right"],o)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=o==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=o==="top"?225:45)+"deg)");var c=u*Math.PI/180,h=a+r,d=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),f=Math.round(((d-Math.SQRT2*r)/2+Math.SQRT2*r-(d-h)/2)*100)/100;s+=";"+o+":-"+f+"px";var p=e+" solid "+r+"px;",g=["position:absolute;width:"+a+"px;height:"+a+"px;z-index:-1;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+i+";"];return'<div style="'+g.join("")+'"></div>'}function OG(n,e,t){var i="cubic-bezier(0.23,1,0.32,1)",r="",o="";return t&&(r=" "+n/2+"s "+i,o="opacity"+r+",visibility"+r),e||(r=" "+n+"s "+i,o+=(o.length?",":"")+(fe.transformSupported?""+iy+r:",left"+r+",top"+r)),IG+":"+o}function pC(n,e,t){var i=n.toFixed(0)+"px",r=e.toFixed(0)+"px";if(!fe.transformSupported)return t?"top:"+r+";left:"+i+";":[["top",r],["left",i]];var o=fe.transform3dSupported,a="translate"+(o?"3d":"")+"("+i+","+r+(o?",0":"")+")";return t?"top:0;left:0;"+iy+":"+a+";":[["top",0],["left",0],[dC,a]]}function RG(n){var e=[],t=n.get("fontSize"),i=n.getTextColor();i&&e.push("color:"+i),e.push("font:"+n.getFont());var r=te(n.get("lineHeight"),Math.round(t*3/2));t&&e.push("line-height:"+r+"px");var o=n.get("textShadowColor"),a=n.get("textShadowBlur")||0,s=n.get("textShadowOffsetX")||0,l=n.get("textShadowOffsetY")||0;return o&&a&&e.push("text-shadow:"+s+"px "+l+"px "+a+"px "+o),N(["decoration","align"],function(u){var c=n.get(u);c&&e.push("text-"+u+":"+c)}),e.join(";")}function LG(n,e,t,i){var r=[],o=n.get("transitionDuration"),a=n.get("backgroundColor"),s=n.get("shadowBlur"),l=n.get("shadowColor"),u=n.get("shadowOffsetX"),c=n.get("shadowOffsetY"),h=n.getModel("textStyle"),d=H1(n,"html"),f=u+"px "+c+"px "+s+"px "+l;return r.push("box-shadow:"+f),e&&o>0&&r.push(OG(o,t,i)),a&&r.push("background-color:"+a),N(["width","color","radius"],function(p){var g="border-"+p,m=T1(g),y=n.get(m);y!=null&&r.push(g+":"+y+(p==="color"?"":"px"))}),r.push(RG(h)),d!=null&&r.push("padding:"+lc(d).join("px ")+"px"),r.join(";")+";"}function gC(n,e,t,i,r){var o=e&&e.painter;if(t){var a=o&&o.getViewportRoot();a&&ZR(n,a,t,i,r)}else{n[0]=i,n[1]=r;var s=o&&o.getViewportRootOffset();s&&(n[0]+=s.offsetLeft,n[1]+=s.offsetTop)}n[2]=n[0]/e.getWidth(),n[3]=n[1]/e.getHeight()}var PG=function(){function n(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,fe.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var r=this._zr=e.getZr(),o=t.appendTo,a=o&&(Q(o)?document.querySelector(o):pr(o)?o:ce(o)&&o(e.getDom()));gC(this._styleCoord,r,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(i),this._api=e,this._container=a;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=r.handler,c=r.painter.getViewportRoot();un(c,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return n.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),i=DG(t,"position"),r=t.style;r.position!=="absolute"&&i!=="absolute"&&(r.position="relative")}var o=e.get("alwaysShowContent");o&&this._moveIfResized(),this._alwaysShowContent=o,this._enableDisplayTransition=e.get("displayTransition")&&e.get("transitionDuration")>0,this.el.className=e.get("className")||""},n.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,r=i.style,o=this._styleCoord;i.innerHTML?r.cssText=EG+LG(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+pC(o[0],o[1],!0)+("border-color:"+Xr(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):r.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},n.prototype.setContent=function(e,t,i,r,o){var a=this.el;if(e==null){a.innerHTML="";return}var s="";if(Q(o)&&i.get("trigger")==="item"&&!cC(i)&&(s=AG(i,r,o)),Q(e))a.innerHTML=e+s;else if(e){a.innerHTML="",q(e)||(e=[e]);for(var l=0;l<e.length;l++)pr(e[l])&&e[l].parentNode!==a&&a.appendChild(e[l]);if(s&&a.childNodes.length){var u=document.createElement("div");u.innerHTML=s,a.appendChild(u)}}},n.prototype.setEnterable=function(e){this._enterable=e},n.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},n.prototype.moveTo=function(e,t){if(this.el){var i=this._styleCoord;if(gC(i,this._zr,this._container,e,t),i[0]!=null&&i[1]!=null){var r=this.el.style,o=pC(i[0],i[1]);N(o,function(a){r[a[0]]=a[1]})}}},n.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},n.prototype.hide=function(){var e=this,t=this.el.style;this._enableDisplayTransition?(t.visibility="hidden",t.opacity="0"):t.display="none",fe.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},n.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(ke(this.hide,this),e)):this.hide())},n.prototype.isShow=function(){return this._show},n.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this._zr;XR(e&&e.painter&&e.painter.getViewportRoot(),this._container);var t=this.el;if(t){t.onmouseenter=t.onmousemove=t.onmouseleave=null;var i=t.parentNode;i&&i.removeChild(t)}this.el=this._container=null},n}(),zG=function(){function n(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),yC(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return n.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},n.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},n.prototype.setContent=function(e,t,i,r,o){var a=this;ne(e)&&Lt(process.env.NODE_ENV!=="production"?"Passing DOM nodes as content is not supported in richText tooltip!":""),this.el&&this._zr.remove(this.el);var s=i.getModel("textStyle");this.el=new it({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:r,textShadowColor:s.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:H1(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),N(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(u){a.el.style[u]=i.get(u)}),N(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(u){a.el.style[u]=s.get(u)||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})},n.prototype.setEnterable=function(e){this._enterable=e},n.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),i=mC(e.style);return[t.width+i.left+i.right,t.height+i.top+i.bottom]},n.prototype.moveTo=function(e,t){var i=this.el;if(i){var r=this._styleCoord;yC(r,this._zr,e,t),e=r[0],t=r[1];var o=i.style,a=lr(o.borderWidth||0),s=mC(o);i.x=e+a+s.left,i.y=t+a+s.top,i.markRedraw()}},n.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},n.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},n.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(ke(this.hide,this),e)):this.hide())},n.prototype.isShow=function(){return this._show},n.prototype.dispose=function(){this._zr.remove(this.el)},n}();function lr(n){return Math.max(0,n)}function mC(n){var e=lr(n.shadowBlur||0),t=lr(n.shadowOffsetX||0),i=lr(n.shadowOffsetY||0);return{left:lr(e-t),right:lr(e+t),top:lr(e-i),bottom:lr(e+i)}}function yC(n,e,t,i){n[0]=t,n[1]=i,n[2]=n[0]/e.getWidth(),n[3]=n[1]/e.getHeight()}var BG=new Ue({shape:{x:-1,y:-1,width:2,height:2}}),VG=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){if(!(fe.node||!i.getDom())){var r=t.getComponent("tooltip"),o=this._renderMode=zA(r.get("renderMode"));this._tooltipContent=o==="richText"?new zG(i):new PG(i,{appendTo:r.get("appendToBody",!0)?"body":r.get("appendTo",!0)})}},e.prototype.render=function(t,i,r){if(!(fe.node||!r.getDom())){this.group.removeAll(),this._tooltipModel=t,this._ecModel=i,this._api=r;var o=this._tooltipContent;o.update(t),o.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&t.get("transitionDuration")?qp(this,"_updatePosition",50,"fixRate"):jp(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var t=this._tooltipModel,i=t.get("triggerOn");VM("itemTooltip",this._api,ke(function(r,o,a){i!=="none"&&(i.indexOf(r)>=0?this._tryShow(o,a):r==="leave"&&this._hide(a))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,i=this._ecModel,r=this._api,o=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&o!=="none"&&o!=="click"){var a=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!r.isDisposed()&&a.manuallyShowTip(t,i,r,{x:a._lastX,y:a._lastY,dataByCoordSys:a._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,i,r,o){if(!(o.from===this.uid||fe.node||!r.getDom())){var a=vC(o,r);this._ticket="";var s=o.dataByCoordSys,l=WG(o,i,r);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:o.position,positionDefault:"bottom"},a)}else if(o.tooltip&&o.x!=null&&o.y!=null){var c=BG;c.x=o.x,c.y=o.y,c.update(),Se(c).tooltipConfig={name:null,option:o.tooltip},this._tryShow({offsetX:o.x,offsetY:o.y,target:c},a)}else if(s)this._tryShow({offsetX:o.x,offsetY:o.y,position:o.position,dataByCoordSys:s,tooltipOption:o.tooltipOption},a);else if(o.seriesIndex!=null){if(this._manuallyAxisShowTip(t,i,r,o))return;var h=FM(o,i),d=h.point[0],f=h.point[1];d!=null&&f!=null&&this._tryShow({offsetX:d,offsetY:f,target:h.el,position:o.position,positionDefault:"bottom"},a)}else o.x!=null&&o.y!=null&&(r.dispatchAction({type:"updateAxisPointer",x:o.x,y:o.y}),this._tryShow({offsetX:o.x,offsetY:o.y,position:o.position,target:r.getZr().findHover(o.x,o.y).target},a))}},e.prototype.manuallyHideTip=function(t,i,r,o){var a=this._tooltipContent;this._tooltipModel&&a.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,o.from!==this.uid&&this._hide(vC(o,r))},e.prototype._manuallyAxisShowTip=function(t,i,r,o){var a=o.seriesIndex,s=o.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(a==null||s==null||l==null)){var u=i.getSeriesByIndex(a);if(u){var c=u.getData(),h=fl([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return r.dispatchAction({type:"updateAxisPointer",seriesIndex:a,dataIndex:s,position:o.position}),!0}}},e.prototype._tryShow=function(t,i){var r=t.target,o=this._tooltipModel;if(o){this._lastX=t.offsetX,this._lastY=t.offsetY;var a=t.dataByCoordSys;if(a&&a.length)this._showAxisTooltip(a,t);else if(r){var s=Se(r);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Zs(r,function(c){if(c.tooltipDisabled)return l=u=null,!0;l||u||(Se(c).dataIndex!=null?l=c:Se(c).tooltipConfig!=null&&(u=c))},!0),l?this._showSeriesItemTooltip(t,l,i):u?this._showComponentItemTooltip(t,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},e.prototype._showOrMove=function(t,i){var r=t.get("showDelay");i=ke(i,this),clearTimeout(this._showTimout),r>0?this._showTimout=setTimeout(i,r):i()},e.prototype._showAxisTooltip=function(t,i){var r=this._ecModel,o=this._tooltipModel,a=[i.offsetX,i.offsetY],s=fl([i.tooltipOption],o),l=this._renderMode,u=[],c=Qr("section",{blocks:[],noHeader:!0}),h=[],d=new Rp;N(t,function(v){N(v.dataByAxis,function(_){var b=r.getComponent(_.axisDim+"Axis",_.axisIndex),T=_.value;if(!(!b||T==null)){var w=LM(T,b.axis,r,_.seriesDataIndices,_.valueLabelOpt),S=Qr("section",{header:w,noHeader:!An(w),sortBlocks:!0,blocks:[]});c.blocks.push(S),N(_.seriesDataIndices,function(M){var C=r.getSeriesByIndex(M.seriesIndex),I=M.dataIndexInside,E=C.getDataParams(I);if(!(E.dataIndex<0)){E.axisDim=_.axisDim,E.axisIndex=_.axisIndex,E.axisType=_.axisType,E.axisId=_.axisId,E.axisValue=qc(b.axis,{value:T}),E.axisValueLabel=w,E.marker=d.makeTooltipMarker("item",Xr(E.color),l);var k=I1(C.formatTooltip(I,!0,null)),D=k.frag;if(D){var A=fl([C],o).get("valueFormatter");S.blocks.push(A?U({valueFormatter:A},D):D)}k.text&&h.push(k.text),u.push(E)}})}})}),c.blocks.reverse(),h.reverse();var f=i.position,p=s.get("order"),g=B1(c,d,l,p,r.get("useUTC"),s.get("textStyle"));g&&h.unshift(g);var m=l==="richText"?`
|
|
63
|
+
|
|
64
|
+
`:"<br/>",y=h.join(m);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,f,a[0],a[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",a[0],a[1],f,null,d)})},e.prototype._showSeriesItemTooltip=function(t,i,r){var o=this._ecModel,a=Se(i),s=a.seriesIndex,l=o.getSeriesByIndex(s),u=a.dataModel||l,c=a.dataIndex,h=a.dataType,d=u.getData(h),f=this._renderMode,p=t.positionDefault,g=fl([d.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),m=g.get("trigger");if(!(m!=null&&m!=="item")){var y=u.getDataParams(c,h),v=new Rp;y.marker=v.makeTooltipMarker("item",Xr(y.color),f);var _=I1(u.formatTooltip(c,!1,h)),b=g.get("order"),T=g.get("valueFormatter"),w=_.frag,S=w?B1(T?U({valueFormatter:T},w):w,v,f,b,o.get("useUTC"),g.get("textStyle")):_.text,M="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,S,y,M,t.offsetX,t.offsetY,t.position,t.target,v)}),r({type:"showTip",dataIndexInside:c,dataIndex:d.getRawIndex(c),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,i,r){var o=this._renderMode==="html",a=Se(i),s=a.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(Q(l)){var c=l;l={content:c,formatter:c},u=!0}u&&o&&l.content&&(l=ue(l),l.content=Dt(l.content));var h=[l],d=this._ecModel.getComponent(a.componentMainType,a.componentIndex);d&&h.push(d),h.push({formatter:l.content});var f=t.positionDefault,p=fl(h,this._tooltipModel,f?{position:f}:null),g=p.get("content"),m=Math.random()+"",y=new Rp;this._showOrMove(p,function(){var v=ue(p.get("formatterParams")||{});this._showTooltipContent(p,g,v,m,t.offsetX,t.offsetY,t.position,i,y)}),r({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,i,r,o,a,s,l,u,c){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var h=this._tooltipContent;h.setEnterable(t.get("enterable"));var d=t.get("formatter");l=l||t.get("position");var f=i,p=this._getNearestPoint([a,s],r,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)),g=p.color;if(d)if(Q(d)){var m=t.ecModel.get("useUTC"),y=q(r)?r[0]:r,v=y&&y.axisType&&y.axisType.indexOf("time")>=0;f=d,v&&(f=ac(y.axisValue,f,m)),f=C1(f,r,!0)}else if(ce(d)){var _=ke(function(b,T){b===this._ticket&&(h.setContent(T,c,t,g,l),this._updatePosition(t,l,a,s,h,r,u))},this);this._ticket=o,f=d(r,o,_)}else f=d;h.setContent(f,c,t,g,l),h.show(t,g),this._updatePosition(t,l,a,s,h,r,u)}},e.prototype._getNearestPoint=function(t,i,r,o,a){if(r==="axis"||q(i))return{color:o||a};if(!q(i))return{color:o||i.color||i.borderColor}},e.prototype._updatePosition=function(t,i,r,o,a,s,l){var u=this._api.getWidth(),c=this._api.getHeight();i=i||t.get("position");var h=a.getSize(),d=t.get("align"),f=t.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),ce(i)&&(i=i([r,o],s,a.el,p,{viewSize:[u,c],contentSize:h.slice()})),q(i))r=Pe(i[0],u),o=Pe(i[1],c);else if(ne(i)){var g=i;g.width=h[0],g.height=h[1];var m=jn(g,{width:u,height:c});r=m.x,o=m.y,d=null,f=null}else if(Q(i)&&l){var y=GG(i,p,h,t.get("borderWidth"));r=y[0],o=y[1]}else{var y=HG(r,o,a,u,c,d?null:20,f?null:20);r=y[0],o=y[1]}if(d&&(r-=_C(d)?h[0]/2:d==="right"?h[0]:0),f&&(o-=_C(f)?h[1]/2:f==="bottom"?h[1]:0),cC(t)){var y=FG(r,o,a,u,c);r=y[0],o=y[1]}a.moveTo(r,o)},e.prototype._updateContentNotChangedOnAxis=function(t,i){var r=this._lastDataByCoordSys,o=this._cbParamsList,a=!!r&&r.length===t.length;return a&&N(r,function(s,l){var u=s.dataByAxis||[],c=t[l]||{},h=c.dataByAxis||[];a=a&&u.length===h.length,a&&N(u,function(d,f){var p=h[f]||{},g=d.seriesDataIndices||[],m=p.seriesDataIndices||[];a=a&&d.value===p.value&&d.axisType===p.axisType&&d.axisId===p.axisId&&g.length===m.length,a&&N(g,function(y,v){var _=m[v];a=a&&y.seriesIndex===_.seriesIndex&&y.dataIndex===_.dataIndex}),o&&N(d.seriesDataIndices,function(y){var v=y.seriesIndex,_=i[v],b=o[v];_&&b&&b.data!==_.data&&(a=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=i,!!a},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,i){fe.node||!i.getDom()||(jp(this,"_updatePosition"),this._tooltipContent.dispose(),$m("itemTooltip",i))},e.type="tooltip",e}(Et);function fl(n,e,t){var i=e.ecModel,r;t?(r=new Ge(t,i,i),r=new Ge(e.option,r,i)):r=e;for(var o=n.length-1;o>=0;o--){var a=n[o];a&&(a instanceof Ge&&(a=a.get("tooltip",!0)),Q(a)&&(a={formatter:a}),a&&(r=new Ge(a,r,i)))}return r}function vC(n,e){return n.dispatchAction||ke(e.dispatchAction,e)}function HG(n,e,t,i,r,o,a){var s=t.getSize(),l=s[0],u=s[1];return o!=null&&(n+l+o+2>i?n-=l+o:n+=o),a!=null&&(e+u+a>r?e-=u+a:e+=a),[n,e]}function FG(n,e,t,i,r){var o=t.getSize(),a=o[0],s=o[1];return n=Math.min(n+a,i)-a,e=Math.min(e+s,r)-s,n=Math.max(n,0),e=Math.max(e,0),[n,e]}function GG(n,e,t,i){var r=t[0],o=t[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,c=e.height;switch(n){case"inside":s=e.x+u/2-r/2,l=e.y+c/2-o/2;break;case"top":s=e.x+u/2-r/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-r/2,l=e.y+c+a;break;case"left":s=e.x-r-a,l=e.y+c/2-o/2;break;case"right":s=e.x+u+a,l=e.y+c/2-o/2}return[s,l]}function _C(n){return n==="center"||n==="middle"}function WG(n,e,t){var i=yf(n).queryOptionMap,r=i.keys()[0];if(!(!r||r==="series")){var o=ds(e,r,i.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(a){var s=t.getViewOfComponentModel(a),l;if(s.group.traverse(function(u){var c=Se(u).tooltipConfig;if(c&&c.name===n.name)return l=u,!0}),l)return{componentMainType:r,componentIndex:a.componentIndex,el:l}}}}function UG(n){bi(YM),n.registerComponentModel(CG),n.registerComponentView(VG),n.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},nt),n.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},nt)}var YG=["rect","polygon","keep","clear"];function qG(n,e){var t=_t(n?n.brush:[]);if(t.length){var i=[];N(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(i=i.concat(u))});var r=n&&n.toolbox;q(r)&&(r=r[0]),r||(r={feature:{}},n.toolbox=[r]);var o=r.feature||(r.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,i),jG(s),e&&!s.length&&s.push.apply(s,YG)}}function jG(n){var e={};N(n,function(t){e[t]=1}),n.length=0,N(e,function(t,i){n.push(i)})}var xC=N;function bC(n){if(n){for(var e in n)if(n.hasOwnProperty(e))return!0}}function $G(n,e,t){var i={};return xC(e,function(o){var a=i[o]=r();xC(n[o],function(s,l){if(pa.isValidType(l)){var u={type:l,visual:s};t&&t(u,o),a[l]=new pa(u),l==="opacity"&&(u=ue(u),u.type="colorAlpha",a.__hidden.__alphaForOpacity=new pa(u))}})}),i;function r(){var o=function(){};o.prototype.__hidden=o.prototype;var a=new o;return a}}function ZG(n,e,t){var i;N(t,function(r){e.hasOwnProperty(r)&&bC(e[r])&&(i=!0)}),i&&N(t,function(r){e.hasOwnProperty(r)&&bC(e[r])?n[r]=ue(e[r]):delete n[r]})}function XG(n,e,t,i,r,o){var a={};N(n,function(h){var d=pa.prepareVisualTypes(e[h]);a[h]=d});var s;function l(h){return Nw(t,s,h)}function u(h,d){JB(t,s,h,d)}t.each(c);function c(h,d){s=h;var f=t.getRawDataItem(s);if(!(f&&f.visualMap===!1))for(var p=i.call(r,h),g=e[p],m=a[p],y=0,v=m.length;y<v;y++){var _=m[y];g[_]&&g[_].applyVisual(h,l,u)}}}function KG(n){var e=n.brushType,t={point:function(i){return wC[e].point(i,t,n)},rect:function(i){return wC[e].rect(i,t,n)}};return t}var wC={lineX:SC(0),lineY:SC(1),rect:{point:function(n,e,t){return n&&t.boundingRect.contain(n[0],n[1])},rect:function(n,e,t){return n&&t.boundingRect.intersect(n)}},polygon:{point:function(n,e,t){return n&&t.boundingRect.contain(n[0],n[1])&&ol(t.range,n[0],n[1])},rect:function(n,e,t){var i=t.range;if(!n||i.length<=1)return!1;var r=n.x,o=n.y,a=n.width,s=n.height,l=i[0];if(ol(i,r,o)||ol(i,r+a,o)||ol(i,r,o+s)||ol(i,r+a,o+s)||ve.create(n).contain(l[0],l[1])||xs(r,o,r+a,o,i)||xs(r,o,r,o+s,i)||xs(r+a,o,r+a,o+s,i)||xs(r,o+s,r+a,o+s,i))return!0}}};function SC(n){var e=["x","y"],t=["width","height"];return{point:function(i,r,o){if(i){var a=o.range,s=i[n];return pl(s,a)}},rect:function(i,r,o){if(i){var a=o.range,s=[i[e[n]],i[e[n]]+i[t[n]]];return s[1]<s[0]&&s.reverse(),pl(s[0],a)||pl(s[1],a)||pl(a[0],s)||pl(a[1],s)}}}}function pl(n,e){return e[0]<=n&&n<=e[1]}var TC=["inBrush","outOfBrush"],ry="__ecBrushSelect",oy="__ecInBrushSelectEvent";function MC(n){n.eachComponent({mainType:"brush"},function(e){var t=e.brushTargetManager=new Qm(e.option,n);t.setInputRanges(e.areas,n)})}function QG(n,e,t){var i=[],r,o;n.eachComponent({mainType:"brush"},function(a){t&&t.type==="takeGlobalCursor"&&a.setBrushOption(t.key==="brush"?t.brushOption:{brushType:!1})}),MC(n),n.eachComponent({mainType:"brush"},function(a,s){var l={brushId:a.id,brushIndex:s,brushName:a.name,areas:ue(a.areas),selected:[]};i.push(l);var u=a.option,c=u.brushLink,h=[],d=[],f=[],p=!1;s||(r=u.throttleType,o=u.throttleDelay);var g=$(a.areas,function(T){var w=n4[T.brushType],S=Me({boundingRect:w?w(T):void 0},T);return S.selectors=KG(S),S}),m=$G(a.option,TC,function(T){T.mappingMethod="fixed"});q(c)&&N(c,function(T){h[T]=1});function y(T){return c==="all"||!!h[T]}function v(T){return!!T.length}n.eachSeries(function(T,w){var S=f[w]=[];T.subType==="parallel"?_(T,w):b(T,w,S)});function _(T,w){var S=T.coordinateSystem;p=p||S.hasAxisBrushed(),y(w)&&S.eachActiveState(T.getData(),function(M,C){M==="active"&&(d[C]=1)})}function b(T,w,S){if(!(!T.brushSelector||t4(a,w))&&(N(g,function(C){a.brushTargetManager.controlSeries(C,T,n)&&S.push(C),p=p||v(S)}),y(w)&&v(S))){var M=T.getData();M.each(function(C){CC(T,S,M,C)&&(d[C]=1)})}}n.eachSeries(function(T,w){var S={seriesId:T.id,seriesIndex:w,seriesName:T.name,dataIndex:[]};l.selected.push(S);var M=f[w],C=T.getData(),I=y(w)?function(E){return d[E]?(S.dataIndex.push(C.getRawIndex(E)),"inBrush"):"outOfBrush"}:function(E){return CC(T,M,C,E)?(S.dataIndex.push(C.getRawIndex(E)),"inBrush"):"outOfBrush"};(y(w)?p:v(M))&&XG(TC,m,C,I)})}),JG(e,r,o,i,t)}function JG(n,e,t,i,r){if(r){var o=n.getZr();if(!o[oy]){o[ry]||(o[ry]=e4);var a=qp(o,ry,t,e);a(n,i)}}}function e4(n,e){if(!n.isDisposed()){var t=n.getZr();t[oy]=!0,n.dispatchAction({type:"brushSelect",batch:e}),t[oy]=!1}}function CC(n,e,t,i){for(var r=0,o=e.length;r<o;r++){var a=e[r];if(n.brushSelector(i,t,a.selectors,a))return!0}}function t4(n,e){var t=n.option.seriesIndex;return t!=null&&t!=="all"&&(q(t)?be(t,e)<0:e!==t)}var n4={rect:function(n){return kC(n.range)},polygon:function(n){for(var e,t=n.range,i=0,r=t.length;i<r;i++){e=e||[[1/0,-1/0],[1/0,-1/0]];var o=t[i];o[0]<e[0][0]&&(e[0][0]=o[0]),o[0]>e[0][1]&&(e[0][1]=o[0]),o[1]<e[1][0]&&(e[1][0]=o[1]),o[1]>e[1][1]&&(e[1][1]=o[1])}return e&&kC(e)}};function kC(n){return new ve(n[0][0],n[1][0],n[0][1]-n[0][0],n[1][1]-n[1][0])}var i4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){this.ecModel=t,this.api=i,this.model,(this._brushController=new IT(i.getZr())).on("brush",ke(this._onBrush,this)).mount()},e.prototype.render=function(t,i,r,o){this.model=t,this._updateController(t,i,r,o)},e.prototype.updateTransform=function(t,i,r,o){MC(i),this._updateController(t,i,r,o)},e.prototype.updateVisual=function(t,i,r,o){this.updateTransform(t,i,r,o)},e.prototype.updateView=function(t,i,r,o){this._updateController(t,i,r,o)},e.prototype._updateController=function(t,i,r,o){(!o||o.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(r)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var i=this.model.id,r=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:ue(r),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:ue(r),$from:i})},e.type="brush",e}(Et),r4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,i){var r=this.option;!i&&ZG(r,t,["inBrush","outOfBrush"]);var o=r.inBrush=r.inBrush||{};r.outOfBrush=r.outOfBrush||{color:this.option.defaultOutOfBrushColor},o.hasOwnProperty("liftZ")||(o.liftZ=5)},e.prototype.setAreas=function(t){process.env.NODE_ENV!=="production"&&(J(q(t)),N(t,function(i){J(i.brushType,"Illegal areas")})),t&&(this.areas=$(t,function(i){return DC(this.option,i)},this))},e.prototype.setBrushOption=function(t){this.brushOption=DC(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:Z.color.backgroundTint,borderColor:Z.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:Z.color.disabled},e}(De);function DC(n,e){return _e({brushType:n.brushType,brushMode:n.brushMode,transformable:n.transformable,brushStyle:new Ge(n.brushStyle).getItemStyle(),removeOnClick:n.removeOnClick,z:n.z},e,!0)}var o4=["rect","polygon","lineX","lineY","keep","clear"],a4=function(n){W(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,i,r){var o,a,s;i.eachComponent({mainType:"brush"},function(l){o=l.brushType,a=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=o,this._brushMode=a,N(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?a==="multiple":l==="clear"?s:l===o)?"emphasis":"normal")})},e.prototype.updateView=function(t,i,r){this.render(t,i,r)},e.prototype.getIcons=function(){var t=this.model,i=t.get("icon",!0),r={};return N(t.get("type",!0),function(o){i[o]&&(r[o]=i[o])}),r},e.prototype.onclick=function(t,i,r){var o=this._brushType,a=this._brushMode;r==="clear"?(i.dispatchAction({type:"axisAreaSelect",intervals:[]}),i.dispatchAction({type:"brush",command:"clear",areas:[]})):i.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:r==="keep"?o:o===r?!1:r,brushMode:r==="keep"?a==="multiple"?"single":"multiple":a}})},e.getDefaultOption=function(t){var i={show:!0,type:o4.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return i},e}(fn);function s4(n){n.registerComponentView(i4),n.registerComponentModel(r4),n.registerPreprocessor(qG),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,QG),n.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(i){i.setAreas(e.areas)})}),n.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},nt),n.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},nt),xa("brush",a4)}var l4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:Z.size.m,backgroundColor:Z.color.transparent,borderColor:Z.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:Z.color.primary},subtextStyle:{fontSize:12,color:Z.color.quaternary}},e}(De),u4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,r){if(this.group.removeAll(),!!t.get("show")){var o=this.group,a=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=te(t.get("textBaseline"),t.get("textVerticalAlign")),c=new it({style:Yi(a,{text:t.get("text"),fill:a.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),d=t.get("subtext"),f=new it({style:Yi(s,{text:d,fill:s.getTextColor(),y:h.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=t.get("link"),g=t.get("sublink"),m=t.get("triggerEvent",!0);c.silent=!p&&!m,f.silent=!g&&!m,p&&c.on("click",function(){k1(p,"_"+t.get("target"))}),g&&f.on("click",function(){k1(g,"_"+t.get("subtarget"))}),Se(c).eventData=Se(f).eventData=m?{componentType:"title",componentIndex:t.componentIndex}:null,o.add(c),d&&o.add(f);var y=o.getBoundingRect(),v=t.getBoxLayoutParams();v.width=y.width,v.height=y.height;var _=Os(t,r),b=jn(v,_.refContainer,t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?b.x+=b.width:l==="center"&&(b.x+=b.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?b.y+=b.height:u==="middle"&&(b.y+=b.height/2),u=u||"top"),o.x=b.x,o.y=b.y,o.markRedraw();var T={align:l,verticalAlign:u};c.setStyle(T),f.setStyle(T),y=o.getBoundingRect();var w=b.margin,S=t.getItemStyle(["color","opacity"]);S.fill=t.get("backgroundColor");var M=new Ue({shape:{x:y.x-w[3],y:y.y-w[0],width:y.width+w[1]+w[3],height:y.height+w[0]+w[2],r:t.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});o.add(M)}},e.type="title",e}(Et);function c4(n){n.registerComponentModel(l4),n.registerComponentView(u4)}function IC(n,e){if(!n)return!1;for(var t=q(n)?n:[n],i=0;i<t.length;i++)if(t[i]&&t[i][e])return!0;return!1}function sh(n){Mu(n,"label",["show"])}var lh=Re(),ur=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.createdBySelf=!1,t.preventAutoZ=!0,t}return e.prototype.init=function(t,i,r){if(process.env.NODE_ENV!=="production"&&this.type==="marker")throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(t,r),this._mergeOption(t,r,!1,!0)},e.prototype.isAnimationEnabled=function(){if(fe.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},e.prototype.mergeOption=function(t,i){this._mergeOption(t,i,!1,!1)},e.prototype._mergeOption=function(t,i,r,o){var a=this.mainType;r||i.eachSeries(function(s){var l=s.get(this.mainType,!0),u=lh(s)[a];if(!l||!l.data){lh(s)[a]=null;return}u?u._mergeOption(l,i,!0):(o&&sh(l),N(l.data,function(c){c instanceof Array?(sh(c[0]),sh(c[1])):sh(c)}),u=this.createMarkerModelFromSeries(l,this,i),U(u,{mainType:this.mainType,seriesIndex:s.seriesIndex,name:s.name,createdBySelf:!0}),u.__hostSeries=s),lh(s)[a]=u},this)},e.prototype.formatTooltip=function(t,i,r){var o=this.getData(),a=this.getRawValue(t),s=o.getName(t);return Qr("section",{header:this.name,blocks:[Qr("nameValue",{name:s,value:a,noName:!s,noValue:a==null})]})},e.prototype.getData=function(){return this._data},e.prototype.setData=function(t){this._data=t},e.prototype.getDataParams=function(t,i){var r=Ep.prototype.getDataParams.call(this,t,i),o=this.__hostSeries;return o&&(r.seriesId=o.id,r.seriesName=o.name,r.seriesType=o.subType),r},e.getMarkerModelFromSeries=function(t,i){return lh(t)[i]},e.type="marker",e.dependencies=["series","grid","polar","geo"],e}(De);yn(ur,Ep.prototype);function ay(n){return!(isNaN(parseFloat(n.x))&&isNaN(parseFloat(n.y)))}function h4(n){return!isNaN(parseFloat(n.x))&&!isNaN(parseFloat(n.y))}function uh(n,e,t,i,r,o,a){var s=[],l=$r(e,r),u=l?e.getCalculationInfo("stackResultDimension"):r,c=fh(e,u,n),h=e.hostModel,d=h.indicesOfNearest(t,u,c)[0];s[o]=e.get(i,d),s[a]=e.get(u,d);var f=e.get(r,d),p=Wn(e.get(r,d));return p=Math.min(p,20),p>=0&&(s[a]=+s[a].toFixed(p)),[s,f]}var ch={min:we(uh,"min"),max:we(uh,"max"),average:we(uh,"average"),median:we(uh,"median")};function hh(n,e){if(e){var t=n.getData(),i=n.coordinateSystem,r=i&&i.dimensions;if(!h4(e)&&!q(e.coord)&&q(r)){var o=EC(e,t,i,n);if(e=ue(e),e.type&&ch[e.type]&&o.baseAxis&&o.valueAxis){var a=be(r,o.baseAxis.dim),s=be(r,o.valueAxis.dim),l=ch[e.type](t,o.valueAxis.dim,o.baseDataDim,o.valueDataDim,a,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!q(r)){e.coord=[];var u=n.getBaseAxis();if(u&&e.type&&ch[e.type]){var c=i.getOtherAxis(u);c&&(e.value=fh(t,t.mapDimension(c.dim),e.type))}}else for(var h=e.coord,d=0;d<2;d++)ch[h[d]]&&(h[d]=fh(t,t.mapDimension(r[d]),h[d]));return e}}function EC(n,e,t,i){var r={};return n.valueIndex!=null||n.valueDim!=null?(r.valueDataDim=n.valueIndex!=null?e.getDimension(n.valueIndex):n.valueDim,r.valueAxis=t.getAxis(d4(i,r.valueDataDim)),r.baseAxis=t.getOtherAxis(r.valueAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=t.getOtherAxis(r.baseAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim),r.valueDataDim=e.mapDimension(r.valueAxis.dim)),r}function d4(n,e){var t=n.getData().getDimensionInfo(e);return t&&t.coordDim}function dh(n,e){return n&&n.containData&&e.coord&&!ay(e)?n.containData(e.coord):!0}function f4(n,e,t){return n&&n.containZone&&e.coord&&t.coord&&!ay(e)&&!ay(t)?n.containZone(e.coord,t.coord):!0}function p4(n,e){return n?function(t,i,r,o){var a=o<2?t.coord&&t.coord[o]:t.value;return qi(a,e[o])}:function(t,i,r,o){return qi(t.value,e[o])}}function fh(n,e,t){if(t==="average"){var i=0,r=0;return n.each(e,function(o,a){isNaN(o)||(i+=o,r++)}),i/r}else return t==="median"?n.getMedian(e):n.getDataExtent(e)[t==="max"?1:0]}var sy=Re(),NC=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=me()},e.prototype.render=function(t,i,r){var o=this,a=this.markerGroupMap;a.each(function(s){sy(s).keep=!1}),i.eachSeries(function(s){var l=ur.getMarkerModelFromSeries(s,o.type);l&&o.renderSeries(s,l,i,r)}),a.each(function(s){!sy(s).keep&&o.group.remove(s.group)}),g4(i,a,this.type)},e.prototype.markKeep=function(t){sy(t).keep=!0},e.prototype.toggleBlurSeries=function(t,i){var r=this;N(t,function(o){var a=ur.getMarkerModelFromSeries(o,r.type);if(a){var s=a.getData();s.eachItemGraphicEl(function(l){l&&(i?F_(l):Tf(l))})}})},e.type="marker",e}(Et);function g4(n,e,t){n.eachSeries(function(i){var r=ur.getMarkerModelFromSeries(i,t),o=e.get(i.id);if(r&&o&&o.group){var a=Ts(r),s=a.z,l=a.zlevel;qf(o.group,s,l)}})}var m4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,r){return new e(t,i,r)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(ur),ph=Re(),y4=function(n,e,t,i){var r=n.getData(),o;if(q(i))o=i;else{var a=i.type;if(a==="min"||a==="max"||a==="average"||a==="median"||i.xAxis!=null||i.yAxis!=null){var s=void 0,l=void 0;if(i.yAxis!=null||i.xAxis!=null)s=e.getAxis(i.yAxis!=null?"y":"x"),l=vn(i.yAxis,i.xAxis);else{var u=EC(i,r,e,n);s=u.valueAxis;var c=l1(r,u.valueDataDim);l=fh(r,c,a)}var h=s.dim==="x"?0:1,d=1-h,f=ue(i),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var g=t.get("precision");g>=0&&Ne(l)&&(l=+l.toFixed(Math.min(g,20))),f.coord[h]=p.coord[h]=l,o=[f,p,{type:a,valueIndex:i.valueIndex,value:l}]}else process.env.NODE_ENV!=="production"&&Nn("Invalid markLine data."),o=[]}var m=[hh(n,o[0]),hh(n,o[1]),U({},o[2])];return m[2].type=m[2].type||null,_e(m[2],m[0]),_e(m[2],m[1]),m};function gh(n){return!isNaN(n)&&!isFinite(n)}function AC(n,e,t,i){var r=1-n,o=i.dimensions[n];return gh(e[r])&&gh(t[r])&&e[n]===t[n]&&i.getAxis(o).containData(e[n])}function v4(n,e){if(n.type==="cartesian2d"){var t=e[0].coord,i=e[1].coord;if(t&&i&&(AC(1,t,i,n)||AC(0,t,i,n)))return!0}return dh(n,e[0])&&dh(n,e[1])}function ly(n,e,t,i,r){var o=i.coordinateSystem,a=n.getItemModel(e),s,l=Pe(a.get("x"),r.getWidth()),u=Pe(a.get("y"),r.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition)s=i.getMarkerPosition(n.getValues(n.dimensions,e));else{var c=o.dimensions,h=n.get(c[0],e),d=n.get(c[1],e);s=o.dataToPoint([h,d])}if(ia(o,"cartesian2d")){var f=o.getAxis("x"),p=o.getAxis("y"),c=o.dimensions;gh(n.get(c[0],e))?s[0]=f.toGlobalCoord(f.getExtent()[t?0:1]):gh(n.get(c[1],e))&&(s[1]=p.toGlobalCoord(p.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}n.setItemLayout(e,s)}var _4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,r){i.eachSeries(function(o){var a=ur.getMarkerModelFromSeries(o,"markLine");if(a){var s=a.getData(),l=ph(a).from,u=ph(a).to;l.each(function(c){ly(l,c,!0,o,r),ly(u,c,!1,o,r)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(o.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,i,r,o){var a=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new BH);this.group.add(c.group);var h=x4(a,t,i),d=h.from,f=h.to,p=h.line;ph(i).from=d,ph(i).to=f,i.setData(p);var g=i.get("symbol"),m=i.get("symbolSize"),y=i.get("symbolRotate"),v=i.get("symbolOffset");q(g)||(g=[g,g]),q(m)||(m=[m,m]),q(y)||(y=[y,y]),q(v)||(v=[v,v]),h.from.each(function(b){_(d,b,!0),_(f,b,!1)}),p.each(function(b){var T=p.getItemModel(b),w=T.getModel("lineStyle").getLineStyle();p.setItemLayout(b,[d.getItemLayout(b),f.getItemLayout(b)]);var S=T.get("z2");w.stroke==null&&(w.stroke=d.getItemVisual(b,"style").fill),p.setItemVisual(b,{z2:te(S,0),fromSymbolKeepAspect:d.getItemVisual(b,"symbolKeepAspect"),fromSymbolOffset:d.getItemVisual(b,"symbolOffset"),fromSymbolRotate:d.getItemVisual(b,"symbolRotate"),fromSymbolSize:d.getItemVisual(b,"symbolSize"),fromSymbol:d.getItemVisual(b,"symbol"),toSymbolKeepAspect:f.getItemVisual(b,"symbolKeepAspect"),toSymbolOffset:f.getItemVisual(b,"symbolOffset"),toSymbolRotate:f.getItemVisual(b,"symbolRotate"),toSymbolSize:f.getItemVisual(b,"symbolSize"),toSymbol:f.getItemVisual(b,"symbol"),style:w})}),c.updateData(p),h.line.eachItemGraphicEl(function(b){Se(b).dataModel=i,b.traverse(function(T){Se(T).dataModel=i})});function _(b,T,w){var S=b.getItemModel(T);ly(b,T,w,t,o);var M=S.getModel("itemStyle").getItemStyle();M.fill==null&&(M.fill=wg(l,"color")),b.setItemVisual(T,{symbolKeepAspect:S.get("symbolKeepAspect"),symbolOffset:te(S.get("symbolOffset",!0),v[w?0:1]),symbolRotate:te(S.get("symbolRotate",!0),y[w?0:1]),symbolSize:te(S.get("symbolSize"),m[w?0:1]),symbol:te(S.get("symbol",!0),g[w?0:1]),style:M})}this.markKeep(c),c.group.silent=i.get("silent")||t.get("silent")},e.type="markLine",e}(NC);function x4(n,e,t){var i;n?i=$(n&&n.dimensions,function(u){var c=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return U(U({},c),{name:u,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var r=new jr(i,t),o=new jr(i,t),a=new jr([],t),s=$(t.get("data"),we(y4,e,n,t));n&&(s=$e(s,we(v4,n)));var l=p4(!!n,i);return r.initData($(s,function(u){return u[0]}),null,l),o.initData($(s,function(u){return u[1]}),null,l),a.initData($(s,function(u){return u[2]})),a.hasItemOption=!0,{from:r,to:o,line:a}}function b4(n){n.registerComponentModel(m4),n.registerComponentView(_4),n.registerPreprocessor(function(e){IC(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var w4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,r){return new e(t,i,r)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(ur),mh=Re(),S4=function(n,e,t,i){var r=i[0],o=i[1];if(!(!r||!o)){var a=hh(n,r),s=hh(n,o),l=a.coord,u=s.coord;l[0]=vn(l[0],-1/0),l[1]=vn(l[1],-1/0),u[0]=vn(u[0],1/0),u[1]=vn(u[1],1/0);var c=b2([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function yh(n){return!isNaN(n)&&!isFinite(n)}function OC(n,e,t,i){var r=1-n;return yh(e[r])&&yh(t[r])}function T4(n,e){var t=e.coord[0],i=e.coord[1],r={coord:t,x:e.x0,y:e.y0},o={coord:i,x:e.x1,y:e.y1};return ia(n,"cartesian2d")?t&&i&&(OC(1,t,i)||OC(0,t,i))?!0:f4(n,r,o):dh(n,r)||dh(n,o)}function RC(n,e,t,i,r){var o=i.coordinateSystem,a=n.getItemModel(e),s,l=Pe(a.get(t[0]),r.getWidth()),u=Pe(a.get(t[1]),r.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition){var c=n.getValues(["x0","y0"],e),h=n.getValues(["x1","y1"],e),d=o.clampData(c),f=o.clampData(h),p=[];t[0]==="x0"?p[0]=d[0]>f[0]?h[0]:c[0]:p[0]=d[0]>f[0]?c[0]:h[0],t[1]==="y0"?p[1]=d[1]>f[1]?h[1]:c[1]:p[1]=d[1]>f[1]?c[1]:h[1],s=i.getMarkerPosition(p,t,!0)}else{var g=n.get(t[0],e),m=n.get(t[1],e),y=[g,m];o.clampData&&o.clampData(y,y),s=o.dataToPoint(y,!0)}if(ia(o,"cartesian2d")){var v=o.getAxis("x"),_=o.getAxis("y"),g=n.get(t[0],e),m=n.get(t[1],e);yh(g)?s[0]=v.toGlobalCoord(v.getExtent()[t[0]==="x0"?0:1]):yh(m)&&(s[1]=_.toGlobalCoord(_.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var LC=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],M4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,r){i.eachSeries(function(o){var a=ur.getMarkerModelFromSeries(o,"markArea");if(a){var s=a.getData();s.each(function(l){var u=$(LC,function(h){return RC(s,l,h,o,r)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,i,r,o){var a=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Ye});this.group.add(c.group),this.markKeep(c);var h=C4(a,t,i);i.setData(h),h.each(function(d){var f=$(LC,function(I){return RC(h,d,I,t,o)}),p=a.getAxis("x").scale,g=a.getAxis("y").scale,m=p.getExtent(),y=g.getExtent(),v=[p.parse(h.get("x0",d)),p.parse(h.get("x1",d))],_=[g.parse(h.get("y0",d)),g.parse(h.get("y1",d))];pf(v),pf(_);var b=!(m[0]>v[1]||m[1]<v[0]||y[0]>_[1]||y[1]<_[0]),T=!b;h.setItemLayout(d,{points:f,allClipped:T});var w=h.getItemModel(d),S=w.getModel("itemStyle").getItemStyle(),M=w.get("z2"),C=wg(l,"color");S.fill||(S.fill=C,Q(S.fill)&&(S.fill=Bd(S.fill,.4))),S.stroke||(S.stroke=C),h.setItemVisual(d,"style",S),h.setItemVisual(d,"z2",te(M,0))}),h.diff(mh(c).data).add(function(d){var f=h.getItemLayout(d),p=h.getItemVisual(d,"z2");if(!f.allClipped){var g=new qo({z2:te(p,0),shape:{points:f.points}});h.setItemGraphicEl(d,g),c.group.add(g)}}).update(function(d,f){var p=mh(c).data.getItemGraphicEl(f),g=h.getItemLayout(d),m=h.getItemVisual(d,"z2");g.allClipped?p&&c.group.remove(p):(p?ft(p,{z2:te(m,0),shape:{points:g.points}},i,d):p=new qo({shape:{points:g.points}}),h.setItemGraphicEl(d,p),c.group.add(p))}).remove(function(d){var f=mh(c).data.getItemGraphicEl(d);c.group.remove(f)}).execute(),h.eachItemGraphicEl(function(d,f){var p=h.getItemModel(f),g=h.getItemVisual(f,"style");d.useStyle(h.getItemVisual(f,"style")),Fr(d,Ui(p),{labelFetcher:i,labelDataIndex:f,defaultText:h.getName(f)||"",inheritColor:Q(g.fill)?Bd(g.fill,1):Z.color.neutral99}),fs(d,p),zr(d,null,null,p.get(["emphasis","disabled"])),Se(d).dataModel=i}),mh(c).data=h,c.group.silent=i.get("silent")||t.get("silent")},e.type="markArea",e}(NC);function C4(n,e,t){var i,r,o=["x0","y0","x1","y1"];if(n){var a=$(n&&n.dimensions,function(u){var c=e.getData(),h=c.getDimensionInfo(c.mapDimension(u))||{};return U(U({},h),{name:u,ordinalMeta:null})});r=$(o,function(u,c){return{name:u,type:a[c%2].type}}),i=new jr(r,t)}else r=[{name:"value",type:"float"}],i=new jr(r,t);var s=$(t.get("data"),we(S4,e,n,t));n&&(s=$e(s,we(T4,n)));var l=n?function(u,c,h,d){var f=u.coord[Math.floor(d/2)][d%2];return qi(f,r[d])}:function(u,c,h,d){return qi(u.value,r[d])};return i.initData(s,null,l),i.hasItemOption=!0,i}function k4(n){n.registerComponentModel(w4),n.registerComponentView(M4),n.registerPreprocessor(function(e){IC(e.series,"markArea")&&(e.markArea=e.markArea||{})})}var D4=function(n,e){if(e==="all")return{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:n.getLocaleModel().get(["legend","selector","inverse"])}},uy=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.prototype.init=function(t,i,r){this.mergeDefaultAndTheme(t,r),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(t,i){n.prototype.mergeOption.call(this,t,i),this._updateSelector(t)},e.prototype._updateSelector=function(t){var i=t.selector,r=this.ecModel;i===!0&&(i=t.selector=["all","inverse"]),q(i)&&N(i,function(o,a){Q(o)&&(o={type:o}),i[a]=_e(o,D4(r,o.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&this.get("selectedMode")==="single"){for(var i=!1,r=0;r<t.length;r++){var o=t[r].get("name");if(this.isSelected(o)){this.select(o),i=!0;break}}!i&&this.select(t[0].get("name"))}},e.prototype._updateData=function(t){var i=[],r=[];t.eachRawSeries(function(l){var u=l.name;r.push(u);var c;if(l.legendVisualProvider){var h=l.legendVisualProvider,d=h.getAllNames();t.isSeriesFiltered(l)||(r=r.concat(d)),d.length?i=i.concat(d):c=!0}else c=!0;c&&mf(l)&&i.push(l.name)}),this._availableNames=r;var o=this.get("data")||i,a=me(),s=$(o,function(l){return(Q(l)||Ne(l))&&(l={name:l}),a.get(l.name)?null:(a.set(l.name,!0),new Ge(l,this,this.ecModel))},this);this._data=$e(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(t){var i=this.option.selected,r=this.get("selectedMode");if(r==="single"){var o=this._data;N(o,function(a){i[a.get("name")]=!1})}i[t]=!0},e.prototype.unSelect=function(t){this.get("selectedMode")!=="single"&&(this.option.selected[t]=!1)},e.prototype.toggleSelected=function(t){var i=this.option.selected;i.hasOwnProperty(t)||(i[t]=!0),this[i[t]?"unSelect":"select"](t)},e.prototype.allSelect=function(){var t=this._data,i=this.option.selected;N(t,function(r){i[r.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var t=this._data,i=this.option.selected;N(t,function(r){var o=r.get("name",!0);i.hasOwnProperty(o)||(i[o]=!0),i[o]=!i[o]})},e.prototype.isSelected=function(t){var i=this.option.selected;return!(i.hasOwnProperty(t)&&!i[t])&&be(this._availableNames,t)>=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",bottom:Z.size.m,align:"auto",backgroundColor:Z.color.transparent,borderColor:Z.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:Z.color.disabled,inactiveBorderColor:Z.color.disabled,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:Z.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:Z.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:Z.color.tertiary,borderWidth:1,borderColor:Z.color.border},emphasis:{selectorLabel:{show:!0,color:Z.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},e}(De),wa=we,cy=N,vh=Ye,PC=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new vh),this.group.add(this._selectorGroup=new vh),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,i,r){var o=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var a=t.get("align"),s=t.get("orient");(!a||a==="auto")&&(a=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(a,t,i,r,l,s,u);var c=Os(t,r).refContainer,h=t.getBoxLayoutParams(),d=t.get("padding"),f=jn(h,c,d),p=this.layoutInner(t,a,f,o,l,u),g=jn(Me({width:p.width,height:p.height},h),c,d);this.group.x=g.x-p.x,this.group.y=g.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=QM(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,i,r,o,a,s,l){var u=this.getContentGroup(),c=me(),h=i.get("selectedMode"),d=i.get("triggerEvent"),f=[];r.eachRawSeries(function(p){!p.get("legendHoverLink")&&f.push(p.id)}),cy(i.getData(),function(p,g){var m=this,y=p.get("name");if(!this.newlineDisabled&&(y===""||y===`
|
|
65
|
+
`)){var v=new vh;v.newline=!0,u.add(v);return}var _=r.getSeriesByName(y)[0];if(!c.get(y)){if(_){var b=_.getData(),T=b.getVisual("legendLineStyle")||{},w=b.getVisual("legendIcon"),S=b.getVisual("style"),M=this._createItem(_,y,g,p,i,t,T,S,w,h,o);M.on("click",wa(zC,y,null,o,f)).on("mouseover",wa(hy,_.name,null,o,f)).on("mouseout",wa(dy,_.name,null,o,f)),r.ssr&&M.eachChild(function(C){var I=Se(C);I.seriesIndex=_.seriesIndex,I.dataIndex=g,I.ssrType="legend"}),d&&M.eachChild(function(C){m.packEventData(C,i,_,g,y)}),c.set(y,!0)}else r.eachRawSeries(function(C){var I=this;if(!c.get(y)&&C.legendVisualProvider){var E=C.legendVisualProvider;if(!E.containName(y))return;var k=E.indexOfName(y),D=E.getItemVisual(k,"style"),A=E.getItemVisual(k,"legendIcon"),R=Ut(D.fill);R&&R[3]===0&&(R[3]=.2,D=U(U({},D),{fill:ui(R,"rgba")}));var L=this._createItem(C,y,g,p,i,t,{},D,A,h,o);L.on("click",wa(zC,null,y,o,f)).on("mouseover",wa(hy,null,y,o,f)).on("mouseout",wa(dy,null,y,o,f)),r.ssr&&L.eachChild(function(V){var z=Se(V);z.seriesIndex=C.seriesIndex,z.dataIndex=g,z.ssrType="legend"}),d&&L.eachChild(function(V){I.packEventData(V,i,C,g,y)}),c.set(y,!0)}},this);process.env.NODE_ENV!=="production"&&(c.get(y)||console.warn(y+" series not exists. Legend data should be same with series name or data name."))}},this),a&&this._createSelector(a,i,o,s,l)},e.prototype.packEventData=function(t,i,r,o,a){var s={componentType:"legend",componentIndex:i.componentIndex,dataIndex:o,value:a,seriesIndex:r.seriesIndex};Se(t).eventData=s},e.prototype._createSelector=function(t,i,r,o,a){var s=this.getSelectorGroup();cy(t,function(l){var u=l.type,c=new it({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){r.dispatchAction({type:u==="all"?"legendAllSelect":"legendInverseSelect",legendId:i.id})}});s.add(c);var h=i.getModel("selectorLabel"),d=i.getModel(["emphasis","selectorLabel"]);Fr(c,{normal:h,emphasis:d},{defaultText:l.title}),Df(c)})},e.prototype._createItem=function(t,i,r,o,a,s,l,u,c,h,d){var f=t.visualDrawType,p=a.get("itemWidth"),g=a.get("itemHeight"),m=a.isSelected(i),y=o.get("symbolRotate"),v=o.get("symbolKeepAspect"),_=o.get("icon");c=_||c||"roundRect";var b=I4(c,o,l,u,f,m,d),T=new vh,w=o.getModel("textStyle");if(ce(t.getLegendIcon)&&(!_||_==="inherit"))T.add(t.getLegendIcon({itemWidth:p,itemHeight:g,icon:c,iconRotate:y,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:v}));else{var S=_==="inherit"&&t.getData().getVisual("symbol")?y==="inherit"?t.getData().getVisual("symbolRotate"):y:0;T.add(E4({itemWidth:p,itemHeight:g,icon:c,iconRotate:S,itemStyle:b.itemStyle,symbolKeepAspect:v}))}var M=s==="left"?p+5:-5,C=s,I=a.get("formatter"),E=i;Q(I)&&I?E=I.replace("{name}",i??""):ce(I)&&(E=I(i));var k=m?w.getTextColor():o.get("inactiveColor");T.add(new it({style:Yi(w,{text:E,x:M,y:g/2,fill:k,align:C,verticalAlign:"middle"},{inheritColor:k})}));var D=new Ue({shape:T.getBoundingRect(),style:{fill:"transparent"}}),A=o.getModel("tooltip");return A.get("show")&&bs({el:D,componentModel:a,itemName:i,itemTooltipOption:A.option}),T.add(D),T.eachChild(function(R){R.silent=!0}),D.silent=!h,this.getContentGroup().add(T),Df(T),T.__legendDataIndex=r,T},e.prototype.layoutInner=function(t,i,r,o,a,s){var l=this.getContentGroup(),u=this.getSelectorGroup();na(t.get("orient"),l,t.get("itemGap"),r.width,r.height);var c=l.getBoundingRect(),h=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),a){na("horizontal",u,t.get("selectorItemGap",!0));var d=u.getBoundingRect(),f=[-d.x,-d.y],p=t.get("selectorButtonGap",!0),g=t.getOrient().index,m=g===0?"width":"height",y=g===0?"height":"width",v=g===0?"y":"x";s==="end"?f[g]+=c[m]+p:h[g]+=d[m]+p,f[1-g]+=c[y]/2-d[y]/2,u.x=f[0],u.y=f[1],l.x=h[0],l.y=h[1];var _={x:0,y:0};return _[m]=c[m]+p+d[m],_[y]=Math.max(c[y],d[y]),_[v]=Math.min(0,d[v]+f[1-g]),_}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Et);function I4(n,e,t,i,r,o,a){function s(m,y){m.lineWidth==="auto"&&(m.lineWidth=y.lineWidth>0?2:0),cy(m,function(v,_){m[_]==="inherit"&&(m[_]=y[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=n.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?i.decal:kg(h,a),u.fill==="inherit"&&(u.fill=i[r]),u.stroke==="inherit"&&(u.stroke=i[c]),u.opacity==="inherit"&&(u.opacity=(r==="fill"?i:t).opacity),s(u,i);var d=e.getModel("lineStyle"),f=d.getLineStyle();if(s(f,t),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),f.stroke==="auto"&&(f.stroke=i.fill),!o){var p=e.get("inactiveBorderWidth"),g=u[c];u.lineWidth=p==="auto"?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),f.stroke=d.get("inactiveColor"),f.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:f}}function E4(n){var e=n.icon||"roundRect",t=Jr(e,0,0,n.itemWidth,n.itemHeight,n.itemStyle.fill,n.symbolKeepAspect);return t.setStyle(n.itemStyle),t.rotation=(n.iconRotate||0)*Math.PI/180,t.setOrigin([n.itemWidth/2,n.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill=Z.color.neutral00,t.style.lineWidth=2),t}function zC(n,e,t,i){dy(n,e,t,i),t.dispatchAction({type:"legendToggleSelect",name:n??e}),hy(n,e,t,i)}function BC(n){for(var e=n.getZr().storage.getDisplayList(),t,i=0,r=e.length;i<r&&!(t=e[i].states.emphasis);)i++;return t&&t.hoverLayer}function hy(n,e,t,i){BC(t)||t.dispatchAction({type:"highlight",seriesName:n,name:e,excludeSeriesId:i})}function dy(n,e,t,i){BC(t)||t.dispatchAction({type:"downplay",seriesName:n,name:e,excludeSeriesId:i})}function N4(n){var e=n.findComponents({mainType:"legend"});e&&e.length&&n.filterSeries(function(t){for(var i=0;i<e.length;i++)if(!e[i].isSelected(t.name))return!1;return!0})}function gl(n,e,t){var i=n==="allSelect"||n==="inverseSelect",r={},o=[];t.eachComponent({mainType:"legend",query:e},function(s){i?s[n]():s[n](e.name),VC(s,r),o.push(s.componentIndex)});var a={};return t.eachComponent("legend",function(s){N(r,function(l,u){s[l?"select":"unSelect"](u)}),VC(s,a)}),i?{selected:a,legendIndex:o}:{name:e.name,selected:a}}function VC(n,e){var t=e||{};return N(n.getData(),function(i){var r=i.get("name");if(!(r===`
|
|
66
|
+
`||r==="")){var o=n.isSelected(r);_n(t,r)?t[r]=t[r]&&o:t[r]=o}}),t}function A4(n){n.registerAction("legendToggleSelect","legendselectchanged",we(gl,"toggleSelected")),n.registerAction("legendAllSelect","legendselectall",we(gl,"allSelect")),n.registerAction("legendInverseSelect","legendinverseselect",we(gl,"inverseSelect")),n.registerAction("legendSelect","legendselected",we(gl,"select")),n.registerAction("legendUnSelect","legendunselected",we(gl,"unSelect"))}function HC(n){n.registerComponentModel(uy),n.registerComponentView(PC),n.registerProcessor(n.PRIORITY.PROCESSOR.SERIES_FILTER,N4),n.registerSubTypeDefaulter("legend",function(){return"plain"}),A4(n)}var O4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(t,i,r){var o=Ls(t);n.prototype.init.call(this,t,i,r),FC(this,t,o)},e.prototype.mergeOption=function(t,i){n.prototype.mergeOption.call(this,t,i),FC(this,this.option,t)},e.type="legend.scroll",e.defaultOption=u1(uy.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:Z.color.accent50,pageIconInactiveColor:Z.color.accent10,pageIconSize:15,pageTextStyle:{color:Z.color.tertiary},animationDurationUpdate:800}),e}(uy);function FC(n,e,t){var i=n.getOrient(),r=[1,1];r[i.index]=0,Zi(e,t,{type:"box",ignoreSize:!!r})}var GC=Ye,fy=["width","height"],py=["x","y"],R4=function(n){W(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!0,t._currentIndex=0,t}return e.prototype.init=function(){n.prototype.init.call(this),this.group.add(this._containerGroup=new GC),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new GC)},e.prototype.resetInner=function(){n.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(t,i,r,o,a,s,l){var u=this;n.prototype.renderInner.call(this,t,i,r,o,a,s,l);var c=this._controllerGroup,h=i.get("pageIconSize",!0),d=q(h)?h:[h,h];p("pagePrev",0);var f=i.getModel("pageTextStyle");c.add(new it({name:"pageText",style:{text:"xx/xx",fill:f.getTextColor(),font:f.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1);function p(g,m){var y=g+"DataIndex",v=Wu(i.get("pageIcons",!0)[i.getOrient().name][m],{onclick:ke(u._pageGo,u,y,i,o)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});v.name=g,c.add(v)}},e.prototype.layoutInner=function(t,i,r,o,a,s){var l=this.getSelectorGroup(),u=t.getOrient().index,c=fy[u],h=py[u],d=fy[1-u],f=py[1-u];a&&na("horizontal",l,t.get("selectorItemGap",!0));var p=t.get("selectorButtonGap",!0),g=l.getBoundingRect(),m=[-g.x,-g.y],y=ue(r);a&&(y[c]=r[c]-g[c]-p);var v=this._layoutContentAndController(t,o,y,u,c,d,f,h);if(a){if(s==="end")m[u]+=v[c]+p;else{var _=g[c]+p;m[u]-=_,v[h]-=_}v[c]+=g[c]+p,m[1-u]+=v[f]+v[d]/2-g[d]/2,v[d]=Math.max(v[d],g[d]),v[f]=Math.min(v[f],g[f]+m[1-u]),l.x=m[0],l.y=m[1],l.markRedraw()}return v},e.prototype._layoutContentAndController=function(t,i,r,o,a,s,l,u){var c=this.getContentGroup(),h=this._containerGroup,d=this._controllerGroup;na(t.get("orient"),c,t.get("itemGap"),o?r.width:null,o?null:r.height),na("horizontal",d,t.get("pageButtonItemGap",!0));var f=c.getBoundingRect(),p=d.getBoundingRect(),g=this._showController=f[a]>r[a],m=[-f.x,-f.y];i||(m[o]=c[u]);var y=[0,0],v=[-p.x,-p.y],_=te(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(g){var b=t.get("pageButtonPosition",!0);b==="end"?v[o]+=r[a]-p[a]:y[o]+=p[a]+_}v[1-o]+=f[s]/2-p[s]/2,c.setPosition(m),h.setPosition(y),d.setPosition(v);var T={x:0,y:0};if(T[a]=g?r[a]:f[a],T[s]=Math.max(f[s],p[s]),T[l]=Math.min(0,p[l]+v[1-o]),h.__rectSize=r[a],g){var w={x:0,y:0};w[a]=Math.max(r[a]-p[a]-_,0),w[s]=T[s],h.setClipPath(new Ue({shape:w})),h.__rectSize=w[a]}else d.eachChild(function(M){M.attr({invisible:!0,silent:!0})});var S=this._getPageInfo(t);return S.pageIndex!=null&&ft(c,{x:S.contentPosition[0],y:S.contentPosition[1]},g?t:null),this._updatePageInfoView(t,S),T},e.prototype._pageGo=function(t,i,r){var o=this._getPageInfo(i)[t];o!=null&&r.dispatchAction({type:"legendScroll",scrollDataIndex:o,legendId:i.id})},e.prototype._updatePageInfoView=function(t,i){var r=this._controllerGroup;N(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",d=i[h]!=null,f=r.childOfName(c);f&&(f.setStyle("fill",d?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),f.cursor=d?"pointer":"default")});var o=r.childOfName("pageText"),a=t.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;o&&a&&o.setStyle("text",Q(a)?a.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):a({current:l,total:u}))},e.prototype._getPageInfo=function(t){var i=t.get("scrollDataIndex",!0),r=this.getContentGroup(),o=this._containerGroup.__rectSize,a=t.getOrient().index,s=fy[a],l=py[a],u=this._findTargetItemIndex(i),c=r.children(),h=c[u],d=c.length,f=d?1:0,p={contentPosition:[r.x,r.y],pageCount:f,pageIndex:f-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return p;var g=b(h);p.contentPosition[a]=-g.s;for(var m=u+1,y=g,v=g,_=null;m<=d;++m)_=b(c[m]),(!_&&v.e>y.s+o||_&&!T(_,y.s))&&(v.i>y.i?y=v:y=_,y&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=y.i),++p.pageCount)),v=_;for(var m=u-1,y=g,v=g,_=null;m>=-1;--m)_=b(c[m]),(!_||!T(v,_.s))&&y.i<v.i&&(v=y,p.pagePrevDataIndex==null&&(p.pagePrevDataIndex=y.i),++p.pageCount,++p.pageIndex),y=_;return p;function b(w){if(w){var S=w.getBoundingRect(),M=S[l]+w[l];return{s:M,e:M+S[s],i:w.__legendDataIndex}}}function T(w,S){return w.e>=S&&w.s<=S+o}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var i,r=this.getContentGroup(),o;return r.eachChild(function(a,s){var l=a.__legendDataIndex;o==null&&l!=null&&(o=s),l===t&&(i=s)}),i??o},e.type="legend.scroll",e}(PC);function L4(n){n.registerAction("legendScroll","legendscroll",function(e,t){var i=e.scrollDataIndex;i!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(r){r.setScrollDataIndex(i)})})}function P4(n){bi(HC),n.registerComponentModel(O4),n.registerComponentView(R4),L4(n)}function z4(n){bi(HC),bi(P4)}function gy(n){return x.getCurrentScope()?(x.onScopeDispose(n),!0):!1}const WC=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const B4=n=>n!=null,V4=Object.prototype.toString,H4=n=>V4.call(n)==="[object Object]",UC=()=>{};function F4(n,e){function t(...i){return new Promise((r,o)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(o)})}return t}function G4(n,e={}){let t,i,r=UC;const o=s=>{clearTimeout(s),r(),r=UC};let a;return s=>{const l=x.toValue(n),u=x.toValue(e.maxWait);return t&&o(t),l<=0||u!==void 0&&u<=0?(i&&(o(i),i=void 0),Promise.resolve(s())):new Promise((c,h)=>{r=e.rejectOnCancel?h:c,a=s,u&&!i&&(i=setTimeout(()=>{t&&o(t),i=void 0,c(a())},u)),t=setTimeout(()=>{i&&o(i),i=void 0,c(s())},l)})}}function ml(n){return Array.isArray(n)?n:[n]}function W4(n){return x.getCurrentInstance()}function U4(n,e=200,t={}){return F4(G4(e,t),n)}function Y4(n,e={}){if(!x.isRef(n))return x.toRefs(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=x.customRef(()=>({get(){return n.value[i]},set(r){var o;if((o=x.toValue(e.replaceRef))==null||o)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return t}function YC(n,e=!0,t){W4()?x.onMounted(n,t):e?n():x.nextTick(n)}function q4(n,e,t){return x.watch(n,e,{...t,immediate:!0})}const yl=WC?window:void 0;function Kn(n){var e;const t=x.toValue(n);return(e=t==null?void 0:t.$el)!=null?e:t}function vl(...n){const e=[],t=()=>{e.forEach(s=>s()),e.length=0},i=(s,l,u,c)=>(s.addEventListener(l,u,c),()=>s.removeEventListener(l,u,c)),r=x.computed(()=>{const s=ml(x.toValue(n[0])).filter(l=>l!=null);return s.every(l=>typeof l!="string")?s:void 0}),o=q4(()=>{var s,l;return[(l=(s=r.value)==null?void 0:s.map(u=>Kn(u)))!=null?l:[yl].filter(u=>u!=null),ml(x.toValue(r.value?n[1]:n[0])),ml(x.unref(r.value?n[2]:n[1])),x.toValue(r.value?n[3]:n[2])]},([s,l,u,c])=>{if(t(),!(s!=null&&s.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const h=H4(c)?{...c}:c;e.push(...s.flatMap(d=>l.flatMap(f=>u.map(p=>i(d,f,p,h)))))},{flush:"post"}),a=()=>{o(),t()};return gy(t),a}function j4(){const n=x.shallowRef(!1),e=x.getCurrentInstance();return e&&x.onMounted(()=>{n.value=!0},e),n}function qC(n){const e=j4();return x.computed(()=>(e.value,!!n()))}function $4(n,e,t={}){const{window:i=yl,...r}=t;let o;const a=qC(()=>i&&"MutationObserver"in i),s=()=>{o&&(o.disconnect(),o=void 0)},l=x.computed(()=>{const d=x.toValue(n),f=ml(d).map(Kn).filter(B4);return new Set(f)}),u=x.watch(()=>l.value,d=>{s(),a.value&&d.size&&(o=new MutationObserver(e),d.forEach(f=>o.observe(f,r)))},{immediate:!0,flush:"post"}),c=()=>o==null?void 0:o.takeRecords(),h=()=>{u(),s()};return gy(h),{isSupported:a,stop:h,takeRecords:c}}function Z4(n,e={}){var t;const{pointerTypes:i,preventDefault:r,stopPropagation:o,exact:a,onMove:s,onEnd:l,onStart:u,initialValue:c,axis:h="both",draggingElement:d=yl,containerElement:f,handle:p=n,buttons:g=[0]}=e,m=x.ref((t=x.toValue(c))!=null?t:{x:0,y:0}),y=x.ref(),v=S=>i?i.includes(S.pointerType):!0,_=S=>{x.toValue(r)&&S.preventDefault(),x.toValue(o)&&S.stopPropagation()},b=S=>{var M;if(!x.toValue(g).includes(S.button)||x.toValue(e.disabled)||!v(S)||x.toValue(a)&&S.target!==x.toValue(n))return;const C=x.toValue(f),I=(M=C==null?void 0:C.getBoundingClientRect)==null?void 0:M.call(C),E=x.toValue(n).getBoundingClientRect(),k={x:S.clientX-(C?E.left-I.left+C.scrollLeft:E.left),y:S.clientY-(C?E.top-I.top+C.scrollTop:E.top)};(u==null?void 0:u(k,S))!==!1&&(y.value=k,_(S))},T=S=>{if(x.toValue(e.disabled)||!v(S)||!y.value)return;const M=x.toValue(f),C=x.toValue(n).getBoundingClientRect();let{x:I,y:E}=m.value;(h==="x"||h==="both")&&(I=S.clientX-y.value.x,M&&(I=Math.min(Math.max(0,I),M.scrollWidth-C.width))),(h==="y"||h==="both")&&(E=S.clientY-y.value.y,M&&(E=Math.min(Math.max(0,E),M.scrollHeight-C.height))),m.value={x:I,y:E},s==null||s(m.value,S),_(S)},w=S=>{x.toValue(e.disabled)||!v(S)||y.value&&(y.value=void 0,l==null||l(m.value,S),_(S))};if(WC){const S=()=>{var M;return{capture:(M=e.capture)!=null?M:!0,passive:!x.toValue(r)}};vl(p,"pointerdown",b,S),vl(d,"pointermove",T,S),vl(d,"pointerup",w,S)}return{...Y4(m),position:m,isDragging:x.computed(()=>!!y.value),style:x.computed(()=>`left:${m.value.x}px;top:${m.value.y}px;`)}}function jC(n,e,t={}){const{window:i=yl,...r}=t;let o;const a=qC(()=>i&&"ResizeObserver"in i),s=()=>{o&&(o.disconnect(),o=void 0)},l=x.computed(()=>{const h=x.toValue(n);return Array.isArray(h)?h.map(d=>Kn(d)):[Kn(h)]}),u=x.watch(l,h=>{if(s(),a.value&&i){o=new ResizeObserver(e);for(const d of h)d&&o.observe(d,r)}},{immediate:!0,flush:"post"}),c=()=>{s(),u()};return gy(c),{isSupported:a,stop:c}}function X4(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:r=!0,immediate:o=!0,updateTiming:a="sync"}=e,s=x.shallowRef(0),l=x.shallowRef(0),u=x.shallowRef(0),c=x.shallowRef(0),h=x.shallowRef(0),d=x.shallowRef(0),f=x.shallowRef(0),p=x.shallowRef(0);function g(){const y=Kn(n);if(!y){t&&(s.value=0,l.value=0,u.value=0,c.value=0,h.value=0,d.value=0,f.value=0,p.value=0);return}const v=y.getBoundingClientRect();s.value=v.height,l.value=v.bottom,u.value=v.left,c.value=v.right,h.value=v.top,d.value=v.width,f.value=v.x,p.value=v.y}function m(){a==="sync"?g():a==="next-frame"&&requestAnimationFrame(()=>g())}return jC(n,m),x.watch(()=>Kn(n),y=>!y&&m()),$4(n,m,{attributeFilter:["style","class"]}),r&&vl("scroll",m,{capture:!0,passive:!0}),i&&vl("resize",m,{passive:!0}),YC(()=>{o&&m()}),{height:s,bottom:l,left:u,right:c,top:h,width:d,x:f,y:p,update:m}}function $C(n,e={width:0,height:0},t={}){const{window:i=yl,box:r="content-box"}=t,o=x.computed(()=>{var h,d;return(d=(h=Kn(n))==null?void 0:h.namespaceURI)==null?void 0:d.includes("svg")}),a=x.shallowRef(e.width),s=x.shallowRef(e.height),{stop:l}=jC(n,([h])=>{const d=r==="border-box"?h.borderBoxSize:r==="content-box"?h.contentBoxSize:h.devicePixelContentBoxSize;if(i&&o.value){const f=Kn(n);if(f){const p=f.getBoundingClientRect();a.value=p.width,s.value=p.height}}else if(d){const f=ml(d);a.value=f.reduce((p,{inlineSize:g})=>p+g,0),s.value=f.reduce((p,{blockSize:g})=>p+g,0)}else a.value=h.contentRect.width,s.value=h.contentRect.height},t);YC(()=>{const h=Kn(n);h&&(a.value="offsetWidth"in h?h.offsetWidth:e.width,s.value="offsetHeight"in h?h.offsetHeight:e.height)});const u=x.watch(()=>Kn(n),h=>{a.value=h?e.width:0,s.value=h?e.height:0});function c(){l(),u()}return{width:a,height:s,stop:c}}const K4={class:"zoom-timerange-container"},Q4={class:"zoom-timerange-details"},J4={class:"label","data-testid":"zoom-timerange-from"},eW={class:"label","data-testid":"zoom-timerange-to"},tW=x.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const e=n,{i18n:t}=Wa.useI18n(),i=x.ref(Pl({tickValue:e.start,granularity:e.granularity})),r=x.ref(Pl({tickValue:e.end,granularity:e.granularity})),o=(a,s)=>{U4(()=>{i.value=Pl({tickValue:a,granularity:e.granularity}),r.value=Pl({tickValue:s,granularity:e.granularity})},100)()};return x.watch(()=>[e.start,e.end],([a,s])=>{o(a,s)},{immediate:!0}),(a,s)=>(x.openBlock(),x.createElementBlock("div",K4,[x.createElementVNode("div",Q4,[x.createElementVNode("div",J4,x.toDisplayString(x.unref(t).t("zoom_time_range.from")),1),x.createElementVNode("div",null,x.toDisplayString(i.value),1),x.createElementVNode("div",eW,x.toDisplayString(x.unref(t).t("zoom_time_range.to")),1),x.createElementVNode("div",null,x.toDisplayString(r.value),1)])]))}}),_h=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},ZC=_h(tW,[["__scopeId","data-v-14925f2c"]]),nW={class:"zoom-actions-container"},iW={class:"zoom-actions-heading"},rW={class:"zoom-action-select"},oW=["data-testid"],aW=["aria-disabled","href"],sW=["onClick"],lW=x.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:e}){const t=e,i=r=>{r.action&&(r.action(n.newTimeRange),t("onAction"))};return(r,o)=>(x.openBlock(),x.createElementBlock("div",nW,[x.createElementVNode("div",iW,[x.createVNode(ZC,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),x.createVNode(x.unref(Di.CloseIcon),{class:"zoom-actions-close-icon",color:x.unref(_E),size:x.unref(bE),onClick:o[0]||(o[0]=a=>r.$emit("onAction"))},null,8,["color","size"])]),o[2]||(o[2]=x.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),x.createElementVNode("div",rW,[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(n.zoomActionItems,a=>(x.openBlock(),x.createElementBlock("div",{key:a.key,class:x.normalizeClass(["zoom-action-item",{disabled:a.disabled}]),"data-testid":`zoom-action-item-${a.key}`},[a.href?(x.openBlock(),x.createElementBlock("a",{key:0,"aria-disabled":a.disabled,class:"zoom-action-link",href:a.href,onClick:o[1]||(o[1]=s=>r.$emit("onAction"))},x.toDisplayString(a.label),9,aW)):(x.openBlock(),x.createElementBlock("div",{key:1,onClick:s=>i(a)},x.toDisplayString(a.label),9,sW))],10,oW))),128))])]))}}),uW=_h(lW,[["__scopeId","data-v-c3e13fab"]]),cW={key:2},hW={class:"tooltip-title"},dW={class:"title"},fW={key:0,class:"subtitle"},pW={class:"context"},gW={class:"metric"},mW={class:"tooltip-content"},yW={class:"tooltip-item-label"},vW={class:"tooltip-item-value"},_W=x.defineComponent({__name:"ChartTooltip",props:{state:{},brushTimeRange:{default:()=>{}},granularity:{default:()=>{}},zoomActionItems:{default:()=>{}}},emits:["onAction"],setup(n,{expose:e,emit:t}){const i=t,r=x.useTemplateRef("toolip"),{width:o,height:a}=$C(r),{x:s,y:l,isDragging:u}=Z4(r,{initialValue:{x:n.state.left,y:n.state.top}}),c=x.computed(()=>`${n.state.top}px`),h=x.computed(()=>`${n.state.left}px`),d=x.computed(()=>`${l.value}px`),f=x.computed(()=>`${s.value}px`),p=x.computed(()=>["interactive","zoom-interactive"].includes(n.state.interactionMode));return x.watch(()=>[n.state.left,n.state.top],([g,m])=>{!u.value&&!p.value&&(s.value=g,l.value=m)}),x.watch(u,g=>{g?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),e({width:o,height:a}),(g,m)=>{var y,v;return n.state.visible?(x.openBlock(),x.createElementBlock("div",{key:0,ref:"toolip",class:"chart-tooltip",style:x.normalizeStyle({transform:p.value?`translate(${f.value}, ${d.value})`:`translate(${h.value}, ${c.value})`,pointerEvents:p.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.brushTimeRange&&n.granularity?(x.openBlock(),x.createBlock(ZC,{key:0,end:(y=n.brushTimeRange)==null?void 0:y.end,granularity:n.granularity,start:(v=n.brushTimeRange)==null?void 0:v.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.brushTimeRange&&n.zoomActionItems&&n.granularity?(x.openBlock(),x.createBlock(uW,{key:1,granularity:n.granularity,"new-time-range":n.brushTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:m[0]||(m[0]=_=>i("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(x.openBlock(),x.createElementBlock("div",cW,[x.createElementVNode("div",hW,[x.createElementVNode("div",dW,[x.createElementVNode("div",null,x.toDisplayString(n.state.title),1)]),n.state.subtitle||n.state.metricDisplay?(x.openBlock(),x.createElementBlock("div",fW,[x.createElementVNode("div",pW,x.toDisplayString(n.state.subtitle),1),x.createElementVNode("div",gW,x.toDisplayString(n.state.metricDisplay),1)])):x.createCommentVNode("",!0)]),x.createElementVNode("div",mW,[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(n.state.entries,_=>(x.openBlock(),x.createElementBlock("div",{key:`${_.label}-${_.value}`,class:"tooltip-item"},[x.createElementVNode("div",{class:"square-marker",style:x.normalizeStyle({background:_.backgroundColor,"border-color":_.borderColor})},null,4),x.createElementVNode("div",yW,x.toDisplayString(_.label),1),x.createElementVNode("div",vW,x.toDisplayString(_.value),1)]))),128))])]))],4)):x.createCommentVNode("",!0)}}}),xW=_h(_W,[["__scopeId","data-v-e48f37a5"]]),bW={ref:"container",class:"kong-ui-public-analytics-echarts"},wW=x.defineComponent({__name:"BaseAnalyticsEcharts",props:x.mergeModels({option:{},enableBrush:{type:Boolean,default:!1},granularity:{default:()=>{}},zoomActionItems:{default:()=>{}},theme:{default:"light"},renderMode:{default:"svg"}},{tooltipState:{required:!0},tooltipStateModifiers:{}}),emits:x.mergeModels(["zoom-time-range","select-chart-range"],["update:tooltipState"]),setup(n,{emit:e}){const t=x.useModel(n,"tooltipState"),i=e;x.watch(()=>n.renderMode,A=>{bi([...A==="canvas"?[hF]:[],...A==="svg"?[aF]:[],HP,lz,Oz,c4,UG,z4,PF,s4,MG,b4,k4])},{immediate:!0}),x.provide(QT,x.toRef(()=>n.theme));const r=x.ref(!1),o=x.ref(void 0),a=x.ref(void 0),s=x.ref(void 0),l=x.useTemplateRef("container"),u=x.useTemplateRef("chart"),c=x.useTemplateRef("tooltip"),h=x.computed(()=>{var A;return(A=u.value)==null?void 0:A.$el}),{width:d,height:f}=$C(h),{top:p,left:g}=X4(l),m=x.computed(()=>["interactive","zoom-interactive"].includes(t.value.interactionMode)),y=x.computed(()=>{var A;return(A=c.value)==null?void 0:A.width}),v=x.computed(()=>{var A;return(A=c.value)==null?void 0:A.height});x.watch(()=>n.option,A=>{var R;b(),(R=u.value)==null||R.setOption(A,{notMerge:!0,lazyUpdate:!1})},{deep:!0});const _=()=>{t.value.interactionMode="interactive"},b=()=>{var A;t.value.interactionMode="idle",t.value.visible=!1,n.enableBrush&&(r.value=!1,(A=u.value)==null||A.dispatchAction({type:"brush",command:"clear",areas:[]}))},T=A=>{var R;return(R=u.value)==null?void 0:R.convertFromPixel({xAxisIndex:0},A.offsetX)},w=(A,R)=>{var L;(L=u.value)==null||L.dispatchAction({type:"brush",areas:[{brushType:"lineX",xAxisIndex:0,coordRange:[Math.min(A,R),Math.max(A,R)]}]})},S=A=>{const R=A.offsetX,L=A.offsetY,V=40;if(n.enableBrush&&r.value&&a.value){const z=T(A);z&&w(a.value,z)}if(y.value&&v.value&&!m.value){let z;R>d.value/2?z=R-y.value-V:z=R+V;let H;L>f.value/2?H=L-v.value-V:H=L+V,t.value.left=z+g.value,t.value.top=H+p.value}},M=A=>{var R;A.componentType==="series"&&((R=u.value)==null||R.dispatchAction({type:"toggleSelect",seriesIndex:A.seriesIndex,dataIndex:A.dataIndex}))},C=()=>{n.enableBrush&&r.value||(t.value.interactionMode!=="idle"?b():_())},I=()=>{m.value||(t.value.visible=!1)},E=A=>{n.enableBrush&&(o.value=window.setTimeout(()=>{var R,L;r.value=!0,t.value.interactionMode="selecting-chart-area",(R=u.value)==null||R.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"lineX",brushMode:"single",xAxisIndex:0}}),(L=u.value)==null||L.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:!1}}),a.value=T(A),a.value&&w(a.value,a.value)},150))},k=A=>{var R;if(clearTimeout(o.value),!n.enableBrush||!r.value)return;r.value=!1;const L=T(A);L&&a.value&&w(a.value,L),(R=u.value)==null||R.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:!1}}),t.value.interactionMode="zoom-interactive",s.value&&i("select-chart-range",s.value)},D=A=>{var R,L;n.enableBrush&&(s.value={type:"absolute",start:new Date((R=A.areas[0])==null?void 0:R.coordRange[0]),end:new Date((L=A.areas[0])==null?void 0:L.coordRange[1])})};return x.onUnmounted(()=>{o.value&&clearTimeout(o.value)}),(A,R)=>(x.openBlock(),x.createElementBlock("div",bW,[(x.openBlock(),x.createBlock(x.unref(C3),{key:`${n.theme}-${n.renderMode}`,ref:"chart",autoresize:!0,class:"chart","manual-update":"",option:n.option,onBrush:D,onClick:M,"onZr:click":C,"onZr:mousedown":E,"onZr:mousemove":S,"onZr:mouseout":I,"onZr:mouseup":k},null,8,["option"])),x.createVNode(xW,{ref:"tooltip","brush-time-range":s.value,granularity:n.granularity,state:t.value,"zoom-action-items":n.zoomActionItems,onOnAction:b},null,8,["brush-time-range","granularity","state","zoom-action-items"])],512))}}),SW=_h(wW,[["__scopeId","data-v-8cc2576a"]]),TW=x.defineComponent({__name:"TimeseriesChart",props:{data:{},type:{},stacked:{type:Boolean,default:!1},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:()=>{}},exploreLink:{default:()=>{}},threshold:{default:()=>{}},theme:{default:"light"},renderMode:{default:"svg"}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:e}){const t=e,i=x.ref({interactionMode:"idle",entries:[],visible:!1,top:0,left:0}),{i18n:r}=Wa.useI18n(),{option:o}=Wa.useExploreResultToEchartTimeseries({exploreResult:x.toRef(()=>n.data),chartType:x.toRef(()=>n.type),stacked:x.toRef(()=>n.stacked),threshold:x.toRef(()=>n.threshold),tooltipState:i}),a=x.computed(()=>n.data.meta.granularity_ms?cv(n.data.meta.granularity_ms)||"hourly":cv(new Date(n.data.data[1].timestamp).getTime()-new Date(n.data.data[0].timestamp).getTime())||"hourly"),s=x.computed(()=>[...n.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:l=>t("zoom-time-range",l)}]:[],...n.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:n.exploreLink.href}]:[],...n.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:n.requestsLink.href}]:[]]);return(l,u)=>(x.openBlock(),x.createBlock(SW,{"enable-brush":n.timeseriesZoom,"enable-zoom":n.timeseriesZoom,granularity:a.value,option:x.unref(o),"render-mode":n.renderMode,theme:n.theme,"tooltip-state":i.value,"zoom-action-items":s.value,onSelectChartRange:u[0]||(u[0]=c=>t("select-chart-range",c)),onZoomTimeRange:u[1]||(u[1]=c=>t("zoom-time-range",c))},null,8,["enable-brush","enable-zoom","granularity","option","render-mode","theme","tooltip-state","zoom-action-items"]))}}),MW={class:"analytics-chart"},XC=Ii(x.defineComponent({__name:"AnalyticsEchartsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{},extraProps:{}},emits:["edit-tile","chart-data","zoom-time-range","view-requests","select-chart-range"],setup(n,{emit:e}){const t=n,i=e,r=x.computed(()=>t.context.zoomable),o=a=>{i("chart-data",a)};return(a,s)=>(x.openBlock(),x.createBlock(Ra,{context:n.context,query:n.query,"query-ready":n.queryReady,"refresh-counter":n.refreshCounter,onChartData:o},{default:x.withCtx(({data:l})=>[x.createElementVNode("div",MW,[x.createVNode(x.unref(TW),{data:l,stacked:n.chartOptions.stacked??!1,threshold:n.chartOptions.threshold,"timeseries-zoom":r.value,type:n.chartOptions.type,onSelectChartRange:s[0]||(s[0]=u=>i("select-chart-range",u)),onZoomTimeRange:s[1]||(s[1]=u=>i("zoom-time-range",u))},null,8,["data","stacked","threshold","timeseries-zoom","type"])])]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),[["__scopeId","data-v-d47c36dd"]]),CW={class:"metric-card-tile-wrapper"},kW=Ii(x.defineComponent({__name:"GoldenSignalsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(n){const e=n,t=x.computed(()=>{var r,o;const i=(r=e.query)==null?void 0:r.datasource;if(i&&i!=="api_usage"&&i!=="basic")throw new Error(`Invalid datasource value: ${i}`);return{datasource:(o=e.query)==null?void 0:o.datasource,overrideTimeRange:e.context.timeSpec,tz:e.context.tz,additionalFilter:e.context.filters,longCardTitles:e.chartOptions.long_card_titles,percentileLatency:e.chartOptions.percentile_latency,refreshInterval:e.context.refreshInterval,queryReady:e.queryReady,refreshCounter:e.refreshCounter}});return(i,r)=>(x.openBlock(),x.createElementBlock("div",CW,[x.createVNode(x.unref(Ey.MetricsProvider),x.normalizeProps(x.guardReactiveProps(t.value)),{default:x.withCtx(()=>[x.createVNode(x.unref(Ey.MetricsConsumer))]),_:1},16)]))}}),[["__scopeId","data-v-86bb2448"]]),DW={class:"fallback-entity-link","data-testid":"entity-link-parent"},KC=x.defineComponent({__name:"FallbackEntityLink",props:{entityLinkData:{}},setup(n){return(e,t)=>(x.openBlock(),x.createElementBlock("div",DW,x.toDisplayString(n.entityLinkData.label),1))}}),IW=x.defineComponent({__name:"TopNTableRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(n){const e=n,t=x.inject(ti),i=x.defineAsyncComponent(async()=>{if(t!=null&&t.fetchComponent)try{return await t.fetchComponent("EntityLink")}catch{return KC}return KC}),r=o=>{var a;if((a=e.chartOptions)!=null&&a.entity_link)if(o.id.includes(":")){const[s,l]=o.id.split(":");return e.chartOptions.entity_link.replace(Oy,s).replace(Ph,l)}else return e.chartOptions.entity_link.replace(Ph,o.id);return""};return(o,a)=>(x.openBlock(),x.createBlock(Ra,{context:n.context,query:n.query,"query-ready":n.queryReady,"refresh-counter":n.refreshCounter},{default:x.withCtx(({data:s})=>[x.createVNode(x.unref(En.TopNTable),{data:s,"synthetics-data-key":n.chartOptions.synthetics_data_key},x.createSlots({_:2},[e.chartOptions.entity_link?{name:"name",fn:x.withCtx(({record:l})=>[x.createVNode(x.unref(i),{"entity-link-data":{id:l.id,label:l.name,deleted:l.deleted},"external-link":r(l)},null,8,["entity-link-data","external-link"])]),key:"0"}:void 0]),1032,["data","synthetics-data-key"])]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),QC="#6c7489",EW="12px",JC="20px",ek="32px",tk="20px",NW=x.defineComponent({__name:"DonutChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},setup(n){return(e,t)=>(x.openBlock(),x.createBlock(Wy,{"chart-options":n.chartOptions,context:n.context,height:n.height,query:n.query,"query-ready":n.queryReady,"refresh-counter":n.refreshCounter},null,8,["chart-options","context","height","query","query-ready","refresh-counter"]))}}),AW=["data-testid"],OW={key:0,class:"tile-header"},RW={class:"badge-container"},LW={class:"badge-text"},PW={key:0},zW=["data-testid"],BW=["data-testid"],VW={class:"delete-option"},HW=["data-testid"],FW=["data-testid"],nk=Ii(x.defineComponent({__name:"DashboardTile",props:x.mergeModels({context:{},definition:{},height:{default:vo},isFullscreen:{type:Boolean},hideActions:{type:Boolean,default:!1},queryReady:{type:Boolean},showRefresh:{type:Boolean,default:!1},tileId:{}},{refreshCounter:{default:0},refreshCounterModifiers:{}}),emits:x.mergeModels(["edit-tile","duplicate-tile","remove-tile","tile-time-range-zoom","tile-bounds-change"],["update:refreshCounter"]),setup(n,{emit:e}){x.useCssVars(X=>({v0f0d10eb:`${X.height}px`}));const t=parseInt(tk,10),i=n,r=x.useModel(n,"refreshCounter"),o=()=>{g.value=!0,r.value++},a=e,s=x.defineAsyncComponent(()=>Promise.resolve().then(()=>eU)),l=x.inject(ti),{i18n:u}=ni.useI18n(),c=x.ref(),h=x.ref({status:"loading"}),d=x.ref(!1),f=x.ref(),p=x.ref(!1),g=x.ref(!0),{exploreLinkKebabMenu:m,requestsLinkKebabMenu:y,canShowKebabMenu:v,canGenerateRequestsLink:_,canGenerateExploreLink:b,requestsLinkZoomActions:T,exploreLinkZoomActions:w,buildExploreQuery:S,buildExploreLink:M,buildRequestLink:C,buildRequestsQueryZoomActions:I}=ni.useContextLinks({queryBridge:l,chartData:x.readonly(c),definition:x.readonly(x.toRef(i,"definition")),context:x.readonly(x.toRef(i,"context"))}),{issueQuery:E}=ni.useIssueQuery();x.watch(()=>i.definition,async(X,de)=>{await x.nextTick(),f.value&&(p.value=f.value.scrollWidth>f.value.clientWidth);try{JSON.stringify(X==null?void 0:X.query)!==JSON.stringify(de==null?void 0:de.query)&&(g.value=!0)}catch{}},{immediate:!0,deep:!0});const k=x.computed(()=>u.t("csvExport.defaultFilename")),D=x.computed(()=>v.value&&!i.hideActions&&(A.value||i.context.editable)),A=x.computed(()=>!!m.value||("allow_csv_export"in i.definition.chart?i.definition.chart.allow_csv_export:!0)||i.context.editable),R={timeseries_line:XC,timeseries_bar:XC,horizontal_bar:Uy,vertical_bar:Uy,gauge:Gy,donut:NW,golden_signals:kW,top_n:IW,slottable:void 0,single_value:Gy,choropleth_map:s},L=x.computed(()=>{var X,de,ge;return{...(X=V.value)!=null&&X.rendererEvents.supportsRequests?{"select-chart-range":ct}:{},...(de=V.value)!=null&&de.rendererEvents.supportsZoom?{"zoom-time-range":oe}:{},...(ge=V.value)!=null&&ge.rendererEvents.supportsBounds?{"bounds-change":xe}:{}}}),V=x.computed(()=>{var tt,je;const X=R[i.definition.chart.type],de=!!((tt=X==null?void 0:X.emits)!=null&&tt.includes("select-chart-range")),ge=!!((je=X==null?void 0:X.emits)!=null&&je.includes("zoom-time-range")),Fe=i.definition.chart.type==="choropleth_map";return X&&{component:X,rendererProps:{query:i.definition.query,context:i.context,queryReady:i.queryReady,chartOptions:i.definition.chart,height:i.height-t*2,refreshCounter:r.value,requestsLink:T.value,exploreLink:w.value},rendererEvents:{supportsRequests:de,supportsZoom:ge,supportsBounds:Fe}}}),z=x.computed(()=>{var de;const X=(de=i.definition.query)==null?void 0:de.time_range;if((X==null?void 0:X.type)==="relative"){const ge=Ie.TimePeriods.get(Ie.TIMEFRAME_LOOKUP[X.time_range]);return ge?ge.display:(console.warn("Did not recognize the given relative time range:",X.time_range),X.time_range)}else if((X==null?void 0:X.type)==="absolute"){const ge=X.tz||"Etc/UTC";return`${Ie.formatTime(X.start,{short:!0,tz:ge})} - ${Ie.formatTime(X.end,{short:!0,tz:ge})}`}return null}),H=x.computed(()=>{if(i.definition.chart.type==="slottable")return!1;const X=!!i.definition.chart.chart_title,de=i.definition.chart.type==="golden_signals"&&!!i.definition.chart.description,ge=i.showRefresh,Fe=D.value&&A.value&&!i.isFullscreen,tt=!!z.value;return X||Fe||tt||de||ge}),F=x.computed(()=>c.value?Ie.msToGranularity(c.value.meta.granularity_ms):void 0),j=x.computed(()=>["timeseries_line","timeseries_bar"].includes(i.definition.chart.type)),Y=x.computed(()=>{var de,ge;if(!j.value||!i.queryReady||g.value)return!1;const X=(ge=(de=i.definition)==null?void 0:de.query)==null?void 0:ge.granularity;return!X||!F.value?!1:X!==F.value}),ee=x.computed(()=>{var ge,Fe,tt;const X=Ie.msToGranularity(((ge=c.value)==null?void 0:ge.meta.granularity_ms)??0)??"unknown",de=((tt=(Fe=i.definition)==null?void 0:Fe.query)==null?void 0:tt.granularity)??"unknown";return u.t("query_aged_out_warning",{currentGranularity:u.t(`granularities.${X}`),savedGranularity:u.t(`granularities.${de}`)})}),pe=x.computed(()=>{var ge,Fe;const X=[...i.context.filters,...i.definition.query.filters??[]],de=((Fe=(ge=i.definition)==null?void 0:ge.query)==null?void 0:Fe.datasource)??"api_usage";return X.filter(tt=>Ie.getFieldDataSources(tt.field).some(Kt=>de===Kt))}),Te=()=>{a("edit-tile",i.definition)},qe=()=>{a("duplicate-tile",i.definition)},Je=()=>{a("remove-tile",i.definition)},We=X=>{c.value=X,g.value=!1},He=()=>{d.value=!1},Be=async()=>{var X;if(d.value=!0,h.value={status:"loading"},((X=l==null?void 0:l.staticConfig)==null?void 0:X.increaseCsvExportLimit)??!0)E(i.definition.query,i.context,Ie.EXPORT_RECORD_LIMIT).then(de=>{h.value={status:"success",chartData:de}}).catch(de=>{h.value={status:"error",error:de}});else if(c.value)h.value={status:"success",chartData:c.value};else{const de=x.watch(c,ge=>{ge&&(h.value={status:"success",chartData:ge},de())})}},oe=X=>{const de={tileId:i.tileId.toString(),timeRange:X};a("tile-time-range-zoom",de)},xe=X=>{const de={tileId:i.tileId.toString(),bounds:X};a("tile-bounds-change",de)},ct=X=>{const de=pe.value,ge=I(X,de),Fe=S(X,de);T.value=_.value?{href:C(ge)}:void 0,w.value=b.value?{href:M(Fe)}:void 0};return(X,de)=>{const ge=x.resolveComponent("KTooltip"),Fe=x.resolveComponent("KBadge"),tt=x.resolveComponent("KButton"),je=x.resolveComponent("KDropdownItem"),Kt=x.resolveComponent("KDropdown");return x.openBlock(),x.createElementBlock("div",{class:x.normalizeClass(["tile-boundary",{editable:n.context.editable,headless:!H.value}]),"data-testid":`tile-${n.tileId}`},[H.value&&n.definition.chart.type!=="slottable"?(x.openBlock(),x.createElementBlock("div",OW,[x.createVNode(ge,{class:"title-tooltip",disabled:!p.value,"max-width":"500",text:n.definition.chart.chart_title},{default:x.withCtx(()=>[x.createElementVNode("div",{ref_key:"titleRef",ref:f,class:"title"},x.toDisplayString(n.definition.chart.chart_title),513)]),_:1},8,["disabled","text"]),x.createElementVNode("div",RW,[z.value?(x.openBlock(),x.createBlock(Fe,{key:0,"data-testid":"time-range-badge",tooltip:Y.value?ee.value:void 0,"tooltip-attributes":{maxWidth:"320px"}},x.createSlots({default:x.withCtx(()=>[x.createElementVNode("span",LW,x.toDisplayString(z.value),1)]),_:2},[Y.value?{name:"icon",fn:x.withCtx(()=>[x.createVNode(x.unref(Di.WarningIcon),{size:x.unref(EW)},null,8,["size"])]),key:"0"}:void 0]),1032,["tooltip"])):x.createCommentVNode("",!0)]),n.showRefresh?(x.openBlock(),x.createElementBlock("div",PW,[x.createVNode(tt,{appearance:"secondary",class:"refresh-button",disabled:g.value,icon:"",size:"small",onClick:o},{default:x.withCtx(()=>[g.value?(x.openBlock(),x.createBlock(x.unref(Di.ProgressIcon),{key:0,role:"button",size:x.unref(ek),tabindex:"0"},null,8,["size"])):(x.openBlock(),x.createBlock(x.unref(Di.RefreshIcon),{key:1,role:"button",size:x.unref(ek),tabindex:"0"},null,8,["size"]))]),_:1},8,["disabled"])])):x.createCommentVNode("",!0),D.value?(x.openBlock(),x.createElementBlock("div",{key:1,class:"tile-actions","data-testid":`tile-actions-${n.tileId}`},[x.unref(v)&&n.context.editable&&!n.isFullscreen?(x.openBlock(),x.createBlock(x.unref(Di.EditIcon),{key:0,class:"edit-icon",color:x.unref(QC),"data-testid":`edit-tile-${n.tileId}`,size:x.unref(JC),onClick:Te},null,8,["color","data-testid","size"])):x.createCommentVNode("",!0),x.unref(v)&&A.value&&!n.isFullscreen?(x.openBlock(),x.createBlock(Kt,{key:1,class:"dropdown","data-testid":`chart-action-menu-${n.tileId}`,"kpop-attributes":{placement:"bottom-end"}},{items:x.withCtx(()=>[x.unref(m)?(x.openBlock(),x.createBlock(je,{key:0,"data-testid":`chart-jump-to-explore-${n.tileId}`,item:{label:x.unref(u).t("jumpToExplore"),to:x.unref(m)}},null,8,["data-testid","item"])):x.createCommentVNode("",!0),x.unref(y)?(x.openBlock(),x.createBlock(je,{key:1,"data-testid":`chart-jump-to-requests-${n.tileId}`,item:{label:x.unref(u).t("jumpToRequests"),to:x.unref(y)}},null,8,["data-testid","item"])):x.createCommentVNode("",!0),!("allow_csv_export"in n.definition.chart)||n.definition.chart.allow_csv_export?(x.openBlock(),x.createBlock(je,{key:2,class:"chart-export-button","data-testid":`chart-csv-export-${n.tileId}`,onClick:Be},{default:x.withCtx(()=>[x.createElementVNode("span",{class:"chart-export-trigger","data-testid":`csv-export-button-${n.tileId}`},x.toDisplayString(x.unref(u).t("csvExport.exportAsCsv")),9,BW)]),_:1},8,["data-testid"])):x.createCommentVNode("",!0),n.context.editable?(x.openBlock(),x.createBlock(je,{key:3,"data-testid":`duplicate-tile-${n.tileId}`,onClick:qe},{default:x.withCtx(()=>[x.createTextVNode(x.toDisplayString(x.unref(u).t("renderer.duplicateTile")),1)]),_:1},8,["data-testid"])):x.createCommentVNode("",!0),n.context.editable?(x.openBlock(),x.createBlock(je,{key:4,"data-testid":`remove-tile-${n.tileId}`,onClick:Je},{default:x.withCtx(()=>[x.createElementVNode("span",VW,x.toDisplayString(x.unref(u).t("renderer.delete")),1)]),_:1},8,["data-testid"])):x.createCommentVNode("",!0)]),default:x.withCtx(()=>[x.createVNode(x.unref(Di.MoreIcon),{class:"kebab-action-menu",color:x.unref(QC),"data-testid":`kebab-action-menu-${n.tileId}`,size:x.unref(JC)},null,8,["color","data-testid","size"])]),_:1},8,["data-testid"])):x.createCommentVNode("",!0)],8,zW)):"description"in n.definition.chart?(x.openBlock(),x.createElementBlock("div",{key:2,class:"header-description","data-testid":`tile-description-${n.tileId}`},x.toDisplayString(n.definition.chart.description),9,HW)):x.createCommentVNode("",!0),d.value?(x.openBlock(),x.createBlock(x.unref(En.CsvExportModal),{key:3,"data-testid":`csv-export-modal-${n.tileId}`,"export-state":h.value,filename:k.value,onCloseModal:He},null,8,["data-testid","export-state","filename"])):x.createCommentVNode("",!0)])):x.createCommentVNode("",!0),x.createElementVNode("div",{class:x.normalizeClass(["tile-content",`type-${n.definition.chart.type}`]),"data-testid":`tile-content-${n.tileId}`},[V.value?(x.openBlock(),x.createBlock(x.resolveDynamicComponent(V.value.component),x.mergeProps({key:0},V.value.rendererProps,x.toHandlers(L.value),{onChartData:We}),null,16)):x.createCommentVNode("",!0)],10,FW)],10,AW)}}}),[["__scopeId","data-v-9ddc86c3"]]),GW=(n,e)=>{let t=0;const i=new Map;e.forEach(o=>{const a=o.layout.position.row,s=i.get(a),l=o.layout.size.rows===1&&!!o.layout.size.fit_to_content;t=Math.max(t,a+o.layout.size.rows),s===void 0?i.set(a,l):i.set(a,s&&l)});const r=[];for(let o=0;o<t;o++)i.get(o)?r.push("auto"):r.push(`${n}px`);return r},ik=Ii(x.defineComponent({__name:"GridLayout",props:{tileHeight:{type:Number,required:!1,default:()=>vo},tiles:{type:Array,required:!0}},setup(n){x.useCssVars(s=>({v2a38e79e:x.unref(Lh),v4cc71de6:o.value}));const e=n,t=x.ref(null),i=x.ref(0),r=new ResizeObserver(s=>{window.requestAnimationFrame(()=>{!Array.isArray(s)||!s.length||(i.value=s[0].contentRect.width)})});x.onMounted(()=>{t.value&&r.observe(t.value)}),x.onUnmounted(()=>{t.value&&r.unobserve(t.value)});const o=x.computed(()=>GW(e.tileHeight,e.tiles).join(" ")),a=x.computed(()=>e.tiles.map((s,l)=>({key:`tile-${l}`,tile:s,style:{"grid-column-start":s.layout.position.col+1,"grid-column-end":s.layout.position.col+1+s.layout.size.cols,"grid-row-start":s.layout.position.row+1,"grid-row-end":s.layout.position.row+1+s.layout.size.rows}})));return(s,l)=>(x.openBlock(),x.createElementBlock("div",{ref_key:"gridContainer",ref:t,class:"kong-ui-public-grid-layout"},[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(a.value,u=>(x.openBlock(),x.createElementBlock("div",{key:u.key,class:x.normalizeClass(["grid-cell",{"empty-cell":!u.tile}]),style:x.normalizeStyle(u.style)},[x.renderSlot(s.$slots,"tile",{style:x.normalizeStyle(u.style),tile:u.tile},void 0,!0)],6))),128))],512))}}),[["__scopeId","data-v-354b7177"]]);function WW(n,e,t,i,r){const o=(...a)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+r+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(n,a));return o.prototype=e.prototype,o}class P{static getElements(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const o=i.getElementById(e);return o?[o]:[]}let r=t.querySelectorAll(e);return!r.length&&e[0]!=="."&&e[0]!=="#"&&(r=t.querySelectorAll("."+e),r.length||(r=t.querySelectorAll("#"+e))),Array.from(r)}return[e]}static getElement(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(!e.length)return null;if(i&&e[0]==="#")return i.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return t.querySelector(e);if(i&&!isNaN(+e[0]))return i.getElementById(e);let r=t.querySelector(e);return i&&!r&&(r=i.getElementById(e)),r||(r=t.querySelector("."+e)),r}return e}static lazyLoad(e){var t,i;return e.lazyLoad||((i=(t=e.grid)==null?void 0:t.opts)==null?void 0:i.lazyLoad)&&e.lazyLoad!==!1}static createDiv(e,t){const i=document.createElement("div");return e.forEach(r=>{r&&i.classList.add(r)}),t==null||t.appendChild(i),i}static shouldSizeToContent(e,t=!1){return(e==null?void 0:e.grid)&&(t?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return P.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){const i=e.x>t.x?e.x:t.x,r=e.x+e.w<t.x+t.w?e.x+e.w:t.x+t.w;if(r<=i)return 0;const o=e.y>t.y?e.y:t.y,a=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return a<=o?0:(r-i)*(a-o)}static area(e){return e.w*e.h}static sort(e,t=1){return e.sort((r,o)=>{const a=t*((r.y??1e4)-(o.y??1e4));return a===0?t*((r.x??1e4)-(o.x??1e4)):a})}static find(e,t){return t?e.find(i=>i.id===t):void 0}static createStylesheet(e,t,i){const r=document.createElement("style"),o=i==null?void 0:i.nonce;return o&&(r.nonce=o),r.setAttribute("type","text/css"),r.setAttribute("gs-style-id",e),r.styleSheet?r.styleSheet.cssText="":r.appendChild(document.createTextNode("")),t?t.insertBefore(r,t.firstChild):(t=document.getElementsByTagName("head")[0],t.appendChild(r)),r}static removeStylesheet(e,t){const r=(t||document).querySelector("STYLE[gs-style-id="+e+"]");r&&r.parentNode&&r.remove()}static addCSSRule(e,t,i){e.textContent+=`${t} { ${i} } `}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let t,i="px";if(typeof e=="string")if(e==="auto"||e==="")t=0;else{const r=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!r)throw new Error(`Invalid height val = ${e}`);i=r[2]||"px",t=parseFloat(r[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(const r in i){if(!i.hasOwnProperty(r))return;e[r]===null||e[r]===void 0?e[r]=i[r]:typeof i[r]=="object"&&typeof e[r]=="object"&&this.defaults(e[r],i[r])}}),e}static same(e,t){if(typeof e!="object")return e==t;if(typeof e!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}static copyPos(e,t,i=!1){return t.x!==void 0&&(e.x=t.x),t.y!==void 0&&(e.y=t.y),t.w!==void 0&&(e.w=t.w),t.h!==void 0&&(e.h=t.h),i&&(t.minW&&(e.minW=t.minW),t.minH&&(e.minH=t.minH),t.maxW&&(e.maxW=t.maxW),t.maxH&&(e.maxH=t.maxH)),e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&(e.w||1)===(t.w||1)&&(e.h||1)===(t.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,t){if(!(typeof e!="object"||typeof t!="object"))for(let i in e){const r=e[i],o=t[i];i[0]==="_"||r===o?delete e[i]:r&&typeof r=="object"&&o!==void 0&&(P.removeInternalAndSame(r,o),Object.keys(r).length||delete e[i])}}static removeInternalForSave(e,t=!0){for(let i in e)(i[0]==="_"||e[i]===null||e[i]===void 0)&&delete e[i];delete e.grid,t&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,t){let i=!1;return(...r)=>{i||(i=!0,setTimeout(()=>{e(...r),i=!1},t))}}static removePositioningStyles(e){const t=e.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const t=getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowY)?e:this.getScrollElement(e.parentElement)}static updateScrollPosition(e,t,i){const r=e.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(r.top<0||r.bottom>o){const a=r.bottom-o,s=r.top,l=this.getScrollElement(e);if(l!==null){const u=l.scrollTop;r.top<0&&i<0?e.offsetHeight>o?l.scrollTop+=i:l.scrollTop+=Math.abs(s)>Math.abs(i)?i:s:i>0&&(e.offsetHeight>o?l.scrollTop+=i:l.scrollTop+=a>i?i:a),t.top+=l.scrollTop-u}}}static updateScrollResize(e,t,i){const r=this.getScrollElement(t),o=r.clientHeight,a=r===this.getScrollElement()?0:r.getBoundingClientRect().top,s=e.clientY-a,l=s<i,u=s>o-i;l?r.scrollBy({behavior:"smooth",top:s-i}):u&&r.scrollBy({behavior:"smooth",top:i-(o-s)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const t=["parentGrid","el","grid","subGrid","engine"],i=P.clone(e);for(const r in i)i.hasOwnProperty(r)&&typeof i[r]=="object"&&r.substring(0,2)!=="__"&&!t.find(o=>o===r)&&(i[r]=P.cloneDeep(e[r]));return i}static cloneNode(e){const t=e.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(e,t){let i;typeof t=="string"?i=P.getElement(t):i=t,i&&i.appendChild(e)}static addElStyles(e,t){if(t instanceof Object)for(const i in t)t.hasOwnProperty(i)&&(Array.isArray(t[i])?t[i].forEach(r=>{e.style[i]=r}):e.style[i]=t[i])}static initEvent(e,t){const i={type:t.type},r={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(o=>i[o]=e[o]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(o=>i[o]=e[o]),{...i,...r}}static simulateMouseEvent(e,t,i){const r=e,o=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:r.ctrlKey??!1,altKey:r.altKey??!1,shiftKey:r.shiftKey??!1,metaKey:r.metaKey??!1,button:0,relatedTarget:e.target});(i||e.target).dispatchEvent(o)}static getValuesFromTransformedElement(e){const t=document.createElement("div");P.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(t);const i=t.getBoundingClientRect();return e.removeChild(t),t.remove(),{xScale:1/i.width,yScale:1/i.height,xOffset:i.left,yOffset:i.top}}static swap(e,t,i){if(!e)return;const r=e[t];e[t]=e[i],e[i]=r}static canBeRotated(e){var t;return!(!e||e.w===e.h||e.locked||e.noResize||(t=e.grid)!=null&&t.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}}class Qn{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,r={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!r.nested&&!this.float&&this.swap(e,i))return!0;let o=t;!this._loading&&this._useEntireRowArea(e,t)&&(o={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,o,r.skip));let a=!1;const s={nested:!0,pack:!1};let l=0;for(;i=i||this.collide(e,o,r.skip);){if(l++>this.nodes.length*2)throw new Error("Infinite collide check");let u;if(i.locked||this._loading||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,{...i,y:e.y},e)||!this.collide(i,{...i,y:t.y-i.h},e))){e._skipDown=e._skipDown||t.y>e.y;const c={...t,y:i.y+i.h,...s};u=this._loading&&P.samePos(e,c)?!0:this.moveNode(e,c),(i.locked||this._loading)&&u?P.copyPos(t,e):!i.locked&&u&&r.pack&&(this._packNodes(),t.y=i.y+i.h,P.copyPos(e,t)),a=a||u}else u=this.moveNode(i,{...i,y:t.y+t.h,skip:e,...s});if(!u)return a;i=void 0}return a}collide(e,t=e,i){const r=e._id,o=i==null?void 0:i._id;return this.nodes.find(a=>a._id!==r&&a._id!==o&&P.isIntercepted(a,t))}collideAll(e,t=e,i){const r=e._id,o=i==null?void 0:i._id;return this.nodes.filter(a=>a._id!==r&&a._id!==o&&P.isIntercepted(a,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;const r=e._rect,o={...t.rect};o.y>r.y?(o.h+=o.y-r.y,o.y=r.y):o.h+=r.y-o.y,o.x>r.x?(o.w+=o.x-r.x,o.x=r.x):o.w+=r.x-o.x;let a,s=.5;for(let l of i){if(l.locked||!l._rect)break;const u=l._rect;let c=Number.MAX_VALUE,h=Number.MAX_VALUE;r.y<u.y?c=(o.y+o.h-u.y)/u.h:r.y+r.h>u.y+u.h&&(c=(u.y+u.h-o.y)/u.h),r.x<u.x?h=(o.x+o.w-u.x)/u.w:r.x+r.w>u.x+u.w&&(h=(u.x+u.w-o.x)/u.w);const d=Math.min(h,c);d>s&&(s=d,a=l)}return t.collide=a,a}cacheRects(e,t,i,r,o,a){return this.nodes.forEach(s=>s._rect={y:s.y*t+i,x:s.x*e+a,w:s.w*e-a-r,h:s.h*t-i-o}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){const o=t.x,a=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=o,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=a):(e.x=o,e.y=a),e._dirty=t._dirty=!0,!0}let r;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(r=P.isTouching(e,t)))return i();if(r!==!1){if(e.w===t.w&&e.x===t.x&&(r||(r=P.isTouching(e,t)))){if(t.y<e.y){const o=e;e=t,t=o}return i()}if(r!==!1){if(e.h===t.h&&e.y===t.y&&(r||(r=P.isTouching(e,t)))){if(t.x<e.x){const o=e;e=t,t=o}return i()}return!1}}}isAreaEmpty(e,t,i,r){const o={x:e||0,y:t||0,w:i||1,h:r||1};return!this.collide(o)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();const i=this.batchMode;i||this.batchUpdate();const r=this._inColumnResize;r||(this._inColumnResize=!0);const o=this.nodes;return this.nodes=[],o.forEach((a,s,l)=>{let u;a.locked||(a.autoPosition=!0,e==="list"&&s&&(u=l[s-1])),this.addNode(a,!1,u)}),r||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=P.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){const i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){e._id=e._id??Qn._idSeq++;const i=e.id;if(i){let o=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=i+"_"+o++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const r={x:0,y:0,w:1,h:1};return P.defaults(e,r),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,P.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=r.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=r.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=r.w),isNaN(e.h)&&(e.h=r.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){const i=e._orig||P.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id&&this.findCacheLayout(e,this.defaultColumn)===-1){const o={...e};o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),P.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!P.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=P.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||P.samePos(e,e._orig)||(P.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,r){const o=r?r.y*i+(r.x+r.w):0;let a=!1;for(let s=o;!a;++s){const l=s%i,u=Math.floor(s/i);if(l+e.w>i)continue;const c={x:l,y:u,w:e.w,h:e.h};t.find(h=>P.isIntercepted(c,h))||((e.x!==l||e.y!==u)&&(e._dirty=!0),e.x=l,e.y=u,delete e.autoPosition,a=!0)}return a}addNode(e,t=!1,i){const r=this.nodes.find(a=>a._id===e._id);if(r)return r;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let o;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,o=!0),this.nodes.push(e),t&&this.addedNodes.push(e),o||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(r=>r._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(r=>r._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(r=>r._removeDOM=!0);const i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i;const r=new Qn({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(i={...a},i):{...a})});if(!i)return!1;const o=r.moveNode(i,t)&&r.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!t.resizing&&t.collide){const a=t.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return o?(r.nodes.filter(a=>a._dirty).forEach(a=>{const s=this.nodes.find(l=>l._id===a._id);s&&(P.copyPos(s,a),s._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const t=new Qn({column:this.column,float:this.float,nodes:this.nodes.map(r=>({...r}))}),i={...e};return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=P.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){var u,c;if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);const r=e.w!==t.w||e.h!==t.h,o=P.copyPos({},e,!0);if(P.copyPos(o,t),this.nodeBoundFix(o,r),P.copyPos(t,o),!t.forceCollide&&P.samePos(e,t))return!1;const a=P.copyPos({},e),s=this.collideAll(e,o,t.skip);let l=!0;if(s.length){const h=e._moving&&!t.nested;let d=h?this.directionCollideCoverage(e,t,s):s[0];if(h&&d&&((c=(u=e.grid)==null?void 0:u.opts)!=null&&c.subGridDynamic)&&!e.grid._isTemp){const f=P.areaIntercept(t.rect,d._rect),p=P.area(t.rect),g=P.area(d._rect);f/(p<g?p:g)>.8&&(d.grid.makeSubGrid(d.el,void 0,e),d=void 0)}d?l=!this._fixCollisions(e,o,d,t):(l=!1,i&&delete t.pack)}return l&&!P.samePos(e,o)&&(e._dirty=!0,P.copyPos(e,o)),t.pack&&this._packNodes()._notify(),!P.samePos(e,a)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t){var a;const i=(a=this._layouts)==null?void 0:a.length,r=i&&this.column!==i-1?this._layouts[i-1]:null,o=[];return this.sortNodes(),this.nodes.forEach(s=>{const l=r==null?void 0:r.find(c=>c._id===s._id),u={...s,...l||{}};P.removeInternalForSave(u,!e),t&&t(s,u),o.push(u)}),o}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{const r=i/this.column;e.forEach(o=>{if(!o._orig)return;const a=t.find(s=>s._id===o._id);a&&(a.y>=0&&o.y!==o._orig.y&&(a.y+=o.y-o._orig.y),o.x!==o._orig.x&&(a.x=Math.round(o.x*r)),o.w!==o._orig.w&&(a.w=Math.round(o.w*r)))})}}),this)}columnChanged(e,t,i="moveScale"){var s;if(!this.nodes.length||!t||e===t)return this;const r=i==="compact"||i==="list";r&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let o=[],a=r?this.nodes:P.sort(this.nodes,-1);if(t>e&&this._layouts){const l=this._layouts[t]||[],u=this._layouts.length-1;!l.length&&e!==u&&((s=this._layouts[u])!=null&&s.length)&&(e=u,this._layouts[u].forEach(c=>{const h=a.find(d=>d._id===c._id);h&&(!r&&!c.autoPosition&&(h.x=c.x??h.x,h.y=c.y??h.y),h.w=c.w??h.w,(c.x==null||c.y===void 0)&&(h.autoPosition=!0))})),l.forEach(c=>{const h=a.findIndex(d=>d._id===c._id);if(h!==-1){const d=a[h];if(r){d.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(d.x=c.x??d.x,d.y=c.y??d.y,d.w=c.w??d.w,o.push(d)),a.splice(h,1)}})}if(r)this.compact(i,!1);else{if(a.length)if(typeof i=="function")i(t,e,o,a);else{const l=r||i==="none"?1:t/e,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";a.forEach(h=>{h.x=t===1?0:u?Math.round(h.x*l):Math.min(h.x,t-1),h.w=t===1||e===1?1:c?Math.round(h.w*l)||1:Math.min(h.w,t),o.push(h)}),a=[]}o=P.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!r),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){const r=[];return e.forEach((o,a)=>{if(o._id===void 0){const s=o.id?this.nodes.find(l=>l.id===o.id):void 0;o._id=(s==null?void 0:s._id)??Qn._idSeq++}r[a]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=r,this}cacheOneLayout(e,t){e._id=e._id??Qn._idSeq++;const i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];const r=this.findCacheLayout(e,t);return r===-1?this._layouts[t].push(i):this._layouts[t][r]=i,this}findCacheLayout(e,t){var i,r;return((r=(i=this._layouts)==null?void 0:i[t])==null?void 0:r.findIndex(o=>o._id===e._id))??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){const i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(const t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}Qn._idSeq=0;const Xt={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class he{}const In=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class Jn{}function xh(n,e){n.touches.length>1||(n.cancelable&&n.preventDefault(),P.simulateMouseEvent(n.changedTouches[0],e))}function rk(n,e){n.cancelable&&n.preventDefault(),P.simulateMouseEvent(n,e)}function bh(n){Jn.touchHandled||(Jn.touchHandled=!0,xh(n,"mousedown"))}function wh(n){Jn.touchHandled&&xh(n,"mousemove")}function Sh(n){if(!Jn.touchHandled)return;Jn.pointerLeaveTimeout&&(window.clearTimeout(Jn.pointerLeaveTimeout),delete Jn.pointerLeaveTimeout);const e=!!he.dragElement;xh(n,"mouseup"),e||xh(n,"click"),Jn.touchHandled=!1}function Th(n){n.pointerType!=="mouse"&&n.target.releasePointerCapture(n.pointerId)}function ok(n){he.dragElement&&n.pointerType!=="mouse"&&rk(n,"mouseenter")}function ak(n){he.dragElement&&n.pointerType!=="mouse"&&(Jn.pointerLeaveTimeout=window.setTimeout(()=>{delete Jn.pointerLeaveTimeout,rk(n,"mouseleave")},10))}class Mh{constructor(e,t,i){this.host=e,this.dir=t,this.option=i,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const e=this.el=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(`${Mh.prefix}${this.dir}`),e.style.zIndex="100",e.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),In&&(this.el.addEventListener("touchstart",bh),this.el.addEventListener("pointerdown",Th)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),In&&(this.el.removeEventListener("touchstart",bh),this.el.removeEventListener("pointerdown",Th)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),In&&(this.el.addEventListener("touchmove",wh),this.el.addEventListener("touchend",Sh)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),In&&(this.el.removeEventListener("touchmove",wh),this.el.removeEventListener("touchend",Sh)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){var t,i;e.key==="Escape"&&((i=(t=this.host.gridstackNode)==null?void 0:t.grid)==null||i.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}Mh.prefix="ui-resizable-";class my{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](t)}}class _l extends my{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{const r=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||o;return{position:{left:(a.left-r.left)*this.rectScale.x,top:(a.top-r.top)*this.rectScale.y},size:{width:a.width*this.rectScale.x,height:a.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){const t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(r=>this.option[r]=e[r]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),he.overResizeElement===this&&delete he.overResizeElement),this}_mouseOver(e){he.overResizeElement||he.dragElement||(he.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){he.overResizeElement===this&&(delete he.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new Mh(this.el,e,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:t=>{this._resizing(t,e)}})),this}_resizeStart(e){this.sizeToContent=P.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=P.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const t=P.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();const i=P.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){const t=P.initEvent(e,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=_l._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,t=P.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return _l._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){const i=this.startEvent,r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},o=e.clientX-i.clientX,a=this.sizeToContent?0:e.clientY-i.clientY;let s,l;t.indexOf("e")>-1?r.width+=o:t.indexOf("w")>-1&&(r.width-=o,r.left+=o,s=!0),t.indexOf("s")>-1?r.height+=a:t.indexOf("n")>-1&&(r.height-=a,r.top+=a,l=!0);const u=this._constrainSize(r.width,r.height,s,l);return Math.round(r.width)!==Math.round(u.width)&&(t.indexOf("w")>-1&&(r.left+=r.width-u.width),r.width=u.width),Math.round(r.height)!==Math.round(u.height)&&(t.indexOf("n")>-1&&(r.top+=r.height-u.height),r.height=u.height),r}_constrainSize(e,t,i,r){const o=this.option,a=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,s=o.minWidth/this.rectScale.x||e,l=(r?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,u=o.minHeight/this.rectScale.y||t,c=Math.min(a,Math.max(s,e)),h=Math.min(l,Math.max(u,t));return{width:c,height:h}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const t=this.el.parentElement,{left:i,top:r}=t.getBoundingClientRect();e={left:i,top:r,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{const i=this.temporalRect[t],r=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*r+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}_l._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const UW='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class xl extends my{constructor(e,t={}){var o;super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const i=(o=t==null?void 0:t.handle)==null?void 0:o.substring(1),r=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:r!=null&&r.subGrid?[e.querySelector(t.handle)||e]:Array.from(e.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),In&&(e.addEventListener("touchstart",bh),e.addEventListener("pointerdown",Th))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),In&&(t.removeEventListener("touchstart",bh),t.removeEventListener("pointerdown",Th))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(!he.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(UW)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete he.dragElement,delete he.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),In&&(e.currentTarget.addEventListener("touchmove",wh),e.currentTarget.addEventListener("touchend",Sh)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),he.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const t=P.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){var i;const t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),he.pauseDrag){const r=Number.isInteger(he.pauseDrag)?he.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),r)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,he.dragElement=this;const r=(i=this.el.gridstackNode)==null?void 0:i.grid;r?he.dropElement=r.el.ddElement.ddDroppable:delete he.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=P.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const o=P.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(o,this.ui()),this.triggerEvent("dragstart",o),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){var t,i;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),In&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",wh,!0),e.currentTarget.removeEventListener("touchend",Sh,!0)),this.dragging){delete this.dragging,(t=this.el.gridstackNode)==null||delete t._origRotate,document.removeEventListener("keydown",this._keyEvent),((i=he.dropElement)==null?void 0:i.el)===this.el.parentElement&&delete he.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const r=P.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(r),this.triggerEvent("dragstop",r),he.dropElement&&he.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete he.dragElement,delete he.dropElement,delete he.mouseHandled,e.preventDefault()}_keyEvent(e){var r,o;const t=this.el.gridstackNode,i=(t==null?void 0:t.grid)||((o=(r=he.dropElement)==null?void 0:r.el)==null?void 0:o.gridstack);if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i==null||i.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!P.canBeRotated(t))return;t._origRotate=t._origRotate||{...t._orig},delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",P.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=P.cloneNode(this.el)),e.parentElement||P.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=xl.originStyleProp.map(t=>this.el.style[t]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging");const t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.transition=null)},0),this}_removeHelperStyle(){var t;this.helper.classList.remove("ui-draggable-dragging");const e=(t=this.helper)==null?void 0:t.gridstackNode;if(!(e!=null&&e._isAboutToRemove)&&this.dragElementOriginStyle){const i=this.helper,r=this.dragElementOriginStyle.transition||null;i.style.transition=this.dragElementOriginStyle.transition="none",xl.originStyleProp.forEach(o=>i.style[o]=this.dragElementOriginStyle[o]||null),setTimeout(()=>i.style.transition=r,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const t={left:0,top:0},i=this.helper.style,r=this.dragOffset;i.left=(e.clientX+r.offsetLeft-t.left)*this.dragTransform.xScale+"px",i.top=(e.clientY+r.offsetTop-t.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,t,i){let r=0,o=0;i&&(r=this.dragTransform.xOffset,o=this.dragTransform.yOffset);const a=t.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-r,offsetTop:-e.clientY+a.top-o,width:a.width*this.dragTransform.xScale,height:a.height*this.dragTransform.yScale}}ui(){const t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:(i.left-t.left)*this.dragTransform.xScale}}}}xl.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class YW extends my{constructor(e,t={}){super(),this.el=e,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),In&&(this.el.addEventListener("pointerenter",ok),this.el.addEventListener("pointerleave",ak)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),In&&(this.el.removeEventListener("pointerenter",ok),this.el.removeEventListener("pointerleave",ak)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this._setupAccept(),this}_mouseEnter(e){if(!he.dragElement||!this._canDrop(he.dragElement.el))return;e.preventDefault(),e.stopPropagation(),he.dropElement&&he.dropElement!==this&&he.dropElement._mouseLeave(e,!0),he.dropElement=this;const t=P.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(he.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){var r;if(!he.dragElement||he.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const i=P.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui(he.dragElement)),this.triggerEvent("dropout",i),he.dropElement===this&&(delete he.dropElement,!t)){let o,a=this.el.parentElement;for(;!o&&a;)o=(r=a.ddElement)==null?void 0:r.ddDroppable,a=a.parentElement;o&&o._mouseEnter(e)}}drop(e){e.preventDefault();const t=P.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(he.dragElement)),this.triggerEvent("drop",t)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return{draggable:e.el,...e.ui()}}}class yy{static init(e){return e.ddElement||(e.ddElement=new yy(e)),e.ddElement}constructor(e){this.el=e}on(e,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,t),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new xl(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new _l(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new YW(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class qW{resizable(e,t,i,r){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddResizable&&o.ddResizable[t]();else if(t==="destroy")o.ddResizable&&o.cleanResizable();else if(t==="option")o.setupResizable({[i]:r});else{const s=o.el.gridstackNode.grid;let l=o.el.getAttribute("gs-resize-handles")||s.opts.resizable.handles||"e,s,se";l==="all"&&(l="n,e,s,w,se,sw,ne,nw");const u=!s.opts.alwaysShowResizeHandle;o.setupResizable({...s.opts.resizable,handles:l,autoHide:u,start:t.start,stop:t.stop,resize:t.resize})}}),this}draggable(e,t,i,r){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddDraggable&&o.ddDraggable[t]();else if(t==="destroy")o.ddDraggable&&o.cleanDraggable();else if(t==="option")o.setupDraggable({[i]:r});else{const a=o.el.gridstackNode.grid;o.setupDraggable({...a.opts.draggable,start:t.start,stop:t.stop,drag:t.drag})}}),this}dragIn(e,t){return this._getDDElements(e).forEach(i=>i.setupDraggable(t)),this}droppable(e,t,i,r){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=o=>t._accept(o)),this._getDDElements(e,t).forEach(o=>{t==="disable"||t==="enable"?o.ddDroppable&&o.ddDroppable[t]():t==="destroy"?o.ddDroppable&&o.cleanDroppable():t==="option"?o.setupDroppable({[i]:r}):o.setupDroppable(t)}),this}isDroppable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(r=>r.on(t,o=>{i(o,he.dragElement?he.dragElement.el:o.target,he.dragElement?he.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t){const i=e.gridstack||t!=="destroy"&&t!=="disable",r=P.getElements(e);return r.length?r.map(a=>a.ddElement||(i?yy.init(a):null)).filter(a=>a):[]}}/*!
|
|
2
67
|
* GridStack 11.5.1
|
|
3
68
|
* https://gridstackjs.com/
|
|
4
69
|
*
|
|
5
70
|
* Copyright (c) 2021-2024 Alain Dumesny
|
|
6
71
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
7
|
-
*/const
|
|
8
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},t=".grid-stack"){const i=[];return typeof document>"u"||(
|
|
9
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(e,t={}){if(!e)return null;let i=e;if(i.gridstack){const a=i.gridstack;return t&&(a.opts={...a.opts,...t}),t.children!==void 0&&a.load(t.children),a}return(!e.classList.contains("grid-stack")||w.addRemoveCB)&&(w.addRemoveCB?i=w.addRemoveCB(e,t,!0,!0):i=f.createDiv(["grid-stack",t.class],e)),w.init(t,i)}static registerEngine(e){w.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=f.createDiv([this.opts.placeholderClass,G.itemClass,this.opts.itemClass]);const e=f.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,t={}){var h,m,g;this.el=e,this.opts=t,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);const i=f.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let s=(h=t.columnOpts)==null?void 0:h.breakpoints;const r=t;if(r.oneColumnModeDomSort&&(delete r.oneColumnModeDomSort,console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")),r.oneColumnSize||r.disableOneColumnMode===!1){const y=r.oneColumnSize||768;delete r.oneColumnSize,delete r.disableOneColumnMode,t.columnOpts=t.columnOpts||{},s=t.columnOpts.breakpoints=t.columnOpts.breakpoints||[];let _=s.find(p=>p.c===1);_?_.w=y:(_={c:1,w:y},s.push(_,{c:12,w:y+1}))}const a=t.columnOpts;a&&(!a.columnWidth&&!((m=a.breakpoints)!=null&&m.length)?(delete t.columnOpts,s=void 0):a.columnMax=a.columnMax||12),(s==null?void 0:s.length)>1&&s.sort((y,_)=>(_.w||0)-(y.w||0));const o={...f.cloneDeep(G),column:f.toNumber(e.getAttribute("gs-column"))||G.column,minRow:i||f.toNumber(e.getAttribute("gs-min-row"))||G.minRow,maxRow:i||f.toNumber(e.getAttribute("gs-max-row"))||G.maxRow,staticGrid:f.toBool(e.getAttribute("gs-static"))||G.staticGrid,sizeToContent:f.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||G.draggable.handle},removableOptions:{accept:t.itemClass||G.removableOptions.accept,decline:G.removableOptions.decline}};e.getAttribute("gs-animate")&&(o.animate=f.toBool(e.getAttribute("gs-animate"))),t=f.defaults(t,o),this._initMargin(),this.checkDynamicColumn(),this.el.classList.add("gs-"+t.column),t.rtl==="auto"&&(t.rtl=e.style.direction==="rtl"),t.rtl&&this.el.classList.add("grid-stack-rtl");const u=this.el.closest("."+G.itemClass),d=u==null?void 0:u.gridstackNode;d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=t.cellHeight==="auto",this._isAutoCellHeight||t.cellHeight==="initial"?this.cellHeight(void 0,!1):(typeof t.cellHeight=="number"&&t.cellHeightUnit&&t.cellHeightUnit!==G.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit),this.cellHeight(t.cellHeight,!1)),t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=X),this._styleSheetClass="gs-id-"+te._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();const c=t.engineClass||w.engineClass||te;if(this.engine=new c({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:y=>{let _=0;this.engine.nodes.forEach(p=>{_=Math.max(_,p.y+p.h)}),y.forEach(p=>{const C=p.el;C&&(p._removeDOM?(C&&C.remove(),delete p._removeDOM):this._writePosAttr(C,p))}),this._updateStyles(!1,_)}}),this._updateStyles(!1,0),t.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(y=>this._prepareElement(y)),delete this.engine._loading,this.batchUpdate(!1)),t.children){const y=t.children;delete t.children,y.length&&this.load(y)}this.setAnimation(),t.subGridDynamic&&!x.pauseDrag&&(x.pauseDrag=!0),((g=t.draggable)==null?void 0:g.pause)!==void 0&&(x.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(e){if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let t,i=e;if(i.grid=this,i!=null&&i.el?t=i.el:w.addRemoveCB?t=w.addRemoveCB(this.el,e,!0,!1):t=this.createWidgetDivs(i),!t)return;if(i=t.gridstackNode,i&&t.parentElement===this.el&&this.engine.nodes.find(r=>r._id===i._id))return t;const s=this._readAttr(t);return f.defaults(e,s),this.engine.prepareNode(e),this.el.appendChild(t),this.makeWidget(t,e),t}createWidgetDivs(e){const t=f.createDiv(["grid-stack-item",this.opts.itemClass]),i=f.createDiv(["grid-stack-item-content"],t);return f.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([s])=>{var r,a;s.isIntersecting&&((r=e.visibleObservable)==null||r.disconnect(),delete e.visibleObservable,w.renderCB(i,e),(a=e.grid)==null||a.prepareDragDrop(e.el))}),window.setTimeout(()=>{var s;return(s=e.visibleObservable)==null?void 0:s.observe(t)})):w.renderCB(i,e),t}makeSubGrid(e,t,i,s=!0){var g,y,_;let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),(g=r.subGrid)!=null&&g.el)return r.subGrid;let a,o=this;for(;o&&!a;)a=(y=o.opts)==null?void 0:y.subGridOpts,o=(_=o.parentGridNode)==null?void 0:_.grid;t=f.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...t||r.subGridOpts||{}}),r.subGridOpts=t;let u;t.column==="auto"&&(u=!0,t.column=Math.max(r.w||1,(i==null?void 0:i.w)||1),delete t.columnOpts);let d=r.el.querySelector(".grid-stack-item-content"),c,h;if(s&&(this._removeDD(r.el),h={...r,x:0,y:0},f.removeInternalForSave(h),delete h.subGridOpts,r.content&&(h.content=r.content,delete r.content),w.addRemoveCB?c=w.addRemoveCB(this.el,h,!0,!1):(c=f.createDiv(["grid-stack-item"]),c.appendChild(d),d=f.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),i){const p=u?t.column:r.w,C=r.h+i.h,L=r.el.style;L.transition="none",this.update(r.el,{w:p,h:C}),setTimeout(()=>L.transition=null)}const m=r.subGrid=w.addGrid(d,t);return i!=null&&i._moving&&(m._isTemp=!0),u&&(m._autoColumn=!0),s&&m.makeWidget(c,h),i&&(i._moving?window.setTimeout(()=>f.simulateMouseEvent(i._event,"mouseenter",m.el),0):m.makeWidget(r.el,r)),this.resizeToContentCheck(!1,r),m}removeAsSubGrid(e){var i;const t=(i=this.parentGridNode)==null?void 0:i.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(s=>{s.x+=this.parentGridNode.x,s.y+=this.parentGridNode.y,t.makeWidget(s.el,s)}),t.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>f.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=w.saveCB){const s=this.engine.save(e,i);if(s.forEach(r=>{var a;if(e&&r.el&&!r.subGrid&&!i){const o=r.el.querySelector(".grid-stack-item-content");r.content=o==null?void 0:o.innerHTML,r.content||delete r.content}else if(!e&&!i&&delete r.content,(a=r.subGrid)!=null&&a.el){const o=r.subGrid.save(e,t,i);r.subGridOpts=t?o:{children:o},delete r.subGrid}delete r.el}),t){const r=f.cloneDeep(this.opts);r.marginBottom===r.marginTop&&r.marginRight===r.marginLeft&&r.marginTop===r.marginRight&&(r.margin=r.marginTop,delete r.marginTop,delete r.marginRight,delete r.marginBottom,delete r.marginLeft),r.rtl===(this.el.style.direction==="rtl")&&(r.rtl="auto"),this._isAutoCellHeight&&(r.cellHeight="auto"),this._autoColumn&&(r.column="auto");const a=r._alwaysShowResizeHandle;return delete r._alwaysShowResizeHandle,a!==void 0?r.alwaysShowResizeHandle=a:delete r.alwaysShowResizeHandle,f.removeInternalAndSame(r,G),r.children=s,r}return s}load(e,t=w.addRemoveCB||!0){var d;e=f.cloneDeep(e);const i=this.getColumn();e.forEach(c=>{c.w=c.w||1,c.h=c.h||1}),e=f.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;e.forEach(c=>{s=Math.max(s,(c.x||0)+c.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s),s>i&&this.engine.cacheLayout(e,s,!0);const r=w.addRemoveCB;typeof t=="function"&&(w.addRemoveCB=t);const a=[];this.batchUpdate();const o=!this.engine.nodes.length;o&&this.setAnimation(!1),!o&&t&&[...this.engine.nodes].forEach(h=>{if(!h.id)return;f.find(e,h.id)||(w.addRemoveCB&&w.addRemoveCB(this.el,h,!1,!1),a.push(h),this.removeWidget(h.el,!0,!1))}),this.engine._loading=!0;const u=[];return this.engine.nodes=this.engine.nodes.filter(c=>f.find(e,c.id)?(u.push(c),!1):!0),e.forEach(c=>{var m;const h=f.find(u,c.id);if(h){if(f.shouldSizeToContent(h)&&(c.h=h.h),this.engine.nodeBoundFix(c),(c.autoPosition||c.x===void 0||c.y===void 0)&&(c.w=c.w||h.w,c.h=c.h||h.h,this.engine.findEmptyPosition(c)),this.engine.nodes.push(h),f.samePos(h,c)&&this.engine.nodes.length>1&&(this.moveNode(h,{...c,forceCollide:!0}),f.copyPos(c,h)),this.update(h.el,c),(m=c.subGridOpts)!=null&&m.children){const g=h.el.querySelector(".grid-stack");g&&g.gridstack&&g.gridstack.load(c.subGridOpts.children)}}else t&&this.addWidget(c)}),delete this.engine._loading,this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?w.addRemoveCB=r:delete w.addRemoveCB,o&&((d=this.opts)!=null&&d.animate)&&this.setAnimation(this.opts.animate,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const t=this.el.querySelector("."+this.opts.itemClass);if(t){const s=f.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/s)}const i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(e,t=!0){if(t&&e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){const s=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+s}const i=f.parseHeight(e);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.resizeToContentCheck(),t&&this._updateStyles(!0),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){var t;return e&&((t=this.opts.columnOpts)!=null&&t.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var r,a;const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!((r=e.breakpoints)!=null&&r.length))return!1;const t=this.getColumn();let i=t;const s=this._widthOrContainer(!0);if(e.columnWidth)i=Math.min(Math.round(s/e.columnWidth)||1,e.columnMax);else{i=e.columnMax;let o=0;for(;o<e.breakpoints.length&&s<=e.breakpoints[o].w;)i=e.breakpoints[o++].c||t}if(i!==t){const o=(a=e.breakpoints)==null?void 0:a.find(u=>u.c===i);return this.column(i,(o==null?void 0:o.layout)||e.layout),!0}return!1}compact(e="compact",t=!0){return this.engine.compact(e,t),this._triggerChangeEvent(),this}column(e,t="moveScale"){if(!e||e<1||this.opts.column===e)return this;const i=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+i),this.el.classList.add("gs-"+e),this.engine.columnChanged(i,e,t),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){var t,i;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.classList.remove(this._styleSheetClass),this.el.removeAttribute("gs-current-row")),this._removeStylesheet(),(t=this.parentGridNode)==null||delete t.subGrid,delete this.parentGridNode,delete this.opts,(i=this._placeholder)==null||delete i.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,t=!1){const i=this.el.getBoundingClientRect();let s;t?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};const r=e.left-s.left,a=e.top-s.top,o=i.width/this.getColumn(),u=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/o),y:Math.floor(a/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(e,t,i,s){return this.engine.isAreaEmpty(e,t,i,s)}makeWidget(e,t){const i=w.getElement(e);if(!i)return;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,t);const s=i.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1);let r;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(r=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),r&&delete this._ignoreLayoutsNodeChange,i}on(e,t){return e.indexOf(" ")!==-1?(e.split(" ").forEach(s=>this.on(s,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=s=>t(s):this._gsEventHandler[e]=s=>{s.detail&&t(s,s.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=t:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.off(i)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,t=!0,i=!0){return e?(w.getElements(e).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let r=s.gridstackNode;r||(r=this.engine.nodes.find(a=>s===a.el)),r&&(t&&w.addRemoveCB&&w.addRemoveCB(this.el,r,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(r,t,i),t&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,t=!0){return this.engine.nodes.forEach(i=>{e&&w.addRemoveCB&&w.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(e,t),t&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,t){return t?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,t=!0,i=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.setStatic(e,t,i)}),t&&this._setStaticClass(),this)}updateOptions(e){var i;const t=this.opts;return e.acceptWidgets!==void 0&&this._setupAcceptWidget(),e.animate!==void 0&&this.setAnimation(),e.cellHeight&&(this.cellHeight(e.cellHeight,!0),delete e.cellHeight),e.class&&e.class!==t.class&&(t.class&&this.el.classList.remove(t.class),this.el.classList.add(e.class)),typeof e.column=="number"&&!e.columnOpts&&(this.column(e.column),delete e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0&&(t.minRow=t.maxRow=e.row),(i=e.children)!=null&&i.length&&(this.load(e.children),delete e.children),this.opts={...this.opts,...e},this}update(e,t){return w.getElements(e).forEach(i=>{var c;const s=i==null?void 0:i.gridstackNode;if(!s)return;const r={...f.copyPos({},s),...f.cloneDeep(t)};this.engine.nodeBoundFix(r),delete r.autoPosition;const a=["x","y","w","h"];let o;if(a.some(h=>r[h]!==void 0&&r[h]!==s[h])&&(o={},a.forEach(h=>{o[h]=r[h]!==void 0?r[h]:s[h],delete r[h]})),!o&&(r.minW||r.minH||r.maxW||r.maxH)&&(o={}),r.content!==void 0){const h=i.querySelector(".grid-stack-item-content");h&&h.textContent!==r.content&&(s.content=r.content,w.renderCB(h,r),(c=s.subGrid)!=null&&c.el&&(h.appendChild(s.subGrid.el),s.subGrid.opts.styleInHead||s.subGrid._updateStyles(!0))),delete r.content}let u=!1,d=!1;for(const h in r)h[0]!=="_"&&s[h]!==r[h]&&(s[h]=r[h],u=!0,d=d||!this.opts.staticGrid&&(h==="noResize"||h==="noMove"||h==="locked"));if(f.sanitizeMinMax(s),o){const h=o.w!==void 0&&o.w!==s.w;this.moveNode(s,o),h&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(h,s),delete s._orig}(o||u)&&this._writeAttr(i,s),d&&this.prepareDragDrop(s.el)}),this}moveNode(e,t){const i=e._updating;i||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,t),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){var m,g;if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const t=e.gridstackNode;if(!t)return;const i=t.grid;if(!i||e.parentElement!==i.el)return;const s=i.getCellHeight(!0);if(!s)return;let r=t.h?t.h*s:e.clientHeight,a;if(t.resizeToContentParent&&(a=e.querySelector(t.resizeToContentParent)),a||(a=e.querySelector(w.resizeToContentParent)),!a)return;const o=e.clientHeight-a.clientHeight,u=t.h?t.h*s-o:a.clientHeight;let d;if(t.subGrid){d=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);const y=t.subGrid.el.getBoundingClientRect(),_=t.subGrid.el.parentElement.getBoundingClientRect();d+=y.top-_.top}else{if((g=(m=t.subGridOpts)==null?void 0:m.children)!=null&&g.length)return;{const y=a.firstElementChild;if(!y){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${w.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}d=y.getBoundingClientRect().height||u}}if(u===d)return;r+=d-u;let c=Math.ceil(r/s);const h=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;h&&c>h&&(c=h,e.classList.add("size-to-content-max")),t.minH&&c<t.minH?c=t.minH:t.maxH&&c>t.maxH&&(c=t.maxH),c!==t.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(t,{h:c}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){w.resizeToContentCB?w.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,t){return w.getElements(e).forEach(i=>{const s=i.gridstackNode;if(!f.canBeRotated(s))return;const r={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(t){const o=t.left>0?Math.floor(t.left/this.cellWidth()):0,u=t.top>0?Math.floor(t.top/this.opts.cellHeight):0;r.x=s.x+o-(s.h-(u+1)),r.y=s.y+u-o}Object.keys(r).forEach(o=>{r[o]===void 0&&delete r[o]});const a=s._orig;this.update(i,r),s._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const i=f.parseHeight(e);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(e){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const t=arguments;let i=0,s={x:t[i++],y:t[i++],w:t[i++],h:t[i++],autoPosition:t[i++]};return this.willItFit(s)}return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.addedNodes)!=null&&e.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});const t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.removedNodes)!=null&&e.length){const t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(e,t){const i=t?new CustomEvent(e,{bubbles:!1,detail:t}):new Event(e);return this.el.dispatchEvent(i),this}_removeStylesheet(){if(this._styles){const e=this.opts.styleInHead?void 0:this.el.parentNode;f.removeStylesheet(this._styleSheetClass,e),delete this._styles}return this}_updateStyles(e=!1,t){if(e&&this._removeStylesheet(),t===void 0&&(t=this.getRow()),this._updateContainerHeight(),this.opts.cellHeight===0)return this;const i=this.opts.cellHeight,s=this.opts.cellHeightUnit,r=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){const a=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=f.createStylesheet(this._styleSheetClass,a,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,f.addCSSRule(this._styles,r,`height: ${i}${s}`);const o=this.opts.marginTop+this.opts.marginUnit,u=this.opts.marginBottom+this.opts.marginUnit,d=this.opts.marginRight+this.opts.marginUnit,c=this.opts.marginLeft+this.opts.marginUnit,h=`${r} > .grid-stack-item-content`,m=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;f.addCSSRule(this._styles,h,`top: ${o}; right: ${d}; bottom: ${u}; left: ${c};`),f.addCSSRule(this._styles,m,`top: ${o}; right: ${d}; bottom: ${u}; left: ${c};`),f.addCSSRule(this._styles,`${r} > .ui-resizable-n`,`top: ${o};`),f.addCSSRule(this._styles,`${r} > .ui-resizable-s`,`bottom: ${u}`),f.addCSSRule(this._styles,`${r} > .ui-resizable-ne`,`right: ${d}; top: ${o}`),f.addCSSRule(this._styles,`${r} > .ui-resizable-e`,`right: ${d}`),f.addCSSRule(this._styles,`${r} > .ui-resizable-se`,`right: ${d}; bottom: ${u}`),f.addCSSRule(this._styles,`${r} > .ui-resizable-nw`,`left: ${c}; top: ${o}`),f.addCSSRule(this._styles,`${r} > .ui-resizable-w`,`left: ${c}`),f.addCSSRule(this._styles,`${r} > .ui-resizable-sw`,`left: ${c}; bottom: ${u}`)}if(t=t||this._styles._max,t>this._styles._max){const a=o=>i*o+s;for(let o=this._styles._max+1;o<=t;o++)f.addCSSRule(this._styles,`${r}[gs-y="${o}"]`,`top: ${a(o)}`),f.addCSSRule(this._styles,`${r}[gs-h="${o+1}"]`,`height: ${a(o+1)}`);this._styles._max=t}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let t=this.getRow()+this._extraDragRow;const i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!e){const r=f.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===s){const a=Math.floor(r.h/i);t<a&&(t=a)}}return this.el.setAttribute("gs-current-row",String(t)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),t&&(this.el.style[e?"minHeight":"height"]=t*i+s),e&&!e.grid.engine.batchMode&&f.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,t=!1,i){i=i||this._readAttr(e),e.gridstackNode=i,i.el=e,i.grid=this,i=this.engine.addNode(i,t),this._writeAttr(e,i),e.classList.add(G.itemClass,this.opts.itemClass);const s=f.shouldSizeToContent(i);return s?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),f.lazyLoad(i)||this.prepareDragDrop(i.el),this}_writePosAttr(e,t){return t.x!==void 0&&t.x!==null&&e.setAttribute("gs-x",String(t.x)),t.y!==void 0&&t.y!==null&&e.setAttribute("gs-y",String(t.y)),t.w>1?e.setAttribute("gs-w",String(t.w)):e.removeAttribute("gs-w"),t.h>1?e.setAttribute("gs-h",String(t.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,t){if(!t)return this;this._writePosAttr(e,t);const i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const s in i)t[s]?e.setAttribute(i[s],String(t[s])):e.removeAttribute(i[s]);return this}_readAttr(e,t=!0){const i={};i.x=f.toNumber(e.getAttribute("gs-x")),i.y=f.toNumber(e.getAttribute("gs-y")),i.w=f.toNumber(e.getAttribute("gs-w")),i.h=f.toNumber(e.getAttribute("gs-h")),i.autoPosition=f.toBool(e.getAttribute("gs-auto-position")),i.noResize=f.toBool(e.getAttribute("gs-no-resize")),i.noMove=f.toBool(e.getAttribute("gs-no-move")),i.locked=f.toBool(e.getAttribute("gs-locked"));const s=e.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?i.sizeToContent=f.toBool(s):i.sizeToContent=parseInt(s,10)),i.id=e.getAttribute("gs-id"),i.maxW=f.toNumber(e.getAttribute("gs-max-w")),i.minW=f.toNumber(e.getAttribute("gs-min-w")),i.maxH=f.toNumber(e.getAttribute("gs-max-h")),i.minH=f.toNumber(e.getAttribute("gs-min-h")),t&&(i.w===1&&e.removeAttribute("gs-w"),i.h===1&&e.removeAttribute("gs-h"),i.maxW&&e.removeAttribute("gs-max-w"),i.minW&&e.removeAttribute("gs-min-w"),i.maxH&&e.removeAttribute("gs-max-h"),i.minH&&e.removeAttribute("gs-min-h"));for(const r in i){if(!i.hasOwnProperty(r))return;!i[r]&&i[r]!==0&&r!=="gs-size-to-content"&&delete i[r]}return i}_setStaticClass(){const e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=(t=>(t=this.el)==null?void 0:t.clientWidth)()){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(s=>{s.subGrid&&s.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,t=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,t),this.animationDelay);if(t)f.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.el);else if(this.engine.nodes.some(i=>f.shouldSizeToContent(i))){const i=[...this.engine.nodes];this.batchUpdate(),i.forEach(s=>{f.shouldSizeToContent(s)&&this.resizeToContentCBCheck(s.el)}),this.batchUpdate(!1)}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,t?[t]:this.engine.nodes)}}_updateResizeEvent(e=!1){const t=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!this.resizeObserver?(this._sizeThrottle=f.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!t)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return f.getElement(e)}static getElements(e=".grid-stack-item"){return f.getElements(e)}static getGridElement(e){return w.getElement(e)}static getGridElements(e){return f.getElements(e)}_initMargin(){let e,t=0,i=[];return typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(e=f.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,t=this.opts.margin=e.h),this.opts.marginTop===void 0?this.opts.marginTop=t:(e=f.parseHeight(this.opts.marginTop),this.opts.marginTop=e.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=t:(e=f.parseHeight(this.opts.marginBottom),this.opts.marginBottom=e.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=t:(e=f.parseHeight(this.opts.marginRight),this.opts.marginRight=e.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=t:(e=f.parseHeight(this.opts.marginLeft),this.opts.marginLeft=e.h,delete this.opts.margin),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static getDD(){return $}static setupDragIn(e,t,i,s=document){(t==null?void 0:t.pause)!==void 0&&(x.pauseDrag=t.pause),t={appendTo:"body",helper:"clone",...t||{}},(typeof e=="string"?f.getElements(e,s):e).forEach((a,o)=>{$.isDraggable(a)||$.dragIn(a,t),i!=null&&i[o]&&(a.gridstackNode=i[o])})}movable(e,t){return this.opts.staticGrid?this:(w.getElements(e).forEach(i=>{const s=i.gridstackNode;s&&(t?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(e,t){return this.opts.staticGrid?this:(w.getElements(e).forEach(i=>{const s=i.gridstackNode;s&&(t?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableMove(e,t)}),this)}enableResize(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}cancelDrag(){var t;const e=(t=this._placeholder)==null?void 0:t.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&w._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return $.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return $.droppable(this.el,"destroy"),this;let e,t;const i=(s,r,a)=>{var m;a=a||r;const o=a.gridstackNode;if(!o)return;if(!((m=o.grid)!=null&&m.el)){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const g=a.getBoundingClientRect();a.style.left=g.x+(this.dragTransform.xScale-1)*(s.clientX-g.x)/this.dragTransform.xScale+"px",a.style.top=g.y+(this.dragTransform.yScale-1)*(s.clientY-g.y)/this.dragTransform.yScale+"px",a.style.transformOrigin="0px 0px"}let{top:u,left:d}=a.getBoundingClientRect();const c=this.el.getBoundingClientRect();d-=c.left,u-=c.top;const h={position:{top:u*this.dragTransform.xScale,left:d*this.dragTransform.yScale}};if(o._temporaryRemoved){if(o.x=Math.max(0,Math.round(d/t)),o.y=Math.max(0,Math.round(u/e)),delete o.autoPosition,this.engine.nodeBoundFix(o),!this.engine.willItFit(o)){if(o.autoPosition=!0,!this.engine.willItFit(o)){$.off(r,"drag");return}o._willFitPos&&(f.copyPos(o,o._willFitPos),delete o._willFitPos)}this._onStartMoving(a,s,h,o,t,e)}else this._dragOrResize(a,s,h,o,t,e)};return $.droppable(this.el,{accept:s=>{const r=s.gridstackNode||this._readAttr(s,!1);if((r==null?void 0:r.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(s);else{const o=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=s.matches(o)}if(a&&r&&this.opts.maxRow){const o={w:r.w,h:r.h,minW:r.minW,minH:r.minH};a=this.engine.willItFit(o)}return a}}).on(this.el,"dropover",(s,r,a)=>{let o=(a==null?void 0:a.gridstackNode)||r.gridstackNode;if((o==null?void 0:o.grid)===this&&!o._temporaryRemoved)return!1;if(o!=null&&o._sidebarOrig&&(o.w=o._sidebarOrig.w,o.h=o._sidebarOrig.h),o!=null&&o.grid&&o.grid!==this&&!o._temporaryRemoved&&o.grid._leave(r,a),a=a||r,t=this.cellWidth(),e=this.getCellHeight(!0),!o){const c=a.getAttribute("data-gs-widget")||a.getAttribute("gridstacknode");if(c){try{o=JSON.parse(c)}catch{console.error("Gridstack dropover: Bad JSON format: ",c)}a.removeAttribute("data-gs-widget"),a.removeAttribute("gridstacknode")}o||(o=this._readAttr(a)),o._sidebarOrig={w:o.w,h:o.h}}o.grid||(o.el||(o={...o}),o._isExternal=!0,a.gridstackNode=o);const u=o.w||Math.round(a.offsetWidth/t)||1,d=o.h||Math.round(a.offsetHeight/e)||1;return o.grid&&o.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=o),r.gridstackNode=o={...o,w:u,h:d,grid:this},delete o.x,delete o.y,this.engine.cleanupNode(o).nodeBoundFix(o),o._initDD=o._isExternal=o._temporaryRemoved=!0):(o.w=u,o.h=d,o._temporaryRemoved=!0),w._itemRemoving(o.el,!1),$.on(r,"drag",i),i(s,r,a),!1}).on(this.el,"dropout",(s,r,a)=>{const o=(a==null?void 0:a.gridstackNode)||r.gridstackNode;return o&&(!o.grid||o.grid===this)&&(this._leave(r,a),this._isTemp&&this.removeAsSubGrid(o)),!1}).on(this.el,"drop",(s,r,a)=>{var g,y,_;const o=(a==null?void 0:a.gridstackNode)||r.gridstackNode;if((o==null?void 0:o.grid)===this&&!o._isExternal)return!1;const u=!!this.placeholder.parentElement,d=r!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode;const c=u&&this.opts.animate;c&&this.setAnimation(!1);const h=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,u&&(h!=null&&h.grid)&&h.grid!==this){const p=h.grid;p.engine.removeNodeFromLayoutCache(h),p.engine.removedNodes.push(h),p._triggerRemoveEvent()._triggerChangeEvent(),p.parentGridNode&&!p.engine.nodes.length&&p.opts.subGridDynamic&&p.removeAsSubGrid()}if(!o||(u&&(this.engine.cleanupNode(o),o.grid=this),(g=o.grid)==null||delete g._isTemp,$.off(r,"drag"),a!==r?(a.remove(),r=a):r.remove(),this._removeDD(r),!u))return!1;const m=(_=(y=o.subGrid)==null?void 0:y.el)==null?void 0:_.gridstack;return f.copyPos(o,this._readAttr(this.placeholder)),f.removePositioningStyles(r),d&&(o.content||o.subGridOpts||w.addRemoveCB)?(delete o.el,r=this.addWidget(o)):(this._prepareElement(r,!0,o),this.el.appendChild(r),this.resizeToContentCheck(!1,o),m&&(m.parentGridNode=o,m.opts.styleInHead||m._updateStyles(!0)),this._updateContainerHeight()),this.engine.addedNodes.push(o),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...s,type:"dropped"},h&&h.grid?h:void 0,o),c&&this.setAnimation(this.opts.animate,!0),!1}),this}static _itemRemoving(e,t){if(!e)return;const i=e?e.gridstackNode:void 0;!(i!=null&&i.grid)||e.classList.contains(i.grid.opts.removableOptions.decline)||(t?i._isAboutToRemove=!0:delete i._isAboutToRemove,t?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!$.isDroppable(e)&&$.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>w._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>w._itemRemoving(i,!1)),this):this}prepareDragDrop(e,t=!1){const i=e==null?void 0:e.gridstackNode;if(!i)return;const s=i.noMove||this.opts.disableDrag,r=i.noResize||this.opts.disableResize,a=this.opts.staticGrid||s&&r;if((t||a)&&(i._initDD&&(this._removeDD(e),delete i._initDD),a&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!t))return this;if(!i._initDD){let o,u;const d=(m,g)=>{this._gsEventHandler[m.type]&&this._gsEventHandler[m.type](m,m.target),o=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,m,g,i,o,u)},c=(m,g)=>{this._dragOrResize(e,m,g,i,o,u)},h=m=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._event,delete i._lastTried;const g=i.w!==i._orig.w,y=m.target;if(!(!y.gridstackNode||y.gridstackNode.grid!==this)){if(i.el=y,i._isAboutToRemove){const _=e.gridstackNode.grid;_._gsEventHandler[m.type]&&_._gsEventHandler[m.type](m,y),_.engine.nodes.push(i),_.removeWidget(e,!0,!0)}else f.removePositioningStyles(y),i._temporaryRemoved?(f.copyPos(i,i._orig),this._writePosAttr(y,i),this.engine.addNode(i)):this._writePosAttr(y,i),this._gsEventHandler[m.type]&&this._gsEventHandler[m.type](m,y);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),m.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(g,i))}};$.draggable(e,{start:d,stop:h,drag:c}).resizable(e,{start:d,stop:h,resize:c}),i._initDD=!0}return $.draggable(e,s?"disable":"enable").resizable(e,r?"disable":"enable"),this}_onStartMoving(e,t,i,s,r,a){var o;if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=s,(o=s.grid)!=null&&o.el)this.dragTransform=f.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const u=this.placeholder.closest(".grid-stack");this.dragTransform=f.getValuesFromTransformedElement(u)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(s.el=this.placeholder,s._lastUiPosition=i.position,s._prevYPix=i.position.top,s._moving=t.type==="dragstart",delete s._lastTried,t.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(r,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"){const u=this.getColumn()-s.x,d=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;$.resizable(e,"option","minWidth",r*Math.min(s.minW||1,u)).resizable(e,"option","minHeight",a*Math.min(s.minH||1,d)).resizable(e,"option","maxWidth",r*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxWidthMoveLeft",r*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(e,"option","maxHeight",a*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,d)).resizable(e,"option","maxHeightMoveUp",a*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(e,t,i,s,r,a){const o={...s._orig};let u,d=this.opts.marginLeft,c=this.opts.marginRight,h=this.opts.marginTop,m=this.opts.marginBottom;const g=Math.round(a*.1),y=Math.round(r*.1);if(d=Math.min(d,y),c=Math.min(c,y),h=Math.min(h,g),m=Math.min(m,g),t.type==="drag"){if(s._temporaryRemoved)return;const p=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&f.updateScrollPosition(e,i.position,p);const C=i.position.left+(i.position.left>s._lastUiPosition.left?-c:d),L=i.position.top+(i.position.top>s._lastUiPosition.top?-m:h);o.x=Math.round(C/r),o.y=Math.round(L/a);const z=this._extraDragRow;if(this.engine.collide(s,o)){const Y=this.getRow();let q=Math.max(0,o.y+s.h-Y);this.opts.maxRow&&Y+q>this.opts.maxRow&&(q=Math.max(0,this.opts.maxRow-Y)),this._extraDragRow=q}else this._extraDragRow=0;if(this._extraDragRow!==z&&this._updateContainerHeight(),s.x===o.x&&s.y===o.y)return}else if(t.type==="resize"){if(o.x<0||(f.updateScrollResize(t,e,a),o.w=Math.round((i.size.width-d)/r),o.h=Math.round((i.size.height-h)/a),s.w===o.w&&s.h===o.h)||s._lastTried&&s._lastTried.w===o.w&&s._lastTried.h===o.h)return;const p=i.position.left+d,C=i.position.top+h;o.x=Math.round(p/r),o.y=Math.round(C/a),u=!0}s._event=t,s._lastTried=o;const _={x:i.position.left+d,y:i.position.top+h,w:(i.size?i.size.width:s.w*r)-d-c,h:(i.size?i.size.height:s.h*a)-h-m};if(this.engine.moveNodeCheck(s,{...o,cellWidth:r,cellHeight:a,rect:_,resizing:u})){s._lastUiPosition=i.position,this.engine.cacheRects(r,a,h,c,m,d),delete s._skipDown,u&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const p=t.target;s._sidebarOrig||this._writePosAttr(p,s),this._gsEventHandler[t.type]&&this._gsEventHandler[t.type](t,p)}}_leave(e,t){t=t||e;const i=t.gridstackNode;if(!i||(t.style.transform=t.style.transformOrigin=null,$.off(e,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e;const s=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=s,this.opts.removable===!0&&w._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}commit(){return gi(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}w.renderCB=(l,e)=>{l&&(e!=null&&e.content)&&(l.textContent=e.content)},w.resizeToContentParent=".grid-stack-item-content",w.Utils=f,w.Engine=te,w.GDRev="11.5.1";const bi=["data-id","data-testid","gs-h","gs-w","gs-x","gs-y"],vi={class:"grid-stack-item-content"},wi=de(n.defineComponent({__name:"DraggableGridLayout",props:{tiles:{},tileHeight:{default:ce}},emits:["update-tiles"],setup(l,{expose:e,emit:t}){const i=l,s=t,r=n.ref(null),a=n.ref(new Map(i.tiles.map(g=>[`${g.id}`,g])));let o=null;const u=g=>`[data-id="${g}"]`,d=g=>g.map(y=>{var p;const _=a.value.get(`${(p=y.el)==null?void 0:p.getAttribute("data-id")}`);if(_)return{..._,layout:{position:{col:Number(y.x),row:Number(y.y)},size:{cols:Number(y.w),rows:Number(y.h)}}}}).filter(y=>y!==void 0),c=(g,y)=>{o&&(d(y).forEach(p=>{a.value.set(`${p.id}`,p)}),s("update-tiles",Array.from(a.value.values())))},h=(g,y)=>{y.forEach(_=>{var p;a.value.delete(`${(p=_.el)==null?void 0:p.getAttribute("data-id")}`)}),s("update-tiles",Array.from(a.value.values()))};n.onMounted(()=>{r.value&&(o=w.init({margin:10,column:Pe,cellHeight:i.tileHeight,resizable:{handles:"se, sw"},handle:".tile-header"},r.value),o.on("change",c),o.on("added",c),o.on("removed",h))}),n.onUnmounted(()=>{o&&o.destroy(!1)});const m=g=>{if(o&&r.value){const y=r.value.querySelector(u(g));y&&o.removeWidget(y)}};return n.watch(()=>i.tiles.length,async(g,y)=>{if(g>y&&o){const _=i.tiles.slice(y);for(const p of _)a.value.set(`${p.id}`,p),await n.nextTick(),o.makeWidget(u(p.id),{autoPosition:!0,w:p.layout.size.cols,h:p.layout.size.rows})}}),n.watchEffect(()=>{i.tiles.forEach(g=>{a.value.set(`${g.id}`,g)})}),e({removeWidget:m}),(g,y)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"gridContainer",ref:r,class:"grid-stack"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.tiles,_=>(n.openBlock(),n.createElementBlock("div",{key:_.id,class:"grid-stack-item","data-id":`${_.id}`,"data-testid":`grid-stack-item-${_.id}`,"gs-h":_.layout.size.rows,"gs-lazy-load":!0,"gs-w":_.layout.size.cols,"gs-x":_.layout.position.col,"gs-y":_.layout.position.row},[n.createElementVNode("div",vi,[n.renderSlot(g.$slots,"tile",{tile:_},void 0,!0)])],8,bi))),128))],512))}}),[["__scopeId","data-v-a68d6821"]]),Ei={key:0,class:"fullscreen-header"},xi={key:0,class:"tile-container slottable-tile"},Ci=de(n.defineComponent({__name:"DashboardRenderer",props:n.mergeModels({context:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:n.mergeModels(["edit-tile","tile-time-range-zoom"],["update:modelValue"]),setup(l,{expose:e,emit:t}){n.useCssVars(k=>({v019a5586:h.value}));const i=l,s=t,r=n.useModel(l,"modelValue"),{i18n:a}=re.useI18n(),o=n.ref(0),u=n.ref(null),d=n.ref(),c=n.ref(),h=n.ref("scale(1)"),m=n.inject(se);m||(console.warn("Analytics dashboards require a query bridge supplied via provide / inject."),console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"),console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")),re.useRequestQueue();const g=ye.useAnalyticsConfigStore(),y=n.computed(()=>i.context.timeSpec?i.context.timeSpec:{type:"relative",time_range:g.defaultQueryTimeForOrg}),_=n.computed(()=>!!i.context.timeSpec||!g.loading),p=(k,A)=>{const I=k.layout.position.row-A.layout.position.row;return I!==0?I:k.layout.position.col-A.layout.position.col},C=n.computed(()=>r.value.tiles.map(k=>{var I;let A=k.definition;if("description"in A.chart){const M=(I=A.chart.description)==null?void 0:I.replace(et,()=>{const ke=`renderer.trendRange.${y.value.type==="absolute"?"custom":y.value.time_range}`;return a.te(ke)?a.t(ke):""});A={...A,chart:{...A.chart,description:M}}}return i.context.editable&&!k.id&&console.warn("No id provided for tile. One will be generated automatically,","however tracking changes to this tile may not work as expected.",k),{layout:k.layout,meta:A,type:k.type,id:k.id??crypto.randomUUID()}})),L=k=>{s("edit-tile",k)},z=k=>k.type==="slottable",Y=k=>{const A=z(k.meta.chart)?{...k.meta.chart}:{...k.meta.chart,chart_title:k.meta.chart.chart_title?`Copy of ${k.meta.chart.chart_title}`:""},I={id:crypto.randomUUID(),type:"chart",definition:{...k.meta,chart:A},layout:{position:{col:0,row:0},size:k.layout.size}};r.value.tiles.push(I)},q=k=>{u.value&&u.value.removeWidget(k.id)},S=()=>{o.value++},O=k=>{const A=k.map(I=>({id:I.id,type:I.type,layout:I.layout,definition:I.meta}));r.value.tiles=A.sort(p)},U=async()=>{if(h.value="scale(1)",await n.nextTick(),c.value){const{availWidth:k,availHeight:A}=window.screen,{width:I,height:M}=c.value.getBoundingClientRect(),W=Math.min(A/M,k/I);h.value=`scale(${W})`}},oe=()=>{d.value&&(document.fullscreenElement?document.exitFullscreen():d.value.requestFullscreen())},Z=n.ref(!1),Ce=()=>{Z.value=document.fullscreenElement!==null,Z.value&&U()},We=n.computed(()=>r.value.preset_filters??[]),{internalContext:Me}=re.useDashboardInternalContext({globalFilters:We,context:n.toRef(i,"context"),isFullscreen:Z});return e({refresh:S,toggleFullscreen:oe}),(k,A)=>{const I=n.resolveComponent("KAlert");return n.openBlock(),n.createElementBlock("div",{ref_key:"dashboardContainer",ref:d,class:n.normalizeClass(["kong-ui-public-dashboard-renderer",{"is-fullscreen":Z.value}]),onFullscreenchange:Ce},[n.createElementVNode("div",{ref_key:"layoutContainer",ref:c,class:"layout"},[n.unref(m)&&Z.value?(n.openBlock(),n.createElementBlock("div",Ei,[n.renderSlot(k.$slots,"fullscreenHeader",{},void 0,!0)])):n.createCommentVNode("",!0),n.unref(m)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.context.editable&&!Z.value?wi:yt),{key:2,ref_key:"gridLayoutRef",ref:u,"tile-height":r.value.tile_height,tiles:C.value,onUpdateTiles:O},{tile:n.withCtx(({tile:M})=>[M.meta.chart.type==="slottable"?(n.openBlock(),n.createElementBlock("div",xi,[n.renderSlot(k.$slots,M.meta.chart.id,{},void 0,!0)])):(n.openBlock(),n.createBlock(pt,{key:Z.value?`${M.id}-tile`:`${M.id}-tile-fullscreen`,"refresh-counter":o.value,"onUpdate:refreshCounter":A[0]||(A[0]=W=>o.value=W),class:"tile-container",context:n.unref(Me),definition:M.meta,height:M.layout.size.rows*(r.value.tile_height||n.unref(ce))+parseInt(n.unref(gt),10),"is-fullscreen":Z.value,"query-ready":_.value,"tile-id":M.id,onDuplicateTile:W=>Y(M),onEditTile:W=>L(M),onRemoveTile:W=>q(M),onTileTimeRangeZoom:A[1]||(A[1]=W=>s("tile-time-range-zoom",W))},null,8,["refresh-counter","context","definition","height","is-fullscreen","query-ready","tile-id","onDuplicateTile","onEditTile","onRemoveTile"]))]),_:3},40,["tile-height","tiles"])):(n.openBlock(),n.createBlock(I,{key:1,appearance:"danger"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a).t("renderer.noQueryBridge")),1)]),_:1}))],512)],34)}}}),[["__scopeId","data-v-1fc40e84"]]),ki=n.defineComponent({__name:"DashboardTilePreview",props:{context:{},definition:{},globalFilters:{default:()=>[]}},emits:["tile-time-range-zoom","tile-bounds-change"],setup(l,{expose:e,emit:t}){const i=n.useTemplateRef("root"),s=crypto.randomUUID(),r=t,a=_=>{r("tile-time-range-zoom",_)},o=_=>{r("tile-bounds-change",_)},{internalContext:u}=re.useDashboardInternalContext({globalFilters:n.toRef(()=>l.globalFilters),context:n.toRef(()=>l.context)}),d=ye.useAnalyticsConfigStore(),c=n.computed(()=>!!l.context.timeSpec||!d.loading),h=n.ref(ce);let m;n.onMounted(()=>{var p;const _=(p=i.value)==null?void 0:p.parentElement;_&&(h.value=_.getBoundingClientRect().height,m=new ResizeObserver(([C])=>{const{height:L}=C.contentRect;h.value=L}),m.observe(_))}),n.onUnmounted(()=>m==null?void 0:m.disconnect());const g=n.ref(0);return e({refresh:()=>{g.value++}}),(_,p)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:i,"data-testid":"dashboard-tile-preview-root"},[n.createVNode(pt,{"refresh-counter":g.value,"onUpdate:refreshCounter":p[0]||(p[0]=C=>g.value=C),context:{...n.unref(u),editable:!1},definition:l.definition,height:h.value,"hide-actions":"","query-ready":c.value,"show-refresh":"","tile-id":n.unref(s),onTileBoundsChange:o,onTileTimeRangeZoom:a},null,8,["refresh-counter","context","definition","height","query-ready","tile-id"])],512))}}),Ri=Object.freeze(Object.defineProperty({__proto__:null,default:n.defineComponent({__name:"GeoMapRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},emits:["bounds-change"],setup(l,{emit:e}){const t=n.ref(void 0),i=n.computed(()=>t.value?Xe.exploreResultToCountryMetrics(t.value):{}),s=n.computed(()=>{var d;return t.value?((d=t.value)==null?void 0:d.meta.metric_names)&&t.value.meta.metric_names[0]:""}),r=n.computed(()=>{var h,m,g;if(!t.value)return"";const d=(h=t==null?void 0:t.value)==null?void 0:h.meta.metric_units,c=(g=(m=t==null?void 0:t.value)==null?void 0:m.meta)==null?void 0:g.metric_names;return d&&c&&d[c[0]]}),a=d=>{t.value=d},o=e,u=d=>{o("bounds-change",d)};return(d,c)=>(n.openBlock(),n.createBlock(Te,{context:l.context,"limit-override":n.unref(T.COUNTRIES).length,query:l.query,"query-ready":l.queryReady,"refresh-counter":l.refreshCounter,onChartData:a},{default:n.withCtx(()=>[n.createVNode(n.unref(Xe.AnalyticsGeoMap),{bounds:l.chartOptions.bounds,"country-metrics":i.value,"fit-to-country":l.chartOptions.fit_to_country,metric:s.value,"metric-unit":r.value,"with-legend":l.chartOptions.legend||!1,onBoundsChange:u},null,8,["bounds","country-metrics","fit-to-country","metric","metric-unit","with-legend"])]),_:1},8,["context","limit-override","query","query-ready","refresh-counter"]))}})},Symbol.toStringTag,{value:"Module"}));v.CP_ID_TOKEN=Je,v.DASHBOARD_COLS=Pe,v.DEFAULT_TILE_HEIGHT=ce,v.DEFAULT_TILE_REFRESH_INTERVAL_MS=tt,v.DashboardRenderer=Ci,v.DashboardTilePreview=ki,v.ENTITY_ID_TOKEN=$e,v.FULLSCREEN_LONG_REFRESH_INTERVAL_MS=st,v.FULLSCREEN_SHORT_REFRESH_INTERVAL_MS=it,v.GridLayout=yt,v.INJECT_QUERY_PROVIDER=se,v.TIMEFRAME_TOKEN=et,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|
|
72
|
+
*/const Nt=new qW;class le{static init(e={},t=".grid-stack"){if(typeof document>"u")return null;const i=le.getGridElement(t);return i?(i.gridstack||(i.gridstack=new le(i,P.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
|
|
73
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},t=".grid-stack"){const i=[];return typeof document>"u"||(le.getGridElements(t).forEach(r=>{r.gridstack||(r.gridstack=new le(r,P.cloneDeep(e))),i.push(r.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
|
|
74
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(e,t={}){if(!e)return null;let i=e;if(i.gridstack){const a=i.gridstack;return t&&(a.opts={...a.opts,...t}),t.children!==void 0&&a.load(t.children),a}return(!e.classList.contains("grid-stack")||le.addRemoveCB)&&(le.addRemoveCB?i=le.addRemoveCB(e,t,!0,!0):i=P.createDiv(["grid-stack",t.class],e)),le.init(t,i)}static registerEngine(e){le.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=P.createDiv([this.opts.placeholderClass,Xt.itemClass,this.opts.itemClass]);const e=P.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,t={}){var h,d,f;this.el=e,this.opts=t,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);const i=P.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let r=(h=t.columnOpts)==null?void 0:h.breakpoints;const o=t;if(o.oneColumnModeDomSort&&(delete o.oneColumnModeDomSort,console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")),o.oneColumnSize||o.disableOneColumnMode===!1){const p=o.oneColumnSize||768;delete o.oneColumnSize,delete o.disableOneColumnMode,t.columnOpts=t.columnOpts||{},r=t.columnOpts.breakpoints=t.columnOpts.breakpoints||[];let g=r.find(m=>m.c===1);g?g.w=p:(g={c:1,w:p},r.push(g,{c:12,w:p+1}))}const a=t.columnOpts;a&&(!a.columnWidth&&!((d=a.breakpoints)!=null&&d.length)?(delete t.columnOpts,r=void 0):a.columnMax=a.columnMax||12),(r==null?void 0:r.length)>1&&r.sort((p,g)=>(g.w||0)-(p.w||0));const s={...P.cloneDeep(Xt),column:P.toNumber(e.getAttribute("gs-column"))||Xt.column,minRow:i||P.toNumber(e.getAttribute("gs-min-row"))||Xt.minRow,maxRow:i||P.toNumber(e.getAttribute("gs-max-row"))||Xt.maxRow,staticGrid:P.toBool(e.getAttribute("gs-static"))||Xt.staticGrid,sizeToContent:P.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||Xt.draggable.handle},removableOptions:{accept:t.itemClass||Xt.removableOptions.accept,decline:Xt.removableOptions.decline}};e.getAttribute("gs-animate")&&(s.animate=P.toBool(e.getAttribute("gs-animate"))),t=P.defaults(t,s),this._initMargin(),this.checkDynamicColumn(),this.el.classList.add("gs-"+t.column),t.rtl==="auto"&&(t.rtl=e.style.direction==="rtl"),t.rtl&&this.el.classList.add("grid-stack-rtl");const l=this.el.closest("."+Xt.itemClass),u=l==null?void 0:l.gridstackNode;u&&(u.subGrid=this,this.parentGridNode=u,this.el.classList.add("grid-stack-nested"),u.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=t.cellHeight==="auto",this._isAutoCellHeight||t.cellHeight==="initial"?this.cellHeight(void 0,!1):(typeof t.cellHeight=="number"&&t.cellHeightUnit&&t.cellHeightUnit!==Xt.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit),this.cellHeight(t.cellHeight,!1)),t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=In),this._styleSheetClass="gs-id-"+Qn._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();const c=t.engineClass||le.engineClass||Qn;if(this.engine=new c({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:p=>{let g=0;this.engine.nodes.forEach(m=>{g=Math.max(g,m.y+m.h)}),p.forEach(m=>{const y=m.el;y&&(m._removeDOM?(y&&y.remove(),delete m._removeDOM):this._writePosAttr(y,m))}),this._updateStyles(!1,g)}}),this._updateStyles(!1,0),t.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(p=>this._prepareElement(p)),delete this.engine._loading,this.batchUpdate(!1)),t.children){const p=t.children;delete t.children,p.length&&this.load(p)}this.setAnimation(),t.subGridDynamic&&!he.pauseDrag&&(he.pauseDrag=!0),((f=t.draggable)==null?void 0:f.pause)!==void 0&&(he.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(e){if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let t,i=e;if(i.grid=this,i!=null&&i.el?t=i.el:le.addRemoveCB?t=le.addRemoveCB(this.el,e,!0,!1):t=this.createWidgetDivs(i),!t)return;if(i=t.gridstackNode,i&&t.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return t;const r=this._readAttr(t);return P.defaults(e,r),this.engine.prepareNode(e),this.el.appendChild(t),this.makeWidget(t,e),t}createWidgetDivs(e){const t=P.createDiv(["grid-stack-item",this.opts.itemClass]),i=P.createDiv(["grid-stack-item-content"],t);return P.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([r])=>{var o,a;r.isIntersecting&&((o=e.visibleObservable)==null||o.disconnect(),delete e.visibleObservable,le.renderCB(i,e),(a=e.grid)==null||a.prepareDragDrop(e.el))}),window.setTimeout(()=>{var r;return(r=e.visibleObservable)==null?void 0:r.observe(t)})):le.renderCB(i,e),t}makeSubGrid(e,t,i,r=!0){var f,p,g;let o=e.gridstackNode;if(o||(o=this.makeWidget(e).gridstackNode),(f=o.subGrid)!=null&&f.el)return o.subGrid;let a,s=this;for(;s&&!a;)a=(p=s.opts)==null?void 0:p.subGridOpts,s=(g=s.parentGridNode)==null?void 0:g.grid;t=P.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...t||o.subGridOpts||{}}),o.subGridOpts=t;let l;t.column==="auto"&&(l=!0,t.column=Math.max(o.w||1,(i==null?void 0:i.w)||1),delete t.columnOpts);let u=o.el.querySelector(".grid-stack-item-content"),c,h;if(r&&(this._removeDD(o.el),h={...o,x:0,y:0},P.removeInternalForSave(h),delete h.subGridOpts,o.content&&(h.content=o.content,delete o.content),le.addRemoveCB?c=le.addRemoveCB(this.el,h,!0,!1):(c=P.createDiv(["grid-stack-item"]),c.appendChild(u),u=P.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){const m=l?t.column:o.w,y=o.h+i.h,v=o.el.style;v.transition="none",this.update(o.el,{w:m,h:y}),setTimeout(()=>v.transition=null)}const d=o.subGrid=le.addGrid(u,t);return i!=null&&i._moving&&(d._isTemp=!0),l&&(d._autoColumn=!0),r&&d.makeWidget(c,h),i&&(i._moving?window.setTimeout(()=>P.simulateMouseEvent(i._event,"mouseenter",d.el),0):d.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),d}removeAsSubGrid(e){var i;const t=(i=this.parentGridNode)==null?void 0:i.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(r=>{r.x+=this.parentGridNode.x,r.y+=this.parentGridNode.y,t.makeWidget(r.el,r)}),t.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>P.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=le.saveCB){const r=this.engine.save(e,i);if(r.forEach(o=>{var a;if(e&&o.el&&!o.subGrid&&!i){const s=o.el.querySelector(".grid-stack-item-content");o.content=s==null?void 0:s.innerHTML,o.content||delete o.content}else if(!e&&!i&&delete o.content,(a=o.subGrid)!=null&&a.el){const s=o.subGrid.save(e,t,i);o.subGridOpts=t?s:{children:s},delete o.subGrid}delete o.el}),t){const o=P.cloneDeep(this.opts);o.marginBottom===o.marginTop&&o.marginRight===o.marginLeft&&o.marginTop===o.marginRight&&(o.margin=o.marginTop,delete o.marginTop,delete o.marginRight,delete o.marginBottom,delete o.marginLeft),o.rtl===(this.el.style.direction==="rtl")&&(o.rtl="auto"),this._isAutoCellHeight&&(o.cellHeight="auto"),this._autoColumn&&(o.column="auto");const a=o._alwaysShowResizeHandle;return delete o._alwaysShowResizeHandle,a!==void 0?o.alwaysShowResizeHandle=a:delete o.alwaysShowResizeHandle,P.removeInternalAndSame(o,Xt),o.children=r,o}return r}load(e,t=le.addRemoveCB||!0){var u;e=P.cloneDeep(e);const i=this.getColumn();e.forEach(c=>{c.w=c.w||1,c.h=c.h||1}),e=P.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let r=0;e.forEach(c=>{r=Math.max(r,(c.x||0)+c.w)}),r>this.engine.defaultColumn&&(this.engine.defaultColumn=r),r>i&&this.engine.cacheLayout(e,r,!0);const o=le.addRemoveCB;typeof t=="function"&&(le.addRemoveCB=t);const a=[];this.batchUpdate();const s=!this.engine.nodes.length;s&&this.setAnimation(!1),!s&&t&&[...this.engine.nodes].forEach(h=>{if(!h.id)return;P.find(e,h.id)||(le.addRemoveCB&&le.addRemoveCB(this.el,h,!1,!1),a.push(h),this.removeWidget(h.el,!0,!1))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(c=>P.find(e,c.id)?(l.push(c),!1):!0),e.forEach(c=>{var d;const h=P.find(l,c.id);if(h){if(P.shouldSizeToContent(h)&&(c.h=h.h),this.engine.nodeBoundFix(c),(c.autoPosition||c.x===void 0||c.y===void 0)&&(c.w=c.w||h.w,c.h=c.h||h.h,this.engine.findEmptyPosition(c)),this.engine.nodes.push(h),P.samePos(h,c)&&this.engine.nodes.length>1&&(this.moveNode(h,{...c,forceCollide:!0}),P.copyPos(c,h)),this.update(h.el,c),(d=c.subGridOpts)!=null&&d.children){const f=h.el.querySelector(".grid-stack");f&&f.gridstack&&f.gridstack.load(c.subGridOpts.children)}}else t&&this.addWidget(c)}),delete this.engine._loading,this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?le.addRemoveCB=o:delete le.addRemoveCB,s&&((u=this.opts)!=null&&u.animate)&&this.setAnimation(this.opts.animate,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const t=this.el.querySelector("."+this.opts.itemClass);if(t){const r=P.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/r)}const i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(e,t=!0){if(t&&e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){const r=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+r}const i=P.parseHeight(e);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.resizeToContentCheck(),t&&this._updateStyles(!0),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){var t;return e&&((t=this.opts.columnOpts)!=null&&t.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var o,a;const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!((o=e.breakpoints)!=null&&o.length))return!1;const t=this.getColumn();let i=t;const r=this._widthOrContainer(!0);if(e.columnWidth)i=Math.min(Math.round(r/e.columnWidth)||1,e.columnMax);else{i=e.columnMax;let s=0;for(;s<e.breakpoints.length&&r<=e.breakpoints[s].w;)i=e.breakpoints[s++].c||t}if(i!==t){const s=(a=e.breakpoints)==null?void 0:a.find(l=>l.c===i);return this.column(i,(s==null?void 0:s.layout)||e.layout),!0}return!1}compact(e="compact",t=!0){return this.engine.compact(e,t),this._triggerChangeEvent(),this}column(e,t="moveScale"){if(!e||e<1||this.opts.column===e)return this;const i=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+i),this.el.classList.add("gs-"+e),this.engine.columnChanged(i,e,t),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){var t,i;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.classList.remove(this._styleSheetClass),this.el.removeAttribute("gs-current-row")),this._removeStylesheet(),(t=this.parentGridNode)==null||delete t.subGrid,delete this.parentGridNode,delete this.opts,(i=this._placeholder)==null||delete i.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,t=!1){const i=this.el.getBoundingClientRect();let r;t?r={top:i.top+document.documentElement.scrollTop,left:i.left}:r={top:this.el.offsetTop,left:this.el.offsetLeft};const o=e.left-r.left,a=e.top-r.top,s=i.width/this.getColumn(),l=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/s),y:Math.floor(a/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(e,t,i,r){return this.engine.isAreaEmpty(e,t,i,r)}makeWidget(e,t){const i=le.getElement(e);if(!i)return;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,t);const r=i.gridstackNode;this._updateContainerHeight(),r.subGridOpts&&this.makeSubGrid(i,r.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&delete this._ignoreLayoutsNodeChange,i}on(e,t){return e.indexOf(" ")!==-1?(e.split(" ").forEach(r=>this.on(r,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=r=>t(r):this._gsEventHandler[e]=r=>{r.detail&&t(r,r.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=t:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.off(i)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,t=!0,i=!0){return e?(le.getElements(e).forEach(r=>{if(r.parentElement&&r.parentElement!==this.el)return;let o=r.gridstackNode;o||(o=this.engine.nodes.find(a=>r===a.el)),o&&(t&&le.addRemoveCB&&le.addRemoveCB(this.el,o,!1,!1),delete r.gridstackNode,this._removeDD(r),this.engine.removeNode(o,t,i),t&&r.parentElement&&r.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,t=!0){return this.engine.nodes.forEach(i=>{e&&le.addRemoveCB&&le.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(e,t),t&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,t){return t?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,t=!0,i=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&i&&r.subGrid.setStatic(e,t,i)}),t&&this._setStaticClass(),this)}updateOptions(e){var i;const t=this.opts;return e.acceptWidgets!==void 0&&this._setupAcceptWidget(),e.animate!==void 0&&this.setAnimation(),e.cellHeight&&(this.cellHeight(e.cellHeight,!0),delete e.cellHeight),e.class&&e.class!==t.class&&(t.class&&this.el.classList.remove(t.class),this.el.classList.add(e.class)),typeof e.column=="number"&&!e.columnOpts&&(this.column(e.column),delete e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0&&(t.minRow=t.maxRow=e.row),(i=e.children)!=null&&i.length&&(this.load(e.children),delete e.children),this.opts={...this.opts,...e},this}update(e,t){return le.getElements(e).forEach(i=>{var c;const r=i==null?void 0:i.gridstackNode;if(!r)return;const o={...P.copyPos({},r),...P.cloneDeep(t)};this.engine.nodeBoundFix(o),delete o.autoPosition;const a=["x","y","w","h"];let s;if(a.some(h=>o[h]!==void 0&&o[h]!==r[h])&&(s={},a.forEach(h=>{s[h]=o[h]!==void 0?o[h]:r[h],delete o[h]})),!s&&(o.minW||o.minH||o.maxW||o.maxH)&&(s={}),o.content!==void 0){const h=i.querySelector(".grid-stack-item-content");h&&h.textContent!==o.content&&(r.content=o.content,le.renderCB(h,o),(c=r.subGrid)!=null&&c.el&&(h.appendChild(r.subGrid.el),r.subGrid.opts.styleInHead||r.subGrid._updateStyles(!0))),delete o.content}let l=!1,u=!1;for(const h in o)h[0]!=="_"&&r[h]!==o[h]&&(r[h]=o[h],l=!0,u=u||!this.opts.staticGrid&&(h==="noResize"||h==="noMove"||h==="locked"));if(P.sanitizeMinMax(r),s){const h=s.w!==void 0&&s.w!==r.w;this.moveNode(r,s),h&&r.subGrid?r.subGrid.onResize(this.hasAnimationCSS()?r.w:void 0):this.resizeToContentCheck(h,r),delete r._orig}(s||l)&&this._writeAttr(i,r),u&&this.prepareDragDrop(r.el)}),this}moveNode(e,t){const i=e._updating;i||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,t),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){var d,f;if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const t=e.gridstackNode;if(!t)return;const i=t.grid;if(!i||e.parentElement!==i.el)return;const r=i.getCellHeight(!0);if(!r)return;let o=t.h?t.h*r:e.clientHeight,a;if(t.resizeToContentParent&&(a=e.querySelector(t.resizeToContentParent)),a||(a=e.querySelector(le.resizeToContentParent)),!a)return;const s=e.clientHeight-a.clientHeight,l=t.h?t.h*r-s:a.clientHeight;let u;if(t.subGrid){u=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);const p=t.subGrid.el.getBoundingClientRect(),g=t.subGrid.el.parentElement.getBoundingClientRect();u+=p.top-g.top}else{if((f=(d=t.subGridOpts)==null?void 0:d.children)!=null&&f.length)return;{const p=a.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${le.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}u=p.getBoundingClientRect().height||l}}if(l===u)return;o+=u-l;let c=Math.ceil(o/r);const h=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;h&&c>h&&(c=h,e.classList.add("size-to-content-max")),t.minH&&c<t.minH?c=t.minH:t.maxH&&c>t.maxH&&(c=t.maxH),c!==t.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(t,{h:c}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){le.resizeToContentCB?le.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,t){return le.getElements(e).forEach(i=>{const r=i.gridstackNode;if(!P.canBeRotated(r))return;const o={w:r.h,h:r.w,minH:r.minW,minW:r.minH,maxH:r.maxW,maxW:r.maxH};if(t){const s=t.left>0?Math.floor(t.left/this.cellWidth()):0,l=t.top>0?Math.floor(t.top/this.opts.cellHeight):0;o.x=r.x+s-(r.h-(l+1)),o.y=r.y+l-s}Object.keys(o).forEach(s=>{o[s]===void 0&&delete o[s]});const a=r._orig;this.update(i,o),r._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const i=P.parseHeight(e);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(e){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const t=arguments;let i=0,r={x:t[i++],y:t[i++],w:t[i++],h:t[i++],autoPosition:t[i++]};return this.willItFit(r)}return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.addedNodes)!=null&&e.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});const t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.removedNodes)!=null&&e.length){const t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(e,t){const i=t?new CustomEvent(e,{bubbles:!1,detail:t}):new Event(e);return this.el.dispatchEvent(i),this}_removeStylesheet(){if(this._styles){const e=this.opts.styleInHead?void 0:this.el.parentNode;P.removeStylesheet(this._styleSheetClass,e),delete this._styles}return this}_updateStyles(e=!1,t){if(e&&this._removeStylesheet(),t===void 0&&(t=this.getRow()),this._updateContainerHeight(),this.opts.cellHeight===0)return this;const i=this.opts.cellHeight,r=this.opts.cellHeightUnit,o=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){const a=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=P.createStylesheet(this._styleSheetClass,a,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,P.addCSSRule(this._styles,o,`height: ${i}${r}`);const s=this.opts.marginTop+this.opts.marginUnit,l=this.opts.marginBottom+this.opts.marginUnit,u=this.opts.marginRight+this.opts.marginUnit,c=this.opts.marginLeft+this.opts.marginUnit,h=`${o} > .grid-stack-item-content`,d=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;P.addCSSRule(this._styles,h,`top: ${s}; right: ${u}; bottom: ${l}; left: ${c};`),P.addCSSRule(this._styles,d,`top: ${s}; right: ${u}; bottom: ${l}; left: ${c};`),P.addCSSRule(this._styles,`${o} > .ui-resizable-n`,`top: ${s};`),P.addCSSRule(this._styles,`${o} > .ui-resizable-s`,`bottom: ${l}`),P.addCSSRule(this._styles,`${o} > .ui-resizable-ne`,`right: ${u}; top: ${s}`),P.addCSSRule(this._styles,`${o} > .ui-resizable-e`,`right: ${u}`),P.addCSSRule(this._styles,`${o} > .ui-resizable-se`,`right: ${u}; bottom: ${l}`),P.addCSSRule(this._styles,`${o} > .ui-resizable-nw`,`left: ${c}; top: ${s}`),P.addCSSRule(this._styles,`${o} > .ui-resizable-w`,`left: ${c}`),P.addCSSRule(this._styles,`${o} > .ui-resizable-sw`,`left: ${c}; bottom: ${l}`)}if(t=t||this._styles._max,t>this._styles._max){const a=s=>i*s+r;for(let s=this._styles._max+1;s<=t;s++)P.addCSSRule(this._styles,`${o}[gs-y="${s}"]`,`top: ${a(s)}`),P.addCSSRule(this._styles,`${o}[gs-h="${s+1}"]`,`height: ${a(s+1)}`);this._styles._max=t}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let t=this.getRow()+this._extraDragRow;const i=this.opts.cellHeight,r=this.opts.cellHeightUnit;if(!i)return this;if(!e){const o=P.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===r){const a=Math.floor(o.h/i);t<a&&(t=a)}}return this.el.setAttribute("gs-current-row",String(t)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),t&&(this.el.style[e?"minHeight":"height"]=t*i+r),e&&!e.grid.engine.batchMode&&P.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,t=!1,i){i=i||this._readAttr(e),e.gridstackNode=i,i.el=e,i.grid=this,i=this.engine.addNode(i,t),this._writeAttr(e,i),e.classList.add(Xt.itemClass,this.opts.itemClass);const r=P.shouldSizeToContent(i);return r?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),r&&this.resizeToContentCheck(!1,i),P.lazyLoad(i)||this.prepareDragDrop(i.el),this}_writePosAttr(e,t){return t.x!==void 0&&t.x!==null&&e.setAttribute("gs-x",String(t.x)),t.y!==void 0&&t.y!==null&&e.setAttribute("gs-y",String(t.y)),t.w>1?e.setAttribute("gs-w",String(t.w)):e.removeAttribute("gs-w"),t.h>1?e.setAttribute("gs-h",String(t.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,t){if(!t)return this;this._writePosAttr(e,t);const i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const r in i)t[r]?e.setAttribute(i[r],String(t[r])):e.removeAttribute(i[r]);return this}_readAttr(e,t=!0){const i={};i.x=P.toNumber(e.getAttribute("gs-x")),i.y=P.toNumber(e.getAttribute("gs-y")),i.w=P.toNumber(e.getAttribute("gs-w")),i.h=P.toNumber(e.getAttribute("gs-h")),i.autoPosition=P.toBool(e.getAttribute("gs-auto-position")),i.noResize=P.toBool(e.getAttribute("gs-no-resize")),i.noMove=P.toBool(e.getAttribute("gs-no-move")),i.locked=P.toBool(e.getAttribute("gs-locked"));const r=e.getAttribute("gs-size-to-content");r&&(r==="true"||r==="false"?i.sizeToContent=P.toBool(r):i.sizeToContent=parseInt(r,10)),i.id=e.getAttribute("gs-id"),i.maxW=P.toNumber(e.getAttribute("gs-max-w")),i.minW=P.toNumber(e.getAttribute("gs-min-w")),i.maxH=P.toNumber(e.getAttribute("gs-max-h")),i.minH=P.toNumber(e.getAttribute("gs-min-h")),t&&(i.w===1&&e.removeAttribute("gs-w"),i.h===1&&e.removeAttribute("gs-h"),i.maxW&&e.removeAttribute("gs-max-w"),i.minW&&e.removeAttribute("gs-min-w"),i.maxH&&e.removeAttribute("gs-max-h"),i.minH&&e.removeAttribute("gs-min-h"));for(const o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="gs-size-to-content"&&delete i[o]}return i}_setStaticClass(){const e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=(t=>(t=this.el)==null?void 0:t.clientWidth)()){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(r=>{r.subGrid&&r.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,t=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,t),this.animationDelay);if(t)P.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.el);else if(this.engine.nodes.some(i=>P.shouldSizeToContent(i))){const i=[...this.engine.nodes];this.batchUpdate(),i.forEach(r=>{P.shouldSizeToContent(r)&&this.resizeToContentCBCheck(r.el)}),this.batchUpdate(!1)}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,t?[t]:this.engine.nodes)}}_updateResizeEvent(e=!1){const t=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!this.resizeObserver?(this._sizeThrottle=P.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!t)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return P.getElement(e)}static getElements(e=".grid-stack-item"){return P.getElements(e)}static getGridElement(e){return le.getElement(e)}static getGridElements(e){return P.getElements(e)}_initMargin(){let e,t=0,i=[];return typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(e=P.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,t=this.opts.margin=e.h),this.opts.marginTop===void 0?this.opts.marginTop=t:(e=P.parseHeight(this.opts.marginTop),this.opts.marginTop=e.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=t:(e=P.parseHeight(this.opts.marginBottom),this.opts.marginBottom=e.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=t:(e=P.parseHeight(this.opts.marginRight),this.opts.marginRight=e.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=t:(e=P.parseHeight(this.opts.marginLeft),this.opts.marginLeft=e.h,delete this.opts.margin),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static getDD(){return Nt}static setupDragIn(e,t,i,r=document){(t==null?void 0:t.pause)!==void 0&&(he.pauseDrag=t.pause),t={appendTo:"body",helper:"clone",...t||{}},(typeof e=="string"?P.getElements(e,r):e).forEach((a,s)=>{Nt.isDraggable(a)||Nt.dragIn(a,t),i!=null&&i[s]&&(a.gridstackNode=i[s])})}movable(e,t){return this.opts.staticGrid?this:(le.getElements(e).forEach(i=>{const r=i.gridstackNode;r&&(t?delete r.noMove:r.noMove=!0,this.prepareDragDrop(r.el))}),this)}resizable(e,t){return this.opts.staticGrid?this:(le.getElements(e).forEach(i=>{const r=i.gridstackNode;r&&(t?delete r.noResize:r.noResize=!0,this.prepareDragDrop(r.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableMove(e,t)}),this)}enableResize(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}cancelDrag(){var t;const e=(t=this._placeholder)==null?void 0:t.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&le._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Nt.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Nt.droppable(this.el,"destroy"),this;let e,t;const i=(r,o,a)=>{var d;a=a||o;const s=a.gridstackNode;if(!s)return;if(!((d=s.grid)!=null&&d.el)){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const f=a.getBoundingClientRect();a.style.left=f.x+(this.dragTransform.xScale-1)*(r.clientX-f.x)/this.dragTransform.xScale+"px",a.style.top=f.y+(this.dragTransform.yScale-1)*(r.clientY-f.y)/this.dragTransform.yScale+"px",a.style.transformOrigin="0px 0px"}let{top:l,left:u}=a.getBoundingClientRect();const c=this.el.getBoundingClientRect();u-=c.left,l-=c.top;const h={position:{top:l*this.dragTransform.xScale,left:u*this.dragTransform.yScale}};if(s._temporaryRemoved){if(s.x=Math.max(0,Math.round(u/t)),s.y=Math.max(0,Math.round(l/e)),delete s.autoPosition,this.engine.nodeBoundFix(s),!this.engine.willItFit(s)){if(s.autoPosition=!0,!this.engine.willItFit(s)){Nt.off(o,"drag");return}s._willFitPos&&(P.copyPos(s,s._willFitPos),delete s._willFitPos)}this._onStartMoving(a,r,h,s,t,e)}else this._dragOrResize(a,r,h,s,t,e)};return Nt.droppable(this.el,{accept:r=>{const o=r.gridstackNode||this._readAttr(r,!1);if((o==null?void 0:o.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(r);else{const s=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=r.matches(s)}if(a&&o&&this.opts.maxRow){const s={w:o.w,h:o.h,minW:o.minW,minH:o.minH};a=this.engine.willItFit(s)}return a}}).on(this.el,"dropover",(r,o,a)=>{let s=(a==null?void 0:a.gridstackNode)||o.gridstackNode;if((s==null?void 0:s.grid)===this&&!s._temporaryRemoved)return!1;if(s!=null&&s._sidebarOrig&&(s.w=s._sidebarOrig.w,s.h=s._sidebarOrig.h),s!=null&&s.grid&&s.grid!==this&&!s._temporaryRemoved&&s.grid._leave(o,a),a=a||o,t=this.cellWidth(),e=this.getCellHeight(!0),!s){const c=a.getAttribute("data-gs-widget")||a.getAttribute("gridstacknode");if(c){try{s=JSON.parse(c)}catch{console.error("Gridstack dropover: Bad JSON format: ",c)}a.removeAttribute("data-gs-widget"),a.removeAttribute("gridstacknode")}s||(s=this._readAttr(a)),s._sidebarOrig={w:s.w,h:s.h}}s.grid||(s.el||(s={...s}),s._isExternal=!0,a.gridstackNode=s);const l=s.w||Math.round(a.offsetWidth/t)||1,u=s.h||Math.round(a.offsetHeight/e)||1;return s.grid&&s.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=s),o.gridstackNode=s={...s,w:l,h:u,grid:this},delete s.x,delete s.y,this.engine.cleanupNode(s).nodeBoundFix(s),s._initDD=s._isExternal=s._temporaryRemoved=!0):(s.w=l,s.h=u,s._temporaryRemoved=!0),le._itemRemoving(s.el,!1),Nt.on(o,"drag",i),i(r,o,a),!1}).on(this.el,"dropout",(r,o,a)=>{const s=(a==null?void 0:a.gridstackNode)||o.gridstackNode;return s&&(!s.grid||s.grid===this)&&(this._leave(o,a),this._isTemp&&this.removeAsSubGrid(s)),!1}).on(this.el,"drop",(r,o,a)=>{var f,p,g;const s=(a==null?void 0:a.gridstackNode)||o.gridstackNode;if((s==null?void 0:s.grid)===this&&!s._isExternal)return!1;const l=!!this.placeholder.parentElement,u=o!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode;const c=l&&this.opts.animate;c&&this.setAnimation(!1);const h=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,l&&(h!=null&&h.grid)&&h.grid!==this){const m=h.grid;m.engine.removeNodeFromLayoutCache(h),m.engine.removedNodes.push(h),m._triggerRemoveEvent()._triggerChangeEvent(),m.parentGridNode&&!m.engine.nodes.length&&m.opts.subGridDynamic&&m.removeAsSubGrid()}if(!s||(l&&(this.engine.cleanupNode(s),s.grid=this),(f=s.grid)==null||delete f._isTemp,Nt.off(o,"drag"),a!==o?(a.remove(),o=a):o.remove(),this._removeDD(o),!l))return!1;const d=(g=(p=s.subGrid)==null?void 0:p.el)==null?void 0:g.gridstack;return P.copyPos(s,this._readAttr(this.placeholder)),P.removePositioningStyles(o),u&&(s.content||s.subGridOpts||le.addRemoveCB)?(delete s.el,o=this.addWidget(s)):(this._prepareElement(o,!0,s),this.el.appendChild(o),this.resizeToContentCheck(!1,s),d&&(d.parentGridNode=s,d.opts.styleInHead||d._updateStyles(!0)),this._updateContainerHeight()),this.engine.addedNodes.push(s),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...r,type:"dropped"},h&&h.grid?h:void 0,s),c&&this.setAnimation(this.opts.animate,!0),!1}),this}static _itemRemoving(e,t){if(!e)return;const i=e?e.gridstackNode:void 0;!(i!=null&&i.grid)||e.classList.contains(i.grid.opts.removableOptions.decline)||(t?i._isAboutToRemove=!0:delete i._isAboutToRemove,t?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Nt.isDroppable(e)&&Nt.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>le._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>le._itemRemoving(i,!1)),this):this}prepareDragDrop(e,t=!1){const i=e==null?void 0:e.gridstackNode;if(!i)return;const r=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,a=this.opts.staticGrid||r&&o;if((t||a)&&(i._initDD&&(this._removeDD(e),delete i._initDD),a&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!t))return this;if(!i._initDD){let s,l;const u=(d,f)=>{this._gsEventHandler[d.type]&&this._gsEventHandler[d.type](d,d.target),s=this.cellWidth(),l=this.getCellHeight(!0),this._onStartMoving(e,d,f,i,s,l)},c=(d,f)=>{this._dragOrResize(e,d,f,i,s,l)},h=d=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._event,delete i._lastTried;const f=i.w!==i._orig.w,p=d.target;if(!(!p.gridstackNode||p.gridstackNode.grid!==this)){if(i.el=p,i._isAboutToRemove){const g=e.gridstackNode.grid;g._gsEventHandler[d.type]&&g._gsEventHandler[d.type](d,p),g.engine.nodes.push(i),g.removeWidget(e,!0,!0)}else P.removePositioningStyles(p),i._temporaryRemoved?(P.copyPos(i,i._orig),this._writePosAttr(p,i),this.engine.addNode(i)):this._writePosAttr(p,i),this._gsEventHandler[d.type]&&this._gsEventHandler[d.type](d,p);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),d.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(f,i))}};Nt.draggable(e,{start:u,stop:h,drag:c}).resizable(e,{start:u,stop:h,resize:c}),i._initDD=!0}return Nt.draggable(e,r?"disable":"enable").resizable(e,o?"disable":"enable"),this}_onStartMoving(e,t,i,r,o,a){var s;if(this.engine.cleanNodes().beginUpdate(r),this._writePosAttr(this.placeholder,r),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=r,(s=r.grid)!=null&&s.el)this.dragTransform=P.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=P.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(r.el=this.placeholder,r._lastUiPosition=i.position,r._prevYPix=i.position.top,r._moving=t.type==="dragstart",delete r._lastTried,t.type==="dropover"&&r._temporaryRemoved&&(this.engine.addNode(r),r._moving=!0),this.engine.cacheRects(o,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"){const l=this.getColumn()-r.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-r.y;Nt.resizable(e,"option","minWidth",o*Math.min(r.minW||1,l)).resizable(e,"option","minHeight",a*Math.min(r.minH||1,u)).resizable(e,"option","maxWidth",o*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",o*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,r.x+r.w)).resizable(e,"option","maxHeight",a*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",a*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,r.y+r.h))}}_dragOrResize(e,t,i,r,o,a){const s={...r._orig};let l,u=this.opts.marginLeft,c=this.opts.marginRight,h=this.opts.marginTop,d=this.opts.marginBottom;const f=Math.round(a*.1),p=Math.round(o*.1);if(u=Math.min(u,p),c=Math.min(c,p),h=Math.min(h,f),d=Math.min(d,f),t.type==="drag"){if(r._temporaryRemoved)return;const m=i.position.top-r._prevYPix;r._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&P.updateScrollPosition(e,i.position,m);const y=i.position.left+(i.position.left>r._lastUiPosition.left?-c:u),v=i.position.top+(i.position.top>r._lastUiPosition.top?-d:h);s.x=Math.round(y/o),s.y=Math.round(v/a);const _=this._extraDragRow;if(this.engine.collide(r,s)){const b=this.getRow();let T=Math.max(0,s.y+r.h-b);this.opts.maxRow&&b+T>this.opts.maxRow&&(T=Math.max(0,this.opts.maxRow-b)),this._extraDragRow=T}else this._extraDragRow=0;if(this._extraDragRow!==_&&this._updateContainerHeight(),r.x===s.x&&r.y===s.y)return}else if(t.type==="resize"){if(s.x<0||(P.updateScrollResize(t,e,a),s.w=Math.round((i.size.width-u)/o),s.h=Math.round((i.size.height-h)/a),r.w===s.w&&r.h===s.h)||r._lastTried&&r._lastTried.w===s.w&&r._lastTried.h===s.h)return;const m=i.position.left+u,y=i.position.top+h;s.x=Math.round(m/o),s.y=Math.round(y/a),l=!0}r._event=t,r._lastTried=s;const g={x:i.position.left+u,y:i.position.top+h,w:(i.size?i.size.width:r.w*o)-u-c,h:(i.size?i.size.height:r.h*a)-h-d};if(this.engine.moveNodeCheck(r,{...s,cellWidth:o,cellHeight:a,rect:g,resizing:l})){r._lastUiPosition=i.position,this.engine.cacheRects(o,a,h,c,d,u),delete r._skipDown,l&&r.subGrid&&r.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const m=t.target;r._sidebarOrig||this._writePosAttr(m,r),this._gsEventHandler[t.type]&&this._gsEventHandler[t.type](t,m)}}_leave(e,t){t=t||e;const i=t.gridstackNode;if(!i||(t.style.transform=t.style.transformOrigin=null,Nt.off(e,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e;const r=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=r,this.opts.removable===!0&&le._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}commit(){return WW(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}le.renderCB=(n,e)=>{n&&(e!=null&&e.content)&&(n.textContent=e.content)},le.resizeToContentParent=".grid-stack-item-content",le.Utils=P,le.Engine=Qn,le.GDRev="11.5.1";const jW=["data-id","data-testid","gs-h","gs-w","gs-x","gs-y"],$W={class:"grid-stack-item-content"},ZW=Ii(x.defineComponent({__name:"DraggableGridLayout",props:{tiles:{},tileHeight:{default:vo}},emits:["update-tiles"],setup(n,{expose:e,emit:t}){const i=n,r=t,o=x.ref(null),a=x.ref(new Map(i.tiles.map(f=>[`${f.id}`,f])));let s=null;const l=f=>`[data-id="${f}"]`,u=f=>f.map(p=>{var m;const g=a.value.get(`${(m=p.el)==null?void 0:m.getAttribute("data-id")}`);if(g)return{...g,layout:{position:{col:Number(p.x),row:Number(p.y)},size:{cols:Number(p.w),rows:Number(p.h)}}}}).filter(p=>p!==void 0),c=(f,p)=>{s&&(u(p).forEach(m=>{a.value.set(`${m.id}`,m)}),r("update-tiles",Array.from(a.value.values())))},h=(f,p)=>{p.forEach(g=>{var m;a.value.delete(`${(m=g.el)==null?void 0:m.getAttribute("data-id")}`)}),r("update-tiles",Array.from(a.value.values()))};x.onMounted(()=>{o.value&&(s=le.init({margin:10,column:Lh,cellHeight:i.tileHeight,resizable:{handles:"se, sw"},handle:".tile-header"},o.value),s.on("change",c),s.on("added",c),s.on("removed",h))}),x.onUnmounted(()=>{s&&s.destroy(!1)});const d=f=>{if(s&&o.value){const p=o.value.querySelector(l(f));p&&s.removeWidget(p)}};return x.watch(()=>i.tiles.length,async(f,p)=>{if(f>p&&s){const g=i.tiles.slice(p);for(const m of g)a.value.set(`${m.id}`,m),await x.nextTick(),s.makeWidget(l(m.id),{autoPosition:!0,w:m.layout.size.cols,h:m.layout.size.rows})}}),x.watchEffect(()=>{i.tiles.forEach(f=>{a.value.set(`${f.id}`,f)})}),e({removeWidget:d}),(f,p)=>(x.openBlock(),x.createElementBlock("div",{ref_key:"gridContainer",ref:o,class:"grid-stack"},[(x.openBlock(!0),x.createElementBlock(x.Fragment,null,x.renderList(i.tiles,g=>(x.openBlock(),x.createElementBlock("div",{key:g.id,class:"grid-stack-item","data-id":`${g.id}`,"data-testid":`grid-stack-item-${g.id}`,"gs-h":g.layout.size.rows,"gs-lazy-load":!0,"gs-w":g.layout.size.cols,"gs-x":g.layout.position.col,"gs-y":g.layout.position.row},[x.createElementVNode("div",$W,[x.renderSlot(f.$slots,"tile",{tile:g},void 0,!0)])],8,jW))),128))],512))}}),[["__scopeId","data-v-a68d6821"]]),XW={key:0,class:"fullscreen-header"},KW={key:0,class:"tile-container slottable-tile"},QW=Ii(x.defineComponent({__name:"DashboardRenderer",props:x.mergeModels({context:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:x.mergeModels(["edit-tile","tile-time-range-zoom"],["update:modelValue"]),setup(n,{expose:e,emit:t}){x.useCssVars(A=>({v019a5586:h.value}));const i=n,r=t,o=x.useModel(n,"modelValue"),{i18n:a}=ni.useI18n(),s=x.ref(0),l=x.ref(null),u=x.ref(),c=x.ref(),h=x.ref("scale(1)"),d=x.inject(ti);d||(console.warn("Analytics dashboards require a query bridge supplied via provide / inject."),console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"),console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")),ni.useRequestQueue();const f=Oa.useAnalyticsConfigStore(),p=x.computed(()=>i.context.timeSpec?i.context.timeSpec:{type:"relative",time_range:f.defaultQueryTimeForOrg}),g=x.computed(()=>!!i.context.timeSpec||!f.loading),m=(A,R)=>{const L=A.layout.position.row-R.layout.position.row;return L!==0?L:A.layout.position.col-R.layout.position.col},y=x.computed(()=>o.value.tiles.map(A=>{var L;let R=A.definition;if("description"in R.chart){const V=(L=R.chart.description)==null?void 0:L.replace(Ry,()=>{const H=`renderer.trendRange.${p.value.type==="absolute"?"custom":p.value.time_range}`;return a.te(H)?a.t(H):""});R={...R,chart:{...R.chart,description:V}}}return i.context.editable&&!A.id&&console.warn("No id provided for tile. One will be generated automatically,","however tracking changes to this tile may not work as expected.",A),{layout:A.layout,meta:R,type:A.type,id:A.id??crypto.randomUUID()}})),v=A=>{r("edit-tile",A)},_=A=>A.type==="slottable",b=A=>{const R=_(A.meta.chart)?{...A.meta.chart}:{...A.meta.chart,chart_title:A.meta.chart.chart_title?`Copy of ${A.meta.chart.chart_title}`:""},L={id:crypto.randomUUID(),type:"chart",definition:{...A.meta,chart:R},layout:{position:{col:0,row:0},size:A.layout.size}};o.value.tiles.push(L)},T=A=>{l.value&&l.value.removeWidget(A.id)},w=()=>{s.value++},S=A=>{const R=A.map(L=>({id:L.id,type:L.type,layout:L.layout,definition:L.meta}));o.value.tiles=R.sort(m)},M=async()=>{if(h.value="scale(1)",await x.nextTick(),c.value){const{availWidth:A,availHeight:R}=window.screen,{width:L,height:V}=c.value.getBoundingClientRect(),z=Math.min(R/V,A/L);h.value=`scale(${z})`}},C=()=>{u.value&&(document.fullscreenElement?document.exitFullscreen():u.value.requestFullscreen())},I=x.ref(!1),E=()=>{I.value=document.fullscreenElement!==null,I.value&&M()},k=x.computed(()=>o.value.preset_filters??[]),{internalContext:D}=ni.useDashboardInternalContext({globalFilters:k,context:x.toRef(i,"context"),isFullscreen:I});return e({refresh:w,toggleFullscreen:C}),(A,R)=>{const L=x.resolveComponent("KAlert");return x.openBlock(),x.createElementBlock("div",{ref_key:"dashboardContainer",ref:u,class:x.normalizeClass(["kong-ui-public-dashboard-renderer",{"is-fullscreen":I.value}]),onFullscreenchange:E},[x.createElementVNode("div",{ref_key:"layoutContainer",ref:c,class:"layout"},[x.unref(d)&&I.value?(x.openBlock(),x.createElementBlock("div",XW,[x.renderSlot(A.$slots,"fullscreenHeader",{},void 0,!0)])):x.createCommentVNode("",!0),x.unref(d)?(x.openBlock(),x.createBlock(x.resolveDynamicComponent(n.context.editable&&!I.value?ZW:ik),{key:2,ref_key:"gridLayoutRef",ref:l,"tile-height":o.value.tile_height,tiles:y.value,onUpdateTiles:S},{tile:x.withCtx(({tile:V})=>[V.meta.chart.type==="slottable"?(x.openBlock(),x.createElementBlock("div",KW,[x.renderSlot(A.$slots,V.meta.chart.id,{},void 0,!0)])):(x.openBlock(),x.createBlock(nk,{key:I.value?`${V.id}-tile`:`${V.id}-tile-fullscreen`,"refresh-counter":s.value,"onUpdate:refreshCounter":R[0]||(R[0]=z=>s.value=z),class:"tile-container",context:x.unref(D),definition:V.meta,height:V.layout.size.rows*(o.value.tile_height||x.unref(vo))+parseInt(x.unref(tk),10),"is-fullscreen":I.value,"query-ready":g.value,"tile-id":V.id,onDuplicateTile:z=>b(V),onEditTile:z=>v(V),onRemoveTile:z=>T(V),onTileTimeRangeZoom:R[1]||(R[1]=z=>r("tile-time-range-zoom",z))},null,8,["refresh-counter","context","definition","height","is-fullscreen","query-ready","tile-id","onDuplicateTile","onEditTile","onRemoveTile"]))]),_:3},40,["tile-height","tiles"])):(x.openBlock(),x.createBlock(L,{key:1,appearance:"danger"},{default:x.withCtx(()=>[x.createTextVNode(x.toDisplayString(x.unref(a).t("renderer.noQueryBridge")),1)]),_:1}))],512)],34)}}}),[["__scopeId","data-v-1fc40e84"]]),JW=x.defineComponent({__name:"DashboardTilePreview",props:{context:{},definition:{},globalFilters:{default:()=>[]}},emits:["tile-time-range-zoom","tile-bounds-change"],setup(n,{expose:e,emit:t}){const i=x.useTemplateRef("root"),r=crypto.randomUUID(),o=t,a=g=>{o("tile-time-range-zoom",g)},s=g=>{o("tile-bounds-change",g)},{internalContext:l}=ni.useDashboardInternalContext({globalFilters:x.toRef(()=>n.globalFilters),context:x.toRef(()=>n.context)}),u=Oa.useAnalyticsConfigStore(),c=x.computed(()=>!!n.context.timeSpec||!u.loading),h=x.ref(vo);let d;x.onMounted(()=>{var m;const g=(m=i.value)==null?void 0:m.parentElement;g&&(h.value=g.getBoundingClientRect().height,d=new ResizeObserver(([y])=>{const{height:v}=y.contentRect;h.value=v}),d.observe(g))}),x.onUnmounted(()=>d==null?void 0:d.disconnect());const f=x.ref(0);return e({refresh:()=>{f.value++}}),(g,m)=>(x.openBlock(),x.createElementBlock("div",{ref_key:"root",ref:i,"data-testid":"dashboard-tile-preview-root"},[x.createVNode(nk,{"refresh-counter":f.value,"onUpdate:refreshCounter":m[0]||(m[0]=y=>f.value=y),context:{...x.unref(l),editable:!1},definition:n.definition,height:h.value,"hide-actions":"","query-ready":c.value,"show-refresh":"","tile-id":x.unref(r),onTileBoundsChange:s,onTileTimeRangeZoom:a},null,8,["refresh-counter","context","definition","height","query-ready","tile-id"])],512))}}),eU=Object.freeze(Object.defineProperty({__proto__:null,default:x.defineComponent({__name:"GeoMapRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},requestsLink:{},exploreLink:{}},emits:["bounds-change"],setup(n,{emit:e}){const t=x.ref(void 0),i=x.computed(()=>t.value?Ny.exploreResultToCountryMetrics(t.value):{}),r=x.computed(()=>{var u;return t.value?((u=t.value)==null?void 0:u.meta.metric_names)&&t.value.meta.metric_names[0]:""}),o=x.computed(()=>{var h,d,f;if(!t.value)return"";const u=(h=t==null?void 0:t.value)==null?void 0:h.meta.metric_units,c=(f=(d=t==null?void 0:t.value)==null?void 0:d.meta)==null?void 0:f.metric_names;return u&&c&&u[c[0]]}),a=u=>{t.value=u},s=e,l=u=>{s("bounds-change",u)};return(u,c)=>(x.openBlock(),x.createBlock(Ra,{context:n.context,"limit-override":x.unref(Ie.COUNTRIES).length,query:n.query,"query-ready":n.queryReady,"refresh-counter":n.refreshCounter,onChartData:a},{default:x.withCtx(()=>[x.createVNode(x.unref(Ny.AnalyticsGeoMap),{bounds:n.chartOptions.bounds,"country-metrics":i.value,"fit-to-country":n.chartOptions.fit_to_country,metric:r.value,"metric-unit":o.value,"with-legend":n.chartOptions.legend||!1,onBoundsChange:l},null,8,["bounds","country-metrics","fit-to-country","metric","metric-unit","with-legend"])]),_:1},8,["context","limit-override","query","query-ready","refresh-counter"]))}})},Symbol.toStringTag,{value:"Module"}));se.CP_ID_TOKEN=Oy,se.DASHBOARD_COLS=Lh,se.DEFAULT_TILE_HEIGHT=vo,se.DEFAULT_TILE_REFRESH_INTERVAL_MS=Ly,se.DashboardRenderer=QW,se.DashboardTilePreview=JW,se.ENTITY_ID_TOKEN=Ph,se.FULLSCREEN_LONG_REFRESH_INTERVAL_MS=zy,se.FULLSCREEN_SHORT_REFRESH_INTERVAL_MS=Py,se.GridLayout=ik,se.INJECT_QUERY_PROVIDER=ti,se.TIMEFRAME_TOKEN=Ry,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|