From 9e6c83405bdccf62255278908ec95c1b87f98c52 Mon Sep 17 00:00:00 2001 From: Willxup Date: Wed, 5 Aug 2026 16:32:55 +0800 Subject: [PATCH] feat: add version-aware application footer Signed-off-by: Willxup --- api/openapi.yaml | 3 +- internal/httpapi/handler.go | 5 +- internal/httpapi/test/handler_test.go | 5 +- ...-B-hY3tUU.js => DashboardPage-t2pmmhQz.js} | 32 ++++----- .../{index-TEbLqC9v.js => index-B9YDBDoG.js} | 2 +- .../webassets/dist/assets/index-CKrnZdaT.css | 1 - .../webassets/dist/assets/index-NUtcblDI.css | 1 + internal/webassets/dist/index.html | 4 +- test/e2e/stage4-demo.spec.ts | 4 +- test/e2e/stage4-production-csp.spec.ts | 16 +++++ web/src/api/contracts.ts | 1 + web/src/api/production.ts | 1 + web/src/api/test/production.test.ts | 19 +++++ web/src/app/Shell.tsx | 4 ++ web/src/components/AppFooter.tsx | 70 +++++++++++++++++++ web/src/components/test/AppFooter.test.tsx | 32 +++++++++ web/src/demo/fixture.json | 1 + web/src/features/dashboard/DashboardPage.tsx | 2 + .../dashboard/test/DashboardPage.test.tsx | 21 ++++-- web/src/features/live/test/model.test.ts | 1 + web/src/styles/layout.css | 54 ++++++++++++++ 21 files changed, 251 insertions(+), 28 deletions(-) rename internal/webassets/dist/assets/{DashboardPage-B-hY3tUU.js => DashboardPage-t2pmmhQz.js} (71%) rename internal/webassets/dist/assets/{index-TEbLqC9v.js => index-B9YDBDoG.js} (88%) delete mode 100644 internal/webassets/dist/assets/index-CKrnZdaT.css create mode 100644 internal/webassets/dist/assets/index-NUtcblDI.css create mode 100644 web/src/components/AppFooter.tsx create mode 100644 web/src/components/test/AppFooter.test.tsx diff --git a/api/openapi.yaml b/api/openapi.yaml index 1fbcc8f..8e94321 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -406,11 +406,12 @@ components: StatusResponse: type: object additionalProperties: false - required: [status, reason, timezone, auth_enabled, capabilities] + required: [status, reason, timezone, version, auth_enabled, capabilities] properties: status: { type: string, enum: [ok, degraded, failed] } reason: { type: string } timezone: { type: string } + version: { type: string } auth_enabled: { type: boolean } capabilities: { $ref: "#/components/schemas/Capabilities" } Capabilities: diff --git a/internal/httpapi/handler.go b/internal/httpapi/handler.go index f6b7afa..1999653 100644 --- a/internal/httpapi/handler.go +++ b/internal/httpapi/handler.go @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/Willxup/flowlens/internal/buildinfo" "github.com/Willxup/flowlens/internal/clashapi" "github.com/Willxup/flowlens/internal/collector" flowstatus "github.com/Willxup/flowlens/internal/status" @@ -307,6 +308,7 @@ func (h *handler) statusResponse(writer http.ResponseWriter, request *http.Reque Status flowstatus.Level `json:"status"` Reason string `json:"reason"` Timezone string `json:"timezone"` + Version string `json:"version"` AuthEnabled bool `json:"auth_enabled"` Capabilities struct { ConnectionID bool `json:"connection_id"` @@ -317,7 +319,8 @@ func (h *handler) statusResponse(writer http.ResponseWriter, request *http.Reque Domain bool `json:"domain"` } `json:"capabilities"` }{ - Status: snapshot.Level, Reason: snapshot.Reason, Timezone: h.timezone, AuthEnabled: !h.authDisabled, + Status: snapshot.Level, Reason: snapshot.Reason, Timezone: h.timezone, + Version: buildinfo.Version, AuthEnabled: !h.authDisabled, Capabilities: struct { ConnectionID bool `json:"connection_id"` Source bool `json:"source"` diff --git a/internal/httpapi/test/handler_test.go b/internal/httpapi/test/handler_test.go index 6a86018..b4cac77 100644 --- a/internal/httpapi/test/handler_test.go +++ b/internal/httpapi/test/handler_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "github.com/Willxup/flowlens/internal/buildinfo" "github.com/Willxup/flowlens/internal/clashapi" "github.com/Willxup/flowlens/internal/httpapi" flowstatus "github.com/Willxup/flowlens/internal/status" @@ -58,13 +59,15 @@ func TestLoginStatusAndLogoutFlow(t *testing.T) { Status string `json:"status"` Reason string `json:"reason"` Timezone string `json:"timezone"` + Version string `json:"version"` AuthEnabled bool `json:"auth_enabled"` Capabilities map[string]bool `json:"capabilities"` } if err := json.Unmarshal(statusResponse.Body.Bytes(), &body); err != nil { t.Fatalf("status JSON: %v", err) } - if body.Status != "ok" || body.Reason != "ready" || body.Timezone != "Asia/Shanghai" || !body.AuthEnabled || + if body.Status != "ok" || body.Reason != "ready" || body.Timezone != "Asia/Shanghai" || + body.Version != buildinfo.Version || !body.AuthEnabled || len(body.Capabilities) != 6 || !body.Capabilities["connection_id"] { t.Errorf("status body = %#v", body) } diff --git a/internal/webassets/dist/assets/DashboardPage-B-hY3tUU.js b/internal/webassets/dist/assets/DashboardPage-t2pmmhQz.js similarity index 71% rename from internal/webassets/dist/assets/DashboardPage-B-hY3tUU.js rename to internal/webassets/dist/assets/DashboardPage-t2pmmhQz.js index 50a3a7e..dd4c8f5 100644 --- a/internal/webassets/dist/assets/DashboardPage-B-hY3tUU.js +++ b/internal/webassets/dist/assets/DashboardPage-t2pmmhQz.js @@ -1,4 +1,4 @@ -import{j as w,T as u1,a as Jf,r as rt,I as Mr,d as f1,b as wr,U as Zo,f as Wt,c as Ot,e as Mu,g as ks}from"./index-TEbLqC9v.js";function h1({status:e,sourceMode:t,authEnabled:r,onLogout:n,logoutFailed:i,children:a}){const o=i?"退出失败,请重试":"退出";return w.jsxs("main",{className:"app","data-source-mode":t,children:[w.jsxs("header",{className:"topbar",children:[w.jsxs("a",{className:"brand",href:"https://github.com/Willxup/flowlens",target:"_blank",rel:"noreferrer","aria-label":"FlowLens GitHub 仓库",children:[w.jsx("div",{className:"brand-mark","aria-hidden":"true"}),w.jsxs("div",{children:[w.jsx("strong",{children:"FlowLens"}),w.jsx("span",{className:"eyebrow",children:"edge telemetry"})]})]}),w.jsxs("div",{className:"top-actions",children:[w.jsxs("span",{className:`live-status ${e}`,children:[w.jsx("i",{}),e==="ok"?"采集正常":e==="degraded"?"采集降级":"采集失败"]}),w.jsx(u1,{}),r?w.jsx(Jf,{content:o,children:w.jsxs("button",{className:`logout-button${i?" failed":""}`,type:"button","aria-label":o,onClick:n,children:[w.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:w.jsx("path",{d:"M10 4H5.5A1.5 1.5 0 0 0 4 5.5v13A1.5 1.5 0 0 0 5.5 20H10M14.5 8.5 18 12l-3.5 3.5M9 12h9"})}),w.jsx("span",{children:i?"重试退出":"退出"})]})}):null]})]}),a]})}function c1({source:e,labels:t,candidates:r,onChanged:n,onClose:i}){const[a,o]=rt.useState({}),[s,l]=rt.useState(!1),[u,f]=rt.useState(null),h=rt.useMemo(()=>{const c=new Map(r.map(g=>[Ln(g.label_type,g.match_value),g])),d=[],p=new Set;for(const g of t){const m=Ln(g.label_type,g.match_value);p.add(m),d.push(c.get(m)??{label_type:g.label_type,match_value:g.match_value,display_name:g.display_name,upload_bytes:"0",download_bytes:"0"})}for(const g of r)p.has(Ln(g.label_type,g.match_value))||d.push(g);return d},[r,t]);rt.useEffect(()=>{const c={};for(const d of h){const p=t.find(g=>g.label_type===d.label_type&&g.match_value===d.match_value);c[Ln(d.label_type,d.match_value)]=p?.display_name??""}o(c)},[h,t]);async function v(c,d){const p=Ln(c.label_type,c.match_value),g=(a[p]??"").trim();if(!(e.demo||g===""&&d===void 0)){f(p),l(!1);try{g===""?await e.deleteLabel(d.id):d===void 0?await e.createLabel({label_type:c.label_type,match_value:c.match_value,display_name:g}):await e.updateLabel(d.id,g),await n()}catch{l(!0)}finally{f(null)}}}return w.jsx("div",{className:"dialog-backdrop",role:"presentation",children:w.jsxs("section",{className:"dialog-shell",role:"dialog","aria-modal":"true","aria-labelledby":"alias-title",children:[w.jsxs("header",{className:"dialog-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:"Display aliases"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{id:"alias-title",children:"目标别名"}),w.jsx(Mr,{content:"别名只改变 FlowLens 展示;清空后保存即可恢复原始名称。",label:"查看“目标别名”说明"})]})]}),w.jsx(Jf,{content:"关闭别名",children:w.jsx("button",{type:"button","aria-label":"关闭别名",onClick:i,children:w.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:w.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})})})]}),w.jsxs("div",{className:"dialog-body",children:[e.demo?w.jsx("p",{className:"demo-notice",children:"Demo 为只读,别名修改仅在生产模式提供。"}):null,s?w.jsx("p",{className:"form-error",role:"alert",children:"别名保存失败,请重试。"}):null,w.jsx("div",{className:"alias-list",children:h.map(c=>{const d=t.find(g=>g.label_type===c.label_type&&g.match_value===c.match_value),p=Ln(c.label_type,c.match_value);return w.jsxs("div",{className:"alias-row",children:[w.jsxs("div",{className:"alias-identity",children:[w.jsx("strong",{children:c.match_value}),w.jsxs("span",{children:[c.label_type," 别名"]})]}),w.jsx("input",{className:"alias-field","aria-label":`${c.match_value} 显示名称`,value:a[p]??"",onChange:g=>o(m=>({...m,[p]:g.target.value})),maxLength:64,disabled:e.demo}),w.jsx("div",{className:"alias-actions",children:w.jsx("button",{type:"button","aria-label":`${c.match_value} 保存`,disabled:e.demo||u!==null||d===void 0&&(a[p]??"").trim()==="",onClick:()=>void v(c,d),children:"保存"})})]},p)})})]})]})})}function Ln(e,t){return`${e}:${t}`}const v1=[{label:"实时",value:{kind:"live"}},{label:"今天",value:{kind:"preset",preset:"today"}},{label:"昨天",value:{kind:"preset",preset:"yesterday"}},{label:"7 天",value:{kind:"preset",preset:"7d"}},{label:"30 天",value:{kind:"preset",preset:"30d"}},{label:"90 天",value:{kind:"preset",preset:"90d"}},{label:"今年",value:{kind:"preset",preset:"year"}}],d1=["日","一","二","三","四","五","六"];function p1({value:e,now:t,timezone:r="UTC",onChange:n}){const[i,a]=rt.useState(!1),o=f1(t,r),[s,l]=rt.useState(o),[u,f]=rt.useState(o),[h,v]=rt.useState("from"),[c,d]=rt.useState({..._i(o)}),p=S=>JSON.stringify(S)===JSON.stringify(e),g=s!==""&&u!==""&&s<=u&&u<=o;function m(){e.kind==="custom"?(l(e.from),f(e.to),d(_i(e.from))):(l(o),f(o),d(_i(o))),v("from"),a(!0)}function y(S){v(S),d(_i(S==="from"?s:u))}function _(S){if(h==="from"){l(S),S>u&&f(S),v("to");return}Sw.jsx("button",{type:"button","aria-pressed":!i&&p(S.value),onClick:()=>{a(!1),n(S.value)},children:S.label},S.label)),w.jsx("button",{type:"button","aria-pressed":i||e.kind==="custom",onClick:m,children:"自定义"})]}),i?w.jsxs("section",{className:"custom-range-dialog",role:"dialog","aria-labelledby":"custom-range-title",children:[w.jsxs("header",{className:"custom-range-head",children:[w.jsx("h2",{id:"custom-range-title",children:"选择自定义日期"}),w.jsx("span",{children:r})]}),w.jsxs("div",{className:"custom-date-grid",children:[w.jsxs("button",{className:"custom-date-card",type:"button","aria-label":`开始日期 ${s}`,"aria-pressed":h==="from",onClick:()=>y("from"),children:[w.jsx("span",{children:"开始日期"}),w.jsx("strong",{children:Ga(s)})]}),w.jsxs("button",{className:"custom-date-card",type:"button","aria-label":`结束日期 ${u}`,"aria-pressed":h==="to",onClick:()=>y("to"),children:[w.jsx("span",{children:"结束日期"}),w.jsx("strong",{children:Ga(u)})]})]}),w.jsxs("section",{className:"calendar-card","aria-label":"日期选择器",children:[w.jsxs("header",{className:"calendar-head",children:[w.jsx("button",{type:"button","aria-label":"上个月",onClick:()=>d(Mc(c,-1)),children:"‹"}),w.jsx("h3",{children:`${c.year} 年 ${c.month} 月`}),w.jsx("button",{type:"button","aria-label":"下个月",onClick:()=>d(Mc(c,1)),children:"›"})]}),w.jsx("div",{className:"calendar-weekdays","aria-hidden":"true",children:d1.map(S=>w.jsx("span",{children:S},S))}),w.jsx("div",{className:"calendar-days",children:b.map(S=>{const x=S.value===s||S.value===u,T=S.value>=s&&S.value<=u;return w.jsx("button",{className:["calendar-day",S.currentMonth?"":"outside-month",T?"in-range":"",x?"range-endpoint":""].filter(Boolean).join(" "),type:"button",disabled:S.value>o,"aria-label":S.value,"aria-pressed":x,onClick:()=>{_(S.value),S.currentMonth||d(_i(S.value))},children:S.day},S.value)})})]}),w.jsxs("footer",{className:"custom-range-actions",children:[w.jsx("span",{children:`${Ga(s)} — ${Ga(u)}`}),w.jsxs("div",{children:[w.jsx("button",{className:"soft-button",type:"button",onClick:()=>a(!1),children:"取消"}),w.jsx("button",{className:"primary-button",type:"button",disabled:!g,onClick:()=>{n({kind:"custom",from:s,to:u}),a(!1)},children:"应用"})]})]})]}):null]})}function _i(e){const{year:t,month:r}=Hg(e);return{year:t,month:r}}function Mc(e,t){const r=new Date(Date.UTC(e.year,e.month-1+t,1));return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1}}function g1(e){const r=1-new Date(Date.UTC(e.year,e.month-1,1)).getUTCDay();return Array.from({length:42},(n,i)=>{const a=new Date(Date.UTC(e.year,e.month-1,r+i));return{value:m1(a),day:a.getUTCDate(),currentMonth:a.getUTCMonth()===e.month-1}})}function m1(e){return[e.getUTCFullYear(),String(e.getUTCMonth()+1).padStart(2,"0"),String(e.getUTCDate()).padStart(2,"0")].join("-")}function Ga(e){const{year:t,month:r,day:n}=Hg(e);return`${t}年${r}月${n}日`}function Hg(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))throw new Error("invalid date");return{year:Number(e.slice(0,4)),month:Number(e.slice(5,7)),day:Number(e.slice(8,10))}}function y1(e){const t=e.items.map(r=>({rawValue:r.raw_value,displayName:r.display_name,networkCode:r.network_code,uploadBytes:r.upload_bytes,downloadBytes:r.download_bytes,totalBytes:wr(r.upload_bytes,r.download_bytes)})).sort((r,n)=>_1(n.totalBytes,r.totalBytes)||r.rawValue.localeCompare(n.rawValue));return{by:e.by,available:e.available,noTraffic:e.no_traffic,approximate:e.approximate,connectionCoverage:e.connection_coverage,dimensionRetention:e.dimension_retention,globalBytes:wr(e.global.upload_bytes,e.global.download_bytes),otherBytes:wr(e.other.upload_bytes,e.other.download_bytes),unattributedBytes:wr(e.unattributed.upload_bytes,e.unattributed.download_bytes),items:t}}function _1(e,t){const r=BigInt(e),n=BigInt(t);return rn?1:0}function b1(e,t,r){let n="0";const i=t.points.map(h=>(n=wr(n,h.upload_bytes,h.download_bytes),{start:h.bucket_start,end:h.bucket_end,upload:h.upload_bytes,download:h.download_bytes,cumulative:n,uploadRate:h.speed_sample_count>0?h.average_upload_bytes_per_second:null,downloadRate:h.speed_sample_count>0?h.average_download_bytes_per_second:null,resolution:h.source_resolution_sec})),a=t.points.reduce((h,v)=>h+v.counter_observed_seconds,0),o=t.points.reduce((h,v)=>h+v.elapsed_seconds,0),s=t.points.reduce((h,v)=>h+v.active_connections_samples,0),l=t.points.reduce((h,v)=>h+v.active_connections_sum,0),u=t.points.reduce((h,v)=>wr(h,v.recovered_upload_bytes,v.recovered_download_bytes),"0"),f=t.points.reduce((h,v)=>wr(h,v.unattributed_upload_bytes,v.unattributed_download_bytes),"0");return{uploadBytes:e.current.upload_bytes,downloadBytes:e.current.download_bytes,totalBytes:wr(e.current.upload_bytes,e.current.download_bytes),previousBytes:e.previous.total_bytes,completeness:o>0?Math.min(1,a/o):null,averageUpload:Ac(t,"speed_upload_sample_sum"),averageDownload:Ac(t,"speed_download_sample_sum"),peakUpload:Lc(t,"peak_upload_bytes_per_second"),peakDownload:Lc(t,"peak_download_bytes_per_second"),averageConnections:s>0?l/s:null,peakConnections:s>0?t.points.reduce((h,v)=>v.active_connections_samples>0?Math.max(h,v.active_connections_max):h,0):null,boundaryApproximate:e.boundary_approximate||t.boundary_approximate,qualityEvents:r.events,recoveredBytes:u,unattributedBytes:f,resetCount:t.points.reduce((h,v)=>h+v.reset_count,0),chart:i}}function Ac(e,t){const r=e.points.reduce((a,o)=>a+o.speed_sample_count,0);if(r===0)return null;const n=e.points.reduce((a,o)=>a+BigInt(o[t]),0n),i=BigInt(r);return Number(n/i)+Number(n%i)/r}function Lc(e,t){const r=e.points.filter(n=>n.speed_sample_count>0);return r.length===0?null:r.reduce((n,i)=>Math.max(n,i[t]),0)}function S1(e,t,r,n,i=0){const[a,o]=rt.useState({loading:!1,error:!1,view:null,breakdown:null});return rt.useEffect(()=>{if(t.kind==="live")return;const s=t,l=new AbortController;let u=!0,f=!1;const h=async()=>{o(c=>f?{...c,loading:!0,error:!1}:{loading:!0,error:!1,view:null,breakdown:null});try{const[c,d,p,g]=await Promise.all([e.overview(s,l.signal),e.series(s,l.signal),e.quality(s,l.signal),e.breakdown(s,r,l.signal)]);u&&(f=!0,o({loading:!1,error:!1,view:b1(c,d,p),breakdown:g}))}catch(c){c instanceof Zo?n():u&&!l.signal.aborted&&o(d=>({loading:!1,error:!0,view:f?d.view:null,breakdown:f?d.breakdown:null}))}};h();const v=t.kind==="preset"&&t.preset==="today"?window.setInterval(h,6e4):void 0;return()=>{u=!1,l.abort(),v!==void 0&&window.clearInterval(v)}},[r,n,i,t,e]),{...a,targets:a.breakdown===null?null:y1(a.breakdown)}}function x1(e,t,r,n){const i=[...e].filter(w1).sort((s,l)=>s.timestamp-l.timestamp).slice(-3600),a=i.at(-1),o=T1(i);return{currentUpload:a?.upload_bytes_per_second??null,currentDownload:a?.download_bytes_per_second??null,averageUpload1m:Va(i.slice(-60),"upload_bytes_per_second"),averageDownload1m:Va(i.slice(-60),"download_bytes_per_second"),averageUpload5m:Va(i.slice(-300),"upload_bytes_per_second"),averageDownload5m:Va(i.slice(-300),"download_bytes_per_second"),peakUpload60m:Pc(i,"upload_bytes_per_second"),peakDownload60m:Pc(i,"download_bytes_per_second"),activeConnections:a?.active_connections??r?.active_connections??null,connectionCoverage:r?.connection_coverage??null,status:t,connected:n,observedAt:r?.observed_at??null,intervalMillis:r?.interval_millis??null,targetGlobalRate:r===null?null:r.global_upload_bytes_per_second+r.global_download_bytes_per_second,hasGap:o.some(s=>s.upload===null),chart:o,targets:r?.targets??[]}}function w1(e){return Number.isSafeInteger(e.timestamp)&&e.timestamp>0&&e.upload_bytes_per_second>=0&&e.download_bytes_per_second>=0&&e.active_connections>=0}function Va(e,t){return e.length===0?null:e.reduce((r,n)=>r+n[t],0)/e.length}function Pc(e,t){return e.length===0?null:e.reduce((r,n)=>Math.max(r,n[t]),0)}function T1(e){const t=[];let r=0;for(const n of e)r>0&&n.timestamp-r>2.5&&t.push({timestamp:r+1,upload:null,download:null}),t.push({timestamp:n.timestamp,upload:n.upload_bytes_per_second,download:n.download_bytes_per_second}),r=n.timestamp;return t}function C1(e,t,r,n,i){const[a,o]=rt.useState([]),[s,l]=rt.useState(null),[u,f]=rt.useState(!1);return rt.useEffect(()=>{if(!r)return;let h=!0;const v=async()=>{try{const p=await e.liveTargets();h&&l(p)}catch(p){p instanceof Zo&&i()}};v();const c=window.setInterval(v,1e4),d=e.subscribeLive(p=>{h&&(p.type==="snapshot"&&o(p.samples),p.type==="sample"&&o(g=>[...g,p.sample].slice(-3600)),p.type==="status"&&n(p.status,p.reason))},f);return()=>{h=!1,window.clearInterval(c),d(),f(!1)}},[r,n,i,e]),rt.useMemo(()=>x1(a,t,s,u),[u,a,t,s])}function D1({value:e}){if(e===null)return w.jsx("p",{className:"empty-state",children:"存储状态正在加载。"});const t=e.last_rollup_cleanup,r=e.protecting?"数据库已进入容量保护,请检查空间和保留策略。":t===null?"数据库空间正常,暂无聚合清理记录。":t.successful?"数据库空间充足,最近一次聚合清理已经顺利完成。":"数据库空间正常,但最近一次聚合清理失败。";return w.jsxs("section",{className:"panel storage-panel","aria-labelledby":"storage-title",children:[w.jsxs("div",{className:"storage-lead",children:[w.jsx("span",{className:"eyebrow",children:"Storage health"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{id:"storage-title",children:"存储健康"}),w.jsx(Mr,{content:r,label:"查看“存储健康”说明"})]})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"SQLite"}),w.jsx("strong",{children:Wt(e.database_bytes)})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"WAL"}),w.jsx("strong",{children:Wt(e.wal_bytes)})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"软上限"}),w.jsx("strong",{children:Wt(e.soft_limit_bytes)})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"容量保护"}),w.jsx("strong",{children:e.protecting?"已启用":"正常"})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"最近清理"}),w.jsx("strong",{children:t===null?"暂无记录":t.successful?"成功":"失败"})]})]})}function Ic({live:e,liveTotalRate:t,historical:r}){const n=e!==void 0?e.map(a=>{const o=kc(a.raw_endpoint,a.display_name);return{key:a.raw_endpoint,...o,network:Mu(a.network_code),download:Ot(a.download_bytes_per_second),upload:Ot(a.upload_bytes_per_second),share:M1(a,t),value:Ot(a.upload_bytes_per_second+a.download_bytes_per_second),magnitude:a.upload_bytes_per_second+a.download_bytes_per_second}}):(r??[]).map(a=>{const o=kc(a.rawValue,a.displayName);return{key:a.rawValue,...o,network:Mu(a.networkCode),download:Wt(a.downloadBytes),upload:Wt(a.uploadBytes),share:null,value:Wt(a.totalBytes),magnitude:Number(BigInt(a.totalBytes)>10000000000n?10000000000n:BigInt(a.totalBytes))}}),i=Math.max(1,...n.map(a=>a.magnitude));return w.jsx("div",{className:"target-list",children:n.length===0?w.jsx("p",{className:"empty-state",children:"当前没有可展示的目标。"}):n.slice(0,8).map((a,o)=>w.jsxs("div",{className:"target-item",children:[w.jsx("div",{className:"target-icon target-rank","aria-label":`第 ${o+1} 名`,children:o+1}),w.jsxs("div",{className:"target-main",children:[w.jsx("strong",{children:a.name}),w.jsxs("span",{className:"target-detail",children:[a.rawDetail===null?null:w.jsxs(w.Fragment,{children:[w.jsx("span",{children:a.rawDetail}),w.jsx("i",{"aria-hidden":"true",children:"·"})]}),w.jsx("span",{children:a.network}),w.jsx("i",{"aria-hidden":"true",children:"·"}),w.jsxs("span",{"aria-label":`下载 ${a.download}`,children:[w.jsx("b",{className:"target-download","aria-hidden":"true",children:"↓"})," ",a.download]}),w.jsx("i",{"aria-hidden":"true",children:"·"}),w.jsxs("span",{"aria-label":`上传 ${a.upload}`,children:[w.jsx("b",{className:"target-upload","aria-hidden":"true",children:"↑"})," ",a.upload]}),a.share===null?null:w.jsxs(w.Fragment,{children:[w.jsx("i",{"aria-hidden":"true",children:"·"}),w.jsx("span",{children:a.share})]})]}),w.jsx("div",{className:"target-bar",children:w.jsx("i",{style:{width:`${Math.max(4,a.magnitude/i*100)}%`}})})]}),w.jsx("strong",{className:"target-value",children:a.value})]},a.key))})}function kc(e,t){const r=` · ${e}`,n=t.endsWith(r)?t.slice(0,-r.length).trim():t.trim(),i=n===""?e:n;return{name:i,rawDetail:i===e?null:e}}function M1(e,t){return t==null||t<=0?null:`占全局 ${ks((e.upload_bytes_per_second+e.download_bytes_per_second)/t)}`}const A1={target:"目标 IP",endpoint:"Endpoint",port:"端口",network:"TCP/UDP",source:"来源网段",domain:"域名"};function L1({by:e,rows:t}){const r=t.reduce((n,i)=>P1(n,i.totalBytes),"1");return w.jsx("div",{className:"breakdown-distribution","aria-label":`${A1[e]}分布`,children:t.length===0?w.jsx("p",{className:"empty-state",children:"当前范围没有可展示的数据。"}):t.slice(0,8).map(n=>w.jsxs("div",{className:"distribution-row",children:[w.jsxs("div",{className:"distribution-label",children:[w.jsxs("div",{children:[w.jsx("strong",{children:n.displayName}),w.jsxs("span",{children:[n.rawValue,n.networkCode>0?` · ${Mu(n.networkCode)}`:""]})]}),w.jsx("strong",{children:Wt(n.totalBytes)})]}),w.jsxs("div",{className:"distribution-track","aria-hidden":"true",children:[w.jsx("i",{className:"distribution-download",style:{width:`${Rc(n.downloadBytes,r)}%`}}),w.jsx("i",{className:"distribution-upload",style:{width:`${Rc(n.uploadBytes,r)}%`}})]}),w.jsxs("div",{className:"distribution-detail",children:[w.jsxs("span",{children:["↓ ",Wt(n.downloadBytes)]}),w.jsxs("span",{children:["↑ ",Wt(n.uploadBytes)]})]})]},n.rawValue))})}function P1(e,t){return BigInt(e)>=BigInt(t)?e:t}function Rc(e,t){return Number(BigInt(e)*1000n/BigInt(t))/10}function I1({targets:e}){const t=e.slice(0,3),r=162.5+(t.length-1)*50;return w.jsxs("div",{className:"topology","aria-label":"流量拓扑:来源网络经过代理网关到目标服务",children:[w.jsxs("svg",{className:"topology-desktop-flow",viewBox:"0 0 900 300",preserveAspectRatio:"none","aria-hidden":"true",children:[w.jsx("path",{className:"flow-path",d:"M0 72 C260 72 300 150 450 150"}),w.jsx("path",{className:"flow-path secondary",d:"M0 232 C260 232 300 150 450 150"}),t.map((n,i)=>w.jsx("path",{className:"flow-path target",d:`M450 150 C600 150 640 ${50+i*100} 900 ${50+i*100}`},i))]}),w.jsxs("svg",{className:"topology-mobile-flow",viewBox:"0 0 300 285",preserveAspectRatio:"none","aria-hidden":"true",children:[w.jsx("defs",{children:w.jsx("marker",{id:"topology-mobile-arrow",viewBox:"0 0 6 6",refX:"5.5",refY:"3",markerWidth:"5",markerHeight:"5",orient:"auto",children:w.jsx("path",{className:"mobile-flow-arrow",d:"M0 0L6 3L0 6Z"})})}),w.jsx("path",{className:"flow-path",d:"M75 50V60H138V72"}),w.jsx("path",{className:"flow-path secondary",d:"M225 50V60H162V72"}),t.length>0?w.jsx("path",{className:"flow-path target mobile-target-trunk",d:`M150 120V128H14V${r}`}):null,t.map((n,i)=>w.jsx("path",{className:"flow-path target mobile-target-path",d:`M14 ${162.5+i*50}H24`,markerEnd:"url(#topology-mobile-arrow)"},i))]}),w.jsxs("div",{className:"flow-node node-source-one",children:[w.jsx("strong",{children:"来源网络"}),w.jsx("span",{children:"采样可见来源"})]}),w.jsxs("div",{className:"flow-node node-source-two",children:[w.jsx("strong",{children:"其他来源"}),w.jsx("span",{children:"Top 20 合并展示"})]}),w.jsxs("div",{className:"flow-node node-gateway",children:[w.jsx("strong",{children:"代理网关"}),w.jsx("span",{children:"network edge"})]}),t.map((n,i)=>w.jsxs("div",{className:`flow-node node-target node-target-${i}`,children:[w.jsx("strong",{children:n.displayName}),w.jsx("span",{children:n.rawValue})]},n.rawValue))]})}/*! ***************************************************************************** +import{j as w,T as f1,a as Jf,r as rt,I as Mr,d as h1,b as wr,U as Zo,f as Wt,c as Ot,e as Mu,g as ks}from"./index-B9YDBDoG.js";const Mc="https://github.com/Willxup/flowlens",c1="https://github.com/Willxup";function v1(e){const t=e?.trim();return t?`Version: ${t}`:void 0}function d1({version:e}){const t=v1(e);return w.jsxs("footer",{className:"app-footer",children:[w.jsxs("div",{className:"app-footer-line app-footer-meta",children:[w.jsx("span",{children:"© 2026"}),w.jsx("a",{href:Mc,target:"_blank",rel:"noreferrer",children:"FlowLens"}),w.jsx("span",{"aria-hidden":"true",children:"·"}),w.jsx("a",{href:`${Mc}/blob/main/LICENSE`,target:"_blank",rel:"noreferrer",children:"License"})]}),w.jsxs("div",{className:"app-footer-line app-footer-powered",children:[w.jsx("span",{children:"Powered By"}),w.jsxs("a",{href:c1,target:"_blank",rel:"noreferrer","aria-label":"Willxup GitHub 主页",children:[w.jsx(p1,{}),w.jsx("span",{children:"Willxup"})]}),t?w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"app-footer-version-separator","aria-hidden":"true",children:"·"}),w.jsx("span",{className:"app-footer-version",children:t})]}):null]})]})}function p1(){return w.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[w.jsx("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"}),w.jsx("path",{d:"M9 18c-4.51 2-5-2-7-2"})]})}function g1({status:e,version:t,sourceMode:r,authEnabled:n,onLogout:i,logoutFailed:a,children:o}){const s=a?"退出失败,请重试":"退出";return w.jsxs("main",{className:"app","data-source-mode":r,children:[w.jsxs("header",{className:"topbar",children:[w.jsxs("a",{className:"brand",href:"https://github.com/Willxup/flowlens",target:"_blank",rel:"noreferrer","aria-label":"FlowLens GitHub 仓库",children:[w.jsx("div",{className:"brand-mark","aria-hidden":"true"}),w.jsxs("div",{children:[w.jsx("strong",{children:"FlowLens"}),w.jsx("span",{className:"eyebrow",children:"edge telemetry"})]})]}),w.jsxs("div",{className:"top-actions",children:[w.jsxs("span",{className:`live-status ${e}`,children:[w.jsx("i",{}),e==="ok"?"采集正常":e==="degraded"?"采集降级":"采集失败"]}),w.jsx(f1,{}),n?w.jsx(Jf,{content:s,children:w.jsxs("button",{className:`logout-button${a?" failed":""}`,type:"button","aria-label":s,onClick:i,children:[w.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:w.jsx("path",{d:"M10 4H5.5A1.5 1.5 0 0 0 4 5.5v13A1.5 1.5 0 0 0 5.5 20H10M14.5 8.5 18 12l-3.5 3.5M9 12h9"})}),w.jsx("span",{children:a?"重试退出":"退出"})]})}):null]})]}),o,w.jsx(d1,{version:t})]})}function m1({source:e,labels:t,candidates:r,onChanged:n,onClose:i}){const[a,o]=rt.useState({}),[s,l]=rt.useState(!1),[u,f]=rt.useState(null),h=rt.useMemo(()=>{const c=new Map(r.map(g=>[Ln(g.label_type,g.match_value),g])),d=[],p=new Set;for(const g of t){const m=Ln(g.label_type,g.match_value);p.add(m),d.push(c.get(m)??{label_type:g.label_type,match_value:g.match_value,display_name:g.display_name,upload_bytes:"0",download_bytes:"0"})}for(const g of r)p.has(Ln(g.label_type,g.match_value))||d.push(g);return d},[r,t]);rt.useEffect(()=>{const c={};for(const d of h){const p=t.find(g=>g.label_type===d.label_type&&g.match_value===d.match_value);c[Ln(d.label_type,d.match_value)]=p?.display_name??""}o(c)},[h,t]);async function v(c,d){const p=Ln(c.label_type,c.match_value),g=(a[p]??"").trim();if(!(e.demo||g===""&&d===void 0)){f(p),l(!1);try{g===""?await e.deleteLabel(d.id):d===void 0?await e.createLabel({label_type:c.label_type,match_value:c.match_value,display_name:g}):await e.updateLabel(d.id,g),await n()}catch{l(!0)}finally{f(null)}}}return w.jsx("div",{className:"dialog-backdrop",role:"presentation",children:w.jsxs("section",{className:"dialog-shell",role:"dialog","aria-modal":"true","aria-labelledby":"alias-title",children:[w.jsxs("header",{className:"dialog-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:"Display aliases"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{id:"alias-title",children:"目标别名"}),w.jsx(Mr,{content:"别名只改变 FlowLens 展示;清空后保存即可恢复原始名称。",label:"查看“目标别名”说明"})]})]}),w.jsx(Jf,{content:"关闭别名",children:w.jsx("button",{type:"button","aria-label":"关闭别名",onClick:i,children:w.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:w.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})})})]}),w.jsxs("div",{className:"dialog-body",children:[e.demo?w.jsx("p",{className:"demo-notice",children:"Demo 为只读,别名修改仅在生产模式提供。"}):null,s?w.jsx("p",{className:"form-error",role:"alert",children:"别名保存失败,请重试。"}):null,w.jsx("div",{className:"alias-list",children:h.map(c=>{const d=t.find(g=>g.label_type===c.label_type&&g.match_value===c.match_value),p=Ln(c.label_type,c.match_value);return w.jsxs("div",{className:"alias-row",children:[w.jsxs("div",{className:"alias-identity",children:[w.jsx("strong",{children:c.match_value}),w.jsxs("span",{children:[c.label_type," 别名"]})]}),w.jsx("input",{className:"alias-field","aria-label":`${c.match_value} 显示名称`,value:a[p]??"",onChange:g=>o(m=>({...m,[p]:g.target.value})),maxLength:64,disabled:e.demo}),w.jsx("div",{className:"alias-actions",children:w.jsx("button",{type:"button","aria-label":`${c.match_value} 保存`,disabled:e.demo||u!==null||d===void 0&&(a[p]??"").trim()==="",onClick:()=>void v(c,d),children:"保存"})})]},p)})})]})]})})}function Ln(e,t){return`${e}:${t}`}const y1=[{label:"实时",value:{kind:"live"}},{label:"今天",value:{kind:"preset",preset:"today"}},{label:"昨天",value:{kind:"preset",preset:"yesterday"}},{label:"7 天",value:{kind:"preset",preset:"7d"}},{label:"30 天",value:{kind:"preset",preset:"30d"}},{label:"90 天",value:{kind:"preset",preset:"90d"}},{label:"今年",value:{kind:"preset",preset:"year"}}],_1=["日","一","二","三","四","五","六"];function b1({value:e,now:t,timezone:r="UTC",onChange:n}){const[i,a]=rt.useState(!1),o=h1(t,r),[s,l]=rt.useState(o),[u,f]=rt.useState(o),[h,v]=rt.useState("from"),[c,d]=rt.useState({..._i(o)}),p=S=>JSON.stringify(S)===JSON.stringify(e),g=s!==""&&u!==""&&s<=u&&u<=o;function m(){e.kind==="custom"?(l(e.from),f(e.to),d(_i(e.from))):(l(o),f(o),d(_i(o))),v("from"),a(!0)}function y(S){v(S),d(_i(S==="from"?s:u))}function _(S){if(h==="from"){l(S),S>u&&f(S),v("to");return}Sw.jsx("button",{type:"button","aria-pressed":!i&&p(S.value),onClick:()=>{a(!1),n(S.value)},children:S.label},S.label)),w.jsx("button",{type:"button","aria-pressed":i||e.kind==="custom",onClick:m,children:"自定义"})]}),i?w.jsxs("section",{className:"custom-range-dialog",role:"dialog","aria-labelledby":"custom-range-title",children:[w.jsxs("header",{className:"custom-range-head",children:[w.jsx("h2",{id:"custom-range-title",children:"选择自定义日期"}),w.jsx("span",{children:r})]}),w.jsxs("div",{className:"custom-date-grid",children:[w.jsxs("button",{className:"custom-date-card",type:"button","aria-label":`开始日期 ${s}`,"aria-pressed":h==="from",onClick:()=>y("from"),children:[w.jsx("span",{children:"开始日期"}),w.jsx("strong",{children:Ga(s)})]}),w.jsxs("button",{className:"custom-date-card",type:"button","aria-label":`结束日期 ${u}`,"aria-pressed":h==="to",onClick:()=>y("to"),children:[w.jsx("span",{children:"结束日期"}),w.jsx("strong",{children:Ga(u)})]})]}),w.jsxs("section",{className:"calendar-card","aria-label":"日期选择器",children:[w.jsxs("header",{className:"calendar-head",children:[w.jsx("button",{type:"button","aria-label":"上个月",onClick:()=>d(Ac(c,-1)),children:"‹"}),w.jsx("h3",{children:`${c.year} 年 ${c.month} 月`}),w.jsx("button",{type:"button","aria-label":"下个月",onClick:()=>d(Ac(c,1)),children:"›"})]}),w.jsx("div",{className:"calendar-weekdays","aria-hidden":"true",children:_1.map(S=>w.jsx("span",{children:S},S))}),w.jsx("div",{className:"calendar-days",children:b.map(S=>{const x=S.value===s||S.value===u,T=S.value>=s&&S.value<=u;return w.jsx("button",{className:["calendar-day",S.currentMonth?"":"outside-month",T?"in-range":"",x?"range-endpoint":""].filter(Boolean).join(" "),type:"button",disabled:S.value>o,"aria-label":S.value,"aria-pressed":x,onClick:()=>{_(S.value),S.currentMonth||d(_i(S.value))},children:S.day},S.value)})})]}),w.jsxs("footer",{className:"custom-range-actions",children:[w.jsx("span",{children:`${Ga(s)} — ${Ga(u)}`}),w.jsxs("div",{children:[w.jsx("button",{className:"soft-button",type:"button",onClick:()=>a(!1),children:"取消"}),w.jsx("button",{className:"primary-button",type:"button",disabled:!g,onClick:()=>{n({kind:"custom",from:s,to:u}),a(!1)},children:"应用"})]})]})]}):null]})}function _i(e){const{year:t,month:r}=Wg(e);return{year:t,month:r}}function Ac(e,t){const r=new Date(Date.UTC(e.year,e.month-1+t,1));return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1}}function S1(e){const r=1-new Date(Date.UTC(e.year,e.month-1,1)).getUTCDay();return Array.from({length:42},(n,i)=>{const a=new Date(Date.UTC(e.year,e.month-1,r+i));return{value:x1(a),day:a.getUTCDate(),currentMonth:a.getUTCMonth()===e.month-1}})}function x1(e){return[e.getUTCFullYear(),String(e.getUTCMonth()+1).padStart(2,"0"),String(e.getUTCDate()).padStart(2,"0")].join("-")}function Ga(e){const{year:t,month:r,day:n}=Wg(e);return`${t}年${r}月${n}日`}function Wg(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))throw new Error("invalid date");return{year:Number(e.slice(0,4)),month:Number(e.slice(5,7)),day:Number(e.slice(8,10))}}function w1(e){const t=e.items.map(r=>({rawValue:r.raw_value,displayName:r.display_name,networkCode:r.network_code,uploadBytes:r.upload_bytes,downloadBytes:r.download_bytes,totalBytes:wr(r.upload_bytes,r.download_bytes)})).sort((r,n)=>T1(n.totalBytes,r.totalBytes)||r.rawValue.localeCompare(n.rawValue));return{by:e.by,available:e.available,noTraffic:e.no_traffic,approximate:e.approximate,connectionCoverage:e.connection_coverage,dimensionRetention:e.dimension_retention,globalBytes:wr(e.global.upload_bytes,e.global.download_bytes),otherBytes:wr(e.other.upload_bytes,e.other.download_bytes),unattributedBytes:wr(e.unattributed.upload_bytes,e.unattributed.download_bytes),items:t}}function T1(e,t){const r=BigInt(e),n=BigInt(t);return rn?1:0}function C1(e,t,r){let n="0";const i=t.points.map(h=>(n=wr(n,h.upload_bytes,h.download_bytes),{start:h.bucket_start,end:h.bucket_end,upload:h.upload_bytes,download:h.download_bytes,cumulative:n,uploadRate:h.speed_sample_count>0?h.average_upload_bytes_per_second:null,downloadRate:h.speed_sample_count>0?h.average_download_bytes_per_second:null,resolution:h.source_resolution_sec})),a=t.points.reduce((h,v)=>h+v.counter_observed_seconds,0),o=t.points.reduce((h,v)=>h+v.elapsed_seconds,0),s=t.points.reduce((h,v)=>h+v.active_connections_samples,0),l=t.points.reduce((h,v)=>h+v.active_connections_sum,0),u=t.points.reduce((h,v)=>wr(h,v.recovered_upload_bytes,v.recovered_download_bytes),"0"),f=t.points.reduce((h,v)=>wr(h,v.unattributed_upload_bytes,v.unattributed_download_bytes),"0");return{uploadBytes:e.current.upload_bytes,downloadBytes:e.current.download_bytes,totalBytes:wr(e.current.upload_bytes,e.current.download_bytes),previousBytes:e.previous.total_bytes,completeness:o>0?Math.min(1,a/o):null,averageUpload:Lc(t,"speed_upload_sample_sum"),averageDownload:Lc(t,"speed_download_sample_sum"),peakUpload:Pc(t,"peak_upload_bytes_per_second"),peakDownload:Pc(t,"peak_download_bytes_per_second"),averageConnections:s>0?l/s:null,peakConnections:s>0?t.points.reduce((h,v)=>v.active_connections_samples>0?Math.max(h,v.active_connections_max):h,0):null,boundaryApproximate:e.boundary_approximate||t.boundary_approximate,qualityEvents:r.events,recoveredBytes:u,unattributedBytes:f,resetCount:t.points.reduce((h,v)=>h+v.reset_count,0),chart:i}}function Lc(e,t){const r=e.points.reduce((a,o)=>a+o.speed_sample_count,0);if(r===0)return null;const n=e.points.reduce((a,o)=>a+BigInt(o[t]),0n),i=BigInt(r);return Number(n/i)+Number(n%i)/r}function Pc(e,t){const r=e.points.filter(n=>n.speed_sample_count>0);return r.length===0?null:r.reduce((n,i)=>Math.max(n,i[t]),0)}function D1(e,t,r,n,i=0){const[a,o]=rt.useState({loading:!1,error:!1,view:null,breakdown:null});return rt.useEffect(()=>{if(t.kind==="live")return;const s=t,l=new AbortController;let u=!0,f=!1;const h=async()=>{o(c=>f?{...c,loading:!0,error:!1}:{loading:!0,error:!1,view:null,breakdown:null});try{const[c,d,p,g]=await Promise.all([e.overview(s,l.signal),e.series(s,l.signal),e.quality(s,l.signal),e.breakdown(s,r,l.signal)]);u&&(f=!0,o({loading:!1,error:!1,view:C1(c,d,p),breakdown:g}))}catch(c){c instanceof Zo?n():u&&!l.signal.aborted&&o(d=>({loading:!1,error:!0,view:f?d.view:null,breakdown:f?d.breakdown:null}))}};h();const v=t.kind==="preset"&&t.preset==="today"?window.setInterval(h,6e4):void 0;return()=>{u=!1,l.abort(),v!==void 0&&window.clearInterval(v)}},[r,n,i,t,e]),{...a,targets:a.breakdown===null?null:w1(a.breakdown)}}function M1(e,t,r,n){const i=[...e].filter(A1).sort((s,l)=>s.timestamp-l.timestamp).slice(-3600),a=i.at(-1),o=L1(i);return{currentUpload:a?.upload_bytes_per_second??null,currentDownload:a?.download_bytes_per_second??null,averageUpload1m:Va(i.slice(-60),"upload_bytes_per_second"),averageDownload1m:Va(i.slice(-60),"download_bytes_per_second"),averageUpload5m:Va(i.slice(-300),"upload_bytes_per_second"),averageDownload5m:Va(i.slice(-300),"download_bytes_per_second"),peakUpload60m:Ic(i,"upload_bytes_per_second"),peakDownload60m:Ic(i,"download_bytes_per_second"),activeConnections:a?.active_connections??r?.active_connections??null,connectionCoverage:r?.connection_coverage??null,status:t,connected:n,observedAt:r?.observed_at??null,intervalMillis:r?.interval_millis??null,targetGlobalRate:r===null?null:r.global_upload_bytes_per_second+r.global_download_bytes_per_second,hasGap:o.some(s=>s.upload===null),chart:o,targets:r?.targets??[]}}function A1(e){return Number.isSafeInteger(e.timestamp)&&e.timestamp>0&&e.upload_bytes_per_second>=0&&e.download_bytes_per_second>=0&&e.active_connections>=0}function Va(e,t){return e.length===0?null:e.reduce((r,n)=>r+n[t],0)/e.length}function Ic(e,t){return e.length===0?null:e.reduce((r,n)=>Math.max(r,n[t]),0)}function L1(e){const t=[];let r=0;for(const n of e)r>0&&n.timestamp-r>2.5&&t.push({timestamp:r+1,upload:null,download:null}),t.push({timestamp:n.timestamp,upload:n.upload_bytes_per_second,download:n.download_bytes_per_second}),r=n.timestamp;return t}function P1(e,t,r,n,i){const[a,o]=rt.useState([]),[s,l]=rt.useState(null),[u,f]=rt.useState(!1);return rt.useEffect(()=>{if(!r)return;let h=!0;const v=async()=>{try{const p=await e.liveTargets();h&&l(p)}catch(p){p instanceof Zo&&i()}};v();const c=window.setInterval(v,1e4),d=e.subscribeLive(p=>{h&&(p.type==="snapshot"&&o(p.samples),p.type==="sample"&&o(g=>[...g,p.sample].slice(-3600)),p.type==="status"&&n(p.status,p.reason))},f);return()=>{h=!1,window.clearInterval(c),d(),f(!1)}},[r,n,i,e]),rt.useMemo(()=>M1(a,t,s,u),[u,a,t,s])}function I1({value:e}){if(e===null)return w.jsx("p",{className:"empty-state",children:"存储状态正在加载。"});const t=e.last_rollup_cleanup,r=e.protecting?"数据库已进入容量保护,请检查空间和保留策略。":t===null?"数据库空间正常,暂无聚合清理记录。":t.successful?"数据库空间充足,最近一次聚合清理已经顺利完成。":"数据库空间正常,但最近一次聚合清理失败。";return w.jsxs("section",{className:"panel storage-panel","aria-labelledby":"storage-title",children:[w.jsxs("div",{className:"storage-lead",children:[w.jsx("span",{className:"eyebrow",children:"Storage health"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{id:"storage-title",children:"存储健康"}),w.jsx(Mr,{content:r,label:"查看“存储健康”说明"})]})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"SQLite"}),w.jsx("strong",{children:Wt(e.database_bytes)})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"WAL"}),w.jsx("strong",{children:Wt(e.wal_bytes)})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"软上限"}),w.jsx("strong",{children:Wt(e.soft_limit_bytes)})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"容量保护"}),w.jsx("strong",{children:e.protecting?"已启用":"正常"})]}),w.jsxs("div",{className:"storage-stat",children:[w.jsx("span",{children:"最近清理"}),w.jsx("strong",{children:t===null?"暂无记录":t.successful?"成功":"失败"})]})]})}function kc({live:e,liveTotalRate:t,historical:r}){const n=e!==void 0?e.map(a=>{const o=Rc(a.raw_endpoint,a.display_name);return{key:a.raw_endpoint,...o,network:Mu(a.network_code),download:Ot(a.download_bytes_per_second),upload:Ot(a.upload_bytes_per_second),share:k1(a,t),value:Ot(a.upload_bytes_per_second+a.download_bytes_per_second),magnitude:a.upload_bytes_per_second+a.download_bytes_per_second}}):(r??[]).map(a=>{const o=Rc(a.rawValue,a.displayName);return{key:a.rawValue,...o,network:Mu(a.networkCode),download:Wt(a.downloadBytes),upload:Wt(a.uploadBytes),share:null,value:Wt(a.totalBytes),magnitude:Number(BigInt(a.totalBytes)>10000000000n?10000000000n:BigInt(a.totalBytes))}}),i=Math.max(1,...n.map(a=>a.magnitude));return w.jsx("div",{className:"target-list",children:n.length===0?w.jsx("p",{className:"empty-state",children:"当前没有可展示的目标。"}):n.slice(0,8).map((a,o)=>w.jsxs("div",{className:"target-item",children:[w.jsx("div",{className:"target-icon target-rank","aria-label":`第 ${o+1} 名`,children:o+1}),w.jsxs("div",{className:"target-main",children:[w.jsx("strong",{children:a.name}),w.jsxs("span",{className:"target-detail",children:[a.rawDetail===null?null:w.jsxs(w.Fragment,{children:[w.jsx("span",{children:a.rawDetail}),w.jsx("i",{"aria-hidden":"true",children:"·"})]}),w.jsx("span",{children:a.network}),w.jsx("i",{"aria-hidden":"true",children:"·"}),w.jsxs("span",{"aria-label":`下载 ${a.download}`,children:[w.jsx("b",{className:"target-download","aria-hidden":"true",children:"↓"})," ",a.download]}),w.jsx("i",{"aria-hidden":"true",children:"·"}),w.jsxs("span",{"aria-label":`上传 ${a.upload}`,children:[w.jsx("b",{className:"target-upload","aria-hidden":"true",children:"↑"})," ",a.upload]}),a.share===null?null:w.jsxs(w.Fragment,{children:[w.jsx("i",{"aria-hidden":"true",children:"·"}),w.jsx("span",{children:a.share})]})]}),w.jsx("div",{className:"target-bar",children:w.jsx("i",{style:{width:`${Math.max(4,a.magnitude/i*100)}%`}})})]}),w.jsx("strong",{className:"target-value",children:a.value})]},a.key))})}function Rc(e,t){const r=` · ${e}`,n=t.endsWith(r)?t.slice(0,-r.length).trim():t.trim(),i=n===""?e:n;return{name:i,rawDetail:i===e?null:e}}function k1(e,t){return t==null||t<=0?null:`占全局 ${ks((e.upload_bytes_per_second+e.download_bytes_per_second)/t)}`}const R1={target:"目标 IP",endpoint:"Endpoint",port:"端口",network:"TCP/UDP",source:"来源网段",domain:"域名"};function E1({by:e,rows:t}){const r=t.reduce((n,i)=>O1(n,i.totalBytes),"1");return w.jsx("div",{className:"breakdown-distribution","aria-label":`${R1[e]}分布`,children:t.length===0?w.jsx("p",{className:"empty-state",children:"当前范围没有可展示的数据。"}):t.slice(0,8).map(n=>w.jsxs("div",{className:"distribution-row",children:[w.jsxs("div",{className:"distribution-label",children:[w.jsxs("div",{children:[w.jsx("strong",{children:n.displayName}),w.jsxs("span",{children:[n.rawValue,n.networkCode>0?` · ${Mu(n.networkCode)}`:""]})]}),w.jsx("strong",{children:Wt(n.totalBytes)})]}),w.jsxs("div",{className:"distribution-track","aria-hidden":"true",children:[w.jsx("i",{className:"distribution-download",style:{width:`${Ec(n.downloadBytes,r)}%`}}),w.jsx("i",{className:"distribution-upload",style:{width:`${Ec(n.uploadBytes,r)}%`}})]}),w.jsxs("div",{className:"distribution-detail",children:[w.jsxs("span",{children:["↓ ",Wt(n.downloadBytes)]}),w.jsxs("span",{children:["↑ ",Wt(n.uploadBytes)]})]})]},n.rawValue))})}function O1(e,t){return BigInt(e)>=BigInt(t)?e:t}function Ec(e,t){return Number(BigInt(e)*1000n/BigInt(t))/10}function N1({targets:e}){const t=e.slice(0,3),r=162.5+(t.length-1)*50;return w.jsxs("div",{className:"topology","aria-label":"流量拓扑:来源网络经过代理网关到目标服务",children:[w.jsxs("svg",{className:"topology-desktop-flow",viewBox:"0 0 900 300",preserveAspectRatio:"none","aria-hidden":"true",children:[w.jsx("path",{className:"flow-path",d:"M0 72 C260 72 300 150 450 150"}),w.jsx("path",{className:"flow-path secondary",d:"M0 232 C260 232 300 150 450 150"}),t.map((n,i)=>w.jsx("path",{className:"flow-path target",d:`M450 150 C600 150 640 ${50+i*100} 900 ${50+i*100}`},i))]}),w.jsxs("svg",{className:"topology-mobile-flow",viewBox:"0 0 300 285",preserveAspectRatio:"none","aria-hidden":"true",children:[w.jsx("defs",{children:w.jsx("marker",{id:"topology-mobile-arrow",viewBox:"0 0 6 6",refX:"5.5",refY:"3",markerWidth:"5",markerHeight:"5",orient:"auto",children:w.jsx("path",{className:"mobile-flow-arrow",d:"M0 0L6 3L0 6Z"})})}),w.jsx("path",{className:"flow-path",d:"M75 50V60H138V72"}),w.jsx("path",{className:"flow-path secondary",d:"M225 50V60H162V72"}),t.length>0?w.jsx("path",{className:"flow-path target mobile-target-trunk",d:`M150 120V128H14V${r}`}):null,t.map((n,i)=>w.jsx("path",{className:"flow-path target mobile-target-path",d:`M14 ${162.5+i*50}H24`,markerEnd:"url(#topology-mobile-arrow)"},i))]}),w.jsxs("div",{className:"flow-node node-source-one",children:[w.jsx("strong",{children:"来源网络"}),w.jsx("span",{children:"采样可见来源"})]}),w.jsxs("div",{className:"flow-node node-source-two",children:[w.jsx("strong",{children:"其他来源"}),w.jsx("span",{children:"Top 20 合并展示"})]}),w.jsxs("div",{className:"flow-node node-gateway",children:[w.jsx("strong",{children:"代理网关"}),w.jsx("span",{children:"network edge"})]}),t.map((n,i)=>w.jsxs("div",{className:`flow-node node-target node-target-${i}`,children:[w.jsx("strong",{children:n.displayName}),w.jsx("span",{children:n.rawValue})]},n.rawValue))]})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -11,8 +11,8 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Au=function(e,t){return Au=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Au(e,t)};function V(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Au(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var k1=(function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e})(),R1=(function(){function e(){this.browser=new k1,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 e})(),tt=new R1;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(tt.wxa=!0,tt.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?tt.worker=!0:!tt.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(tt.node=!0,tt.svgSupported=!0):E1(navigator.userAgent,tt);function E1(e,t){var r=t.browser,n=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=t.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}}var th=12,Wg="sans-serif",lr=th+"px "+Wg,O1=20,N1=100,B1="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function F1(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r=0)s=o*r.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),e.appendChild(o),r.push(o)}return t.clearMarkers=function(){M(r,function(f){f.parentNode&&f.parentNode.removeChild(f)})},r}function ub(e,t,r){for(var n=r?"invTrans":"trans",i=t[n],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var f=e[u].getBoundingClientRect(),h=2*u,v=f.left,c=f.top;o.push(v,c),l=l&&a&&v===a[h]&&c===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?Bc(s,o):Bc(o,s))}function qg(e){return e.nodeName.toUpperCase()==="CANVAS"}var fb=/([&<>"'])/g,hb={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ut(e){return e==null?"":(e+"").replace(fb,function(t,r){return hb[r]})}var cb=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sl=[],vb=tt.browser.firefox&&+tt.browser.version.split(".")[0]<39;function Eu(e,t,r,n){return r=r||{},n?Fc(e,t,r):vb&&t.layerX!=null&&t.layerX!==t.offsetX?(r.zrX=t.layerX,r.zrY=t.layerY):t.offsetX!=null?(r.zrX=t.offsetX,r.zrY=t.offsetY):Fc(e,t,r),r}function Fc(e,t,r){if(tt.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(qg(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(Ru(sl,e,n,i)){r.zrX=sl[0],r.zrY=sl[1];return}}r.zrX=r.zrY=0}function oh(e){return e||window.event}function fe(e,t,r){if(t=oh(t),t.zrX!=null)return t;var n=t.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&Eu(e,o,t,r)}else{Eu(e,t,t,r);var a=db(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&cb.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function db(e){var t=e.wheelDelta;if(t)return t;var r=e.deltaX,n=e.deltaY;if(r==null||n==null)return t;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function pb(e,t,r,n){e.addEventListener(t,r,n)}function gb(e,t,r,n){e.removeEventListener(t,r,n)}var Kg=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0},mb=(function(){function e(){this._track=[]}return e.prototype.recognize=function(t,r,n){return this._doTrack(t,r,n),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,r,n){var i=t.touches;if(i){for(var a={points:[],touches:[],target:r,event:t},o=0,s=i.length;o1&&n&&n.length>1){var a=zc(n)/zc(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=yb(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function sr(){return[1,0,0,1,0,0]}function sh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Qg(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Xi(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],l=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function Ou(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function lh(e,t,r,n){n===void 0&&(n=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],f=Math.sin(r),h=Math.cos(r);return e[0]=i*h+s*f,e[1]=-i*f+s*h,e[2]=a*h+l*f,e[3]=-a*f+h*l,e[4]=h*(o-n[0])+f*(u-n[1])+n[0],e[5]=h*(u-n[1])-f*(o-n[0])+n[1],e}function _b(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e}function Pa(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],l=r*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*s-o*i)*l,e[5]=(a*i-r*s)*l,e):null}var pt=(function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,n=this.y-t.y;return Math.sqrt(r*r+n*n)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,n=this.y-t.y;return r*r+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,n=this.y;return this.x=t[0]*r+t[2]*n+t[4],this.y=t[1]*r+t[3]*n+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,n){t.x=r,t.y=n},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,n){t.x=r.x+n.x,t.y=r.y+n.y},e.sub=function(t,r,n){t.x=r.x-n.x,t.y=r.y-n.y},e.scale=function(t,r,n){t.x=r.x*n,t.y=r.y*n},e.scaleAndAdd=function(t,r,n,i){t.x=r.x+n.x*i,t.y=r.y+n.y*i},e.lerp=function(t,r,n,i){var a=1-i;t.x=a*r.x+i*n.x,t.y=a*r.y+i*n.y},e})(),gn=Math.min,Kn=Math.max,Nu=Math.abs,Gc=["x","y"],bb=["width","height"],Vr=new pt,Hr=new pt,Wr=new pt,Ur=new pt,ne=Jg(),zi=ne.minTv,Bu=ne.maxTv,Zi=[0,0],at=(function(){function e(t,r,n,i){e.set(this,t,r,n,i)}return e.set=function(t,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),t.x=r,t.y=n,t.width=i,t.height=a,t},e.prototype.union=function(t){var r=gn(t.x,this.x),n=gn(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Kn(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Kn(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=r,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){var r=this,n=t.width/r.width,i=t.height/r.height,a=sr();return Ou(a,a,[-r.x,-r.y]),_b(a,a,[n,i]),Ou(a,a,[t.x,t.y]),a},e.prototype.intersect=function(t,r,n){return e.intersect(this,t,r,n)},e.intersect=function(t,r,n,i){n&&pt.set(n,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!r)return!1;t instanceof e||(t=e.set(Sb,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(xb,r.x,r.y,r.width,r.height));var s=!!n;ne.reset(i,s);var l=ne.touchThreshold,u=t.x+l,f=t.x+t.width-l,h=t.y+l,v=t.y+t.height-l,c=r.x+l,d=r.x+r.width-l,p=r.y+l,g=r.y+r.height-l;if(u>f||h>v||c>d||p>g)return!1;var m=!(f=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&e.copy(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Vr.x=Wr.x=r.x,Vr.y=Ur.y=r.y,Hr.x=Ur.x=r.x+r.width,Hr.y=Wr.y=r.y+r.height,Vr.transform(n),Ur.transform(n),Hr.transform(n),Wr.transform(n),t.x=gn(Vr.x,Hr.x,Wr.x,Ur.x),t.y=gn(Vr.y,Hr.y,Wr.y,Ur.y);var l=Kn(Vr.x,Hr.x,Wr.x,Ur.x),u=Kn(Vr.y,Hr.y,Wr.y,Ur.y);t.width=l-t.x,t.height=u-t.y},e})(),Sb=new at(0,0,0,0),xb=new at(0,0,0,0);function Vc(e,t,r,n,i,a,o,s){var l=Nu(t-r),u=Nu(n-e),f=gn(l,u),h=Gc[i],v=Gc[1-i],c=bb[i];t=u||!ne.bidirectional)&&(zi[h]=-u,zi[v]=0,ne.useDir&&ne.calcDirMTV())))}function Jg(){var e=0,t=new pt,r=new pt,n={minTv:new pt,maxTv:new pt,useDir:!1,dirMinTv:new pt,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=Kn(0,a.touchThreshold)),n.negativeSize=!1,o&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),e=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=n.minTv,o=n.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(e),u=Math.cos(e),f=l*a.y+u*a.x;if(i(f)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(r.x=s*u/f,r.y=s*l/f,i(r.x)&&i(r.y)){o.set(0,0);return}(n.bidirectional||t.dot(r)>0)&&r.len()=0;h--){var v=a[h];v!==i&&!v.ignore&&!v.ignoreCoarsePointer&&(!v.parent||!v.parent.ignoreCoarsePointer)&&(ul.copy(v.getBoundingRect()),v.transform&&ul.applyTransform(v.transform),ul.intersect(f)&&s.push(v))}if(s.length)for(var c=4,d=Math.PI/12,p=Math.PI*2,g=0;g4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function Mb(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){for(var n=e,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(t,r))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s?n.ignoreHostSilent?null:s:n.parent}return i?tm:!0}return!1}function Hc(e,t,r,n,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=Mb(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==tm)){t.target=o;break}}}function rm(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var nm=32,Si=7;function Ab(e){for(var t=0;e>=nm;)t|=e&1,e>>=1;return e+t}function Wc(e,t,r,n){var i=t+1;if(i===r)return 1;if(n(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function Lb(e,t,r){for(r--;t>>1,i(a,e[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;u>0;)e[o+u]=e[o+u-1],u--}e[o]=a}}function fl(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(e,t[r+f])>0?o=f+1:l=f}return l}function hl(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(e,t[r+f])<0?l=f:o=f+1}return l}function Pb(e,t){var r=Si,n,i,a=0,o=[];n=[],i=[];function s(c,d){n[a]=c,i[a]=d,a+=1}function l(){for(;a>1;){var c=a-2;if(c>=1&&i[c-1]<=i[c]+i[c+1]||c>=2&&i[c-2]<=i[c]+i[c-1])i[c-1]i[c+1])break;f(c)}}function u(){for(;a>1;){var c=a-2;c>0&&i[c-1]=Si||T>=Si);if(A)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),d===1){for(m=0;m=0;m--)e[x+m]=e[S+m];e[b]=o[_];return}for(var T=r;;){var A=0,L=0,D=!1;do if(t(o[_],e[y])<0){if(e[b--]=e[y--],A++,L=0,--d===0){D=!0;break}}else if(e[b--]=o[_--],L++,A=0,--g===1){D=!0;break}while((A|L)=0;m--)e[x+m]=e[S+m];if(d===0){D=!0;break}}if(e[b--]=o[_--],--g===1){D=!0;break}if(L=g-fl(e[y],o,0,g,g-1,t),L!==0){for(b-=L,_-=L,g-=L,x=b+1,S=_+1,m=0;m=Si||L>=Si);if(D)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),g===1){for(b-=d,y-=d,x=b+1,S=y+1,m=d-1;m>=0;m--)e[x+m]=e[S+m];e[b]=o[_]}else{if(g===0)throw new Error;for(S=b-(g-1),m=0;ms&&(l=s),Uc(e,r,r+l,r+a,t),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var Be=1,Gi=2,$n=4,jc=!1;function cl(){jc||(jc=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Yc(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Ib=(function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Yc}return e.prototype.traverse=function(t,r){for(var n=0;n=0&&this._roots.splice(i,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e})(),Fu;Fu=tt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var qi={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)))},elasticOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},elasticInOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-qi.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?qi.bounceIn(e*2)*.5:qi.bounceOut(e*2-1)*.5+.5}},Wa=Math.pow,Ar=Math.sqrt,Qo=1e-8,im=1e-4,$c=Ar(3),Ua=1/3,Fe=di(),ve=di(),ni=di();function Tr(e){return e>-Qo&&eQo||e<-Qo}function Nt(e,t,r,n,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*n+3*a*r)}function Xc(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function Jo(e,t,r,n,i,a){var o=n+3*(t-r)-e,s=3*(r-t*2+e),l=3*(t-e),u=e-i,f=s*s-3*o*l,h=s*l-9*o*u,v=l*l-3*s*u,c=0;if(Tr(f)&&Tr(h))if(Tr(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[c++]=d)}else{var p=h*h-4*f*v;if(Tr(p)){var g=h/f,d=-s/o+g,m=-g/2;d>=0&&d<=1&&(a[c++]=d),m>=0&&m<=1&&(a[c++]=m)}else if(p>0){var y=Ar(p),_=f*s+1.5*o*(-h+y),b=f*s+1.5*o*(-h-y);_<0?_=-Wa(-_,Ua):_=Wa(_,Ua),b<0?b=-Wa(-b,Ua):b=Wa(b,Ua);var d=(-s-(_+b))/(3*o);d>=0&&d<=1&&(a[c++]=d)}else{var S=(2*f*s-3*o*h)/(2*Ar(f*f*f)),x=Math.acos(S)/3,T=Ar(f),A=Math.cos(x),d=(-s-2*T*A)/(3*o),m=(-s+T*(A+$c*Math.sin(x)))/(3*o),L=(-s+T*(A-$c*Math.sin(x)))/(3*o);d>=0&&d<=1&&(a[c++]=d),m>=0&&m<=1&&(a[c++]=m),L>=0&&L<=1&&(a[c++]=L)}}return c}function om(e,t,r,n,i){var a=6*r-12*t+6*e,o=9*t+3*n-3*e-9*r,s=3*t-3*e,l=0;if(Tr(o)){if(am(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var f=a*a-4*o*s;if(Tr(f))i[0]=-a/(2*o);else if(f>0){var h=Ar(f),u=(-a+h)/(2*o),v=(-a-h)/(2*o);u>=0&&u<=1&&(i[l++]=u),v>=0&&v<=1&&(i[l++]=v)}}return l}function ts(e,t,r,n,i,a){var o=(t-e)*i+e,s=(r-t)*i+t,l=(n-r)*i+r,u=(s-o)*i+o,f=(l-s)*i+s,h=(f-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=f,a[6]=l,a[7]=n}function kb(e,t,r,n,i,a,o,s,l,u,f){var h,v=.005,c=1/0,d,p,g,m;Fe[0]=l,Fe[1]=u;for(var y=0;y<1;y+=.05)ve[0]=Nt(e,r,i,o,y),ve[1]=Nt(t,n,a,s,y),g=ri(Fe,ve),g=0&&g=0&&u<=1&&(i[l++]=u)}}else{var f=o*o-4*a*s;if(Tr(f)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(f>0){var h=Ar(f),u=(-o+h)/(2*a),v=(-o-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),v>=0&&v<=1&&(i[l++]=v)}}return l}function sm(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function es(e,t,r,n,i){var a=(t-e)*n+e,o=(r-t)*n+t,s=(o-a)*n+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function Ob(e,t,r,n,i,a,o,s,l){var u,f=.005,h=1/0;Fe[0]=o,Fe[1]=s;for(var v=0;v<1;v+=.05){ve[0]=qt(e,r,i,v),ve[1]=qt(t,n,a,v);var c=ri(Fe,ve);c=0&&c=1?1:Jo(0,n,a,1,l,s)&&Nt(0,i,o,1,s[0])}}}var Fb=(function(){function e(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Yt,this.ondestroy=t.ondestroy||Yt,this.onrestart=t.onrestart||Yt,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,r){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,i=t-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Q(t)?t:qi[t]||uh(t)},e})(),lm=(function(){function e(t){this.value=t}return e})(),zb=(function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new lm(t);return this.insertEntry(r),r},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var r=t.prev,n=t.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e})(),ai=(function(){function e(t){this._list=new zb,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var n=this._list,i=this._map,a=null;if(i[t]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new lm(r),s.key=t,n.insertEntry(s),i[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e})(),qc={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 Lr(e){return e=Math.round(e),e<0?0:e>255?255:e}function zu(e){return e<0?0:e>1?1:e}function vl(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Lr(parseFloat(t)/100*255):Lr(parseInt(t,10))}function _n(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?zu(parseFloat(t)/100):zu(parseFloat(t))}function dl(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function ja(e,t,r){return e+(t-e)*r}function ue(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function Gu(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var um=new ai(20),Ya=null;function In(e,t){Ya&&Gu(Ya,t),Ya=um.put(e,Ya||t.slice())}function Ce(e,t){if(e){t=t||[];var r=um.get(e);if(r)return Gu(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in qc)return Gu(t,qc[n]),In(e,t),t;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){ue(t,0,0,0,1);return}return ue(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),In(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){ue(t,0,0,0,1);return}return ue(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),In(e,t),t}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),f=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?ue(t,+u[0],+u[1],+u[2],1):ue(t,0,0,0,1);f=_n(u.pop());case"rgb":if(u.length>=3)return ue(t,vl(u[0]),vl(u[1]),vl(u[2]),u.length===3?f:_n(u[3])),In(e,t),t;ue(t,0,0,0,1);return;case"hsla":if(u.length!==4){ue(t,0,0,0,1);return}return u[3]=_n(u[3]),Vu(u,t),In(e,t),t;case"hsl":if(u.length!==3){ue(t,0,0,0,1);return}return Vu(u,t),In(e,t),t;default:return}}ue(t,0,0,0,1)}}function Vu(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=_n(e[1]),i=_n(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],ue(t,Lr(dl(o,a,r+1/3)*255),Lr(dl(o,a,r)*255),Lr(dl(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function Gb(e){if(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var f=((a-t)/6+o/2)/o,h=((a-r)/6+o/2)/o,v=((a-n)/6+o/2)/o;t===a?l=v-h:r===a?l=1/3+f-v:n===a&&(l=2/3+h-f),l<0&&(l+=1),l>1&&(l-=1)}var c=[l*360,u,s];return e[3]!=null&&c.push(e[3]),c}}function Kc(e,t){var r=Ce(e);if(r){for(var n=0;n<3;n++)r[n]=r[n]*(1-t)|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Ia(r,r.length===4?"rgba":"rgb")}}function Vb(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=Ce(t[i]),s=Ce(t[a]),l=n-i,u=Ia([Lr(ja(o[0],s[0],l)),Lr(ja(o[1],s[1],l)),Lr(ja(o[2],s[2],l)),zu(ja(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}function Hu(e,t,r,n){var i=Ce(e);if(e)return i=Gb(i),r!=null&&(i[1]=_n(Q(r)?r(i[1]):r)),n!=null&&(i[2]=_n(Q(n)?n(i[2]):n)),Ia(Vu(i),"rgba")}function Ia(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}}function rs(e,t){var r=Ce(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}var Qc=new ai(100);function Wu(e){if(Y(e)){var t=Qc.get(e);return t||(t=Kc(e,-.1),Qc.put(e,t)),t}else if(nh(e)){var r=N({},e);return r.colorStops=$(e.colorStops,function(n){return{offset:n.offset,color:Kc(n.color,-.1)}}),r}return e}var ns=Math.round;function la(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=Ce(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var Jc=1e-4;function Cr(e){return e-Jc}function $a(e){return ns(e*1e3)/1e3}function Uu(e){return ns(e*1e4)/1e4}function Hb(e){return"matrix("+$a(e[0])+","+$a(e[1])+","+$a(e[2])+","+$a(e[3])+","+Uu(e[4])+","+Uu(e[5])+")"}var Wb={left:"start",right:"end",center:"middle",middle:"middle"};function Ub(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function jb(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function Yb(e){var t=e.style,r=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function fm(e){return e&&!!e.image}function $b(e){return e&&!!e.svgElement}function fh(e){return fm(e)||$b(e)}function hm(e){return e.type==="linear"}function cm(e){return e.type==="radial"}function vm(e){return e&&(e.type==="linear"||e.type==="radial")}function Os(e){return"url(#"+e+")"}function dm(e){var t=e.getGlobalScale(),r=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function pm(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*Ro,i=X(e.scaleX,1),a=X(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,l=[];return(t||r)&&l.push("translate("+t+"px,"+r+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+ns(o*Ro)+"deg, "+ns(s*Ro)+"deg)"),l.join(" ")}var Xb=(function(){return tt.hasGlobalWindow&&Q(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<"u"?function(e){return Buffer.from(e).toString("base64")}:function(e){return null}})(),ju=Array.prototype.slice;function rr(e,t,r){return(t-e)*r+e}function pl(e,t,r,n){for(var i=t.length,a=0;an?t:e,a=Math.min(r,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,r,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=ev,l=r;if(Jt(r)){var u=Qb(r);s=u,(u===1&&!vt(r[0])||u===2&&!vt(r[0][0]))&&(o=!0)}else if(vt(r)&&!sa(r))s=Za;else if(Y(r))if(!isNaN(+r))s=Za;else{var f=Ce(r);f&&(l=f,s=Vi)}else if(nh(r)){var h=N({},l);h.colorStops=$(r.colorStops,function(c){return{offset:c.offset,color:Ce(c.color)}}),hm(r)?s=Yu:cm(r)&&(s=$u),l=h}a===0?this.valType=s:(s!==this.valType||s===ev)&&(o=!0),this.discrete=this.discrete||o;var v={time:t,value:l,rawValue:r,percent:0};return n&&(v.easing=n,v.easingFunc=Q(n)?n:qi[n]||uh(n)),i.push(v),v},e.prototype.prepare=function(t,r){var n=this.keyframes;this._needsSort&&n.sort(function(p,g){return p.time-g.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=qa(i),u=rv(i),f=0;f=0&&!(o[f].percent<=r);f--);f=v(f,s-2)}else{for(f=h;fr);f++);f=v(f-1,s-2)}d=o[f+1],c=o[f]}if(c&&d){this._lastFr=f,this._lastFrP=r;var g=d.percent-c.percent,m=g===0?1:v((r-c.percent)/g,1);d.easingFunc&&(m=d.easingFunc(m));var y=n?this._additiveValue:u?xi:t[l];if((qa(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)t[l]=m<1?c.rawValue:d.rawValue;else if(qa(a))a===Bo?pl(y,c[i],d[i],m):Zb(y,c[i],d[i],m);else if(rv(a)){var _=c[i],b=d[i],S=a===Yu;t[l]={type:S?"linear":"radial",x:rr(_.x,b.x,m),y:rr(_.y,b.y,m),colorStops:$(_.colorStops,function(T,A){var L=b.colorStops[A];return{offset:rr(T.offset,L.offset,m),color:No(pl([],T.color,L.color,m))}}),global:b.global},S?(t[l].x2=rr(_.x2,b.x2,m),t[l].y2=rr(_.y2,b.y2,m)):t[l].r=rr(_.r,b.r,m)}else if(u)pl(y,c[i],d[i],m),n||(t[l]=No(y));else{var x=rr(c[i],d[i],m);n?this._additiveValue=x:t[l]=x}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===Za?t[n]=t[n]+i:r===Vi?(Ce(t[n],xi),Xa(xi,xi,i,1),t[n]=No(xi)):r===Bo?Xa(t[n],t[n],i,1):r===gm&&tv(t[n],t[n],i,1)},e})(),hh=(function(){function e(t,r,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=r,r&&i){$g("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,r,n){return this.whenWithKeys(t,r,st(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,Oo(u),i),this._trackKeys.push(s)}l.addKeyframe(t,Oo(r[s]),i)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var r=t.length,n=0;n0)){this._started=1;for(var r=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e})();function Qn(){return new Date().getTime()}var tS=(function(e){V(t,e);function t(r){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return t.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},t.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},t.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},t.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},t.prototype.update=function(r){for(var n=Qn()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,r||(this.trigger("frame",i),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(Fu(n),!r._paused&&r.update())}Fu(n)},t.prototype.start=function(){this._running||(this._time=Qn(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Qn(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Qn()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(r,n){n=n||{},this.start();var i=new hh(r,n.loop);return this.addAnimator(i),i},t})(fr),eS=300,gl=tt.domSupported,ml=(function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=$(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}})(),nv={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},iv=!1;function Xu(e){var t=e.pointerType;return t==="pen"||t==="touch"}function rS(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function yl(e){e&&(e.zrByTouch=!0)}function nS(e,t){return fe(e.dom,new iS(e,t),!0)}function mm(e,t){for(var r=t,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==t&&r===e.painterRoot);)r=r.parentNode;return n}var iS=(function(){function e(t,r){this.stopPropagation=Yt,this.stopImmediatePropagation=Yt,this.preventDefault=Yt,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e})(),xe={mousedown:function(e){e=fe(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=fe(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=fe(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=fe(this.dom,e);var t=e.toElement||e.relatedTarget;mm(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){iv=!0,e=fe(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){iv||(e=fe(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=fe(this.dom,e),yl(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),xe.mousemove.call(this,e),xe.mousedown.call(this,e)},touchmove:function(e){e=fe(this.dom,e),yl(e),this.handler.processGesture(e,"change"),xe.mousemove.call(this,e)},touchend:function(e){e=fe(this.dom,e),yl(e),this.handler.processGesture(e,"end"),xe.mouseup.call(this,e),+new Date-+this.__lastTouchMomentlv||e<-lv}var Yr=[],kn=[],bl=sr(),Sl=Math.abs,ch=(function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return jr(this.rotation)||jr(this.x)||jr(this.y)||jr(this.scaleX-1)||jr(this.scaleY-1)||jr(this.skewX)||jr(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(sv(n),this.invTransform=null);return}n=n||sr(),r?this.getLocalTransform(n):sv(n),t&&(r?Xi(n,t,n):Qg(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Yr);var n=Yr[0]<0?-1:1,i=Yr[1]<0?-1:1,a=((Yr[0]-n)*r+n)/Yr[0]||0,o=((Yr[1]-i)*r+i)/Yr[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||sr(),Pa(this.invTransform,t)},e.prototype.getComputedTransform=function(){for(var t=this,r=[];t;)r.push(t),t=t.parent;for(;t=r.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(t){var r=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),a=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,r=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||sr(),Xi(kn,t.invTransform,r),r=kn);var n=this.originX,i=this.originY;(n||i)&&(bl[4]=n,bl[5]=i,Xi(kn,r,bl),kn[4]-=n,kn[5]-=i,r=kn),this.setLocalTransform(r)}},e.prototype.getGlobalScale=function(t){var r=this.transform;return t=t||[],r?(t[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),t[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(t[0]=-t[0]),r[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,r){var n=[t,r],i=this.invTransform;return i&&ye(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&ye(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&Sl(t[0]-1)>1e-10&&Sl(t[3]-1)>1e-10?Math.sqrt(Sl(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){is(this,t)},e.getLocalTransform=function(t,r){r=r||[];var n=t.originX||0,i=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,f=t.x,h=t.y,v=t.skewX?Math.tan(t.skewX):0,c=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var d=n+s,p=i+l;r[4]=-d*a-v*p*o,r[5]=-p*o-c*d*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=c*a,r[2]=v*o,u&&lh(r,r,u),r[4]+=n+f,r[5]+=i+h,r},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e})(),ua=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function is(e,t){for(var r=0;r=uv)){e=e||lr;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=kr.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?xl=uv:i>2&&xl++,t}}var xl=0,uv=5;function _m(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=uS(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function We(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=kr.measureText(t,e.font).width,r.put(t,n)),n}function fv(e,t,r,n){var i=We(He(t),e),a=ka(t),o=oi(0,i,r),s=bn(0,a,n),l=new at(o,s,i,a);return l}function bm(e,t,r,n){var i=((e||"")+"").split(` -`),a=i.length;if(a===1)return fv(i[0],t,r,n);for(var o=new at(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function as(e,t,r){var n=t.position||"inside",i=t.distance!=null?t.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,f="left",h="top";if(n instanceof Array)l+=Rr(n[0],r.width),u+=Rr(n[1],r.height),f=null,h=null;else switch(n){case"left":l-=i,u+=s,f="right",h="middle";break;case"right":l+=i+o,u+=s,h="middle";break;case"top":l+=o/2,u-=i,f="center",h="bottom";break;case"bottom":l+=o/2,u+=a+i,f="center";break;case"inside":l+=o/2,u+=s,f="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=o-i,u+=s,f="right",h="middle";break;case"insideTop":l+=o/2,u+=i,f="center";break;case"insideBottom":l+=o/2,u+=a-i,f="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,f="right";break;case"insideBottomLeft":l+=i,u+=a-i,h="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,f="right",h="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=f,e.verticalAlign=h,e}var wl="__zr_normal__",Tl=ua.concat(["ignore"]),fS=vi(ua,function(e,t){return e[t]=!0,e},{ignore:!1}),Rn={},hS=new at(0,0,0,0),Qa=[],Ns=(function(){function e(t){this.id=Yg(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=r,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var r=this._textContent;if(r&&(!r.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;a.copyTransform(r);var f=n.position!=null,h=n.autoOverflowArea,v=void 0;if((h||f)&&(v=hS,n.layoutRect?v.copy(n.layoutRect):v.copy(this.getBoundingRect()),i||v.applyTransform(this.transform)),f){this.calculateTextPosition?this.calculateTextPosition(Rn,n,v):as(Rn,n,v),a.x=Rn.x,a.y=Rn.y,o=Rn.align,s=Rn.verticalAlign;var c=n.origin;if(c&&n.rotation!=null){var d=void 0,p=void 0;c==="center"?(d=v.width*.5,p=v.height*.5):(d=Rr(c[0],v.width),p=Rr(c[1],v.height)),u=!0,a.originX=-a.x+d+(i?0:v.x),a.originY=-a.y+p+(i?0:v.y)}}n.rotation!=null&&(a.rotation=n.rotation);var g=n.offset;g&&(a.x+=g[0],a.y+=g[1],u||(a.originX=-g[0],a.originY=-g[1]));var m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var y=m.overflowRect=m.overflowRect||new at(0,0,0,0);a.getLocalTransform(Qa),Pa(Qa,Qa),at.copy(y,v),y.applyTransform(Qa)}else m.overflowRect=null;var _=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,b=void 0,S=void 0,x=void 0;_&&this.canBeInsideText()?(b=n.insideFill,S=n.insideStroke,(b==null||b==="auto")&&(b=this.getInsideTextFill()),(S==null||S==="auto")&&(S=this.getInsideTextStroke(b),x=!0)):(b=n.outsideFill,S=n.outsideStroke,(b==null||b==="auto")&&(b=this.getOutsideFill()),(S==null||S==="auto")&&(S=this.getOutsideStroke(b),x=!0)),b=b||"#000",(b!==m.fill||S!==m.stroke||x!==m.autoStroke||o!==m.align||s!==m.verticalAlign)&&(l=!0,m.fill=b,m.stroke=S,m.autoStroke=x,m.align=o,m.verticalAlign=s,r.setDefaultTextStyle(m)),r.__dirty|=Be,l&&r.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Qu:Ku},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Ce(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,Ia(n,"rgba")},e.prototype.traverse=function(t,r){},e.prototype.attrKV=function(t,r){t==="textConfig"?this.setTextConfig(r):t==="textContent"?this.setTextContent(r):t==="clipPath"?this.setClipPath(r):t==="extra"?(this.extra=this.extra||{},N(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(Z(t))for(var n=t,i=st(n),a=0;a0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var r=this.states;return r[t]||(r[t]={}),r[t]},e.prototype.clearStates=function(t){this.useState(wl,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===wl,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(ft(s,t)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){$g("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var f=!!(u&&u.hoverLayer||i);f&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,v=this._textGuide;return h&&h.useState(t,r,n,f),v&&v.useState(t,r,n,f),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Be),u}}},e.prototype.useStates=function(t,r,n){if(!t.length)this.clearStates();else{var i=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l0,d);var p=this._textContent,g=this._textGuide;p&&p.useStates(t,r,v),g&&g.useStates(t,r,v),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!v&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Be)}},e.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var r=t.__hostTarget;t=r?t.ignoreHostSilent?null:r:t.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},e.prototype.replaceState=function(t,r,n){var i=this.currentStates.slice(),a=ft(i,t),o=ft(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&i.push(r),this.useStates(i)},e.prototype.toggleState=function(t,r){r?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var r={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,r){for(var n=this.animators,i=n.length,a=[],o=0;o0&&r.during&&a[0].during(function(d,p){r.during(p)});for(var v=0;v0||i.force&&!o.length){var A=void 0,L=void 0,D=void 0;if(s){L={},v&&(A={});for(var b=0;b<_;b++){var m=p[b];L[m]=r[m],v?A[m]=n[m]:r[m]=n[m]}}else if(v){D={};for(var b=0;b<_;b++){var m=p[b];D[m]=Oo(r[m]),vS(r,n,m)}}var S=new hh(r,!1,!1,h?Mt(d,function(I){return I.targetName===t}):null);S.targetName=t,i.scope&&(S.scope=i.scope),v&&A&&S.whenWithKeys(0,A,p),D&&S.whenWithKeys(0,D,p),S.whenWithKeys(u??500,s?L:n,p).delay(f||0),e.addAnimator(S,t),o.push(S)}}var Rt=(function(e){V(t,e);function t(r){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(r){return this._children[r]},t.prototype.childOfName=function(r){for(var n=this._children,i=0;i=0&&(i.splice(a,0,r),this._doAdd(r))}return this},t.prototype.replace=function(r,n){var i=ft(this._children,r);return i>=0&&this.replaceAt(n,i),this},t.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},t.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},t.prototype.remove=function(r){var n=this.__zr,i=this._children,a=ft(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},t.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i"u"&&typeof self<"u"?tt.worker=!0:!tt.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(tt.node=!0,tt.svgSupported=!0):z1(navigator.userAgent,tt);function z1(e,t){var r=t.browser,n=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=t.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}}var th=12,jg="sans-serif",lr=th+"px "+jg,G1=20,V1=100,H1="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function W1(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r=0)s=o*r.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),e.appendChild(o),r.push(o)}return t.clearMarkers=function(){M(r,function(f){f.parentNode&&f.parentNode.removeChild(f)})},r}function db(e,t,r){for(var n=r?"invTrans":"trans",i=t[n],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var f=e[u].getBoundingClientRect(),h=2*u,v=f.left,c=f.top;o.push(v,c),l=l&&a&&v===a[h]&&c===a[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?Fc(s,o):Fc(o,s))}function Kg(e){return e.nodeName.toUpperCase()==="CANVAS"}var pb=/([&<>"'])/g,gb={"&":"&","<":"<",">":">",'"':""","'":"'"};function jt(e){return e==null?"":(e+"").replace(pb,function(t,r){return gb[r]})}var mb=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sl=[],yb=tt.browser.firefox&&+tt.browser.version.split(".")[0]<39;function Eu(e,t,r,n){return r=r||{},n?zc(e,t,r):yb&&t.layerX!=null&&t.layerX!==t.offsetX?(r.zrX=t.layerX,r.zrY=t.layerY):t.offsetX!=null?(r.zrX=t.offsetX,r.zrY=t.offsetY):zc(e,t,r),r}function zc(e,t,r){if(tt.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(Kg(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(Ru(sl,e,n,i)){r.zrX=sl[0],r.zrY=sl[1];return}}r.zrX=r.zrY=0}function oh(e){return e||window.event}function fe(e,t,r){if(t=oh(t),t.zrX!=null)return t;var n=t.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&Eu(e,o,t,r)}else{Eu(e,t,t,r);var a=_b(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&mb.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function _b(e){var t=e.wheelDelta;if(t)return t;var r=e.deltaX,n=e.deltaY;if(r==null||n==null)return t;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function bb(e,t,r,n){e.addEventListener(t,r,n)}function Sb(e,t,r,n){e.removeEventListener(t,r,n)}var Qg=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0},xb=(function(){function e(){this._track=[]}return e.prototype.recognize=function(t,r,n){return this._doTrack(t,r,n),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,r,n){var i=t.touches;if(i){for(var a={points:[],touches:[],target:r,event:t},o=0,s=i.length;o1&&n&&n.length>1){var a=Gc(n)/Gc(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=wb(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function sr(){return[1,0,0,1,0,0]}function sh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Jg(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Xi(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],l=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function Ou(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function lh(e,t,r,n){n===void 0&&(n=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],f=Math.sin(r),h=Math.cos(r);return e[0]=i*h+s*f,e[1]=-i*f+s*h,e[2]=a*h+l*f,e[3]=-a*f+h*l,e[4]=h*(o-n[0])+f*(u-n[1])+n[0],e[5]=h*(u-n[1])-f*(o-n[0])+n[1],e}function Tb(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e}function Pa(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],l=r*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*s-o*i)*l,e[5]=(a*i-r*s)*l,e):null}var pt=(function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,n=this.y-t.y;return Math.sqrt(r*r+n*n)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,n=this.y-t.y;return r*r+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,n=this.y;return this.x=t[0]*r+t[2]*n+t[4],this.y=t[1]*r+t[3]*n+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,n){t.x=r,t.y=n},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,n){t.x=r.x+n.x,t.y=r.y+n.y},e.sub=function(t,r,n){t.x=r.x-n.x,t.y=r.y-n.y},e.scale=function(t,r,n){t.x=r.x*n,t.y=r.y*n},e.scaleAndAdd=function(t,r,n,i){t.x=r.x+n.x*i,t.y=r.y+n.y*i},e.lerp=function(t,r,n,i){var a=1-i;t.x=a*r.x+i*n.x,t.y=a*r.y+i*n.y},e})(),gn=Math.min,Kn=Math.max,Nu=Math.abs,Vc=["x","y"],Cb=["width","height"],Vr=new pt,Hr=new pt,Wr=new pt,jr=new pt,ne=tm(),zi=ne.minTv,Bu=ne.maxTv,Zi=[0,0],at=(function(){function e(t,r,n,i){e.set(this,t,r,n,i)}return e.set=function(t,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),t.x=r,t.y=n,t.width=i,t.height=a,t},e.prototype.union=function(t){var r=gn(t.x,this.x),n=gn(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Kn(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Kn(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=r,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){var r=this,n=t.width/r.width,i=t.height/r.height,a=sr();return Ou(a,a,[-r.x,-r.y]),Tb(a,a,[n,i]),Ou(a,a,[t.x,t.y]),a},e.prototype.intersect=function(t,r,n){return e.intersect(this,t,r,n)},e.intersect=function(t,r,n,i){n&&pt.set(n,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!r)return!1;t instanceof e||(t=e.set(Db,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(Mb,r.x,r.y,r.width,r.height));var s=!!n;ne.reset(i,s);var l=ne.touchThreshold,u=t.x+l,f=t.x+t.width-l,h=t.y+l,v=t.y+t.height-l,c=r.x+l,d=r.x+r.width-l,p=r.y+l,g=r.y+r.height-l;if(u>f||h>v||c>d||p>g)return!1;var m=!(f=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&e.copy(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Vr.x=Wr.x=r.x,Vr.y=jr.y=r.y,Hr.x=jr.x=r.x+r.width,Hr.y=Wr.y=r.y+r.height,Vr.transform(n),jr.transform(n),Hr.transform(n),Wr.transform(n),t.x=gn(Vr.x,Hr.x,Wr.x,jr.x),t.y=gn(Vr.y,Hr.y,Wr.y,jr.y);var l=Kn(Vr.x,Hr.x,Wr.x,jr.x),u=Kn(Vr.y,Hr.y,Wr.y,jr.y);t.width=l-t.x,t.height=u-t.y},e})(),Db=new at(0,0,0,0),Mb=new at(0,0,0,0);function Hc(e,t,r,n,i,a,o,s){var l=Nu(t-r),u=Nu(n-e),f=gn(l,u),h=Vc[i],v=Vc[1-i],c=Cb[i];t=u||!ne.bidirectional)&&(zi[h]=-u,zi[v]=0,ne.useDir&&ne.calcDirMTV())))}function tm(){var e=0,t=new pt,r=new pt,n={minTv:new pt,maxTv:new pt,useDir:!1,dirMinTv:new pt,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=Kn(0,a.touchThreshold)),n.negativeSize=!1,o&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),e=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=n.minTv,o=n.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(e),u=Math.cos(e),f=l*a.y+u*a.x;if(i(f)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(r.x=s*u/f,r.y=s*l/f,i(r.x)&&i(r.y)){o.set(0,0);return}(n.bidirectional||t.dot(r)>0)&&r.len()=0;h--){var v=a[h];v!==i&&!v.ignore&&!v.ignoreCoarsePointer&&(!v.parent||!v.parent.ignoreCoarsePointer)&&(ul.copy(v.getBoundingRect()),v.transform&&ul.applyTransform(v.transform),ul.intersect(f)&&s.push(v))}if(s.length)for(var c=4,d=Math.PI/12,p=Math.PI*2,g=0;g4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function kb(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){for(var n=e,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(t,r))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s?n.ignoreHostSilent?null:s:n.parent}return i?em:!0}return!1}function Wc(e,t,r,n,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=kb(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==em)){t.target=o;break}}}function nm(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var im=32,Si=7;function Rb(e){for(var t=0;e>=im;)t|=e&1,e>>=1;return e+t}function jc(e,t,r,n){var i=t+1;if(i===r)return 1;if(n(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function Eb(e,t,r){for(r--;t>>1,i(a,e[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;u>0;)e[o+u]=e[o+u-1],u--}e[o]=a}}function fl(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(e,t[r+f])>0?o=f+1:l=f}return l}function hl(e,t,r,n,i,a){var o=0,s=0,l=1;if(a(e,t[r+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(e,t[r+f])<0?l=f:o=f+1}return l}function Ob(e,t){var r=Si,n,i,a=0,o=[];n=[],i=[];function s(c,d){n[a]=c,i[a]=d,a+=1}function l(){for(;a>1;){var c=a-2;if(c>=1&&i[c-1]<=i[c]+i[c+1]||c>=2&&i[c-2]<=i[c]+i[c-1])i[c-1]i[c+1])break;f(c)}}function u(){for(;a>1;){var c=a-2;c>0&&i[c-1]=Si||T>=Si);if(A)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),d===1){for(m=0;m=0;m--)e[x+m]=e[S+m];e[b]=o[_];return}for(var T=r;;){var A=0,L=0,D=!1;do if(t(o[_],e[y])<0){if(e[b--]=e[y--],A++,L=0,--d===0){D=!0;break}}else if(e[b--]=o[_--],L++,A=0,--g===1){D=!0;break}while((A|L)=0;m--)e[x+m]=e[S+m];if(d===0){D=!0;break}}if(e[b--]=o[_--],--g===1){D=!0;break}if(L=g-fl(e[y],o,0,g,g-1,t),L!==0){for(b-=L,_-=L,g-=L,x=b+1,S=_+1,m=0;m=Si||L>=Si);if(D)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),g===1){for(b-=d,y-=d,x=b+1,S=y+1,m=d-1;m>=0;m--)e[x+m]=e[S+m];e[b]=o[_]}else{if(g===0)throw new Error;for(S=b-(g-1),m=0;ms&&(l=s),Uc(e,r,r+l,r+a,t),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var Be=1,Gi=2,$n=4,Yc=!1;function cl(){Yc||(Yc=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function $c(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Nb=(function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=$c}return e.prototype.traverse=function(t,r){for(var n=0;n=0&&this._roots.splice(i,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e})(),Fu;Fu=tt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var qi={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)))},elasticOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},elasticInOut:function(e){var t,r=.1,n=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=n/4):t=n*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-qi.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?qi.bounceIn(e*2)*.5:qi.bounceOut(e*2-1)*.5+.5}},Wa=Math.pow,Ar=Math.sqrt,Qo=1e-8,am=1e-4,Xc=Ar(3),ja=1/3,Fe=di(),ve=di(),ni=di();function Tr(e){return e>-Qo&&eQo||e<-Qo}function Nt(e,t,r,n,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*n+3*a*r)}function Zc(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function Jo(e,t,r,n,i,a){var o=n+3*(t-r)-e,s=3*(r-t*2+e),l=3*(t-e),u=e-i,f=s*s-3*o*l,h=s*l-9*o*u,v=l*l-3*s*u,c=0;if(Tr(f)&&Tr(h))if(Tr(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[c++]=d)}else{var p=h*h-4*f*v;if(Tr(p)){var g=h/f,d=-s/o+g,m=-g/2;d>=0&&d<=1&&(a[c++]=d),m>=0&&m<=1&&(a[c++]=m)}else if(p>0){var y=Ar(p),_=f*s+1.5*o*(-h+y),b=f*s+1.5*o*(-h-y);_<0?_=-Wa(-_,ja):_=Wa(_,ja),b<0?b=-Wa(-b,ja):b=Wa(b,ja);var d=(-s-(_+b))/(3*o);d>=0&&d<=1&&(a[c++]=d)}else{var S=(2*f*s-3*o*h)/(2*Ar(f*f*f)),x=Math.acos(S)/3,T=Ar(f),A=Math.cos(x),d=(-s-2*T*A)/(3*o),m=(-s+T*(A+Xc*Math.sin(x)))/(3*o),L=(-s+T*(A-Xc*Math.sin(x)))/(3*o);d>=0&&d<=1&&(a[c++]=d),m>=0&&m<=1&&(a[c++]=m),L>=0&&L<=1&&(a[c++]=L)}}return c}function sm(e,t,r,n,i){var a=6*r-12*t+6*e,o=9*t+3*n-3*e-9*r,s=3*t-3*e,l=0;if(Tr(o)){if(om(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var f=a*a-4*o*s;if(Tr(f))i[0]=-a/(2*o);else if(f>0){var h=Ar(f),u=(-a+h)/(2*o),v=(-a-h)/(2*o);u>=0&&u<=1&&(i[l++]=u),v>=0&&v<=1&&(i[l++]=v)}}return l}function ts(e,t,r,n,i,a){var o=(t-e)*i+e,s=(r-t)*i+t,l=(n-r)*i+r,u=(s-o)*i+o,f=(l-s)*i+s,h=(f-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=f,a[6]=l,a[7]=n}function Bb(e,t,r,n,i,a,o,s,l,u,f){var h,v=.005,c=1/0,d,p,g,m;Fe[0]=l,Fe[1]=u;for(var y=0;y<1;y+=.05)ve[0]=Nt(e,r,i,o,y),ve[1]=Nt(t,n,a,s,y),g=ri(Fe,ve),g=0&&g=0&&u<=1&&(i[l++]=u)}}else{var f=o*o-4*a*s;if(Tr(f)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(f>0){var h=Ar(f),u=(-o+h)/(2*a),v=(-o-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),v>=0&&v<=1&&(i[l++]=v)}}return l}function lm(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function es(e,t,r,n,i){var a=(t-e)*n+e,o=(r-t)*n+t,s=(o-a)*n+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function Gb(e,t,r,n,i,a,o,s,l){var u,f=.005,h=1/0;Fe[0]=o,Fe[1]=s;for(var v=0;v<1;v+=.05){ve[0]=qt(e,r,i,v),ve[1]=qt(t,n,a,v);var c=ri(Fe,ve);c=0&&c=1?1:Jo(0,n,a,1,l,s)&&Nt(0,i,o,1,s[0])}}}var Wb=(function(){function e(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Yt,this.ondestroy=t.ondestroy||Yt,this.onrestart=t.onrestart||Yt,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,r){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,i=t-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Q(t)?t:qi[t]||uh(t)},e})(),um=(function(){function e(t){this.value=t}return e})(),jb=(function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new um(t);return this.insertEntry(r),r},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var r=t.prev,n=t.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e})(),ai=(function(){function e(t){this._list=new jb,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var n=this._list,i=this._map,a=null;if(i[t]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new um(r),s.key=t,n.insertEntry(s),i[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e})(),Kc={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 Lr(e){return e=Math.round(e),e<0?0:e>255?255:e}function zu(e){return e<0?0:e>1?1:e}function vl(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Lr(parseFloat(t)/100*255):Lr(parseInt(t,10))}function _n(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?zu(parseFloat(t)/100):zu(parseFloat(t))}function dl(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function Ua(e,t,r){return e+(t-e)*r}function ue(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function Gu(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var fm=new ai(20),Ya=null;function In(e,t){Ya&&Gu(Ya,t),Ya=fm.put(e,Ya||t.slice())}function Ce(e,t){if(e){t=t||[];var r=fm.get(e);if(r)return Gu(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in Kc)return Gu(t,Kc[n]),In(e,t),t;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){ue(t,0,0,0,1);return}return ue(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),In(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){ue(t,0,0,0,1);return}return ue(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),In(e,t),t}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),f=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?ue(t,+u[0],+u[1],+u[2],1):ue(t,0,0,0,1);f=_n(u.pop());case"rgb":if(u.length>=3)return ue(t,vl(u[0]),vl(u[1]),vl(u[2]),u.length===3?f:_n(u[3])),In(e,t),t;ue(t,0,0,0,1);return;case"hsla":if(u.length!==4){ue(t,0,0,0,1);return}return u[3]=_n(u[3]),Vu(u,t),In(e,t),t;case"hsl":if(u.length!==3){ue(t,0,0,0,1);return}return Vu(u,t),In(e,t),t;default:return}}ue(t,0,0,0,1)}}function Vu(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=_n(e[1]),i=_n(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],ue(t,Lr(dl(o,a,r+1/3)*255),Lr(dl(o,a,r)*255),Lr(dl(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function Ub(e){if(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var f=((a-t)/6+o/2)/o,h=((a-r)/6+o/2)/o,v=((a-n)/6+o/2)/o;t===a?l=v-h:r===a?l=1/3+f-v:n===a&&(l=2/3+h-f),l<0&&(l+=1),l>1&&(l-=1)}var c=[l*360,u,s];return e[3]!=null&&c.push(e[3]),c}}function Qc(e,t){var r=Ce(e);if(r){for(var n=0;n<3;n++)r[n]=r[n]*(1-t)|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Ia(r,r.length===4?"rgba":"rgb")}}function Yb(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=Ce(t[i]),s=Ce(t[a]),l=n-i,u=Ia([Lr(Ua(o[0],s[0],l)),Lr(Ua(o[1],s[1],l)),Lr(Ua(o[2],s[2],l)),zu(Ua(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}function Hu(e,t,r,n){var i=Ce(e);if(e)return i=Ub(i),r!=null&&(i[1]=_n(Q(r)?r(i[1]):r)),n!=null&&(i[2]=_n(Q(n)?n(i[2]):n)),Ia(Vu(i),"rgba")}function Ia(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}}function rs(e,t){var r=Ce(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}var Jc=new ai(100);function Wu(e){if(Y(e)){var t=Jc.get(e);return t||(t=Qc(e,-.1),Jc.put(e,t)),t}else if(nh(e)){var r=N({},e);return r.colorStops=$(e.colorStops,function(n){return{offset:n.offset,color:Qc(n.color,-.1)}}),r}return e}var ns=Math.round;function la(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=Ce(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var tv=1e-4;function Cr(e){return e-tv}function $a(e){return ns(e*1e3)/1e3}function ju(e){return ns(e*1e4)/1e4}function $b(e){return"matrix("+$a(e[0])+","+$a(e[1])+","+$a(e[2])+","+$a(e[3])+","+ju(e[4])+","+ju(e[5])+")"}var Xb={left:"start",right:"end",center:"middle",middle:"middle"};function Zb(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function qb(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function Kb(e){var t=e.style,r=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function hm(e){return e&&!!e.image}function Qb(e){return e&&!!e.svgElement}function fh(e){return hm(e)||Qb(e)}function cm(e){return e.type==="linear"}function vm(e){return e.type==="radial"}function dm(e){return e&&(e.type==="linear"||e.type==="radial")}function Os(e){return"url(#"+e+")"}function pm(e){var t=e.getGlobalScale(),r=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function gm(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*Ro,i=X(e.scaleX,1),a=X(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,l=[];return(t||r)&&l.push("translate("+t+"px,"+r+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+ns(o*Ro)+"deg, "+ns(s*Ro)+"deg)"),l.join(" ")}var Jb=(function(){return tt.hasGlobalWindow&&Q(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<"u"?function(e){return Buffer.from(e).toString("base64")}:function(e){return null}})(),Uu=Array.prototype.slice;function rr(e,t,r){return(t-e)*r+e}function pl(e,t,r,n){for(var i=t.length,a=0;an?t:e,a=Math.min(r,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,r,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=rv,l=r;if(Jt(r)){var u=nS(r);s=u,(u===1&&!vt(r[0])||u===2&&!vt(r[0][0]))&&(o=!0)}else if(vt(r)&&!sa(r))s=Za;else if(Y(r))if(!isNaN(+r))s=Za;else{var f=Ce(r);f&&(l=f,s=Vi)}else if(nh(r)){var h=N({},l);h.colorStops=$(r.colorStops,function(c){return{offset:c.offset,color:Ce(c.color)}}),cm(r)?s=Yu:vm(r)&&(s=$u),l=h}a===0?this.valType=s:(s!==this.valType||s===rv)&&(o=!0),this.discrete=this.discrete||o;var v={time:t,value:l,rawValue:r,percent:0};return n&&(v.easing=n,v.easingFunc=Q(n)?n:qi[n]||uh(n)),i.push(v),v},e.prototype.prepare=function(t,r){var n=this.keyframes;this._needsSort&&n.sort(function(p,g){return p.time-g.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=qa(i),u=nv(i),f=0;f=0&&!(o[f].percent<=r);f--);f=v(f,s-2)}else{for(f=h;fr);f++);f=v(f-1,s-2)}d=o[f+1],c=o[f]}if(c&&d){this._lastFr=f,this._lastFrP=r;var g=d.percent-c.percent,m=g===0?1:v((r-c.percent)/g,1);d.easingFunc&&(m=d.easingFunc(m));var y=n?this._additiveValue:u?xi:t[l];if((qa(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)t[l]=m<1?c.rawValue:d.rawValue;else if(qa(a))a===Bo?pl(y,c[i],d[i],m):tS(y,c[i],d[i],m);else if(nv(a)){var _=c[i],b=d[i],S=a===Yu;t[l]={type:S?"linear":"radial",x:rr(_.x,b.x,m),y:rr(_.y,b.y,m),colorStops:$(_.colorStops,function(T,A){var L=b.colorStops[A];return{offset:rr(T.offset,L.offset,m),color:No(pl([],T.color,L.color,m))}}),global:b.global},S?(t[l].x2=rr(_.x2,b.x2,m),t[l].y2=rr(_.y2,b.y2,m)):t[l].r=rr(_.r,b.r,m)}else if(u)pl(y,c[i],d[i],m),n||(t[l]=No(y));else{var x=rr(c[i],d[i],m);n?this._additiveValue=x:t[l]=x}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===Za?t[n]=t[n]+i:r===Vi?(Ce(t[n],xi),Xa(xi,xi,i,1),t[n]=No(xi)):r===Bo?Xa(t[n],t[n],i,1):r===mm&&ev(t[n],t[n],i,1)},e})(),hh=(function(){function e(t,r,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=r,r&&i){Xg("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,r,n){return this.whenWithKeys(t,r,st(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,Oo(u),i),this._trackKeys.push(s)}l.addKeyframe(t,Oo(r[s]),i)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var r=t.length,n=0;n0)){this._started=1;for(var r=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e})();function Qn(){return new Date().getTime()}var aS=(function(e){V(t,e);function t(r){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return t.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},t.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},t.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},t.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},t.prototype.update=function(r){for(var n=Qn()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,r||(this.trigger("frame",i),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(Fu(n),!r._paused&&r.update())}Fu(n)},t.prototype.start=function(){this._running||(this._time=Qn(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Qn(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Qn()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(r,n){n=n||{},this.start();var i=new hh(r,n.loop);return this.addAnimator(i),i},t})(fr),oS=300,gl=tt.domSupported,ml=(function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=$(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}})(),iv={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},av=!1;function Xu(e){var t=e.pointerType;return t==="pen"||t==="touch"}function sS(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function yl(e){e&&(e.zrByTouch=!0)}function lS(e,t){return fe(e.dom,new uS(e,t),!0)}function ym(e,t){for(var r=t,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==t&&r===e.painterRoot);)r=r.parentNode;return n}var uS=(function(){function e(t,r){this.stopPropagation=Yt,this.stopImmediatePropagation=Yt,this.preventDefault=Yt,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e})(),xe={mousedown:function(e){e=fe(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=fe(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=fe(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=fe(this.dom,e);var t=e.toElement||e.relatedTarget;ym(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){av=!0,e=fe(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){av||(e=fe(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=fe(this.dom,e),yl(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),xe.mousemove.call(this,e),xe.mousedown.call(this,e)},touchmove:function(e){e=fe(this.dom,e),yl(e),this.handler.processGesture(e,"change"),xe.mousemove.call(this,e)},touchend:function(e){e=fe(this.dom,e),yl(e),this.handler.processGesture(e,"end"),xe.mouseup.call(this,e),+new Date-+this.__lastTouchMomentuv||e<-uv}var Yr=[],kn=[],bl=sr(),Sl=Math.abs,ch=(function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return Ur(this.rotation)||Ur(this.x)||Ur(this.y)||Ur(this.scaleX-1)||Ur(this.scaleY-1)||Ur(this.skewX)||Ur(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(lv(n),this.invTransform=null);return}n=n||sr(),r?this.getLocalTransform(n):lv(n),t&&(r?Xi(n,t,n):Jg(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Yr);var n=Yr[0]<0?-1:1,i=Yr[1]<0?-1:1,a=((Yr[0]-n)*r+n)/Yr[0]||0,o=((Yr[1]-i)*r+i)/Yr[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||sr(),Pa(this.invTransform,t)},e.prototype.getComputedTransform=function(){for(var t=this,r=[];t;)r.push(t),t=t.parent;for(;t=r.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(t){var r=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),a=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,r=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||sr(),Xi(kn,t.invTransform,r),r=kn);var n=this.originX,i=this.originY;(n||i)&&(bl[4]=n,bl[5]=i,Xi(kn,r,bl),kn[4]-=n,kn[5]-=i,r=kn),this.setLocalTransform(r)}},e.prototype.getGlobalScale=function(t){var r=this.transform;return t=t||[],r?(t[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),t[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(t[0]=-t[0]),r[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,r){var n=[t,r],i=this.invTransform;return i&&ye(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&ye(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&Sl(t[0]-1)>1e-10&&Sl(t[3]-1)>1e-10?Math.sqrt(Sl(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){is(this,t)},e.getLocalTransform=function(t,r){r=r||[];var n=t.originX||0,i=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,f=t.x,h=t.y,v=t.skewX?Math.tan(t.skewX):0,c=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var d=n+s,p=i+l;r[4]=-d*a-v*p*o,r[5]=-p*o-c*d*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=c*a,r[2]=v*o,u&&lh(r,r,u),r[4]+=n+f,r[5]+=i+h,r},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e})(),ua=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function is(e,t){for(var r=0;r=fv)){e=e||lr;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=kr.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?xl=fv:i>2&&xl++,t}}var xl=0,fv=5;function bm(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=dS(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function We(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=kr.measureText(t,e.font).width,r.put(t,n)),n}function hv(e,t,r,n){var i=We(He(t),e),a=ka(t),o=oi(0,i,r),s=bn(0,a,n),l=new at(o,s,i,a);return l}function Sm(e,t,r,n){var i=((e||"")+"").split(` +`),a=i.length;if(a===1)return hv(i[0],t,r,n);for(var o=new at(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function as(e,t,r){var n=t.position||"inside",i=t.distance!=null?t.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,f="left",h="top";if(n instanceof Array)l+=Rr(n[0],r.width),u+=Rr(n[1],r.height),f=null,h=null;else switch(n){case"left":l-=i,u+=s,f="right",h="middle";break;case"right":l+=i+o,u+=s,h="middle";break;case"top":l+=o/2,u-=i,f="center",h="bottom";break;case"bottom":l+=o/2,u+=a+i,f="center";break;case"inside":l+=o/2,u+=s,f="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=o-i,u+=s,f="right",h="middle";break;case"insideTop":l+=o/2,u+=i,f="center";break;case"insideBottom":l+=o/2,u+=a-i,f="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,f="right";break;case"insideBottomLeft":l+=i,u+=a-i,h="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,f="right",h="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=f,e.verticalAlign=h,e}var wl="__zr_normal__",Tl=ua.concat(["ignore"]),pS=vi(ua,function(e,t){return e[t]=!0,e},{ignore:!1}),Rn={},gS=new at(0,0,0,0),Qa=[],Ns=(function(){function e(t){this.id=$g(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=r,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var r=this._textContent;if(r&&(!r.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;a.copyTransform(r);var f=n.position!=null,h=n.autoOverflowArea,v=void 0;if((h||f)&&(v=gS,n.layoutRect?v.copy(n.layoutRect):v.copy(this.getBoundingRect()),i||v.applyTransform(this.transform)),f){this.calculateTextPosition?this.calculateTextPosition(Rn,n,v):as(Rn,n,v),a.x=Rn.x,a.y=Rn.y,o=Rn.align,s=Rn.verticalAlign;var c=n.origin;if(c&&n.rotation!=null){var d=void 0,p=void 0;c==="center"?(d=v.width*.5,p=v.height*.5):(d=Rr(c[0],v.width),p=Rr(c[1],v.height)),u=!0,a.originX=-a.x+d+(i?0:v.x),a.originY=-a.y+p+(i?0:v.y)}}n.rotation!=null&&(a.rotation=n.rotation);var g=n.offset;g&&(a.x+=g[0],a.y+=g[1],u||(a.originX=-g[0],a.originY=-g[1]));var m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var y=m.overflowRect=m.overflowRect||new at(0,0,0,0);a.getLocalTransform(Qa),Pa(Qa,Qa),at.copy(y,v),y.applyTransform(Qa)}else m.overflowRect=null;var _=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,b=void 0,S=void 0,x=void 0;_&&this.canBeInsideText()?(b=n.insideFill,S=n.insideStroke,(b==null||b==="auto")&&(b=this.getInsideTextFill()),(S==null||S==="auto")&&(S=this.getInsideTextStroke(b),x=!0)):(b=n.outsideFill,S=n.outsideStroke,(b==null||b==="auto")&&(b=this.getOutsideFill()),(S==null||S==="auto")&&(S=this.getOutsideStroke(b),x=!0)),b=b||"#000",(b!==m.fill||S!==m.stroke||x!==m.autoStroke||o!==m.align||s!==m.verticalAlign)&&(l=!0,m.fill=b,m.stroke=S,m.autoStroke=x,m.align=o,m.verticalAlign=s,r.setDefaultTextStyle(m)),r.__dirty|=Be,l&&r.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Qu:Ku},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Ce(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,Ia(n,"rgba")},e.prototype.traverse=function(t,r){},e.prototype.attrKV=function(t,r){t==="textConfig"?this.setTextConfig(r):t==="textContent"?this.setTextContent(r):t==="clipPath"?this.setClipPath(r):t==="extra"?(this.extra=this.extra||{},N(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(Z(t))for(var n=t,i=st(n),a=0;a0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var r=this.states;return r[t]||(r[t]={}),r[t]},e.prototype.clearStates=function(t){this.useState(wl,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===wl,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(ft(s,t)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){Xg("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var f=!!(u&&u.hoverLayer||i);f&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,v=this._textGuide;return h&&h.useState(t,r,n,f),v&&v.useState(t,r,n,f),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Be),u}}},e.prototype.useStates=function(t,r,n){if(!t.length)this.clearStates();else{var i=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l0,d);var p=this._textContent,g=this._textGuide;p&&p.useStates(t,r,v),g&&g.useStates(t,r,v),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!v&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Be)}},e.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var r=t.__hostTarget;t=r?t.ignoreHostSilent?null:r:t.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},e.prototype.replaceState=function(t,r,n){var i=this.currentStates.slice(),a=ft(i,t),o=ft(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&i.push(r),this.useStates(i)},e.prototype.toggleState=function(t,r){r?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var r={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,r){for(var n=this.animators,i=n.length,a=[],o=0;o0&&r.during&&a[0].during(function(d,p){r.during(p)});for(var v=0;v0||i.force&&!o.length){var A=void 0,L=void 0,D=void 0;if(s){L={},v&&(A={});for(var b=0;b<_;b++){var m=p[b];L[m]=r[m],v?A[m]=n[m]:r[m]=n[m]}}else if(v){D={};for(var b=0;b<_;b++){var m=p[b];D[m]=Oo(r[m]),yS(r,n,m)}}var S=new hh(r,!1,!1,h?Mt(d,function(I){return I.targetName===t}):null);S.targetName=t,i.scope&&(S.scope=i.scope),v&&A&&S.whenWithKeys(0,A,p),D&&S.whenWithKeys(0,D,p),S.whenWithKeys(u??500,s?L:n,p).delay(f||0),e.addAnimator(S,t),o.push(S)}}var Rt=(function(e){V(t,e);function t(r){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(r){return this._children[r]},t.prototype.childOfName=function(r){for(var n=this._children,i=0;i=0&&(i.splice(a,0,r),this._doAdd(r))}return this},t.prototype.replace=function(r,n){var i=ft(this._children,r);return i>=0&&this.replaceAt(n,i),this},t.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},t.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},t.prototype.remove=function(r){var n=this.__zr,i=this._children,a=ft(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},t.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},e.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,r){if(!this._disposed)return this.handler.findHover(t,r)},e.prototype.on=function(t,r,n){return this._disposed||this.handler.on(t,r,n),this},e.prototype.off=function(t,r){this._disposed||this.handler.off(t,r)},e.prototype.trigger=function(t,r){this._disposed||this.handler.trigger(t,r)},e.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),r=0;r0){if(e<=i)return o;if(e>=a)return s}else{if(e>=i)return o;if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/l*u+o}var jt=wS;function wS(e,t,r){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%";break}return tf(e,t,r)}function tf(e,t,r){return Y(e)?xS(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function Bt(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),wm),e=(+e).toFixed(t),r?e:+e}function ir(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,r=0;r<15;r++,t*=10)if(Math.round(e*t)/t===e)return r}return TS(e)}function TS(e){var t=e.toString().toLowerCase(),r=t.indexOf("e"),n=r>0?+t.slice(r+1):0,i=r>0?r:t.length,a=t.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function CS(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(Ge(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function DS(e,t){var r=Math.max(ir(e),ir(t)),n=e+t;return r>wm?n:Bt(n,r)}function Tm(e){var t=Math.PI*2;return(e%t+t)%t}function os(e){return e>-cv&&e=10&&t++,t}function Cm(e,t){var r=vh(e),n=Math.pow(10,r),i=e/n,a;return i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10,e=a*n,r>=-20?+e.toFixed(r<0?-r:0):e}function ss(e){var t=parseFloat(e);return t==e&&(t!==0||!Y(e)||e.indexOf("x")<=0)?t:NaN}function LS(e){return!isNaN(ss(e))}function Dm(){return Math.round(Math.random()*9)}function Mm(e,t){return t===0?e:Mm(t,e%t)}function dv(e,t){return e==null?t:t==null?e:e*t/Mm(e,t)}var PS="[ECharts] ",IS=typeof console<"u"&&console.warn&&console.log;function kS(e,t,r){IS&&console[e](PS+t)}function Am(e,t){kS("error",e)}function Kt(e){throw new Error(e)}function pv(e,t,r){return(t-e)*r+e}var Lm="series\0",RS="\0_ec_\0";function $t(e){return e instanceof Array?e:e==null?[]:[e]}function gv(e,t,r){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var n=0,i=r.length;n=0||a&&ft(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var rx=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],nx=ca(rx),ix=(function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return nx(this,t,r)},e})(),ef=new ai(50);function ax(e){if(typeof e=="string"){var t=ef.get(e);return t&&t.image}else return e}function mh(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=ef.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!Fs(t)&&a.pending.push(o)):(t=kr.loadImage(e,yv,yv),t.__zrImageSrc=e,ef.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function yv(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var f=We(o,r);return f>l&&(r="",f=0),l=e-f,i.ellipsis=r,i.ellipsisWidth=f,i.contentWidth=l,i.containerWidth=e,i}function Om(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=We(a,t);if(o<=n){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){t+=r.ellipsis;break}var l=s===0?sx(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=We(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function sx(e,t,r){for(var n=0,i=0,a=e.length;ig&&c){var _=Math.floor(g/v);d=d||m.length>_,m=m.slice(0,_),y=m.length*v}if(i&&f&&p!=null)for(var b=Em(p,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),S={},x=0;xd&&Ll(a,o.substring(d,g),t,c),Ll(a,p[2],t,c,p[1]),d=Al.lastIndex}dh){var B=a.lines.length;I>0?(L.tokens=L.tokens.slice(0,I),T(L,C,D),a.lines=a.lines.slice(0,A+1)):a.lines=a.lines.slice(0,A),a.isTruncated=a.isTruncated||a.lines.length0&&d+n.accumWidth>n.width&&(f=t.split(` -`),u=!0),n.accumWidth=d}else{var p=Nm(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=p.accumWidth+c,h=p.linesWidths,f=p.lines}}f||(f=t.split(` -`));for(var g=He(l),m=0;m=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var vx=vi(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function dx(e){return cx(e)?!!vx[e]:!0}function Nm(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,f=0,h=He(t),v=0;vr:i+f+d>r){f?(s||l)&&(p?(s||(s=l,l="",u=0,f=u),a.push(s),o.push(f-u),l+=c,u+=d,s="",f=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(f),s=c,f=d)):p?(a.push(l),o.push(u),l=c,u=d):(a.push(c),o.push(d));continue}f+=d,p?(l+=c,u+=d):(l&&(s+=l,l="",u=0),s+=c)}return l&&(s+=l),s&&(a.push(s),o.push(f)),a.length===1&&(f+=i),{accumWidth:f,lines:a,linesWidths:o}}function bv(e,t,r,n,i,a){if(e.baseX=r,e.baseY=n,e.outerWidth=e.outerHeight=null,!!t){var o=t.width*2,s=t.height*2;at.set(Sv,oi(r,o,i),bn(n,s,a),o,s),at.intersect(t,Sv,null,xv);var l=xv.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=oi(l.x,l.width,i,!0),e.baseY=bn(l.y,l.height,a,!0)}}var Sv=new at(0,0,0,0),xv={outIntersectRect:{},clamp:!0};function yh(e){return e!=null?e+="":e=""}function px(e){var t=yh(e.text),r=e.font,n=We(He(r),t),i=ka(r);return rf(e,n,i,null)}function rf(e,t,r,n){var i=new at(oi(e.x||0,t,e.textAlign),bn(e.y||0,r,e.textBaseline),t,r),a=n??(Bm(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Bm(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var nf="__zr_style_"+Math.round(Math.random()*10),Sn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},zs={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Sn[nf]=!0;var wv=["z","z2","invisible"],gx=["invisible"],Oa=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=st(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(Ja[0]=Rl(i)*r+e,Ja[1]=kl(i)*n+t,to[0]=Rl(a)*r+e,to[1]=kl(a)*n+t,u(s,Ja,to),f(l,Ja,to),i=i%Xr,i<0&&(i=i+Xr),a=a%Xr,a<0&&(a=a+Xr),i>a&&!o?a+=Xr:ii&&(eo[0]=Rl(c)*r+e,eo[1]=kl(c)*n+t,u(s,eo,s),f(l,eo,l))}var ut={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Zr=[],qr=[],Ie=[],cr=[],ke=[],Re=[],El=Math.min,Ol=Math.max,Kr=Math.cos,Qr=Math.sin,Qe=Math.abs,af=Math.PI,Sr=af*2,Nl=typeof Float32Array<"u",wi=[];function Bl(e){var t=Math.round(e/af*1e8)/1e8;return t%2*af}function Sx(e,t){var r=Bl(e[0]);r<0&&(r+=Sr);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=Sr?i=r+Sr:t&&r-i>=Sr?i=r-Sr:!t&&r>i?i=r+(Sr-Bl(r-i)):t&&r0&&(this._ux=Qe(n/ov/t)||0,this._uy=Qe(n/ov/r)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,r){return this._drawPendingPt(),this.addData(ut.M,t,r),this._ctx&&this._ctx.moveTo(t,r),this._x0=t,this._y0=r,this._xi=t,this._yi=r,this},e.prototype.lineTo=function(t,r){var n=Qe(t-this._xi),i=Qe(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(ut.L,t,r),this._ctx&&a&&this._ctx.lineTo(t,r),a)this._xi=t,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=r,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){return this._drawPendingPt(),this.addData(ut.C,t,r,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(t,r,n,i,a,o),this._xi=a,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,r,n,i){return this._drawPendingPt(),this.addData(ut.Q,t,r,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,r,n,i),this._xi=n,this._yi=i,this},e.prototype.arc=function(t,r,n,i,a,o){this._drawPendingPt(),wi[0]=i,wi[1]=a,Sx(wi,o),i=wi[0],a=wi[1];var s=a-i;return this.addData(ut.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=Kr(a)*n+t,this._yi=Qr(a)*n+r,this},e.prototype.arcTo=function(t,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,r,n,i,a),this},e.prototype.rect=function(t,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,r,n,i),this.addData(ut.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(ut.Z);var t=this._ctx,r=this._x0,n=this._y0;return t&&t.closePath(),this._xi=r,this._yi=n,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){if(this._saveData){var r=t.length;!(this.data&&this.data.length===r)&&Nl&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sf.length&&(this._expandData(),f=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],r=0;r11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){Ie[0]=Ie[1]=ke[0]=ke[1]=Number.MAX_VALUE,cr[0]=cr[1]=Re[0]=Re[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Qe(_)>i||v===r-1)&&(p=Math.sqrt(y*y+_*_),a=g,o=m);break}case ut.C:{var b=t[v++],S=t[v++],g=t[v++],m=t[v++],x=t[v++],T=t[v++];p=Rb(a,o,b,S,g,m,x,T,10),a=x,o=T;break}case ut.Q:{var b=t[v++],S=t[v++],g=t[v++],m=t[v++];p=Nb(a,o,b,S,g,m,10),a=g,o=m;break}case ut.A:var A=t[v++],L=t[v++],D=t[v++],C=t[v++],I=t[v++],P=t[v++],k=P+I;v+=1,d&&(s=Kr(I)*D+A,l=Qr(I)*C+L),p=Ol(D,C)*El(Sr,Math.abs(P)),a=Kr(k)*D+A,o=Qr(k)*C+L;break;case ut.R:{s=a=t[v++],l=o=t[v++];var R=t[v++],E=t[v++];p=R*2+E*2;break}case ut.Z:{var y=s-a,_=l-o;p=Math.sqrt(y*y+_*_),a=s,o=l;break}}p>=0&&(u[h++]=p,f+=p)}return this._pathLen=f,f},e.prototype.rebuildPath=function(t,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,f,h,v,c=r<1,d,p,g=0,m=0,y,_=0,b,S;if(!(c&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,p=this._pathLen,y=r*p,!y)))t:for(var x=0;x0&&(t.lineTo(b,S),_=0),T){case ut.M:s=u=n[x++],l=f=n[x++],t.moveTo(u,f);break;case ut.L:{h=n[x++],v=n[x++];var L=Qe(h-u),D=Qe(v-f);if(L>i||D>a){if(c){var C=d[m++];if(g+C>y){var I=(y-g)/C;t.lineTo(u*(1-I)+h*I,f*(1-I)+v*I);break t}g+=C}t.lineTo(h,v),u=h,f=v,_=0}else{var P=L*L+D*D;P>_&&(b=h,S=v,_=P)}break}case ut.C:{var k=n[x++],R=n[x++],E=n[x++],W=n[x++],O=n[x++],B=n[x++];if(c){var C=d[m++];if(g+C>y){var I=(y-g)/C;ts(u,k,E,O,I,Zr),ts(f,R,W,B,I,qr),t.bezierCurveTo(Zr[1],qr[1],Zr[2],qr[2],Zr[3],qr[3]);break t}g+=C}t.bezierCurveTo(k,R,E,W,O,B),u=O,f=B;break}case ut.Q:{var k=n[x++],R=n[x++],E=n[x++],W=n[x++];if(c){var C=d[m++];if(g+C>y){var I=(y-g)/C;es(u,k,E,I,Zr),es(f,R,W,I,qr),t.quadraticCurveTo(Zr[1],qr[1],Zr[2],qr[2]);break t}g+=C}t.quadraticCurveTo(k,R,E,W),u=E,f=W;break}case ut.A:var j=n[x++],U=n[x++],z=n[x++],G=n[x++],J=n[x++],ot=n[x++],Ft=n[x++],se=!n[x++],Xt=z>G?z:G,Pt=Qe(z-G)>.001,Tt=J+ot,K=!1;if(c){var C=d[m++];g+C>y&&(Tt=J+ot*(y-g)/C,K=!0),g+=C}if(Pt&&t.ellipse?t.ellipse(j,U,z,G,Ft,J,Tt,se):t.arc(j,U,Xt,J,Tt,se),K)break t;A&&(s=Kr(J)*z+j,l=Qr(J)*G+U),u=Kr(Tt)*z+j,f=Qr(Tt)*G+U;break;case ut.R:s=u=n[x],l=f=n[x+1],h=n[x++],v=n[x++];var nt=n[x++],_e=n[x++];if(c){var C=d[m++];if(g+C>y){var Dt=y-g;t.moveTo(h,v),t.lineTo(h+El(Dt,nt),v),Dt-=nt,Dt>0&&t.lineTo(h+nt,v+El(Dt,_e)),Dt-=_e,Dt>0&&t.lineTo(h+Ol(nt-Dt,0),v+_e),Dt-=nt,Dt>0&&t.lineTo(h,v+Ol(_e-Dt,0));break t}g+=C}t.rect(h,v,nt,_e);break;case ut.Z:if(c){var C=d[m++];if(g+C>y){var I=(y-g)/C;t.lineTo(u*(1-I)+s*I,f*(1-I)+l*I);break t}g+=C}t.closePath(),u=s,f=l}}},e.prototype.clone=function(){var t=new e,r=this.data;return t.data=r.slice?r.slice():Array.prototype.slice.call(r),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=ut,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e})();function En(e,t,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=e;if(o>t+s&&o>n+s||oe+s&&a>r+s||at+h&&f>n+h&&f>a+h&&f>s+h||fe+h&&u>r+h&&u>i+h&&u>o+h||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||f+ui&&(i+=Ti);var v=Math.atan2(l,s);return v<0&&(v+=Ti),v>=n&&v<=i||v+Ti>=n&&v+Ti<=i}function Jr(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var vr=Er.CMD,tn=Math.PI*2,Dx=1e-4;function Mx(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&Ax(),c=Nt(t,n,a,s,ce[0]),v>1&&(d=Nt(t,n,a,s,ce[1]))),v===2?gt&&s>n&&s>a||s=0&&u<=1){for(var f=0,h=qt(t,n,a,u),v=0;vr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Ht[0]=-l,Ht[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=tn-1e-4){n=0,i=tn;var f=a?1:-1;return o>=Ht[0]+e&&o<=Ht[1]+e?f:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=tn,i+=tn);for(var v=0,c=0;c<2;c++){var d=Ht[c];if(d+e>o){var p=Math.atan2(s,d),f=a?1:-1;p<0&&(p=tn+p),(p>=n&&p<=i||p+tn>=n&&p+tn<=i)&&(p>Math.PI/2&&p1&&(r||(s+=Jr(l,u,f,h,n,i))),g&&(l=a[d],u=a[d+1],f=l,h=u),p){case vr.M:f=a[d++],h=a[d++],l=f,u=h;break;case vr.L:if(r){if(En(l,u,a[d],a[d+1],t,n,i))return!0}else s+=Jr(l,u,a[d],a[d+1],n,i)||0;l=a[d++],u=a[d++];break;case vr.C:if(r){if(xx(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],t,n,i))return!0}else s+=Lx(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],n,i)||0;l=a[d++],u=a[d++];break;case vr.Q:if(r){if(Tx(l,u,a[d++],a[d++],a[d],a[d+1],t,n,i))return!0}else s+=Px(l,u,a[d++],a[d++],a[d],a[d+1],n,i)||0;l=a[d++],u=a[d++];break;case vr.A:var m=a[d++],y=a[d++],_=a[d++],b=a[d++],S=a[d++],x=a[d++];d+=1;var T=!!(1-a[d++]);v=Math.cos(S)*_+m,c=Math.sin(S)*b+y,g?(f=v,h=c):s+=Jr(l,u,v,c,n,i);var A=(n-m)*b/_+m;if(r){if(Cx(m,y,b,S,S+x,T,t,A,i))return!0}else s+=Ix(m,y,b,S,S+x,T,A,i);l=Math.cos(S+x)*_+m,u=Math.sin(S+x)*b+y;break;case vr.R:f=l=a[d++],h=u=a[d++];var L=a[d++],D=a[d++];if(v=f+L,c=h+D,r){if(En(f,h,v,h,t,n,i)||En(v,h,v,c,t,n,i)||En(v,c,f,c,t,n,i)||En(f,c,f,h,t,n,i))return!0}else s+=Jr(v,h,v,c,n,i),s+=Jr(f,c,f,h,n,i);break;case vr.Z:if(r){if(En(l,u,f,h,t,n,i))return!0}else s+=Jr(l,u,f,h,n,i);l=f,u=h;break}}return!r&&!Mx(u,h)&&(s+=Jr(l,u,f,h,n,i)||0),s!==0}function kx(e,t,r){return Fm(e,0,!1,t,r)}function Rx(e,t,r,n){return Fm(e,t,!0,r,n)}var ls=dt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Sn),Ex={style:dt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},zs.style)},Fl=ua.concat(["invisible","culling","z","z2","zlevel","parent"]),ht=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype.update=function(){var r=this;e.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?Ku:n>.2?lS:Qu}else if(r)return Qu}return Ku},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(Y(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=rs(r,0)0))},t.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},t.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&$n)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var f=this.strokeContainThreshold;u=Math.max(u,f??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 r},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),Rx(s,l/u,r,n)))return!0}if(this.hasFill())return kx(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=$n,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(r){return this.animate("shape",r)},t.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):e.prototype.attrKV.call(this,r,n)},t.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:N(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&$n)},t.prototype.createStyle=function(r){return Es(ls,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=N({},this.shape))},t.prototype._applyStateObj=function(r,n,i,a,o,s){e.prototype._applyStateObj.call(this,r,n,i,a,o,s);var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=N({},i.shape),N(u,n.shape)):(u=N({},a?this.shape:i.shape),N(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=N({},this.shape);for(var f={},h=st(u),v=0;vi&&(h=s+l,s*=i/h,l*=i/h),u+f>i&&(h=u+f,u*=i/h,f*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+f>a&&(h=s+f,s*=a/h,f*=a/h),e.moveTo(r+s,n),e.lineTo(r+i-l,n),l!==0&&e.arc(r+i-l,n+l,l,-Math.PI/2,0),e.lineTo(r+i,n+a-u),u!==0&&e.arc(r+i-u,n+a-u,u,0,Math.PI/2),e.lineTo(r+f,n+a),f!==0&&e.arc(r+f,n+a-f,f,Math.PI/2,Math.PI),e.lineTo(r,n+s),s!==0&&e.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var Jn=Math.round;function zm(e,t,r){if(t){var n=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=n,e.x2=i,e.y1=a,e.y2=o;var s=r&&r.lineWidth;return s&&(Jn(n*2)===Jn(i*2)&&(e.x1=e.x2=mn(n,s,!0)),Jn(a*2)===Jn(o*2)&&(e.y1=e.y2=mn(a,s,!0))),e}}function Gm(e,t,r){if(t){var n=t.x,i=t.y,a=t.width,o=t.height;e.x=n,e.y=i,e.width=a,e.height=o;var s=r&&r.lineWidth;return s&&(e.x=mn(n,s,!0),e.y=mn(i,s,!0),e.width=Math.max(mn(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(mn(i+o,s,!1)-e.y,o===0?0:1)),e}}function mn(e,t,r){if(!t)return e;var n=Jn(e*2);return(n+Jn(t))%2===0?n/2:(n+(r?1:-1))/2}var Gx=(function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e})(),Vx={},wt=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Gx},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=Gm(Vx,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?zx(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t})(ht);wt.prototype.type="rect";var Av={fill:"#000"},Lv=2,Ee={},Hx={style:dt({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},zs.style)},ee=(function(e){V(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Av,n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,I=0;I=0&&(k=x[P],k.align==="right");)this._placeToken(k,r,A,m,I,"right",_),L-=k.width,I-=k.width,P--;for(C+=(f-(C-g)-(y-I)-L)/2;D<=P;)k=x[D],this._placeToken(k,r,A,m,C+k.width/2,"center",_),C+=k.width,D++;m+=A}},t.prototype._placeToken=function(r,n,i,a,o,s,l){var u=n.rich[r.styleName]||{};u.text=r.text;var f=r.verticalAlign,h=a+i/2;f==="top"?h=a+r.height/2:f==="bottom"&&(h=a+i-r.height/2);var v=!r.isLineHolder&&zl(u);v&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var c=!!u.backgroundColor,d=r.textPadding;d&&(o=Ov(o,s,d),h-=r.height/2-d[0]-r.innerHeight/2);var p=this._getOrCreateChild(va),g=p.createStyle();p.useStyle(g);var m=this._defaultStyle,y=!1,_=0,b=!1,S=Ev("fill"in u?u.fill:"fill"in n?n.fill:(y=!0,m.fill)),x=Rv("stroke"in u?u.stroke:"stroke"in n?n.stroke:!c&&!l&&(!m.autoStroke||y)?(_=Lv,b=!0,m.stroke):null),T=u.textShadowBlur>0||n.textShadowBlur>0;g.text=r.text,g.x=o,g.y=h,T&&(g.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,g.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",g.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,g.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=r.font||lr,g.opacity=ei(u.opacity,n.opacity,1),Iv(g,u),x&&(g.lineWidth=ei(u.lineWidth,n.lineWidth,_),g.lineDash=X(u.lineDash,n.lineDash),g.lineDashOffset=n.lineDashOffset||0,g.stroke=x),S&&(g.fill=S),p.setBoundingRect(rf(g,r.contentWidth,r.contentHeight,b?0:null))},t.prototype._renderBackground=function(r,n,i,a,o,s){var l=r.backgroundColor,u=r.borderWidth,f=r.borderColor,h=l&&l.image,v=l&&!h,c=r.borderRadius,d=this,p,g;if(v||r.lineHeight||u&&f){p=this._getOrCreateChild(wt),p.useStyle(p.createStyle()),p.style.fill=null;var m=p.shape;m.x=i,m.y=a,m.width=o,m.height=s,m.r=c,p.dirtyShape()}if(v){var y=p.style;y.fill=l||null,y.fillOpacity=X(r.fillOpacity,1)}else if(h){g=this._getOrCreateChild(qe),g.onload=function(){d.dirtyStyle()};var _=g.style;_.image=l.image,_.x=i,_.y=a,_.width=o,_.height=s}if(u&&f){var y=p.style;y.lineWidth=u,y.stroke=f,y.strokeOpacity=X(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var b=(p||g).style;b.shadowBlur=r.shadowBlur||0,b.shadowColor=r.shadowColor||"transparent",b.shadowOffsetX=r.shadowOffsetX||0,b.shadowOffsetY=r.shadowOffsetY||0,b.opacity=ei(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return Hm(r)&&(n=[r.fontStyle,r.fontWeight,Vm(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&ze(n)||r.textFont||r.font},t})(Oa),Wx={left:!0,right:1,center:1},Ux={top:1,bottom:1,middle:1},Pv=["fontStyle","fontWeight","fontSize","fontFamily"];function Vm(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?th+"px":e+"px"}function Iv(e,t){for(var r=0;r=0,a=!1;if(e instanceof ht){var o=Wm(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(On(s)||On(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=N({},n),u=N({},u),u.fill=s):!On(u.fill)&&On(s)?(a=!0,n=N({},n),u=N({},u),u.fill=Wu(s)):!On(u.stroke)&&On(l)&&(a||(n=N({},n),u=N({},u)),u.stroke=Wu(l)),n.style=u}}if(n&&n.z2==null){a||(n=N({},n));var f=e.z2EmphasisLift;n.z2=e.z2+(f??$x)}return n}function Jx(e,t,r){if(r&&r.z2==null){r=N({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??Xx)}return r}function tw(e,t,r){var n=ft(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:Kx(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=N({},r),o=N({opacity:n?i:a.opacity*.1},o),r.style=o),r}function Gl(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return Qx(this,e,t,r);if(e==="blur")return tw(this,e,r);if(e==="select")return Jx(this,e,r)}return r}function ew(e){e.stateProxy=Gl;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=Gl),r&&(r.stateProxy=Gl)}function Hv(e,t){!qm(e,t)&&!e.__highByOuter&&hr(e,Um)}function Wv(e,t){!qm(e,t)&&!e.__highByOuter&&hr(e,jm)}function hs(e,t){e.__highByOuter|=1<<(t||0),hr(e,Um)}function cs(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&hr(e,jm)}function rw(e){hr(e,xh)}function $m(e){hr(e,Ym)}function Xm(e){hr(e,Zx)}function Zm(e){hr(e,qx)}function qm(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Km(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=_h(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){Ym(u)}),s&&r.push(a)),o.isBlured=!1}),M(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function sf(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,f){for(var h=0;h0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function uf(e,t,r){Qm(e,!0),hr(e,ew),uw(e,t,r)}function lw(e){Qm(e,!1)}function vs(e,t,r,n){n?lw(e):uf(e,t,r)}function uw(e,t,r){var n=lt(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var jv=["emphasis","blur","select"],fw={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function ff(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=Vl(d),s*=Vl(d));var p=(i===a?-1:1)*Vl((o*o*(s*s)-o*o*(c*c)-s*s*(v*v))/(o*o*(c*c)+s*s*(v*v)))||0,g=p*o*c/s,m=p*-s*v/o,y=(e+r)/2+io(h)*g-no(h)*m,_=(t+n)/2+no(h)*g+io(h)*m,b=Zv([1,0],[(v-g)/o,(c-m)/s]),S=[(v-g)/o,(c-m)/s],x=[(-1*v-g)/o,(-1*c-m)/s],T=Zv(S,x);if(vf(S,x)<=-1&&(T=Ci),vf(S,x)>=1&&(T=0),T<0){var A=Math.round(T/Ci*1e6)/1e6;T=Ci*2+A%2*Ci}f.addData(u,y,_,o,s,b,T,h,a)}var gw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,mw=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function yw(e){var t=new Er;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=Er.CMD,l=e.match(gw);if(!l)return t;for(var u=0;uk*k+R*R&&(A=D,L=C),{cx:A,cy:L,x0:-f,y0:-h,x1:A*(i/S-1),y1:L*(i/S-1)}}function Dw(e){var t;if(H(e)){var r=e.length;if(!r)return e;r===1?t=[e[0],e[0],0,0]:r===2?t=[e[0],e[0],e[1],e[1]]:r===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function Mw(e,t){var r,n=Hi(t.r,0),i=Hi(t.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var f=t.cx,h=t.cy,v=!!t.clockwise,c=Kv(u-l),d=c>Hl&&c%Hl;if(d>Se&&(c=d),!(n>Se))e.moveTo(f,h);else if(c>Hl-Se)e.moveTo(f+n*Bn(l),h+n*en(l)),e.arc(f,h,n,l,u,!v),i>Se&&(e.moveTo(f+i*Bn(u),h+i*en(u)),e.arc(f,h,i,u,l,v));else{var p=void 0,g=void 0,m=void 0,y=void 0,_=void 0,b=void 0,S=void 0,x=void 0,T=void 0,A=void 0,L=void 0,D=void 0,C=void 0,I=void 0,P=void 0,k=void 0,R=n*Bn(l),E=n*en(l),W=i*Bn(u),O=i*en(u),B=c>Se;if(B){var j=t.cornerRadius;j&&(r=Dw(j),p=r[0],g=r[1],m=r[2],y=r[3]);var U=Kv(n-i)/2;if(_=Oe(U,m),b=Oe(U,y),S=Oe(U,p),x=Oe(U,g),L=T=Hi(_,b),D=A=Hi(S,x),(T>Se||A>Se)&&(C=n*Bn(u),I=n*en(u),P=i*Bn(l),k=i*en(l),cSe){var Pt=Oe(m,L),Tt=Oe(y,L),K=ao(P,k,R,E,n,Pt,v),nt=ao(C,I,W,O,n,Tt,v);e.moveTo(f+K.cx+K.x0,h+K.cy+K.y0),L0&&e.arc(f+K.cx,h+K.cy,Pt,zt(K.y0,K.x0),zt(K.y1,K.x1),!v),e.arc(f,h,n,zt(K.cy+K.y1,K.cx+K.x1),zt(nt.cy+nt.y1,nt.cx+nt.x1),!v),Tt>0&&e.arc(f+nt.cx,h+nt.cy,Tt,zt(nt.y1,nt.x1),zt(nt.y0,nt.x0),!v))}else e.moveTo(f+R,h+E),e.arc(f,h,n,l,u,!v);if(!(i>Se)||!B)e.lineTo(f+W,h+O);else if(D>Se){var Pt=Oe(p,D),Tt=Oe(g,D),K=ao(W,O,C,I,i,-Tt,v),nt=ao(R,E,P,k,i,-Pt,v);e.lineTo(f+K.cx+K.x0,h+K.cy+K.y0),D0&&e.arc(f+K.cx,h+K.cy,Tt,zt(K.y0,K.x0),zt(K.y1,K.x1),!v),e.arc(f,h,i,zt(K.cy+K.y1,K.cx+K.x1),zt(nt.cy+nt.y1,nt.cx+nt.x1),v),Pt>0&&e.arc(f+nt.cx,h+nt.cy,Pt,zt(nt.y1,nt.x1),zt(nt.y0,nt.x0),!v))}else e.lineTo(f+W,h+O),e.arc(f,h,i,u,l,v)}e.closePath()}}}var Aw=(function(){function e(){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 e})(),gi=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Aw},t.prototype.buildPath=function(r,n){Mw(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t})(ht);gi.prototype.type="sector";var Lw=(function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e})(),Ch=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Lw},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,o,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,o,!0)},t})(ht);Ch.prototype.type="ring";function Pw(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,f,h;if(n){f=[1/0,1/0],h=[-1/0,-1/0];for(var v=0,c=e.length;v=2){if(n){var a=Pw(i,n,r,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],f=i[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],f[0],f[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,h=i.length;snn[1]){if(a=!1,kt.negativeSize||n)return a;var l=oo(nn[0]-rn[1]),u=oo(rn[0]-nn[1]);Wl(l,u)>lo.len()&&(l=u||!kt.bidirectional)&&(pt.scale(so,s,-u*i),kt.useDir&&kt.calcDirMTV()))}}return a},e.prototype._getProjMinMaxOnAxis=function(t,r,n){for(var i=this._axes[t],a=this._origin,o=r[0].dot(i)+a[t],s=o,l=o,u=1;u0){var h=f.duration,v=f.delay,c=f.easing,d={duration:h,delay:v||0,easing:c,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,d):t.animateTo(r,d)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function ae(e,t,r,n,i,a){Lh("update",e,t,r,n,i,a)}function ur(e,t,r,n,i,a){Lh("enter",e,t,r,n,i,a)}function Ji(e){if(!e.__zr)return!0;for(var t=0;tGe(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function td(e){return!e.isGroup}function Qw(e){return e.shape!=null}function cy(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){td(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return Qw(o)&&(s.shape=it(o.shape)),s}var a=n(e);t.traverse(function(o){if(td(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),ae(o,l,r,lt(o).dataIndex)}}})}function Jw(e,t){return $(e,function(r){var n=r[0];n=ie(n,t.x),n=fa(n,t.x+t.width);var i=r[1];return i=ie(i,t.y),i=fa(i,t.y+t.height),[n,i]})}function tT(e,t){var r=ie(e.x,t.x),n=fa(e.x+e.width,t.x+t.width),i=ie(e.y,t.y),a=fa(e.y+e.height,t.y+t.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function kh(e,t,r){var n=N({rectHover:!0},t),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},e)return e.indexOf("image://")===0?(i.image=e.slice(8),dt(i,r),new qe(n)):Ph(e.replace("path://",""),n,r,"center")}function eT(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var g=Ul(c,d,f,h)/v;return!(g<0||g>1)}function Ul(e,t,r,n){return e*n-r*t}function rT(e){return e<=1e-6&&e>=-1e-6}function ps(e,t,r,n,i){return t==null||(vt(t)?mt[0]=mt[1]=mt[2]=mt[3]=t:(mt[0]=t[0],mt[1]=t[1],mt[2]=t[2],mt[3]=t[3]),n&&(mt[0]=ie(0,mt[0]),mt[1]=ie(0,mt[1]),mt[2]=ie(0,mt[2]),mt[3]=ie(0,mt[3])),r&&(mt[0]=-mt[0],mt[1]=-mt[1],mt[2]=-mt[2],mt[3]=-mt[3]),ed(e,mt,"x","width",3,1,i&&i[0]||0),ed(e,mt,"y","height",0,2,i&&i[1]||0)),e}var mt=[0,0,0,0];function ed(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=ie(0,fa(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:Ge(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function js(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=Y(t)?{formatter:t}:t,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=e.formatterParamsExtra;l&&M(st(l),function(f){Te(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=lt(e.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:dt({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function pf(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function Ys(e,t){if(e)if(H(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function py(e,t,r){gy(e,t,r,-1/0)}function gy(e,t,r,n){if(e.ignoreModelZ)return n;var i=e.getTextContent(),a=e.getTextGuideLine(),o=e.isGroup;if(o)for(var s=e.childrenRef(),l=0;l=0&&s.push(l)}),s}}function _y(e,t){return yt(yt({},e,!0),t,!0)}const _T={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:". "}}}},bT={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 gs="ZH",Oh="EN",ii=Oh,Ho={},Nh={},by=tt.domSupported?(function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ii).toUpperCase();return e.indexOf(gs)>-1?gs:ii})():ii;function Sy(e,t){e=e.toUpperCase(),Nh[e]=new _t(t),Ho[e]=t}function ST(e){if(Y(e)){var t=Ho[e.toUpperCase()]||{};return e===gs||e===Oh?it(t):yt(it(t),it(Ho[ii]),!1)}else return yt(it(e),it(Ho[ii]),!1)}function xT(e){return Nh[e]}function wT(){return Nh[ii]}Sy(Oh,_T);Sy(gs,bT);var TT=null;function ms(){return TT}var Bh=1e3,Fh=Bh*60,ta=Fh*60,me=ta*24,ld=me*365,CT={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})/},Wo={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},DT="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",fo="{yyyy}-{MM}-{dd}",ud={year:"{yyyy}",month:"{yyyy}-{MM}",day:fo,hour:fo+" "+Wo.hour,minute:fo+" "+Wo.minute,second:fo+" "+Wo.second,millisecond:DT},wn=["year","month","day","hour","minute","second","millisecond"],MT=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function AT(e){return!Y(e)&&!Q(e)?LT(e):e}function LT(e){e=e||{};var t={},r=!0;return M(wn,function(n){r&&(r=e[n]==null)}),M(wn,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=wn[s],u=Z(a)&&!H(a)?a[l]:a,f=void 0;H(u)?(f=u.slice(),o=f[0]||""):Y(u)?(o=u,f=[o]):(o==null?o=Wo[n]:CT[l].test(o)||(o=t[l][l][0]+" "+o),f=[o],r&&(f[1]="{primary|"+o+"}")),t[n][l]=f}}),t}function dr(e,t){return e+="","0000".substr(0,t-e.length)+e}function ea(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function PT(e){return e===ea(e)}function IT(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Qs(e,t,r,n){var i=pi(e),a=i[xy(r)](),o=i[zh(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[Gh(r)](),u=i["get"+(r?"UTC":"")+"Day"](),f=i[Vh(r)](),h=(f-1)%12+1,v=i[Hh(r)](),c=i[Wh(r)](),d=i[Uh(r)](),p=f>=12?"pm":"am",g=p.toUpperCase(),m=n instanceof _t?n:xT(n||by)||wT(),y=m.getModel("time"),_=y.get("month"),b=y.get("monthAbbr"),S=y.get("dayOfWeek"),x=y.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,p+"").replace(/{A}/g,g+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,dr(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[o-1]).replace(/{MMM}/g,b[o-1]).replace(/{MM}/g,dr(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,dr(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,dr(f,2)).replace(/{H}/g,f+"").replace(/{hh}/g,dr(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,dr(v,2)).replace(/{m}/g,v+"").replace(/{ss}/g,dr(c,2)).replace(/{s}/g,c+"").replace(/{SSS}/g,dr(d,3)).replace(/{S}/g,d+"")}function kT(e,t,r,n,i){var a=null;if(Y(r))a=r;else if(Q(r)){var o={time:e.time,level:e.time.level},s=ms();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=r(e.value,t,o)}else{var l=e.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var f=ys(e.value,i);a=r[f][f][0]}}return Qs(new Date(e.value),a,i,n)}function ys(e,t){var r=pi(e),n=r[zh(t)]()+1,i=r[Gh(t)](),a=r[Vh(t)](),o=r[Hh(t)](),s=r[Wh(t)](),l=r[Uh(t)](),u=l===0,f=u&&s===0,h=f&&o===0,v=h&&a===0,c=v&&i===1,d=c&&n===1;return d?"year":c?"month":v?"day":h?"hour":f?"minute":u?"second":"millisecond"}function gf(e,t,r){switch(t){case"year":e[wy(r)](0);case"month":e[Ty(r)](1);case"day":e[Cy(r)](0);case"hour":e[Dy(r)](0);case"minute":e[My(r)](0);case"second":e[Ay(r)](0)}return e}function xy(e){return e?"getUTCFullYear":"getFullYear"}function zh(e){return e?"getUTCMonth":"getMonth"}function Gh(e){return e?"getUTCDate":"getDate"}function Vh(e){return e?"getUTCHours":"getHours"}function Hh(e){return e?"getUTCMinutes":"getMinutes"}function Wh(e){return e?"getUTCSeconds":"getSeconds"}function Uh(e){return e?"getUTCMilliseconds":"getMilliseconds"}function RT(e){return e?"setUTCFullYear":"setFullYear"}function wy(e){return e?"setUTCMonth":"setMonth"}function Ty(e){return e?"setUTCDate":"setDate"}function Cy(e){return e?"setUTCHours":"setHours"}function Dy(e){return e?"setUTCMinutes":"setMinutes"}function My(e){return e?"setUTCSeconds":"setSeconds"}function Ay(e){return e?"setUTCMilliseconds":"setMilliseconds"}function Ly(e){if(!LS(e))return Y(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Py(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var Js=ah;function mf(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(f){return f&&ze(f)?f:"-"}function a(f){return!!(f!=null&&!isNaN(f)&&isFinite(f))}var o=t==="time",s=e instanceof Date;if(o||s){var l=o?pi(e):e;if(isNaN(+l)){if(s)return"-"}else return Qs(l,n,r)}if(t==="ordinal")return Lu(e)?i(e):vt(e)&&a(e)?e+"":"-";var u=ss(e);return a(u)?Ly(u):Lu(e)?i(e):typeof e=="boolean"?e+"":"-"}var fd=["a","b","c","d","e","f","g"],$l=function(e,t){return"{"+e+(t??"")+"}"};function Iy(e,t,r){H(t)||(t=[t]);var n=t.length;if(!n)return"";for(var i=t[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function Dn(e,t){return t=t||"transparent",Y(e)?e:Z(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}var Uo={},Xl={},jh=(function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(Uo),this._normalMasterList=n(Xl);function n(i,a){var o=[];return M(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){M(this._normalMasterList,function(n){n.update&&n.update(t,r)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(t,r){if(t==="matrix"||t==="calendar"){Uo[t]=r;return}Xl[t]=r},e.get=function(t){return Xl[t]||Uo[t]},e})();function OT(e){return!!Uo[e]}var hd={coord:1,coord2:2},NT=et();function BT(e){var t=e.getShallow("coord",!0),r=hd.coord;if(t==null){var n=NT.get(e.type);n&&n.getCoord2&&(r=hd.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var nr={none:0,dataCoordSys:1,boxCoordSys:2};function FT(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=nr.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=nr.dataCoordSys,a||(i=nr.none)):n==="box"&&(i=nr.boxCoordSys,!a&&!OT(r)&&(i=nr.none))}return{coordSysType:r,kind:i}}function zT(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys,a=FT(t),o=a.kind,s=a.coordSysType;if(i&&o!==nr.dataCoordSys&&(o=nr.dataCoordSys,s=r),o===nr.none||s!==r)return!1;var l=n(r,t);return l?(o===nr.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var jo=M,GT=["left","right","top","bottom","width","height"],ho=[["width","left","right"],["height","top","bottom"]];function Yh(e,t,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;t.eachChild(function(l,u){var f=l.getBoundingRect(),h=t.childAt(u+1),v=h&&h.getBoundingRect(),c,d;if(e==="horizontal"){var p=f.width+(v?-v.x+f.x:0);c=a+p,c>n||l.newline?(a=0,c=p,o+=s+r,s=f.height):s=Math.max(s,f.height)}else{var g=f.height+(v?-v.y+f.y:0);d=o+g,d>i||l.newline?(a+=s+r,o=0,d=g,s=f.width):s=Math.max(s,f.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),e==="horizontal"?a=c+r:o=d+r)})}var ra=Yh;At(Yh,"vertical");At(Yh,"horizontal");function VT(e,t){return{left:e.getShallow("left",t),top:e.getShallow("top",t),right:e.getShallow("right",t),bottom:e.getShallow("bottom",t),width:e.getShallow("width",t),height:e.getShallow("height",t)}}function ma(e,t,r){r=Js(r||0);var n=t.width,i=t.height,a=jt(e.left,n),o=jt(e.top,i),s=jt(e.right,n),l=jt(e.bottom,i),u=jt(e.width,n),f=jt(e.height,i),h=r[2]+r[0],v=r[1]+r[3],c=e.aspect;switch(isNaN(u)&&(u=n-s-v-a),isNaN(f)&&(f=i-l-h-o),c!=null&&(isNaN(u)&&isNaN(f)&&(c>n/i?u=n*.8:f=i*.8),isNaN(u)&&(u=c*f),isNaN(f)&&(f=u/c)),isNaN(a)&&(a=n-s-u-v),isNaN(o)&&(o=i-l-f-h),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-v;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-f/2-r[0];break;case"bottom":o=i-f-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-v-a-(s||0)),isNaN(f)&&(f=i-h-o-(l||0));var d=new at((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,f);return d.margin=r,d}var Zl={rect:1};function ky(e,t,r){var n,i,a,o=e.boxCoordinateSystem,s;if(o){var l=BT(e),u=l.coord,f=l.from;if(o.dataToLayout){a=Zl.rect,s=f;var h=o.dataToLayout(u);n=h.contentRect||h.rect}}return a==null&&(a=Zl.rect),a===Zl.rect&&(n||(n={x:0,y:0,width:t.getWidth(),height:t.getHeight()}),i=[n.x+n.width/2,n.y+n.height/2]),{type:a,refContainer:n,refPoint:i,boxCoordFrom:s}}function ya(e){var t=e.layoutMode||e.constructor.layoutMode;return Z(t)?t:t?{type:t}:null}function Nr(e,t,r){var n=r&&r.ignoreSize;!H(n)&&(n=[n,n]);var i=o(ho[0],0),a=o(ho[1],1);l(ho[0],e,i),l(ho[1],e,a);function o(u,f){var h={},v=0,c={},d=0,p=2;if(jo(u,function(y){c[y]=e[y]}),jo(u,function(y){Te(t,y)&&(h[y]=c[y]=t[y]),s(h,y)&&v++,s(c,y)&&d++}),n[f])return s(t,u[1])?c[u[2]]=null:s(t,u[2])&&(c[u[1]]=null),c;if(d===p||!v)return c;if(v>=p)return h;for(var g=0;g=0;l--)s=yt(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return Ea(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return VT(this,!1)},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(r){this.option.zlevel=r},t.protoInitialize=(function(){var r=t.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0})(),t})(_t);Rm(ct,_t);Bs(ct);mT(ct);yT(ct,UT);function UT(e){var t=[];return M(ct.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=$(t,function(r){return Ve(r).main}),e!=="dataset"&&ft(t,"dataset")<=0&&t.unshift("dataset"),t}var q={color:{},darkColor:{},size:{}},bt=q.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)"};N(bt,{primary:bt.neutral80,secondary:bt.neutral70,tertiary:bt.neutral60,quaternary:bt.neutral50,disabled:bt.neutral20,border:bt.neutral30,borderTint:bt.neutral20,borderShade:bt.neutral40,background:bt.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:bt.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:bt.neutral70,axisLineTint:bt.neutral40,axisTick:bt.neutral70,axisTickMinor:bt.neutral60,axisLabel:bt.neutral70,axisSplitLine:bt.neutral15,axisMinorSplitLine:bt.neutral05});for(var an in bt)if(bt.hasOwnProperty(an)){var cd=bt[an];an==="theme"?q.darkColor.theme=bt.theme.slice():an==="highlight"?q.darkColor.highlight="rgba(255,231,130,0.4)":an.indexOf("accent")===0?q.darkColor[an]=Hu(cd,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):q.darkColor[an]=Hu(cd,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}q.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var Ry="";typeof navigator<"u"&&(Ry=navigator.platform||"");var Fn="rgba(0, 0, 0, 0.2)",Ey=q.color.theme[0],jT=Hu(Ey,null,null,.9);const YT={darkMode:"auto",colorBy:"series",color:q.color.theme,gradientColor:[jT,Ey],aria:{decal:{decals:[{color:Fn,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Fn,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Fn,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Fn,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Fn,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Fn,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Ry.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 Oy=et(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),oe="original",Vt="arrayRows",Pe="objectRows",Ke="keyedColumns",Pr="typedArray",Ny="unknown",je="column",Mn="row",re={Must:1,Might:2,Not:3},By=St();function $T(e){By(e).datasetMap=et()}function XT(e,t,r){var n={},i=Fy(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=By(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,f,h;e=e.slice(),M(e,function(p,g){var m=Z(p)?p:e[g]={name:p};m.type==="ordinal"&&f==null&&(f=g,h=d(m)),n[m.name]=[]});var v=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});M(e,function(p,g){var m=p.name,y=d(p);if(f==null){var _=v.valueWayDim;c(n[m],_,y),c(o,_,y),v.valueWayDim+=y}else if(f===g)c(n[m],0,y),c(a,0,y);else{var _=v.categoryWayDim;c(n[m],_,y),c(o,_,y),v.categoryWayDim+=y}});function c(p,g,m){for(var y=0;yt)return e[n];return e[r-1]}function tC(e,t,r,n,i,a,o){a=a||e;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var f=o==null||!n?r:JT(n,o);if(f=f||r,!(!f||!f.length)){var h=f[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%f.length,h}}function eC(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var co,Di,dd,pd="\0_ec_inner",rC=1,Xh=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new _t(a),this._locale=new _t(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=yd(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,yd(n))},t.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?dd(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&M(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},t.prototype.mergeOption=function(r){this._mergeOption(r,null)},t.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=et(),u=n&&n.replaceMergeMainTypeMap;$T(this),M(r,function(h,v){h!=null&&(ct.hasClass(v)?v&&(s.push(v),l.set(v,!0)):i[v]=i[v]==null?it(h):yt(i[v],h,!0))}),u&&u.each(function(h,v){ct.hasClass(v)&&!l.get(v)&&(s.push(v),l.set(v,!0))}),ct.topologicalTravel(s,ct.getAllClassMainTypes(),f,this);function f(h){var v=QT(this,h,$t(r[h])),c=a.get(h),d=c?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",p=OS(c,v,d);HS(p,h,ct),i[h]=null,a.set(h,null),o.set(h,0);var g=[],m=[],y=0,_;M(p,function(b,S){var x=b.existing,T=b.newOption;if(!T)x&&(x.mergeOption({},this),x.optionUpdated({},!1));else{var A=h==="series",L=ct.getClass(h,b.keyInfo.subType,!A);if(!L)return;if(h==="tooltip"){if(_)return;_=!0}if(x&&x.constructor===L)x.name=b.keyInfo.name,x.mergeOption(T,this),x.optionUpdated(T,!1);else{var D=N({componentIndex:S},b.keyInfo);x=new L(T,this,this,D),N(x,D),b.brandNew&&(x.__requireNewView=!0),x.init(T,this,this),x.optionUpdated(null,!0)}}x?(g.push(x.option),m.push(x),y++):(g.push(void 0),m.push(void 0))},this),i[h]=g,a.set(h,m),o.set(h,y),h==="series"&&co(this)}this._seriesIndices||co(this)},t.prototype.getOption=function(){var r=it(this.option);return M(r,function(n,i){if(ct.hasClass(i)){for(var a=$t(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!ha(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[pd],r},t.prototype.setTheme=function(r){this._theme=new _t(r),this._resetOption("recreate",null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(r){this._payload=r},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=t:r==="max"?e<=t:e===t}function hC(e,t){return e.join(",")===t.join(",")}var be=M,_a=Z,_d=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function ql(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=_d.length;r0?r[o-1].seriesModel:null)}),bC(r)}})}function bC(e){M(e,function(t,r){var n=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,f,h){var v=o.get(t.stackedDimension,h);if(isNaN(v))return i;var c,d;s?d=o.getRawIndex(h):c=o.get(t.stackedByDimension,h);for(var p=NaN,g=r-1;g>=0;g--){var m=e[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var y=m.data.getByRawIndex(m.stackResultDimension,d);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&v>=0&&y>0||l==="samesign"&&v<=0&&y<0){v=DS(v,y),p=y;break}}}return n[0]=v,n[1]=p,n})})}var tl=(function(){function e(t){this.data=t.data||(t.sourceFormat===Ke?{}:[]),this.sourceFormat=t.sourceFormat||Ny,this.seriesLayoutBy=t.seriesLayoutBy||je,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var r=this.dimensionsDefine=t.dimensionsDefine;if(r)for(var n=0;np&&(p=_)}c[0]=d,c[1]=p}},i=function(){return this._data?this._data.length/this._dimSize:0};Dd=(t={},t[Vt+"_"+je]={pure:!0,appendData:a},t[Vt+"_"+Mn]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Pe]={pure:!0,appendData:a},t[Ke]={pure:!0,appendData:function(o){var s=this._data;M(o,function(l,u){for(var f=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)f.push(l[h])})}},t[oe]={appendData:a},t[Pr]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})}},e.prototype.getRawValue=function(t,r){return li(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e})();function Pd(e){var t,r;return Z(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function na(e){return new LC(e)}var LC=(function(){function e(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return e.prototype.perform=function(t){var r=this._upstream,n=t&&t.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=f(this._modBy),s=this._modDataCount||0,l=f(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function f(y){return!(y>=1)&&(y=1),y}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(n)),this._modBy=l,this._modDataCount=u;var v=t&&t.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var c=this._dueIndex,d=Math.min(v!=null?this._dueIndex+v:1/0,this._dueEnd);if(!n&&(h||c1&&n>0?s:o}};return a;function o(){return t=e?null:li?-this._resultLT:0},e})(),IC=(function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(t){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(t){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(t,r){},e.prototype.retrieveValueFromItem=function(t,r){},e.prototype.convertValue=function(t,r){return Yo(t,r)},e})();function kC(e,t){var r=new IC,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==je&&Kt(o);var s=[],l={},u=e.dimensionsDefine;if(u)M(u,function(p,g){var m=p.name,y={index:g,name:m,displayName:p.displayName};if(s.push(y),m!=null){var _="";Te(l,m)&&Kt(_),l[m]=y}});else for(var f=0;f65535?GC:VC}function Gn(){return[1/0,-1/0]}function HC(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function Rd(e,t,r,n,i){var a=Qy[r||"float"];if(i){var o=e[t],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;ug[1]&&(g[1]=p)}return this._rawCount=this._count=l,{start:s,end:l}},e.prototype._initDataFromProvider=function(t,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=$(o,function(y){return y.property}),f=0;fm[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(t,r){if(!(r>=0&&r=0&&r=this._rawCount||t<0)return-1;if(!this._indices)return t;var r=this._indices,n=r[t];if(n!=null&&nt)a=o-1;else return o}return-1},e.prototype.getIndices=function(){var t,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){t=new n(i);for(var a=0;a=h&&y<=v||isNaN(y))&&(l[u++]=p),p++}d=!0}else if(a===2){for(var g=c[i[0]],_=c[i[1]],b=t[i[1]][0],S=t[i[1]][1],m=0;m=h&&y<=v||isNaN(y))&&(x>=b&&x<=S||isNaN(x))&&(l[u++]=p),p++}d=!0}}if(!d)if(a===1)for(var m=0;m=h&&y<=v||isNaN(y))&&(l[u++]=T)}else for(var m=0;mt[D][1])&&(A=!1)}A&&(l[u++]=r.getRawIndex(m))}return um[1]&&(m[1]=g)}}}},e.prototype.lttbDownSample=function(t,r){var n=this.clone([t],!0),i=n._chunks,a=i[t],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),f,h,v,c=new(zn(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));c[s++]=u;for(var d=1;df&&(f=h,v=b)}C>0&&Cs&&(p=s-f);for(var g=0;gd&&(d=y,c=f+g)}var _=this.getRawIndex(h),b=this.getRawIndex(c);hf-d&&(l=f-d,s.length=l);for(var p=0;ph[1]&&(h[1]=m),v[c++]=y}return a._count=c,a._indices=v,a._updateGetRawIdx(),a},e.prototype.each=function(t,r){if(this._count)for(var n=t.length,i=this._chunks,a=0,o=this.count();al&&(l=h)}return o=[s,l],this._extent[t]=o,o},e.prototype.getRawDataItem=function(t){var r=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[t]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=(function(){function t(r,n,i,a){return Yo(r[a],this._dimensions[a])}Jl={arrayRows:t,objectRows:function(r,n,i,a){return Yo(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return Yo(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}})(),e})(),WC=(function(){function e(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(t,r){this._sourceList=t,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(po(t)){var o=t,s=void 0,l=void 0,u=void 0;if(n){var f=r[0];f.prepareSource(),u=f.getSource(),s=u.data,l=u.sourceFormat,a=[f._getVersionSign()]}else s=o.get("data",!0),l=te(s)?Pr:oe,a=[];var h=this._getSourceMetaRawOption()||{},v=u&&u.metaRawOption||{},c=X(h.seriesLayoutBy,v.seriesLayoutBy)||null,d=X(h.sourceHeader,v.sourceHeader),p=X(h.dimensions,v.dimensions),g=c!==v.seriesLayoutBy||!!d!=!!v.sourceHeader||p;i=g?[yf(s,{seriesLayoutBy:c,sourceHeader:d,dimensions:p},l)]:[]}else{var m=t;if(n){var y=this._applyTransform(r);i=y.sourceList,a=y.upstreamSignList}else{var _=m.get("source",!0);i=[yf(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},e.prototype._applyTransform=function(t){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";t.length!==1&&Ed(a)}var o,s=[],l=[];return M(t,function(u){u.prepareSource();var f=u.getSource(i||0),h="";i!=null&&!f&&Ed(h),s.push(f),l.push(u._getVersionSign())}),n?o=FC(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[SC(s[0])]),{sourceList:o,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),r=0;r0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},e.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,r){if(!this._disposed)return this.handler.findHover(t,r)},e.prototype.on=function(t,r,n){return this._disposed||this.handler.on(t,r,n),this},e.prototype.off=function(t,r){this._disposed||this.handler.off(t,r)},e.prototype.trigger=function(t,r){this._disposed||this.handler.trigger(t,r)},e.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),r=0;r0){if(e<=i)return o;if(e>=a)return s}else{if(e>=i)return o;if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/l*u+o}var Ut=AS;function AS(e,t,r){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%";break}return tf(e,t,r)}function tf(e,t,r){return Y(e)?MS(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function Bt(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),Tm),e=(+e).toFixed(t),r?e:+e}function ir(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,r=0;r<15;r++,t*=10)if(Math.round(e*t)/t===e)return r}return LS(e)}function LS(e){var t=e.toString().toLowerCase(),r=t.indexOf("e"),n=r>0?+t.slice(r+1):0,i=r>0?r:t.length,a=t.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function PS(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(Ge(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function IS(e,t){var r=Math.max(ir(e),ir(t)),n=e+t;return r>Tm?n:Bt(n,r)}function Cm(e){var t=Math.PI*2;return(e%t+t)%t}function os(e){return e>-vv&&e=10&&t++,t}function Dm(e,t){var r=vh(e),n=Math.pow(10,r),i=e/n,a;return i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10,e=a*n,r>=-20?+e.toFixed(r<0?-r:0):e}function ss(e){var t=parseFloat(e);return t==e&&(t!==0||!Y(e)||e.indexOf("x")<=0)?t:NaN}function ES(e){return!isNaN(ss(e))}function Mm(){return Math.round(Math.random()*9)}function Am(e,t){return t===0?e:Am(t,e%t)}function pv(e,t){return e==null?t:t==null?e:e*t/Am(e,t)}var OS="[ECharts] ",NS=typeof console<"u"&&console.warn&&console.log;function BS(e,t,r){NS&&console[e](OS+t)}function Lm(e,t){BS("error",e)}function Kt(e){throw new Error(e)}function gv(e,t,r){return(t-e)*r+e}var Pm="series\0",FS="\0_ec_\0";function $t(e){return e instanceof Array?e:e==null?[]:[e]}function mv(e,t,r){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var n=0,i=r.length;n=0||a&&ft(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var sx=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],lx=ca(sx),ux=(function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return lx(this,t,r)},e})(),ef=new ai(50);function fx(e){if(typeof e=="string"){var t=ef.get(e);return t&&t.image}else return e}function mh(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=ef.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!Fs(t)&&a.pending.push(o)):(t=kr.loadImage(e,_v,_v),t.__zrImageSrc=e,ef.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function _v(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var f=We(o,r);return f>l&&(r="",f=0),l=e-f,i.ellipsis=r,i.ellipsisWidth=f,i.contentWidth=l,i.containerWidth=e,i}function Nm(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=We(a,t);if(o<=n){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){t+=r.ellipsis;break}var l=s===0?cx(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=We(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function cx(e,t,r){for(var n=0,i=0,a=e.length;ig&&c){var _=Math.floor(g/v);d=d||m.length>_,m=m.slice(0,_),y=m.length*v}if(i&&f&&p!=null)for(var b=Om(p,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),S={},x=0;xd&&Ll(a,o.substring(d,g),t,c),Ll(a,p[2],t,c,p[1]),d=Al.lastIndex}dh){var B=a.lines.length;I>0?(L.tokens=L.tokens.slice(0,I),T(L,C,D),a.lines=a.lines.slice(0,A+1)):a.lines=a.lines.slice(0,A),a.isTruncated=a.isTruncated||a.lines.length0&&d+n.accumWidth>n.width&&(f=t.split(` +`),u=!0),n.accumWidth=d}else{var p=Bm(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=p.accumWidth+c,h=p.linesWidths,f=p.lines}}f||(f=t.split(` +`));for(var g=He(l),m=0;m=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var yx=vi(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function _x(e){return mx(e)?!!yx[e]:!0}function Bm(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,f=0,h=He(t),v=0;vr:i+f+d>r){f?(s||l)&&(p?(s||(s=l,l="",u=0,f=u),a.push(s),o.push(f-u),l+=c,u+=d,s="",f=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(f),s=c,f=d)):p?(a.push(l),o.push(u),l=c,u=d):(a.push(c),o.push(d));continue}f+=d,p?(l+=c,u+=d):(l&&(s+=l,l="",u=0),s+=c)}return l&&(s+=l),s&&(a.push(s),o.push(f)),a.length===1&&(f+=i),{accumWidth:f,lines:a,linesWidths:o}}function Sv(e,t,r,n,i,a){if(e.baseX=r,e.baseY=n,e.outerWidth=e.outerHeight=null,!!t){var o=t.width*2,s=t.height*2;at.set(xv,oi(r,o,i),bn(n,s,a),o,s),at.intersect(t,xv,null,wv);var l=wv.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=oi(l.x,l.width,i,!0),e.baseY=bn(l.y,l.height,a,!0)}}var xv=new at(0,0,0,0),wv={outIntersectRect:{},clamp:!0};function yh(e){return e!=null?e+="":e=""}function bx(e){var t=yh(e.text),r=e.font,n=We(He(r),t),i=ka(r);return rf(e,n,i,null)}function rf(e,t,r,n){var i=new at(oi(e.x||0,t,e.textAlign),bn(e.y||0,r,e.textBaseline),t,r),a=n??(Fm(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Fm(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var nf="__zr_style_"+Math.round(Math.random()*10),Sn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},zs={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Sn[nf]=!0;var Tv=["z","z2","invisible"],Sx=["invisible"],Oa=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=st(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(Ja[0]=Rl(i)*r+e,Ja[1]=kl(i)*n+t,to[0]=Rl(a)*r+e,to[1]=kl(a)*n+t,u(s,Ja,to),f(l,Ja,to),i=i%Xr,i<0&&(i=i+Xr),a=a%Xr,a<0&&(a=a+Xr),i>a&&!o?a+=Xr:ii&&(eo[0]=Rl(c)*r+e,eo[1]=kl(c)*n+t,u(s,eo,s),f(l,eo,l))}var ut={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Zr=[],qr=[],Ie=[],cr=[],ke=[],Re=[],El=Math.min,Ol=Math.max,Kr=Math.cos,Qr=Math.sin,Qe=Math.abs,af=Math.PI,Sr=af*2,Nl=typeof Float32Array<"u",wi=[];function Bl(e){var t=Math.round(e/af*1e8)/1e8;return t%2*af}function Mx(e,t){var r=Bl(e[0]);r<0&&(r+=Sr);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=Sr?i=r+Sr:t&&r-i>=Sr?i=r-Sr:!t&&r>i?i=r+(Sr-Bl(r-i)):t&&r0&&(this._ux=Qe(n/sv/t)||0,this._uy=Qe(n/sv/r)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,r){return this._drawPendingPt(),this.addData(ut.M,t,r),this._ctx&&this._ctx.moveTo(t,r),this._x0=t,this._y0=r,this._xi=t,this._yi=r,this},e.prototype.lineTo=function(t,r){var n=Qe(t-this._xi),i=Qe(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(ut.L,t,r),this._ctx&&a&&this._ctx.lineTo(t,r),a)this._xi=t,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=r,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){return this._drawPendingPt(),this.addData(ut.C,t,r,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(t,r,n,i,a,o),this._xi=a,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,r,n,i){return this._drawPendingPt(),this.addData(ut.Q,t,r,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,r,n,i),this._xi=n,this._yi=i,this},e.prototype.arc=function(t,r,n,i,a,o){this._drawPendingPt(),wi[0]=i,wi[1]=a,Mx(wi,o),i=wi[0],a=wi[1];var s=a-i;return this.addData(ut.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=Kr(a)*n+t,this._yi=Qr(a)*n+r,this},e.prototype.arcTo=function(t,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,r,n,i,a),this},e.prototype.rect=function(t,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,r,n,i),this.addData(ut.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(ut.Z);var t=this._ctx,r=this._x0,n=this._y0;return t&&t.closePath(),this._xi=r,this._yi=n,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){if(this._saveData){var r=t.length;!(this.data&&this.data.length===r)&&Nl&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sf.length&&(this._expandData(),f=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],r=0;r11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){Ie[0]=Ie[1]=ke[0]=ke[1]=Number.MAX_VALUE,cr[0]=cr[1]=Re[0]=Re[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Qe(_)>i||v===r-1)&&(p=Math.sqrt(y*y+_*_),a=g,o=m);break}case ut.C:{var b=t[v++],S=t[v++],g=t[v++],m=t[v++],x=t[v++],T=t[v++];p=Fb(a,o,b,S,g,m,x,T,10),a=x,o=T;break}case ut.Q:{var b=t[v++],S=t[v++],g=t[v++],m=t[v++];p=Vb(a,o,b,S,g,m,10),a=g,o=m;break}case ut.A:var A=t[v++],L=t[v++],D=t[v++],C=t[v++],I=t[v++],P=t[v++],k=P+I;v+=1,d&&(s=Kr(I)*D+A,l=Qr(I)*C+L),p=Ol(D,C)*El(Sr,Math.abs(P)),a=Kr(k)*D+A,o=Qr(k)*C+L;break;case ut.R:{s=a=t[v++],l=o=t[v++];var R=t[v++],E=t[v++];p=R*2+E*2;break}case ut.Z:{var y=s-a,_=l-o;p=Math.sqrt(y*y+_*_),a=s,o=l;break}}p>=0&&(u[h++]=p,f+=p)}return this._pathLen=f,f},e.prototype.rebuildPath=function(t,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,f,h,v,c=r<1,d,p,g=0,m=0,y,_=0,b,S;if(!(c&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,p=this._pathLen,y=r*p,!y)))t:for(var x=0;x0&&(t.lineTo(b,S),_=0),T){case ut.M:s=u=n[x++],l=f=n[x++],t.moveTo(u,f);break;case ut.L:{h=n[x++],v=n[x++];var L=Qe(h-u),D=Qe(v-f);if(L>i||D>a){if(c){var C=d[m++];if(g+C>y){var I=(y-g)/C;t.lineTo(u*(1-I)+h*I,f*(1-I)+v*I);break t}g+=C}t.lineTo(h,v),u=h,f=v,_=0}else{var P=L*L+D*D;P>_&&(b=h,S=v,_=P)}break}case ut.C:{var k=n[x++],R=n[x++],E=n[x++],W=n[x++],O=n[x++],B=n[x++];if(c){var C=d[m++];if(g+C>y){var I=(y-g)/C;ts(u,k,E,O,I,Zr),ts(f,R,W,B,I,qr),t.bezierCurveTo(Zr[1],qr[1],Zr[2],qr[2],Zr[3],qr[3]);break t}g+=C}t.bezierCurveTo(k,R,E,W,O,B),u=O,f=B;break}case ut.Q:{var k=n[x++],R=n[x++],E=n[x++],W=n[x++];if(c){var C=d[m++];if(g+C>y){var I=(y-g)/C;es(u,k,E,I,Zr),es(f,R,W,I,qr),t.quadraticCurveTo(Zr[1],qr[1],Zr[2],qr[2]);break t}g+=C}t.quadraticCurveTo(k,R,E,W),u=E,f=W;break}case ut.A:var U=n[x++],j=n[x++],z=n[x++],G=n[x++],J=n[x++],ot=n[x++],Ft=n[x++],se=!n[x++],Xt=z>G?z:G,Pt=Qe(z-G)>.001,Tt=J+ot,K=!1;if(c){var C=d[m++];g+C>y&&(Tt=J+ot*(y-g)/C,K=!0),g+=C}if(Pt&&t.ellipse?t.ellipse(U,j,z,G,Ft,J,Tt,se):t.arc(U,j,Xt,J,Tt,se),K)break t;A&&(s=Kr(J)*z+U,l=Qr(J)*G+j),u=Kr(Tt)*z+U,f=Qr(Tt)*G+j;break;case ut.R:s=u=n[x],l=f=n[x+1],h=n[x++],v=n[x++];var nt=n[x++],_e=n[x++];if(c){var C=d[m++];if(g+C>y){var Dt=y-g;t.moveTo(h,v),t.lineTo(h+El(Dt,nt),v),Dt-=nt,Dt>0&&t.lineTo(h+nt,v+El(Dt,_e)),Dt-=_e,Dt>0&&t.lineTo(h+Ol(nt-Dt,0),v+_e),Dt-=nt,Dt>0&&t.lineTo(h,v+Ol(_e-Dt,0));break t}g+=C}t.rect(h,v,nt,_e);break;case ut.Z:if(c){var C=d[m++];if(g+C>y){var I=(y-g)/C;t.lineTo(u*(1-I)+s*I,f*(1-I)+l*I);break t}g+=C}t.closePath(),u=s,f=l}}},e.prototype.clone=function(){var t=new e,r=this.data;return t.data=r.slice?r.slice():Array.prototype.slice.call(r),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=ut,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e})();function En(e,t,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=e;if(o>t+s&&o>n+s||oe+s&&a>r+s||at+h&&f>n+h&&f>a+h&&f>s+h||fe+h&&u>r+h&&u>i+h&&u>o+h||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||f+ui&&(i+=Ti);var v=Math.atan2(l,s);return v<0&&(v+=Ti),v>=n&&v<=i||v+Ti>=n&&v+Ti<=i}function Jr(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var vr=Er.CMD,tn=Math.PI*2,Ix=1e-4;function kx(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&Rx(),c=Nt(t,n,a,s,ce[0]),v>1&&(d=Nt(t,n,a,s,ce[1]))),v===2?gt&&s>n&&s>a||s=0&&u<=1){for(var f=0,h=qt(t,n,a,u),v=0;vr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Ht[0]=-l,Ht[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=tn-1e-4){n=0,i=tn;var f=a?1:-1;return o>=Ht[0]+e&&o<=Ht[1]+e?f:0}if(n>i){var h=n;n=i,i=h}n<0&&(n+=tn,i+=tn);for(var v=0,c=0;c<2;c++){var d=Ht[c];if(d+e>o){var p=Math.atan2(s,d),f=a?1:-1;p<0&&(p=tn+p),(p>=n&&p<=i||p+tn>=n&&p+tn<=i)&&(p>Math.PI/2&&p1&&(r||(s+=Jr(l,u,f,h,n,i))),g&&(l=a[d],u=a[d+1],f=l,h=u),p){case vr.M:f=a[d++],h=a[d++],l=f,u=h;break;case vr.L:if(r){if(En(l,u,a[d],a[d+1],t,n,i))return!0}else s+=Jr(l,u,a[d],a[d+1],n,i)||0;l=a[d++],u=a[d++];break;case vr.C:if(r){if(Ax(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],t,n,i))return!0}else s+=Ex(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],n,i)||0;l=a[d++],u=a[d++];break;case vr.Q:if(r){if(Lx(l,u,a[d++],a[d++],a[d],a[d+1],t,n,i))return!0}else s+=Ox(l,u,a[d++],a[d++],a[d],a[d+1],n,i)||0;l=a[d++],u=a[d++];break;case vr.A:var m=a[d++],y=a[d++],_=a[d++],b=a[d++],S=a[d++],x=a[d++];d+=1;var T=!!(1-a[d++]);v=Math.cos(S)*_+m,c=Math.sin(S)*b+y,g?(f=v,h=c):s+=Jr(l,u,v,c,n,i);var A=(n-m)*b/_+m;if(r){if(Px(m,y,b,S,S+x,T,t,A,i))return!0}else s+=Nx(m,y,b,S,S+x,T,A,i);l=Math.cos(S+x)*_+m,u=Math.sin(S+x)*b+y;break;case vr.R:f=l=a[d++],h=u=a[d++];var L=a[d++],D=a[d++];if(v=f+L,c=h+D,r){if(En(f,h,v,h,t,n,i)||En(v,h,v,c,t,n,i)||En(v,c,f,c,t,n,i)||En(f,c,f,h,t,n,i))return!0}else s+=Jr(v,h,v,c,n,i),s+=Jr(f,c,f,h,n,i);break;case vr.Z:if(r){if(En(l,u,f,h,t,n,i))return!0}else s+=Jr(l,u,f,h,n,i);l=f,u=h;break}}return!r&&!kx(u,h)&&(s+=Jr(l,u,f,h,n,i)||0),s!==0}function Bx(e,t,r){return zm(e,0,!1,t,r)}function Fx(e,t,r,n){return zm(e,t,!0,r,n)}var ls=dt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Sn),zx={style:dt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},zs.style)},Fl=ua.concat(["invisible","culling","z","z2","zlevel","parent"]),ht=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype.update=function(){var r=this;e.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?Ku:n>.2?vS:Qu}else if(r)return Qu}return Ku},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(Y(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=rs(r,0)0))},t.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},t.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&$n)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var f=this.strokeContainThreshold;u=Math.max(u,f??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 r},t.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),Fx(s,l/u,r,n)))return!0}if(this.hasFill())return Bx(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=$n,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(r){return this.animate("shape",r)},t.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):e.prototype.attrKV.call(this,r,n)},t.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:N(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&$n)},t.prototype.createStyle=function(r){return Es(ls,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=N({},this.shape))},t.prototype._applyStateObj=function(r,n,i,a,o,s){e.prototype._applyStateObj.call(this,r,n,i,a,o,s);var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=N({},i.shape),N(u,n.shape)):(u=N({},a?this.shape:i.shape),N(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=N({},this.shape);for(var f={},h=st(u),v=0;vi&&(h=s+l,s*=i/h,l*=i/h),u+f>i&&(h=u+f,u*=i/h,f*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+f>a&&(h=s+f,s*=a/h,f*=a/h),e.moveTo(r+s,n),e.lineTo(r+i-l,n),l!==0&&e.arc(r+i-l,n+l,l,-Math.PI/2,0),e.lineTo(r+i,n+a-u),u!==0&&e.arc(r+i-u,n+a-u,u,0,Math.PI/2),e.lineTo(r+f,n+a),f!==0&&e.arc(r+f,n+a-f,f,Math.PI/2,Math.PI),e.lineTo(r,n+s),s!==0&&e.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var Jn=Math.round;function Gm(e,t,r){if(t){var n=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=n,e.x2=i,e.y1=a,e.y2=o;var s=r&&r.lineWidth;return s&&(Jn(n*2)===Jn(i*2)&&(e.x1=e.x2=mn(n,s,!0)),Jn(a*2)===Jn(o*2)&&(e.y1=e.y2=mn(a,s,!0))),e}}function Vm(e,t,r){if(t){var n=t.x,i=t.y,a=t.width,o=t.height;e.x=n,e.y=i,e.width=a,e.height=o;var s=r&&r.lineWidth;return s&&(e.x=mn(n,s,!0),e.y=mn(i,s,!0),e.width=Math.max(mn(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(mn(i+o,s,!1)-e.y,o===0?0:1)),e}}function mn(e,t,r){if(!t)return e;var n=Jn(e*2);return(n+Jn(t))%2===0?n/2:(n+(r?1:-1))/2}var Ux=(function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e})(),Yx={},wt=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Ux},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=Vm(Yx,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?jx(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t})(ht);wt.prototype.type="rect";var Lv={fill:"#000"},Pv=2,Ee={},$x={style:dt({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},zs.style)},ee=(function(e){V(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Lv,n.attr(r),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,I=0;I=0&&(k=x[P],k.align==="right");)this._placeToken(k,r,A,m,I,"right",_),L-=k.width,I-=k.width,P--;for(C+=(f-(C-g)-(y-I)-L)/2;D<=P;)k=x[D],this._placeToken(k,r,A,m,C+k.width/2,"center",_),C+=k.width,D++;m+=A}},t.prototype._placeToken=function(r,n,i,a,o,s,l){var u=n.rich[r.styleName]||{};u.text=r.text;var f=r.verticalAlign,h=a+i/2;f==="top"?h=a+r.height/2:f==="bottom"&&(h=a+i-r.height/2);var v=!r.isLineHolder&&zl(u);v&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var c=!!u.backgroundColor,d=r.textPadding;d&&(o=Nv(o,s,d),h-=r.height/2-d[0]-r.innerHeight/2);var p=this._getOrCreateChild(va),g=p.createStyle();p.useStyle(g);var m=this._defaultStyle,y=!1,_=0,b=!1,S=Ov("fill"in u?u.fill:"fill"in n?n.fill:(y=!0,m.fill)),x=Ev("stroke"in u?u.stroke:"stroke"in n?n.stroke:!c&&!l&&(!m.autoStroke||y)?(_=Pv,b=!0,m.stroke):null),T=u.textShadowBlur>0||n.textShadowBlur>0;g.text=r.text,g.x=o,g.y=h,T&&(g.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,g.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",g.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,g.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=r.font||lr,g.opacity=ei(u.opacity,n.opacity,1),kv(g,u),x&&(g.lineWidth=ei(u.lineWidth,n.lineWidth,_),g.lineDash=X(u.lineDash,n.lineDash),g.lineDashOffset=n.lineDashOffset||0,g.stroke=x),S&&(g.fill=S),p.setBoundingRect(rf(g,r.contentWidth,r.contentHeight,b?0:null))},t.prototype._renderBackground=function(r,n,i,a,o,s){var l=r.backgroundColor,u=r.borderWidth,f=r.borderColor,h=l&&l.image,v=l&&!h,c=r.borderRadius,d=this,p,g;if(v||r.lineHeight||u&&f){p=this._getOrCreateChild(wt),p.useStyle(p.createStyle()),p.style.fill=null;var m=p.shape;m.x=i,m.y=a,m.width=o,m.height=s,m.r=c,p.dirtyShape()}if(v){var y=p.style;y.fill=l||null,y.fillOpacity=X(r.fillOpacity,1)}else if(h){g=this._getOrCreateChild(qe),g.onload=function(){d.dirtyStyle()};var _=g.style;_.image=l.image,_.x=i,_.y=a,_.width=o,_.height=s}if(u&&f){var y=p.style;y.lineWidth=u,y.stroke=f,y.strokeOpacity=X(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var b=(p||g).style;b.shadowBlur=r.shadowBlur||0,b.shadowColor=r.shadowColor||"transparent",b.shadowOffsetX=r.shadowOffsetX||0,b.shadowOffsetY=r.shadowOffsetY||0,b.opacity=ei(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return Wm(r)&&(n=[r.fontStyle,r.fontWeight,Hm(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&ze(n)||r.textFont||r.font},t})(Oa),Xx={left:!0,right:1,center:1},Zx={top:1,bottom:1,middle:1},Iv=["fontStyle","fontWeight","fontSize","fontFamily"];function Hm(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?th+"px":e+"px"}function kv(e,t){for(var r=0;r=0,a=!1;if(e instanceof ht){var o=jm(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(On(s)||On(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=N({},n),u=N({},u),u.fill=s):!On(u.fill)&&On(s)?(a=!0,n=N({},n),u=N({},u),u.fill=Wu(s)):!On(u.stroke)&&On(l)&&(a||(n=N({},n),u=N({},u)),u.stroke=Wu(l)),n.style=u}}if(n&&n.z2==null){a||(n=N({},n));var f=e.z2EmphasisLift;n.z2=e.z2+(f??Qx)}return n}function iw(e,t,r){if(r&&r.z2==null){r=N({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??Jx)}return r}function aw(e,t,r){var n=ft(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:rw(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=N({},r),o=N({opacity:n?i:a.opacity*.1},o),r.style=o),r}function Gl(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return nw(this,e,t,r);if(e==="blur")return aw(this,e,r);if(e==="select")return iw(this,e,r)}return r}function ow(e){e.stateProxy=Gl;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=Gl),r&&(r.stateProxy=Gl)}function Wv(e,t){!Km(e,t)&&!e.__highByOuter&&hr(e,Um)}function jv(e,t){!Km(e,t)&&!e.__highByOuter&&hr(e,Ym)}function hs(e,t){e.__highByOuter|=1<<(t||0),hr(e,Um)}function cs(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&hr(e,Ym)}function sw(e){hr(e,xh)}function Xm(e){hr(e,$m)}function Zm(e){hr(e,tw)}function qm(e){hr(e,ew)}function Km(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Qm(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=_h(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){$m(u)}),s&&r.push(a)),o.isBlured=!1}),M(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function sf(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,f){for(var h=0;h0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function uf(e,t,r){Jm(e,!0),hr(e,ow),dw(e,t,r)}function vw(e){Jm(e,!1)}function vs(e,t,r,n){n?vw(e):uf(e,t,r)}function dw(e,t,r){var n=lt(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var Yv=["emphasis","blur","select"],pw={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function ff(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=Vl(d),s*=Vl(d));var p=(i===a?-1:1)*Vl((o*o*(s*s)-o*o*(c*c)-s*s*(v*v))/(o*o*(c*c)+s*s*(v*v)))||0,g=p*o*c/s,m=p*-s*v/o,y=(e+r)/2+io(h)*g-no(h)*m,_=(t+n)/2+no(h)*g+io(h)*m,b=qv([1,0],[(v-g)/o,(c-m)/s]),S=[(v-g)/o,(c-m)/s],x=[(-1*v-g)/o,(-1*c-m)/s],T=qv(S,x);if(vf(S,x)<=-1&&(T=Ci),vf(S,x)>=1&&(T=0),T<0){var A=Math.round(T/Ci*1e6)/1e6;T=Ci*2+A%2*Ci}f.addData(u,y,_,o,s,b,T,h,a)}var Sw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,xw=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function ww(e){var t=new Er;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=Er.CMD,l=e.match(Sw);if(!l)return t;for(var u=0;uk*k+R*R&&(A=D,L=C),{cx:A,cy:L,x0:-f,y0:-h,x1:A*(i/S-1),y1:L*(i/S-1)}}function Iw(e){var t;if(H(e)){var r=e.length;if(!r)return e;r===1?t=[e[0],e[0],0,0]:r===2?t=[e[0],e[0],e[1],e[1]]:r===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function kw(e,t){var r,n=Hi(t.r,0),i=Hi(t.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var f=t.cx,h=t.cy,v=!!t.clockwise,c=Qv(u-l),d=c>Hl&&c%Hl;if(d>Se&&(c=d),!(n>Se))e.moveTo(f,h);else if(c>Hl-Se)e.moveTo(f+n*Bn(l),h+n*en(l)),e.arc(f,h,n,l,u,!v),i>Se&&(e.moveTo(f+i*Bn(u),h+i*en(u)),e.arc(f,h,i,u,l,v));else{var p=void 0,g=void 0,m=void 0,y=void 0,_=void 0,b=void 0,S=void 0,x=void 0,T=void 0,A=void 0,L=void 0,D=void 0,C=void 0,I=void 0,P=void 0,k=void 0,R=n*Bn(l),E=n*en(l),W=i*Bn(u),O=i*en(u),B=c>Se;if(B){var U=t.cornerRadius;U&&(r=Iw(U),p=r[0],g=r[1],m=r[2],y=r[3]);var j=Qv(n-i)/2;if(_=Oe(j,m),b=Oe(j,y),S=Oe(j,p),x=Oe(j,g),L=T=Hi(_,b),D=A=Hi(S,x),(T>Se||A>Se)&&(C=n*Bn(u),I=n*en(u),P=i*Bn(l),k=i*en(l),cSe){var Pt=Oe(m,L),Tt=Oe(y,L),K=ao(P,k,R,E,n,Pt,v),nt=ao(C,I,W,O,n,Tt,v);e.moveTo(f+K.cx+K.x0,h+K.cy+K.y0),L0&&e.arc(f+K.cx,h+K.cy,Pt,zt(K.y0,K.x0),zt(K.y1,K.x1),!v),e.arc(f,h,n,zt(K.cy+K.y1,K.cx+K.x1),zt(nt.cy+nt.y1,nt.cx+nt.x1),!v),Tt>0&&e.arc(f+nt.cx,h+nt.cy,Tt,zt(nt.y1,nt.x1),zt(nt.y0,nt.x0),!v))}else e.moveTo(f+R,h+E),e.arc(f,h,n,l,u,!v);if(!(i>Se)||!B)e.lineTo(f+W,h+O);else if(D>Se){var Pt=Oe(p,D),Tt=Oe(g,D),K=ao(W,O,C,I,i,-Tt,v),nt=ao(R,E,P,k,i,-Pt,v);e.lineTo(f+K.cx+K.x0,h+K.cy+K.y0),D0&&e.arc(f+K.cx,h+K.cy,Tt,zt(K.y0,K.x0),zt(K.y1,K.x1),!v),e.arc(f,h,i,zt(K.cy+K.y1,K.cx+K.x1),zt(nt.cy+nt.y1,nt.cx+nt.x1),v),Pt>0&&e.arc(f+nt.cx,h+nt.cy,Pt,zt(nt.y1,nt.x1),zt(nt.y0,nt.x0),!v))}else e.lineTo(f+W,h+O),e.arc(f,h,i,u,l,v)}e.closePath()}}}var Rw=(function(){function e(){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 e})(),gi=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Rw},t.prototype.buildPath=function(r,n){kw(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t})(ht);gi.prototype.type="sector";var Ew=(function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e})(),Ch=(function(e){V(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Ew},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,o,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,o,!0)},t})(ht);Ch.prototype.type="ring";function Ow(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,f,h;if(n){f=[1/0,1/0],h=[-1/0,-1/0];for(var v=0,c=e.length;v=2){if(n){var a=Ow(i,n,r,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],f=i[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],f[0],f[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,h=i.length;snn[1]){if(a=!1,kt.negativeSize||n)return a;var l=oo(nn[0]-rn[1]),u=oo(rn[0]-nn[1]);Wl(l,u)>lo.len()&&(l=u||!kt.bidirectional)&&(pt.scale(so,s,-u*i),kt.useDir&&kt.calcDirMTV()))}}return a},e.prototype._getProjMinMaxOnAxis=function(t,r,n){for(var i=this._axes[t],a=this._origin,o=r[0].dot(i)+a[t],s=o,l=o,u=1;u0){var h=f.duration,v=f.delay,c=f.easing,d={duration:h,delay:v||0,easing:c,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,d):t.animateTo(r,d)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function ae(e,t,r,n,i,a){Lh("update",e,t,r,n,i,a)}function ur(e,t,r,n,i,a){Lh("enter",e,t,r,n,i,a)}function Ji(e){if(!e.__zr)return!0;for(var t=0;tGe(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function ed(e){return!e.isGroup}function nT(e){return e.shape!=null}function vy(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){ed(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return nT(o)&&(s.shape=it(o.shape)),s}var a=n(e);t.traverse(function(o){if(ed(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),ae(o,l,r,lt(o).dataIndex)}}})}function iT(e,t){return $(e,function(r){var n=r[0];n=ie(n,t.x),n=fa(n,t.x+t.width);var i=r[1];return i=ie(i,t.y),i=fa(i,t.y+t.height),[n,i]})}function aT(e,t){var r=ie(e.x,t.x),n=fa(e.x+e.width,t.x+t.width),i=ie(e.y,t.y),a=fa(e.y+e.height,t.y+t.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function kh(e,t,r){var n=N({rectHover:!0},t),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},e)return e.indexOf("image://")===0?(i.image=e.slice(8),dt(i,r),new qe(n)):Ph(e.replace("path://",""),n,r,"center")}function oT(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var g=jl(c,d,f,h)/v;return!(g<0||g>1)}function jl(e,t,r,n){return e*n-r*t}function sT(e){return e<=1e-6&&e>=-1e-6}function ps(e,t,r,n,i){return t==null||(vt(t)?mt[0]=mt[1]=mt[2]=mt[3]=t:(mt[0]=t[0],mt[1]=t[1],mt[2]=t[2],mt[3]=t[3]),n&&(mt[0]=ie(0,mt[0]),mt[1]=ie(0,mt[1]),mt[2]=ie(0,mt[2]),mt[3]=ie(0,mt[3])),r&&(mt[0]=-mt[0],mt[1]=-mt[1],mt[2]=-mt[2],mt[3]=-mt[3]),rd(e,mt,"x","width",3,1,i&&i[0]||0),rd(e,mt,"y","height",0,2,i&&i[1]||0)),e}var mt=[0,0,0,0];function rd(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=ie(0,fa(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:Ge(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function Us(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=Y(t)?{formatter:t}:t,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=e.formatterParamsExtra;l&&M(st(l),function(f){Te(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=lt(e.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:dt({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function pf(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function Ys(e,t){if(e)if(H(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function gy(e,t,r){my(e,t,r,-1/0)}function my(e,t,r,n){if(e.ignoreModelZ)return n;var i=e.getTextContent(),a=e.getTextGuideLine(),o=e.isGroup;if(o)for(var s=e.childrenRef(),l=0;l=0&&s.push(l)}),s}}function by(e,t){return yt(yt({},e,!0),t,!0)}const TT={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:". "}}}},CT={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 gs="ZH",Oh="EN",ii=Oh,Ho={},Nh={},Sy=tt.domSupported?(function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ii).toUpperCase();return e.indexOf(gs)>-1?gs:ii})():ii;function xy(e,t){e=e.toUpperCase(),Nh[e]=new _t(t),Ho[e]=t}function DT(e){if(Y(e)){var t=Ho[e.toUpperCase()]||{};return e===gs||e===Oh?it(t):yt(it(t),it(Ho[ii]),!1)}else return yt(it(e),it(Ho[ii]),!1)}function MT(e){return Nh[e]}function AT(){return Nh[ii]}xy(Oh,TT);xy(gs,CT);var LT=null;function ms(){return LT}var Bh=1e3,Fh=Bh*60,ta=Fh*60,me=ta*24,ud=me*365,PT={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})/},Wo={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},IT="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",fo="{yyyy}-{MM}-{dd}",fd={year:"{yyyy}",month:"{yyyy}-{MM}",day:fo,hour:fo+" "+Wo.hour,minute:fo+" "+Wo.minute,second:fo+" "+Wo.second,millisecond:IT},wn=["year","month","day","hour","minute","second","millisecond"],kT=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function RT(e){return!Y(e)&&!Q(e)?ET(e):e}function ET(e){e=e||{};var t={},r=!0;return M(wn,function(n){r&&(r=e[n]==null)}),M(wn,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=wn[s],u=Z(a)&&!H(a)?a[l]:a,f=void 0;H(u)?(f=u.slice(),o=f[0]||""):Y(u)?(o=u,f=[o]):(o==null?o=Wo[n]:PT[l].test(o)||(o=t[l][l][0]+" "+o),f=[o],r&&(f[1]="{primary|"+o+"}")),t[n][l]=f}}),t}function dr(e,t){return e+="","0000".substr(0,t-e.length)+e}function ea(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function OT(e){return e===ea(e)}function NT(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Qs(e,t,r,n){var i=pi(e),a=i[wy(r)](),o=i[zh(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[Gh(r)](),u=i["get"+(r?"UTC":"")+"Day"](),f=i[Vh(r)](),h=(f-1)%12+1,v=i[Hh(r)](),c=i[Wh(r)](),d=i[jh(r)](),p=f>=12?"pm":"am",g=p.toUpperCase(),m=n instanceof _t?n:MT(n||Sy)||AT(),y=m.getModel("time"),_=y.get("month"),b=y.get("monthAbbr"),S=y.get("dayOfWeek"),x=y.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,p+"").replace(/{A}/g,g+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,dr(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[o-1]).replace(/{MMM}/g,b[o-1]).replace(/{MM}/g,dr(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,dr(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,dr(f,2)).replace(/{H}/g,f+"").replace(/{hh}/g,dr(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,dr(v,2)).replace(/{m}/g,v+"").replace(/{ss}/g,dr(c,2)).replace(/{s}/g,c+"").replace(/{SSS}/g,dr(d,3)).replace(/{S}/g,d+"")}function BT(e,t,r,n,i){var a=null;if(Y(r))a=r;else if(Q(r)){var o={time:e.time,level:e.time.level},s=ms();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=r(e.value,t,o)}else{var l=e.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var f=ys(e.value,i);a=r[f][f][0]}}return Qs(new Date(e.value),a,i,n)}function ys(e,t){var r=pi(e),n=r[zh(t)]()+1,i=r[Gh(t)](),a=r[Vh(t)](),o=r[Hh(t)](),s=r[Wh(t)](),l=r[jh(t)](),u=l===0,f=u&&s===0,h=f&&o===0,v=h&&a===0,c=v&&i===1,d=c&&n===1;return d?"year":c?"month":v?"day":h?"hour":f?"minute":u?"second":"millisecond"}function gf(e,t,r){switch(t){case"year":e[Ty(r)](0);case"month":e[Cy(r)](1);case"day":e[Dy(r)](0);case"hour":e[My(r)](0);case"minute":e[Ay(r)](0);case"second":e[Ly(r)](0)}return e}function wy(e){return e?"getUTCFullYear":"getFullYear"}function zh(e){return e?"getUTCMonth":"getMonth"}function Gh(e){return e?"getUTCDate":"getDate"}function Vh(e){return e?"getUTCHours":"getHours"}function Hh(e){return e?"getUTCMinutes":"getMinutes"}function Wh(e){return e?"getUTCSeconds":"getSeconds"}function jh(e){return e?"getUTCMilliseconds":"getMilliseconds"}function FT(e){return e?"setUTCFullYear":"setFullYear"}function Ty(e){return e?"setUTCMonth":"setMonth"}function Cy(e){return e?"setUTCDate":"setDate"}function Dy(e){return e?"setUTCHours":"setHours"}function My(e){return e?"setUTCMinutes":"setMinutes"}function Ay(e){return e?"setUTCSeconds":"setSeconds"}function Ly(e){return e?"setUTCMilliseconds":"setMilliseconds"}function Py(e){if(!ES(e))return Y(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Iy(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var Js=ah;function mf(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(f){return f&&ze(f)?f:"-"}function a(f){return!!(f!=null&&!isNaN(f)&&isFinite(f))}var o=t==="time",s=e instanceof Date;if(o||s){var l=o?pi(e):e;if(isNaN(+l)){if(s)return"-"}else return Qs(l,n,r)}if(t==="ordinal")return Lu(e)?i(e):vt(e)&&a(e)?e+"":"-";var u=ss(e);return a(u)?Py(u):Lu(e)?i(e):typeof e=="boolean"?e+"":"-"}var hd=["a","b","c","d","e","f","g"],$l=function(e,t){return"{"+e+(t??"")+"}"};function ky(e,t,r){H(t)||(t=[t]);var n=t.length;if(!n)return"";for(var i=t[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function Dn(e,t){return t=t||"transparent",Y(e)?e:Z(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}var jo={},Xl={},Uh=(function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(jo),this._normalMasterList=n(Xl);function n(i,a){var o=[];return M(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){M(this._normalMasterList,function(n){n.update&&n.update(t,r)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(t,r){if(t==="matrix"||t==="calendar"){jo[t]=r;return}Xl[t]=r},e.get=function(t){return Xl[t]||jo[t]},e})();function GT(e){return!!jo[e]}var cd={coord:1,coord2:2},VT=et();function HT(e){var t=e.getShallow("coord",!0),r=cd.coord;if(t==null){var n=VT.get(e.type);n&&n.getCoord2&&(r=cd.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var nr={none:0,dataCoordSys:1,boxCoordSys:2};function WT(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=nr.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=nr.dataCoordSys,a||(i=nr.none)):n==="box"&&(i=nr.boxCoordSys,!a&&!GT(r)&&(i=nr.none))}return{coordSysType:r,kind:i}}function jT(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys,a=WT(t),o=a.kind,s=a.coordSysType;if(i&&o!==nr.dataCoordSys&&(o=nr.dataCoordSys,s=r),o===nr.none||s!==r)return!1;var l=n(r,t);return l?(o===nr.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var Uo=M,UT=["left","right","top","bottom","width","height"],ho=[["width","left","right"],["height","top","bottom"]];function Yh(e,t,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;t.eachChild(function(l,u){var f=l.getBoundingRect(),h=t.childAt(u+1),v=h&&h.getBoundingRect(),c,d;if(e==="horizontal"){var p=f.width+(v?-v.x+f.x:0);c=a+p,c>n||l.newline?(a=0,c=p,o+=s+r,s=f.height):s=Math.max(s,f.height)}else{var g=f.height+(v?-v.y+f.y:0);d=o+g,d>i||l.newline?(a+=s+r,o=0,d=g,s=f.width):s=Math.max(s,f.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),e==="horizontal"?a=c+r:o=d+r)})}var ra=Yh;At(Yh,"vertical");At(Yh,"horizontal");function YT(e,t){return{left:e.getShallow("left",t),top:e.getShallow("top",t),right:e.getShallow("right",t),bottom:e.getShallow("bottom",t),width:e.getShallow("width",t),height:e.getShallow("height",t)}}function ma(e,t,r){r=Js(r||0);var n=t.width,i=t.height,a=Ut(e.left,n),o=Ut(e.top,i),s=Ut(e.right,n),l=Ut(e.bottom,i),u=Ut(e.width,n),f=Ut(e.height,i),h=r[2]+r[0],v=r[1]+r[3],c=e.aspect;switch(isNaN(u)&&(u=n-s-v-a),isNaN(f)&&(f=i-l-h-o),c!=null&&(isNaN(u)&&isNaN(f)&&(c>n/i?u=n*.8:f=i*.8),isNaN(u)&&(u=c*f),isNaN(f)&&(f=u/c)),isNaN(a)&&(a=n-s-u-v),isNaN(o)&&(o=i-l-f-h),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-v;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-f/2-r[0];break;case"bottom":o=i-f-h;break}a=a||0,o=o||0,isNaN(u)&&(u=n-v-a-(s||0)),isNaN(f)&&(f=i-h-o-(l||0));var d=new at((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,f);return d.margin=r,d}var Zl={rect:1};function Ry(e,t,r){var n,i,a,o=e.boxCoordinateSystem,s;if(o){var l=HT(e),u=l.coord,f=l.from;if(o.dataToLayout){a=Zl.rect,s=f;var h=o.dataToLayout(u);n=h.contentRect||h.rect}}return a==null&&(a=Zl.rect),a===Zl.rect&&(n||(n={x:0,y:0,width:t.getWidth(),height:t.getHeight()}),i=[n.x+n.width/2,n.y+n.height/2]),{type:a,refContainer:n,refPoint:i,boxCoordFrom:s}}function ya(e){var t=e.layoutMode||e.constructor.layoutMode;return Z(t)?t:t?{type:t}:null}function Nr(e,t,r){var n=r&&r.ignoreSize;!H(n)&&(n=[n,n]);var i=o(ho[0],0),a=o(ho[1],1);l(ho[0],e,i),l(ho[1],e,a);function o(u,f){var h={},v=0,c={},d=0,p=2;if(Uo(u,function(y){c[y]=e[y]}),Uo(u,function(y){Te(t,y)&&(h[y]=c[y]=t[y]),s(h,y)&&v++,s(c,y)&&d++}),n[f])return s(t,u[1])?c[u[2]]=null:s(t,u[2])&&(c[u[1]]=null),c;if(d===p||!v)return c;if(v>=p)return h;for(var g=0;g=0;l--)s=yt(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return Ea(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return YT(this,!1)},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(r){this.option.zlevel=r},t.protoInitialize=(function(){var r=t.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0})(),t})(_t);Em(ct,_t);Bs(ct);xT(ct);wT(ct,ZT);function ZT(e){var t=[];return M(ct.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=$(t,function(r){return Ve(r).main}),e!=="dataset"&&ft(t,"dataset")<=0&&t.unshift("dataset"),t}var q={color:{},darkColor:{},size:{}},bt=q.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)"};N(bt,{primary:bt.neutral80,secondary:bt.neutral70,tertiary:bt.neutral60,quaternary:bt.neutral50,disabled:bt.neutral20,border:bt.neutral30,borderTint:bt.neutral20,borderShade:bt.neutral40,background:bt.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:bt.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:bt.neutral70,axisLineTint:bt.neutral40,axisTick:bt.neutral70,axisTickMinor:bt.neutral60,axisLabel:bt.neutral70,axisSplitLine:bt.neutral15,axisMinorSplitLine:bt.neutral05});for(var an in bt)if(bt.hasOwnProperty(an)){var vd=bt[an];an==="theme"?q.darkColor.theme=bt.theme.slice():an==="highlight"?q.darkColor.highlight="rgba(255,231,130,0.4)":an.indexOf("accent")===0?q.darkColor[an]=Hu(vd,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):q.darkColor[an]=Hu(vd,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}q.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var Ey="";typeof navigator<"u"&&(Ey=navigator.platform||"");var Fn="rgba(0, 0, 0, 0.2)",Oy=q.color.theme[0],qT=Hu(Oy,null,null,.9);const KT={darkMode:"auto",colorBy:"series",color:q.color.theme,gradientColor:[qT,Oy],aria:{decal:{decals:[{color:Fn,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Fn,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Fn,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Fn,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Fn,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Fn,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Ey.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 Ny=et(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),oe="original",Vt="arrayRows",Pe="objectRows",Ke="keyedColumns",Pr="typedArray",By="unknown",Ue="column",Mn="row",re={Must:1,Might:2,Not:3},Fy=St();function QT(e){Fy(e).datasetMap=et()}function JT(e,t,r){var n={},i=zy(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=Fy(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,f,h;e=e.slice(),M(e,function(p,g){var m=Z(p)?p:e[g]={name:p};m.type==="ordinal"&&f==null&&(f=g,h=d(m)),n[m.name]=[]});var v=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});M(e,function(p,g){var m=p.name,y=d(p);if(f==null){var _=v.valueWayDim;c(n[m],_,y),c(o,_,y),v.valueWayDim+=y}else if(f===g)c(n[m],0,y),c(a,0,y);else{var _=v.categoryWayDim;c(n[m],_,y),c(o,_,y),v.categoryWayDim+=y}});function c(p,g,m){for(var y=0;yt)return e[n];return e[r-1]}function aC(e,t,r,n,i,a,o){a=a||e;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var f=o==null||!n?r:iC(n,o);if(f=f||r,!(!f||!f.length)){var h=f[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%f.length,h}}function oC(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var co,Di,pd,gd="\0_ec_inner",sC=1,Xh=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new _t(a),this._locale=new _t(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=_d(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,_d(n))},t.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?pd(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&M(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},t.prototype.mergeOption=function(r){this._mergeOption(r,null)},t.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=et(),u=n&&n.replaceMergeMainTypeMap;QT(this),M(r,function(h,v){h!=null&&(ct.hasClass(v)?v&&(s.push(v),l.set(v,!0)):i[v]=i[v]==null?it(h):yt(i[v],h,!0))}),u&&u.each(function(h,v){ct.hasClass(v)&&!l.get(v)&&(s.push(v),l.set(v,!0))}),ct.topologicalTravel(s,ct.getAllClassMainTypes(),f,this);function f(h){var v=nC(this,h,$t(r[h])),c=a.get(h),d=c?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",p=GS(c,v,d);$S(p,h,ct),i[h]=null,a.set(h,null),o.set(h,0);var g=[],m=[],y=0,_;M(p,function(b,S){var x=b.existing,T=b.newOption;if(!T)x&&(x.mergeOption({},this),x.optionUpdated({},!1));else{var A=h==="series",L=ct.getClass(h,b.keyInfo.subType,!A);if(!L)return;if(h==="tooltip"){if(_)return;_=!0}if(x&&x.constructor===L)x.name=b.keyInfo.name,x.mergeOption(T,this),x.optionUpdated(T,!1);else{var D=N({componentIndex:S},b.keyInfo);x=new L(T,this,this,D),N(x,D),b.brandNew&&(x.__requireNewView=!0),x.init(T,this,this),x.optionUpdated(null,!0)}}x?(g.push(x.option),m.push(x),y++):(g.push(void 0),m.push(void 0))},this),i[h]=g,a.set(h,m),o.set(h,y),h==="series"&&co(this)}this._seriesIndices||co(this)},t.prototype.getOption=function(){var r=it(this.option);return M(r,function(n,i){if(ct.hasClass(i)){for(var a=$t(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!ha(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[gd],r},t.prototype.setTheme=function(r){this._theme=new _t(r),this._resetOption("recreate",null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(r){this._payload=r},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=t:r==="max"?e<=t:e===t}function gC(e,t){return e.join(",")===t.join(",")}var be=M,_a=Z,bd=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function ql(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=bd.length;r0?r[o-1].seriesModel:null)}),CC(r)}})}function CC(e){M(e,function(t,r){var n=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,f,h){var v=o.get(t.stackedDimension,h);if(isNaN(v))return i;var c,d;s?d=o.getRawIndex(h):c=o.get(t.stackedByDimension,h);for(var p=NaN,g=r-1;g>=0;g--){var m=e[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var y=m.data.getByRawIndex(m.stackResultDimension,d);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&v>=0&&y>0||l==="samesign"&&v<=0&&y<0){v=IS(v,y),p=y;break}}}return n[0]=v,n[1]=p,n})})}var tl=(function(){function e(t){this.data=t.data||(t.sourceFormat===Ke?{}:[]),this.sourceFormat=t.sourceFormat||By,this.seriesLayoutBy=t.seriesLayoutBy||Ue,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var r=this.dimensionsDefine=t.dimensionsDefine;if(r)for(var n=0;np&&(p=_)}c[0]=d,c[1]=p}},i=function(){return this._data?this._data.length/this._dimSize:0};Md=(t={},t[Vt+"_"+Ue]={pure:!0,appendData:a},t[Vt+"_"+Mn]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Pe]={pure:!0,appendData:a},t[Ke]={pure:!0,appendData:function(o){var s=this._data;M(o,function(l,u){for(var f=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)f.push(l[h])})}},t[oe]={appendData:a},t[Pr]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})}},e.prototype.getRawValue=function(t,r){return li(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e})();function Id(e){var t,r;return Z(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function na(e){return new EC(e)}var EC=(function(){function e(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return e.prototype.perform=function(t){var r=this._upstream,n=t&&t.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=f(this._modBy),s=this._modDataCount||0,l=f(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function f(y){return!(y>=1)&&(y=1),y}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(n)),this._modBy=l,this._modDataCount=u;var v=t&&t.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var c=this._dueIndex,d=Math.min(v!=null?this._dueIndex+v:1/0,this._dueEnd);if(!n&&(h||c1&&n>0?s:o}};return a;function o(){return t=e?null:li?-this._resultLT:0},e})(),NC=(function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(t){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(t){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(t,r){},e.prototype.retrieveValueFromItem=function(t,r){},e.prototype.convertValue=function(t,r){return Yo(t,r)},e})();function BC(e,t){var r=new NC,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==Ue&&Kt(o);var s=[],l={},u=e.dimensionsDefine;if(u)M(u,function(p,g){var m=p.name,y={index:g,name:m,displayName:p.displayName};if(s.push(y),m!=null){var _="";Te(l,m)&&Kt(_),l[m]=y}});else for(var f=0;f65535?UC:YC}function Gn(){return[1/0,-1/0]}function $C(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function Ed(e,t,r,n,i){var a=Jy[r||"float"];if(i){var o=e[t],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;ug[1]&&(g[1]=p)}return this._rawCount=this._count=l,{start:s,end:l}},e.prototype._initDataFromProvider=function(t,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=$(o,function(y){return y.property}),f=0;fm[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(t,r){if(!(r>=0&&r=0&&r=this._rawCount||t<0)return-1;if(!this._indices)return t;var r=this._indices,n=r[t];if(n!=null&&nt)a=o-1;else return o}return-1},e.prototype.getIndices=function(){var t,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){t=new n(i);for(var a=0;a=h&&y<=v||isNaN(y))&&(l[u++]=p),p++}d=!0}else if(a===2){for(var g=c[i[0]],_=c[i[1]],b=t[i[1]][0],S=t[i[1]][1],m=0;m=h&&y<=v||isNaN(y))&&(x>=b&&x<=S||isNaN(x))&&(l[u++]=p),p++}d=!0}}if(!d)if(a===1)for(var m=0;m=h&&y<=v||isNaN(y))&&(l[u++]=T)}else for(var m=0;mt[D][1])&&(A=!1)}A&&(l[u++]=r.getRawIndex(m))}return um[1]&&(m[1]=g)}}}},e.prototype.lttbDownSample=function(t,r){var n=this.clone([t],!0),i=n._chunks,a=i[t],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),f,h,v,c=new(zn(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));c[s++]=u;for(var d=1;df&&(f=h,v=b)}C>0&&Cs&&(p=s-f);for(var g=0;gd&&(d=y,c=f+g)}var _=this.getRawIndex(h),b=this.getRawIndex(c);hf-d&&(l=f-d,s.length=l);for(var p=0;ph[1]&&(h[1]=m),v[c++]=y}return a._count=c,a._indices=v,a._updateGetRawIdx(),a},e.prototype.each=function(t,r){if(this._count)for(var n=t.length,i=this._chunks,a=0,o=this.count();al&&(l=h)}return o=[s,l],this._extent[t]=o,o},e.prototype.getRawDataItem=function(t){var r=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[t]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=(function(){function t(r,n,i,a){return Yo(r[a],this._dimensions[a])}Jl={arrayRows:t,objectRows:function(r,n,i,a){return Yo(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return Yo(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}})(),e})(),XC=(function(){function e(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(t,r){this._sourceList=t,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(po(t)){var o=t,s=void 0,l=void 0,u=void 0;if(n){var f=r[0];f.prepareSource(),u=f.getSource(),s=u.data,l=u.sourceFormat,a=[f._getVersionSign()]}else s=o.get("data",!0),l=te(s)?Pr:oe,a=[];var h=this._getSourceMetaRawOption()||{},v=u&&u.metaRawOption||{},c=X(h.seriesLayoutBy,v.seriesLayoutBy)||null,d=X(h.sourceHeader,v.sourceHeader),p=X(h.dimensions,v.dimensions),g=c!==v.seriesLayoutBy||!!d!=!!v.sourceHeader||p;i=g?[yf(s,{seriesLayoutBy:c,sourceHeader:d,dimensions:p},l)]:[]}else{var m=t;if(n){var y=this._applyTransform(r);i=y.sourceList,a=y.upstreamSignList}else{var _=m.get("source",!0);i=[yf(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},e.prototype._applyTransform=function(t){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";t.length!==1&&Od(a)}var o,s=[],l=[];return M(t,function(u){u.prepareSource();var f=u.getSource(i||0),h="";i!=null&&!f&&Od(h),s.push(f),l.push(u._getVersionSign())}),n?o=WC(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[DC(s[0])]),{sourceList:o,upstreamSignList:l}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),r=0;r1||r>0&&!e.noHeader;return M(e.blocks,function(i){var a=r0(i);a>=t&&(t=a+ +(n&&(!a||bf(i)&&!i.noHeader)))}),t}return 0}function $C(e,t,r,n){var i=t.noHeader,a=ZC(r0(t)),o=[],s=t.blocks||[];Me(!s||H(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Te(u,l)){var f=new PC(u[l],null);s.sort(function(p,g){return f.evaluate(p.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}M(s,function(p,g){var m=t.valueFormatter,y=e0(p)(m?N(N({},e),{valueFormatter:m}):e,p,g>0?a.html:0,n);y!=null&&o.push(y)});var h=e.renderMode==="richText"?o.join(a.richText):Sf(n,o.join(""),i?r:a.html);if(i)return h;var v=mf(t.header,"ordinal",e.useUTC),c=t0(n,e.renderMode).nameStyle,d=Jy(n);return e.renderMode==="richText"?n0(e,v,c)+a.richText+h:Sf(n,'
'+Ut(v)+"
"+h,r)}function XC(e,t,r,n){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,f=t.valueFormatter||e.valueFormatter||function(b){return b=H(b)?b:[b],$(b,function(S,x){return mf(S,H(c)?c[x]:c,u)})};if(!(a&&o)){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||q.color.secondary,i),v=a?"":mf(l,"ordinal",u),c=t.valueType,d=o?[]:f(t.value,t.dataIndex),p=!s||!a,g=!s&&a,m=t0(n,i),y=m.nameStyle,_=m.valueStyle;return i==="richText"?(s?"":h)+(a?"":n0(e,v,y))+(o?"":QC(e,d,p,g,_)):Sf(n,(s?"":h)+(a?"":qC(v,!s,y))+(o?"":KC(d,p,g,_)),r)}}function Od(e,t,r,n,i,a){if(e){var o=e0(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function ZC(e){return{html:jC[e],richText:YC[e]}}function Sf(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=Jy(e);return'
'+t+n+"
"}function qC(e,t,r){var n=t?"margin-left:2px":"";return''+Ut(e)+""}function KC(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=H(e)?e:[e],''+$(e,function(o){return Ut(o)}).join("  ")+""}function n0(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function QC(e,t,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(H(t)?t.join(" "):t,a)}function JC(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return Dn(n)}function i0(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var tu=(function(){function e(){this.richTextStyles={},this._nextStyleNameId=Dm()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(t,r,n){var i=n==="richText"?this._generateStyleName():null,a=ET({color:r,type:t,renderMode:n,markerId:i});return Y(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};H(r)?M(r,function(a){return N(n,a)}):N(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e})();function tD(e){var t=e.series,r=e.dataIndex,n=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(r),l=H(s),u=JC(t,r),f,h,v,c;if(o>1||l&&!o){var d=eD(s,t,r,a,u);f=d.inlineValues,h=d.inlineValueTypes,v=d.blocks,c=d.inlineValues[0]}else if(o){var p=i.getDimensionInfo(a[0]);c=f=li(i,r,a[0]),h=p.type}else c=f=l?s[0]:s;var g=dh(t),m=g&&t.name||"",y=i.getName(r),_=n?m:y;return ba("section",{header:m,noHeader:n||!g,sortParam:c,blocks:[ba("nameValue",{markerType:"item",markerColor:u,name:_,noName:!ze(_),value:f,valueType:h,dataIndex:r})].concat(v||[])})}function eD(e,t,r,n,i){var a=t.getData(),o=vi(e,function(h,v,c){var d=a.getDimensionInfo(c);return h=h||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];n.length?M(n,function(h){f(li(a,r,h),h)}):M(e,f);function f(h,v){var c=a.getDimensionInfo(v);!c||c.otherDims.tooltip===!1||(o?u.push(ba("nameValue",{markerType:"subItem",markerColor:i,name:c.displayName,value:h,valueType:c.type})):(s.push(h),l.push(c.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var pr=St();function go(e,t){return e.getName(t)||e.getId(t)}var rD="__universalTransitionEnabled",$e=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return t.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=na({count:iD,reset:aD}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=pr(this).sourceManager=new WC(this);a.prepareSource();var o=this.getInitialData(r,i);Bd(o,this),this.dataTask.context.data=o,pr(this).dataBeforeProcessed=o,Nd(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=ya(this),a=i?Na(r):{},o=this.subType;ct.hasClass(o)&&(o+="Series"),yt(r,n.getTheme().get(this.subType)),yt(r,this.getDefaultOption()),gv(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Nr(r,a,i)},t.prototype.mergeOption=function(r,n){r=yt(this.option,r,!0),this.fillDataTextStyle(r.data);var i=ya(this);i&&Nr(this.option,r,i);var a=pr(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);Bd(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,pr(this).dataBeforeProcessed=o,Nd(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!te(r))for(var n=["show"],i=0;i=0&&v<0)&&(h=y,v=m,c=0),m===v&&(f[c++]=p))}),f.length=c,f},t.prototype.formatTooltip=function(r,n,i){return tD({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(tt.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,o=$h.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},t.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},t.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},t.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[go(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[rD])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},t.prototype._innerSelect=function(r,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){Z(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,f=0;f0&&this._innerSelect(r,n)}},t.registerClass=function(r){return ct.registerClass(r)},t.protoInitialize=(function(){var r=t.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"})(),t})(ct);Ze($e,AC);Ze($e,$h);Rm($e,ct);function Nd(e){var t=e.name;dh(e)||(e.name=nD(e)||t)}function nD(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return M(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function iD(e){return e.model.getRawData().count()}function aD(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),oD}function oD(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Bd(e,t){M(q1(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,At(sD,t))})}function sD(e,t){var r=xf(e);return r&&r.setOutputEnd((t||this).count()),t}function xf(e){var t=(e.ecModel||{}).scheduler,r=t&&t.getPipeline(e.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(e.uid))}return n}}var Xe=(function(){function e(){this.group=new Rt,this.uid=Ks("viewComponent")}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){},e.prototype.updateLayout=function(t,r,n,i){},e.prototype.updateVisual=function(t,r,n,i){},e.prototype.toggleBlurSeries=function(t,r,n){},e.prototype.eachRendered=function(t){var r=this.group;r&&r.traverse(t)},e})();gh(Xe);Bs(Xe);function Qh(){var e=St();return function(t){var r=e(t),n=t.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var a0=St(),lD=Qh(),De=(function(){function e(){this.group=new Rt,this.uid=Ks("viewChart"),this.renderTask=na({plan:uD,reset:fD}),this.renderTask.context={view:this}}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.highlight=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&zd(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&zd(a,i,"normal")},e.prototype.remove=function(t,r){this.group.removeAll()},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateLayout=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateVisual=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.eachRendered=function(t){Ys(this.group,t)},e.markUpdateMethod=function(t,r){a0(t).updateMethod=r},e.protoInitialize=(function(){var t=e.prototype;t.type="chart"})(),e})();function Fd(e,t,r){e&&hf(e)&&(t==="emphasis"?hs:cs)(e,r)}function zd(e,t,r){var n=Cn(e,t),i=t&&t.highlightKey!=null?hw(t.highlightKey):null;n!=null?M($t(n),function(a){Fd(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){Fd(a,r,i)})}gh(De);Bs(De);function uD(e){return lD(e.model)}function fD(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&a0(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),hD[l]}var hD={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},_s="\0__throttleOriginMethod",Gd="\0__throttleRate",Vd="\0__throttleType";function Jh(e,t,r){var n,i=0,a=0,o=null,s,l,u,f;t=t||0;function h(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var v=function(){for(var c=[],d=0;d=0?h():o=setTimeout(h,-s),i=n};return v.clear=function(){o&&(clearTimeout(o),o=null)},v.debounceNextCall=function(c){f=c},v}function o0(e,t,r,n){var i=e[t];if(i){var a=i[_s]||i,o=i[Vd],s=i[Gd];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=Jh(a,r,n==="debounce"),i[_s]=a,i[Vd]=n,i[Gd]=r}return i}}function wf(e,t){var r=e[t];r&&r[_s]&&(r.clear&&r.clear(),e[t]=r[_s])}var Hd=St(),Wd={itemStyle:ca(yy,!0),lineStyle:ca(my,!0)},cD={lineStyle:"stroke",itemStyle:"fill"};function s0(e,t){var r=e.visualStyleMapper||Wd[t];return r||(console.warn("Unknown style type '"+t+"'."),Wd.itemStyle)}function l0(e,t){var r=e.visualDrawType||cD[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var vD={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=s0(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=l0(e,n),u=o[l],f=Q(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||f||h){var v=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=v,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Q(o.fill)?v:o.fill,o.stroke=o.stroke==="auto"||Q(o.stroke)?v:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&f)return r.setVisual("colorFromPalette",!1),{dataEach:function(c,d){var p=e.getDataParams(d),g=N({},o);g[l]=f(p),c.setItemVisual(d,"style",g)}}}},Ai=new _t,dD={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=s0(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Ai.option=l[n];var u=i(Ai),f=o.ensureUniqueItemVisual(s,"style");N(f,u),Ai.option.decal&&(o.setItemVisual(s,"decal",Ai.option.decal),Ai.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},pD={performRawSeries:!0,overallReset:function(e){var t=et();e.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var i=r.type+"-"+n,a=t.get(i);a||(a={},t.set(i,a)),Hd(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=Hd(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=l0(r,s);a.each(function(u){var f=a.getRawIndex(u);i[f]=u}),n.each(function(u){var f=i[u],h=a.getItemVisual(f,"colorFromPalette");if(h){var v=a.ensureUniqueItemVisual(f,"style"),c=n.getName(u)||u+"",d=n.count();v[l]=r.getColorFromPalette(c,o,d)}})}})}},mo=Math.PI;function gD(e,t){t=t||{},dt(t,{text:"loading",textColor:q.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:q.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new Rt,n=new wt({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new ee({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new wt({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});r.add(a);var o;return t.showSpinner&&(o=new Us({shape:{startAngle:-mo/2,endAngle:-mo/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:mo*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:mo*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(e.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),f=e.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:f}),a.setShape({x:u-l,y:f-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},r.resize(),r}var u0=(function(){function e(t,r,n,i){this._stageTaskMap=et(),this.ecInstance=t,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(t,r){t.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},e.prototype.getPerformArgs=function(t,r){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},e.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},e.prototype.updateStreamModes=function(t,r){var n=this._pipelineMap.get(t.uid),i=t.getData(),a=i.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&a>=n.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},e.prototype.restorePipelines=function(t){var r=this,n=r._pipelineMap=et();t.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),r._pipe(i,i.dataTask)})},e.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,r=this.api.getModel(),n=this.api;M(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";Me(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},e.prototype.prepareView=function(t,r,n,i){var a=t.renderTask,o=a.context;o.model=r,o.ecModel=n,o.api=i,a.__block=!t.incrementalPrepareRender,this._pipe(r,a)},e.prototype.performDataProcessorTasks=function(t,r){this._performStageTasks(this._dataProcessorHandlers,t,r,{block:!0})},e.prototype.performVisualTasks=function(t,r,n){this._performStageTasks(this._visualHandlers,t,r,n)},e.prototype._performStageTasks=function(t,r,n,i){i=i||{};var a=!1,o=this;M(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var f=o._stageTaskMap.get(l.uid),h=f.seriesTaskMap,v=f.overallTask;if(v){var c,d=v.agentStubMap;d.each(function(g){s(i,g)&&(g.dirty(),c=!0)}),c&&v.dirty(),o.updatePayload(v,n);var p=o.getPerformArgs(v,i.block);d.each(function(g){g.perform(p)}),v.perform(p)&&(a=!0)}else h&&h.each(function(g,m){s(i,g)&&g.dirty();var y=o.getPerformArgs(g,i.block);y.skip=!l.performRawSeries&&r.isSeriesFiltered(g.context.model),o.updatePayload(g,n),g.perform(y)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},e.prototype.performSeriesTasks=function(t){var r;t.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(t){var r=t.tail;do{if(r.__block){t.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},e.prototype.updatePayload=function(t,r){r!=="remain"&&(t.context.payload=r)},e.prototype._createSeriesStageTask=function(t,r,n,i){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=et(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(f):l?n.eachRawSeriesByType(l,f):u&&u(n,i).each(f);function f(h){var v=h.uid,c=s.set(v,o&&o.get(v)||na({plan:SD,reset:xD,count:TD}));c.context={model:h,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(h,c)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||na({reset:mD});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=et(),u=t.seriesType,f=t.getTargetSeries,h=!0,v=!1,c="";Me(!t.createOnAllSeries,c),u?n.eachRawSeriesByType(u,d):f?f(n,i).each(d):(h=!1,M(n.getSeries(),d));function d(p){var g=p.uid,m=l.set(g,s&&s.get(g)||(v=!0,na({reset:yD,onDirty:bD})));m.context={model:p,overallProgress:h},m.agent=o,m.__block=h,a._pipe(p,m)}v&&o.dirty()},e.prototype._pipe=function(t,r){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},e.wrapStageHandler=function(t,r){return Q(t)&&(t={overallReset:t,seriesType:CD(t)}),t.uid=Ks("stageHandler"),r&&(t.visualType=r),t},e})();function mD(e){e.overallReset(e.ecModel,e.api,e.payload)}function yD(e){return e.overallProgress&&_D}function _D(){this.agent.dirty(),this.getDownstream().dirty()}function bD(){this.agent&&this.agent.dirty()}function SD(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function xD(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=$t(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?$(t,function(r,n){return f0(n)}):wD}var wD=f0(0);function f0(e){return function(t,r){var n=r.data,i=r.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&c===u.length-v.length){var d=u.slice(0,c);d!=="data"&&(r.mainType=d,r[v.toLowerCase()]=l,f=!0)}}s.hasOwnProperty(u)&&(n[u]=l,f=!0),f||(i[u]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},e.prototype.filter=function(t,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return f(l,o,"mainType")&&f(l,o,"subType")&&f(l,o,"index","componentIndex")&&f(l,o,"name")&&f(l,o,"id")&&f(u,a,"name")&&f(u,a,"dataIndex")&&f(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,r.otherQuery,i,a));function f(h,v,c,d){return h[c]==null||v[d||c]===h[c]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e})(),Tf=["symbol","symbolSize","symbolRotate","symbolOffset"],jd=Tf.concat(["symbolKeepAspect"]),AD={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData();if(e.legendIcon&&r.setVisual("legendIcon",e.legendIcon),!e.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&yn(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function Yd(e,t,r){for(var n=t.type==="radial"?YD(e,t,r):jD(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:vt(e)?[e]:H(e)?e:null}function tc(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&XD(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=$(r,function(a){return a/i}),n/=i)}return[r,n]}var ZD=new Er(!0);function Ss(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function Xd(e){return typeof e=="string"&&e!=="none"}function xs(e){var t=e.fill;return t!=null&&t!=="none"}function Zd(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function qd(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function Kd(e,t,r){var n=mh(t.image,t.__image,r);if(Fs(n)){var i=e.createPattern(n,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Ro),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function qD(e,t,r,n){var i,a=Ss(r),o=xs(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var f=t.path||ZD,h=t.__dirty;if(!n){var v=r.fill,c=r.stroke,d=o&&!!v.colorStops,p=a&&!!c.colorStops,g=o&&!!v.image,m=a&&!!c.image,y=void 0,_=void 0,b=void 0,S=void 0,x=void 0;(d||p)&&(x=t.getBoundingRect()),d&&(y=h?Yd(e,v,x):t.__canvasFillGradient,t.__canvasFillGradient=y),p&&(_=h?Yd(e,c,x):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),g&&(b=h||!t.__canvasFillPattern?Kd(e,v,t):t.__canvasFillPattern,t.__canvasFillPattern=b),m&&(S=h||!t.__canvasStrokePattern?Kd(e,c,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),d?e.fillStyle=y:g&&(b?e.fillStyle=b:o=!1),p?e.strokeStyle=_:m&&(S?e.strokeStyle=S:a=!1)}var T=t.getGlobalScale();f.setScale(T[0],T[1],t.segmentIgnoreThreshold);var A,L;e.setLineDash&&r.lineDash&&(i=tc(t),A=i[0],L=i[1]);var D=!0;(u||h&$n)&&(f.setDPR(e.dpr),l?f.setContext(null):(f.setContext(e),D=!1),f.reset(),t.buildPath(f,t.shape,n),f.toStatic(),t.pathUpdated()),D&&f.rebuildPath(e,l?s:1),A&&(e.setLineDash(A),e.lineDashOffset=L),n||(r.strokeFirst?(a&&qd(e,r),o&&Zd(e,r)):(o&&Zd(e,r),a&&qd(e,r))),A&&e.setLineDash([])}function KD(e,t,r){var n=t.__image=mh(r.image,t.__image,t,t.onload);if(!(!n||!Fs(n))){var i=r.x||0,a=r.y||0,o=t.getWidth(),s=t.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var u=r.sx||0,f=r.sy||0;e.drawImage(n,u,f,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,f=r.sy,h=o-u,v=s-f;e.drawImage(n,u,f,h,v,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function QD(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||lr,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=tc(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(Ss(r)&&e.strokeText(i,r.x,r.y),xs(r)&&e.fillText(i,r.x,r.y)):(xs(r)&&e.fillText(i,r.x,r.y),Ss(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var Qd=["shadowBlur","shadowOffsetX","shadowOffsetY"],Jd=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function p0(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){Qt(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?Sn.opacity:o}(n||t.blend!==r.blend)&&(a||(Qt(e,i),a=!0),e.globalCompositeOperation=t.blend||Sn.blend);for(var s=0;s0&&r.unfinished);r.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(r,n,i){if(!this[Ct]){if(this._disposed){this.id;return}var a,o,s;if(Z(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Ct]=!0,Un(this),!this._model||n){var l=new sC(this._api),u=this._theme,f=this._model=new Xh;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},If);var h={seriesTransition:s,optionChanged:!0};if(i)this[It]={silent:a,updateParams:h},this[Ct]=!1,this.getZr().wakeUp();else{try{fn(this),tr.update.call(this,null,h)}catch(v){throw this[It]=null,this[Ct]=!1,v}this._ssr||this._zr.flush(),this[It]=null,this[Ct]=!1,Hn.call(this,a),Wn.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[Ct]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[It]&&(a==null&&(a=this[It].silent),o=this[It].updateParams,this[It]=null),this[Ct]=!0,Un(this);try{this._updateTheme(r),i.setTheme(this._theme),fn(this),tr.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Ct]=!1,s}this[Ct]=!1,Hn.call(this,a),Wn.call(this,a)}}},t.prototype._updateTheme=function(r){Y(r)&&(r=I0[r]),r&&(r=it(r),r&&Hy(r,!0),this._theme=r)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||tt.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},t.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},t.prototype.getSvgDataURL=function(){var r=this._zr,n=r.storage.getDisplayList();return M(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()},t.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],o=this;M(n,function(l){i.eachComponent({mainType:l},function(u){var f=o._componentsMap[u.__viewId];f.group.ignore||(a.push(f),f.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return M(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(dp[i]){var l=s,u=s,f=-s,h=-s,v=[],c=r&&r.pixelRatio||this.getDevicePixelRatio();M(ia,function(_,b){if(_.group===i){var S=n?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(it(r)),x=_.getDom().getBoundingClientRect();l=a(x.left,l),u=a(x.top,u),f=o(x.right,f),h=o(x.bottom,h),v.push({dom:S,left:x.left,top:x.top})}}),l*=c,u*=c,f*=c,h*=c;var d=f-l,p=h-u,g=kr.createCanvas(),m=hv(g,{renderer:n?"svg":"canvas"});if(m.resize({width:d,height:p}),n){var y="";return M(v,function(_){var b=_.left-l,S=_.top-u;y+=''+_.dom+""}),m.painter.getSvgRoot().innerHTML=y,r.connectedBackgroundColor&&m.painter.setBackgroundColor(r.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return r.connectedBackgroundColor&&m.add(new wt({shape:{x:0,y:0,width:d,height:p},style:{fill:r.connectedBackgroundColor}})),M(v,function(_){var b=new qe({style:{x:_.left*c-l,y:_.top*c-u,image:_.dom}});m.add(b)}),m.refreshImmediately(),g.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},t.prototype.convertToPixel=function(r,n,i){return So(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return So(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return So(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=Ml(i,r);return M(o,function(s,l){l.indexOf("Models")>=0&&M(s,function(u){var f=u.coordinateSystem;if(f&&f.containPoint)a=a||!!f.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=Ml(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?PD(s,l,n):ID(s,n)},t.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},t.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},t.prototype._initEvents=function(){var r=this;M(TM,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,f=i==="globalout";if(f?u={}:l&&Ui(l,function(p){var g=lt(p);if(g&&g.dataIndex!=null){var m=g.dataModel||s.getSeriesByIndex(g.seriesIndex);return u=m&&m.getDataParams(g.dataIndex,g.dataType,l)||{},!0}else if(g.eventData)return u=N({},g.eventData),!0},!0),u){var h=u.componentType,v=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",v=u.seriesIndex);var c=h&&v!=null&&s.getComponent(h,v),d=c&&r[c.mainType==="series"?"_chartsMap":"_componentsMap"][c.__viewId];u.event=o,u.type=i,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:c,view:d},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;M(Lf,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),kD(n,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&Im(this.getDom(),nc,"");var n=this,i=n._api,a=n._model;M(n._componentsViews,function(o){o.dispose(a,i)}),M(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete ia[n.id]},t.prototype.resize=function(r){if(!this[Ct]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[It]&&(a==null&&(a=this[It].silent),i=!0,this[It]=null),this[Ct]=!0,Un(this);try{i&&fn(this),tr.update.call(this,{type:"resize",animation:N({duration:0},r&&r.animation)})}catch(o){throw this[Ct]=!1,o}this[Ct]=!1,Hn.call(this,a),Wn.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(Z(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!kf[r]){var i=kf[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(r){var n=N({},r);return n.type=Af[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(Z(n)||(n={silent:!!n}),!!ws[r.type]&&this._model){if(this[Ct]){this._pendingActions.push(r);return}var i=n.silent;ou.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&tt.browser.weChat&&this._throttledZrFlush(),Hn.call(this,i),Wn.call(this,i)}},t.prototype.updateLabelLayout=function(){we.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=(function(){fn=function(h){var v=h._scheduler;v.restorePipelines(h._model),v.prepareStageTasks(),iu(h,!0),iu(h,!1),v.plan()},iu=function(h,v){for(var c=h._model,d=h._scheduler,p=v?h._componentsViews:h._chartsViews,g=v?h._componentsMap:h._chartsMap,m=h._zr,y=h._api,_=0;_v.get("hoverLayerThreshold")&&!tt.node&&!tt.worker&&v.eachSeries(function(g){if(!g.preventUsingHoverLayer){var m=h._chartsMap[g.__viewId];m.__alive&&m.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function s(h,v){var c=h.get("blendMode")||null;v.eachRendered(function(d){d.isGroup||(d.style.blend=c)})}function l(h,v){if(!h.preventAutoZ){var c=dy(h);v.eachRendered(function(d){return py(d,c.z,c.zlevel),!0})}}function u(h,v){v.eachRendered(function(c){if(!Ji(c)){var d=c.getTextContent(),p=c.getTextGuideLine();c.stateTransition&&(c.stateTransition=null),d&&d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),c.hasState()?(c.prevStates=c.currentStates,c.clearStates()):c.prevStates&&(c.prevStates=null)}})}function f(h,v){var c=h.getModel("stateAnimation"),d=h.isAnimationEnabled(),p=c.get("duration"),g=p>0?{duration:p,delay:c.get("delay"),easing:c.get("easing")}:null;v.eachRendered(function(m){if(m.states&&m.states.emphasis){if(Ji(m))return;if(m instanceof ht&&cw(m),m.__dirty){var y=m.prevStates;y&&m.useStates(y)}if(d){m.stateTransition=g;var _=m.getTextContent(),b=m.getTextGuideLine();_&&(_.stateTransition=g),b&&(b.stateTransition=g)}m.__dirty&&a(m)}})}cp=function(h){return new((function(v){V(c,v);function c(){return v!==null&&v.apply(this,arguments)||this}return c.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},c.prototype.getComponentByElement=function(d){for(;d;){var p=d.__ecComponentInfo;if(p!=null)return h._model.getComponent(p.mainType,p.index);d=d.parent}},c.prototype.enterEmphasis=function(d,p){hs(d,p),le(h)},c.prototype.leaveEmphasis=function(d,p){cs(d,p),le(h)},c.prototype.enterBlur=function(d){rw(d),le(h)},c.prototype.leaveBlur=function(d){$m(d),le(h)},c.prototype.enterSelect=function(d){Xm(d),le(h)},c.prototype.leaveSelect=function(d){Zm(d),le(h)},c.prototype.getModel=function(){return h.getModel()},c.prototype.getViewOfComponentModel=function(d){return h.getViewOfComponentModel(d)},c.prototype.getViewOfSeriesModel=function(d){return h.getViewOfSeriesModel(d)},c.prototype.getMainProcessVersion=function(){return h[_o]},c})(Gy))(h)},L0=function(h){function v(c,d){for(var p=0;p=0)){pp.push(r);var a=u0.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function O0(e,t){kf[e]=t}function kM(e,t,r){var n=uM("registerMap");n&&n(e,t,r)}var RM=BC;An(ec,vD);An(rl,dD);An(rl,pD);An(ec,AD);An(rl,LD);An(w0,sM);R0(Hy);E0(cM,_C);O0("default",gD);mi({type:xn,event:xn,update:xn},Yt);mi({type:Go,event:Go,update:Go},Yt);mi({type:us,event:Sh,update:us,action:Yt,refineEvent:oc,publishNonRefinedEvent:!0});mi({type:of,event:Sh,update:of,action:Yt,refineEvent:oc,publishNonRefinedEvent:!0});mi({type:fs,event:Sh,update:fs,action:Yt,refineEvent:oc,publishNonRefinedEvent:!0});function oc(e,t,r,n){return{eventContent:{selected:sw(r),isFromClick:t.isFromClick||!1}}}k0("default",{});k0("dark",v0);function Pi(e){return e==null?0:e.length||1}function gp(e){return e}var EM=(function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||gp,this._newKeyGetter=i||gp,this.context=a,this._diffModeMultiple=o==="multiple"}return e.prototype.add=function(t){return this._add=t,this},e.prototype.update=function(t){return this._update=t,this},e.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},e.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},e.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},e.prototype.remove=function(t){return this._remove=t,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var t=this._old,r=this._new,n={},i=new Array(t.length),a=new Array(r.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var o=0;o1){var f=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(f,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},e.prototype._executeMultiple=function(){var t=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(t,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&v===1)this._updateManyToOne&&this._updateManyToOne(f,u),i[l]=null;else if(h===1&&v>1)this._updateOneToMany&&this._updateOneToMany(f,u),i[l]=null;else if(h===1&&v===1)this._update&&this._update(f,u),i[l]=null;else if(h>1&&v>1)this._updateManyToMany&&this._updateManyToMany(f,u),i[l]=null;else if(h>1)for(var c=0;c1)for(var s=0;s30}var Ii=Z,gr=$,VM=typeof Int32Array>"u"?Array:Int32Array,HM="e\0\0",mp=-1,WM=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],UM=["_approximateExtent"],yp,wo,ki,Ri,uu,Ei,fu,jM=(function(){function e(t,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;B0(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},f=0;f=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===oe;if(l&&!i.pure)for(var u=[],f=t;f0},e.prototype.ensureUniqueItemVisual=function(t,r){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var a=i[r];return a==null&&(a=this.getVisual(r),H(a)?a=a.slice():Ii(a)&&(a=N({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Ii(r)?N(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){Ii(t)?N(this._layout,t):this._layout[t]=r},e.prototype.getLayout=function(t){return this._layout[t]},e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},e.prototype.setItemLayout=function(t,r,n){this._itemLayouts[t]=n?N(this._itemLayouts[t]||{},r):r},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(t,r){var n=this.hostModel&&this.hostModel.seriesIndex;Yx(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){M(this._graphicEls,function(n,i){n&&t&&t.call(r,n,i)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:gr(this.dimensions,this._getDimInfo,this),this.hostModel)),uu(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Q(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(ih(arguments)))})},e.internalField=(function(){yp=function(t){var r=t._invertedIndicesMap;M(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new VM(o.categories.length);for(var l=0;l1&&(l+="__ec__"+f),i[r]=l}}})(),e})();function YM(e,t){Zh(e)||(e=Wy(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=et(),a=[],o=XM(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&G0(o),l=n===e.dimensionsDefine,u=l?z0(e):F0(n),f=t.encodeDefine;!f&&t.encodeDefaulter&&(f=t.encodeDefaulter(e,o));for(var h=et(f),v=new Ky(o),c=0;c0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function XM(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return M(t,function(a){var o;Z(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function ZM(e,t,r){if(r||t.hasKey(e)){for(var n=0;t.hasKey(e+n);)n++;e+=n}return t.set(e,!0),e}var qM=(function(){function e(t){this.coordSysDims=[],this.axisMap=et(),this.categoryAxisMap=et(),this.coordSysName=t}return e})();function KM(e){var t=e.get("coordinateSystem"),r=new qM(t),n=QM[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var QM={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",ge).models[0],a=e.getReferringComponents("yAxis",ge).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),jn(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),jn(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",ge).models[0];t.coordSysDims=["single"],r.set("single",i),jn(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",ge).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),jn(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),jn(o)&&(n.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(e,t,r,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,r,n){var i=e.ecModel,a=i.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();M(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),f=o[l];r.set(f,u),jn(u)&&(n.set(f,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",ge).models[0];t.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),o=i.getDimensionModel("y");r.set("x",a),r.set("y",o),n.set("x",a),n.set("y",o)}};function jn(e){return e.get("type")==="category"}function JM(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;tA(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,f,h,v;if(M(a,function(y,_){Y(y)&&(a[_]=y={name:y}),l&&!y.isExtraCoord&&(!n&&!u&&y.ordinalMeta&&(u=y),!f&&y.type!=="ordinal"&&y.type!=="time"&&(!i||i===y.coordDim)&&(f=y))}),f&&!n&&!u&&(n=!0),f){h="__\0ecstackresult_"+e.id,v="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var c=f.coordDim,d=f.type,p=0;M(a,function(y){y.coordDim===c&&p++});var g={name:h,coordDim:c,coordDimIndex:p,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:v,coordDim:v,coordDimIndex:p+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(v,d),m.storeDimIndex=s.ensureCalculationDimension(h,d)),o.appendCalculationDimension(g),o.appendCalculationDimension(m)):(a.push(g),a.push(m))}return{stackedDimension:f&&f.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:v,stackResultDimension:h}}function tA(e){return!B0(e.schema)}function fi(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function eA(e,t){return fi(e,t)?e.getCalculationInfo("stackResultDimension"):t}function rA(e,t){var r=e.get("coordinateSystem"),n=jh.get(r),i;return t&&t.coordSysDims&&(i=$(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=BM(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function nA(e,t,r){var n,i;return r&&M(e,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(e[n].otherDims.itemName=0),n}function sc(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;i=n.getSource(),a=i.sourceFormat===oe;var o=KM(t),s=rA(t,o),l=r.useEncodeDefaulter,u=Q(l)?l:l?At(XT,s,t):null,f={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=YM(i,f),v=nA(h.dimensions,r.createInvertedIndices,o),c=a?null:n.getSharedDataStore(h),d=JM(t,{schema:h,store:c}),p=new jM(h,t);p.setCalculationInfo(d);var g=v!=null&&iA(i)?function(m,y,_,b){return b===v?_:this.defaultDimValueGetter(m,y,_,b)}:null;return p.hasItemOption=!1,p.initData(a?i:c,null,g),p}function iA(e){if(e.sourceFormat===oe){var t=aA(e.data||[]);return!H(Ra(t))}}function aA(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=wa(o),l=a.niceTickExtent=[Bt(Math.ceil(e[0]/o)*o,s),Bt(Math.floor(e[1]/o)*o,s)];return sA(l,e),a}function hu(e){var t=Math.pow(10,vh(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,Bt(r*t)}function wa(e){return ir(e)+2}function _p(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function sA(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),_p(e,0,t),_p(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function lc(e,t){return e>=t[0]&&e<=t[1]}var lA=(function(){function e(){this.normalize=bp,this.scale=Sp}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=gt(t.normalize,t),this.scale=gt(t.scale,t)):(this.normalize=bp,this.scale=Sp)},e})();function bp(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function Sp(e,t){return e*(t[1]-t[0])+t[0]}function Ef(e,t,r){var n=Math.log(e);return[Math.log(r?t[0]:Math.max(0,t[0]))/n,Math.log(r?t[1]:Math.max(0,t[1]))/n]}var zr=(function(){function e(t){this._calculator=new lA,this._setting=t||{},this._extent=[1/0,-1/0]}return e.prototype.getSetting=function(t){return this._setting[t]},e.prototype._innerUnionExtent=function(t){var r=this._extent;this._innerSetExtent(t[0]r[1]?t[1]:r[1])},e.prototype.unionExtentFromData=function(t,r){this._innerUnionExtent(t.getApproximateExtent(r))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(t,r){this._innerSetExtent(t,r)},e.prototype._innerSetExtent=function(t,r){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(r)||(n[1]=r),this._brkCtx&&this._brkCtx.update(n)},e.prototype.setBreaksFromOption=function(t){},e.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},e.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},e.prototype.hasBreaks=function(){return this._brkCtx?this._brkCtx.hasBreaks():!1},e.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},e.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(t){this._isBlank=t},e})();Bs(zr);var uA=0,Of=(function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++uA,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&$(n,fA);return new e({categories:i,needCollect:!i,deduplication:r.dedplication!==!1})},e.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},e.prototype.parseAndCollect=function(t){var r,n=this._needCollect;if(!Y(t)&&!n)return t;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=t,this._onCollect&&this._onCollect(t,r),r;var i=this._getOrCreateMap();return r=i.get(t),r==null&&(n?(r=this.categories.length,this.categories[r]=t,i.set(t,r),this._onCollect&&this._onCollect(t,r)):r=NaN),r},e.prototype._getOrCreateMap=function(){return this._map||(this._map=et(this.categories))},e})();function fA(e){return Z(e)&&e.value!=null?e.value:e+""}var V0=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new Of({})),H(i)&&(i=new Of({categories:$(i,function(a){return Z(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return t.prototype.parse=function(r){return r==null?NaN:Y(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return lc(r,this._extent)&&r>=0&&r=0&&r=0&&r=r},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t})(zr);zr.registerClass(V0);var mr=Bt,hi=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return t.prototype.parse=function(r){return r==null||r===""?NaN:Number(r)},t.prototype.contain=function(r){return lc(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=wa(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=ms(),l=[];if(!n)return l;r.breakTicks;var u=1e4;i[0]=0&&(h=mr(h+v*n,o))}if(l.length>0&&h===l[l.length-1].value)break;if(l.length>u)return[]}var c=l.length?l[l.length-1].value:a[1];return i[1]>c&&(r.expandToNicedExtent?l.push({value:mr(c+n,o)}):l.push({value:i[1]})),r.breakTicks,l},t.prototype.getMinorTicks=function(r){for(var n=this.getTicks({expandToNicedExtent:!0}),i=[],a=this.getExtent(),o=1;oa[0]&&d0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function j0(e){var t=vA(e),r=[];return M(e,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],f=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),v=Math.abs(h[1]-h[0]);s=u?f/v*u:f}else{var c=n.getData();s=Math.abs(o[1]-o[0])/c.count()}var d=jt(n.get("barWidth"),s),p=jt(n.get("barMaxWidth"),s),g=jt(n.get("barMinWidth")||($0(n)?.5:1),s),m=n.get("barGap"),y=n.get("barCategoryGap"),_=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:d,barMaxWidth:p,barMinWidth:g,barGap:m,barCategoryGap:y,defaultBarGap:_,axisKey:uc(a),stackId:W0(n)})}),dA(r)}function dA(e){var t={};M(e,function(n,i){var a=n.axisKey,o=n.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:n.defaultBarGap||0,stacks:{}},l=s.stacks;t[a]=s;var u=n.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var f=n.barWidth;f&&!l[u].width&&(l[u].width=f,f=Math.min(s.remainedWidth,f),s.remainedWidth-=f);var h=n.barMaxWidth;h&&(l[u].maxWidth=h);var v=n.barMinWidth;v&&(l[u].minWidth=v);var c=n.barGap;c!=null&&(s.gap=c);var d=n.barCategoryGap;d!=null&&(s.categoryGap=d)});var r={};return M(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=st(a).length;s=Math.max(35-l*4,15)+"%"}var u=jt(s,o),f=jt(n.gap,1),h=n.remainedWidth,v=n.autoWidthCount,c=(h-u)/(v+(v-1)*f);c=Math.max(c,0),M(a,function(m){var y=m.maxWidth,_=m.minWidth;if(m.width){var b=m.width;y&&(b=Math.min(b,y)),_&&(b=Math.max(b,_)),m.width=b,h-=b+f*b,v--}else{var b=c;y&&yb&&(b=_),b!==c&&(m.width=b,h-=b+f*b,v--)}}),c=(h-u)/(v+(v-1)*f),c=Math.max(c,0);var d=0,p;M(a,function(m,y){m.width||(m.width=c),p=m,d+=m.width*(1+f)}),p&&(d-=p.width*f);var g=-d/2;M(a,function(m,y){r[i][y]=r[i][y]||{bandWidth:o,offset:g,width:m.width},g+=m.width*(1+f)})}),r}function pA(e,t,r){if(e&&t){var n=e[uc(t)];return n}}function gA(e,t){var r=U0(e,t),n=j0(r);M(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=W0(i),u=n[uc(s)][l],f=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:f,size:h})})}function mA(e){return{seriesType:e,plan:Qh(),reset:function(t){if(Y0(t)){var r=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(i.dim)),l=t.get("showBackground",!0),u=r.mapDimension(a.dim),f=r.getCalculationInfo("stackResultDimension"),h=fi(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),v=a.isHorizontal(),c=yA(i,a),d=$0(t),p=t.get("barMinHeight")||0,g=f&&r.getDimensionIndex(f),m=r.getLayout("size"),y=r.getLayout("offset");return{progress:function(_,b){for(var S=_.count,x=d&&ar(S*3),T=d&&l&&ar(S*3),A=d&&ar(S),L=n.master.getRect(),D=v?L.width:L.height,C,I=b.getStore(),P=0;(C=_.next())!=null;){var k=I.get(h?g:o,C),R=I.get(s,C),E=c,W=void 0;h&&(W=+k-I.get(o,C));var O=void 0,B=void 0,j=void 0,U=void 0;if(v){var z=n.dataToPoint([k,R]);if(h){var G=n.dataToPoint([W,R]);E=G[0]}O=E,B=z[1]+y,j=z[0]-E,U=m,Math.abs(j)0?r:1:r))}var _A=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=To.length,s=Math.min(_A(To,this._approxInterval,0,o),o-1);this._interval=To[s][1],this._intervalPrecision=wa(this._interval),this._minLevelUnit=To[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return vt(r)?r:+pi(r)},t.prototype.contain=function(r){return lc(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.type="time",t})(hi),To=[["second",Bh],["minute",Fh],["hour",ta],["quarter-day",ta*6],["half-day",ta*12],["day",me*1.2],["half-week",me*3.5],["week",me*7],["month",me*31],["quarter",me*95],["half-year",ld/2],["year",ld]];function bA(e,t,r,n){return gf(new Date(t),e,n).getTime()===gf(new Date(r),e,n).getTime()}function SA(e,t){return e/=me,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function xA(e){var t=30*me;return e/=t,e>6?6:e>3?3:e>2?2:1}function wA(e){return e/=ta,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function xp(e,t){return e/=t?Fh:Bh,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function TA(e){return Cm(e)}function CA(e,t,r){var n=Math.max(0,ft(wn,t)-1);return gf(new Date(e),wn[n],r).getTime()}function DA(e,t){var r=new Date(0);r[e](1);var n=r.getTime();r[e](1+t);var i=r.getTime()-n;return function(a,o){return Math.max(0,Math.round((o-a)/i))}}function MA(e,t,r,n,i,a){var o=1e4,s=MT,l=0;function u(P,k,R,E,W,O,B){for(var j=DA(W,P),U=k,z=new Date(U);Uo));)if(z[W](z[E]()+P),U=z.getTime(),a){var G=a.calcNiceTickMultiple(U,j);G>0&&(z[W](z[E]()+G*P),U=z.getTime())}B.push({value:U,notAdd:!0})}function f(P,k,R){var E=[],W=!k.length;if(!bA(ea(P),n[0],n[1],r)){W&&(k=[{value:CA(n[0],P,r)},{value:n[1]}]);for(var O=0;O=n[0]&&B<=n[1]&&u(U,B,j,z,G,J,E),P==="year"&&R.length>1&&O===0&&R.unshift({value:R[0].value-U})}}for(var O=0;O=n[0]&&b<=n[1]&&c++)}var S=i/t;if(c>S*1.5&&d>S/1.5||(h.push(y),c>S||e===s[p]))break}v=[]}}}for(var x=Mt($(h,function(P){return Mt(P,function(k){return k.value>=n[0]&&k.value<=n[1]&&!k.notAdd})}),function(P){return P.length>0}),T=[],A=x.length-1,p=0;p0;)a*=10;var s=[Nf(LA(n[0]/a)*a),Nf(AA(n[1]/a)*a)];this._interval=a,this._intervalPrecision=wa(a),this._niceExtent=s}},t.prototype.calcNiceExtent=function(r){e.prototype.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},t.prototype.contain=function(r){return r=Do(r)/Do(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=Do(r)/Do(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),Co(this.base,r)},t.prototype.setBreaksFromOption=function(r){},t.type="log",t})(hi);function cu(e,t){return Nf(e,ir(t))}zr.registerClass(Z0);var PA=(function(){function e(t,r,n){this._prepareParams(t,r,n)}return e.prototype._prepareParams=function(t,r,n){n[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!f&&(l=0));var v=this._determinedMin,c=this._determinedMax;return v!=null&&(s=v,u=!0),c!=null&&(l=c,f=!0),{min:s,max:l,minFixed:u,maxFixed:f,isBlank:h}},e.prototype.modifyDataMinMax=function(t,r){this[kA[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=IA[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e})(),IA={min:"_determinedMin",max:"_determinedMax"},kA={min:"_dataMin",max:"_dataMax"};function RA(e,t,r){var n=e.rawExtentInfo;return n||(n=new PA(e,t,r),e.rawExtentInfo=n,n)}function Mo(e,t){return t==null?null:sa(t)?NaN:e.parse(t)}function q0(e,t){var r=e.type,n=RA(e,t,e.getExtent()).calculate();e.setBlank(n.isBlank);var i=n.min,a=n.max,o=t.ecModel;if(o&&r==="time"){var s=U0("bar",o),l=!1;if(M(s,function(h){l=l||h.getBaseAxis()===t.axis}),l){var u=j0(s),f=EA(i,a,t,u);i=f.min,a=f.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function EA(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=pA(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;M(o,function(c){s=Math.min(c.offset,s)});var l=-1/0;M(o,function(c){l=Math.max(c.offset+c.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,f=t-e,h=1-(s+l)/a,v=f/h-f;return t+=v*(l/u),e-=v*(s/u),{min:e,max:t}}function wp(e,t){var r=t,n=q0(e,r),i=n.extent,a=r.get("splitNumber");e instanceof Z0&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(Q0(r)),e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&e.setInterval&&e.setInterval(s)}function OA(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new V0({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new X0({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(zr.getClass(t)||hi)}}function NA(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function Ba(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=AT(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(Y(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Q(t)){if(e.type==="category")return function(i,a){return t(Cs(e,i),i.value-e.scale.getExtent()[0],null)};var n=ms();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(Cs(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function Cs(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function fc(e){var t=e.get("interval");return t??"auto"}function K0(e){return e.type==="category"&&fc(e.getLabelModel())===0}function BA(e,t){var r={};return M(e.mapDimensionsAll(t),function(n){r[eA(e,n)]=!0}),st(r)}function ci(e){return e==="middle"||e==="center"}function Ta(e){return e.getShallow("show")}function Q0(e){var t=e.get("breaks",!0);t==null}var FA=(function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e})(),Tp=[],zA={registerPreprocessor:R0,registerProcessor:E0,registerPostInit:AM,registerPostUpdate:LM,registerUpdateLifecycle:ic,registerAction:mi,registerCoordinateSystem:PM,registerLayout:IM,registerVisual:An,registerTransform:RM,registerLoading:O0,registerMap:kM,registerImpl:lM,PRIORITY:SM,ComponentModel:ct,ComponentView:Xe,SeriesModel:$e,ChartView:De,registerComponentModel:function(e){ct.registerClass(e)},registerComponentView:function(e){Xe.registerClass(e)},registerSeriesModel:function(e){$e.registerClass(e)},registerChartView:function(e){De.registerClass(e)},registerCustomSeries:function(e,t){},registerSubTypeDefaulter:function(e,t){ct.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){_S(e,t)}};function Br(e){if(H(e)){M(e,function(t){Br(t)});return}ft(Tp,e)>=0||(Tp.push(e),Q(e)&&(e={install:e}),e.install(zA))}var GA=St(),aa=St(),Ae={estimate:1,determine:2};function Ds(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function J0(e,t){var r=$(t,function(n){return e.scale.parse(n)});return e.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function VA(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=Ba(e),i=e.scale.getExtent(),a=J0(e,r),o=Mt(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:$(o,function(s){var l={value:s};return{formattedLabel:n(l),rawLabel:e.scale.getLabel(l),tickValue:s,time:void 0,break:void 0}})}}return e.type==="category"?WA(e,t):jA(e)}function HA(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=J0(e,n);return{ticks:Mt(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?UA(e,t):{ticks:$(e.scale.getTicks(r),function(o){return o.value})}}function WA(e,t){var r=e.getLabelModel(),n=t_(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function t_(e,t,r){var n=$A(e),i=fc(t),a=r.kind===Ae.estimate;if(!a){var o=r_(n,i);if(o)return o}var s,l;Q(i)?s=a_(e,i):(l=i==="auto"?XA(e,r):i,s=i_(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return Bf(n,i,u),!0}):Bf(n,i,u),u}function UA(e,t){var r=YA(e),n=fc(t),i=r_(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Q(n))a=a_(e,n,!0);else if(n==="auto"){var s=t_(e,e.getLabelModel(),Ds(Ae.determine));o=s.labelCategoryInterval,a=$(s.labels,function(l){return l.tickValue})}else o=n,a=i_(e,o,!0);return Bf(r,n,{ticks:a,tickCategoryInterval:o})}function jA(e){var t=e.scale.getTicks(),r=Ba(e);return{labels:$(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var YA=e_("axisTick"),$A=e_("axisLabel");function e_(e){return function(r){return aa(r)[e]||(aa(r)[e]={list:[]})}}function r_(e,t){for(var r=0;rf&&(u=Math.max(1,Math.floor(l/f)));for(var h=s[0],v=e.dataToCoord(h+1)-e.dataToCoord(h),c=Math.abs(v*Math.cos(a)),d=Math.abs(v*Math.sin(a)),p=0,g=0;h<=s[1];h+=u){var m=0,y=0,_=bm(i({value:h}),n.font,"center","top");m=_.width*1.3,y=_.height*1.3,p=Math.max(p,m,7),g=Math.max(g,y,7)}var b=p/c,S=g/d;isNaN(b)&&(b=1/0),isNaN(S)&&(S=1/0);var x=Math.max(0,Math.floor(Math.min(b,S)));if(r===Ae.estimate)return t.out.noPxChangeTryDetermine.push(gt(qA,null,e,x,l)),x;var T=n_(e,x,l);return T??x}function qA(e,t,r){return n_(e,t,r)==null}function n_(e,t,r){var n=GA(e.model),i=e.getExtent(),a=n.lastAutoInterval,o=n.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-r)<=1&&a>t&&n.axisExtent0===i[0]&&n.axisExtent1===i[1])return a;n.lastTickCount=r,n.lastAutoInterval=t,n.axisExtent0=i[0],n.axisExtent1=i[1]}function KA(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function i_(e,t,r){var n=Ba(e),i=e.scale,a=i.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],f=i.count();u!==0&&l>1&&f/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=K0(e),v=o.get("showMinLabel")||h,c=o.get("showMaxLabel")||h;v&&u!==a[0]&&p(a[0]);for(var d=u;d<=a[1];d+=l)p(d);c&&d-l!==a[1]&&p(a[1]);function p(g){var m={value:g};s.push(r?g:{formattedLabel:n(m),rawLabel:i.getLabel(m),tickValue:g,time:void 0,break:void 0})}return s}function a_(e,t,r){var n=e.scale,i=Ba(e),a=[];return M(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;t(o.value,s)&&a.push(r?l:{formattedLabel:i(o),rawLabel:s,tickValue:l,time:void 0,break:void 0})}),a}var Cp=[0,1],QA=(function(){function e(t,r,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=r,this._extent=n||[0,0]}return e.prototype.contain=function(t){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return t>=n&&t<=i},e.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(t){return CS(t||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(t,r){var n=this._extent;n[0]=t,n[1]=r},e.prototype.dataToCoord=function(t,r){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&i.type==="ordinal"&&(n=n.slice(),Dp(n,i.count())),vv(t,Cp,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),Dp(n,i.count()));var a=vv(t,n,Cp,r);return this.scale.scale(a)},e.prototype.pointToData=function(t,r){},e.prototype.getTicksCoords=function(t){t=t||{};var r=t.tickModel||this.getTickModel(),n=HA(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=$(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return JA(this,a,o,t.clamp),a},e.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),r=t.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=$(n,function(a){return $(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||Ds(Ae.determine),VA(this,t).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var t=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},e.prototype.calculateCategoryInterval=function(t){return t=t||Ds(Ae.determine),ZA(this,t)},e})();function Dp(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function JA(e,t,r,n){var i=t.length;if(!e.onBand||r||!i)return;var a=e.getExtent(),o,s;if(i===1)t[0].coord=a[0],t[0].onBand=!0,o=t[1]={coord:a[1],tickValue:t[0].tickValue,onBand:!0};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;M(t,function(c){c.coord-=u/2,c.onBand=!0});var f=e.scale.getExtent();s=1+f[1]-t[i-1].tickValue,o={coord:t[i-1].coord+u*s,tickValue:f[1]+1,onBand:!0},t.push(o)}var h=a[0]>a[1];v(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&v(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),v(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&v(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function v(c,d){return c=Bt(c),d=Bt(d),h?c>d:c-1&&(u.style.stroke=u.style.fill,u.style.fill=q.color.neutral00,u.style.lineWidth=2),n},t.type="series.line",t.dependencies=["grid","polar"],t.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},t})($e);function cc(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=li(e,t,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(t[a])}return n.join(" ")}var vc=(function(e){V(t,e);function t(r,n,i,a){var o=e.call(this)||this;return o.updateData(r,n,i,a),o}return t.prototype._createSymbol=function(r,n,i,a,o,s){this.removeAll();var l=ui(r,-1,-1,2,2,null,s);l.attr({z2:X(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=o2,this._symbolType=r,this.add(l)},t.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){hs(this.childAt(0))},t.prototype.downplay=function(){cs(this.childAt(0))},t.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},t.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},t.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=t.getSymbolSize(r,n),u=t.getSymbolZ2(r,n),f=o!==this._symbolType,h=a&&a.disableAnimation;if(f){var v=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,v)}else{var c=this.childAt(0);c.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};h?c.attr(d):ae(c,d,s,n),ly(c)}if(this._updateCommon(r,n,l,i,a),f){var c=this.childAt(0);if(!h){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:c.style.opacity}};c.scaleX=c.scaleY=0,c.style.opacity=0,ur(c,d,s,n)}}h&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,f,h,v,c,d,p,g,m;if(a&&(u=a.emphasisItemStyle,f=a.blurItemStyle,h=a.selectItemStyle,v=a.focus,c=a.blurScope,p=a.labelStatesModels,g=a.hoverScale,m=a.cursorStyle,d=a.emphasisDisabled),!a||r.hasItemOption){var y=a&&a.itemModel?a.itemModel:r.getItemModel(n),_=y.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),h=y.getModel(["select","itemStyle"]).getItemStyle(),f=y.getModel(["blur","itemStyle"]).getItemStyle(),v=_.get("focus"),c=_.get("blurScope"),d=_.get("disabled"),p=Zs(y),g=_.getShallow("scale"),m=y.getShallow("cursor")}var b=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(b||0)*Math.PI/180||0);var S=d0(r.getItemVisual(n,"symbolOffset"),i);S&&(s.x=S[0],s.y=S[1]),m&&s.attr("cursor",m);var x=r.getItemVisual(n,"style"),T=x.fill;if(s instanceof qe){var A=s.style;s.useStyle(N({image:A.image,x:A.x,y:A.y,width:A.width,height:A.height},x))}else s.__isEmptyBrush?s.useStyle(N({},x)):s.useStyle(x),s.style.decal=null,s.setColor(T,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var L=r.getItemVisual(n,"liftZ"),D=this._z2;L!=null?D==null&&(this._z2=s.z2,s.z2+=L):D!=null&&(s.z2=D,this._z2=null);var C=o&&o.useNameLabel;Xs(s,p,{labelFetcher:l,labelDataIndex:n,defaultText:I,inheritColor:T,defaultOpacity:x.opacity});function I(R){return C?r.getName(R):cc(r,R)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var P=s.ensureState("emphasis");P.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=f;var k=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;P.scaleX=this._sizeX*k,P.scaleY=this._sizeY*k,this.setSymbolScale(1),vs(this,v,c,d)},t.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},t.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),o=lt(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&ds(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();ds(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return UD(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t})(Rt);function o2(e,t){this.parent.drift(e,t)}function du(e,t,r,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&e.getItemVisual(r,"symbol")!=="none"}function Pp(e){return e!=null&&!Z(e)&&(e={isIgnore:e}),e||{}}function Ip(e){var t=e.hostModel,r=t.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Zs(t),cursorStyle:t.get("cursor")}}var s2=(function(){function e(t){this.group=new Rt,this._SymbolCtor=t||vc}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=Pp(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=Ip(t),u={disableAnimation:s},f=r.getSymbolPoint||function(h){return t.getItemLayout(h)};a||n.removeAll(),t.diff(a).add(function(h){var v=f(h);if(du(t,v,h,r)){var c=new o(t,h,l,u);c.setPosition(v),t.setItemGraphicEl(h,c),n.add(c)}}).update(function(h,v){var c=a.getItemGraphicEl(v),d=f(h);if(!du(t,d,h,r)){n.remove(c);return}var p=t.getItemVisual(h,"symbol")||"circle",g=c&&c.getSymbolType&&c.getSymbolType();if(!c||g&&g!==p)n.remove(c),c=new o(t,h,l,u),c.setPosition(d);else{c.updateData(t,h,l,u);var m={x:d[0],y:d[1]};s?c.attr(m):ae(c,m,i)}n.add(c),t.setItemGraphicEl(h,c)}).remove(function(h){var v=a.getItemGraphicEl(h);v&&v.fadeOut(function(){n.remove(v)},i)}).execute(),this._getSymbolPoint=f,this._data=t},e.prototype.updateLayout=function(){var t=this,r=this._data;r&&r.eachItemGraphicEl(function(n,i){var a=t._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Ip(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=Pp(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a0?r=n[0]:n[1]<0&&(r=n[1]),r}function f_(e,t,r,n){var i=NaN;e.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=r.get(e.baseDim,n),o[1-a]=i,t.dataToPoint(o)}function u2(e,t){var r=[];return t.diff(e).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,i){r.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function f2(e,t,r,n,i,a,o,s){for(var l=u2(e,t),u=[],f=[],h=[],v=[],c=[],d=[],p=[],g=u_(i,t,o),m=e.getLayout("points")||[],y=t.getLayout("points")||[],_=0;_=i||p<0)break;if(Tn(m,y)){if(l){p+=a;continue}break}if(p===r)e[a>0?"moveTo":"lineTo"](m,y),h=m,v=y;else{var _=m-u,b=y-f;if(_*_+b*b<.5){p+=a;continue}if(o>0){for(var S=p+a,x=t[S*2],T=t[S*2+1];x===m&&T===y&&g=n||Tn(x,T))c=m,d=y;else{D=x-u,C=T-f;var k=m-u,R=x-m,E=y-f,W=T-y,O=void 0,B=void 0;if(s==="x"){O=Math.abs(k),B=Math.abs(R);var j=D>0?1:-1;c=m-j*O*o,d=y,I=m+j*B*o,P=y}else if(s==="y"){O=Math.abs(E),B=Math.abs(W);var U=C>0?1:-1;c=m,d=y-U*O*o,I=m,P=y+U*B*o}else O=Math.sqrt(k*k+E*E),B=Math.sqrt(R*R+W*W),L=B/(B+O),c=m-D*o*(1-L),d=y-C*o*(1-L),I=m+D*o*L,P=y+C*o*L,I=yr(I,_r(x,m)),P=yr(P,_r(T,y)),I=_r(I,yr(x,m)),P=_r(P,yr(T,y)),D=I-m,C=P-y,c=m-D*O/B,d=y-C*O/B,c=yr(c,_r(u,m)),d=yr(d,_r(f,y)),c=_r(c,yr(u,m)),d=_r(d,yr(f,y)),D=m-c,C=y-d,I=m+D*B/O,P=y+C*B/O}e.bezierCurveTo(h,v,c,d,m,y),h=I,v=P}else e.lineTo(m,y)}u=m,f=y,p+=a}return g}var h_=(function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e})(),h2=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polyline",n}return t.prototype.getDefaultStyle=function(){return{stroke:q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new h_},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Tn(i[o*2-2],i[o*2-1]);o--);for(;a=0){var b=u?(d-l)*_+l:(c-s)*_+s;return u?[r,b]:[b,r]}s=c,l=d;break;case o.C:c=a[h++],d=a[h++],p=a[h++],g=a[h++],m=a[h++],y=a[h++];var S=u?Jo(s,c,p,m,r,f):Jo(l,d,g,y,r,f);if(S>0)for(var x=0;x=0){var b=u?Nt(l,d,g,y,T):Nt(s,c,p,m,T);return u?[r,b]:[b,r]}}s=m,l=y;break}}},t})(ht),c2=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(h_),v2=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polygon",n}return t.prototype.getDefaultShape=function(){return new c2},t.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Tn(i[s*2-2],i[s*2-1]);s--);for(;ot){a?r.push(o(a,l,t)):i&&r.push(o(i,l,0),o(i,l,t));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function m2(e,t,r){var n=e.getVisual("visualMeta");if(!(!n||!n.length||!e.count())&&t.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=e.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=t.getAxis(i),u=$(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),f=u.length,h=a.outerColors.slice();f&&u[0].coord>u[f-1].coord&&(u.reverse(),h.reverse());var v=g2(u,i==="x"?r.getWidth():r.getHeight()),c=v.length;if(!c&&f)return u[0].coord<0?h[1]?h[1]:u[f-1].color:h[0]?h[0]:u[0].color;var d=10,p=v[0].coord-d,g=v[c-1].coord+d,m=g-p;if(m<.001)return"transparent";M(v,function(_){_.offset=(_.coord-p)/m}),v.push({offset:c?v[c-1].offset:.5,color:h[1]||"transparent"}),v.unshift({offset:c?v[0].offset:.5,color:h[0]||"transparent"});var y=new oy(0,0,0,0,v,!0);return y[i]=p,y[i+"2"]=g,y}}}function y2(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&_2(a,t))){var o=t.mapDimension(a.dim),s={};return M(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function _2(e,t){var r=e.getExtent(),n=Math.abs(r[1]-r[0])/e.scale.count();isNaN(n)&&(n=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function b2(e,t){return isNaN(e)||isNaN(t)}function S2(e){for(var t=e.length/2;t>0&&b2(e[t*2-2],e[t*2-1]);t--);return t-1}function Np(e,t){return[e[t*2],e[t*2+1]]}function x2(e,t,r){for(var n=e.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function d_(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var B=d.getState("emphasis").style;B.lineWidth=+d.style.lineWidth+1}lt(d).seriesIndex=r.seriesIndex,vs(d,E,W,O);var j=Op(r.get("smooth")),U=r.get("smoothMonotone");if(d.setShape({smooth:j,smoothMonotone:U,connectNulls:T}),p){var z=s.getCalculationInfo("stackedOnSeries"),G=0;p.useStyle(dt(u.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),z&&(G=Op(z.get("smooth"))),p.setShape({smooth:j,stackedOnSmooth:G,smoothMonotone:U,connectNulls:T}),ff(p,r,"areaStyle"),lt(p).seriesIndex=r.seriesIndex,vs(p,E,W,O)}var J=this._changePolyState;s.eachItemGraphicEl(function(ot){ot&&(ot.onHoverStateChange=J)}),this._polyline.onHoverStateChange=J,this._data=s,this._coordSys=a,this._stackedOnPoints=S,this._points=f,this._step=D,this._valueOrigin=_,r.get("triggerLineEvent")&&(this.packEventData(r,d),p&&this.packEventData(r,p))},t.prototype.packEventData=function(r,n){lt(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},t.prototype.highlight=function(r,n,i,a){var o=r.getData(),s=Cn(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var f=l[s*2],h=l[s*2+1];if(isNaN(f)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(f,h))return;var v=r.get("zlevel")||0,c=r.get("z")||0;u=new vc(o,s),u.x=f,u.y=h,u.setZ(v,c);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=v,d.z=c,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else De.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=Cn(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else De.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;Vv(this._polyline,r),n&&Vv(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new h2({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},t.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new v2({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},t.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,f=u.get("animationDuration");Q(f)&&(f=f(null));var h=u.get("animationDelay")||0,v=Q(h)?h(null):h;r.eachItemGraphicEl(function(c,d){var p=c;if(p){var g=[c.x,c.y],m=void 0,y=void 0,_=void 0;if(i)if(o){var b=i,S=n.pointToCoord(g);a?(m=b.startAngle,y=b.endAngle,_=-S[1]/180*Math.PI):(m=b.r0,y=b.r,_=S[0])}else{var x=i;a?(m=x.x,y=x.x+x.width,_=c.x):(m=x.y+x.height,y=x.y,_=c.y)}var T=y===m?0:(_-m)/(y-m);l&&(T=1-T);var A=Q(h)?h(d):f*T+v,L=p.getSymbolPath(),D=L.getTextContent();p.attr({scaleX:0,scaleY:0}),p.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:A}),D&&D.animateFrom({style:{opacity:0}},{duration:300,delay:A}),L.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(d_(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new ee({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var f=S2(l);f>=0&&(Xs(s,Zs(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:f,defaultText:function(h,v,c){return c!=null?l_(o,c):cc(o,h)},enableTextSetter:!0},w2(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(r,n,i,a,o,s,l){var u=this._endLabel,f=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=i.getLayout("points"),v=i.hostModel,c=v.get("connectNulls"),d=s.get("precision"),p=s.get("distance")||0,g=l.getBaseAxis(),m=g.isHorizontal(),y=g.inverse,_=n.shape,b=y?m?_.x:_.y+_.height:m?_.x+_.width:_.y,S=(m?p:0)*(y?-1:1),x=(m?0:-p)*(y?-1:1),T=m?"x":"y",A=x2(h,b,T),L=A.range,D=L[1]-L[0],C=void 0;if(D>=1){if(D>1&&!c){var I=Np(h,L[0]);u.attr({x:I[0]+S,y:I[1]+x}),o&&(C=v.getRawValue(L[0]))}else{var I=f.getPointOn(b,T);I&&u.attr({x:I[0]+S,y:I[1]+x});var P=v.getRawValue(L[0]),k=v.getRawValue(L[1]);o&&(C=$S(i,d,P,k,A.t))}a.lastFrameIndex=L[0]}else{var R=r===1||a.lastFrameIndex>0?L[0]:0,I=Np(h,R);o&&(C=v.getRawValue(R)),u.attr({x:I[0]+S,y:I[1]+x})}if(o){var E=qs(u);typeof E.setLabelText=="function"&&E.setLabelText(C)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,f=this._polygon,h=r.hostModel,v=f2(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),c=v.current,d=v.stackedOnCurrent,p=v.next,g=v.stackedOnNext;if(o&&(d=br(v.stackedOnCurrent,v.current,i,o,l),c=br(v.current,null,i,o,l),g=br(v.stackedOnNext,v.next,i,o,l),p=br(v.next,null,i,o,l)),Ep(c,p)>3e3||f&&Ep(d,g)>3e3){u.stopAnimation(),u.setShape({points:p}),f&&(f.stopAnimation(),f.setShape({points:p,stackedOnPoints:g}));return}u.shape.__points=v.current,u.shape.points=c;var m={shape:{points:p}};v.current!==c&&(m.shape.__points=v.next),u.stopAnimation(),ae(u,m,h),f&&(f.setShape({points:c,stackedOnPoints:d}),f.stopAnimation(),ae(f,{shape:{stackedOnPoints:g}},h),u.shape.points!==f.shape.points&&(f.shape.points=u.shape.points));for(var y=[],_=v.status,b=0;b<_.length;b++){var S=_[b].cmd;if(S==="="){var x=r.getItemGraphicEl(_[b].idx1);x&&y.push({el:x,ptIdx:b})}}u.animators&&u.animators.length&&u.animators[0].during(function(){f&&f.dirtyShape();for(var T=u.shape.__points,A=0;At&&(t=e[r]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,r=0;r10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),f=l.getExtent(),h=n.getDevicePixelRatio(),v=Math.abs(f[1]-f[0])*(h||1),c=Math.round(s/v);if(isFinite(c)&&c>1){a==="lttb"?t.setData(i.lttbDownSample(i.mapDimension(u.dim),1/c)):a==="minmax"&&t.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/c));var d=void 0;Y(a)?d=D2[a]:Q(a)&&(d=a),d&&t.setData(i.downSample(i.mapDimension(u.dim),1/c,d,M2))}}}}}function A2(e){e.registerChartView(T2),e.registerSeriesModel(a2),e.registerLayout(C2("line")),e.registerVisual({seriesType:"line",reset:function(t){var r=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,p_("line"))}var zf=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return sc(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(r,n,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(r),s=a.dataToPoint(o);if(i)M(a.getAxes(),function(v,c){if(v.type==="category"&&n!=null){var d=v.getTicksCoords(),p=v.getTickModel().get("alignWithLabel"),g=o[c],m=n[c]==="x1"||n[c]==="y1";if(m&&!p&&(g+=1),d.length<2)return;if(d.length===2){s[c]=v.toGlobalCoord(v.getExtent()[m?1:0]);return}for(var y=void 0,_=void 0,b=1,S=0;Sg){_=(x+y)/2;break}S===1&&(b=T-d[0].tickValue)}_==null&&(y?y&&(_=d[d.length-1].coord):_=d[0].coord),s[c]=v.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),f=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+f/2}return s}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},t})($e);$e.registerClass(zf);var L2=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(){return sc(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},t.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=_y(zf.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:q.color.primary,borderWidth:2}},realtimeSort:!1}),t})(zf),P2=(function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e})(),Bp=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;return n.type="sausage",n}return t.prototype.getDefaultShape=function(){return new P2},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,f=n.startAngle,h=n.endAngle,v=n.clockwise,c=Math.PI*2,d=v?h-fMath.PI/2&&fs)return!0;s=h}return!1},t.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},t.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},t.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Vo(a,r,lt(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t})(De),Fp={cartesian2d:function(e,t){var r=t.width<0?-1:1,n=t.height<0?-1:1;r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=gu(t.x,e.x),s=mu(t.x+t.width,i),l=gu(t.y,e.y),u=mu(t.y+t.height,a),f=si?s:o,t.y=h&&l>a?u:l,t.width=f?0:s-o,t.height=h?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),f||h},polar:function(e,t){var r=t.r0<=t.r?1:-1;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}var i=mu(t.r,e.r),a=gu(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}return o}},zp={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new wt({shape:N({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var f=u.shape,h=i?"height":"width";f[h]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?Bp:gi,f=new u({shape:n,z2:1});f.name="item";var h=g_(i);if(f.calculateTextPosition=I2(h,{isRoundCap:u===Bp}),a){var v=f.shape,c=i?"r":"endAngle",d={};v[c]=i?n.r0:n.startAngle,d[c]=n[c],(s?ae:ur)(f,{shape:d},a)}return f}};function N2(e,t){var r=e.get("realtimeSort",!0),n=t.getBaseAxis();if(r&&n.type==="category"&&t.type==="cartesian2d")return{baseAxis:n,otherAxis:t.getOtherAxis(n)}}function Gp(e,t,r,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?ae:ur)(r,{shape:l},t,i,null);var f=t?e.baseAxis.model:null;(o?ae:ur)(r,{shape:u},f,i)}function Vp(e,t){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(e,t,r){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function z2(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function g_(e){return(function(t){var r=t?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}})(e)}function Wp(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var f=e.shape,h=R2(n.getModel("itemStyle"),f);N(f,h),e.setShape(f)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var v=n.getShallow("cursor");v&&e.attr("cursor",v);var c=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",d=Zs(n);Xs(e,d,{labelFetcher:a,labelDataIndex:r,defaultText:cc(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:c});var p=e.getTextContent();if(s&&p){var g=n.get(["label","position"]);e.textConfig.inside=g==="middle"?!0:null,k2(e,g==="outside"?c:g,g_(o),n.get(["label","rotate"]))}uT(p,d,a.getRawValue(r),function(y){return l_(t,y)});var m=n.getModel(["emphasis"]);vs(e,m.get("focus"),m.get("blurScope"),m.get("disabled")),ff(e,n),z2(i)&&(e.style.fill="none",e.style.stroke="none",M(e.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function G2(e,t){var r=e.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,a)}var V2=(function(){function e(){}return e})(),Up=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;return n.type="largeBar",n}return t.prototype.getDefaultShape=function(){return new V2},t.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,f=0;f=0?r:null},30,!1);function H2(e,t,r){for(var n=e.baseDimIdx,i=1-n,a=e.shape.points,o=e.largeDataIndices,s=[],l=[],u=e.barWidth,f=0,h=a.length/3;f=s[0]&&t<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[f]}return-1}function m_(e,t,r){if(dc(r,"cartesian2d")){var n=t,i=r.getArea();return{x:e?n.x:i.x,y:e?i.y:n.y,width:e?n.width:i.width,height:e?i.height:n.height}}else{var i=r.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}}function W2(e,t,r){var n=e.type==="polar"?gi:wt;return new n({shape:m_(t,r,e),silent:!0,z2:0})}function U2(e){e.registerChartView(O2),e.registerSeriesModel(L2),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,At(gA,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,mA("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,p_("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,r){var n=t.componentType||"series";r.eachComponent({mainType:n,query:t},function(i){t.sortInfo&&i.axis.setCategorySortInfo(t.sortInfo)})})}var y_={left:0,right:0,top:0,bottom:0},Ls=["25%","25%"],j2=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Na(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Nr(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Nr(this.option.outerBounds,r.outerBounds)},t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:y_,outerBoundsContain:"all",outerBoundsClampWidth:Ls[0],outerBoundsClampHeight:Ls[1],backgroundColor:q.color.transparent,borderWidth:1,borderColor:q.color.neutral30},t})(ct),Gf=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ge).models[0]},t.type="cartesian2dAxis",t})(ct);Ze(Gf,FA);var __={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:q.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:q.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:q.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[q.color.backgroundTint,q.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:q.color.neutral00,borderColor:q.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},Y2=yt({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},__),pc=yt({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:q.color.axisMinorSplitLine,width:1}}},__),$2=yt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},pc),X2=dt({logBase:10},pc);const Z2={category:Y2,value:pc,time:$2,log:X2};var q2={value:1,category:1,time:1,log:1},K2=null;function Q2(){return K2}function $p(e,t,r,n){M(q2,function(i,a){var o=yt(yt({},Z2[a],!0),n,!0),s=(function(l){V(u,l);function u(){var f=l!==null&&l.apply(this,arguments)||this;return f.type=t+"Axis."+a,f}return u.prototype.mergeDefaultAndTheme=function(f,h){var v=ya(this),c=v?Na(f):{},d=h.getTheme();yt(f,d.get(a+"Axis")),yt(f,this.getDefaultOption()),f.type=Xp(f),v&&Nr(f,c,v)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=Of.createByAxisModel(this))},u.prototype.getCategories=function(f){var h=this.option;if(h.type==="category")return f?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(f){return{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u})(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",Xp)}function Xp(e){return e.type||(e.data?"category":"value")}var J2=(function(){function e(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return e.prototype.getAxis=function(t){return this._axes[t]},e.prototype.getAxes=function(){return $(this._dimList,function(t){return this._axes[t]},this)},e.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),Mt(this.getAxes(),function(r){return r.scale.type===t})},e.prototype.addAxis=function(t){var r=t.dim;this._axes[r]=t,this._dimList.push(r)},e})(),Vf=["x","y"];function Zp(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var tL=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=Vf,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!Zp(r)||!Zp(n))){var i=r.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var f=(s[0]-o[0])/l,h=(s[1]-o[1])/u,v=o[0]-i[0]*f,c=o[1]-a[0]*h,d=this._transform=[f,0,0,h,v,c];this._invTransform=Pa([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},t.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},t.prototype.containZone=function(r,n){var i=this.dataToPoint(r),a=this.dataToPoint(n),o=this.getArea(),s=new at(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},t.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return ye(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},t.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},t.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return ye(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.toLocalCoord(r[1]),n),i},t.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},t.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-r,o=Math.min(i[0],i[1])-r,s=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-o+r;return new at(a,o,s,l)},t})(J2),eL=(function(e){V(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},t.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},t.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},t.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},t})(QA),rL="expandAxisBreak",Dr=Math.PI,nL=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],iL=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Ca=St(),b_=St(),S_=(function(){function e(t){this.recordMap={},this.resolveAxisNameOverlap=t}return e.prototype.ensureRecord=function(t){var r=t.axis.dim,n=t.componentIndex,i=this.recordMap,a=i[r]||(i[r]=[]);return a[n]||(a[n]={ready:{}})},e})();function aL(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=gc(e.axisName)&&ci(e.nameLocation);M(n,function(d){var p=Fr(d);if(!(!p||p.label.ignore)){o.push(p);var g=a.transGroup;l&&(g.transform?Pa(Oi,g.transform):sh(Oi),p.transform&&Xi(Oi,Oi,p.transform),at.copy(Io,p.localRect),Io.applyTransform(Oi),s?s.union(Io):at.copy(s=new at(0,0,0,0),Io))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",f=a.transGroup[u];if(o.sort(function(d,p){return Math.abs(d.label[u]-f)-Math.abs(p.label[u]-f)}),l&&s){var h=i.getExtent(),v=Math.min(h[0],h[1]),c=Math.max(h[0],h[1])-v;s.union(new at(v,0,c,1))}a.stOccupiedRect=s,a.labelInfoList=o}var Oi=sr(),Io=new at(0,0,0,0),x_=function(e,t,r,n,i,a){if(ci(e.nameLocation)){var o=a.stOccupiedRect;o&&w_(r2({},o,a.transGroup.transform),n,i)}else T_(a.labelInfoList,a.dirVec,n,i)};function w_(e,t,r){var n=new pt;hc(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&n2(t,n)}function T_(e,t,r,n){for(var i=pt.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):os(i-Dr)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},e.makeAxisEventDataBase=function(t){var r={componentType:t.mainType,componentIndex:t.componentIndex};return r[t.mainType+"Index"]=t.componentIndex,r},e.isLabelSilent=function(t){var r=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||r&&r.show)},e})(),oL=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],sL={axisLine:function(e,t,r,n,i,a,o){var s=n.get(["axisLine","show"]);if(s==="auto"&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),!!s){var l=n.axis.getExtent(),u=a.transform,f=[l[0],0],h=[l[1],0],v=f[0]>h[0];u&&(ye(f,f,u),ye(h,h,u));var c=N({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),d={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:c};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())Q2().buildAxisBreakLine(n,i,a,d);else{var p=new Or(N({shape:{x1:f[0],y1:f[1],x2:h[0],y2:h[1]}},d));pa(p.shape,p.style.lineWidth),p.anid="line",i.add(p)}var g=n.get(["axisLine","symbol"]);if(g!=null){var m=n.get(["axisLine","symbolSize"]);Y(g)&&(g=[g,g]),(Y(m)||vt(m))&&(m=[m,m]);var y=d0(n.get(["axisLine","symbolOffset"])||0,m),_=m[0],b=m[1];M([{rotate:e.rotation+Math.PI/2,offset:y[0],r:0},{rotate:e.rotation-Math.PI/2,offset:y[1],r:Math.sqrt((f[0]-h[0])*(f[0]-h[0])+(f[1]-h[1])*(f[1]-h[1]))}],function(S,x){if(g[x]!=="none"&&g[x]!=null){var T=ui(g[x],-_/2,-b/2,_,b,c.stroke,!0),A=S.r+S.offset,L=v?h:f;T.attr({rotation:S.rotate,x:L[0]+A*Math.cos(e.rotation),y:L[1]-A*Math.sin(e.rotation),silent:!0,z2:11}),i.add(T)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=Kp(t,i,s);l&&qp(e,t,r,n,i,a,o,Ae.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=Kp(t,i,s);l&&qp(e,t,r,n,i,a,o,Ae.determine);var u=hL(e,i,a,n);fL(e,t.labelLayoutList,u),cL(e,i,a,n,e.tickDirection)},axisName:function(e,t,r,n,i,a,o,s){var l=r.ensureRecord(n);t.nameEl&&(i.remove(t.nameEl),t.nameEl=l.nameLayout=l.nameLocation=null);var u=e.axisName;if(gc(u)){var f=e.nameLocation,h=e.nameDirection,v=n.getModel("nameTextStyle"),c=n.get("nameGap")||0,d=n.axis.getExtent(),p=n.axis.inverse?-1:1,g=new pt(0,0),m=new pt(0,0);f==="start"?(g.x=d[0]-p*c,m.x=-p):f==="end"?(g.x=d[1]+p*c,m.x=p):(g.x=(d[0]+d[1])/2,g.y=e.labelOffset+h*c,m.y=h);var y=sr();m.transform(lh(y,y,e.rotation));var _=n.get("nameRotate");_!=null&&(_=_*Dr/180);var b,S;ci(f)?b=Ir.innerTextLayout(e.rotation,_??e.rotation,h):(b=lL(e.rotation,f,_||0,d),S=e.raw.axisNameAvailableWidth,S!=null&&(S=Math.abs(S/Math.sin(b.rotation)),!isFinite(S)&&(S=null)));var x=v.getFont(),T=n.get("nameTruncate",!0)||{},A=T.ellipsis,L=qo(e.raw.nameTruncateMaxWidth,T.maxWidth,S),D=s.nameMarginLevel||0,C=new ee({x:g.x,y:g.y,rotation:b.rotation,silent:Ir.isLabelSilent(n),style:si(v,{text:u,font:x,overflow:"truncate",width:L,ellipsis:A,fill:v.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:v.get("align")||b.textAlign,verticalAlign:v.get("verticalAlign")||b.textVerticalAlign}),z2:1});if(js({el:C,componentModel:n,itemName:u}),C.__fullText=u,C.anid="name",n.get("triggerEvent")){var I=Ir.makeAxisEventDataBase(n);I.targetType="axisName",I.name=u,lt(C).eventData=I}a.add(C),C.updateTransform(),t.nameEl=C;var P=l.nameLayout=Fr({label:C,priority:C.z2,defaultAttr:{ignore:C.ignore},marginDefault:ci(f)?nL[D]:iL[D]});if(l.nameLocation=f,i.add(C),C.decomposeTransform(),e.shouldNameMoveOverlap&&P){var k=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,P,m,k)}}}};function qp(e,t,r,n,i,a,o,s){D_(t)||vL(e,t,i,s,n,o);var l=t.labelLayoutList;dL(e,n,l,a),e.rotation;var u=e.optionHideOverlap;uL(n,l,u),u&&i2(Mt(l,function(f){return f&&!f.label.ignore})),aL(e,r,n,l)}function lL(e,t,r,n){var i=Tm(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return os(i-Dr/2)?(o=l?"bottom":"top",a="center"):os(i-Dr*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iDr/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function uL(e,t,r){if(K0(e.axis))return;function n(s,l,u){var f=Fr(t[l]),h=Fr(t[u]);if(!(!f||!h)){if(s===!1||f.suggestIgnore){ji(f.label);return}if(h.suggestIgnore){ji(h.label);return}var v=.1;if(!r){var c=[0,0,0,0];f=Ap({marginForce:c},f),h=Ap({marginForce:c},h)}hc(f,h,null,{touchThreshold:v})&&ji(s?h.label:f.label)}}var i=e.get(["axisLabel","showMinLabel"]),a=e.get(["axisLabel","showMaxLabel"]),o=t.length;n(i,0,1),n(a,o-1,o-2)}function fL(e,t,r){e.showMinorTicks||M(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(d)&&isFinite(u[0]);)c=hu(c),d=u[1]-c*o;else{var g=e.getTicks().length-1;g>o&&(c=hu(c));var m=c*o;p=Math.ceil(u[1]/c)*c,d=Bt(p-m),d<0&&u[0]>=0?(d=0,p=Bt(m)):p>0&&u[1]<=0&&(p=0,d=-Bt(m))}var y=(i[0].value-a[0].value)/s,_=(i[o].value-a[o].value)/s;n.setExtent.call(e,d+c*y,p+c*_),n.setInterval.call(e,c),(y||_)&&n.setNiceExtent.call(e,d+c,p-c)}var Jp=[[3,1],[0,2]],SL=(function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Vf,this._initCartesian(t,r,n),this.model=t}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(t,r){var n=this._axesMap;this._updateScale(t,this.model);function i(o){var s,l=st(o),u=l.length;if(u){for(var f=[],h=u-1;h>=0;h--){var v=+l[h],c=o[v],d=c.model,p=c.scale;Rf(p)&&d.get("alignTicks")&&d.get("interval")==null?f.push(c):(wp(p,d),Rf(p)&&(s=c))}f.length&&(s||(s=f.pop(),wp(s.scale,s.model)),M(f,function(g){bL(g.scale,g.model,s.scale)}))}}i(n.x),i(n.y);var a={};M(n.x,function(o){tg(n,"y",o,a)}),M(n.y,function(o){tg(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=ky(t,r),a=this._rect=ma(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(M_(o,a),!n){var u=wL(a,s,o,l,r),f=void 0;if(l)f=ng(a.clone(),"axisLabel",null,a,o,u,i);else{var h=TL(t,a,i),v=h.outerBoundsRect,c=h.parsedOuterBoundsContain,d=h.outerBoundsClamp;v&&(f=ng(v,c,d,a,o,u,i))}A_(a,o,Ae.determine,null,f,i)}M(this._coordsList,function(p){p.calcAffineTransform()})},e.prototype.getAxis=function(t,r){var n=this._axesMap[t];if(n!=null)return n[r||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(t,r){if(t!=null&&r!=null){var n="x"+t+"y"+r;return this._coordsMap[n]}Z(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return ps(n,s,!0,!0,r),M_(i,n),l;function u(v){M(i[vn[v]],function(c){if(Ta(c.model)){var d=a.ensureRecord(c.model),p=d.labelInfoList;if(p)for(var g=0;g0&&!sa(c)&&c>1e-4&&(v/=c),v}}function wL(e,t,r,n,i){var a=new S_(CL);return M(r,function(o){return M(o,function(s){if(Ta(s.model)){var l=!n;s.axisBuilder=yL(e,t,s.model,i,a,l)}})}),a}function A_(e,t,r,n,i,a){var o=r===Ae.determine;M(t,function(u){return M(u,function(f){Ta(f.model)&&(_L(f.axisBuilder,e,f.model),f.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[vn[1-u]]=e[da[u]]<=a.refContainer[da[u]]*.5?0:1-u===1?2:1}M(t,function(u,f){return M(u,function(h){Ta(h.model)&&((n==="all"||o)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[f]}),o&&h.axisBuilder.build({axisLine:!0}))})})}function TL(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=ma(e.get("outerBounds",!0)||y_,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||ft(["all","axisLabel"],a)<0?o="all":o=a;var s=[tf(X(e.get("outerBoundsClampWidth",!0),Ls[0]),t.width),tf(X(e.get("outerBoundsClampHeight",!0),Ls[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var CL=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";x_(e,t,r,n,i,a),ci(e.nameLocation)||M(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&T_(s.labelInfoList,s.dirVec,n,i)})};function DL(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return ML(r,e,t),r.seriesInvolved&&LL(r,e),r}function ML(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];M(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Da(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var f=s.model,h=f.getModel("tooltip",n);if(M(s.getAxes(),At(p,!1,null)),s.getTooltipAxes&&n&&h.get("show")){var v=h.get("trigger")==="axis",c=h.get(["axisPointer","type"])==="cross",d=s.getTooltipAxes(h.get(["axisPointer","axis"]));(v||c)&&M(d.baseAxes,At(p,c?"cross":!0,v)),c&&M(d.otherAxes,At(p,"cross",!1))}function p(g,m,y){var _=y.model.getModel("axisPointer",i),b=_.get("show");if(!(!b||b==="auto"&&!g&&!Wf(_))){m==null&&(m=_.get("triggerTooltip")),_=g?AL(y,h,i,t,g,m):_;var S=_.get("snap"),x=_.get("triggerEmphasis"),T=Da(y.model),A=m||S||y.type==="category",L=e.axesInfo[T]={key:T,axis:y,coordSys:s,axisPointerModel:_,triggerTooltip:m,triggerEmphasis:x,involveSeries:A,snap:S,useHandle:Wf(_),seriesModels:[],linkGroup:null};u[T]=L,e.seriesInvolved=e.seriesInvolved||A;var D=PL(a,y);if(D!=null){var C=o[D]||(o[D]={axesInfo:{}});C.axesInfo[T]=L,C.mapper=a[D].mapper,L.linkGroup=C}}}})}function AL(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};M(s,function(v){l[v]=it(o.get(v))}),l.snap=e.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var f=o.get(["label","show"]);if(u.show=f??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&dt(u,h.textStyle)}}return e.model.getModel("axisPointer",new _t(l,r,n))}function LL(e,t){t.eachSeries(function(r){var n=r.coordinateSystem,i=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!n||!n.model||i==="none"||i===!1||i==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||M(e.coordSysAxesInfo[Da(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function PL(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function IL(e){var t=mc(e);if(t){var r=t.axisPointerModel,n=t.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=Wf(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),os)return!0;if(o){var l=mc(t).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},e.prototype.makeElOption=function(t,r,n,i,a){},e.prototype.createPointerEl=function(t,r,n,i){var a=r.pointer;if(a){var o=dn(t).pointerEl=new iT[a.type](og(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=dn(t).labelEl=new ee(og(r.label));t.add(a),lg(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=dn(t).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},e.prototype.updateLabelEl=function(t,r,n,i){var a=dn(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),lg(a,i))},e.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=kh(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Kg(u.event)},onmousedown:bu(this._onHandleDragMove,this,0,0),drift:bu(this._onHandleDragMove,this),ondragend:bu(this._onHandleDragEnd,this)}),n.add(i)),ug(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");H(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,o0(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){sg(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Su(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(t,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(Su(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(Su(i)),dn(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var r=t.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),wf(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(t,r,n){return n=n||0,{x:t[n],y:t[1-n],width:r[n],height:r[1-n]}},e})();function sg(e,t,r,n){k_(dn(r).lastProp,n)||(dn(r).lastProp=n,t?ae(r,n,e):(r.stopAnimation(),r.attr(n)))}function k_(e,t){if(Z(e)&&Z(t)){var r=!0;return M(t,function(n,i){r=r&&k_(e[i],n)}),!!r}else return e===t}function lg(e,t){e[t.get(["label","show"])?"show":"hide"]()}function Su(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function ug(e,t,r){var n=t.get("z"),i=t.get("zlevel");e&&e.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function VL(e){var t=e.get("type"),r=e.getModel(t+"Style"),n;return t==="line"?(n=r.getLineStyle(),n.fill=null):t==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function HL(e,t,r,n,i){var a=r.get("value"),o=R_(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=Js(s.get("padding")||0),u=s.getFont(),f=bm(o,u),h=i.position,v=f.width+l[1]+l[3],c=f.height+l[0]+l[2],d=i.align;d==="right"&&(h[0]-=v),d==="center"&&(h[0]-=v/2);var p=i.verticalAlign;p==="bottom"&&(h[1]-=c),p==="middle"&&(h[1]-=c/2),WL(h,v,c,n);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=t.get(["axisLine","lineStyle","color"])),e.label={x:h[0],y:h[1],style:si(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function WL(e,t,r,n){var i=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+r,a)-r,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function R_(e,t,r,n,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:Cs(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};M(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,h=u&&u.getDataParams(f);h&&s.seriesData.push(h)}),Y(o)?a=o.replace("{value}",a):Q(o)&&(a=o(s))}return a}function E_(e,t,r){var n=sr();return lh(n,n,r.rotation),Ou(n,n,r.position),Ih([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function UL(e,t,r,n,i,a){var o=Ir.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),HL(t,n,i,a,{position:E_(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function jL(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function YL(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}var $L=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),f=fg(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var v=VL(a),c=XL[u](s,h,f);c.style=v,r.graphicKey=c.type,r.pointer=c}var d=Ps(l.getRect(),i);UL(n,r,d,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=Ps(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=E_(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=fg(s,o).getOtherAxis(o).getGlobalExtent(),f=o.dim==="x"?0:1,h=[r.x,r.y];h[f]+=n[f],h[f]=Math.min(l[1],h[f]),h[f]=Math.max(l[0],h[f]);var v=(u[1]+u[0])/2,c=[v,v];c[f]=h[f];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:c,tooltipOption:d[f]}},t})(GL);function fg(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var XL={line:function(e,t,r){var n=jL([t,r[0]],[t,r[1]],hg(e));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(e,t,r){var n=Math.max(1,e.getBandWidth()),i=r[1]-r[0];return{type:"Rect",shape:YL([t-n/2,r[0]],[n,i],hg(e))}}};function hg(e){return e.dim==="x"?0:1}var ZL=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:q.color.border,width:1,type:"dashed"},shadowStyle:{color:q.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:q.color.neutral00,padding:[5,7,5,7],backgroundColor:q.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:q.color.accent40,throttle:40}},t})(ct),or=St(),qL=M;function O_(e,t,r){if(!tt.node){var n=t.getZr();or(n).records||(or(n).records={}),KL(n,t);var i=or(n).records[e]||(or(n).records[e]={});i.handler=r}}function KL(e,t){if(or(e).initialized)return;or(e).initialized=!0,r("click",At(cg,"click")),r("mousemove",At(cg,"mousemove")),r("globalout",JL);function r(n,i){e.on(n,function(a){var o=tP(t);qL(or(e).records,function(s){s&&i(s,a,o.dispatchAction)}),QL(o.pendings,t)})}}function QL(e,t){var r=e.showTip.length,n=e.hideTip.length,i;r?i=e.showTip[r-1]:n&&(i=e.hideTip[n-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function JL(e,t,r){e.handler("leave",null,r)}function cg(e,t,r,n){t.handler(e,r,n)}function tP(e){var t={showTip:[],hideTip:[]},r=function(n){var i=t[n.type];i?i.push(n):(n.dispatchAction=r,e.dispatchAction(n))};return{dispatchAction:r,pendings:t}}function jf(e,t){if(!tt.node){var r=t.getZr(),n=(or(r).records||{})[e];n&&(or(r).records[e]=null)}}var eP=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";O_("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(r,n){jf("axisPointer",n)},t.prototype.dispose=function(r,n){jf("axisPointer",n)},t.type="axisPointer",t})(Xe);function N_(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=Cn(a,e);if(o==null||o<0||H(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),f=l.getOtherAxis(u),h=f.dim,v=u.dim,c=h==="x"||h==="radius"?1:0,d=a.mapDimension(v),p=[];p[c]=a.get(d,o),p[1-c]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(p)||[]}else r=l.dataToPoint(a.getValues($(l.dimensions,function(m){return a.mapDimension(m)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var vg=St();function rP(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||gt(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Xo(i)&&(i=N_({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Xo(i),u=a.axesInfo,f=s.axesInfo,h=n==="leave"||Xo(i),v={},c={},d={list:[],map:{}},p={showPointer:At(iP,c),showTooltip:At(aP,d)};M(s.coordSysMap,function(m,y){var _=l||m.containPoint(i);M(s.coordSysAxesInfo[y],function(b,S){var x=b.axis,T=uP(u,b);if(!h&&_&&(!u||T)){var A=T&&T.value;A==null&&!l&&(A=x.pointToData(i)),A!=null&&dg(b,A,p,!1,v)}})});var g={};return M(f,function(m,y){var _=m.linkGroup;_&&!c[y]&&M(_.axesInfo,function(b,S){var x=c[S];if(b!==m&&x){var T=x.value;_.mapper&&(T=m.axis.scale.parse(_.mapper(T,pg(b),pg(m)))),g[m.key]=T}})}),M(g,function(m,y){dg(f[y],m,p,!0,v)}),oP(c,f,v),sP(d,i,e,o),lP(f,o,r),v}}function dg(e,t,r,n,i){var a=e.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!e.involveSeries){r.showPointer(e,t);return}var o=nP(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&N(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function nP(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return M(t.seriesModels,function(l,u){var f=l.getData().mapDimensionsAll(n),h,v;if(l.getAxisTooltipData){var c=l.getAxisTooltipData(f,e,r);v=c.dataIndices,h=c.nestestValue}else{if(v=l.indicesOfNearest(n,f[0],e,r.type==="category"?.5:null),!v.length)return;h=l.getData().get(f[0],v[0])}if(!(h==null||!isFinite(h))){var d=e-h,p=Math.abs(d);p<=o&&((p=0&&s<0)&&(o=p,s=d,i=h,a.length=0),M(v,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:i}}function iP(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function aP(e,t,r,n){var i=r.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!i.length)){var l=t.coordSys.model,u=Da(l),f=e.map[u];f||(f=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(f)),f.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function oP(e,t,r){var n=r.axesInfo=[];M(t,function(i,a){var o=i.axisPointerModel.option,s=e[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function sP(e,t,r,n){if(Xo(t)||!e.list.length){n({type:"hideTip"});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function lP(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=vg(n)[i]||{},o=vg(n)[i]={};M(e,function(u,f){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&M(h.seriesDataIndices,function(v){var c=v.seriesIndex+" | "+v.dataIndex;o[c]=v})});var s=[],l=[];M(a,function(u,f){!o[f]&&l.push(u)}),M(o,function(u,f){!a[f]&&s.push(u)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function uP(e,t){for(var r=0;r<(e||[]).length;r++){var n=e[r];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}function pg(e){var t=e.axis.model,r={},n=r.axisDim=e.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=t.componentIndex,r.axisName=r[n+"AxisName"]=t.name,r.axisId=r[n+"AxisId"]=t.id,r}function Xo(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function B_(e){L_.registerAxisPointerClass("CartesianAxisPointer",$L),e.registerComponentModel(ZL),e.registerComponentView(eP),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!H(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=DL(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},rP)}function fP(e){Br(zL),Br(B_)}function hP(e,t){var r=Js(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new wt({shape:{x:e.x-r[3],y:e.y-r[0],width:e.width+r[1]+r[3],height:e.height+r[0]+r[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1});return i}var cP=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="tooltip",t.dependencies=["axisPointer"],t.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:q.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:q.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:q.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:q.color.tertiary,fontSize:14}},t})(ct);function F_(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function z_(e){if(tt.domSupported){for(var t=document.documentElement.style,r=0,n=e.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var f=u*Math.PI/180,h=o+i,v=h*Math.abs(Math.cos(f))+h*Math.abs(Math.sin(f)),c=Math.round(((v-Math.SQRT2*i)/2+Math.SQRT2*i-(v-h)/2)*100)/100;s+=";"+a+":-"+c+"px";var d=t+" solid "+i+"px;",p=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+n+";"];return'
'}function _P(e,t,r){var n="cubic-bezier(0.23,1,0.32,1)",i="",a="";return r&&(i=" "+e/2+"s "+n,a="opacity"+i+",visibility"+i),t||(i=" "+e+"s "+n,a+=(a.length?",":"")+(tt.transformSupported?""+yc+i:",left"+i+",top"+i)),pP+":"+a}function gg(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!tt.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=tt.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+yc+":"+o+";":[["top",0],["left",0],[G_,o]]}function bP(e){var t=[],r=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var i=X(e.get("lineHeight"),Math.round(r*3/2));r&&t.push("line-height:"+i+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return a&&o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),M(["decoration","align"],function(u){var f=e.get(u);f&&t.push("text-"+u+":"+f)}),t.join(";")}function SP(e,t,r,n){var i=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),f=e.get("shadowOffsetY"),h=e.getModel("textStyle"),v=i0(e,"html"),c=u+"px "+f+"px "+s+"px "+l;return i.push("box-shadow:"+c),t&&a>0&&i.push(_P(a,r,n)),o&&i.push("background-color:"+o),M(["width","color","radius"],function(d){var p="border-"+d,g=Py(p),m=e.get(g);m!=null&&i.push(p+":"+m+(d==="color"?"":"px"))}),i.push(bP(h)),v!=null&&i.push("padding:"+Js(v).join("px ")+"px"),i.join(";")+";"}function mg(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&ob(e,o,r,n,i)}else{e[0]=n,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var xP=(function(){function e(t,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,tt.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),a=r.appendTo,o=a&&(Y(a)?document.querySelector(a):oa(a)?a:Q(a)&&a(t.getDom()));mg(this._styleCoord,i,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(n),this._api=t,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,f=i.painter.getViewportRoot();fe(f,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return e.prototype.update=function(t){if(!this._container){var r=this._api.getDom(),n=dP(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},e.prototype.show=function(t,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=gP+SP(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+gg(a[0],a[1],!0)+("border-color:"+Dn(r)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(t,r,n,i,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(Y(a)&&n.get("trigger")==="item"&&!F_(n)&&(s=yP(n,i,a)),Y(t))o.innerHTML=t+s;else if(t){o.innerHTML="",H(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api,a=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(r,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||tt.node||!i.getDom())){var o=bg(a,i);this._ticket="";var s=a.dataByCoordSys,l=LP(a,n,i);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:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var f=TP;f.x=a.x,f.y=a.y,f.update(),lt(f).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:f},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var h=N_(a,n),v=h.point[0],c=h.point[1];v!=null&&c!=null&&this._tryShow({offsetX:v,offsetY:c,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(bg(a,i))},t.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var f=u.getData(),h=Ni([f.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){var s=lt(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Ui(i,function(f){if(f.tooltipDisabled)return l=u=null,!0;l||u||(lt(f).dataIndex!=null?l=f:lt(f).tooltipConfig!=null&&(u=f))},!0),l?this._showSeriesItemTooltip(r,l,n):u?this._showComponentItemTooltip(r,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},t.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=gt(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},t.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=Ni([n.tooltipOption],a),l=this._renderMode,u=[],f=ba("section",{blocks:[],noHeader:!0}),h=[],v=new tu;M(r,function(y){M(y.dataByAxis,function(_){var b=i.getComponent(_.axisDim+"Axis",_.axisIndex),S=_.value;if(!(!b||S==null)){var x=R_(S,b.axis,i,_.seriesDataIndices,_.valueLabelOpt),T=ba("section",{header:x,noHeader:!ze(x),sortBlocks:!0,blocks:[]});f.blocks.push(T),M(_.seriesDataIndices,function(A){var L=i.getSeriesByIndex(A.seriesIndex),D=A.dataIndexInside,C=L.getDataParams(D);if(!(C.dataIndex<0)){C.axisDim=_.axisDim,C.axisIndex=_.axisIndex,C.axisType=_.axisType,C.axisId=_.axisId,C.axisValue=Cs(b.axis,{value:S}),C.axisValueLabel=x,C.marker=v.makeTooltipMarker("item",Dn(C.color),l);var I=Pd(L.formatTooltip(D,!0,null)),P=I.frag;if(P){var k=Ni([L],a).get("valueFormatter");T.blocks.push(k?N({valueFormatter:k},P):P)}I.text&&h.push(I.text),u.push(C)}})}})}),f.blocks.reverse(),h.reverse();var c=n.position,d=s.get("order"),p=Od(f,v,l,d,i.get("useUTC"),s.get("textStyle"));p&&h.unshift(p);var g=l==="richText"?` +`];function ba(e,t){return t.type=e,t}function bf(e){return e.type==="section"}function r0(e){return bf(e)?QC:JC}function n0(e){if(bf(e)){var t=0,r=e.blocks.length,n=r>1||r>0&&!e.noHeader;return M(e.blocks,function(i){var a=n0(i);a>=t&&(t=a+ +(n&&(!a||bf(i)&&!i.noHeader)))}),t}return 0}function QC(e,t,r,n){var i=t.noHeader,a=tD(n0(t)),o=[],s=t.blocks||[];Me(!s||H(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Te(u,l)){var f=new OC(u[l],null);s.sort(function(p,g){return f.evaluate(p.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}M(s,function(p,g){var m=t.valueFormatter,y=r0(p)(m?N(N({},e),{valueFormatter:m}):e,p,g>0?a.html:0,n);y!=null&&o.push(y)});var h=e.renderMode==="richText"?o.join(a.richText):Sf(n,o.join(""),i?r:a.html);if(i)return h;var v=mf(t.header,"ordinal",e.useUTC),c=e0(n,e.renderMode).nameStyle,d=t0(n);return e.renderMode==="richText"?i0(e,v,c)+a.richText+h:Sf(n,'
'+jt(v)+"
"+h,r)}function JC(e,t,r,n){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,f=t.valueFormatter||e.valueFormatter||function(b){return b=H(b)?b:[b],$(b,function(S,x){return mf(S,H(c)?c[x]:c,u)})};if(!(a&&o)){var h=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||q.color.secondary,i),v=a?"":mf(l,"ordinal",u),c=t.valueType,d=o?[]:f(t.value,t.dataIndex),p=!s||!a,g=!s&&a,m=e0(n,i),y=m.nameStyle,_=m.valueStyle;return i==="richText"?(s?"":h)+(a?"":i0(e,v,y))+(o?"":nD(e,d,p,g,_)):Sf(n,(s?"":h)+(a?"":eD(v,!s,y))+(o?"":rD(d,p,g,_)),r)}}function Nd(e,t,r,n,i,a){if(e){var o=r0(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function tD(e){return{html:qC[e],richText:KC[e]}}function Sf(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=t0(e);return'
'+t+n+"
"}function eD(e,t,r){var n=t?"margin-left:2px":"";return''+jt(e)+""}function rD(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=H(e)?e:[e],''+$(e,function(o){return jt(o)}).join("  ")+""}function i0(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function nD(e,t,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(H(t)?t.join(" "):t,a)}function iD(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return Dn(n)}function a0(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var tu=(function(){function e(){this.richTextStyles={},this._nextStyleNameId=Mm()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(t,r,n){var i=n==="richText"?this._generateStyleName():null,a=zT({color:r,type:t,renderMode:n,markerId:i});return Y(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};H(r)?M(r,function(a){return N(n,a)}):N(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e})();function aD(e){var t=e.series,r=e.dataIndex,n=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(r),l=H(s),u=iD(t,r),f,h,v,c;if(o>1||l&&!o){var d=oD(s,t,r,a,u);f=d.inlineValues,h=d.inlineValueTypes,v=d.blocks,c=d.inlineValues[0]}else if(o){var p=i.getDimensionInfo(a[0]);c=f=li(i,r,a[0]),h=p.type}else c=f=l?s[0]:s;var g=dh(t),m=g&&t.name||"",y=i.getName(r),_=n?m:y;return ba("section",{header:m,noHeader:n||!g,sortParam:c,blocks:[ba("nameValue",{markerType:"item",markerColor:u,name:_,noName:!ze(_),value:f,valueType:h,dataIndex:r})].concat(v||[])})}function oD(e,t,r,n,i){var a=t.getData(),o=vi(e,function(h,v,c){var d=a.getDimensionInfo(c);return h=h||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];n.length?M(n,function(h){f(li(a,r,h),h)}):M(e,f);function f(h,v){var c=a.getDimensionInfo(v);!c||c.otherDims.tooltip===!1||(o?u.push(ba("nameValue",{markerType:"subItem",markerColor:i,name:c.displayName,value:h,valueType:c.type})):(s.push(h),l.push(c.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var pr=St();function go(e,t){return e.getName(t)||e.getId(t)}var sD="__universalTransitionEnabled",$e=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return t.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=na({count:uD,reset:fD}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=pr(this).sourceManager=new XC(this);a.prepareSource();var o=this.getInitialData(r,i);Fd(o,this),this.dataTask.context.data=o,pr(this).dataBeforeProcessed=o,Bd(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=ya(this),a=i?Na(r):{},o=this.subType;ct.hasClass(o)&&(o+="Series"),yt(r,n.getTheme().get(this.subType)),yt(r,this.getDefaultOption()),mv(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Nr(r,a,i)},t.prototype.mergeOption=function(r,n){r=yt(this.option,r,!0),this.fillDataTextStyle(r.data);var i=ya(this);i&&Nr(this.option,r,i);var a=pr(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);Fd(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,pr(this).dataBeforeProcessed=o,Bd(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!te(r))for(var n=["show"],i=0;i=0&&v<0)&&(h=y,v=m,c=0),m===v&&(f[c++]=p))}),f.length=c,f},t.prototype.formatTooltip=function(r,n,i){return aD({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(tt.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,o=$h.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},t.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},t.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},t.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[go(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[sD])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},t.prototype._innerSelect=function(r,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){Z(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,f=0;f0&&this._innerSelect(r,n)}},t.registerClass=function(r){return ct.registerClass(r)},t.protoInitialize=(function(){var r=t.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"})(),t})(ct);Ze($e,RC);Ze($e,$h);Em($e,ct);function Bd(e){var t=e.name;dh(e)||(e.name=lD(e)||t)}function lD(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return M(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function uD(e){return e.model.getRawData().count()}function fD(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),hD}function hD(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Fd(e,t){M(eb(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,At(cD,t))})}function cD(e,t){var r=xf(e);return r&&r.setOutputEnd((t||this).count()),t}function xf(e){var t=(e.ecModel||{}).scheduler,r=t&&t.getPipeline(e.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(e.uid))}return n}}var Xe=(function(){function e(){this.group=new Rt,this.uid=Ks("viewComponent")}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){},e.prototype.updateLayout=function(t,r,n,i){},e.prototype.updateVisual=function(t,r,n,i){},e.prototype.toggleBlurSeries=function(t,r,n){},e.prototype.eachRendered=function(t){var r=this.group;r&&r.traverse(t)},e})();gh(Xe);Bs(Xe);function Qh(){var e=St();return function(t){var r=e(t),n=t.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var o0=St(),vD=Qh(),De=(function(){function e(){this.group=new Rt,this.uid=Ks("viewChart"),this.renderTask=na({plan:dD,reset:pD}),this.renderTask.context={view:this}}return e.prototype.init=function(t,r){},e.prototype.render=function(t,r,n,i){},e.prototype.highlight=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&Gd(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&Gd(a,i,"normal")},e.prototype.remove=function(t,r){this.group.removeAll()},e.prototype.dispose=function(t,r){},e.prototype.updateView=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateLayout=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.updateVisual=function(t,r,n,i){this.render(t,r,n,i)},e.prototype.eachRendered=function(t){Ys(this.group,t)},e.markUpdateMethod=function(t,r){o0(t).updateMethod=r},e.protoInitialize=(function(){var t=e.prototype;t.type="chart"})(),e})();function zd(e,t,r){e&&hf(e)&&(t==="emphasis"?hs:cs)(e,r)}function Gd(e,t,r){var n=Cn(e,t),i=t&&t.highlightKey!=null?gw(t.highlightKey):null;n!=null?M($t(n),function(a){zd(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){zd(a,r,i)})}gh(De);Bs(De);function dD(e){return vD(e.model)}function pD(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&o0(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),gD[l]}var gD={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},_s="\0__throttleOriginMethod",Vd="\0__throttleRate",Hd="\0__throttleType";function Jh(e,t,r){var n,i=0,a=0,o=null,s,l,u,f;t=t||0;function h(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var v=function(){for(var c=[],d=0;d=0?h():o=setTimeout(h,-s),i=n};return v.clear=function(){o&&(clearTimeout(o),o=null)},v.debounceNextCall=function(c){f=c},v}function s0(e,t,r,n){var i=e[t];if(i){var a=i[_s]||i,o=i[Hd],s=i[Vd];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=Jh(a,r,n==="debounce"),i[_s]=a,i[Hd]=n,i[Vd]=r}return i}}function wf(e,t){var r=e[t];r&&r[_s]&&(r.clear&&r.clear(),e[t]=r[_s])}var Wd=St(),jd={itemStyle:ca(_y,!0),lineStyle:ca(yy,!0)},mD={lineStyle:"stroke",itemStyle:"fill"};function l0(e,t){var r=e.visualStyleMapper||jd[t];return r||(console.warn("Unknown style type '"+t+"'."),jd.itemStyle)}function u0(e,t){var r=e.visualDrawType||mD[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var yD={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=l0(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=u0(e,n),u=o[l],f=Q(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||f||h){var v=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=v,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Q(o.fill)?v:o.fill,o.stroke=o.stroke==="auto"||Q(o.stroke)?v:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&f)return r.setVisual("colorFromPalette",!1),{dataEach:function(c,d){var p=e.getDataParams(d),g=N({},o);g[l]=f(p),c.setItemVisual(d,"style",g)}}}},Ai=new _t,_D={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=l0(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Ai.option=l[n];var u=i(Ai),f=o.ensureUniqueItemVisual(s,"style");N(f,u),Ai.option.decal&&(o.setItemVisual(s,"decal",Ai.option.decal),Ai.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},bD={performRawSeries:!0,overallReset:function(e){var t=et();e.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var i=r.type+"-"+n,a=t.get(i);a||(a={},t.set(i,a)),Wd(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=Wd(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=u0(r,s);a.each(function(u){var f=a.getRawIndex(u);i[f]=u}),n.each(function(u){var f=i[u],h=a.getItemVisual(f,"colorFromPalette");if(h){var v=a.ensureUniqueItemVisual(f,"style"),c=n.getName(u)||u+"",d=n.count();v[l]=r.getColorFromPalette(c,o,d)}})}})}},mo=Math.PI;function SD(e,t){t=t||{},dt(t,{text:"loading",textColor:q.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:q.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new Rt,n=new wt({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new ee({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new wt({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});r.add(a);var o;return t.showSpinner&&(o=new js({shape:{startAngle:-mo/2,endAngle:-mo/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:mo*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:mo*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(e.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),f=e.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:f}),a.setShape({x:u-l,y:f-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},r.resize(),r}var f0=(function(){function e(t,r,n,i){this._stageTaskMap=et(),this.ecInstance=t,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(t,r){t.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},e.prototype.getPerformArgs=function(t,r){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},e.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},e.prototype.updateStreamModes=function(t,r){var n=this._pipelineMap.get(t.uid),i=t.getData(),a=i.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&a>=n.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},e.prototype.restorePipelines=function(t){var r=this,n=r._pipelineMap=et();t.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),r._pipe(i,i.dataTask)})},e.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,r=this.api.getModel(),n=this.api;M(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";Me(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},e.prototype.prepareView=function(t,r,n,i){var a=t.renderTask,o=a.context;o.model=r,o.ecModel=n,o.api=i,a.__block=!t.incrementalPrepareRender,this._pipe(r,a)},e.prototype.performDataProcessorTasks=function(t,r){this._performStageTasks(this._dataProcessorHandlers,t,r,{block:!0})},e.prototype.performVisualTasks=function(t,r,n){this._performStageTasks(this._visualHandlers,t,r,n)},e.prototype._performStageTasks=function(t,r,n,i){i=i||{};var a=!1,o=this;M(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var f=o._stageTaskMap.get(l.uid),h=f.seriesTaskMap,v=f.overallTask;if(v){var c,d=v.agentStubMap;d.each(function(g){s(i,g)&&(g.dirty(),c=!0)}),c&&v.dirty(),o.updatePayload(v,n);var p=o.getPerformArgs(v,i.block);d.each(function(g){g.perform(p)}),v.perform(p)&&(a=!0)}else h&&h.each(function(g,m){s(i,g)&&g.dirty();var y=o.getPerformArgs(g,i.block);y.skip=!l.performRawSeries&&r.isSeriesFiltered(g.context.model),o.updatePayload(g,n),g.perform(y)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},e.prototype.performSeriesTasks=function(t){var r;t.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(t){var r=t.tail;do{if(r.__block){t.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},e.prototype.updatePayload=function(t,r){r!=="remain"&&(t.context.payload=r)},e.prototype._createSeriesStageTask=function(t,r,n,i){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=et(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(f):l?n.eachRawSeriesByType(l,f):u&&u(n,i).each(f);function f(h){var v=h.uid,c=s.set(v,o&&o.get(v)||na({plan:DD,reset:MD,count:LD}));c.context={model:h,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(h,c)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||na({reset:xD});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=et(),u=t.seriesType,f=t.getTargetSeries,h=!0,v=!1,c="";Me(!t.createOnAllSeries,c),u?n.eachRawSeriesByType(u,d):f?f(n,i).each(d):(h=!1,M(n.getSeries(),d));function d(p){var g=p.uid,m=l.set(g,s&&s.get(g)||(v=!0,na({reset:wD,onDirty:CD})));m.context={model:p,overallProgress:h},m.agent=o,m.__block=h,a._pipe(p,m)}v&&o.dirty()},e.prototype._pipe=function(t,r){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},e.wrapStageHandler=function(t,r){return Q(t)&&(t={overallReset:t,seriesType:PD(t)}),t.uid=Ks("stageHandler"),r&&(t.visualType=r),t},e})();function xD(e){e.overallReset(e.ecModel,e.api,e.payload)}function wD(e){return e.overallProgress&&TD}function TD(){this.agent.dirty(),this.getDownstream().dirty()}function CD(){this.agent&&this.agent.dirty()}function DD(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function MD(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=$t(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?$(t,function(r,n){return h0(n)}):AD}var AD=h0(0);function h0(e){return function(t,r){var n=r.data,i=r.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&c===u.length-v.length){var d=u.slice(0,c);d!=="data"&&(r.mainType=d,r[v.toLowerCase()]=l,f=!0)}}s.hasOwnProperty(u)&&(n[u]=l,f=!0),f||(i[u]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},e.prototype.filter=function(t,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return f(l,o,"mainType")&&f(l,o,"subType")&&f(l,o,"index","componentIndex")&&f(l,o,"name")&&f(l,o,"id")&&f(u,a,"name")&&f(u,a,"dataIndex")&&f(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,r.otherQuery,i,a));function f(h,v,c,d){return h[c]==null||v[d||c]===h[c]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e})(),Tf=["symbol","symbolSize","symbolRotate","symbolOffset"],Yd=Tf.concat(["symbolKeepAspect"]),RD={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData();if(e.legendIcon&&r.setVisual("legendIcon",e.legendIcon),!e.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&yn(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function $d(e,t,r){for(var n=t.type==="radial"?KD(e,t,r):qD(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:vt(e)?[e]:H(e)?e:null}function tc(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&JD(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=$(r,function(a){return a/i}),n/=i)}return[r,n]}var tM=new Er(!0);function Ss(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function Zd(e){return typeof e=="string"&&e!=="none"}function xs(e){var t=e.fill;return t!=null&&t!=="none"}function qd(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function Kd(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function Qd(e,t,r){var n=mh(t.image,t.__image,r);if(Fs(n)){var i=e.createPattern(n,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Ro),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function eM(e,t,r,n){var i,a=Ss(r),o=xs(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var f=t.path||tM,h=t.__dirty;if(!n){var v=r.fill,c=r.stroke,d=o&&!!v.colorStops,p=a&&!!c.colorStops,g=o&&!!v.image,m=a&&!!c.image,y=void 0,_=void 0,b=void 0,S=void 0,x=void 0;(d||p)&&(x=t.getBoundingRect()),d&&(y=h?$d(e,v,x):t.__canvasFillGradient,t.__canvasFillGradient=y),p&&(_=h?$d(e,c,x):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),g&&(b=h||!t.__canvasFillPattern?Qd(e,v,t):t.__canvasFillPattern,t.__canvasFillPattern=b),m&&(S=h||!t.__canvasStrokePattern?Qd(e,c,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),d?e.fillStyle=y:g&&(b?e.fillStyle=b:o=!1),p?e.strokeStyle=_:m&&(S?e.strokeStyle=S:a=!1)}var T=t.getGlobalScale();f.setScale(T[0],T[1],t.segmentIgnoreThreshold);var A,L;e.setLineDash&&r.lineDash&&(i=tc(t),A=i[0],L=i[1]);var D=!0;(u||h&$n)&&(f.setDPR(e.dpr),l?f.setContext(null):(f.setContext(e),D=!1),f.reset(),t.buildPath(f,t.shape,n),f.toStatic(),t.pathUpdated()),D&&f.rebuildPath(e,l?s:1),A&&(e.setLineDash(A),e.lineDashOffset=L),n||(r.strokeFirst?(a&&Kd(e,r),o&&qd(e,r)):(o&&qd(e,r),a&&Kd(e,r))),A&&e.setLineDash([])}function rM(e,t,r){var n=t.__image=mh(r.image,t.__image,t,t.onload);if(!(!n||!Fs(n))){var i=r.x||0,a=r.y||0,o=t.getWidth(),s=t.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var u=r.sx||0,f=r.sy||0;e.drawImage(n,u,f,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,f=r.sy,h=o-u,v=s-f;e.drawImage(n,u,f,h,v,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function nM(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||lr,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=tc(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(Ss(r)&&e.strokeText(i,r.x,r.y),xs(r)&&e.fillText(i,r.x,r.y)):(xs(r)&&e.fillText(i,r.x,r.y),Ss(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var Jd=["shadowBlur","shadowOffsetX","shadowOffsetY"],tp=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function g0(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){Qt(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?Sn.opacity:o}(n||t.blend!==r.blend)&&(a||(Qt(e,i),a=!0),e.globalCompositeOperation=t.blend||Sn.blend);for(var s=0;s0&&r.unfinished);r.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(r,n,i){if(!this[Ct]){if(this._disposed){this.id;return}var a,o,s;if(Z(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Ct]=!0,jn(this),!this._model||n){var l=new cC(this._api),u=this._theme,f=this._model=new Xh;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},If);var h={seriesTransition:s,optionChanged:!0};if(i)this[It]={silent:a,updateParams:h},this[Ct]=!1,this.getZr().wakeUp();else{try{fn(this),tr.update.call(this,null,h)}catch(v){throw this[It]=null,this[Ct]=!1,v}this._ssr||this._zr.flush(),this[It]=null,this[Ct]=!1,Hn.call(this,a),Wn.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[Ct]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[It]&&(a==null&&(a=this[It].silent),o=this[It].updateParams,this[It]=null),this[Ct]=!0,jn(this);try{this._updateTheme(r),i.setTheme(this._theme),fn(this),tr.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Ct]=!1,s}this[Ct]=!1,Hn.call(this,a),Wn.call(this,a)}}},t.prototype._updateTheme=function(r){Y(r)&&(r=k0[r]),r&&(r=it(r),r&&Wy(r,!0),this._theme=r)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||tt.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},t.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},t.prototype.getSvgDataURL=function(){var r=this._zr,n=r.storage.getDisplayList();return M(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()},t.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],o=this;M(n,function(l){i.eachComponent({mainType:l},function(u){var f=o._componentsMap[u.__viewId];f.group.ignore||(a.push(f),f.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return M(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(pp[i]){var l=s,u=s,f=-s,h=-s,v=[],c=r&&r.pixelRatio||this.getDevicePixelRatio();M(ia,function(_,b){if(_.group===i){var S=n?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(it(r)),x=_.getDom().getBoundingClientRect();l=a(x.left,l),u=a(x.top,u),f=o(x.right,f),h=o(x.bottom,h),v.push({dom:S,left:x.left,top:x.top})}}),l*=c,u*=c,f*=c,h*=c;var d=f-l,p=h-u,g=kr.createCanvas(),m=cv(g,{renderer:n?"svg":"canvas"});if(m.resize({width:d,height:p}),n){var y="";return M(v,function(_){var b=_.left-l,S=_.top-u;y+=''+_.dom+""}),m.painter.getSvgRoot().innerHTML=y,r.connectedBackgroundColor&&m.painter.setBackgroundColor(r.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return r.connectedBackgroundColor&&m.add(new wt({shape:{x:0,y:0,width:d,height:p},style:{fill:r.connectedBackgroundColor}})),M(v,function(_){var b=new qe({style:{x:_.left*c-l,y:_.top*c-u,image:_.dom}});m.add(b)}),m.refreshImmediately(),g.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},t.prototype.convertToPixel=function(r,n,i){return So(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return So(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return So(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=Ml(i,r);return M(o,function(s,l){l.indexOf("Models")>=0&&M(s,function(u){var f=u.coordinateSystem;if(f&&f.containPoint)a=a||!!f.containPoint(n);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=Ml(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?OD(s,l,n):ND(s,n)},t.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},t.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},t.prototype._initEvents=function(){var r=this;M(LM,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,f=i==="globalout";if(f?u={}:l&&ji(l,function(p){var g=lt(p);if(g&&g.dataIndex!=null){var m=g.dataModel||s.getSeriesByIndex(g.seriesIndex);return u=m&&m.getDataParams(g.dataIndex,g.dataType,l)||{},!0}else if(g.eventData)return u=N({},g.eventData),!0},!0),u){var h=u.componentType,v=u.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",v=u.seriesIndex);var c=h&&v!=null&&s.getComponent(h,v),d=c&&r[c.mainType==="series"?"_chartsMap":"_componentsMap"][c.__viewId];u.event=o,u.type=i,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:c,view:d},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;M(Lf,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),BD(n,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&km(this.getDom(),nc,"");var n=this,i=n._api,a=n._model;M(n._componentsViews,function(o){o.dispose(a,i)}),M(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete ia[n.id]},t.prototype.resize=function(r){if(!this[Ct]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[It]&&(a==null&&(a=this[It].silent),i=!0,this[It]=null),this[Ct]=!0,jn(this);try{i&&fn(this),tr.update.call(this,{type:"resize",animation:N({duration:0},r&&r.animation)})}catch(o){throw this[Ct]=!1,o}this[Ct]=!1,Hn.call(this,a),Wn.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(Z(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!kf[r]){var i=kf[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(r){var n=N({},r);return n.type=Af[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(Z(n)||(n={silent:!!n}),!!ws[r.type]&&this._model){if(this[Ct]){this._pendingActions.push(r);return}var i=n.silent;ou.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&tt.browser.weChat&&this._throttledZrFlush(),Hn.call(this,i),Wn.call(this,i)}},t.prototype.updateLabelLayout=function(){we.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=(function(){fn=function(h){var v=h._scheduler;v.restorePipelines(h._model),v.prepareStageTasks(),iu(h,!0),iu(h,!1),v.plan()},iu=function(h,v){for(var c=h._model,d=h._scheduler,p=v?h._componentsViews:h._chartsViews,g=v?h._componentsMap:h._chartsMap,m=h._zr,y=h._api,_=0;_v.get("hoverLayerThreshold")&&!tt.node&&!tt.worker&&v.eachSeries(function(g){if(!g.preventUsingHoverLayer){var m=h._chartsMap[g.__viewId];m.__alive&&m.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function s(h,v){var c=h.get("blendMode")||null;v.eachRendered(function(d){d.isGroup||(d.style.blend=c)})}function l(h,v){if(!h.preventAutoZ){var c=py(h);v.eachRendered(function(d){return gy(d,c.z,c.zlevel),!0})}}function u(h,v){v.eachRendered(function(c){if(!Ji(c)){var d=c.getTextContent(),p=c.getTextGuideLine();c.stateTransition&&(c.stateTransition=null),d&&d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),c.hasState()?(c.prevStates=c.currentStates,c.clearStates()):c.prevStates&&(c.prevStates=null)}})}function f(h,v){var c=h.getModel("stateAnimation"),d=h.isAnimationEnabled(),p=c.get("duration"),g=p>0?{duration:p,delay:c.get("delay"),easing:c.get("easing")}:null;v.eachRendered(function(m){if(m.states&&m.states.emphasis){if(Ji(m))return;if(m instanceof ht&&mw(m),m.__dirty){var y=m.prevStates;y&&m.useStates(y)}if(d){m.stateTransition=g;var _=m.getTextContent(),b=m.getTextGuideLine();_&&(_.stateTransition=g),b&&(b.stateTransition=g)}m.__dirty&&a(m)}})}vp=function(h){return new((function(v){V(c,v);function c(){return v!==null&&v.apply(this,arguments)||this}return c.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},c.prototype.getComponentByElement=function(d){for(;d;){var p=d.__ecComponentInfo;if(p!=null)return h._model.getComponent(p.mainType,p.index);d=d.parent}},c.prototype.enterEmphasis=function(d,p){hs(d,p),le(h)},c.prototype.leaveEmphasis=function(d,p){cs(d,p),le(h)},c.prototype.enterBlur=function(d){sw(d),le(h)},c.prototype.leaveBlur=function(d){Xm(d),le(h)},c.prototype.enterSelect=function(d){Zm(d),le(h)},c.prototype.leaveSelect=function(d){qm(d),le(h)},c.prototype.getModel=function(){return h.getModel()},c.prototype.getViewOfComponentModel=function(d){return h.getViewOfComponentModel(d)},c.prototype.getViewOfSeriesModel=function(d){return h.getViewOfSeriesModel(d)},c.prototype.getMainProcessVersion=function(){return h[_o]},c})(Vy))(h)},P0=function(h){function v(c,d){for(var p=0;p=0)){gp.push(r);var a=f0.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function N0(e,t){kf[e]=t}function BM(e,t,r){var n=dM("registerMap");n&&n(e,t,r)}var FM=HC;An(ec,yD);An(rl,_D);An(rl,bD);An(ec,RD);An(rl,ED);An(T0,cM);E0(Wy);O0(mM,TC);N0("default",SD);mi({type:xn,event:xn,update:xn},Yt);mi({type:Go,event:Go,update:Go},Yt);mi({type:us,event:Sh,update:us,action:Yt,refineEvent:oc,publishNonRefinedEvent:!0});mi({type:of,event:Sh,update:of,action:Yt,refineEvent:oc,publishNonRefinedEvent:!0});mi({type:fs,event:Sh,update:fs,action:Yt,refineEvent:oc,publishNonRefinedEvent:!0});function oc(e,t,r,n){return{eventContent:{selected:cw(r),isFromClick:t.isFromClick||!1}}}R0("default",{});R0("dark",d0);function Pi(e){return e==null?0:e.length||1}function mp(e){return e}var zM=(function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||mp,this._newKeyGetter=i||mp,this.context=a,this._diffModeMultiple=o==="multiple"}return e.prototype.add=function(t){return this._add=t,this},e.prototype.update=function(t){return this._update=t,this},e.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},e.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},e.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},e.prototype.remove=function(t){return this._remove=t,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var t=this._old,r=this._new,n={},i=new Array(t.length),a=new Array(r.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var o=0;o1){var f=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(f,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},e.prototype._executeMultiple=function(){var t=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(t,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&v===1)this._updateManyToOne&&this._updateManyToOne(f,u),i[l]=null;else if(h===1&&v>1)this._updateOneToMany&&this._updateOneToMany(f,u),i[l]=null;else if(h===1&&v===1)this._update&&this._update(f,u),i[l]=null;else if(h>1&&v>1)this._updateManyToMany&&this._updateManyToMany(f,u),i[l]=null;else if(h>1)for(var c=0;c1)for(var s=0;s30}var Ii=Z,gr=$,YM=typeof Int32Array>"u"?Array:Int32Array,$M="e\0\0",yp=-1,XM=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],ZM=["_approximateExtent"],_p,wo,ki,Ri,uu,Ei,fu,qM=(function(){function e(t,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;F0(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},f=0;f=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===oe;if(l&&!i.pure)for(var u=[],f=t;f0},e.prototype.ensureUniqueItemVisual=function(t,r){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var a=i[r];return a==null&&(a=this.getVisual(r),H(a)?a=a.slice():Ii(a)&&(a=N({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Ii(r)?N(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){Ii(t)?N(this._layout,t):this._layout[t]=r},e.prototype.getLayout=function(t){return this._layout[t]},e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},e.prototype.setItemLayout=function(t,r,n){this._itemLayouts[t]=n?N(this._itemLayouts[t]||{},r):r},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(t,r){var n=this.hostModel&&this.hostModel.seriesIndex;Kx(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){M(this._graphicEls,function(n,i){n&&t&&t.call(r,n,i)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:gr(this.dimensions,this._getDimInfo,this),this.hostModel)),uu(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Q(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(ih(arguments)))})},e.internalField=(function(){_p=function(t){var r=t._invertedIndicesMap;M(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new YM(o.categories.length);for(var l=0;l1&&(l+="__ec__"+f),i[r]=l}}})(),e})();function KM(e,t){Zh(e)||(e=jy(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=et(),a=[],o=JM(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&V0(o),l=n===e.dimensionsDefine,u=l?G0(e):z0(n),f=t.encodeDefine;!f&&t.encodeDefaulter&&(f=t.encodeDefaulter(e,o));for(var h=et(f),v=new Qy(o),c=0;c0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function JM(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return M(t,function(a){var o;Z(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function tA(e,t,r){if(r||t.hasKey(e)){for(var n=0;t.hasKey(e+n);)n++;e+=n}return t.set(e,!0),e}var eA=(function(){function e(t){this.coordSysDims=[],this.axisMap=et(),this.categoryAxisMap=et(),this.coordSysName=t}return e})();function rA(e){var t=e.get("coordinateSystem"),r=new eA(t),n=nA[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var nA={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",ge).models[0],a=e.getReferringComponents("yAxis",ge).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),Un(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),Un(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",ge).models[0];t.coordSysDims=["single"],r.set("single",i),Un(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",ge).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),Un(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),Un(o)&&(n.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(e,t,r,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,r,n){var i=e.ecModel,a=i.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();M(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),f=o[l];r.set(f,u),Un(u)&&(n.set(f,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",ge).models[0];t.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),o=i.getDimensionModel("y");r.set("x",a),r.set("y",o),n.set("x",a),n.set("y",o)}};function Un(e){return e.get("type")==="category"}function iA(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;aA(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,f,h,v;if(M(a,function(y,_){Y(y)&&(a[_]=y={name:y}),l&&!y.isExtraCoord&&(!n&&!u&&y.ordinalMeta&&(u=y),!f&&y.type!=="ordinal"&&y.type!=="time"&&(!i||i===y.coordDim)&&(f=y))}),f&&!n&&!u&&(n=!0),f){h="__\0ecstackresult_"+e.id,v="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var c=f.coordDim,d=f.type,p=0;M(a,function(y){y.coordDim===c&&p++});var g={name:h,coordDim:c,coordDimIndex:p,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:v,coordDim:v,coordDimIndex:p+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(v,d),m.storeDimIndex=s.ensureCalculationDimension(h,d)),o.appendCalculationDimension(g),o.appendCalculationDimension(m)):(a.push(g),a.push(m))}return{stackedDimension:f&&f.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:v,stackResultDimension:h}}function aA(e){return!F0(e.schema)}function fi(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function oA(e,t){return fi(e,t)?e.getCalculationInfo("stackResultDimension"):t}function sA(e,t){var r=e.get("coordinateSystem"),n=Uh.get(r),i;return t&&t.coordSysDims&&(i=$(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=HM(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function lA(e,t,r){var n,i;return r&&M(e,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(e[n].otherDims.itemName=0),n}function sc(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;i=n.getSource(),a=i.sourceFormat===oe;var o=rA(t),s=sA(t,o),l=r.useEncodeDefaulter,u=Q(l)?l:l?At(JT,s,t):null,f={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=KM(i,f),v=lA(h.dimensions,r.createInvertedIndices,o),c=a?null:n.getSharedDataStore(h),d=iA(t,{schema:h,store:c}),p=new qM(h,t);p.setCalculationInfo(d);var g=v!=null&&uA(i)?function(m,y,_,b){return b===v?_:this.defaultDimValueGetter(m,y,_,b)}:null;return p.hasItemOption=!1,p.initData(a?i:c,null,g),p}function uA(e){if(e.sourceFormat===oe){var t=fA(e.data||[]);return!H(Ra(t))}}function fA(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=wa(o),l=a.niceTickExtent=[Bt(Math.ceil(e[0]/o)*o,s),Bt(Math.floor(e[1]/o)*o,s)];return cA(l,e),a}function hu(e){var t=Math.pow(10,vh(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,Bt(r*t)}function wa(e){return ir(e)+2}function bp(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function cA(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),bp(e,0,t),bp(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function lc(e,t){return e>=t[0]&&e<=t[1]}var vA=(function(){function e(){this.normalize=Sp,this.scale=xp}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=gt(t.normalize,t),this.scale=gt(t.scale,t)):(this.normalize=Sp,this.scale=xp)},e})();function Sp(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function xp(e,t){return e*(t[1]-t[0])+t[0]}function Ef(e,t,r){var n=Math.log(e);return[Math.log(r?t[0]:Math.max(0,t[0]))/n,Math.log(r?t[1]:Math.max(0,t[1]))/n]}var zr=(function(){function e(t){this._calculator=new vA,this._setting=t||{},this._extent=[1/0,-1/0]}return e.prototype.getSetting=function(t){return this._setting[t]},e.prototype._innerUnionExtent=function(t){var r=this._extent;this._innerSetExtent(t[0]r[1]?t[1]:r[1])},e.prototype.unionExtentFromData=function(t,r){this._innerUnionExtent(t.getApproximateExtent(r))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(t,r){this._innerSetExtent(t,r)},e.prototype._innerSetExtent=function(t,r){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(r)||(n[1]=r),this._brkCtx&&this._brkCtx.update(n)},e.prototype.setBreaksFromOption=function(t){},e.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},e.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},e.prototype.hasBreaks=function(){return this._brkCtx?this._brkCtx.hasBreaks():!1},e.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},e.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(t){this._isBlank=t},e})();Bs(zr);var dA=0,Of=(function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++dA,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&$(n,pA);return new e({categories:i,needCollect:!i,deduplication:r.dedplication!==!1})},e.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},e.prototype.parseAndCollect=function(t){var r,n=this._needCollect;if(!Y(t)&&!n)return t;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=t,this._onCollect&&this._onCollect(t,r),r;var i=this._getOrCreateMap();return r=i.get(t),r==null&&(n?(r=this.categories.length,this.categories[r]=t,i.set(t,r),this._onCollect&&this._onCollect(t,r)):r=NaN),r},e.prototype._getOrCreateMap=function(){return this._map||(this._map=et(this.categories))},e})();function pA(e){return Z(e)&&e.value!=null?e.value:e+""}var H0=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new Of({})),H(i)&&(i=new Of({categories:$(i,function(a){return Z(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return t.prototype.parse=function(r){return r==null?NaN:Y(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return lc(r,this._extent)&&r>=0&&r=0&&r=0&&r=r},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t})(zr);zr.registerClass(H0);var mr=Bt,hi=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return t.prototype.parse=function(r){return r==null||r===""?NaN:Number(r)},t.prototype.contain=function(r){return lc(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=wa(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=ms(),l=[];if(!n)return l;r.breakTicks;var u=1e4;i[0]=0&&(h=mr(h+v*n,o))}if(l.length>0&&h===l[l.length-1].value)break;if(l.length>u)return[]}var c=l.length?l[l.length-1].value:a[1];return i[1]>c&&(r.expandToNicedExtent?l.push({value:mr(c+n,o)}):l.push({value:i[1]})),r.breakTicks,l},t.prototype.getMinorTicks=function(r){for(var n=this.getTicks({expandToNicedExtent:!0}),i=[],a=this.getExtent(),o=1;oa[0]&&d0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function Y0(e){var t=yA(e),r=[];return M(e,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],f=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),v=Math.abs(h[1]-h[0]);s=u?f/v*u:f}else{var c=n.getData();s=Math.abs(o[1]-o[0])/c.count()}var d=Ut(n.get("barWidth"),s),p=Ut(n.get("barMaxWidth"),s),g=Ut(n.get("barMinWidth")||(X0(n)?.5:1),s),m=n.get("barGap"),y=n.get("barCategoryGap"),_=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:d,barMaxWidth:p,barMinWidth:g,barGap:m,barCategoryGap:y,defaultBarGap:_,axisKey:uc(a),stackId:j0(n)})}),_A(r)}function _A(e){var t={};M(e,function(n,i){var a=n.axisKey,o=n.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:n.defaultBarGap||0,stacks:{}},l=s.stacks;t[a]=s;var u=n.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var f=n.barWidth;f&&!l[u].width&&(l[u].width=f,f=Math.min(s.remainedWidth,f),s.remainedWidth-=f);var h=n.barMaxWidth;h&&(l[u].maxWidth=h);var v=n.barMinWidth;v&&(l[u].minWidth=v);var c=n.barGap;c!=null&&(s.gap=c);var d=n.barCategoryGap;d!=null&&(s.categoryGap=d)});var r={};return M(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=st(a).length;s=Math.max(35-l*4,15)+"%"}var u=Ut(s,o),f=Ut(n.gap,1),h=n.remainedWidth,v=n.autoWidthCount,c=(h-u)/(v+(v-1)*f);c=Math.max(c,0),M(a,function(m){var y=m.maxWidth,_=m.minWidth;if(m.width){var b=m.width;y&&(b=Math.min(b,y)),_&&(b=Math.max(b,_)),m.width=b,h-=b+f*b,v--}else{var b=c;y&&yb&&(b=_),b!==c&&(m.width=b,h-=b+f*b,v--)}}),c=(h-u)/(v+(v-1)*f),c=Math.max(c,0);var d=0,p;M(a,function(m,y){m.width||(m.width=c),p=m,d+=m.width*(1+f)}),p&&(d-=p.width*f);var g=-d/2;M(a,function(m,y){r[i][y]=r[i][y]||{bandWidth:o,offset:g,width:m.width},g+=m.width*(1+f)})}),r}function bA(e,t,r){if(e&&t){var n=e[uc(t)];return n}}function SA(e,t){var r=U0(e,t),n=Y0(r);M(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=j0(i),u=n[uc(s)][l],f=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:f,size:h})})}function xA(e){return{seriesType:e,plan:Qh(),reset:function(t){if($0(t)){var r=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(i.dim)),l=t.get("showBackground",!0),u=r.mapDimension(a.dim),f=r.getCalculationInfo("stackResultDimension"),h=fi(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),v=a.isHorizontal(),c=wA(i,a),d=X0(t),p=t.get("barMinHeight")||0,g=f&&r.getDimensionIndex(f),m=r.getLayout("size"),y=r.getLayout("offset");return{progress:function(_,b){for(var S=_.count,x=d&&ar(S*3),T=d&&l&&ar(S*3),A=d&&ar(S),L=n.master.getRect(),D=v?L.width:L.height,C,I=b.getStore(),P=0;(C=_.next())!=null;){var k=I.get(h?g:o,C),R=I.get(s,C),E=c,W=void 0;h&&(W=+k-I.get(o,C));var O=void 0,B=void 0,U=void 0,j=void 0;if(v){var z=n.dataToPoint([k,R]);if(h){var G=n.dataToPoint([W,R]);E=G[0]}O=E,B=z[1]+y,U=z[0]-E,j=m,Math.abs(U)0?r:1:r))}var TA=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=To.length,s=Math.min(TA(To,this._approxInterval,0,o),o-1);this._interval=To[s][1],this._intervalPrecision=wa(this._interval),this._minLevelUnit=To[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return vt(r)?r:+pi(r)},t.prototype.contain=function(r){return lc(r,this._extent)},t.prototype.normalize=function(r){return this._calculator.normalize(r,this._extent)},t.prototype.scale=function(r){return this._calculator.scale(r,this._extent)},t.type="time",t})(hi),To=[["second",Bh],["minute",Fh],["hour",ta],["quarter-day",ta*6],["half-day",ta*12],["day",me*1.2],["half-week",me*3.5],["week",me*7],["month",me*31],["quarter",me*95],["half-year",ud/2],["year",ud]];function CA(e,t,r,n){return gf(new Date(t),e,n).getTime()===gf(new Date(r),e,n).getTime()}function DA(e,t){return e/=me,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function MA(e){var t=30*me;return e/=t,e>6?6:e>3?3:e>2?2:1}function AA(e){return e/=ta,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function wp(e,t){return e/=t?Fh:Bh,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function LA(e){return Dm(e)}function PA(e,t,r){var n=Math.max(0,ft(wn,t)-1);return gf(new Date(e),wn[n],r).getTime()}function IA(e,t){var r=new Date(0);r[e](1);var n=r.getTime();r[e](1+t);var i=r.getTime()-n;return function(a,o){return Math.max(0,Math.round((o-a)/i))}}function kA(e,t,r,n,i,a){var o=1e4,s=kT,l=0;function u(P,k,R,E,W,O,B){for(var U=IA(W,P),j=k,z=new Date(j);jo));)if(z[W](z[E]()+P),j=z.getTime(),a){var G=a.calcNiceTickMultiple(j,U);G>0&&(z[W](z[E]()+G*P),j=z.getTime())}B.push({value:j,notAdd:!0})}function f(P,k,R){var E=[],W=!k.length;if(!CA(ea(P),n[0],n[1],r)){W&&(k=[{value:PA(n[0],P,r)},{value:n[1]}]);for(var O=0;O=n[0]&&B<=n[1]&&u(j,B,U,z,G,J,E),P==="year"&&R.length>1&&O===0&&R.unshift({value:R[0].value-j})}}for(var O=0;O=n[0]&&b<=n[1]&&c++)}var S=i/t;if(c>S*1.5&&d>S/1.5||(h.push(y),c>S||e===s[p]))break}v=[]}}}for(var x=Mt($(h,function(P){return Mt(P,function(k){return k.value>=n[0]&&k.value<=n[1]&&!k.notAdd})}),function(P){return P.length>0}),T=[],A=x.length-1,p=0;p0;)a*=10;var s=[Nf(EA(n[0]/a)*a),Nf(RA(n[1]/a)*a)];this._interval=a,this._intervalPrecision=wa(a),this._niceExtent=s}},t.prototype.calcNiceExtent=function(r){e.prototype.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},t.prototype.contain=function(r){return r=Do(r)/Do(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=Do(r)/Do(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),Co(this.base,r)},t.prototype.setBreaksFromOption=function(r){},t.type="log",t})(hi);function cu(e,t){return Nf(e,ir(t))}zr.registerClass(q0);var OA=(function(){function e(t,r,n){this._prepareParams(t,r,n)}return e.prototype._prepareParams=function(t,r,n){n[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!f&&(l=0));var v=this._determinedMin,c=this._determinedMax;return v!=null&&(s=v,u=!0),c!=null&&(l=c,f=!0),{min:s,max:l,minFixed:u,maxFixed:f,isBlank:h}},e.prototype.modifyDataMinMax=function(t,r){this[BA[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=NA[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e})(),NA={min:"_determinedMin",max:"_determinedMax"},BA={min:"_dataMin",max:"_dataMax"};function FA(e,t,r){var n=e.rawExtentInfo;return n||(n=new OA(e,t,r),e.rawExtentInfo=n,n)}function Mo(e,t){return t==null?null:sa(t)?NaN:e.parse(t)}function K0(e,t){var r=e.type,n=FA(e,t,e.getExtent()).calculate();e.setBlank(n.isBlank);var i=n.min,a=n.max,o=t.ecModel;if(o&&r==="time"){var s=U0("bar",o),l=!1;if(M(s,function(h){l=l||h.getBaseAxis()===t.axis}),l){var u=Y0(s),f=zA(i,a,t,u);i=f.min,a=f.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function zA(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=bA(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;M(o,function(c){s=Math.min(c.offset,s)});var l=-1/0;M(o,function(c){l=Math.max(c.offset+c.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,f=t-e,h=1-(s+l)/a,v=f/h-f;return t+=v*(l/u),e-=v*(s/u),{min:e,max:t}}function Tp(e,t){var r=t,n=K0(e,r),i=n.extent,a=r.get("splitNumber");e instanceof q0&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(J0(r)),e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&e.setInterval&&e.setInterval(s)}function GA(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new H0({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new Z0({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(zr.getClass(t)||hi)}}function VA(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function Ba(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=RT(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(Y(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Q(t)){if(e.type==="category")return function(i,a){return t(Cs(e,i),i.value-e.scale.getExtent()[0],null)};var n=ms();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(Cs(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function Cs(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function fc(e){var t=e.get("interval");return t??"auto"}function Q0(e){return e.type==="category"&&fc(e.getLabelModel())===0}function HA(e,t){var r={};return M(e.mapDimensionsAll(t),function(n){r[oA(e,n)]=!0}),st(r)}function ci(e){return e==="middle"||e==="center"}function Ta(e){return e.getShallow("show")}function J0(e){var t=e.get("breaks",!0);t==null}var WA=(function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e})(),Cp=[],jA={registerPreprocessor:E0,registerProcessor:O0,registerPostInit:RM,registerPostUpdate:EM,registerUpdateLifecycle:ic,registerAction:mi,registerCoordinateSystem:OM,registerLayout:NM,registerVisual:An,registerTransform:FM,registerLoading:N0,registerMap:BM,registerImpl:vM,PRIORITY:DM,ComponentModel:ct,ComponentView:Xe,SeriesModel:$e,ChartView:De,registerComponentModel:function(e){ct.registerClass(e)},registerComponentView:function(e){Xe.registerClass(e)},registerSeriesModel:function(e){$e.registerClass(e)},registerChartView:function(e){De.registerClass(e)},registerCustomSeries:function(e,t){},registerSubTypeDefaulter:function(e,t){ct.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){TS(e,t)}};function Br(e){if(H(e)){M(e,function(t){Br(t)});return}ft(Cp,e)>=0||(Cp.push(e),Q(e)&&(e={install:e}),e.install(jA))}var UA=St(),aa=St(),Ae={estimate:1,determine:2};function Ds(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function t_(e,t){var r=$(t,function(n){return e.scale.parse(n)});return e.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function YA(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=Ba(e),i=e.scale.getExtent(),a=t_(e,r),o=Mt(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:$(o,function(s){var l={value:s};return{formattedLabel:n(l),rawLabel:e.scale.getLabel(l),tickValue:s,time:void 0,break:void 0}})}}return e.type==="category"?XA(e,t):qA(e)}function $A(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=t_(e,n);return{ticks:Mt(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?ZA(e,t):{ticks:$(e.scale.getTicks(r),function(o){return o.value})}}function XA(e,t){var r=e.getLabelModel(),n=e_(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function e_(e,t,r){var n=QA(e),i=fc(t),a=r.kind===Ae.estimate;if(!a){var o=n_(n,i);if(o)return o}var s,l;Q(i)?s=o_(e,i):(l=i==="auto"?JA(e,r):i,s=a_(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return Bf(n,i,u),!0}):Bf(n,i,u),u}function ZA(e,t){var r=KA(e),n=fc(t),i=n_(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Q(n))a=o_(e,n,!0);else if(n==="auto"){var s=e_(e,e.getLabelModel(),Ds(Ae.determine));o=s.labelCategoryInterval,a=$(s.labels,function(l){return l.tickValue})}else o=n,a=a_(e,o,!0);return Bf(r,n,{ticks:a,tickCategoryInterval:o})}function qA(e){var t=e.scale.getTicks(),r=Ba(e);return{labels:$(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var KA=r_("axisTick"),QA=r_("axisLabel");function r_(e){return function(r){return aa(r)[e]||(aa(r)[e]={list:[]})}}function n_(e,t){for(var r=0;rf&&(u=Math.max(1,Math.floor(l/f)));for(var h=s[0],v=e.dataToCoord(h+1)-e.dataToCoord(h),c=Math.abs(v*Math.cos(a)),d=Math.abs(v*Math.sin(a)),p=0,g=0;h<=s[1];h+=u){var m=0,y=0,_=Sm(i({value:h}),n.font,"center","top");m=_.width*1.3,y=_.height*1.3,p=Math.max(p,m,7),g=Math.max(g,y,7)}var b=p/c,S=g/d;isNaN(b)&&(b=1/0),isNaN(S)&&(S=1/0);var x=Math.max(0,Math.floor(Math.min(b,S)));if(r===Ae.estimate)return t.out.noPxChangeTryDetermine.push(gt(e2,null,e,x,l)),x;var T=i_(e,x,l);return T??x}function e2(e,t,r){return i_(e,t,r)==null}function i_(e,t,r){var n=UA(e.model),i=e.getExtent(),a=n.lastAutoInterval,o=n.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-r)<=1&&a>t&&n.axisExtent0===i[0]&&n.axisExtent1===i[1])return a;n.lastTickCount=r,n.lastAutoInterval=t,n.axisExtent0=i[0],n.axisExtent1=i[1]}function r2(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function a_(e,t,r){var n=Ba(e),i=e.scale,a=i.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],f=i.count();u!==0&&l>1&&f/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=Q0(e),v=o.get("showMinLabel")||h,c=o.get("showMaxLabel")||h;v&&u!==a[0]&&p(a[0]);for(var d=u;d<=a[1];d+=l)p(d);c&&d-l!==a[1]&&p(a[1]);function p(g){var m={value:g};s.push(r?g:{formattedLabel:n(m),rawLabel:i.getLabel(m),tickValue:g,time:void 0,break:void 0})}return s}function o_(e,t,r){var n=e.scale,i=Ba(e),a=[];return M(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;t(o.value,s)&&a.push(r?l:{formattedLabel:i(o),rawLabel:s,tickValue:l,time:void 0,break:void 0})}),a}var Dp=[0,1],n2=(function(){function e(t,r,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=r,this._extent=n||[0,0]}return e.prototype.contain=function(t){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return t>=n&&t<=i},e.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(t){return PS(t||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(t,r){var n=this._extent;n[0]=t,n[1]=r},e.prototype.dataToCoord=function(t,r){var n=this._extent,i=this.scale;return t=i.normalize(i.parse(t)),this.onBand&&i.type==="ordinal"&&(n=n.slice(),Mp(n,i.count())),dv(t,Dp,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),Mp(n,i.count()));var a=dv(t,n,Dp,r);return this.scale.scale(a)},e.prototype.pointToData=function(t,r){},e.prototype.getTicksCoords=function(t){t=t||{};var r=t.tickModel||this.getTickModel(),n=$A(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=$(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return i2(this,a,o,t.clamp),a},e.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),r=t.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=$(n,function(a){return $(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||Ds(Ae.determine),YA(this,t).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var t=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},e.prototype.calculateCategoryInterval=function(t){return t=t||Ds(Ae.determine),t2(this,t)},e})();function Mp(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function i2(e,t,r,n){var i=t.length;if(!e.onBand||r||!i)return;var a=e.getExtent(),o,s;if(i===1)t[0].coord=a[0],t[0].onBand=!0,o=t[1]={coord:a[1],tickValue:t[0].tickValue,onBand:!0};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;M(t,function(c){c.coord-=u/2,c.onBand=!0});var f=e.scale.getExtent();s=1+f[1]-t[i-1].tickValue,o={coord:t[i-1].coord+u*s,tickValue:f[1]+1,onBand:!0},t.push(o)}var h=a[0]>a[1];v(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&v(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),v(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&v(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function v(c,d){return c=Bt(c),d=Bt(d),h?c>d:c-1&&(u.style.stroke=u.style.fill,u.style.fill=q.color.neutral00,u.style.lineWidth=2),n},t.type="series.line",t.dependencies=["grid","polar"],t.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},t})($e);function cc(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=li(e,t,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(t[a])}return n.join(" ")}var vc=(function(e){V(t,e);function t(r,n,i,a){var o=e.call(this)||this;return o.updateData(r,n,i,a),o}return t.prototype._createSymbol=function(r,n,i,a,o,s){this.removeAll();var l=ui(r,-1,-1,2,2,null,s);l.attr({z2:X(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=h2,this._symbolType=r,this.add(l)},t.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){hs(this.childAt(0))},t.prototype.downplay=function(){cs(this.childAt(0))},t.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},t.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},t.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=t.getSymbolSize(r,n),u=t.getSymbolZ2(r,n),f=o!==this._symbolType,h=a&&a.disableAnimation;if(f){var v=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,v)}else{var c=this.childAt(0);c.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};h?c.attr(d):ae(c,d,s,n),uy(c)}if(this._updateCommon(r,n,l,i,a),f){var c=this.childAt(0);if(!h){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:c.style.opacity}};c.scaleX=c.scaleY=0,c.style.opacity=0,ur(c,d,s,n)}}h&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,f,h,v,c,d,p,g,m;if(a&&(u=a.emphasisItemStyle,f=a.blurItemStyle,h=a.selectItemStyle,v=a.focus,c=a.blurScope,p=a.labelStatesModels,g=a.hoverScale,m=a.cursorStyle,d=a.emphasisDisabled),!a||r.hasItemOption){var y=a&&a.itemModel?a.itemModel:r.getItemModel(n),_=y.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),h=y.getModel(["select","itemStyle"]).getItemStyle(),f=y.getModel(["blur","itemStyle"]).getItemStyle(),v=_.get("focus"),c=_.get("blurScope"),d=_.get("disabled"),p=Zs(y),g=_.getShallow("scale"),m=y.getShallow("cursor")}var b=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(b||0)*Math.PI/180||0);var S=p0(r.getItemVisual(n,"symbolOffset"),i);S&&(s.x=S[0],s.y=S[1]),m&&s.attr("cursor",m);var x=r.getItemVisual(n,"style"),T=x.fill;if(s instanceof qe){var A=s.style;s.useStyle(N({image:A.image,x:A.x,y:A.y,width:A.width,height:A.height},x))}else s.__isEmptyBrush?s.useStyle(N({},x)):s.useStyle(x),s.style.decal=null,s.setColor(T,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var L=r.getItemVisual(n,"liftZ"),D=this._z2;L!=null?D==null&&(this._z2=s.z2,s.z2+=L):D!=null&&(s.z2=D,this._z2=null);var C=o&&o.useNameLabel;Xs(s,p,{labelFetcher:l,labelDataIndex:n,defaultText:I,inheritColor:T,defaultOpacity:x.opacity});function I(R){return C?r.getName(R):cc(r,R)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var P=s.ensureState("emphasis");P.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=f;var k=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;P.scaleX=this._sizeX*k,P.scaleY=this._sizeY*k,this.setSymbolScale(1),vs(this,v,c,d)},t.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},t.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),o=lt(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&ds(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();ds(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return ZD(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t})(Rt);function h2(e,t){this.parent.drift(e,t)}function du(e,t,r,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&e.getItemVisual(r,"symbol")!=="none"}function Ip(e){return e!=null&&!Z(e)&&(e={isIgnore:e}),e||{}}function kp(e){var t=e.hostModel,r=t.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Zs(t),cursorStyle:t.get("cursor")}}var c2=(function(){function e(t){this.group=new Rt,this._SymbolCtor=t||vc}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=Ip(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=kp(t),u={disableAnimation:s},f=r.getSymbolPoint||function(h){return t.getItemLayout(h)};a||n.removeAll(),t.diff(a).add(function(h){var v=f(h);if(du(t,v,h,r)){var c=new o(t,h,l,u);c.setPosition(v),t.setItemGraphicEl(h,c),n.add(c)}}).update(function(h,v){var c=a.getItemGraphicEl(v),d=f(h);if(!du(t,d,h,r)){n.remove(c);return}var p=t.getItemVisual(h,"symbol")||"circle",g=c&&c.getSymbolType&&c.getSymbolType();if(!c||g&&g!==p)n.remove(c),c=new o(t,h,l,u),c.setPosition(d);else{c.updateData(t,h,l,u);var m={x:d[0],y:d[1]};s?c.attr(m):ae(c,m,i)}n.add(c),t.setItemGraphicEl(h,c)}).remove(function(h){var v=a.getItemGraphicEl(h);v&&v.fadeOut(function(){n.remove(v)},i)}).execute(),this._getSymbolPoint=f,this._data=t},e.prototype.updateLayout=function(){var t=this,r=this._data;r&&r.eachItemGraphicEl(function(n,i){var a=t._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=kp(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=Ip(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a0?r=n[0]:n[1]<0&&(r=n[1]),r}function h_(e,t,r,n){var i=NaN;e.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=r.get(e.baseDim,n),o[1-a]=i,t.dataToPoint(o)}function d2(e,t){var r=[];return t.diff(e).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,i){r.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function p2(e,t,r,n,i,a,o,s){for(var l=d2(e,t),u=[],f=[],h=[],v=[],c=[],d=[],p=[],g=f_(i,t,o),m=e.getLayout("points")||[],y=t.getLayout("points")||[],_=0;_=i||p<0)break;if(Tn(m,y)){if(l){p+=a;continue}break}if(p===r)e[a>0?"moveTo":"lineTo"](m,y),h=m,v=y;else{var _=m-u,b=y-f;if(_*_+b*b<.5){p+=a;continue}if(o>0){for(var S=p+a,x=t[S*2],T=t[S*2+1];x===m&&T===y&&g=n||Tn(x,T))c=m,d=y;else{D=x-u,C=T-f;var k=m-u,R=x-m,E=y-f,W=T-y,O=void 0,B=void 0;if(s==="x"){O=Math.abs(k),B=Math.abs(R);var U=D>0?1:-1;c=m-U*O*o,d=y,I=m+U*B*o,P=y}else if(s==="y"){O=Math.abs(E),B=Math.abs(W);var j=C>0?1:-1;c=m,d=y-j*O*o,I=m,P=y+j*B*o}else O=Math.sqrt(k*k+E*E),B=Math.sqrt(R*R+W*W),L=B/(B+O),c=m-D*o*(1-L),d=y-C*o*(1-L),I=m+D*o*L,P=y+C*o*L,I=yr(I,_r(x,m)),P=yr(P,_r(T,y)),I=_r(I,yr(x,m)),P=_r(P,yr(T,y)),D=I-m,C=P-y,c=m-D*O/B,d=y-C*O/B,c=yr(c,_r(u,m)),d=yr(d,_r(f,y)),c=_r(c,yr(u,m)),d=_r(d,yr(f,y)),D=m-c,C=y-d,I=m+D*B/O,P=y+C*B/O}e.bezierCurveTo(h,v,c,d,m,y),h=I,v=P}else e.lineTo(m,y)}u=m,f=y,p+=a}return g}var c_=(function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e})(),g2=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polyline",n}return t.prototype.getDefaultStyle=function(){return{stroke:q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new c_},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Tn(i[o*2-2],i[o*2-1]);o--);for(;a=0){var b=u?(d-l)*_+l:(c-s)*_+s;return u?[r,b]:[b,r]}s=c,l=d;break;case o.C:c=a[h++],d=a[h++],p=a[h++],g=a[h++],m=a[h++],y=a[h++];var S=u?Jo(s,c,p,m,r,f):Jo(l,d,g,y,r,f);if(S>0)for(var x=0;x=0){var b=u?Nt(l,d,g,y,T):Nt(s,c,p,m,T);return u?[r,b]:[b,r]}}s=m,l=y;break}}},t})(ht),m2=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(c_),y2=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;return n.type="ec-polygon",n}return t.prototype.getDefaultShape=function(){return new m2},t.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Tn(i[s*2-2],i[s*2-1]);s--);for(;ot){a?r.push(o(a,l,t)):i&&r.push(o(i,l,0),o(i,l,t));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function x2(e,t,r){var n=e.getVisual("visualMeta");if(!(!n||!n.length||!e.count())&&t.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=e.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=t.getAxis(i),u=$(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),f=u.length,h=a.outerColors.slice();f&&u[0].coord>u[f-1].coord&&(u.reverse(),h.reverse());var v=S2(u,i==="x"?r.getWidth():r.getHeight()),c=v.length;if(!c&&f)return u[0].coord<0?h[1]?h[1]:u[f-1].color:h[0]?h[0]:u[0].color;var d=10,p=v[0].coord-d,g=v[c-1].coord+d,m=g-p;if(m<.001)return"transparent";M(v,function(_){_.offset=(_.coord-p)/m}),v.push({offset:c?v[c-1].offset:.5,color:h[1]||"transparent"}),v.unshift({offset:c?v[0].offset:.5,color:h[0]||"transparent"});var y=new sy(0,0,0,0,v,!0);return y[i]=p,y[i+"2"]=g,y}}}function w2(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&T2(a,t))){var o=t.mapDimension(a.dim),s={};return M(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function T2(e,t){var r=e.getExtent(),n=Math.abs(r[1]-r[0])/e.scale.count();isNaN(n)&&(n=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function C2(e,t){return isNaN(e)||isNaN(t)}function D2(e){for(var t=e.length/2;t>0&&C2(e[t*2-2],e[t*2-1]);t--);return t-1}function Bp(e,t){return[e[t*2],e[t*2+1]]}function M2(e,t,r){for(var n=e.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function p_(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var B=d.getState("emphasis").style;B.lineWidth=+d.style.lineWidth+1}lt(d).seriesIndex=r.seriesIndex,vs(d,E,W,O);var U=Np(r.get("smooth")),j=r.get("smoothMonotone");if(d.setShape({smooth:U,smoothMonotone:j,connectNulls:T}),p){var z=s.getCalculationInfo("stackedOnSeries"),G=0;p.useStyle(dt(u.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),z&&(G=Np(z.get("smooth"))),p.setShape({smooth:U,stackedOnSmooth:G,smoothMonotone:j,connectNulls:T}),ff(p,r,"areaStyle"),lt(p).seriesIndex=r.seriesIndex,vs(p,E,W,O)}var J=this._changePolyState;s.eachItemGraphicEl(function(ot){ot&&(ot.onHoverStateChange=J)}),this._polyline.onHoverStateChange=J,this._data=s,this._coordSys=a,this._stackedOnPoints=S,this._points=f,this._step=D,this._valueOrigin=_,r.get("triggerLineEvent")&&(this.packEventData(r,d),p&&this.packEventData(r,p))},t.prototype.packEventData=function(r,n){lt(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},t.prototype.highlight=function(r,n,i,a){var o=r.getData(),s=Cn(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var f=l[s*2],h=l[s*2+1];if(isNaN(f)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(f,h))return;var v=r.get("zlevel")||0,c=r.get("z")||0;u=new vc(o,s),u.x=f,u.y=h,u.setZ(v,c);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=v,d.z=c,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else De.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=Cn(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else De.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;Hv(this._polyline,r),n&&Hv(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new g2({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},t.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new y2({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},t.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,f=u.get("animationDuration");Q(f)&&(f=f(null));var h=u.get("animationDelay")||0,v=Q(h)?h(null):h;r.eachItemGraphicEl(function(c,d){var p=c;if(p){var g=[c.x,c.y],m=void 0,y=void 0,_=void 0;if(i)if(o){var b=i,S=n.pointToCoord(g);a?(m=b.startAngle,y=b.endAngle,_=-S[1]/180*Math.PI):(m=b.r0,y=b.r,_=S[0])}else{var x=i;a?(m=x.x,y=x.x+x.width,_=c.x):(m=x.y+x.height,y=x.y,_=c.y)}var T=y===m?0:(_-m)/(y-m);l&&(T=1-T);var A=Q(h)?h(d):f*T+v,L=p.getSymbolPath(),D=L.getTextContent();p.attr({scaleX:0,scaleY:0}),p.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:A}),D&&D.animateFrom({style:{opacity:0}},{duration:300,delay:A}),L.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(p_(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new ee({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var f=D2(l);f>=0&&(Xs(s,Zs(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:f,defaultText:function(h,v,c){return c!=null?u_(o,c):cc(o,h)},enableTextSetter:!0},A2(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(r,n,i,a,o,s,l){var u=this._endLabel,f=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=i.getLayout("points"),v=i.hostModel,c=v.get("connectNulls"),d=s.get("precision"),p=s.get("distance")||0,g=l.getBaseAxis(),m=g.isHorizontal(),y=g.inverse,_=n.shape,b=y?m?_.x:_.y+_.height:m?_.x+_.width:_.y,S=(m?p:0)*(y?-1:1),x=(m?0:-p)*(y?-1:1),T=m?"x":"y",A=M2(h,b,T),L=A.range,D=L[1]-L[0],C=void 0;if(D>=1){if(D>1&&!c){var I=Bp(h,L[0]);u.attr({x:I[0]+S,y:I[1]+x}),o&&(C=v.getRawValue(L[0]))}else{var I=f.getPointOn(b,T);I&&u.attr({x:I[0]+S,y:I[1]+x});var P=v.getRawValue(L[0]),k=v.getRawValue(L[1]);o&&(C=QS(i,d,P,k,A.t))}a.lastFrameIndex=L[0]}else{var R=r===1||a.lastFrameIndex>0?L[0]:0,I=Bp(h,R);o&&(C=v.getRawValue(R)),u.attr({x:I[0]+S,y:I[1]+x})}if(o){var E=qs(u);typeof E.setLabelText=="function"&&E.setLabelText(C)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,f=this._polygon,h=r.hostModel,v=p2(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),c=v.current,d=v.stackedOnCurrent,p=v.next,g=v.stackedOnNext;if(o&&(d=br(v.stackedOnCurrent,v.current,i,o,l),c=br(v.current,null,i,o,l),g=br(v.stackedOnNext,v.next,i,o,l),p=br(v.next,null,i,o,l)),Op(c,p)>3e3||f&&Op(d,g)>3e3){u.stopAnimation(),u.setShape({points:p}),f&&(f.stopAnimation(),f.setShape({points:p,stackedOnPoints:g}));return}u.shape.__points=v.current,u.shape.points=c;var m={shape:{points:p}};v.current!==c&&(m.shape.__points=v.next),u.stopAnimation(),ae(u,m,h),f&&(f.setShape({points:c,stackedOnPoints:d}),f.stopAnimation(),ae(f,{shape:{stackedOnPoints:g}},h),u.shape.points!==f.shape.points&&(f.shape.points=u.shape.points));for(var y=[],_=v.status,b=0;b<_.length;b++){var S=_[b].cmd;if(S==="="){var x=r.getItemGraphicEl(_[b].idx1);x&&y.push({el:x,ptIdx:b})}}u.animators&&u.animators.length&&u.animators[0].during(function(){f&&f.dirtyShape();for(var T=u.shape.__points,A=0;At&&(t=e[r]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,r=0;r10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),f=l.getExtent(),h=n.getDevicePixelRatio(),v=Math.abs(f[1]-f[0])*(h||1),c=Math.round(s/v);if(isFinite(c)&&c>1){a==="lttb"?t.setData(i.lttbDownSample(i.mapDimension(u.dim),1/c)):a==="minmax"&&t.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/c));var d=void 0;Y(a)?d=I2[a]:Q(a)&&(d=a),d&&t.setData(i.downSample(i.mapDimension(u.dim),1/c,d,k2))}}}}}function R2(e){e.registerChartView(L2),e.registerSeriesModel(f2),e.registerLayout(P2("line")),e.registerVisual({seriesType:"line",reset:function(t){var r=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,g_("line"))}var zf=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(r,n){return sc(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(r,n,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(r),s=a.dataToPoint(o);if(i)M(a.getAxes(),function(v,c){if(v.type==="category"&&n!=null){var d=v.getTicksCoords(),p=v.getTickModel().get("alignWithLabel"),g=o[c],m=n[c]==="x1"||n[c]==="y1";if(m&&!p&&(g+=1),d.length<2)return;if(d.length===2){s[c]=v.toGlobalCoord(v.getExtent()[m?1:0]);return}for(var y=void 0,_=void 0,b=1,S=0;Sg){_=(x+y)/2;break}S===1&&(b=T-d[0].tickValue)}_==null&&(y?y&&(_=d[d.length-1].coord):_=d[0].coord),s[c]=v.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),f=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+f/2}return s}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},t})($e);$e.registerClass(zf);var E2=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.getInitialData=function(){return sc(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},t.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=by(zf.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:q.color.primary,borderWidth:2}},realtimeSort:!1}),t})(zf),O2=(function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e})(),Fp=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;return n.type="sausage",n}return t.prototype.getDefaultShape=function(){return new O2},t.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,f=n.startAngle,h=n.endAngle,v=n.clockwise,c=Math.PI*2,d=v?h-fMath.PI/2&&fs)return!0;s=h}return!1},t.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},t.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},t.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Vo(a,r,lt(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t})(De),zp={cartesian2d:function(e,t){var r=t.width<0?-1:1,n=t.height<0?-1:1;r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=gu(t.x,e.x),s=mu(t.x+t.width,i),l=gu(t.y,e.y),u=mu(t.y+t.height,a),f=si?s:o,t.y=h&&l>a?u:l,t.width=f?0:s-o,t.height=h?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),f||h},polar:function(e,t){var r=t.r0<=t.r?1:-1;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}var i=mu(t.r,e.r),a=gu(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(r<0){var n=t.r;t.r=t.r0,t.r0=n}return o}},Gp={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new wt({shape:N({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var f=u.shape,h=i?"height":"width";f[h]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?Fp:gi,f=new u({shape:n,z2:1});f.name="item";var h=m_(i);if(f.calculateTextPosition=N2(h,{isRoundCap:u===Fp}),a){var v=f.shape,c=i?"r":"endAngle",d={};v[c]=i?n.r0:n.startAngle,d[c]=n[c],(s?ae:ur)(f,{shape:d},a)}return f}};function V2(e,t){var r=e.get("realtimeSort",!0),n=t.getBaseAxis();if(r&&n.type==="category"&&t.type==="cartesian2d")return{baseAxis:n,otherAxis:t.getOtherAxis(n)}}function Vp(e,t,r,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?ae:ur)(r,{shape:l},t,i,null);var f=t?e.baseAxis.model:null;(o?ae:ur)(r,{shape:u},f,i)}function Hp(e,t){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(e,t,r){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function j2(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function m_(e){return(function(t){var r=t?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}})(e)}function jp(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var f=e.shape,h=F2(n.getModel("itemStyle"),f);N(f,h),e.setShape(f)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var v=n.getShallow("cursor");v&&e.attr("cursor",v);var c=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",d=Zs(n);Xs(e,d,{labelFetcher:a,labelDataIndex:r,defaultText:cc(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:c});var p=e.getTextContent();if(s&&p){var g=n.get(["label","position"]);e.textConfig.inside=g==="middle"?!0:null,B2(e,g==="outside"?c:g,m_(o),n.get(["label","rotate"]))}dT(p,d,a.getRawValue(r),function(y){return u_(t,y)});var m=n.getModel(["emphasis"]);vs(e,m.get("focus"),m.get("blurScope"),m.get("disabled")),ff(e,n),j2(i)&&(e.style.fill="none",e.style.stroke="none",M(e.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function U2(e,t){var r=e.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=e.get(["itemStyle","borderWidth"])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(n,i,a)}var Y2=(function(){function e(){}return e})(),Up=(function(e){V(t,e);function t(r){var n=e.call(this,r)||this;return n.type="largeBar",n}return t.prototype.getDefaultShape=function(){return new Y2},t.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,f=0;f=0?r:null},30,!1);function $2(e,t,r){for(var n=e.baseDimIdx,i=1-n,a=e.shape.points,o=e.largeDataIndices,s=[],l=[],u=e.barWidth,f=0,h=a.length/3;f=s[0]&&t<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[f]}return-1}function y_(e,t,r){if(dc(r,"cartesian2d")){var n=t,i=r.getArea();return{x:e?n.x:i.x,y:e?i.y:n.y,width:e?n.width:i.width,height:e?i.height:n.height}}else{var i=r.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}}function X2(e,t,r){var n=e.type==="polar"?gi:wt;return new n({shape:y_(t,r,e),silent:!0,z2:0})}function Z2(e){e.registerChartView(G2),e.registerSeriesModel(E2),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,At(SA,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,xA("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,g_("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,r){var n=t.componentType||"series";r.eachComponent({mainType:n,query:t},function(i){t.sortInfo&&i.axis.setCategorySortInfo(t.sortInfo)})})}var __={left:0,right:0,top:0,bottom:0},Ls=["25%","25%"],q2=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Na(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Nr(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Nr(this.option.outerBounds,r.outerBounds)},t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:__,outerBoundsContain:"all",outerBoundsClampWidth:Ls[0],outerBoundsClampHeight:Ls[1],backgroundColor:q.color.transparent,borderWidth:1,borderColor:q.color.neutral30},t})(ct),Gf=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ge).models[0]},t.type="cartesian2dAxis",t})(ct);Ze(Gf,WA);var b_={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:q.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:q.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:q.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[q.color.backgroundTint,q.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:q.color.neutral00,borderColor:q.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},K2=yt({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},b_),pc=yt({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:q.color.axisMinorSplitLine,width:1}}},b_),Q2=yt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},pc),J2=dt({logBase:10},pc);const tL={category:K2,value:pc,time:Q2,log:J2};var eL={value:1,category:1,time:1,log:1},rL=null;function nL(){return rL}function Xp(e,t,r,n){M(eL,function(i,a){var o=yt(yt({},tL[a],!0),n,!0),s=(function(l){V(u,l);function u(){var f=l!==null&&l.apply(this,arguments)||this;return f.type=t+"Axis."+a,f}return u.prototype.mergeDefaultAndTheme=function(f,h){var v=ya(this),c=v?Na(f):{},d=h.getTheme();yt(f,d.get(a+"Axis")),yt(f,this.getDefaultOption()),f.type=Zp(f),v&&Nr(f,c,v)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=Of.createByAxisModel(this))},u.prototype.getCategories=function(f){var h=this.option;if(h.type==="category")return f?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(f){return{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u})(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",Zp)}function Zp(e){return e.type||(e.data?"category":"value")}var iL=(function(){function e(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return e.prototype.getAxis=function(t){return this._axes[t]},e.prototype.getAxes=function(){return $(this._dimList,function(t){return this._axes[t]},this)},e.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),Mt(this.getAxes(),function(r){return r.scale.type===t})},e.prototype.addAxis=function(t){var r=t.dim;this._axes[r]=t,this._dimList.push(r)},e})(),Vf=["x","y"];function qp(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var aL=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=Vf,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!qp(r)||!qp(n))){var i=r.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var f=(s[0]-o[0])/l,h=(s[1]-o[1])/u,v=o[0]-i[0]*f,c=o[1]-a[0]*h,d=this._transform=[f,0,0,h,v,c];this._invTransform=Pa([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},t.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},t.prototype.containZone=function(r,n){var i=this.dataToPoint(r),a=this.dataToPoint(n),o=this.getArea(),s=new at(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},t.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return ye(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},t.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},t.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return ye(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.toLocalCoord(r[1]),n),i},t.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},t.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-r,o=Math.min(i[0],i[1])-r,s=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-o+r;return new at(a,o,s,l)},t})(iL),oL=(function(e){V(t,e);function t(r,n,i,a,o){var s=e.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},t.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},t.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},t.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},t})(n2),sL="expandAxisBreak",Dr=Math.PI,lL=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],uL=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Ca=St(),S_=St(),x_=(function(){function e(t){this.recordMap={},this.resolveAxisNameOverlap=t}return e.prototype.ensureRecord=function(t){var r=t.axis.dim,n=t.componentIndex,i=this.recordMap,a=i[r]||(i[r]=[]);return a[n]||(a[n]={ready:{}})},e})();function fL(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=gc(e.axisName)&&ci(e.nameLocation);M(n,function(d){var p=Fr(d);if(!(!p||p.label.ignore)){o.push(p);var g=a.transGroup;l&&(g.transform?Pa(Oi,g.transform):sh(Oi),p.transform&&Xi(Oi,Oi,p.transform),at.copy(Io,p.localRect),Io.applyTransform(Oi),s?s.union(Io):at.copy(s=new at(0,0,0,0),Io))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",f=a.transGroup[u];if(o.sort(function(d,p){return Math.abs(d.label[u]-f)-Math.abs(p.label[u]-f)}),l&&s){var h=i.getExtent(),v=Math.min(h[0],h[1]),c=Math.max(h[0],h[1])-v;s.union(new at(v,0,c,1))}a.stOccupiedRect=s,a.labelInfoList=o}var Oi=sr(),Io=new at(0,0,0,0),w_=function(e,t,r,n,i,a){if(ci(e.nameLocation)){var o=a.stOccupiedRect;o&&T_(s2({},o,a.transGroup.transform),n,i)}else C_(a.labelInfoList,a.dirVec,n,i)};function T_(e,t,r){var n=new pt;hc(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&l2(t,n)}function C_(e,t,r,n){for(var i=pt.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):os(i-Dr)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},e.makeAxisEventDataBase=function(t){var r={componentType:t.mainType,componentIndex:t.componentIndex};return r[t.mainType+"Index"]=t.componentIndex,r},e.isLabelSilent=function(t){var r=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||r&&r.show)},e})(),hL=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],cL={axisLine:function(e,t,r,n,i,a,o){var s=n.get(["axisLine","show"]);if(s==="auto"&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),!!s){var l=n.axis.getExtent(),u=a.transform,f=[l[0],0],h=[l[1],0],v=f[0]>h[0];u&&(ye(f,f,u),ye(h,h,u));var c=N({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),d={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:c};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())nL().buildAxisBreakLine(n,i,a,d);else{var p=new Or(N({shape:{x1:f[0],y1:f[1],x2:h[0],y2:h[1]}},d));pa(p.shape,p.style.lineWidth),p.anid="line",i.add(p)}var g=n.get(["axisLine","symbol"]);if(g!=null){var m=n.get(["axisLine","symbolSize"]);Y(g)&&(g=[g,g]),(Y(m)||vt(m))&&(m=[m,m]);var y=p0(n.get(["axisLine","symbolOffset"])||0,m),_=m[0],b=m[1];M([{rotate:e.rotation+Math.PI/2,offset:y[0],r:0},{rotate:e.rotation-Math.PI/2,offset:y[1],r:Math.sqrt((f[0]-h[0])*(f[0]-h[0])+(f[1]-h[1])*(f[1]-h[1]))}],function(S,x){if(g[x]!=="none"&&g[x]!=null){var T=ui(g[x],-_/2,-b/2,_,b,c.stroke,!0),A=S.r+S.offset,L=v?h:f;T.attr({rotation:S.rotate,x:L[0]+A*Math.cos(e.rotation),y:L[1]-A*Math.sin(e.rotation),silent:!0,z2:11}),i.add(T)}})}}},axisTickLabelEstimate:function(e,t,r,n,i,a,o,s){var l=Qp(t,i,s);l&&Kp(e,t,r,n,i,a,o,Ae.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=Qp(t,i,s);l&&Kp(e,t,r,n,i,a,o,Ae.determine);var u=gL(e,i,a,n);pL(e,t.labelLayoutList,u),mL(e,i,a,n,e.tickDirection)},axisName:function(e,t,r,n,i,a,o,s){var l=r.ensureRecord(n);t.nameEl&&(i.remove(t.nameEl),t.nameEl=l.nameLayout=l.nameLocation=null);var u=e.axisName;if(gc(u)){var f=e.nameLocation,h=e.nameDirection,v=n.getModel("nameTextStyle"),c=n.get("nameGap")||0,d=n.axis.getExtent(),p=n.axis.inverse?-1:1,g=new pt(0,0),m=new pt(0,0);f==="start"?(g.x=d[0]-p*c,m.x=-p):f==="end"?(g.x=d[1]+p*c,m.x=p):(g.x=(d[0]+d[1])/2,g.y=e.labelOffset+h*c,m.y=h);var y=sr();m.transform(lh(y,y,e.rotation));var _=n.get("nameRotate");_!=null&&(_=_*Dr/180);var b,S;ci(f)?b=Ir.innerTextLayout(e.rotation,_??e.rotation,h):(b=vL(e.rotation,f,_||0,d),S=e.raw.axisNameAvailableWidth,S!=null&&(S=Math.abs(S/Math.sin(b.rotation)),!isFinite(S)&&(S=null)));var x=v.getFont(),T=n.get("nameTruncate",!0)||{},A=T.ellipsis,L=qo(e.raw.nameTruncateMaxWidth,T.maxWidth,S),D=s.nameMarginLevel||0,C=new ee({x:g.x,y:g.y,rotation:b.rotation,silent:Ir.isLabelSilent(n),style:si(v,{text:u,font:x,overflow:"truncate",width:L,ellipsis:A,fill:v.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:v.get("align")||b.textAlign,verticalAlign:v.get("verticalAlign")||b.textVerticalAlign}),z2:1});if(Us({el:C,componentModel:n,itemName:u}),C.__fullText=u,C.anid="name",n.get("triggerEvent")){var I=Ir.makeAxisEventDataBase(n);I.targetType="axisName",I.name=u,lt(C).eventData=I}a.add(C),C.updateTransform(),t.nameEl=C;var P=l.nameLayout=Fr({label:C,priority:C.z2,defaultAttr:{ignore:C.ignore},marginDefault:ci(f)?lL[D]:uL[D]});if(l.nameLocation=f,i.add(C),C.decomposeTransform(),e.shouldNameMoveOverlap&&P){var k=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,P,m,k)}}}};function Kp(e,t,r,n,i,a,o,s){M_(t)||yL(e,t,i,s,n,o);var l=t.labelLayoutList;_L(e,n,l,a),e.rotation;var u=e.optionHideOverlap;dL(n,l,u),u&&u2(Mt(l,function(f){return f&&!f.label.ignore})),fL(e,r,n,l)}function vL(e,t,r,n){var i=Cm(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return os(i-Dr/2)?(o=l?"bottom":"top",a="center"):os(i-Dr*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iDr/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function dL(e,t,r){if(Q0(e.axis))return;function n(s,l,u){var f=Fr(t[l]),h=Fr(t[u]);if(!(!f||!h)){if(s===!1||f.suggestIgnore){Ui(f.label);return}if(h.suggestIgnore){Ui(h.label);return}var v=.1;if(!r){var c=[0,0,0,0];f=Lp({marginForce:c},f),h=Lp({marginForce:c},h)}hc(f,h,null,{touchThreshold:v})&&Ui(s?h.label:f.label)}}var i=e.get(["axisLabel","showMinLabel"]),a=e.get(["axisLabel","showMaxLabel"]),o=t.length;n(i,0,1),n(a,o-1,o-2)}function pL(e,t,r){e.showMinorTicks||M(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(d)&&isFinite(u[0]);)c=hu(c),d=u[1]-c*o;else{var g=e.getTicks().length-1;g>o&&(c=hu(c));var m=c*o;p=Math.ceil(u[1]/c)*c,d=Bt(p-m),d<0&&u[0]>=0?(d=0,p=Bt(m)):p>0&&u[1]<=0&&(p=0,d=-Bt(m))}var y=(i[0].value-a[0].value)/s,_=(i[o].value-a[o].value)/s;n.setExtent.call(e,d+c*y,p+c*_),n.setInterval.call(e,c),(y||_)&&n.setNiceExtent.call(e,d+c,p-c)}var tg=[[3,1],[0,2]],DL=(function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Vf,this._initCartesian(t,r,n),this.model=t}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(t,r){var n=this._axesMap;this._updateScale(t,this.model);function i(o){var s,l=st(o),u=l.length;if(u){for(var f=[],h=u-1;h>=0;h--){var v=+l[h],c=o[v],d=c.model,p=c.scale;Rf(p)&&d.get("alignTicks")&&d.get("interval")==null?f.push(c):(Tp(p,d),Rf(p)&&(s=c))}f.length&&(s||(s=f.pop(),Tp(s.scale,s.model)),M(f,function(g){CL(g.scale,g.model,s.scale)}))}}i(n.x),i(n.y);var a={};M(n.x,function(o){eg(n,"y",o,a)}),M(n.y,function(o){eg(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=Ry(t,r),a=this._rect=ma(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(A_(o,a),!n){var u=AL(a,s,o,l,r),f=void 0;if(l)f=ig(a.clone(),"axisLabel",null,a,o,u,i);else{var h=LL(t,a,i),v=h.outerBoundsRect,c=h.parsedOuterBoundsContain,d=h.outerBoundsClamp;v&&(f=ig(v,c,d,a,o,u,i))}L_(a,o,Ae.determine,null,f,i)}M(this._coordsList,function(p){p.calcAffineTransform()})},e.prototype.getAxis=function(t,r){var n=this._axesMap[t];if(n!=null)return n[r||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(t,r){if(t!=null&&r!=null){var n="x"+t+"y"+r;return this._coordsMap[n]}Z(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return ps(n,s,!0,!0,r),A_(i,n),l;function u(v){M(i[vn[v]],function(c){if(Ta(c.model)){var d=a.ensureRecord(c.model),p=d.labelInfoList;if(p)for(var g=0;g0&&!sa(c)&&c>1e-4&&(v/=c),v}}function AL(e,t,r,n,i){var a=new x_(PL);return M(r,function(o){return M(o,function(s){if(Ta(s.model)){var l=!n;s.axisBuilder=wL(e,t,s.model,i,a,l)}})}),a}function L_(e,t,r,n,i,a){var o=r===Ae.determine;M(t,function(u){return M(u,function(f){Ta(f.model)&&(TL(f.axisBuilder,e,f.model),f.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[vn[1-u]]=e[da[u]]<=a.refContainer[da[u]]*.5?0:1-u===1?2:1}M(t,function(u,f){return M(u,function(h){Ta(h.model)&&((n==="all"||o)&&h.axisBuilder.build({axisName:!0},{nameMarginLevel:s[f]}),o&&h.axisBuilder.build({axisLine:!0}))})})}function LL(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=ma(e.get("outerBounds",!0)||__,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||ft(["all","axisLabel"],a)<0?o="all":o=a;var s=[tf(X(e.get("outerBoundsClampWidth",!0),Ls[0]),t.width),tf(X(e.get("outerBoundsClampHeight",!0),Ls[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var PL=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";w_(e,t,r,n,i,a),ci(e.nameLocation)||M(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&C_(s.labelInfoList,s.dirVec,n,i)})};function IL(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return kL(r,e,t),r.seriesInvolved&&EL(r,e),r}function kL(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];M(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Da(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var f=s.model,h=f.getModel("tooltip",n);if(M(s.getAxes(),At(p,!1,null)),s.getTooltipAxes&&n&&h.get("show")){var v=h.get("trigger")==="axis",c=h.get(["axisPointer","type"])==="cross",d=s.getTooltipAxes(h.get(["axisPointer","axis"]));(v||c)&&M(d.baseAxes,At(p,c?"cross":!0,v)),c&&M(d.otherAxes,At(p,"cross",!1))}function p(g,m,y){var _=y.model.getModel("axisPointer",i),b=_.get("show");if(!(!b||b==="auto"&&!g&&!Wf(_))){m==null&&(m=_.get("triggerTooltip")),_=g?RL(y,h,i,t,g,m):_;var S=_.get("snap"),x=_.get("triggerEmphasis"),T=Da(y.model),A=m||S||y.type==="category",L=e.axesInfo[T]={key:T,axis:y,coordSys:s,axisPointerModel:_,triggerTooltip:m,triggerEmphasis:x,involveSeries:A,snap:S,useHandle:Wf(_),seriesModels:[],linkGroup:null};u[T]=L,e.seriesInvolved=e.seriesInvolved||A;var D=OL(a,y);if(D!=null){var C=o[D]||(o[D]={axesInfo:{}});C.axesInfo[T]=L,C.mapper=a[D].mapper,L.linkGroup=C}}}})}function RL(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};M(s,function(v){l[v]=it(o.get(v))}),l.snap=e.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var f=o.get(["label","show"]);if(u.show=f??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&dt(u,h.textStyle)}}return e.model.getModel("axisPointer",new _t(l,r,n))}function EL(e,t){t.eachSeries(function(r){var n=r.coordinateSystem,i=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!n||!n.model||i==="none"||i===!1||i==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||M(e.coordSysAxesInfo[Da(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function OL(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function NL(e){var t=mc(e);if(t){var r=t.axisPointerModel,n=t.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=Wf(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),os)return!0;if(o){var l=mc(t).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},e.prototype.makeElOption=function(t,r,n,i,a){},e.prototype.createPointerEl=function(t,r,n,i){var a=r.pointer;if(a){var o=dn(t).pointerEl=new uT[a.type](sg(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=dn(t).labelEl=new ee(sg(r.label));t.add(a),ug(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=dn(t).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},e.prototype.updateLabelEl=function(t,r,n,i){var a=dn(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),ug(a,i))},e.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=kh(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Qg(u.event)},onmousedown:bu(this._onHandleDragMove,this,0,0),drift:bu(this._onHandleDragMove,this),ondragend:bu(this._onHandleDragEnd,this)}),n.add(i)),fg(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");H(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,s0(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){lg(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Su(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(t,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(Su(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(Su(i)),dn(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var r=t.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),wf(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(t,r,n){return n=n||0,{x:t[n],y:t[1-n],width:r[n],height:r[1-n]}},e})();function lg(e,t,r,n){R_(dn(r).lastProp,n)||(dn(r).lastProp=n,t?ae(r,n,e):(r.stopAnimation(),r.attr(n)))}function R_(e,t){if(Z(e)&&Z(t)){var r=!0;return M(t,function(n,i){r=r&&R_(e[i],n)}),!!r}else return e===t}function ug(e,t){e[t.get(["label","show"])?"show":"hide"]()}function Su(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function fg(e,t,r){var n=t.get("z"),i=t.get("zlevel");e&&e.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function YL(e){var t=e.get("type"),r=e.getModel(t+"Style"),n;return t==="line"?(n=r.getLineStyle(),n.fill=null):t==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function $L(e,t,r,n,i){var a=r.get("value"),o=E_(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=Js(s.get("padding")||0),u=s.getFont(),f=Sm(o,u),h=i.position,v=f.width+l[1]+l[3],c=f.height+l[0]+l[2],d=i.align;d==="right"&&(h[0]-=v),d==="center"&&(h[0]-=v/2);var p=i.verticalAlign;p==="bottom"&&(h[1]-=c),p==="middle"&&(h[1]-=c/2),XL(h,v,c,n);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=t.get(["axisLine","lineStyle","color"])),e.label={x:h[0],y:h[1],style:si(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function XL(e,t,r,n){var i=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+r,a)-r,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function E_(e,t,r,n,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:Cs(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};M(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,h=u&&u.getDataParams(f);h&&s.seriesData.push(h)}),Y(o)?a=o.replace("{value}",a):Q(o)&&(a=o(s))}return a}function O_(e,t,r){var n=sr();return lh(n,n,r.rotation),Ou(n,n,r.position),Ih([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function ZL(e,t,r,n,i,a){var o=Ir.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),$L(t,n,i,a,{position:O_(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function qL(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function KL(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}var QL=(function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),f=hg(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var v=YL(a),c=JL[u](s,h,f);c.style=v,r.graphicKey=c.type,r.pointer=c}var d=Ps(l.getRect(),i);ZL(n,r,d,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=Ps(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=O_(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=hg(s,o).getOtherAxis(o).getGlobalExtent(),f=o.dim==="x"?0:1,h=[r.x,r.y];h[f]+=n[f],h[f]=Math.min(l[1],h[f]),h[f]=Math.max(l[0],h[f]);var v=(u[1]+u[0])/2,c=[v,v];c[f]=h[f];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:c,tooltipOption:d[f]}},t})(UL);function hg(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var JL={line:function(e,t,r){var n=qL([t,r[0]],[t,r[1]],cg(e));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(e,t,r){var n=Math.max(1,e.getBandWidth()),i=r[1]-r[0];return{type:"Rect",shape:KL([t-n/2,r[0]],[n,i],cg(e))}}};function cg(e){return e.dim==="x"?0:1}var tP=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:q.color.border,width:1,type:"dashed"},shadowStyle:{color:q.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:q.color.neutral00,padding:[5,7,5,7],backgroundColor:q.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:q.color.accent40,throttle:40}},t})(ct),or=St(),eP=M;function N_(e,t,r){if(!tt.node){var n=t.getZr();or(n).records||(or(n).records={}),rP(n,t);var i=or(n).records[e]||(or(n).records[e]={});i.handler=r}}function rP(e,t){if(or(e).initialized)return;or(e).initialized=!0,r("click",At(vg,"click")),r("mousemove",At(vg,"mousemove")),r("globalout",iP);function r(n,i){e.on(n,function(a){var o=aP(t);eP(or(e).records,function(s){s&&i(s,a,o.dispatchAction)}),nP(o.pendings,t)})}}function nP(e,t){var r=e.showTip.length,n=e.hideTip.length,i;r?i=e.showTip[r-1]:n&&(i=e.hideTip[n-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function iP(e,t,r){e.handler("leave",null,r)}function vg(e,t,r,n){t.handler(e,r,n)}function aP(e){var t={showTip:[],hideTip:[]},r=function(n){var i=t[n.type];i?i.push(n):(n.dispatchAction=r,e.dispatchAction(n))};return{dispatchAction:r,pendings:t}}function Uf(e,t){if(!tt.node){var r=t.getZr(),n=(or(r).records||{})[e];n&&(or(r).records[e]=null)}}var oP=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";N_("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(r,n){Uf("axisPointer",n)},t.prototype.dispose=function(r,n){Uf("axisPointer",n)},t.type="axisPointer",t})(Xe);function B_(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=Cn(a,e);if(o==null||o<0||H(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),f=l.getOtherAxis(u),h=f.dim,v=u.dim,c=h==="x"||h==="radius"?1:0,d=a.mapDimension(v),p=[];p[c]=a.get(d,o),p[1-c]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(p)||[]}else r=l.dataToPoint(a.getValues($(l.dimensions,function(m){return a.mapDimension(m)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var dg=St();function sP(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||gt(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Xo(i)&&(i=B_({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Xo(i),u=a.axesInfo,f=s.axesInfo,h=n==="leave"||Xo(i),v={},c={},d={list:[],map:{}},p={showPointer:At(uP,c),showTooltip:At(fP,d)};M(s.coordSysMap,function(m,y){var _=l||m.containPoint(i);M(s.coordSysAxesInfo[y],function(b,S){var x=b.axis,T=dP(u,b);if(!h&&_&&(!u||T)){var A=T&&T.value;A==null&&!l&&(A=x.pointToData(i)),A!=null&&pg(b,A,p,!1,v)}})});var g={};return M(f,function(m,y){var _=m.linkGroup;_&&!c[y]&&M(_.axesInfo,function(b,S){var x=c[S];if(b!==m&&x){var T=x.value;_.mapper&&(T=m.axis.scale.parse(_.mapper(T,gg(b),gg(m)))),g[m.key]=T}})}),M(g,function(m,y){pg(f[y],m,p,!0,v)}),hP(c,f,v),cP(d,i,e,o),vP(f,o,r),v}}function pg(e,t,r,n,i){var a=e.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!e.involveSeries){r.showPointer(e,t);return}var o=lP(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&N(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function lP(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return M(t.seriesModels,function(l,u){var f=l.getData().mapDimensionsAll(n),h,v;if(l.getAxisTooltipData){var c=l.getAxisTooltipData(f,e,r);v=c.dataIndices,h=c.nestestValue}else{if(v=l.indicesOfNearest(n,f[0],e,r.type==="category"?.5:null),!v.length)return;h=l.getData().get(f[0],v[0])}if(!(h==null||!isFinite(h))){var d=e-h,p=Math.abs(d);p<=o&&((p=0&&s<0)&&(o=p,s=d,i=h,a.length=0),M(v,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:i}}function uP(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function fP(e,t,r,n){var i=r.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!i.length)){var l=t.coordSys.model,u=Da(l),f=e.map[u];f||(f=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(f)),f.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function hP(e,t,r){var n=r.axesInfo=[];M(t,function(i,a){var o=i.axisPointerModel.option,s=e[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function cP(e,t,r,n){if(Xo(t)||!e.list.length){n({type:"hideTip"});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function vP(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=dg(n)[i]||{},o=dg(n)[i]={};M(e,function(u,f){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&M(h.seriesDataIndices,function(v){var c=v.seriesIndex+" | "+v.dataIndex;o[c]=v})});var s=[],l=[];M(a,function(u,f){!o[f]&&l.push(u)}),M(o,function(u,f){!a[f]&&s.push(u)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function dP(e,t){for(var r=0;r<(e||[]).length;r++){var n=e[r];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}function gg(e){var t=e.axis.model,r={},n=r.axisDim=e.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=t.componentIndex,r.axisName=r[n+"AxisName"]=t.name,r.axisId=r[n+"AxisId"]=t.id,r}function Xo(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function F_(e){P_.registerAxisPointerClass("CartesianAxisPointer",QL),e.registerComponentModel(tP),e.registerComponentView(oP),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!H(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=IL(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},sP)}function pP(e){Br(jL),Br(F_)}function gP(e,t){var r=Js(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new wt({shape:{x:e.x-r[3],y:e.y-r[0],width:e.width+r[1]+r[3],height:e.height+r[0]+r[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1});return i}var mP=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="tooltip",t.dependencies=["axisPointer"],t.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:q.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:q.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:q.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:q.color.tertiary,fontSize:14}},t})(ct);function z_(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function G_(e){if(tt.domSupported){for(var t=document.documentElement.style,r=0,n=e.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var f=u*Math.PI/180,h=o+i,v=h*Math.abs(Math.cos(f))+h*Math.abs(Math.sin(f)),c=Math.round(((v-Math.SQRT2*i)/2+Math.SQRT2*i-(v-h)/2)*100)/100;s+=";"+a+":-"+c+"px";var d=t+" solid "+i+"px;",p=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+n+";"];return'
'}function TP(e,t,r){var n="cubic-bezier(0.23,1,0.32,1)",i="",a="";return r&&(i=" "+e/2+"s "+n,a="opacity"+i+",visibility"+i),t||(i=" "+e+"s "+n,a+=(a.length?",":"")+(tt.transformSupported?""+yc+i:",left"+i+",top"+i)),bP+":"+a}function mg(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!tt.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=tt.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+yc+":"+o+";":[["top",0],["left",0],[V_,o]]}function CP(e){var t=[],r=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var i=X(e.get("lineHeight"),Math.round(r*3/2));r&&t.push("line-height:"+i+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return a&&o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),M(["decoration","align"],function(u){var f=e.get(u);f&&t.push("text-"+u+":"+f)}),t.join(";")}function DP(e,t,r,n){var i=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),f=e.get("shadowOffsetY"),h=e.getModel("textStyle"),v=a0(e,"html"),c=u+"px "+f+"px "+s+"px "+l;return i.push("box-shadow:"+c),t&&a>0&&i.push(TP(a,r,n)),o&&i.push("background-color:"+o),M(["width","color","radius"],function(d){var p="border-"+d,g=Iy(p),m=e.get(g);m!=null&&i.push(p+":"+m+(d==="color"?"":"px"))}),i.push(CP(h)),v!=null&&i.push("padding:"+Js(v).join("px ")+"px"),i.join(";")+";"}function yg(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&hb(e,o,r,n,i)}else{e[0]=n,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var MP=(function(){function e(t,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,tt.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),a=r.appendTo,o=a&&(Y(a)?document.querySelector(a):oa(a)?a:Q(a)&&a(t.getDom()));yg(this._styleCoord,i,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(n),this._api=t,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,f=i.painter.getViewportRoot();fe(f,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return e.prototype.update=function(t){if(!this._container){var r=this._api.getDom(),n=_P(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},e.prototype.show=function(t,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=SP+DP(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+mg(a[0],a[1],!0)+("border-color:"+Dn(r)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(t,r,n,i,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(Y(a)&&n.get("trigger")==="item"&&!z_(n)&&(s=wP(n,i,a)),Y(t))o.innerHTML=t+s;else if(t){o.innerHTML="",H(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api,a=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(r,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||tt.node||!i.getDom())){var o=Sg(a,i);this._ticket="";var s=a.dataByCoordSys,l=EP(a,n,i);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:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var f=LP;f.x=a.x,f.y=a.y,f.update(),lt(f).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:f},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var h=B_(a,n),v=h.point[0],c=h.point[1];v!=null&&c!=null&&this._tryShow({offsetX:v,offsetY:c,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(Sg(a,i))},t.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var f=u.getData(),h=Ni([f.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){var s=lt(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;ji(i,function(f){if(f.tooltipDisabled)return l=u=null,!0;l||u||(lt(f).dataIndex!=null?l=f:lt(f).tooltipConfig!=null&&(u=f))},!0),l?this._showSeriesItemTooltip(r,l,n):u?this._showComponentItemTooltip(r,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},t.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=gt(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},t.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=Ni([n.tooltipOption],a),l=this._renderMode,u=[],f=ba("section",{blocks:[],noHeader:!0}),h=[],v=new tu;M(r,function(y){M(y.dataByAxis,function(_){var b=i.getComponent(_.axisDim+"Axis",_.axisIndex),S=_.value;if(!(!b||S==null)){var x=E_(S,b.axis,i,_.seriesDataIndices,_.valueLabelOpt),T=ba("section",{header:x,noHeader:!ze(x),sortBlocks:!0,blocks:[]});f.blocks.push(T),M(_.seriesDataIndices,function(A){var L=i.getSeriesByIndex(A.seriesIndex),D=A.dataIndexInside,C=L.getDataParams(D);if(!(C.dataIndex<0)){C.axisDim=_.axisDim,C.axisIndex=_.axisIndex,C.axisType=_.axisType,C.axisId=_.axisId,C.axisValue=Cs(b.axis,{value:S}),C.axisValueLabel=x,C.marker=v.makeTooltipMarker("item",Dn(C.color),l);var I=Id(L.formatTooltip(D,!0,null)),P=I.frag;if(P){var k=Ni([L],a).get("valueFormatter");T.blocks.push(k?N({valueFormatter:k},P):P)}I.text&&h.push(I.text),u.push(C)}})}})}),f.blocks.reverse(),h.reverse();var c=n.position,d=s.get("order"),p=Nd(f,v,l,d,i.get("useUTC"),s.get("textStyle"));p&&h.unshift(p);var g=l==="richText"?` -`:"
",m=h.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,c,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],c,null,v)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=lt(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,h=o.dataType,v=u.getData(h),c=this._renderMode,d=r.positionDefault,p=Ni([v.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var m=u.getDataParams(f,h),y=new tu;m.marker=y.makeTooltipMarker("item",Dn(m.color),c);var _=Pd(u.formatTooltip(f,!1,h)),b=p.get("order"),S=p.get("valueFormatter"),x=_.frag,T=x?Od(S?N({valueFormatter:S},x):x,y,c,b,a.get("useUTC"),p.get("textStyle")):_.text,A="item_"+u.name+"_"+f;this._showOrMove(p,function(){this._showTooltipContent(p,T,m,A,r.offsetX,r.offsetY,r.position,r.target,y)}),i({type:"showTip",dataIndexInside:f,dataIndex:v.getRawIndex(f),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=lt(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(Y(l)){var f=l;l={content:f,formatter:f},u=!0}u&&a&&l.content&&(l=it(l),l.content=Ut(l.content));var h=[l],v=this._ecModel.getComponent(o.componentMainType,o.componentIndex);v&&h.push(v),h.push({formatter:l.content});var c=r.positionDefault,d=Ni(h,this._tooltipModel,c?{position:c}:null),p=d.get("content"),g=Math.random()+"",m=new tu;this._showOrMove(d,function(){var y=it(d.get("formatterParams")||{});this._showTooltipContent(d,p,y,g,r.offsetX,r.offsetY,r.position,n,m)}),i({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(r,n,i,a,o,s,l,u,f){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.setEnterable(r.get("enterable"));var v=r.get("formatter");l=l||r.get("position");var c=n,d=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),p=d.color;if(v)if(Y(v)){var g=r.ecModel.get("useUTC"),m=H(i)?i[0]:i,y=m&&m.axisType&&m.axisType.indexOf("time")>=0;c=v,y&&(c=Qs(m.axisValue,c,g)),c=Iy(c,i,!0)}else if(Q(v)){var _=gt(function(b,S){b===this._ticket&&(h.setContent(S,f,r,p,l),this._updatePosition(r,l,o,s,h,i,u))},this);this._ticket=a,c=v(i,a,_)}else c=v;h.setContent(c,f,r,p,l),h.show(r,p),this._updatePosition(r,l,o,s,h,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||H(n))return{color:a||o};if(!H(n))return{color:a||n.color||n.borderColor}},t.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();n=n||r.get("position");var h=o.getSize(),v=r.get("align"),c=r.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),Q(n)&&(n=n([i,a],s,o.el,d,{viewSize:[u,f],contentSize:h.slice()})),H(n))i=jt(n[0],u),a=jt(n[1],f);else if(Z(n)){var p=n;p.width=h[0],p.height=h[1];var g=ma(p,{width:u,height:f});i=g.x,a=g.y,v=null,c=null}else if(Y(n)&&l){var m=AP(n,d,h,r.get("borderWidth"));i=m[0],a=m[1]}else{var m=DP(i,a,o,u,f,v?null:20,c?null:20);i=m[0],a=m[1]}if(v&&(i-=Sg(v)?h[0]/2:v==="right"?h[0]:0),c&&(a-=Sg(c)?h[1]/2:c==="bottom"?h[1]:0),F_(r)){var m=MP(i,a,o,u,f);i=m[0],a=m[1]}o.moveTo(i,a)},t.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&M(i,function(s,l){var u=s.dataByAxis||[],f=r[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&M(u,function(v,c){var d=h[c]||{},p=v.seriesDataIndices||[],g=d.seriesDataIndices||[];o=o&&v.value===d.value&&v.axisType===d.axisType&&v.axisId===d.axisId&&p.length===g.length,o&&M(p,function(m,y){var _=g[y];o=o&&m.seriesIndex===_.seriesIndex&&m.dataIndex===_.dataIndex}),a&&M(v.seriesDataIndices,function(m){var y=m.seriesIndex,_=n[y],b=a[y];_&&b&&b.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},t.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},t.prototype.dispose=function(r,n){tt.node||!n.getDom()||(wf(this,"_updatePosition"),this._tooltipContent.dispose(),jf("itemTooltip",n))},t.type="tooltip",t})(Xe);function Ni(e,t,r){var n=t.ecModel,i;r?(i=new _t(r,n,n),i=new _t(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof _t&&(o=o.get("tooltip",!0)),Y(o)&&(o={formatter:o}),o&&(i=new _t(o,i,n)))}return i}function bg(e,t){return e.dispatchAction||gt(t.dispatchAction,t)}function DP(e,t,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(e+l+a+2>n?e-=l+a:e+=a),o!=null&&(t+u+o>i?t-=u+o:t+=o),[e,t]}function MP(e,t,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,n)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function AP(e,t,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=t.width,f=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+f/2-a/2;break;case"top":s=t.x+u/2-i/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-i/2,l=t.y+f+o;break;case"left":s=t.x-i-o,l=t.y+f/2-a/2;break;case"right":s=t.x+u+o,l=t.y+f/2-a/2}return[s,l]}function Sg(e){return e==="center"||e==="middle"}function LP(e,t,r){var n=ph(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=Ea(t,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var f=lt(u).tooltipConfig;if(f&&f.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function PP(e){Br(B_),e.registerComponentModel(cP),e.registerComponentView(CP),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Yt),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Yt)}var IP=function(e,t){if(t==="all")return{type:"all",title:e.getLocaleModel().get(["legend","selector","all"])};if(t==="inverse")return{type:"inverse",title:e.getLocaleModel().get(["legend","selector","inverse"])}},Yf=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode={type:"box",ignoreSize:!0},r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),r.selected=r.selected||{},this._updateSelector(r)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.call(this,r,n),this._updateSelector(r)},t.prototype._updateSelector=function(r){var n=r.selector,i=this.ecModel;n===!0&&(n=r.selector=["all","inverse"]),H(n)&&M(n,function(a,o){Y(a)&&(a={type:a}),n[o]=yt(a,IP(i,a.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var n=!1,i=0;i=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:q.size.m,align:"auto",backgroundColor:q.color.transparent,borderColor:q.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:q.color.disabled,inactiveBorderColor:q.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:q.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:q.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:q.color.tertiary,borderWidth:1,borderColor:q.color.border},emphasis:{selectorLabel:{show:!0,color:q.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t})(ct),Yn=At,$f=M,ko=Rt,H_=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.newlineDisabled=!1,r}return t.prototype.init=function(){this.group.add(this._contentGroup=new ko),this.group.add(this._selectorGroup=new ko),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var f=ky(r,i).refContainer,h=r.getBoxLayoutParams(),v=r.get("padding"),c=ma(h,f,v),d=this.layoutInner(r,o,c,a,l,u),p=ma(dt({width:d.width,height:d.height},h),f,v);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=hP(d,r))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(r,n,i,a,o,s,l){var u=this.getContentGroup(),f=et(),h=n.get("selectedMode"),v=n.get("triggerEvent"),c=[];i.eachRawSeries(function(d){!d.get("legendHoverLink")&&c.push(d.id)}),$f(n.getData(),function(d,p){var g=this,m=d.get("name");if(!this.newlineDisabled&&(m===""||m===` -`)){var y=new ko;y.newline=!0,u.add(y);return}var _=i.getSeriesByName(m)[0];if(!f.get(m))if(_){var b=_.getData(),S=b.getVisual("legendLineStyle")||{},x=b.getVisual("legendIcon"),T=b.getVisual("style"),A=this._createItem(_,m,p,d,n,r,S,T,x,h,a);A.on("click",Yn(xg,m,null,a,c)).on("mouseover",Yn(Xf,_.name,null,a,c)).on("mouseout",Yn(Zf,_.name,null,a,c)),i.ssr&&A.eachChild(function(L){var D=lt(L);D.seriesIndex=_.seriesIndex,D.dataIndex=p,D.ssrType="legend"}),v&&A.eachChild(function(L){g.packEventData(L,n,_,p,m)}),f.set(m,!0)}else i.eachRawSeries(function(L){var D=this;if(!f.get(m)&&L.legendVisualProvider){var C=L.legendVisualProvider;if(!C.containName(m))return;var I=C.indexOfName(m),P=C.getItemVisual(I,"style"),k=C.getItemVisual(I,"legendIcon"),R=Ce(P.fill);R&&R[3]===0&&(R[3]=.2,P=N(N({},P),{fill:Ia(R,"rgba")}));var E=this._createItem(L,m,p,d,n,r,{},P,k,h,a);E.on("click",Yn(xg,null,m,a,c)).on("mouseover",Yn(Xf,null,m,a,c)).on("mouseout",Yn(Zf,null,m,a,c)),i.ssr&&E.eachChild(function(W){var O=lt(W);O.seriesIndex=L.seriesIndex,O.dataIndex=p,O.ssrType="legend"}),v&&E.eachChild(function(W){D.packEventData(W,n,L,p,m)}),f.set(m,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},t.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};lt(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();$f(r,function(u){var f=u.type,h=new ee({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var v=n.getModel("selectorLabel"),c=n.getModel(["emphasis","selectorLabel"]);Xs(h,{normal:v,emphasis:c},{defaultText:u.title}),uf(h)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,f,h,v){var c=r.visualDrawType,d=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(n),m=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");f=_||f||"roundRect";var b=kP(f,a,l,u,c,g,v),S=new ko,x=a.getModel("textStyle");if(Q(r.getLegendIcon)&&(!_||_==="inherit"))S.add(r.getLegendIcon({itemWidth:d,itemHeight:p,icon:f,iconRotate:m,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:y}));else{var T=_==="inherit"&&r.getData().getVisual("symbol")?m==="inherit"?r.getData().getVisual("symbolRotate"):m:0;S.add(RP({itemWidth:d,itemHeight:p,icon:f,iconRotate:T,itemStyle:b.itemStyle,symbolKeepAspect:y}))}var A=s==="left"?d+5:-5,L=s,D=o.get("formatter"),C=n;Y(D)&&D?C=D.replace("{name}",n??""):Q(D)&&(C=D(n));var I=g?x.getTextColor():a.get("inactiveColor");S.add(new ee({style:si(x,{text:C,x:A,y:p/2,fill:I,align:L,verticalAlign:"middle"},{inheritColor:I})}));var P=new wt({shape:S.getBoundingRect(),style:{fill:"transparent"}}),k=a.getModel("tooltip");return k.get("show")&&js({el:P,componentModel:o,itemName:n,itemTooltipOption:k.option}),S.add(P),S.eachChild(function(R){R.silent=!0}),P.silent=!h,this.getContentGroup().add(S),uf(S),S.__legendDataIndex=i,S},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();ra(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var f=l.getBoundingRect(),h=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){ra("horizontal",u,r.get("selectorItemGap",!0));var v=u.getBoundingRect(),c=[-v.x,-v.y],d=r.get("selectorButtonGap",!0),p=r.getOrient().index,g=p===0?"width":"height",m=p===0?"height":"width",y=p===0?"y":"x";s==="end"?c[p]+=f[g]+d:h[p]+=v[g]+d,c[1-p]+=f[m]/2-v[m]/2,u.x=c[0],u.y=c[1],l.x=h[0],l.y=h[1];var _={x:0,y:0};return _[g]=f[g]+d+v[g],_[m]=Math.max(f[m],v[m]),_[y]=Math.min(0,v[y]+c[1-p]),_}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t})(Xe);function kP(e,t,r,n,i,a,o){function s(g,m){g.lineWidth==="auto"&&(g.lineWidth=m.lineWidth>0?2:0),$f(g,function(y,_){g[_]==="inherit"&&(g[_]=m[_])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),f=e.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:Mf(h,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[f]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var v=t.getModel("lineStyle"),c=v.getLineStyle();if(s(c,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),c.stroke==="auto"&&(c.stroke=n.fill),!a){var d=t.get("inactiveBorderWidth"),p=u[f];u.lineWidth=d==="auto"?n.lineWidth>0&&p?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),c.stroke=v.get("inactiveColor"),c.lineWidth=v.get("inactiveWidth")}return{itemStyle:u,lineStyle:c}}function RP(e){var t=e.icon||"roundRect",r=ui(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return r.setStyle(e.itemStyle),r.rotation=(e.iconRotate||0)*Math.PI/180,r.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=q.color.neutral00,r.style.lineWidth=2),r}function xg(e,t,r,n){Zf(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),Xf(e,t,r,n)}function W_(e){for(var t=e.getZr().storage.getDisplayList(),r,n=0,i=t.length;ni[o],g=[-c.x,-c.y];n||(g[a]=f[u]);var m=[0,0],y=[-d.x,-d.y],_=X(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(p){var b=r.get("pageButtonPosition",!0);b==="end"?y[a]+=i[o]-d[o]:m[a]+=d[o]+_}y[1-a]+=c[s]/2-d[s]/2,f.setPosition(g),h.setPosition(m),v.setPosition(y);var S={x:0,y:0};if(S[o]=p?i[o]:c[o],S[s]=Math.max(c[s],d[s]),S[l]=Math.min(0,d[l]+y[1-a]),h.__rectSize=i[o],p){var x={x:0,y:0};x[o]=Math.max(i[o]-d[o]-_,0),x[s]=S[s],h.setClipPath(new wt({shape:x})),h.__rectSize=x[o]}else v.eachChild(function(A){A.attr({invisible:!0,silent:!0})});var T=this._getPageInfo(r);return T.pageIndex!=null&&ae(f,{x:T.contentPosition[0],y:T.contentPosition[1]},p?r:null),this._updatePageInfoView(r,T),S},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;M(["pagePrev","pageNext"],function(f){var h=f+"DataIndex",v=n[h]!=null,c=i.childOfName(f);c&&(c.setStyle("fill",v?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),c.cursor=v?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",Y(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=xu[o],l=wu[o],u=this._findTargetItemIndex(n),f=i.children(),h=f[u],v=f.length,c=v?1:0,d={contentPosition:[i.x,i.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return d;var p=b(h);d.contentPosition[o]=-p.s;for(var g=u+1,m=p,y=p,_=null;g<=v;++g)_=b(f[g]),(!_&&y.e>m.s+a||_&&!S(_,m.s))&&(y.i>m.i?m=y:m=_,m&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=m.i),++d.pageCount)),y=_;for(var g=u-1,m=p,y=p,_=null;g>=-1;--g)_=b(f[g]),(!_||!S(y,_.s))&&m.i=T&&x.s<=T+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t})(H_);function FP(e){e.registerAction("legendScroll","legendscroll",function(t,r){var n=t.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:t},function(i){i.setScrollDataIndex(n)})})}function zP(e){Br(U_),e.registerComponentModel(NP),e.registerComponentView(BP),FP(e)}function GP(e){Br(U_),Br(zP)}var Tu=Math.sin,Cu=Math.cos,j_=Math.PI,hn=Math.PI*2,VP=180/j_,Y_=(function(){function e(){}return e.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},e.prototype.moveTo=function(t,r){this._add("M",t,r)},e.prototype.lineTo=function(t,r){this._add("L",t,r)},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){this._add("C",t,r,n,i,a,o)},e.prototype.quadraticCurveTo=function(t,r,n,i){this._add("Q",t,r,n,i)},e.prototype.arc=function(t,r,n,i,a,o){this.ellipse(t,r,n,n,0,i,a,o)},e.prototype.ellipse=function(t,r,n,i,a,o,s,l){var u=s-o,f=!l,h=Math.abs(u),v=Cr(h-hn)||(f?u>=hn:-u>=hn),c=u>0?u%hn:u%hn+hn,d=!1;v?d=!0:Cr(h)?d=!1:d=c>=j_==!!f;var p=t+n*Cu(o),g=r+i*Tu(o);this._start&&this._add("M",p,g);var m=Math.round(a*VP);if(v){var y=1/this._p,_=(f?1:-1)*(hn-y);this._add("A",n,i,m,1,+f,t+n*Cu(o+_),r+i*Tu(o+_)),y>.01&&this._add("A",n,i,m,0,+f,p,g)}else{var b=t+n*Cu(s),S=r+i*Tu(s);this._add("A",n,i,m,+d,+f,b,S)}},e.prototype.rect=function(t,r,n,i){this._add("M",t,r),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(t,r,n,i,a,o,s,l,u){for(var f=[],h=this._p,v=1;v"}function qP(e){return""}function bc(e,t){t=t||{};var r=t.newline?` -`:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return ZP(o,s)+(o!=="style"?Ut(l):l||"")+(a?""+r+$(a,function(u){return n(u)}).join(r)+r:"")+qP(o)}return n(e)}function KP(e,t,r){r=r||{};var n=r.newline?` -`:"",i=" {"+n,a=n+"}",o=$(st(e),function(l){return l+i+$(st(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=$(st(t),function(l){return"@keyframes "+l+i+$(st(t[l]),function(u){return u+i+$(st(t[l][u]),function(f){var h=t[l][u][f];return f==="d"&&(h='path("'+h+'")'),f+":"+h+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function Kf(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Mg(e,t,r,n){return Lt("svg","root",{width:e,height:t,xmlns:$_,"xmlns:xlink":X_,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var QP=0;function q_(){return QP++}var Ag={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"},cn="transform-origin";function JP(e,t,r){var n=N({},e.shape);N(n,t),e.buildPath(r,n);var i=new Y_;return i.reset(dm(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function tI(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[cn]=r+"px "+n+"px")}var eI={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function K_(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function rI(e,t,r){var n=e.shape.paths,i={},a,o;if(M(n,function(l){var u=Kf(r.zrId);u.animation=!0,nl(l,{},u,!0);var f=u.cssAnims,h=u.cssNodes,v=st(f),c=v.length;if(c){o=v[c-1];var d=f[o];for(var p in d){var g=d[p];i[p]=i[p]||{d:""},i[p].d+=g.d||""}for(var m in h){var y=h[m].animation;y.indexOf(o)>=0&&(a=y)}}}),!!a){t.d=!1;var s=K_(i,r);return a.replace(o,s)}}function Lg(e){return Y(e)?Ag[e]?"cubic-bezier("+Ag[e]+")":uh(e)?e:"":""}function nl(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof iy){var s=rI(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var se=K_(T,r);return se+" "+y[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var m=r.zrId+"-cls-"+q_();r.cssNodes["."+m]={animation:o.join(",")},t.class=m}}function nI(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};Pg(n,t,r)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,l=e.currentStates.indexOf("select")>=0&&s||o;l&&(a=Wu(l))}var u=i.lineWidth;if(u){var f=!i.strokeNoScale&&e.transform?e.transform[0]:1;u=u/f}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),Pg(n,t,r)}}function Pg(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+q_(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var Ma=Math.round;function Q_(e){return e&&Y(e.src)}function J_(e){return e&&Q(e.toDataURL)}function Sc(e,t,r,n){YP(function(i,a){var o=i==="fill"||i==="stroke";o&&vm(a)?e1(t,e,i,n):o&&fh(a)?r1(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),fI(r,e,n)}function xc(e,t){var r=bS(t);r&&(r.each(function(n,i){n!=null&&(e[(Dg+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[Dg+"silent"]="true"))}function Ig(e){return Cr(e[0]-1)&&Cr(e[1])&&Cr(e[2])&&Cr(e[3]-1)}function iI(e){return Cr(e[4])&&Cr(e[5])}function wc(e,t,r){if(t&&!(iI(t)&&Ig(t))){var n=1e4;e.transform=Ig(t)?"translate("+Ma(t[4]*n)/n+" "+Ma(t[5]*n)/n+")":Hb(t)}}function kg(e,t,r){for(var n=e.points,i=[],a=0;a"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";Me(v,g),Me(c,g)}else if(v==null||c==null){var m=function(D,C){if(D){var I=D.elm,P=v||C.width,k=c||C.height;D.tag==="pattern"&&(u?(k=1,P/=a.width):f&&(P=1,k/=a.height)),D.attrs.width=P,D.attrs.height=k,I&&(I.setAttribute("width",P),I.setAttribute("height",k))}},y=mh(d,null,e,function(D){l||m(x,D),m(h,D)});y&&y.width&&y.height&&(v=v||y.width,c=c||y.height)}h=Lt("image","img",{href:d,width:v,height:c}),o.width=v,o.height=c}else i.svgElement&&(h=it(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(h){var _,b;l?_=b=1:u?(b=1,_=o.width/a.width):f?(_=1,b=o.height/a.height):o.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(o.width=_),b!=null&&!isNaN(b)&&(o.height=b);var S=pm(i);S&&(o.patternTransform=S);var x=Lt("pattern","",o,[h]),T=bc(x),A=n.patternCache,L=A[T];L||(L=n.zrId+"-p"+n.patternIdx++,A[T]=L,o.id=L,x=n.defs[L]=Lt("pattern",L,o,[h])),t[r]=Os(L)}}function hI(e,t,r){var n=r.clipPathCache,i=r.defs,a=n[e.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[e.id]=a,i[a]=Lt("clipPath",a,o,[t1(e,r)])}t["clip-path"]=Os(a)}function Og(e){return document.createTextNode(e)}function pn(e,t,r){e.insertBefore(t,r)}function Ng(e,t){e.removeChild(t)}function Bg(e,t){e.appendChild(t)}function n1(e){return e.parentNode}function i1(e){return e.nextSibling}function Du(e,t){e.textContent=t}var Fg=58,cI=120,vI=Lt("","");function Qf(e){return e===void 0}function Ne(e){return e!==void 0}function dI(e,t,r){for(var n={},i=t;i<=r;++i){var a=e[i].key;a!==void 0&&(n[a]=i)}return n}function Yi(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function Aa(e){var t,r=e.children,n=e.tag;if(Ne(n)){var i=e.elm=Z_(n);if(Tc(vI,e),H(r))for(t=0;ta?(d=r[l+1]==null?null:r[l+1].elm,a1(e,d,r,i,l)):Is(e,t,n,a))}function Xn(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(Tc(e,t),Qf(t.text)?Ne(n)&&Ne(i)?n!==i&&pI(r,n,i):Ne(i)?(Ne(e.text)&&Du(r,""),a1(r,null,i,0,i.length-1)):Ne(n)?Is(r,n,0,n.length-1):Ne(e.text)&&Du(r,""):e.text!==t.text&&(Ne(n)&&Is(r,n,0,n.length-1),Du(r,t.text)))}function gI(e,t){if(Yi(e,t))Xn(e,t);else{var r=e.elm,n=n1(r);Aa(t),n!==null&&(pn(n,t.elm,i1(r)),Is(n,[e],0,0))}return t}var mI=0,yI=(function(){function e(t,r,n){if(this.type="svg",this.refreshHover=zg(),this.configLayer=zg(),this.storage=r,this._opts=n=N({},n),this.root=t,this._id="zr"+mI++,this._oldVNode=Mg(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=Z_("svg");Tc(null,this._oldVNode),i.appendChild(a),t.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",gI(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return Eg(t,Kf(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=Kf(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=_I(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Lt("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=$(st(a.defs),function(v){return a.defs[v]});if(u.length&&o.push(Lt("defs","defs",{},u)),t.animation){var f=KP(a.cssNodes,a.cssAnims,{newline:!0});if(f){var h=Lt("style","stl",{},[],f);o.push(h)}}return Mg(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},bc(this.renderToVNode({animation:X(t.cssAnimation,!0),emphasis:X(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:X(t.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(t,r,n){for(var i=t.length,a=[],o=0,s,l,u=0,f=0;f=0&&!(v&&l&&v[p]===l[p]);p--);for(var g=d-1;g>p;g--)o--,s=a[o-1];for(var m=p+1;m{const f=a.current;if(f===null||f.clientWidth===0)return;const h=DM(f,void 0,{renderer:"svg"});o.current=h;const v=()=>h.resize();return window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v),o.current=null,h.dispose()}},[]),rt.useEffect(()=>{const f=window.matchMedia?.("(prefers-color-scheme: dark)"),h=()=>u(v=>v+1);return window.addEventListener("flowlens-theme-change",h),f?.addEventListener("change",h),()=>{window.removeEventListener("flowlens-theme-change",h),f?.removeEventListener("change",h)}},[]),rt.useEffect(()=>{const f=o.current;if(f===null)return;const h=e==="live"?n.map(g=>g.timestamp):i.map(g=>g.start),v=e==="live"||t==="speed",c=e==="live"?"live":`history-${t}`,d=s.current!==null&&s.current!==c;s.current=c;const p=xI();f.setOption({animation:e!=="live"&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches,color:[p.download,p.upload,p.green],textStyle:{fontFamily:p.fontFamily},grid:{left:52,right:14,top:34,bottom:28},tooltip:{trigger:"axis",backgroundColor:p.tooltipBackground,borderColor:p.lineStrong,textStyle:{color:p.tooltipInk,fontSize:11},formatter:TI(e,v)},legend:{top:0,right:4,itemWidth:14,itemHeight:7,textStyle:{color:p.muted,fontSize:10}},xAxis:{type:"category",data:h,boundaryGap:e==="history"&&t==="traffic",axisTick:{show:!1},axisLine:{lineStyle:{color:p.line}},axisLabel:{show:!0,hideOverlap:!0,interval:Math.max(0,Math.ceil(h.length/(e==="live"?10:8))-1),color:p.muted,fontSize:10,formatter:g=>wI(g,e,r)}},yAxis:{type:"value",axisLabel:{color:p.muted,fontSize:10,formatter:v?Ot:o1},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:p.line}}},series:e==="live"?[{id:"live-download",name:"下载",type:"line",showSymbol:!1,smooth:.45,smoothMonotone:"x",connectNulls:!1,lineStyle:{width:2},areaStyle:{opacity:.07},data:n.map(g=>g.download)},{id:"live-upload",name:"上传",type:"line",showSymbol:!1,smooth:.45,smoothMonotone:"x",connectNulls:!1,lineStyle:{width:2},areaStyle:{opacity:.05},data:n.map(g=>g.upload)}]:t==="speed"?[{id:"history-speed-download",name:"平均下载",type:"line",showSymbol:!1,smooth:.45,smoothMonotone:"x",connectNulls:!1,lineStyle:{width:2},areaStyle:{opacity:.07},data:i.map(g=>g.downloadRate)},{id:"history-speed-upload",name:"平均上传",type:"line",showSymbol:!1,smooth:.45,smoothMonotone:"x",connectNulls:!1,lineStyle:{width:2},areaStyle:{opacity:.05},data:i.map(g=>g.uploadRate)}]:[{id:"history-traffic-download",name:"下载",type:"bar",stack:"bytes",data:i.map(g=>Number(BigInt(g.download)/1024n))},{id:"history-traffic-upload",name:"上传",type:"bar",stack:"bytes",data:i.map(g=>Number(BigInt(g.upload)/1024n))},{id:"history-traffic-cumulative",name:"累计",type:"line",yAxisIndex:0,showSymbol:!1,data:i.map(g=>Number(BigInt(g.cumulative)/1024n))}]},d?{lazyUpdate:!0,replaceMerge:["series"]}:{lazyUpdate:!0})},[i,r,t,n,e,l]),w.jsx("div",{ref:a,className:"chart-shell",role:"img","aria-label":e==="live"?"实时上传和下载速度曲线":t==="speed"?"历史平均上传和下载速度曲线":"历史上传下载流量和累计曲线"})}function xI(){const e=getComputedStyle(document.documentElement),t=(r,n)=>e.getPropertyValue(r).trim()||n;return{download:t("--download","#2563eb"),upload:t("--upload","#d97706"),green:t("--green","#0f9d78"),muted:t("--muted","#667085"),line:t("--line","#dfe5ed"),lineStrong:t("--line-strong","#cbd4e1"),tooltipBackground:t("--chart-tooltip-bg","#172033"),tooltipInk:t("--chart-tooltip-ink","#f8fafc"),fontFamily:t("--font-sans",'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif')}}function wI(e,t,r){const n=Number(e);if(!Number.isFinite(n))return"";const i=new Date(n*1e3);return t==="live"||r==="time"?i.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):i.toLocaleDateString("zh-CN",{month:"numeric",day:"numeric"})}function o1(e){if(!Number.isFinite(e)||e<0)return"—";const t=["KiB","MiB","GiB","TiB","PiB"];let r=e,n=0;for(;r>=1024&&n=10||Number.isInteger(r)?0:1;return`${r.toFixed(i)} ${t[n]}`}function TI(e,t){return r=>{const n=Array.isArray(r)?r:[r],i=CI(n[0]?.axisValue,e),a=t?Ot:o1,o=n.map(s=>{const l=typeof s.marker=="string"?s.marker:"",u=typeof s.seriesName=="string"?s.seriesName:"",f=typeof s.value=="number"?s.value:Number.NaN;return`${l}${u} ${a(f)}`});return[`${i}`,...o].join("
")}}function CI(e,t){const r=Number(e);if(!Number.isFinite(r))return"—";const n=new Date(r*1e3),i=[n.getFullYear(),Fi(n.getMonth()+1),Fi(n.getDate())].join("-"),a=[Fi(n.getHours()),Fi(n.getMinutes())];return t==="live"&&a.push(Fi(n.getSeconds())),`${i} ${a.join(":")}`}function Fi(e){return String(e).padStart(2,"0")}const DI={status:"degraded",reason:"starting",timezone:"UTC",auth_enabled:!1,capabilities:{connection_id:!1,source:!1,destination:!1,port:!1,network:!1,domain:!1}};function RI({source:e,onUnauthorized:t}){const[r,n]=rt.useState(DI),[i,a]=rt.useState({kind:"live"}),[o,s]=rt.useState("endpoint"),[l,u]=rt.useState("speed"),[f,h]=rt.useState(null),[v,c]=rt.useState([]),[d,p]=rt.useState([]),[g,m]=rt.useState([]),[y,_]=rt.useState(!1),[b,S]=rt.useState(0),[x,T]=rt.useState(!1),A=rt.useCallback((G,J)=>{n(ot=>ot.status===G&&ot.reason===J?ot:{...ot,status:G,reason:J})},[]),L=rt.useCallback(async()=>{c(await e.labels()),S(G=>G+1)},[e]);rt.useEffect(()=>{const G=new AbortController,J=ot=>{ot instanceof Zo&&t()};return e.status(G.signal).then(n).catch(J),e.storage(G.signal).then(h).catch(J),e.labels(G.signal).then(c).catch(J),e.labelCandidates(G.signal).then(p).catch(J),e.runtimeSessions(G.signal).then(m).catch(J),()=>G.abort()},[t,e]);const D=C1(e,r,i.kind==="live",A,t),C=S1(e,i,o,t,b),I=rt.useMemo(()=>C.targets?.items??[],[C.targets]),P=i.kind==="live"?D.targets.map(G=>({rawValue:G.raw_endpoint,displayName:G.display_name,networkCode:G.network_code,totalBytes:"0",uploadBytes:"0",downloadBytes:"0"})):I;async function k(){T(!1);try{await e.logout(),t()}catch(G){if(G instanceof Zo){t();return}T(!0)}}const R=i.kind==="live",E=o==="target"||o==="endpoint",W=R?"实时吞吐":"历史流量",O=R?"最近 60 分钟 · 1 秒采样":"SQLite 聚合 · 自动选择分辨率",B=R?"实时目标分析":`${LI(o)}分析`,j=`${R?"当前目标速率":"所选周期累计流量"} · 近似归因`,U=R?"当前目标排行":"历史维度排行",z=R?"按当前速率排序,别名后保留原始端点。":"按所选周期累计流量排序,结果为近似归因。";return w.jsxs(h1,{status:r.status,sourceMode:e.demo?"demo":"app",authEnabled:e.demo||r.auth_enabled,onLogout:()=>void k(),logoutFailed:x,children:[w.jsxs("section",{className:"page-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:"Traffic overview"}),w.jsx("h1",{className:"page-title",children:"流量总览"})]}),w.jsx(p1,{value:i,now:e.now(),timezone:r.timezone,onChange:a})]}),w.jsxs("section",{className:"dashboard","data-dashboard-mode":R?"live":"history",children:[w.jsxs("article",{className:"panel hero-panel",children:[w.jsxs("header",{className:"panel-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:R?"Live throughput":"Historical traffic"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{children:W}),w.jsx(Mr,{content:O,label:`查看“${W}”说明`})]})]}),w.jsx("span",{className:"micro",children:R?D.connected?`${l1(D.intervalMillis)}采样 · SSE 已连接`:"SSE 重连中":C.loading?"正在加载":C.error?"历史数据加载失败":"按范围查询"})]}),w.jsxs("div",{className:"chart-summary",children:[w.jsx(Et,{label:R?"当前下载":"下载总量",value:R?Ot(D.currentDownload):C.view?Wt(C.view.downloadBytes):"—"}),w.jsx(Et,{label:R?"当前上传":"上传总量",value:R?Ot(D.currentUpload):C.view?Wt(C.view.uploadBytes):"—"}),w.jsx(Et,{label:R?"活动连接":"总流量",value:R?String(D.activeConnections??"—"):C.view?Wt(C.view.totalBytes):"—"})]}),w.jsx("div",{className:"metric-grid",children:R?w.jsxs(w.Fragment,{children:[w.jsx(Et,{label:"1 分钟平均下载",value:Ot(D.averageDownload1m)}),w.jsx(Et,{label:"1 分钟平均上传",value:Ot(D.averageUpload1m)}),w.jsx(Et,{label:"5 分钟平均下载",value:Ot(D.averageDownload5m)}),w.jsx(Et,{label:"5 分钟平均上传",value:Ot(D.averageUpload5m)}),w.jsx(Et,{label:"60 分钟峰值下载",value:Ot(D.peakDownload60m)}),w.jsx(Et,{label:"60 分钟峰值上传",value:Ot(D.peakUpload60m)})]}):w.jsxs(w.Fragment,{children:[w.jsx(Et,{label:"较上一周期",value:II(C.view?.totalBytes,C.view?.previousBytes,i)}),w.jsx(Et,{label:"平均下载",value:Ot(C.view?.averageDownload??null)}),w.jsx(Et,{label:"平均上传",value:Ot(C.view?.averageUpload??null)}),w.jsx(Et,{label:"峰值下载",value:Ot(C.view?.peakDownload??null)}),w.jsx(Et,{label:"峰值上传",value:Ot(C.view?.peakUpload??null)}),w.jsx(Et,{label:"平均连接",value:Vg(C.view?.averageConnections??null)}),w.jsx(Et,{label:"峰值连接",value:Vg(C.view?.peakConnections??null)}),w.jsx(Et,{label:"数据完整率",value:ks(C.view?.completeness??null)})]})}),R?null:w.jsxs("div",{className:"chart-toggle","aria-label":"历史图表视图",children:[w.jsx("button",{type:"button","aria-pressed":l==="traffic",onClick:()=>u("traffic"),children:"流量视图"}),w.jsx("button",{type:"button","aria-pressed":l==="speed",onClick:()=>u("speed"),children:"速度视图"})]}),w.jsx(SI,{mode:R?"live":"history",live:D.chart,history:C.view?.chart,historyView:l,historyLabelMode:i.kind==="preset"&&(i.preset==="today"||i.preset==="yesterday")?"time":"date"})]}),w.jsxs("article",{className:"panel topology-panel",children:[w.jsxs("header",{className:"panel-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:"Traffic topology"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{children:B}),w.jsx(Mr,{content:j,label:`查看“${B}”说明`})]})]}),R?null:w.jsx(PI,{value:o,onChange:s})]}),R||E?w.jsx(I1,{targets:P}):w.jsx(L1,{by:o,rows:I})]}),w.jsx(MI,{liveMode:R,connectionCoverage:R?D.connectionCoverage:C.targets?.connectionCoverage??null,dimensionRetention:R?null:C.targets?.dimensionRetention??null,unattributed:R||!C.targets?null:Wt(C.targets.unattributedBytes),other:R||!C.targets?null:Wt(C.targets.otherBytes),statusReason:r.reason,observedAt:R?D.observedAt:null,intervalMillis:R?D.intervalMillis:null,completeness:R?null:C.view?.completeness??null,recovered:R||!C.view?null:Wt(C.view.recoveredBytes),resetCount:R?null:C.view?.resetCount??null,qualityEventCount:R?null:C.view?.qualityEvents.length??null,boundaryApproximate:R?null:C.view?.boundaryApproximate??null,sessions:R?[]:g}),w.jsxs("article",{className:"panel targets-panel",children:[w.jsxs("header",{className:"panel-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:"Observed targets"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{children:U}),w.jsx(Mr,{content:z,label:`查看“${U}”说明`})]})]}),w.jsx(Jf,{content:"管理别名",children:w.jsx("button",{className:"icon-button",type:"button","aria-label":"管理别名",onClick:()=>_(!0),children:w.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:w.jsx("path",{d:"m4 16-.8 4.8L8 20l10.6-10.6a2 2 0 0 0-2.8-2.8L5.2 17.2M14.5 8l2.8 2.8"})})})})]}),R?w.jsx(Ic,{live:D.targets,liveTotalRate:D.targetGlobalRate}):w.jsx(Ic,{historical:I})]}),w.jsx(D1,{value:f})]}),y?w.jsx(c1,{source:e,labels:v,candidates:d,onChanged:L,onClose:()=>_(!1)}):null]})}function MI({liveMode:e,connectionCoverage:t,dimensionRetention:r,unattributed:n,other:i,statusReason:a,observedAt:o,intervalMillis:s,completeness:l,recovered:u,resetCount:f,qualityEventCount:h,boundaryApproximate:v,sessions:c}){return w.jsxs("aside",{className:"panel confidence-panel",children:[w.jsx("span",{className:"eyebrow",children:"Data confidence"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{children:"数据质量"}),w.jsx(Mr,{content:"全局总量精确;下面说明目标排行能解释其中多少流量。",label:"查看“数据质量”说明"})]}),w.jsxs("div",{className:"coverage-list",children:[w.jsx(Gg,{label:"可归因覆盖",value:t,detail:"全局流量中,能关联到活动连接维度的部分。"}),e?null:w.jsx(Gg,{label:"排行覆盖",value:r,detail:"已归因流量中,仍保留在当前 Top K 排行里的部分。"})]}),w.jsxs("dl",{className:"confidence-stats",children:[w.jsxs("div",{children:[w.jsx("dt",{children:"未归因流量"}),w.jsx("dd",{children:e?"实时不累计":n??"—"})]}),e?null:w.jsxs("div",{children:[w.jsx("dt",{children:"Top K 之外"}),w.jsx("dd",{children:i??"—"})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"采集状态"}),w.jsx("dd",{children:a})]}),e?w.jsxs(w.Fragment,{children:[w.jsxs("div",{children:[w.jsx("dt",{children:"最后观测"}),w.jsx("dd",{children:o===null?"—":new Date(o*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"实际间隔"}),w.jsx("dd",{children:l1(s)})]})]}):w.jsxs(w.Fragment,{children:[w.jsxs("div",{children:[w.jsx("dt",{children:"数据完整率"}),w.jsx("dd",{children:ks(l)})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"恢复流量"}),w.jsx("dd",{children:u??"—"})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"重置次数"}),w.jsx("dd",{children:f??"—"})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"质量事件"}),w.jsx("dd",{children:h??"—"})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"边界估算"}),w.jsx("dd",{children:v===null?"—":v?"已近似":"精确边界"})]})]})]}),e?null:w.jsx(AI,{sessions:c})]})}function AI({sessions:e}){return w.jsxs("section",{className:"runtime-sessions","aria-label":"最近运行",children:[w.jsx("div",{className:"runtime-sessions-head",children:w.jsxs("span",{className:"label-with-tooltip",children:[w.jsx("strong",{children:"最近运行"}),w.jsx(Mr,{content:"采集进程上下文",label:"查看“最近运行”说明"})]})}),e.length===0?w.jsx("p",{className:"empty-state",children:"暂无运行记录。"}):w.jsx("div",{className:"runtime-session-list",children:e.slice(0,3).map(t=>w.jsxs("article",{className:"runtime-session",children:[w.jsxs("div",{children:[w.jsx("strong",{children:t.ended_at===null?"当前运行":"历史运行"}),w.jsx("span",{children:t.sing_box_version})]}),w.jsxs("span",{children:[new Date(t.started_at*1e3).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),t.ended_at===null?" 至今":" 已结束"]}),w.jsx("span",{children:t.data_gap_before_seconds>0?`前序缺口 ${t.data_gap_before_seconds} 秒`:"连续采集"})]},`${t.started_at}-${t.last_seen_at}`))})]})}function Gg({label:e,value:t,detail:r}){const n=t===null?null:Math.round(t*1e3)/10;return w.jsxs("div",{className:"coverage-row",children:[w.jsxs("div",{className:"coverage-label",children:[w.jsxs("span",{className:"label-with-tooltip",children:[w.jsx("strong",{children:e}),w.jsx(Mr,{content:r,label:`查看“${e}”说明`})]}),w.jsx("span",{children:ks(t)})]}),w.jsx("div",{className:"coverage-track",role:"progressbar","aria-label":e,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n??void 0,children:w.jsx("i",{style:{"--coverage":`${n===null?0:n}%`}})})]})}function Et({label:e,value:t}){return w.jsxs("div",{className:"chart-value",children:[w.jsx("span",{children:e}),w.jsx("strong",{children:t})]})}const s1=[{value:"target",label:"目标 IP"},{value:"endpoint",label:"Endpoint"},{value:"port",label:"端口"},{value:"network",label:"TCP/UDP"},{value:"source",label:"来源网段"},{value:"domain",label:"域名"}];function LI(e){return s1.find(t=>t.value===e).label}function PI({value:e,onChange:t}){return w.jsx("div",{className:"dimension-tabs","aria-label":"分析维度",children:s1.map(r=>w.jsx("button",{type:"button","aria-pressed":e===r.value,onClick:()=>t(r.value),children:r.label},r.value))})}function Vg(e){return e===null?"—":e.toFixed(e%1===0?0:1)}function l1(e){return e===null?"":`${(e/1e3).toFixed(1)} 秒`}function II(e,t,r){if(r.kind==="preset"&&r.preset==="lifetime")return"不适用";if(e===void 0||t===void 0)return"—";const n=BigInt(t);if(n===0n)return"首次统计";const i=Number((BigInt(e)-n)*1000n/n)/10;return`${i>=0?"+":""}${i.toFixed(1)}%`}export{RI as DashboardPage}; +`:"
",m=h.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,c,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],c,null,v)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=lt(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,h=o.dataType,v=u.getData(h),c=this._renderMode,d=r.positionDefault,p=Ni([v.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var m=u.getDataParams(f,h),y=new tu;m.marker=y.makeTooltipMarker("item",Dn(m.color),c);var _=Id(u.formatTooltip(f,!1,h)),b=p.get("order"),S=p.get("valueFormatter"),x=_.frag,T=x?Nd(S?N({valueFormatter:S},x):x,y,c,b,a.get("useUTC"),p.get("textStyle")):_.text,A="item_"+u.name+"_"+f;this._showOrMove(p,function(){this._showTooltipContent(p,T,m,A,r.offsetX,r.offsetY,r.position,r.target,y)}),i({type:"showTip",dataIndexInside:f,dataIndex:v.getRawIndex(f),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=lt(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(Y(l)){var f=l;l={content:f,formatter:f},u=!0}u&&a&&l.content&&(l=it(l),l.content=jt(l.content));var h=[l],v=this._ecModel.getComponent(o.componentMainType,o.componentIndex);v&&h.push(v),h.push({formatter:l.content});var c=r.positionDefault,d=Ni(h,this._tooltipModel,c?{position:c}:null),p=d.get("content"),g=Math.random()+"",m=new tu;this._showOrMove(d,function(){var y=it(d.get("formatterParams")||{});this._showTooltipContent(d,p,y,g,r.offsetX,r.offsetY,r.position,n,m)}),i({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(r,n,i,a,o,s,l,u,f){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.setEnterable(r.get("enterable"));var v=r.get("formatter");l=l||r.get("position");var c=n,d=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),p=d.color;if(v)if(Y(v)){var g=r.ecModel.get("useUTC"),m=H(i)?i[0]:i,y=m&&m.axisType&&m.axisType.indexOf("time")>=0;c=v,y&&(c=Qs(m.axisValue,c,g)),c=ky(c,i,!0)}else if(Q(v)){var _=gt(function(b,S){b===this._ticket&&(h.setContent(S,f,r,p,l),this._updatePosition(r,l,o,s,h,i,u))},this);this._ticket=a,c=v(i,a,_)}else c=v;h.setContent(c,f,r,p,l),h.show(r,p),this._updatePosition(r,l,o,s,h,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||H(n))return{color:a||o};if(!H(n))return{color:a||n.color||n.borderColor}},t.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();n=n||r.get("position");var h=o.getSize(),v=r.get("align"),c=r.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),Q(n)&&(n=n([i,a],s,o.el,d,{viewSize:[u,f],contentSize:h.slice()})),H(n))i=Ut(n[0],u),a=Ut(n[1],f);else if(Z(n)){var p=n;p.width=h[0],p.height=h[1];var g=ma(p,{width:u,height:f});i=g.x,a=g.y,v=null,c=null}else if(Y(n)&&l){var m=RP(n,d,h,r.get("borderWidth"));i=m[0],a=m[1]}else{var m=IP(i,a,o,u,f,v?null:20,c?null:20);i=m[0],a=m[1]}if(v&&(i-=xg(v)?h[0]/2:v==="right"?h[0]:0),c&&(a-=xg(c)?h[1]/2:c==="bottom"?h[1]:0),z_(r)){var m=kP(i,a,o,u,f);i=m[0],a=m[1]}o.moveTo(i,a)},t.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&M(i,function(s,l){var u=s.dataByAxis||[],f=r[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&M(u,function(v,c){var d=h[c]||{},p=v.seriesDataIndices||[],g=d.seriesDataIndices||[];o=o&&v.value===d.value&&v.axisType===d.axisType&&v.axisId===d.axisId&&p.length===g.length,o&&M(p,function(m,y){var _=g[y];o=o&&m.seriesIndex===_.seriesIndex&&m.dataIndex===_.dataIndex}),a&&M(v.seriesDataIndices,function(m){var y=m.seriesIndex,_=n[y],b=a[y];_&&b&&b.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},t.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},t.prototype.dispose=function(r,n){tt.node||!n.getDom()||(wf(this,"_updatePosition"),this._tooltipContent.dispose(),Uf("itemTooltip",n))},t.type="tooltip",t})(Xe);function Ni(e,t,r){var n=t.ecModel,i;r?(i=new _t(r,n,n),i=new _t(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof _t&&(o=o.get("tooltip",!0)),Y(o)&&(o={formatter:o}),o&&(i=new _t(o,i,n)))}return i}function Sg(e,t){return e.dispatchAction||gt(t.dispatchAction,t)}function IP(e,t,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(e+l+a+2>n?e-=l+a:e+=a),o!=null&&(t+u+o>i?t-=u+o:t+=o),[e,t]}function kP(e,t,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,n)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function RP(e,t,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=t.width,f=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+f/2-a/2;break;case"top":s=t.x+u/2-i/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-i/2,l=t.y+f+o;break;case"left":s=t.x-i-o,l=t.y+f/2-a/2;break;case"right":s=t.x+u+o,l=t.y+f/2-a/2}return[s,l]}function xg(e){return e==="center"||e==="middle"}function EP(e,t,r){var n=ph(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=Ea(t,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var f=lt(u).tooltipConfig;if(f&&f.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function OP(e){Br(F_),e.registerComponentModel(mP),e.registerComponentView(PP),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Yt),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Yt)}var NP=function(e,t){if(t==="all")return{type:"all",title:e.getLocaleModel().get(["legend","selector","all"])};if(t==="inverse")return{type:"inverse",title:e.getLocaleModel().get(["legend","selector","inverse"])}},Yf=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode={type:"box",ignoreSize:!0},r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),r.selected=r.selected||{},this._updateSelector(r)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.call(this,r,n),this._updateSelector(r)},t.prototype._updateSelector=function(r){var n=r.selector,i=this.ecModel;n===!0&&(n=r.selector=["all","inverse"]),H(n)&&M(n,function(a,o){Y(a)&&(a={type:a}),n[o]=yt(a,NP(i,a.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var n=!1,i=0;i=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:q.size.m,align:"auto",backgroundColor:q.color.transparent,borderColor:q.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:q.color.disabled,inactiveBorderColor:q.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:q.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:q.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:q.color.tertiary,borderWidth:1,borderColor:q.color.border},emphasis:{selectorLabel:{show:!0,color:q.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t})(ct),Yn=At,$f=M,ko=Rt,W_=(function(e){V(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.newlineDisabled=!1,r}return t.prototype.init=function(){this.group.add(this._contentGroup=new ko),this.group.add(this._selectorGroup=new ko),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var f=Ry(r,i).refContainer,h=r.getBoxLayoutParams(),v=r.get("padding"),c=ma(h,f,v),d=this.layoutInner(r,o,c,a,l,u),p=ma(dt({width:d.width,height:d.height},h),f,v);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=gP(d,r))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(r,n,i,a,o,s,l){var u=this.getContentGroup(),f=et(),h=n.get("selectedMode"),v=n.get("triggerEvent"),c=[];i.eachRawSeries(function(d){!d.get("legendHoverLink")&&c.push(d.id)}),$f(n.getData(),function(d,p){var g=this,m=d.get("name");if(!this.newlineDisabled&&(m===""||m===` +`)){var y=new ko;y.newline=!0,u.add(y);return}var _=i.getSeriesByName(m)[0];if(!f.get(m))if(_){var b=_.getData(),S=b.getVisual("legendLineStyle")||{},x=b.getVisual("legendIcon"),T=b.getVisual("style"),A=this._createItem(_,m,p,d,n,r,S,T,x,h,a);A.on("click",Yn(wg,m,null,a,c)).on("mouseover",Yn(Xf,_.name,null,a,c)).on("mouseout",Yn(Zf,_.name,null,a,c)),i.ssr&&A.eachChild(function(L){var D=lt(L);D.seriesIndex=_.seriesIndex,D.dataIndex=p,D.ssrType="legend"}),v&&A.eachChild(function(L){g.packEventData(L,n,_,p,m)}),f.set(m,!0)}else i.eachRawSeries(function(L){var D=this;if(!f.get(m)&&L.legendVisualProvider){var C=L.legendVisualProvider;if(!C.containName(m))return;var I=C.indexOfName(m),P=C.getItemVisual(I,"style"),k=C.getItemVisual(I,"legendIcon"),R=Ce(P.fill);R&&R[3]===0&&(R[3]=.2,P=N(N({},P),{fill:Ia(R,"rgba")}));var E=this._createItem(L,m,p,d,n,r,{},P,k,h,a);E.on("click",Yn(wg,null,m,a,c)).on("mouseover",Yn(Xf,null,m,a,c)).on("mouseout",Yn(Zf,null,m,a,c)),i.ssr&&E.eachChild(function(W){var O=lt(W);O.seriesIndex=L.seriesIndex,O.dataIndex=p,O.ssrType="legend"}),v&&E.eachChild(function(W){D.packEventData(W,n,L,p,m)}),f.set(m,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},t.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};lt(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();$f(r,function(u){var f=u.type,h=new ee({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(h);var v=n.getModel("selectorLabel"),c=n.getModel(["emphasis","selectorLabel"]);Xs(h,{normal:v,emphasis:c},{defaultText:u.title}),uf(h)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,f,h,v){var c=r.visualDrawType,d=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(n),m=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");f=_||f||"roundRect";var b=BP(f,a,l,u,c,g,v),S=new ko,x=a.getModel("textStyle");if(Q(r.getLegendIcon)&&(!_||_==="inherit"))S.add(r.getLegendIcon({itemWidth:d,itemHeight:p,icon:f,iconRotate:m,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:y}));else{var T=_==="inherit"&&r.getData().getVisual("symbol")?m==="inherit"?r.getData().getVisual("symbolRotate"):m:0;S.add(FP({itemWidth:d,itemHeight:p,icon:f,iconRotate:T,itemStyle:b.itemStyle,symbolKeepAspect:y}))}var A=s==="left"?d+5:-5,L=s,D=o.get("formatter"),C=n;Y(D)&&D?C=D.replace("{name}",n??""):Q(D)&&(C=D(n));var I=g?x.getTextColor():a.get("inactiveColor");S.add(new ee({style:si(x,{text:C,x:A,y:p/2,fill:I,align:L,verticalAlign:"middle"},{inheritColor:I})}));var P=new wt({shape:S.getBoundingRect(),style:{fill:"transparent"}}),k=a.getModel("tooltip");return k.get("show")&&Us({el:P,componentModel:o,itemName:n,itemTooltipOption:k.option}),S.add(P),S.eachChild(function(R){R.silent=!0}),P.silent=!h,this.getContentGroup().add(S),uf(S),S.__legendDataIndex=i,S},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();ra(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var f=l.getBoundingRect(),h=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){ra("horizontal",u,r.get("selectorItemGap",!0));var v=u.getBoundingRect(),c=[-v.x,-v.y],d=r.get("selectorButtonGap",!0),p=r.getOrient().index,g=p===0?"width":"height",m=p===0?"height":"width",y=p===0?"y":"x";s==="end"?c[p]+=f[g]+d:h[p]+=v[g]+d,c[1-p]+=f[m]/2-v[m]/2,u.x=c[0],u.y=c[1],l.x=h[0],l.y=h[1];var _={x:0,y:0};return _[g]=f[g]+d+v[g],_[m]=Math.max(f[m],v[m]),_[y]=Math.min(0,v[y]+c[1-p]),_}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t})(Xe);function BP(e,t,r,n,i,a,o){function s(g,m){g.lineWidth==="auto"&&(g.lineWidth=m.lineWidth>0?2:0),$f(g,function(y,_){g[_]==="inherit"&&(g[_]=m[_])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),f=e.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?n.decal:Mf(h,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[f]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var v=t.getModel("lineStyle"),c=v.getLineStyle();if(s(c,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),c.stroke==="auto"&&(c.stroke=n.fill),!a){var d=t.get("inactiveBorderWidth"),p=u[f];u.lineWidth=d==="auto"?n.lineWidth>0&&p?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),c.stroke=v.get("inactiveColor"),c.lineWidth=v.get("inactiveWidth")}return{itemStyle:u,lineStyle:c}}function FP(e){var t=e.icon||"roundRect",r=ui(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return r.setStyle(e.itemStyle),r.rotation=(e.iconRotate||0)*Math.PI/180,r.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=q.color.neutral00,r.style.lineWidth=2),r}function wg(e,t,r,n){Zf(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),Xf(e,t,r,n)}function j_(e){for(var t=e.getZr().storage.getDisplayList(),r,n=0,i=t.length;ni[o],g=[-c.x,-c.y];n||(g[a]=f[u]);var m=[0,0],y=[-d.x,-d.y],_=X(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(p){var b=r.get("pageButtonPosition",!0);b==="end"?y[a]+=i[o]-d[o]:m[a]+=d[o]+_}y[1-a]+=c[s]/2-d[s]/2,f.setPosition(g),h.setPosition(m),v.setPosition(y);var S={x:0,y:0};if(S[o]=p?i[o]:c[o],S[s]=Math.max(c[s],d[s]),S[l]=Math.min(0,d[l]+y[1-a]),h.__rectSize=i[o],p){var x={x:0,y:0};x[o]=Math.max(i[o]-d[o]-_,0),x[s]=S[s],h.setClipPath(new wt({shape:x})),h.__rectSize=x[o]}else v.eachChild(function(A){A.attr({invisible:!0,silent:!0})});var T=this._getPageInfo(r);return T.pageIndex!=null&&ae(f,{x:T.contentPosition[0],y:T.contentPosition[1]},p?r:null),this._updatePageInfoView(r,T),S},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;M(["pagePrev","pageNext"],function(f){var h=f+"DataIndex",v=n[h]!=null,c=i.childOfName(f);c&&(c.setStyle("fill",v?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),c.cursor=v?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",Y(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=xu[o],l=wu[o],u=this._findTargetItemIndex(n),f=i.children(),h=f[u],v=f.length,c=v?1:0,d={contentPosition:[i.x,i.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return d;var p=b(h);d.contentPosition[o]=-p.s;for(var g=u+1,m=p,y=p,_=null;g<=v;++g)_=b(f[g]),(!_&&y.e>m.s+a||_&&!S(_,m.s))&&(y.i>m.i?m=y:m=_,m&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=m.i),++d.pageCount)),y=_;for(var g=u-1,m=p,y=p,_=null;g>=-1;--g)_=b(f[g]),(!_||!S(y,_.s))&&m.i=T&&x.s<=T+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t})(W_);function WP(e){e.registerAction("legendScroll","legendscroll",function(t,r){var n=t.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:t},function(i){i.setScrollDataIndex(n)})})}function jP(e){Br(U_),e.registerComponentModel(VP),e.registerComponentView(HP),WP(e)}function UP(e){Br(U_),Br(jP)}var Tu=Math.sin,Cu=Math.cos,Y_=Math.PI,hn=Math.PI*2,YP=180/Y_,$_=(function(){function e(){}return e.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},e.prototype.moveTo=function(t,r){this._add("M",t,r)},e.prototype.lineTo=function(t,r){this._add("L",t,r)},e.prototype.bezierCurveTo=function(t,r,n,i,a,o){this._add("C",t,r,n,i,a,o)},e.prototype.quadraticCurveTo=function(t,r,n,i){this._add("Q",t,r,n,i)},e.prototype.arc=function(t,r,n,i,a,o){this.ellipse(t,r,n,n,0,i,a,o)},e.prototype.ellipse=function(t,r,n,i,a,o,s,l){var u=s-o,f=!l,h=Math.abs(u),v=Cr(h-hn)||(f?u>=hn:-u>=hn),c=u>0?u%hn:u%hn+hn,d=!1;v?d=!0:Cr(h)?d=!1:d=c>=Y_==!!f;var p=t+n*Cu(o),g=r+i*Tu(o);this._start&&this._add("M",p,g);var m=Math.round(a*YP);if(v){var y=1/this._p,_=(f?1:-1)*(hn-y);this._add("A",n,i,m,1,+f,t+n*Cu(o+_),r+i*Tu(o+_)),y>.01&&this._add("A",n,i,m,0,+f,p,g)}else{var b=t+n*Cu(s),S=r+i*Tu(s);this._add("A",n,i,m,+d,+f,b,S)}},e.prototype.rect=function(t,r,n,i){this._add("M",t,r),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(t,r,n,i,a,o,s,l,u){for(var f=[],h=this._p,v=1;v"}function eI(e){return""}function bc(e,t){t=t||{};var r=t.newline?` +`:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return tI(o,s)+(o!=="style"?jt(l):l||"")+(a?""+r+$(a,function(u){return n(u)}).join(r)+r:"")+eI(o)}return n(e)}function rI(e,t,r){r=r||{};var n=r.newline?` +`:"",i=" {"+n,a=n+"}",o=$(st(e),function(l){return l+i+$(st(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=$(st(t),function(l){return"@keyframes "+l+i+$(st(t[l]),function(u){return u+i+$(st(t[l][u]),function(f){var h=t[l][u][f];return f==="d"&&(h='path("'+h+'")'),f+":"+h+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function Kf(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Ag(e,t,r,n){return Lt("svg","root",{width:e,height:t,xmlns:X_,"xmlns:xlink":Z_,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var nI=0;function K_(){return nI++}var Lg={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"},cn="transform-origin";function iI(e,t,r){var n=N({},e.shape);N(n,t),e.buildPath(r,n);var i=new $_;return i.reset(pm(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function aI(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[cn]=r+"px "+n+"px")}var oI={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Q_(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function sI(e,t,r){var n=e.shape.paths,i={},a,o;if(M(n,function(l){var u=Kf(r.zrId);u.animation=!0,nl(l,{},u,!0);var f=u.cssAnims,h=u.cssNodes,v=st(f),c=v.length;if(c){o=v[c-1];var d=f[o];for(var p in d){var g=d[p];i[p]=i[p]||{d:""},i[p].d+=g.d||""}for(var m in h){var y=h[m].animation;y.indexOf(o)>=0&&(a=y)}}}),!!a){t.d=!1;var s=Q_(i,r);return a.replace(o,s)}}function Pg(e){return Y(e)?Lg[e]?"cubic-bezier("+Lg[e]+")":uh(e)?e:"":""}function nl(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof ay){var s=sI(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var se=Q_(T,r);return se+" "+y[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var m=r.zrId+"-cls-"+K_();r.cssNodes["."+m]={animation:o.join(",")},t.class=m}}function lI(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};Ig(n,t,r)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,l=e.currentStates.indexOf("select")>=0&&s||o;l&&(a=Wu(l))}var u=i.lineWidth;if(u){var f=!i.strokeNoScale&&e.transform?e.transform[0]:1;u=u/f}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),Ig(n,t,r)}}function Ig(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+K_(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var Ma=Math.round;function J_(e){return e&&Y(e.src)}function t1(e){return e&&Q(e.toDataURL)}function Sc(e,t,r,n){KP(function(i,a){var o=i==="fill"||i==="stroke";o&&dm(a)?r1(t,e,i,n):o&&fh(a)?n1(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),pI(r,e,n)}function xc(e,t){var r=CS(t);r&&(r.each(function(n,i){n!=null&&(e[(Mg+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[Mg+"silent"]="true"))}function kg(e){return Cr(e[0]-1)&&Cr(e[1])&&Cr(e[2])&&Cr(e[3]-1)}function uI(e){return Cr(e[4])&&Cr(e[5])}function wc(e,t,r){if(t&&!(uI(t)&&kg(t))){var n=1e4;e.transform=kg(t)?"translate("+Ma(t[4]*n)/n+" "+Ma(t[5]*n)/n+")":$b(t)}}function Rg(e,t,r){for(var n=e.points,i=[],a=0;a"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";Me(v,g),Me(c,g)}else if(v==null||c==null){var m=function(D,C){if(D){var I=D.elm,P=v||C.width,k=c||C.height;D.tag==="pattern"&&(u?(k=1,P/=a.width):f&&(P=1,k/=a.height)),D.attrs.width=P,D.attrs.height=k,I&&(I.setAttribute("width",P),I.setAttribute("height",k))}},y=mh(d,null,e,function(D){l||m(x,D),m(h,D)});y&&y.width&&y.height&&(v=v||y.width,c=c||y.height)}h=Lt("image","img",{href:d,width:v,height:c}),o.width=v,o.height=c}else i.svgElement&&(h=it(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(h){var _,b;l?_=b=1:u?(b=1,_=o.width/a.width):f?(_=1,b=o.height/a.height):o.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(o.width=_),b!=null&&!isNaN(b)&&(o.height=b);var S=gm(i);S&&(o.patternTransform=S);var x=Lt("pattern","",o,[h]),T=bc(x),A=n.patternCache,L=A[T];L||(L=n.zrId+"-p"+n.patternIdx++,A[T]=L,o.id=L,x=n.defs[L]=Lt("pattern",L,o,[h])),t[r]=Os(L)}}function gI(e,t,r){var n=r.clipPathCache,i=r.defs,a=n[e.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[e.id]=a,i[a]=Lt("clipPath",a,o,[e1(e,r)])}t["clip-path"]=Os(a)}function Ng(e){return document.createTextNode(e)}function pn(e,t,r){e.insertBefore(t,r)}function Bg(e,t){e.removeChild(t)}function Fg(e,t){e.appendChild(t)}function i1(e){return e.parentNode}function a1(e){return e.nextSibling}function Du(e,t){e.textContent=t}var zg=58,mI=120,yI=Lt("","");function Qf(e){return e===void 0}function Ne(e){return e!==void 0}function _I(e,t,r){for(var n={},i=t;i<=r;++i){var a=e[i].key;a!==void 0&&(n[a]=i)}return n}function Yi(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function Aa(e){var t,r=e.children,n=e.tag;if(Ne(n)){var i=e.elm=q_(n);if(Tc(yI,e),H(r))for(t=0;ta?(d=r[l+1]==null?null:r[l+1].elm,o1(e,d,r,i,l)):Is(e,t,n,a))}function Xn(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(Tc(e,t),Qf(t.text)?Ne(n)&&Ne(i)?n!==i&&bI(r,n,i):Ne(i)?(Ne(e.text)&&Du(r,""),o1(r,null,i,0,i.length-1)):Ne(n)?Is(r,n,0,n.length-1):Ne(e.text)&&Du(r,""):e.text!==t.text&&(Ne(n)&&Is(r,n,0,n.length-1),Du(r,t.text)))}function SI(e,t){if(Yi(e,t))Xn(e,t);else{var r=e.elm,n=i1(r);Aa(t),n!==null&&(pn(n,t.elm,a1(r)),Is(n,[e],0,0))}return t}var xI=0,wI=(function(){function e(t,r,n){if(this.type="svg",this.refreshHover=Gg(),this.configLayer=Gg(),this.storage=r,this._opts=n=N({},n),this.root=t,this._id="zr"+xI++,this._oldVNode=Ag(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=q_("svg");Tc(null,this._oldVNode),i.appendChild(a),t.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",SI(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return Og(t,Kf(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=Kf(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=TI(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Lt("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=$(st(a.defs),function(v){return a.defs[v]});if(u.length&&o.push(Lt("defs","defs",{},u)),t.animation){var f=rI(a.cssNodes,a.cssAnims,{newline:!0});if(f){var h=Lt("style","stl",{},[],f);o.push(h)}}return Ag(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},bc(this.renderToVNode({animation:X(t.cssAnimation,!0),emphasis:X(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:X(t.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(t,r,n){for(var i=t.length,a=[],o=0,s,l,u=0,f=0;f=0&&!(v&&l&&v[p]===l[p]);p--);for(var g=d-1;g>p;g--)o--,s=a[o-1];for(var m=p+1;m{const f=a.current;if(f===null||f.clientWidth===0)return;const h=IM(f,void 0,{renderer:"svg"});o.current=h;const v=()=>h.resize();return window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v),o.current=null,h.dispose()}},[]),rt.useEffect(()=>{const f=window.matchMedia?.("(prefers-color-scheme: dark)"),h=()=>u(v=>v+1);return window.addEventListener("flowlens-theme-change",h),f?.addEventListener("change",h),()=>{window.removeEventListener("flowlens-theme-change",h),f?.removeEventListener("change",h)}},[]),rt.useEffect(()=>{const f=o.current;if(f===null)return;const h=e==="live"?n.map(g=>g.timestamp):i.map(g=>g.start),v=e==="live"||t==="speed",c=e==="live"?"live":`history-${t}`,d=s.current!==null&&s.current!==c;s.current=c;const p=MI();f.setOption({animation:e!=="live"&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches,color:[p.download,p.upload,p.green],textStyle:{fontFamily:p.fontFamily},grid:{left:52,right:14,top:34,bottom:28},tooltip:{trigger:"axis",backgroundColor:p.tooltipBackground,borderColor:p.lineStrong,textStyle:{color:p.tooltipInk,fontSize:11},formatter:LI(e,v)},legend:{top:0,right:4,itemWidth:14,itemHeight:7,textStyle:{color:p.muted,fontSize:10}},xAxis:{type:"category",data:h,boundaryGap:e==="history"&&t==="traffic",axisTick:{show:!1},axisLine:{lineStyle:{color:p.line}},axisLabel:{show:!0,hideOverlap:!0,interval:Math.max(0,Math.ceil(h.length/(e==="live"?10:8))-1),color:p.muted,fontSize:10,formatter:g=>AI(g,e,r)}},yAxis:{type:"value",axisLabel:{color:p.muted,fontSize:10,formatter:v?Ot:s1},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:p.line}}},series:e==="live"?[{id:"live-download",name:"下载",type:"line",showSymbol:!1,smooth:.45,smoothMonotone:"x",connectNulls:!1,lineStyle:{width:2},areaStyle:{opacity:.07},data:n.map(g=>g.download)},{id:"live-upload",name:"上传",type:"line",showSymbol:!1,smooth:.45,smoothMonotone:"x",connectNulls:!1,lineStyle:{width:2},areaStyle:{opacity:.05},data:n.map(g=>g.upload)}]:t==="speed"?[{id:"history-speed-download",name:"平均下载",type:"line",showSymbol:!1,smooth:.45,smoothMonotone:"x",connectNulls:!1,lineStyle:{width:2},areaStyle:{opacity:.07},data:i.map(g=>g.downloadRate)},{id:"history-speed-upload",name:"平均上传",type:"line",showSymbol:!1,smooth:.45,smoothMonotone:"x",connectNulls:!1,lineStyle:{width:2},areaStyle:{opacity:.05},data:i.map(g=>g.uploadRate)}]:[{id:"history-traffic-download",name:"下载",type:"bar",stack:"bytes",data:i.map(g=>Number(BigInt(g.download)/1024n))},{id:"history-traffic-upload",name:"上传",type:"bar",stack:"bytes",data:i.map(g=>Number(BigInt(g.upload)/1024n))},{id:"history-traffic-cumulative",name:"累计",type:"line",yAxisIndex:0,showSymbol:!1,data:i.map(g=>Number(BigInt(g.cumulative)/1024n))}]},d?{lazyUpdate:!0,replaceMerge:["series"]}:{lazyUpdate:!0})},[i,r,t,n,e,l]),w.jsx("div",{ref:a,className:"chart-shell",role:"img","aria-label":e==="live"?"实时上传和下载速度曲线":t==="speed"?"历史平均上传和下载速度曲线":"历史上传下载流量和累计曲线"})}function MI(){const e=getComputedStyle(document.documentElement),t=(r,n)=>e.getPropertyValue(r).trim()||n;return{download:t("--download","#2563eb"),upload:t("--upload","#d97706"),green:t("--green","#0f9d78"),muted:t("--muted","#667085"),line:t("--line","#dfe5ed"),lineStrong:t("--line-strong","#cbd4e1"),tooltipBackground:t("--chart-tooltip-bg","#172033"),tooltipInk:t("--chart-tooltip-ink","#f8fafc"),fontFamily:t("--font-sans",'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif')}}function AI(e,t,r){const n=Number(e);if(!Number.isFinite(n))return"";const i=new Date(n*1e3);return t==="live"||r==="time"?i.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):i.toLocaleDateString("zh-CN",{month:"numeric",day:"numeric"})}function s1(e){if(!Number.isFinite(e)||e<0)return"—";const t=["KiB","MiB","GiB","TiB","PiB"];let r=e,n=0;for(;r>=1024&&n=10||Number.isInteger(r)?0:1;return`${r.toFixed(i)} ${t[n]}`}function LI(e,t){return r=>{const n=Array.isArray(r)?r:[r],i=PI(n[0]?.axisValue,e),a=t?Ot:s1,o=n.map(s=>{const l=typeof s.marker=="string"?s.marker:"",u=typeof s.seriesName=="string"?s.seriesName:"",f=typeof s.value=="number"?s.value:Number.NaN;return`${l}${u} ${a(f)}`});return[`${i}`,...o].join("
")}}function PI(e,t){const r=Number(e);if(!Number.isFinite(r))return"—";const n=new Date(r*1e3),i=[n.getFullYear(),Fi(n.getMonth()+1),Fi(n.getDate())].join("-"),a=[Fi(n.getHours()),Fi(n.getMinutes())];return t==="live"&&a.push(Fi(n.getSeconds())),`${i} ${a.join(":")}`}function Fi(e){return String(e).padStart(2,"0")}const II={status:"degraded",reason:"starting",timezone:"UTC",version:"",auth_enabled:!1,capabilities:{connection_id:!1,source:!1,destination:!1,port:!1,network:!1,domain:!1}};function FI({source:e,onUnauthorized:t}){const[r,n]=rt.useState(II),[i,a]=rt.useState({kind:"live"}),[o,s]=rt.useState("endpoint"),[l,u]=rt.useState("speed"),[f,h]=rt.useState(null),[v,c]=rt.useState([]),[d,p]=rt.useState([]),[g,m]=rt.useState([]),[y,_]=rt.useState(!1),[b,S]=rt.useState(0),[x,T]=rt.useState(!1),A=rt.useCallback((G,J)=>{n(ot=>ot.status===G&&ot.reason===J?ot:{...ot,status:G,reason:J})},[]),L=rt.useCallback(async()=>{c(await e.labels()),S(G=>G+1)},[e]);rt.useEffect(()=>{const G=new AbortController,J=ot=>{ot instanceof Zo&&t()};return e.status(G.signal).then(n).catch(J),e.storage(G.signal).then(h).catch(J),e.labels(G.signal).then(c).catch(J),e.labelCandidates(G.signal).then(p).catch(J),e.runtimeSessions(G.signal).then(m).catch(J),()=>G.abort()},[t,e]);const D=P1(e,r,i.kind==="live",A,t),C=D1(e,i,o,t,b),I=rt.useMemo(()=>C.targets?.items??[],[C.targets]),P=i.kind==="live"?D.targets.map(G=>({rawValue:G.raw_endpoint,displayName:G.display_name,networkCode:G.network_code,totalBytes:"0",uploadBytes:"0",downloadBytes:"0"})):I;async function k(){T(!1);try{await e.logout(),t()}catch(G){if(G instanceof Zo){t();return}T(!0)}}const R=i.kind==="live",E=o==="target"||o==="endpoint",W=R?"实时吞吐":"历史流量",O=R?"最近 60 分钟 · 1 秒采样":"SQLite 聚合 · 自动选择分辨率",B=R?"实时目标分析":`${EI(o)}分析`,U=`${R?"当前目标速率":"所选周期累计流量"} · 近似归因`,j=R?"当前目标排行":"历史维度排行",z=R?"按当前速率排序,别名后保留原始端点。":"按所选周期累计流量排序,结果为近似归因。";return w.jsxs(g1,{status:r.status,version:r.version,sourceMode:e.demo?"demo":"app",authEnabled:e.demo||r.auth_enabled,onLogout:()=>void k(),logoutFailed:x,children:[w.jsxs("section",{className:"page-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:"Traffic overview"}),w.jsx("h1",{className:"page-title",children:"流量总览"})]}),w.jsx(b1,{value:i,now:e.now(),timezone:r.timezone,onChange:a})]}),w.jsxs("section",{className:"dashboard","data-dashboard-mode":R?"live":"history",children:[w.jsxs("article",{className:"panel hero-panel",children:[w.jsxs("header",{className:"panel-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:R?"Live throughput":"Historical traffic"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{children:W}),w.jsx(Mr,{content:O,label:`查看“${W}”说明`})]})]}),w.jsx("span",{className:"micro",children:R?D.connected?`${u1(D.intervalMillis)}采样 · SSE 已连接`:"SSE 重连中":C.loading?"正在加载":C.error?"历史数据加载失败":"按范围查询"})]}),w.jsxs("div",{className:"chart-summary",children:[w.jsx(Et,{label:R?"当前下载":"下载总量",value:R?Ot(D.currentDownload):C.view?Wt(C.view.downloadBytes):"—"}),w.jsx(Et,{label:R?"当前上传":"上传总量",value:R?Ot(D.currentUpload):C.view?Wt(C.view.uploadBytes):"—"}),w.jsx(Et,{label:R?"活动连接":"总流量",value:R?String(D.activeConnections??"—"):C.view?Wt(C.view.totalBytes):"—"})]}),w.jsx("div",{className:"metric-grid",children:R?w.jsxs(w.Fragment,{children:[w.jsx(Et,{label:"1 分钟平均下载",value:Ot(D.averageDownload1m)}),w.jsx(Et,{label:"1 分钟平均上传",value:Ot(D.averageUpload1m)}),w.jsx(Et,{label:"5 分钟平均下载",value:Ot(D.averageDownload5m)}),w.jsx(Et,{label:"5 分钟平均上传",value:Ot(D.averageUpload5m)}),w.jsx(Et,{label:"60 分钟峰值下载",value:Ot(D.peakDownload60m)}),w.jsx(Et,{label:"60 分钟峰值上传",value:Ot(D.peakUpload60m)})]}):w.jsxs(w.Fragment,{children:[w.jsx(Et,{label:"较上一周期",value:NI(C.view?.totalBytes,C.view?.previousBytes,i)}),w.jsx(Et,{label:"平均下载",value:Ot(C.view?.averageDownload??null)}),w.jsx(Et,{label:"平均上传",value:Ot(C.view?.averageUpload??null)}),w.jsx(Et,{label:"峰值下载",value:Ot(C.view?.peakDownload??null)}),w.jsx(Et,{label:"峰值上传",value:Ot(C.view?.peakUpload??null)}),w.jsx(Et,{label:"平均连接",value:Hg(C.view?.averageConnections??null)}),w.jsx(Et,{label:"峰值连接",value:Hg(C.view?.peakConnections??null)}),w.jsx(Et,{label:"数据完整率",value:ks(C.view?.completeness??null)})]})}),R?null:w.jsxs("div",{className:"chart-toggle","aria-label":"历史图表视图",children:[w.jsx("button",{type:"button","aria-pressed":l==="traffic",onClick:()=>u("traffic"),children:"流量视图"}),w.jsx("button",{type:"button","aria-pressed":l==="speed",onClick:()=>u("speed"),children:"速度视图"})]}),w.jsx(DI,{mode:R?"live":"history",live:D.chart,history:C.view?.chart,historyView:l,historyLabelMode:i.kind==="preset"&&(i.preset==="today"||i.preset==="yesterday")?"time":"date"})]}),w.jsxs("article",{className:"panel topology-panel",children:[w.jsxs("header",{className:"panel-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:"Traffic topology"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{children:B}),w.jsx(Mr,{content:U,label:`查看“${B}”说明`})]})]}),R?null:w.jsx(OI,{value:o,onChange:s})]}),R||E?w.jsx(N1,{targets:P}):w.jsx(E1,{by:o,rows:I})]}),w.jsx(kI,{liveMode:R,connectionCoverage:R?D.connectionCoverage:C.targets?.connectionCoverage??null,dimensionRetention:R?null:C.targets?.dimensionRetention??null,unattributed:R||!C.targets?null:Wt(C.targets.unattributedBytes),other:R||!C.targets?null:Wt(C.targets.otherBytes),statusReason:r.reason,observedAt:R?D.observedAt:null,intervalMillis:R?D.intervalMillis:null,completeness:R?null:C.view?.completeness??null,recovered:R||!C.view?null:Wt(C.view.recoveredBytes),resetCount:R?null:C.view?.resetCount??null,qualityEventCount:R?null:C.view?.qualityEvents.length??null,boundaryApproximate:R?null:C.view?.boundaryApproximate??null,sessions:R?[]:g}),w.jsxs("article",{className:"panel targets-panel",children:[w.jsxs("header",{className:"panel-head",children:[w.jsxs("div",{children:[w.jsx("span",{className:"eyebrow",children:"Observed targets"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{children:j}),w.jsx(Mr,{content:z,label:`查看“${j}”说明`})]})]}),w.jsx(Jf,{content:"管理别名",children:w.jsx("button",{className:"icon-button",type:"button","aria-label":"管理别名",onClick:()=>_(!0),children:w.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:w.jsx("path",{d:"m4 16-.8 4.8L8 20l10.6-10.6a2 2 0 0 0-2.8-2.8L5.2 17.2M14.5 8l2.8 2.8"})})})})]}),R?w.jsx(kc,{live:D.targets,liveTotalRate:D.targetGlobalRate}):w.jsx(kc,{historical:I})]}),w.jsx(I1,{value:f})]}),y?w.jsx(m1,{source:e,labels:v,candidates:d,onChanged:L,onClose:()=>_(!1)}):null]})}function kI({liveMode:e,connectionCoverage:t,dimensionRetention:r,unattributed:n,other:i,statusReason:a,observedAt:o,intervalMillis:s,completeness:l,recovered:u,resetCount:f,qualityEventCount:h,boundaryApproximate:v,sessions:c}){return w.jsxs("aside",{className:"panel confidence-panel",children:[w.jsx("span",{className:"eyebrow",children:"Data confidence"}),w.jsxs("div",{className:"heading-with-tooltip",children:[w.jsx("h2",{children:"数据质量"}),w.jsx(Mr,{content:"全局总量精确;下面说明目标排行能解释其中多少流量。",label:"查看“数据质量”说明"})]}),w.jsxs("div",{className:"coverage-list",children:[w.jsx(Vg,{label:"可归因覆盖",value:t,detail:"全局流量中,能关联到活动连接维度的部分。"}),e?null:w.jsx(Vg,{label:"排行覆盖",value:r,detail:"已归因流量中,仍保留在当前 Top K 排行里的部分。"})]}),w.jsxs("dl",{className:"confidence-stats",children:[w.jsxs("div",{children:[w.jsx("dt",{children:"未归因流量"}),w.jsx("dd",{children:e?"实时不累计":n??"—"})]}),e?null:w.jsxs("div",{children:[w.jsx("dt",{children:"Top K 之外"}),w.jsx("dd",{children:i??"—"})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"采集状态"}),w.jsx("dd",{children:a})]}),e?w.jsxs(w.Fragment,{children:[w.jsxs("div",{children:[w.jsx("dt",{children:"最后观测"}),w.jsx("dd",{children:o===null?"—":new Date(o*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"实际间隔"}),w.jsx("dd",{children:u1(s)})]})]}):w.jsxs(w.Fragment,{children:[w.jsxs("div",{children:[w.jsx("dt",{children:"数据完整率"}),w.jsx("dd",{children:ks(l)})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"恢复流量"}),w.jsx("dd",{children:u??"—"})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"重置次数"}),w.jsx("dd",{children:f??"—"})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"质量事件"}),w.jsx("dd",{children:h??"—"})]}),w.jsxs("div",{children:[w.jsx("dt",{children:"边界估算"}),w.jsx("dd",{children:v===null?"—":v?"已近似":"精确边界"})]})]})]}),e?null:w.jsx(RI,{sessions:c})]})}function RI({sessions:e}){return w.jsxs("section",{className:"runtime-sessions","aria-label":"最近运行",children:[w.jsx("div",{className:"runtime-sessions-head",children:w.jsxs("span",{className:"label-with-tooltip",children:[w.jsx("strong",{children:"最近运行"}),w.jsx(Mr,{content:"采集进程上下文",label:"查看“最近运行”说明"})]})}),e.length===0?w.jsx("p",{className:"empty-state",children:"暂无运行记录。"}):w.jsx("div",{className:"runtime-session-list",children:e.slice(0,3).map(t=>w.jsxs("article",{className:"runtime-session",children:[w.jsxs("div",{children:[w.jsx("strong",{children:t.ended_at===null?"当前运行":"历史运行"}),w.jsx("span",{children:t.sing_box_version})]}),w.jsxs("span",{children:[new Date(t.started_at*1e3).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),t.ended_at===null?" 至今":" 已结束"]}),w.jsx("span",{children:t.data_gap_before_seconds>0?`前序缺口 ${t.data_gap_before_seconds} 秒`:"连续采集"})]},`${t.started_at}-${t.last_seen_at}`))})]})}function Vg({label:e,value:t,detail:r}){const n=t===null?null:Math.round(t*1e3)/10;return w.jsxs("div",{className:"coverage-row",children:[w.jsxs("div",{className:"coverage-label",children:[w.jsxs("span",{className:"label-with-tooltip",children:[w.jsx("strong",{children:e}),w.jsx(Mr,{content:r,label:`查看“${e}”说明`})]}),w.jsx("span",{children:ks(t)})]}),w.jsx("div",{className:"coverage-track",role:"progressbar","aria-label":e,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n??void 0,children:w.jsx("i",{style:{"--coverage":`${n===null?0:n}%`}})})]})}function Et({label:e,value:t}){return w.jsxs("div",{className:"chart-value",children:[w.jsx("span",{children:e}),w.jsx("strong",{children:t})]})}const l1=[{value:"target",label:"目标 IP"},{value:"endpoint",label:"Endpoint"},{value:"port",label:"端口"},{value:"network",label:"TCP/UDP"},{value:"source",label:"来源网段"},{value:"domain",label:"域名"}];function EI(e){return l1.find(t=>t.value===e).label}function OI({value:e,onChange:t}){return w.jsx("div",{className:"dimension-tabs","aria-label":"分析维度",children:l1.map(r=>w.jsx("button",{type:"button","aria-pressed":e===r.value,onClick:()=>t(r.value),children:r.label},r.value))})}function Hg(e){return e===null?"—":e.toFixed(e%1===0?0:1)}function u1(e){return e===null?"":`${(e/1e3).toFixed(1)} 秒`}function NI(e,t,r){if(r.kind==="preset"&&r.preset==="lifetime")return"不适用";if(e===void 0||t===void 0)return"—";const n=BigInt(t);if(n===0n)return"首次统计";const i=Number((BigInt(e)-n)*1000n/n)/10;return`${i>=0?"+":""}${i.toFixed(1)}%`}export{FI as DashboardPage}; diff --git a/internal/webassets/dist/assets/index-TEbLqC9v.js b/internal/webassets/dist/assets/index-B9YDBDoG.js similarity index 88% rename from internal/webassets/dist/assets/index-TEbLqC9v.js rename to internal/webassets/dist/assets/index-B9YDBDoG.js index e5f0347..3181a84 100644 --- a/internal/webassets/dist/assets/index-TEbLqC9v.js +++ b/internal/webassets/dist/assets/index-B9YDBDoG.js @@ -46,4 +46,4 @@ `+o[a].replace(" at new "," at ");return t.displayName&&p.includes("")&&(p=p.replace("",t.displayName)),p}while(1<=a&&0<=u);break}}}finally{ei=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?Ve(e):""}function ld(t){switch(t.tag){case 26:case 27:case 5:return Ve(t.type);case 16:return Ve("Lazy");case 13:return Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return ai(t.type,!1);case 11:return ai(t.type.render,!1);case 1:return ai(t.type,!0);case 31:return Ve("Activity");default:return""}}function xf(t){try{var l="";do l+=ld(t),t=t.return;while(t);return l}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}function ol(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function wf(t){var l=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ed(t){var l=wf(t)?"checked":"value",e=Object.getOwnPropertyDescriptor(t.constructor.prototype,l),a=""+t[l];if(!t.hasOwnProperty(l)&&typeof e<"u"&&typeof e.get=="function"&&typeof e.set=="function"){var u=e.get,n=e.set;return Object.defineProperty(t,l,{configurable:!0,get:function(){return u.call(this)},set:function(i){a=""+i,n.call(this,i)}}),Object.defineProperty(t,l,{enumerable:e.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){t._valueTracker=null,delete t[l]}}}}function Bu(t){t._valueTracker||(t._valueTracker=ed(t))}function Yf(t){if(!t)return!1;var l=t._valueTracker;if(!l)return!0;var e=l.getValue(),a="";return t&&(a=wf(t)?t.checked?"true":"false":t.value),t=a,t!==e?(l.setValue(t),!0):!1}function xu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ad=/[\n"\\]/g;function rl(t){return t.replace(ad,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function ui(t,l,e,a,u,n,i,c){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+ol(l)):t.value!==""+ol(l)&&(t.value=""+ol(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?ni(t,i,ol(l)):e!=null?ni(t,i,ol(e)):a!=null&&t.removeAttribute("value"),u==null&&n!=null&&(t.defaultChecked=!!n),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.name=""+ol(c):t.removeAttribute("name")}function jf(t,l,e,a,u,n,i,c){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null))return;e=e!=null?""+ol(e):"",l=l!=null?""+ol(l):e,c||l===t.value||(t.value=l),t.defaultValue=l}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=c?t.checked:!!a,t.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i)}function ni(t,l,e){l==="number"&&xu(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function Ke(t,l,e,a){if(t=t.options,l){l={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oi=!1;if(Hl)try{var qa={};Object.defineProperty(qa,"passive",{get:function(){oi=!0}}),window.addEventListener("test",qa,qa),window.removeEventListener("test",qa,qa)}catch{oi=!1}var $l=null,ri=null,Yu=null;function Vf(){if(Yu)return Yu;var t,l=ri,e=l.length,a,u="value"in $l?$l.value:$l.textContent,n=u.length;for(t=0;t=xa),Ff=" ",If=!1;function Pf(t,l){switch(t){case"keyup":return Nd.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ts(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $e=!1;function Hd(t,l){switch(t){case"compositionend":return ts(l);case"keypress":return l.which!==32?null:(If=!0,Ff);case"textInput":return t=l.data,t===Ff&&If?null:t;default:return null}}function Bd(t,l){if($e)return t==="compositionend"||!vi&&Pf(t,l)?(t=Vf(),Yu=ri=$l=null,$e=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=a}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=fs(e)}}function os(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?os(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function rs(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=xu(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=xu(t.document)}return l}function gi(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var Qd=Hl&&"documentMode"in document&&11>=document.documentMode,Fe=null,Si=null,Ga=null,pi=!1;function ds(t,l,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;pi||Fe==null||Fe!==xu(a)||(a=Fe,"selectionStart"in a&&gi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ga&&ja(Ga,a)||(Ga=a,a=On(Si,"onSelect"),0>=i,u-=i,xl=1<<32-el(l)+u|e<n?n:8;var i=T.T,c={};T.T=c,ic(t,!1,l,e);try{var o=u(),b=T.S;if(b!==null&&b(c,o),o!==null&&typeof o=="object"&&typeof o.then=="function"){var p=Fd(o,a);tu(t,l,p,fl(t))}else tu(t,l,a,fl(t))}catch(M){tu(t,l,{then:function(){},status:"rejected",reason:M},fl())}finally{N.p=n,T.T=i}}function ey(){}function uc(t,l,e,a){if(t.tag!==5)throw Error(s(476));var u=mo(t).queue;yo(t,u,l,C,e===null?ey:function(){return ho(t),e(a)})}function mo(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:C,baseState:C,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gl,lastRenderedState:C},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function ho(t){var l=mo(t).next.queue;tu(t,l,{},fl())}function nc(){return Zt(_u)}function vo(){return At().memoizedState}function bo(){return At().memoizedState}function ay(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=fl();t=Pl(e);var a=te(l,t,e);a!==null&&(sl(a,l,e),ka(a,l,e)),l={cache:xi()},t.payload=l;return}l=l.return}}function uy(t,l,e){var a=fl();e={lane:a,revertLane:0,action:e,hasEagerState:!1,eagerState:null,next:null},fn(t)?go(l,e):(e=Mi(t,l,e,a),e!==null&&(sl(e,t,a),So(e,l,a)))}function _o(t,l,e){var a=fl();tu(t,l,e,a)}function tu(t,l,e,a){var u={lane:a,revertLane:0,action:e,hasEagerState:!1,eagerState:null,next:null};if(fn(t))go(l,u);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,c=n(i,e);if(u.hasEagerState=!0,u.eagerState=c,al(c,i))return Lu(t,l,u,0),yt===null&&Zu(),!1}catch{}finally{}if(e=Mi(t,l,u,a),e!==null)return sl(e,t,a),So(e,l,a),!0}return!1}function ic(t,l,e,a){if(a={lane:2,revertLane:jc(),action:a,hasEagerState:!1,eagerState:null,next:null},fn(t)){if(l)throw Error(s(479))}else l=Mi(t,e,a,2),l!==null&&sl(l,t,2)}function fn(t){var l=t.alternate;return t===J||l!==null&&l===J}function go(t,l){ca=ln=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function So(t,l,e){if((e&4194048)!==0){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,Df(t,e)}}var sn={readContext:Zt,use:an,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt},po={readContext:Zt,use:an,useCallback:function(t,l){return $t().memoizedState=[t,l===void 0?null:l],t},useContext:Zt,useEffect:ao,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,cn(4194308,4,co.bind(null,l,t),e)},useLayoutEffect:function(t,l){return cn(4194308,4,t,l)},useInsertionEffect:function(t,l){cn(4,2,t,l)},useMemo:function(t,l){var e=$t();l=l===void 0?null:l;var a=t();if(Be){kl(!0);try{t()}finally{kl(!1)}}return e.memoizedState=[a,l],a},useReducer:function(t,l,e){var a=$t();if(e!==void 0){var u=e(l);if(Be){kl(!0);try{e(l)}finally{kl(!1)}}}else u=l;return a.memoizedState=a.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},a.queue=t,t=t.dispatch=uy.bind(null,J,t),[a.memoizedState,t]},useRef:function(t){var l=$t();return t={current:t},l.memoizedState=t},useState:function(t){t=tc(t);var l=t.queue,e=_o.bind(null,J,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:ec,useDeferredValue:function(t,l){var e=$t();return ac(e,t,l)},useTransition:function(){var t=tc(!1);return t=yo.bind(null,J,t.queue,!0,!1),$t().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var a=J,u=$t();if(et){if(e===void 0)throw Error(s(407));e=e()}else{if(e=l(),yt===null)throw Error(s(349));(I&124)!==0||Xs(a,l,e)}u.memoizedState=e;var n={value:e,getSnapshot:l};return u.queue=n,ao(Zs.bind(null,a,n,t),[t]),a.flags|=2048,sa(9,nn(),Qs.bind(null,a,n,e,l),null),e},useId:function(){var t=$t(),l=yt.identifierPrefix;if(et){var e=wl,a=xl;e=(a&~(1<<32-el(a)-1)).toString(32)+e,l="«"+l+"R"+e,e=en++,0G?(Nt=w,w=null):Nt=w.sibling;var lt=_(m,w,v[G],A);if(lt===null){w===null&&(w=Nt);break}t&&w&<.alternate===null&&l(m,w),d=n(lt,d,G),k===null?x=lt:k.sibling=lt,k=lt,w=Nt}if(G===v.length)return e(m,w),et&&Oe(m,G),x;if(w===null){for(;GG?(Nt=w,w=null):Nt=w.sibling;var be=_(m,w,lt.value,A);if(be===null){w===null&&(w=Nt);break}t&&w&&be.alternate===null&&l(m,w),d=n(be,d,G),k===null?x=be:k.sibling=be,k=be,w=Nt}if(lt.done)return e(m,w),et&&Oe(m,G),x;if(w===null){for(;!lt.done;G++,lt=v.next())lt=M(m,lt.value,A),lt!==null&&(d=n(lt,d,G),k===null?x=lt:k.sibling=lt,k=lt);return et&&Oe(m,G),x}for(w=a(w);!lt.done;G++,lt=v.next())lt=g(w,m,G,lt.value,A),lt!==null&&(t&<.alternate!==null&&w.delete(lt.key===null?G:lt.key),d=n(lt,d,G),k===null?x=lt:k.sibling=lt,k=lt);return t&&w.forEach(function(i1){return l(m,i1)}),et&&Oe(m,G),x}function st(m,d,v,A){if(typeof v=="object"&&v!==null&&v.type===it&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case V:t:{for(var x=v.key;d!==null;){if(d.key===x){if(x=v.type,x===it){if(d.tag===7){e(m,d.sibling),A=u(d,v.props.children),A.return=m,m=A;break t}}else if(d.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Pt&&Eo(x)===d.type){e(m,d.sibling),A=u(d,v.props),eu(A,v),A.return=m,m=A;break t}e(m,d);break}else l(m,d);d=d.sibling}v.type===it?(A=ze(v.props.children,m.mode,A,v.key),A.return=m,m=A):(A=Ku(v.type,v.key,v.props,null,m.mode,A),eu(A,v),A.return=m,m=A)}return i(m);case dt:t:{for(x=v.key;d!==null;){if(d.key===x)if(d.tag===4&&d.stateNode.containerInfo===v.containerInfo&&d.stateNode.implementation===v.implementation){e(m,d.sibling),A=u(d,v.children||[]),A.return=m,m=A;break t}else{e(m,d);break}else l(m,d);d=d.sibling}A=Oi(v,m.mode,A),A.return=m,m=A}return i(m);case Pt:return x=v._init,v=x(v._payload),st(m,d,v,A)}if(Xt(v))return X(m,d,v,A);if(Ct(v)){if(x=Ct(v),typeof x!="function")throw Error(s(150));return v=x.call(v),j(m,d,v,A)}if(typeof v.then=="function")return st(m,d,on(v),A);if(v.$$typeof===at)return st(m,d,$u(m,v),A);rn(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,d!==null&&d.tag===6?(e(m,d.sibling),A=u(d,v),A.return=m,m=A):(e(m,d),A=Di(v,m.mode,A),A.return=m,m=A),i(m)):e(m,d)}return function(m,d,v,A){try{lu=0;var x=st(m,d,v,A);return oa=null,x}catch(w){if(w===Ka||w===Iu)throw w;var k=ul(29,w,null,m.mode);return k.lanes=A,k.return=m,k}finally{}}}var ra=Ao(!0),Mo=Ao(!1),vl=z(null),zl=null;function ee(t){var l=t.alternate;R(zt,zt.current&1),R(vl,t),zl===null&&(l===null||ia.current!==null||l.memoizedState!==null)&&(zl=t)}function zo(t){if(t.tag===22){if(R(zt,zt.current),R(vl,t),zl===null){var l=t.alternate;l!==null&&l.memoizedState!==null&&(zl=t)}}else ae()}function ae(){R(zt,zt.current),R(vl,vl.current)}function Cl(t){B(vl),zl===t&&(zl=null),B(zt)}var zt=z(0);function dn(t){for(var l=t;l!==null;){if(l.tag===13){var e=l.memoizedState;if(e!==null&&(e=e.dehydrated,e===null||e.data==="$?"||$c(e)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break;for(;l.sibling===null;){if(l.return===null||l.return===t)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function cc(t,l,e,a){l=t.memoizedState,e=e(a,l),e=e==null?l:U({},l,e),t.memoizedState=e,t.lanes===0&&(t.updateQueue.baseState=e)}var fc={enqueueSetState:function(t,l,e){t=t._reactInternals;var a=fl(),u=Pl(a);u.payload=l,e!=null&&(u.callback=e),l=te(t,u,a),l!==null&&(sl(l,t,a),ka(l,t,a))},enqueueReplaceState:function(t,l,e){t=t._reactInternals;var a=fl(),u=Pl(a);u.tag=1,u.payload=l,e!=null&&(u.callback=e),l=te(t,u,a),l!==null&&(sl(l,t,a),ka(l,t,a))},enqueueForceUpdate:function(t,l){t=t._reactInternals;var e=fl(),a=Pl(e);a.tag=2,l!=null&&(a.callback=l),l=te(t,a,e),l!==null&&(sl(l,t,e),ka(l,t,e))}};function Do(t,l,e,a,u,n,i){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,n,i):l.prototype&&l.prototype.isPureReactComponent?!ja(e,a)||!ja(u,n):!0}function Oo(t,l,e,a){t=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(e,a),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(e,a),l.state!==t&&fc.enqueueReplaceState(l,l.state,null)}function xe(t,l){var e=l;if("ref"in l){e={};for(var a in l)a!=="ref"&&(e[a]=l[a])}if(t=t.defaultProps){e===l&&(e=U({},e));for(var u in t)e[u]===void 0&&(e[u]=t[u])}return e}var yn=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Uo(t){yn(t)}function Ro(t){console.error(t)}function No(t){yn(t)}function mn(t,l){try{var e=t.onUncaughtError;e(l.value,{componentStack:l.stack})}catch(a){setTimeout(function(){throw a})}}function qo(t,l,e){try{var a=t.onCaughtError;a(e.value,{componentStack:e.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function sc(t,l,e){return e=Pl(e),e.tag=3,e.payload={element:null},e.callback=function(){mn(t,l)},e}function Ho(t){return t=Pl(t),t.tag=3,t}function Bo(t,l,e,a){var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var n=a.value;t.payload=function(){return u(n)},t.callback=function(){qo(l,e,a)}}var i=e.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){qo(l,e,a),typeof u!="function"&&(se===null?se=new Set([this]):se.add(this));var c=a.stack;this.componentDidCatch(a.value,{componentStack:c!==null?c:""})})}function iy(t,l,e,a,u){if(e.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(l=e.alternate,l!==null&&Za(l,e,u,!0),e=vl.current,e!==null){switch(e.tag){case 13:return zl===null?Hc():e.alternate===null&>===0&&(gt=3),e.flags&=-257,e.flags|=65536,e.lanes=u,a===ji?e.flags|=16384:(l=e.updateQueue,l===null?e.updateQueue=new Set([a]):l.add(a),xc(t,a,u)),!1;case 22:return e.flags|=65536,a===ji?e.flags|=16384:(l=e.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([a])},e.updateQueue=l):(e=l.retryQueue,e===null?l.retryQueue=new Set([a]):e.add(a)),xc(t,a,u)),!1}throw Error(s(435,e.tag))}return xc(t,a,u),Hc(),!1}if(et)return l=vl.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=u,a!==Ni&&(t=Error(s(422),{cause:a}),Qa(dl(t,e)))):(a!==Ni&&(l=Error(s(423),{cause:a}),Qa(dl(l,e))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,a=dl(a,e),u=sc(t.stateNode,a,u),Xi(t,u),gt!==4&&(gt=2)),!1;var n=Error(s(520),{cause:a});if(n=dl(n,e),su===null?su=[n]:su.push(n),gt!==4&&(gt=2),l===null)return!0;a=dl(a,e),e=l;do{switch(e.tag){case 3:return e.flags|=65536,t=u&-u,e.lanes|=t,t=sc(e.stateNode,a,t),Xi(e,t),!1;case 1:if(l=e.type,n=e.stateNode,(e.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(se===null||!se.has(n))))return e.flags|=65536,u&=-u,e.lanes|=u,u=Ho(u),Bo(u,t,e,a),Xi(e,u),!1}e=e.return}while(e!==null);return!1}var xo=Error(s(461)),Ut=!1;function Ht(t,l,e,a){l.child=t===null?Mo(l,null,e,a):ra(l,t.child,e,a)}function wo(t,l,e,a,u){e=e.render;var n=l.ref;if("ref"in a){var i={};for(var c in a)c!=="ref"&&(i[c]=a[c])}else i=a;return qe(l),a=Ki(t,l,e,i,n,u),c=Ji(),t!==null&&!Ut?(ki(t,l,u),Xl(t,l,u)):(et&&c&&Ui(l),l.flags|=1,Ht(t,l,a,u),l.child)}function Yo(t,l,e,a,u){if(t===null){var n=e.type;return typeof n=="function"&&!zi(n)&&n.defaultProps===void 0&&e.compare===null?(l.tag=15,l.type=n,jo(t,l,n,a,u)):(t=Ku(e.type,null,a,l,l.mode,u),t.ref=l.ref,t.return=l,l.child=t)}if(n=t.child,!bc(t,u)){var i=n.memoizedProps;if(e=e.compare,e=e!==null?e:ja,e(i,a)&&t.ref===l.ref)return Xl(t,l,u)}return l.flags|=1,t=Bl(n,a),t.ref=l.ref,t.return=l,l.child=t}function jo(t,l,e,a,u){if(t!==null){var n=t.memoizedProps;if(ja(n,a)&&t.ref===l.ref)if(Ut=!1,l.pendingProps=a=n,bc(t,u))(t.flags&131072)!==0&&(Ut=!0);else return l.lanes=t.lanes,Xl(t,l,u)}return oc(t,l,e,a,u)}function Go(t,l,e){var a=l.pendingProps,u=a.children,n=t!==null?t.memoizedState:null;if(a.mode==="hidden"){if((l.flags&128)!==0){if(a=n!==null?n.baseLanes|e:e,t!==null){for(u=l.child=t.child,n=0;u!==null;)n=n|u.lanes|u.childLanes,u=u.sibling;l.childLanes=n&~a}else l.childLanes=0,l.child=null;return Co(t,l,a,e)}if((e&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},t!==null&&Fu(l,n!==null?n.cachePool:null),n!==null?Ys(l,n):Zi(),zo(l);else return l.lanes=l.childLanes=536870912,Co(t,l,n!==null?n.baseLanes|e:e,e)}else n!==null?(Fu(l,n.cachePool),Ys(l,n),ae(),l.memoizedState=null):(t!==null&&Fu(l,null),Zi(),ae());return Ht(t,l,u,e),l.child}function Co(t,l,e,a){var u=Yi();return u=u===null?null:{parent:Mt._currentValue,pool:u},l.memoizedState={baseLanes:e,cachePool:u},t!==null&&Fu(l,null),Zi(),zo(l),t!==null&&Za(t,l,a,!0),null}function hn(t,l){var e=l.ref;if(e===null)t!==null&&t.ref!==null&&(l.flags|=4194816);else{if(typeof e!="function"&&typeof e!="object")throw Error(s(284));(t===null||t.ref!==e)&&(l.flags|=4194816)}}function oc(t,l,e,a,u){return qe(l),e=Ki(t,l,e,a,void 0,u),a=Ji(),t!==null&&!Ut?(ki(t,l,u),Xl(t,l,u)):(et&&a&&Ui(l),l.flags|=1,Ht(t,l,e,u),l.child)}function Xo(t,l,e,a,u,n){return qe(l),l.updateQueue=null,e=Gs(l,a,e,u),js(t),a=Ji(),t!==null&&!Ut?(ki(t,l,n),Xl(t,l,n)):(et&&a&&Ui(l),l.flags|=1,Ht(t,l,e,n),l.child)}function Qo(t,l,e,a,u){if(qe(l),l.stateNode===null){var n=la,i=e.contextType;typeof i=="object"&&i!==null&&(n=Zt(i)),n=new e(a,n),l.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=fc,l.stateNode=n,n._reactInternals=l,n=l.stateNode,n.props=a,n.state=l.memoizedState,n.refs={},Gi(l),i=e.contextType,n.context=typeof i=="object"&&i!==null?Zt(i):la,n.state=l.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(cc(l,e,i,a),n.state=l.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(i=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),i!==n.state&&fc.enqueueReplaceState(n,n.state,null),$a(l,a,n,u),Wa(),n.state=l.memoizedState),typeof n.componentDidMount=="function"&&(l.flags|=4194308),a=!0}else if(t===null){n=l.stateNode;var c=l.memoizedProps,o=xe(e,c);n.props=o;var b=n.context,p=e.contextType;i=la,typeof p=="object"&&p!==null&&(i=Zt(p));var M=e.getDerivedStateFromProps;p=typeof M=="function"||typeof n.getSnapshotBeforeUpdate=="function",c=l.pendingProps!==c,p||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(c||b!==i)&&Oo(l,n,a,i),Il=!1;var _=l.memoizedState;n.state=_,$a(l,a,n,u),Wa(),b=l.memoizedState,c||_!==b||Il?(typeof M=="function"&&(cc(l,e,M,a),b=l.memoizedState),(o=Il||Do(l,e,o,a,_,b,i))?(p||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(l.flags|=4194308)):(typeof n.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=a,l.memoizedState=b),n.props=a,n.state=b,n.context=i,a=o):(typeof n.componentDidMount=="function"&&(l.flags|=4194308),a=!1)}else{n=l.stateNode,Ci(t,l),i=l.memoizedProps,p=xe(e,i),n.props=p,M=l.pendingProps,_=n.context,b=e.contextType,o=la,typeof b=="object"&&b!==null&&(o=Zt(b)),c=e.getDerivedStateFromProps,(b=typeof c=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(i!==M||_!==o)&&Oo(l,n,a,o),Il=!1,_=l.memoizedState,n.state=_,$a(l,a,n,u),Wa();var g=l.memoizedState;i!==M||_!==g||Il||t!==null&&t.dependencies!==null&&Wu(t.dependencies)?(typeof c=="function"&&(cc(l,e,c,a),g=l.memoizedState),(p=Il||Do(l,e,p,a,_,g,o)||t!==null&&t.dependencies!==null&&Wu(t.dependencies))?(b||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(a,g,o),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(a,g,o)),typeof n.componentDidUpdate=="function"&&(l.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof n.componentDidUpdate!="function"||i===t.memoizedProps&&_===t.memoizedState||(l.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&_===t.memoizedState||(l.flags|=1024),l.memoizedProps=a,l.memoizedState=g),n.props=a,n.state=g,n.context=o,a=p):(typeof n.componentDidUpdate!="function"||i===t.memoizedProps&&_===t.memoizedState||(l.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&_===t.memoizedState||(l.flags|=1024),a=!1)}return n=a,hn(t,l),a=(l.flags&128)!==0,n||a?(n=l.stateNode,e=a&&typeof e.getDerivedStateFromError!="function"?null:n.render(),l.flags|=1,t!==null&&a?(l.child=ra(l,t.child,null,u),l.child=ra(l,null,e,u)):Ht(t,l,e,u),l.memoizedState=n.state,t=l.child):t=Xl(t,l,u),t}function Zo(t,l,e,a){return Xa(),l.flags|=256,Ht(t,l,e,a),l.child}var rc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function dc(t){return{baseLanes:t,cachePool:Us()}}function yc(t,l,e){return t=t!==null?t.childLanes&~e:0,l&&(t|=bl),t}function Lo(t,l,e){var a=l.pendingProps,u=!1,n=(l.flags&128)!==0,i;if((i=n)||(i=t!==null&&t.memoizedState===null?!1:(zt.current&2)!==0),i&&(u=!0,l.flags&=-129),i=(l.flags&32)!==0,l.flags&=-33,t===null){if(et){if(u?ee(l):ae(),et){var c=_t,o;if(o=c){t:{for(o=c,c=Ml;o.nodeType!==8;){if(!c){c=null;break t}if(o=pl(o.nextSibling),o===null){c=null;break t}}c=o}c!==null?(l.memoizedState={dehydrated:c,treeContext:De!==null?{id:xl,overflow:wl}:null,retryLane:536870912,hydrationErrors:null},o=ul(18,null,null,0),o.stateNode=c,o.return=l,l.child=o,Kt=l,_t=null,o=!0):o=!1}o||Re(l)}if(c=l.memoizedState,c!==null&&(c=c.dehydrated,c!==null))return $c(c)?l.lanes=32:l.lanes=536870912,null;Cl(l)}return c=a.children,a=a.fallback,u?(ae(),u=l.mode,c=vn({mode:"hidden",children:c},u),a=ze(a,u,e,null),c.return=l,a.return=l,c.sibling=a,l.child=c,u=l.child,u.memoizedState=dc(e),u.childLanes=yc(t,i,e),l.memoizedState=rc,a):(ee(l),mc(l,c))}if(o=t.memoizedState,o!==null&&(c=o.dehydrated,c!==null)){if(n)l.flags&256?(ee(l),l.flags&=-257,l=hc(t,l,e)):l.memoizedState!==null?(ae(),l.child=t.child,l.flags|=128,l=null):(ae(),u=a.fallback,c=l.mode,a=vn({mode:"visible",children:a.children},c),u=ze(u,c,e,null),u.flags|=2,a.return=l,u.return=l,a.sibling=u,l.child=a,ra(l,t.child,null,e),a=l.child,a.memoizedState=dc(e),a.childLanes=yc(t,i,e),l.memoizedState=rc,l=u);else if(ee(l),$c(c)){if(i=c.nextSibling&&c.nextSibling.dataset,i)var b=i.dgst;i=b,a=Error(s(419)),a.stack="",a.digest=i,Qa({value:a,source:null,stack:null}),l=hc(t,l,e)}else if(Ut||Za(t,l,e,!1),i=(e&t.childLanes)!==0,Ut||i){if(i=yt,i!==null&&(a=e&-e,a=(a&42)!==0?1:Fn(a),a=(a&(i.suspendedLanes|e))!==0?0:a,a!==0&&a!==o.retryLane))throw o.retryLane=a,ta(t,a),sl(i,t,a),xo;c.data==="$?"||Hc(),l=hc(t,l,e)}else c.data==="$?"?(l.flags|=192,l.child=t.child,l=null):(t=o.treeContext,_t=pl(c.nextSibling),Kt=l,et=!0,Ue=null,Ml=!1,t!==null&&(ml[hl++]=xl,ml[hl++]=wl,ml[hl++]=De,xl=t.id,wl=t.overflow,De=l),l=mc(l,a.children),l.flags|=4096);return l}return u?(ae(),u=a.fallback,c=l.mode,o=t.child,b=o.sibling,a=Bl(o,{mode:"hidden",children:a.children}),a.subtreeFlags=o.subtreeFlags&65011712,b!==null?u=Bl(b,u):(u=ze(u,c,e,null),u.flags|=2),u.return=l,a.return=l,a.sibling=u,l.child=a,a=u,u=l.child,c=t.child.memoizedState,c===null?c=dc(e):(o=c.cachePool,o!==null?(b=Mt._currentValue,o=o.parent!==b?{parent:b,pool:b}:o):o=Us(),c={baseLanes:c.baseLanes|e,cachePool:o}),u.memoizedState=c,u.childLanes=yc(t,i,e),l.memoizedState=rc,a):(ee(l),e=t.child,t=e.sibling,e=Bl(e,{mode:"visible",children:a.children}),e.return=l,e.sibling=null,t!==null&&(i=l.deletions,i===null?(l.deletions=[t],l.flags|=16):i.push(t)),l.child=e,l.memoizedState=null,e)}function mc(t,l){return l=vn({mode:"visible",children:l},t.mode),l.return=t,t.child=l}function vn(t,l){return t=ul(22,t,null,l),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function hc(t,l,e){return ra(l,t.child,null,e),t=mc(l,l.pendingProps.children),t.flags|=2,l.memoizedState=null,t}function Vo(t,l,e){t.lanes|=l;var a=t.alternate;a!==null&&(a.lanes|=l),Hi(t.return,l,e)}function vc(t,l,e,a,u){var n=t.memoizedState;n===null?t.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:a,tail:e,tailMode:u}:(n.isBackwards=l,n.rendering=null,n.renderingStartTime=0,n.last=a,n.tail=e,n.tailMode=u)}function Ko(t,l,e){var a=l.pendingProps,u=a.revealOrder,n=a.tail;if(Ht(t,l,a.children,e),a=zt.current,(a&2)!==0)a=a&1|2,l.flags|=128;else{if(t!==null&&(t.flags&128)!==0)t:for(t=l.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Vo(t,e,l);else if(t.tag===19)Vo(t,e,l);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===l)break t;for(;t.sibling===null;){if(t.return===null||t.return===l)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}a&=1}switch(R(zt,a),u){case"forwards":for(e=l.child,u=null;e!==null;)t=e.alternate,t!==null&&dn(t)===null&&(u=e),e=e.sibling;e=u,e===null?(u=l.child,l.child=null):(u=e.sibling,e.sibling=null),vc(l,!1,u,e,n);break;case"backwards":for(e=null,u=l.child,l.child=null;u!==null;){if(t=u.alternate,t!==null&&dn(t)===null){l.child=u;break}t=u.sibling,u.sibling=e,e=u,u=t}vc(l,!0,e,null,n);break;case"together":vc(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Xl(t,l,e){if(t!==null&&(l.dependencies=t.dependencies),fe|=l.lanes,(e&l.childLanes)===0)if(t!==null){if(Za(t,l,e,!1),(e&l.childLanes)===0)return null}else return null;if(t!==null&&l.child!==t.child)throw Error(s(153));if(l.child!==null){for(t=l.child,e=Bl(t,t.pendingProps),l.child=e,e.return=l;t.sibling!==null;)t=t.sibling,e=e.sibling=Bl(t,t.pendingProps),e.return=l;e.sibling=null}return l.child}function bc(t,l){return(t.lanes&l)!==0?!0:(t=t.dependencies,!!(t!==null&&Wu(t)))}function cy(t,l,e){switch(l.tag){case 3:ht(l,l.stateNode.containerInfo),Fl(l,Mt,t.memoizedState.cache),Xa();break;case 27:case 5:Kn(l);break;case 4:ht(l,l.stateNode.containerInfo);break;case 10:Fl(l,l.type,l.memoizedProps.value);break;case 13:var a=l.memoizedState;if(a!==null)return a.dehydrated!==null?(ee(l),l.flags|=128,null):(e&l.child.childLanes)!==0?Lo(t,l,e):(ee(l),t=Xl(t,l,e),t!==null?t.sibling:null);ee(l);break;case 19:var u=(t.flags&128)!==0;if(a=(e&l.childLanes)!==0,a||(Za(t,l,e,!1),a=(e&l.childLanes)!==0),u){if(a)return Ko(t,l,e);l.flags|=128}if(u=l.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),R(zt,zt.current),a)break;return null;case 22:case 23:return l.lanes=0,Go(t,l,e);case 24:Fl(l,Mt,t.memoizedState.cache)}return Xl(t,l,e)}function Jo(t,l,e){if(t!==null)if(t.memoizedProps!==l.pendingProps)Ut=!0;else{if(!bc(t,e)&&(l.flags&128)===0)return Ut=!1,cy(t,l,e);Ut=(t.flags&131072)!==0}else Ut=!1,et&&(l.flags&1048576)!==0&&Ts(l,ku,l.index);switch(l.lanes=0,l.tag){case 16:t:{t=l.pendingProps;var a=l.elementType,u=a._init;if(a=u(a._payload),l.type=a,typeof a=="function")zi(a)?(t=xe(a,t),l.tag=1,l=Qo(null,l,a,t,e)):(l.tag=0,l=oc(null,l,a,t,e));else{if(a!=null){if(u=a.$$typeof,u===jt){l.tag=11,l=wo(null,l,a,t,e);break t}else if(u===Gt){l.tag=14,l=Yo(null,l,a,t,e);break t}}throw l=Se(a)||a,Error(s(306,l,""))}}return l;case 0:return oc(t,l,l.type,l.pendingProps,e);case 1:return a=l.type,u=xe(a,l.pendingProps),Qo(t,l,a,u,e);case 3:t:{if(ht(l,l.stateNode.containerInfo),t===null)throw Error(s(387));a=l.pendingProps;var n=l.memoizedState;u=n.element,Ci(t,l),$a(l,a,null,e);var i=l.memoizedState;if(a=i.cache,Fl(l,Mt,a),a!==n.cache&&Bi(l,[Mt],e,!0),Wa(),a=i.element,n.isDehydrated)if(n={element:a,isDehydrated:!1,cache:i.cache},l.updateQueue.baseState=n,l.memoizedState=n,l.flags&256){l=Zo(t,l,a,e);break t}else if(a!==u){u=dl(Error(s(424)),l),Qa(u),l=Zo(t,l,a,e);break t}else{switch(t=l.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(_t=pl(t.firstChild),Kt=l,et=!0,Ue=null,Ml=!0,e=Mo(l,null,a,e),l.child=e;e;)e.flags=e.flags&-3|4096,e=e.sibling}else{if(Xa(),a===u){l=Xl(t,l,e);break t}Ht(t,l,a,e)}l=l.child}return l;case 26:return hn(t,l),t===null?(e=F0(l.type,null,l.pendingProps,null))?l.memoizedState=e:et||(e=l.type,t=l.pendingProps,a=Rn(Q.current).createElement(e),a[Qt]=l,a[kt]=t,xt(a,e,t),Ot(a),l.stateNode=a):l.memoizedState=F0(l.type,t.memoizedProps,l.pendingProps,t.memoizedState),null;case 27:return Kn(l),t===null&&et&&(a=l.stateNode=k0(l.type,l.pendingProps,Q.current),Kt=l,Ml=!0,u=_t,de(l.type)?(Fc=u,_t=pl(a.firstChild)):_t=u),Ht(t,l,l.pendingProps.children,e),hn(t,l),t===null&&(l.flags|=4194304),l.child;case 5:return t===null&&et&&((u=a=_t)&&(a=xy(a,l.type,l.pendingProps,Ml),a!==null?(l.stateNode=a,Kt=l,_t=pl(a.firstChild),Ml=!1,u=!0):u=!1),u||Re(l)),Kn(l),u=l.type,n=l.pendingProps,i=t!==null?t.memoizedProps:null,a=n.children,Jc(u,n)?a=null:i!==null&&Jc(u,i)&&(l.flags|=32),l.memoizedState!==null&&(u=Ki(t,l,Pd,null,null,e),_u._currentValue=u),hn(t,l),Ht(t,l,a,e),l.child;case 6:return t===null&&et&&((t=e=_t)&&(e=wy(e,l.pendingProps,Ml),e!==null?(l.stateNode=e,Kt=l,_t=null,t=!0):t=!1),t||Re(l)),null;case 13:return Lo(t,l,e);case 4:return ht(l,l.stateNode.containerInfo),a=l.pendingProps,t===null?l.child=ra(l,null,a,e):Ht(t,l,a,e),l.child;case 11:return wo(t,l,l.type,l.pendingProps,e);case 7:return Ht(t,l,l.pendingProps,e),l.child;case 8:return Ht(t,l,l.pendingProps.children,e),l.child;case 12:return Ht(t,l,l.pendingProps.children,e),l.child;case 10:return a=l.pendingProps,Fl(l,l.type,a.value),Ht(t,l,a.children,e),l.child;case 9:return u=l.type._context,a=l.pendingProps.children,qe(l),u=Zt(u),a=a(u),l.flags|=1,Ht(t,l,a,e),l.child;case 14:return Yo(t,l,l.type,l.pendingProps,e);case 15:return jo(t,l,l.type,l.pendingProps,e);case 19:return Ko(t,l,e);case 31:return a=l.pendingProps,e=l.mode,a={mode:a.mode,children:a.children},t===null?(e=vn(a,e),e.ref=l.ref,l.child=e,e.return=l,l=e):(e=Bl(t.child,a),e.ref=l.ref,l.child=e,e.return=l,l=e),l;case 22:return Go(t,l,e);case 24:return qe(l),a=Zt(Mt),t===null?(u=Yi(),u===null&&(u=yt,n=xi(),u.pooledCache=n,n.refCount++,n!==null&&(u.pooledCacheLanes|=e),u=n),l.memoizedState={parent:a,cache:u},Gi(l),Fl(l,Mt,u)):((t.lanes&e)!==0&&(Ci(t,l),$a(l,null,null,e),Wa()),u=t.memoizedState,n=l.memoizedState,u.parent!==a?(u={parent:a,cache:a},l.memoizedState=u,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=u),Fl(l,Mt,a)):(a=n.cache,Fl(l,Mt,a),a!==u.cache&&Bi(l,[Mt],e,!0))),Ht(t,l,l.pendingProps.children,e),l.child;case 29:throw l.pendingProps}throw Error(s(156,l.tag))}function Ql(t){t.flags|=4}function ko(t,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!er(l)){if(l=vl.current,l!==null&&((I&4194048)===I?zl!==null:(I&62914560)!==I&&(I&536870912)===0||l!==zl))throw Ja=ji,Rs;t.flags|=8192}}function bn(t,l){l!==null&&(t.flags|=4),t.flags&16384&&(l=t.tag!==22?Mf():536870912,t.lanes|=l,ha|=l)}function au(t,l){if(!et)switch(t.tailMode){case"hidden":l=t.tail;for(var e=null;l!==null;)l.alternate!==null&&(e=l),l=l.sibling;e===null?t.tail=null:e.sibling=null;break;case"collapsed":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?l||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function bt(t){var l=t.alternate!==null&&t.alternate.child===t.child,e=0,a=0;if(l)for(var u=t.child;u!==null;)e|=u.lanes|u.childLanes,a|=u.subtreeFlags&65011712,a|=u.flags&65011712,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)e|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=a,t.childLanes=e,l}function fy(t,l,e){var a=l.pendingProps;switch(Ri(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(l),null;case 1:return bt(l),null;case 3:return e=l.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),l.memoizedState.cache!==a&&(l.flags|=2048),jl(Mt),Jl(),e.pendingContext&&(e.context=e.pendingContext,e.pendingContext=null),(t===null||t.child===null)&&(Ca(l)?Ql(l):t===null||t.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ms())),bt(l),null;case 26:return e=l.memoizedState,t===null?(Ql(l),e!==null?(bt(l),ko(l,e)):(bt(l),l.flags&=-16777217)):e?e!==t.memoizedState?(Ql(l),bt(l),ko(l,e)):(bt(l),l.flags&=-16777217):(t.memoizedProps!==a&&Ql(l),bt(l),l.flags&=-16777217),null;case 27:Du(l),e=Q.current;var u=l.type;if(t!==null&&l.stateNode!=null)t.memoizedProps!==a&&Ql(l);else{if(!a){if(l.stateNode===null)throw Error(s(166));return bt(l),null}t=Y.current,Ca(l)?Es(l):(t=k0(u,a,e),l.stateNode=t,Ql(l))}return bt(l),null;case 5:if(Du(l),e=l.type,t!==null&&l.stateNode!=null)t.memoizedProps!==a&&Ql(l);else{if(!a){if(l.stateNode===null)throw Error(s(166));return bt(l),null}if(t=Y.current,Ca(l))Es(l);else{switch(u=Rn(Q.current),t){case 1:t=u.createElementNS("http://www.w3.org/2000/svg",e);break;case 2:t=u.createElementNS("http://www.w3.org/1998/Math/MathML",e);break;default:switch(e){case"svg":t=u.createElementNS("http://www.w3.org/2000/svg",e);break;case"math":t=u.createElementNS("http://www.w3.org/1998/Math/MathML",e);break;case"script":t=u.createElement("div"),t.innerHTML=" FlowLens - - + +
diff --git a/test/e2e/stage4-demo.spec.ts b/test/e2e/stage4-demo.spec.ts index 958ef10..72fb754 100644 --- a/test/e2e/stage4-demo.spec.ts +++ b/test/e2e/stage4-demo.spec.ts @@ -18,7 +18,9 @@ test("offline Demo exposes one rich responsive statistics dashboard", async ({ "data-source-mode", "demo", ); - await expect(page.getByText("FlowLens")).toBeVisible(); + await expect( + page.getByRole("link", { name: "FlowLens GitHub 仓库" }), + ).toBeVisible(); await expect(page.getByText("采集正常")).toBeVisible(); await expect(page.locator(".live-status.ok i")).toHaveCSS( "animation-name", diff --git a/test/e2e/stage4-production-csp.spec.ts b/test/e2e/stage4-production-csp.spec.ts index 58d04b1..d5fe965 100644 --- a/test/e2e/stage4-production-csp.spec.ts +++ b/test/e2e/stage4-production-csp.spec.ts @@ -74,6 +74,21 @@ test("production bundle works with the shipped CSP and named SSE events", async "app", ); await expect(page.getByRole("heading", { name: "实时吞吐" })).toBeVisible(); + const footer = page.locator("footer.app-footer"); + await expect(footer.getByText("© 2026")).toBeVisible(); + await expect(footer.getByRole("link", { name: "FlowLens" })).toHaveAttribute( + "href", + "https://github.com/Willxup/flowlens", + ); + await expect(footer.getByRole("link", { name: "License" })).toHaveAttribute( + "href", + "https://github.com/Willxup/flowlens/blob/main/LICENSE", + ); + await expect( + footer.getByRole("link", { name: "Willxup GitHub 主页" }), + ).toHaveAttribute("href", "https://github.com/Willxup"); + await expect(footer.getByText("Version: v0.2.5")).toBeVisible(); + await expect(footer.locator(".app-footer-version-separator")).toBeHidden(); await expect.poll(() => apiRequests).toContain("/api/v1/connections/live"); await expect( page.getByText("Fixture · 198.51.100.20:443").first(), @@ -127,6 +142,7 @@ function fixtureResponse(path: string): unknown { status: "ok", reason: "ready", timezone: "UTC", + version: "v0.2.5", auth_enabled: true, capabilities: { connection_id: true, diff --git a/web/src/api/contracts.ts b/web/src/api/contracts.ts index 349615e..9f3ba39 100644 --- a/web/src/api/contracts.ts +++ b/web/src/api/contracts.ts @@ -32,6 +32,7 @@ export interface StatusResponse { status: ServiceLevel; reason: string; timezone: string; + version: string; auth_enabled: boolean; capabilities: Capabilities; } diff --git a/web/src/api/production.ts b/web/src/api/production.ts index 01604a9..5050ae7 100644 --- a/web/src/api/production.ts +++ b/web/src/api/production.ts @@ -328,6 +328,7 @@ function validResponse(value: unknown, shape: string | undefined): boolean { typeof value.status === "string" && typeof value.reason === "string" && typeof value.timezone === "string" && + typeof value.version === "string" && typeof value.auth_enabled === "boolean" && isRecord(value.capabilities) ); diff --git a/web/src/api/test/production.test.ts b/web/src/api/test/production.test.ts index fdf6b49..fc59d62 100644 --- a/web/src/api/test/production.test.ts +++ b/web/src/api/test/production.test.ts @@ -104,6 +104,25 @@ describe("ProductionDataSource", () => { status: "ok", reason: "ready", timezone: "Asia/Shanghai", + version: "v0.2.5", + capabilities: {}, + }), + ) as typeof fetch, + ); + + await expect(source.status()).rejects.toThrow( + "FlowLens response is invalid", + ); + }); + + it("requires the injected build version in status responses", async () => { + const source = new ProductionDataSource( + vi.fn(async () => + Response.json({ + status: "ok", + reason: "ready", + timezone: "Asia/Shanghai", + auth_enabled: true, capabilities: {}, }), ) as typeof fetch, diff --git a/web/src/app/Shell.tsx b/web/src/app/Shell.tsx index b2a905c..3635031 100644 --- a/web/src/app/Shell.tsx +++ b/web/src/app/Shell.tsx @@ -1,10 +1,12 @@ import type { ReactNode } from "react"; import type { ServiceLevel } from "../api/contracts"; +import { AppFooter } from "../components/AppFooter"; import { Tooltip } from "../components/Tooltip"; import { ThemeSelect } from "../features/theme/ThemeSelect"; export function Shell({ status, + version, sourceMode, authEnabled, onLogout, @@ -12,6 +14,7 @@ export function Shell({ children, }: { status: ServiceLevel; + version: string; sourceMode: "app" | "demo"; authEnabled: boolean; onLogout: () => void; @@ -63,6 +66,7 @@ export function Shell({ {children} + ); } diff --git a/web/src/components/AppFooter.tsx b/web/src/components/AppFooter.tsx new file mode 100644 index 0000000..709e34e --- /dev/null +++ b/web/src/components/AppFooter.tsx @@ -0,0 +1,70 @@ +const REPOSITORY_URL = "https://github.com/Willxup/flowlens"; +const PROFILE_URL = "https://github.com/Willxup"; + +export function footerVersionLabel(version?: string): string | undefined { + const trimmed = version?.trim(); + return trimmed ? `Version: ${trimmed}` : undefined; +} + +export function AppFooter({ version }: { version?: string }) { + const versionLabel = footerVersionLabel(version); + + return ( + + ); +} + +function GitHubIcon() { + return ( + + ); +} diff --git a/web/src/components/test/AppFooter.test.tsx b/web/src/components/test/AppFooter.test.tsx new file mode 100644 index 0000000..2c1fa5b --- /dev/null +++ b/web/src/components/test/AppFooter.test.tsx @@ -0,0 +1,32 @@ +import { render, screen } from "@testing-library/react"; +import { AppFooter, footerVersionLabel } from "../AppFooter"; + +describe("AppFooter", () => { + it("renders the project, license, author, and injected version links", () => { + render(); + + expect(screen.getByText("© 2026")).toBeInTheDocument(); + expect(screen.getByRole("link", { name: "FlowLens" })).toHaveAttribute( + "href", + "https://github.com/Willxup/flowlens", + ); + expect(screen.getByRole("link", { name: "License" })).toHaveAttribute( + "href", + "https://github.com/Willxup/flowlens/blob/main/LICENSE", + ); + expect( + screen.getByRole("link", { name: "Willxup GitHub 主页" }), + ).toHaveAttribute("href", "https://github.com/Willxup"); + expect(screen.getByText("Powered By")).toBeInTheDocument(); + expect(screen.getByText("Version: v0.2.5")).toBeInTheDocument(); + }); + + it("omits the version label until a non-empty build version is available", () => { + const { rerender } = render(); + expect(screen.queryByText(/Version:/)).not.toBeInTheDocument(); + + rerender(); + expect(screen.queryByText(/Version:/)).not.toBeInTheDocument(); + expect(footerVersionLabel(" v0.2.5 ")).toBe("Version: v0.2.5"); + }); +}); diff --git a/web/src/demo/fixture.json b/web/src/demo/fixture.json index a10f31a..8f4225a 100644 --- a/web/src/demo/fixture.json +++ b/web/src/demo/fixture.json @@ -4,6 +4,7 @@ "status": "ok", "reason": "ready", "timezone": "Asia/Shanghai", + "version": "v0.2.5", "auth_enabled": true, "capabilities": { "connection_id": true, diff --git a/web/src/features/dashboard/DashboardPage.tsx b/web/src/features/dashboard/DashboardPage.tsx index 8c3ae6c..22a5771 100644 --- a/web/src/features/dashboard/DashboardPage.tsx +++ b/web/src/features/dashboard/DashboardPage.tsx @@ -33,6 +33,7 @@ const initialStatus: StatusResponse = { status: "degraded", reason: "starting", timezone: "UTC", + version: "", auth_enabled: false, capabilities: { connection_id: false, @@ -159,6 +160,7 @@ export function DashboardPage({ return ( void logout()} diff --git a/web/src/features/dashboard/test/DashboardPage.test.tsx b/web/src/features/dashboard/test/DashboardPage.test.tsx index 3a13268..4999ef7 100644 --- a/web/src/features/dashboard/test/DashboardPage.test.tsx +++ b/web/src/features/dashboard/test/DashboardPage.test.tsx @@ -53,11 +53,24 @@ describe("DashboardPage", () => { render( , ); - expect(await screen.findByText("FlowLens")).toBeInTheDocument(); - expect( - screen.getByRole("link", { name: "FlowLens GitHub 仓库" }), - ).toHaveAttribute("href", "https://github.com/Willxup/flowlens"); + const brand = await screen.findByRole("link", { + name: "FlowLens GitHub 仓库", + }); + expect(brand).toHaveTextContent("FlowLens"); + expect(brand).toHaveAttribute( + "href", + "https://github.com/Willxup/flowlens", + ); expect(screen.getByText("采集正常")).toBeInTheDocument(); + expect(await screen.findByText("© 2026")).toBeInTheDocument(); + expect(screen.getByRole("link", { name: "License" })).toHaveAttribute( + "href", + "https://github.com/Willxup/flowlens/blob/main/LICENSE", + ); + expect( + screen.getByRole("link", { name: "Willxup GitHub 主页" }), + ).toHaveAttribute("href", "https://github.com/Willxup"); + expect(await screen.findByText("Version: v0.2.5")).toBeInTheDocument(); expect( screen.getByRole("button", { name: "跟随系统" }), ).toBeInTheDocument(); diff --git a/web/src/features/live/test/model.test.ts b/web/src/features/live/test/model.test.ts index 1609d1a..b727fd1 100644 --- a/web/src/features/live/test/model.test.ts +++ b/web/src/features/live/test/model.test.ts @@ -9,6 +9,7 @@ const status: StatusResponse = { status: "ok", reason: "ready", timezone: "UTC", + version: "v0.2.5", auth_enabled: true, capabilities: { connection_id: true, diff --git a/web/src/styles/layout.css b/web/src/styles/layout.css index 7b56a34..4aa3dc0 100644 --- a/web/src/styles/layout.css +++ b/web/src/styles/layout.css @@ -2,6 +2,46 @@ width: min(1360px, calc(100% - 48px)); margin: 20px auto 48px; } +.app-footer { + display: grid; + gap: 6px; + justify-items: center; + padding: 26px 24px 0; + color: var(--muted); + font-size: 0.68rem; + line-height: 1.5; + text-align: center; +} +.app-footer-line { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + gap: 6px; + flex-wrap: wrap; +} +.app-footer a { + display: inline-flex; + align-items: center; + gap: 4px; + border-radius: 5px; + color: inherit; + text-decoration: none; + transition: color var(--motion-fast) ease; +} +.app-footer a:hover { + color: var(--download-strong); +} +.app-footer a:focus-visible { + outline: 3px solid var(--focus-ring); + outline-offset: 3px; +} +.app-footer-powered svg { + flex: 0 0 auto; +} +.app-footer-version { + white-space: nowrap; +} .topbar { min-height: 64px; padding: 10px 12px 10px 16px; @@ -607,6 +647,20 @@ margin-top: 8px; margin-bottom: 28px; } + .app-footer { + padding: 22px 14px 0; + } + .app-footer-line { + gap: 7px; + } + .app-footer-version-separator { + display: none; + } + .app-footer-version { + display: block; + flex-basis: 100%; + text-align: center; + } .topbar { top: 6px; min-height: 60px;