@nocobase/portal-template-default 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/AGENTS.md +8 -0
  2. package/README.MD +4 -0
  3. package/dist/assets/{LineDraw-iG-ADes-.js → LineDraw-BBB5hwuJ.js} +1 -1
  4. package/dist/assets/{SymbolDraw-DXoSw1tM.js → SymbolDraw-CKS3uUb_.js} +1 -1
  5. package/dist/assets/{VisualMapping-C_ee4Eht.js → VisualMapping-BCwaW3TD.js} +1 -1
  6. package/dist/assets/auth-method-demo-BdCCvEEz.js +1 -0
  7. package/dist/assets/{auto-login-provider-5Uxza9Ms.js → auto-login-provider-DO5Il6Dp.js} +2 -2
  8. package/dist/assets/auto-login-provider-TQ08B6-i.js +1 -0
  9. package/dist/assets/auto-redirect-provider-ButXp0A3.js +1 -0
  10. package/dist/assets/auto-redirect-provider-DnGGP2Vn.js +1 -0
  11. package/dist/assets/auto-redirect-provider-ja-vFPaF.js +1 -0
  12. package/dist/assets/calendar-C7xnRgOT.js +1 -0
  13. package/dist/assets/{cas-sign-in-button-CyqG1QME.js → cas-sign-in-button-BZCa4lR6.js} +1 -1
  14. package/dist/assets/{components-D-ptYjX_.js → components-_g-GjQeV.js} +3 -3
  15. package/dist/assets/{configuration-gate-C08mkkiX.js → configuration-gate-B4XVz7tS.js} +1 -1
  16. package/dist/assets/{createClipPathFromCoordSys-wj34-b1B.js → createClipPathFromCoordSys-z9Kmh-tu.js} +1 -1
  17. package/dist/assets/createSeriesDataSimply-CPqysF0K.js +1 -0
  18. package/dist/assets/{customGraphicKeyframeAnimation-DWrhrHL_.js → customGraphicKeyframeAnimation-DMU5crAu.js} +1 -1
  19. package/dist/assets/demo-BPlae2bp.js +1 -0
  20. package/dist/assets/demo-Bj_Y0RrW.js +1 -0
  21. package/dist/assets/demo-CKPAQOib.js +1 -0
  22. package/dist/assets/demo-CXRTPvIx.js +1 -0
  23. package/dist/assets/demo-DJuVDu1n.js +1 -0
  24. package/dist/assets/demo-DUmWU7ik.js +1 -0
  25. package/dist/assets/demo-NhIzFRE1.js +1 -0
  26. package/dist/assets/{dingtalk-sign-in-button-DSWsSruv.js → dingtalk-sign-in-button-DMPgE5kT.js} +1 -1
  27. package/dist/assets/{echarts-preview-DxHNfq1C.js → echarts-preview-R96Pbqmz.js} +1 -1
  28. package/dist/assets/{echarts-runtime-D8kXn6ME.js → echarts-runtime-Ce_z2eX_.js} +3 -3
  29. package/dist/assets/{echarts-runtime-advanced-QY8v95qK.js → echarts-runtime-advanced-Dr80KHJR.js} +1 -1
  30. package/dist/assets/{echarts-runtime-common-D-yqAK-r.js → echarts-runtime-common-DB95Yfc1.js} +1 -1
  31. package/dist/assets/{echarts-runtime-components-P4-i8jPU.js → echarts-runtime-components-DCJEaTJk.js} +1 -1
  32. package/dist/assets/{echarts-runtime-hierarchy-ByQZ-DbP.js → echarts-runtime-hierarchy-CezgZs9O.js} +1 -1
  33. package/dist/assets/{floating-BFVEyPEp.js → floating-O9WmiDXk.js} +2 -2
  34. package/dist/assets/index-BBKV6O5d.css +1 -0
  35. package/dist/assets/{index-Btk35Nx-.js → index-CPzehPGe.js} +3 -3
  36. package/dist/assets/index-Cc6awvdg.js +1064 -0
  37. package/dist/assets/index-ChA0z9ke.js +38 -0
  38. package/dist/assets/{index-um5hdKdZ.js → index-DgB7uTMs.js} +2 -2
  39. package/dist/assets/{index-CwNxd66J.js → index-DroUAK80.js} +1 -1
  40. package/dist/assets/index-WKvygTBp.js +59 -0
  41. package/dist/assets/{labelHelper-DQqRy3a_.js → labelHelper-Dk5jkiD-.js} +1 -1
  42. package/dist/assets/ldap-sign-in-form-CKN4l7qM.js +1 -0
  43. package/dist/assets/{oidc-sign-in-button-CQdRcR_p.js → oidc-sign-in-button-BIRonrpC.js} +1 -1
  44. package/dist/assets/{page-context-CnQ4GYM7.js → page-context-DAiW_dId.js} +3 -3
  45. package/dist/assets/prompt-card-rGZqpqkF.js +1 -0
  46. package/dist/assets/prompt-output-B4h3uLWf.js +1 -0
  47. package/dist/assets/saml-sign-in-button-B4ugaLIb.js +1 -0
  48. package/dist/assets/{sectorHelper-DN_Vv6OL.js → sectorHelper-BuxrrJrA.js} +1 -1
  49. package/dist/assets/shortcut-BhKXxJLs.js +47 -0
  50. package/dist/assets/{sms-sign-in-form-DTX9GV2I.js → sms-sign-in-form-DKpxRDdZ.js} +1 -1
  51. package/dist/assets/{static.browser-jI1psK0d.js → static.browser-kzzpH0Xt.js} +8 -8
  52. package/dist/assets/switch-BdVxPIVU.js +1 -0
  53. package/dist/assets/{tool-cards-DFttLAfo.js → tool-cards-CpczIke-.js} +3 -3
  54. package/dist/assets/{use-authenticator-sign-in-CRGjzXju.js → use-authenticator-sign-in-CIj210ry.js} +1 -1
  55. package/dist/assets/use-dingtalk-sign-in-BW4kkXD3.js +1 -0
  56. package/dist/assets/{use-wecom-sign-in-C9j8wfCD.js → use-wecom-sign-in-dIqMtcN9.js} +1 -1
  57. package/dist/assets/wecom-sign-in-button-Dn_2zDab.js +1 -0
  58. package/dist/index.html +2 -2
  59. package/dist/index.raw.html +2 -2
  60. package/package.json +9 -1
  61. package/src/App.tsx +5 -2
  62. package/src/app/extension.ts +2 -0
  63. package/src/app/extensions.tsx +18 -6
  64. package/src/app/route-access-guard.tsx +22 -0
  65. package/src/app/route-runtime.ts +173 -0
  66. package/src/app/routes.tsx +2 -2
  67. package/src/components/app-shell/header.tsx +56 -1
  68. package/src/components/app-shell/sidebar.tsx +14 -2
  69. package/src/components/auth/sign-up-form.tsx +287 -59
  70. package/src/components/auth/types.ts +23 -1
  71. package/src/extensions/nocobase-acl/README.md +28 -14
  72. package/src/extensions/nocobase-acl/demo/index.tsx +87 -15
  73. package/src/extensions/nocobase-acl/demo/prompt-generator.tsx +1 -0
  74. package/src/extensions/nocobase-mail/README.md +74 -0
  75. package/src/extensions/nocobase-mail/components/index.ts +79 -0
  76. package/src/extensions/nocobase-mail/components/mail-api.ts +423 -0
  77. package/src/extensions/nocobase-mail/components/mail-attachment-list.tsx +67 -0
  78. package/src/extensions/nocobase-mail/components/mail-compose-attachments.tsx +166 -0
  79. package/src/extensions/nocobase-mail/components/mail-compose.tsx +1071 -0
  80. package/src/extensions/nocobase-mail/components/mail-detail.tsx +653 -0
  81. package/src/extensions/nocobase-mail/components/mail-draft-autosave.ts +26 -0
  82. package/src/extensions/nocobase-mail/components/mail-empty.tsx +48 -0
  83. package/src/extensions/nocobase-mail/components/mail-filters.tsx +277 -0
  84. package/src/extensions/nocobase-mail/components/mail-inbox.tsx +544 -0
  85. package/src/extensions/nocobase-mail/components/mail-inline-images.ts +69 -0
  86. package/src/extensions/nocobase-mail/components/mail-label-badge.tsx +25 -0
  87. package/src/extensions/nocobase-mail/components/mail-label-manager.tsx +271 -0
  88. package/src/extensions/nocobase-mail/components/mail-labels-editor.tsx +267 -0
  89. package/src/extensions/nocobase-mail/components/mail-mass-tracking.tsx +271 -0
  90. package/src/extensions/nocobase-mail/components/mail-note-editor.tsx +99 -0
  91. package/src/extensions/nocobase-mail/components/mail-recipient-input.tsx +260 -0
  92. package/src/extensions/nocobase-mail/components/mail-reply-quote.ts +28 -0
  93. package/src/extensions/nocobase-mail/components/mail-rich-editor.tsx +287 -0
  94. package/src/extensions/nocobase-mail/components/mail-send-actions.tsx +238 -0
  95. package/src/extensions/nocobase-mail/components/mail-senders.ts +61 -0
  96. package/src/extensions/nocobase-mail/components/mail-settings-drawer.tsx +708 -0
  97. package/src/extensions/nocobase-mail/components/mail-showcase-layout.tsx +64 -0
  98. package/src/extensions/nocobase-mail/components/mail-signature-manager.tsx +258 -0
  99. package/src/extensions/nocobase-mail/components/mail-signatures.ts +25 -0
  100. package/src/extensions/nocobase-mail/components/mail-table.tsx +476 -0
  101. package/src/extensions/nocobase-mail/components/mail-template-manager.tsx +204 -0
  102. package/src/extensions/nocobase-mail/components/mail-toolbar.tsx +155 -0
  103. package/src/extensions/nocobase-mail/components/mail-unread.tsx +111 -0
  104. package/src/extensions/nocobase-mail/components/types.ts +297 -0
  105. package/src/extensions/nocobase-mail/components/use-mail-compose.tsx +262 -0
  106. package/src/extensions/nocobase-mail/components/use-mail-mass-messages.ts +54 -0
  107. package/src/extensions/nocobase-mail/components/use-mail-messages.ts +113 -0
  108. package/src/extensions/nocobase-mail/components/use-mail-signatures.ts +122 -0
  109. package/src/extensions/nocobase-mail/components/use-mail-templates.ts +54 -0
  110. package/src/extensions/nocobase-mail/extension.tsx +105 -0
  111. package/src/extensions/nocobase-mail/index.ts +1 -0
  112. package/src/extensions/nocobase-mail/mail-demo-pages.tsx +503 -0
  113. package/src/extensions/nocobase-mail/mail-pages.tsx +201 -0
  114. package/src/extensions/nocobase-mail/tests/mail-quote-html-regression.mjs +51 -0
  115. package/src/extensions/nocobase-mail/tests/mail-regression.mjs +649 -0
  116. package/src/extensions/nocobase-users-example/app-routes.tsx +121 -0
  117. package/src/extensions/nocobase-users-example/extension.tsx +2 -100
  118. package/src/extensions/nocobase-users-example/index.ts +1 -0
  119. package/src/lib/nocobase/acl/menu.ts +17 -3
  120. package/src/lib/nocobase/acl/types.ts +4 -0
  121. package/src/locales/en-US.ts +2 -1
  122. package/src/locales/zh-CN.ts +2 -1
  123. package/src/providers/runtime-config.ts +18 -0
  124. package/src/routes.tsx +10 -0
  125. package/src/vite-env.d.ts +3 -0
  126. package/vite.config.ts +8 -0
  127. package/dist/assets/auth-method-demo-DaOCuvsq.js +0 -1
  128. package/dist/assets/auto-login-provider-DyaPGK2D.js +0 -1
  129. package/dist/assets/auto-redirect-provider-CfwRvYOI.js +0 -1
  130. package/dist/assets/auto-redirect-provider-Cr3jmYts.js +0 -1
  131. package/dist/assets/auto-redirect-provider-QkJQRBbG.js +0 -1
  132. package/dist/assets/calendar-DjDRfD5t.js +0 -1
  133. package/dist/assets/card-DuQBOS6A.js +0 -1
  134. package/dist/assets/createSeriesDataSimply-D0A6SAVQ.js +0 -1
  135. package/dist/assets/demo-BYWHeKUe.js +0 -1
  136. package/dist/assets/demo-CPWoNtx8.js +0 -1
  137. package/dist/assets/demo-CyvJk5zV.js +0 -1
  138. package/dist/assets/demo-D4OiKplc.js +0 -1
  139. package/dist/assets/demo-DBueJg0m.js +0 -1
  140. package/dist/assets/demo-DkIhyiRK.js +0 -1
  141. package/dist/assets/demo-tpTjO0sC.js +0 -1
  142. package/dist/assets/index-BgCbGDMc.js +0 -43
  143. package/dist/assets/index-MB-jfQld.js +0 -686
  144. package/dist/assets/index-NH3aqqQz.css +0 -1
  145. package/dist/assets/index-gFtCXH3o.js +0 -58
  146. package/dist/assets/ldap-sign-in-form--6Gt3yGq.js +0 -1
  147. package/dist/assets/prompt-card-B2RS4nt2.js +0 -1
  148. package/dist/assets/prompt-output-DZHRM2ft.js +0 -1
  149. package/dist/assets/saml-sign-in-button-BHL5a0JV.js +0 -1
  150. package/dist/assets/shortcut-C5x5LQWU.js +0 -47
  151. package/dist/assets/switch-CRL8PmRI.js +0 -1
  152. package/dist/assets/use-dingtalk-sign-in-8WYzJ2jf.js +0 -1
  153. package/dist/assets/wecom-sign-in-button-mIS1zGSU.js +0 -1
@@ -1 +1 @@
1
- import{au as ee,av as Zt,ab as xa,aw as bt,k as et,z as Ut,ax as ba,ay as Et,az as nr,aA as ve,aB as Ze,H as te,a4 as H,aC as lt,y as _,b as Ee,aD as Kr,_ as q,M as tt,N as X,K as ir,C as Ie,Z as Ae,j as fe,x as se,J as at,s as Se,t as xe,r as Xe,u as We,aE as ut,f as me,T as ge,aF as or,aG as Jr,aH as ia,S as De,aI as Qr,aJ as en,aK as oa,G as be,al as lr,aL as tn,m as we,a2 as an,ae as rn,a as qt,aM as nn,aN as Re,X as ur,aO as sr,aP as vr,aQ as cr,l as pe,aR as on,n as ln,ah as $t,aS as un,aT as jt,P as la,aU as sn,aV as vn,aW as wt,as as hr,at as ft,o as Ye,D as ze,a3 as It,aX as Ge,aY as Kt,aZ as cn,a_ as rt,a$ as wa,b0 as hn,b1 as gn,b2 as Dt,b3 as ke,b4 as gr,W as pt,b5 as Ia,b6 as dn,b7 as dr,b8 as Da,b9 as vt,ba as La,bb as fn,bc as pn,R as ua,bd as yn,be as mn,bf as fr,bg as Sn,aj as Jt,bh as pr,bi as Aa,bj as Me,bk as sa,bl as xn,bm as bn,bn as je,bo as Ta,bp as wn,bq as ue,br as Qt,bs as In,bt as Dn,bu as Ln,a1 as yr,c as An,bv as Tn,bw as Nn,bx as Na,ap as Mn,by as Ma,O as Cn,bz as En,ac as Vn,ad as _n,L as Pn,bA as kn,bB as Rn,bC as ct,bD as zn,bE as Gn}from"./echarts-runtime-D8kXn6ME.js";import{c as Lt}from"./createSeriesDataSimply-D0A6SAVQ.js";import{L as At,d as Tt}from"./LegendVisualProvider-Bdgkckq-.js";import{g as Fe,S as Ca}from"./sectorHelper-DN_Vv6OL.js";import{R as va,V as ca,u as mr,a as Sr,b as xr,L as Bn}from"./LineDraw-iG-ADes-.js";import{a as Hn,S as On}from"./SymbolDraw-DXoSw1tM.js";import{i as Fn,V as br}from"./VisualMapping-C_ee4Eht.js";import"./index-MB-jfQld.js";import"./labelHelper-DQqRy3a_.js";function wr(r,t,e,a,n,o,i,l){var u=n-r,s=o-t,v=e-r,h=a-t,c=Math.sqrt(v*v+h*h);v/=c,h/=c;var g=u*v+s*h,d=g/c;d*=c;var f=i[0]=r+d*v,p=i[1]=t+d*h;return Math.sqrt((f-n)*(f-n)+(p-o)*(p-o))}var Te=new ee,J=new ee,re=new ee,Ne=new ee,de=new ee,yt=[],oe=new ee;function Xn(r,t){if(t<=180&&t>0){t=t/180*Math.PI,Te.fromArray(r[0]),J.fromArray(r[1]),re.fromArray(r[2]),ee.sub(Ne,Te,J),ee.sub(de,re,J);var e=Ne.len(),a=de.len();if(!(e<.001||a<.001)){Ne.scale(1/e),de.scale(1/a);var n=Ne.dot(de),o=Math.cos(t);if(o<n){var i=wr(J.x,J.y,re.x,re.y,Te.x,Te.y,yt);oe.fromArray(yt),oe.scaleAndAdd(de,i/Math.tan(Math.PI-t));var l=re.x!==J.x?(oe.x-J.x)/(re.x-J.x):(oe.y-J.y)/(re.y-J.y);if(isNaN(l))return;l<0?ee.copy(oe,J):l>1&&ee.copy(oe,re),oe.toArray(r[1])}}}}function Wn(r,t,e){if(e<=180&&e>0){e=e/180*Math.PI,Te.fromArray(r[0]),J.fromArray(r[1]),re.fromArray(r[2]),ee.sub(Ne,J,Te),ee.sub(de,re,J);var a=Ne.len(),n=de.len();if(!(a<.001||n<.001)){Ne.scale(1/a),de.scale(1/n);var o=Ne.dot(t),i=Math.cos(e);if(o<i){var l=wr(J.x,J.y,re.x,re.y,Te.x,Te.y,yt);oe.fromArray(yt);var u=Math.PI/2,s=Math.acos(de.dot(t)),v=u+s-e;if(v>=u)ee.copy(oe,re);else{oe.scaleAndAdd(de,l/Math.tan(Math.PI/2-v));var h=re.x!==J.x?(oe.x-J.x)/(re.x-J.x):(oe.y-J.y)/(re.y-J.y);if(isNaN(h))return;h<0?ee.copy(oe,J):h>1&&ee.copy(oe,re)}oe.toArray(r[1])}}}}function Vt(r,t,e,a){var n=e==="normal",o=n?r:r.ensureState(e);o.ignore=t;var i=a.get("smooth");i&&i===!0&&(i=.3),o.shape=o.shape||{},i>0&&(o.shape.smooth=i);var l=a.getModel("lineStyle").getLineStyle();n?r.useStyle(l):o.style=l}function Yn(r,t){var e=t.smooth,a=t.points;if(a)if(r.moveTo(a[0][0],a[0][1]),e>0&&a.length>=3){var n=ba(a[0],a[1]),o=ba(a[1],a[2]);if(!n||!o){r.lineTo(a[1][0],a[1][1]),r.lineTo(a[2][0],a[2][1]);return}var i=Math.min(n,o)*e,l=Et([],a[1],a[0],i/n),u=Et([],a[1],a[2],i/o),s=Et([],l,u,.5);r.bezierCurveTo(l[0],l[1],l[0],l[1],s[0],s[1]),r.bezierCurveTo(u[0],u[1],u[0],u[1],a[2][0],a[2][1])}else for(var v=1;v<a.length;v++)r.lineTo(a[v][0],a[v][1])}function Ir(r,t,e){var a=r.getTextGuideLine(),n=r.getTextContent();if(!n){a&&r.removeTextGuideLine();return}for(var o=t.normal,i=o.get("show"),l=n.ignore,u=0;u<Zt.length;u++){var s=Zt[u],v=t[s],h=s==="normal";if(v){var c=v.get("show"),g=h?l:xa(n.states[s]&&n.states[s].ignore,l);if(g||!xa(c,i)){var d=h?a:a&&a.states[s];d&&(d.ignore=!0),a&&Vt(a,!0,s,v);continue}a||(a=new bt,r.setTextGuideLine(a),!h&&(l||!i)&&Vt(a,!0,"normal",t.normal),r.stateProxy&&(a.stateProxy=r.stateProxy)),Vt(a,!1,s,v)}}if(a){et(a.style,e),a.style.fill=null;var f=o.get("showAbove"),p=r.textGuideLineConfig=r.textGuideLineConfig||{};p.showAbove=f||!1,a.buildPath=Yn}}function Dr(r,t){t=t||"labelLine";for(var e={normal:r.getModel(t)},a=0;a<Ut.length;a++){var n=Ut[a];e[n]=r.getModel([n,t])}return e}var Ea=Math.PI*2,ht=Math.PI/180;function Lr(r,t){return Ze(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function Ar(r,t){var e=Lr(r,t),a=r.get("center"),n=r.get("radius");te(n)||(n=[0,n]);var o=H(e.width,t.getWidth()),i=H(e.height,t.getHeight()),l=Math.min(o,i),u=H(n[0],l/2),s=H(n[1],l/2),v,h,c=r.coordinateSystem;if(c){var g=c.dataToPoint(a);v=g[0]||0,h=g[1]||0}else te(a)||(a=[a,a]),v=H(a[0],o)+e.x,h=H(a[1],i)+e.y;return{cx:v,cy:h,r0:u,r:s}}function Zn(r,t,e){t.eachSeriesByType(r,function(a){var n=a.getData(),o=n.mapDimension("value"),i=Lr(a,e),l=Ar(a,e),u=l.cx,s=l.cy,v=l.r,h=l.r0,c=-a.get("startAngle")*ht,g=a.get("endAngle"),d=a.get("padAngle")*ht;g=g==="auto"?c-Ea:-g*ht;var f=a.get("minAngle")*ht,p=f+d,S=0;n.each(o,function(V){!isNaN(V)&&S++});var m=n.getSum(o),y=Math.PI/(m||S)*2,x=a.get("clockwise"),b=a.get("roseType"),w=a.get("stillShowZeroSum"),L=n.getDataExtent(o);L[0]=0;var I=x?1:-1,A=[c,g],D=I*d/2;nr(A,!x),c=A[0],g=A[1];var N=Tr(a);N.startAngle=c,N.endAngle=g,N.clockwise=x;var T=Math.abs(g-c),M=T,P=0,E=c;if(n.setLayout({viewRect:i,r:v}),n.each(o,function(V,k){var R;if(isNaN(V)){n.setItemLayout(k,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:u,cy:s,r0:h,r:b?NaN:v});return}b!=="area"?R=m===0&&w?y:V*y:R=T/S,R<p?(R=p,M-=p):P+=V;var z=E+I*R,B=0,F=0;d>R?(B=E+I*R/2,F=B):(B=E+D,F=z-D),n.setItemLayout(k,{angle:R,startAngle:B,endAngle:F,clockwise:x,cx:u,cy:s,r0:h,r:b?ve(V,L,[h,v]):v}),E=z}),M<Ea&&S)if(M<=.001){var C=T/S;n.each(o,function(V,k){if(!isNaN(V)){var R=n.getItemLayout(k);R.angle=C;var z=0,B=0;C<d?(z=c+I*(k+1/2)*C,B=z):(z=c+I*k*C+D,B=c+I*(k+1)*C-D),R.startAngle=z,R.endAngle=B}})}else y=M/P,E=c,n.each(o,function(V,k){if(!isNaN(V)){var R=n.getItemLayout(k),z=R.angle===p?p:V*y,B=0,F=0;z<d?(B=E+I*z/2,F=B):(B=E+D,F=E+I*z-D),R.startAngle=B,R.endAngle=F,E+=I*z}})})}var Tr=lt(),Un=Math.PI/180;function Va(r,t,e,a,n,o,i,l,u,s){if(r.length<2)return;function v(f){for(var p=f.rB,S=p*p,m=0;m<f.list.length;m++){var y=f.list[m],x=Math.abs(y.label.y-e),b=a+y.len,w=b*b,L=Math.sqrt(Math.abs((1-x*x/S)*w)),I=t+(L+y.len2)*n,A=I-y.label.x,D=y.targetTextWidth-A*n;Nr(y,D,!0),y.label.x=I}}function h(f){for(var p={list:[],maxY:0},S={list:[],maxY:0},m=0;m<f.length;m++)if(f[m].labelAlignTo==="none"){var y=f[m],x=y.label.y>e?S:p,b=Math.abs(y.label.y-e);if(b>=x.maxY){var w=y.label.x-t-y.len2*n,L=a+y.len,I=Math.abs(w)<L?Math.sqrt(b*b/(1-w*w/L/L)):L;x.rB=I,x.maxY=b}x.list.push(y)}v(p),v(S)}for(var c=r.length,g=0;g<c;g++)if(r[g].position==="outer"&&r[g].labelAlignTo==="labelLine"){var d=r[g].label.x-s;r[g].linePoints[1][0]+=d,r[g].label.x=s}Kr(r,u,u+i)&&h(r)}function qn(r,t,e,a,n,o,i,l){for(var u=[],s=[],v=Number.MAX_VALUE,h=-Number.MAX_VALUE,c=0;c<r.length;c++){var g=r[c].label;_t(r[c])||(g.x<t?(v=Math.min(v,g.x),u.push(r[c])):(h=Math.max(h,g.x),s.push(r[c])))}for(var c=0;c<r.length;c++){var d=r[c];if(!_t(d)&&d.linePoints){if(d.labelStyleWidth!=null)continue;var g=d.label,f=d.linePoints,p=void 0;d.labelAlignTo==="edge"?g.x<t?p=f[2][0]-d.labelDistance-i-d.edgeDistance:p=i+n-d.edgeDistance-f[2][0]-d.labelDistance:d.labelAlignTo==="labelLine"?g.x<t?p=v-i-d.bleedMargin:p=i+n-h-d.bleedMargin:g.x<t?p=g.x-i-d.bleedMargin:p=i+n-g.x-d.bleedMargin,d.targetTextWidth=p,Nr(d,p)}}Va(s,t,e,a,1,n,o,i,l,h),Va(u,t,e,a,-1,n,o,i,l,v);for(var c=0;c<r.length;c++){var d=r[c];if(!_t(d)&&d.linePoints){var g=d.label,f=d.linePoints,S=d.labelAlignTo==="edge",m=g.style.padding,y=m?m[1]+m[3]:0,x=g.style.backgroundColor?0:y,b=d.rect.width+x,w=f[1][0]-f[2][0];S?g.x<t?f[2][0]=i+d.edgeDistance+b+d.labelDistance:f[2][0]=i+n-d.edgeDistance-b-d.labelDistance:(g.x<t?f[2][0]=g.x+d.labelDistance:f[2][0]=g.x-d.labelDistance,f[1][0]=f[2][0]+w),f[1][1]=f[2][1]=g.y}}}function Nr(r,t,e){if(e===void 0&&(e=!1),r.labelStyleWidth==null){var a=r.label,n=a.style,o=r.rect,i=n.backgroundColor,l=n.padding,u=l?l[1]+l[3]:0,s=n.overflow,v=o.width+(i?0:u);if(t<v||e){var h=o.height;if(s&&s.match("break")){a.setStyle("backgroundColor",null),a.setStyle("width",t-u);var c=a.getBoundingRect();a.setStyle("width",Math.ceil(c.width)),a.setStyle("backgroundColor",i)}else{var g=t-u,d=t<v?g:e?g>r.unconstrainedWidth?null:g:null;a.setStyle("width",d)}var f=a.getBoundingRect();o.width=f.width;var p=(a.style.margin||0)+2.1;o.height=f.height+p,o.y-=(o.height-h)/2}}}function _t(r){return r.position==="center"}function $n(r){var t=r.getData(),e=[],a,n,o=!1,i=(r.get("minShowLabelAngle")||0)*Un,l=t.getLayout("viewRect"),u=t.getLayout("r"),s=l.width,v=l.x,h=l.y,c=l.height;function g(w){w.ignore=!0}function d(w){if(!w.ignore)return!0;for(var L in w.states)if(w.states[L].ignore===!1)return!0;return!1}t.each(function(w){var L=t.getItemGraphicEl(w),I=L.shape,A=L.getTextContent(),D=L.getTextGuideLine(),N=t.getItemModel(w),T=N.getModel("label"),M=T.get("position")||N.get(["emphasis","label","position"]),P=T.get("distanceToLabelLine"),E=T.get("alignTo"),C=H(T.get("edgeDistance"),s),V=T.get("bleedMargin"),k=N.getModel("labelLine"),R=k.get("length");R=H(R,s);var z=k.get("length2");if(z=H(z,s),Math.abs(I.endAngle-I.startAngle)<i){_(A.states,g),A.ignore=!0,D&&(_(D.states,g),D.ignore=!0);return}if(d(A)){var B=(I.startAngle+I.endAngle)/2,F=Math.cos(B),$=Math.sin(B),Y,j,ne,he;a=I.cx,n=I.cy;var O=M==="inside"||M==="inner";if(M==="center")Y=I.cx,j=I.cy,he="center";else{var G=(O?(I.r+I.r0)/2*F:I.r*F)+a,Z=(O?(I.r+I.r0)/2*$:I.r*$)+n;if(Y=G+F*3,j=Z+$*3,!O){var W=G+F*(R+u-I.r),K=Z+$*(R+u-I.r),ae=W+(F<0?-1:1)*z,le=K;E==="edge"?Y=F<0?v+C:v+s-C:Y=ae+(F<0?-P:P),j=le,ne=[[G,Z],[W,K],[ae,le]]}he=O?"center":E==="edge"?F>0?"right":"left":F>0?"left":"right"}var U=Math.PI,Q=0,ie=T.get("rotate");if(Ee(ie))Q=ie*(U/180);else if(M==="center")Q=0;else if(ie==="radial"||ie===!0){var Le=F<0?-B+U:-B;Q=Le}else if(ie==="tangential"&&M!=="outside"&&M!=="outer"){var ye=Math.atan2(F,$);ye<0&&(ye=U*2+ye);var st=$>0;st&&(ye=U+ye),Q=ye-U}if(o=!!Q,A.x=Y,A.y=j,A.rotation=Q,A.setStyle({verticalAlign:"middle"}),O){A.setStyle({align:he});var Ct=A.states.select;Ct&&(Ct.x+=A.x,Ct.y+=A.y)}else{var Ue=A.getBoundingRect().clone();Ue.applyTransform(A.getComputedTransform());var Sa=(A.style.margin||0)+2.1;Ue.y-=Sa/2,Ue.height+=Sa,e.push({label:A,labelLine:D,position:M,len:R,len2:z,minTurnAngle:k.get("minTurnAngle"),maxSurfaceAngle:k.get("maxSurfaceAngle"),surfaceNormal:new ee(F,$),linePoints:ne,textAlign:he,labelDistance:P,labelAlignTo:E,edgeDistance:C,bleedMargin:V,rect:Ue,unconstrainedWidth:Ue.width,labelStyleWidth:A.style.width})}L.setTextConfig({inside:O})}}),!o&&r.get("avoidLabelOverlap")&&qn(e,a,n,u,s,c,v,h);for(var f=0;f<e.length;f++){var p=e[f],S=p.label,m=p.labelLine,y=isNaN(S.x)||isNaN(S.y);if(S){S.setStyle({align:p.textAlign}),y&&(_(S.states,g),S.ignore=!0);var x=S.states.select;x&&(x.x+=S.x,x.y+=S.y)}if(m){var b=p.linePoints;y||!b?(_(m.states,g),m.ignore=!0):(Xn(b,p.minTurnAngle),Wn(b,p.surfaceNormal,p.maxSurfaceAngle),m.setShape({points:b}),S.__hostTarget.textGuideLineConfig={anchor:new ee(b[0][0],b[0][1])})}}}var jn=(function(r){q(t,r);function t(e,a,n){var o=r.call(this)||this;o.z2=2;var i=new Ae;return o.setTextContent(i),o.updateData(e,a,n,!0),o}return t.prototype.updateData=function(e,a,n,o){var i=this,l=e.hostModel,u=e.getItemModel(a),s=u.getModel("emphasis"),v=e.getItemLayout(a),h=X(Fe(u.getModel("itemStyle"),v,!0),v);if(isNaN(h.startAngle)){i.setShape(h);return}if(o){i.setShape(h);var c=l.getShallow("animationType");l.ecModel.ssr?(fe(i,{scaleX:0,scaleY:0},l,{dataIndex:a,isFrom:!0}),i.originX=h.cx,i.originY=h.cy):c==="scale"?(i.shape.r=v.r0,fe(i,{shape:{r:v.r}},l,a)):n!=null?(i.setShape({startAngle:n,endAngle:n}),fe(i,{shape:{startAngle:v.startAngle,endAngle:v.endAngle}},l,a)):(i.shape.endAngle=v.startAngle,se(i,{shape:{endAngle:v.endAngle}},l,a))}else at(i),se(i,{shape:h},l,a);i.useStyle(e.getItemVisual(a,"style")),Se(i,u);var g=(v.startAngle+v.endAngle)/2,d=l.get("selectedOffset"),f=Math.cos(g)*d,p=Math.sin(g)*d,S=u.getShallow("cursor");S&&i.attr("cursor",S),this._updateLabel(l,e,a),i.ensureState("emphasis").shape=X({r:v.r+(s.get("scale")&&s.get("scaleSize")||0)},Fe(s.getModel("itemStyle"),v)),X(i.ensureState("select"),{x:f,y:p,shape:Fe(u.getModel(["select","itemStyle"]),v)}),X(i.ensureState("blur"),{shape:Fe(u.getModel(["blur","itemStyle"]),v)});var m=i.getTextGuideLine(),y=i.getTextContent();m&&X(m.ensureState("select"),{x:f,y:p}),X(y.ensureState("select"),{x:f,y:p}),xe(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,a,n){var o=this,i=a.getItemModel(n),l=i.getModel("labelLine"),u=a.getItemVisual(n,"style"),s=u&&u.fill,v=u&&u.opacity;Xe(o,We(i),{labelFetcher:a.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:v,defaultText:e.getFormattedLabel(n,"normal")||a.getName(n)});var h=o.getTextContent();o.setTextConfig({position:null,rotation:null}),h.attr({z2:10});var c=e.get(["label","position"]);if(c!=="outside"&&c!=="outer")o.removeTextGuideLine();else{var g=this.getTextGuideLine();g||(g=new bt,this.setTextGuideLine(g)),Ir(this,Dr(i),{stroke:s,opacity:ut(l.get(["lineStyle","opacity"]),v,1)})}},t})(tt),Kn=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return t.prototype.render=function(e,a,n,o){var i=e.getData(),l=this._data,u=this.group,s;if(!l&&i.count()>0){for(var v=i.getItemLayout(0),h=1;isNaN(v&&v.startAngle)&&h<i.count();++h)v=i.getItemLayout(h);v&&(s=v.startAngle)}if(this._emptyCircleSector&&u.remove(this._emptyCircleSector),i.count()===0&&e.get("showEmptyCircle")){var c=Tr(e),g=new tt({shape:X(Ar(e,n),c)});g.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=g,u.add(g)}i.diff(l).add(function(d){var f=new jn(i,d,s);i.setItemGraphicEl(d,f),u.add(f)}).update(function(d,f){var p=l.getItemGraphicEl(f);p.updateData(i,d,s),p.off("click"),u.add(p),i.setItemGraphicEl(d,p)}).remove(function(d){var f=l.getItemGraphicEl(d);ir(f,e,d)}).execute(),$n(e),e.get("animationTypeUpdate")!=="expansion"&&(this._data=i)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,a){var n=a.getData(),o=n.getItemLayout(0);if(o){var i=e[0]-o.cx,l=e[1]-o.cy,u=Math.sqrt(i*i+l*l);return u<=o.r&&u>=o.r0}},t.type="pie",t})(Ie),Jn=lt(),Qn=(function(r){q(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new At(me(this.getData,this),me(this.getRawData,this)),this._defaultLabelLine(e)},t.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Lt(this,{coordDimensions:["value"],encodeDefaulter:ge(or,this)})},t.prototype.getDataParams=function(e){var a=this.getData(),n=Jn(a),o=n.seats;if(!o){var i=[];a.each(a.mapDimension("value"),function(u){i.push(u)}),o=n.seats=Jr(i,a.hostModel.get("percentPrecision"))}var l=r.prototype.getDataParams.call(this,e);return l.percent=o[e]||0,l.$vars.push("percent"),l},t.prototype._defaultLabelLine=function(e){ia(e,"labelLine",["show"]);var a=e.labelLine,n=e.emphasis.labelLine;a.show=a.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t})(De);function ei(r){return{seriesType:r,reset:function(t,e){var a=t.getData();a.filterSelf(function(n){var o=a.mapDimension("value"),i=a.get(o,n);return!(Ee(i)&&!isNaN(i)&&i<0)})}}}function ti(r){r.registerChartView(Kn),r.registerSeriesModel(Qn),Qr("pie",r.registerAction),r.registerLayout(ge(Zn,"pie")),r.registerProcessor(Tt("pie")),r.registerProcessor(ei("pie"))}function ai(r){r.eachSeriesByType("radar",function(t){var e=t.getData(),a=[],n=t.coordinateSystem;if(n){var o=n.getIndicatorAxes();_(o,function(i,l){e.each(e.mapDimension(o[l].dim),function(u,s){a[s]=a[s]||[];var v=n.dataToPoint(u,l);a[s][l]=_a(v)?v:Pa(n)})}),e.each(function(i){var l=en(a[i],function(u){return _a(u)})||Pa(n);a[i].push(l.slice()),e.setItemLayout(i,a[i])})}})}function _a(r){return!isNaN(r[0])&&!isNaN(r[1])}function Pa(r){return[r.cx,r.cy]}function ri(r){var t=r.polar;if(t){te(t)||(t=[t]);var e=[];_(t,function(a,n){a.indicator?(a.type&&!a.shape&&(a.shape=a.type),r.radar=r.radar||[],te(r.radar)||(r.radar=[r.radar]),r.radar.push(a)):e.push(a)}),r.polar=e}_(r.series,function(a){a&&a.type==="radar"&&a.polarIndex&&(a.radarIndex=a.polarIndex)})}var ni=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,a,n){var o=e.coordinateSystem,i=this.group,l=e.getData(),u=this._data;function s(c,g){var d=c.getItemVisual(g,"symbol")||"circle";if(d!=="none"){var f=rn(c.getItemVisual(g,"symbolSize")),p=qt(d,-1,-1,2,2),S=c.getItemVisual(g,"symbolRotate")||0;return p.attr({style:{strokeNoScale:!0},z2:100,scaleX:f[0]/2,scaleY:f[1]/2,rotation:S*Math.PI/180||0}),p}}function v(c,g,d,f,p,S){d.removeAll();for(var m=0;m<g.length-1;m++){var y=s(f,p);y&&(y.__dimIdx=m,c[m]?(y.setPosition(c[m]),an[S?"initProps":"updateProps"](y,{x:g[m][0],y:g[m][1]},e,p)):y.setPosition(g[m]),d.add(y))}}function h(c){return we(c,function(g){return[o.cx,o.cy]})}l.diff(u).add(function(c){var g=l.getItemLayout(c);if(g){var d=new oa,f=new bt,p={shape:{points:g}};d.shape.points=h(g),f.shape.points=h(g),fe(d,p,e,c),fe(f,p,e,c);var S=new be,m=new be;S.add(f),S.add(d),S.add(m),v(f.shape.points,g,m,l,c,!0),l.setItemGraphicEl(c,S)}}).update(function(c,g){var d=u.getItemGraphicEl(g),f=d.childAt(0),p=d.childAt(1),S=d.childAt(2),m={shape:{points:l.getItemLayout(c)}};m.shape.points&&(v(f.shape.points,m.shape.points,S,l,c,!1),at(p),at(f),se(f,m,e),se(p,m,e),l.setItemGraphicEl(c,d))}).remove(function(c){i.remove(u.getItemGraphicEl(c))}).execute(),l.eachItemGraphicEl(function(c,g){var d=l.getItemModel(g),f=c.childAt(0),p=c.childAt(1),S=c.childAt(2),m=l.getItemVisual(g,"style"),y=m.fill;i.add(c),f.useStyle(et(d.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:y})),Se(f,d,"lineStyle"),Se(p,d,"areaStyle");var x=d.getModel("areaStyle"),b=x.isEmpty()&&x.parentModel.isEmpty();p.ignore=b,_(["emphasis","select","blur"],function(I){var A=d.getModel([I,"areaStyle"]),D=A.isEmpty()&&A.parentModel.isEmpty();p.ensureState(I).ignore=D&&b}),p.useStyle(et(x.getAreaStyle(),{fill:y,opacity:.7,decal:m.decal}));var w=d.getModel("emphasis"),L=w.getModel("itemStyle").getItemStyle();S.eachChild(function(I){if(I instanceof lr){var A=I.style;I.useStyle(X({image:A.image,x:A.x,y:A.y,width:A.width,height:A.height},m))}else I.useStyle(m),I.setColor(y),I.style.strokeNoScale=!0;var D=I.ensureState("emphasis");D.style=tn(L);var N=l.getStore().get(l.getDimensionIndex(I.__dimIdx),g);(N==null||isNaN(N))&&(N=""),Xe(I,We(d),{labelFetcher:l.hostModel,labelDataIndex:g,labelDimIndex:I.__dimIdx,defaultText:N,inheritColor:y,defaultOpacity:m.opacity})}),xe(c,w.get("focus"),w.get("blurScope"),w.get("disabled"))}),this._data=l},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.type="radar",t})(Ie),ii=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.hasSymbolVisual=!0,e}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new At(me(this.getData,this),me(this.getRawData,this))},t.prototype.getInitialData=function(e,a){return Lt(this,{generateCoord:"indicator_",generateCoordCount:1/0})},t.prototype.formatTooltip=function(e,a,n){var o=this.getData(),i=this.coordinateSystem,l=i.getIndicatorAxes(),u=this.getData().getName(e),s=u===""?this.name:u,v=nn(this,e);return Re("section",{header:s,sortBlocks:!0,blocks:we(l,function(h){var c=o.get(o.mapDimension(h.dim),e);return Re("nameValue",{markerType:"subItem",markerColor:v,name:h.name,value:c,sortParam:c})})})},t.prototype.getTooltipPosition=function(e){if(e!=null){for(var a=this.getData(),n=this.coordinateSystem,o=a.getValues(we(n.dimensions,function(s){return a.mapDimension(s)}),e),i=0,l=o.length;i<l;i++)if(!isNaN(o[i])){var u=n.getIndicatorAxes();return n.coordToPoint(u[i].dataToCoord(o[i]),i)}}},t.type="series.radar",t.dependencies=["radar"],t.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},t})(De);function oi(r){ur(Fn),r.registerChartView(ni),r.registerSeriesModel(ii),r.registerLayout(ai),r.registerProcessor(Tt("radar")),r.registerPreprocessor(ri)}function li(r){var t=r;t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var e=[t],a,n;a=e.pop();)if(n=a.children,a.isExpand&&n.length)for(var o=n.length,i=o-1;i>=0;i--){var l=n[i];l.hierNode={defaultAncestor:null,ancestor:l,prelim:0,modifier:0,change:0,shift:0,i,thread:null},e.push(l)}}function ui(r,t){var e=r.isExpand?r.children:[],a=r.parentNode.children,n=r.hierNode.i?a[r.hierNode.i-1]:null;if(e.length){ci(r);var o=(e[0].hierNode.prelim+e[e.length-1].hierNode.prelim)/2;n?(r.hierNode.prelim=n.hierNode.prelim+t(r,n),r.hierNode.modifier=r.hierNode.prelim-o):r.hierNode.prelim=o}else n&&(r.hierNode.prelim=n.hierNode.prelim+t(r,n));r.parentNode.hierNode.defaultAncestor=hi(r,n,r.parentNode.hierNode.defaultAncestor||a[0],t)}function si(r){var t=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:t},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function ka(r){return arguments.length?r:fi}function Ke(r,t){return r-=Math.PI/2,{x:t*Math.cos(r),y:t*Math.sin(r)}}function vi(r,t){return Ze(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function ci(r){for(var t=r.children,e=t.length,a=0,n=0;--e>=0;){var o=t[e];o.hierNode.prelim+=a,o.hierNode.modifier+=a,n+=o.hierNode.change,a+=o.hierNode.shift+n}}function hi(r,t,e,a){if(t){for(var n=r,o=r,i=o.parentNode.children[0],l=t,u=n.hierNode.modifier,s=o.hierNode.modifier,v=i.hierNode.modifier,h=l.hierNode.modifier;l=Pt(l),o=kt(o),l&&o;){n=Pt(n),i=kt(i),n.hierNode.ancestor=r;var c=l.hierNode.prelim+h-o.hierNode.prelim-s+a(l,o);c>0&&(di(gi(l,r,e),r,c),s+=c,u+=c),h+=l.hierNode.modifier,s+=o.hierNode.modifier,u+=n.hierNode.modifier,v+=i.hierNode.modifier}l&&!Pt(n)&&(n.hierNode.thread=l,n.hierNode.modifier+=h-u),o&&!kt(i)&&(i.hierNode.thread=o,i.hierNode.modifier+=s-v,e=r)}return e}function Pt(r){var t=r.children;return t.length&&r.isExpand?t[t.length-1]:r.hierNode.thread}function kt(r){var t=r.children;return t.length&&r.isExpand?t[0]:r.hierNode.thread}function gi(r,t,e){return r.hierNode.ancestor.parentNode===t.parentNode?r.hierNode.ancestor:e}function di(r,t,e){var a=e/(t.hierNode.i-r.hierNode.i);t.hierNode.change-=a,t.hierNode.shift+=e,t.hierNode.modifier+=e,t.hierNode.prelim+=e,r.hierNode.change+=a}function fi(r,t){return r.parentNode===t.parentNode?1:2}var pi=(function(){function r(){this.parentPoint=[],this.childPoints=[]}return r})(),yi=(function(r){q(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new pi},t.prototype.buildPath=function(e,a){var n=a.childPoints,o=n.length,i=a.parentPoint,l=n[0],u=n[o-1];if(o===1){e.moveTo(i[0],i[1]),e.lineTo(l[0],l[1]);return}var s=a.orient,v=s==="TB"||s==="BT"?0:1,h=1-v,c=H(a.forkPosition,1),g=[];g[v]=i[v],g[h]=i[h]+(u[h]-i[h])*c,e.moveTo(i[0],i[1]),e.lineTo(g[0],g[1]),e.moveTo(l[0],l[1]),g[v]=l[v],e.lineTo(g[0],g[1]),g[v]=u[v],e.lineTo(g[0],g[1]),e.lineTo(u[0],u[1]);for(var d=1;d<o-1;d++){var f=n[d];e.moveTo(f[0],f[1]),g[v]=f[v],e.lineTo(g[0],g[1])}},t})(la),mi=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._mainGroup=new be,e}return t.prototype.init=function(e,a){this._controller=new va(a.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(e,a,n){var o=e.getData(),i=e.layoutInfo,l=this._mainGroup,u=e.get("layout");u==="radial"?(l.x=i.x+i.width/2,l.y=i.y+i.height/2):(l.x=i.x,l.y=i.y),this._updateViewCoordSys(e,n),this._updateController(e,a,n);var s=this._data;o.diff(s).add(function(v){Ra(o,v)&&za(o,v,null,l,e)}).update(function(v,h){var c=s.getItemGraphicEl(h);if(!Ra(o,v)){c&&Ba(s,h,c,l,e);return}za(o,v,c,l,e)}).remove(function(v){var h=s.getItemGraphicEl(v);h&&Ba(s,v,h,l,e)}).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),e.get("expandAndCollapse")===!0&&o.eachItemGraphicEl(function(v,h){v.off("click").on("click",function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:h})})}),this._data=o},t.prototype._updateViewCoordSys=function(e,a){var n=e.getData(),o=[];n.each(function(h){var c=n.getItemLayout(h);c&&!isNaN(c.x)&&!isNaN(c.y)&&o.push([+c.x,+c.y])});var i=[],l=[];sr(o,i,l);var u=this._min,s=this._max;l[0]-i[0]===0&&(i[0]=u?u[0]:i[0]-1,l[0]=s?s[0]:l[0]+1),l[1]-i[1]===0&&(i[1]=u?u[1]:i[1]-1,l[1]=s?s[1]:l[1]+1);var v=e.coordinateSystem=new ca;v.zoomLimit=e.get("scaleLimit"),v.setBoundingRect(i[0],i[1],l[0]-i[0],l[1]-i[1]),v.setCenter(e.get("center"),a),v.setZoom(e.get("zoom")),this.group.attr({x:v.x,y:v.y,scaleX:v.scaleX,scaleY:v.scaleY}),this._min=i,this._max=l},t.prototype._updateController=function(e,a,n){var o=this,i=this._controller,l=this._controllerHost,u=this.group;i.setPointerChecker(function(s,v,h){var c=u.getBoundingRect();return c.applyTransform(u.transform),c.contain(v,h)&&!vr(s,n,e)}),i.enable(e.get("roam")),l.zoomLimit=e.get("scaleLimit"),l.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",function(s){mr(l,s.dx,s.dy),n.dispatchAction({seriesId:e.id,type:"treeRoam",dx:s.dx,dy:s.dy})}).on("zoom",function(s){Sr(l,s.scale,s.originX,s.originY),n.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:s.scale,originX:s.originX,originY:s.originY}),o._updateNodeAndLinkScale(e),n.updateLabelLayout()})},t.prototype._updateNodeAndLinkScale=function(e){var a=e.getData(),n=this._getNodeGlobalScale(e);a.eachItemGraphicEl(function(o,i){o.setSymbolScale(n)})},t.prototype._getNodeGlobalScale=function(e){var a=e.coordinateSystem;if(a.type!=="view")return 1;var n=this._nodeScaleRatio,o=a.scaleX||1,i=a.getZoom(),l=(i-1)*n+1;return l/o},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},t.type="tree",t})(Ie);function Ra(r,t){var e=r.getItemLayout(t);return e&&!isNaN(e.x)&&!isNaN(e.y)}function za(r,t,e,a,n){var o=!e,i=r.tree.getNodeByDataIndex(t),l=i.getModel(),u=i.getVisual("style").fill,s=i.isExpand===!1&&i.children.length!==0?u:"#fff",v=r.tree.root,h=i.parentNode===v?i:i.parentNode||i,c=r.getItemGraphicEl(h.dataIndex),g=h.getLayout(),d=c?{x:c.__oldX,y:c.__oldY,rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:g,f=i.getLayout();o?(e=new Hn(r,t,null,{symbolInnerColor:s,useNameLabel:!0}),e.x=d.x,e.y=d.y):e.updateData(r,t,null,{symbolInnerColor:s,useNameLabel:!0}),e.__radialOldRawX=e.__radialRawX,e.__radialOldRawY=e.__radialRawY,e.__radialRawX=f.rawX,e.__radialRawY=f.rawY,a.add(e),r.setItemGraphicEl(t,e),e.__oldX=e.x,e.__oldY=e.y,se(e,{x:f.x,y:f.y},n);var p=e.getSymbolPath();if(n.get("layout")==="radial"){var S=v.children[0],m=S.getLayout(),y=S.children.length,x=void 0,b=void 0;if(f.x===m.x&&i.isExpand===!0&&S.children.length){var w={x:(S.children[0].getLayout().x+S.children[y-1].getLayout().x)/2,y:(S.children[0].getLayout().y+S.children[y-1].getLayout().y)/2};x=Math.atan2(w.y-m.y,w.x-m.x),x<0&&(x=Math.PI*2+x),b=w.x<m.x,b&&(x=x-Math.PI)}else x=Math.atan2(f.y-m.y,f.x-m.x),x<0&&(x=Math.PI*2+x),i.children.length===0||i.children.length!==0&&i.isExpand===!1?(b=f.x<m.x,b&&(x=x-Math.PI)):(b=f.x>m.x,b||(x=x-Math.PI));var L=b?"left":"right",I=l.getModel("label"),A=I.get("rotate"),D=A*(Math.PI/180),N=p.getTextContent();N&&(p.setTextConfig({position:I.get("position")||L,rotation:A==null?-x:D,origin:"center"}),N.setStyle("verticalAlign","middle"))}var T=l.get(["emphasis","focus"]),M=T==="relative"?cr(i.getAncestorsIndices(),i.getDescendantIndices()):T==="ancestor"?i.getAncestorsIndices():T==="descendant"?i.getDescendantIndices():null;M&&(pe(e).focus=M),Si(n,i,v,e,d,g,f,a),e.__edge&&(e.onHoverStateChange=function(P){if(P!=="blur"){var E=i.parentNode&&r.getItemGraphicEl(i.parentNode.dataIndex);E&&E.hoverState===on||ln(e.__edge,P)}})}function Si(r,t,e,a,n,o,i,l){var u=t.getModel(),s=r.get("edgeShape"),v=r.get("layout"),h=r.getOrient(),c=r.get(["lineStyle","curveness"]),g=r.get("edgeForkPosition"),d=u.getModel("lineStyle").getLineStyle(),f=a.__edge;if(s==="curve")t.parentNode&&t.parentNode!==e&&(f||(f=a.__edge=new un({shape:ea(v,h,c,n,n)})),se(f,{shape:ea(v,h,c,o,i)},r));else if(s==="polyline"&&v==="orthogonal"&&t!==e&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var p=t.children,S=[],m=0;m<p.length;m++){var y=p[m].getLayout();S.push([y.x,y.y])}f||(f=a.__edge=new yi({shape:{parentPoint:[i.x,i.y],childPoints:[[i.x,i.y]],orient:h,forkPosition:g}})),se(f,{shape:{parentPoint:[i.x,i.y],childPoints:S}},r)}f&&!(s==="polyline"&&!t.isExpand)&&(f.useStyle(et({strokeNoScale:!0,fill:null},d)),Se(f,u,"lineStyle"),jt(f),l.add(f))}function Ga(r,t,e,a,n){var o=t.tree.root,i=Mr(o,r),l=i.source,u=i.sourceLayout,s=t.getItemGraphicEl(r.dataIndex);if(s){var v=t.getItemGraphicEl(l.dataIndex),h=v.__edge,c=s.__edge||(l.isExpand===!1||l.children.length===1?h:void 0),g=a.get("edgeShape"),d=a.get("layout"),f=a.get("orient"),p=a.get(["lineStyle","curveness"]);c&&(g==="curve"?$t(c,{shape:ea(d,f,p,u,u),style:{opacity:0}},a,{cb:function(){e.remove(c)},removeOpt:n}):g==="polyline"&&a.get("layout")==="orthogonal"&&$t(c,{shape:{parentPoint:[u.x,u.y],childPoints:[[u.x,u.y]]},style:{opacity:0}},a,{cb:function(){e.remove(c)},removeOpt:n}))}}function Mr(r,t){for(var e=t.parentNode===r?t:t.parentNode||t,a;a=e.getLayout(),a==null;)e=e.parentNode===r?e:e.parentNode||e;return{source:e,sourceLayout:a}}function Ba(r,t,e,a,n){var o=r.tree.getNodeByDataIndex(t),i=r.tree.root,l=Mr(i,o).sourceLayout,u={duration:n.get("animationDurationUpdate"),easing:n.get("animationEasingUpdate")};$t(e,{x:l.x+1,y:l.y+1},n,{cb:function(){a.remove(e),r.setItemGraphicEl(t,null)},removeOpt:u}),e.fadeOut(null,r.hostModel,{fadeLabel:!0,animation:u}),o.children.forEach(function(s){Ga(s,r,a,n,u)}),Ga(o,r,a,n,u)}function ea(r,t,e,a,n){var o,i,l,u,s,v,h,c;if(r==="radial"){s=a.rawX,h=a.rawY,v=n.rawX,c=n.rawY;var g=Ke(s,h),d=Ke(s,h+(c-h)*e),f=Ke(v,c+(h-c)*e),p=Ke(v,c);return{x1:g.x||0,y1:g.y||0,x2:p.x||0,y2:p.y||0,cpx1:d.x||0,cpy1:d.y||0,cpx2:f.x||0,cpy2:f.y||0}}else s=a.x,h=a.y,v=n.x,c=n.y,(t==="LR"||t==="RL")&&(o=s+(v-s)*e,i=h,l=v+(s-v)*e,u=c),(t==="TB"||t==="BT")&&(o=s,i=h+(c-h)*e,l=v,u=c+(h-c)*e);return{x1:s,y1:h,x2:v,y2:c,cpx1:o,cpy1:i,cpx2:l,cpy2:u}}var ce=lt();function Cr(r){var t=r.mainData,e=r.datas;e||(e={main:t},r.datasAttr={main:"data"}),r.datas=r.mainData=null,Er(t,e,r),_(e,function(a){_(t.TRANSFERABLE_METHODS,function(n){a.wrapMethod(n,ge(xi,r))})}),t.wrapMethod("cloneShallow",ge(wi,r)),_(t.CHANGABLE_METHODS,function(a){t.wrapMethod(a,ge(bi,r))}),sn(e[t.dataType]===t)}function xi(r,t){if(Li(this)){var e=X({},ce(this).datas);e[this.dataType]=t,Er(t,e,r)}else ha(t,this.dataType,ce(this).mainData,r);return t}function bi(r,t){return r.struct&&r.struct.update(),t}function wi(r,t){return _(ce(t).datas,function(e,a){e!==t&&ha(e.cloneShallow(),a,t,r)}),t}function Ii(r){var t=ce(this).mainData;return r==null||t==null?t:ce(t).datas[r]}function Di(){var r=ce(this).mainData;return r==null?[{data:r}]:we(vn(ce(r).datas),function(t){return{type:t,data:ce(r).datas[t]}})}function Li(r){return ce(r).mainData===r}function Er(r,t,e){ce(r).datas={},_(t,function(a,n){ha(a,n,r,e)})}function ha(r,t,e,a){ce(e).datas[t]=r,ce(r).mainData=e,r.dataType=t,a.struct&&(r[a.structAttr]=a.struct,a.struct[a.datasAttr[t]]=r),r.getLinkedData=Ii,r.getLinkedDataAll=Di}var Ai=(function(){function r(t,e){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=t||"",this.hostTree=e}return r.prototype.isRemoved=function(){return this.dataIndex<0},r.prototype.eachNode=function(t,e,a){Ye(t)&&(a=e,e=t,t=null),t=t||{},ze(t)&&(t={order:t});var n=t.order||"preorder",o=this[t.attr||"children"],i;n==="preorder"&&(i=e.call(a,this));for(var l=0;!i&&l<o.length;l++)o[l].eachNode(t,e,a);n==="postorder"&&e.call(a,this)},r.prototype.updateDepthAndHeight=function(t){var e=0;this.depth=t;for(var a=0;a<this.children.length;a++){var n=this.children[a];n.updateDepthAndHeight(t+1),n.height>e&&(e=n.height)}this.height=e+1},r.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,a=this.children,n=a.length;e<n;e++){var o=a[e].getNodeById(t);if(o)return o}},r.prototype.contains=function(t){if(t===this)return!0;for(var e=0,a=this.children,n=a.length;e<n;e++){var o=a[e].contains(t);if(o)return o}},r.prototype.getAncestors=function(t){for(var e=[],a=t?this:this.parentNode;a;)e.push(a),a=a.parentNode;return e.reverse(),e},r.prototype.getAncestorsIndices=function(){for(var t=[],e=this;e;)t.push(e.dataIndex),e=e.parentNode;return t.reverse(),t},r.prototype.getDescendantIndices=function(){var t=[];return this.eachNode(function(e){t.push(e.dataIndex)}),t},r.prototype.getValue=function(t){var e=this.hostTree.data;return e.getStore().get(e.getDimensionIndex(t||"value"),this.dataIndex)},r.prototype.setLayout=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostTree,a=e.data.getItemModel(this.dataIndex);return a.getModel(t)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},r.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e<t.length;++e)if(t[e]===this)return e;return-1}return-1},r.prototype.isAncestorOf=function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},r.prototype.isDescendantOf=function(t){return t!==this&&t.isAncestorOf(this)},r})(),ga=(function(){function r(t){this.type="tree",this._nodes=[],this.hostModel=t}return r.prototype.eachNode=function(t,e,a){this.root.eachNode(t,e,a)},r.prototype.getNodeByDataIndex=function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},r.prototype.getNodeById=function(t){return this.root.getNodeById(t)},r.prototype.update=function(){for(var t=this.data,e=this._nodes,a=0,n=e.length;a<n;a++)e[a].dataIndex=-1;for(var a=0,n=t.count();a<n;a++)e[t.getRawIndex(a)].dataIndex=a},r.prototype.clearLayouts=function(){this.data.clearItemLayouts()},r.createTree=function(t,e,a){var n=new r(e),o=[],i=1;l(t);function l(v,h){var c=v.value;i=Math.max(i,te(c)?c.length:1),o.push(v);var g=new Ai(wt(v.name,""),n);h?Ti(g,h):n.root=g,n._nodes.push(g);var d=v.children;if(d)for(var f=0;f<d.length;f++)l(d[f],g)}n.root.updateDepthAndHeight(0);var u=hr(o,{coordDimensions:["value"],dimensionsCount:i}).dimensions,s=new ft(u,e);return s.initData(o),a&&a(s),Cr({mainData:s,struct:n,structAttr:"tree"}),n.update(),n},r})();function Ti(r,t){var e=t.children;r.parentNode!==t&&(e.push(r),r.parentNode=t)}function nt(r,t,e){if(r&&It(t,r.type)>=0){var a=e.getData().tree.root,n=r.targetNode;if(ze(n)&&(n=a.getNodeById(n)),n&&a.contains(n))return{node:n};var o=r.targetNodeId;if(o!=null&&(n=a.getNodeById(o)))return{node:n}}}function Vr(r){for(var t=[];r;)r=r.parentNode,r&&t.push(r);return t.reverse()}function da(r,t){var e=Vr(r);return It(e,t)>=0}function Nt(r,t){for(var e=[];r;){var a=r.dataIndex;e.push({name:r.name,dataIndex:a,value:t.getRawValue(a)}),r=r.parentNode}return e.reverse(),e}var Ni=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return t.prototype.getInitialData=function(e){var a={name:e.name,children:e.data},n=e.leaves||{},o=new Ge(n,this,this.ecModel),i=ga.createTree(a,this,l);function l(h){h.wrapMethod("getItemModel",function(c,g){var d=i.getNodeByDataIndex(g);return d&&d.children.length&&d.isExpand||(c.parentModel=o),c})}var u=0;i.eachNode("preorder",function(h){h.depth>u&&(u=h.depth)});var s=e.expandAndCollapse,v=s&&e.initialTreeDepth>=0?e.initialTreeDepth:u;return i.root.eachNode("preorder",function(h){var c=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=c&&c.collapsed!=null?!c.collapsed:h.depth<=v}),i.data},t.prototype.getOrient=function(){var e=this.get("orient");return e==="horizontal"?e="LR":e==="vertical"&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,a,n){for(var o=this.getData().tree,i=o.root.children[0],l=o.getNodeByDataIndex(e),u=l.getValue(),s=l.name;l&&l!==i;)s=l.parentNode.name+"."+s,l=l.parentNode;return Re("nameValue",{name:s,value:u,noValue:isNaN(u)||u==null})},t.prototype.getDataParams=function(e){var a=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return a.treeAncestors=Nt(n,this),a.collapsed=!n.isExpand,a},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t})(De);function Mi(r,t,e){for(var a=[r],n=[],o;o=a.pop();)if(n.push(o),o.isExpand){var i=o.children;if(i.length)for(var l=0;l<i.length;l++)a.push(i[l])}for(;o=n.pop();)t(o,e)}function qe(r,t){for(var e=[r],a;a=e.pop();)if(t(a),a.isExpand){var n=a.children;if(n.length)for(var o=n.length-1;o>=0;o--)e.push(n[o])}}function Ci(r,t){r.eachSeriesByType("tree",function(e){Ei(e,t)})}function Ei(r,t){var e=vi(r,t);r.layoutInfo=e;var a=r.get("layout"),n=0,o=0,i=null;a==="radial"?(n=2*Math.PI,o=Math.min(e.height,e.width)/2,i=ka(function(y,x){return(y.parentNode===x.parentNode?1:2)/y.depth})):(n=e.width,o=e.height,i=ka());var l=r.getData().tree.root,u=l.children[0];if(u){li(l),Mi(u,ui,i),l.hierNode.modifier=-u.hierNode.prelim,qe(u,si);var s=u,v=u,h=u;qe(u,function(y){var x=y.getLayout().x;x<s.getLayout().x&&(s=y),x>v.getLayout().x&&(v=y),y.depth>h.depth&&(h=y)});var c=s===v?1:i(s,v)/2,g=c-s.getLayout().x,d=0,f=0,p=0,S=0;if(a==="radial")d=n/(v.getLayout().x+c+g),f=o/(h.depth-1||1),qe(u,function(y){p=(y.getLayout().x+g)*d,S=(y.depth-1)*f;var x=Ke(p,S);y.setLayout({x:x.x,y:x.y,rawX:p,rawY:S},!0)});else{var m=r.getOrient();m==="RL"||m==="LR"?(f=o/(v.getLayout().x+c+g),d=n/(h.depth-1||1),qe(u,function(y){S=(y.getLayout().x+g)*f,p=m==="LR"?(y.depth-1)*d:n-(y.depth-1)*d,y.setLayout({x:p,y:S},!0)})):(m==="TB"||m==="BT")&&(d=n/(v.getLayout().x+c+g),f=o/(h.depth-1||1),qe(u,function(y){p=(y.getLayout().x+g)*d,S=m==="TB"?(y.depth-1)*f:o-(y.depth-1)*f,y.setLayout({x:p,y:S},!0)}))}}}function Vi(r){r.eachSeriesByType("tree",function(t){var e=t.getData(),a=e.tree;a.eachNode(function(n){var o=n.getModel(),i=o.getModel("itemStyle").getItemStyle(),l=e.ensureUniqueItemVisual(n.dataIndex,"style");X(l,i)})})}function _i(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(a){var n=t.dataIndex,o=a.getData().tree,i=o.getNodeByDataIndex(n);i.isExpand=!i.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(t,e,a){e.eachComponent({mainType:"series",subType:"tree",query:t},function(n){var o=n.coordinateSystem,i=xr(o,t,void 0,a);n.setCenter&&n.setCenter(i.center),n.setZoom&&n.setZoom(i.zoom)})})}function Pi(r){r.registerChartView(mi),r.registerSeriesModel(Ni),r.registerLayout(Ci),r.registerVisual(Vi),_i(r)}var Ha=["treemapZoomToNode","treemapRender","treemapMove"];function ki(r){for(var t=0;t<Ha.length;t++)r.registerAction({type:Ha[t],update:"updateView"},Kt);r.registerAction({type:"treemapRootToNode",update:"updateView"},function(e,a){a.eachComponent({mainType:"series",subType:"treemap",query:e},n);function n(o,i){var l=["treemapZoomToNode","treemapRootToNode"],u=nt(e,l,o);if(u){var s=o.getViewRoot();s&&(e.direction=da(s,u.node)?"rollUp":"drillDown"),o.resetViewRoot(u.node)}}})}function _r(r){var t=r.getData(),e=t.tree,a={};e.eachNode(function(n){for(var o=n;o&&o.depth>1;)o=o.parentNode;var i=cn(r.ecModel,o.name||o.dataIndex+"",a);n.setVisual("decal",i)})}var Ri=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.preventUsingHoverLayer=!0,e}return t.prototype.getInitialData=function(e,a){var n={name:e.name,children:e.data};Pr(n);var o=e.levels||[],i=this.designatedVisualItemStyle={},l=new Ge({itemStyle:i},this,a);o=e.levels=zi(o,a);var u=we(o||[],function(h){return new Ge(h,l,a)},this),s=ga.createTree(n,this,v);function v(h){h.wrapMethod("getItemModel",function(c,g){var d=s.getNodeByDataIndex(g),f=d?u[d.depth]:null;return c.parentModel=f||l,c})}return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,a,n){var o=this.getData(),i=this.getRawValue(e),l=o.getName(e);return Re("nameValue",{name:l,value:i})},t.prototype.getDataParams=function(e){var a=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return a.treeAncestors=Nt(n,this),a.treePathInfo=a.treeAncestors,a},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},X(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var a=this._idIndexMap;a||(a=this._idIndexMap=rt(),this._idIndexMapCount=0);var n=a.get(e);return n==null&&a.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var a=this.getRawData().tree.root;(!e||e!==a&&!a.contains(e))&&(this._viewRoot=a)},t.prototype.enableAriaDecal=function(){_r(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t})(De);function Pr(r){var t=0;_(r.children,function(a){Pr(a);var n=a.value;te(n)&&(n=n[0]),t+=n});var e=r.value;te(e)&&(e=e[0]),(e==null||isNaN(e))&&(e=t),e<0&&(e=0),te(r.value)?r.value[0]=e:r.value=e}function zi(r,t){var e=wa(t.get("color")),a=wa(t.get(["aria","decal","decals"]));if(e){r=r||[];var n,o;_(r,function(l){var u=new Ge(l),s=u.get("color"),v=u.get("decal");(u.get(["itemStyle","color"])||s&&s!=="none")&&(n=!0),(u.get(["itemStyle","decal"])||v&&v!=="none")&&(o=!0)});var i=r[0]||(r[0]={});return n||(i.color=e.slice()),!o&&a&&(i.decal=a.slice()),r}}var Gi=8,Oa=8,Rt=5,Bi=(function(){function r(t){this.group=new be,t.add(this.group)}return r.prototype.render=function(t,e,a,n){var o=t.getModel("breadcrumb"),i=this.group;if(i.removeAll(),!(!o.get("show")||!a)){var l=o.getModel("itemStyle"),u=o.getModel("emphasis"),s=l.getModel("textStyle"),v=u.getModel(["itemStyle","textStyle"]),h={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(a,h,s),this._renderContent(t,h,l,u,s,v,n),hn(i,h.pos,h.box)}},r.prototype._prepare=function(t,e,a){for(var n=t;n;n=n.parentNode){var o=wt(n.getModel().get("name"),""),i=a.getTextRect(o),l=Math.max(i.width+Gi*2,e.emptyItemWidth);e.totalWidth+=l+Oa,e.renderList.push({node:n,text:o,width:l})}},r.prototype._renderContent=function(t,e,a,n,o,i,l){for(var u=0,s=e.emptyItemWidth,v=t.get(["breadcrumb","height"]),h=gn(e.pos,e.box),c=e.totalWidth,g=e.renderList,d=n.getModel("itemStyle").getItemStyle(),f=g.length-1;f>=0;f--){var p=g[f],S=p.node,m=p.width,y=p.text;c>h.width&&(c-=m-s,m=s,y=null);var x=new oa({shape:{points:Hi(u,0,m,v,f===g.length-1,f===0)},style:et(a.getItemStyle(),{lineJoin:"bevel"}),textContent:new Ae({style:ke(o,{text:y})}),textConfig:{position:"inside"},z2:Dt*1e4,onclick:ge(l,S)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=ke(i,{text:y}),x.ensureState("emphasis").style=d,xe(x,n.get("focus"),n.get("blurScope"),n.get("disabled")),this.group.add(x),Oi(x,t,S),u+=m+Oa}},r.prototype.remove=function(){this.group.removeAll()},r})();function Hi(r,t,e,a,n,o){var i=[[n?r:r-Rt,t],[r+e,t],[r+e,t+a],[n?r:r-Rt,t+a]];return!o&&i.splice(2,0,[r+e+Rt,t+a/2]),!n&&i.push([r,t+a/2]),i}function Oi(r,t,e){pe(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:e&&e.dataIndex,name:e&&e.name},treePathInfo:e&&Nt(e,t)}}var Fi=(function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(t,e,a,n,o){return this._elExistsMap[t.id]?!1:(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:a,delay:n,easing:o}),!0)},r.prototype.finished=function(t){return this._finishedCallback=t,this},r.prototype.start=function(){for(var t=this,e=this._storage.length,a=function(){e--,e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},n=0,o=this._storage.length;n<o;n++){var i=this._storage[n];i.el.animateTo(i.target,{duration:i.duration,delay:i.delay,easing:i.easing,setToFinal:!0,done:a,aborted:a})}return this},r})();function Xi(){return new Fi}var ta=be,Fa=ua,Xa=3,Wa="label",Ya="upperLabel",Wi=Dt*10,Yi=Dt*2,Zi=Dt*3,_e=yn([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),Za=function(r){var t=_e(r);return t.stroke=t.fill=t.lineWidth=null,t},mt=lt(),Ui=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._state="ready",e._storage=$e(),e}return t.prototype.render=function(e,a,n,o){var i=a.findComponents({mainType:"series",subType:"treemap",query:o});if(!(It(i,e)<0)){this.seriesModel=e,this.api=n,this.ecModel=a;var l=["treemapZoomToNode","treemapRootToNode"],u=nt(o,l,e),s=o&&o.type,v=e.layoutInfo,h=!this._oldTree,c=this._storage,g=s==="treemapRootToNode"&&u&&c?{rootNodeGroup:c.nodeGroup[u.node.getRawIndex()],direction:o.direction}:null,d=this._giveContainerGroup(v),f=e.get("animation"),p=this._doRender(d,e,g);f&&!h&&(!s||s==="treemapZoomToNode"||s==="treemapRootToNode")?this._doAnimation(d,p,e,g):p.renderFinally(),this._resetController(n),this._renderBreadcrumb(e,n,u)}},t.prototype._giveContainerGroup=function(e){var a=this._containerGroup;return a||(a=this._containerGroup=new ta,this._initEvents(a),this.group.add(a)),a.x=e.x,a.y=e.y,a},t.prototype._doRender=function(e,a,n){var o=a.getData().tree,i=this._oldTree,l=$e(),u=$e(),s=this._storage,v=[];function h(m,y,x,b){return qi(a,u,s,n,l,v,m,y,x,b)}f(o.root?[o.root]:[],i&&i.root?[i.root]:[],e,o===i||!i,0);var c=p(s);if(this._oldTree=o,this._storage=u,this._controllerHost){var g=this.seriesModel.layoutInfo,d=o.root.getLayout();d.width===g.width&&d.height===g.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:l,willDeleteEls:c,renderFinally:S};function f(m,y,x,b,w){b?(y=m,_(m,function(A,D){!A.isRemoved()&&I(D,D)})):new gr(y,m,L,L).add(I).update(I).remove(ge(I,null)).execute();function L(A){return A.getId()}function I(A,D){var N=A!=null?m[A]:null,T=D!=null?y[D]:null,M=h(N,T,x,w);M&&f(N&&N.viewChildren||[],T&&T.viewChildren||[],M,b,w+1)}}function p(m){var y=$e();return m&&_(m,function(x,b){var w=y[b];_(x,function(L){L&&(w.push(L),mt(L).willDelete=!0)})}),y}function S(){_(c,function(m){_(m,function(y){y.parent&&y.parent.remove(y)})}),_(v,function(m){m.invisible=!0,m.dirty()})}},t.prototype._doAnimation=function(e,a,n,o){var i=n.get("animationDurationUpdate"),l=n.get("animationEasing"),u=(Ye(i)?0:i)||0,s=(Ye(l)?null:l)||"cubicOut",v=Xi();_(a.willDeleteEls,function(h,c){_(h,function(g,d){if(!g.invisible){var f=g.parent,p,S=mt(f);if(o&&o.direction==="drillDown")p=f===o.rootNodeGroup?{shape:{x:0,y:0,width:S.nodeWidth,height:S.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var m=0,y=0;S.willDelete||(m=S.nodeWidth/2,y=S.nodeHeight/2),p=c==="nodeGroup"?{x:m,y,style:{opacity:0}}:{shape:{x:m,y,width:0,height:0},style:{opacity:0}}}p&&v.add(g,p,u,0,s)}})}),_(this._storage,function(h,c){_(h,function(g,d){var f=a.lastsForAnimation[c][d],p={};f&&(g instanceof be?f.oldX!=null&&(p.x=g.x,p.y=g.y,g.x=f.oldX,g.y=f.oldY):(f.oldShape&&(p.shape=X({},g.shape),g.setShape(f.oldShape)),f.fadein?(g.setStyle("opacity",0),p.style={opacity:1}):g.style.opacity!==1&&(p.style={opacity:1})),v.add(g,p,u,0,s))})},this),this._state="animating",v.finished(me(function(){this._state="ready",a.renderFinally()},this)).start()},t.prototype._resetController=function(e){var a=this._controller,n=this._controllerHost;n||(this._controllerHost={target:this.group},n=this._controllerHost),a||(a=this._controller=new va(e.getZr()),a.enable(this.seriesModel.get("roam")),n.zoomLimit=this.seriesModel.get("scaleLimit"),n.zoom=this.seriesModel.get("zoom"),a.on("pan",me(this._onPan,this)),a.on("zoom",me(this._onZoom,this)));var o=new pt(0,0,e.getWidth(),e.getHeight());a.setPointerChecker(function(i,l,u){return o.contain(l,u)})},t.prototype._clearController=function(){var e=this._controller;this._controllerHost=null,e&&(e.dispose(),e=null)},t.prototype._onPan=function(e){if(this._state!=="animating"&&(Math.abs(e.dx)>Xa||Math.abs(e.dy)>Xa)){var a=this.seriesModel.getData().tree.root;if(!a)return;var n=a.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var a=e.originX,n=e.originY,o=e.scale;if(this._state!=="animating"){var i=this.seriesModel.getData().tree.root;if(!i)return;var l=i.getLayout();if(!l)return;var u=new pt(l.x,l.y,l.width,l.height),s=null,v=this._controllerHost;s=v.zoomLimit;var h=v.zoom=v.zoom||1;if(h*=o,s){var c=s.min||0,g=s.max||1/0;h=Math.max(Math.min(g,h),c)}var d=h/v.zoom;v.zoom=h;var f=this.seriesModel.layoutInfo;a-=f.x,n-=f.y;var p=mn();Ia(p,p,[-a,-n]),dn(p,p,[d,d]),Ia(p,p,[a,n]),u.applyTransform(p),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:u.x,y:u.y,width:u.width,height:u.height}})}},t.prototype._initEvents=function(e){var a=this;e.on("click",function(n){if(a._state==="ready"){var o=a.seriesModel.get("nodeClick",!0);if(o){var i=a.findTarget(n.offsetX,n.offsetY);if(i){var l=i.node;if(l.getLayout().isLeafRoot)a._rootToNode(i);else if(o==="zoomToNode")a._zoomToNode(i);else if(o==="link"){var u=l.hostTree.data.getItemModel(l.dataIndex),s=u.get("link",!0),v=u.get("target",!0)||"blank";s&&dr(s,v)}}}}},this)},t.prototype._renderBreadcrumb=function(e,a,n){var o=this;n||(n=e.get("leafDepth",!0)!=null?{node:e.getViewRoot()}:this.findTarget(a.getWidth()/2,a.getHeight()/2),n||(n={node:e.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new Bi(this.group))).render(e,a,n.node,function(i){o._state!=="animating"&&(da(e.getViewRoot(),i)?o._rootToNode({node:i}):o._zoomToNode({node:i}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=$e(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,a){var n,o=this.seriesModel.getViewRoot();return o.eachNode({attr:"viewChildren",order:"preorder"},function(i){var l=this._storage.background[i.getRawIndex()];if(l){var u=l.transformCoordToLocal(e,a),s=l.shape;if(s.x<=u[0]&&u[0]<=s.x+s.width&&s.y<=u[1]&&u[1]<=s.y+s.height)n={node:i,offsetX:u[0],offsetY:u[1]};else return!1}},this),n},t.type="treemap",t})(Ie);function $e(){return{nodeGroup:[],background:[],content:[]}}function qi(r,t,e,a,n,o,i,l,u,s){if(!i)return;var v=i.getLayout(),h=r.getData(),c=i.getModel();if(h.setItemGraphicEl(i.dataIndex,null),!v||!v.isInView)return;var g=v.width,d=v.height,f=v.borderWidth,p=v.invisible,S=i.getRawIndex(),m=l&&l.getRawIndex(),y=i.viewChildren,x=v.upperHeight,b=y&&y.length,w=c.getModel("itemStyle"),L=c.getModel(["emphasis","itemStyle"]),I=c.getModel(["blur","itemStyle"]),A=c.getModel(["select","itemStyle"]),D=w.get("borderRadius")||0,N=j("nodeGroup",ta);if(!N)return;if(u.add(N),N.x=v.x||0,N.y=v.y||0,N.markRedraw(),mt(N).nodeWidth=g,mt(N).nodeHeight=d,v.isAboveViewRoot)return N;var T=j("background",Fa,s,Yi);T&&z(N,T,b&&v.upperLabelHeight);var M=c.getModel("emphasis"),P=M.get("focus"),E=M.get("blurScope"),C=M.get("disabled"),V=P==="ancestor"?i.getAncestorsIndices():P==="descendant"?i.getDescendantIndices():P;if(b)Da(N)&&vt(N,!1),T&&(vt(T,!C),h.setItemGraphicEl(i.dataIndex,T),La(T,V,E));else{var k=j("content",Fa,s,Zi);k&&B(N,k),T.disableMorphing=!0,T&&Da(T)&&vt(T,!1),vt(N,!C),h.setItemGraphicEl(i.dataIndex,N);var R=c.getShallow("cursor");R&&k.attr("cursor",R),La(N,V,E)}return N;function z(O,G,Z){var W=pe(G);if(W.dataIndex=i.dataIndex,W.seriesIndex=r.seriesIndex,G.setShape({x:0,y:0,width:g,height:d,r:D}),p)F(G);else{G.invisible=!1;var K=i.getVisual("style"),ae=K.stroke,le=Za(w);le.fill=ae;var U=_e(L);U.fill=L.get("borderColor");var Q=_e(I);Q.fill=I.get("borderColor");var ie=_e(A);if(ie.fill=A.get("borderColor"),Z){var Le=g-2*f;$(G,ae,K.opacity,{x:f,y:0,width:Le,height:x})}else G.removeTextContent();G.setStyle(le),G.ensureState("emphasis").style=U,G.ensureState("blur").style=Q,G.ensureState("select").style=ie,jt(G)}O.add(G)}function B(O,G){var Z=pe(G);Z.dataIndex=i.dataIndex,Z.seriesIndex=r.seriesIndex;var W=Math.max(g-2*f,0),K=Math.max(d-2*f,0);if(G.culling=!0,G.setShape({x:f,y:f,width:W,height:K,r:D}),p)F(G);else{G.invisible=!1;var ae=i.getVisual("style"),le=ae.fill,U=Za(w);U.fill=le,U.decal=ae.decal;var Q=_e(L),ie=_e(I),Le=_e(A);$(G,le,ae.opacity,null),G.setStyle(U),G.ensureState("emphasis").style=Q,G.ensureState("blur").style=ie,G.ensureState("select").style=Le,jt(G)}O.add(G)}function F(O){!O.invisible&&o.push(O)}function $(O,G,Z,W){var K=c.getModel(W?Ya:Wa),ae=wt(c.get("name"),null),le=K.getShallow("show");Xe(O,We(c,W?Ya:Wa),{defaultText:le?ae:null,inheritColor:G,defaultOpacity:Z,labelFetcher:r,labelDataIndex:i.dataIndex});var U=O.getTextContent();if(U){var Q=U.style,ie=fn(Q.padding||0);W&&(O.setTextConfig({layoutRect:W}),U.disableLabelLayout=!0),U.beforeUpdate=function(){var ye=Math.max((W?W.width:O.shape.width)-ie[1]-ie[3],0),st=Math.max((W?W.height:O.shape.height)-ie[0]-ie[2],0);(Q.width!==ye||Q.height!==st)&&U.setStyle({width:ye,height:st})},Q.truncateMinChar=2,Q.lineOverflow="truncate",Y(Q,W,v);var Le=U.getState("emphasis");Y(Le?Le.style:null,W,v)}}function Y(O,G,Z){var W=O?O.text:null;if(!G&&Z.isLeafRoot&&W!=null){var K=r.get("drillDownIcon",!0);O.text=K?K+" "+W:W}}function j(O,G,Z,W){var K=m!=null&&e[O][m],ae=n[O];return K?(e[O][m]=null,ne(ae,K)):p||(K=new G,K instanceof pn&&(K.z2=$i(Z,W)),he(ae,K)),t[O][S]=K}function ne(O,G){var Z=O[S]={};G instanceof ta?(Z.oldX=G.x,Z.oldY=G.y):Z.oldShape=X({},G.shape)}function he(O,G){var Z=O[S]={},W=i.parentNode,K=G instanceof be;if(W&&(!a||a.direction==="drillDown")){var ae=0,le=0,U=n.background[W.getRawIndex()];!a&&U&&U.oldShape&&(ae=U.oldShape.width,le=U.oldShape.height),K?(Z.oldX=0,Z.oldY=le):Z.oldShape={x:ae,y:le,width:0,height:0}}Z.fadein=!K}}function $i(r,t){return r*Wi+t}var ji="itemStyle",kr=lt();const Ki={seriesType:"treemap",reset:function(r){var t=r.getData().tree,e=t.root;e.isRemoved()||Rr(e,{},r.getViewRoot().getAncestors(),r)}};function Rr(r,t,e,a){var n=r.getModel(),o=r.getLayout(),i=r.hostTree.data;if(!(!o||o.invisible||!o.isInView)){var l=n.getModel(ji),u=Ji(l,t,a),s=i.ensureUniqueItemVisual(r.dataIndex,"style"),v=l.get("borderColor"),h=l.get("borderColorSaturation"),c;h!=null&&(c=Ua(u),v=Qi(h,c)),s.stroke=v;var g=r.viewChildren;if(!g||!g.length)c=Ua(u),s.fill=c;else{var d=eo(r,n,o,l,u,g);_(g,function(f,p){if(f.depth>=e.length||f===e[f.depth]){var S=to(n,u,f,p,d,a);Rr(f,S,e,a)}})}}}function Ji(r,t,e){var a=X({},t),n=e.designatedVisualItemStyle;return _(["color","colorAlpha","colorSaturation"],function(o){n[o]=t[o];var i=r.get(o);n[o]=null,i!=null&&(a[o]=i)}),a}function Ua(r){var t=zt(r,"color");if(t){var e=zt(r,"colorAlpha"),a=zt(r,"colorSaturation");return a&&(t=fr(t,null,null,a)),e&&(t=Sn(t,e)),t}}function Qi(r,t){return t!=null?fr(t,null,null,r):null}function zt(r,t){var e=r[t];if(e!=null&&e!=="none")return e}function eo(r,t,e,a,n,o){if(!(!o||!o.length)){var i=Gt(t,"color")||n.color!=null&&n.color!=="none"&&(Gt(t,"colorAlpha")||Gt(t,"colorSaturation"));if(i){var l=t.get("visualMin"),u=t.get("visualMax"),s=e.dataExtent.slice();l!=null&&l<s[0]&&(s[0]=l),u!=null&&u>s[1]&&(s[1]=u);var v=t.get("colorMappingBy"),h={type:i.name,dataExtent:s,visual:i.range};h.type==="color"&&(v==="index"||v==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var c=new br(h);return kr(c).drColorMappingBy=v,c}}}function Gt(r,t){var e=r.get(t);return te(e)&&e.length?{name:t,range:e}:null}function to(r,t,e,a,n,o){var i=X({},t);if(n){var l=n.type,u=l==="color"&&kr(n).drColorMappingBy,s=u==="index"?a:u==="id"?o.mapIdToIndex(e.getId()):e.getValue(r.get("visualDimension"));i[l]=n.mapValueToVisual(s)}return i}var it=Math.max,St=Math.min,qa=Jt,fa=_,zr=["itemStyle","borderWidth"],ao=["itemStyle","gapWidth"],ro=["upperLabel","show"],no=["upperLabel","height"];const io={seriesType:"treemap",reset:function(r,t,e,a){var n=e.getWidth(),o=e.getHeight(),i=r.option,l=Ze(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),u=i.size||[],s=H(qa(l.width,u[0]),n),v=H(qa(l.height,u[1]),o),h=a&&a.type,c=["treemapZoomToNode","treemapRootToNode"],g=nt(a,c,r),d=h==="treemapRender"||h==="treemapMove"?a.rootRect:null,f=r.getViewRoot(),p=Vr(f);if(h!=="treemapMove"){var S=h==="treemapZoomToNode"?co(r,g,f,s,v):d?[d.width,d.height]:[s,v],m=i.sort;m&&m!=="asc"&&m!=="desc"&&(m="desc");var y={squareRatio:i.squareRatio,sort:m,leafDepth:i.leafDepth};f.hostTree.clearLayouts();var x={x:0,y:0,width:S[0],height:S[1],area:S[0]*S[1]};f.setLayout(x),Gr(f,y,!1,0),x=f.getLayout(),fa(p,function(w,L){var I=(p[L+1]||f).getValue();w.setLayout(X({dataExtent:[I,I],borderWidth:0,upperHeight:0},x))})}var b=r.getData().tree.root;b.setLayout(ho(l,d,g),!0),r.setLayoutInfo(l),Br(b,new pt(-l.x,-l.y,n,o),p,f,0)}};function Gr(r,t,e,a){var n,o;if(!r.isRemoved()){var i=r.getLayout();n=i.width,o=i.height;var l=r.getModel(),u=l.get(zr),s=l.get(ao)/2,v=Hr(l),h=Math.max(u,v),c=u-s,g=h-s;r.setLayout({borderWidth:u,upperHeight:h,upperLabelHeight:v},!0),n=it(n-2*c,0),o=it(o-c-g,0);var d=n*o,f=oo(r,l,d,t,e,a);if(f.length){var p={x:c,y:g,width:n,height:o},S=St(n,o),m=1/0,y=[];y.area=0;for(var x=0,b=f.length;x<b;){var w=f[x];y.push(w),y.area+=w.getLayout().area;var L=vo(y,S,t.squareRatio);L<=m?(x++,m=L):(y.area-=y.pop().getLayout().area,$a(y,S,p,s,!1),S=St(p.width,p.height),y.length=y.area=0,m=1/0)}if(y.length&&$a(y,S,p,s,!0),!e){var I=l.get("childrenVisibleMin");I!=null&&d<I&&(e=!0)}for(var x=0,b=f.length;x<b;x++)Gr(f[x],t,e,a+1)}}}function oo(r,t,e,a,n,o){var i=r.children||[],l=a.sort;l!=="asc"&&l!=="desc"&&(l=null);var u=a.leafDepth!=null&&a.leafDepth<=o;if(n&&!u)return r.viewChildren=[];i=pr(i,function(g){return!g.isRemoved()}),uo(i,l);var s=so(t,i,l);if(s.sum===0)return r.viewChildren=[];if(s.sum=lo(t,e,s.sum,l,i),s.sum===0)return r.viewChildren=[];for(var v=0,h=i.length;v<h;v++){var c=i[v].getValue()/s.sum*e;i[v].setLayout({area:c})}return u&&(i.length&&r.setLayout({isLeafRoot:!0},!0),i.length=0),r.viewChildren=i,r.setLayout({dataExtent:s.dataExtent},!0),i}function lo(r,t,e,a,n){if(!a)return e;for(var o=r.get("visibleMin"),i=n.length,l=i,u=i-1;u>=0;u--){var s=n[a==="asc"?i-u-1:u].getValue();s/e*t<o&&(l=u,e-=s)}return a==="asc"?n.splice(0,i-l):n.splice(l,i-l),e}function uo(r,t){return t&&r.sort(function(e,a){var n=t==="asc"?e.getValue()-a.getValue():a.getValue()-e.getValue();return n===0?t==="asc"?e.dataIndex-a.dataIndex:a.dataIndex-e.dataIndex:n}),r}function so(r,t,e){for(var a=0,n=0,o=t.length;n<o;n++)a+=t[n].getValue();var i=r.get("visualDimension"),l;return!t||!t.length?l=[NaN,NaN]:i==="value"&&e?(l=[t[t.length-1].getValue(),t[0].getValue()],e==="asc"&&l.reverse()):(l=[1/0,-1/0],fa(t,function(u){var s=u.getValue(i);s<l[0]&&(l[0]=s),s>l[1]&&(l[1]=s)})),{sum:a,dataExtent:l}}function vo(r,t,e){for(var a=0,n=1/0,o=0,i=void 0,l=r.length;o<l;o++)i=r[o].getLayout().area,i&&(i<n&&(n=i),i>a&&(a=i));var u=r.area*r.area,s=t*t*e;return u?it(s*a/u,u/(s*n)):1/0}function $a(r,t,e,a,n){var o=t===e.width?0:1,i=1-o,l=["x","y"],u=["width","height"],s=e[l[o]],v=t?r.area/t:0;(n||v>e[u[i]])&&(v=e[u[i]]);for(var h=0,c=r.length;h<c;h++){var g=r[h],d={},f=v?g.getLayout().area/v:0,p=d[u[i]]=it(v-2*a,0),S=e[l[o]]+e[u[o]]-s,m=h===c-1||S<f?S:f,y=d[u[o]]=it(m-2*a,0);d[l[i]]=e[l[i]]+St(a,p/2),d[l[o]]=s+St(a,y/2),s+=m,g.setLayout(d,!0)}e[l[i]]+=v,e[u[i]]-=v}function co(r,t,e,a,n){var o=(t||{}).node,i=[a,n];if(!o||o===e)return i;for(var l,u=a*n,s=u*r.option.zoomToNodeRatio;l=o.parentNode;){for(var v=0,h=l.children,c=0,g=h.length;c<g;c++)v+=h[c].getValue();var d=o.getValue();if(d===0)return i;s*=v/d;var f=l.getModel(),p=f.get(zr),S=Math.max(p,Hr(f));s+=4*p*p+(3*p+S)*Math.pow(s,.5),s>Aa&&(s=Aa),o=l}s<u&&(s=u);var m=Math.pow(s/u,.5);return[a*m,n*m]}function ho(r,t,e){if(t)return{x:t.x,y:t.y};var a={x:0,y:0};if(!e)return a;var n=e.node,o=n.getLayout();if(!o)return a;for(var i=[o.width/2,o.height/2],l=n;l;){var u=l.getLayout();i[0]+=u.x,i[1]+=u.y,l=l.parentNode}return{x:r.width/2-i[0],y:r.height/2-i[1]}}function Br(r,t,e,a,n){var o=r.getLayout(),i=e[n],l=i&&i===r;if(!(i&&!l||n===e.length&&r!==a)){r.setLayout({isInView:!0,invisible:!l&&!t.intersect(o),isAboveViewRoot:l},!0);var u=new pt(t.x-o.x,t.y-o.y,t.width,t.height);fa(r.viewChildren||[],function(s){Br(s,u,e,a,n+1)})}}function Hr(r){return r.get(ro)?r.get(no):0}function go(r){r.registerSeriesModel(Ri),r.registerChartView(Ui),r.registerVisual(Ki),r.registerLayout(io),ki(r)}function fo(r){var t=r.findComponents({mainType:"legend"});!t||!t.length||r.eachSeriesByType("graph",function(e){var a=e.getCategoriesData(),n=e.getGraph(),o=n.data,i=a.mapArray(a.getName);o.filterSelf(function(l){var u=o.getItemModel(l),s=u.getShallow("category");if(s!=null){Ee(s)&&(s=i[s]);for(var v=0;v<t.length;v++)if(!t[v].isSelected(s))return!1}return!0})})}function po(r){var t={};r.eachSeriesByType("graph",function(e){var a=e.getCategoriesData(),n=e.getData(),o={};a.each(function(i){var l=a.getName(i);o["ec-"+l]=i;var u=a.getItemModel(i),s=u.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(l,t)),a.setItemVisual(i,"style",s);for(var v=["symbol","symbolSize","symbolKeepAspect"],h=0;h<v.length;h++){var c=u.getShallow(v[h],!0);c!=null&&a.setItemVisual(i,v[h],c)}}),a.count()&&n.each(function(i){var l=n.getItemModel(i),u=l.getShallow("category");if(u!=null){ze(u)&&(u=o["ec-"+u]);var s=a.getItemVisual(u,"style"),v=n.ensureUniqueItemVisual(i,"style");X(v,s);for(var h=["symbol","symbolSize","symbolKeepAspect"],c=0;c<h.length;c++)n.setItemVisual(i,h[c],a.getItemVisual(u,h[c]))}})})}function gt(r){return r instanceof Array||(r=[r,r]),r}function yo(r){r.eachSeriesByType("graph",function(t){var e=t.getGraph(),a=t.getEdgeData(),n=gt(t.get("edgeSymbol")),o=gt(t.get("edgeSymbolSize"));a.setVisual("fromSymbol",n&&n[0]),a.setVisual("toSymbol",n&&n[1]),a.setVisual("fromSymbolSize",o&&o[0]),a.setVisual("toSymbolSize",o&&o[1]),a.setVisual("style",t.getModel("lineStyle").getLineStyle()),a.each(function(i){var l=a.getItemModel(i),u=e.getEdgeByIndex(i),s=gt(l.getShallow("symbol",!0)),v=gt(l.getShallow("symbolSize",!0)),h=l.getModel("lineStyle").getLineStyle(),c=a.ensureUniqueItemVisual(i,"style");switch(X(c,h),c.stroke){case"source":{var g=u.node1.getVisual("style");c.stroke=g&&g.fill;break}case"target":{var g=u.node2.getVisual("style");c.stroke=g&&g.fill;break}}s[0]&&u.setVisual("fromSymbol",s[0]),s[1]&&u.setVisual("toSymbol",s[1]),v[0]&&u.setVisual("fromSymbolSize",v[0]),v[1]&&u.setVisual("toSymbolSize",v[1])})})}var aa="-->",Mt=function(r){return r.get("autoCurveness")||null},Or=function(r,t){var e=Mt(r),a=20,n=[];if(Ee(e))a=e;else if(te(e)){r.__curvenessList=e;return}t>a&&(a=t);var o=a%2?a+2:a+3;n=[];for(var i=0;i<o;i++)n.push((i%2?i+1:i)/10*(i%2?-1:1));r.__curvenessList=n},ot=function(r,t,e){var a=[r.id,r.dataIndex].join("."),n=[t.id,t.dataIndex].join(".");return[e.uid,a,n].join(aa)},Fr=function(r){var t=r.split(aa);return[t[0],t[2],t[1]].join(aa)},mo=function(r,t){var e=ot(r.node1,r.node2,t);return t.__edgeMap[e]},So=function(r,t){var e=ra(ot(r.node1,r.node2,t),t),a=ra(ot(r.node2,r.node1,t),t);return e+a},ra=function(r,t){var e=t.__edgeMap;return e[r]?e[r].length:0};function xo(r){Mt(r)&&(r.__curvenessList=[],r.__edgeMap={},Or(r))}function bo(r,t,e,a){if(Mt(e)){var n=ot(r,t,e),o=e.__edgeMap,i=o[Fr(n)];o[n]&&!i?o[n].isForward=!0:i&&o[n]&&(i.isForward=!0,o[n].isForward=!1),o[n]=o[n]||[],o[n].push(a)}}function pa(r,t,e,a){var n=Mt(t),o=te(n);if(!n)return null;var i=mo(r,t);if(!i)return null;for(var l=-1,u=0;u<i.length;u++)if(i[u]===e){l=u;break}var s=So(r,t);Or(t,s),r.lineStyle=r.lineStyle||{};var v=ot(r.node1,r.node2,t),h=t.__curvenessList,c=o||s%2?0:1;if(i.isForward)return h[c+l];var g=Fr(v),d=ra(g,t),f=h[l+d+c];return a?o?n&&n[0]===0?(d+c)%2?f:-f:((d%2?0:1)+c)%2?f:-f:(d+c)%2?f:-f:h[l+d+c]}function Xr(r){var t=r.coordinateSystem;if(!(t&&t.type!=="view")){var e=r.getGraph();e.eachNode(function(a){var n=a.getModel();a.setLayout([+n.get("x"),+n.get("y")])}),ya(e,r)}}function ya(r,t){r.eachEdge(function(e,a){var n=ut(e.getModel().get(["lineStyle","curveness"]),-pa(e,t,a,!0),0),o=Me(e.node1.getLayout()),i=Me(e.node2.getLayout()),l=[o,i];+n&&l.push([(o[0]+i[0])/2-(o[1]-i[1])*n,(o[1]+i[1])/2-(i[0]-o[0])*n]),e.setLayout(l)})}function wo(r,t){r.eachSeriesByType("graph",function(e){var a=e.get("layout"),n=e.coordinateSystem;if(n&&n.type!=="view"){var o=e.getData(),i=[];_(n.dimensions,function(c){i=i.concat(o.mapDimensionsAll(c))});for(var l=0;l<o.count();l++){for(var u=[],s=!1,v=0;v<i.length;v++){var h=o.get(i[v],l);isNaN(h)||(s=!0),u.push(h)}s?o.setItemLayout(l,n.dataToPoint(u)):o.setItemLayout(l,[NaN,NaN])}ya(o.graph,e)}else(!a||a==="none")&&Xr(e)})}function Je(r){var t=r.coordinateSystem;if(t.type!=="view")return 1;var e=r.option.nodeScaleRatio,a=t.scaleX,n=t.getZoom(),o=(n-1)*e+1;return o/a}function Qe(r){var t=r.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var ja=Math.PI,Bt=[];function ma(r,t,e,a){var n=r.coordinateSystem;if(!(n&&n.type!=="view")){var o=n.getBoundingRect(),i=r.getData(),l=i.graph,u=o.width/2+o.x,s=o.height/2+o.y,v=Math.min(o.width,o.height)/2,h=i.count();if(i.setLayout({cx:u,cy:s}),!!h){if(e){var c=n.pointToData(a),g=c[0],d=c[1],f=[g-u,d-s];sa(f,f),xn(f,f,v),e.setLayout([u+f[0],s+f[1]],!0);var p=r.get(["circular","rotateLabel"]);Wr(e,p,u,s)}Io[t](r,l,i,v,u,s,h),l.eachEdge(function(S,m){var y=ut(S.getModel().get(["lineStyle","curveness"]),pa(S,r,m),0),x=Me(S.node1.getLayout()),b=Me(S.node2.getLayout()),w,L=(x[0]+b[0])/2,I=(x[1]+b[1])/2;+y&&(y*=3,w=[u*y+L*(1-y),s*y+I*(1-y)]),S.setLayout([x,b,w])})}}}var Io={value:function(r,t,e,a,n,o,i){var l=0,u=e.getSum("value"),s=Math.PI*2/(u||i);t.eachNode(function(v){var h=v.getValue("value"),c=s*(u?h:1)/2;l+=c,v.setLayout([a*Math.cos(l)+n,a*Math.sin(l)+o]),l+=c})},symbolSize:function(r,t,e,a,n,o,i){var l=0;Bt.length=i;var u=Je(r);t.eachNode(function(h){var c=Qe(h);isNaN(c)&&(c=2),c<0&&(c=0),c*=u;var g=Math.asin(c/2/a);isNaN(g)&&(g=ja/2),Bt[h.dataIndex]=g,l+=g*2});var s=(2*ja-l)/i/2,v=0;t.eachNode(function(h){var c=s+Bt[h.dataIndex];v+=c,(!h.getLayout()||!h.getLayout().fixed)&&h.setLayout([a*Math.cos(v)+n,a*Math.sin(v)+o]),v+=c})}};function Wr(r,t,e,a){var n=r.getGraphicEl();if(n){var o=r.getModel(),i=o.get(["label","rotate"])||0,l=n.getSymbolPath();if(t){var u=r.getLayout(),s=Math.atan2(u[1]-a,u[0]-e);s<0&&(s=Math.PI*2+s);var v=u[0]<e;v&&(s=s-Math.PI);var h=v?"left":"right";l.setTextConfig({rotation:-s,position:h,origin:"center"});var c=l.ensureState("emphasis");X(c.textConfig||(c.textConfig={}),{position:h})}else l.setTextConfig({rotation:i*=Math.PI/180})}}function Do(r){r.eachSeriesByType("graph",function(t){t.get("layout")==="circular"&&ma(t,"symbolSize")})}var Be=Qt;function Lo(r,t,e){for(var a=r,n=t,o=e.rect,i=o.width,l=o.height,u=[o.x+i/2,o.y+l/2],s=e.gravity==null?.1:e.gravity,v=0;v<a.length;v++){var h=a[v];h.p||(h.p=bn(i*(Math.random()-.5)+u[0],l*(Math.random()-.5)+u[1])),h.pp=Me(h.p),h.edges=null}var c=e.friction==null?.6:e.friction,g=c,d,f;return{warmUp:function(){g=c*.8},setFixed:function(p){a[p].fixed=!0},setUnfixed:function(p){a[p].fixed=!1},beforeStep:function(p){d=p},afterStep:function(p){f=p},step:function(p){d&&d(a,n);for(var S=[],m=a.length,y=0;y<n.length;y++){var x=n[y];if(!x.ignoreForceLayout){var b=x.n1,w=x.n2;je(S,w.p,b.p);var L=Ta(S)-x.d,I=w.w/(b.w+w.w);isNaN(I)&&(I=0),sa(S,S),!b.fixed&&Be(b.p,b.p,S,I*L*g),!w.fixed&&Be(w.p,w.p,S,-(1-I)*L*g)}}for(var y=0;y<m;y++){var A=a[y];A.fixed||(je(S,u,A.p),Be(A.p,A.p,S,s*g))}for(var y=0;y<m;y++)for(var b=a[y],D=y+1;D<m;D++){var w=a[D];je(S,w.p,b.p);var L=Ta(S);L===0&&(wn(S,Math.random()-.5,Math.random()-.5),L=1);var N=(b.rep+w.rep)/L/L;!b.fixed&&Be(b.pp,b.pp,S,N),!w.fixed&&Be(w.pp,w.pp,S,-N)}for(var T=[],y=0;y<m;y++){var A=a[y];A.fixed||(je(T,A.p,A.pp),Be(A.p,A.p,T,g),ue(A.pp,A.p))}g=g*.992;var M=g<.01;f&&f(a,n,M),p&&p(M)}}}function Ao(r){r.eachSeriesByType("graph",function(t){var e=t.coordinateSystem;if(!(e&&e.type!=="view"))if(t.get("layout")==="force"){var a=t.preservedPoints||{},n=t.getGraph(),o=n.data,i=n.edgeData,l=t.getModel("force"),u=l.get("initLayout");t.preservedPoints?o.each(function(y){var x=o.getId(y);o.setItemLayout(y,a[x]||[NaN,NaN])}):!u||u==="none"?Xr(t):u==="circular"&&ma(t,"value");var s=o.getDataExtent("value"),v=i.getDataExtent("value"),h=l.get("repulsion"),c=l.get("edgeLength"),g=te(h)?h:[h,h],d=te(c)?c:[c,c];d=[d[1],d[0]];var f=o.mapArray("value",function(y,x){var b=o.getItemLayout(x),w=ve(y,s,g);return isNaN(w)&&(w=(g[0]+g[1])/2),{w,rep:w,fixed:o.getItemModel(x).get("fixed"),p:!b||isNaN(b[0])||isNaN(b[1])?null:b}}),p=i.mapArray("value",function(y,x){var b=n.getEdgeByIndex(x),w=ve(y,v,d);isNaN(w)&&(w=(d[0]+d[1])/2);var L=b.getModel(),I=ut(b.getModel().get(["lineStyle","curveness"]),-pa(b,t,x,!0),0);return{n1:f[b.node1.dataIndex],n2:f[b.node2.dataIndex],d:w,curveness:I,ignoreForceLayout:L.get("ignoreForceLayout")}}),S=e.getBoundingRect(),m=Lo(f,p,{rect:S,gravity:l.get("gravity"),friction:l.get("friction")});m.beforeStep(function(y,x){for(var b=0,w=y.length;b<w;b++)y[b].fixed&&ue(y[b].p,n.getNodeByIndex(b).getLayout())}),m.afterStep(function(y,x,b){for(var w=0,L=y.length;w<L;w++)y[w].fixed||n.getNodeByIndex(w).setLayout(y[w].p),a[o.getId(w)]=y[w].p;for(var w=0,L=x.length;w<L;w++){var I=x[w],A=n.getEdgeByIndex(w),D=I.n1.p,N=I.n2.p,T=A.getLayout();T=T?T.slice():[],T[0]=T[0]||[],T[1]=T[1]||[],ue(T[0],D),ue(T[1],N),+I.curveness&&(T[2]=[(D[0]+N[0])/2-(D[1]-N[1])*I.curveness,(D[1]+N[1])/2-(N[0]-D[0])*I.curveness]),A.setLayout(T)}}),t.forceLayout=m,t.preservedPoints=a,m.step()}else t.forceLayout=null})}function To(r,t,e){var a=X(r.getBoxLayoutParams(),{aspect:e});return Ze(a,{width:t.getWidth(),height:t.getHeight()})}function No(r,t){var e=[];return r.eachSeriesByType("graph",function(a){var n=a.get("coordinateSystem");if(!n||n==="view"){var o=a.getData(),i=o.mapArray(function(p){var S=o.getItemModel(p);return[+S.get("x"),+S.get("y")]}),l=[],u=[];sr(i,l,u),u[0]-l[0]===0&&(u[0]+=1,l[0]-=1),u[1]-l[1]===0&&(u[1]+=1,l[1]-=1);var s=(u[0]-l[0])/(u[1]-l[1]),v=To(a,t,s);isNaN(s)&&(l=[v.x,v.y],u=[v.x+v.width,v.y+v.height]);var h=u[0]-l[0],c=u[1]-l[1],g=v.width,d=v.height,f=a.coordinateSystem=new ca;f.zoomLimit=a.get("scaleLimit"),f.setBoundingRect(l[0],l[1],h,c),f.setViewRect(v.x,v.y,g,d),f.setCenter(a.get("center"),t),f.setZoom(a.get("zoom")),e.push(f)}}),e}var Ht=[],Ot=[],Ft=[],He=Dn,Xt=Ln,Ka=Math.abs;function Ja(r,t,e){for(var a=r[0],n=r[1],o=r[2],i=1/0,l,u=e*e,s=.1,v=.1;v<=.9;v+=.1){Ht[0]=He(a[0],n[0],o[0],v),Ht[1]=He(a[1],n[1],o[1],v);var h=Ka(Xt(Ht,t)-u);h<i&&(i=h,l=v)}for(var c=0;c<32;c++){var g=l+s;Ot[0]=He(a[0],n[0],o[0],l),Ot[1]=He(a[1],n[1],o[1],l),Ft[0]=He(a[0],n[0],o[0],g),Ft[1]=He(a[1],n[1],o[1],g);var h=Xt(Ot,t)-u;if(Ka(h)<.01)break;var d=Xt(Ft,t)-u;s/=2,h<0?d>=0?l=l+s:l=l-s:d>=0?l=l-s:l=l+s}return l}function Wt(r,t){var e=[],a=In,n=[[],[],[]],o=[[],[]],i=[];t/=2,r.eachEdge(function(l,u){var s=l.getLayout(),v=l.getVisual("fromSymbol"),h=l.getVisual("toSymbol");s.__original||(s.__original=[Me(s[0]),Me(s[1])],s[2]&&s.__original.push(Me(s[2])));var c=s.__original;if(s[2]!=null){if(ue(n[0],c[0]),ue(n[1],c[2]),ue(n[2],c[1]),v&&v!=="none"){var g=Qe(l.node1),d=Ja(n,c[0],g*t);a(n[0][0],n[1][0],n[2][0],d,e),n[0][0]=e[3],n[1][0]=e[4],a(n[0][1],n[1][1],n[2][1],d,e),n[0][1]=e[3],n[1][1]=e[4]}if(h&&h!=="none"){var g=Qe(l.node2),d=Ja(n,c[1],g*t);a(n[0][0],n[1][0],n[2][0],d,e),n[1][0]=e[1],n[2][0]=e[2],a(n[0][1],n[1][1],n[2][1],d,e),n[1][1]=e[1],n[2][1]=e[2]}ue(s[0],n[0]),ue(s[1],n[2]),ue(s[2],n[1])}else{if(ue(o[0],c[0]),ue(o[1],c[1]),je(i,o[1],o[0]),sa(i,i),v&&v!=="none"){var g=Qe(l.node1);Qt(o[0],o[0],i,g*t)}if(h&&h!=="none"){var g=Qe(l.node2);Qt(o[1],o[1],i,-g*t)}ue(s[0],o[0]),ue(s[1],o[1])}})}function Qa(r){return r.type==="view"}var Mo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e,a){var n=new On,o=new Bn,i=this.group;this._controller=new va(a.getZr()),this._controllerHost={target:i},i.add(n.group),i.add(o.group),this._symbolDraw=n,this._lineDraw=o,this._firstRender=!0},t.prototype.render=function(e,a,n){var o=this,i=e.coordinateSystem;this._model=e;var l=this._symbolDraw,u=this._lineDraw,s=this.group;if(Qa(i)){var v={x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY};this._firstRender?s.attr(v):se(s,v,e)}Wt(e.getGraph(),Je(e));var h=e.getData();l.updateData(h);var c=e.getEdgeData();u.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,a,n),clearTimeout(this._layoutTimeout);var g=e.forceLayout,d=e.get(["force","layoutAnimation"]);g&&this._startForceLayoutIteration(g,d);var f=e.get("layout");h.graph.eachNode(function(y){var x=y.dataIndex,b=y.getGraphicEl(),w=y.getModel();if(b){b.off("drag").off("dragend");var L=w.get("draggable");L&&b.on("drag",function(A){switch(f){case"force":g.warmUp(),!o._layouting&&o._startForceLayoutIteration(g,d),g.setFixed(x),h.setItemLayout(x,[b.x,b.y]);break;case"circular":h.setItemLayout(x,[b.x,b.y]),y.setLayout({fixed:!0},!0),ma(e,"symbolSize",y,[A.offsetX,A.offsetY]),o.updateLayout(e);break;case"none":default:h.setItemLayout(x,[b.x,b.y]),ya(e.getGraph(),e),o.updateLayout(e);break}}).on("dragend",function(){g&&g.setUnfixed(x)}),b.setDraggable(L,!!w.get("cursor"));var I=w.get(["emphasis","focus"]);I==="adjacency"&&(pe(b).focus=y.getAdjacentDataIndices())}}),h.graph.eachEdge(function(y){var x=y.getGraphicEl(),b=y.getModel().get(["emphasis","focus"]);x&&b==="adjacency"&&(pe(x).focus={edge:[y.dataIndex],node:[y.node1.dataIndex,y.node2.dataIndex]})});var p=e.get("layout")==="circular"&&e.get(["circular","rotateLabel"]),S=h.getLayout("cx"),m=h.getLayout("cy");h.graph.eachNode(function(y){Wr(y,p,S,m)}),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,a){var n=this;(function o(){e.step(function(i){n.updateLayout(n._model),(n._layouting=!i)&&(a?n._layoutTimeout=setTimeout(o,16):o())})})()},t.prototype._updateController=function(e,a,n){var o=this,i=this._controller,l=this._controllerHost,u=this.group;if(i.setPointerChecker(function(s,v,h){var c=u.getBoundingRect();return c.applyTransform(u.transform),c.contain(v,h)&&!vr(s,n,e)}),!Qa(e.coordinateSystem)){i.disable();return}i.enable(e.get("roam")),l.zoomLimit=e.get("scaleLimit"),l.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",function(s){mr(l,s.dx,s.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:s.dx,dy:s.dy})}).on("zoom",function(s){Sr(l,s.scale,s.originX,s.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:s.scale,originX:s.originX,originY:s.originY}),o._updateNodeAndLinkScale(),Wt(e.getGraph(),Je(e)),o._lineDraw.updateLayout(),n.updateLabelLayout()})},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,a=e.getData(),n=Je(e);a.eachItemGraphicEl(function(o,i){o&&o.setSymbolScale(n)})},t.prototype.updateLayout=function(e){Wt(e.getGraph(),Je(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t})(Ie);function Oe(r){return"_EC_"+r}var Co=(function(){function r(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(t,e){t=t==null?""+e:""+t;var a=this._nodesMap;if(!a[Oe(t)]){var n=new Pe(t,e);return n.hostGraph=this,this.nodes.push(n),a[Oe(t)]=n,n}},r.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},r.prototype.getNodeById=function(t){return this._nodesMap[Oe(t)]},r.prototype.addEdge=function(t,e,a){var n=this._nodesMap,o=this._edgesMap;if(Ee(t)&&(t=this.nodes[t]),Ee(e)&&(e=this.nodes[e]),t instanceof Pe||(t=n[Oe(t)]),e instanceof Pe||(e=n[Oe(e)]),!(!t||!e)){var i=t.id+"-"+e.id,l=new Yr(t,e,a);return l.hostGraph=this,this._directed&&(t.outEdges.push(l),e.inEdges.push(l)),t.edges.push(l),t!==e&&e.edges.push(l),this.edges.push(l),o[i]=l,l}},r.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},r.prototype.getEdge=function(t,e){t instanceof Pe&&(t=t.id),e instanceof Pe&&(e=e.id);var a=this._edgesMap;return this._directed?a[t+"-"+e]:a[t+"-"+e]||a[e+"-"+t]},r.prototype.eachNode=function(t,e){for(var a=this.nodes,n=a.length,o=0;o<n;o++)a[o].dataIndex>=0&&t.call(e,a[o],o)},r.prototype.eachEdge=function(t,e){for(var a=this.edges,n=a.length,o=0;o<n;o++)a[o].dataIndex>=0&&a[o].node1.dataIndex>=0&&a[o].node2.dataIndex>=0&&t.call(e,a[o],o)},r.prototype.breadthFirstTraverse=function(t,e,a,n){if(e instanceof Pe||(e=this._nodesMap[Oe(e)]),!!e){for(var o=a==="out"?"outEdges":a==="in"?"inEdges":"edges",i=0;i<this.nodes.length;i++)this.nodes[i].__visited=!1;if(!t.call(n,e,null))for(var l=[e];l.length;)for(var u=l.shift(),s=u[o],i=0;i<s.length;i++){var v=s[i],h=v.node1===u?v.node2:v.node1;if(!h.__visited){if(t.call(n,h,u))return;l.push(h),h.__visited=!0}}}},r.prototype.update=function(){for(var t=this.data,e=this.edgeData,a=this.nodes,n=this.edges,o=0,i=a.length;o<i;o++)a[o].dataIndex=-1;for(var o=0,i=t.count();o<i;o++)a[t.getRawIndex(o)].dataIndex=o;e.filterSelf(function(l){var u=n[e.getRawIndex(l)];return u.node1.dataIndex>=0&&u.node2.dataIndex>=0});for(var o=0,i=n.length;o<i;o++)n[o].dataIndex=-1;for(var o=0,i=e.count();o<i;o++)n[e.getRawIndex(o)].dataIndex=o},r.prototype.clone=function(){for(var t=new r(this._directed),e=this.nodes,a=this.edges,n=0;n<e.length;n++)t.addNode(e[n].id,e[n].dataIndex);for(var n=0;n<a.length;n++){var o=a[n];t.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return t},r})(),Pe=(function(){function r(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=t??"",this.dataIndex=e??-1}return r.prototype.degree=function(){return this.edges.length},r.prototype.inDegree=function(){return this.inEdges.length},r.prototype.outDegree=function(){return this.outEdges.length},r.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostGraph,a=e.data.getItemModel(this.dataIndex);return a.getModel(t)}},r.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var a=this.edges[e];a.dataIndex<0||(t.edge.push(a.dataIndex),t.node.push(a.node1.dataIndex,a.node2.dataIndex))}return t},r.prototype.getTrajectoryDataIndices=function(){for(var t=rt(),e=rt(),a=0;a<this.edges.length;a++){var n=this.edges[a];if(!(n.dataIndex<0)){t.set(n.dataIndex,!0);for(var o=[n.node1],i=[n.node2],l=0;l<o.length;){var u=o[l];l++,e.set(u.dataIndex,!0);for(var s=0;s<u.inEdges.length;s++)t.set(u.inEdges[s].dataIndex,!0),o.push(u.inEdges[s].node1)}for(l=0;l<i.length;){var v=i[l];l++,e.set(v.dataIndex,!0);for(var s=0;s<v.outEdges.length;s++)t.set(v.outEdges[s].dataIndex,!0),i.push(v.outEdges[s].node2)}}}return{edge:t.keys(),node:e.keys()}},r})(),Yr=(function(){function r(t,e,a){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=a??-1}return r.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostGraph,a=e.edgeData.getItemModel(this.dataIndex);return a.getModel(t)}},r.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},r.prototype.getTrajectoryDataIndices=function(){var t=rt(),e=rt();t.set(this.dataIndex,!0);for(var a=[this.node1],n=[this.node2],o=0;o<a.length;){var i=a[o];o++,e.set(i.dataIndex,!0);for(var l=0;l<i.inEdges.length;l++)t.set(i.inEdges[l].dataIndex,!0),a.push(i.inEdges[l].node1)}for(o=0;o<n.length;){var u=n[o];o++,e.set(u.dataIndex,!0);for(var l=0;l<u.outEdges.length;l++)t.set(u.outEdges[l].dataIndex,!0),n.push(u.outEdges[l].node2)}return{edge:t.keys(),node:e.keys()}},r})();function Zr(r,t){return{getValue:function(e){var a=this[r][t];return a.getStore().get(a.getDimensionIndex(e||"value"),this.dataIndex)},setVisual:function(e,a){this.dataIndex>=0&&this[r][t].setItemVisual(this.dataIndex,e,a)},getVisual:function(e){return this[r][t].getItemVisual(this.dataIndex,e)},setLayout:function(e,a){this.dataIndex>=0&&this[r][t].setItemLayout(this.dataIndex,e,a)},getLayout:function(){return this[r][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][t].getRawIndex(this.dataIndex)}}}yr(Pe,Zr("hostGraph","data"));yr(Yr,Zr("hostGraph","edgeData"));function Ur(r,t,e,a,n){for(var o=new Co(a),i=0;i<r.length;i++)o.addNode(Jt(r[i].id,r[i].name,i),i);for(var l=[],u=[],s=0,i=0;i<t.length;i++){var v=t[i],h=v.source,c=v.target;o.addEdge(h,c,s)&&(u.push(v),l.push(Jt(wt(v.id,null),h+" > "+c)),s++)}var g=e.get("coordinateSystem"),d;if(g==="cartesian2d"||g==="polar")d=An(r,e);else{var f=Tn.get(g),p=f?f.dimensions||[]:[];It(p,"value")<0&&p.concat(["value"]);var S=hr(r,{coordDimensions:p,encodeDefine:e.getEncode()}).dimensions;d=new ft(S,e),d.initData(r)}var m=new ft(["value"],e);return m.initData(u,l),n&&n(d,m),Cr({mainData:d,struct:o,structAttr:"graph",datas:{node:d,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var Eo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.hasSymbolVisual=!0,e}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments);var a=this;function n(){return a._categoriesData}this.legendVisualProvider=new At(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},t.prototype.mergeOption=function(e){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(e){r.prototype.mergeDefaultAndTheme.apply(this,arguments),ia(e,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,a){var n=e.edges||e.links||[],o=e.data||e.nodes||[],i=this;if(o&&n){xo(this);var l=Ur(o,n,this,!0,u);return _(l.edges,function(s){bo(s.node1,s.node2,this,s.dataIndex)},this),l.data}function u(s,v){s.wrapMethod("getItemModel",function(d){var f=i._categoriesModels,p=d.getShallow("category"),S=f[p];return S&&(S.parentModel=d.parentModel,d.parentModel=S),d});var h=Ge.prototype.getModel;function c(d,f){var p=h.call(this,d,f);return p.resolveParentPath=g,p}v.wrapMethod("getItemModel",function(d){return d.resolveParentPath=g,d.getModel=c,d});function g(d){if(d&&(d[0]==="label"||d[1]==="label")){var f=d.slice();return d[0]==="label"?f[0]="edgeLabel":d[1]==="label"&&(f[1]="edgeLabel"),f}return d}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,a,n){if(n==="edge"){var o=this.getData(),i=this.getDataParams(e,n),l=o.graph.getEdgeByIndex(e),u=o.getName(l.node1.dataIndex),s=o.getName(l.node2.dataIndex),v=[];return u!=null&&v.push(u),s!=null&&v.push(s),Re("nameValue",{name:v.join(" > "),value:i.value,noValue:i.value==null})}var h=Nn({series:this,dataIndex:e,multipleSeries:a});return h},t.prototype._updateCategoriesData=function(){var e=we(this.option.categories||[],function(n){return n.value!=null?n:X({value:0},n)}),a=new ft(["value"],this);a.initData(e),this._categoriesData=a,this._categoriesModels=a.mapArray(function(n){return a.getItemModel(n)})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t})(De),Vo={type:"graphRoam",event:"graphRoam",update:"none"};function _o(r){r.registerChartView(Mo),r.registerSeriesModel(Eo),r.registerProcessor(fo),r.registerVisual(po),r.registerVisual(yo),r.registerLayout(wo),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,Do),r.registerLayout(Ao),r.registerCoordinateSystem("graphView",{dimensions:ca.dimensions,create:No}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Kt),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Kt),r.registerAction(Vo,function(t,e,a){e.eachComponent({mainType:"series",query:t},function(n){var o=n.coordinateSystem,i=xr(o,t,void 0,a);n.setCenter&&n.setCenter(i.center),n.setZoom&&n.setZoom(i.zoom)})})}var Po=(function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r})(),ko=(function(r){q(t,r);function t(e){var a=r.call(this,e)||this;return a.type="pointer",a}return t.prototype.getDefaultShape=function(){return new Po},t.prototype.buildPath=function(e,a){var n=Math.cos,o=Math.sin,i=a.r,l=a.width,u=a.angle,s=a.x-n(u)*l*(l>=i/3?1:2),v=a.y-o(u)*l*(l>=i/3?1:2);u=a.angle-Math.PI/2,e.moveTo(s,v),e.lineTo(a.x+n(u)*l,a.y+o(u)*l),e.lineTo(a.x+n(a.angle)*i,a.y+o(a.angle)*i),e.lineTo(a.x-n(u)*l,a.y-o(u)*l),e.lineTo(s,v)},t})(la);function Ro(r,t){var e=r.get("center"),a=t.getWidth(),n=t.getHeight(),o=Math.min(a,n),i=H(e[0],t.getWidth()),l=H(e[1],t.getHeight()),u=H(r.get("radius"),o/2);return{cx:i,cy:l,r:u}}function dt(r,t){var e=r==null?"":r+"";return t&&(ze(t)?e=t.replace("{value}",e):Ye(t)&&(e=t(r))),e}var zo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,a,n){this.group.removeAll();var o=e.get(["axisLine","lineStyle","color"]),i=Ro(e,n);this._renderMain(e,a,n,o,i),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,a,n,o,i){var l=this.group,u=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,v=-e.get("endAngle")/180*Math.PI,h=e.getModel("axisLine"),c=h.get("roundCap"),g=c?Ca:tt,d=h.get("show"),f=h.getModel("lineStyle"),p=f.get("width"),S=[s,v];nr(S,!u),s=S[0],v=S[1];for(var m=v-s,y=s,x=[],b=0;d&&b<o.length;b++){var w=Math.min(Math.max(o[b][0],0),1);v=s+m*w;var L=new g({shape:{startAngle:y,endAngle:v,cx:i.cx,cy:i.cy,clockwise:u,r0:i.r-p,r:i.r},silent:!0});L.setStyle({fill:o[b][1]}),L.setStyle(f.getLineStyle(["color","width"])),x.push(L),y=v}x.reverse(),_(x,function(A){return l.add(A)});var I=function(A){if(A<=0)return o[0][1];var D;for(D=0;D<o.length;D++)if(o[D][0]>=A&&(D===0?0:o[D-1][0])<A)return o[D][1];return o[D-1][1]};this._renderTicks(e,a,n,I,i,s,v,u,p),this._renderTitleAndDetail(e,a,n,I,i),this._renderAnchor(e,i),this._renderPointer(e,a,n,I,i,s,v,u,p)},t.prototype._renderTicks=function(e,a,n,o,i,l,u,s,v){for(var h=this.group,c=i.cx,g=i.cy,d=i.r,f=+e.get("min"),p=+e.get("max"),S=e.getModel("splitLine"),m=e.getModel("axisTick"),y=e.getModel("axisLabel"),x=e.get("splitNumber"),b=m.get("splitNumber"),w=H(S.get("length"),d),L=H(m.get("length"),d),I=l,A=(u-l)/x,D=A/b,N=S.getModel("lineStyle").getLineStyle(),T=m.getModel("lineStyle").getLineStyle(),M=S.get("distance"),P,E,C=0;C<=x;C++){if(P=Math.cos(I),E=Math.sin(I),S.get("show")){var V=M?M+v:v,k=new Na({shape:{x1:P*(d-V)+c,y1:E*(d-V)+g,x2:P*(d-w-V)+c,y2:E*(d-w-V)+g},style:N,silent:!0});N.stroke==="auto"&&k.setStyle({stroke:o(C/x)}),h.add(k)}if(y.get("show")){var V=y.get("distance")+M,R=dt(Mn(C/x*(p-f)+f),y.get("formatter")),z=o(C/x),B=P*(d-w-V)+c,F=E*(d-w-V)+g,$=y.get("rotate"),Y=0;$==="radial"?(Y=-I+2*Math.PI,Y>Math.PI/2&&(Y+=Math.PI)):$==="tangential"?Y=-I-Math.PI/2:Ee($)&&(Y=$*Math.PI/180),Y===0?h.add(new Ae({style:ke(y,{text:R,x:B,y:F,verticalAlign:E<-.8?"top":E>.8?"bottom":"middle",align:P<-.4?"left":P>.4?"right":"center"},{inheritColor:z}),silent:!0})):h.add(new Ae({style:ke(y,{text:R,x:B,y:F,verticalAlign:"middle",align:"center"},{inheritColor:z}),silent:!0,originX:B,originY:F,rotation:Y}))}if(m.get("show")&&C!==x){var V=m.get("distance");V=V?V+v:v;for(var j=0;j<=b;j++){P=Math.cos(I),E=Math.sin(I);var ne=new Na({shape:{x1:P*(d-V)+c,y1:E*(d-V)+g,x2:P*(d-L-V)+c,y2:E*(d-L-V)+g},silent:!0,style:T});T.stroke==="auto"&&ne.setStyle({stroke:o((C+j/b)/x)}),h.add(ne),I+=D}I-=D}else I+=A}},t.prototype._renderPointer=function(e,a,n,o,i,l,u,s,v){var h=this.group,c=this._data,g=this._progressEls,d=[],f=e.get(["pointer","show"]),p=e.getModel("progress"),S=p.get("show"),m=e.getData(),y=m.mapDimension("value"),x=+e.get("min"),b=+e.get("max"),w=[x,b],L=[l,u];function I(D,N){var T=m.getItemModel(D),M=T.getModel("pointer"),P=H(M.get("width"),i.r),E=H(M.get("length"),i.r),C=e.get(["pointer","icon"]),V=M.get("offsetCenter"),k=H(V[0],i.r),R=H(V[1],i.r),z=M.get("keepAspect"),B;return C?B=qt(C,k-P/2,R-E,P,E,null,z):B=new ko({shape:{angle:-Math.PI/2,width:P,r:E,x:k,y:R}}),B.rotation=-(N+Math.PI/2),B.x=i.cx,B.y=i.cy,B}function A(D,N){var T=p.get("roundCap"),M=T?Ca:tt,P=p.get("overlap"),E=P?p.get("width"):v/m.count(),C=P?i.r-E:i.r-(D+1)*E,V=P?i.r:i.r-D*E,k=new M({shape:{startAngle:l,endAngle:N,cx:i.cx,cy:i.cy,clockwise:s,r0:C,r:V}});return P&&(k.z2=ve(m.get(y,D),[x,b],[100,0],!0)),k}(S||f)&&(m.diff(c).add(function(D){var N=m.get(y,D);if(f){var T=I(D,l);fe(T,{rotation:-((isNaN(+N)?L[0]:ve(N,w,L,!0))+Math.PI/2)},e),h.add(T),m.setItemGraphicEl(D,T)}if(S){var M=A(D,l),P=p.get("clip");fe(M,{shape:{endAngle:ve(N,w,L,P)}},e),h.add(M),Ma(e.seriesIndex,m.dataType,D,M),d[D]=M}}).update(function(D,N){var T=m.get(y,D);if(f){var M=c.getItemGraphicEl(N),P=M?M.rotation:l,E=I(D,P);E.rotation=P,se(E,{rotation:-((isNaN(+T)?L[0]:ve(T,w,L,!0))+Math.PI/2)},e),h.add(E),m.setItemGraphicEl(D,E)}if(S){var C=g[N],V=C?C.shape.endAngle:l,k=A(D,V),R=p.get("clip");se(k,{shape:{endAngle:ve(T,w,L,R)}},e),h.add(k),Ma(e.seriesIndex,m.dataType,D,k),d[D]=k}}).execute(),m.each(function(D){var N=m.getItemModel(D),T=N.getModel("emphasis"),M=T.get("focus"),P=T.get("blurScope"),E=T.get("disabled");if(f){var C=m.getItemGraphicEl(D),V=m.getItemVisual(D,"style"),k=V.fill;if(C instanceof lr){var R=C.style;C.useStyle(X({image:R.image,x:R.x,y:R.y,width:R.width,height:R.height},V))}else C.useStyle(V),C.type!=="pointer"&&C.setColor(k);C.setStyle(N.getModel(["pointer","itemStyle"]).getItemStyle()),C.style.fill==="auto"&&C.setStyle("fill",o(ve(m.get(y,D),w,[0,1],!0))),C.z2EmphasisLift=0,Se(C,N),xe(C,M,P,E)}if(S){var z=d[D];z.useStyle(m.getItemVisual(D,"style")),z.setStyle(N.getModel(["progress","itemStyle"]).getItemStyle()),z.z2EmphasisLift=0,Se(z,N),xe(z,M,P,E)}}),this._progressEls=d)},t.prototype._renderAnchor=function(e,a){var n=e.getModel("anchor"),o=n.get("show");if(o){var i=n.get("size"),l=n.get("icon"),u=n.get("offsetCenter"),s=n.get("keepAspect"),v=qt(l,a.cx-i/2+H(u[0],a.r),a.cy-i/2+H(u[1],a.r),i,i,null,s);v.z2=n.get("showAbove")?1:0,v.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(v)}},t.prototype._renderTitleAndDetail=function(e,a,n,o,i){var l=this,u=e.getData(),s=u.mapDimension("value"),v=+e.get("min"),h=+e.get("max"),c=new be,g=[],d=[],f=e.isAnimationEnabled(),p=e.get(["pointer","showAbove"]);u.diff(this._data).add(function(S){g[S]=new Ae({silent:!0}),d[S]=new Ae({silent:!0})}).update(function(S,m){g[S]=l._titleEls[m],d[S]=l._detailEls[m]}).execute(),u.each(function(S){var m=u.getItemModel(S),y=u.get(s,S),x=new be,b=o(ve(y,[v,h],[0,1],!0)),w=m.getModel("title");if(w.get("show")){var L=w.get("offsetCenter"),I=i.cx+H(L[0],i.r),A=i.cy+H(L[1],i.r),D=g[S];D.attr({z2:p?0:2,style:ke(w,{x:I,y:A,text:u.getName(S),align:"center",verticalAlign:"middle"},{inheritColor:b})}),x.add(D)}var N=m.getModel("detail");if(N.get("show")){var T=N.get("offsetCenter"),M=i.cx+H(T[0],i.r),P=i.cy+H(T[1],i.r),E=H(N.get("width"),i.r),C=H(N.get("height"),i.r),V=e.get(["progress","show"])?u.getItemVisual(S,"style").fill:b,D=d[S],k=N.get("formatter");D.attr({z2:p?0:2,style:ke(N,{x:M,y:P,text:dt(y,k),width:isNaN(E)?null:E,height:isNaN(C)?null:C,align:"center",verticalAlign:"middle"},{inheritColor:V})}),Cn(D,{normal:N},y,function(z){return dt(z,k)}),f&&En(D,S,u,e,{getFormattedLabel:function(z,B,F,$,Y,j){return dt(j?j.interpolatedValue:y,k)}}),x.add(D)}c.add(x)}),this.group.add(c),this._titleEls=g,this._detailEls=d},t.type="gauge",t})(Ie),Go=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.visualStyleAccessPath="itemStyle",e}return t.prototype.getInitialData=function(e,a){return Lt(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t})(De);function Bo(r){r.registerChartView(zo),r.registerSeriesModel(Go)}var Ho=["itemStyle","opacity"],Oo=(function(r){q(t,r);function t(e,a){var n=r.call(this)||this,o=n,i=new bt,l=new Ae;return o.setTextContent(l),n.setTextGuideLine(i),n.updateData(e,a,!0),n}return t.prototype.updateData=function(e,a,n){var o=this,i=e.hostModel,l=e.getItemModel(a),u=e.getItemLayout(a),s=l.getModel("emphasis"),v=l.get(Ho);v=v??1,n||at(o),o.useStyle(e.getItemVisual(a,"style")),o.style.lineJoin="round",n?(o.setShape({points:u.points}),o.style.opacity=0,fe(o,{style:{opacity:v}},i,a)):se(o,{style:{opacity:v},shape:{points:u.points}},i,a),Se(o,l),this._updateLabel(e,a),xe(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,a){var n=this,o=this.getTextGuideLine(),i=n.getTextContent(),l=e.hostModel,u=e.getItemModel(a),s=e.getItemLayout(a),v=s.label,h=e.getItemVisual(a,"style"),c=h.fill;Xe(i,We(u),{labelFetcher:e.hostModel,labelDataIndex:a,defaultOpacity:h.opacity,defaultText:e.getName(a)},{normal:{align:v.textAlign,verticalAlign:v.verticalAlign}}),n.setTextConfig({local:!0,inside:!!v.inside,insideStroke:c,outsideFill:c});var g=v.linePoints;o.setShape({points:g}),n.textGuideLineConfig={anchor:g?new ee(g[0][0],g[0][1]):null},se(i,{style:{x:v.x,y:v.y}},l,a),i.attr({rotation:v.rotation,originX:v.x,originY:v.y,z2:10}),Ir(n,Dr(u),{stroke:c})},t})(oa),Fo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.ignoreLabelLineUpdate=!0,e}return t.prototype.render=function(e,a,n){var o=e.getData(),i=this._data,l=this.group;o.diff(i).add(function(u){var s=new Oo(o,u);o.setItemGraphicEl(u,s),l.add(s)}).update(function(u,s){var v=i.getItemGraphicEl(s);v.updateData(o,u),l.add(v),o.setItemGraphicEl(u,v)}).remove(function(u){var s=i.getItemGraphicEl(u);ir(s,e,u)}).execute(),this._data=o},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t})(Ie),Xo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new At(me(this.getData,this),me(this.getRawData,this)),this._defaultLabelLine(e)},t.prototype.getInitialData=function(e,a){return Lt(this,{coordDimensions:["value"],encodeDefaulter:ge(or,this)})},t.prototype._defaultLabelLine=function(e){ia(e,"labelLine",["show"]);var a=e.labelLine,n=e.emphasis.labelLine;a.show=a.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(e){var a=this.getData(),n=r.prototype.getDataParams.call(this,e),o=a.mapDimension("value"),i=a.getSum(o);return n.percent=i?+(a.get(o,e)/i*100).toFixed(2):0,n.$vars.push("percent"),n},t.type="series.funnel",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t})(De);function Wo(r,t){return Ze(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function Yo(r,t){for(var e=r.mapDimension("value"),a=r.mapArray(e,function(u){return u}),n=[],o=t==="ascending",i=0,l=r.count();i<l;i++)n[i]=i;return Ye(t)?n.sort(t):t!=="none"&&n.sort(function(u,s){return o?a[u]-a[s]:a[s]-a[u]}),n}function Zo(r){var t=r.hostModel,e=t.get("orient");r.each(function(a){var n=r.getItemModel(a),o=n.getModel("label"),i=o.get("position"),l=n.getModel("labelLine"),u=r.getItemLayout(a),s=u.points,v=i==="inner"||i==="inside"||i==="center"||i==="insideLeft"||i==="insideRight",h,c,g,d;if(v)i==="insideLeft"?(c=(s[0][0]+s[3][0])/2+5,g=(s[0][1]+s[3][1])/2,h="left"):i==="insideRight"?(c=(s[1][0]+s[2][0])/2-5,g=(s[1][1]+s[2][1])/2,h="right"):(c=(s[0][0]+s[1][0]+s[2][0]+s[3][0])/4,g=(s[0][1]+s[1][1]+s[2][1]+s[3][1])/4,h="center"),d=[[c,g],[c,g]];else{var f=void 0,p=void 0,S=void 0,m=void 0,y=l.get("length");i==="left"?(f=(s[3][0]+s[0][0])/2,p=(s[3][1]+s[0][1])/2,S=f-y,c=S-5,h="right"):i==="right"?(f=(s[1][0]+s[2][0])/2,p=(s[1][1]+s[2][1])/2,S=f+y,c=S+5,h="left"):i==="top"?(f=(s[3][0]+s[0][0])/2,p=(s[3][1]+s[0][1])/2,m=p-y,g=m-5,h="center"):i==="bottom"?(f=(s[1][0]+s[2][0])/2,p=(s[1][1]+s[2][1])/2,m=p+y,g=m+5,h="center"):i==="rightTop"?(f=e==="horizontal"?s[3][0]:s[1][0],p=e==="horizontal"?s[3][1]:s[1][1],e==="horizontal"?(m=p-y,g=m-5,h="center"):(S=f+y,c=S+5,h="top")):i==="rightBottom"?(f=s[2][0],p=s[2][1],e==="horizontal"?(m=p+y,g=m+5,h="center"):(S=f+y,c=S+5,h="bottom")):i==="leftTop"?(f=s[0][0],p=e==="horizontal"?s[0][1]:s[1][1],e==="horizontal"?(m=p-y,g=m-5,h="center"):(S=f-y,c=S-5,h="right")):i==="leftBottom"?(f=e==="horizontal"?s[1][0]:s[3][0],p=e==="horizontal"?s[1][1]:s[2][1],e==="horizontal"?(m=p+y,g=m+5,h="center"):(S=f-y,c=S-5,h="right")):(f=(s[1][0]+s[2][0])/2,p=(s[1][1]+s[2][1])/2,e==="horizontal"?(m=p+y,g=m+5,h="center"):(S=f+y,c=S+5,h="left")),e==="horizontal"?(S=f,c=S):(m=p,g=m),d=[[f,p],[S,m]]}u.label={linePoints:d,x:c,y:g,verticalAlign:"middle",textAlign:h,inside:v}})}function Uo(r,t){r.eachSeriesByType("funnel",function(e){var a=e.getData(),n=a.mapDimension("value"),o=e.get("sort"),i=Wo(e,t),l=e.get("orient"),u=i.width,s=i.height,v=Yo(a,o),h=i.x,c=i.y,g=l==="horizontal"?[H(e.get("minSize"),s),H(e.get("maxSize"),s)]:[H(e.get("minSize"),u),H(e.get("maxSize"),u)],d=a.getDataExtent(n),f=e.get("min"),p=e.get("max");f==null&&(f=Math.min(d[0],0)),p==null&&(p=d[1]);var S=e.get("funnelAlign"),m=e.get("gap"),y=l==="horizontal"?u:s,x=(y-m*(a.count()-1))/a.count(),b=function(P,E){if(l==="horizontal"){var C=a.get(n,P)||0,V=ve(C,[f,p],g,!0),k=void 0;switch(S){case"top":k=c;break;case"center":k=c+(s-V)/2;break;case"bottom":k=c+(s-V);break}return[[E,k],[E,k+V]]}var R=a.get(n,P)||0,z=ve(R,[f,p],g,!0),B;switch(S){case"left":B=h;break;case"center":B=h+(u-z)/2;break;case"right":B=h+u-z;break}return[[B,E],[B+z,E]]};o==="ascending"&&(x=-x,m=-m,l==="horizontal"?h+=u:c+=s,v=v.reverse());for(var w=0;w<v.length;w++){var L=v[w],I=v[w+1],A=a.getItemModel(L);if(l==="horizontal"){var D=A.get(["itemStyle","width"]);D==null?D=x:(D=H(D,u),o==="ascending"&&(D=-D));var N=b(L,h),T=b(I,h+D);h+=D+m,a.setItemLayout(L,{points:N.concat(T.slice().reverse())})}else{var M=A.get(["itemStyle","height"]);M==null?M=x:(M=H(M,s),o==="ascending"&&(M=-M));var N=b(L,c),T=b(I,c+M);c+=M+m,a.setItemLayout(L,{points:N.concat(T.slice().reverse())})}}Zo(a)})}function qo(r){r.registerChartView(Fo),r.registerSeriesModel(Xo),r.registerLayout(Uo),r.registerProcessor(Tt("funnel"))}var $o=(function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r})(),jo=(function(r){q(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new $o},t.prototype.buildPath=function(e,a){var n=a.extent;e.moveTo(a.x1,a.y1),e.bezierCurveTo(a.cpx1,a.cpy1,a.cpx2,a.cpy2,a.x2,a.y2),a.orient==="vertical"?(e.lineTo(a.x2+n,a.y2),e.bezierCurveTo(a.cpx2+n,a.cpy2,a.cpx1+n,a.cpy1,a.x1+n,a.y1)):(e.lineTo(a.x2,a.y2+n),e.bezierCurveTo(a.cpx2,a.cpy2+n,a.cpx1,a.cpy1+n,a.x1,a.y1+n)),e.closePath()},t.prototype.highlight=function(){Vn(this)},t.prototype.downplay=function(){_n(this)},t})(la),Ko=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._focusAdjacencyDisabled=!1,e}return t.prototype.render=function(e,a,n){var o=this,i=e.getGraph(),l=this.group,u=e.layoutInfo,s=u.width,v=u.height,h=e.getData(),c=e.getData("edge"),g=e.get("orient");this._model=e,l.removeAll(),l.x=u.x,l.y=u.y,i.eachEdge(function(d){var f=new jo,p=pe(f);p.dataIndex=d.dataIndex,p.seriesIndex=e.seriesIndex,p.dataType="edge";var S=d.getModel(),m=S.getModel("lineStyle"),y=m.get("curveness"),x=d.node1.getLayout(),b=d.node1.getModel(),w=b.get("localX"),L=b.get("localY"),I=d.node2.getLayout(),A=d.node2.getModel(),D=A.get("localX"),N=A.get("localY"),T=d.getLayout(),M,P,E,C,V,k,R,z;f.shape.extent=Math.max(1,T.dy),f.shape.orient=g,g==="vertical"?(M=(w!=null?w*s:x.x)+T.sy,P=(L!=null?L*v:x.y)+x.dy,E=(D!=null?D*s:I.x)+T.ty,C=N!=null?N*v:I.y,V=M,k=P*(1-y)+C*y,R=E,z=P*y+C*(1-y)):(M=(w!=null?w*s:x.x)+x.dx,P=(L!=null?L*v:x.y)+T.sy,E=D!=null?D*s:I.x,C=(N!=null?N*v:I.y)+T.ty,V=M*(1-y)+E*y,k=P,R=M*y+E*(1-y),z=C),f.setShape({x1:M,y1:P,x2:E,y2:C,cpx1:V,cpy1:k,cpx2:R,cpy2:z}),f.useStyle(m.getItemStyle()),er(f.style,g,d);var B=""+S.get("value"),F=We(S,"edgeLabel");Xe(f,F,{labelFetcher:{getFormattedLabel:function(j,ne,he,O,G,Z){return e.getFormattedLabel(j,ne,"edge",O,ut(G,F.normal&&F.normal.get("formatter"),B),Z)}},labelDataIndex:d.dataIndex,defaultText:B}),f.setTextConfig({position:"inside"});var $=S.getModel("emphasis");Se(f,S,"lineStyle",function(j){var ne=j.getItemStyle();return er(ne,g,d),ne}),l.add(f),c.setItemGraphicEl(d.dataIndex,f);var Y=$.get("focus");xe(f,Y==="adjacency"?d.getAdjacentDataIndices():Y==="trajectory"?d.getTrajectoryDataIndices():Y,$.get("blurScope"),$.get("disabled"))}),i.eachNode(function(d){var f=d.getLayout(),p=d.getModel(),S=p.get("localX"),m=p.get("localY"),y=p.getModel("emphasis"),x=p.get(["itemStyle","borderRadius"])||0,b=new ua({shape:{x:S!=null?S*s:f.x,y:m!=null?m*v:f.y,width:f.dx,height:f.dy,r:x},style:p.getModel("itemStyle").getItemStyle(),z2:10});Xe(b,We(p),{labelFetcher:{getFormattedLabel:function(L,I){return e.getFormattedLabel(L,I,"node")}},labelDataIndex:d.dataIndex,defaultText:d.id}),b.disableLabelAnimation=!0,b.setStyle("fill",d.getVisual("color")),b.setStyle("decal",d.getVisual("style").decal),Se(b,p),l.add(b),h.setItemGraphicEl(d.dataIndex,b),pe(b).dataType="node";var w=y.get("focus");xe(b,w==="adjacency"?d.getAdjacentDataIndices():w==="trajectory"?d.getTrajectoryDataIndices():w,y.get("blurScope"),y.get("disabled"))}),h.eachItemGraphicEl(function(d,f){var p=h.getItemModel(f);p.get("draggable")&&(d.drift=function(S,m){o._focusAdjacencyDisabled=!0,this.shape.x+=S,this.shape.y+=m,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:h.getRawIndex(f),localX:this.shape.x/s,localY:this.shape.y/v})},d.ondragend=function(){o._focusAdjacencyDisabled=!1},d.draggable=!0,d.cursor="move")}),!this._data&&e.isAnimationEnabled()&&l.setClipPath(Jo(l.getBoundingRect(),e,function(){l.removeClipPath()})),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t})(Ie);function er(r,t,e){switch(r.fill){case"source":r.fill=e.node1.getVisual("color"),r.decal=e.node1.getVisual("style").decal;break;case"target":r.fill=e.node2.getVisual("color"),r.decal=e.node2.getVisual("style").decal;break;case"gradient":var a=e.node1.getVisual("color"),n=e.node2.getVisual("color");ze(a)&&ze(n)&&(r.fill=new Pn(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:a,offset:0},{color:n,offset:1}]))}}function Jo(r,t,e){var a=new ua({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return fe(a,{shape:{width:r.width+20}},t,e),a}var Qo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(e,a){var n=e.edges||e.links||[],o=e.data||e.nodes||[],i=e.levels||[];this.levelModels=[];for(var l=this.levelModels,u=0;u<i.length;u++)i[u].depth!=null&&i[u].depth>=0&&(l[i[u].depth]=new Ge(i[u],this,a));var s=Ur(o,n,this,!0,v);return s.data;function v(h,c){h.wrapMethod("getItemModel",function(g,d){var f=g.parentModel,p=f.getData().getItemLayout(d);if(p){var S=p.depth,m=f.levelModels[S];m&&(g.parentModel=m)}return g}),c.wrapMethod("getItemModel",function(g,d){var f=g.parentModel,p=f.getGraph().getEdgeByIndex(d),S=p.node1.getLayout();if(S){var m=S.depth,y=f.levelModels[m];y&&(g.parentModel=y)}return g})}},t.prototype.setNodePosition=function(e,a){var n=this.option.data||this.option.nodes,o=n[e];o.localX=a[0],o.localY=a[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,a,n){function o(g){return isNaN(g)||g==null}if(n==="edge"){var i=this.getDataParams(e,n),l=i.data,u=i.value,s=l.source+" -- "+l.target;return Re("nameValue",{name:s,value:u,noValue:o(u)})}else{var v=this.getGraph().getNodeByIndex(e),h=v.getLayout().value,c=this.getDataParams(e,n).data.name;return Re("nameValue",{name:c!=null?c+"":null,value:h,noValue:o(h)})}},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(e,a){var n=r.prototype.getDataParams.call(this,e,a);if(n.value==null&&a==="node"){var o=this.getGraph().getNodeByIndex(e),i=o.getLayout().value;n.value=i}return n},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t})(De);function el(r,t){r.eachSeriesByType("sankey",function(e){var a=e.get("nodeWidth"),n=e.get("nodeGap"),o=tl(e,t);e.layoutInfo=o;var i=o.width,l=o.height,u=e.getGraph(),s=u.nodes,v=u.edges;rl(s);var h=pr(s,function(f){return f.getLayout().value===0}),c=h.length!==0?0:e.get("layoutIterations"),g=e.get("orient"),d=e.get("nodeAlign");al(s,v,a,n,i,l,c,g,d)})}function tl(r,t){return Ze(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function al(r,t,e,a,n,o,i,l,u){nl(r,t,e,n,o,l,u),ul(r,t,o,n,a,i,l),yl(r,l)}function rl(r){_(r,function(t){var e=Ce(t.outEdges,xt),a=Ce(t.inEdges,xt),n=t.getValue()||0,o=Math.max(e,a,n);t.setLayout({value:o},!0)})}function nl(r,t,e,a,n,o,i){for(var l=[],u=[],s=[],v=[],h=0,c=0;c<t.length;c++)l[c]=1;for(var c=0;c<r.length;c++)u[c]=r[c].inEdges.length,u[c]===0&&s.push(r[c]);for(var g=-1;s.length;){for(var d=0;d<s.length;d++){var f=s[d],p=f.hostGraph.data.getRawDataItem(f.dataIndex),S=p.depth!=null&&p.depth>=0;S&&p.depth>g&&(g=p.depth),f.setLayout({depth:S?p.depth:h},!0),o==="vertical"?f.setLayout({dy:e},!0):f.setLayout({dx:e},!0);for(var m=0;m<f.outEdges.length;m++){var y=f.outEdges[m],x=t.indexOf(y);l[x]=0;var b=y.node2,w=r.indexOf(b);--u[w]===0&&v.indexOf(b)<0&&v.push(b)}}++h,s=v,v=[]}for(var c=0;c<l.length;c++)if(l[c]===1)throw new Error("Sankey is a DAG, the original data has cycle!");var L=g>h-1?g:h-1;i&&i!=="left"&&il(r,i,o,L);var I=o==="vertical"?(n-e)/L:(a-e)/L;ll(r,I,o)}function qr(r){var t=r.hostGraph.data.getRawDataItem(r.dataIndex);return t.depth!=null&&t.depth>=0}function il(r,t,e,a){if(t==="right"){for(var n=[],o=r,i=0;o.length;){for(var l=0;l<o.length;l++){var u=o[l];u.setLayout({skNodeHeight:i},!0);for(var s=0;s<u.inEdges.length;s++){var v=u.inEdges[s];n.indexOf(v.node1)<0&&n.push(v.node1)}}o=n,n=[],++i}_(r,function(h){qr(h)||h.setLayout({depth:Math.max(0,a-h.getLayout().skNodeHeight)},!0)})}else t==="justify"&&ol(r,a)}function ol(r,t){_(r,function(e){!qr(e)&&!e.outEdges.length&&e.setLayout({depth:t},!0)})}function ll(r,t,e){_(r,function(a){var n=a.getLayout().depth*t;e==="vertical"?a.setLayout({y:n},!0):a.setLayout({x:n},!0)})}function ul(r,t,e,a,n,o,i){var l=sl(r,i);vl(l,t,e,a,n,i),Yt(l,n,e,a,i);for(var u=1;o>0;o--)u*=.99,cl(l,u,i),Yt(l,n,e,a,i),pl(l,u,i),Yt(l,n,e,a,i)}function sl(r,t){var e=[],a=t==="vertical"?"y":"x",n=kn(r,function(o){return o.getLayout()[a]});return n.keys.sort(function(o,i){return o-i}),_(n.keys,function(o){e.push(n.buckets.get(o))}),e}function vl(r,t,e,a,n,o){var i=1/0;_(r,function(l){var u=l.length,s=0;_(l,function(h){s+=h.getLayout().value});var v=o==="vertical"?(a-(u-1)*n)/s:(e-(u-1)*n)/s;v<i&&(i=v)}),_(r,function(l){_(l,function(u,s){var v=u.getLayout().value*i;o==="vertical"?(u.setLayout({x:s},!0),u.setLayout({dx:v},!0)):(u.setLayout({y:s},!0),u.setLayout({dy:v},!0))})}),_(t,function(l){var u=+l.getValue()*i;l.setLayout({dy:u},!0)})}function Yt(r,t,e,a,n){var o=n==="vertical"?"x":"y";_(r,function(i){i.sort(function(f,p){return f.getLayout()[o]-p.getLayout()[o]});for(var l,u,s,v=0,h=i.length,c=n==="vertical"?"dx":"dy",g=0;g<h;g++)u=i[g],s=v-u.getLayout()[o],s>0&&(l=u.getLayout()[o]+s,n==="vertical"?u.setLayout({x:l},!0):u.setLayout({y:l},!0)),v=u.getLayout()[o]+u.getLayout()[c]+t;var d=n==="vertical"?a:e;if(s=v-t-d,s>0){l=u.getLayout()[o]-s,n==="vertical"?u.setLayout({x:l},!0):u.setLayout({y:l},!0),v=l;for(var g=h-2;g>=0;--g)u=i[g],s=u.getLayout()[o]+u.getLayout()[c]+t-v,s>0&&(l=u.getLayout()[o]-s,n==="vertical"?u.setLayout({x:l},!0):u.setLayout({y:l},!0)),v=u.getLayout()[o]}})}function cl(r,t,e){_(r.slice().reverse(),function(a){_(a,function(n){if(n.outEdges.length){var o=Ce(n.outEdges,hl,e)/Ce(n.outEdges,xt);if(isNaN(o)){var i=n.outEdges.length;o=i?Ce(n.outEdges,gl,e)/i:0}if(e==="vertical"){var l=n.getLayout().x+(o-Ve(n,e))*t;n.setLayout({x:l},!0)}else{var u=n.getLayout().y+(o-Ve(n,e))*t;n.setLayout({y:u},!0)}}})})}function hl(r,t){return Ve(r.node2,t)*r.getValue()}function gl(r,t){return Ve(r.node2,t)}function dl(r,t){return Ve(r.node1,t)*r.getValue()}function fl(r,t){return Ve(r.node1,t)}function Ve(r,t){return t==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function xt(r){return r.getValue()}function Ce(r,t,e){for(var a=0,n=r.length,o=-1;++o<n;){var i=+t(r[o],e);isNaN(i)||(a+=i)}return a}function pl(r,t,e){_(r,function(a){_(a,function(n){if(n.inEdges.length){var o=Ce(n.inEdges,dl,e)/Ce(n.inEdges,xt);if(isNaN(o)){var i=n.inEdges.length;o=i?Ce(n.inEdges,fl,e)/i:0}if(e==="vertical"){var l=n.getLayout().x+(o-Ve(n,e))*t;n.setLayout({x:l},!0)}else{var u=n.getLayout().y+(o-Ve(n,e))*t;n.setLayout({y:u},!0)}}})})}function yl(r,t){var e=t==="vertical"?"x":"y";_(r,function(a){a.outEdges.sort(function(n,o){return n.node2.getLayout()[e]-o.node2.getLayout()[e]}),a.inEdges.sort(function(n,o){return n.node1.getLayout()[e]-o.node1.getLayout()[e]})}),_(r,function(a){var n=0,o=0;_(a.outEdges,function(i){i.setLayout({sy:n},!0),n+=i.getLayout().dy}),_(a.inEdges,function(i){i.setLayout({ty:o},!0),o+=i.getLayout().dy})})}function ml(r){r.eachSeriesByType("sankey",function(t){var e=t.getGraph(),a=e.nodes,n=e.edges;if(a.length){var o=1/0,i=-1/0;_(a,function(l){var u=l.getLayout().value;u<o&&(o=u),u>i&&(i=u)}),_(a,function(l){var u=new br({type:"color",mappingMethod:"linear",dataExtent:[o,i],visual:t.get("color")}),s=u.mapValueToVisual(l.getLayout().value),v=l.getModel().get(["itemStyle","color"]);v!=null?(l.setVisual("color",v),l.setVisual("style",{fill:v})):(l.setVisual("color",s),l.setVisual("style",{fill:s}))})}n.length&&_(n,function(l){var u=l.getModel().get("lineStyle");l.setVisual("style",u)})})}function Sl(r){r.registerChartView(Ko),r.registerSeriesModel(Qo),r.registerLayout(el),r.registerVisual(ml),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},function(a){a.setNodePosition(t.dataIndex,[t.localX,t.localY])})})}var xl=2,bl=4,tr=(function(r){q(t,r);function t(e,a,n,o){var i=r.call(this)||this;i.z2=xl,i.textConfig={inside:!0},pe(i).seriesIndex=a.seriesIndex;var l=new Ae({z2:bl,silent:e.getModel().get(["label","silent"])});return i.setTextContent(l),i.updateData(!0,e,a,n,o),i}return t.prototype.updateData=function(e,a,n,o,i){this.node=a,a.piece=this,n=n||this._seriesModel,o=o||this._ecModel;var l=this;pe(l).dataIndex=a.dataIndex;var u=a.getModel(),s=u.getModel("emphasis"),v=a.getLayout(),h=X({},v);h.label=null;var c=a.getVisual("style");c.lineJoin="bevel";var g=a.getVisual("decal");g&&(c.decal=Rn(g,i));var d=Fe(u.getModel("itemStyle"),h,!0);X(h,d),_(Ut,function(m){var y=l.ensureState(m),x=u.getModel([m,"itemStyle"]);y.style=x.getItemStyle();var b=Fe(x,h);b&&(y.shape=b)}),e?(l.setShape(h),l.shape.r=v.r0,fe(l,{shape:{r:v.r}},n,a.dataIndex)):(se(l,{shape:h},n),at(l)),l.useStyle(c),this._updateLabel(n);var f=u.getShallow("cursor");f&&l.attr("cursor",f),this._seriesModel=n||this._seriesModel,this._ecModel=o||this._ecModel;var p=s.get("focus"),S=p==="relative"?cr(a.getAncestorsIndices(),a.getDescendantIndices()):p==="ancestor"?a.getAncestorsIndices():p==="descendant"?a.getDescendantIndices():p;xe(this,S,s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e){var a=this,n=this.node.getModel(),o=n.getModel("label"),i=this.node.getLayout(),l=i.endAngle-i.startAngle,u=(i.startAngle+i.endAngle)/2,s=Math.cos(u),v=Math.sin(u),h=this,c=h.getTextContent(),g=this.node.dataIndex,d=o.get("minAngle")/180*Math.PI,f=o.get("show")&&!(d!=null&&Math.abs(l)<d);c.ignore=!f,_(Zt,function(S){var m=S==="normal"?n.getModel("label"):n.getModel([S,"label"]),y=S==="normal",x=y?c:c.ensureState(S),b=e.getFormattedLabel(g,S);y&&(b=b||a.node.name),x.style=ke(m,{},null,S!=="normal",!0),b&&(x.style.text=b);var w=m.get("show");w!=null&&!y&&(x.ignore=!w);var L=p(m,"position"),I=y?h:h.states[S],A=I.style.fill;I.textConfig={outsideFill:m.get("color")==="inherit"?A:null,inside:L!=="outside"};var D,N=p(m,"distance")||0,T=p(m,"align"),M=p(m,"rotate"),P=Math.PI*.5,E=Math.PI*1.5,C=ct(M==="tangential"?Math.PI/2-u:u),V=C>P&&!zn(C-P)&&C<E;L==="outside"?(D=i.r+N,T=V?"right":"left"):!T||T==="center"?(l===2*Math.PI&&i.r0===0?D=0:D=(i.r+i.r0)/2,T="center"):T==="left"?(D=i.r0+N,T=V?"right":"left"):T==="right"&&(D=i.r-N,T=V?"left":"right"),x.style.align=T,x.style.verticalAlign=p(m,"verticalAlign")||"middle",x.x=D*s+i.cx,x.y=D*v+i.cy;var k=0;M==="radial"?k=ct(-u)+(V?Math.PI:0):M==="tangential"?k=ct(Math.PI/2-u)+(V?Math.PI:0):Ee(M)&&(k=M*Math.PI/180),x.rotation=ct(k)});function p(S,m){var y=S.get(m);return y??o.get(m)}c.dirtyStyle()},t})(tt),na="sunburstRootToNode",ar="sunburstHighlight",wl="sunburstUnhighlight";function Il(r){r.registerAction({type:na,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},a);function a(n,o){var i=nt(t,[na],n);if(i){var l=n.getViewRoot();l&&(t.direction=da(l,i.node)?"rollUp":"drillDown"),n.resetViewRoot(i.node)}}}),r.registerAction({type:ar,update:"none"},function(t,e,a){t=X({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},n);function n(o){var i=nt(t,[ar],o);i&&(t.dataIndex=i.node.dataIndex)}a.dispatchAction(X(t,{type:"highlight"}))}),r.registerAction({type:wl,update:"updateView"},function(t,e,a){t=X({},t),a.dispatchAction(X(t,{type:"downplay"}))})}var Dl=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,a,n,o){var i=this;this.seriesModel=e,this.api=n,this.ecModel=a;var l=e.getData(),u=l.tree.root,s=e.getViewRoot(),v=this.group,h=e.get("renderLabelForZeroData"),c=[];s.eachNode(function(m){c.push(m)});var g=this._oldChildren||[];d(c,g),S(u,s),this._initEvents(),this._oldChildren=c;function d(m,y){if(m.length===0&&y.length===0)return;new gr(y,m,x,x).add(b).update(b).remove(ge(b,null)).execute();function x(w){return w.getId()}function b(w,L){var I=w==null?null:m[w],A=L==null?null:y[L];f(I,A)}}function f(m,y){if(!h&&m&&!m.getValue()&&(m=null),m!==u&&y!==u){if(y&&y.piece)m?(y.piece.updateData(!1,m,e,a,n),l.setItemGraphicEl(m.dataIndex,y.piece)):p(y);else if(m){var x=new tr(m,e,a,n);v.add(x),l.setItemGraphicEl(m.dataIndex,x)}}}function p(m){m&&m.piece&&(v.remove(m.piece),m.piece=null)}function S(m,y){y.depth>0?(i.virtualPiece?i.virtualPiece.updateData(!1,m,e,a,n):(i.virtualPiece=new tr(m,e,a,n),v.add(i.virtualPiece)),y.piece.off("click"),i.virtualPiece.on("click",function(x){i._rootToNode(y.parentNode)})):i.virtualPiece&&(v.remove(i.virtualPiece),i.virtualPiece=null)}},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",function(a){var n=!1,o=e.seriesModel.getViewRoot();o.eachNode(function(i){if(!n&&i.piece&&i.piece===a.target){var l=i.getModel().get("nodeClick");if(l==="rootToNode")e._rootToNode(i);else if(l==="link"){var u=i.getModel(),s=u.get("link");if(s){var v=u.get("target",!0)||"_blank";dr(s,v)}}n=!0}})})},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:na,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,a){var n=a.getData(),o=n.getItemLayout(0);if(o){var i=e[0]-o.cx,l=e[1]-o.cy,u=Math.sqrt(i*i+l*l);return u<=o.r&&u>=o.r0}},t.type="sunburst",t})(Ie),Ll=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.ignoreStyleOnData=!0,e}return t.prototype.getInitialData=function(e,a){var n={name:e.name,children:e.data};$r(n);var o=this._levelModels=we(e.levels||[],function(u){return new Ge(u,this,a)},this),i=ga.createTree(n,this,l);function l(u){u.wrapMethod("getItemModel",function(s,v){var h=i.getNodeByDataIndex(v),c=o[h.depth];return c&&(s.parentModel=c),s})}return i.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(e){var a=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return a.treePathInfo=Nt(n,this),a},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var a=this.getRawData().tree.root;(!e||e!==a&&!a.contains(e))&&(this._viewRoot=a)},t.prototype.enableAriaDecal=function(){_r(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t})(De);function $r(r){var t=0;_(r.children,function(a){$r(a);var n=a.value;te(n)&&(n=n[0]),t+=n});var e=r.value;te(e)&&(e=e[0]),(e==null||isNaN(e))&&(e=t),e<0&&(e=0),te(r.value)?r.value[0]=e:r.value=e}var rr=Math.PI/180;function Al(r,t,e){t.eachSeriesByType(r,function(a){var n=a.get("center"),o=a.get("radius");te(o)||(o=[0,o]),te(n)||(n=[n,n]);var i=e.getWidth(),l=e.getHeight(),u=Math.min(i,l),s=H(n[0],i),v=H(n[1],l),h=H(o[0],u/2),c=H(o[1],u/2),g=-a.get("startAngle")*rr,d=a.get("minAngle")*rr,f=a.getData().tree.root,p=a.getViewRoot(),S=p.depth,m=a.get("sort");m!=null&&jr(p,m);var y=0;_(p.children,function(C){!isNaN(C.getValue())&&y++});var x=p.getValue(),b=Math.PI/(x||y)*2,w=p.depth>0,L=p.height-(w?-1:1),I=(c-h)/(L||1),A=a.get("clockwise"),D=a.get("stillShowZeroSum"),N=A?1:-1,T=function(C,V){if(C){var k=V;if(C!==f){var R=C.getValue(),z=x===0&&D?b:R*b;z<d&&(z=d),k=V+N*z;var B=C.depth-S-(w?-1:1),F=h+I*B,$=h+I*(B+1),Y=a.getLevelModel(C);if(Y){var j=Y.get("r0",!0),ne=Y.get("r",!0),he=Y.get("radius",!0);he!=null&&(j=he[0],ne=he[1]),j!=null&&(F=H(j,u/2)),ne!=null&&($=H(ne,u/2))}C.setLayout({angle:z,startAngle:V,endAngle:k,clockwise:A,cx:s,cy:v,r0:F,r:$})}if(C.children&&C.children.length){var O=0;_(C.children,function(G){O+=T(G,V+O)})}return k-V}};if(w){var M=h,P=h+I,E=Math.PI*2;f.setLayout({angle:E,startAngle:g,endAngle:g+E,clockwise:A,cx:s,cy:v,r0:M,r:P})}T(p,g)})}function jr(r,t){var e=r.children||[];r.children=Tl(e,t),e.length&&_(r.children,function(a){jr(a,t)})}function Tl(r,t){if(Ye(t)){var e=we(r,function(n,o){var i=n.getValue();return{params:{depth:n.depth,height:n.height,dataIndex:n.dataIndex,getValue:function(){return i}},index:o}});return e.sort(function(n,o){return t(n.params,o.params)}),we(e,function(n){return r[n.index]})}else{var a=t==="asc";return r.sort(function(n,o){var i=(n.getValue()-o.getValue())*(a?1:-1);return i===0?(n.dataIndex-o.dataIndex)*(a?-1:1):i})}}function Nl(r){var t={};function e(a,n,o){for(var i=a;i&&i.depth>1;)i=i.parentNode;var l=n.getColorFromPalette(i.name||i.dataIndex+"",t);return a.depth>1&&ze(l)&&(l=Gn(l,(a.depth-1)/(o-1)*.5)),l}r.eachSeriesByType("sunburst",function(a){var n=a.getData(),o=n.tree;o.eachNode(function(i){var l=i.getModel(),u=l.getModel("itemStyle").getItemStyle();u.fill||(u.fill=e(i,a,o.root.height));var s=n.ensureUniqueItemVisual(i.dataIndex,"style");X(s,u)})})}function Ml(r){r.registerChartView(Dl),r.registerSeriesModel(Ll),r.registerLayout(ge(Al,"sunburst")),r.registerProcessor(ge(Tt,"sunburst")),r.registerVisual(Nl),Il(r)}ur([qo,Bo,_o,ti,oi,Sl,Ml,Pi,go]);
1
+ import{au as ee,av as Zt,ab as xa,aw as bt,k as et,z as Ut,ax as ba,ay as Et,az as nr,aA as ve,aB as Ze,H as te,a4 as H,aC as lt,y as _,b as Ee,aD as Kr,_ as q,M as tt,N as X,K as ir,C as Ie,Z as Ae,j as fe,x as se,J as at,s as Se,t as xe,r as Xe,u as We,aE as ut,f as me,T as ge,aF as or,aG as Jr,aH as ia,S as De,aI as Qr,aJ as en,aK as oa,G as be,al as lr,aL as tn,m as we,a2 as an,ae as rn,a as qt,aM as nn,aN as Re,X as ur,aO as sr,aP as vr,aQ as cr,l as pe,aR as on,n as ln,ah as $t,aS as un,aT as jt,P as la,aU as sn,aV as vn,aW as wt,as as hr,at as ft,o as Ye,D as ze,a3 as It,aX as Ge,aY as Kt,aZ as cn,a_ as rt,a$ as wa,b0 as hn,b1 as gn,b2 as Dt,b3 as ke,b4 as gr,W as pt,b5 as Ia,b6 as dn,b7 as dr,b8 as Da,b9 as vt,ba as La,bb as fn,bc as pn,R as ua,bd as yn,be as mn,bf as fr,bg as Sn,aj as Jt,bh as pr,bi as Aa,bj as Me,bk as sa,bl as xn,bm as bn,bn as je,bo as Ta,bp as wn,bq as ue,br as Qt,bs as In,bt as Dn,bu as Ln,a1 as yr,c as An,bv as Tn,bw as Nn,bx as Na,ap as Mn,by as Ma,O as Cn,bz as En,ac as Vn,ad as _n,L as Pn,bA as kn,bB as Rn,bC as ct,bD as zn,bE as Gn}from"./echarts-runtime-Ce_z2eX_.js";import{c as Lt}from"./createSeriesDataSimply-CPqysF0K.js";import{L as At,d as Tt}from"./LegendVisualProvider-Bdgkckq-.js";import{g as Fe,S as Ca}from"./sectorHelper-BuxrrJrA.js";import{R as va,V as ca,u as mr,a as Sr,b as xr,L as Bn}from"./LineDraw-BBB5hwuJ.js";import{a as Hn,S as On}from"./SymbolDraw-CKS3uUb_.js";import{i as Fn,V as br}from"./VisualMapping-BCwaW3TD.js";import"./index-Cc6awvdg.js";import"./labelHelper-Dk5jkiD-.js";function wr(r,t,e,a,n,o,i,l){var u=n-r,s=o-t,v=e-r,h=a-t,c=Math.sqrt(v*v+h*h);v/=c,h/=c;var g=u*v+s*h,d=g/c;d*=c;var f=i[0]=r+d*v,p=i[1]=t+d*h;return Math.sqrt((f-n)*(f-n)+(p-o)*(p-o))}var Te=new ee,J=new ee,re=new ee,Ne=new ee,de=new ee,yt=[],oe=new ee;function Xn(r,t){if(t<=180&&t>0){t=t/180*Math.PI,Te.fromArray(r[0]),J.fromArray(r[1]),re.fromArray(r[2]),ee.sub(Ne,Te,J),ee.sub(de,re,J);var e=Ne.len(),a=de.len();if(!(e<.001||a<.001)){Ne.scale(1/e),de.scale(1/a);var n=Ne.dot(de),o=Math.cos(t);if(o<n){var i=wr(J.x,J.y,re.x,re.y,Te.x,Te.y,yt);oe.fromArray(yt),oe.scaleAndAdd(de,i/Math.tan(Math.PI-t));var l=re.x!==J.x?(oe.x-J.x)/(re.x-J.x):(oe.y-J.y)/(re.y-J.y);if(isNaN(l))return;l<0?ee.copy(oe,J):l>1&&ee.copy(oe,re),oe.toArray(r[1])}}}}function Wn(r,t,e){if(e<=180&&e>0){e=e/180*Math.PI,Te.fromArray(r[0]),J.fromArray(r[1]),re.fromArray(r[2]),ee.sub(Ne,J,Te),ee.sub(de,re,J);var a=Ne.len(),n=de.len();if(!(a<.001||n<.001)){Ne.scale(1/a),de.scale(1/n);var o=Ne.dot(t),i=Math.cos(e);if(o<i){var l=wr(J.x,J.y,re.x,re.y,Te.x,Te.y,yt);oe.fromArray(yt);var u=Math.PI/2,s=Math.acos(de.dot(t)),v=u+s-e;if(v>=u)ee.copy(oe,re);else{oe.scaleAndAdd(de,l/Math.tan(Math.PI/2-v));var h=re.x!==J.x?(oe.x-J.x)/(re.x-J.x):(oe.y-J.y)/(re.y-J.y);if(isNaN(h))return;h<0?ee.copy(oe,J):h>1&&ee.copy(oe,re)}oe.toArray(r[1])}}}}function Vt(r,t,e,a){var n=e==="normal",o=n?r:r.ensureState(e);o.ignore=t;var i=a.get("smooth");i&&i===!0&&(i=.3),o.shape=o.shape||{},i>0&&(o.shape.smooth=i);var l=a.getModel("lineStyle").getLineStyle();n?r.useStyle(l):o.style=l}function Yn(r,t){var e=t.smooth,a=t.points;if(a)if(r.moveTo(a[0][0],a[0][1]),e>0&&a.length>=3){var n=ba(a[0],a[1]),o=ba(a[1],a[2]);if(!n||!o){r.lineTo(a[1][0],a[1][1]),r.lineTo(a[2][0],a[2][1]);return}var i=Math.min(n,o)*e,l=Et([],a[1],a[0],i/n),u=Et([],a[1],a[2],i/o),s=Et([],l,u,.5);r.bezierCurveTo(l[0],l[1],l[0],l[1],s[0],s[1]),r.bezierCurveTo(u[0],u[1],u[0],u[1],a[2][0],a[2][1])}else for(var v=1;v<a.length;v++)r.lineTo(a[v][0],a[v][1])}function Ir(r,t,e){var a=r.getTextGuideLine(),n=r.getTextContent();if(!n){a&&r.removeTextGuideLine();return}for(var o=t.normal,i=o.get("show"),l=n.ignore,u=0;u<Zt.length;u++){var s=Zt[u],v=t[s],h=s==="normal";if(v){var c=v.get("show"),g=h?l:xa(n.states[s]&&n.states[s].ignore,l);if(g||!xa(c,i)){var d=h?a:a&&a.states[s];d&&(d.ignore=!0),a&&Vt(a,!0,s,v);continue}a||(a=new bt,r.setTextGuideLine(a),!h&&(l||!i)&&Vt(a,!0,"normal",t.normal),r.stateProxy&&(a.stateProxy=r.stateProxy)),Vt(a,!1,s,v)}}if(a){et(a.style,e),a.style.fill=null;var f=o.get("showAbove"),p=r.textGuideLineConfig=r.textGuideLineConfig||{};p.showAbove=f||!1,a.buildPath=Yn}}function Dr(r,t){t=t||"labelLine";for(var e={normal:r.getModel(t)},a=0;a<Ut.length;a++){var n=Ut[a];e[n]=r.getModel([n,t])}return e}var Ea=Math.PI*2,ht=Math.PI/180;function Lr(r,t){return Ze(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function Ar(r,t){var e=Lr(r,t),a=r.get("center"),n=r.get("radius");te(n)||(n=[0,n]);var o=H(e.width,t.getWidth()),i=H(e.height,t.getHeight()),l=Math.min(o,i),u=H(n[0],l/2),s=H(n[1],l/2),v,h,c=r.coordinateSystem;if(c){var g=c.dataToPoint(a);v=g[0]||0,h=g[1]||0}else te(a)||(a=[a,a]),v=H(a[0],o)+e.x,h=H(a[1],i)+e.y;return{cx:v,cy:h,r0:u,r:s}}function Zn(r,t,e){t.eachSeriesByType(r,function(a){var n=a.getData(),o=n.mapDimension("value"),i=Lr(a,e),l=Ar(a,e),u=l.cx,s=l.cy,v=l.r,h=l.r0,c=-a.get("startAngle")*ht,g=a.get("endAngle"),d=a.get("padAngle")*ht;g=g==="auto"?c-Ea:-g*ht;var f=a.get("minAngle")*ht,p=f+d,S=0;n.each(o,function(V){!isNaN(V)&&S++});var m=n.getSum(o),y=Math.PI/(m||S)*2,x=a.get("clockwise"),b=a.get("roseType"),w=a.get("stillShowZeroSum"),L=n.getDataExtent(o);L[0]=0;var I=x?1:-1,A=[c,g],D=I*d/2;nr(A,!x),c=A[0],g=A[1];var N=Tr(a);N.startAngle=c,N.endAngle=g,N.clockwise=x;var T=Math.abs(g-c),M=T,P=0,E=c;if(n.setLayout({viewRect:i,r:v}),n.each(o,function(V,k){var R;if(isNaN(V)){n.setItemLayout(k,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:u,cy:s,r0:h,r:b?NaN:v});return}b!=="area"?R=m===0&&w?y:V*y:R=T/S,R<p?(R=p,M-=p):P+=V;var z=E+I*R,B=0,F=0;d>R?(B=E+I*R/2,F=B):(B=E+D,F=z-D),n.setItemLayout(k,{angle:R,startAngle:B,endAngle:F,clockwise:x,cx:u,cy:s,r0:h,r:b?ve(V,L,[h,v]):v}),E=z}),M<Ea&&S)if(M<=.001){var C=T/S;n.each(o,function(V,k){if(!isNaN(V)){var R=n.getItemLayout(k);R.angle=C;var z=0,B=0;C<d?(z=c+I*(k+1/2)*C,B=z):(z=c+I*k*C+D,B=c+I*(k+1)*C-D),R.startAngle=z,R.endAngle=B}})}else y=M/P,E=c,n.each(o,function(V,k){if(!isNaN(V)){var R=n.getItemLayout(k),z=R.angle===p?p:V*y,B=0,F=0;z<d?(B=E+I*z/2,F=B):(B=E+D,F=E+I*z-D),R.startAngle=B,R.endAngle=F,E+=I*z}})})}var Tr=lt(),Un=Math.PI/180;function Va(r,t,e,a,n,o,i,l,u,s){if(r.length<2)return;function v(f){for(var p=f.rB,S=p*p,m=0;m<f.list.length;m++){var y=f.list[m],x=Math.abs(y.label.y-e),b=a+y.len,w=b*b,L=Math.sqrt(Math.abs((1-x*x/S)*w)),I=t+(L+y.len2)*n,A=I-y.label.x,D=y.targetTextWidth-A*n;Nr(y,D,!0),y.label.x=I}}function h(f){for(var p={list:[],maxY:0},S={list:[],maxY:0},m=0;m<f.length;m++)if(f[m].labelAlignTo==="none"){var y=f[m],x=y.label.y>e?S:p,b=Math.abs(y.label.y-e);if(b>=x.maxY){var w=y.label.x-t-y.len2*n,L=a+y.len,I=Math.abs(w)<L?Math.sqrt(b*b/(1-w*w/L/L)):L;x.rB=I,x.maxY=b}x.list.push(y)}v(p),v(S)}for(var c=r.length,g=0;g<c;g++)if(r[g].position==="outer"&&r[g].labelAlignTo==="labelLine"){var d=r[g].label.x-s;r[g].linePoints[1][0]+=d,r[g].label.x=s}Kr(r,u,u+i)&&h(r)}function qn(r,t,e,a,n,o,i,l){for(var u=[],s=[],v=Number.MAX_VALUE,h=-Number.MAX_VALUE,c=0;c<r.length;c++){var g=r[c].label;_t(r[c])||(g.x<t?(v=Math.min(v,g.x),u.push(r[c])):(h=Math.max(h,g.x),s.push(r[c])))}for(var c=0;c<r.length;c++){var d=r[c];if(!_t(d)&&d.linePoints){if(d.labelStyleWidth!=null)continue;var g=d.label,f=d.linePoints,p=void 0;d.labelAlignTo==="edge"?g.x<t?p=f[2][0]-d.labelDistance-i-d.edgeDistance:p=i+n-d.edgeDistance-f[2][0]-d.labelDistance:d.labelAlignTo==="labelLine"?g.x<t?p=v-i-d.bleedMargin:p=i+n-h-d.bleedMargin:g.x<t?p=g.x-i-d.bleedMargin:p=i+n-g.x-d.bleedMargin,d.targetTextWidth=p,Nr(d,p)}}Va(s,t,e,a,1,n,o,i,l,h),Va(u,t,e,a,-1,n,o,i,l,v);for(var c=0;c<r.length;c++){var d=r[c];if(!_t(d)&&d.linePoints){var g=d.label,f=d.linePoints,S=d.labelAlignTo==="edge",m=g.style.padding,y=m?m[1]+m[3]:0,x=g.style.backgroundColor?0:y,b=d.rect.width+x,w=f[1][0]-f[2][0];S?g.x<t?f[2][0]=i+d.edgeDistance+b+d.labelDistance:f[2][0]=i+n-d.edgeDistance-b-d.labelDistance:(g.x<t?f[2][0]=g.x+d.labelDistance:f[2][0]=g.x-d.labelDistance,f[1][0]=f[2][0]+w),f[1][1]=f[2][1]=g.y}}}function Nr(r,t,e){if(e===void 0&&(e=!1),r.labelStyleWidth==null){var a=r.label,n=a.style,o=r.rect,i=n.backgroundColor,l=n.padding,u=l?l[1]+l[3]:0,s=n.overflow,v=o.width+(i?0:u);if(t<v||e){var h=o.height;if(s&&s.match("break")){a.setStyle("backgroundColor",null),a.setStyle("width",t-u);var c=a.getBoundingRect();a.setStyle("width",Math.ceil(c.width)),a.setStyle("backgroundColor",i)}else{var g=t-u,d=t<v?g:e?g>r.unconstrainedWidth?null:g:null;a.setStyle("width",d)}var f=a.getBoundingRect();o.width=f.width;var p=(a.style.margin||0)+2.1;o.height=f.height+p,o.y-=(o.height-h)/2}}}function _t(r){return r.position==="center"}function $n(r){var t=r.getData(),e=[],a,n,o=!1,i=(r.get("minShowLabelAngle")||0)*Un,l=t.getLayout("viewRect"),u=t.getLayout("r"),s=l.width,v=l.x,h=l.y,c=l.height;function g(w){w.ignore=!0}function d(w){if(!w.ignore)return!0;for(var L in w.states)if(w.states[L].ignore===!1)return!0;return!1}t.each(function(w){var L=t.getItemGraphicEl(w),I=L.shape,A=L.getTextContent(),D=L.getTextGuideLine(),N=t.getItemModel(w),T=N.getModel("label"),M=T.get("position")||N.get(["emphasis","label","position"]),P=T.get("distanceToLabelLine"),E=T.get("alignTo"),C=H(T.get("edgeDistance"),s),V=T.get("bleedMargin"),k=N.getModel("labelLine"),R=k.get("length");R=H(R,s);var z=k.get("length2");if(z=H(z,s),Math.abs(I.endAngle-I.startAngle)<i){_(A.states,g),A.ignore=!0,D&&(_(D.states,g),D.ignore=!0);return}if(d(A)){var B=(I.startAngle+I.endAngle)/2,F=Math.cos(B),$=Math.sin(B),Y,j,ne,he;a=I.cx,n=I.cy;var O=M==="inside"||M==="inner";if(M==="center")Y=I.cx,j=I.cy,he="center";else{var G=(O?(I.r+I.r0)/2*F:I.r*F)+a,Z=(O?(I.r+I.r0)/2*$:I.r*$)+n;if(Y=G+F*3,j=Z+$*3,!O){var W=G+F*(R+u-I.r),K=Z+$*(R+u-I.r),ae=W+(F<0?-1:1)*z,le=K;E==="edge"?Y=F<0?v+C:v+s-C:Y=ae+(F<0?-P:P),j=le,ne=[[G,Z],[W,K],[ae,le]]}he=O?"center":E==="edge"?F>0?"right":"left":F>0?"left":"right"}var U=Math.PI,Q=0,ie=T.get("rotate");if(Ee(ie))Q=ie*(U/180);else if(M==="center")Q=0;else if(ie==="radial"||ie===!0){var Le=F<0?-B+U:-B;Q=Le}else if(ie==="tangential"&&M!=="outside"&&M!=="outer"){var ye=Math.atan2(F,$);ye<0&&(ye=U*2+ye);var st=$>0;st&&(ye=U+ye),Q=ye-U}if(o=!!Q,A.x=Y,A.y=j,A.rotation=Q,A.setStyle({verticalAlign:"middle"}),O){A.setStyle({align:he});var Ct=A.states.select;Ct&&(Ct.x+=A.x,Ct.y+=A.y)}else{var Ue=A.getBoundingRect().clone();Ue.applyTransform(A.getComputedTransform());var Sa=(A.style.margin||0)+2.1;Ue.y-=Sa/2,Ue.height+=Sa,e.push({label:A,labelLine:D,position:M,len:R,len2:z,minTurnAngle:k.get("minTurnAngle"),maxSurfaceAngle:k.get("maxSurfaceAngle"),surfaceNormal:new ee(F,$),linePoints:ne,textAlign:he,labelDistance:P,labelAlignTo:E,edgeDistance:C,bleedMargin:V,rect:Ue,unconstrainedWidth:Ue.width,labelStyleWidth:A.style.width})}L.setTextConfig({inside:O})}}),!o&&r.get("avoidLabelOverlap")&&qn(e,a,n,u,s,c,v,h);for(var f=0;f<e.length;f++){var p=e[f],S=p.label,m=p.labelLine,y=isNaN(S.x)||isNaN(S.y);if(S){S.setStyle({align:p.textAlign}),y&&(_(S.states,g),S.ignore=!0);var x=S.states.select;x&&(x.x+=S.x,x.y+=S.y)}if(m){var b=p.linePoints;y||!b?(_(m.states,g),m.ignore=!0):(Xn(b,p.minTurnAngle),Wn(b,p.surfaceNormal,p.maxSurfaceAngle),m.setShape({points:b}),S.__hostTarget.textGuideLineConfig={anchor:new ee(b[0][0],b[0][1])})}}}var jn=(function(r){q(t,r);function t(e,a,n){var o=r.call(this)||this;o.z2=2;var i=new Ae;return o.setTextContent(i),o.updateData(e,a,n,!0),o}return t.prototype.updateData=function(e,a,n,o){var i=this,l=e.hostModel,u=e.getItemModel(a),s=u.getModel("emphasis"),v=e.getItemLayout(a),h=X(Fe(u.getModel("itemStyle"),v,!0),v);if(isNaN(h.startAngle)){i.setShape(h);return}if(o){i.setShape(h);var c=l.getShallow("animationType");l.ecModel.ssr?(fe(i,{scaleX:0,scaleY:0},l,{dataIndex:a,isFrom:!0}),i.originX=h.cx,i.originY=h.cy):c==="scale"?(i.shape.r=v.r0,fe(i,{shape:{r:v.r}},l,a)):n!=null?(i.setShape({startAngle:n,endAngle:n}),fe(i,{shape:{startAngle:v.startAngle,endAngle:v.endAngle}},l,a)):(i.shape.endAngle=v.startAngle,se(i,{shape:{endAngle:v.endAngle}},l,a))}else at(i),se(i,{shape:h},l,a);i.useStyle(e.getItemVisual(a,"style")),Se(i,u);var g=(v.startAngle+v.endAngle)/2,d=l.get("selectedOffset"),f=Math.cos(g)*d,p=Math.sin(g)*d,S=u.getShallow("cursor");S&&i.attr("cursor",S),this._updateLabel(l,e,a),i.ensureState("emphasis").shape=X({r:v.r+(s.get("scale")&&s.get("scaleSize")||0)},Fe(s.getModel("itemStyle"),v)),X(i.ensureState("select"),{x:f,y:p,shape:Fe(u.getModel(["select","itemStyle"]),v)}),X(i.ensureState("blur"),{shape:Fe(u.getModel(["blur","itemStyle"]),v)});var m=i.getTextGuideLine(),y=i.getTextContent();m&&X(m.ensureState("select"),{x:f,y:p}),X(y.ensureState("select"),{x:f,y:p}),xe(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,a,n){var o=this,i=a.getItemModel(n),l=i.getModel("labelLine"),u=a.getItemVisual(n,"style"),s=u&&u.fill,v=u&&u.opacity;Xe(o,We(i),{labelFetcher:a.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:v,defaultText:e.getFormattedLabel(n,"normal")||a.getName(n)});var h=o.getTextContent();o.setTextConfig({position:null,rotation:null}),h.attr({z2:10});var c=e.get(["label","position"]);if(c!=="outside"&&c!=="outer")o.removeTextGuideLine();else{var g=this.getTextGuideLine();g||(g=new bt,this.setTextGuideLine(g)),Ir(this,Dr(i),{stroke:s,opacity:ut(l.get(["lineStyle","opacity"]),v,1)})}},t})(tt),Kn=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return t.prototype.render=function(e,a,n,o){var i=e.getData(),l=this._data,u=this.group,s;if(!l&&i.count()>0){for(var v=i.getItemLayout(0),h=1;isNaN(v&&v.startAngle)&&h<i.count();++h)v=i.getItemLayout(h);v&&(s=v.startAngle)}if(this._emptyCircleSector&&u.remove(this._emptyCircleSector),i.count()===0&&e.get("showEmptyCircle")){var c=Tr(e),g=new tt({shape:X(Ar(e,n),c)});g.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=g,u.add(g)}i.diff(l).add(function(d){var f=new jn(i,d,s);i.setItemGraphicEl(d,f),u.add(f)}).update(function(d,f){var p=l.getItemGraphicEl(f);p.updateData(i,d,s),p.off("click"),u.add(p),i.setItemGraphicEl(d,p)}).remove(function(d){var f=l.getItemGraphicEl(d);ir(f,e,d)}).execute(),$n(e),e.get("animationTypeUpdate")!=="expansion"&&(this._data=i)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,a){var n=a.getData(),o=n.getItemLayout(0);if(o){var i=e[0]-o.cx,l=e[1]-o.cy,u=Math.sqrt(i*i+l*l);return u<=o.r&&u>=o.r0}},t.type="pie",t})(Ie),Jn=lt(),Qn=(function(r){q(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new At(me(this.getData,this),me(this.getRawData,this)),this._defaultLabelLine(e)},t.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Lt(this,{coordDimensions:["value"],encodeDefaulter:ge(or,this)})},t.prototype.getDataParams=function(e){var a=this.getData(),n=Jn(a),o=n.seats;if(!o){var i=[];a.each(a.mapDimension("value"),function(u){i.push(u)}),o=n.seats=Jr(i,a.hostModel.get("percentPrecision"))}var l=r.prototype.getDataParams.call(this,e);return l.percent=o[e]||0,l.$vars.push("percent"),l},t.prototype._defaultLabelLine=function(e){ia(e,"labelLine",["show"]);var a=e.labelLine,n=e.emphasis.labelLine;a.show=a.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t})(De);function ei(r){return{seriesType:r,reset:function(t,e){var a=t.getData();a.filterSelf(function(n){var o=a.mapDimension("value"),i=a.get(o,n);return!(Ee(i)&&!isNaN(i)&&i<0)})}}}function ti(r){r.registerChartView(Kn),r.registerSeriesModel(Qn),Qr("pie",r.registerAction),r.registerLayout(ge(Zn,"pie")),r.registerProcessor(Tt("pie")),r.registerProcessor(ei("pie"))}function ai(r){r.eachSeriesByType("radar",function(t){var e=t.getData(),a=[],n=t.coordinateSystem;if(n){var o=n.getIndicatorAxes();_(o,function(i,l){e.each(e.mapDimension(o[l].dim),function(u,s){a[s]=a[s]||[];var v=n.dataToPoint(u,l);a[s][l]=_a(v)?v:Pa(n)})}),e.each(function(i){var l=en(a[i],function(u){return _a(u)})||Pa(n);a[i].push(l.slice()),e.setItemLayout(i,a[i])})}})}function _a(r){return!isNaN(r[0])&&!isNaN(r[1])}function Pa(r){return[r.cx,r.cy]}function ri(r){var t=r.polar;if(t){te(t)||(t=[t]);var e=[];_(t,function(a,n){a.indicator?(a.type&&!a.shape&&(a.shape=a.type),r.radar=r.radar||[],te(r.radar)||(r.radar=[r.radar]),r.radar.push(a)):e.push(a)}),r.polar=e}_(r.series,function(a){a&&a.type==="radar"&&a.polarIndex&&(a.radarIndex=a.polarIndex)})}var ni=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,a,n){var o=e.coordinateSystem,i=this.group,l=e.getData(),u=this._data;function s(c,g){var d=c.getItemVisual(g,"symbol")||"circle";if(d!=="none"){var f=rn(c.getItemVisual(g,"symbolSize")),p=qt(d,-1,-1,2,2),S=c.getItemVisual(g,"symbolRotate")||0;return p.attr({style:{strokeNoScale:!0},z2:100,scaleX:f[0]/2,scaleY:f[1]/2,rotation:S*Math.PI/180||0}),p}}function v(c,g,d,f,p,S){d.removeAll();for(var m=0;m<g.length-1;m++){var y=s(f,p);y&&(y.__dimIdx=m,c[m]?(y.setPosition(c[m]),an[S?"initProps":"updateProps"](y,{x:g[m][0],y:g[m][1]},e,p)):y.setPosition(g[m]),d.add(y))}}function h(c){return we(c,function(g){return[o.cx,o.cy]})}l.diff(u).add(function(c){var g=l.getItemLayout(c);if(g){var d=new oa,f=new bt,p={shape:{points:g}};d.shape.points=h(g),f.shape.points=h(g),fe(d,p,e,c),fe(f,p,e,c);var S=new be,m=new be;S.add(f),S.add(d),S.add(m),v(f.shape.points,g,m,l,c,!0),l.setItemGraphicEl(c,S)}}).update(function(c,g){var d=u.getItemGraphicEl(g),f=d.childAt(0),p=d.childAt(1),S=d.childAt(2),m={shape:{points:l.getItemLayout(c)}};m.shape.points&&(v(f.shape.points,m.shape.points,S,l,c,!1),at(p),at(f),se(f,m,e),se(p,m,e),l.setItemGraphicEl(c,d))}).remove(function(c){i.remove(u.getItemGraphicEl(c))}).execute(),l.eachItemGraphicEl(function(c,g){var d=l.getItemModel(g),f=c.childAt(0),p=c.childAt(1),S=c.childAt(2),m=l.getItemVisual(g,"style"),y=m.fill;i.add(c),f.useStyle(et(d.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:y})),Se(f,d,"lineStyle"),Se(p,d,"areaStyle");var x=d.getModel("areaStyle"),b=x.isEmpty()&&x.parentModel.isEmpty();p.ignore=b,_(["emphasis","select","blur"],function(I){var A=d.getModel([I,"areaStyle"]),D=A.isEmpty()&&A.parentModel.isEmpty();p.ensureState(I).ignore=D&&b}),p.useStyle(et(x.getAreaStyle(),{fill:y,opacity:.7,decal:m.decal}));var w=d.getModel("emphasis"),L=w.getModel("itemStyle").getItemStyle();S.eachChild(function(I){if(I instanceof lr){var A=I.style;I.useStyle(X({image:A.image,x:A.x,y:A.y,width:A.width,height:A.height},m))}else I.useStyle(m),I.setColor(y),I.style.strokeNoScale=!0;var D=I.ensureState("emphasis");D.style=tn(L);var N=l.getStore().get(l.getDimensionIndex(I.__dimIdx),g);(N==null||isNaN(N))&&(N=""),Xe(I,We(d),{labelFetcher:l.hostModel,labelDataIndex:g,labelDimIndex:I.__dimIdx,defaultText:N,inheritColor:y,defaultOpacity:m.opacity})}),xe(c,w.get("focus"),w.get("blurScope"),w.get("disabled"))}),this._data=l},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.type="radar",t})(Ie),ii=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.hasSymbolVisual=!0,e}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new At(me(this.getData,this),me(this.getRawData,this))},t.prototype.getInitialData=function(e,a){return Lt(this,{generateCoord:"indicator_",generateCoordCount:1/0})},t.prototype.formatTooltip=function(e,a,n){var o=this.getData(),i=this.coordinateSystem,l=i.getIndicatorAxes(),u=this.getData().getName(e),s=u===""?this.name:u,v=nn(this,e);return Re("section",{header:s,sortBlocks:!0,blocks:we(l,function(h){var c=o.get(o.mapDimension(h.dim),e);return Re("nameValue",{markerType:"subItem",markerColor:v,name:h.name,value:c,sortParam:c})})})},t.prototype.getTooltipPosition=function(e){if(e!=null){for(var a=this.getData(),n=this.coordinateSystem,o=a.getValues(we(n.dimensions,function(s){return a.mapDimension(s)}),e),i=0,l=o.length;i<l;i++)if(!isNaN(o[i])){var u=n.getIndicatorAxes();return n.coordToPoint(u[i].dataToCoord(o[i]),i)}}},t.type="series.radar",t.dependencies=["radar"],t.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},t})(De);function oi(r){ur(Fn),r.registerChartView(ni),r.registerSeriesModel(ii),r.registerLayout(ai),r.registerProcessor(Tt("radar")),r.registerPreprocessor(ri)}function li(r){var t=r;t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var e=[t],a,n;a=e.pop();)if(n=a.children,a.isExpand&&n.length)for(var o=n.length,i=o-1;i>=0;i--){var l=n[i];l.hierNode={defaultAncestor:null,ancestor:l,prelim:0,modifier:0,change:0,shift:0,i,thread:null},e.push(l)}}function ui(r,t){var e=r.isExpand?r.children:[],a=r.parentNode.children,n=r.hierNode.i?a[r.hierNode.i-1]:null;if(e.length){ci(r);var o=(e[0].hierNode.prelim+e[e.length-1].hierNode.prelim)/2;n?(r.hierNode.prelim=n.hierNode.prelim+t(r,n),r.hierNode.modifier=r.hierNode.prelim-o):r.hierNode.prelim=o}else n&&(r.hierNode.prelim=n.hierNode.prelim+t(r,n));r.parentNode.hierNode.defaultAncestor=hi(r,n,r.parentNode.hierNode.defaultAncestor||a[0],t)}function si(r){var t=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:t},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function ka(r){return arguments.length?r:fi}function Ke(r,t){return r-=Math.PI/2,{x:t*Math.cos(r),y:t*Math.sin(r)}}function vi(r,t){return Ze(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function ci(r){for(var t=r.children,e=t.length,a=0,n=0;--e>=0;){var o=t[e];o.hierNode.prelim+=a,o.hierNode.modifier+=a,n+=o.hierNode.change,a+=o.hierNode.shift+n}}function hi(r,t,e,a){if(t){for(var n=r,o=r,i=o.parentNode.children[0],l=t,u=n.hierNode.modifier,s=o.hierNode.modifier,v=i.hierNode.modifier,h=l.hierNode.modifier;l=Pt(l),o=kt(o),l&&o;){n=Pt(n),i=kt(i),n.hierNode.ancestor=r;var c=l.hierNode.prelim+h-o.hierNode.prelim-s+a(l,o);c>0&&(di(gi(l,r,e),r,c),s+=c,u+=c),h+=l.hierNode.modifier,s+=o.hierNode.modifier,u+=n.hierNode.modifier,v+=i.hierNode.modifier}l&&!Pt(n)&&(n.hierNode.thread=l,n.hierNode.modifier+=h-u),o&&!kt(i)&&(i.hierNode.thread=o,i.hierNode.modifier+=s-v,e=r)}return e}function Pt(r){var t=r.children;return t.length&&r.isExpand?t[t.length-1]:r.hierNode.thread}function kt(r){var t=r.children;return t.length&&r.isExpand?t[0]:r.hierNode.thread}function gi(r,t,e){return r.hierNode.ancestor.parentNode===t.parentNode?r.hierNode.ancestor:e}function di(r,t,e){var a=e/(t.hierNode.i-r.hierNode.i);t.hierNode.change-=a,t.hierNode.shift+=e,t.hierNode.modifier+=e,t.hierNode.prelim+=e,r.hierNode.change+=a}function fi(r,t){return r.parentNode===t.parentNode?1:2}var pi=(function(){function r(){this.parentPoint=[],this.childPoints=[]}return r})(),yi=(function(r){q(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new pi},t.prototype.buildPath=function(e,a){var n=a.childPoints,o=n.length,i=a.parentPoint,l=n[0],u=n[o-1];if(o===1){e.moveTo(i[0],i[1]),e.lineTo(l[0],l[1]);return}var s=a.orient,v=s==="TB"||s==="BT"?0:1,h=1-v,c=H(a.forkPosition,1),g=[];g[v]=i[v],g[h]=i[h]+(u[h]-i[h])*c,e.moveTo(i[0],i[1]),e.lineTo(g[0],g[1]),e.moveTo(l[0],l[1]),g[v]=l[v],e.lineTo(g[0],g[1]),g[v]=u[v],e.lineTo(g[0],g[1]),e.lineTo(u[0],u[1]);for(var d=1;d<o-1;d++){var f=n[d];e.moveTo(f[0],f[1]),g[v]=f[v],e.lineTo(g[0],g[1])}},t})(la),mi=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._mainGroup=new be,e}return t.prototype.init=function(e,a){this._controller=new va(a.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(e,a,n){var o=e.getData(),i=e.layoutInfo,l=this._mainGroup,u=e.get("layout");u==="radial"?(l.x=i.x+i.width/2,l.y=i.y+i.height/2):(l.x=i.x,l.y=i.y),this._updateViewCoordSys(e,n),this._updateController(e,a,n);var s=this._data;o.diff(s).add(function(v){Ra(o,v)&&za(o,v,null,l,e)}).update(function(v,h){var c=s.getItemGraphicEl(h);if(!Ra(o,v)){c&&Ba(s,h,c,l,e);return}za(o,v,c,l,e)}).remove(function(v){var h=s.getItemGraphicEl(v);h&&Ba(s,v,h,l,e)}).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),e.get("expandAndCollapse")===!0&&o.eachItemGraphicEl(function(v,h){v.off("click").on("click",function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:h})})}),this._data=o},t.prototype._updateViewCoordSys=function(e,a){var n=e.getData(),o=[];n.each(function(h){var c=n.getItemLayout(h);c&&!isNaN(c.x)&&!isNaN(c.y)&&o.push([+c.x,+c.y])});var i=[],l=[];sr(o,i,l);var u=this._min,s=this._max;l[0]-i[0]===0&&(i[0]=u?u[0]:i[0]-1,l[0]=s?s[0]:l[0]+1),l[1]-i[1]===0&&(i[1]=u?u[1]:i[1]-1,l[1]=s?s[1]:l[1]+1);var v=e.coordinateSystem=new ca;v.zoomLimit=e.get("scaleLimit"),v.setBoundingRect(i[0],i[1],l[0]-i[0],l[1]-i[1]),v.setCenter(e.get("center"),a),v.setZoom(e.get("zoom")),this.group.attr({x:v.x,y:v.y,scaleX:v.scaleX,scaleY:v.scaleY}),this._min=i,this._max=l},t.prototype._updateController=function(e,a,n){var o=this,i=this._controller,l=this._controllerHost,u=this.group;i.setPointerChecker(function(s,v,h){var c=u.getBoundingRect();return c.applyTransform(u.transform),c.contain(v,h)&&!vr(s,n,e)}),i.enable(e.get("roam")),l.zoomLimit=e.get("scaleLimit"),l.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",function(s){mr(l,s.dx,s.dy),n.dispatchAction({seriesId:e.id,type:"treeRoam",dx:s.dx,dy:s.dy})}).on("zoom",function(s){Sr(l,s.scale,s.originX,s.originY),n.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:s.scale,originX:s.originX,originY:s.originY}),o._updateNodeAndLinkScale(e),n.updateLabelLayout()})},t.prototype._updateNodeAndLinkScale=function(e){var a=e.getData(),n=this._getNodeGlobalScale(e);a.eachItemGraphicEl(function(o,i){o.setSymbolScale(n)})},t.prototype._getNodeGlobalScale=function(e){var a=e.coordinateSystem;if(a.type!=="view")return 1;var n=this._nodeScaleRatio,o=a.scaleX||1,i=a.getZoom(),l=(i-1)*n+1;return l/o},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},t.type="tree",t})(Ie);function Ra(r,t){var e=r.getItemLayout(t);return e&&!isNaN(e.x)&&!isNaN(e.y)}function za(r,t,e,a,n){var o=!e,i=r.tree.getNodeByDataIndex(t),l=i.getModel(),u=i.getVisual("style").fill,s=i.isExpand===!1&&i.children.length!==0?u:"#fff",v=r.tree.root,h=i.parentNode===v?i:i.parentNode||i,c=r.getItemGraphicEl(h.dataIndex),g=h.getLayout(),d=c?{x:c.__oldX,y:c.__oldY,rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:g,f=i.getLayout();o?(e=new Hn(r,t,null,{symbolInnerColor:s,useNameLabel:!0}),e.x=d.x,e.y=d.y):e.updateData(r,t,null,{symbolInnerColor:s,useNameLabel:!0}),e.__radialOldRawX=e.__radialRawX,e.__radialOldRawY=e.__radialRawY,e.__radialRawX=f.rawX,e.__radialRawY=f.rawY,a.add(e),r.setItemGraphicEl(t,e),e.__oldX=e.x,e.__oldY=e.y,se(e,{x:f.x,y:f.y},n);var p=e.getSymbolPath();if(n.get("layout")==="radial"){var S=v.children[0],m=S.getLayout(),y=S.children.length,x=void 0,b=void 0;if(f.x===m.x&&i.isExpand===!0&&S.children.length){var w={x:(S.children[0].getLayout().x+S.children[y-1].getLayout().x)/2,y:(S.children[0].getLayout().y+S.children[y-1].getLayout().y)/2};x=Math.atan2(w.y-m.y,w.x-m.x),x<0&&(x=Math.PI*2+x),b=w.x<m.x,b&&(x=x-Math.PI)}else x=Math.atan2(f.y-m.y,f.x-m.x),x<0&&(x=Math.PI*2+x),i.children.length===0||i.children.length!==0&&i.isExpand===!1?(b=f.x<m.x,b&&(x=x-Math.PI)):(b=f.x>m.x,b||(x=x-Math.PI));var L=b?"left":"right",I=l.getModel("label"),A=I.get("rotate"),D=A*(Math.PI/180),N=p.getTextContent();N&&(p.setTextConfig({position:I.get("position")||L,rotation:A==null?-x:D,origin:"center"}),N.setStyle("verticalAlign","middle"))}var T=l.get(["emphasis","focus"]),M=T==="relative"?cr(i.getAncestorsIndices(),i.getDescendantIndices()):T==="ancestor"?i.getAncestorsIndices():T==="descendant"?i.getDescendantIndices():null;M&&(pe(e).focus=M),Si(n,i,v,e,d,g,f,a),e.__edge&&(e.onHoverStateChange=function(P){if(P!=="blur"){var E=i.parentNode&&r.getItemGraphicEl(i.parentNode.dataIndex);E&&E.hoverState===on||ln(e.__edge,P)}})}function Si(r,t,e,a,n,o,i,l){var u=t.getModel(),s=r.get("edgeShape"),v=r.get("layout"),h=r.getOrient(),c=r.get(["lineStyle","curveness"]),g=r.get("edgeForkPosition"),d=u.getModel("lineStyle").getLineStyle(),f=a.__edge;if(s==="curve")t.parentNode&&t.parentNode!==e&&(f||(f=a.__edge=new un({shape:ea(v,h,c,n,n)})),se(f,{shape:ea(v,h,c,o,i)},r));else if(s==="polyline"&&v==="orthogonal"&&t!==e&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var p=t.children,S=[],m=0;m<p.length;m++){var y=p[m].getLayout();S.push([y.x,y.y])}f||(f=a.__edge=new yi({shape:{parentPoint:[i.x,i.y],childPoints:[[i.x,i.y]],orient:h,forkPosition:g}})),se(f,{shape:{parentPoint:[i.x,i.y],childPoints:S}},r)}f&&!(s==="polyline"&&!t.isExpand)&&(f.useStyle(et({strokeNoScale:!0,fill:null},d)),Se(f,u,"lineStyle"),jt(f),l.add(f))}function Ga(r,t,e,a,n){var o=t.tree.root,i=Mr(o,r),l=i.source,u=i.sourceLayout,s=t.getItemGraphicEl(r.dataIndex);if(s){var v=t.getItemGraphicEl(l.dataIndex),h=v.__edge,c=s.__edge||(l.isExpand===!1||l.children.length===1?h:void 0),g=a.get("edgeShape"),d=a.get("layout"),f=a.get("orient"),p=a.get(["lineStyle","curveness"]);c&&(g==="curve"?$t(c,{shape:ea(d,f,p,u,u),style:{opacity:0}},a,{cb:function(){e.remove(c)},removeOpt:n}):g==="polyline"&&a.get("layout")==="orthogonal"&&$t(c,{shape:{parentPoint:[u.x,u.y],childPoints:[[u.x,u.y]]},style:{opacity:0}},a,{cb:function(){e.remove(c)},removeOpt:n}))}}function Mr(r,t){for(var e=t.parentNode===r?t:t.parentNode||t,a;a=e.getLayout(),a==null;)e=e.parentNode===r?e:e.parentNode||e;return{source:e,sourceLayout:a}}function Ba(r,t,e,a,n){var o=r.tree.getNodeByDataIndex(t),i=r.tree.root,l=Mr(i,o).sourceLayout,u={duration:n.get("animationDurationUpdate"),easing:n.get("animationEasingUpdate")};$t(e,{x:l.x+1,y:l.y+1},n,{cb:function(){a.remove(e),r.setItemGraphicEl(t,null)},removeOpt:u}),e.fadeOut(null,r.hostModel,{fadeLabel:!0,animation:u}),o.children.forEach(function(s){Ga(s,r,a,n,u)}),Ga(o,r,a,n,u)}function ea(r,t,e,a,n){var o,i,l,u,s,v,h,c;if(r==="radial"){s=a.rawX,h=a.rawY,v=n.rawX,c=n.rawY;var g=Ke(s,h),d=Ke(s,h+(c-h)*e),f=Ke(v,c+(h-c)*e),p=Ke(v,c);return{x1:g.x||0,y1:g.y||0,x2:p.x||0,y2:p.y||0,cpx1:d.x||0,cpy1:d.y||0,cpx2:f.x||0,cpy2:f.y||0}}else s=a.x,h=a.y,v=n.x,c=n.y,(t==="LR"||t==="RL")&&(o=s+(v-s)*e,i=h,l=v+(s-v)*e,u=c),(t==="TB"||t==="BT")&&(o=s,i=h+(c-h)*e,l=v,u=c+(h-c)*e);return{x1:s,y1:h,x2:v,y2:c,cpx1:o,cpy1:i,cpx2:l,cpy2:u}}var ce=lt();function Cr(r){var t=r.mainData,e=r.datas;e||(e={main:t},r.datasAttr={main:"data"}),r.datas=r.mainData=null,Er(t,e,r),_(e,function(a){_(t.TRANSFERABLE_METHODS,function(n){a.wrapMethod(n,ge(xi,r))})}),t.wrapMethod("cloneShallow",ge(wi,r)),_(t.CHANGABLE_METHODS,function(a){t.wrapMethod(a,ge(bi,r))}),sn(e[t.dataType]===t)}function xi(r,t){if(Li(this)){var e=X({},ce(this).datas);e[this.dataType]=t,Er(t,e,r)}else ha(t,this.dataType,ce(this).mainData,r);return t}function bi(r,t){return r.struct&&r.struct.update(),t}function wi(r,t){return _(ce(t).datas,function(e,a){e!==t&&ha(e.cloneShallow(),a,t,r)}),t}function Ii(r){var t=ce(this).mainData;return r==null||t==null?t:ce(t).datas[r]}function Di(){var r=ce(this).mainData;return r==null?[{data:r}]:we(vn(ce(r).datas),function(t){return{type:t,data:ce(r).datas[t]}})}function Li(r){return ce(r).mainData===r}function Er(r,t,e){ce(r).datas={},_(t,function(a,n){ha(a,n,r,e)})}function ha(r,t,e,a){ce(e).datas[t]=r,ce(r).mainData=e,r.dataType=t,a.struct&&(r[a.structAttr]=a.struct,a.struct[a.datasAttr[t]]=r),r.getLinkedData=Ii,r.getLinkedDataAll=Di}var Ai=(function(){function r(t,e){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=t||"",this.hostTree=e}return r.prototype.isRemoved=function(){return this.dataIndex<0},r.prototype.eachNode=function(t,e,a){Ye(t)&&(a=e,e=t,t=null),t=t||{},ze(t)&&(t={order:t});var n=t.order||"preorder",o=this[t.attr||"children"],i;n==="preorder"&&(i=e.call(a,this));for(var l=0;!i&&l<o.length;l++)o[l].eachNode(t,e,a);n==="postorder"&&e.call(a,this)},r.prototype.updateDepthAndHeight=function(t){var e=0;this.depth=t;for(var a=0;a<this.children.length;a++){var n=this.children[a];n.updateDepthAndHeight(t+1),n.height>e&&(e=n.height)}this.height=e+1},r.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,a=this.children,n=a.length;e<n;e++){var o=a[e].getNodeById(t);if(o)return o}},r.prototype.contains=function(t){if(t===this)return!0;for(var e=0,a=this.children,n=a.length;e<n;e++){var o=a[e].contains(t);if(o)return o}},r.prototype.getAncestors=function(t){for(var e=[],a=t?this:this.parentNode;a;)e.push(a),a=a.parentNode;return e.reverse(),e},r.prototype.getAncestorsIndices=function(){for(var t=[],e=this;e;)t.push(e.dataIndex),e=e.parentNode;return t.reverse(),t},r.prototype.getDescendantIndices=function(){var t=[];return this.eachNode(function(e){t.push(e.dataIndex)}),t},r.prototype.getValue=function(t){var e=this.hostTree.data;return e.getStore().get(e.getDimensionIndex(t||"value"),this.dataIndex)},r.prototype.setLayout=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostTree,a=e.data.getItemModel(this.dataIndex);return a.getModel(t)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},r.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e<t.length;++e)if(t[e]===this)return e;return-1}return-1},r.prototype.isAncestorOf=function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},r.prototype.isDescendantOf=function(t){return t!==this&&t.isAncestorOf(this)},r})(),ga=(function(){function r(t){this.type="tree",this._nodes=[],this.hostModel=t}return r.prototype.eachNode=function(t,e,a){this.root.eachNode(t,e,a)},r.prototype.getNodeByDataIndex=function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},r.prototype.getNodeById=function(t){return this.root.getNodeById(t)},r.prototype.update=function(){for(var t=this.data,e=this._nodes,a=0,n=e.length;a<n;a++)e[a].dataIndex=-1;for(var a=0,n=t.count();a<n;a++)e[t.getRawIndex(a)].dataIndex=a},r.prototype.clearLayouts=function(){this.data.clearItemLayouts()},r.createTree=function(t,e,a){var n=new r(e),o=[],i=1;l(t);function l(v,h){var c=v.value;i=Math.max(i,te(c)?c.length:1),o.push(v);var g=new Ai(wt(v.name,""),n);h?Ti(g,h):n.root=g,n._nodes.push(g);var d=v.children;if(d)for(var f=0;f<d.length;f++)l(d[f],g)}n.root.updateDepthAndHeight(0);var u=hr(o,{coordDimensions:["value"],dimensionsCount:i}).dimensions,s=new ft(u,e);return s.initData(o),a&&a(s),Cr({mainData:s,struct:n,structAttr:"tree"}),n.update(),n},r})();function Ti(r,t){var e=t.children;r.parentNode!==t&&(e.push(r),r.parentNode=t)}function nt(r,t,e){if(r&&It(t,r.type)>=0){var a=e.getData().tree.root,n=r.targetNode;if(ze(n)&&(n=a.getNodeById(n)),n&&a.contains(n))return{node:n};var o=r.targetNodeId;if(o!=null&&(n=a.getNodeById(o)))return{node:n}}}function Vr(r){for(var t=[];r;)r=r.parentNode,r&&t.push(r);return t.reverse()}function da(r,t){var e=Vr(r);return It(e,t)>=0}function Nt(r,t){for(var e=[];r;){var a=r.dataIndex;e.push({name:r.name,dataIndex:a,value:t.getRawValue(a)}),r=r.parentNode}return e.reverse(),e}var Ni=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return t.prototype.getInitialData=function(e){var a={name:e.name,children:e.data},n=e.leaves||{},o=new Ge(n,this,this.ecModel),i=ga.createTree(a,this,l);function l(h){h.wrapMethod("getItemModel",function(c,g){var d=i.getNodeByDataIndex(g);return d&&d.children.length&&d.isExpand||(c.parentModel=o),c})}var u=0;i.eachNode("preorder",function(h){h.depth>u&&(u=h.depth)});var s=e.expandAndCollapse,v=s&&e.initialTreeDepth>=0?e.initialTreeDepth:u;return i.root.eachNode("preorder",function(h){var c=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=c&&c.collapsed!=null?!c.collapsed:h.depth<=v}),i.data},t.prototype.getOrient=function(){var e=this.get("orient");return e==="horizontal"?e="LR":e==="vertical"&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,a,n){for(var o=this.getData().tree,i=o.root.children[0],l=o.getNodeByDataIndex(e),u=l.getValue(),s=l.name;l&&l!==i;)s=l.parentNode.name+"."+s,l=l.parentNode;return Re("nameValue",{name:s,value:u,noValue:isNaN(u)||u==null})},t.prototype.getDataParams=function(e){var a=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return a.treeAncestors=Nt(n,this),a.collapsed=!n.isExpand,a},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t})(De);function Mi(r,t,e){for(var a=[r],n=[],o;o=a.pop();)if(n.push(o),o.isExpand){var i=o.children;if(i.length)for(var l=0;l<i.length;l++)a.push(i[l])}for(;o=n.pop();)t(o,e)}function qe(r,t){for(var e=[r],a;a=e.pop();)if(t(a),a.isExpand){var n=a.children;if(n.length)for(var o=n.length-1;o>=0;o--)e.push(n[o])}}function Ci(r,t){r.eachSeriesByType("tree",function(e){Ei(e,t)})}function Ei(r,t){var e=vi(r,t);r.layoutInfo=e;var a=r.get("layout"),n=0,o=0,i=null;a==="radial"?(n=2*Math.PI,o=Math.min(e.height,e.width)/2,i=ka(function(y,x){return(y.parentNode===x.parentNode?1:2)/y.depth})):(n=e.width,o=e.height,i=ka());var l=r.getData().tree.root,u=l.children[0];if(u){li(l),Mi(u,ui,i),l.hierNode.modifier=-u.hierNode.prelim,qe(u,si);var s=u,v=u,h=u;qe(u,function(y){var x=y.getLayout().x;x<s.getLayout().x&&(s=y),x>v.getLayout().x&&(v=y),y.depth>h.depth&&(h=y)});var c=s===v?1:i(s,v)/2,g=c-s.getLayout().x,d=0,f=0,p=0,S=0;if(a==="radial")d=n/(v.getLayout().x+c+g),f=o/(h.depth-1||1),qe(u,function(y){p=(y.getLayout().x+g)*d,S=(y.depth-1)*f;var x=Ke(p,S);y.setLayout({x:x.x,y:x.y,rawX:p,rawY:S},!0)});else{var m=r.getOrient();m==="RL"||m==="LR"?(f=o/(v.getLayout().x+c+g),d=n/(h.depth-1||1),qe(u,function(y){S=(y.getLayout().x+g)*f,p=m==="LR"?(y.depth-1)*d:n-(y.depth-1)*d,y.setLayout({x:p,y:S},!0)})):(m==="TB"||m==="BT")&&(d=n/(v.getLayout().x+c+g),f=o/(h.depth-1||1),qe(u,function(y){p=(y.getLayout().x+g)*d,S=m==="TB"?(y.depth-1)*f:o-(y.depth-1)*f,y.setLayout({x:p,y:S},!0)}))}}}function Vi(r){r.eachSeriesByType("tree",function(t){var e=t.getData(),a=e.tree;a.eachNode(function(n){var o=n.getModel(),i=o.getModel("itemStyle").getItemStyle(),l=e.ensureUniqueItemVisual(n.dataIndex,"style");X(l,i)})})}function _i(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(a){var n=t.dataIndex,o=a.getData().tree,i=o.getNodeByDataIndex(n);i.isExpand=!i.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(t,e,a){e.eachComponent({mainType:"series",subType:"tree",query:t},function(n){var o=n.coordinateSystem,i=xr(o,t,void 0,a);n.setCenter&&n.setCenter(i.center),n.setZoom&&n.setZoom(i.zoom)})})}function Pi(r){r.registerChartView(mi),r.registerSeriesModel(Ni),r.registerLayout(Ci),r.registerVisual(Vi),_i(r)}var Ha=["treemapZoomToNode","treemapRender","treemapMove"];function ki(r){for(var t=0;t<Ha.length;t++)r.registerAction({type:Ha[t],update:"updateView"},Kt);r.registerAction({type:"treemapRootToNode",update:"updateView"},function(e,a){a.eachComponent({mainType:"series",subType:"treemap",query:e},n);function n(o,i){var l=["treemapZoomToNode","treemapRootToNode"],u=nt(e,l,o);if(u){var s=o.getViewRoot();s&&(e.direction=da(s,u.node)?"rollUp":"drillDown"),o.resetViewRoot(u.node)}}})}function _r(r){var t=r.getData(),e=t.tree,a={};e.eachNode(function(n){for(var o=n;o&&o.depth>1;)o=o.parentNode;var i=cn(r.ecModel,o.name||o.dataIndex+"",a);n.setVisual("decal",i)})}var Ri=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.preventUsingHoverLayer=!0,e}return t.prototype.getInitialData=function(e,a){var n={name:e.name,children:e.data};Pr(n);var o=e.levels||[],i=this.designatedVisualItemStyle={},l=new Ge({itemStyle:i},this,a);o=e.levels=zi(o,a);var u=we(o||[],function(h){return new Ge(h,l,a)},this),s=ga.createTree(n,this,v);function v(h){h.wrapMethod("getItemModel",function(c,g){var d=s.getNodeByDataIndex(g),f=d?u[d.depth]:null;return c.parentModel=f||l,c})}return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,a,n){var o=this.getData(),i=this.getRawValue(e),l=o.getName(e);return Re("nameValue",{name:l,value:i})},t.prototype.getDataParams=function(e){var a=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return a.treeAncestors=Nt(n,this),a.treePathInfo=a.treeAncestors,a},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},X(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var a=this._idIndexMap;a||(a=this._idIndexMap=rt(),this._idIndexMapCount=0);var n=a.get(e);return n==null&&a.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var a=this.getRawData().tree.root;(!e||e!==a&&!a.contains(e))&&(this._viewRoot=a)},t.prototype.enableAriaDecal=function(){_r(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t})(De);function Pr(r){var t=0;_(r.children,function(a){Pr(a);var n=a.value;te(n)&&(n=n[0]),t+=n});var e=r.value;te(e)&&(e=e[0]),(e==null||isNaN(e))&&(e=t),e<0&&(e=0),te(r.value)?r.value[0]=e:r.value=e}function zi(r,t){var e=wa(t.get("color")),a=wa(t.get(["aria","decal","decals"]));if(e){r=r||[];var n,o;_(r,function(l){var u=new Ge(l),s=u.get("color"),v=u.get("decal");(u.get(["itemStyle","color"])||s&&s!=="none")&&(n=!0),(u.get(["itemStyle","decal"])||v&&v!=="none")&&(o=!0)});var i=r[0]||(r[0]={});return n||(i.color=e.slice()),!o&&a&&(i.decal=a.slice()),r}}var Gi=8,Oa=8,Rt=5,Bi=(function(){function r(t){this.group=new be,t.add(this.group)}return r.prototype.render=function(t,e,a,n){var o=t.getModel("breadcrumb"),i=this.group;if(i.removeAll(),!(!o.get("show")||!a)){var l=o.getModel("itemStyle"),u=o.getModel("emphasis"),s=l.getModel("textStyle"),v=u.getModel(["itemStyle","textStyle"]),h={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(a,h,s),this._renderContent(t,h,l,u,s,v,n),hn(i,h.pos,h.box)}},r.prototype._prepare=function(t,e,a){for(var n=t;n;n=n.parentNode){var o=wt(n.getModel().get("name"),""),i=a.getTextRect(o),l=Math.max(i.width+Gi*2,e.emptyItemWidth);e.totalWidth+=l+Oa,e.renderList.push({node:n,text:o,width:l})}},r.prototype._renderContent=function(t,e,a,n,o,i,l){for(var u=0,s=e.emptyItemWidth,v=t.get(["breadcrumb","height"]),h=gn(e.pos,e.box),c=e.totalWidth,g=e.renderList,d=n.getModel("itemStyle").getItemStyle(),f=g.length-1;f>=0;f--){var p=g[f],S=p.node,m=p.width,y=p.text;c>h.width&&(c-=m-s,m=s,y=null);var x=new oa({shape:{points:Hi(u,0,m,v,f===g.length-1,f===0)},style:et(a.getItemStyle(),{lineJoin:"bevel"}),textContent:new Ae({style:ke(o,{text:y})}),textConfig:{position:"inside"},z2:Dt*1e4,onclick:ge(l,S)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=ke(i,{text:y}),x.ensureState("emphasis").style=d,xe(x,n.get("focus"),n.get("blurScope"),n.get("disabled")),this.group.add(x),Oi(x,t,S),u+=m+Oa}},r.prototype.remove=function(){this.group.removeAll()},r})();function Hi(r,t,e,a,n,o){var i=[[n?r:r-Rt,t],[r+e,t],[r+e,t+a],[n?r:r-Rt,t+a]];return!o&&i.splice(2,0,[r+e+Rt,t+a/2]),!n&&i.push([r,t+a/2]),i}function Oi(r,t,e){pe(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:e&&e.dataIndex,name:e&&e.name},treePathInfo:e&&Nt(e,t)}}var Fi=(function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(t,e,a,n,o){return this._elExistsMap[t.id]?!1:(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:a,delay:n,easing:o}),!0)},r.prototype.finished=function(t){return this._finishedCallback=t,this},r.prototype.start=function(){for(var t=this,e=this._storage.length,a=function(){e--,e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},n=0,o=this._storage.length;n<o;n++){var i=this._storage[n];i.el.animateTo(i.target,{duration:i.duration,delay:i.delay,easing:i.easing,setToFinal:!0,done:a,aborted:a})}return this},r})();function Xi(){return new Fi}var ta=be,Fa=ua,Xa=3,Wa="label",Ya="upperLabel",Wi=Dt*10,Yi=Dt*2,Zi=Dt*3,_e=yn([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),Za=function(r){var t=_e(r);return t.stroke=t.fill=t.lineWidth=null,t},mt=lt(),Ui=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._state="ready",e._storage=$e(),e}return t.prototype.render=function(e,a,n,o){var i=a.findComponents({mainType:"series",subType:"treemap",query:o});if(!(It(i,e)<0)){this.seriesModel=e,this.api=n,this.ecModel=a;var l=["treemapZoomToNode","treemapRootToNode"],u=nt(o,l,e),s=o&&o.type,v=e.layoutInfo,h=!this._oldTree,c=this._storage,g=s==="treemapRootToNode"&&u&&c?{rootNodeGroup:c.nodeGroup[u.node.getRawIndex()],direction:o.direction}:null,d=this._giveContainerGroup(v),f=e.get("animation"),p=this._doRender(d,e,g);f&&!h&&(!s||s==="treemapZoomToNode"||s==="treemapRootToNode")?this._doAnimation(d,p,e,g):p.renderFinally(),this._resetController(n),this._renderBreadcrumb(e,n,u)}},t.prototype._giveContainerGroup=function(e){var a=this._containerGroup;return a||(a=this._containerGroup=new ta,this._initEvents(a),this.group.add(a)),a.x=e.x,a.y=e.y,a},t.prototype._doRender=function(e,a,n){var o=a.getData().tree,i=this._oldTree,l=$e(),u=$e(),s=this._storage,v=[];function h(m,y,x,b){return qi(a,u,s,n,l,v,m,y,x,b)}f(o.root?[o.root]:[],i&&i.root?[i.root]:[],e,o===i||!i,0);var c=p(s);if(this._oldTree=o,this._storage=u,this._controllerHost){var g=this.seriesModel.layoutInfo,d=o.root.getLayout();d.width===g.width&&d.height===g.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:l,willDeleteEls:c,renderFinally:S};function f(m,y,x,b,w){b?(y=m,_(m,function(A,D){!A.isRemoved()&&I(D,D)})):new gr(y,m,L,L).add(I).update(I).remove(ge(I,null)).execute();function L(A){return A.getId()}function I(A,D){var N=A!=null?m[A]:null,T=D!=null?y[D]:null,M=h(N,T,x,w);M&&f(N&&N.viewChildren||[],T&&T.viewChildren||[],M,b,w+1)}}function p(m){var y=$e();return m&&_(m,function(x,b){var w=y[b];_(x,function(L){L&&(w.push(L),mt(L).willDelete=!0)})}),y}function S(){_(c,function(m){_(m,function(y){y.parent&&y.parent.remove(y)})}),_(v,function(m){m.invisible=!0,m.dirty()})}},t.prototype._doAnimation=function(e,a,n,o){var i=n.get("animationDurationUpdate"),l=n.get("animationEasing"),u=(Ye(i)?0:i)||0,s=(Ye(l)?null:l)||"cubicOut",v=Xi();_(a.willDeleteEls,function(h,c){_(h,function(g,d){if(!g.invisible){var f=g.parent,p,S=mt(f);if(o&&o.direction==="drillDown")p=f===o.rootNodeGroup?{shape:{x:0,y:0,width:S.nodeWidth,height:S.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var m=0,y=0;S.willDelete||(m=S.nodeWidth/2,y=S.nodeHeight/2),p=c==="nodeGroup"?{x:m,y,style:{opacity:0}}:{shape:{x:m,y,width:0,height:0},style:{opacity:0}}}p&&v.add(g,p,u,0,s)}})}),_(this._storage,function(h,c){_(h,function(g,d){var f=a.lastsForAnimation[c][d],p={};f&&(g instanceof be?f.oldX!=null&&(p.x=g.x,p.y=g.y,g.x=f.oldX,g.y=f.oldY):(f.oldShape&&(p.shape=X({},g.shape),g.setShape(f.oldShape)),f.fadein?(g.setStyle("opacity",0),p.style={opacity:1}):g.style.opacity!==1&&(p.style={opacity:1})),v.add(g,p,u,0,s))})},this),this._state="animating",v.finished(me(function(){this._state="ready",a.renderFinally()},this)).start()},t.prototype._resetController=function(e){var a=this._controller,n=this._controllerHost;n||(this._controllerHost={target:this.group},n=this._controllerHost),a||(a=this._controller=new va(e.getZr()),a.enable(this.seriesModel.get("roam")),n.zoomLimit=this.seriesModel.get("scaleLimit"),n.zoom=this.seriesModel.get("zoom"),a.on("pan",me(this._onPan,this)),a.on("zoom",me(this._onZoom,this)));var o=new pt(0,0,e.getWidth(),e.getHeight());a.setPointerChecker(function(i,l,u){return o.contain(l,u)})},t.prototype._clearController=function(){var e=this._controller;this._controllerHost=null,e&&(e.dispose(),e=null)},t.prototype._onPan=function(e){if(this._state!=="animating"&&(Math.abs(e.dx)>Xa||Math.abs(e.dy)>Xa)){var a=this.seriesModel.getData().tree.root;if(!a)return;var n=a.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var a=e.originX,n=e.originY,o=e.scale;if(this._state!=="animating"){var i=this.seriesModel.getData().tree.root;if(!i)return;var l=i.getLayout();if(!l)return;var u=new pt(l.x,l.y,l.width,l.height),s=null,v=this._controllerHost;s=v.zoomLimit;var h=v.zoom=v.zoom||1;if(h*=o,s){var c=s.min||0,g=s.max||1/0;h=Math.max(Math.min(g,h),c)}var d=h/v.zoom;v.zoom=h;var f=this.seriesModel.layoutInfo;a-=f.x,n-=f.y;var p=mn();Ia(p,p,[-a,-n]),dn(p,p,[d,d]),Ia(p,p,[a,n]),u.applyTransform(p),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:u.x,y:u.y,width:u.width,height:u.height}})}},t.prototype._initEvents=function(e){var a=this;e.on("click",function(n){if(a._state==="ready"){var o=a.seriesModel.get("nodeClick",!0);if(o){var i=a.findTarget(n.offsetX,n.offsetY);if(i){var l=i.node;if(l.getLayout().isLeafRoot)a._rootToNode(i);else if(o==="zoomToNode")a._zoomToNode(i);else if(o==="link"){var u=l.hostTree.data.getItemModel(l.dataIndex),s=u.get("link",!0),v=u.get("target",!0)||"blank";s&&dr(s,v)}}}}},this)},t.prototype._renderBreadcrumb=function(e,a,n){var o=this;n||(n=e.get("leafDepth",!0)!=null?{node:e.getViewRoot()}:this.findTarget(a.getWidth()/2,a.getHeight()/2),n||(n={node:e.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new Bi(this.group))).render(e,a,n.node,function(i){o._state!=="animating"&&(da(e.getViewRoot(),i)?o._rootToNode({node:i}):o._zoomToNode({node:i}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=$e(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,a){var n,o=this.seriesModel.getViewRoot();return o.eachNode({attr:"viewChildren",order:"preorder"},function(i){var l=this._storage.background[i.getRawIndex()];if(l){var u=l.transformCoordToLocal(e,a),s=l.shape;if(s.x<=u[0]&&u[0]<=s.x+s.width&&s.y<=u[1]&&u[1]<=s.y+s.height)n={node:i,offsetX:u[0],offsetY:u[1]};else return!1}},this),n},t.type="treemap",t})(Ie);function $e(){return{nodeGroup:[],background:[],content:[]}}function qi(r,t,e,a,n,o,i,l,u,s){if(!i)return;var v=i.getLayout(),h=r.getData(),c=i.getModel();if(h.setItemGraphicEl(i.dataIndex,null),!v||!v.isInView)return;var g=v.width,d=v.height,f=v.borderWidth,p=v.invisible,S=i.getRawIndex(),m=l&&l.getRawIndex(),y=i.viewChildren,x=v.upperHeight,b=y&&y.length,w=c.getModel("itemStyle"),L=c.getModel(["emphasis","itemStyle"]),I=c.getModel(["blur","itemStyle"]),A=c.getModel(["select","itemStyle"]),D=w.get("borderRadius")||0,N=j("nodeGroup",ta);if(!N)return;if(u.add(N),N.x=v.x||0,N.y=v.y||0,N.markRedraw(),mt(N).nodeWidth=g,mt(N).nodeHeight=d,v.isAboveViewRoot)return N;var T=j("background",Fa,s,Yi);T&&z(N,T,b&&v.upperLabelHeight);var M=c.getModel("emphasis"),P=M.get("focus"),E=M.get("blurScope"),C=M.get("disabled"),V=P==="ancestor"?i.getAncestorsIndices():P==="descendant"?i.getDescendantIndices():P;if(b)Da(N)&&vt(N,!1),T&&(vt(T,!C),h.setItemGraphicEl(i.dataIndex,T),La(T,V,E));else{var k=j("content",Fa,s,Zi);k&&B(N,k),T.disableMorphing=!0,T&&Da(T)&&vt(T,!1),vt(N,!C),h.setItemGraphicEl(i.dataIndex,N);var R=c.getShallow("cursor");R&&k.attr("cursor",R),La(N,V,E)}return N;function z(O,G,Z){var W=pe(G);if(W.dataIndex=i.dataIndex,W.seriesIndex=r.seriesIndex,G.setShape({x:0,y:0,width:g,height:d,r:D}),p)F(G);else{G.invisible=!1;var K=i.getVisual("style"),ae=K.stroke,le=Za(w);le.fill=ae;var U=_e(L);U.fill=L.get("borderColor");var Q=_e(I);Q.fill=I.get("borderColor");var ie=_e(A);if(ie.fill=A.get("borderColor"),Z){var Le=g-2*f;$(G,ae,K.opacity,{x:f,y:0,width:Le,height:x})}else G.removeTextContent();G.setStyle(le),G.ensureState("emphasis").style=U,G.ensureState("blur").style=Q,G.ensureState("select").style=ie,jt(G)}O.add(G)}function B(O,G){var Z=pe(G);Z.dataIndex=i.dataIndex,Z.seriesIndex=r.seriesIndex;var W=Math.max(g-2*f,0),K=Math.max(d-2*f,0);if(G.culling=!0,G.setShape({x:f,y:f,width:W,height:K,r:D}),p)F(G);else{G.invisible=!1;var ae=i.getVisual("style"),le=ae.fill,U=Za(w);U.fill=le,U.decal=ae.decal;var Q=_e(L),ie=_e(I),Le=_e(A);$(G,le,ae.opacity,null),G.setStyle(U),G.ensureState("emphasis").style=Q,G.ensureState("blur").style=ie,G.ensureState("select").style=Le,jt(G)}O.add(G)}function F(O){!O.invisible&&o.push(O)}function $(O,G,Z,W){var K=c.getModel(W?Ya:Wa),ae=wt(c.get("name"),null),le=K.getShallow("show");Xe(O,We(c,W?Ya:Wa),{defaultText:le?ae:null,inheritColor:G,defaultOpacity:Z,labelFetcher:r,labelDataIndex:i.dataIndex});var U=O.getTextContent();if(U){var Q=U.style,ie=fn(Q.padding||0);W&&(O.setTextConfig({layoutRect:W}),U.disableLabelLayout=!0),U.beforeUpdate=function(){var ye=Math.max((W?W.width:O.shape.width)-ie[1]-ie[3],0),st=Math.max((W?W.height:O.shape.height)-ie[0]-ie[2],0);(Q.width!==ye||Q.height!==st)&&U.setStyle({width:ye,height:st})},Q.truncateMinChar=2,Q.lineOverflow="truncate",Y(Q,W,v);var Le=U.getState("emphasis");Y(Le?Le.style:null,W,v)}}function Y(O,G,Z){var W=O?O.text:null;if(!G&&Z.isLeafRoot&&W!=null){var K=r.get("drillDownIcon",!0);O.text=K?K+" "+W:W}}function j(O,G,Z,W){var K=m!=null&&e[O][m],ae=n[O];return K?(e[O][m]=null,ne(ae,K)):p||(K=new G,K instanceof pn&&(K.z2=$i(Z,W)),he(ae,K)),t[O][S]=K}function ne(O,G){var Z=O[S]={};G instanceof ta?(Z.oldX=G.x,Z.oldY=G.y):Z.oldShape=X({},G.shape)}function he(O,G){var Z=O[S]={},W=i.parentNode,K=G instanceof be;if(W&&(!a||a.direction==="drillDown")){var ae=0,le=0,U=n.background[W.getRawIndex()];!a&&U&&U.oldShape&&(ae=U.oldShape.width,le=U.oldShape.height),K?(Z.oldX=0,Z.oldY=le):Z.oldShape={x:ae,y:le,width:0,height:0}}Z.fadein=!K}}function $i(r,t){return r*Wi+t}var ji="itemStyle",kr=lt();const Ki={seriesType:"treemap",reset:function(r){var t=r.getData().tree,e=t.root;e.isRemoved()||Rr(e,{},r.getViewRoot().getAncestors(),r)}};function Rr(r,t,e,a){var n=r.getModel(),o=r.getLayout(),i=r.hostTree.data;if(!(!o||o.invisible||!o.isInView)){var l=n.getModel(ji),u=Ji(l,t,a),s=i.ensureUniqueItemVisual(r.dataIndex,"style"),v=l.get("borderColor"),h=l.get("borderColorSaturation"),c;h!=null&&(c=Ua(u),v=Qi(h,c)),s.stroke=v;var g=r.viewChildren;if(!g||!g.length)c=Ua(u),s.fill=c;else{var d=eo(r,n,o,l,u,g);_(g,function(f,p){if(f.depth>=e.length||f===e[f.depth]){var S=to(n,u,f,p,d,a);Rr(f,S,e,a)}})}}}function Ji(r,t,e){var a=X({},t),n=e.designatedVisualItemStyle;return _(["color","colorAlpha","colorSaturation"],function(o){n[o]=t[o];var i=r.get(o);n[o]=null,i!=null&&(a[o]=i)}),a}function Ua(r){var t=zt(r,"color");if(t){var e=zt(r,"colorAlpha"),a=zt(r,"colorSaturation");return a&&(t=fr(t,null,null,a)),e&&(t=Sn(t,e)),t}}function Qi(r,t){return t!=null?fr(t,null,null,r):null}function zt(r,t){var e=r[t];if(e!=null&&e!=="none")return e}function eo(r,t,e,a,n,o){if(!(!o||!o.length)){var i=Gt(t,"color")||n.color!=null&&n.color!=="none"&&(Gt(t,"colorAlpha")||Gt(t,"colorSaturation"));if(i){var l=t.get("visualMin"),u=t.get("visualMax"),s=e.dataExtent.slice();l!=null&&l<s[0]&&(s[0]=l),u!=null&&u>s[1]&&(s[1]=u);var v=t.get("colorMappingBy"),h={type:i.name,dataExtent:s,visual:i.range};h.type==="color"&&(v==="index"||v==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var c=new br(h);return kr(c).drColorMappingBy=v,c}}}function Gt(r,t){var e=r.get(t);return te(e)&&e.length?{name:t,range:e}:null}function to(r,t,e,a,n,o){var i=X({},t);if(n){var l=n.type,u=l==="color"&&kr(n).drColorMappingBy,s=u==="index"?a:u==="id"?o.mapIdToIndex(e.getId()):e.getValue(r.get("visualDimension"));i[l]=n.mapValueToVisual(s)}return i}var it=Math.max,St=Math.min,qa=Jt,fa=_,zr=["itemStyle","borderWidth"],ao=["itemStyle","gapWidth"],ro=["upperLabel","show"],no=["upperLabel","height"];const io={seriesType:"treemap",reset:function(r,t,e,a){var n=e.getWidth(),o=e.getHeight(),i=r.option,l=Ze(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),u=i.size||[],s=H(qa(l.width,u[0]),n),v=H(qa(l.height,u[1]),o),h=a&&a.type,c=["treemapZoomToNode","treemapRootToNode"],g=nt(a,c,r),d=h==="treemapRender"||h==="treemapMove"?a.rootRect:null,f=r.getViewRoot(),p=Vr(f);if(h!=="treemapMove"){var S=h==="treemapZoomToNode"?co(r,g,f,s,v):d?[d.width,d.height]:[s,v],m=i.sort;m&&m!=="asc"&&m!=="desc"&&(m="desc");var y={squareRatio:i.squareRatio,sort:m,leafDepth:i.leafDepth};f.hostTree.clearLayouts();var x={x:0,y:0,width:S[0],height:S[1],area:S[0]*S[1]};f.setLayout(x),Gr(f,y,!1,0),x=f.getLayout(),fa(p,function(w,L){var I=(p[L+1]||f).getValue();w.setLayout(X({dataExtent:[I,I],borderWidth:0,upperHeight:0},x))})}var b=r.getData().tree.root;b.setLayout(ho(l,d,g),!0),r.setLayoutInfo(l),Br(b,new pt(-l.x,-l.y,n,o),p,f,0)}};function Gr(r,t,e,a){var n,o;if(!r.isRemoved()){var i=r.getLayout();n=i.width,o=i.height;var l=r.getModel(),u=l.get(zr),s=l.get(ao)/2,v=Hr(l),h=Math.max(u,v),c=u-s,g=h-s;r.setLayout({borderWidth:u,upperHeight:h,upperLabelHeight:v},!0),n=it(n-2*c,0),o=it(o-c-g,0);var d=n*o,f=oo(r,l,d,t,e,a);if(f.length){var p={x:c,y:g,width:n,height:o},S=St(n,o),m=1/0,y=[];y.area=0;for(var x=0,b=f.length;x<b;){var w=f[x];y.push(w),y.area+=w.getLayout().area;var L=vo(y,S,t.squareRatio);L<=m?(x++,m=L):(y.area-=y.pop().getLayout().area,$a(y,S,p,s,!1),S=St(p.width,p.height),y.length=y.area=0,m=1/0)}if(y.length&&$a(y,S,p,s,!0),!e){var I=l.get("childrenVisibleMin");I!=null&&d<I&&(e=!0)}for(var x=0,b=f.length;x<b;x++)Gr(f[x],t,e,a+1)}}}function oo(r,t,e,a,n,o){var i=r.children||[],l=a.sort;l!=="asc"&&l!=="desc"&&(l=null);var u=a.leafDepth!=null&&a.leafDepth<=o;if(n&&!u)return r.viewChildren=[];i=pr(i,function(g){return!g.isRemoved()}),uo(i,l);var s=so(t,i,l);if(s.sum===0)return r.viewChildren=[];if(s.sum=lo(t,e,s.sum,l,i),s.sum===0)return r.viewChildren=[];for(var v=0,h=i.length;v<h;v++){var c=i[v].getValue()/s.sum*e;i[v].setLayout({area:c})}return u&&(i.length&&r.setLayout({isLeafRoot:!0},!0),i.length=0),r.viewChildren=i,r.setLayout({dataExtent:s.dataExtent},!0),i}function lo(r,t,e,a,n){if(!a)return e;for(var o=r.get("visibleMin"),i=n.length,l=i,u=i-1;u>=0;u--){var s=n[a==="asc"?i-u-1:u].getValue();s/e*t<o&&(l=u,e-=s)}return a==="asc"?n.splice(0,i-l):n.splice(l,i-l),e}function uo(r,t){return t&&r.sort(function(e,a){var n=t==="asc"?e.getValue()-a.getValue():a.getValue()-e.getValue();return n===0?t==="asc"?e.dataIndex-a.dataIndex:a.dataIndex-e.dataIndex:n}),r}function so(r,t,e){for(var a=0,n=0,o=t.length;n<o;n++)a+=t[n].getValue();var i=r.get("visualDimension"),l;return!t||!t.length?l=[NaN,NaN]:i==="value"&&e?(l=[t[t.length-1].getValue(),t[0].getValue()],e==="asc"&&l.reverse()):(l=[1/0,-1/0],fa(t,function(u){var s=u.getValue(i);s<l[0]&&(l[0]=s),s>l[1]&&(l[1]=s)})),{sum:a,dataExtent:l}}function vo(r,t,e){for(var a=0,n=1/0,o=0,i=void 0,l=r.length;o<l;o++)i=r[o].getLayout().area,i&&(i<n&&(n=i),i>a&&(a=i));var u=r.area*r.area,s=t*t*e;return u?it(s*a/u,u/(s*n)):1/0}function $a(r,t,e,a,n){var o=t===e.width?0:1,i=1-o,l=["x","y"],u=["width","height"],s=e[l[o]],v=t?r.area/t:0;(n||v>e[u[i]])&&(v=e[u[i]]);for(var h=0,c=r.length;h<c;h++){var g=r[h],d={},f=v?g.getLayout().area/v:0,p=d[u[i]]=it(v-2*a,0),S=e[l[o]]+e[u[o]]-s,m=h===c-1||S<f?S:f,y=d[u[o]]=it(m-2*a,0);d[l[i]]=e[l[i]]+St(a,p/2),d[l[o]]=s+St(a,y/2),s+=m,g.setLayout(d,!0)}e[l[i]]+=v,e[u[i]]-=v}function co(r,t,e,a,n){var o=(t||{}).node,i=[a,n];if(!o||o===e)return i;for(var l,u=a*n,s=u*r.option.zoomToNodeRatio;l=o.parentNode;){for(var v=0,h=l.children,c=0,g=h.length;c<g;c++)v+=h[c].getValue();var d=o.getValue();if(d===0)return i;s*=v/d;var f=l.getModel(),p=f.get(zr),S=Math.max(p,Hr(f));s+=4*p*p+(3*p+S)*Math.pow(s,.5),s>Aa&&(s=Aa),o=l}s<u&&(s=u);var m=Math.pow(s/u,.5);return[a*m,n*m]}function ho(r,t,e){if(t)return{x:t.x,y:t.y};var a={x:0,y:0};if(!e)return a;var n=e.node,o=n.getLayout();if(!o)return a;for(var i=[o.width/2,o.height/2],l=n;l;){var u=l.getLayout();i[0]+=u.x,i[1]+=u.y,l=l.parentNode}return{x:r.width/2-i[0],y:r.height/2-i[1]}}function Br(r,t,e,a,n){var o=r.getLayout(),i=e[n],l=i&&i===r;if(!(i&&!l||n===e.length&&r!==a)){r.setLayout({isInView:!0,invisible:!l&&!t.intersect(o),isAboveViewRoot:l},!0);var u=new pt(t.x-o.x,t.y-o.y,t.width,t.height);fa(r.viewChildren||[],function(s){Br(s,u,e,a,n+1)})}}function Hr(r){return r.get(ro)?r.get(no):0}function go(r){r.registerSeriesModel(Ri),r.registerChartView(Ui),r.registerVisual(Ki),r.registerLayout(io),ki(r)}function fo(r){var t=r.findComponents({mainType:"legend"});!t||!t.length||r.eachSeriesByType("graph",function(e){var a=e.getCategoriesData(),n=e.getGraph(),o=n.data,i=a.mapArray(a.getName);o.filterSelf(function(l){var u=o.getItemModel(l),s=u.getShallow("category");if(s!=null){Ee(s)&&(s=i[s]);for(var v=0;v<t.length;v++)if(!t[v].isSelected(s))return!1}return!0})})}function po(r){var t={};r.eachSeriesByType("graph",function(e){var a=e.getCategoriesData(),n=e.getData(),o={};a.each(function(i){var l=a.getName(i);o["ec-"+l]=i;var u=a.getItemModel(i),s=u.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(l,t)),a.setItemVisual(i,"style",s);for(var v=["symbol","symbolSize","symbolKeepAspect"],h=0;h<v.length;h++){var c=u.getShallow(v[h],!0);c!=null&&a.setItemVisual(i,v[h],c)}}),a.count()&&n.each(function(i){var l=n.getItemModel(i),u=l.getShallow("category");if(u!=null){ze(u)&&(u=o["ec-"+u]);var s=a.getItemVisual(u,"style"),v=n.ensureUniqueItemVisual(i,"style");X(v,s);for(var h=["symbol","symbolSize","symbolKeepAspect"],c=0;c<h.length;c++)n.setItemVisual(i,h[c],a.getItemVisual(u,h[c]))}})})}function gt(r){return r instanceof Array||(r=[r,r]),r}function yo(r){r.eachSeriesByType("graph",function(t){var e=t.getGraph(),a=t.getEdgeData(),n=gt(t.get("edgeSymbol")),o=gt(t.get("edgeSymbolSize"));a.setVisual("fromSymbol",n&&n[0]),a.setVisual("toSymbol",n&&n[1]),a.setVisual("fromSymbolSize",o&&o[0]),a.setVisual("toSymbolSize",o&&o[1]),a.setVisual("style",t.getModel("lineStyle").getLineStyle()),a.each(function(i){var l=a.getItemModel(i),u=e.getEdgeByIndex(i),s=gt(l.getShallow("symbol",!0)),v=gt(l.getShallow("symbolSize",!0)),h=l.getModel("lineStyle").getLineStyle(),c=a.ensureUniqueItemVisual(i,"style");switch(X(c,h),c.stroke){case"source":{var g=u.node1.getVisual("style");c.stroke=g&&g.fill;break}case"target":{var g=u.node2.getVisual("style");c.stroke=g&&g.fill;break}}s[0]&&u.setVisual("fromSymbol",s[0]),s[1]&&u.setVisual("toSymbol",s[1]),v[0]&&u.setVisual("fromSymbolSize",v[0]),v[1]&&u.setVisual("toSymbolSize",v[1])})})}var aa="-->",Mt=function(r){return r.get("autoCurveness")||null},Or=function(r,t){var e=Mt(r),a=20,n=[];if(Ee(e))a=e;else if(te(e)){r.__curvenessList=e;return}t>a&&(a=t);var o=a%2?a+2:a+3;n=[];for(var i=0;i<o;i++)n.push((i%2?i+1:i)/10*(i%2?-1:1));r.__curvenessList=n},ot=function(r,t,e){var a=[r.id,r.dataIndex].join("."),n=[t.id,t.dataIndex].join(".");return[e.uid,a,n].join(aa)},Fr=function(r){var t=r.split(aa);return[t[0],t[2],t[1]].join(aa)},mo=function(r,t){var e=ot(r.node1,r.node2,t);return t.__edgeMap[e]},So=function(r,t){var e=ra(ot(r.node1,r.node2,t),t),a=ra(ot(r.node2,r.node1,t),t);return e+a},ra=function(r,t){var e=t.__edgeMap;return e[r]?e[r].length:0};function xo(r){Mt(r)&&(r.__curvenessList=[],r.__edgeMap={},Or(r))}function bo(r,t,e,a){if(Mt(e)){var n=ot(r,t,e),o=e.__edgeMap,i=o[Fr(n)];o[n]&&!i?o[n].isForward=!0:i&&o[n]&&(i.isForward=!0,o[n].isForward=!1),o[n]=o[n]||[],o[n].push(a)}}function pa(r,t,e,a){var n=Mt(t),o=te(n);if(!n)return null;var i=mo(r,t);if(!i)return null;for(var l=-1,u=0;u<i.length;u++)if(i[u]===e){l=u;break}var s=So(r,t);Or(t,s),r.lineStyle=r.lineStyle||{};var v=ot(r.node1,r.node2,t),h=t.__curvenessList,c=o||s%2?0:1;if(i.isForward)return h[c+l];var g=Fr(v),d=ra(g,t),f=h[l+d+c];return a?o?n&&n[0]===0?(d+c)%2?f:-f:((d%2?0:1)+c)%2?f:-f:(d+c)%2?f:-f:h[l+d+c]}function Xr(r){var t=r.coordinateSystem;if(!(t&&t.type!=="view")){var e=r.getGraph();e.eachNode(function(a){var n=a.getModel();a.setLayout([+n.get("x"),+n.get("y")])}),ya(e,r)}}function ya(r,t){r.eachEdge(function(e,a){var n=ut(e.getModel().get(["lineStyle","curveness"]),-pa(e,t,a,!0),0),o=Me(e.node1.getLayout()),i=Me(e.node2.getLayout()),l=[o,i];+n&&l.push([(o[0]+i[0])/2-(o[1]-i[1])*n,(o[1]+i[1])/2-(i[0]-o[0])*n]),e.setLayout(l)})}function wo(r,t){r.eachSeriesByType("graph",function(e){var a=e.get("layout"),n=e.coordinateSystem;if(n&&n.type!=="view"){var o=e.getData(),i=[];_(n.dimensions,function(c){i=i.concat(o.mapDimensionsAll(c))});for(var l=0;l<o.count();l++){for(var u=[],s=!1,v=0;v<i.length;v++){var h=o.get(i[v],l);isNaN(h)||(s=!0),u.push(h)}s?o.setItemLayout(l,n.dataToPoint(u)):o.setItemLayout(l,[NaN,NaN])}ya(o.graph,e)}else(!a||a==="none")&&Xr(e)})}function Je(r){var t=r.coordinateSystem;if(t.type!=="view")return 1;var e=r.option.nodeScaleRatio,a=t.scaleX,n=t.getZoom(),o=(n-1)*e+1;return o/a}function Qe(r){var t=r.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var ja=Math.PI,Bt=[];function ma(r,t,e,a){var n=r.coordinateSystem;if(!(n&&n.type!=="view")){var o=n.getBoundingRect(),i=r.getData(),l=i.graph,u=o.width/2+o.x,s=o.height/2+o.y,v=Math.min(o.width,o.height)/2,h=i.count();if(i.setLayout({cx:u,cy:s}),!!h){if(e){var c=n.pointToData(a),g=c[0],d=c[1],f=[g-u,d-s];sa(f,f),xn(f,f,v),e.setLayout([u+f[0],s+f[1]],!0);var p=r.get(["circular","rotateLabel"]);Wr(e,p,u,s)}Io[t](r,l,i,v,u,s,h),l.eachEdge(function(S,m){var y=ut(S.getModel().get(["lineStyle","curveness"]),pa(S,r,m),0),x=Me(S.node1.getLayout()),b=Me(S.node2.getLayout()),w,L=(x[0]+b[0])/2,I=(x[1]+b[1])/2;+y&&(y*=3,w=[u*y+L*(1-y),s*y+I*(1-y)]),S.setLayout([x,b,w])})}}}var Io={value:function(r,t,e,a,n,o,i){var l=0,u=e.getSum("value"),s=Math.PI*2/(u||i);t.eachNode(function(v){var h=v.getValue("value"),c=s*(u?h:1)/2;l+=c,v.setLayout([a*Math.cos(l)+n,a*Math.sin(l)+o]),l+=c})},symbolSize:function(r,t,e,a,n,o,i){var l=0;Bt.length=i;var u=Je(r);t.eachNode(function(h){var c=Qe(h);isNaN(c)&&(c=2),c<0&&(c=0),c*=u;var g=Math.asin(c/2/a);isNaN(g)&&(g=ja/2),Bt[h.dataIndex]=g,l+=g*2});var s=(2*ja-l)/i/2,v=0;t.eachNode(function(h){var c=s+Bt[h.dataIndex];v+=c,(!h.getLayout()||!h.getLayout().fixed)&&h.setLayout([a*Math.cos(v)+n,a*Math.sin(v)+o]),v+=c})}};function Wr(r,t,e,a){var n=r.getGraphicEl();if(n){var o=r.getModel(),i=o.get(["label","rotate"])||0,l=n.getSymbolPath();if(t){var u=r.getLayout(),s=Math.atan2(u[1]-a,u[0]-e);s<0&&(s=Math.PI*2+s);var v=u[0]<e;v&&(s=s-Math.PI);var h=v?"left":"right";l.setTextConfig({rotation:-s,position:h,origin:"center"});var c=l.ensureState("emphasis");X(c.textConfig||(c.textConfig={}),{position:h})}else l.setTextConfig({rotation:i*=Math.PI/180})}}function Do(r){r.eachSeriesByType("graph",function(t){t.get("layout")==="circular"&&ma(t,"symbolSize")})}var Be=Qt;function Lo(r,t,e){for(var a=r,n=t,o=e.rect,i=o.width,l=o.height,u=[o.x+i/2,o.y+l/2],s=e.gravity==null?.1:e.gravity,v=0;v<a.length;v++){var h=a[v];h.p||(h.p=bn(i*(Math.random()-.5)+u[0],l*(Math.random()-.5)+u[1])),h.pp=Me(h.p),h.edges=null}var c=e.friction==null?.6:e.friction,g=c,d,f;return{warmUp:function(){g=c*.8},setFixed:function(p){a[p].fixed=!0},setUnfixed:function(p){a[p].fixed=!1},beforeStep:function(p){d=p},afterStep:function(p){f=p},step:function(p){d&&d(a,n);for(var S=[],m=a.length,y=0;y<n.length;y++){var x=n[y];if(!x.ignoreForceLayout){var b=x.n1,w=x.n2;je(S,w.p,b.p);var L=Ta(S)-x.d,I=w.w/(b.w+w.w);isNaN(I)&&(I=0),sa(S,S),!b.fixed&&Be(b.p,b.p,S,I*L*g),!w.fixed&&Be(w.p,w.p,S,-(1-I)*L*g)}}for(var y=0;y<m;y++){var A=a[y];A.fixed||(je(S,u,A.p),Be(A.p,A.p,S,s*g))}for(var y=0;y<m;y++)for(var b=a[y],D=y+1;D<m;D++){var w=a[D];je(S,w.p,b.p);var L=Ta(S);L===0&&(wn(S,Math.random()-.5,Math.random()-.5),L=1);var N=(b.rep+w.rep)/L/L;!b.fixed&&Be(b.pp,b.pp,S,N),!w.fixed&&Be(w.pp,w.pp,S,-N)}for(var T=[],y=0;y<m;y++){var A=a[y];A.fixed||(je(T,A.p,A.pp),Be(A.p,A.p,T,g),ue(A.pp,A.p))}g=g*.992;var M=g<.01;f&&f(a,n,M),p&&p(M)}}}function Ao(r){r.eachSeriesByType("graph",function(t){var e=t.coordinateSystem;if(!(e&&e.type!=="view"))if(t.get("layout")==="force"){var a=t.preservedPoints||{},n=t.getGraph(),o=n.data,i=n.edgeData,l=t.getModel("force"),u=l.get("initLayout");t.preservedPoints?o.each(function(y){var x=o.getId(y);o.setItemLayout(y,a[x]||[NaN,NaN])}):!u||u==="none"?Xr(t):u==="circular"&&ma(t,"value");var s=o.getDataExtent("value"),v=i.getDataExtent("value"),h=l.get("repulsion"),c=l.get("edgeLength"),g=te(h)?h:[h,h],d=te(c)?c:[c,c];d=[d[1],d[0]];var f=o.mapArray("value",function(y,x){var b=o.getItemLayout(x),w=ve(y,s,g);return isNaN(w)&&(w=(g[0]+g[1])/2),{w,rep:w,fixed:o.getItemModel(x).get("fixed"),p:!b||isNaN(b[0])||isNaN(b[1])?null:b}}),p=i.mapArray("value",function(y,x){var b=n.getEdgeByIndex(x),w=ve(y,v,d);isNaN(w)&&(w=(d[0]+d[1])/2);var L=b.getModel(),I=ut(b.getModel().get(["lineStyle","curveness"]),-pa(b,t,x,!0),0);return{n1:f[b.node1.dataIndex],n2:f[b.node2.dataIndex],d:w,curveness:I,ignoreForceLayout:L.get("ignoreForceLayout")}}),S=e.getBoundingRect(),m=Lo(f,p,{rect:S,gravity:l.get("gravity"),friction:l.get("friction")});m.beforeStep(function(y,x){for(var b=0,w=y.length;b<w;b++)y[b].fixed&&ue(y[b].p,n.getNodeByIndex(b).getLayout())}),m.afterStep(function(y,x,b){for(var w=0,L=y.length;w<L;w++)y[w].fixed||n.getNodeByIndex(w).setLayout(y[w].p),a[o.getId(w)]=y[w].p;for(var w=0,L=x.length;w<L;w++){var I=x[w],A=n.getEdgeByIndex(w),D=I.n1.p,N=I.n2.p,T=A.getLayout();T=T?T.slice():[],T[0]=T[0]||[],T[1]=T[1]||[],ue(T[0],D),ue(T[1],N),+I.curveness&&(T[2]=[(D[0]+N[0])/2-(D[1]-N[1])*I.curveness,(D[1]+N[1])/2-(N[0]-D[0])*I.curveness]),A.setLayout(T)}}),t.forceLayout=m,t.preservedPoints=a,m.step()}else t.forceLayout=null})}function To(r,t,e){var a=X(r.getBoxLayoutParams(),{aspect:e});return Ze(a,{width:t.getWidth(),height:t.getHeight()})}function No(r,t){var e=[];return r.eachSeriesByType("graph",function(a){var n=a.get("coordinateSystem");if(!n||n==="view"){var o=a.getData(),i=o.mapArray(function(p){var S=o.getItemModel(p);return[+S.get("x"),+S.get("y")]}),l=[],u=[];sr(i,l,u),u[0]-l[0]===0&&(u[0]+=1,l[0]-=1),u[1]-l[1]===0&&(u[1]+=1,l[1]-=1);var s=(u[0]-l[0])/(u[1]-l[1]),v=To(a,t,s);isNaN(s)&&(l=[v.x,v.y],u=[v.x+v.width,v.y+v.height]);var h=u[0]-l[0],c=u[1]-l[1],g=v.width,d=v.height,f=a.coordinateSystem=new ca;f.zoomLimit=a.get("scaleLimit"),f.setBoundingRect(l[0],l[1],h,c),f.setViewRect(v.x,v.y,g,d),f.setCenter(a.get("center"),t),f.setZoom(a.get("zoom")),e.push(f)}}),e}var Ht=[],Ot=[],Ft=[],He=Dn,Xt=Ln,Ka=Math.abs;function Ja(r,t,e){for(var a=r[0],n=r[1],o=r[2],i=1/0,l,u=e*e,s=.1,v=.1;v<=.9;v+=.1){Ht[0]=He(a[0],n[0],o[0],v),Ht[1]=He(a[1],n[1],o[1],v);var h=Ka(Xt(Ht,t)-u);h<i&&(i=h,l=v)}for(var c=0;c<32;c++){var g=l+s;Ot[0]=He(a[0],n[0],o[0],l),Ot[1]=He(a[1],n[1],o[1],l),Ft[0]=He(a[0],n[0],o[0],g),Ft[1]=He(a[1],n[1],o[1],g);var h=Xt(Ot,t)-u;if(Ka(h)<.01)break;var d=Xt(Ft,t)-u;s/=2,h<0?d>=0?l=l+s:l=l-s:d>=0?l=l-s:l=l+s}return l}function Wt(r,t){var e=[],a=In,n=[[],[],[]],o=[[],[]],i=[];t/=2,r.eachEdge(function(l,u){var s=l.getLayout(),v=l.getVisual("fromSymbol"),h=l.getVisual("toSymbol");s.__original||(s.__original=[Me(s[0]),Me(s[1])],s[2]&&s.__original.push(Me(s[2])));var c=s.__original;if(s[2]!=null){if(ue(n[0],c[0]),ue(n[1],c[2]),ue(n[2],c[1]),v&&v!=="none"){var g=Qe(l.node1),d=Ja(n,c[0],g*t);a(n[0][0],n[1][0],n[2][0],d,e),n[0][0]=e[3],n[1][0]=e[4],a(n[0][1],n[1][1],n[2][1],d,e),n[0][1]=e[3],n[1][1]=e[4]}if(h&&h!=="none"){var g=Qe(l.node2),d=Ja(n,c[1],g*t);a(n[0][0],n[1][0],n[2][0],d,e),n[1][0]=e[1],n[2][0]=e[2],a(n[0][1],n[1][1],n[2][1],d,e),n[1][1]=e[1],n[2][1]=e[2]}ue(s[0],n[0]),ue(s[1],n[2]),ue(s[2],n[1])}else{if(ue(o[0],c[0]),ue(o[1],c[1]),je(i,o[1],o[0]),sa(i,i),v&&v!=="none"){var g=Qe(l.node1);Qt(o[0],o[0],i,g*t)}if(h&&h!=="none"){var g=Qe(l.node2);Qt(o[1],o[1],i,-g*t)}ue(s[0],o[0]),ue(s[1],o[1])}})}function Qa(r){return r.type==="view"}var Mo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e,a){var n=new On,o=new Bn,i=this.group;this._controller=new va(a.getZr()),this._controllerHost={target:i},i.add(n.group),i.add(o.group),this._symbolDraw=n,this._lineDraw=o,this._firstRender=!0},t.prototype.render=function(e,a,n){var o=this,i=e.coordinateSystem;this._model=e;var l=this._symbolDraw,u=this._lineDraw,s=this.group;if(Qa(i)){var v={x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY};this._firstRender?s.attr(v):se(s,v,e)}Wt(e.getGraph(),Je(e));var h=e.getData();l.updateData(h);var c=e.getEdgeData();u.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,a,n),clearTimeout(this._layoutTimeout);var g=e.forceLayout,d=e.get(["force","layoutAnimation"]);g&&this._startForceLayoutIteration(g,d);var f=e.get("layout");h.graph.eachNode(function(y){var x=y.dataIndex,b=y.getGraphicEl(),w=y.getModel();if(b){b.off("drag").off("dragend");var L=w.get("draggable");L&&b.on("drag",function(A){switch(f){case"force":g.warmUp(),!o._layouting&&o._startForceLayoutIteration(g,d),g.setFixed(x),h.setItemLayout(x,[b.x,b.y]);break;case"circular":h.setItemLayout(x,[b.x,b.y]),y.setLayout({fixed:!0},!0),ma(e,"symbolSize",y,[A.offsetX,A.offsetY]),o.updateLayout(e);break;case"none":default:h.setItemLayout(x,[b.x,b.y]),ya(e.getGraph(),e),o.updateLayout(e);break}}).on("dragend",function(){g&&g.setUnfixed(x)}),b.setDraggable(L,!!w.get("cursor"));var I=w.get(["emphasis","focus"]);I==="adjacency"&&(pe(b).focus=y.getAdjacentDataIndices())}}),h.graph.eachEdge(function(y){var x=y.getGraphicEl(),b=y.getModel().get(["emphasis","focus"]);x&&b==="adjacency"&&(pe(x).focus={edge:[y.dataIndex],node:[y.node1.dataIndex,y.node2.dataIndex]})});var p=e.get("layout")==="circular"&&e.get(["circular","rotateLabel"]),S=h.getLayout("cx"),m=h.getLayout("cy");h.graph.eachNode(function(y){Wr(y,p,S,m)}),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,a){var n=this;(function o(){e.step(function(i){n.updateLayout(n._model),(n._layouting=!i)&&(a?n._layoutTimeout=setTimeout(o,16):o())})})()},t.prototype._updateController=function(e,a,n){var o=this,i=this._controller,l=this._controllerHost,u=this.group;if(i.setPointerChecker(function(s,v,h){var c=u.getBoundingRect();return c.applyTransform(u.transform),c.contain(v,h)&&!vr(s,n,e)}),!Qa(e.coordinateSystem)){i.disable();return}i.enable(e.get("roam")),l.zoomLimit=e.get("scaleLimit"),l.zoom=e.coordinateSystem.getZoom(),i.off("pan").off("zoom").on("pan",function(s){mr(l,s.dx,s.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:s.dx,dy:s.dy})}).on("zoom",function(s){Sr(l,s.scale,s.originX,s.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:s.scale,originX:s.originX,originY:s.originY}),o._updateNodeAndLinkScale(),Wt(e.getGraph(),Je(e)),o._lineDraw.updateLayout(),n.updateLabelLayout()})},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,a=e.getData(),n=Je(e);a.eachItemGraphicEl(function(o,i){o&&o.setSymbolScale(n)})},t.prototype.updateLayout=function(e){Wt(e.getGraph(),Je(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t})(Ie);function Oe(r){return"_EC_"+r}var Co=(function(){function r(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(t,e){t=t==null?""+e:""+t;var a=this._nodesMap;if(!a[Oe(t)]){var n=new Pe(t,e);return n.hostGraph=this,this.nodes.push(n),a[Oe(t)]=n,n}},r.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},r.prototype.getNodeById=function(t){return this._nodesMap[Oe(t)]},r.prototype.addEdge=function(t,e,a){var n=this._nodesMap,o=this._edgesMap;if(Ee(t)&&(t=this.nodes[t]),Ee(e)&&(e=this.nodes[e]),t instanceof Pe||(t=n[Oe(t)]),e instanceof Pe||(e=n[Oe(e)]),!(!t||!e)){var i=t.id+"-"+e.id,l=new Yr(t,e,a);return l.hostGraph=this,this._directed&&(t.outEdges.push(l),e.inEdges.push(l)),t.edges.push(l),t!==e&&e.edges.push(l),this.edges.push(l),o[i]=l,l}},r.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},r.prototype.getEdge=function(t,e){t instanceof Pe&&(t=t.id),e instanceof Pe&&(e=e.id);var a=this._edgesMap;return this._directed?a[t+"-"+e]:a[t+"-"+e]||a[e+"-"+t]},r.prototype.eachNode=function(t,e){for(var a=this.nodes,n=a.length,o=0;o<n;o++)a[o].dataIndex>=0&&t.call(e,a[o],o)},r.prototype.eachEdge=function(t,e){for(var a=this.edges,n=a.length,o=0;o<n;o++)a[o].dataIndex>=0&&a[o].node1.dataIndex>=0&&a[o].node2.dataIndex>=0&&t.call(e,a[o],o)},r.prototype.breadthFirstTraverse=function(t,e,a,n){if(e instanceof Pe||(e=this._nodesMap[Oe(e)]),!!e){for(var o=a==="out"?"outEdges":a==="in"?"inEdges":"edges",i=0;i<this.nodes.length;i++)this.nodes[i].__visited=!1;if(!t.call(n,e,null))for(var l=[e];l.length;)for(var u=l.shift(),s=u[o],i=0;i<s.length;i++){var v=s[i],h=v.node1===u?v.node2:v.node1;if(!h.__visited){if(t.call(n,h,u))return;l.push(h),h.__visited=!0}}}},r.prototype.update=function(){for(var t=this.data,e=this.edgeData,a=this.nodes,n=this.edges,o=0,i=a.length;o<i;o++)a[o].dataIndex=-1;for(var o=0,i=t.count();o<i;o++)a[t.getRawIndex(o)].dataIndex=o;e.filterSelf(function(l){var u=n[e.getRawIndex(l)];return u.node1.dataIndex>=0&&u.node2.dataIndex>=0});for(var o=0,i=n.length;o<i;o++)n[o].dataIndex=-1;for(var o=0,i=e.count();o<i;o++)n[e.getRawIndex(o)].dataIndex=o},r.prototype.clone=function(){for(var t=new r(this._directed),e=this.nodes,a=this.edges,n=0;n<e.length;n++)t.addNode(e[n].id,e[n].dataIndex);for(var n=0;n<a.length;n++){var o=a[n];t.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return t},r})(),Pe=(function(){function r(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=t??"",this.dataIndex=e??-1}return r.prototype.degree=function(){return this.edges.length},r.prototype.inDegree=function(){return this.inEdges.length},r.prototype.outDegree=function(){return this.outEdges.length},r.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostGraph,a=e.data.getItemModel(this.dataIndex);return a.getModel(t)}},r.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var a=this.edges[e];a.dataIndex<0||(t.edge.push(a.dataIndex),t.node.push(a.node1.dataIndex,a.node2.dataIndex))}return t},r.prototype.getTrajectoryDataIndices=function(){for(var t=rt(),e=rt(),a=0;a<this.edges.length;a++){var n=this.edges[a];if(!(n.dataIndex<0)){t.set(n.dataIndex,!0);for(var o=[n.node1],i=[n.node2],l=0;l<o.length;){var u=o[l];l++,e.set(u.dataIndex,!0);for(var s=0;s<u.inEdges.length;s++)t.set(u.inEdges[s].dataIndex,!0),o.push(u.inEdges[s].node1)}for(l=0;l<i.length;){var v=i[l];l++,e.set(v.dataIndex,!0);for(var s=0;s<v.outEdges.length;s++)t.set(v.outEdges[s].dataIndex,!0),i.push(v.outEdges[s].node2)}}}return{edge:t.keys(),node:e.keys()}},r})(),Yr=(function(){function r(t,e,a){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=a??-1}return r.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostGraph,a=e.edgeData.getItemModel(this.dataIndex);return a.getModel(t)}},r.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},r.prototype.getTrajectoryDataIndices=function(){var t=rt(),e=rt();t.set(this.dataIndex,!0);for(var a=[this.node1],n=[this.node2],o=0;o<a.length;){var i=a[o];o++,e.set(i.dataIndex,!0);for(var l=0;l<i.inEdges.length;l++)t.set(i.inEdges[l].dataIndex,!0),a.push(i.inEdges[l].node1)}for(o=0;o<n.length;){var u=n[o];o++,e.set(u.dataIndex,!0);for(var l=0;l<u.outEdges.length;l++)t.set(u.outEdges[l].dataIndex,!0),n.push(u.outEdges[l].node2)}return{edge:t.keys(),node:e.keys()}},r})();function Zr(r,t){return{getValue:function(e){var a=this[r][t];return a.getStore().get(a.getDimensionIndex(e||"value"),this.dataIndex)},setVisual:function(e,a){this.dataIndex>=0&&this[r][t].setItemVisual(this.dataIndex,e,a)},getVisual:function(e){return this[r][t].getItemVisual(this.dataIndex,e)},setLayout:function(e,a){this.dataIndex>=0&&this[r][t].setItemLayout(this.dataIndex,e,a)},getLayout:function(){return this[r][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][t].getRawIndex(this.dataIndex)}}}yr(Pe,Zr("hostGraph","data"));yr(Yr,Zr("hostGraph","edgeData"));function Ur(r,t,e,a,n){for(var o=new Co(a),i=0;i<r.length;i++)o.addNode(Jt(r[i].id,r[i].name,i),i);for(var l=[],u=[],s=0,i=0;i<t.length;i++){var v=t[i],h=v.source,c=v.target;o.addEdge(h,c,s)&&(u.push(v),l.push(Jt(wt(v.id,null),h+" > "+c)),s++)}var g=e.get("coordinateSystem"),d;if(g==="cartesian2d"||g==="polar")d=An(r,e);else{var f=Tn.get(g),p=f?f.dimensions||[]:[];It(p,"value")<0&&p.concat(["value"]);var S=hr(r,{coordDimensions:p,encodeDefine:e.getEncode()}).dimensions;d=new ft(S,e),d.initData(r)}var m=new ft(["value"],e);return m.initData(u,l),n&&n(d,m),Cr({mainData:d,struct:o,structAttr:"graph",datas:{node:d,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var Eo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.hasSymbolVisual=!0,e}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments);var a=this;function n(){return a._categoriesData}this.legendVisualProvider=new At(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},t.prototype.mergeOption=function(e){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(e){r.prototype.mergeDefaultAndTheme.apply(this,arguments),ia(e,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,a){var n=e.edges||e.links||[],o=e.data||e.nodes||[],i=this;if(o&&n){xo(this);var l=Ur(o,n,this,!0,u);return _(l.edges,function(s){bo(s.node1,s.node2,this,s.dataIndex)},this),l.data}function u(s,v){s.wrapMethod("getItemModel",function(d){var f=i._categoriesModels,p=d.getShallow("category"),S=f[p];return S&&(S.parentModel=d.parentModel,d.parentModel=S),d});var h=Ge.prototype.getModel;function c(d,f){var p=h.call(this,d,f);return p.resolveParentPath=g,p}v.wrapMethod("getItemModel",function(d){return d.resolveParentPath=g,d.getModel=c,d});function g(d){if(d&&(d[0]==="label"||d[1]==="label")){var f=d.slice();return d[0]==="label"?f[0]="edgeLabel":d[1]==="label"&&(f[1]="edgeLabel"),f}return d}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,a,n){if(n==="edge"){var o=this.getData(),i=this.getDataParams(e,n),l=o.graph.getEdgeByIndex(e),u=o.getName(l.node1.dataIndex),s=o.getName(l.node2.dataIndex),v=[];return u!=null&&v.push(u),s!=null&&v.push(s),Re("nameValue",{name:v.join(" > "),value:i.value,noValue:i.value==null})}var h=Nn({series:this,dataIndex:e,multipleSeries:a});return h},t.prototype._updateCategoriesData=function(){var e=we(this.option.categories||[],function(n){return n.value!=null?n:X({value:0},n)}),a=new ft(["value"],this);a.initData(e),this._categoriesData=a,this._categoriesModels=a.mapArray(function(n){return a.getItemModel(n)})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t})(De),Vo={type:"graphRoam",event:"graphRoam",update:"none"};function _o(r){r.registerChartView(Mo),r.registerSeriesModel(Eo),r.registerProcessor(fo),r.registerVisual(po),r.registerVisual(yo),r.registerLayout(wo),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,Do),r.registerLayout(Ao),r.registerCoordinateSystem("graphView",{dimensions:ca.dimensions,create:No}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Kt),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Kt),r.registerAction(Vo,function(t,e,a){e.eachComponent({mainType:"series",query:t},function(n){var o=n.coordinateSystem,i=xr(o,t,void 0,a);n.setCenter&&n.setCenter(i.center),n.setZoom&&n.setZoom(i.zoom)})})}var Po=(function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r})(),ko=(function(r){q(t,r);function t(e){var a=r.call(this,e)||this;return a.type="pointer",a}return t.prototype.getDefaultShape=function(){return new Po},t.prototype.buildPath=function(e,a){var n=Math.cos,o=Math.sin,i=a.r,l=a.width,u=a.angle,s=a.x-n(u)*l*(l>=i/3?1:2),v=a.y-o(u)*l*(l>=i/3?1:2);u=a.angle-Math.PI/2,e.moveTo(s,v),e.lineTo(a.x+n(u)*l,a.y+o(u)*l),e.lineTo(a.x+n(a.angle)*i,a.y+o(a.angle)*i),e.lineTo(a.x-n(u)*l,a.y-o(u)*l),e.lineTo(s,v)},t})(la);function Ro(r,t){var e=r.get("center"),a=t.getWidth(),n=t.getHeight(),o=Math.min(a,n),i=H(e[0],t.getWidth()),l=H(e[1],t.getHeight()),u=H(r.get("radius"),o/2);return{cx:i,cy:l,r:u}}function dt(r,t){var e=r==null?"":r+"";return t&&(ze(t)?e=t.replace("{value}",e):Ye(t)&&(e=t(r))),e}var zo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,a,n){this.group.removeAll();var o=e.get(["axisLine","lineStyle","color"]),i=Ro(e,n);this._renderMain(e,a,n,o,i),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,a,n,o,i){var l=this.group,u=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,v=-e.get("endAngle")/180*Math.PI,h=e.getModel("axisLine"),c=h.get("roundCap"),g=c?Ca:tt,d=h.get("show"),f=h.getModel("lineStyle"),p=f.get("width"),S=[s,v];nr(S,!u),s=S[0],v=S[1];for(var m=v-s,y=s,x=[],b=0;d&&b<o.length;b++){var w=Math.min(Math.max(o[b][0],0),1);v=s+m*w;var L=new g({shape:{startAngle:y,endAngle:v,cx:i.cx,cy:i.cy,clockwise:u,r0:i.r-p,r:i.r},silent:!0});L.setStyle({fill:o[b][1]}),L.setStyle(f.getLineStyle(["color","width"])),x.push(L),y=v}x.reverse(),_(x,function(A){return l.add(A)});var I=function(A){if(A<=0)return o[0][1];var D;for(D=0;D<o.length;D++)if(o[D][0]>=A&&(D===0?0:o[D-1][0])<A)return o[D][1];return o[D-1][1]};this._renderTicks(e,a,n,I,i,s,v,u,p),this._renderTitleAndDetail(e,a,n,I,i),this._renderAnchor(e,i),this._renderPointer(e,a,n,I,i,s,v,u,p)},t.prototype._renderTicks=function(e,a,n,o,i,l,u,s,v){for(var h=this.group,c=i.cx,g=i.cy,d=i.r,f=+e.get("min"),p=+e.get("max"),S=e.getModel("splitLine"),m=e.getModel("axisTick"),y=e.getModel("axisLabel"),x=e.get("splitNumber"),b=m.get("splitNumber"),w=H(S.get("length"),d),L=H(m.get("length"),d),I=l,A=(u-l)/x,D=A/b,N=S.getModel("lineStyle").getLineStyle(),T=m.getModel("lineStyle").getLineStyle(),M=S.get("distance"),P,E,C=0;C<=x;C++){if(P=Math.cos(I),E=Math.sin(I),S.get("show")){var V=M?M+v:v,k=new Na({shape:{x1:P*(d-V)+c,y1:E*(d-V)+g,x2:P*(d-w-V)+c,y2:E*(d-w-V)+g},style:N,silent:!0});N.stroke==="auto"&&k.setStyle({stroke:o(C/x)}),h.add(k)}if(y.get("show")){var V=y.get("distance")+M,R=dt(Mn(C/x*(p-f)+f),y.get("formatter")),z=o(C/x),B=P*(d-w-V)+c,F=E*(d-w-V)+g,$=y.get("rotate"),Y=0;$==="radial"?(Y=-I+2*Math.PI,Y>Math.PI/2&&(Y+=Math.PI)):$==="tangential"?Y=-I-Math.PI/2:Ee($)&&(Y=$*Math.PI/180),Y===0?h.add(new Ae({style:ke(y,{text:R,x:B,y:F,verticalAlign:E<-.8?"top":E>.8?"bottom":"middle",align:P<-.4?"left":P>.4?"right":"center"},{inheritColor:z}),silent:!0})):h.add(new Ae({style:ke(y,{text:R,x:B,y:F,verticalAlign:"middle",align:"center"},{inheritColor:z}),silent:!0,originX:B,originY:F,rotation:Y}))}if(m.get("show")&&C!==x){var V=m.get("distance");V=V?V+v:v;for(var j=0;j<=b;j++){P=Math.cos(I),E=Math.sin(I);var ne=new Na({shape:{x1:P*(d-V)+c,y1:E*(d-V)+g,x2:P*(d-L-V)+c,y2:E*(d-L-V)+g},silent:!0,style:T});T.stroke==="auto"&&ne.setStyle({stroke:o((C+j/b)/x)}),h.add(ne),I+=D}I-=D}else I+=A}},t.prototype._renderPointer=function(e,a,n,o,i,l,u,s,v){var h=this.group,c=this._data,g=this._progressEls,d=[],f=e.get(["pointer","show"]),p=e.getModel("progress"),S=p.get("show"),m=e.getData(),y=m.mapDimension("value"),x=+e.get("min"),b=+e.get("max"),w=[x,b],L=[l,u];function I(D,N){var T=m.getItemModel(D),M=T.getModel("pointer"),P=H(M.get("width"),i.r),E=H(M.get("length"),i.r),C=e.get(["pointer","icon"]),V=M.get("offsetCenter"),k=H(V[0],i.r),R=H(V[1],i.r),z=M.get("keepAspect"),B;return C?B=qt(C,k-P/2,R-E,P,E,null,z):B=new ko({shape:{angle:-Math.PI/2,width:P,r:E,x:k,y:R}}),B.rotation=-(N+Math.PI/2),B.x=i.cx,B.y=i.cy,B}function A(D,N){var T=p.get("roundCap"),M=T?Ca:tt,P=p.get("overlap"),E=P?p.get("width"):v/m.count(),C=P?i.r-E:i.r-(D+1)*E,V=P?i.r:i.r-D*E,k=new M({shape:{startAngle:l,endAngle:N,cx:i.cx,cy:i.cy,clockwise:s,r0:C,r:V}});return P&&(k.z2=ve(m.get(y,D),[x,b],[100,0],!0)),k}(S||f)&&(m.diff(c).add(function(D){var N=m.get(y,D);if(f){var T=I(D,l);fe(T,{rotation:-((isNaN(+N)?L[0]:ve(N,w,L,!0))+Math.PI/2)},e),h.add(T),m.setItemGraphicEl(D,T)}if(S){var M=A(D,l),P=p.get("clip");fe(M,{shape:{endAngle:ve(N,w,L,P)}},e),h.add(M),Ma(e.seriesIndex,m.dataType,D,M),d[D]=M}}).update(function(D,N){var T=m.get(y,D);if(f){var M=c.getItemGraphicEl(N),P=M?M.rotation:l,E=I(D,P);E.rotation=P,se(E,{rotation:-((isNaN(+T)?L[0]:ve(T,w,L,!0))+Math.PI/2)},e),h.add(E),m.setItemGraphicEl(D,E)}if(S){var C=g[N],V=C?C.shape.endAngle:l,k=A(D,V),R=p.get("clip");se(k,{shape:{endAngle:ve(T,w,L,R)}},e),h.add(k),Ma(e.seriesIndex,m.dataType,D,k),d[D]=k}}).execute(),m.each(function(D){var N=m.getItemModel(D),T=N.getModel("emphasis"),M=T.get("focus"),P=T.get("blurScope"),E=T.get("disabled");if(f){var C=m.getItemGraphicEl(D),V=m.getItemVisual(D,"style"),k=V.fill;if(C instanceof lr){var R=C.style;C.useStyle(X({image:R.image,x:R.x,y:R.y,width:R.width,height:R.height},V))}else C.useStyle(V),C.type!=="pointer"&&C.setColor(k);C.setStyle(N.getModel(["pointer","itemStyle"]).getItemStyle()),C.style.fill==="auto"&&C.setStyle("fill",o(ve(m.get(y,D),w,[0,1],!0))),C.z2EmphasisLift=0,Se(C,N),xe(C,M,P,E)}if(S){var z=d[D];z.useStyle(m.getItemVisual(D,"style")),z.setStyle(N.getModel(["progress","itemStyle"]).getItemStyle()),z.z2EmphasisLift=0,Se(z,N),xe(z,M,P,E)}}),this._progressEls=d)},t.prototype._renderAnchor=function(e,a){var n=e.getModel("anchor"),o=n.get("show");if(o){var i=n.get("size"),l=n.get("icon"),u=n.get("offsetCenter"),s=n.get("keepAspect"),v=qt(l,a.cx-i/2+H(u[0],a.r),a.cy-i/2+H(u[1],a.r),i,i,null,s);v.z2=n.get("showAbove")?1:0,v.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(v)}},t.prototype._renderTitleAndDetail=function(e,a,n,o,i){var l=this,u=e.getData(),s=u.mapDimension("value"),v=+e.get("min"),h=+e.get("max"),c=new be,g=[],d=[],f=e.isAnimationEnabled(),p=e.get(["pointer","showAbove"]);u.diff(this._data).add(function(S){g[S]=new Ae({silent:!0}),d[S]=new Ae({silent:!0})}).update(function(S,m){g[S]=l._titleEls[m],d[S]=l._detailEls[m]}).execute(),u.each(function(S){var m=u.getItemModel(S),y=u.get(s,S),x=new be,b=o(ve(y,[v,h],[0,1],!0)),w=m.getModel("title");if(w.get("show")){var L=w.get("offsetCenter"),I=i.cx+H(L[0],i.r),A=i.cy+H(L[1],i.r),D=g[S];D.attr({z2:p?0:2,style:ke(w,{x:I,y:A,text:u.getName(S),align:"center",verticalAlign:"middle"},{inheritColor:b})}),x.add(D)}var N=m.getModel("detail");if(N.get("show")){var T=N.get("offsetCenter"),M=i.cx+H(T[0],i.r),P=i.cy+H(T[1],i.r),E=H(N.get("width"),i.r),C=H(N.get("height"),i.r),V=e.get(["progress","show"])?u.getItemVisual(S,"style").fill:b,D=d[S],k=N.get("formatter");D.attr({z2:p?0:2,style:ke(N,{x:M,y:P,text:dt(y,k),width:isNaN(E)?null:E,height:isNaN(C)?null:C,align:"center",verticalAlign:"middle"},{inheritColor:V})}),Cn(D,{normal:N},y,function(z){return dt(z,k)}),f&&En(D,S,u,e,{getFormattedLabel:function(z,B,F,$,Y,j){return dt(j?j.interpolatedValue:y,k)}}),x.add(D)}c.add(x)}),this.group.add(c),this._titleEls=g,this._detailEls=d},t.type="gauge",t})(Ie),Go=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.visualStyleAccessPath="itemStyle",e}return t.prototype.getInitialData=function(e,a){return Lt(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t})(De);function Bo(r){r.registerChartView(zo),r.registerSeriesModel(Go)}var Ho=["itemStyle","opacity"],Oo=(function(r){q(t,r);function t(e,a){var n=r.call(this)||this,o=n,i=new bt,l=new Ae;return o.setTextContent(l),n.setTextGuideLine(i),n.updateData(e,a,!0),n}return t.prototype.updateData=function(e,a,n){var o=this,i=e.hostModel,l=e.getItemModel(a),u=e.getItemLayout(a),s=l.getModel("emphasis"),v=l.get(Ho);v=v??1,n||at(o),o.useStyle(e.getItemVisual(a,"style")),o.style.lineJoin="round",n?(o.setShape({points:u.points}),o.style.opacity=0,fe(o,{style:{opacity:v}},i,a)):se(o,{style:{opacity:v},shape:{points:u.points}},i,a),Se(o,l),this._updateLabel(e,a),xe(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,a){var n=this,o=this.getTextGuideLine(),i=n.getTextContent(),l=e.hostModel,u=e.getItemModel(a),s=e.getItemLayout(a),v=s.label,h=e.getItemVisual(a,"style"),c=h.fill;Xe(i,We(u),{labelFetcher:e.hostModel,labelDataIndex:a,defaultOpacity:h.opacity,defaultText:e.getName(a)},{normal:{align:v.textAlign,verticalAlign:v.verticalAlign}}),n.setTextConfig({local:!0,inside:!!v.inside,insideStroke:c,outsideFill:c});var g=v.linePoints;o.setShape({points:g}),n.textGuideLineConfig={anchor:g?new ee(g[0][0],g[0][1]):null},se(i,{style:{x:v.x,y:v.y}},l,a),i.attr({rotation:v.rotation,originX:v.x,originY:v.y,z2:10}),Ir(n,Dr(u),{stroke:c})},t})(oa),Fo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.ignoreLabelLineUpdate=!0,e}return t.prototype.render=function(e,a,n){var o=e.getData(),i=this._data,l=this.group;o.diff(i).add(function(u){var s=new Oo(o,u);o.setItemGraphicEl(u,s),l.add(s)}).update(function(u,s){var v=i.getItemGraphicEl(s);v.updateData(o,u),l.add(v),o.setItemGraphicEl(u,v)}).remove(function(u){var s=i.getItemGraphicEl(u);ir(s,e,u)}).execute(),this._data=o},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t})(Ie),Xo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new At(me(this.getData,this),me(this.getRawData,this)),this._defaultLabelLine(e)},t.prototype.getInitialData=function(e,a){return Lt(this,{coordDimensions:["value"],encodeDefaulter:ge(or,this)})},t.prototype._defaultLabelLine=function(e){ia(e,"labelLine",["show"]);var a=e.labelLine,n=e.emphasis.labelLine;a.show=a.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(e){var a=this.getData(),n=r.prototype.getDataParams.call(this,e),o=a.mapDimension("value"),i=a.getSum(o);return n.percent=i?+(a.get(o,e)/i*100).toFixed(2):0,n.$vars.push("percent"),n},t.type="series.funnel",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t})(De);function Wo(r,t){return Ze(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function Yo(r,t){for(var e=r.mapDimension("value"),a=r.mapArray(e,function(u){return u}),n=[],o=t==="ascending",i=0,l=r.count();i<l;i++)n[i]=i;return Ye(t)?n.sort(t):t!=="none"&&n.sort(function(u,s){return o?a[u]-a[s]:a[s]-a[u]}),n}function Zo(r){var t=r.hostModel,e=t.get("orient");r.each(function(a){var n=r.getItemModel(a),o=n.getModel("label"),i=o.get("position"),l=n.getModel("labelLine"),u=r.getItemLayout(a),s=u.points,v=i==="inner"||i==="inside"||i==="center"||i==="insideLeft"||i==="insideRight",h,c,g,d;if(v)i==="insideLeft"?(c=(s[0][0]+s[3][0])/2+5,g=(s[0][1]+s[3][1])/2,h="left"):i==="insideRight"?(c=(s[1][0]+s[2][0])/2-5,g=(s[1][1]+s[2][1])/2,h="right"):(c=(s[0][0]+s[1][0]+s[2][0]+s[3][0])/4,g=(s[0][1]+s[1][1]+s[2][1]+s[3][1])/4,h="center"),d=[[c,g],[c,g]];else{var f=void 0,p=void 0,S=void 0,m=void 0,y=l.get("length");i==="left"?(f=(s[3][0]+s[0][0])/2,p=(s[3][1]+s[0][1])/2,S=f-y,c=S-5,h="right"):i==="right"?(f=(s[1][0]+s[2][0])/2,p=(s[1][1]+s[2][1])/2,S=f+y,c=S+5,h="left"):i==="top"?(f=(s[3][0]+s[0][0])/2,p=(s[3][1]+s[0][1])/2,m=p-y,g=m-5,h="center"):i==="bottom"?(f=(s[1][0]+s[2][0])/2,p=(s[1][1]+s[2][1])/2,m=p+y,g=m+5,h="center"):i==="rightTop"?(f=e==="horizontal"?s[3][0]:s[1][0],p=e==="horizontal"?s[3][1]:s[1][1],e==="horizontal"?(m=p-y,g=m-5,h="center"):(S=f+y,c=S+5,h="top")):i==="rightBottom"?(f=s[2][0],p=s[2][1],e==="horizontal"?(m=p+y,g=m+5,h="center"):(S=f+y,c=S+5,h="bottom")):i==="leftTop"?(f=s[0][0],p=e==="horizontal"?s[0][1]:s[1][1],e==="horizontal"?(m=p-y,g=m-5,h="center"):(S=f-y,c=S-5,h="right")):i==="leftBottom"?(f=e==="horizontal"?s[1][0]:s[3][0],p=e==="horizontal"?s[1][1]:s[2][1],e==="horizontal"?(m=p+y,g=m+5,h="center"):(S=f-y,c=S-5,h="right")):(f=(s[1][0]+s[2][0])/2,p=(s[1][1]+s[2][1])/2,e==="horizontal"?(m=p+y,g=m+5,h="center"):(S=f+y,c=S+5,h="left")),e==="horizontal"?(S=f,c=S):(m=p,g=m),d=[[f,p],[S,m]]}u.label={linePoints:d,x:c,y:g,verticalAlign:"middle",textAlign:h,inside:v}})}function Uo(r,t){r.eachSeriesByType("funnel",function(e){var a=e.getData(),n=a.mapDimension("value"),o=e.get("sort"),i=Wo(e,t),l=e.get("orient"),u=i.width,s=i.height,v=Yo(a,o),h=i.x,c=i.y,g=l==="horizontal"?[H(e.get("minSize"),s),H(e.get("maxSize"),s)]:[H(e.get("minSize"),u),H(e.get("maxSize"),u)],d=a.getDataExtent(n),f=e.get("min"),p=e.get("max");f==null&&(f=Math.min(d[0],0)),p==null&&(p=d[1]);var S=e.get("funnelAlign"),m=e.get("gap"),y=l==="horizontal"?u:s,x=(y-m*(a.count()-1))/a.count(),b=function(P,E){if(l==="horizontal"){var C=a.get(n,P)||0,V=ve(C,[f,p],g,!0),k=void 0;switch(S){case"top":k=c;break;case"center":k=c+(s-V)/2;break;case"bottom":k=c+(s-V);break}return[[E,k],[E,k+V]]}var R=a.get(n,P)||0,z=ve(R,[f,p],g,!0),B;switch(S){case"left":B=h;break;case"center":B=h+(u-z)/2;break;case"right":B=h+u-z;break}return[[B,E],[B+z,E]]};o==="ascending"&&(x=-x,m=-m,l==="horizontal"?h+=u:c+=s,v=v.reverse());for(var w=0;w<v.length;w++){var L=v[w],I=v[w+1],A=a.getItemModel(L);if(l==="horizontal"){var D=A.get(["itemStyle","width"]);D==null?D=x:(D=H(D,u),o==="ascending"&&(D=-D));var N=b(L,h),T=b(I,h+D);h+=D+m,a.setItemLayout(L,{points:N.concat(T.slice().reverse())})}else{var M=A.get(["itemStyle","height"]);M==null?M=x:(M=H(M,s),o==="ascending"&&(M=-M));var N=b(L,c),T=b(I,c+M);c+=M+m,a.setItemLayout(L,{points:N.concat(T.slice().reverse())})}}Zo(a)})}function qo(r){r.registerChartView(Fo),r.registerSeriesModel(Xo),r.registerLayout(Uo),r.registerProcessor(Tt("funnel"))}var $o=(function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r})(),jo=(function(r){q(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new $o},t.prototype.buildPath=function(e,a){var n=a.extent;e.moveTo(a.x1,a.y1),e.bezierCurveTo(a.cpx1,a.cpy1,a.cpx2,a.cpy2,a.x2,a.y2),a.orient==="vertical"?(e.lineTo(a.x2+n,a.y2),e.bezierCurveTo(a.cpx2+n,a.cpy2,a.cpx1+n,a.cpy1,a.x1+n,a.y1)):(e.lineTo(a.x2,a.y2+n),e.bezierCurveTo(a.cpx2,a.cpy2+n,a.cpx1,a.cpy1+n,a.x1,a.y1+n)),e.closePath()},t.prototype.highlight=function(){Vn(this)},t.prototype.downplay=function(){_n(this)},t})(la),Ko=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._focusAdjacencyDisabled=!1,e}return t.prototype.render=function(e,a,n){var o=this,i=e.getGraph(),l=this.group,u=e.layoutInfo,s=u.width,v=u.height,h=e.getData(),c=e.getData("edge"),g=e.get("orient");this._model=e,l.removeAll(),l.x=u.x,l.y=u.y,i.eachEdge(function(d){var f=new jo,p=pe(f);p.dataIndex=d.dataIndex,p.seriesIndex=e.seriesIndex,p.dataType="edge";var S=d.getModel(),m=S.getModel("lineStyle"),y=m.get("curveness"),x=d.node1.getLayout(),b=d.node1.getModel(),w=b.get("localX"),L=b.get("localY"),I=d.node2.getLayout(),A=d.node2.getModel(),D=A.get("localX"),N=A.get("localY"),T=d.getLayout(),M,P,E,C,V,k,R,z;f.shape.extent=Math.max(1,T.dy),f.shape.orient=g,g==="vertical"?(M=(w!=null?w*s:x.x)+T.sy,P=(L!=null?L*v:x.y)+x.dy,E=(D!=null?D*s:I.x)+T.ty,C=N!=null?N*v:I.y,V=M,k=P*(1-y)+C*y,R=E,z=P*y+C*(1-y)):(M=(w!=null?w*s:x.x)+x.dx,P=(L!=null?L*v:x.y)+T.sy,E=D!=null?D*s:I.x,C=(N!=null?N*v:I.y)+T.ty,V=M*(1-y)+E*y,k=P,R=M*y+E*(1-y),z=C),f.setShape({x1:M,y1:P,x2:E,y2:C,cpx1:V,cpy1:k,cpx2:R,cpy2:z}),f.useStyle(m.getItemStyle()),er(f.style,g,d);var B=""+S.get("value"),F=We(S,"edgeLabel");Xe(f,F,{labelFetcher:{getFormattedLabel:function(j,ne,he,O,G,Z){return e.getFormattedLabel(j,ne,"edge",O,ut(G,F.normal&&F.normal.get("formatter"),B),Z)}},labelDataIndex:d.dataIndex,defaultText:B}),f.setTextConfig({position:"inside"});var $=S.getModel("emphasis");Se(f,S,"lineStyle",function(j){var ne=j.getItemStyle();return er(ne,g,d),ne}),l.add(f),c.setItemGraphicEl(d.dataIndex,f);var Y=$.get("focus");xe(f,Y==="adjacency"?d.getAdjacentDataIndices():Y==="trajectory"?d.getTrajectoryDataIndices():Y,$.get("blurScope"),$.get("disabled"))}),i.eachNode(function(d){var f=d.getLayout(),p=d.getModel(),S=p.get("localX"),m=p.get("localY"),y=p.getModel("emphasis"),x=p.get(["itemStyle","borderRadius"])||0,b=new ua({shape:{x:S!=null?S*s:f.x,y:m!=null?m*v:f.y,width:f.dx,height:f.dy,r:x},style:p.getModel("itemStyle").getItemStyle(),z2:10});Xe(b,We(p),{labelFetcher:{getFormattedLabel:function(L,I){return e.getFormattedLabel(L,I,"node")}},labelDataIndex:d.dataIndex,defaultText:d.id}),b.disableLabelAnimation=!0,b.setStyle("fill",d.getVisual("color")),b.setStyle("decal",d.getVisual("style").decal),Se(b,p),l.add(b),h.setItemGraphicEl(d.dataIndex,b),pe(b).dataType="node";var w=y.get("focus");xe(b,w==="adjacency"?d.getAdjacentDataIndices():w==="trajectory"?d.getTrajectoryDataIndices():w,y.get("blurScope"),y.get("disabled"))}),h.eachItemGraphicEl(function(d,f){var p=h.getItemModel(f);p.get("draggable")&&(d.drift=function(S,m){o._focusAdjacencyDisabled=!0,this.shape.x+=S,this.shape.y+=m,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:h.getRawIndex(f),localX:this.shape.x/s,localY:this.shape.y/v})},d.ondragend=function(){o._focusAdjacencyDisabled=!1},d.draggable=!0,d.cursor="move")}),!this._data&&e.isAnimationEnabled()&&l.setClipPath(Jo(l.getBoundingRect(),e,function(){l.removeClipPath()})),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t})(Ie);function er(r,t,e){switch(r.fill){case"source":r.fill=e.node1.getVisual("color"),r.decal=e.node1.getVisual("style").decal;break;case"target":r.fill=e.node2.getVisual("color"),r.decal=e.node2.getVisual("style").decal;break;case"gradient":var a=e.node1.getVisual("color"),n=e.node2.getVisual("color");ze(a)&&ze(n)&&(r.fill=new Pn(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:a,offset:0},{color:n,offset:1}]))}}function Jo(r,t,e){var a=new ua({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return fe(a,{shape:{width:r.width+20}},t,e),a}var Qo=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(e,a){var n=e.edges||e.links||[],o=e.data||e.nodes||[],i=e.levels||[];this.levelModels=[];for(var l=this.levelModels,u=0;u<i.length;u++)i[u].depth!=null&&i[u].depth>=0&&(l[i[u].depth]=new Ge(i[u],this,a));var s=Ur(o,n,this,!0,v);return s.data;function v(h,c){h.wrapMethod("getItemModel",function(g,d){var f=g.parentModel,p=f.getData().getItemLayout(d);if(p){var S=p.depth,m=f.levelModels[S];m&&(g.parentModel=m)}return g}),c.wrapMethod("getItemModel",function(g,d){var f=g.parentModel,p=f.getGraph().getEdgeByIndex(d),S=p.node1.getLayout();if(S){var m=S.depth,y=f.levelModels[m];y&&(g.parentModel=y)}return g})}},t.prototype.setNodePosition=function(e,a){var n=this.option.data||this.option.nodes,o=n[e];o.localX=a[0],o.localY=a[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,a,n){function o(g){return isNaN(g)||g==null}if(n==="edge"){var i=this.getDataParams(e,n),l=i.data,u=i.value,s=l.source+" -- "+l.target;return Re("nameValue",{name:s,value:u,noValue:o(u)})}else{var v=this.getGraph().getNodeByIndex(e),h=v.getLayout().value,c=this.getDataParams(e,n).data.name;return Re("nameValue",{name:c!=null?c+"":null,value:h,noValue:o(h)})}},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(e,a){var n=r.prototype.getDataParams.call(this,e,a);if(n.value==null&&a==="node"){var o=this.getGraph().getNodeByIndex(e),i=o.getLayout().value;n.value=i}return n},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t})(De);function el(r,t){r.eachSeriesByType("sankey",function(e){var a=e.get("nodeWidth"),n=e.get("nodeGap"),o=tl(e,t);e.layoutInfo=o;var i=o.width,l=o.height,u=e.getGraph(),s=u.nodes,v=u.edges;rl(s);var h=pr(s,function(f){return f.getLayout().value===0}),c=h.length!==0?0:e.get("layoutIterations"),g=e.get("orient"),d=e.get("nodeAlign");al(s,v,a,n,i,l,c,g,d)})}function tl(r,t){return Ze(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function al(r,t,e,a,n,o,i,l,u){nl(r,t,e,n,o,l,u),ul(r,t,o,n,a,i,l),yl(r,l)}function rl(r){_(r,function(t){var e=Ce(t.outEdges,xt),a=Ce(t.inEdges,xt),n=t.getValue()||0,o=Math.max(e,a,n);t.setLayout({value:o},!0)})}function nl(r,t,e,a,n,o,i){for(var l=[],u=[],s=[],v=[],h=0,c=0;c<t.length;c++)l[c]=1;for(var c=0;c<r.length;c++)u[c]=r[c].inEdges.length,u[c]===0&&s.push(r[c]);for(var g=-1;s.length;){for(var d=0;d<s.length;d++){var f=s[d],p=f.hostGraph.data.getRawDataItem(f.dataIndex),S=p.depth!=null&&p.depth>=0;S&&p.depth>g&&(g=p.depth),f.setLayout({depth:S?p.depth:h},!0),o==="vertical"?f.setLayout({dy:e},!0):f.setLayout({dx:e},!0);for(var m=0;m<f.outEdges.length;m++){var y=f.outEdges[m],x=t.indexOf(y);l[x]=0;var b=y.node2,w=r.indexOf(b);--u[w]===0&&v.indexOf(b)<0&&v.push(b)}}++h,s=v,v=[]}for(var c=0;c<l.length;c++)if(l[c]===1)throw new Error("Sankey is a DAG, the original data has cycle!");var L=g>h-1?g:h-1;i&&i!=="left"&&il(r,i,o,L);var I=o==="vertical"?(n-e)/L:(a-e)/L;ll(r,I,o)}function qr(r){var t=r.hostGraph.data.getRawDataItem(r.dataIndex);return t.depth!=null&&t.depth>=0}function il(r,t,e,a){if(t==="right"){for(var n=[],o=r,i=0;o.length;){for(var l=0;l<o.length;l++){var u=o[l];u.setLayout({skNodeHeight:i},!0);for(var s=0;s<u.inEdges.length;s++){var v=u.inEdges[s];n.indexOf(v.node1)<0&&n.push(v.node1)}}o=n,n=[],++i}_(r,function(h){qr(h)||h.setLayout({depth:Math.max(0,a-h.getLayout().skNodeHeight)},!0)})}else t==="justify"&&ol(r,a)}function ol(r,t){_(r,function(e){!qr(e)&&!e.outEdges.length&&e.setLayout({depth:t},!0)})}function ll(r,t,e){_(r,function(a){var n=a.getLayout().depth*t;e==="vertical"?a.setLayout({y:n},!0):a.setLayout({x:n},!0)})}function ul(r,t,e,a,n,o,i){var l=sl(r,i);vl(l,t,e,a,n,i),Yt(l,n,e,a,i);for(var u=1;o>0;o--)u*=.99,cl(l,u,i),Yt(l,n,e,a,i),pl(l,u,i),Yt(l,n,e,a,i)}function sl(r,t){var e=[],a=t==="vertical"?"y":"x",n=kn(r,function(o){return o.getLayout()[a]});return n.keys.sort(function(o,i){return o-i}),_(n.keys,function(o){e.push(n.buckets.get(o))}),e}function vl(r,t,e,a,n,o){var i=1/0;_(r,function(l){var u=l.length,s=0;_(l,function(h){s+=h.getLayout().value});var v=o==="vertical"?(a-(u-1)*n)/s:(e-(u-1)*n)/s;v<i&&(i=v)}),_(r,function(l){_(l,function(u,s){var v=u.getLayout().value*i;o==="vertical"?(u.setLayout({x:s},!0),u.setLayout({dx:v},!0)):(u.setLayout({y:s},!0),u.setLayout({dy:v},!0))})}),_(t,function(l){var u=+l.getValue()*i;l.setLayout({dy:u},!0)})}function Yt(r,t,e,a,n){var o=n==="vertical"?"x":"y";_(r,function(i){i.sort(function(f,p){return f.getLayout()[o]-p.getLayout()[o]});for(var l,u,s,v=0,h=i.length,c=n==="vertical"?"dx":"dy",g=0;g<h;g++)u=i[g],s=v-u.getLayout()[o],s>0&&(l=u.getLayout()[o]+s,n==="vertical"?u.setLayout({x:l},!0):u.setLayout({y:l},!0)),v=u.getLayout()[o]+u.getLayout()[c]+t;var d=n==="vertical"?a:e;if(s=v-t-d,s>0){l=u.getLayout()[o]-s,n==="vertical"?u.setLayout({x:l},!0):u.setLayout({y:l},!0),v=l;for(var g=h-2;g>=0;--g)u=i[g],s=u.getLayout()[o]+u.getLayout()[c]+t-v,s>0&&(l=u.getLayout()[o]-s,n==="vertical"?u.setLayout({x:l},!0):u.setLayout({y:l},!0)),v=u.getLayout()[o]}})}function cl(r,t,e){_(r.slice().reverse(),function(a){_(a,function(n){if(n.outEdges.length){var o=Ce(n.outEdges,hl,e)/Ce(n.outEdges,xt);if(isNaN(o)){var i=n.outEdges.length;o=i?Ce(n.outEdges,gl,e)/i:0}if(e==="vertical"){var l=n.getLayout().x+(o-Ve(n,e))*t;n.setLayout({x:l},!0)}else{var u=n.getLayout().y+(o-Ve(n,e))*t;n.setLayout({y:u},!0)}}})})}function hl(r,t){return Ve(r.node2,t)*r.getValue()}function gl(r,t){return Ve(r.node2,t)}function dl(r,t){return Ve(r.node1,t)*r.getValue()}function fl(r,t){return Ve(r.node1,t)}function Ve(r,t){return t==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function xt(r){return r.getValue()}function Ce(r,t,e){for(var a=0,n=r.length,o=-1;++o<n;){var i=+t(r[o],e);isNaN(i)||(a+=i)}return a}function pl(r,t,e){_(r,function(a){_(a,function(n){if(n.inEdges.length){var o=Ce(n.inEdges,dl,e)/Ce(n.inEdges,xt);if(isNaN(o)){var i=n.inEdges.length;o=i?Ce(n.inEdges,fl,e)/i:0}if(e==="vertical"){var l=n.getLayout().x+(o-Ve(n,e))*t;n.setLayout({x:l},!0)}else{var u=n.getLayout().y+(o-Ve(n,e))*t;n.setLayout({y:u},!0)}}})})}function yl(r,t){var e=t==="vertical"?"x":"y";_(r,function(a){a.outEdges.sort(function(n,o){return n.node2.getLayout()[e]-o.node2.getLayout()[e]}),a.inEdges.sort(function(n,o){return n.node1.getLayout()[e]-o.node1.getLayout()[e]})}),_(r,function(a){var n=0,o=0;_(a.outEdges,function(i){i.setLayout({sy:n},!0),n+=i.getLayout().dy}),_(a.inEdges,function(i){i.setLayout({ty:o},!0),o+=i.getLayout().dy})})}function ml(r){r.eachSeriesByType("sankey",function(t){var e=t.getGraph(),a=e.nodes,n=e.edges;if(a.length){var o=1/0,i=-1/0;_(a,function(l){var u=l.getLayout().value;u<o&&(o=u),u>i&&(i=u)}),_(a,function(l){var u=new br({type:"color",mappingMethod:"linear",dataExtent:[o,i],visual:t.get("color")}),s=u.mapValueToVisual(l.getLayout().value),v=l.getModel().get(["itemStyle","color"]);v!=null?(l.setVisual("color",v),l.setVisual("style",{fill:v})):(l.setVisual("color",s),l.setVisual("style",{fill:s}))})}n.length&&_(n,function(l){var u=l.getModel().get("lineStyle");l.setVisual("style",u)})})}function Sl(r){r.registerChartView(Ko),r.registerSeriesModel(Qo),r.registerLayout(el),r.registerVisual(ml),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},function(a){a.setNodePosition(t.dataIndex,[t.localX,t.localY])})})}var xl=2,bl=4,tr=(function(r){q(t,r);function t(e,a,n,o){var i=r.call(this)||this;i.z2=xl,i.textConfig={inside:!0},pe(i).seriesIndex=a.seriesIndex;var l=new Ae({z2:bl,silent:e.getModel().get(["label","silent"])});return i.setTextContent(l),i.updateData(!0,e,a,n,o),i}return t.prototype.updateData=function(e,a,n,o,i){this.node=a,a.piece=this,n=n||this._seriesModel,o=o||this._ecModel;var l=this;pe(l).dataIndex=a.dataIndex;var u=a.getModel(),s=u.getModel("emphasis"),v=a.getLayout(),h=X({},v);h.label=null;var c=a.getVisual("style");c.lineJoin="bevel";var g=a.getVisual("decal");g&&(c.decal=Rn(g,i));var d=Fe(u.getModel("itemStyle"),h,!0);X(h,d),_(Ut,function(m){var y=l.ensureState(m),x=u.getModel([m,"itemStyle"]);y.style=x.getItemStyle();var b=Fe(x,h);b&&(y.shape=b)}),e?(l.setShape(h),l.shape.r=v.r0,fe(l,{shape:{r:v.r}},n,a.dataIndex)):(se(l,{shape:h},n),at(l)),l.useStyle(c),this._updateLabel(n);var f=u.getShallow("cursor");f&&l.attr("cursor",f),this._seriesModel=n||this._seriesModel,this._ecModel=o||this._ecModel;var p=s.get("focus"),S=p==="relative"?cr(a.getAncestorsIndices(),a.getDescendantIndices()):p==="ancestor"?a.getAncestorsIndices():p==="descendant"?a.getDescendantIndices():p;xe(this,S,s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e){var a=this,n=this.node.getModel(),o=n.getModel("label"),i=this.node.getLayout(),l=i.endAngle-i.startAngle,u=(i.startAngle+i.endAngle)/2,s=Math.cos(u),v=Math.sin(u),h=this,c=h.getTextContent(),g=this.node.dataIndex,d=o.get("minAngle")/180*Math.PI,f=o.get("show")&&!(d!=null&&Math.abs(l)<d);c.ignore=!f,_(Zt,function(S){var m=S==="normal"?n.getModel("label"):n.getModel([S,"label"]),y=S==="normal",x=y?c:c.ensureState(S),b=e.getFormattedLabel(g,S);y&&(b=b||a.node.name),x.style=ke(m,{},null,S!=="normal",!0),b&&(x.style.text=b);var w=m.get("show");w!=null&&!y&&(x.ignore=!w);var L=p(m,"position"),I=y?h:h.states[S],A=I.style.fill;I.textConfig={outsideFill:m.get("color")==="inherit"?A:null,inside:L!=="outside"};var D,N=p(m,"distance")||0,T=p(m,"align"),M=p(m,"rotate"),P=Math.PI*.5,E=Math.PI*1.5,C=ct(M==="tangential"?Math.PI/2-u:u),V=C>P&&!zn(C-P)&&C<E;L==="outside"?(D=i.r+N,T=V?"right":"left"):!T||T==="center"?(l===2*Math.PI&&i.r0===0?D=0:D=(i.r+i.r0)/2,T="center"):T==="left"?(D=i.r0+N,T=V?"right":"left"):T==="right"&&(D=i.r-N,T=V?"left":"right"),x.style.align=T,x.style.verticalAlign=p(m,"verticalAlign")||"middle",x.x=D*s+i.cx,x.y=D*v+i.cy;var k=0;M==="radial"?k=ct(-u)+(V?Math.PI:0):M==="tangential"?k=ct(Math.PI/2-u)+(V?Math.PI:0):Ee(M)&&(k=M*Math.PI/180),x.rotation=ct(k)});function p(S,m){var y=S.get(m);return y??o.get(m)}c.dirtyStyle()},t})(tt),na="sunburstRootToNode",ar="sunburstHighlight",wl="sunburstUnhighlight";function Il(r){r.registerAction({type:na,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},a);function a(n,o){var i=nt(t,[na],n);if(i){var l=n.getViewRoot();l&&(t.direction=da(l,i.node)?"rollUp":"drillDown"),n.resetViewRoot(i.node)}}}),r.registerAction({type:ar,update:"none"},function(t,e,a){t=X({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},n);function n(o){var i=nt(t,[ar],o);i&&(t.dataIndex=i.node.dataIndex)}a.dispatchAction(X(t,{type:"highlight"}))}),r.registerAction({type:wl,update:"updateView"},function(t,e,a){t=X({},t),a.dispatchAction(X(t,{type:"downplay"}))})}var Dl=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,a,n,o){var i=this;this.seriesModel=e,this.api=n,this.ecModel=a;var l=e.getData(),u=l.tree.root,s=e.getViewRoot(),v=this.group,h=e.get("renderLabelForZeroData"),c=[];s.eachNode(function(m){c.push(m)});var g=this._oldChildren||[];d(c,g),S(u,s),this._initEvents(),this._oldChildren=c;function d(m,y){if(m.length===0&&y.length===0)return;new gr(y,m,x,x).add(b).update(b).remove(ge(b,null)).execute();function x(w){return w.getId()}function b(w,L){var I=w==null?null:m[w],A=L==null?null:y[L];f(I,A)}}function f(m,y){if(!h&&m&&!m.getValue()&&(m=null),m!==u&&y!==u){if(y&&y.piece)m?(y.piece.updateData(!1,m,e,a,n),l.setItemGraphicEl(m.dataIndex,y.piece)):p(y);else if(m){var x=new tr(m,e,a,n);v.add(x),l.setItemGraphicEl(m.dataIndex,x)}}}function p(m){m&&m.piece&&(v.remove(m.piece),m.piece=null)}function S(m,y){y.depth>0?(i.virtualPiece?i.virtualPiece.updateData(!1,m,e,a,n):(i.virtualPiece=new tr(m,e,a,n),v.add(i.virtualPiece)),y.piece.off("click"),i.virtualPiece.on("click",function(x){i._rootToNode(y.parentNode)})):i.virtualPiece&&(v.remove(i.virtualPiece),i.virtualPiece=null)}},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",function(a){var n=!1,o=e.seriesModel.getViewRoot();o.eachNode(function(i){if(!n&&i.piece&&i.piece===a.target){var l=i.getModel().get("nodeClick");if(l==="rootToNode")e._rootToNode(i);else if(l==="link"){var u=i.getModel(),s=u.get("link");if(s){var v=u.get("target",!0)||"_blank";dr(s,v)}}n=!0}})})},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:na,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,a){var n=a.getData(),o=n.getItemLayout(0);if(o){var i=e[0]-o.cx,l=e[1]-o.cy,u=Math.sqrt(i*i+l*l);return u<=o.r&&u>=o.r0}},t.type="sunburst",t})(Ie),Ll=(function(r){q(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.ignoreStyleOnData=!0,e}return t.prototype.getInitialData=function(e,a){var n={name:e.name,children:e.data};$r(n);var o=this._levelModels=we(e.levels||[],function(u){return new Ge(u,this,a)},this),i=ga.createTree(n,this,l);function l(u){u.wrapMethod("getItemModel",function(s,v){var h=i.getNodeByDataIndex(v),c=o[h.depth];return c&&(s.parentModel=c),s})}return i.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(e){var a=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return a.treePathInfo=Nt(n,this),a},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var a=this.getRawData().tree.root;(!e||e!==a&&!a.contains(e))&&(this._viewRoot=a)},t.prototype.enableAriaDecal=function(){_r(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t})(De);function $r(r){var t=0;_(r.children,function(a){$r(a);var n=a.value;te(n)&&(n=n[0]),t+=n});var e=r.value;te(e)&&(e=e[0]),(e==null||isNaN(e))&&(e=t),e<0&&(e=0),te(r.value)?r.value[0]=e:r.value=e}var rr=Math.PI/180;function Al(r,t,e){t.eachSeriesByType(r,function(a){var n=a.get("center"),o=a.get("radius");te(o)||(o=[0,o]),te(n)||(n=[n,n]);var i=e.getWidth(),l=e.getHeight(),u=Math.min(i,l),s=H(n[0],i),v=H(n[1],l),h=H(o[0],u/2),c=H(o[1],u/2),g=-a.get("startAngle")*rr,d=a.get("minAngle")*rr,f=a.getData().tree.root,p=a.getViewRoot(),S=p.depth,m=a.get("sort");m!=null&&jr(p,m);var y=0;_(p.children,function(C){!isNaN(C.getValue())&&y++});var x=p.getValue(),b=Math.PI/(x||y)*2,w=p.depth>0,L=p.height-(w?-1:1),I=(c-h)/(L||1),A=a.get("clockwise"),D=a.get("stillShowZeroSum"),N=A?1:-1,T=function(C,V){if(C){var k=V;if(C!==f){var R=C.getValue(),z=x===0&&D?b:R*b;z<d&&(z=d),k=V+N*z;var B=C.depth-S-(w?-1:1),F=h+I*B,$=h+I*(B+1),Y=a.getLevelModel(C);if(Y){var j=Y.get("r0",!0),ne=Y.get("r",!0),he=Y.get("radius",!0);he!=null&&(j=he[0],ne=he[1]),j!=null&&(F=H(j,u/2)),ne!=null&&($=H(ne,u/2))}C.setLayout({angle:z,startAngle:V,endAngle:k,clockwise:A,cx:s,cy:v,r0:F,r:$})}if(C.children&&C.children.length){var O=0;_(C.children,function(G){O+=T(G,V+O)})}return k-V}};if(w){var M=h,P=h+I,E=Math.PI*2;f.setLayout({angle:E,startAngle:g,endAngle:g+E,clockwise:A,cx:s,cy:v,r0:M,r:P})}T(p,g)})}function jr(r,t){var e=r.children||[];r.children=Tl(e,t),e.length&&_(r.children,function(a){jr(a,t)})}function Tl(r,t){if(Ye(t)){var e=we(r,function(n,o){var i=n.getValue();return{params:{depth:n.depth,height:n.height,dataIndex:n.dataIndex,getValue:function(){return i}},index:o}});return e.sort(function(n,o){return t(n.params,o.params)}),we(e,function(n){return r[n.index]})}else{var a=t==="asc";return r.sort(function(n,o){var i=(n.getValue()-o.getValue())*(a?1:-1);return i===0?(n.dataIndex-o.dataIndex)*(a?-1:1):i})}}function Nl(r){var t={};function e(a,n,o){for(var i=a;i&&i.depth>1;)i=i.parentNode;var l=n.getColorFromPalette(i.name||i.dataIndex+"",t);return a.depth>1&&ze(l)&&(l=Gn(l,(a.depth-1)/(o-1)*.5)),l}r.eachSeriesByType("sunburst",function(a){var n=a.getData(),o=n.tree;o.eachNode(function(i){var l=i.getModel(),u=l.getModel("itemStyle").getItemStyle();u.fill||(u.fill=e(i,a,o.root.height));var s=n.ensureUniqueItemVisual(i.dataIndex,"style");X(s,u)})})}function Ml(r){r.registerChartView(Dl),r.registerSeriesModel(Ll),r.registerLayout(ge(Al,"sunburst")),r.registerProcessor(ge(Tt,"sunburst")),r.registerVisual(Nl),Il(r)}ur([qo,Bo,_o,ti,oi,Sl,Ml,Pi,go]);