iobroker.admin 7.7.2 → 7.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +120 -13
- package/admin/README.md +3 -0
- package/admin/admin.png +0 -0
- package/admin/i18n/de.json +1 -1
- package/admin/i18n/es.json +1 -1
- package/admin/i18n/fr.json +1 -1
- package/admin/i18n/it.json +1 -1
- package/admin/i18n/nl.json +1 -1
- package/admin/i18n/pl.json +1 -1
- package/admin/i18n/pt.json +1 -1
- package/admin/i18n/ru.json +1 -1
- package/admin/i18n/uk.json +1 -1
- package/admin/i18n/zh-cn.json +1 -1
- package/admin/jsonConfig.json5 +1 -2
- package/adminWww/assets/AdapterUpdateDialog-CJRQB5ud.js +2 -0
- package/adminWww/assets/Adapters-B5LWXJ3G.js +9 -0
- package/adminWww/assets/Config-D3mtokJQ.js +1 -0
- package/adminWww/assets/CustomModal-DCjdghJB.js +1 -0
- package/adminWww/assets/CustomTab-CBVvppVS.js +1 -0
- package/adminWww/assets/DefaultPropsProvider-BZ42HOhu.js +15 -0
- package/adminWww/assets/DefaultPropsProvider-DoV5d6EJ.js +1 -0
- package/adminWww/assets/EasyMode-CR0Vw-OT.js +1 -0
- package/adminWww/assets/Enums-BImz5cPM.js +111 -0
- package/adminWww/assets/Fields-V2W2HJlv.js +1 -0
- package/adminWww/assets/Files-Ci2XDKh8.js +6 -0
- package/adminWww/assets/FilledInput-0vrRQpr_.js +2 -0
- package/adminWww/assets/Google-FmfjVx6X.js +27 -0
- package/adminWww/assets/Hosts-AXD2lYOf.js +121 -0
- package/adminWww/assets/Instances-j88MVgOp.js +2 -0
- package/adminWww/assets/Intro-DH7_8X9J.js +2 -0
- package/adminWww/assets/Logs-BJEYaBGh.js +1 -0
- package/adminWww/assets/Objects-CeqK8jeG.js +60 -0
- package/adminWww/assets/State-DhReNijC.js +1 -0
- package/adminWww/assets/TextField-fjsX40wR.js +138 -0
- package/adminWww/assets/Users-BJgk5zRR.js +1 -0
- package/adminWww/assets/___vite-browser-external_commonjs-proxy-DMh1aSo_.js +1 -0
- package/adminWww/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
- package/adminWww/assets/_commonjsHelpers-CE1G-McA.js +1 -0
- package/adminWww/assets/ace-DgO9yth5.js +985 -0
- package/adminWww/assets/assertThisInitialized-CKqanoMB.js +1 -0
- package/adminWww/assets/blueGrey-BFcAYvAO.js +29 -0
- package/adminWww/assets/{bootstrap-CrpeRPv0.css → bootstrap-DSlxhDzw.css} +1 -1
- package/adminWww/assets/bootstrap-xC60EdKn.js +303 -0
- package/adminWww/assets/createSvgIcon-CC7aIjya.js +1 -0
- package/adminWww/assets/createTheme-O_VGsRib.js +16 -0
- package/adminWww/assets/defaultTheme-CF56WVgQ.js +1 -0
- package/adminWww/assets/emotion-cache.browser.esm-BgJfNZJN.js +1 -0
- package/adminWww/assets/emotion-react.browser.esm-LdYA3M0T.js +8 -0
- package/adminWww/assets/emotion-serialize.esm-Q4o_CgeF.js +1 -0
- package/adminWww/assets/emotion-styled.browser.esm-D6u524ZG.js +1 -0
- package/adminWww/assets/emotion-use-insertion-effect-with-fallbacks.browser.esm-q3_hvwuL.js +1 -0
- package/adminWww/assets/en-US-B8gg5zk_.js +1 -0
- package/adminWww/assets/ext-language_tools-DJmHbGA8.js +389 -0
- package/adminWww/assets/geosearch.module-BN92cSpK.js +1 -0
- package/adminWww/assets/{hostInit-fzxL8JAx.js → hostInit-OBG53iVO.js} +2 -2
- package/adminWww/assets/iconBase-CB0tx1VT.js +1 -0
- package/adminWww/assets/{index-D--ojYan.js → index-28qkNZAi.js} +1 -1
- package/adminWww/assets/index-8V8iNIbi.js +5 -0
- package/adminWww/assets/{index-CJvbfjSs.js → index-B0C4gXUO.js} +1 -1
- package/adminWww/assets/index-B5NvG6mn.js +2 -0
- package/adminWww/assets/index-BVQ-ZSLt.js +10 -0
- package/adminWww/assets/index-B_eoqXoQ.js +890 -0
- package/adminWww/assets/index-Bc8bBbjM.js +15 -0
- package/adminWww/assets/{index-Co3YA5NW.js → index-BgpTxVrG.js} +1 -1
- package/adminWww/assets/{index-DTGUg51P.js → index-C73G-H4k.js} +2 -2
- package/adminWww/assets/{index-rKfs-rCa.js → index-CbQYNHIO.js} +1 -1
- package/adminWww/assets/index-ChtI58Wj.js +1 -0
- package/adminWww/assets/index-CkI9667U.js +1 -0
- package/adminWww/assets/index-DEgEIbz9.js +1 -0
- package/adminWww/assets/index-DYa0xJDK.js +1 -0
- package/adminWww/assets/index-Dy_ekAsY.js +1 -0
- package/adminWww/assets/index-d-Zo1uu9.js +55 -0
- package/adminWww/assets/{iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js → iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js} +1 -1
- package/adminWww/assets/iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-D-aUnioX.js +1 -0
- package/adminWww/assets/iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-DQH_iIDO.js +1 -0
- package/adminWww/assets/iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-Dy1SQ0vs.js +1 -0
- package/adminWww/assets/{iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.js → iobroker_admin__loadShare__leaflet__loadShare__-BfU5U5_j.js} +1 -1
- package/adminWww/assets/iobroker_admin__loadShare__prop_mf_2_types__loadShare__-CpCTEixV.js +1 -0
- package/adminWww/assets/{iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js → iobroker_admin__loadShare__react__loadShare__-CMWK8WhK.js} +1 -1
- package/adminWww/assets/iobroker_admin__loadShare__react_mf_2_dom__loadShare__-GTRt2eft.js +1 -0
- package/adminWww/assets/iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-BF_gp27r.js +1 -0
- package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js +5 -0
- package/adminWww/assets/leaflet-src-B98elavC.js +4 -0
- package/adminWww/assets/locale-ZVMVA5rz.js +1 -0
- package/adminWww/assets/pl-OOhGZ0tn.js +1 -0
- package/adminWww/assets/preload-helper-BDBacUwf.js +1 -0
- package/adminWww/assets/sdk-DTP6UH26.js +15 -0
- package/adminWww/assets/sentry-C8mPNiGL.js +1 -0
- package/adminWww/assets/useTheme-C-uGEZO5.js +1 -0
- package/adminWww/assets/useTheme-UOPilb5j.js +1 -0
- package/adminWww/assets/{zh-cn-vvAC9zpl.js → zh-cn-Dy5SHo8v.js} +13 -13
- package/adminWww/img/admin.png +0 -0
- package/adminWww/index.html +4 -4
- package/adminWww/lib/js/ace/ext-searchbox.js +1 -1
- package/adminWww/lib/js/socket.io.js +7 -1
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/remoteEntry.js +2 -2
- package/build/i18n/de.json +18 -0
- package/build/i18n/es.json +18 -0
- package/build/i18n/fr.json +18 -0
- package/build/i18n/it.json +18 -0
- package/build/i18n/nl.json +18 -0
- package/build/i18n/pl.json +18 -0
- package/build/i18n/pt.json +18 -0
- package/build/i18n/ru.json +18 -0
- package/build/i18n/uk.json +18 -0
- package/build/i18n/zh-cn.json +18 -0
- package/build/lib/checkLinuxPass.js.map +1 -0
- package/{build-backend → build}/lib/testPassword.js +1 -1
- package/build/lib/testPassword.js.map +1 -0
- package/{build-backend → build}/lib/translations.js +16 -1
- package/build/lib/translations.js.map +1 -0
- package/{build-backend → build}/lib/utils.js +20 -0
- package/build/lib/utils.js.map +1 -0
- package/{build-backend → build}/lib/web.js +6 -7
- package/build/lib/web.js.map +1 -0
- package/{build-backend → build}/main.js +68 -5
- package/build/main.js.map +1 -0
- package/io-package.json +27 -40
- package/package.json +117 -110
- package/adminWww/assets/AdapterUpdateDialog-DHGhgEEq.js +0 -2
- package/adminWww/assets/Adapters-CgSIajcF.js +0 -7
- package/adminWww/assets/Config-BQSl4bfA.js +0 -1
- package/adminWww/assets/CustomModal-DNMTLv4y.js +0 -1
- package/adminWww/assets/CustomTab-Bl8S8QZW.js +0 -1
- package/adminWww/assets/DefaultPropsProvider-u5xB1Fxz.js +0 -30
- package/adminWww/assets/EasyMode-xDbqrply.js +0 -1
- package/adminWww/assets/Enums-BSICIhWI.js +0 -111
- package/adminWww/assets/Fields-C3JkTmfP.js +0 -1
- package/adminWww/assets/Files-DK85-COY.js +0 -6
- package/adminWww/assets/FilledInput-CysG4ax_.js +0 -2
- package/adminWww/assets/Hosts-qIsB4Gub.js +0 -121
- package/adminWww/assets/Instances-BA_DCzs8.js +0 -2
- package/adminWww/assets/Intro-00oh6SLw.js +0 -2
- package/adminWww/assets/Logs-Cvpgh-zN.js +0 -1
- package/adminWww/assets/Objects-Dp71iotS.js +0 -60
- package/adminWww/assets/State-BqfD2ABf.js +0 -1
- package/adminWww/assets/Tabs-sxfWgN0b.js +0 -138
- package/adminWww/assets/Users-CDcWqTfZ.js +0 -1
- package/adminWww/assets/_commonjsHelpers-D6-XlEtG.js +0 -1
- package/adminWww/assets/ace-BG5WYul1.js +0 -985
- package/adminWww/assets/blueGrey-DYsiMDOn.js +0 -29
- package/adminWww/assets/bootstrap-BYQTdf9r.js +0 -2024
- package/adminWww/assets/createSvgIcon-Bh3KWtyp.js +0 -1
- package/adminWww/assets/emotion-cache.browser.esm-B8BFze5o.js +0 -1
- package/adminWww/assets/emotion-react.browser.esm-BCDt9NrH.js +0 -8
- package/adminWww/assets/emotion-serialize.esm-BUa21YfQ.js +0 -1
- package/adminWww/assets/emotion-styled.browser.esm-CyFqGgyG.js +0 -1
- package/adminWww/assets/emotion-utils.browser.esm-pglN4_eI.js +0 -1
- package/adminWww/assets/geosearch.module-DH4NhiPj.js +0 -1
- package/adminWww/assets/iconBase-C3vi24ZE.js +0 -1
- package/adminWww/assets/index-B1ITPhEY.js +0 -7
- package/adminWww/assets/index-C_-7Z7UV.js +0 -1
- package/adminWww/assets/index-D3IAEXXP.js +0 -10
- package/adminWww/assets/index-DPDg2YA0.js +0 -1
- package/adminWww/assets/index-Qa7Q_Dz5.js +0 -1
- package/adminWww/assets/index-qcIeekse.js +0 -55
- package/adminWww/assets/index-wN1ZlPSW.js +0 -2
- package/adminWww/assets/iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js +0 -1
- package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js +0 -5
- package/adminWww/assets/leaflet-src-A2ZHl6nF.js +0 -4
- package/adminWww/assets/locale-9HzB0nxi.js +0 -1
- package/adminWww/assets/preload-helper-Dp1pzeXC.js +0 -1
- package/adminWww/assets/sentry-H_UdJ2zx.js +0 -1
- package/adminWww/lib/js/crypto-js/aes.js +0 -234
- package/adminWww/lib/js/crypto-js/blowfish.js +0 -471
- package/adminWww/lib/js/crypto-js/bower.json +0 -39
- package/adminWww/lib/js/crypto-js/cipher-core.js +0 -895
- package/adminWww/lib/js/crypto-js/core.js +0 -807
- package/adminWww/lib/js/crypto-js/crypto-js.js +0 -6657
- package/adminWww/lib/js/crypto-js/docs/QuickStartGuide.wiki +0 -470
- package/adminWww/lib/js/crypto-js/enc-base64.js +0 -136
- package/adminWww/lib/js/crypto-js/enc-base64url.js +0 -148
- package/adminWww/lib/js/crypto-js/enc-hex.js +0 -18
- package/adminWww/lib/js/crypto-js/enc-latin1.js +0 -18
- package/adminWww/lib/js/crypto-js/enc-utf16.js +0 -149
- package/adminWww/lib/js/crypto-js/enc-utf8.js +0 -18
- package/adminWww/lib/js/crypto-js/evpkdf.js +0 -134
- package/adminWww/lib/js/crypto-js/format-hex.js +0 -66
- package/adminWww/lib/js/crypto-js/format-openssl.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac-md5.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac-ripemd160.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac-sha1.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac-sha224.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac-sha256.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac-sha3.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac-sha384.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac-sha512.js +0 -18
- package/adminWww/lib/js/crypto-js/hmac.js +0 -143
- package/adminWww/lib/js/crypto-js/index.js +0 -18
- package/adminWww/lib/js/crypto-js/lib-typedarrays.js +0 -76
- package/adminWww/lib/js/crypto-js/md5.js +0 -268
- package/adminWww/lib/js/crypto-js/mode-cfb.js +0 -80
- package/adminWww/lib/js/crypto-js/mode-ctr-gladman.js +0 -116
- package/adminWww/lib/js/crypto-js/mode-ctr.js +0 -58
- package/adminWww/lib/js/crypto-js/mode-ecb.js +0 -40
- package/adminWww/lib/js/crypto-js/mode-ofb.js +0 -54
- package/adminWww/lib/js/crypto-js/package.json +0 -42
- package/adminWww/lib/js/crypto-js/pad-ansix923.js +0 -49
- package/adminWww/lib/js/crypto-js/pad-iso10126.js +0 -44
- package/adminWww/lib/js/crypto-js/pad-iso97971.js +0 -40
- package/adminWww/lib/js/crypto-js/pad-nopadding.js +0 -30
- package/adminWww/lib/js/crypto-js/pad-pkcs7.js +0 -18
- package/adminWww/lib/js/crypto-js/pad-zeropadding.js +0 -47
- package/adminWww/lib/js/crypto-js/pbkdf2.js +0 -145
- package/adminWww/lib/js/crypto-js/rabbit-legacy.js +0 -190
- package/adminWww/lib/js/crypto-js/rabbit.js +0 -192
- package/adminWww/lib/js/crypto-js/rc4.js +0 -139
- package/adminWww/lib/js/crypto-js/ripemd160.js +0 -267
- package/adminWww/lib/js/crypto-js/sha1.js +0 -150
- package/adminWww/lib/js/crypto-js/sha224.js +0 -80
- package/adminWww/lib/js/crypto-js/sha256.js +0 -199
- package/adminWww/lib/js/crypto-js/sha3.js +0 -326
- package/adminWww/lib/js/crypto-js/sha384.js +0 -83
- package/adminWww/lib/js/crypto-js/sha512.js +0 -326
- package/adminWww/lib/js/crypto-js/tripledes.js +0 -779
- package/adminWww/lib/js/crypto-js/x64-core.js +0 -304
- package/build-backend/i18n/de.json +0 -18
- package/build-backend/i18n/es.json +0 -18
- package/build-backend/i18n/fr.json +0 -18
- package/build-backend/i18n/it.json +0 -18
- package/build-backend/i18n/nl.json +0 -18
- package/build-backend/i18n/pl.json +0 -18
- package/build-backend/i18n/pt.json +0 -18
- package/build-backend/i18n/ru.json +0 -18
- package/build-backend/i18n/uk.json +0 -18
- package/build-backend/i18n/zh-cn.json +0 -18
- package/build-backend/lib/checkLinuxPass.js.map +0 -1
- package/build-backend/lib/testPassword.js.map +0 -1
- package/build-backend/lib/translations.js.map +0 -1
- package/build-backend/lib/utils.js.map +0 -1
- package/build-backend/lib/web.js.map +0 -1
- package/build-backend/main.js.map +0 -1
- /package/{build-backend → build}/i18n/en.json +0 -0
- /package/{build-backend → build}/lib/checkLinuxPass.js +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import{j as y}from"./DefaultPropsProvider-BZ42HOhu.js";import{i as at,a as ch}from"./iobroker_admin__loadShare__react__loadShare__-CMWK8WhK.js";import{i as w,a as W}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-Dy1SQ0vs.js";import{i as O}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-D-aUnioX.js";import{l as Dx}from"./index-8HslT92O.js";import{i as _n}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-DQH_iIDO.js";import{c as tn,e as ws,f as Px,M as bd,E as Fm}from"./bootstrap-xC60EdKn.js";import{i as Xt}from"./ext-language_tools-DJmHbGA8.js";import{v as kx,w as Rx,x as Lx,y as xd}from"./index-Dy_ekAsY.js";import{a as Ox,b as Ex}from"./iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js";import{a as jx}from"./_commonjsHelpers-CE1G-McA.js";import{h as Hl}from"./zh-cn-Dy5SHo8v.js";import{C as Nx}from"./CustomModal-DCjdghJB.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-CpCTEixV.js";import"./ace-DgO9yth5.js";import"./iobroker_admin__loadShare__react_mf_2_dom__loadShare__-GTRt2eft.js";import"./useTheme-UOPilb5j.js";import"./createTheme-O_VGsRib.js";import"./preload-helper-BDBacUwf.js";import"./sdk-DTP6UH26.js";import"./blueGrey-BFcAYvAO.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./assertThisInitialized-CKqanoMB.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-BfU5U5_j.js";import"./extends-CF3RwP-h.js";import"./iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-BF_gp27r.js";import"./en-US-B8gg5zk_.js";import"./iconBase-CB0tx1VT.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";const Gt={paper:{height:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden"},headingIcon:{marginRight:5,width:32,height:32},titleEnabled:{float:"right",fontSize:16,color:"#7ff57f",textTransform:"uppercase",fontWeight:"bold",paddingLeft:20},scrollDiv:{width:"100%",height:"100%",overflow:"auto"},enabledControl:{width:130,display:"inline-block",verticalAlign:"top"},customControls:{width:"calc(100% - 130px)",maxWidth:800,display:"inline-block",verticalAlign:"top",paddingTop:16},accordionOdd:{},accordionEven:{backgroundColor:"rgba(128, 128, 128, 0.1)"},accordionHeaderOdd:{backgroundColor:"rgba(128, 128, 128, 0.2)"},accordionHeaderEven:{backgroundColor:"rgba(128, 128, 128, 0.3)"},accordionHeaderEnabledOdd:{backgroundColor:"rgba(128, 255, 128, 0.2)"},accordionHeaderEnabledEven:{backgroundColor:"rgba(128, 255, 128, 0.2)"},enabledVisible:{display:"inline-block"},enabledInvisible:{display:"none"}},Fx=".";class Ss extends at.Component{changedIds;scrollDivRef;jsonConfigs;refTemplate;customObj;commonConfig={};cb;cachedNewValues;constructor(t){super(t);let e;try{e=JSON.parse((window._localStorage||window.localStorage).getItem("App.customsExpanded")||"[]")}catch{e=[]}this.changedIds=[],this.state={loaded:!1,expanded:e,newValues:{},confirmed:!1,showConfirmation:!1,maxOids:0,systemConfig:this.props.systemConfig},this.scrollDivRef=at.createRef(),this.jsonConfigs={},this.refTemplate={},this.props.customsInstances.map(i=>this.refTemplate[i]=at.createRef()),this.customObj=this.props.objectIDs.length>1?{common:{custom:{}},native:{}}:tn.deepClone(this.props.objects[this.props.objectIDs[0]]||null),this.customObj&&this.loadAllCustoms().then(()=>{this.commonConfig=this.getCommonConfig(),this.setState({loaded:!0,newValues:{}})})}async componentDidMount(){this.state.systemConfig||this.setState({systemConfig:await this.props.socket.getCompactSystemConfig()}),this.props.registerSaveFunc&&this.props.registerSaveFunc(this.onSave)}componentWillUnmount(){this.props.registerSaveFunc&&this.props.registerSaveFunc()}async loadAllCustoms(){const t=[];for(const e of this.props.customsInstances){if(e==="_")continue;const i=e.replace(/\.\d+$/,"").replace("system.adapter.","");this.jsonConfigs[i]===void 0&&(this.jsonConfigs[i]=null,t.push(this.getCustomTemplate(i)))}await Promise.all(t),this.props.customsInstances.forEach(e=>{var n,a;const i=e.replace(/\.\d+$/,"").replace("system.adapter.","");this.jsonConfigs[i]&&(this.jsonConfigs[i].instanceObjs=this.jsonConfigs[i].instanceObjs||{},this.jsonConfigs[i].instanceObjs[e]={_id:e,common:JSON.parse(JSON.stringify((n=this.props.objects[`system.adapter.${e}`])==null?void 0:n.common)),native:JSON.parse(JSON.stringify((a=this.props.objects[`system.adapter.${e}`])==null?void 0:a.native)),type:"instance",instanceObjects:[],objects:[]})})}async getCustomTemplate(t){var i;const e=this.props.objects[`system.adapter.${t}`]?tn.deepClone(this.props.objects[`system.adapter.${t}`]):null;if(!e){console.error(`Cannot find adapter "${t}"`);return}if(tn.fixAdminUI(e),((i=e.common)==null?void 0:i.adminUI.custom)==="json")try{const n=await this.props.socket.fileExists(`${t}.admin`,"jsonCustom.json5");let a,o;n?o=await this.props.socket.readFile(`${t}.admin`,"jsonCustom.json5"):o=await this.props.socket.readFile(`${t}.admin`,"jsonCustom.json"),o.file!==void 0?a=o.file:a=o;let s;try{s=Dx.parse(a),this.jsonConfigs[t]=this.jsonConfigs[t]||{},this.jsonConfigs[t].json=s}catch(l){console.error(`Cannot parse jsonConfig of ${t}: ${l}`),window.alert(`Cannot parse jsonConfig of ${t}: ${l}`)}await _n.JsonConfigComponent.loadI18n(this.props.socket,s.i18n,t);return}catch(n){console.error(`Cannot load jsonConfig of ${t}: ${n}`),window.alert(`Cannot load jsonConfig of ${t}: ${n}`)}console.error(`Adapter ${t} is not yet supported by this version of admin`),window.alert(`Adapter ${t} is not yet supported by this version of admin`)}_executeCustom(t,e,i,n,a,o,s){if(s.includes(o))return;s.push(o);let l=[],u;if(t&&typeof t=="object"?(l=t.alsoDependsOn||[],typeof l=="string"&&(l=[l]),u=t.func):u=t,l.forEach(h=>{if(!a[h])console.error(`[JsonConfigComponent] attribute "${h}" does not exist!`);else if(!a[h].defaultFunc)console.error(`[JsonConfigComponent] attribute "${h}" is not required to be includes in "alsoDependsOn" while has static value!`);else{const c=this._executeCustom(a[h].defaultFunc,e,i,n,a,h,s);c!==void 0&&(e[h]=c)}}),!u)e[o]=a[o].default===void 0?null:a[o].default;else try{const h=new Function("data","originalData","_system","instanceObj","customObj","_socket",u.includes("return")?u:`return ${u}`);e[o]=h(e||this.props.data,this.props.originalData,this.props.systemConfig,n,i,this.props.socket)}catch(h){console.error(`Cannot execute ${t}: ${h}`),e[o]=!a[o]||a[o].default===void 0?null:a[o].default}return e[o]}static flattenItems(t,e={}){return t&&Object.keys(t).forEach(i=>{t[i].items?Ss.flattenItems(t[i].items,e):e[i]=t[i]}),e}getDefaultValues(t,e){const i={enabled:!1},n=t.split(".")[0];if(this.jsonConfigs[n]&&!this.jsonConfigs[n].disabled){const a=Ss.flattenItems(this.jsonConfigs[n].json.items);if(a){const o=[],s=Object.keys(a).filter(l=>a[l]);s.forEach(l=>{!a[l].defaultFunc&&a[l].default!==void 0&&(i[l]=a[l].default)}),s.forEach(l=>{a[l].defaultFunc&&this._executeCustom(a[l].defaultFunc,i,e,this.jsonConfigs[n].instanceObjs[t],a,l,o)})}}return i}getCommonConfig(){const t=this.props.objectIDs||[],e=this.props.objects,i={};return this.props.customsInstances.forEach(n=>{const a=n.split(".")[0];this.jsonConfigs[a]&&this.jsonConfigs[a].disabled||(i[n]={},t.forEach(o=>{var u;const s=e[o],l=(u=s==null?void 0:s.common)!=null&&u.custom&&s.common.custom[n]||null;if(l)Object.keys(l).forEach(h=>{h.startsWith("_")||(i[n][h]===void 0?i[n][h]=l[h]:i[n][h]!==l[h]&&(Array.isArray(i[n][h])||(i[n][h]=[i[n][h]]),i[n][h].includes(l[h])||i[n][h].push(l[h])))});else{const h=this.getDefaultValues(n,s);h.enabled=!1,Object.keys(h).forEach(c=>{c.startsWith("_")||(i[n][c]===void 0?i[n][c]=h[c]:i[n][c]!==h[c]&&(Array.isArray(i[n][c])||(i[n][c]=[i[n][c]]),i[n][c].includes(h[c])||i[n][c].push(h[c])))})}}),Object.keys(i[n]).forEach(o=>{Array.isArray(i[n][o])&&i[n][o].sort()}))}),i}isChanged(t){return t=t||this.state.newValues,Object.keys(t).find(e=>t[e]===null||t[e]&&Object.keys(t[e]).find(i=>!i.startsWith("_")))}combineNewAndOld(t,e=!1){const i={...this.commonConfig[t]||{},...this.state.newValues[t]||{}};return e&&Object.keys(i).forEach(n=>{n.startsWith("_")&&delete i[n]}),this.state.newValues[t]===null&&(i.enabled=!1),i}renderOneCustom(t,e,i,n){var p,v;const a=t.split(".")[0],o=`${Fx}/adapter/${a}/${this.props.objects[`system.adapter.${a}`].common.icon}`,s=this.state.newValues[t]!==void 0&&(!this.state.newValues[t]||this.state.newValues[t].enabled!==void 0)?!!(this.state.newValues[t]&&this.state.newValues[t].enabled):this.state.newValues[t]===null?!1:this.commonConfig[t].enabled,l=Array.isArray(s)&&(!this.state.newValues[t]||this.state.newValues[t].enabled===void 0),u=(v=(p=this.jsonConfigs[a])==null?void 0:p.json)==null?void 0:v.disabled,h=this.combineNewAndOld(t),c=this.jsonConfigs[a].json.hidden;if(u&&c===!0||typeof c=="string"&&this._executeCustom(c,h,i,e,this.jsonConfigs[a].json.items,"enabled",[]))return null;let f=null;const d=this.jsonConfigs[a].json.help;return u&&d&&(typeof d=="object"?f=d[this.props.lang]||d.en:f=this.props.t(d)),y.jsxs(w.Accordion,{id:`Accordion_${t}`,style:n%2?Gt.accordionOdd:Gt.accordionEven,expanded:this.state.expanded.includes(t),ref:this.refTemplate[t],onChange:()=>{const g=[...this.state.expanded],m=g.indexOf(t);m===-1?g.push(t):g.splice(m,1),(window._localStorage||window.localStorage).setItem("App.customsExpanded",JSON.stringify(g)),m===-1&&(window._localStorage||window.localStorage).setItem("App.customsLastExpanded",t),this.setState({expanded:g})},children:[y.jsxs(w.AccordionSummary,{expandIcon:y.jsx(W.ExpandMore,{}),"data-id":t,style:n%2?s?Gt.accordionHeaderEnabledOdd:Gt.accordionHeaderOdd:s?Gt.accordionHeaderEnabledEven:Gt.accordionHeaderEven,children:[y.jsx("img",{src:o,style:Gt.headingIcon,alt:""}),y.jsx(w.Typography,{style:Gt.heading,children:this.props.t("Settings %s",t)}),y.jsx("div",{className:"titleEnabled",style:{...Gt.titleEnabled,...s?Gt.enabledVisible:Gt.enabledInvisible},children:this.props.t("Enabled")})]}),y.jsxs(w.AccordionDetails,{children:[y.jsx("div",{style:Gt.enabledControl,children:y.jsx(w.FormControlLabel,{style:Gt.formControl,control:y.jsx(w.Checkbox,{indeterminate:l,checked:!!s,disabled:!!u,onChange:g=>{this.cachedNewValues=this.cachedNewValues||this.state.newValues;const m=tn.deepClone(this.cachedNewValues);m[t]=m[t]||{},l||g.target.checked?m[t].enabled=!0:s&&this.commonConfig[t].enabled?m[t]=null:delete m[t],this.cachedNewValues=m,this.setState({newValues:m,hasChanges:this.isChanged(m)},()=>{this.cachedNewValues=void 0,this.props.onChange&&this.props.onChange(!!this.state.hasChanges)})}}),label:this.props.t("Enabled")})}),y.jsxs("div",{style:Gt.customControls,children:[!u&&(s||l)&&this.state.systemConfig?y.jsx(_n.JsonConfigComponent,{instanceObj:e,customObj:i,custom:!0,adapterName:a,instance:parseInt((t==null?void 0:t.split(".").pop())??"0",10)||0,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,multiEdit:this.props.objectIDs.length>1,schema:this.jsonConfigs[a].json,data:h,isFloatComma:this.props.systemConfig.common.isFloatComma,dateFormat:this.props.systemConfig.common.dateFormat,onError:g=>this.setState({error:g},()=>this.props.onError&&this.props.onError(g)),onValueChange:(g,m)=>{var b;this.cachedNewValues=this.cachedNewValues||this.state.newValues,console.log(`${g} => ${m}`);const _=tn.deepClone(this.cachedNewValues);_[t]=_[t]||{},JSON.stringify(_n.ConfigGeneric.getValue((b=this.commonConfig)==null?void 0:b[t],g))===JSON.stringify(m)?(_n.ConfigGeneric.setValue(_[t],g,null),Object.keys(_[t]).length||delete _[t]):_n.ConfigGeneric.setValue(_[t],g,m),this.cachedNewValues=_,this.setState({newValues:_,hasChanges:this.isChanged(_)},()=>{this.cachedNewValues=void 0,this.props.onChange&&this.props.onChange(!!this.state.hasChanges)})}}):null,f]})]})]},t)}renderErrorMessage(){return!!this.state.error&&y.jsx(O.DialogError,{title:this.props.t("Error"),text:this.state.error?"Error":"",onClose:()=>this.setState({error:!1})})}getObject(t,e,i){return t[i]?Promise.resolve(t[i]):this.props.socket.getObject(i).then(n=>(e[i]=tn.deepClone(n),t[i]=n,n))}saveOneState(t,e,i,n){if(i=i||{},n=n||{},t!=null&&t.length){const a=this.state.maxOids||t.length;this.state.maxOids===null&&this.setState({maxOids:t.length},()=>this.props.onProgress(!0)),this.setState({progress:Math.round((a-t.length)/a*50)});const o=t.shift();this.getObject(i,n,o).then(s=>{var u,h,c;if(!s){window.alert(`Invalid object ${o}`);return}(u=s.common)!=null&&u.custom&&Object.keys(s.common.custom).forEach(f=>{(!s.common.custom[f]||!s.common.custom[f].enabled)&&(s.common.custom[f]=null)});const l=Object.keys(this.state.newValues);for(let f=0;f<l.length;f++){const d=l[f],p=this.combineNewAndOld(d,!0);if(p.enabled===!1)(c=(h=s.common)==null?void 0:h.custom)!=null&&c[d]&&(s.common.custom[d]=null);else if(p.enabled){if(s.common=s.common||{},Array.isArray(p.enabled)&&(!s.common.custom||!s.common.custom[d]||!s.common.custom[d].enabled)){s.common.custom&&s.common.custom[d]&&(s.common.custom[d]=null);continue}if(s.common.custom=s.common.custom||{},!s.common.custom[d]||!s.common.custom[d].enabled){const g=this.getDefaultValues(d,s);s.common.custom[d]=JSON.parse(JSON.stringify(g||{})),Object.keys(s.common.custom[d]).forEach(m=>{m.startsWith("_")&&delete s.common.custom[d][m]})}const v=this.props.objectIDs.length>1;s.common.custom[d].enabled=!0,Object.keys(p).forEach(g=>{if(!g.startsWith("_")){if(Array.isArray(p[g])&&v)return;s.common.custom[d][g]=p[g]}})}}setTimeout(()=>this.saveOneState(t,e,i,n),0)})}else{const a=Object.keys(i);if(!a.length)this.setState({maxOids:0},()=>this.props.onProgress(!1)),e&&e();else{this.setState({progress:Math.round((this.state.maxOids-a.length)/this.state.maxOids*50)+50});const o=a.shift();if(JSON.stringify(i[o].common)!==JSON.stringify(n[o].common)){this.changedIds.includes(o)||this.changedIds.push(o),this.props.socket.setObject(o,i[o]).then(async()=>{delete i[o],delete n[o],this.props.objects[o]=await this.props.socket.getObject(o),setTimeout(()=>this.saveOneState(t,e,i,n),0)});return}delete i[o],delete n[o],setTimeout(()=>this.saveOneState(t,e,i,n),0)}}}renderConfirmationDialog(){return this.state.showConfirmation?y.jsx(O.DialogConfirm,{text:this.props.t("The changes will be applied to %s states. Are you sure?",this.props.objectIDs.length.toString()),ok:this.props.t("Yes"),onClose:t=>{t?this.setState({showConfirmation:!1,confirmed:!0},()=>{const e=this.cb;this.cb=void 0,this.onSave(e)}):(this.cb=void 0,this.setState({showConfirmation:!1}))}}):null}onSave=t=>{this.props.objectIDs.length>10&&!this.state.confirmed?(this.cb=t,this.setState({showConfirmation:!0})):this.saveOneState([...this.props.objectIDs],()=>{this.cachedNewValues={},this.commonConfig=this.getCommonConfig(),this.setState({confirmed:!1,hasChanges:void 0,newValues:{}},()=>{this.props.reportChangedIds(this.changedIds),this.props.onChange(!1,!0),t&&setTimeout(()=>t(),100)})})};render(){if(this.customObj===null)return y.jsx("div",{style:{color:"#F55",fontSize:32},children:this.props.t("Object does not exist!")});if(!this.state.loaded)return y.jsx(w.LinearProgress,{});let t=0;return y.jsxs(w.Paper,{style:Gt.paper,children:[this.state.maxOids>1&&y.jsx(w.LinearProgress,{color:"secondary",variant:"determinate",value:this.state.progress}),y.jsx("div",{style:Gt.scrollDiv,ref:this.scrollDivRef,children:this.state.maxOids===0&&Object.values(this.jsonConfigs).map(e=>e?Object.keys(e.instanceObjs).map(i=>this.renderOneCustom(i,e.instanceObjs[i],this.customObj,t++)):null)}),this.renderErrorMessage(),this.renderConfirmationDialog()]})}}const Bx=O.withWidth()(Ss),{loadShare:zx}=Ex,{initPromise:Vx}=Ox,Hx=Vx.then(r=>zx("date-fns/locale",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),Wx=await Hx.then(r=>r());var xe=Wx;const Cs={en:xe.enUS,fr:xe.fr,ru:xe.ru,de:xe.de,es:xe.es,br:xe.ptBR,nl:xe.nl,it:xe.it,pt:xe.pt,pl:xe.pl,uk:xe.uk,"zh-cn":xe.zhCN},rt={paper:{height:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden"},tableDiv:r=>({height:`calc(100% - ${parseInt(r.mixins.toolbar.minHeight,10)+8}px)`,overflow:"hidden",width:"100%"}),container:{height:"100%"},table:r=>({minWidth:960,width:"100%","& td:nth-of-type(5)":{overflow:"hidden",whiteSpace:"nowrap"},"& tr:nth-child(even)":{backgroundColor:r.palette.mode==="dark"?"#383838":"#b2b2b2"}}),row:{userSelect:"none",position:"relative","&:hover":{opacity:.7},"& td":{position:"relative"}},updatedRow:{animation:"updated 1s"},rowInterpolated:{opacity:.5},selectHistoryControl:{width:130},selectRelativeTime:{marginLeft:10,width:200},notAliveInstance:{opacity:.5},customRange:r=>({color:r.palette.primary.main}),rowSelected:r=>({backgroundColor:r.palette.secondary.main,color:r.palette.secondary.contrastText,"& td":{color:r.palette.secondary.contrastText,backgroundColor:r.palette.secondary.main}}),rowFocused:r=>({position:"absolute",pointerEvents:"none",top:0,bottom:0,left:0,right:0,m:"3px",border:`1px dotted ${r.palette.action.active}`}),grow:{flexGrow:1},msInput:{width:50,pt:"10px",ml:"5px","& label":{mt:"15px"}},cellAckTrue:r=>({color:r.palette.mode==="dark"?"#66ff7f":"#04a821"}),cellAckFalse:{color:"#FF6666"},toolbarDate:{width:124,mt:"9px","& fieldset":{display:"none"},"& input":{padding:"8px 0 0 0"},"& .MuiInputAdornment-root":{ml:0,mt:"7px"}},toolbarTime:{width:84,mt:"9px","& fieldset":{display:"none"},"& input":{padding:"8px 0 0 0"},"& .MuiInputAdornment-root":{ml:0,mt:"7px"}},toolbarTimeGrid:{position:"relative",marginLeft:8,paddingLeft:8,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px dotted #AAAAAA",borderRadius:8,display:"flex"},toolbarTimeLabel:{position:"absolute",padding:8,fontSize:"0.8rem",left:2,top:-9},noLoadingProgress:{width:"100%",height:4},colValue:{},colAck:{},colFrom:{},colLastChange:{},colTs:{}};class Ts extends at.Component{adminInstance;supportedFeaturesPromises;unit;timeTimer;readSupportedFeaturesTimeout;rangeValues;rangeRef;subscribes;localStorage;constructor(t){super(t),this.localStorage=window._localStorage||window.localStorage;let e=this.localStorage.getItem("App.relativeRange")||"absolute";const i=parseInt(this.localStorage.getItem("App.absoluteStart"),10)||0,n=parseInt(this.localStorage.getItem("App.absoluteEnd"),10)||0,a=this.localStorage.getItem("App.historySelected")||"",o=parseInt(this.localStorage.getItem("App.historyLastSelected"),10)||null,s=this.localStorage.getItem("App.historyLastSelectedColumn")||null;(!i||!n)&&(!e||e==="absolute")&&(e="30"),i&&n&&(e="absolute");let l;try{l=JSON.parse(a)}catch{l=[]}this.state={start:i,end:n,values:null,relativeRange:e,selected:l,lastSelected:o,lastSelectedColumn:s,historyInstance:"",updateOpened:!1,insertOpened:!1,historyInstances:null,lcVisible:!0,ackVisible:!0,fromVisible:!0,supportedFeatures:[],ampm:!1,edit:{}},this.adminInstance=parseInt(window.location.search.slice(1),10)||0,this.supportedFeaturesPromises={},this.unit=this.props.obj.common&&this.props.obj.common.unit?` ${this.props.obj.common.unit}`:"",this.timeTimer=void 0,this.subscribes=[],this.prepareData().then(()=>this.readHistoryRange()).then(()=>{e!=="absolute"?this.setRelativeInterval(this.state.relativeRange,!0):this.readHistory()})}readSupportedFeatures(t){return t=t||this.state.historyInstance,t?this.supportedFeaturesPromises[t]instanceof Promise?this.supportedFeaturesPromises[t]:(this.supportedFeaturesPromises[t]=new Promise(e=>{this.readSupportedFeaturesTimeout&&clearTimeout(this.readSupportedFeaturesTimeout),this.readSupportedFeaturesTimeout=setTimeout(()=>{this.readSupportedFeaturesTimeout=void 0,e([])},2e3),this.props.socket.sendTo(t,"features",null).then(i=>{this.readSupportedFeaturesTimeout?(clearTimeout(this.readSupportedFeaturesTimeout),this.readSupportedFeaturesTimeout=void 0,e(i?i.supportedFeatures||[]:[])):this.setState({supportedFeatures:i?i.supportedFeatures||[]:[]})})}),this.supportedFeaturesPromises[t]):Promise.resolve([])}async componentDidMount(){await this.props.socket.subscribeState(this.props.obj._id,this.onChange)}componentWillUnmount(){this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0);for(let t=0;t<this.subscribes.length;t++)this.props.socket.unsubscribeState(this.subscribes[t],this.onChange);this.subscribes=[],this.props.socket.unsubscribeState(this.props.obj._id,this.onChange)}onChange=(t,e)=>{if(t===this.props.obj._id&&e&&this.state.values&&(!this.state.values.length||this.state.values[this.state.values.length-1].ts<e.ts)){const i=[...this.state.values,e];this.setState({values:i})}else if(t.startsWith("system.adapter.")&&t.endsWith(".alive")){const i=t.substring(15,t.length-6),n=this.state.historyInstances,a=n.findIndex(o=>o.id===i);if(a!==-1&&n[a].alive!==!!(e!=null&&e.val)){const o=JSON.parse(JSON.stringify(n));o[a].alive=!!(e!=null&&e.val),this.setState({historyInstances:o},()=>{o[a].alive&&this.state.historyInstance===i&&this.readHistoryRange().then(()=>this.readHistory())})}}};async prepareData(){var o;const t=await this.getHistoryInstances(),e=await this.props.socket.getCompactSystemConfig(),i=(o=e==null?void 0:e.common)==null?void 0:o.defaultHistory;let n=this.localStorage.getItem("App.historyInstance")||"";if((!n||!t.find(s=>s.id===n&&s.alive))&&(n=i),!n||!t.find(s=>s.id===n&&s.alive)){const s=t.find(l=>l.alive);s&&(n=s.id)}!n&&t.length&&(n=i);const a=await this.readSupportedFeatures(n);await new Promise(s=>{this.setState({ampm:(e.common.dateFormat||"").includes("/"),historyInstances:t,historyInstance:n,supportedFeatures:a},()=>s())})}getHistoryInstances(){const t=[],e=[];return this.props.customsInstances.forEach(i=>{const n=this.props.objects[`system.adapter.${i}`];if(n&&n.common&&n.common.getHistory){const a={id:i,alive:!1};t.push(a),e.push(`system.adapter.${i}.alive`)}}),e.length?this.props.socket.getForeignStates(e).then(async i=>{Object.keys(i).forEach(n=>{var o;const a=t.find(s=>n.endsWith(`${s.id}.alive`));a&&(a.alive=!!((o=i[n])!=null&&o.val))}),this.subscribes=e;for(let n=0;n<e.length;n++)await this.props.socket.subscribeState(e[n],this.onChange);return t}):Promise.resolve(t)}readHistory(t,e){var i;return t=t||this.state.start,e=e||this.state.end,!this.state.historyInstance||!((i=this.state.historyInstances)!=null&&i.find(n=>n.id===this.state.historyInstance&&n.alive))?null:(this.setState({loading:!0}),this.props.socket.getHistory(this.props.obj._id,{instance:this.state.historyInstance,start:t,end:e,from:!0,ack:!0,q:!0,addId:!1,aggregate:"none",returnNewestEntries:!0}).then(n=>{const a=[],o=this.rangeValues;let s=!1,l=!1,u=!1;if(o&&o.length&&(!n||!n.length||o[0].ts<n[0].ts)&&(a.push(o[0]),a.push({ts:o[0].ts+1,e:!0}),console.log(`add ${new Date(o[0].ts).toISOString()}: ${o[0].val}`),!l&&o[0].ack!==void 0&&(l=!0),!u&&o[0].from&&(u=!0)),n!=null&&n.length)for(let h=0;h<n.length;h++)n[h]&&(!a.length||a[a.length-1].ts<n[h].ts)?(a.push(n[h]),n[h].from&&(n[h].from.startsWith("system.adapter.")?n[h].from=n[h].from.substring(15):n[h].from.startsWith("system.host.")&&(n[h].from=n[h].from.substring(7))),!s&&n[h].lc&&(s=!0),!l&&n[h].ack!==void 0&&(l=!0),!u&&n[h].from&&(u=!0),console.log(`add value ${new Date(n[h].ts).toISOString()}: ${n[h].val}`)):a[a.length-1].ts===n[h].ts&&a[a.length-1].val!==n[h].ts&&console.error("Strange data!");else a.push({noDataForPeriod:!0});a.length||a.push({noData:!0}),this.setState({loading:!1,values:a,lcVisible:s,fromVisible:u,ackVisible:l})}))}readHistoryRange(){var i;const t=new Date,e=new Date(2e3,0,1);return!this.state.historyInstance||!((i=this.state.historyInstances)!=null&&i.find(n=>n.id===this.state.historyInstance&&n.alive))?Promise.resolve():(this.setState({loading:!0}),this.props.socket.getHistory(this.props.obj._id,{instance:this.state.historyInstance,start:e.getTime(),end:t.getTime(),limit:1,from:!1,ack:!1,q:!1,addId:!1,aggregate:"none"}).then(n=>{n.length?((n[0].val===null||n[0].ts===e.getTime())&&n.shift(),n.forEach(a=>a.i=!0),this.rangeValues=n,this.setState({loading:!1})):(this.rangeValues=[],this.setState({loading:!1}))}))}onToggleSelect(t,e,i){let n=[...this.state.selected];const a=n.indexOf(e);if(t.shiftKey&&this.state.lastSelected){let o=-1,s=-1;n=[];for(let l=0;l<this.state.values.length&&!(this.state.values[l].ts===e&&(o=l,s!==o&&n.push(this.state.values[l].ts),o!==-1&&s!==-1)||this.state.values[l].ts===this.state.lastSelected&&(s=l,s!==o&&n.push(this.state.values[l].ts),o!==-1&&s!==-1));l++)(o!==-1||s!==-1)&&n.push(this.state.values[l].ts)}else t.ctrlKey?(a!==-1?n.splice(a,1):n.push(e),n.sort()):n=[e];this.localStorage.setItem("App.historyLastSelected",e.toString()),this.localStorage.setItem("App.historyLastSelectedColumn",i),this.localStorage.setItem("App.historySelected",JSON.stringify(n)),this.setState({selected:n,lastSelected:e,lastSelectedColumn:i})}getTableRows(){const t=[];for(let e=this.state.values.length-1;e>=0;e--){const i=this.state.values[e],n=i.ts;if(i.e)t.push(y.jsxs(w.TableRow,{sx:{...rt.row,...rt.updatedRow,...rt.rowInterpolated},hover:!0,children:[y.jsx(w.TableCell,{}),y.jsx(w.TableCell,{children:"..."}),this.state.ackVisible?y.jsx(w.TableCell,{}):null,this.state.fromVisible?y.jsx(w.TableCell,{}):null,this.state.lcVisible?y.jsx(w.TableCell,{}):null]},n));else if(i.noData||i.noDataForPeriod)t.push(y.jsxs(w.TableRow,{sx:{...rt.row,...rt.updatedRow,...rt.rowNoData},hover:!0,children:[y.jsx(w.TableCell,{}),y.jsx(w.TableCell,{children:i.noData?this.props.t("No data in history"):this.props.t("No data in history for selected period")}),this.state.ackVisible?y.jsx(w.TableCell,{}):null,this.state.fromVisible?y.jsx(w.TableCell,{}):null,this.state.lcVisible?y.jsx(w.TableCell,{}):null]},i.noData?"nodata":""));else{const a=i.i,o=this.state.lastSelected===n;let s=i.val;this.props.isFloatComma&&this.props.obj.common.type==="number"&&s&&(s=s.toString().replace(".",",")),s===null&&(s="null"),s===void 0&&(s="_");const l=this.state.selected.includes(n);t.push(y.jsxs(w.TableRow,{sx:{...rt.row,...rt.updatedRow,...a?rt.rowInterpolated:void 0,...l?rt.rowSelected:void 0},children:[y.jsxs(w.TableCell,{onClick:u=>!a&&this.onToggleSelect(u,n,"ts"),children:[`${Ts.formatTimestamp(i.ts)}`,o&&this.state.lastSelectedColumn==="ts"?y.jsx(w.Box,{component:"div",sx:rt.rowFocused}):""]}),y.jsxs(w.TableCell,{onClick:u=>!a&&this.onToggleSelect(u,n,"val"),children:[s+this.unit,o&&this.state.lastSelectedColumn==="val"?y.jsx(w.Box,{component:"div",sx:rt.rowFocused}):""]}),this.state.ackVisible?y.jsxs(w.TableCell,{onClick:u=>!a&&this.onToggleSelect(u,n,"ack"),sx:i.ack?rt.cellAckTrue:rt.cellAckFalse,children:[i.ack?"true":"false",o&&this.state.lastSelectedColumn==="ack"?y.jsx(w.Box,{component:"div",sx:rt.rowFocused}):""]}):null,this.state.fromVisible?y.jsxs(w.TableCell,{onClick:u=>!a&&this.onToggleSelect(u,n,"from"),children:[i.from||"",o&&this.state.lastSelectedColumn==="from"?y.jsx(w.Box,{component:"div",sx:rt.rowFocused}):""]}):null,this.state.lcVisible?y.jsxs(w.TableCell,{onClick:u=>!a&&this.onToggleSelect(u,n,"lc"),children:[i.lc?`${new Date(i.lc).toLocaleDateString()} ${new Date(i.lc).toLocaleTimeString()}.${(i.ts%1e3).toString().padStart(3,"0")}`:"",o&&this.state.lastSelectedColumn==="lc"?y.jsx(w.Box,{component:"div",sx:rt.rowFocused}):""]}):null]},n.toString()+(i.val||"").toString()))}}return t}shiftTime(){const t=new Date,e=6e4-t.getSeconds()-(1e3-t.getMilliseconds());t.getMilliseconds()&&t.setMilliseconds(1e3),t.getSeconds()&&t.setSeconds(60);const i=t.getTime();let n;const a=this.state.relativeRange;if(a==="day")t.setHours(0),t.setMinutes(0),t.setSeconds(0),n=t.getTime();else if(a==="week"){t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);const o=t.getDay()||7;o!==1&&t.setHours(-24*(o-1)),n=t.getTime()}else if(a==="2weeks"){t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setDate(t.getDate()-7);const o=t.getDay()||7;o!==1&&t.setHours(-24*(o-1)),n=t.getTime()}else a==="month"?(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setDate(1),n=t.getTime()):a==="year"?(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setDate(1),t.setMonth(0),n=t.getTime()):a==="12months"?(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setFullYear(t.getFullYear()-1),n=t.getTime()):n=i-parseInt(a,10)*6e4;this.setState({start:n,end:i},()=>this.readHistory()),this.timeTimer=setTimeout(()=>{this.timeTimer=void 0,this.shiftTime()},e||6e4)}setRelativeInterval(t,e){if(e||(this.localStorage.setItem("App.relativeRange",t.toString()),this.setState({relativeRange:t})),t==="absolute"){this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0);return}this.localStorage.removeItem("App.absoluteStart"),this.localStorage.removeItem("App.absolute");const i=new Date;if(!this.timeTimer){const o=6e4-i.getSeconds()-(1e3-i.getMilliseconds());this.timeTimer=setTimeout(()=>{this.timeTimer=void 0,this.shiftTime()},o||6e4)}i.getMilliseconds()&&i.setMilliseconds(1e3),i.getSeconds()&&i.setSeconds(60);const n=i.getTime();let a;if(t==="day")i.setHours(0),i.setMinutes(0),i.setSeconds(0),a=i.getTime();else if(t==="week"){i.setHours(0),i.setMinutes(0),i.setSeconds(0);const o=i.getDay()||7;o!==1&&i.setHours(-24*(o-1)),a=i.getTime()}else if(t==="2weeks"){i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(i.getDate()-7);const o=i.getDay()||7;o!==1&&i.setHours(-24*(o-1)),a=i.getTime()}else t==="month"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(1),a=i.getTime()):t==="year"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(1),i.setMonth(0),a=i.getTime()):t==="12months"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setFullYear(i.getFullYear()-1),a=i.getTime()):(t=Number(t),a=n-t*6e4);this.setState({start:a,end:n},()=>this.readHistory())}renderTable(){var t;if(!this.state.historyInstance)return y.jsx("div",{style:{marginTop:20,fontSize:24},children:this.props.t("History instance not selected")});if(!((t=this.state.historyInstances)!=null&&t.find(e=>e.id===this.state.historyInstance&&e.alive)))return y.jsx("div",{style:{marginTop:20,fontSize:24},children:this.props.t("History instance not alive")});if(this.state.values){const e=[200,"auto"],i=[190,100];return this.state.ackVisible&&(e.push(50),i.push(50)),this.state.fromVisible&&(e.push(150),i.push(150)),this.state.lcVisible&&(e.push(200),i.push(190)),y.jsx(w.TableContainer,{style:rt.container,children:y.jsxs(O.TableResize,{stickyHeader:!0,sx:rt.table,initialWidths:e,minWidths:i,dblTitle:this.props.t("ra_Double click to reset table layout"),children:[y.jsx(w.TableHead,{children:y.jsxs(w.TableRow,{children:[y.jsx(w.TableCell,{style:rt.colTs,children:this.props.t("Timestamp")}),y.jsx(w.TableCell,{style:rt.colValue,children:this.props.t("Value")}),this.state.ackVisible?y.jsx(w.TableCell,{style:rt.colAck,children:this.props.t("Ack")}):null,this.state.fromVisible?y.jsx(w.TableCell,{style:rt.colFrom,children:this.props.t("From")}):null,this.state.lcVisible?y.jsx(w.TableCell,{style:rt.colLastChange,children:this.props.t("lc")}):null]})}),y.jsx(w.TableBody,{children:this.getTableRows()})]})})}return y.jsx(w.LinearProgress,{})}renderDialogConfirm(){return y.jsxs(w.Dialog,{open:!!this.state.areYouSure,onClose:()=>this.setState({areYouSure:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[y.jsx(w.DialogTitle,{id:"alert-dialog-title"}),y.jsxs(w.DialogContent,{children:[y.jsx(w.DialogContentText,{id:"alert-dialog-description",children:this.props.t("Are you sure?")}),y.jsx(w.FormControlLabel,{control:y.jsx(w.Checkbox,{value:this.state.suppressMessage,onChange:()=>this.setState({suppressMessage:!0})}),label:this.props.t("Suppress for 5 minutes")})]}),y.jsxs(w.DialogActions,{children:[y.jsx(w.Button,{variant:"contained",onClick:()=>this.setState({areYouSure:!1,suppressMessage:this.state.suppressMessage&&Date.now()},()=>this.onDelete()),color:"primary",autoFocus:!0,startIcon:y.jsx(W.Delete,{}),children:this.props.t("Delete")}),y.jsx(w.Button,{variant:"contained",onClick:()=>this.setState({areYouSure:!1}),color:"secondary",startIcon:y.jsx(W.Close,{}),children:this.props.t("Cancel")})]})]})}onDelete(){const t=this.state.selected.map(e=>({state:{ts:e},id:this.props.obj._id}));this.props.socket.sendTo(this.state.historyInstance,"delete",t).then(()=>this.readHistory())}onUpdate(){let t=this.state.edit.val;this.props.obj.common&&(this.props.obj.common.type==="number"?typeof t!="number"&&(t=parseFloat(t.toString().replace(",","."))):this.props.obj.common.type==="boolean"&&(t=t==="true"||t==="TRUE"||t===!0||t==="1"||t===1));const e={val:t,ack:this.state.edit.ack,ts:this.state.selected[0],from:`system.adapter.admin.${this.adminInstance}`,q:this.state.edit.q};for(const[i,n]of Object.entries(e))n===void 0&&delete e[i];!this.state.lcVisible&&e.lc&&delete e.lc,this.props.socket.sendTo(this.state.historyInstance,"update",[{id:this.props.obj._id,state:e}]).then(()=>this.readHistory())}onInsert(){let t=this.state.edit.val;this.props.obj.common&&(this.props.obj.common.type==="number"?t=parseFloat(t.toString().replace(",",".")):this.props.obj.common.type==="boolean"&&(t=t==="true"||t==="TRUE"||t===!0||t==="1"||t===1));const e=this.state.edit.date;e.setHours(this.state.edit.time.getHours()),e.setMinutes(this.state.edit.time.getMinutes()),e.setSeconds(this.state.edit.time.getSeconds()),e.setMilliseconds(parseInt(this.state.edit.ms,10));const i={ts:e.getTime(),val:t,ack:this.state.edit.ack,from:`system.adapter.admin.${this.adminInstance}`,q:this.state.edit.q||0};!this.state.lcVisible&&i.lc&&delete i.lc;for(const[n,a]of Object.entries(i))a===void 0&&delete i[n];this.props.socket.sendTo(this.state.historyInstance,"insert",[{id:this.props.obj._id,state:i}]).then(()=>this.readHistory())}updateEdit(t,e){const i=JSON.parse(JSON.stringify(this.state.edit));i.time=new Date(i.time),i.date=new Date(i.date),i[t]=e,this.setState({edit:i})}renderEditDialog(){return y.jsxs(w.Dialog,{open:this.state.updateOpened||this.state.insertOpened,onClose:()=>this.setState({updateOpened:!1,insertOpened:!1}),"aria-labelledby":"edit-dialog-title","aria-describedby":"edit-dialog-description",children:[y.jsx(w.DialogTitle,{id:"edit-dialog-title",children:this.state.updateOpened?this.props.t("Update entry"):this.props.t("Insert entry")}),y.jsx(w.DialogContent,{children:y.jsxs("form",{noValidate:!0,autoComplete:"off",children:[typeof this.state.edit.val=="boolean"?y.jsx(w.FormControlLabel,{control:y.jsx(w.Checkbox,{checked:this.state.edit.val,onChange:t=>this.updateEdit("val",t.target.checked)}),label:this.props.t("Value")}):y.jsx(w.TextField,{variant:"standard",label:this.props.t("Value"),value:this.state.edit.val,onChange:t=>this.updateEdit("val",t.target.value)}),y.jsx("br",{}),y.jsx(w.FormControlLabel,{control:y.jsx(w.Checkbox,{checked:this.state.edit.ack,onChange:t=>this.updateEdit("ack",t.target.checked)}),label:this.props.t("Acknowledged")}),this.state.insertOpened?y.jsx(Xt.LocalizationProvider,{dateAdapter:ws,adapterLocale:Cs[this.props.lang],children:y.jsxs("div",{style:rt.toolbarTimeGrid,children:[y.jsx("div",{style:rt.toolbarTimeLabel,children:this.props.t("Time")}),y.jsx(Xt.DatePicker,{sx:rt.toolbarDate,value:this.state.edit.date,onChange:t=>this.updateEdit("date",t)}),y.jsx(Xt.TimePicker,{sx:rt.toolbarTime,ampm:this.state.ampm,views:["hours","minutes","seconds"],value:this.state.edit.time,onChange:t=>this.updateEdit("time",t)}),y.jsx(w.TextField,{variant:"standard",sx:rt.msInput,helperText:this.props.t("ms"),type:"number",slotProps:{htmlInput:{max:999,min:0}},value:this.state.edit.ms,onChange:t=>this.updateEdit("ms",t.target.value)})]})}):null]})}),y.jsxs(w.DialogActions,{children:[y.jsx(w.Button,{variant:"contained",disabled:this.state.edit.val==="",onClick:()=>{const t=this.state.updateOpened;this.setState({updateOpened:!1,insertOpened:!1},()=>t?this.onUpdate():this.onInsert())},color:"primary",autoFocus:!0,children:this.state.updateOpened?this.props.t("Update"):this.props.t("Add")}),y.jsx(w.Button,{variant:"contained",onClick:()=>this.setState({updateOpened:!1,insertOpened:!1}),color:"grey",children:this.props.t("Cancel")})]})]})}setStartDate(t){const e=t.getTime();this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0),this.localStorage.setItem("App.relativeRange","absolute"),this.localStorage.setItem("App.absoluteStart",e.toString()),this.localStorage.setItem("App.absoluteEnd",this.state.end.toString()),this.setState({start:e,relativeRange:"absolute"},()=>this.readHistory())}setEndDate(t){const e=t.getTime();this.localStorage.setItem("App.relativeRange","absolute"),this.localStorage.setItem("App.absoluteStart",this.state.start.toString()),this.localStorage.setItem("App.absoluteEnd",e.toString()),this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0),this.setState({end:e,relativeRange:"absolute"},()=>this.readHistory())}renderToolbar(){var t,e;return y.jsxs(w.Toolbar,{children:[y.jsxs(w.FormControl,{variant:"standard",style:rt.selectHistoryControl,children:[y.jsx(w.InputLabel,{children:this.props.t("History instance")}),y.jsx(w.Select,{variant:"standard",value:this.state.historyInstance||"",onChange:i=>{const n=i.target.value;this.localStorage.setItem("App.historyInstance",n),this.readSupportedFeatures(n).then(a=>this.setState({historyInstance:n,supportedFeatures:a},()=>this.readHistory()))},children:(t=this.state.historyInstances)==null?void 0:t.map(i=>y.jsx(w.MenuItem,{value:i.id,style:i.alive?void 0:rt.notAliveInstance,children:i.id},i.id))})]}),y.jsxs(w.FormControl,{variant:"standard",style:rt.selectRelativeTime,children:[y.jsx(w.InputLabel,{children:this.props.t("Relative")}),y.jsxs(w.Select,{variant:"standard",ref:this.rangeRef,value:this.state.relativeRange,onChange:i=>this.setRelativeInterval(i.target.value),children:[y.jsx(w.MenuItem,{value:"absolute",sx:rt.customRange,children:this.props.t("custom range")},"custom"),y.jsx(w.MenuItem,{value:10,children:this.props.t("last 10 minutes")},"1"),y.jsx(w.MenuItem,{value:30,children:this.props.t("last 30 minutes")},"2"),y.jsx(w.MenuItem,{value:60,children:this.props.t("last hour")},"3"),y.jsx(w.MenuItem,{value:"day",children:this.props.t("this day")},"4"),y.jsx(w.MenuItem,{value:1440,children:this.props.t("last 24 hours")},"5"),y.jsx(w.MenuItem,{value:"week",children:this.props.t("this week")},"6"),y.jsx(w.MenuItem,{value:1440*7,children:this.props.t("last week")},"7"),y.jsx(w.MenuItem,{value:"2weeks",children:this.props.t("this 2 weeks")},"8"),y.jsx(w.MenuItem,{value:1440*14,children:this.props.t("last 2 weeks")},"9"),y.jsx(w.MenuItem,{value:"month",children:this.props.t("this month")},"10"),y.jsx(w.MenuItem,{value:720*60,children:this.props.t("last 30 days")},"11"),y.jsx(w.MenuItem,{value:"year",children:this.props.t("this year")},"12"),y.jsx(w.MenuItem,{value:"12months",children:this.props.t("last 12 months")},"13")]})]}),y.jsxs(Xt.LocalizationProvider,{dateAdapter:ws,adapterLocale:Cs[this.props.lang],children:[y.jsxs("div",{style:rt.toolbarTimeGrid,children:[y.jsx("div",{style:{...rt.toolbarTimeLabel,opacity:this.state.relativeRange!=="absolute"?.5:void 0},children:this.props.t("Start time")}),y.jsx(Xt.DatePicker,{sx:rt.toolbarDate,disabled:this.state.relativeRange!=="absolute",value:new Date(this.state.start),onChange:i=>this.setStartDate(i)}),y.jsx(Xt.TimePicker,{disabled:this.state.relativeRange!=="absolute",sx:rt.toolbarTime,ampm:this.state.ampm,value:new Date(this.state.start),onChange:i=>this.setStartDate(i)})]}),y.jsxs("div",{style:rt.toolbarTimeGrid,children:[y.jsx("div",{style:{...rt.toolbarTimeLabel,opacity:this.state.relativeRange!=="absolute"?.5:void 0},children:this.props.t("End time")}),y.jsx(Xt.DatePicker,{disabled:this.state.relativeRange!=="absolute",sx:rt.toolbarDate,value:new Date(this.state.end),onChange:i=>this.setEndDate(i)}),y.jsx(Xt.TimePicker,{disabled:this.state.relativeRange!=="absolute",sx:rt.toolbarTime,ampm:this.state.ampm,value:new Date(this.state.end),onChange:i=>this.setEndDate(i)})]})]}),y.jsx(w.Box,{component:"div",sx:rt.grow}),(e=this.state.values)!=null&&e.length?y.jsx(w.IconButton,{size:"large",onClick:()=>this.exportData(),title:this.props.t("Save data as csv"),children:y.jsx(kx,{})}):null,this.state.supportedFeatures.includes("insert")&&this.props.expertMode?y.jsx(w.IconButton,{size:"large",onClick:()=>{const i=new Date,n={ack:this.state.values[this.state.values.length-1].ack,val:this.state.values[this.state.values.length-1].val,date:new Date(i),ms:0,time:new Date(i),q:0};this.setState({edit:n,insertOpened:!0})},children:y.jsx(Rx,{})}):null,this.state.supportedFeatures.includes("update")&&this.props.expertMode?y.jsx(w.IconButton,{size:"large",disabled:this.state.selected.length!==1,onClick:()=>{const i=JSON.parse(JSON.stringify(this.state.values.find(a=>a.ts===this.state.lastSelected))),n=new Date(i.ts);i.date=new Date(n),i.time=new Date(n),this.setState({edit:i,updateOpened:!0})},children:y.jsx(W.Edit,{})}):null,this.state.supportedFeatures.includes("delete")&&this.props.expertMode?y.jsx(w.IconButton,{size:"large",disabled:!this.state.selected.length,onClick:()=>{typeof this.state.suppressMessage=="number"&&Date.now()-this.state.suppressMessage<3e5?this.onDelete():this.setState({areYouSure:!0})},children:y.jsx(W.Delete,{})}):null]})}exportData(){let t=window.document.getElementById("export-file");t||(t=document.createElement("a"),t.setAttribute("id","export-file"),t.style.display="none",document.body.appendChild(t));const e=["timestamp;value;acknowledged;from;"];this.state.values.forEach(i=>!i.i&&!i.e&&e.push([Ts.formatTimestamp(i.ts),i.val===null||i.val===void 0?"null":i.val.toString(),i.ack?"true":"false",i.from||""].join(";"))),t.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(e.join(`
|
|
2
|
+
`))}`),t.setAttribute("download",`${O.Utils.getObjectName({[this.props.obj._id]:this.props.obj},this.props.obj._id,this.props.lang)}.csv`),t.click(),document.body.removeChild(t)}render(){return this.state.historyInstances?y.jsxs(w.Paper,{style:rt.paper,children:[this.state.loading?y.jsx(w.LinearProgress,{}):y.jsx("div",{style:rt.noLoadingProgress}),this.renderToolbar(),y.jsx(w.Box,{component:"div",sx:rt.tableDiv,children:this.renderTable()}),this.renderDialogConfirm(),this.renderEditDialog()]}):y.jsx(w.LinearProgress,{})}static formatTimestamp(t){return`${new Date(t).toLocaleDateString()} ${new Date(t).toLocaleTimeString()}.${(t%1e3).toString().padStart(3,"0")}`}}const Gx=O.withWidth()(Ts);var Bm={};/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */var fh=function(r,t){return fh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},fh(r,t)};function B(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fh(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var dh=function(){return dh=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},dh.apply(this,arguments)};function Ux(r,t){var e={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&t.indexOf(i)<0&&(e[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(e[i[n]]=r[i[n]]);return e}function $x(r,t,e,i){var n=arguments.length,a=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,t,e,i);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(n<3?o(a):n>3?o(t,e,a):o(t,e))||a);return n>3&&a&&Object.defineProperty(t,e,a),a}function Yx(r,t){return function(e,i){t(e,i,r)}}function Xx(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}function Zx(r,t,e,i){function n(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?a(h.value):n(h.value).then(s,l)}u((i=i.apply(r,t||[])).next())})}function qx(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(h){u=[6,h],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Pc=Object.create?(function(r,t,e,i){i===void 0&&(i=e),Object.defineProperty(r,i,{enumerable:!0,get:function(){return t[e]}})}):(function(r,t,e,i){i===void 0&&(i=e),r[i]=t[e]});function Kx(r,t){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&Pc(t,r,e)}function ph(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function zm(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var i=e.call(r),n,a=[],o;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function Jx(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(zm(arguments[t]));return r}function Qx(){for(var r=0,t=0,e=arguments.length;t<e;t++)r+=arguments[t].length;for(var i=Array(r),n=0,t=0;t<e;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,n++)i[n]=a[o];return i}function tw(r,t,e){if(e||arguments.length===2)for(var i=0,n=t.length,a;i<n;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return r.concat(a||t)}function za(r){return this instanceof za?(this.v=r,this):new za(r)}function ew(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(r,t||[]),n,a=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(f){i[f]&&(n[f]=function(d){return new Promise(function(p,v){a.push([f,d,p,v])>1||s(f,d)})})}function s(f,d){try{l(i[f](d))}catch(p){c(a[0][3],p)}}function l(f){f.value instanceof za?Promise.resolve(f.value.v).then(u,h):c(a[0][2],f)}function u(f){s("next",f)}function h(f){s("throw",f)}function c(f,d){f(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}function rw(r){var t,e;return t={},i("next"),i("throw",function(n){throw n}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(n,a){t[n]=r[n]?function(o){return(e=!e)?{value:za(r[n](o)),done:n==="return"}:a?a(o):o}:a}}function iw(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof ph=="function"?ph(r):r[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(a){e[a]=r[a]&&function(o){return new Promise(function(s,l){o=r[a](o),n(s,l,o.done,o.value)})}}function n(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}}function nw(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}var aw=Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t};function ow(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&Pc(t,r,e);return aw(t,r),t}function sw(r){return r&&r.__esModule?r:{default:r}}function lw(r,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(r):i?i.value:t.get(r)}function uw(r,t,e,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,e):n?n.value=e:t.set(r,e),e}const hw=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return dh},__asyncDelegator:rw,__asyncGenerator:ew,__asyncValues:iw,__await:za,__awaiter:Zx,__classPrivateFieldGet:lw,__classPrivateFieldSet:uw,__createBinding:Pc,__decorate:$x,__exportStar:Kx,__extends:B,__generator:qx,__importDefault:sw,__importStar:ow,__makeTemplateObject:nw,__metadata:Xx,__param:Yx,__read:zm,__rest:Ux,__spread:Jx,__spreadArray:tw,__spreadArrays:Qx,__values:ph},Symbol.toStringTag,{value:"Module"})),Vm=jx(hw);var Hr={},Wr={},Hm={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var t=1,e=function(){return"".concat(t++)};r.default=e})(Hm);var Ks={},Js={},kc={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var t=function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,a=null;return function(){for(var o=this,s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];clearTimeout(a),a=setTimeout(function(){i.apply(o,l)},n)}};r.default=t})(kc);var sr={};Object.defineProperty(sr,"__esModule",{value:!0});sr.SizeSensorId=sr.SensorTabIndex=sr.SensorClassName=void 0;var cw="size-sensor-id";sr.SizeSensorId=cw;var fw="size-sensor-object";sr.SensorClassName=fw;var dw="-1";sr.SensorTabIndex=dw;Object.defineProperty(Js,"__esModule",{value:!0});Js.createSensor=void 0;var pw=vw(kc),Wl=sr;function vw(r){return r&&r.__esModule?r:{default:r}}var gw=function(t,e){var i=void 0,n=[],a=function(){getComputedStyle(t).position==="static"&&(t.style.position="relative");var c=document.createElement("object");return c.onload=function(){c.contentDocument.defaultView.addEventListener("resize",o),o()},c.style.display="block",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.height="100%",c.style.width="100%",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="-1",c.style.opacity="0",c.setAttribute("class",Wl.SensorClassName),c.setAttribute("tabindex",Wl.SensorTabIndex),c.type="text/html",t.appendChild(c),c.data="about:blank",c},o=(0,pw.default)(function(){n.forEach(function(h){h(t)})}),s=function(c){i||(i=a()),n.indexOf(c)===-1&&n.push(c)},l=function(){i&&i.parentNode&&(i.contentDocument&&i.contentDocument.defaultView.removeEventListener("resize",o),i.parentNode.removeChild(i),t.removeAttribute(Wl.SizeSensorId),i=void 0,n=[],e&&e())},u=function(c){var f=n.indexOf(c);f!==-1&&n.splice(f,1),n.length===0&&i&&l()};return{element:t,bind:s,destroy:l,unbind:u}};Js.createSensor=gw;var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.createSensor=void 0;var mw=sr,yw=_w(kc);function _w(r){return r&&r.__esModule?r:{default:r}}var bw=function(t,e){var i=void 0,n=[],a=(0,yw.default)(function(){n.forEach(function(h){h(t)})}),o=function(){var c=new ResizeObserver(a);return c.observe(t),a(),c},s=function(c){i||(i=o()),n.indexOf(c)===-1&&n.push(c)},l=function(){i.disconnect(),n=[],i=void 0,t.removeAttribute(mw.SizeSensorId),e&&e()},u=function(c){var f=n.indexOf(c);f!==-1&&n.splice(f,1),n.length===0&&i&&l()};return{element:t,bind:s,destroy:l,unbind:u}};Qs.createSensor=bw;Object.defineProperty(Ks,"__esModule",{value:!0});Ks.createSensor=void 0;var xw=Js,ww=Qs,Sw=typeof ResizeObserver<"u"?ww.createSensor:xw.createSensor;Ks.createSensor=Sw;Object.defineProperty(Wr,"__esModule",{value:!0});Wr.removeSensor=Wr.getSensor=Wr.Sensors=void 0;var Cw=Aw(Hm),Tw=Ks,vh=sr;function Aw(r){return r&&r.__esModule?r:{default:r}}var Dn={};Wr.Sensors=Dn;function Wm(r){r&&Dn[r]&&delete Dn[r]}var Iw=function(t){var e=t.getAttribute(vh.SizeSensorId);if(e&&Dn[e])return Dn[e];var i=(0,Cw.default)();t.setAttribute(vh.SizeSensorId,i);var n=(0,Tw.createSensor)(t,function(){return Wm(i)});return Dn[i]=n,n};Wr.getSensor=Iw;var Mw=function(t){var e=t.element.getAttribute(vh.SizeSensorId);t.destroy(),Wm(e)};Wr.removeSensor=Mw;Object.defineProperty(Hr,"__esModule",{value:!0});Hr.ver=Hr.clear=Hr.bind=void 0;var gh=Wr,Dw=function(t,e){var i=(0,gh.getSensor)(t);return i.bind(e),function(){i.unbind(e)}};Hr.bind=Dw;var Pw=function(t){var e=(0,gh.getSensor)(t);(0,gh.removeSensor)(e)};Hr.clear=Pw;var kw="1.0.2";Hr.ver=kw;var tl={};Object.defineProperty(tl,"__esModule",{value:!0});tl.pick=void 0;function Rw(r,t){var e={};return t.forEach(function(i){e[i]=r[i]}),e}tl.pick=Rw;var el={};Object.defineProperty(el,"__esModule",{value:!0});el.isFunction=void 0;function Lw(r){return typeof r=="function"}el.isFunction=Lw;var rl={};Object.defineProperty(rl,"__esModule",{value:!0});rl.isString=void 0;function Ow(r){return typeof r=="string"}rl.isString=Ow;var il={};Object.defineProperty(il,"__esModule",{value:!0});il.isEqual=void 0;var Ew=Vm,jw=(0,Ew.__importDefault)(Px);il.isEqual=jw.default;Object.defineProperty(Bm,"__esModule",{value:!0});var mh=Vm,wd=(0,mh.__importStar)(at),Sd=Hr,Cd=tl,Gl=el,Nw=rl,en=il,Fw=(function(r){(0,mh.__extends)(t,r);function t(e){var i=r.call(this,e)||this;return i.echarts=e.echarts,i.ele=null,i.isInitialResize=!0,i}return t.prototype.componentDidMount=function(){this.renderNewEcharts()},t.prototype.componentDidUpdate=function(e){var i=this.props.shouldSetOption;if(!((0,Gl.isFunction)(i)&&!i(e,this.props))){if(!(0,en.isEqual)(e.theme,this.props.theme)||!(0,en.isEqual)(e.opts,this.props.opts)||!(0,en.isEqual)(e.onEvents,this.props.onEvents)){this.dispose(),this.renderNewEcharts();return}var n=["option","notMerge","lazyUpdate","showLoading","loadingOption"];(0,en.isEqual)((0,Cd.pick)(this.props,n),(0,Cd.pick)(e,n))||this.updateEChartsOption(),(!(0,en.isEqual)(e.style,this.props.style)||!(0,en.isEqual)(e.className,this.props.className))&&this.resize()}},t.prototype.componentWillUnmount=function(){this.dispose()},t.prototype.getEchartsInstance=function(){return this.echarts.getInstanceByDom(this.ele)||this.echarts.init(this.ele,this.props.theme,this.props.opts)},t.prototype.dispose=function(){if(this.ele){try{(0,Sd.clear)(this.ele)}catch(e){console.warn(e)}this.echarts.dispose(this.ele)}},t.prototype.renderNewEcharts=function(){var e=this,i=this.props,n=i.onEvents,a=i.onChartReady,o=this.updateEChartsOption();this.bindEvents(o,n||{}),(0,Gl.isFunction)(a)&&a(o),this.ele&&(0,Sd.bind)(this.ele,function(){e.resize()})},t.prototype.bindEvents=function(e,i){function n(o,s){(0,Nw.isString)(o)&&(0,Gl.isFunction)(s)&&e.on(o,function(l){s(l,e)})}for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&n(a,i[a])},t.prototype.updateEChartsOption=function(){var e=this.props,i=e.option,n=e.notMerge,a=n===void 0?!1:n,o=e.lazyUpdate,s=o===void 0?!1:o,l=e.showLoading,u=e.loadingOption,h=u===void 0?null:u,c=this.getEchartsInstance();return c.setOption(i,a,s),l?c.showLoading(h):c.hideLoading(),c},t.prototype.resize=function(){var e=this.getEchartsInstance();if(!this.isInitialResize)try{e.resize()}catch(i){console.warn(i)}this.isInitialResize=!1},t.prototype.render=function(){var e=this,i=this.props,n=i.style,a=i.className,o=a===void 0?"":a,s=(0,mh.__assign)({height:300},n);return wd.default.createElement("div",{ref:function(l){e.ele=l},style:s,className:"echarts-for-react "+o})},t})(wd.PureComponent),Bw=Bm.default=Fw,zw=(function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r})(),Vw=(function(){function r(){this.browser=new zw,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r})(),J=new Vw;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(J.wxa=!0,J.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?J.worker=!0:!J.hasGlobalWindow||"Deno"in window?(J.node=!0,J.svgSupported=!0):Hw(navigator.userAgent,J);function Hw(r,t){var e=t.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(e.firefox=!0,e.version=i[1]),n&&(e.ie=!0,e.version=n[1]),a&&(e.edge=!0,e.version=a[1],e.newEdge=+a[1].split(".")[0]>18),o&&(e.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!e.ie&&!e.edge,t.pointerEventsSupported="onpointerdown"in window&&(e.edge||e.ie&&+e.version>=11),t.domSupported=typeof document<"u";var s=document.documentElement.style;t.transform3dSupported=(e.ie&&"transition"in s||e.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||e.ie&&+e.version>=9}var Rc=12,Gm="sans-serif",Xr=Rc+"px "+Gm,Ww=20,Gw=100,Uw="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function $w(r){var t={};if(typeof JSON>"u")return t;for(var e=0;e<r.length;e++){var i=String.fromCharCode(e+32),n=(r.charCodeAt(e)-Ww)/Gw;t[i]=n}return t}var Yw=$w(Uw),Zr={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var r,t;return function(e,i){if(!r){var n=Zr.createCanvas();r=n&&n.getContext("2d")}if(r)return t!==i&&(t=r.font=i||Xr),r.measureText(e);e=e||"",i=i||Xr;var a=/((?:\d+)?\.?\d*)px/.exec(i),o=a&&+a[1]||Rc,s=0;if(i.indexOf("mono")>=0)s=o*e.length;else for(var l=0;l<e.length;l++){var u=Yw[e[l]];s+=u==null?o:u*o}return{width:s}}})(),loadImage:function(r,t,e){var i=new Image;return i.onload=t,i.onerror=e,i.src=r,i}};function Um(r){for(var t in Zr)r[t]&&(Zr[t]=r[t])}var $m=lr(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(r,t){return r["[object "+t+"]"]=!0,r},{}),Ym=lr(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(r,t){return r["[object "+t+"Array]"]=!0,r},{}),Gn=Object.prototype.toString,nl=Array.prototype,Xw=nl.forEach,Zw=nl.filter,Lc=nl.slice,qw=nl.map,Td=function(){}.constructor,Io=Td?Td.prototype:null,Oc="__proto__",Kw=2311;function Ec(){return Kw++}function jc(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];typeof console<"u"&&console.error.apply(console,r)}function it(r){if(r==null||typeof r!="object")return r;var t=r,e=Gn.call(r);if(e==="[object Array]"){if(!Pn(r)){t=[];for(var i=0,n=r.length;i<n;i++)t[i]=it(r[i])}}else if(Ym[e]){if(!Pn(r)){var a=r.constructor;if(a.from)t=a.from(r);else{t=new a(r.length);for(var i=0,n=r.length;i<n;i++)t[i]=r[i]}}}else if(!$m[e]&&!Pn(r)&&!zi(r)){t={};for(var o in r)r.hasOwnProperty(o)&&o!==Oc&&(t[o]=it(r[o]))}return t}function st(r,t,e){if(!q(t)||!q(r))return e?it(t):r;for(var i in t)if(t.hasOwnProperty(i)&&i!==Oc){var n=r[i],a=t[i];q(a)&&q(n)&&!G(a)&&!G(n)&&!zi(a)&&!zi(n)&&!yh(a)&&!yh(n)&&!Pn(a)&&!Pn(n)?st(n,a,e):(e||!(i in r))&&(r[i]=it(t[i]))}return r}function Jw(r,t){for(var e=r[0],i=1,n=r.length;i<n;i++)e=st(e,r[i],t);return e}function F(r,t){if(Object.assign)Object.assign(r,t);else for(var e in t)t.hasOwnProperty(e)&&e!==Oc&&(r[e]=t[e]);return r}function lt(r,t,e){for(var i=vt(t),n=0,a=i.length;n<a;n++){var o=i[n];(e?t[o]!=null:r[o]==null)&&(r[o]=t[o])}return r}var Qw=Zr.createCanvas;function pt(r,t){if(r){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e}return-1}function Nc(r,t){var e=r.prototype;function i(){}i.prototype=t.prototype,r.prototype=new i;for(var n in e)e.hasOwnProperty(n)&&(r.prototype[n]=e[n]);r.prototype.constructor=r,r.superClass=t}function be(r,t,e){if(r="prototype"in r?r.prototype:r,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(t),n=0;n<i.length;n++){var a=i[n];a!=="constructor"&&(e?t[a]!=null:r[a]==null)&&(r[a]=t[a])}else lt(r,t,e)}function ne(r){return!r||typeof r=="string"?!1:typeof r.length=="number"}function A(r,t,e){if(r&&t)if(r.forEach&&r.forEach===Xw)r.forEach(t,e);else if(r.length===+r.length)for(var i=0,n=r.length;i<n;i++)t.call(e,r[i],i,r);else for(var a in r)r.hasOwnProperty(a)&&t.call(e,r[a],a,r)}function H(r,t,e){if(!r)return[];if(!t)return ol(r);if(r.map&&r.map===qw)return r.map(t,e);for(var i=[],n=0,a=r.length;n<a;n++)i.push(t.call(e,r[n],n,r));return i}function lr(r,t,e,i){if(r&&t){for(var n=0,a=r.length;n<a;n++)e=t.call(i,e,r[n],n,r);return e}}function Dt(r,t,e){if(!r)return[];if(!t)return ol(r);if(r.filter&&r.filter===Zw)return r.filter(t,e);for(var i=[],n=0,a=r.length;n<a;n++)t.call(e,r[n],n,r)&&i.push(r[n]);return i}function t1(r,t,e){if(r&&t){for(var i=0,n=r.length;i<n;i++)if(t.call(e,r[i],i,r))return r[i]}}function vt(r){if(!r)return[];if(Object.keys)return Object.keys(r);var t=[];for(var e in r)r.hasOwnProperty(e)&&t.push(e);return t}function e1(r,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];return function(){return r.apply(t,e.concat(Lc.call(arguments)))}}var ct=Io&&tt(Io.bind)?Io.call.bind(Io.bind):e1;function Ct(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return function(){return r.apply(this,t.concat(Lc.call(arguments)))}}function G(r){return Array.isArray?Array.isArray(r):Gn.call(r)==="[object Array]"}function tt(r){return typeof r=="function"}function $(r){return typeof r=="string"}function As(r){return Gn.call(r)==="[object String]"}function At(r){return typeof r=="number"}function q(r){var t=typeof r;return t==="function"||!!r&&t==="object"}function yh(r){return!!$m[Gn.call(r)]}function ae(r){return!!Ym[Gn.call(r)]}function zi(r){return typeof r=="object"&&typeof r.nodeType=="number"&&typeof r.ownerDocument=="object"}function al(r){return r.colorStops!=null}function r1(r){return r.image!=null}function i1(r){return Gn.call(r)==="[object RegExp]"}function Va(r){return r!==r}function En(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=0,i=r.length;e<i;e++)if(r[e]!=null)return r[e]}function Q(r,t){return r??t}function Ta(r,t,e){return r??t??e}function ol(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return Lc.apply(r,t)}function Fc(r){if(typeof r=="number")return[r,r,r,r];var t=r.length;return t===2?[r[0],r[1],r[0],r[1]]:t===3?[r[0],r[1],r[2],r[1]]:r}function _e(r,t){if(!r)throw new Error(t)}function We(r){return r==null?null:typeof r.trim=="function"?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var Xm="__ec_primitive__";function Is(r){r[Xm]=!0}function Pn(r){return r[Xm]}var n1=(function(){function r(){this.data={}}return r.prototype.delete=function(t){var e=this.has(t);return e&&delete this.data[t],e},r.prototype.has=function(t){return this.data.hasOwnProperty(t)},r.prototype.get=function(t){return this.data[t]},r.prototype.set=function(t,e){return this.data[t]=e,this},r.prototype.keys=function(){return vt(this.data)},r.prototype.forEach=function(t){var e=this.data;for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},r})(),Zm=typeof Map=="function";function a1(){return Zm?new Map:new n1}var qm=(function(){function r(t){var e=G(t);this.data=a1();var i=this;t instanceof r?t.each(n):t&&A(t,n);function n(a,o){e?i.set(a,o):i.set(o,a)}}return r.prototype.hasKey=function(t){return this.data.has(t)},r.prototype.get=function(t){return this.data.get(t)},r.prototype.set=function(t,e){return this.data.set(t,e),e},r.prototype.each=function(t,e){this.data.forEach(function(i,n){t.call(e,i,n)})},r.prototype.keys=function(){var t=this.data.keys();return Zm?Array.from(t):t},r.prototype.removeKey=function(t){this.data.delete(t)},r})();function nt(r){return new qm(r)}function Km(r,t){for(var e=new r.constructor(r.length+t.length),i=0;i<r.length;i++)e[i]=r[i];for(var n=r.length,i=0;i<t.length;i++)e[i+n]=t[i];return e}function ho(r,t){var e;if(Object.create)e=Object.create(r);else{var i=function(){};i.prototype=r,e=new i}return t&&F(e,t),e}function o1(r){var t=r.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function Vi(r,t){return r.hasOwnProperty(t)}function Wt(){}var Aa=180/Math.PI;const s1=Object.freeze(Object.defineProperty({__proto__:null,HashMap:qm,RADIAN_TO_DEGREE:Aa,assert:_e,bind:ct,clone:it,concatArray:Km,createCanvas:Qw,createHashMap:nt,createObject:ho,curry:Ct,defaults:lt,disableUserSelect:o1,each:A,eqNaN:Va,extend:F,filter:Dt,find:t1,guid:Ec,hasOwn:Vi,indexOf:pt,inherits:Nc,isArray:G,isArrayLike:ne,isBuiltInObject:yh,isDom:zi,isFunction:tt,isGradientObject:al,isImagePatternObject:r1,isNumber:At,isObject:q,isPrimitive:Pn,isRegExp:i1,isString:$,isStringSafe:As,isTypedArray:ae,keys:vt,logError:jc,map:H,merge:st,mergeAll:Jw,mixin:be,noop:Wt,normalizeCssArray:Fc,reduce:lr,retrieve:En,retrieve2:Q,retrieve3:Ta,setAsPrimitive:Is,slice:ol,trim:We},Symbol.toStringTag,{value:"Module"}));function Xi(r,t){return r==null&&(r=0),t==null&&(t=0),[r,t]}function l1(r,t){return r[0]=t[0],r[1]=t[1],r}function Jm(r){return[r[0],r[1]]}function u1(r,t,e){return r[0]=t,r[1]=e,r}function _h(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r}function h1(r,t,e,i){return r[0]=t[0]+e[0]*i,r[1]=t[1]+e[1]*i,r}function Qm(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r}function Bc(r){return Math.sqrt(zc(r))}var c1=Bc;function zc(r){return r[0]*r[0]+r[1]*r[1]}var f1=zc;function d1(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r}function p1(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function v1(r,t){return r[0]*t[0]+r[1]*t[1]}function ls(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function ty(r,t){var e=Bc(t);return e===0?(r[0]=0,r[1]=0):(r[0]=t[0]/e,r[1]=t[1]/e),r}function Ms(r,t){return Math.sqrt((r[0]-t[0])*(r[0]-t[0])+(r[1]-t[1])*(r[1]-t[1]))}var ey=Ms;function ry(r,t){return(r[0]-t[0])*(r[0]-t[0])+(r[1]-t[1])*(r[1]-t[1])}var Oi=ry;function g1(r,t){return r[0]=-t[0],r[1]=-t[1],r}function m1(r,t,e,i){return r[0]=t[0]+i*(e[0]-t[0]),r[1]=t[1]+i*(e[1]-t[1]),r}function re(r,t,e){var i=t[0],n=t[1];return r[0]=e[0]*i+e[2]*n+e[4],r[1]=e[1]*i+e[3]*n+e[5],r}function jr(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function Nr(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}const y1=Object.freeze(Object.defineProperty({__proto__:null,add:_h,applyTransform:re,clone:Jm,copy:l1,create:Xi,dist:ey,distSquare:Oi,distance:Ms,distanceSquare:ry,div:p1,dot:v1,len:Bc,lenSquare:zc,length:c1,lengthSquare:f1,lerp:m1,max:Nr,min:jr,mul:d1,negate:g1,normalize:ty,scale:ls,scaleAndAdd:h1,set:u1,sub:Qm},Symbol.toStringTag,{value:"Module"}));var rn=(function(){function r(t,e){this.target=t,this.topTarget=e&&e.topTarget}return r})(),_1=(function(){function r(t){this.handler=t,t.on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}return r.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent||e.__hostTarget;e&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new rn(e,t),"dragstart",t.event))},r.prototype._drag=function(t){var e=this._draggingTarget;if(e){var i=t.offsetX,n=t.offsetY,a=i-this._x,o=n-this._y;this._x=i,this._y=n,e.drift(a,o,t),this.handler.dispatchToElement(new rn(e,t),"drag",t.event);var s=this.handler.findHover(i,n,e).target,l=this._dropTarget;this._dropTarget=s,e!==s&&(l&&s!==l&&this.handler.dispatchToElement(new rn(l,t),"dragleave",t.event),s&&s!==l&&this.handler.dispatchToElement(new rn(s,t),"dragenter",t.event))}},r.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new rn(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new rn(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},r})(),hr=(function(){function r(t){t&&(this._$eventProcessor=t)}return r.prototype.on=function(t,e,i,n){this._$handlers||(this._$handlers={});var a=this._$handlers;if(typeof e=="function"&&(n=i,i=e,e=null),!i||!t)return this;var o=this._$eventProcessor;e!=null&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),a[t]||(a[t]=[]);for(var s=0;s<a[t].length;s++)if(a[t][s].h===i)return this;var l={h:i,query:e,ctx:n||this,callAtLast:i.zrEventfulCallAtLast},u=a[t].length-1,h=a[t][u];return h&&h.callAtLast?a[t].splice(u,0,l):a[t].push(l),this},r.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},r.prototype.off=function(t,e){var i=this._$handlers;if(!i)return this;if(!t)return this._$handlers={},this;if(e){if(i[t]){for(var n=[],a=0,o=i[t].length;a<o;a++)i[t][a].h!==e&&n.push(i[t][a]);i[t]=n}i[t]&&i[t].length===0&&delete i[t]}else delete i[t];return this},r.prototype.trigger=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[t],a=this._$eventProcessor;if(n)for(var o=e.length,s=n.length,l=0;l<s;l++){var u=n[l];if(!(a&&a.filter&&u.query!=null&&!a.filter(t,u.query)))switch(o){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,e[0]);break;case 2:u.h.call(u.ctx,e[0],e[1]);break;default:u.h.apply(u.ctx,e);break}}return a&&a.afterTrigger&&a.afterTrigger(t),this},r.prototype.triggerWithContext=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[t],a=this._$eventProcessor;if(n)for(var o=e.length,s=e[o-1],l=n.length,u=0;u<l;u++){var h=n[u];if(!(a&&a.filter&&h.query!=null&&!a.filter(t,h.query)))switch(o){case 0:h.h.call(s);break;case 1:h.h.call(s,e[0]);break;case 2:h.h.call(s,e[0],e[1]);break;default:h.h.apply(s,e.slice(1,o-1));break}}return a&&a.afterTrigger&&a.afterTrigger(t),this},r})(),b1=Math.log(2);function bh(r,t,e,i,n,a){var o=i+"-"+n,s=r.length;if(a.hasOwnProperty(o))return a[o];if(t===1){var l=Math.round(Math.log((1<<s)-1&~n)/b1);return r[e][l]}for(var u=i|1<<e,h=e+1;i&1<<h;)h++;for(var c=0,f=0,d=0;f<s;f++){var p=1<<f;p&n||(c+=(d%2?-1:1)*r[e][f]*bh(r,t-1,h,u,n|p,a),d++)}return a[o]=c,c}function Ad(r,t){var e=[[r[0],r[1],1,0,0,0,-t[0]*r[0],-t[0]*r[1]],[0,0,0,r[0],r[1],1,-t[1]*r[0],-t[1]*r[1]],[r[2],r[3],1,0,0,0,-t[2]*r[2],-t[2]*r[3]],[0,0,0,r[2],r[3],1,-t[3]*r[2],-t[3]*r[3]],[r[4],r[5],1,0,0,0,-t[4]*r[4],-t[4]*r[5]],[0,0,0,r[4],r[5],1,-t[5]*r[4],-t[5]*r[5]],[r[6],r[7],1,0,0,0,-t[6]*r[6],-t[6]*r[7]],[0,0,0,r[6],r[7],1,-t[7]*r[6],-t[7]*r[7]]],i={},n=bh(e,8,0,0,0,i);if(n!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]==null&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*bh(e,7,o===0?1:0,1<<o,1<<s,i)/n*t[o];return function(l,u,h){var c=u*a[6]+h*a[7]+1;l[0]=(u*a[0]+h*a[1]+a[2])/c,l[1]=(u*a[3]+h*a[4]+a[5])/c}}}var Id="___zrEVENTSAVED",Ul=[];function x1(r,t,e,i,n){return xh(Ul,t,i,n,!0)&&xh(r,e,Ul[0],Ul[1])}function xh(r,t,e,i,n){if(t.getBoundingClientRect&&J.domSupported&&!iy(t)){var a=t[Id]||(t[Id]={}),o=w1(t,a),s=S1(o,a,n);if(s)return s(r,e,i),!0}return!1}function w1(r,t){var e=t.markers;if(e)return e;e=t.markers=[];for(var i=["left","right"],n=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=o.style,l=a%2,u=(a>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),r.appendChild(o),e.push(o)}return e}function S1(r,t,e){for(var i=e?"invTrans":"trans",n=t[i],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var h=r[u].getBoundingClientRect(),c=2*u,f=h.left,d=h.top;o.push(f,d),l=l&&a&&f===a[c]&&d===a[c+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&n?n:(t.srcCoords=o,t[i]=e?Ad(s,o):Ad(o,s))}function iy(r){return r.nodeName.toUpperCase()==="CANVAS"}var C1=/([&<>"'])/g,T1={"&":"&","<":"<",">":">",'"':""","'":"'"};function qt(r){return r==null?"":(r+"").replace(C1,function(t,e){return T1[e]})}var A1=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,$l=[],I1=J.browser.firefox&&+J.browser.version.split(".")[0]<39;function wh(r,t,e,i){return e=e||{},i?Md(r,t,e):I1&&t.layerX!=null&&t.layerX!==t.offsetX?(e.zrX=t.layerX,e.zrY=t.layerY):t.offsetX!=null?(e.zrX=t.offsetX,e.zrY=t.offsetY):Md(r,t,e),e}function Md(r,t,e){if(J.domSupported&&r.getBoundingClientRect){var i=t.clientX,n=t.clientY;if(iy(r)){var a=r.getBoundingClientRect();e.zrX=i-a.left,e.zrY=n-a.top;return}else if(xh($l,r,i,n)){e.zrX=$l[0],e.zrY=$l[1];return}}e.zrX=e.zrY=0}function Vc(r){return r||window.event}function Te(r,t,e){if(t=Vc(t),t.zrX!=null)return t;var i=t.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&wh(r,o,t,e)}else{wh(r,t,t,e);var a=M1(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&A1.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function M1(r){var t=r.wheelDelta;if(t)return t;var e=r.deltaX,i=r.deltaY;if(e==null||i==null)return t;var n=Math.abs(i!==0?i:e),a=i>0?-1:i<0?1:e>0?-1:1;return 3*n*a}function Sh(r,t,e,i){r.addEventListener(t,e,i)}function D1(r,t,e,i){r.removeEventListener(t,e,i)}var ny=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0},P1=(function(){function r(){this._track=[]}return r.prototype.recognize=function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(t,e,i){var n=t.touches;if(n){for(var a={points:[],touches:[],target:e,event:t},o=0,s=n.length;o<s;o++){var l=n[o],u=wh(i,l,{});a.points.push([u.zrX,u.zrY]),a.touches.push(l)}this._track.push(a)}},r.prototype._recognize=function(t){for(var e in Yl)if(Yl.hasOwnProperty(e)){var i=Yl[e](this._track,t);if(i)return i}},r})();function Dd(r){var t=r[1][0]-r[0][0],e=r[1][1]-r[0][1];return Math.sqrt(t*t+e*e)}function k1(r){return[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]}var Yl={pinch:function(r,t){var e=r.length;if(e){var i=(r[e-1]||{}).points,n=(r[e-2]||{}).points||i;if(n&&n.length>1&&i&&i.length>1){var a=Dd(i)/Dd(n);!isFinite(a)&&(a=1),t.pinchScale=a;var o=k1(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:r[0].target,event:t}}}}};function _r(){return[1,0,0,1,0,0]}function co(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function Hc(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function Gr(r,t,e){var i=t[0]*e[0]+t[2]*e[1],n=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],s=t[0]*e[4]+t[2]*e[5]+t[4],l=t[1]*e[4]+t[3]*e[5]+t[5];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function jn(r,t,e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4]+e[0],r[5]=t[5]+e[1],r}function fo(r,t,e,i){i===void 0&&(i=[0,0]);var n=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],h=Math.sin(e),c=Math.cos(e);return r[0]=n*c+s*h,r[1]=-n*h+s*c,r[2]=a*c+l*h,r[3]=-a*h+c*l,r[4]=c*(o-i[0])+h*(u-i[1])+i[0],r[5]=c*(u-i[1])-h*(o-i[0])+i[1],r}function ay(r,t,e){var i=e[0],n=e[1];return r[0]=t[0]*i,r[1]=t[1]*n,r[2]=t[2]*i,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*n,r}function po(r,t){var e=t[0],i=t[2],n=t[4],a=t[1],o=t[3],s=t[5],l=e*o-a*i;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-i*l,r[3]=e*l,r[4]=(i*s-o*n)*l,r[5]=(a*n-e*s)*l,r):null}function R1(r){var t=_r();return Hc(t,r),t}const L1=Object.freeze(Object.defineProperty({__proto__:null,clone:R1,copy:Hc,create:_r,identity:co,invert:po,mul:Gr,rotate:fo,scale:ay,translate:jn},Symbol.toStringTag,{value:"Module"}));var wt=(function(){function r(t,e){this.x=t||0,this.y=e||0}return r.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(t,e){return this.x=t,this.y=e,this},r.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},r.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},r.prototype.scale=function(t){this.x*=t,this.y*=t},r.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},r.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},r.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},r.prototype.distanceSquare=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(t){if(t){var e=this.x,i=this.y;return this.x=t[0]*e+t[2]*i+t[4],this.y=t[1]*e+t[3]*i+t[5],this}},r.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},r.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},r.set=function(t,e,i){t.x=e,t.y=i},r.copy=function(t,e){t.x=e.x,t.y=e.y},r.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},r.lenSquare=function(t){return t.x*t.x+t.y*t.y},r.dot=function(t,e){return t.x*e.x+t.y*e.y},r.add=function(t,e,i){t.x=e.x+i.x,t.y=e.y+i.y},r.sub=function(t,e,i){t.x=e.x-i.x,t.y=e.y-i.y},r.scale=function(t,e,i){t.x=e.x*i,t.y=e.y*i},r.scaleAndAdd=function(t,e,i,n){t.x=e.x+i.x*n,t.y=e.y+i.y*n},r.lerp=function(t,e,i,n){var a=1-n;t.x=a*e.x+n*i.x,t.y=a*e.y+n*i.y},r})(),Mo=Math.min,Do=Math.max,ai=new wt,oi=new wt,si=new wt,li=new wt,Kn=new wt,Jn=new wt,mt=(function(){function r(t,e,i,n){i<0&&(t=t+i,i=-i),n<0&&(e=e+n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}return r.prototype.union=function(t){var e=Mo(t.x,this.x),i=Mo(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Do(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Do(t.y+t.height,this.y+this.height)-i:this.height=t.height,this.x=e,this.y=i},r.prototype.applyTransform=function(t){r.applyTransform(this,this,t)},r.prototype.calculateTransform=function(t){var e=this,i=t.width/e.width,n=t.height/e.height,a=_r();return jn(a,a,[-e.x,-e.y]),ay(a,a,[i,n]),jn(a,a,[t.x,t.y]),a},r.prototype.intersect=function(t,e){if(!t)return!1;t instanceof r||(t=r.create(t));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,u=t.x+t.width,h=t.y,c=t.y+t.height,f=!(a<l||u<n||s<h||c<o);if(e){var d=1/0,p=0,v=Math.abs(a-l),g=Math.abs(u-n),m=Math.abs(s-h),_=Math.abs(c-o),b=Math.min(v,g),x=Math.min(m,_);a<l||u<n?b>p&&(p=b,v<g?wt.set(Jn,-v,0):wt.set(Jn,g,0)):b<d&&(d=b,v<g?wt.set(Kn,v,0):wt.set(Kn,-g,0)),s<h||c<o?x>p&&(p=x,m<_?wt.set(Jn,0,-m):wt.set(Jn,0,_)):b<d&&(d=b,m<_?wt.set(Kn,0,m):wt.set(Kn,0,-_))}return e&&wt.copy(e,f?Kn:Jn),f},r.prototype.contain=function(t,e){var i=this;return t>=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(t){r.copy(this,t)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(t){return new r(t.x,t.y,t.width,t.height)},r.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},r.applyTransform=function(t,e,i){if(!i){t!==e&&r.copy(t,e);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];t.x=e.x*n+o,t.y=e.y*a+s,t.width=e.width*n,t.height=e.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}ai.x=si.x=e.x,ai.y=li.y=e.y,oi.x=li.x=e.x+e.width,oi.y=si.y=e.y+e.height,ai.transform(i),li.transform(i),oi.transform(i),si.transform(i),t.x=Mo(ai.x,oi.x,si.x,li.x),t.y=Mo(ai.y,oi.y,si.y,li.y);var l=Do(ai.x,oi.x,si.x,li.x),u=Do(ai.y,oi.y,si.y,li.y);t.width=l-t.x,t.height=u-t.y},r})(),oy="silent";function O1(r,t,e){return{type:r,event:e,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:e.zrX,offsetY:e.zrY,gestureEvent:e.gestureEvent,pinchX:e.pinchX,pinchY:e.pinchY,pinchScale:e.pinchScale,wheelDelta:e.zrDelta,zrByTouch:e.zrByTouch,which:e.which,stop:E1}}function E1(){ny(this.event)}var j1=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.handler=null,e}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t})(hr),Qn=(function(){function r(t,e){this.x=t,this.y=e}return r})(),N1=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Xl=new mt(0,0,0,0),sy=(function(r){B(t,r);function t(e,i,n,a,o){var s=r.call(this)||this;return s._hovered=new Qn(0,0),s.storage=e,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new j1,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new _1(s),s}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(A(N1,function(i){e.on&&e.on(i,this[i],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var i=e.zrX,n=e.zrY,a=ly(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new Qn(i,n):this.findHover(i,n),u=l.target,h=this.proxy;h.setCursor&&h.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",e),this.dispatchToElement(l,"mousemove",e),u&&u!==s&&this.dispatchToElement(l,"mouseover",e)},t.prototype.mouseout=function(e){var i=e.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",e),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new Qn(0,0)},t.prototype.dispatch=function(e,i){var n=this[e];n&&n.call(this,i)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var i=this.proxy;i.setCursor&&i.setCursor(e)},t.prototype.dispatchToElement=function(e,i,n){e=e||{};var a=e.target;if(!(a&&a.silent)){for(var o="on"+i,s=O1(i,e,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},t.prototype.findHover=function(e,i,n){var a=this.storage.getDisplayList(),o=new Qn(e,i);if(Pd(a,o,e,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,h=new mt(e-u,i-u,l,l),c=a.length-1;c>=0;c--){var f=a[c];f!==n&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(Xl.copy(f.getBoundingRect()),f.transform&&Xl.applyTransform(f.transform),Xl.intersect(h)&&s.push(f))}if(s.length)for(var d=4,p=Math.PI/12,v=Math.PI*2,g=0;g<u;g+=d)for(var m=0;m<v;m+=p){var _=e+g*Math.cos(m),b=i+g*Math.sin(m);if(Pd(s,o,_,b,n),o.target)return o}}return o},t.prototype.processGesture=function(e,i){this._gestureMgr||(this._gestureMgr=new P1);var n=this._gestureMgr;i==="start"&&n.clear();var a=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if(i==="end"&&n.clear(),a){var o=a.type;e.gestureEvent=o;var s=new Qn;s.target=a.target,this.dispatchToElement(s,o,a.event)}},t})(hr);A(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(r){sy.prototype[r]=function(t){var e=t.zrX,i=t.zrY,n=ly(this,e,i),a,o;if((r!=="mouseup"||!n)&&(a=this.findHover(e,i),o=a.target),r==="mousedown")this._downEl=o,this._downPoint=[t.zrX,t.zrY],this._upEl=o;else if(r==="mouseup")this._upEl=o;else if(r==="click"){if(this._downEl!==this._upEl||!this._downPoint||ey(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,r,t)}});function F1(r,t,e){if(r[r.rectHover?"rectContain":"contain"](t,e)){for(var i=r,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,e))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s||i.parent}return n?oy:!0}return!1}function Pd(r,t,e,i,n){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==n&&!o.ignore&&(s=F1(o,e,i))&&(!t.topTarget&&(t.topTarget=o),s!==oy)){t.target=o;break}}}function ly(r,t,e){var i=r.painter;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}var uy=32,ta=7;function B1(r){for(var t=0;r>=uy;)t|=r&1,r>>=1;return r+t}function kd(r,t,e,i){var n=t+1;if(n===e)return 1;if(i(r[n++],r[t])<0){for(;n<e&&i(r[n],r[n-1])<0;)n++;z1(r,t,n)}else for(;n<e&&i(r[n],r[n-1])>=0;)n++;return n-t}function z1(r,t,e){for(e--;t<e;){var i=r[t];r[t++]=r[e],r[e--]=i}}function Rd(r,t,e,i,n){for(i===t&&i++;i<e;i++){for(var a=r[i],o=t,s=i,l;o<s;)l=o+s>>>1,n(a,r[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function Zl(r,t,e,i,n,a){var o=0,s=0,l=1;if(a(r,t[e+n])>0){for(s=i-n;l<s&&a(r,t[e+n+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;l<s&&a(r,t[e+n-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o<l;){var h=o+(l-o>>>1);a(r,t[e+h])>0?o=h+1:l=h}return l}function ql(r,t,e,i,n,a){var o=0,s=0,l=1;if(a(r,t[e+n])<0){for(s=n+1;l<s&&a(r,t[e+n-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l<s&&a(r,t[e+n+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o<l;){var h=o+(l-o>>>1);a(r,t[e+h])<0?l=h:o=h+1}return l}function V1(r,t){var e=ta,i,n,a=0,o=[];i=[],n=[];function s(d,p){i[a]=d,n[a]=p,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&n[d-1]<=n[d]+n[d+1]||d>=2&&n[d-2]<=n[d]+n[d-1])n[d-1]<n[d+1]&&d--;else if(n[d]>n[d+1])break;h(d)}}function u(){for(;a>1;){var d=a-2;d>0&&n[d-1]<n[d+1]&&d--,h(d)}}function h(d){var p=i[d],v=n[d],g=i[d+1],m=n[d+1];n[d]=v+m,d===a-3&&(i[d+1]=i[d+2],n[d+1]=n[d+2]),a--;var _=ql(r[g],r,p,v,0,t);p+=_,v-=_,v!==0&&(m=Zl(r[p+v-1],r,g,m,m-1,t),m!==0&&(v<=m?c(p,v,g,m):f(p,v,g,m)))}function c(d,p,v,g){var m=0;for(m=0;m<p;m++)o[m]=r[d+m];var _=0,b=v,x=d;if(r[x++]=r[b++],--g===0){for(m=0;m<p;m++)r[x+m]=o[_+m];return}if(p===1){for(m=0;m<g;m++)r[x+m]=r[b+m];r[x+g]=o[_];return}for(var C=e,S,T,I;;){S=0,T=0,I=!1;do if(t(r[b],o[_])<0){if(r[x++]=r[b++],T++,S=0,--g===0){I=!0;break}}else if(r[x++]=o[_++],S++,T=0,--p===1){I=!0;break}while((S|T)<C);if(I)break;do{if(S=ql(r[b],o,_,p,0,t),S!==0){for(m=0;m<S;m++)r[x+m]=o[_+m];if(x+=S,_+=S,p-=S,p<=1){I=!0;break}}if(r[x++]=r[b++],--g===0){I=!0;break}if(T=Zl(o[_],r,b,g,0,t),T!==0){for(m=0;m<T;m++)r[x+m]=r[b+m];if(x+=T,b+=T,g-=T,g===0){I=!0;break}}if(r[x++]=o[_++],--p===1){I=!0;break}C--}while(S>=ta||T>=ta);if(I)break;C<0&&(C=0),C+=2}if(e=C,e<1&&(e=1),p===1){for(m=0;m<g;m++)r[x+m]=r[b+m];r[x+g]=o[_]}else{if(p===0)throw new Error;for(m=0;m<p;m++)r[x+m]=o[_+m]}}function f(d,p,v,g){var m=0;for(m=0;m<g;m++)o[m]=r[v+m];var _=d+p-1,b=g-1,x=v+g-1,C=0,S=0;if(r[x--]=r[_--],--p===0){for(C=x-(g-1),m=0;m<g;m++)r[C+m]=o[m];return}if(g===1){for(x-=p,_-=p,S=x+1,C=_+1,m=p-1;m>=0;m--)r[S+m]=r[C+m];r[x]=o[b];return}for(var T=e;;){var I=0,M=0,D=!1;do if(t(o[b],r[_])<0){if(r[x--]=r[_--],I++,M=0,--p===0){D=!0;break}}else if(r[x--]=o[b--],M++,I=0,--g===1){D=!0;break}while((I|M)<T);if(D)break;do{if(I=p-ql(o[b],r,d,p,p-1,t),I!==0){for(x-=I,_-=I,p-=I,S=x+1,C=_+1,m=I-1;m>=0;m--)r[S+m]=r[C+m];if(p===0){D=!0;break}}if(r[x--]=o[b--],--g===1){D=!0;break}if(M=g-Zl(r[_],o,0,g,g-1,t),M!==0){for(x-=M,b-=M,g-=M,S=x+1,C=b+1,m=0;m<M;m++)r[S+m]=o[C+m];if(g<=1){D=!0;break}}if(r[x--]=r[_--],--p===0){D=!0;break}T--}while(I>=ta||M>=ta);if(D)break;T<0&&(T=0),T+=2}if(e=T,e<1&&(e=1),g===1){for(x-=p,_-=p,S=x+1,C=_+1,m=p-1;m>=0;m--)r[S+m]=r[C+m];r[x]=o[b]}else{if(g===0)throw new Error;for(C=x-(g-1),m=0;m<g;m++)r[C+m]=o[m]}}return{mergeRuns:l,forceMergeRuns:u,pushRun:s}}function us(r,t,e,i){e||(e=0),i||(i=r.length);var n=i-e;if(!(n<2)){var a=0;if(n<uy){a=kd(r,e,i,t),Rd(r,e,i,e+a,t);return}var o=V1(r,t),s=B1(n);do{if(a=kd(r,e,i,t),a<s){var l=n;l>s&&(l=s),Rd(r,e,e+l,e+a,t),a=l}o.pushRun(e,a),o.mergeRuns(),n-=a,e+=a}while(n!==0);o.forceMergeRuns()}}var ir=1,ma=2,bn=4,Ld=!1;function Kl(){Ld||(Ld=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Od(r,t){return r.zlevel===t.zlevel?r.z===t.z?r.z2-t.z2:r.z-t.z:r.zlevel-t.zlevel}var H1=(function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Od}return r.prototype.traverse=function(t,e){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(t,e)},r.prototype.getDisplayList=function(t,e){e=e||!1;var i=this._displayList;return(t||!i.length)&&this.updateDisplayList(e),i},r.prototype.updateDisplayList=function(t){this._displayListLen=0;for(var e=this._roots,i=this._displayList,n=0,a=e.length;n<a;n++)this._updateAndAddDisplayable(e[n],null,t);i.length=this._displayListLen,us(i,Od)},r.prototype._updateAndAddDisplayable=function(t,e,i){if(!(t.ignore&&!i)){t.beforeUpdate(),t.update(),t.afterUpdate();var n=t.getClipPath();if(t.ignoreClip)e=null;else if(n){e?e=e.slice():e=[];for(var a=n,o=t;a;)a.parent=o,a.updateTransform(),e.push(a),o=a,a=a.getClipPath()}if(t.childrenRef){for(var s=t.childrenRef(),l=0;l<s.length;l++){var u=s[l];t.__dirty&&(u.__dirty|=ir),this._updateAndAddDisplayable(u,e,i)}t.__dirty=0}else{var h=t;e&&e.length?h.__clipPaths=e:h.__clipPaths&&h.__clipPaths.length>0&&(h.__clipPaths=[]),isNaN(h.z)&&(Kl(),h.z=0),isNaN(h.z2)&&(Kl(),h.z2=0),isNaN(h.zlevel)&&(Kl(),h.zlevel=0),this._displayList[this._displayListLen++]=h}var c=t.getDecalElement&&t.getDecalElement();c&&this._updateAndAddDisplayable(c,e,i);var f=t.getTextGuideLine();f&&this._updateAndAddDisplayable(f,e,i);var d=t.getTextContent();d&&this._updateAndAddDisplayable(d,e,i)}},r.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},r.prototype.delRoot=function(t){if(t instanceof Array){for(var e=0,i=t.length;e<i;e++)this.delRoot(t[e]);return}var n=pt(this._roots,t);n>=0&&this._roots.splice(n,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r})(),Ch;Ch=J.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var Ia={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),-(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)))},elasticOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*r)*Math.sin((r-t)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),(r*=2)<1?-.5*(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)):e*Math.pow(2,-10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var t=1.70158;return r*r*((t+1)*r-t)},backOut:function(r){var t=1.70158;return--r*r*((t+1)*r+t)+1},backInOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},bounceIn:function(r){return 1-Ia.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?Ia.bounceIn(r*2)*.5:Ia.bounceOut(r*2-1)*.5+.5}},Po=Math.pow,Ur=Math.sqrt,Ds=1e-8,hy=1e-4,Ed=Ur(3),ko=1/3,nr=Xi(),Me=Xi(),kn=Xi();function Fr(r){return r>-Ds&&r<Ds}function cy(r){return r>Ds||r<-Ds}function Ht(r,t,e,i,n){var a=1-n;return a*a*(a*r+3*n*t)+n*n*(n*i+3*a*e)}function jd(r,t,e,i,n){var a=1-n;return 3*(((t-r)*a+2*(e-t)*n)*a+(i-e)*n*n)}function Ps(r,t,e,i,n,a){var o=i+3*(t-e)-r,s=3*(e-t*2+r),l=3*(t-r),u=r-n,h=s*s-3*o*l,c=s*l-9*o*u,f=l*l-3*s*u,d=0;if(Fr(h)&&Fr(c))if(Fr(s))a[0]=0;else{var p=-l/s;p>=0&&p<=1&&(a[d++]=p)}else{var v=c*c-4*h*f;if(Fr(v)){var g=c/h,p=-s/o+g,m=-g/2;p>=0&&p<=1&&(a[d++]=p),m>=0&&m<=1&&(a[d++]=m)}else if(v>0){var _=Ur(v),b=h*s+1.5*o*(-c+_),x=h*s+1.5*o*(-c-_);b<0?b=-Po(-b,ko):b=Po(b,ko),x<0?x=-Po(-x,ko):x=Po(x,ko);var p=(-s-(b+x))/(3*o);p>=0&&p<=1&&(a[d++]=p)}else{var C=(2*h*s-3*o*c)/(2*Ur(h*h*h)),S=Math.acos(C)/3,T=Ur(h),I=Math.cos(S),p=(-s-2*T*I)/(3*o),m=(-s+T*(I+Ed*Math.sin(S)))/(3*o),M=(-s+T*(I-Ed*Math.sin(S)))/(3*o);p>=0&&p<=1&&(a[d++]=p),m>=0&&m<=1&&(a[d++]=m),M>=0&&M<=1&&(a[d++]=M)}}return d}function fy(r,t,e,i,n){var a=6*e-12*t+6*r,o=9*t+3*i-3*r-9*e,s=3*t-3*r,l=0;if(Fr(o)){if(cy(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var h=a*a-4*o*s;if(Fr(h))n[0]=-a/(2*o);else if(h>0){var c=Ur(h),u=(-a+c)/(2*o),f=(-a-c)/(2*o);u>=0&&u<=1&&(n[l++]=u),f>=0&&f<=1&&(n[l++]=f)}}return l}function ks(r,t,e,i,n,a){var o=(t-r)*n+r,s=(e-t)*n+t,l=(i-e)*n+e,u=(s-o)*n+o,h=(l-s)*n+s,c=(h-u)*n+u;a[0]=r,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=i}function W1(r,t,e,i,n,a,o,s,l,u,h){var c,f=.005,d=1/0,p,v,g,m;nr[0]=l,nr[1]=u;for(var _=0;_<1;_+=.05)Me[0]=Ht(r,e,n,o,_),Me[1]=Ht(t,i,a,s,_),g=Oi(nr,Me),g<d&&(c=_,d=g);d=1/0;for(var b=0;b<32&&!(f<hy);b++)p=c-f,v=c+f,Me[0]=Ht(r,e,n,o,p),Me[1]=Ht(t,i,a,s,p),g=Oi(Me,nr),p>=0&&g<d?(c=p,d=g):(kn[0]=Ht(r,e,n,o,v),kn[1]=Ht(t,i,a,s,v),m=Oi(kn,nr),v<=1&&m<d?(c=v,d=m):f*=.5);return Ur(d)}function G1(r,t,e,i,n,a,o,s,l){for(var u=r,h=t,c=0,f=1/l,d=1;d<=l;d++){var p=d*f,v=Ht(r,e,n,o,p),g=Ht(t,i,a,s,p),m=v-u,_=g-h;c+=Math.sqrt(m*m+_*_),u=v,h=g}return c}function he(r,t,e,i){var n=1-i;return n*(n*r+2*i*t)+i*i*e}function Nd(r,t,e,i){return 2*((1-i)*(t-r)+i*(e-t))}function U1(r,t,e,i,n){var a=r-2*t+e,o=2*(t-r),s=r-i,l=0;if(Fr(a)){if(cy(o)){var u=-s/o;u>=0&&u<=1&&(n[l++]=u)}}else{var h=o*o-4*a*s;if(Fr(h)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(h>0){var c=Ur(h),u=(-o+c)/(2*a),f=(-o-c)/(2*a);u>=0&&u<=1&&(n[l++]=u),f>=0&&f<=1&&(n[l++]=f)}}return l}function dy(r,t,e){var i=r+e-2*t;return i===0?.5:(r-t)/i}function Rs(r,t,e,i,n){var a=(t-r)*i+r,o=(e-t)*i+t,s=(o-a)*i+a;n[0]=r,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=e}function $1(r,t,e,i,n,a,o,s,l){var u,h=.005,c=1/0;nr[0]=o,nr[1]=s;for(var f=0;f<1;f+=.05){Me[0]=he(r,e,n,f),Me[1]=he(t,i,a,f);var d=Oi(nr,Me);d<c&&(u=f,c=d)}c=1/0;for(var p=0;p<32&&!(h<hy);p++){var v=u-h,g=u+h;Me[0]=he(r,e,n,v),Me[1]=he(t,i,a,v);var d=Oi(Me,nr);if(v>=0&&d<c)u=v,c=d;else{kn[0]=he(r,e,n,g),kn[1]=he(t,i,a,g);var m=Oi(kn,nr);g<=1&&m<c?(u=g,c=m):h*=.5}}return Ur(c)}function Y1(r,t,e,i,n,a,o){for(var s=r,l=t,u=0,h=1/o,c=1;c<=o;c++){var f=c*h,d=he(r,e,n,f),p=he(t,i,a,f),v=d-s,g=p-l;u+=Math.sqrt(v*v+g*g),s=d,l=p}return u}var X1=/cubic-bezier\(([0-9,\.e ]+)\)/;function Wc(r){var t=r&&X1.exec(r);if(t){var e=t[1].split(","),i=+We(e[0]),n=+We(e[1]),a=+We(e[2]),o=+We(e[3]);if(isNaN(i+n+a+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:Ps(0,i,a,1,l,s)&&Ht(0,n,o,1,s[0])}}}var Z1=(function(){function r(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Wt,this.ondestroy=t.ondestroy||Wt,this.onrestart=t.onrestart||Wt,t.easing&&this.setEasing(t.easing)}return r.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=e;return}var i=this._life,n=t-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(t){this.easing=t,this.easingFunc=tt(t)?t:Ia[t]||Wc(t)},r})(),py=(function(){function r(t){this.value=t}return r})(),q1=(function(){function r(){this._len=0}return r.prototype.insert=function(t){var e=new py(t);return this.insertEntry(e),e},r.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},r.prototype.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r})(),vo=(function(){function r(t){this._list=new q1,this._maxSize=10,this._map={},this._maxSize=t}return r.prototype.put=function(t,e){var i=this._list,n=this._map,a=null;if(n[t]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new py(e),s.key=t,i.insertEntry(s),n[t]=s}return a},r.prototype.get=function(t){var e=this._map[t],i=this._list;if(e!=null)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r})(),Fd={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ge(r){return r=Math.round(r),r<0?0:r>255?255:r}function K1(r){return r=Math.round(r),r<0?0:r>360?360:r}function Ha(r){return r<0?0:r>1?1:r}function Jl(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?Ge(parseFloat(t)/100*255):Ge(parseInt(t,10))}function Ei(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?Ha(parseFloat(t)/100):Ha(parseFloat(t))}function Ql(r,t,e){return e<0?e+=1:e>1&&(e-=1),e*6<1?r+(t-r)*e*6:e*2<1?t:e*3<2?r+(t-r)*(2/3-e)*6:r}function Br(r,t,e){return r+(t-r)*e}function Ce(r,t,e,i,n){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r}function Th(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}var vy=new vo(20),Ro=null;function nn(r,t){Ro&&Th(Ro,t),Ro=vy.put(r,Ro||t.slice())}function ge(r,t){if(r){t=t||[];var e=vy.get(r);if(e)return Th(t,e);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in Fd)return Th(t,Fd[i]),nn(r,t),t;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){Ce(t,0,0,0,1);return}return Ce(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),nn(r,t),t}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){Ce(t,0,0,0,1);return}return Ce(t,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),nn(r,t),t}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),h=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Ce(t,+u[0],+u[1],+u[2],1):Ce(t,0,0,0,1);h=Ei(u.pop());case"rgb":if(u.length>=3)return Ce(t,Jl(u[0]),Jl(u[1]),Jl(u[2]),u.length===3?h:Ei(u[3])),nn(r,t),t;Ce(t,0,0,0,1);return;case"hsla":if(u.length!==4){Ce(t,0,0,0,1);return}return u[3]=Ei(u[3]),Ah(u,t),nn(r,t),t;case"hsl":if(u.length!==3){Ce(t,0,0,0,1);return}return Ah(u,t),nn(r,t),t;default:return}}Ce(t,0,0,0,1)}}function Ah(r,t){var e=(parseFloat(r[0])%360+360)%360/360,i=Ei(r[1]),n=Ei(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return t=t||[],Ce(t,Ge(Ql(o,a,e+1/3)*255),Ge(Ql(o,a,e)*255),Ge(Ql(o,a,e-1/3)*255),1),r.length===4&&(t[3]=r[3]),t}function J1(r){if(r){var t=r[0]/255,e=r[1]/255,i=r[2]/255,n=Math.min(t,e,i),a=Math.max(t,e,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var h=((a-t)/6+o/2)/o,c=((a-e)/6+o/2)/o,f=((a-i)/6+o/2)/o;t===a?l=f-c:e===a?l=1/3+h-f:i===a&&(l=2/3+c-h),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return r[3]!=null&&d.push(r[3]),d}}function Ih(r,t){var e=ge(r);if(e){for(var i=0;i<3;i++)t<0?e[i]=e[i]*(1-t)|0:e[i]=(255-e[i])*t+e[i]|0,e[i]>255?e[i]=255:e[i]<0&&(e[i]=0);return Zi(e,e.length===4?"rgba":"rgb")}}function Q1(r){var t=ge(r);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function gy(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){e=e||[];var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=t[n],s=t[a],l=i-n;return e[0]=Ge(Br(o[0],s[0],l)),e[1]=Ge(Br(o[1],s[1],l)),e[2]=Ge(Br(o[2],s[2],l)),e[3]=Ha(Br(o[3],s[3],l)),e}}var tS=gy;function Gc(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=ge(t[n]),s=ge(t[a]),l=i-n,u=Zi([Ge(Br(o[0],s[0],l)),Ge(Br(o[1],s[1],l)),Ge(Br(o[2],s[2],l)),Ha(Br(o[3],s[3],l))],"rgba");return e?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}var eS=Gc;function rS(r,t,e,i){var n=ge(r);if(r)return n=J1(n),t!=null&&(n[0]=K1(t)),e!=null&&(n[1]=Ei(e)),i!=null&&(n[2]=Ei(i)),Zi(Ah(n),"rgba")}function iS(r,t){var e=ge(r);if(e&&t!=null)return e[3]=Ha(t),Zi(e,"rgba")}function Zi(r,t){if(!(!r||!r.length)){var e=r[0]+","+r[1]+","+r[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(e+=","+r[3]),t+"("+e+")"}}function Wa(r,t){var e=ge(r);return e?(.299*e[0]+.587*e[1]+.114*e[2])*e[3]/255+(1-e[3])*t:0}function nS(){return Zi([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var Bd=new vo(100);function Ls(r){if($(r)){var t=Bd.get(r);return t||(t=Ih(r,-.1),Bd.put(r,t)),t}else if(al(r)){var e=F({},r);return e.colorStops=H(r.colorStops,function(i){return{offset:i.offset,color:Ih(i.color,-.1)}}),e}return r}const aS=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:gy,fastMapToColor:tS,lerp:Gc,lift:Ih,liftColor:Ls,lum:Wa,mapToColor:eS,modifyAlpha:iS,modifyHSL:rS,parse:ge,random:nS,stringify:Zi,toHex:Q1},Symbol.toStringTag,{value:"Module"}));var Os=Math.round;function Ga(r){var t;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var e=ge(r);e&&(r="rgb("+e[0]+","+e[1]+","+e[2]+")",t=e[3])}return{color:r,opacity:t??1}}var zd=1e-4;function zr(r){return r<zd&&r>-zd}function Lo(r){return Os(r*1e3)/1e3}function Mh(r){return Os(r*1e4)/1e4}function oS(r){return"matrix("+Lo(r[0])+","+Lo(r[1])+","+Lo(r[2])+","+Lo(r[3])+","+Mh(r[4])+","+Mh(r[5])+")"}var sS={left:"start",right:"end",center:"middle",middle:"middle"};function lS(r,t,e){return e==="top"?r+=t/2:e==="bottom"&&(r-=t/2),r}function uS(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function hS(r){var t=r.style,e=r.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),e[0],e[1]].join(",")}function my(r){return r&&!!r.image}function cS(r){return r&&!!r.svgElement}function Uc(r){return my(r)||cS(r)}function yy(r){return r.type==="linear"}function _y(r){return r.type==="radial"}function by(r){return r&&(r.type==="linear"||r.type==="radial")}function sl(r){return"url(#"+r+")"}function xy(r){var t=r.getGlobalScale(),e=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(e)/Math.log(10)),1)}function wy(r){var t=r.x||0,e=r.y||0,i=(r.rotation||0)*Aa,n=Q(r.scaleX,1),a=Q(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(t||e)&&l.push("translate("+t+"px,"+e+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+Os(o*Aa)+"deg, "+Os(s*Aa)+"deg)"),l.join(" ")}var fS=(function(){return J.hasGlobalWindow&&tt(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}})(),Dh=Array.prototype.slice;function gr(r,t,e){return(t-r)*e+r}function tu(r,t,e,i){for(var n=t.length,a=0;a<n;a++)r[a]=gr(t[a],e[a],i);return r}function dS(r,t,e,i){for(var n=t.length,a=n&&t[0].length,o=0;o<n;o++){r[o]||(r[o]=[]);for(var s=0;s<a;s++)r[o][s]=gr(t[o][s],e[o][s],i)}return r}function Oo(r,t,e,i){for(var n=t.length,a=0;a<n;a++)r[a]=t[a]+e[a]*i;return r}function Vd(r,t,e,i){for(var n=t.length,a=n&&t[0].length,o=0;o<n;o++){r[o]||(r[o]=[]);for(var s=0;s<a;s++)r[o][s]=t[o][s]+e[o][s]*i}return r}function pS(r,t){for(var e=r.length,i=t.length,n=e>i?t:r,a=Math.min(e,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;s<Math.max(e,i);s++)n.push({offset:o.offset,color:o.color.slice()})}function vS(r,t,e){var i=r,n=t;if(!(!i.push||!n.push)){var a=i.length,o=n.length;if(a!==o){var s=a>o;if(s)i.length=o;else for(var l=a;l<o;l++)i.push(e===1?n[l]:Dh.call(n[l]))}for(var u=i[0]&&i[0].length,l=0;l<i.length;l++)if(e===1)isNaN(i[l])&&(i[l]=n[l]);else for(var h=0;h<u;h++)isNaN(i[l][h])&&(i[l][h]=n[l][h])}}function hs(r){if(ne(r)){var t=r.length;if(ne(r[0])){for(var e=[],i=0;i<t;i++)e.push(Dh.call(r[i]));return e}return Dh.call(r)}return r}function cs(r){return r[0]=Math.floor(r[0])||0,r[1]=Math.floor(r[1])||0,r[2]=Math.floor(r[2])||0,r[3]=r[3]==null?1:r[3],"rgba("+r.join(",")+")"}function gS(r){return ne(r&&r[0])?2:1}var Eo=0,fs=1,Sy=2,ya=3,Ph=4,kh=5,Hd=6;function Wd(r){return r===Ph||r===kh}function jo(r){return r===fs||r===Sy}var ea=[0,0,0,0],mS=(function(){function r(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return r.prototype.isFinished=function(){return this._finished},r.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},r.prototype.needsAnimate=function(){return this.keyframes.length>=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(t,e,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=Hd,l=e;if(ne(e)){var u=gS(e);s=u,(u===1&&!At(e[0])||u===2&&!At(e[0][0]))&&(o=!0)}else if(At(e)&&!Va(e))s=Eo;else if($(e))if(!isNaN(+e))s=Eo;else{var h=ge(e);h&&(l=h,s=ya)}else if(al(e)){var c=F({},l);c.colorStops=H(e.colorStops,function(d){return{offset:d.offset,color:ge(d.color)}}),yy(e)?s=Ph:_y(e)&&(s=kh),l=c}a===0?this.valType=s:(s!==this.valType||s===Hd)&&(o=!0),this.discrete=this.discrete||o;var f={time:t,value:l,rawValue:e,percent:0};return i&&(f.easing=i,f.easingFunc=tt(i)?i:Ia[i]||Wc(i)),n.push(f),f},r.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort(function(v,g){return v.time-g.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=jo(n),u=Wd(n),h=0;h<a;h++){var c=i[h],f=c.value,d=o.value;c.percent=c.time/t,s||(l&&h!==a-1?vS(f,d,n):u&&pS(f.colorStops,d.colorStops))}if(!s&&n!==kh&&e&&this.needsAnimate()&&e.needsAnimate()&&n===e.valType&&!e._finished){this._additiveTrack=e;for(var p=i[0].value,h=0;h<a;h++)n===Eo?i[h].additiveValue=i[h].value-p:n===ya?i[h].additiveValue=Oo([],i[h].value,p,-1):jo(n)&&(i[h].additiveValue=n===fs?Oo([],i[h].value,p,-1):Vd([],i[h].value,p,-1))}},r.prototype.step=function(t,e){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var i=this._additiveTrack!=null,n=i?"additiveValue":"value",a=this.valType,o=this.keyframes,s=o.length,l=this.propName,u=a===ya,h,c=this._lastFr,f=Math.min,d,p;if(s===1)d=p=o[0];else{if(e<0)h=0;else if(e<this._lastFrP){var v=f(c+1,s-1);for(h=v;h>=0&&!(o[h].percent<=e);h--);h=f(h,s-2)}else{for(h=c;h<s&&!(o[h].percent>e);h++);h=f(h-1,s-2)}p=o[h+1],d=o[h]}if(d&&p){this._lastFr=h,this._lastFrP=e;var g=p.percent-d.percent,m=g===0?1:f((e-d.percent)/g,1);p.easingFunc&&(m=p.easingFunc(m));var _=i?this._additiveValue:u?ea:t[l];if((jo(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[l]=m<1?d.rawValue:p.rawValue;else if(jo(a))a===fs?tu(_,d[n],p[n],m):dS(_,d[n],p[n],m);else if(Wd(a)){var b=d[n],x=p[n],C=a===Ph;t[l]={type:C?"linear":"radial",x:gr(b.x,x.x,m),y:gr(b.y,x.y,m),colorStops:H(b.colorStops,function(T,I){var M=x.colorStops[I];return{offset:gr(T.offset,M.offset,m),color:cs(tu([],T.color,M.color,m))}}),global:x.global},C?(t[l].x2=gr(b.x2,x.x2,m),t[l].y2=gr(b.y2,x.y2,m)):t[l].r=gr(b.r,x.r,m)}else if(u)tu(_,d[n],p[n],m),i||(t[l]=cs(_));else{var S=gr(d[n],p[n],m);i?this._additiveValue=S:t[l]=S}i&&this._addToTarget(t)}}},r.prototype._addToTarget=function(t){var e=this.valType,i=this.propName,n=this._additiveValue;e===Eo?t[i]=t[i]+n:e===ya?(ge(t[i],ea),Oo(ea,ea,n,1),t[i]=cs(ea)):e===fs?Oo(t[i],t[i],n,1):e===Sy&&Vd(t[i],t[i],n,1)},r})(),$c=(function(){function r(t,e,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&n){jc("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(t){this._target=t},r.prototype.when=function(t,e,i){return this.whenWithKeys(t,e,vt(e),i)},r.prototype.whenWithKeys=function(t,e,i,n){for(var a=this._tracks,o=0;o<i.length;o++){var s=i[o],l=a[s];if(!l){l=a[s]=new mS(s);var u=void 0,h=this._getAdditiveTrack(s);if(h){var c=h.keyframes,f=c[c.length-1];u=f&&f.value,h.valType===ya&&u&&(u=cs(u))}else u=this._target[s];if(u==null)continue;t>0&&l.addKeyframe(0,hs(u),n),this._trackKeys.push(s)}l.addKeyframe(t,hs(e[s]),n)}return this._maxTime=Math.max(this._maxTime,t),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,i=0;i<e;i++)t[i].call(this)},r.prototype._abortedCallback=function(){this._setTracksFinished();var t=this.animation,e=this._abortedCbs;if(t&&t.removeClip(this._clip),this._clip=null,e)for(var i=0;i<e.length;i++)e[i].call(this)},r.prototype._setTracksFinished=function(){for(var t=this._tracks,e=this._trackKeys,i=0;i<e.length;i++)t[e[i]].setFinished()},r.prototype._getAdditiveTrack=function(t){var e,i=this._additiveAnimators;if(i)for(var n=0;n<i.length;n++){var a=i[n].getTrack(t);a&&(e=a)}return e},r.prototype.start=function(t){if(!(this._started>0)){this._started=1;for(var e=this,i=[],n=this._maxTime||0,a=0;a<this._trackKeys.length;a++){var o=this._trackKeys[a],s=this._tracks[o],l=this._getAdditiveTrack(o),u=s.keyframes,h=u.length;if(s.prepare(n,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var c=u[h-1];c&&(e._target[s.propName]=c.rawValue),s.setFinished()}else i.push(s)}if(i.length||this._force){var f=new Z1({life:n,loop:this._loop,delay:this._delay||0,onframe:function(d){e._started=2;var p=e._additiveAnimators;if(p){for(var v=!1,g=0;g<p.length;g++)if(p[g]._clip){v=!0;break}v||(e._additiveAnimators=null)}for(var g=0;g<i.length;g++)i[g].step(e._target,d);var m=e._onframeCbs;if(m)for(var g=0;g<m.length;g++)m[g](e._target,d)},ondestroy:function(){e._doneCallback()}});this._clip=f,this.animation&&this.animation.addClip(f),t&&f.setEasing(t)}else this._doneCallback();return this}},r.prototype.stop=function(t){if(this._clip){var e=this._clip;t&&e.onframe(1),this._abortedCallback()}},r.prototype.delay=function(t){return this._delay=t,this},r.prototype.during=function(t){return t&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(t)),this},r.prototype.done=function(t){return t&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(t)),this},r.prototype.aborted=function(t){return t&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(t)),this},r.prototype.getClip=function(){return this._clip},r.prototype.getTrack=function(t){return this._tracks[t]},r.prototype.getTracks=function(){var t=this;return H(this._trackKeys,function(e){return t._tracks[e]})},r.prototype.stopTracks=function(t,e){if(!t.length||!this._clip)return!0;for(var i=this._tracks,n=this._trackKeys,a=0;a<t.length;a++){var o=i[t[a]];o&&!o.isFinished()&&(e?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,a=0;a<n.length;a++)if(!i[n[a]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},r.prototype.saveTo=function(t,e,i){if(t){e=e||this._trackKeys;for(var n=0;n<e.length;n++){var a=e[n],o=this._tracks[a];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[i?0:s.length-1];l&&(t[a]=hs(l.rawValue))}}}},r.prototype.__changeFinalValue=function(t,e){e=e||vt(t);for(var i=0;i<e.length;i++){var n=e[i],a=this._tracks[n];if(a){var o=a.keyframes;if(o.length>1){var s=o.pop();a.addKeyframe(s.time,t[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r})();function Cn(){return new Date().getTime()}var yS=(function(r){B(t,r);function t(e){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,e=e||{},i.stage=e.stage||{},i}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var i=e.getClip();i&&this.addClip(i)},t.prototype.removeClip=function(e){if(e.animation){var i=e.prev,n=e.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var i=e.getClip();i&&this.removeClip(i),e.animation=null},t.prototype.update=function(e){for(var i=Cn()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function i(){e._running&&(Ch(i),!e._paused&&e.update())}Ch(i)},t.prototype.start=function(){this._running||(this._time=Cn(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Cn(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Cn()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var i=e.next;e.prev=e.next=e.animation=null,e=i}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,i){i=i||{},this.start();var n=new $c(e,i.loop);return this.addAnimator(n),n},t})(hr),_S=300,eu=J.domSupported,ru=(function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],e={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=H(r,function(n){var a=n.replace("mouse","pointer");return e.hasOwnProperty(a)?a:n});return{mouse:r,touch:t,pointer:i}})(),Gd={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Ud=!1;function Rh(r){var t=r.pointerType;return t==="pen"||t==="touch"}function bS(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function iu(r){r&&(r.zrByTouch=!0)}function xS(r,t){return Te(r.dom,new wS(r,t),!0)}function Cy(r,t){for(var e=t,i=!1;e&&e.nodeType!==9&&!(i=e.domBelongToZr||e!==t&&e===r.painterRoot);)e=e.parentNode;return i}var wS=(function(){function r(t,e){this.stopPropagation=Wt,this.stopImmediatePropagation=Wt,this.preventDefault=Wt,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return r})(),ze={mousedown:function(r){r=Te(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=Te(this.dom,r);var t=this.__mayPointerCapture;t&&(r.zrX!==t[0]||r.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=Te(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=Te(this.dom,r);var t=r.toElement||r.relatedTarget;Cy(this,t)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){Ud=!0,r=Te(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){Ud||(r=Te(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=Te(this.dom,r),iu(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),ze.mousemove.call(this,r),ze.mousedown.call(this,r)},touchmove:function(r){r=Te(this.dom,r),iu(r),this.handler.processGesture(r,"change"),ze.mousemove.call(this,r)},touchend:function(r){r=Te(this.dom,r),iu(r),this.handler.processGesture(r,"end"),ze.mouseup.call(this,r),+new Date-+this.__lastTouchMoment<_S&&ze.click.call(this,r)},pointerdown:function(r){ze.mousedown.call(this,r)},pointermove:function(r){Rh(r)||ze.mousemove.call(this,r)},pointerup:function(r){ze.mouseup.call(this,r)},pointerout:function(r){Rh(r)||ze.mouseout.call(this,r)}};A(["click","dblclick","contextmenu"],function(r){ze[r]=function(t){t=Te(this.dom,t),this.trigger(r,t)}});var Lh={pointermove:function(r){Rh(r)||Lh.mousemove.call(this,r)},pointerup:function(r){Lh.mouseup.call(this,r)},mousemove:function(r){this.trigger("mousemove",r)},mouseup:function(r){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",r),t&&(r.zrEventControl="only_globalout",this.trigger("mouseout",r))}};function SS(r,t){var e=t.domHandlers;J.pointerEventsSupported?A(ru.pointer,function(i){ds(t,i,function(n){e[i].call(r,n)})}):(J.touchEventsSupported&&A(ru.touch,function(i){ds(t,i,function(n){e[i].call(r,n),bS(t)})}),A(ru.mouse,function(i){ds(t,i,function(n){n=Vc(n),t.touching||e[i].call(r,n)})}))}function CS(r,t){J.pointerEventsSupported?A(Gd.pointer,e):J.touchEventsSupported||A(Gd.mouse,e);function e(i){function n(a){a=Vc(a),Cy(r,a.target)||(a=xS(r,a),t.domHandlers[i].call(r,a))}ds(t,i,n,{capture:!0})}}function ds(r,t,e,i){r.mounted[t]=e,r.listenerOpts[t]=i,Sh(r.domTarget,t,e,i)}function nu(r){var t=r.mounted;for(var e in t)t.hasOwnProperty(e)&&D1(r.domTarget,e,t[e],r.listenerOpts[e]);r.mounted={}}var $d=(function(){function r(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e}return r})(),TS=(function(r){B(t,r);function t(e,i){var n=r.call(this)||this;return n.__pointerCapturing=!1,n.dom=e,n.painterRoot=i,n._localHandlerScope=new $d(e,ze),eu&&(n._globalHandlerScope=new $d(document,Lh)),SS(n,n._localHandlerScope),n}return t.prototype.dispose=function(){nu(this._localHandlerScope),eu&&nu(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,eu&&+this.__pointerCapturing^+e){this.__pointerCapturing=e;var i=this._globalHandlerScope;e?CS(this,i):nu(i)}},t})(hr),Ty=1;J.hasGlobalWindow&&(Ty=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Yd=Ty,Oh=.4,Eh="#333",jh="#ccc",AS="#eee",Xd=co,Zd=5e-5;function ui(r){return r>Zd||r<-Zd}var hi=[],an=[],au=_r(),ou=Math.abs,Yc=(function(){function r(){}return r.prototype.getLocalTransform=function(t){return r.getLocalTransform(this,t)},r.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},r.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},r.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},r.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},r.prototype.needLocalTransform=function(){return ui(this.rotation)||ui(this.x)||ui(this.y)||ui(this.scaleX-1)||ui(this.scaleY-1)||ui(this.skewX)||ui(this.skewY)},r.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;if(!(e||t)){i&&(Xd(i),this.invTransform=null);return}i=i||_r(),e?this.getLocalTransform(i):Xd(i),t&&(e?Gr(i,t,i):Hc(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(e!=null&&e!==1){this.getGlobalScale(hi);var i=hi[0]<0?-1:1,n=hi[1]<0?-1:1,a=((hi[0]-i)*e+i)/hi[0]||0,o=((hi[1]-n)*e+n)/hi[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||_r(),po(this.invTransform,t)},r.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},r.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=Math.atan2(t[1],t[0]),a=Math.PI/2+n-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(a),e=Math.sqrt(e),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||_r(),Gr(an,t.invTransform,e),e=an);var i=this.originX,n=this.originY;(i||n)&&(au[4]=i,au[5]=n,Gr(an,e,au),an[4]-=i,an[5]-=n,e=an),this.setLocalTransform(e)}},r.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},r.prototype.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&re(i,i,n),i},r.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&re(i,i,n),i},r.prototype.getLineScale=function(){var t=this.transform;return t&&ou(t[0]-1)>1e-10&&ou(t[3]-1)>1e-10?Math.sqrt(ou(t[0]*t[3]-t[2]*t[1])):1},r.prototype.copyTransform=function(t){Ay(this,t)},r.getLocalTransform=function(t,e){e=e||[];var i=t.originX||0,n=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,h=t.x,c=t.y,f=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(i||n||s||l){var p=i+s,v=n+l;e[4]=-p*a-f*v*o,e[5]=-v*o-d*p*a}else e[4]=e[5]=0;return e[0]=a,e[3]=o,e[1]=d*a,e[2]=f*o,u&&fo(e,e,u),e[4]+=i+h,e[5]+=n+c,e},r.initDefaultProps=(function(){var t=r.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),r})(),Ua=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Ay(r,t){for(var e=0;e<Ua.length;e++){var i=Ua[e];r[i]=t[i]}}var qd={};function me(r,t){t=t||Xr;var e=qd[t];e||(e=qd[t]=new vo(500));var i=e.get(r);return i==null&&(i=Zr.measureText(r,t).width,e.put(r,i)),i}function Kd(r,t,e,i){var n=me(r,t),a=ul(t),o=_a(0,n,e),s=xn(0,a,i),l=new mt(o,s,n,a);return l}function ll(r,t,e,i){var n=((r||"")+"").split(`
|
|
16
|
+
`),a=n.length;if(a===1)return Kd(n[0],t,e,i);for(var o=new mt(0,0,0,0),s=0;s<n.length;s++){var l=Kd(n[s],t,e,i);s===0?o.copy(l):o.union(l)}return o}function _a(r,t,e){return e==="right"?r-=t:e==="center"&&(r-=t/2),r}function xn(r,t,e){return e==="middle"?r-=t/2:e==="bottom"&&(r-=t),r}function ul(r){return me("国",r)}function qr(r,t){return typeof r=="string"?r.lastIndexOf("%")>=0?parseFloat(r)/100*t:parseFloat(r):r}function Iy(r,t,e){var i=t.position||"inside",n=t.distance!=null?t.distance:5,a=e.height,o=e.width,s=a/2,l=e.x,u=e.y,h="left",c="top";if(i instanceof Array)l+=qr(i[0],e.width),u+=qr(i[1],e.height),h=null,c=null;else switch(i){case"left":l-=n,u+=s,h="right",c="middle";break;case"right":l+=n+o,u+=s,c="middle";break;case"top":l+=o/2,u-=n,h="center",c="bottom";break;case"bottom":l+=o/2,u+=a+n,h="center";break;case"inside":l+=o/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=n,u+=s,c="middle";break;case"insideRight":l+=o-n,u+=s,h="right",c="middle";break;case"insideTop":l+=o/2,u+=n,h="center";break;case"insideBottom":l+=o/2,u+=a-n,h="center",c="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,h="right";break;case"insideBottomLeft":l+=n,u+=a-n,c="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,h="right",c="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=h,r.verticalAlign=c,r}var su="__zr_normal__",lu=Ua.concat(["ignore"]),IS=lr(Ua,function(r,t){return r[t]=!0,r},{ignore:!1}),on={},MS=new mt(0,0,0,0),hl=(function(){function r(t){this.id=Ec(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return r.prototype._init=function(t){this.attr(t)},r.prototype.drift=function(t,e,i){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=e.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(e),i.position!=null){var h=MS;i.layoutRect?h.copy(i.layoutRect):h.copy(this.getBoundingRect()),n||h.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(on,i,h):Iy(on,i,h),a.x=on.x,a.y=on.y,o=on.align,s=on.verticalAlign;var c=i.origin;if(c&&i.rotation!=null){var f=void 0,d=void 0;c==="center"?(f=h.width*.5,d=h.height*.5):(f=qr(c[0],h.width),d=qr(c[1],h.height)),u=!0,a.originX=-a.x+f+(n?0:h.x),a.originY=-a.y+d+(n?0:h.y)}}i.rotation!=null&&(a.rotation=i.rotation);var p=i.offset;p&&(a.x+=p[0],a.y+=p[1],u||(a.originX=-p[0],a.originY=-p[1]));var v=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,_=void 0,b=void 0;v&&this.canBeInsideText()?(m=i.insideFill,_=i.insideStroke,(m==null||m==="auto")&&(m=this.getInsideTextFill()),(_==null||_==="auto")&&(_=this.getInsideTextStroke(m),b=!0)):(m=i.outsideFill,_=i.outsideStroke,(m==null||m==="auto")&&(m=this.getOutsideFill()),(_==null||_==="auto")&&(_=this.getOutsideStroke(m),b=!0)),m=m||"#000",(m!==g.fill||_!==g.stroke||b!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=m,g.stroke=_,g.autoStroke=b,g.align=o,g.verticalAlign=s,e.setDefaultTextStyle(g)),e.__dirty|=ir,l&&e.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(t){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?jh:Eh},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&ge(e);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,Zi(i,"rgba")},r.prototype.traverse=function(t,e){},r.prototype.attrKV=function(t,e){t==="textConfig"?this.setTextConfig(e):t==="textContent"?this.setTextContent(e):t==="clipPath"?this.setClipPath(e):t==="extra"?(this.extra=this.extra||{},F(this.extra,e)):this[t]=e},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(t,e){if(typeof t=="string")this.attrKV(t,e);else if(q(t))for(var i=t,n=vt(i),a=0;a<n.length;a++){var o=n[a];this.attrKV(o,t[o])}return this.markRedraw(),this},r.prototype.saveCurrentToNormalState=function(t){this._innerSaveToNormal(t);for(var e=this._normalState,i=0;i<this.animators.length;i++){var n=this.animators[i],a=n.__fromStateTransition;if(!(n.getLoop()||a&&a!==su)){var o=n.targetName,s=o?e[o]:e;n.saveTo(s)}}},r.prototype._innerSaveToNormal=function(t){var e=this._normalState;e||(e=this._normalState={}),t.textConfig&&!e.textConfig&&(e.textConfig=this.textConfig),this._savePrimaryToNormal(t,e,lu)},r.prototype._savePrimaryToNormal=function(t,e,i){for(var n=0;n<i.length;n++){var a=i[n];t[a]!=null&&!(a in e)&&(e[a]=this[a])}},r.prototype.hasState=function(){return this.currentStates.length>0},r.prototype.getState=function(t){return this.states[t]},r.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},r.prototype.clearStates=function(t){this.useState(su,!1,t)},r.prototype.useState=function(t,e,i,n){var a=t===su,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(pt(s,t)>=0&&(e||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){jc("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!i&&!this.__inHover&&l&&l.duration>0,l);var c=this._textContent,f=this._textGuide;return c&&c.useState(t,e,i,h),f&&f.useState(t,e,i,h),a?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ir),u}}},r.prototype.useStates=function(t,e,i){if(!t.length)this.clearStates();else{var n=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l<o;l++)if(t[l]!==a[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var u=t[l],h=void 0;this.stateProxy&&(h=this.stateProxy(u,t)),h||(h=this.states[u]),h&&n.push(h)}var c=n[o-1],f=!!(c&&c.hoverLayer||i);f&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(n),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(t.join(","),d,this._normalState,!1,!e&&!this.__inHover&&p&&p.duration>0,p);var v=this._textContent,g=this._textGuide;v&&v.useStates(t,e,f),g&&g.useStates(t,e,f),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ir)}},r.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},r.prototype._updateAnimationTargets=function(){for(var t=0;t<this.animators.length;t++){var e=this.animators[t];e.targetName&&e.changeTarget(this[e.targetName])}},r.prototype.removeState=function(t){var e=pt(this.currentStates,t);if(e>=0){var i=this.currentStates.slice();i.splice(e,1),this.useStates(i)}},r.prototype.replaceState=function(t,e,i){var n=this.currentStates.slice(),a=pt(n,t),o=pt(n,e)>=0;a>=0?o?n.splice(a,1):n[a]=e:i&&!o&&n.push(e),this.useStates(n)},r.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},r.prototype._mergeStates=function(t){for(var e={},i,n=0;n<t.length;n++){var a=t[n];F(e,a),a.textConfig&&(i=i||{},F(i,a.textConfig))}return i&&(e.textConfig=i),e},r.prototype._applyStateObj=function(t,e,i,n,a,o){var s=!(e&&n);e&&e.textConfig?(this.textConfig=F({},n?this.textConfig:i.textConfig),F(this.textConfig,e.textConfig)):s&&i.textConfig&&(this.textConfig=i.textConfig);for(var l={},u=!1,h=0;h<lu.length;h++){var c=lu[h],f=a&&IS[c];e&&e[c]!=null?f?(u=!0,l[c]=e[c]):this[c]=e[c]:s&&i[c]!=null&&(f?(u=!0,l[c]=i[c]):this[c]=i[c])}if(!a)for(var h=0;h<this.animators.length;h++){var d=this.animators[h],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(e||i)[p]:e||i)}u&&this._transitionState(t,l,o)},r.prototype._attachComponent=function(t){if(!(t.__zr&&!t.__hostTarget)&&t!==this){var e=this.__zr;e&&t.addSelfToZr(e),t.__zr=e,t.__hostTarget=this}},r.prototype._detachComponent=function(t){t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__hostTarget=null},r.prototype.getClipPath=function(){return this._clipPath},r.prototype.setClipPath=function(t){this._clipPath&&this._clipPath!==t&&this.removeClipPath(),this._attachComponent(t),this._clipPath=t,this.markRedraw()},r.prototype.removeClipPath=function(){var t=this._clipPath;t&&(this._detachComponent(t),this._clipPath=null,this.markRedraw())},r.prototype.getTextContent=function(){return this._textContent},r.prototype.setTextContent=function(t){var e=this._textContent;e!==t&&(e&&e!==t&&this.removeTextContent(),t.innerTransformable=new Yc,this._attachComponent(t),this._textContent=t,this.markRedraw())},r.prototype.setTextConfig=function(t){this.textConfig||(this.textConfig={}),F(this.textConfig,t),this.markRedraw()},r.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},r.prototype.removeTextContent=function(){var t=this._textContent;t&&(t.innerTransformable=null,this._detachComponent(t),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},r.prototype.getTextGuideLine=function(){return this._textGuide},r.prototype.setTextGuideLine=function(t){this._textGuide&&this._textGuide!==t&&this.removeTextGuideLine(),this._attachComponent(t),this._textGuide=t,this.markRedraw()},r.prototype.removeTextGuideLine=function(){var t=this._textGuide;t&&(this._detachComponent(t),this._textGuide=null,this.markRedraw())},r.prototype.markRedraw=function(){this.__dirty|=ir;var t=this.__zr;t&&(this.__inHover?t.refreshHover():t.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},r.prototype.dirty=function(){this.markRedraw()},r.prototype._toggleHoverLayerFlag=function(t){this.__inHover=t;var e=this._textContent,i=this._textGuide;e&&(e.__inHover=t),i&&(i.__inHover=t)},r.prototype.addSelfToZr=function(t){if(this.__zr!==t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.addAnimator(e[i]);this._clipPath&&this._clipPath.addSelfToZr(t),this._textContent&&this._textContent.addSelfToZr(t),this._textGuide&&this._textGuide.addSelfToZr(t)}},r.prototype.removeSelfFromZr=function(t){if(this.__zr){this.__zr=null;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.removeAnimator(e[i]);this._clipPath&&this._clipPath.removeSelfFromZr(t),this._textContent&&this._textContent.removeSelfFromZr(t),this._textGuide&&this._textGuide.removeSelfFromZr(t)}},r.prototype.animate=function(t,e,i){var n=t?this[t]:this,a=new $c(n,e,i);return t&&(a.targetName=t),this.addAnimator(a,t),a},r.prototype.addAnimator=function(t,e){var i=this.__zr,n=this;t.during(function(){n.updateDuringAnimation(e)}).done(function(){var a=n.animators,o=pt(a,t);o>=0&&a.splice(o,1)}),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(t){this.markRedraw()},r.prototype.stopAnimation=function(t,e){for(var i=this.animators,n=i.length,a=[],o=0;o<n;o++){var s=i[o];!t||t===s.scope?s.stop(e):a.push(s)}return this.animators=a,this},r.prototype.animateTo=function(t,e,i){uu(this,t,e,i)},r.prototype.animateFrom=function(t,e,i){uu(this,t,e,i,!0)},r.prototype._transitionState=function(t,e,i,n){for(var a=uu(this,e,i,n),o=0;o<a.length;o++)a[o].__fromStateTransition=t},r.prototype.getBoundingRect=function(){return null},r.prototype.getPaintRect=function(){return null},r.initDefaultProps=(function(){var t=r.prototype;t.type="element",t.name="",t.ignore=t.silent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=t.__inHover=!1,t.__dirty=ir;function e(i,n,a,o){Object.defineProperty(t,i,{get:function(){if(!this[n]){var l=this[n]=[];s(this,l)}return this[n]},set:function(l){this[a]=l[0],this[o]=l[1],this[n]=l,s(this,l)}});function s(l,u){Object.defineProperty(u,0,{get:function(){return l[a]},set:function(h){l[a]=h}}),Object.defineProperty(u,1,{get:function(){return l[o]},set:function(h){l[o]=h}})}}Object.defineProperty&&(e("position","_legacyPos","x","y"),e("scale","_legacyScale","scaleX","scaleY"),e("origin","_legacyOrigin","originX","originY"))})(),r})();be(hl,hr);be(hl,Yc);function uu(r,t,e,i,n){e=e||{};var a=[];My(r,"",r,t,e,i,a,n);var o=a.length,s=!1,l=e.done,u=e.aborted,h=function(){s=!0,o--,o<=0&&(s?l&&l():u&&u())},c=function(){o--,o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&e.during&&a[0].during(function(p,v){e.during(v)});for(var f=0;f<a.length;f++){var d=a[f];h&&d.done(h),c&&d.aborted(c),e.force&&d.duration(e.duration),d.start(e.easing)}return a}function hu(r,t,e){for(var i=0;i<e;i++)r[i]=t[i]}function DS(r){return ne(r[0])}function PS(r,t,e){if(ne(t[e]))if(ne(r[e])||(r[e]=[]),ae(t[e])){var i=t[e].length;r[e].length!==i&&(r[e]=new t[e].constructor(i),hu(r[e],t[e],i))}else{var n=t[e],a=r[e],o=n.length;if(DS(n))for(var s=n[0].length,l=0;l<o;l++)a[l]?hu(a[l],n[l],s):a[l]=Array.prototype.slice.call(n[l]);else hu(a,n,o);a.length=n.length}else r[e]=t[e]}function kS(r,t){return r===t||ne(r)&&ne(t)&&RS(r,t)}function RS(r,t){var e=r.length;if(e!==t.length)return!1;for(var i=0;i<e;i++)if(r[i]!==t[i])return!1;return!0}function My(r,t,e,i,n,a,o,s){for(var l=vt(i),u=n.duration,h=n.delay,c=n.additive,f=n.setToFinal,d=!q(a),p=r.animators,v=[],g=0;g<l.length;g++){var m=l[g],_=i[m];if(_!=null&&e[m]!=null&&(d||a[m]))if(q(_)&&!ne(_)&&!al(_)){if(t){s||(e[m]=_,r.updateDuringAnimation(t));continue}My(r,m,e[m],_,n,a&&a[m],o,s)}else v.push(m);else s||(e[m]=_,r.updateDuringAnimation(t),v.push(m))}var b=v.length;if(!c&&b)for(var x=0;x<p.length;x++){var C=p[x];if(C.targetName===t){var S=C.stopTracks(v);if(S){var T=pt(p,C);p.splice(T,1)}}}if(n.force||(v=Dt(v,function(P){return!kS(i[P],e[P])}),b=v.length),b>0||n.force&&!o.length){var I=void 0,M=void 0,D=void 0;if(s){M={},f&&(I={});for(var x=0;x<b;x++){var m=v[x];M[m]=e[m],f?I[m]=i[m]:e[m]=i[m]}}else if(f){D={};for(var x=0;x<b;x++){var m=v[x];D[m]=hs(e[m]),PS(e,i,m)}}var C=new $c(e,!1,!1,c?Dt(p,function(k){return k.targetName===t}):null);C.targetName=t,n.scope&&(C.scope=n.scope),f&&I&&C.whenWithKeys(0,I,v),D&&C.whenWithKeys(0,D,v),C.whenWithKeys(u??500,s?M:i,v).delay(h||0),r.addAnimator(C,t),o.push(C)}}var Ft=(function(r){B(t,r);function t(e){var i=r.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var i=this._children,n=0;n<i.length;n++)if(i[n].name===e)return i[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},t.prototype.addBefore=function(e,i){if(e&&e!==this&&e.parent!==this&&i&&i.parent===this){var n=this._children,a=n.indexOf(i);a>=0&&(n.splice(a,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,i){var n=pt(this._children,e);return n>=0&&this.replaceAt(i,n),this},t.prototype.replaceAt=function(e,i){var n=this._children,a=n[i];if(e&&e!==this&&e.parent!==this&&e!==a){n[i]=e,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var i=this.__zr;i&&i!==e.__zr&&e.addSelfToZr(i),i&&i.refresh()},t.prototype.remove=function(e){var i=this.__zr,n=this._children,a=pt(n,e);return a<0?this:(n.splice(a,1),e.parent=null,i&&e.removeSelfFromZr(i),i&&i.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,i=this.__zr,n=0;n<e.length;n++){var a=e[n];i&&a.removeSelfFromZr(i),a.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,i){for(var n=this._children,a=0;a<n.length;a++){var o=n[a];e.call(i,o,a)}return this},t.prototype.traverse=function(e,i){for(var n=0;n<this._children.length;n++){var a=this._children[n],o=e.call(i,a);a.isGroup&&!o&&a.traverse(e,i)}return this},t.prototype.addSelfToZr=function(e){r.prototype.addSelfToZr.call(this,e);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.addSelfToZr(e)}},t.prototype.removeSelfFromZr=function(e){r.prototype.removeSelfFromZr.call(this,e);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.removeSelfFromZr(e)}},t.prototype.getBoundingRect=function(e){for(var i=new mt(0,0,0,0),n=e||this._children,a=[],o=null,s=0;s<n.length;s++){var l=n[s];if(!(l.ignore||l.invisible)){var u=l.getBoundingRect(),h=l.getLocalTransform(a);h?(mt.applyTransform(i,u,h),o=o||i.clone(),o.union(i)):(o=o||u.clone(),o.union(u))}}return o||i},t})(hl);Ft.prototype.type="group";/*!
|
|
17
|
+
* ZRender, a high performance 2d drawing library.
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) 2013, Baidu Inc.
|
|
20
|
+
* All rights reserved.
|
|
21
|
+
*
|
|
22
|
+
* LICENSE
|
|
23
|
+
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
|
24
|
+
*/var ps={},ki={};function LS(r){delete ki[r]}function OS(r){if(!r)return!1;if(typeof r=="string")return Wa(r,1)<Oh;if(r.colorStops){for(var t=r.colorStops,e=0,i=t.length,n=0;n<i;n++)e+=Wa(t[n].color,1);return e/=i,e<Oh}return!1}var ES=(function(){function r(t,e,i){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=e,this.id=t;var a=new H1,o=i.renderer||"canvas";ps[o]||(o=vt(ps)[0]),i.useDirtyRect=i.useDirtyRect==null?!1:i.useDirtyRect;var s=new ps[o](e,a,i,t),l=i.ssr||s.ssrOnly;this.storage=a,this.painter=s;var u=!J.node&&!J.worker&&!l?new TS(s.getViewportRoot(),s.root):null,h=i.useCoarsePointer,c=h==null||h==="auto"?J.touchEventsSupported:!!h,f=44,d;c&&(d=Q(i.pointerSize,f)),this.handler=new sy(a,s,u,s.root,d),this.animation=new yS({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return r.prototype.add=function(t){this._disposed||!t||(this.storage.addRoot(t),t.addSelfToZr(this),this.refresh())},r.prototype.remove=function(t){this._disposed||!t||(this.storage.delRoot(t),t.removeSelfFromZr(this),this.refresh())},r.prototype.configLayer=function(t,e){this._disposed||(this.painter.configLayer&&this.painter.configLayer(t,e),this.refresh())},r.prototype.setBackgroundColor=function(t){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this.refresh(),this._backgroundColor=t,this._darkMode=OS(t))},r.prototype.getBackgroundColor=function(){return this._backgroundColor},r.prototype.setDarkMode=function(t){this._darkMode=t},r.prototype.isDarkMode=function(){return this._darkMode},r.prototype.refreshImmediately=function(t){this._disposed||(t||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},r.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},r.prototype.flush=function(){this._disposed||this._flush(!1)},r.prototype._flush=function(t){var e,i=Cn();this._needsRefresh&&(e=!0,this.refreshImmediately(t)),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately());var n=Cn();e?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-i})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},r.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},r.prototype.on=function(t,e,i){return this._disposed||this.handler.on(t,e,i),this},r.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},r.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},r.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e<t.length;e++)t[e]instanceof Ft&&t[e].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},r.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,LS(this.id))},r})();function Nh(r,t){var e=new ES(Ec(),r,t);return ki[e.id]=e,e}function jS(r){r.dispose()}function NS(){for(var r in ki)ki.hasOwnProperty(r)&&ki[r].dispose();ki={}}function FS(r){return ki[r]}function Dy(r,t){ps[r]=t}var Fh;function Py(r){if(typeof Fh=="function")return Fh(r)}function ky(r){Fh=r}var BS="5.6.1";const zS=Object.freeze(Object.defineProperty({__proto__:null,dispose:jS,disposeAll:NS,getElementSSRData:Py,getInstance:FS,init:Nh,registerPainter:Dy,registerSSRDataGetter:ky,version:BS},Symbol.toStringTag,{value:"Module"}));var Jd=1e-4,Ry=20;function VS(r){return r.replace(/^\s+|\s+$/g,"")}function Er(r,t,e,i){var n=t[0],a=t[1],o=e[0],s=e[1],l=a-n,u=s-o;if(l===0)return u===0?o:(o+s)/2;if(i)if(l>0){if(r<=n)return o;if(r>=a)return s}else{if(r>=n)return o;if(r<=a)return s}else{if(r===n)return o;if(r===a)return s}return(r-n)/l*u+o}function te(r,t){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return $(r)?VS(r).match(/%$/)?parseFloat(r)/100*t:parseFloat(r):r==null?NaN:+r}function Pt(r,t,e){return t==null&&(t=10),t=Math.min(Math.max(0,t),Ry),r=(+r).toFixed(t),e?r:+r}function Xc(r){return r.sort(function(t,e){return t-e}),r}function ar(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var t=1,e=0;e<15;e++,t*=10)if(Math.round(r*t)/t===r)return e}return Ly(r)}function Ly(r){var t=r.toString().toLowerCase(),e=t.indexOf("e"),i=e>0?+t.slice(e+1):0,n=e>0?e:t.length,a=t.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function Zc(r,t){var e=Math.log,i=Math.LN10,n=Math.floor(e(r[1]-r[0])/i),a=Math.round(e(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function HS(r,t,e){if(!r[t])return 0;var i=WS(r,e);return i[t]||0}function WS(r,t){var e=lr(r,function(d,p){return d+(isNaN(p)?0:p)},0);if(e===0)return[];for(var i=Math.pow(10,t),n=H(r,function(d){return(isNaN(d)?0:d)/e*i*100}),a=i*100,o=H(n,function(d){return Math.floor(d)}),s=lr(o,function(d,p){return d+p},0),l=H(n,function(d,p){return d-o[p]});s<a;){for(var u=Number.NEGATIVE_INFINITY,h=null,c=0,f=l.length;c<f;++c)l[c]>u&&(u=l[c],h=c);++o[h],l[h]=0,++s}return H(o,function(d){return d/i})}function GS(r,t){var e=Math.max(ar(r),ar(t)),i=r+t;return e>Ry?i:Pt(i,e)}var US=9007199254740991;function qc(r){var t=Math.PI*2;return(r%t+t)%t}function $a(r){return r>-Jd&&r<Jd}var $S=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Re(r){if(r instanceof Date)return r;if($(r)){var t=$S.exec(r);if(!t)return new Date(NaN);if(t[8]){var e=+t[4]||0;return t[8].toUpperCase()!=="Z"&&(e-=+t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,e,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}else return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0)}else if(r==null)return new Date(NaN);return new Date(Math.round(r))}function Oy(r){return Math.pow(10,cl(r))}function cl(r){if(r===0)return 0;var t=Math.floor(Math.log(r)/Math.LN10);return r/Math.pow(10,t)>=10&&t++,t}function Kc(r,t){var e=cl(r),i=Math.pow(10,e),n=r/i,a;return t?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,r=a*i,e>=-20?+r.toFixed(e<0?-e:0):r}function YS(r,t){var e=(r.length-1)*t+1,i=Math.floor(e),n=+r[i-1],a=e-i;return a?n+a*(r[i]-n):n}function XS(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var t=-1/0,e=1,i=0;i<r.length;){for(var n=r[i].interval,a=r[i].close,o=0;o<2;o++)n[o]<=t&&(n[o]=t,a[o]=o?1:1-e),t=n[o],e=a[o];n[0]===n[1]&&a[0]*a[1]!==1?r.splice(i,1):i++}return r;function s(l,u,h){return l.interval[h]<u.interval[h]||l.interval[h]===u.interval[h]&&(l.close[h]-u.close[h]===(h?-1:1)||!h&&s(l,u,1))}}function Ya(r){var t=parseFloat(r);return t==r&&(t!==0||!$(r)||r.indexOf("x")<=0)?t:NaN}function Ey(r){return!isNaN(Ya(r))}function jy(){return Math.round(Math.random()*9)}function Ny(r,t){return t===0?r:Ny(t,r%t)}function Qd(r,t){return r==null?t:t==null?r:r*t/Ny(r,t)}function ce(r){throw new Error(r)}function tp(r,t,e){return(t-r)*e+r}var Fy="series\0",By="\0_ec_\0";function ie(r){return r instanceof Array?r:r==null?[]:[r]}function ep(r,t,e){if(r){r[t]=r[t]||{},r.emphasis=r.emphasis||{},r.emphasis[t]=r.emphasis[t]||{};for(var i=0,n=e.length;i<n;i++){var a=e[i];!r.emphasis[t].hasOwnProperty(a)&&r[t].hasOwnProperty(a)&&(r.emphasis[t][a]=r[t][a])}}}var rp=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Un(r){return q(r)&&!G(r)&&!(r instanceof Date)?r.value:r}function ZS(r){return q(r)&&!(r instanceof Array)}function qS(r,t,e){var i=e==="normalMerge",n=e==="replaceMerge",a=e==="replaceAll";r=r||[],t=(t||[]).slice();var o=nt();A(t,function(l,u){if(!q(l)){t[u]=null;return}});var s=KS(r,o,e);return(i||n)&&JS(s,r,o,t),i&&QS(s,t),i||n?tC(s,t,n):a&&eC(s,t),rC(s),s}function KS(r,t,e){var i=[];if(e==="replaceAll")return i;for(var n=0;n<r.length;n++){var a=r[n];a&&a.id!=null&&t.set(a.id,n),i.push({existing:e==="replaceMerge"||Xa(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return i}function JS(r,t,e,i){A(i,function(n,a){if(!(!n||n.id==null)){var o=Ma(n.id),s=e.get(o);if(s!=null){var l=r[s];_e(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=n,l.existing=t[s],i[a]=null}}})}function QS(r,t){A(t,function(e,i){if(!(!e||e.name==null))for(var n=0;n<r.length;n++){var a=r[n].existing;if(!r[n].newOption&&a&&(a.id==null||e.id==null)&&!Xa(e)&&!Xa(a)&&zy("name",a,e)){r[n].newOption=e,t[i]=null;return}}})}function tC(r,t,e){A(t,function(i){if(i){for(var n,a=0;(n=r[a])&&(n.newOption||Xa(n.existing)||n.existing&&i.id!=null&&!zy("id",i,n.existing));)a++;n?(n.newOption=i,n.brandNew=e):r.push({newOption:i,brandNew:e,existing:null,keyInfo:null}),a++}})}function eC(r,t){A(t,function(e){r.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})})}function rC(r){var t=nt();A(r,function(e){var i=e.existing;i&&t.set(i.id,e)}),A(r,function(e){var i=e.newOption;_e(!i||i.id==null||!t.get(i.id)||t.get(i.id)===e,"id duplicates: "+(i&&i.id)),i&&i.id!=null&&t.set(i.id,e),!e.keyInfo&&(e.keyInfo={})}),A(r,function(e,i){var n=e.existing,a=e.newOption,o=e.keyInfo;if(q(a)){if(o.name=a.name!=null?Ma(a.name):n?n.name:Fy+i,n)o.id=Ma(n.id);else if(a.id!=null)o.id=Ma(a.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(t.get(o.id))}t.set(o.id,e)}})}function zy(r,t,e){var i=Ue(t[r],null),n=Ue(e[r],null);return i!=null&&n!=null&&i===n}function Ma(r){return Ue(r,"")}function Ue(r,t){return r==null?t:$(r)?r:At(r)||As(r)?r+"":t}function Vy(r){var t=r.name;return!!(t&&t.indexOf(Fy))}function Xa(r){return r&&r.id!=null&&Ma(r.id).indexOf(By)===0}function iC(r){return By+r}function nC(r,t,e){A(r,function(i){var n=i.newOption;q(n)&&(i.keyInfo.mainType=t,i.keyInfo.subType=aC(t,n,i.existing,e))})}function aC(r,t,e,i){var n=t.type?t.type:e?e.subType:i.determineSubType(r,t);return n}function Hi(r,t){if(t.dataIndexInside!=null)return t.dataIndexInside;if(t.dataIndex!=null)return G(t.dataIndex)?H(t.dataIndex,function(e){return r.indexOfRawIndex(e)}):r.indexOfRawIndex(t.dataIndex);if(t.name!=null)return G(t.name)?H(t.name,function(e){return r.indexOfName(e)}):r.indexOfName(t.name)}function kt(){var r="__ec_inner_"+oC++;return function(t){return t[r]||(t[r]={})}}var oC=jy();function Da(r,t,e){var i=Jc(t,e),n=i.mainTypeSpecified,a=i.queryOptionMap,o=i.others,s=o,l=e?e.defaultMainType:null;return!n&&l&&a.set(l,{}),a.each(function(u,h){var c=go(r,h,u,{useDefault:l===h,enableAll:e&&e.enableAll!=null?e.enableAll:!0,enableNone:e&&e.enableNone!=null?e.enableNone:!0});s[h+"Models"]=c.models,s[h+"Model"]=c.models[0]}),s}function Jc(r,t){var e;if($(r)){var i={};i[r+"Index"]=0,e=i}else e=r;var n=nt(),a={},o=!1;return A(e,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){a[l]=s;return}var u=l.match(/^(\w+)(Index|Id|Name)$/)||[],h=u[1],c=(u[2]||"").toLowerCase();if(!(!h||!c||t&&t.includeMainTypes&&pt(t.includeMainTypes,h)<0)){o=o||!!h;var f=n.get(h)||n.set(h,{});f[c]=s}}),{mainTypeSpecified:o,queryOptionMap:n,others:a}}var ee={useDefault:!0,enableAll:!1,enableNone:!1},sC={useDefault:!1,enableAll:!0,enableNone:!0};function go(r,t,e,i){i=i||ee;var n=e.index,a=e.id,o=e.name,s={models:null,specified:n!=null||a!=null||o!=null};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=r.getComponent(t))?[l]:[],s}return n==="none"||n===!1?(_e(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(n==="all"&&(_e(i.enableAll,'`"all"` is not a valid value on index option.'),n=a=o=null),s.models=r.queryComponents({mainType:t,index:n,id:a,name:o}),s)}function Hy(r,t,e){r.setAttribute?r.setAttribute(t,e):r[t]=e}function lC(r,t){return r.getAttribute?r.getAttribute(t):r[t]}function uC(r){return r==="auto"?J.domSupported?"html":"richText":r||"html"}function hC(r,t,e,i,n){var a=t==null||t==="auto";if(i==null)return i;if(At(i)){var o=tp(e||0,i,n);return Pt(o,a?Math.max(ar(e||0),ar(i)):t)}else{if($(i))return n<1?e:i;for(var s=[],l=e,u=i,h=Math.max(l?l.length:0,u.length),c=0;c<h;++c){var f=r.getDimensionInfo(c);if(f&&f.type==="ordinal")s[c]=(n<1&&l?l:u)[c];else{var d=l&&l[c]?l[c]:0,p=u[c],o=tp(d,p,n);s[c]=Pt(o,a?Math.max(ar(d),ar(p)):t)}}return s}}var cC=".",ci="___EC__COMPONENT__CONTAINER___",Wy="___EC__EXTENDED_CLASS___";function or(r){var t={main:"",sub:""};if(r){var e=r.split(cC);t.main=e[0]||"",t.sub=e[1]||""}return t}function fC(r){_e(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(r),'componentType "'+r+'" illegal')}function dC(r){return!!(r&&r[Wy])}function Qc(r,t){r.$constructor=r,r.extend=function(e){var i=this,n;return pC(i)?n=(function(a){B(o,a);function o(){return a.apply(this,arguments)||this}return o})(i):(n=function(){(e.$constructor||i).apply(this,arguments)},Nc(n,this)),F(n.prototype,e),n[Wy]=!0,n.extend=this.extend,n.superCall=mC,n.superApply=yC,n.superClass=i,n}}function pC(r){return tt(r)&&/^class\s/.test(Function.prototype.toString.call(r))}function Gy(r,t){r.extend=t.extend}var vC=Math.round(Math.random()*10);function gC(r){var t=["__\0is_clz",vC++].join("_");r.prototype[t]=!0,r.isInstance=function(e){return!!(e&&e[t])}}function mC(r,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];return this.superClass.prototype[t].apply(r,e)}function yC(r,t,e){return this.superClass.prototype[t].apply(r,e)}function fl(r){var t={};r.registerClass=function(i){var n=i.type||i.prototype.type;if(n){fC(n),i.prototype.type=n;var a=or(n);if(!a.sub)t[a.main]=i;else if(a.sub!==ci){var o=e(a);o[a.sub]=i}}return i},r.getClass=function(i,n,a){var o=t[i];if(o&&o[ci]&&(o=n?o[n]:null),a&&!o)throw new Error(n?"Component "+i+"."+(n||"")+" is used but not imported.":i+".type should be specified.");return o},r.getClassesByMainType=function(i){var n=or(i),a=[],o=t[n.main];return o&&o[ci]?A(o,function(s,l){l!==ci&&a.push(s)}):a.push(o),a},r.hasClass=function(i){var n=or(i);return!!t[n.main]},r.getAllClassMainTypes=function(){var i=[];return A(t,function(n,a){i.push(a)}),i},r.hasSubTypes=function(i){var n=or(i),a=t[n.main];return a&&a[ci]};function e(i){var n=t[i.main];return(!n||!n[ci])&&(n=t[i.main]={},n[ci]=!0),n}}function Za(r,t){for(var e=0;e<r.length;e++)r[e][1]||(r[e][1]=r[e][0]);return t=t||!1,function(i,n,a){for(var o={},s=0;s<r.length;s++){var l=r[s][1];if(!(n&&pt(n,l)>=0||a&&pt(a,l)<0)){var u=i.getShallow(l,t);u!=null&&(o[r[s][0]]=u)}}return o}}var _C=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],bC=Za(_C),xC=(function(){function r(){}return r.prototype.getAreaStyle=function(t,e){return bC(this,t,e)},r})(),Bh=new vo(50);function wC(r){if(typeof r=="string"){var t=Bh.get(r);return t&&t.image}else return r}function tf(r,t,e,i,n){if(r)if(typeof r=="string"){if(t&&t.__zrImageSrc===r||!e)return t;var a=Bh.get(r),o={hostEl:e,cb:i,cbPayload:n};return a?(t=a.image,!dl(t)&&a.pending.push(o)):(t=Zr.loadImage(r,ip,ip),t.__zrImageSrc=r,Bh.put(r,t.__cachedImgObj={image:t,pending:[o]})),t}else return r;else return t}function ip(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<r.pending.length;t++){var e=r.pending[t],i=e.cb;i&&i(this,e.cbPayload),e.hostEl.dirty()}r.pending.length=0}function dl(r){return r&&r.width&&r.height}var cu=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function SC(r,t,e,i,n){var a={};return Uy(a,r,t,e,i,n),a.text}function Uy(r,t,e,i,n,a){if(!e){r.text="",r.isTruncated=!1;return}var o=(t+"").split(`
|
|
25
|
+
`);a=$y(e,i,n,a);for(var s=!1,l={},u=0,h=o.length;u<h;u++)Yy(l,o[u],a),o[u]=l.textLine,s=s||l.isTruncated;r.text=o.join(`
|
|
26
|
+
`),r.isTruncated=s}function $y(r,t,e,i){i=i||{};var n=F({},i);n.font=t,e=Q(e,"..."),n.maxIterations=Q(i.maxIterations,2);var a=n.minChar=Q(i.minChar,0);n.cnCharWidth=me("国",t);var o=n.ascCharWidth=me("a",t);n.placeholder=Q(i.placeholder,"");for(var s=r=Math.max(0,r-1),l=0;l<a&&s>=o;l++)s-=o;var u=me(e,t);return u>s&&(e="",u=0),s=r-u,n.ellipsis=e,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=r,n}function Yy(r,t,e){var i=e.containerWidth,n=e.font,a=e.contentWidth;if(!i){r.textLine="",r.isTruncated=!1;return}var o=me(t,n);if(o<=i){r.textLine=t,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=a||s>=e.maxIterations){t+=e.ellipsis;break}var l=s===0?CC(t,a,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*a/o):0;t=t.substr(0,l),o=me(t,n)}t===""&&(t=e.placeholder),r.textLine=t,r.isTruncated=!0}function CC(r,t,e,i){for(var n=0,a=0,o=r.length;a<o&&n<t;a++){var s=r.charCodeAt(a);n+=0<=s&&s<=127?e:i}return a}function TC(r,t){r!=null&&(r+="");var e=t.overflow,i=t.padding,n=t.font,a=e==="truncate",o=ul(n),s=Q(t.lineHeight,o),l=!!t.backgroundColor,u=t.lineOverflow==="truncate",h=!1,c=t.width,f;c!=null&&(e==="break"||e==="breakAll")?f=r?Xy(r,t.font,c,e==="breakAll",0).lines:[]:f=r?r.split(`
|
|
27
|
+
`):[];var d=f.length*s,p=Q(t.height,d);if(d>p&&u){var v=Math.floor(p/s);h=h||f.length>v,f=f.slice(0,v)}if(r&&a&&c!=null)for(var g=$y(c,n,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),m={},_=0;_<f.length;_++)Yy(m,f[_],g),f[_]=m.textLine,h=h||m.isTruncated;for(var b=p,x=0,_=0;_<f.length;_++)x=Math.max(me(f[_],n),x);c==null&&(c=x);var C=x;return i&&(b+=i[0]+i[2],C+=i[1]+i[3],c+=i[1]+i[3]),l&&(C=c),{lines:f,height:p,outerWidth:C,outerHeight:b,lineHeight:s,calculatedLineHeight:o,contentWidth:x,contentHeight:d,width:c,isTruncated:h}}var AC=(function(){function r(){}return r})(),np=(function(){function r(t){this.tokens=[],t&&(this.tokens=t)}return r})(),IC=(function(){function r(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return r})();function MC(r,t){var e=new IC;if(r!=null&&(r+=""),!r)return e;for(var i=t.width,n=t.height,a=t.overflow,o=(a==="break"||a==="breakAll")&&i!=null?{width:i,accumWidth:0,breakAll:a==="breakAll"}:null,s=cu.lastIndex=0,l;(l=cu.exec(r))!=null;){var u=l.index;u>s&&fu(e,r.substring(s,u),t,o),fu(e,l[2],t,o,l[1]),s=cu.lastIndex}s<r.length&&fu(e,r.substring(s,r.length),t,o);var h=[],c=0,f=0,d=t.padding,p=a==="truncate",v=t.lineOverflow==="truncate",g={};function m(et,ut,ot){et.width=ut,et.lineHeight=ot,c+=ot,f=Math.max(f,ut)}t:for(var _=0;_<e.lines.length;_++){for(var b=e.lines[_],x=0,C=0,S=0;S<b.tokens.length;S++){var T=b.tokens[S],I=T.styleName&&t.rich[T.styleName]||{},M=T.textPadding=I.padding,D=M?M[1]+M[3]:0,P=T.font=I.font||t.font;T.contentHeight=ul(P);var k=Q(I.height,T.contentHeight);if(T.innerHeight=k,M&&(k+=M[0]+M[2]),T.height=k,T.lineHeight=Ta(I.lineHeight,t.lineHeight,k),T.align=I&&I.align||t.align,T.verticalAlign=I&&I.verticalAlign||"middle",v&&n!=null&&c+T.lineHeight>n){var R=e.lines.length;S>0?(b.tokens=b.tokens.slice(0,S),m(b,C,x),e.lines=e.lines.slice(0,_+1)):e.lines=e.lines.slice(0,_),e.isTruncated=e.isTruncated||e.lines.length<R;break t}var L=I.width,N=L==null||L==="auto";if(typeof L=="string"&&L.charAt(L.length-1)==="%")T.percentWidth=L,h.push(T),T.contentWidth=me(T.text,P);else{if(N){var j=I.backgroundColor,Z=j&&j.image;Z&&(Z=wC(Z),dl(Z)&&(T.width=Math.max(T.width,Z.width*k/Z.height)))}var U=p&&i!=null?i-C:null;U!=null&&U<T.width?!N||U<D?(T.text="",T.width=T.contentWidth=0):(Uy(g,T.text,U-D,P,t.ellipsis,{minChar:t.truncateMinChar}),T.text=g.text,e.isTruncated=e.isTruncated||g.isTruncated,T.width=T.contentWidth=me(T.text,P)):T.contentWidth=me(T.text,P)}T.width+=D,C+=T.width,I&&(x=Math.max(x,T.lineHeight))}m(b,C,x)}e.outerWidth=e.width=Q(i,f),e.outerHeight=e.height=Q(n,c),e.contentHeight=c,e.contentWidth=f,d&&(e.outerWidth+=d[1]+d[3],e.outerHeight+=d[0]+d[2]);for(var _=0;_<h.length;_++){var T=h[_],Y=T.percentWidth;T.width=parseInt(Y,10)/100*e.width}return e}function fu(r,t,e,i,n){var a=t==="",o=n&&e.rich[n]||{},s=r.lines,l=o.font||e.font,u=!1,h,c;if(i){var f=o.padding,d=f?f[1]+f[3]:0;if(o.width!=null&&o.width!=="auto"){var p=qr(o.width,i.width)+d;s.length>0&&p+i.accumWidth>i.width&&(h=t.split(`
|
|
28
|
+
`),u=!0),i.accumWidth=p}else{var v=Xy(t,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=v.accumWidth+d,c=v.linesWidths,h=v.lines}}else h=t.split(`
|
|
29
|
+
`);for(var g=0;g<h.length;g++){var m=h[g],_=new AC;if(_.styleName=n,_.text=m,_.isLineHolder=!m&&!a,typeof o.width=="number"?_.width=o.width:_.width=c?c[g]:me(m,l),!g&&!u){var b=(s[s.length-1]||(s[0]=new np)).tokens,x=b.length;x===1&&b[0].isLineHolder?b[0]=_:(m||!x||a)&&b.push(_)}else s.push(new np([_]))}}function DC(r){var t=r.charCodeAt(0);return t>=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var PC=lr(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function kC(r){return DC(r)?!!PC[r]:!0}function Xy(r,t,e,i,n){for(var a=[],o=[],s="",l="",u=0,h=0,c=0;c<r.length;c++){var f=r.charAt(c);if(f===`
|
|
30
|
+
`){l&&(s+=l,h+=u),a.push(s),o.push(h),s="",l="",u=0,h=0;continue}var d=me(f,t),p=i?!1:!kC(f);if(a.length?h+d>e:n+h+d>e){h?(s||l)&&(p?(s||(s=l,l="",u=0,h=u),a.push(s),o.push(h-u),l+=f,u+=d,s="",h=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(h),s=f,h=d)):p?(a.push(l),o.push(u),l=f,u=d):(a.push(f),o.push(d));continue}h+=d,p?(l+=f,u+=d):(l&&(s+=l,l="",u=0),s+=f)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(h)),a.length===1&&(h+=n),{accumWidth:h,lines:a,linesWidths:o}}var zh="__zr_style_"+Math.round(Math.random()*10),ji={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},pl={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};ji[zh]=!0;var ap=["z","z2","invisible"],RC=["invisible"],mo=(function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=vt(e),n=0;n<i.length;n++){var a=i[n];a==="style"?this.useStyle(e[a]):r.prototype.attrKV.call(this,a,e[a])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(e,i,n,a){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&LC(this,e,i)||o&&!o[0]&&!o[3])return!1;if(n&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(a&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},t.prototype.contain=function(e,i){return this.rectContain(e,i)},t.prototype.traverse=function(e,i){e.call(i,this)},t.prototype.rectContain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect();return a.contain(n[0],n[1])},t.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var i=this.transform,n=this.getBoundingRect(),a=this.style,o=a.shadowBlur||0,s=a.shadowOffsetX||0,l=a.shadowOffsetY||0;e=this._paintRect||(this._paintRect=new mt(0,0,0,0)),i?mt.applyTransform(e,n,i):e.copy(n),(o||s||l)&&(e.width+=o*2+Math.abs(s),e.height+=o*2+Math.abs(l),e.x=Math.min(e.x,e.x+s-o),e.y=Math.min(e.y,e.y+l-o));var u=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-u),e.y=Math.floor(e.y-u),e.width=Math.ceil(e.width+1+u*2),e.height=Math.ceil(e.height+1+u*2))}return e},t.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new mt(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(e){return this.animate("style",e)},t.prototype.updateDuringAnimation=function(e){e==="style"?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(e,i){e!=="style"?r.prototype.attrKV.call(this,e,i):this.style?this.setStyle(i):this.useStyle(i)},t.prototype.setStyle=function(e,i){return typeof e=="string"?this.style[e]=i:F(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=ma,this._rect&&(this._rect=null)},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(this.__dirty&ma)},t.prototype.styleUpdated=function(){this.__dirty&=~ma},t.prototype.createStyle=function(e){return ho(ji,e)},t.prototype.useStyle=function(e){e[zh]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},t.prototype.isStyleObject=function(e){return e[zh]},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.style&&!i.style&&(i.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(e,i,ap)},t.prototype._applyStateObj=function(e,i,n,a,o,s){r.prototype._applyStateObj.call(this,e,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.style?o?a?u=i.style:(u=this._mergeStyle(this.createStyle(),n.style),this._mergeStyle(u,i.style)):(u=this._mergeStyle(this.createStyle(),a?this.style:n.style),this._mergeStyle(u,i.style)):l&&(u=n.style),u)if(o){var h=this.style;if(this.style=this.createStyle(l?{}:h),l)for(var c=vt(h),f=0;f<c.length;f++){var d=c[f];d in u&&(u[d]=u[d],this.style[d]=h[d])}for(var p=vt(u),f=0;f<p.length;f++){var d=p[f];this.style[d]=this.style[d]}this._transitionState(e,{style:u},s,this.getAnimationStyleProps())}else this.useStyle(u);for(var v=this.__inHover?RC:ap,f=0;f<v.length;f++){var d=v[f];i&&i[d]!=null?this[d]=i[d]:l&&n[d]!=null&&(this[d]=n[d])}},t.prototype._mergeStates=function(e){for(var i=r.prototype._mergeStates.call(this,e),n,a=0;a<e.length;a++){var o=e[a];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(i.style=n),i},t.prototype._mergeStyle=function(e,i){return F(e,i),e},t.prototype.getAnimationStyleProps=function(){return pl},t.initDefaultProps=(function(){var e=t.prototype;e.type="displayable",e.invisible=!1,e.z=0,e.z2=0,e.zlevel=0,e.culling=!1,e.cursor="pointer",e.rectHover=!1,e.incremental=!1,e._rect=null,e.dirtyRectTolerance=0,e.__dirty=ir|ma})(),t})(hl),du=new mt(0,0,0,0),pu=new mt(0,0,0,0);function LC(r,t,e){return du.copy(r.getBoundingRect()),r.transform&&du.applyTransform(r.transform),pu.width=t,pu.height=e,!du.intersect(pu)}var De=Math.min,Pe=Math.max,vu=Math.sin,gu=Math.cos,fi=Math.PI*2,No=Xi(),Fo=Xi(),Bo=Xi();function op(r,t,e,i,n,a){n[0]=De(r,e),n[1]=De(t,i),a[0]=Pe(r,e),a[1]=Pe(t,i)}var sp=[],lp=[];function OC(r,t,e,i,n,a,o,s,l,u){var h=fy,c=Ht,f=h(r,e,n,o,sp);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var d=0;d<f;d++){var p=c(r,e,n,o,sp[d]);l[0]=De(p,l[0]),u[0]=Pe(p,u[0])}f=h(t,i,a,s,lp);for(var d=0;d<f;d++){var v=c(t,i,a,s,lp[d]);l[1]=De(v,l[1]),u[1]=Pe(v,u[1])}l[0]=De(r,l[0]),u[0]=Pe(r,u[0]),l[0]=De(o,l[0]),u[0]=Pe(o,u[0]),l[1]=De(t,l[1]),u[1]=Pe(t,u[1]),l[1]=De(s,l[1]),u[1]=Pe(s,u[1])}function EC(r,t,e,i,n,a,o,s){var l=dy,u=he,h=Pe(De(l(r,e,n),1),0),c=Pe(De(l(t,i,a),1),0),f=u(r,e,n,h),d=u(t,i,a,c);o[0]=De(r,n,f),o[1]=De(t,a,d),s[0]=Pe(r,n,f),s[1]=Pe(t,a,d)}function jC(r,t,e,i,n,a,o,s,l){var u=jr,h=Nr,c=Math.abs(n-a);if(c%fi<1e-4&&c>1e-4){s[0]=r-e,s[1]=t-i,l[0]=r+e,l[1]=t+i;return}if(No[0]=gu(n)*e+r,No[1]=vu(n)*i+t,Fo[0]=gu(a)*e+r,Fo[1]=vu(a)*i+t,u(s,No,Fo),h(l,No,Fo),n=n%fi,n<0&&(n=n+fi),a=a%fi,a<0&&(a=a+fi),n>a&&!o?a+=fi:n<a&&o&&(n+=fi),o){var f=a;a=n,n=f}for(var d=0;d<a;d+=Math.PI/2)d>n&&(Bo[0]=gu(d)*e+r,Bo[1]=vu(d)*i+t,u(s,Bo,s),h(l,Bo,l))}var yt={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},di=[],pi=[],Ke=[],Tr=[],Je=[],Qe=[],mu=Math.min,yu=Math.max,vi=Math.cos,gi=Math.sin,dr=Math.abs,Vh=Math.PI,Lr=Vh*2,_u=typeof Float32Array<"u",ra=[];function bu(r){var t=Math.round(r/Vh*1e8)/1e8;return t%2*Vh}function NC(r,t){var e=bu(r[0]);e<0&&(e+=Lr);var i=e-r[0],n=r[1];n+=i,!t&&n-e>=Lr?n=e+Lr:t&&e-n>=Lr?n=e-Lr:!t&&e>n?n=e+(Lr-bu(e-n)):t&&e<n&&(n=e-(Lr-bu(n-e))),r[0]=e,r[1]=n}var Kr=(function(){function r(t){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}return r.prototype.increaseVersion=function(){this._version++},r.prototype.getVersion=function(){return this._version},r.prototype.setScale=function(t,e,i){i=i||0,i>0&&(this._ux=dr(i/Yd/t)||0,this._uy=dr(i/Yd/e)||0)},r.prototype.setDPR=function(t){this.dpr=t},r.prototype.setContext=function(t){this._ctx=t},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(yt.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},r.prototype.lineTo=function(t,e){var i=dr(t-this._xi),n=dr(e-this._yi),a=i>this._ux||n>this._uy;if(this.addData(yt.L,t,e),this._ctx&&a&&this._ctx.lineTo(t,e),a)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){return this._drawPendingPt(),this.addData(yt.C,t,e,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(t,e,i,n){return this._drawPendingPt(),this.addData(yt.Q,t,e,i,n),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this},r.prototype.arc=function(t,e,i,n,a,o){this._drawPendingPt(),ra[0]=n,ra[1]=a,NC(ra,o),n=ra[0],a=ra[1];var s=a-n;return this.addData(yt.A,t,e,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,a,o),this._xi=vi(a)*i+t,this._yi=gi(a)*i+e,this},r.prototype.arcTo=function(t,e,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,i,n,a),this},r.prototype.rect=function(t,e,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,i,n),this.addData(yt.R,t,e,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(yt.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&t.closePath(),this._xi=e,this._yi=i,this},r.prototype.fill=function(t){t&&t.fill(),this.toStatic()},r.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(t){var e=t.length;!(this.data&&this.data.length===e)&&_u&&(this.data=new Float32Array(e));for(var i=0;i<e;i++)this.data[i]=t[i];this._len=e},r.prototype.appendPath=function(t){t instanceof Array||(t=[t]);for(var e=t.length,i=0,n=this._len,a=0;a<e;a++)i+=t[a].len();_u&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(var a=0;a<e;a++)for(var o=t[a].data,s=0;s<o.length;s++)this.data[n++]=o[s];this._len=n},r.prototype.addData=function(t,e,i,n,a,o,s,l,u){if(this._saveData){var h=this.data;this._len+arguments.length>h.length&&(this._expandData(),h=this.data);for(var c=0;c<arguments.length;c++)h[this._len++]=arguments[c]}},r.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},r.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var t=this.data;t instanceof Array&&(t.length=this._len,_u&&this._len>11&&(this.data=new Float32Array(t)))}},r.prototype.getBoundingRect=function(){Ke[0]=Ke[1]=Je[0]=Je[1]=Number.MAX_VALUE,Tr[0]=Tr[1]=Qe[0]=Qe[1]=-Number.MAX_VALUE;var t=this.data,e=0,i=0,n=0,a=0,o;for(o=0;o<this._len;){var s=t[o++],l=o===1;switch(l&&(e=t[o],i=t[o+1],n=e,a=i),s){case yt.M:e=n=t[o++],i=a=t[o++],Je[0]=n,Je[1]=a,Qe[0]=n,Qe[1]=a;break;case yt.L:op(e,i,t[o],t[o+1],Je,Qe),e=t[o++],i=t[o++];break;case yt.C:OC(e,i,t[o++],t[o++],t[o++],t[o++],t[o],t[o+1],Je,Qe),e=t[o++],i=t[o++];break;case yt.Q:EC(e,i,t[o++],t[o++],t[o],t[o+1],Je,Qe),e=t[o++],i=t[o++];break;case yt.A:var u=t[o++],h=t[o++],c=t[o++],f=t[o++],d=t[o++],p=t[o++]+d;o+=1;var v=!t[o++];l&&(n=vi(d)*c+u,a=gi(d)*f+h),jC(u,h,c,f,d,p,v,Je,Qe),e=vi(p)*c+u,i=gi(p)*f+h;break;case yt.R:n=e=t[o++],a=i=t[o++];var g=t[o++],m=t[o++];op(n,a,n+g,a+m,Je,Qe);break;case yt.Z:e=n,i=a;break}jr(Ke,Ke,Je),Nr(Tr,Tr,Qe)}return o===0&&(Ke[0]=Ke[1]=Tr[0]=Tr[1]=0),new mt(Ke[0],Ke[1],Tr[0]-Ke[0],Tr[1]-Ke[1])},r.prototype._calculateLength=function(){var t=this.data,e=this._len,i=this._ux,n=this._uy,a=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var u=this._pathSegLen,h=0,c=0,f=0;f<e;){var d=t[f++],p=f===1;p&&(a=t[f],o=t[f+1],s=a,l=o);var v=-1;switch(d){case yt.M:a=s=t[f++],o=l=t[f++];break;case yt.L:{var g=t[f++],m=t[f++],_=g-a,b=m-o;(dr(_)>i||dr(b)>n||f===e-1)&&(v=Math.sqrt(_*_+b*b),a=g,o=m);break}case yt.C:{var x=t[f++],C=t[f++],g=t[f++],m=t[f++],S=t[f++],T=t[f++];v=G1(a,o,x,C,g,m,S,T,10),a=S,o=T;break}case yt.Q:{var x=t[f++],C=t[f++],g=t[f++],m=t[f++];v=Y1(a,o,x,C,g,m,10),a=g,o=m;break}case yt.A:var I=t[f++],M=t[f++],D=t[f++],P=t[f++],k=t[f++],R=t[f++],L=R+k;f+=1,p&&(s=vi(k)*D+I,l=gi(k)*P+M),v=yu(D,P)*mu(Lr,Math.abs(R)),a=vi(L)*D+I,o=gi(L)*P+M;break;case yt.R:{s=a=t[f++],l=o=t[f++];var N=t[f++],j=t[f++];v=N*2+j*2;break}case yt.Z:{var _=s-a,b=l-o;v=Math.sqrt(_*_+b*b),a=s,o=l;break}}v>=0&&(u[c++]=v,h+=v)}return this._pathLen=h,h},r.prototype.rebuildPath=function(t,e){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,h,c,f,d=e<1,p,v,g=0,m=0,_,b=0,x,C;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,v=this._pathLen,_=e*v,!_)))t:for(var S=0;S<o;){var T=i[S++],I=S===1;switch(I&&(u=i[S],h=i[S+1],s=u,l=h),T!==yt.L&&b>0&&(t.lineTo(x,C),b=0),T){case yt.M:s=u=i[S++],l=h=i[S++],t.moveTo(u,h);break;case yt.L:{c=i[S++],f=i[S++];var M=dr(c-u),D=dr(f-h);if(M>n||D>a){if(d){var P=p[m++];if(g+P>_){var k=(_-g)/P;t.lineTo(u*(1-k)+c*k,h*(1-k)+f*k);break t}g+=P}t.lineTo(c,f),u=c,h=f,b=0}else{var R=M*M+D*D;R>b&&(x=c,C=f,b=R)}break}case yt.C:{var L=i[S++],N=i[S++],j=i[S++],Z=i[S++],U=i[S++],Y=i[S++];if(d){var P=p[m++];if(g+P>_){var k=(_-g)/P;ks(u,L,j,U,k,di),ks(h,N,Z,Y,k,pi),t.bezierCurveTo(di[1],pi[1],di[2],pi[2],di[3],pi[3]);break t}g+=P}t.bezierCurveTo(L,N,j,Z,U,Y),u=U,h=Y;break}case yt.Q:{var L=i[S++],N=i[S++],j=i[S++],Z=i[S++];if(d){var P=p[m++];if(g+P>_){var k=(_-g)/P;Rs(u,L,j,k,di),Rs(h,N,Z,k,pi),t.quadraticCurveTo(di[1],pi[1],di[2],pi[2]);break t}g+=P}t.quadraticCurveTo(L,N,j,Z),u=j,h=Z;break}case yt.A:var et=i[S++],ut=i[S++],ot=i[S++],ft=i[S++],gt=i[S++],z=i[S++],Rt=i[S++],It=!i[S++],Lt=ot>ft?ot:ft,xt=dr(ot-ft)>.001,V=gt+z,X=!1;if(d){var P=p[m++];g+P>_&&(V=gt+z*(_-g)/P,X=!0),g+=P}if(xt&&t.ellipse?t.ellipse(et,ut,ot,ft,Rt,gt,V,It):t.arc(et,ut,Lt,gt,V,It),X)break t;I&&(s=vi(gt)*ot+et,l=gi(gt)*ft+ut),u=vi(V)*ot+et,h=gi(V)*ft+ut;break;case yt.R:s=u=i[S],l=h=i[S+1],c=i[S++],f=i[S++];var K=i[S++],Ot=i[S++];if(d){var P=p[m++];if(g+P>_){var St=_-g;t.moveTo(c,f),t.lineTo(c+mu(St,K),f),St-=K,St>0&&t.lineTo(c+K,f+mu(St,Ot)),St-=Ot,St>0&&t.lineTo(c+yu(K-St,0),f+Ot),St-=K,St>0&&t.lineTo(c,f+yu(Ot-St,0));break t}g+=P}t.rect(c,f,K,Ot);break;case yt.Z:if(d){var P=p[m++];if(g+P>_){var k=(_-g)/P;t.lineTo(u*(1-k)+s*k,h*(1-k)+l*k);break t}g+=P}t.closePath(),u=s,h=l}}},r.prototype.clone=function(){var t=new r,e=this.data;return t.data=e.slice?e.slice():Array.prototype.slice.call(e),t._len=this._len,t},r.CMD=yt,r.initDefaultProps=(function(){var t=r.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),r})();function sn(r,t,e,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=r;if(o>t+s&&o>i+s||o<t-s&&o<i-s||a>r+s&&a>e+s||a<r-s&&a<e-s)return!1;if(r!==e)l=(t-i)/(r-e),u=(r*i-e*t)/(r-e);else return Math.abs(a-r)<=s/2;var h=l*a-o+u,c=h*h/(l*l+1);return c<=s/2*s/2}function FC(r,t,e,i,n,a,o,s,l,u,h){if(l===0)return!1;var c=l;if(h>t+c&&h>i+c&&h>a+c&&h>s+c||h<t-c&&h<i-c&&h<a-c&&h<s-c||u>r+c&&u>e+c&&u>n+c&&u>o+c||u<r-c&&u<e-c&&u<n-c&&u<o-c)return!1;var f=W1(r,t,e,i,n,a,o,s,u,h);return f<=c/2}function BC(r,t,e,i,n,a,o,s,l){if(o===0)return!1;var u=o;if(l>t+u&&l>i+u&&l>a+u||l<t-u&&l<i-u&&l<a-u||s>r+u&&s>e+u&&s>n+u||s<r-u&&s<e-u&&s<n-u)return!1;var h=$1(r,t,e,i,n,a,s,l);return h<=u/2}var up=Math.PI*2;function zo(r){return r%=up,r<0&&(r+=up),r}var ia=Math.PI*2;function zC(r,t,e,i,n,a,o,s,l){if(o===0)return!1;var u=o;s-=r,l-=t;var h=Math.sqrt(s*s+l*l);if(h-u>e||h+u<e)return!1;if(Math.abs(i-n)%ia<1e-4)return!0;if(a){var c=i;i=zo(n),n=zo(c)}else i=zo(i),n=zo(n);i>n&&(n+=ia);var f=Math.atan2(l,s);return f<0&&(f+=ia),f>=i&&f<=n||f+ia>=i&&f+ia<=n}function mr(r,t,e,i,n,a){if(a>t&&a>i||a<t&&a<i||i===t)return 0;var o=(a-t)/(i-t),s=i<t?1:-1;(o===1||o===0)&&(s=i<t?.5:-.5);var l=o*(e-r)+r;return l===n?1/0:l>n?s:0}var Ar=Kr.CMD,mi=Math.PI*2,VC=1e-4;function HC(r,t){return Math.abs(r-t)<VC}var Jt=[-1,-1,-1],Ie=[-1,-1];function WC(){var r=Ie[0];Ie[0]=Ie[1],Ie[1]=r}function GC(r,t,e,i,n,a,o,s,l,u){if(u>t&&u>i&&u>a&&u>s||u<t&&u<i&&u<a&&u<s)return 0;var h=Ps(t,i,a,s,u,Jt);if(h===0)return 0;for(var c=0,f=-1,d=void 0,p=void 0,v=0;v<h;v++){var g=Jt[v],m=g===0||g===1?.5:1,_=Ht(r,e,n,o,g);_<l||(f<0&&(f=fy(t,i,a,s,Ie),Ie[1]<Ie[0]&&f>1&&WC(),d=Ht(t,i,a,s,Ie[0]),f>1&&(p=Ht(t,i,a,s,Ie[1]))),f===2?g<Ie[0]?c+=d<t?m:-m:g<Ie[1]?c+=p<d?m:-m:c+=s<p?m:-m:g<Ie[0]?c+=d<t?m:-m:c+=s<d?m:-m)}return c}function UC(r,t,e,i,n,a,o,s){if(s>t&&s>i&&s>a||s<t&&s<i&&s<a)return 0;var l=U1(t,i,a,s,Jt);if(l===0)return 0;var u=dy(t,i,a);if(u>=0&&u<=1){for(var h=0,c=he(t,i,a,u),f=0;f<l;f++){var d=Jt[f]===0||Jt[f]===1?.5:1,p=he(r,e,n,Jt[f]);p<o||(Jt[f]<u?h+=c<t?d:-d:h+=a<c?d:-d)}return h}else{var d=Jt[0]===0||Jt[0]===1?.5:1,p=he(r,e,n,Jt[0]);return p<o?0:a<t?d:-d}}function $C(r,t,e,i,n,a,o,s){if(s-=t,s>e||s<-e)return 0;var l=Math.sqrt(e*e-s*s);Jt[0]=-l,Jt[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=mi-1e-4){i=0,n=mi;var h=a?1:-1;return o>=Jt[0]+r&&o<=Jt[1]+r?h:0}if(i>n){var c=i;i=n,n=c}i<0&&(i+=mi,n+=mi);for(var f=0,d=0;d<2;d++){var p=Jt[d];if(p+r>o){var v=Math.atan2(s,p),h=a?1:-1;v<0&&(v=mi+v),(v>=i&&v<=n||v+mi>=i&&v+mi<=n)&&(v>Math.PI/2&&v<Math.PI*1.5&&(h=-h),f+=h)}}return f}function Zy(r,t,e,i,n){for(var a=r.data,o=r.len(),s=0,l=0,u=0,h=0,c=0,f,d,p=0;p<o;){var v=a[p++],g=p===1;switch(v===Ar.M&&p>1&&(e||(s+=mr(l,u,h,c,i,n))),g&&(l=a[p],u=a[p+1],h=l,c=u),v){case Ar.M:h=a[p++],c=a[p++],l=h,u=c;break;case Ar.L:if(e){if(sn(l,u,a[p],a[p+1],t,i,n))return!0}else s+=mr(l,u,a[p],a[p+1],i,n)||0;l=a[p++],u=a[p++];break;case Ar.C:if(e){if(FC(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],t,i,n))return!0}else s+=GC(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],i,n)||0;l=a[p++],u=a[p++];break;case Ar.Q:if(e){if(BC(l,u,a[p++],a[p++],a[p],a[p+1],t,i,n))return!0}else s+=UC(l,u,a[p++],a[p++],a[p],a[p+1],i,n)||0;l=a[p++],u=a[p++];break;case Ar.A:var m=a[p++],_=a[p++],b=a[p++],x=a[p++],C=a[p++],S=a[p++];p+=1;var T=!!(1-a[p++]);f=Math.cos(C)*b+m,d=Math.sin(C)*x+_,g?(h=f,c=d):s+=mr(l,u,f,d,i,n);var I=(i-m)*x/b+m;if(e){if(zC(m,_,x,C,C+S,T,t,I,n))return!0}else s+=$C(m,_,x,C,C+S,T,I,n);l=Math.cos(C+S)*b+m,u=Math.sin(C+S)*x+_;break;case Ar.R:h=l=a[p++],c=u=a[p++];var M=a[p++],D=a[p++];if(f=h+M,d=c+D,e){if(sn(h,c,f,c,t,i,n)||sn(f,c,f,d,t,i,n)||sn(f,d,h,d,t,i,n)||sn(h,d,h,c,t,i,n))return!0}else s+=mr(f,c,f,d,i,n),s+=mr(h,d,h,c,i,n);break;case Ar.Z:if(e){if(sn(l,u,h,c,t,i,n))return!0}else s+=mr(l,u,h,c,i,n);l=h,u=c;break}}return!e&&!HC(u,c)&&(s+=mr(l,u,h,c,i,n)||0),s!==0}function YC(r,t,e){return Zy(r,0,!1,t,e)}function XC(r,t,e,i){return Zy(r,t,!0,e,i)}var Es=lt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},ji),ZC={style:lt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},pl.style)},xu=Ua.concat(["invisible","culling","z","z2","zlevel","parent"]),bt=(function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.update=function(){var e=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new t;n.buildPath===t.prototype.buildPath&&(n.buildPath=function(l){e.buildPath(l,e.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s<xu.length;++s)n[xu[s]]=this[xu[s]];n.__dirty|=ir}else this._decalEl&&(this._decalEl=null)},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(e){var i=vt(e);this.shape=this.getDefaultShape();var n=this.getDefaultStyle();n&&this.useStyle(n);for(var a=0;a<i.length;a++){var o=i[a],s=e[o];o==="style"?this.style?F(this.style,s):this.useStyle(s):o==="shape"?F(this.shape,s):r.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},t.prototype.getDefaultStyle=function(){return null},t.prototype.getDefaultShape=function(){return{}},t.prototype.canBeInsideText=function(){return this.hasFill()},t.prototype.getInsideTextFill=function(){var e=this.style.fill;if(e!=="none"){if($(e)){var i=Wa(e,0);return i>.5?Eh:i>.2?AS:jh}else if(e)return jh}return Eh},t.prototype.getInsideTextStroke=function(e){var i=this.style.fill;if($(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Wa(e,0)<Oh;if(a===o)return i}},t.prototype.buildPath=function(e,i,n){},t.prototype.pathUpdated=function(){this.__dirty&=~bn},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new Kr(!1)},t.prototype.hasStroke=function(){var e=this.style,i=e.stroke;return!(i==null||i==="none"||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.getBoundingRect=function(){var e=this._rect,i=this.style,n=!e;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&bn)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),e=o.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){s.copy(e);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;u=Math.max(u,h??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return e},t.prototype.contain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect(),o=this.style;if(e=n[0],i=n[1],a.contain(e,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),XC(s,l/u,e,i)))return!0}if(this.hasFill())return YC(s,e,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=bn,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){e==="style"?this.dirtyStyle():e==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(e,i){e==="shape"?this.setShape(i):r.prototype.attrKV.call(this,e,i)},t.prototype.setShape=function(e,i){var n=this.shape;return n||(n=this.shape={}),typeof e=="string"?n[e]=i:F(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&bn)},t.prototype.createStyle=function(e){return ho(Es,e)},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=F({},this.shape))},t.prototype._applyStateObj=function(e,i,n,a,o,s){r.prototype._applyStateObj.call(this,e,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=F({},n.shape),F(u,i.shape)):(u=F({},a?this.shape:n.shape),F(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=F({},this.shape);for(var h={},c=vt(u),f=0;f<c.length;f++){var d=c[f];typeof u[d]=="object"?this.shape[d]=u[d]:h[d]=u[d]}this._transitionState(e,{shape:h},s)}else this.shape=u,this.dirtyShape()},t.prototype._mergeStates=function(e){for(var i=r.prototype._mergeStates.call(this,e),n,a=0;a<e.length;a++){var o=e[a];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(i.shape=n),i},t.prototype.getAnimationStyleProps=function(){return ZC},t.prototype.isZeroArea=function(){return!1},t.extend=function(e){var i=(function(a){B(o,a);function o(s){var l=a.call(this,s)||this;return e.init&&e.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return it(e.style)},o.prototype.getDefaultShape=function(){return it(e.shape)},o})(t);for(var n in e)typeof e[n]=="function"&&(i.prototype[n]=e[n]);return i},t.initDefaultProps=(function(){var e=t.prototype;e.type="path",e.strokeContainThreshold=5,e.segmentIgnoreThreshold=0,e.subPixelOptimize=!1,e.autoBatch=!1,e.__dirty=ir|ma|bn})(),t})(mo),qC=lt({strokeFirst:!0,font:Xr,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Es),qa=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.hasStroke=function(){var e=this.style,i=e.stroke;return i!=null&&i!=="none"&&e.lineWidth>0},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.createStyle=function(e){return ho(qC,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var i=e.text;i!=null?i+="":i="";var n=ll(i,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var a=e.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},t.initDefaultProps=(function(){var e=t.prototype;e.dirtyRectTolerance=10})(),t})(mo);qa.prototype.type="tspan";var KC=lt({x:0,y:0},ji),JC={style:lt({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},pl.style)};function QC(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var Ze=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return ho(KC,e)},t.prototype._getSize=function(e){var i=this.style,n=i[e];if(n!=null)return n;var a=QC(i.image)?i.image:this.__image;if(!a)return 0;var o=e==="width"?"height":"width",s=i[o];return s==null?a[e]:a[e]/a[o]*s},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return JC},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new mt(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t})(mo);Ze.prototype.type="image";function tT(r,t){var e=t.x,i=t.y,n=t.width,a=t.height,o=t.r,s,l,u,h;n<0&&(e=e+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=h=o:o instanceof Array?o.length===1?s=l=u=h=o[0]:o.length===2?(s=u=o[0],l=h=o[1]):o.length===3?(s=o[0],l=h=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],h=o[3]):s=l=u=h=0;var c;s+l>n&&(c=s+l,s*=n/c,l*=n/c),u+h>n&&(c=u+h,u*=n/c,h*=n/c),l+u>a&&(c=l+u,l*=a/c,u*=a/c),s+h>a&&(c=s+h,s*=a/c,h*=a/c),r.moveTo(e+s,i),r.lineTo(e+n-l,i),l!==0&&r.arc(e+n-l,i+l,l,-Math.PI/2,0),r.lineTo(e+n,i+a-u),u!==0&&r.arc(e+n-u,i+a-u,u,0,Math.PI/2),r.lineTo(e+h,i+a),h!==0&&r.arc(e+h,i+a-h,h,Math.PI/2,Math.PI),r.lineTo(e,i+s),s!==0&&r.arc(e+s,i+s,s,Math.PI,Math.PI*1.5)}var Tn=Math.round;function qy(r,t,e){if(t){var i=t.x1,n=t.x2,a=t.y1,o=t.y2;r.x1=i,r.x2=n,r.y1=a,r.y2=o;var s=e&&e.lineWidth;return s&&(Tn(i*2)===Tn(n*2)&&(r.x1=r.x2=Ri(i,s,!0)),Tn(a*2)===Tn(o*2)&&(r.y1=r.y2=Ri(a,s,!0))),r}}function Ky(r,t,e){if(t){var i=t.x,n=t.y,a=t.width,o=t.height;r.x=i,r.y=n,r.width=a,r.height=o;var s=e&&e.lineWidth;return s&&(r.x=Ri(i,s,!0),r.y=Ri(n,s,!0),r.width=Math.max(Ri(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(Ri(n+o,s,!1)-r.y,o===0?0:1)),r}}function Ri(r,t,e){if(!t)return r;var i=Tn(r*2);return(i+Tn(t))%2===0?i/2:(i+(e?1:-1))/2}var eT=(function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r})(),rT={},Nt=(function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new eT},t.prototype.buildPath=function(e,i){var n,a,o,s;if(this.subPixelOptimize){var l=Ky(rT,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?tT(e,i):e.rect(n,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t})(bt);Nt.prototype.type="rect";var hp={fill:"#000"},cp=2,iT={style:lt({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},pl.style)},zt=(function(r){B(t,r);function t(e){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=hp,i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e<this._children.length;e++){var i=this._children[e];i.zlevel=this.zlevel,i.z=this.z,i.z2=this.z2,i.culling=this.culling,i.cursor=this.cursor,i.invisible=this.invisible}},t.prototype.updateTransform=function(){var e=this.innerTransformable;e?(e.updateTransform(),e.transform&&(this.transform=e.transform)):r.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(e){var i=this.innerTransformable;return i?i.getLocalTransform(e):r.prototype.getLocalTransform.call(this,e)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),r.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){this._childCursor=0,oT(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(e){r.prototype.addSelfToZr.call(this,e);for(var i=0;i<this._children.length;i++)this._children[i].__zr=e},t.prototype.removeSelfFromZr=function(e){r.prototype.removeSelfFromZr.call(this,e);for(var i=0;i<this._children.length;i++)this._children[i].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new mt(0,0,0,0),i=this._children,n=[],a=null,o=0;o<i.length;o++){var s=i[o],l=s.getBoundingRect(),u=s.getLocalTransform(n);u?(e.copy(l),e.applyTransform(u),a=a||e.clone(),a.union(e)):(a=a||l.clone(),a.union(l))}this._rect=a||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||hp},t.prototype.setTextContent=function(e){},t.prototype._mergeStyle=function(e,i){if(!i)return e;var n=i.rich,a=e.rich||n&&{};return F(e,i),n&&a?(this._mergeRich(a,n),e.rich=a):a&&(e.rich=a),e},t.prototype._mergeRich=function(e,i){for(var n=vt(i),a=0;a<n.length;a++){var o=n[a];e[o]=e[o]||{},F(e[o],i[o])}},t.prototype.getAnimationStyleProps=function(){return iT},t.prototype._getOrCreateChild=function(e){var i=this._children[this._childCursor];return(!i||!(i instanceof e))&&(i=new e),this._children[this._childCursor++]=i,i.__zr=this.__zr,i.parent=this,i},t.prototype._updatePlainTexts=function(){var e=this.style,i=e.font||Xr,n=e.padding,a=yp(e),o=TC(a,e),s=wu(e),l=!!e.backgroundColor,u=o.outerHeight,h=o.outerWidth,c=o.contentWidth,f=o.lines,d=o.lineHeight,p=this._defaultStyle;this.isTruncated=!!o.isTruncated;var v=e.x||0,g=e.y||0,m=e.align||p.align||"left",_=e.verticalAlign||p.verticalAlign||"top",b=v,x=xn(g,o.contentHeight,_);if(s||n){var C=_a(v,h,m),S=xn(g,u,_);s&&this._renderBackground(e,e,C,S,h,u)}x+=d/2,n&&(b=mp(v,m,n),_==="top"?x+=n[0]:_==="bottom"&&(x-=n[2]));for(var T=0,I=!1,M=gp("fill"in e?e.fill:(I=!0,p.fill)),D=vp("stroke"in e?e.stroke:!l&&(!p.autoStroke||I)?(T=cp,p.stroke):null),P=e.textShadowBlur>0,k=e.width!=null&&(e.overflow==="truncate"||e.overflow==="break"||e.overflow==="breakAll"),R=o.calculatedLineHeight,L=0;L<f.length;L++){var N=this._getOrCreateChild(qa),j=N.createStyle();N.useStyle(j),j.text=f[L],j.x=b,j.y=x,j.textAlign=m,j.textBaseline="middle",j.opacity=e.opacity,j.strokeFirst=!0,P&&(j.shadowBlur=e.textShadowBlur||0,j.shadowColor=e.textShadowColor||"transparent",j.shadowOffsetX=e.textShadowOffsetX||0,j.shadowOffsetY=e.textShadowOffsetY||0),j.stroke=D,j.fill=M,D&&(j.lineWidth=e.lineWidth||T,j.lineDash=e.lineDash,j.lineDashOffset=e.lineDashOffset||0),j.font=i,dp(j,e),x+=d,k&&N.setBoundingRect(new mt(_a(j.x,c,j.textAlign),xn(j.y,R,j.textBaseline),c,R))}},t.prototype._updateRichTexts=function(){var e=this.style,i=yp(e),n=MC(i,e),a=n.width,o=n.outerWidth,s=n.outerHeight,l=e.padding,u=e.x||0,h=e.y||0,c=this._defaultStyle,f=e.align||c.align,d=e.verticalAlign||c.verticalAlign;this.isTruncated=!!n.isTruncated;var p=_a(u,o,f),v=xn(h,s,d),g=p,m=v;l&&(g+=l[3],m+=l[0]);var _=g+a;wu(e)&&this._renderBackground(e,e,p,v,o,s);for(var b=!!e.backgroundColor,x=0;x<n.lines.length;x++){for(var C=n.lines[x],S=C.tokens,T=S.length,I=C.lineHeight,M=C.width,D=0,P=g,k=_,R=T-1,L=void 0;D<T&&(L=S[D],!L.align||L.align==="left");)this._placeToken(L,e,I,m,P,"left",b),M-=L.width,P+=L.width,D++;for(;R>=0&&(L=S[R],L.align==="right");)this._placeToken(L,e,I,m,k,"right",b),M-=L.width,k-=L.width,R--;for(P+=(a-(P-g)-(_-k)-M)/2;D<=R;)L=S[D],this._placeToken(L,e,I,m,P+L.width/2,"center",b),P+=L.width,D++;m+=I}},t.prototype._placeToken=function(e,i,n,a,o,s,l){var u=i.rich[e.styleName]||{};u.text=e.text;var h=e.verticalAlign,c=a+n/2;h==="top"?c=a+e.height/2:h==="bottom"&&(c=a+n-e.height/2);var f=!e.isLineHolder&&wu(u);f&&this._renderBackground(u,i,s==="right"?o-e.width:s==="center"?o-e.width/2:o,c-e.height/2,e.width,e.height);var d=!!u.backgroundColor,p=e.textPadding;p&&(o=mp(o,s,p),c-=e.height/2-p[0]-e.innerHeight/2);var v=this._getOrCreateChild(qa),g=v.createStyle();v.useStyle(g);var m=this._defaultStyle,_=!1,b=0,x=gp("fill"in u?u.fill:"fill"in i?i.fill:(_=!0,m.fill)),C=vp("stroke"in u?u.stroke:"stroke"in i?i.stroke:!d&&!l&&(!m.autoStroke||_)?(b=cp,m.stroke):null),S=u.textShadowBlur>0||i.textShadowBlur>0;g.text=e.text,g.x=o,g.y=c,S&&(g.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,g.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",g.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,g.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=e.font||Xr,g.opacity=Ta(u.opacity,i.opacity,1),dp(g,u),C&&(g.lineWidth=Ta(u.lineWidth,i.lineWidth,b),g.lineDash=Q(u.lineDash,i.lineDash),g.lineDashOffset=i.lineDashOffset||0,g.stroke=C),x&&(g.fill=x);var T=e.contentWidth,I=e.contentHeight;v.setBoundingRect(new mt(_a(g.x,T,g.textAlign),xn(g.y,I,g.textBaseline),T,I))},t.prototype._renderBackground=function(e,i,n,a,o,s){var l=e.backgroundColor,u=e.borderWidth,h=e.borderColor,c=l&&l.image,f=l&&!c,d=e.borderRadius,p=this,v,g;if(f||e.lineHeight||u&&h){v=this._getOrCreateChild(Nt),v.useStyle(v.createStyle()),v.style.fill=null;var m=v.shape;m.x=n,m.y=a,m.width=o,m.height=s,m.r=d,v.dirtyShape()}if(f){var _=v.style;_.fill=l||null,_.fillOpacity=Q(e.fillOpacity,1)}else if(c){g=this._getOrCreateChild(Ze),g.onload=function(){p.dirtyStyle()};var b=g.style;b.image=l.image,b.x=n,b.y=a,b.width=o,b.height=s}if(u&&h){var _=v.style;_.lineWidth=u,_.stroke=h,_.strokeOpacity=Q(e.strokeOpacity,1),_.lineDash=e.borderDash,_.lineDashOffset=e.borderDashOffset||0,v.strokeContainThreshold=0,v.hasFill()&&v.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var x=(v||g).style;x.shadowBlur=e.shadowBlur||0,x.shadowColor=e.shadowColor||"transparent",x.shadowOffsetX=e.shadowOffsetX||0,x.shadowOffsetY=e.shadowOffsetY||0,x.opacity=Ta(e.opacity,i.opacity,1)},t.makeFont=function(e){var i="";return Qy(e)&&(i=[e.fontStyle,e.fontWeight,Jy(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),i&&We(i)||e.textFont||e.font},t})(mo),nT={left:!0,right:1,center:1},aT={top:1,bottom:1,middle:1},fp=["fontStyle","fontWeight","fontSize","fontFamily"];function Jy(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?Rc+"px":r+"px"}function dp(r,t){for(var e=0;e<fp.length;e++){var i=fp[e],n=t[i];n!=null&&(r[i]=n)}}function Qy(r){return r.fontSize!=null||r.fontFamily||r.fontWeight}function oT(r){return pp(r),A(r.rich,pp),r}function pp(r){if(r){r.font=zt.makeFont(r);var t=r.align;t==="middle"&&(t="center"),r.align=t==null||nT[t]?t:"left";var e=r.verticalAlign;e==="center"&&(e="middle"),r.verticalAlign=e==null||aT[e]?e:"top";var i=r.padding;i&&(r.padding=Fc(r.padding))}}function vp(r,t){return r==null||t<=0||r==="transparent"||r==="none"?null:r.image||r.colorStops?"#000":r}function gp(r){return r==null||r==="none"?null:r.image||r.colorStops?"#000":r}function mp(r,t,e){return t==="right"?r-e[1]:t==="center"?r+e[3]/2-e[1]/2:r+e[3]}function yp(r){var t=r.text;return t!=null&&(t+=""),t}function wu(r){return!!(r.backgroundColor||r.lineHeight||r.borderWidth&&r.borderColor)}var _t=kt(),sT=function(r,t,e,i){if(i){var n=_t(i);n.dataIndex=e,n.dataType=t,n.seriesIndex=r,n.ssrType="chart",i.type==="group"&&i.traverse(function(a){var o=_t(a);o.seriesIndex=r,o.dataIndex=e,o.dataType=t,o.ssrType="chart"})}},_p=1,bp={},t0=kt(),ef=kt(),rf=0,vl=1,gl=2,ur=["emphasis","blur","select"],xp=["normal","emphasis","blur","select"],lT=10,uT=9,Ni="highlight",vs="downplay",Pa="select",gs="unselect",ka="toggleSelect";function ln(r){return r!=null&&r!=="none"}function ml(r,t,e){r.onHoverStateChange&&(r.hoverState||0)!==e&&r.onHoverStateChange(t),r.hoverState=e}function e0(r){ml(r,"emphasis",gl)}function r0(r){r.hoverState===gl&&ml(r,"normal",rf)}function nf(r){ml(r,"blur",vl)}function i0(r){r.hoverState===vl&&ml(r,"normal",rf)}function hT(r){r.selected=!0}function cT(r){r.selected=!1}function wp(r,t,e){t(r,e)}function xr(r,t,e){wp(r,t,e),r.isGroup&&r.traverse(function(i){wp(i,t,e)})}function Sp(r,t){switch(t){case"emphasis":r.hoverState=gl;break;case"normal":r.hoverState=rf;break;case"blur":r.hoverState=vl;break;case"select":r.selected=!0}}function fT(r,t,e,i){for(var n=r.style,a={},o=0;o<t.length;o++){var s=t[o],l=n[s];a[s]=l??(i&&i[s])}for(var o=0;o<r.animators.length;o++){var u=r.animators[o];u.__fromStateTransition&&u.__fromStateTransition.indexOf(e)<0&&u.targetName==="style"&&u.saveTo(a,t)}return a}function dT(r,t,e,i){var n=e&&pt(e,"select")>=0,a=!1;if(r instanceof bt){var o=t0(r),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(ln(s)||ln(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=F({},i),u=F({},u),u.fill=s):!ln(u.fill)&&ln(s)?(a=!0,i=F({},i),u=F({},u),u.fill=Ls(s)):!ln(u.stroke)&&ln(l)&&(a||(i=F({},i),u=F({},u)),u.stroke=Ls(l)),i.style=u}}if(i&&i.z2==null){a||(i=F({},i));var h=r.z2EmphasisLift;i.z2=r.z2+(h??lT)}return i}function pT(r,t,e){if(e&&e.z2==null){e=F({},e);var i=r.z2SelectLift;e.z2=r.z2+(i??uT)}return e}function vT(r,t,e){var i=pt(r.currentStates,t)>=0,n=r.style.opacity,a=i?null:fT(r,["opacity"],t,{opacity:1});e=e||{};var o=e.style||{};return o.opacity==null&&(e=F({},e),o=F({opacity:i?n:a.opacity*.1},o),e.style=o),e}function Su(r,t){var e=this.states[r];if(this.style){if(r==="emphasis")return dT(this,r,t,e);if(r==="blur")return vT(this,r,e);if(r==="select")return pT(this,r,e)}return e}function gT(r){r.stateProxy=Su;var t=r.getTextContent(),e=r.getTextGuideLine();t&&(t.stateProxy=Su),e&&(e.stateProxy=Su)}function Cp(r,t){!s0(r,t)&&!r.__highByOuter&&xr(r,e0)}function Tp(r,t){!s0(r,t)&&!r.__highByOuter&&xr(r,r0)}function Nn(r,t){r.__highByOuter|=1<<(t||0),xr(r,e0)}function Fn(r,t){!(r.__highByOuter&=~(1<<(t||0)))&&xr(r,r0)}function mT(r){xr(r,nf)}function n0(r){xr(r,i0)}function a0(r){xr(r,hT)}function o0(r){xr(r,cT)}function s0(r,t){return r.__highDownSilentOnTouch&&t.zrByTouch}function l0(r){var t=r.getModel(),e=[],i=[];t.eachComponent(function(n,a){var o=ef(a),s=n==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){i0(u)}),s&&e.push(a)),o.isBlured=!1}),A(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(e,!1,t)})}function Hh(r,t,e,i){var n=i.getModel();e=e||"coordinateSystem";function a(u,h){for(var c=0;c<h.length;c++){var f=u.getItemGraphicEl(h[c]);f&&n0(f)}}if(r!=null&&!(!t||t==="none")){var o=n.getSeriesByIndex(r),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];n.eachSeries(function(u){var h=o===u,c=u.coordinateSystem;c&&c.master&&(c=c.master);var f=c&&s?c===s:h;if(!(e==="series"&&!h||e==="coordinateSystem"&&!f||t==="series"&&h)){var d=i.getViewOfSeriesModel(u);if(d.group.traverse(function(g){g.__highByOuter&&h&&t==="self"||nf(g)}),ne(t))a(u.getData(),t);else if(q(t))for(var p=vt(t),v=0;v<p.length;v++)a(u.getData(p[v]),t[p[v]]);l.push(u),ef(u).isBlured=!0}}),n.eachComponent(function(u,h){if(u!=="series"){var c=i.getViewOfComponentModel(h);c&&c.toggleBlurSeries&&c.toggleBlurSeries(l,!0,n)}})}}function Wh(r,t,e){if(!(r==null||t==null)){var i=e.getModel().getComponent(r,t);if(i){ef(i).isBlured=!0;var n=e.getViewOfComponentModel(i);!n||!n.focusBlurEnabled||n.group.traverse(function(a){nf(a)})}}}function yT(r,t,e){var i=r.seriesIndex,n=r.getData(t.dataType);if(n){var a=Hi(n,t);a=(G(a)?a[0]:a)||0;var o=n.getItemGraphicEl(a);if(!o)for(var s=n.count(),l=0;!o&&l<s;)o=n.getItemGraphicEl(l++);if(o){var u=_t(o);Hh(i,u.focus,u.blurScope,e)}else{var h=r.get(["emphasis","focus"]),c=r.get(["emphasis","blurScope"]);h!=null&&Hh(i,h,c,e)}}}function af(r,t,e,i){var n={focusSelf:!1,dispatchers:null};if(r==null||r==="series"||t==null||e==null)return n;var a=i.getModel().getComponent(r,t);if(!a)return n;var o=i.getViewOfComponentModel(a);if(!o||!o.findHighDownDispatchers)return n;for(var s=o.findHighDownDispatchers(e),l,u=0;u<s.length;u++)if(_t(s[u]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function _T(r,t,e){var i=_t(r),n=af(i.componentMainType,i.componentIndex,i.componentHighDownName,e),a=n.dispatchers,o=n.focusSelf;a?(o&&Wh(i.componentMainType,i.componentIndex,e),A(a,function(s){return Cp(s,t)})):(Hh(i.seriesIndex,i.focus,i.blurScope,e),i.focus==="self"&&Wh(i.componentMainType,i.componentIndex,e),Cp(r,t))}function bT(r,t,e){l0(e);var i=_t(r),n=af(i.componentMainType,i.componentIndex,i.componentHighDownName,e).dispatchers;n?A(n,function(a){return Tp(a,t)}):Tp(r,t)}function xT(r,t,e){if($h(t)){var i=t.dataType,n=r.getData(i),a=Hi(n,t);G(a)||(a=[a]),r[t.type===ka?"toggleSelect":t.type===Pa?"select":"unselect"](a,i)}}function Ap(r){var t=r.getAllData();A(t,function(e){var i=e.data,n=e.type;i.eachItemGraphicEl(function(a,o){r.isSelected(o,n)?a0(a):o0(a)})})}function wT(r){var t=[];return r.eachSeries(function(e){var i=e.getAllData();A(i,function(n){n.data;var a=n.type,o=e.getSelectedDataIndices();if(o.length>0){var s={dataIndex:o,seriesIndex:e.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function Ra(r,t,e){u0(r,!0),xr(r,gT),CT(r,t,e)}function ST(r){u0(r,!1)}function Gh(r,t,e,i){i?ST(r):Ra(r,t,e)}function CT(r,t,e){var i=_t(r);t!=null?(i.focus=t,i.blurScope=e):i.focus&&(i.focus=null)}var Ip=["emphasis","blur","select"],TT={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Mp(r,t,e,i){e=e||"itemStyle";for(var n=0;n<Ip.length;n++){var a=Ip[n],o=t.getModel([a,e]),s=r.ensureState(a);s.style=o[TT[e]]()}}function u0(r,t){var e=t===!1,i=r;r.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=r.highDownSilentOnTouch),(!e||i.__highDownDispatcher)&&(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!e)}function Uh(r){return!!(r&&r.__highDownDispatcher)}function AT(r){var t=bp[r];return t==null&&_p<=32&&(t=bp[r]=_p++),t}function $h(r){var t=r.type;return t===Pa||t===gs||t===ka}function Dp(r){var t=r.type;return t===Ni||t===vs}function IT(r){var t=t0(r);t.normalFill=r.style.fill,t.normalStroke=r.style.stroke;var e=r.states.select||{};t.selectFill=e.style&&e.style.fill||null,t.selectStroke=e.style&&e.style.stroke||null}var un=Kr.CMD,MT=[[],[],[]],Pp=Math.sqrt,DT=Math.atan2;function PT(r,t){if(t){var e=r.data,i=r.len(),n,a,o,s,l,u,h=un.M,c=un.C,f=un.L,d=un.R,p=un.A,v=un.Q;for(o=0,s=0;o<i;){switch(n=e[o++],s=o,a=0,n){case h:a=1;break;case f:a=1;break;case c:a=3;break;case v:a=2;break;case p:var g=t[4],m=t[5],_=Pp(t[0]*t[0]+t[1]*t[1]),b=Pp(t[2]*t[2]+t[3]*t[3]),x=DT(-t[1]/b,t[0]/_);e[o]*=_,e[o++]+=g,e[o]*=b,e[o++]+=m,e[o++]*=_,e[o++]*=b,e[o++]+=x,e[o++]+=x,o+=2,s=o;break;case d:u[0]=e[o++],u[1]=e[o++],re(u,u,t),e[s++]=u[0],e[s++]=u[1],u[0]+=e[o++],u[1]+=e[o++],re(u,u,t),e[s++]=u[0],e[s++]=u[1]}for(l=0;l<a;l++){var C=MT[l];C[0]=e[o++],C[1]=e[o++],re(C,C,t),e[s++]=C[0],e[s++]=C[1]}}r.increaseVersion()}}var Cu=Math.sqrt,Vo=Math.sin,Ho=Math.cos,na=Math.PI;function kp(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Yh(r,t){return(r[0]*t[0]+r[1]*t[1])/(kp(r)*kp(t))}function Rp(r,t){return(r[0]*t[1]<r[1]*t[0]?-1:1)*Math.acos(Yh(r,t))}function Lp(r,t,e,i,n,a,o,s,l,u,h){var c=l*(na/180),f=Ho(c)*(r-e)/2+Vo(c)*(t-i)/2,d=-1*Vo(c)*(r-e)/2+Ho(c)*(t-i)/2,p=f*f/(o*o)+d*d/(s*s);p>1&&(o*=Cu(p),s*=Cu(p));var v=(n===a?-1:1)*Cu((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,g=v*o*d/s,m=v*-s*f/o,_=(r+e)/2+Ho(c)*g-Vo(c)*m,b=(t+i)/2+Vo(c)*g+Ho(c)*m,x=Rp([1,0],[(f-g)/o,(d-m)/s]),C=[(f-g)/o,(d-m)/s],S=[(-1*f-g)/o,(-1*d-m)/s],T=Rp(C,S);if(Yh(C,S)<=-1&&(T=na),Yh(C,S)>=1&&(T=0),T<0){var I=Math.round(T/na*1e6)/1e6;T=na*2+I%2*na}h.addData(u,_,b,o,s,x,T,c,a)}var kT=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,RT=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function LT(r){var t=new Kr;if(!r)return t;var e=0,i=0,n=e,a=i,o,s=Kr.CMD,l=r.match(kT);if(!l)return t;for(var u=0;u<l.length;u++){for(var h=l[u],c=h.charAt(0),f=void 0,d=h.match(RT)||[],p=d.length,v=0;v<p;v++)d[v]=parseFloat(d[v]);for(var g=0;g<p;){var m=void 0,_=void 0,b=void 0,x=void 0,C=void 0,S=void 0,T=void 0,I=e,M=i,D=void 0,P=void 0;switch(c){case"l":e+=d[g++],i+=d[g++],f=s.L,t.addData(f,e,i);break;case"L":e=d[g++],i=d[g++],f=s.L,t.addData(f,e,i);break;case"m":e+=d[g++],i+=d[g++],f=s.M,t.addData(f,e,i),n=e,a=i,c="l";break;case"M":e=d[g++],i=d[g++],f=s.M,t.addData(f,e,i),n=e,a=i,c="L";break;case"h":e+=d[g++],f=s.L,t.addData(f,e,i);break;case"H":e=d[g++],f=s.L,t.addData(f,e,i);break;case"v":i+=d[g++],f=s.L,t.addData(f,e,i);break;case"V":i=d[g++],f=s.L,t.addData(f,e,i);break;case"C":f=s.C,t.addData(f,d[g++],d[g++],d[g++],d[g++],d[g++],d[g++]),e=d[g-2],i=d[g-1];break;case"c":f=s.C,t.addData(f,d[g++]+e,d[g++]+i,d[g++]+e,d[g++]+i,d[g++]+e,d[g++]+i),e+=d[g-2],i+=d[g-1];break;case"S":m=e,_=i,D=t.len(),P=t.data,o===s.C&&(m+=e-P[D-4],_+=i-P[D-3]),f=s.C,I=d[g++],M=d[g++],e=d[g++],i=d[g++],t.addData(f,m,_,I,M,e,i);break;case"s":m=e,_=i,D=t.len(),P=t.data,o===s.C&&(m+=e-P[D-4],_+=i-P[D-3]),f=s.C,I=e+d[g++],M=i+d[g++],e+=d[g++],i+=d[g++],t.addData(f,m,_,I,M,e,i);break;case"Q":I=d[g++],M=d[g++],e=d[g++],i=d[g++],f=s.Q,t.addData(f,I,M,e,i);break;case"q":I=d[g++]+e,M=d[g++]+i,e+=d[g++],i+=d[g++],f=s.Q,t.addData(f,I,M,e,i);break;case"T":m=e,_=i,D=t.len(),P=t.data,o===s.Q&&(m+=e-P[D-4],_+=i-P[D-3]),e=d[g++],i=d[g++],f=s.Q,t.addData(f,m,_,e,i);break;case"t":m=e,_=i,D=t.len(),P=t.data,o===s.Q&&(m+=e-P[D-4],_+=i-P[D-3]),e+=d[g++],i+=d[g++],f=s.Q,t.addData(f,m,_,e,i);break;case"A":b=d[g++],x=d[g++],C=d[g++],S=d[g++],T=d[g++],I=e,M=i,e=d[g++],i=d[g++],f=s.A,Lp(I,M,e,i,S,T,b,x,C,f,t);break;case"a":b=d[g++],x=d[g++],C=d[g++],S=d[g++],T=d[g++],I=e,M=i,e+=d[g++],i+=d[g++],f=s.A,Lp(I,M,e,i,S,T,b,x,C,f,t);break}}(c==="z"||c==="Z")&&(f=s.Z,t.addData(f),e=n,i=a),o=f}return t.toStatic(),t}var h0=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.applyTransform=function(e){},t})(bt);function c0(r){return r.setData!=null}function f0(r,t){var e=LT(r),i=F({},t);return i.buildPath=function(n){if(c0(n)){n.setData(e.data);var a=n.getContext();a&&n.rebuildPath(a,1)}else{var a=n;e.rebuildPath(a,1)}},i.applyTransform=function(n){PT(e,n),this.dirtyShape()},i}function OT(r,t){return new h0(f0(r,t))}function ET(r,t){var e=f0(r,t),i=(function(n){B(a,n);function a(o){var s=n.call(this,o)||this;return s.applyTransform=e.applyTransform,s.buildPath=e.buildPath,s}return a})(h0);return i}function jT(r,t){for(var e=[],i=r.length,n=0;n<i;n++){var a=r[n];e.push(a.getUpdatedPathProxy(!0))}var o=new bt(t);return o.createPathProxy(),o.buildPath=function(s){if(c0(s)){s.appendPath(e);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var NT=(function(){function r(){this.cx=0,this.cy=0,this.r=0}return r})(),yo=(function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new NT},t.prototype.buildPath=function(e,i){e.moveTo(i.cx+i.r,i.cy),e.arc(i.cx,i.cy,i.r,0,Math.PI*2)},t})(bt);yo.prototype.type="circle";var FT=(function(){function r(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return r})(),yl=(function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new FT},t.prototype.buildPath=function(e,i){var n=.5522848,a=i.cx,o=i.cy,s=i.rx,l=i.ry,u=s*n,h=l*n;e.moveTo(a-s,o),e.bezierCurveTo(a-s,o-h,a-u,o-l,a,o-l),e.bezierCurveTo(a+u,o-l,a+s,o-h,a+s,o),e.bezierCurveTo(a+s,o+h,a+u,o+l,a,o+l),e.bezierCurveTo(a-u,o+l,a-s,o+h,a-s,o),e.closePath()},t})(bt);yl.prototype.type="ellipse";var d0=Math.PI,Tu=d0*2,yi=Math.sin,hn=Math.cos,BT=Math.acos,Ut=Math.atan2,Op=Math.abs,La=Math.sqrt,ba=Math.max,tr=Math.min,Be=1e-4;function zT(r,t,e,i,n,a,o,s){var l=e-r,u=i-t,h=o-n,c=s-a,f=c*l-h*u;if(!(f*f<Be))return f=(h*(t-a)-c*(r-n))/f,[r+f*l,t+f*u]}function Wo(r,t,e,i,n,a,o){var s=r-e,l=t-i,u=(o?a:-a)/La(s*s+l*l),h=u*l,c=-u*s,f=r+h,d=t+c,p=e+h,v=i+c,g=(f+p)/2,m=(d+v)/2,_=p-f,b=v-d,x=_*_+b*b,C=n-a,S=f*v-p*d,T=(b<0?-1:1)*La(ba(0,C*C*x-S*S)),I=(S*b-_*T)/x,M=(-S*_-b*T)/x,D=(S*b+_*T)/x,P=(-S*_+b*T)/x,k=I-g,R=M-m,L=D-g,N=P-m;return k*k+R*R>L*L+N*N&&(I=D,M=P),{cx:I,cy:M,x0:-h,y0:-c,x1:I*(n/C-1),y1:M*(n/C-1)}}function VT(r){var t;if(G(r)){var e=r.length;if(!e)return r;e===1?t=[r[0],r[0],0,0]:e===2?t=[r[0],r[0],r[1],r[1]]:e===3?t=r.concat(r[2]):t=r}else t=[r,r,r,r];return t}function HT(r,t){var e,i=ba(t.r,0),n=ba(t.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var h=t.cx,c=t.cy,f=!!t.clockwise,d=Op(u-l),p=d>Tu&&d%Tu;if(p>Be&&(d=p),!(i>Be))r.moveTo(h,c);else if(d>Tu-Be)r.moveTo(h+i*hn(l),c+i*yi(l)),r.arc(h,c,i,l,u,!f),n>Be&&(r.moveTo(h+n*hn(u),c+n*yi(u)),r.arc(h,c,n,u,l,f));else{var v=void 0,g=void 0,m=void 0,_=void 0,b=void 0,x=void 0,C=void 0,S=void 0,T=void 0,I=void 0,M=void 0,D=void 0,P=void 0,k=void 0,R=void 0,L=void 0,N=i*hn(l),j=i*yi(l),Z=n*hn(u),U=n*yi(u),Y=d>Be;if(Y){var et=t.cornerRadius;et&&(e=VT(et),v=e[0],g=e[1],m=e[2],_=e[3]);var ut=Op(i-n)/2;if(b=tr(ut,m),x=tr(ut,_),C=tr(ut,v),S=tr(ut,g),M=T=ba(b,x),D=I=ba(C,S),(T>Be||I>Be)&&(P=i*hn(u),k=i*yi(u),R=n*hn(l),L=n*yi(l),d<d0)){var ot=zT(N,j,R,L,P,k,Z,U);if(ot){var ft=N-ot[0],gt=j-ot[1],z=P-ot[0],Rt=k-ot[1],It=1/yi(BT((ft*z+gt*Rt)/(La(ft*ft+gt*gt)*La(z*z+Rt*Rt)))/2),Lt=La(ot[0]*ot[0]+ot[1]*ot[1]);M=tr(T,(i-Lt)/(It+1)),D=tr(I,(n-Lt)/(It-1))}}}if(!Y)r.moveTo(h+N,c+j);else if(M>Be){var xt=tr(m,M),V=tr(_,M),X=Wo(R,L,N,j,i,xt,f),K=Wo(P,k,Z,U,i,V,f);r.moveTo(h+X.cx+X.x0,c+X.cy+X.y0),M<T&&xt===V?r.arc(h+X.cx,c+X.cy,M,Ut(X.y0,X.x0),Ut(K.y0,K.x0),!f):(xt>0&&r.arc(h+X.cx,c+X.cy,xt,Ut(X.y0,X.x0),Ut(X.y1,X.x1),!f),r.arc(h,c,i,Ut(X.cy+X.y1,X.cx+X.x1),Ut(K.cy+K.y1,K.cx+K.x1),!f),V>0&&r.arc(h+K.cx,c+K.cy,V,Ut(K.y1,K.x1),Ut(K.y0,K.x0),!f))}else r.moveTo(h+N,c+j),r.arc(h,c,i,l,u,!f);if(!(n>Be)||!Y)r.lineTo(h+Z,c+U);else if(D>Be){var xt=tr(v,D),V=tr(g,D),X=Wo(Z,U,P,k,n,-V,f),K=Wo(N,j,R,L,n,-xt,f);r.lineTo(h+X.cx+X.x0,c+X.cy+X.y0),D<I&&xt===V?r.arc(h+X.cx,c+X.cy,D,Ut(X.y0,X.x0),Ut(K.y0,K.x0),!f):(V>0&&r.arc(h+X.cx,c+X.cy,V,Ut(X.y0,X.x0),Ut(X.y1,X.x1),!f),r.arc(h,c,n,Ut(X.cy+X.y1,X.cx+X.x1),Ut(K.cy+K.y1,K.cx+K.x1),f),xt>0&&r.arc(h+K.cx,c+K.cy,xt,Ut(K.y1,K.x1),Ut(K.y0,K.x0),!f))}else r.lineTo(h+Z,c+U),r.arc(h,c,n,u,l,f)}r.closePath()}}}var WT=(function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r})(),_o=(function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new WT},t.prototype.buildPath=function(e,i){HT(e,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t})(bt);_o.prototype.type="sector";var GT=(function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r})(),_l=(function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new GT},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.PI*2;e.moveTo(n+i.r,a),e.arc(n,a,i.r,0,o,!1),e.moveTo(n+i.r0,a),e.arc(n,a,i.r0,0,o,!0)},t})(bt);_l.prototype.type="ring";function UT(r,t,e,i){var n=[],a=[],o=[],s=[],l,u,h,c;if(i){h=[1/0,1/0],c=[-1/0,-1/0];for(var f=0,d=r.length;f<d;f++)jr(h,h,r[f]),Nr(c,c,r[f]);jr(h,h,i[0]),Nr(c,c,i[1])}for(var f=0,d=r.length;f<d;f++){var p=r[f];if(e)l=r[f?f-1:d-1],u=r[(f+1)%d];else if(f===0||f===d-1){n.push(Jm(r[f]));continue}else l=r[f-1],u=r[f+1];Qm(a,u,l),ls(a,a,t);var v=Ms(p,l),g=Ms(p,u),m=v+g;m!==0&&(v/=m,g/=m),ls(o,a,-v),ls(s,a,g);var _=_h([],p,o),b=_h([],p,s);i&&(Nr(_,_,h),jr(_,_,c),Nr(b,b,h),jr(b,b,c)),n.push(_),n.push(b)}return e&&n.push(n.shift()),n}function p0(r,t,e){var i=t.smooth,n=t.points;if(n&&n.length>=2){if(i){var a=UT(n,i,e,t.smoothConstraint);r.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(e?o:o-1);s++){var l=a[s*2],u=a[s*2+1],h=n[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{r.moveTo(n[0][0],n[0][1]);for(var s=1,c=n.length;s<c;s++)r.lineTo(n[s][0],n[s][1])}e&&r.closePath()}}var $T=(function(){function r(){this.points=null,this.smooth=0,this.smoothConstraint=null}return r})(),bo=(function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new $T},t.prototype.buildPath=function(e,i){p0(e,i,!0)},t})(bt);bo.prototype.type="polygon";var YT=(function(){function r(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return r})(),xo=(function(r){B(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 YT},t.prototype.buildPath=function(e,i){p0(e,i,!1)},t})(bt);xo.prototype.type="polyline";var XT={},ZT=(function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return r})(),Ye=(function(r){B(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 ZT},t.prototype.buildPath=function(e,i){var n,a,o,s;if(this.subPixelOptimize){var l=qy(XT,i,this.style);n=l.x1,a=l.y1,o=l.x2,s=l.y2}else n=i.x1,a=i.y1,o=i.x2,s=i.y2;var u=i.percent;u!==0&&(e.moveTo(n,a),u<1&&(o=n*(1-u)+o*u,s=a*(1-u)+s*u),e.lineTo(o,s))},t.prototype.pointAt=function(e){var i=this.shape;return[i.x1*(1-e)+i.x2*e,i.y1*(1-e)+i.y2*e]},t})(bt);Ye.prototype.type="line";var se=[],qT=(function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return r})();function Ep(r,t,e){var i=r.cpx2,n=r.cpy2;return i!=null||n!=null?[(e?jd:Ht)(r.x1,r.cpx1,r.cpx2,r.x2,t),(e?jd:Ht)(r.y1,r.cpy1,r.cpy2,r.y2,t)]:[(e?Nd:he)(r.x1,r.cpx1,r.x2,t),(e?Nd:he)(r.y1,r.cpy1,r.y2,t)]}var bl=(function(r){B(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 qT},t.prototype.buildPath=function(e,i){var n=i.x1,a=i.y1,o=i.x2,s=i.y2,l=i.cpx1,u=i.cpy1,h=i.cpx2,c=i.cpy2,f=i.percent;f!==0&&(e.moveTo(n,a),h==null||c==null?(f<1&&(Rs(n,l,o,f,se),l=se[1],o=se[2],Rs(a,u,s,f,se),u=se[1],s=se[2]),e.quadraticCurveTo(l,u,o,s)):(f<1&&(ks(n,l,h,o,f,se),l=se[1],h=se[2],o=se[3],ks(a,u,c,s,f,se),u=se[1],c=se[2],s=se[3]),e.bezierCurveTo(l,u,h,c,o,s)))},t.prototype.pointAt=function(e){return Ep(this.shape,e,!1)},t.prototype.tangentAt=function(e){var i=Ep(this.shape,e,!0);return ty(i,i)},t})(bt);bl.prototype.type="bezier-curve";var KT=(function(){function r(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r})(),wo=(function(r){B(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 KT},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.max(i.r,0),s=i.startAngle,l=i.endAngle,u=i.clockwise,h=Math.cos(s),c=Math.sin(s);e.moveTo(h*o+n,c*o+a),e.arc(n,a,o,s,l,!u)},t})(bt);wo.prototype.type="arc";var of=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="compound",e}return t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,i=this.shapeChanged(),n=0;n<e.length;n++)i=i||e[n].shapeChanged();i&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],i=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(i[0],i[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,i){for(var n=i.paths||[],a=0;a<n.length;a++)n[a].buildPath(e,n[a].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],i=0;i<e.length;i++)e[i].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),bt.prototype.getBoundingRect.call(this)},t})(bt),v0=(function(){function r(t){this.colorStops=t||[]}return r.prototype.addColorStop=function(t,e){this.colorStops.push({offset:t,color:e})},r})(),sf=(function(r){B(t,r);function t(e,i,n,a,o,s){var l=r.call(this,o)||this;return l.x=e??0,l.y=i??0,l.x2=n??1,l.y2=a??0,l.type="linear",l.global=s||!1,l}return t})(v0),g0=(function(r){B(t,r);function t(e,i,n,a,o){var s=r.call(this,a)||this;return s.x=e??.5,s.y=i??.5,s.r=n??.5,s.type="radial",s.global=o||!1,s}return t})(v0),_i=[0,0],bi=[0,0],Go=new wt,Uo=new wt,js=(function(){function r(t,e){this._corners=[],this._axes=[],this._origin=[0,0];for(var i=0;i<4;i++)this._corners[i]=new wt;for(var i=0;i<2;i++)this._axes[i]=new wt;t&&this.fromBoundingRect(t,e)}return r.prototype.fromBoundingRect=function(t,e){var i=this._corners,n=this._axes,a=t.x,o=t.y,s=a+t.width,l=o+t.height;if(i[0].set(a,o),i[1].set(s,o),i[2].set(s,l),i[3].set(a,l),e)for(var u=0;u<4;u++)i[u].transform(e);wt.sub(n[0],i[1],i[0]),wt.sub(n[1],i[3],i[0]),n[0].normalize(),n[1].normalize();for(var u=0;u<2;u++)this._origin[u]=n[u].dot(i[0])},r.prototype.intersect=function(t,e){var i=!0,n=!e;return Go.set(1/0,1/0),Uo.set(0,0),!this._intersectCheckOneSide(this,t,Go,Uo,n,1)&&(i=!1,n)||!this._intersectCheckOneSide(t,this,Go,Uo,n,-1)&&(i=!1,n)||n||wt.copy(e,i?Go:Uo),i},r.prototype._intersectCheckOneSide=function(t,e,i,n,a,o){for(var s=!0,l=0;l<2;l++){var u=this._axes[l];if(this._getProjMinMaxOnAxis(l,t._corners,_i),this._getProjMinMaxOnAxis(l,e._corners,bi),_i[1]<bi[0]||_i[0]>bi[1]){if(s=!1,a)return s;var h=Math.abs(bi[0]-_i[1]),c=Math.abs(_i[0]-bi[1]);Math.min(h,c)>n.len()&&(h<c?wt.scale(n,u,-h*o):wt.scale(n,u,c*o))}else if(i){var h=Math.abs(bi[0]-_i[1]),c=Math.abs(_i[0]-bi[1]);Math.min(h,c)<i.len()&&(h<c?wt.scale(i,u,h*o):wt.scale(i,u,-c*o))}}return s},r.prototype._getProjMinMaxOnAxis=function(t,e,i){for(var n=this._axes[t],a=this._origin,o=e[0].dot(n)+a[t],s=o,l=o,u=1;u<e.length;u++){var h=e[u].dot(n)+a[t];s=Math.min(h,s),l=Math.max(h,l)}i[0]=s,i[1]=l},r})(),JT=[],m0=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.notClear=!0,e.incremental=!0,e._displayables=[],e._temporaryDisplayables=[],e._cursor=0,e}return t.prototype.traverse=function(e,i){e.call(i,this)},t.prototype.useStyle=function(){this.style={}},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,i){i?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,i){i=i||!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],i)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var i=this._cursor;i<this._displayables.length;i++)e&&e(this._displayables[i]);for(var i=0;i<this._temporaryDisplayables.length;i++)e&&e(this._temporaryDisplayables[i])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){var i=this._displayables[e];i.parent=this,i.update(),i.parent=null}for(var e=0;e<this._temporaryDisplayables.length;e++){var i=this._temporaryDisplayables[e];i.parent=this,i.update(),i.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new mt(1/0,1/0,-1/0,-1/0),i=0;i<this._displayables.length;i++){var n=this._displayables[i],a=n.getBoundingRect().clone();n.needLocalTransform()&&a.applyTransform(n.getLocalTransform(JT)),e.union(a)}this._rect=e}return this._rect},t.prototype.contain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect();if(a.contain(n[0],n[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(e,i))return!0}return!1},t})(mo),QT=kt();function tA(r,t,e,i,n){var a;if(t&&t.ecModel){var o=t.ecModel.getUpdatePayload();a=o&&o.animation}var s=t&&t.isAnimationEnabled(),l=r==="update";if(s){var u=void 0,h=void 0,c=void 0;i?(u=Q(i.duration,200),h=Q(i.easing,"cubicOut"),c=0):(u=t.getShallow(l?"animationDurationUpdate":"animationDuration"),h=t.getShallow(l?"animationEasingUpdate":"animationEasing"),c=t.getShallow(l?"animationDelayUpdate":"animationDelay")),a&&(a.duration!=null&&(u=a.duration),a.easing!=null&&(h=a.easing),a.delay!=null&&(c=a.delay)),tt(c)&&(c=c(e,n)),tt(u)&&(u=u(e));var f={duration:u||0,delay:c,easing:h};return f}else return null}function lf(r,t,e,i,n,a,o){var s=!1,l;tt(n)?(o=a,a=n,n=null):q(n)&&(a=n.cb,o=n.during,s=n.isFrom,l=n.removeOpt,n=n.dataIndex);var u=r==="leave";u||t.stopAnimation("leave");var h=tA(r,i,n,u?l||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(t,n):null);if(h&&h.duration>0){var c=h.duration,f=h.delay,d=h.easing,p={duration:c,delay:f||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?t.animateFrom(e,p):t.animateTo(e,p)}else t.stopAnimation(),!s&&t.attr(e),o&&o(1),a&&a()}function Jr(r,t,e,i,n,a){lf("update",r,t,e,i,n,a)}function $n(r,t,e,i,n,a){lf("enter",r,t,e,i,n,a)}function Oa(r){if(!r.__zr)return!0;for(var t=0;t<r.animators.length;t++){var e=r.animators[t];if(e.scope==="leave")return!0}return!1}function Ns(r,t,e,i,n,a){Oa(r)||lf("leave",r,t,e,i,n,a)}function jp(r,t,e,i){r.removeTextContent(),r.removeTextGuideLine(),Ns(r,{style:{opacity:0}},t,e,i)}function eA(r,t,e){function i(){r.parent&&r.parent.remove(r)}r.isGroup?r.traverse(function(n){n.isGroup||jp(n,t,e,i)}):jp(r,t,e,i)}function rA(r){QT(r).oldStyle=r.style}var Fs=Math.max,Bs=Math.min,Xh={};function y0(r){return bt.extend(r)}var iA=ET;function _0(r,t){return iA(r,t)}function Le(r,t){Xh[r]=t}function b0(r){if(Xh.hasOwnProperty(r))return Xh[r]}function xl(r,t,e,i){var n=OT(r,t);return e&&(i==="center"&&(e=x0(e,n.getBoundingRect())),hf(n,e)),n}function uf(r,t,e){var i=new Ze({style:{image:r,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(n){if(e==="center"){var a={width:n.width,height:n.height};i.setStyle(x0(t,a))}}});return i}function x0(r,t){var e=t.width/t.height,i=r.height*e,n;i<=r.width?n=r.height:(i=r.width,n=i/e);var a=r.x+r.width/2,o=r.y+r.height/2;return{x:a-i/2,y:o-n/2,width:i,height:n}}var w0=jT;function hf(r,t){if(r.applyTransform){var e=r.getBoundingRect(),i=e.calculateTransform(t);r.applyTransform(i)}}function Ka(r,t){return qy(r,r,{lineWidth:t}),r}function nA(r){return Ky(r.shape,r.shape,r.style),r}var aA=Ri;function wl(r,t){for(var e=co([]);r&&r!==t;)Gr(e,r.getLocalTransform(),e),r=r.parent;return e}function Sl(r,t,e){return t&&!ne(t)&&(t=Yc.getLocalTransform(t)),e&&(t=po([],t)),re([],r,t)}function S0(r,t,e){var i=t[4]===0||t[5]===0||t[0]===0?1:Math.abs(2*t[4]/t[0]),n=t[4]===0||t[5]===0||t[2]===0?1:Math.abs(2*t[4]/t[2]),a=[r==="left"?-i:r==="right"?i:0,r==="top"?-n:r==="bottom"?n:0];return a=Sl(a,t,e),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Np(r){return!r.isGroup}function oA(r){return r.shape!=null}function C0(r,t,e){if(!r||!t)return;function i(o){var s={};return o.traverse(function(l){Np(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return oA(o)&&(s.shape=F({},o.shape)),s}var a=i(r);t.traverse(function(o){if(Np(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Jr(o,l,e,_t(o).dataIndex)}}})}function cf(r,t){return H(r,function(e){var i=e[0];i=Fs(i,t.x),i=Bs(i,t.x+t.width);var n=e[1];return n=Fs(n,t.y),n=Bs(n,t.y+t.height),[i,n]})}function T0(r,t){var e=Fs(r.x,t.x),i=Bs(r.x+r.width,t.x+t.width),n=Fs(r.y,t.y),a=Bs(r.y+r.height,t.y+t.height);if(i>=e&&a>=n)return{x:e,y:n,width:i-e,height:a-n}}function So(r,t,e){var i=F({rectHover:!0},t),n=i.style={strokeNoScale:!0};if(e=e||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(n.image=r.slice(8),lt(n,e),new Ze(i)):xl(r.replace("path://",""),i,e,"center")}function sA(r,t,e,i,n){for(var a=0,o=n[n.length-1];a<n.length;a++){var s=n[a];if(A0(r,t,e,i,s[0],s[1],o[0],o[1]))return!0;o=s}}function A0(r,t,e,i,n,a,o,s){var l=e-r,u=i-t,h=o-n,c=s-a,f=Au(h,c,l,u);if(lA(f))return!1;var d=r-n,p=t-a,v=Au(d,p,l,u)/f;if(v<0||v>1)return!1;var g=Au(d,p,h,c)/f;return!(g<0||g>1)}function Au(r,t,e,i){return r*i-e*t}function lA(r){return r<=1e-6&&r>=-1e-6}function Cl(r){var t=r.itemTooltipOption,e=r.componentModel,i=r.itemName,n=$(t)?{formatter:t}:t,a=e.mainType,o=e.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&A(vt(l),function(h){Vi(s,h)||(s[h]=l[h],s.$vars.push(h))});var u=_t(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:lt({content:i,encodeHTMLContent:!0,formatterParams:s},n)}}function Fp(r,t){var e;r.isGroup&&(e=t(r)),e||r.traverse(t)}function ff(r,t){if(r)if(G(r))for(var e=0;e<r.length;e++)Fp(r[e],t);else Fp(r,t)}Le("circle",yo);Le("ellipse",yl);Le("sector",_o);Le("ring",_l);Le("polygon",bo);Le("polyline",xo);Le("rect",Nt);Le("line",Ye);Le("bezierCurve",bl);Le("arc",wo);const uA=Object.freeze(Object.defineProperty({__proto__:null,Arc:wo,BezierCurve:bl,BoundingRect:mt,Circle:yo,CompoundPath:of,Ellipse:yl,Group:Ft,Image:Ze,IncrementalDisplayable:m0,Line:Ye,LinearGradient:sf,OrientedBoundingRect:js,Path:bt,Point:wt,Polygon:bo,Polyline:xo,RadialGradient:g0,Rect:Nt,Ring:_l,Sector:_o,Text:zt,applyTransform:Sl,clipPointsByRect:cf,clipRectByRect:T0,createIcon:So,extendPath:_0,extendShape:y0,getShapeClass:b0,getTransform:wl,groupTransition:C0,initProps:$n,isElementRemoved:Oa,lineLineIntersect:A0,linePolygonIntersect:sA,makeImage:uf,makePath:xl,mergePath:w0,registerShape:Le,removeElement:Ns,removeElementWithFadeOut:eA,resizePath:hf,setTooltipConfig:Cl,subPixelOptimize:aA,subPixelOptimizeLine:Ka,subPixelOptimizeRect:nA,transformDirection:S0,traverseElements:ff,updateProps:Jr},Symbol.toStringTag,{value:"Module"}));var Tl={};function hA(r,t){for(var e=0;e<ur.length;e++){var i=ur[e],n=t[i],a=r.ensureState(i);a.style=a.style||{},a.style.text=n}var o=r.currentStates.slice();r.clearStates(!0),r.setStyle({text:t.normal}),r.useStates(o,!0)}function Bp(r,t,e){var i=r.labelFetcher,n=r.labelDataIndex,a=r.labelDimIndex,o=t.normal,s;i&&(s=i.getFormattedLabel(n,"normal",null,a,o&&o.get("formatter"),e!=null?{interpolatedValue:e}:null)),s==null&&(s=tt(r.defaultText)?r.defaultText(n,r,e):r.defaultText);for(var l={normal:s},u=0;u<ur.length;u++){var h=ur[u],c=t[h];l[h]=Q(i?i.getFormattedLabel(n,h,null,a,c&&c.get("formatter")):null,s)}return l}function I0(r,t,e,i){e=e||Tl;for(var n=r instanceof zt,a=!1,o=0;o<xp.length;o++){var s=t[xp[o]];if(s&&s.getShallow("show")){a=!0;break}}var l=n?r:r.getTextContent();if(a){n||(l||(l=new zt,r.setTextContent(l)),r.stateProxy&&(l.stateProxy=r.stateProxy));var u=Bp(e,t),h=t.normal,c=!!h.getShallow("show"),f=$e(h,i&&i.normal,e,!1,!n);f.text=u.normal,n||r.setTextConfig(zp(h,e,!1));for(var o=0;o<ur.length;o++){var d=ur[o],s=t[d];if(s){var p=l.ensureState(d),v=!!Q(s.getShallow("show"),c);if(v!==c&&(p.ignore=!v),p.style=$e(s,i&&i[d],e,!0,!n),p.style.text=u[d],!n){var g=r.ensureState(d);g.textConfig=zp(s,e,!0)}}}l.silent=!!h.getShallow("silent"),l.style.x!=null&&(f.x=l.style.x),l.style.y!=null&&(f.y=l.style.y),l.ignore=!c,l.useStyle(f),l.dirty(),e.enableTextSetter&&(D0(l).setLabelText=function(m){var _=Bp(e,t,m);hA(l,_)})}else l&&(l.ignore=!0);r.dirty()}function df(r,t){t=t||"label";for(var e={normal:r.getModel(t)},i=0;i<ur.length;i++){var n=ur[i];e[n]=r.getModel([n,t])}return e}function $e(r,t,e,i,n){var a={};return cA(a,r,e,i,n),t&&F(a,t),a}function zp(r,t,e){t=t||{};var i={},n,a=r.getShallow("rotate"),o=Q(r.getShallow("distance"),e?null:5),s=r.getShallow("offset");return n=r.getShallow("position")||(e?null:"inside"),n==="outside"&&(n=t.defaultOutsidePosition||"top"),n!=null&&(i.position=n),s!=null&&(i.offset=s),a!=null&&(a*=Math.PI/180,i.rotation=a),o!=null&&(i.distance=o),i.outsideFill=r.get("color")==="inherit"?t.inheritColor||null:"auto",i}function cA(r,t,e,i,n){e=e||Tl;var a=t.ecModel,o=a&&a.option.textStyle,s=fA(t),l;if(s){l={};for(var u in s)if(s.hasOwnProperty(u)){var h=t.getModel(["rich",u]);Gp(l[u]={},h,o,e,i,n,!1,!0)}}l&&(r.rich=l);var c=t.get("overflow");c&&(r.overflow=c);var f=t.get("minMargin");f!=null&&(r.margin=f),Gp(r,t,o,e,i,n,!0,!1)}function fA(r){for(var t;r&&r!==r.ecModel;){var e=(r.option||Tl).rich;if(e){t=t||{};for(var i=vt(e),n=0;n<i.length;n++){var a=i[n];t[a]=1}}r=r.parentModel}return t}var Vp=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Hp=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Wp=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function Gp(r,t,e,i,n,a,o,s){e=!n&&e||Tl;var l=i&&i.inheritColor,u=t.getShallow("color"),h=t.getShallow("textBorderColor"),c=Q(t.getShallow("opacity"),e.opacity);(u==="inherit"||u==="auto")&&(l?u=l:u=null),(h==="inherit"||h==="auto")&&(l?h=l:h=null),a||(u=u||e.color,h=h||e.textBorderColor),u!=null&&(r.fill=u),h!=null&&(r.stroke=h);var f=Q(t.getShallow("textBorderWidth"),e.textBorderWidth);f!=null&&(r.lineWidth=f);var d=Q(t.getShallow("textBorderType"),e.textBorderType);d!=null&&(r.lineDash=d);var p=Q(t.getShallow("textBorderDashOffset"),e.textBorderDashOffset);p!=null&&(r.lineDashOffset=p),!n&&c==null&&!s&&(c=i&&i.defaultOpacity),c!=null&&(r.opacity=c),!n&&!a&&r.fill==null&&i.inheritColor&&(r.fill=i.inheritColor);for(var v=0;v<Vp.length;v++){var g=Vp[v],m=Q(t.getShallow(g),e[g]);m!=null&&(r[g]=m)}for(var v=0;v<Hp.length;v++){var g=Hp[v],m=t.getShallow(g);m!=null&&(r[g]=m)}if(r.verticalAlign==null){var _=t.getShallow("baseline");_!=null&&(r.verticalAlign=_)}if(!o||!i.disableBox){for(var v=0;v<Wp.length;v++){var g=Wp[v],m=t.getShallow(g);m!=null&&(r[g]=m)}var b=t.getShallow("borderType");b!=null&&(r.borderDash=b),(r.backgroundColor==="auto"||r.backgroundColor==="inherit")&&l&&(r.backgroundColor=l),(r.borderColor==="auto"||r.borderColor==="inherit")&&l&&(r.borderColor=l)}}function M0(r,t){var e=t&&t.getModel("textStyle");return We([r.fontStyle||e&&e.getShallow("fontStyle")||"",r.fontWeight||e&&e.getShallow("fontWeight")||"",(r.fontSize||e&&e.getShallow("fontSize")||12)+"px",r.fontFamily||e&&e.getShallow("fontFamily")||"sans-serif"].join(" "))}var D0=kt(),dA=["textStyle","color"],Iu=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Mu=new zt,pA=(function(){function r(){}return r.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(dA):null)},r.prototype.getFont=function(){return M0({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},r.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},i=0;i<Iu.length;i++)e[Iu[i]]=this.getShallow(Iu[i]);return Mu.useStyle(e),Mu.update(),Mu.getBoundingRect()},r})(),P0=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],vA=Za(P0),gA=(function(){function r(){}return r.prototype.getLineStyle=function(t){return vA(this,t)},r})(),k0=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],mA=Za(k0),yA=(function(){function r(){}return r.prototype.getItemStyle=function(t,e){return mA(this,t,e)},r})(),Tt=(function(){function r(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}return r.prototype.init=function(t,e,i){},r.prototype.mergeOption=function(t,e){st(this.option,t,!0)},r.prototype.get=function(t,e){return t==null?this.option:this._doGet(this.parsePath(t),!e&&this.parentModel)},r.prototype.getShallow=function(t,e){var i=this.option,n=i==null?i:i[t];if(n==null&&!e){var a=this.parentModel;a&&(n=a.getShallow(t))}return n},r.prototype.getModel=function(t,e){var i=t!=null,n=i?this.parsePath(t):null,a=i?this._doGet(n):this.option;return e=e||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(n)),new r(a,e,this.ecModel)},r.prototype.isEmpty=function(){return this.option==null},r.prototype.restoreData=function(){},r.prototype.clone=function(){var t=this.constructor;return new t(it(this.option))},r.prototype.parsePath=function(t){return typeof t=="string"?t.split("."):t},r.prototype.resolveParentPath=function(t){return t},r.prototype.isAnimationEnabled=function(){if(!J.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},r.prototype._doGet=function(t,e){var i=this.option;if(!t)return i;for(var n=0;n<t.length&&!(t[n]&&(i=i&&typeof i=="object"?i[t[n]]:null,i==null));n++);return i==null&&e&&(i=e._doGet(this.resolveParentPath(t),e.parentModel)),i},r})();Qc(Tt);gC(Tt);be(Tt,gA);be(Tt,yA);be(Tt,xC);be(Tt,pA);var _A=Math.round(Math.random()*10);function Co(r){return[r||"",_A++].join("_")}function bA(r){var t={};r.registerSubTypeDefaulter=function(e,i){var n=or(e);t[n.main]=i},r.determineSubType=function(e,i){var n=i.type;if(!n){var a=or(e).main;r.hasSubTypes(e)&&t[a]&&(n=t[a](i))}return n}}function xA(r,t){r.topologicalTravel=function(a,o,s,l){if(!a.length)return;var u=e(o),h=u.graph,c=u.noEntryList,f={};for(A(a,function(_){f[_]=!0});c.length;){var d=c.pop(),p=h[d],v=!!f[d];v&&(s.call(l,d,p.originalDeps.slice()),delete f[d]),A(p.successor,v?m:g)}A(f,function(){var _="";throw new Error(_)});function g(_){h[_].entryCount--,h[_].entryCount===0&&c.push(_)}function m(_){f[_]=!0,g(_)}};function e(a){var o={},s=[];return A(a,function(l){var u=i(o,l),h=u.originalDeps=t(l),c=n(h,a);u.entryCount=c.length,u.entryCount===0&&s.push(l),A(c,function(f){pt(u.predecessor,f)<0&&u.predecessor.push(f);var d=i(o,f);pt(d.successor,f)<0&&d.successor.push(l)})}),{graph:o,noEntryList:s}}function i(a,o){return a[o]||(a[o]={predecessor:[],successor:[]}),a[o]}function n(a,o){var s=[];return A(a,function(l){pt(o,l)>=0&&s.push(l)}),s}}function wA(r,t){return st(st({},r,!0),t,!0)}const SA={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},CA={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var zs="ZH",pf="EN",Rn=pf,ms={},vf={},R0=J.domSupported?(function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||Rn).toUpperCase();return r.indexOf(zs)>-1?zs:Rn})():Rn;function gf(r,t){r=r.toUpperCase(),vf[r]=new Tt(t),ms[r]=t}function TA(r){if($(r)){var t=ms[r.toUpperCase()]||{};return r===zs||r===pf?it(t):st(it(t),it(ms[Rn]),!1)}else return st(it(r),it(ms[Rn]),!1)}function AA(r){return vf[r]}function IA(){return vf[Rn]}gf(pf,SA);gf(zs,CA);var mf=1e3,yf=mf*60,Ea=yf*60,ke=Ea*24,Up=ke*365,xa={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},$o="{yyyy}-{MM}-{dd}",$p={year:"{yyyy}",month:"{yyyy}-{MM}",day:$o,hour:$o+" "+xa.hour,minute:$o+" "+xa.minute,second:$o+" "+xa.second,millisecond:xa.none},Du=["year","month","day","hour","minute","second","millisecond"],L0=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Qt(r,t){return r+="","0000".substr(0,t-r.length)+r}function Ln(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function MA(r){return r===Ln(r)}function DA(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function To(r,t,e,i){var n=Re(r),a=n[_f(e)](),o=n[On(e)]()+1,s=Math.floor((o-1)/3)+1,l=n[Al(e)](),u=n["get"+(e?"UTC":"")+"Day"](),h=n[Ja(e)](),c=(h-1)%12+1,f=n[Il(e)](),d=n[Ml(e)](),p=n[Dl(e)](),v=h>=12?"pm":"am",g=v.toUpperCase(),m=i instanceof Tt?i:AA(i||R0)||IA(),_=m.getModel("time"),b=_.get("month"),x=_.get("monthAbbr"),C=_.get("dayOfWeek"),S=_.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,v+"").replace(/{A}/g,g+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Qt(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,Qt(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Qt(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,C[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Qt(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,Qt(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,Qt(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,Qt(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,Qt(p,3)).replace(/{S}/g,p+"")}function PA(r,t,e,i,n){var a=null;if($(e))a=e;else if(tt(e))a=e(r.value,t,{level:r.level});else{var o=F({},xa);if(r.level>0)for(var s=0;s<Du.length;++s)o[Du[s]]="{primary|"+o[Du[s]]+"}";var l=e?e.inherit===!1?e:lt(e,o):o,u=O0(r.value,n);if(l[u])a=l[u];else if(l.inherit){for(var h=L0.indexOf(u),s=h-1;s>=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(G(a)){var c=r.level==null?0:r.level>=0?r.level:a.length+r.level;c=Math.min(c,a.length-1),a=a[c]}}return To(new Date(r.value),a,n,i)}function O0(r,t){var e=Re(r),i=e[On(t)]()+1,n=e[Al(t)](),a=e[Ja(t)](),o=e[Il(t)](),s=e[Ml(t)](),l=e[Dl(t)](),u=l===0,h=u&&s===0,c=h&&o===0,f=c&&a===0,d=f&&n===1,p=d&&i===1;return p?"year":d?"month":f?"day":c?"hour":h?"minute":u?"second":"millisecond"}function Yp(r,t,e){var i=At(r)?Re(r):r;switch(t=t||O0(r,e),t){case"year":return i[_f(e)]();case"half-year":return i[On(e)]()>=6?1:0;case"quarter":return Math.floor((i[On(e)]()+1)/4);case"month":return i[On(e)]();case"day":return i[Al(e)]();case"half-day":return i[Ja(e)]()/24;case"hour":return i[Ja(e)]();case"minute":return i[Il(e)]();case"second":return i[Ml(e)]();case"millisecond":return i[Dl(e)]()}}function _f(r){return r?"getUTCFullYear":"getFullYear"}function On(r){return r?"getUTCMonth":"getMonth"}function Al(r){return r?"getUTCDate":"getDate"}function Ja(r){return r?"getUTCHours":"getHours"}function Il(r){return r?"getUTCMinutes":"getMinutes"}function Ml(r){return r?"getUTCSeconds":"getSeconds"}function Dl(r){return r?"getUTCMilliseconds":"getMilliseconds"}function kA(r){return r?"setUTCFullYear":"setFullYear"}function E0(r){return r?"setUTCMonth":"setMonth"}function j0(r){return r?"setUTCDate":"setDate"}function N0(r){return r?"setUTCHours":"setHours"}function F0(r){return r?"setUTCMinutes":"setMinutes"}function B0(r){return r?"setUTCSeconds":"setSeconds"}function z0(r){return r?"setUTCMilliseconds":"setMilliseconds"}function RA(r,t,e,i,n,a,o,s){var l=new zt({style:{text:r,font:t,align:e,verticalAlign:i,padding:n,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function bf(r){if(!Ey(r))return $(r)?r:"-";var t=(r+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function xf(r,t){return r=(r||"").toLowerCase().replace(/-(.)/g,function(e,i){return i.toUpperCase()}),t&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var Ao=Fc;function Zh(r,t,e){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(h){return h&&We(h)?h:"-"}function a(h){return!!(h!=null&&!isNaN(h)&&isFinite(h))}var o=t==="time",s=r instanceof Date;if(o||s){var l=o?Re(r):r;if(isNaN(+l)){if(s)return"-"}else return To(l,i,e)}if(t==="ordinal")return As(r)?n(r):At(r)&&a(r)?r+"":"-";var u=Ya(r);return a(u)?bf(u):As(r)?n(r):typeof r=="boolean"?r+"":"-"}var Xp=["a","b","c","d","e","f","g"],Pu=function(r,t){return"{"+r+(t??"")+"}"};function wf(r,t,e){G(t)||(t=[t]);var i=t.length;if(!i)return"";for(var n=t[0].$vars||[],a=0;a<n.length;a++){var o=Xp[a];r=r.replace(Pu(o),Pu(o,0))}for(var s=0;s<i;s++)for(var l=0;l<n.length;l++){var u=t[s][n[l]];r=r.replace(Pu(Xp[l],s),e?qt(u):u)}return r}function V0(r,t){var e=$(r)?{color:r,extraCssText:t}:r||{},i=e.color,n=e.type;t=e.extraCssText;var a=e.renderMode||"html";if(!i)return"";if(a==="html")return n==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+qt(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+qt(i)+";"+(t||"")+'"></span>';var o=e.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function LA(r,t,e){(r==="week"||r==="month"||r==="quarter"||r==="half-year"||r==="year")&&(r=`MM-dd
|
|
31
|
+
yyyy`);var i=Re(t),n=e?"getUTC":"get",a=i[n+"FullYear"](),o=i[n+"Month"]()+1,s=i[n+"Date"](),l=i[n+"Hours"](),u=i[n+"Minutes"](),h=i[n+"Seconds"](),c=i[n+"Milliseconds"]();return r=r.replace("MM",Qt(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Qt(a%100+"",2)).replace("dd",Qt(s,2)).replace("d",s).replace("hh",Qt(l,2)).replace("h",l).replace("mm",Qt(u,2)).replace("m",u).replace("ss",Qt(h,2)).replace("s",h).replace("SSS",Qt(c,3)),r}function OA(r){return r&&r.charAt(0).toUpperCase()+r.substr(1)}function Wi(r,t){return t=t||"transparent",$(r)?r:q(r)&&r.colorStops&&(r.colorStops[0]||{}).color||t}function Zp(r,t){if(t==="_blank"||t==="blank"){var e=window.open();e.opener=null,e.location.href=r}else window.open(r,t)}var ys=A,EA=["left","right","top","bottom","width","height"],Yo=[["width","left","right"],["height","top","bottom"]];function Sf(r,t,e,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;t.eachChild(function(l,u){var h=l.getBoundingRect(),c=t.childAt(u+1),f=c&&c.getBoundingRect(),d,p;if(r==="horizontal"){var v=h.width+(f?-f.x+h.x:0);d=a+v,d>i||l.newline?(a=0,d=v,o+=s+e,s=h.height):s=Math.max(s,h.height)}else{var g=h.height+(f?-f.y+h.y:0);p=o+g,p>n||l.newline?(a+=s+e,o=0,p=g,s=h.width):s=Math.max(s,h.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=d+e:o=p+e)})}var jA=Sf;Ct(Sf,"vertical");Ct(Sf,"horizontal");function qi(r,t,e){e=Ao(e||0);var i=t.width,n=t.height,a=te(r.left,i),o=te(r.top,n),s=te(r.right,i),l=te(r.bottom,n),u=te(r.width,i),h=te(r.height,n),c=e[2]+e[0],f=e[1]+e[3],d=r.aspect;switch(isNaN(u)&&(u=i-s-f-a),isNaN(h)&&(h=n-l-c-o),d!=null&&(isNaN(u)&&isNaN(h)&&(d>i/n?u=i*.8:h=n*.8),isNaN(u)&&(u=d*h),isNaN(h)&&(h=u/d)),isNaN(a)&&(a=i-s-u-f),isNaN(o)&&(o=n-l-h-c),r.left||r.right){case"center":a=i/2-u/2-e[3];break;case"right":a=i-u-f;break}switch(r.top||r.bottom){case"middle":case"center":o=n/2-h/2-e[0];break;case"bottom":o=n-h-c;break}a=a||0,o=o||0,isNaN(u)&&(u=i-f-a-(s||0)),isNaN(h)&&(h=n-c-o-(l||0));var p=new mt(a+e[3],o+e[0],u,h);return p.margin=e,p}function NA(r,t,e,i,n,a){a=a||r,a.x=r.x,a.y=r.y;var o;if(o=r.getBoundingRect(),r.needLocalTransform()){var s=r.getLocalTransform();o=o.clone(),o.applyTransform(s)}var l=qi(lt({width:o.width,height:o.height},t),e,i),u=l.x-o.x,h=l.y-o.y;return a.x+=u,a.y+=h,a===r&&r.markRedraw(),!0}function Qa(r){var t=r.layoutMode||r.constructor.layoutMode;return q(t)?t:t?{type:t}:null}function to(r,t,e){var i=e&&e.ignoreSize;!G(i)&&(i=[i,i]);var n=o(Yo[0],0),a=o(Yo[1],1);u(Yo[0],r,n),u(Yo[1],r,a);function o(h,c){var f={},d=0,p={},v=0,g=2;if(ys(h,function(b){p[b]=r[b]}),ys(h,function(b){s(t,b)&&(f[b]=p[b]=t[b]),l(f,b)&&d++,l(p,b)&&v++}),i[c])return l(t,h[1])?p[h[2]]=null:l(t,h[2])&&(p[h[1]]=null),p;if(v===g||!d)return p;if(d>=g)return f;for(var m=0;m<h.length;m++){var _=h[m];if(!s(f,_)&&s(r,_)){f[_]=r[_];break}}return f}function s(h,c){return h.hasOwnProperty(c)}function l(h,c){return h[c]!=null&&h[c]!=="auto"}function u(h,c,f){ys(h,function(d){c[d]=f[d]})}}function Cf(r){return FA({},r)}function FA(r,t){return t&&r&&ys(EA,function(e){t.hasOwnProperty(e)&&(r[e]=t[e])}),r}var BA=kt(),dt=(function(r){B(t,r);function t(e,i,n){var a=r.call(this,e,i,n)||this;return a.uid=Co("ec_cpt_model"),a}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,i){var n=Qa(this),a=n?Cf(e):{},o=i.getTheme();st(e,o.get(this.mainType)),st(e,this.getDefaultOption()),n&&to(e,a,n)},t.prototype.mergeOption=function(e,i){st(this.option,e,!0);var n=Qa(this);n&&to(this.option,e,n)},t.prototype.optionUpdated=function(e,i){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!dC(e))return e.defaultOption;var i=BA(this);if(!i.defaultOption){for(var n=[],a=e;a;){var o=a.prototype.defaultOption;o&&n.push(o),a=a.superClass}for(var s={},l=n.length-1;l>=0;l--)s=st(s,n[l],!0);i.defaultOption=s}return i.defaultOption},t.prototype.getReferringComponents=function(e,i){var n=e+"Index",a=e+"Id";return go(this.ecModel,e,{index:this.get(n,!0),id:this.get(a,!0)},i)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=(function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0})(),t})(Tt);Gy(dt,Tt);fl(dt);bA(dt);xA(dt,zA);function zA(r){var t=[];return A(dt.getClassesByMainType(r),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=H(t,function(e){return or(e).main}),r!=="dataset"&&pt(t,"dataset")<=0&&t.unshift("dataset"),t}var H0="";typeof navigator<"u"&&(H0=navigator.platform||"");var cn="rgba(0, 0, 0, 0.2)";const VA={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:cn,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:cn,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:cn,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:cn,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:cn,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:cn,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:H0.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var W0=nt(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Oe="original",de="arrayRows",cr="objectRows",wr="keyedColumns",$r="typedArray",G0="unknown",br="column",Yn="row",ve={Must:1,Might:2,Not:3},U0=kt();function HA(r){U0(r).datasetMap=nt()}function WA(r,t,e){var i={},n=$0(t);if(!n||!r)return i;var a=[],o=[],s=t.ecModel,l=U0(s).datasetMap,u=n.uid+"_"+e.seriesLayoutBy,h,c;r=r.slice(),A(r,function(v,g){var m=q(v)?v:r[g]={name:v};m.type==="ordinal"&&h==null&&(h=g,c=p(m)),i[m.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:c,valueWayDim:0});A(r,function(v,g){var m=v.name,_=p(v);if(h==null){var b=f.valueWayDim;d(i[m],b,_),d(o,b,_),f.valueWayDim+=_}else if(h===g)d(i[m],0,_),d(a,0,_);else{var b=f.categoryWayDim;d(i[m],b,_),d(o,b,_),f.categoryWayDim+=_}});function d(v,g,m){for(var _=0;_<m;_++)v.push(g+_)}function p(v){var g=v.dimsDef;return g?g.length:1}return a.length&&(i.itemName=a),o.length&&(i.seriesName=o),i}function $0(r){var t=r.get("data",!0);if(!t)return go(r.ecModel,"dataset",{index:r.get("datasetIndex",!0),id:r.get("datasetId",!0)},ee).models[0]}function GA(r){return!r.get("transform",!0)&&!r.get("fromTransformResult",!0)?[]:go(r.ecModel,"dataset",{index:r.get("fromDatasetIndex",!0),id:r.get("fromDatasetId",!0)},ee).models}function Y0(r,t){return UA(r.data,r.sourceFormat,r.seriesLayoutBy,r.dimensionsDefine,r.startIndex,t)}function UA(r,t,e,i,n,a){var o,s=5;if(ae(r))return ve.Not;var l,u;if(i){var h=i[a];q(h)?(l=h.name,u=h.type):$(h)&&(l=h)}if(u!=null)return u==="ordinal"?ve.Must:ve.Not;if(t===de){var c=r;if(e===Yn){for(var f=c[a],d=0;d<(f||[]).length&&d<s;d++)if((o=x(f[n+d]))!=null)return o}else for(var d=0;d<c.length&&d<s;d++){var p=c[n+d];if(p&&(o=x(p[a]))!=null)return o}}else if(t===cr){var v=r;if(!l)return ve.Not;for(var d=0;d<v.length&&d<s;d++){var g=v[d];if(g&&(o=x(g[l]))!=null)return o}}else if(t===wr){var m=r;if(!l)return ve.Not;var f=m[l];if(!f||ae(f))return ve.Not;for(var d=0;d<f.length&&d<s;d++)if((o=x(f[d]))!=null)return o}else if(t===Oe)for(var _=r,d=0;d<_.length&&d<s;d++){var g=_[d],b=Un(g);if(!G(b))return ve.Not;if((o=x(b[a]))!=null)return o}function x(C){var S=$(C);if(C!=null&&Number.isFinite(Number(C))&&C!=="")return S?ve.Might:ve.Not;if(S&&C!=="-")return ve.Must}return ve.Not}var qh=nt();function $A(r,t){_e(qh.get(r)==null&&t),qh.set(r,t)}function YA(r,t,e){var i=qh.get(t);if(!i)return e;var n=i(r);return n?e.concat(n):e}var qp=kt();kt();var Tf=(function(){function r(){}return r.prototype.getColorFromPalette=function(t,e,i){var n=ie(this.get("color",!0)),a=this.get("colorLayer",!0);return ZA(this,qp,n,a,t,e,i)},r.prototype.clearColorPalette=function(){qA(this,qp)},r})();function XA(r,t){for(var e=r.length,i=0;i<e;i++)if(r[i].length>t)return r[i];return r[e-1]}function ZA(r,t,e,i,n,a,o){a=a||r;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var h=o==null||!i?e:XA(i,o);if(h=h||e,!(!h||!h.length)){var c=h[l];return n&&(u[n]=c),s.paletteIdx=(l+1)%h.length,c}}function qA(r,t){t(r).paletteIdx=0,t(r).paletteNameMap={}}var Xo,aa,Kp,Jp="\0_ec_inner",KA=1,Af=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Tt(a),this._locale=new Tt(o),this._optionManager=s},t.prototype.setOption=function(e,i,n){var a=ev(i);this._optionManager.setOption(e,n,a),this._resetOption(null,a)},t.prototype.resetOption=function(e,i){return this._resetOption(e,ev(i))},t.prototype._resetOption=function(e,i){var n=!1,a=this._optionManager;if(!e||e==="recreate"){var o=a.mountOption(e==="recreate");!this.option||e==="recreate"?Kp(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((e==="timeline"||e==="media")&&this.restoreData(),!e||e==="recreate"||e==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!e||e==="recreate"||e==="media"){var l=a.getMediaOption(this);l.length&&A(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=nt(),u=i&&i.replaceMergeMainTypeMap;HA(this),A(e,function(c,f){c!=null&&(dt.hasClass(f)?f&&(s.push(f),l.set(f,!0)):n[f]=n[f]==null?it(c):st(n[f],c,!0))}),u&&u.each(function(c,f){dt.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),dt.topologicalTravel(s,dt.getAllClassMainTypes(),h,this);function h(c){var f=YA(this,c,ie(e[c])),d=a.get(c),p=d?u&&u.get(c)?"replaceMerge":"normalMerge":"replaceAll",v=qS(d,f,p);nC(v,c,dt),n[c]=null,a.set(c,null),o.set(c,0);var g=[],m=[],_=0,b;A(v,function(x,C){var S=x.existing,T=x.newOption;if(!T)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var I=c==="series",M=dt.getClass(c,x.keyInfo.subType,!I);if(!M)return;if(c==="tooltip"){if(b)return;b=!0}if(S&&S.constructor===M)S.name=x.keyInfo.name,S.mergeOption(T,this),S.optionUpdated(T,!1);else{var D=F({componentIndex:C},x.keyInfo);S=new M(T,this,this,D),F(S,D),x.brandNew&&(S.__requireNewView=!0),S.init(T,this,this),S.optionUpdated(null,!0)}}S?(g.push(S.option),m.push(S),_++):(g.push(void 0),m.push(void 0))},this),n[c]=g,a.set(c,m),o.set(c,_),c==="series"&&Xo(this)}this._seriesIndices||Xo(this)},t.prototype.getOption=function(){var e=it(this.option);return A(e,function(i,n){if(dt.hasClass(n)){for(var a=ie(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Xa(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,e[n]=a}}),delete e[Jp],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,i){var n=this._componentsMap.get(e);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o<n.length;o++)if(n[o])return n[o]}}},t.prototype.queryComponents=function(e){var i=e.mainType;if(!i)return[];var n=e.index,a=e.id,o=e.name,s=this._componentsMap.get(i);if(!s||!s.length)return[];var l;return n!=null?(l=[],A(ie(n),function(u){s[u]&&l.push(s[u])})):a!=null?l=Qp("id",a,s):o!=null?l=Qp("name",o,s):l=Dt(s,function(u){return!!u}),tv(l,e)},t.prototype.findComponents=function(e){var i=e.query,n=e.mainType,a=s(i),o=a?this.queryComponents(a):Dt(this._componentsMap.get(n),function(u){return!!u});return l(tv(o,e));function s(u){var h=n+"Index",c=n+"Id",f=n+"Name";return u&&(u[h]!=null||u[c]!=null||u[f]!=null)?{mainType:n,index:u[h],id:u[c],name:u[f]}:null}function l(u){return e.filter?Dt(u,e.filter):u}},t.prototype.eachComponent=function(e,i,n){var a=this._componentsMap;if(tt(e)){var o=i,s=e;a.each(function(c,f){for(var d=0;c&&d<c.length;d++){var p=c[d];p&&s.call(o,f,p,p.componentIndex)}})}else for(var l=$(e)?a.get(e):q(e)?this.findComponents(e):null,u=0;l&&u<l.length;u++){var h=l[u];h&&i.call(n,h,h.componentIndex)}},t.prototype.getSeriesByName=function(e){var i=Ue(e,null);return Dt(this._componentsMap.get("series"),function(n){return!!n&&i!=null&&n.name===i})},t.prototype.getSeriesByIndex=function(e){return this._componentsMap.get("series")[e]},t.prototype.getSeriesByType=function(e){return Dt(this._componentsMap.get("series"),function(i){return!!i&&i.subType===e})},t.prototype.getSeries=function(){return Dt(this._componentsMap.get("series"),function(e){return!!e})},t.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},t.prototype.eachSeries=function(e,i){aa(this),A(this._seriesIndices,function(n){var a=this._componentsMap.get("series")[n];e.call(i,a,n)},this)},t.prototype.eachRawSeries=function(e,i){A(this._componentsMap.get("series"),function(n){n&&e.call(i,n,n.componentIndex)})},t.prototype.eachSeriesByType=function(e,i,n){aa(this),A(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];o.subType===e&&i.call(n,o,a)},this)},t.prototype.eachRawSeriesByType=function(e,i,n){return A(this.getSeriesByType(e),i,n)},t.prototype.isSeriesFiltered=function(e){return aa(this),this._seriesIndicesMap.get(e.componentIndex)==null},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,i){aa(this);var n=[];A(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];e.call(i,o,a)&&n.push(a)},this),this._seriesIndices=n,this._seriesIndicesMap=nt(n)},t.prototype.restoreData=function(e){Xo(this);var i=this._componentsMap,n=[];i.each(function(a,o){dt.hasClass(o)&&n.push(o)}),dt.topologicalTravel(n,dt.getAllClassMainTypes(),function(a){A(i.get(a),function(o){o&&(a!=="series"||!JA(o,e))&&o.restoreData()})})},t.internalField=(function(){Xo=function(e){var i=e._seriesIndices=[];A(e._componentsMap.get("series"),function(n){n&&i.push(n.componentIndex)}),e._seriesIndicesMap=nt(i)},aa=function(e){},Kp=function(e,i){e.option={},e.option[Jp]=KA,e._componentsMap=nt({series:[]}),e._componentsCount=nt();var n=i.aria;q(n)&&n.enabled==null&&(n.enabled=!0),QA(i,e._theme.option),st(i,VA,!1),e._mergeOption(i,null)}})(),t})(Tt);function JA(r,t){if(t){var e=t.seriesIndex,i=t.seriesId,n=t.seriesName;return e!=null&&r.componentIndex!==e||i!=null&&r.id!==i||n!=null&&r.name!==n}}function QA(r,t){var e=r.color&&!r.colorLayer;A(t,function(i,n){n==="colorLayer"&&e||dt.hasClass(n)||(typeof i=="object"?r[n]=r[n]?st(r[n],i,!1):it(i):r[n]==null&&(r[n]=i))})}function Qp(r,t,e){if(G(t)){var i=nt();return A(t,function(a){if(a!=null){var o=Ue(a,null);o!=null&&i.set(a,!0)}}),Dt(e,function(a){return a&&i.get(a[r])})}else{var n=Ue(t,null);return Dt(e,function(a){return a&&n!=null&&a[r]===n})}}function tv(r,t){return t.hasOwnProperty("subType")?Dt(r,function(e){return e&&e.subType===t.subType}):r}function ev(r){var t=nt();return r&&A(ie(r.replaceMerge),function(e){t.set(e,!0)}),{replaceMergeMainTypeMap:t}}be(Af,Tf);var tI=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],X0=(function(){function r(t){A(tI,function(e){this[e]=ct(t[e],t)},this)}return r})(),ku={},Pl=(function(){function r(){this._coordinateSystems=[]}return r.prototype.create=function(t,e){var i=[];A(ku,function(n,a){var o=n.create(t,e);i=i.concat(o||[])}),this._coordinateSystems=i},r.prototype.update=function(t,e){A(this._coordinateSystems,function(i){i.update&&i.update(t,e)})},r.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},r.register=function(t,e){ku[t]=e},r.get=function(t){return ku[t]},r})(),eI=/^(min|max)?(.+)$/,rI=(function(){function r(t){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=t}return r.prototype.setOption=function(t,e,i){t&&(A(ie(t.series),function(o){o&&o.data&&ae(o.data)&&Is(o.data)}),A(ie(t.dataset),function(o){o&&o.source&&ae(o.source)&&Is(o.source)})),t=it(t);var n=this._optionBackup,a=iI(t,e,!n);this._newBaseOption=a.baseOption,n?(a.timelineOptions.length&&(n.timelineOptions=a.timelineOptions),a.mediaList.length&&(n.mediaList=a.mediaList),a.mediaDefault&&(n.mediaDefault=a.mediaDefault)):this._optionBackup=a},r.prototype.mountOption=function(t){var e=this._optionBackup;return this._timelineOptions=e.timelineOptions,this._mediaList=e.mediaList,this._mediaDefault=e.mediaDefault,this._currentMediaIndices=[],it(t?e.baseOption:this._newBaseOption)},r.prototype.getTimelineOption=function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=it(i[n.getCurrentIndex()]))}return e},r.prototype.getMediaOption=function(t){var e=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,a=this._mediaDefault,o=[],s=[];if(!n.length&&!a)return s;for(var l=0,u=n.length;l<u;l++)nI(n[l].query,e,i)&&o.push(l);return!o.length&&a&&(o=[-1]),o.length&&!oI(o,this._currentMediaIndices)&&(s=H(o,function(h){return it(h===-1?a.option:n[h].option)})),this._currentMediaIndices=o,s},r})();function iI(r,t,e){var i=[],n,a,o=r.baseOption,s=r.timeline,l=r.options,u=r.media,h=!!r.media,c=!!(l||s||o&&o.timeline);o?(a=o,a.timeline||(a.timeline=s)):((c||h)&&(r.options=r.media=null),a=r),h&&G(u)&&A(u,function(d){d&&d.option&&(d.query?i.push(d):n||(n=d))}),f(a),A(l,function(d){return f(d)}),A(i,function(d){return f(d.option)});function f(d){A(t,function(p){p(d,e)})}return{baseOption:a,timelineOptions:l||[],mediaDefault:n,mediaList:i}}function nI(r,t,e){var i={width:t,height:e,aspectratio:t/e},n=!0;return A(r,function(a,o){var s=o.match(eI);if(!(!s||!s[1]||!s[2])){var l=s[1],u=s[2].toLowerCase();aI(i[u],a,l)||(n=!1)}}),n}function aI(r,t,e){return e==="min"?r>=t:e==="max"?r<=t:r===t}function oI(r,t){return r.join(",")===t.join(",")}var je=A,eo=q,rv=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Ru(r){var t=r&&r.itemStyle;if(t)for(var e=0,i=rv.length;e<i;e++){var n=rv[e],a=t.normal,o=t.emphasis;a&&a[n]&&(r[n]=r[n]||{},r[n].normal?st(r[n].normal,a[n]):r[n].normal=a[n],a[n]=null),o&&o[n]&&(r[n]=r[n]||{},r[n].emphasis?st(r[n].emphasis,o[n]):r[n].emphasis=o[n],o[n]=null)}}function Zt(r,t,e){if(r&&r[t]&&(r[t].normal||r[t].emphasis)){var i=r[t].normal,n=r[t].emphasis;i&&(e?(r[t].normal=r[t].emphasis=null,lt(r[t],i)):r[t]=i),n&&(r.emphasis=r.emphasis||{},r.emphasis[t]=n,n.focus&&(r.emphasis.focus=n.focus),n.blurScope&&(r.emphasis.blurScope=n.blurScope))}}function wa(r){Zt(r,"itemStyle"),Zt(r,"lineStyle"),Zt(r,"areaStyle"),Zt(r,"label"),Zt(r,"labelLine"),Zt(r,"upperLabel"),Zt(r,"edgeLabel")}function Mt(r,t){var e=eo(r)&&r[t],i=eo(e)&&e.textStyle;if(i)for(var n=0,a=rp.length;n<a;n++){var o=rp[n];i.hasOwnProperty(o)&&(e[o]=i[o])}}function Ae(r){r&&(wa(r),Mt(r,"label"),r.emphasis&&Mt(r.emphasis,"label"))}function sI(r){if(eo(r)){Ru(r),wa(r),Mt(r,"label"),Mt(r,"upperLabel"),Mt(r,"edgeLabel"),r.emphasis&&(Mt(r.emphasis,"label"),Mt(r.emphasis,"upperLabel"),Mt(r.emphasis,"edgeLabel"));var t=r.markPoint;t&&(Ru(t),Ae(t));var e=r.markLine;e&&(Ru(e),Ae(e));var i=r.markArea;i&&Ae(i);var n=r.data;if(r.type==="graph"){n=n||r.nodes;var a=r.links||r.edges;if(a&&!ae(a))for(var o=0;o<a.length;o++)Ae(a[o]);A(r.categories,function(u){wa(u)})}if(n&&!ae(n))for(var o=0;o<n.length;o++)Ae(n[o]);if(t=r.markPoint,t&&t.data)for(var s=t.data,o=0;o<s.length;o++)Ae(s[o]);if(e=r.markLine,e&&e.data)for(var l=e.data,o=0;o<l.length;o++)G(l[o])?(Ae(l[o][0]),Ae(l[o][1])):Ae(l[o]);r.type==="gauge"?(Mt(r,"axisLabel"),Mt(r,"title"),Mt(r,"detail")):r.type==="treemap"?(Zt(r.breadcrumb,"itemStyle"),A(r.levels,function(u){wa(u)})):r.type==="tree"&&wa(r.leaves)}}function pr(r){return G(r)?r:r?[r]:[]}function iv(r){return(G(r)?r[0]:r)||{}}function lI(r,t){je(pr(r.series),function(i){eo(i)&&sI(i)});var e=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&e.push("valueAxis","categoryAxis","logAxis","timeAxis"),je(e,function(i){je(pr(r[i]),function(n){n&&(Mt(n,"axisLabel"),Mt(n.axisPointer,"label"))})}),je(pr(r.parallel),function(i){var n=i&&i.parallelAxisDefault;Mt(n,"axisLabel"),Mt(n&&n.axisPointer,"label")}),je(pr(r.calendar),function(i){Zt(i,"itemStyle"),Mt(i,"dayLabel"),Mt(i,"monthLabel"),Mt(i,"yearLabel")}),je(pr(r.radar),function(i){Mt(i,"name"),i.name&&i.axisName==null&&(i.axisName=i.name,delete i.name),i.nameGap!=null&&i.axisNameGap==null&&(i.axisNameGap=i.nameGap,delete i.nameGap)}),je(pr(r.geo),function(i){eo(i)&&(Ae(i),je(pr(i.regions),function(n){Ae(n)}))}),je(pr(r.timeline),function(i){Ae(i),Zt(i,"label"),Zt(i,"itemStyle"),Zt(i,"controlStyle",!0);var n=i.data;G(n)&&A(n,function(a){q(a)&&(Zt(a,"label"),Zt(a,"itemStyle"))})}),je(pr(r.toolbox),function(i){Zt(i,"iconStyle"),je(i.feature,function(n){Zt(n,"iconStyle")})}),Mt(iv(r.axisPointer),"label"),Mt(iv(r.tooltip).axisPointer,"label")}function uI(r,t){for(var e=t.split(","),i=r,n=0;n<e.length&&(i=i&&i[e[n]],i!=null);n++);return i}function hI(r,t,e,i){for(var n=t.split(","),a=r,o,s=0;s<n.length-1;s++)o=n[s],a[o]==null&&(a[o]={}),a=a[o];a[n[s]]==null&&(a[n[s]]=e)}function nv(r){r&&A(cI,function(t){t[0]in r&&!(t[1]in r)&&(r[t[1]]=r[t[0]])})}var cI=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],fI=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Lu=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function oa(r){var t=r&&r.itemStyle;if(t)for(var e=0;e<Lu.length;e++){var i=Lu[e][1],n=Lu[e][0];t[i]!=null&&(t[n]=t[i])}}function av(r){r&&r.alignTo==="edge"&&r.margin!=null&&r.edgeDistance==null&&(r.edgeDistance=r.margin)}function ov(r){r&&r.downplay&&!r.blur&&(r.blur=r.downplay)}function dI(r){r&&r.focusNodeAdjacency!=null&&(r.emphasis=r.emphasis||{},r.emphasis.focus==null&&(r.emphasis.focus="adjacency"))}function Z0(r,t){if(r)for(var e=0;e<r.length;e++)t(r[e]),r[e]&&Z0(r[e].children,t)}function q0(r,t){lI(r,t),r.series=ie(r.series),A(r.series,function(e){if(q(e)){var i=e.type;if(i==="line")e.clipOverflow!=null&&(e.clip=e.clipOverflow);else if(i==="pie"||i==="gauge"){e.clockWise!=null&&(e.clockwise=e.clockWise),av(e.label);var n=e.data;if(n&&!ae(n))for(var a=0;a<n.length;a++)av(n[a]);e.hoverOffset!=null&&(e.emphasis=e.emphasis||{},(e.emphasis.scaleSize=null)&&(e.emphasis.scaleSize=e.hoverOffset))}else if(i==="gauge"){var o=uI(e,"pointer.color");o!=null&&hI(e,"itemStyle.color",o)}else if(i==="bar"){oa(e),oa(e.backgroundStyle),oa(e.emphasis);var n=e.data;if(n&&!ae(n))for(var a=0;a<n.length;a++)typeof n[a]=="object"&&(oa(n[a]),oa(n[a]&&n[a].emphasis))}else if(i==="sunburst"){var s=e.highlightPolicy;s&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=s)),ov(e),Z0(e.data,ov)}else i==="graph"||i==="sankey"?dI(e):i==="map"&&(e.mapType&&!e.map&&(e.map=e.mapType),e.mapLocation&<(e,e.mapLocation));e.hoverAnimation!=null&&(e.emphasis=e.emphasis||{},e.emphasis&&e.emphasis.scale==null&&(e.emphasis.scale=e.hoverAnimation)),nv(e)}}),r.dataRange&&(r.visualMap=r.dataRange),A(fI,function(e){var i=r[e];i&&(G(i)||(i=[i]),A(i,function(n){nv(n)}))})}function pI(r){var t=nt();r.eachSeries(function(e){var i=e.get("stack");if(i){var n=t.get(i)||t.set(i,[]),a=e.getData(),o={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:e};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;n.length&&a.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(o)}}),t.each(vI)}function vI(r){A(r,function(t,e){var i=[],n=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,h,c){var f=o.get(t.stackedDimension,c);if(isNaN(f))return n;var d,p;s?p=o.getRawIndex(c):d=o.get(t.stackedByDimension,c);for(var v=NaN,g=e-1;g>=0;g--){var m=r[g];if(s||(p=m.data.rawIndexOf(m.stackedByDimension,d)),p>=0){var _=m.data.getByRawIndex(m.stackResultDimension,p);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&f>=0&&_>0||l==="samesign"&&f<=0&&_<0){f=GS(f,_),v=_;break}}}return i[0]=f,i[1]=v,i})})}var kl=(function(){function r(t){this.data=t.data||(t.sourceFormat===wr?{}:[]),this.sourceFormat=t.sourceFormat||G0,this.seriesLayoutBy=t.seriesLayoutBy||br,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var i=0;i<e.length;i++){var n=e[i];n.type==null&&Y0(this,i)===ve.Must&&(n.type="ordinal")}}return r})();function If(r){return r instanceof kl}function Kh(r,t,e){e=e||J0(r);var i=t.seriesLayoutBy,n=mI(r,e,i,t.sourceHeader,t.dimensions),a=new kl({data:r,sourceFormat:e,seriesLayoutBy:i,dimensionsDefine:n.dimensionsDefine,startIndex:n.startIndex,dimensionsDetectedCount:n.dimensionsDetectedCount,metaRawOption:it(t)});return a}function K0(r){return new kl({data:r,sourceFormat:ae(r)?$r:Oe})}function gI(r){return new kl({data:r.data,sourceFormat:r.sourceFormat,seriesLayoutBy:r.seriesLayoutBy,dimensionsDefine:it(r.dimensionsDefine),startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount})}function J0(r){var t=G0;if(ae(r))t=$r;else if(G(r)){r.length===0&&(t=de);for(var e=0,i=r.length;e<i;e++){var n=r[e];if(n!=null){if(G(n)||ae(n)){t=de;break}else if(q(n)){t=cr;break}}}}else if(q(r)){for(var a in r)if(Vi(r,a)&&ne(r[a])){t=wr;break}}return t}function mI(r,t,e,i,n){var a,o;if(!r)return{dimensionsDefine:sv(n),startIndex:o,dimensionsDetectedCount:a};if(t===de){var s=r;i==="auto"||i==null?lv(function(u){u!=null&&u!=="-"&&($(u)?o==null&&(o=1):o=0)},e,s,10):o=At(i)?i:i?1:0,!n&&o===1&&(n=[],lv(function(u,h){n[h]=u!=null?u+"":""},e,s,1/0)),a=n?n.length:e===Yn?s.length:s[0]?s[0].length:null}else if(t===cr)n||(n=yI(r));else if(t===wr)n||(n=[],A(r,function(u,h){n.push(h)}));else if(t===Oe){var l=Un(r[0]);a=G(l)&&l.length||1}return{startIndex:o,dimensionsDefine:sv(n),dimensionsDetectedCount:a}}function yI(r){for(var t=0,e;t<r.length&&!(e=r[t++]););if(e)return vt(e)}function sv(r){if(r){var t=nt();return H(r,function(e,i){e=q(e)?e:{name:e};var n={name:e.name,displayName:e.displayName,type:e.type};if(n.name==null)return n;n.name+="",n.displayName==null&&(n.displayName=n.name);var a=t.get(n.name);return a?n.name+="-"+a.count++:t.set(n.name,{count:1}),n})}}function lv(r,t,e,i){if(t===Yn)for(var n=0;n<e.length&&n<i;n++)r(e[n]?e[n][0]:null,n);else for(var a=e[0]||[],n=0;n<a.length&&n<i;n++)r(a[n],n)}function Q0(r){var t=r.sourceFormat;return t===cr||t===wr}var xi,wi,Si,uv,hv,t_=(function(){function r(t,e){var i=If(t)?t:K0(t);this._source=i;var n=this._data=i.data;i.sourceFormat===$r&&(this._offset=0,this._dimSize=e,this._data=n),hv(this,n,i)}return r.prototype.getSource=function(){return this._source},r.prototype.count=function(){return 0},r.prototype.getItem=function(t,e){},r.prototype.appendData=function(t){},r.prototype.clean=function(){},r.protoInitialize=(function(){var t=r.prototype;t.pure=!1,t.persistent=!0})(),r.internalField=(function(){var t;hv=function(o,s,l){var u=l.sourceFormat,h=l.seriesLayoutBy,c=l.startIndex,f=l.dimensionsDefine,d=uv[Mf(u,h)];if(F(o,d),u===$r)o.getItem=e,o.count=n,o.fillStorage=i;else{var p=e_(u,h);o.getItem=ct(p,null,s,c,f);var v=r_(u,h);o.count=ct(v,null,s,c,f)}};var e=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,u=this._dimSize,h=u*o,c=0;c<u;c++)s[c]=l[h+c];return s},i=function(o,s,l,u){for(var h=this._data,c=this._dimSize,f=0;f<c;f++){for(var d=u[f],p=d[0]==null?1/0:d[0],v=d[1]==null?-1/0:d[1],g=s-o,m=l[f],_=0;_<g;_++){var b=h[_*c+f];m[o+_]=b,b<p&&(p=b),b>v&&(v=b)}d[0]=p,d[1]=v}},n=function(){return this._data?this._data.length/this._dimSize:0};uv=(t={},t[de+"_"+br]={pure:!0,appendData:a},t[de+"_"+Yn]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[cr]={pure:!0,appendData:a},t[wr]={pure:!0,appendData:function(o){var s=this._data;A(o,function(l,u){for(var h=s[u]||(s[u]=[]),c=0;c<(l||[]).length;c++)h.push(l[c])})}},t[Oe]={appendData:a},t[$r]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}})(),r})(),cv=function(r,t,e,i){return r[i]},_I=(xi={},xi[de+"_"+br]=function(r,t,e,i){return r[i+t]},xi[de+"_"+Yn]=function(r,t,e,i,n){i+=t;for(var a=n||[],o=r,s=0;s<o.length;s++){var l=o[s];a[s]=l?l[i]:null}return a},xi[cr]=cv,xi[wr]=function(r,t,e,i,n){for(var a=n||[],o=0;o<e.length;o++){var s=e[o].name,l=r[s];a[o]=l?l[i]:null}return a},xi[Oe]=cv,xi);function e_(r,t){var e=_I[Mf(r,t)];return e}var fv=function(r,t,e){return r.length},bI=(wi={},wi[de+"_"+br]=function(r,t,e){return Math.max(0,r.length-t)},wi[de+"_"+Yn]=function(r,t,e){var i=r[0];return i?Math.max(0,i.length-t):0},wi[cr]=fv,wi[wr]=function(r,t,e){var i=e[0].name,n=r[i];return n?n.length:0},wi[Oe]=fv,wi);function r_(r,t){var e=bI[Mf(r,t)];return e}var Ou=function(r,t,e){return r[t]},xI=(Si={},Si[de]=Ou,Si[cr]=function(r,t,e){return r[e]},Si[wr]=Ou,Si[Oe]=function(r,t,e){var i=Un(r);return i instanceof Array?i[t]:i},Si[$r]=Ou,Si);function i_(r){var t=xI[r];return t}function Mf(r,t){return r===de?r+"_"+t:r}function Bn(r,t,e){if(r){var i=r.getRawDataItem(t);if(i!=null){var n=r.getStore(),a=n.getSource().sourceFormat;if(e!=null){var o=r.getDimensionIndex(e),s=n.getDimensionProperty(o);return i_(a)(i,o,s)}else{var l=i;return a===Oe&&(l=Un(i)),l}}}}var wI=/\{@(.+?)\}/g,n_=(function(){function r(){}return r.prototype.getDataParams=function(t,e){var i=this.getData(e),n=this.getRawValue(t,e),a=i.getRawIndex(t),o=i.getName(t),s=i.getRawDataItem(t),l=i.getItemVisual(t,"style"),u=l&&l[i.getItemVisual(t,"drawType")||"fill"],h=l&&l.stroke,c=this.mainType,f=c==="series",d=i.userOutput&&i.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:f?this.subType:null,seriesIndex:this.seriesIndex,seriesId:f?this.id:null,seriesName:f?this.name:null,name:o,dataIndex:a,data:s,dataType:e,value:n,color:u,borderColor:h,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},r.prototype.getFormattedLabel=function(t,e,i,n,a,o){e=e||"normal";var s=this.getData(i),l=this.getDataParams(t,i);if(o&&(l.value=o.interpolatedValue),n!=null&&G(l.value)&&(l.value=l.value[n]),!a){var u=s.getItemModel(t);a=u.get(e==="normal"?["label","formatter"]:[e,"label","formatter"])}if(tt(a))return l.status=e,l.dimensionIndex=n,a(l);if($(a)){var h=wf(a,l);return h.replace(wI,function(c,f){var d=f.length,p=f;p.charAt(0)==="["&&p.charAt(d-1)==="]"&&(p=+p.slice(1,d-1));var v=Bn(s,t,p);if(o&&G(o.interpolatedValue)){var g=s.getDimensionIndex(p);g>=0&&(v=o.interpolatedValue[g])}return v!=null?v+"":""})}},r.prototype.getRawValue=function(t,e){return Bn(this.getData(e),t)},r.prototype.formatTooltip=function(t,e,i){},r})();function dv(r){var t,e;return q(r)?r.type&&(e=r):t=r,{text:t,frag:e}}function ja(r){return new SI(r)}var SI=(function(){function r(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return r.prototype.perform=function(t){var e=this._upstream,i=t&&t.skip;if(this._dirty&&e){var n=this.context;n.data=n.outputData=e.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function h(_){return!(_>=1)&&(_=1),_}var c;(this._dirty||a==="reset")&&(this._dirty=!1,c=this._doReset(i)),this._modBy=l,this._modDataCount=u;var f=t&&t.step;if(e?this._dueEnd=e._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!i&&(c||d<p)){var v=this._progress;if(G(v))for(var g=0;g<v.length;g++)this._doProgress(v[g],d,p,l,u);else this._doProgress(v,d,p,l,u)}this._dueIndex=p;var m=this._settedOutputEnd!=null?this._settedOutputEnd:p;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},r.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},r.prototype._doProgress=function(t,e,i,n,a){pv.reset(e,i,n,a),this._callingProgress=t,this._callingProgress({start:e,end:i,count:i-e,next:pv.next},this.context)},r.prototype._doReset=function(t){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var e,i;!t&&this._reset&&(e=this._reset(this.context),e&&e.progress&&(i=e.forceFirstProgress,e=e.progress),G(e)&&!e.length&&(e=null)),this._progress=e,this._modBy=this._modDataCount=null;var n=this._downstream;return n&&n.dirty(),i},r.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},r.prototype.pipe=function(t){(this._downstream!==t||this._dirty)&&(this._downstream=t,t._upstream=this,t.dirty())},r.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},r.prototype.getUpstream=function(){return this._upstream},r.prototype.getDownstream=function(){return this._downstream},r.prototype.setOutputEnd=function(t){this._outputDueEnd=this._settedOutputEnd=t},r})(),pv=(function(){var r,t,e,i,n,a={reset:function(l,u,h,c){t=l,r=u,e=h,i=c,n=Math.ceil(i/e),a.next=e>1&&i>0?s:o}};return a;function o(){return t<r?t++:null}function s(){var l=t%n*e+Math.ceil(t/n),u=t>=r?null:l<i?l:t;return t++,u}})();function _s(r,t){var e=t&&t.type;return e==="ordinal"?r:(e==="time"&&!At(r)&&r!=null&&r!=="-"&&(r=+Re(r)),r==null||r===""?NaN:Number(r))}nt({number:function(r){return parseFloat(r)},time:function(r){return+Re(r)},trim:function(r){return $(r)?We(r):r}});var CI=(function(){function r(t,e){var i=t==="desc";this._resultLT=i?1:-1,e==null&&(e=i?"min":"max"),this._incomparable=e==="min"?-1/0:1/0}return r.prototype.evaluate=function(t,e){var i=At(t)?t:Ya(t),n=At(e)?e:Ya(e),a=isNaN(i),o=isNaN(n);if(a&&(i=this._incomparable),o&&(n=this._incomparable),a&&o){var s=$(t),l=$(e);s&&(i=l?t:0),l&&(n=s?e:0)}return i<n?this._resultLT:i>n?-this._resultLT:0},r})(),TI=(function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(t){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(t){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(t,e){},r.prototype.retrieveValueFromItem=function(t,e){},r.prototype.convertValue=function(t,e){return _s(t,e)},r})();function AI(r,t){var e=new TI,i=r.data,n=e.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==br&&ce(o);var s=[],l={},u=r.dimensionsDefine;if(u)A(u,function(v,g){var m=v.name,_={index:g,name:m,displayName:v.displayName};if(s.push(_),m!=null){var b="";Vi(l,m)&&ce(b),l[m]=_}});else for(var h=0;h<r.dimensionsDetectedCount;h++)s.push({index:h});var c=e_(n,br);t.__isBuiltIn&&(e.getRawDataItem=function(v){return c(i,a,s,v)},e.getRawData=ct(II,null,r)),e.cloneRawData=ct(MI,null,r);var f=r_(n,br);e.count=ct(f,null,i,a,s);var d=i_(n);e.retrieveValue=function(v,g){var m=c(i,a,s,v);return p(m,g)};var p=e.retrieveValueFromItem=function(v,g){if(v!=null){var m=s[g];if(m)return d(v,g,m.name)}};return e.getDimensionInfo=ct(DI,null,s,l),e.cloneAllDimensionInfo=ct(PI,null,s),e}function II(r){var t=r.sourceFormat;if(!Df(t)){var e="";ce(e)}return r.data}function MI(r){var t=r.sourceFormat,e=r.data;if(!Df(t)){var i="";ce(i)}if(t===de){for(var n=[],a=0,o=e.length;a<o;a++)n.push(e[a].slice());return n}else if(t===cr){for(var n=[],a=0,o=e.length;a<o;a++)n.push(F({},e[a]));return n}}function DI(r,t,e){if(e!=null){if(At(e)||!isNaN(e)&&!Vi(t,e))return r[e];if(Vi(t,e))return t[e]}}function PI(r){return it(r)}var a_=nt();function kI(r){r=it(r);var t=r.type,e="";t||ce(e);var i=t.split(":");i.length!==2&&ce(e);var n=!1;i[0]==="echarts"&&(t=i[1],n=!0),r.__isBuiltIn=n,a_.set(t,r)}function RI(r,t,e){var i=ie(r),n=i.length,a="";n||ce(a);for(var o=0,s=n;o<s;o++){var l=i[o];t=LI(l,t),o!==s-1&&(t.length=Math.max(t.length,1))}return t}function LI(r,t,e,i){var n="";t.length||ce(n),q(r)||ce(n);var a=r.type,o=a_.get(a);o||ce(n);var s=H(t,function(u){return AI(u,o)}),l=ie(o.transform({upstream:s[0],upstreamList:s,config:it(r.config)}));return H(l,function(u,h){var c="";q(u)||ce(c),u.data||ce(c);var f=J0(u.data);Df(f)||ce(c);var d,p=t[0];if(p&&h===0&&!u.dimensions){var v=p.startIndex;v&&(u.data=p.data.slice(0,v).concat(u.data)),d={seriesLayoutBy:br,sourceHeader:v,dimensions:p.metaRawOption.dimensions}}else d={seriesLayoutBy:br,sourceHeader:0,dimensions:u.dimensions};return Kh(u.data,d,null)})}function Df(r){return r===de||r===cr}var Rl="undefined",OI=typeof Uint32Array===Rl?Array:Uint32Array,EI=typeof Uint16Array===Rl?Array:Uint16Array,o_=typeof Int32Array===Rl?Array:Int32Array,vv=typeof Float64Array===Rl?Array:Float64Array,s_={float:vv,int:o_,ordinal:Array,number:Array,time:vv},Eu;function fn(r){return r>65535?OI:EI}function dn(){return[1/0,-1/0]}function jI(r){var t=r.constructor;return t===Array?r.slice():new t(r)}function gv(r,t,e,i,n){var a=s_[e||"float"];if(n){var o=r[t],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;u<s;u++)l[u]=o[u];r[t]=l}}else r[t]=new a(i)}var Jh=(function(){function r(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=nt()}return r.prototype.initData=function(t,e,i){this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var n=t.getSource(),a=this.defaultDimValueGetter=Eu[n.sourceFormat];this._dimValueGetter=i||a,this._rawExtent=[],Q0(n),this._dimensions=H(e,function(o){return{type:o.type,property:o.property}}),this._initDataFromProvider(0,t.count())},r.prototype.getProvider=function(){return this._provider},r.prototype.getSource=function(){return this._provider.getSource()},r.prototype.ensureCalculationDimension=function(t,e){var i=this._calcDimNameToIdx,n=this._dimensions,a=i.get(t);if(a!=null){if(n[a].type===e)return a}else a=n.length;return n[a]={type:e},i.set(t,a),this._chunks[a]=new s_[e||"float"](this._rawCount),this._rawExtent[a]=dn(),a},r.prototype.collectOrdinalMeta=function(t,e){var i=this._chunks[t],n=this._dimensions[t],a=this._rawExtent,o=n.ordinalOffset||0,s=i.length;o===0&&(a[t]=dn());for(var l=a[t],u=o;u<s;u++){var h=i[u]=e.parseAndCollect(i[u]);isNaN(h)||(l[0]=Math.min(h,l[0]),l[1]=Math.max(h,l[1]))}n.ordinalMeta=e,n.ordinalOffset=s,n.type="ordinal"},r.prototype.getOrdinalMeta=function(t){var e=this._dimensions[t],i=e.ordinalMeta;return i},r.prototype.getDimensionProperty=function(t){var e=this._dimensions[t];return e&&e.property},r.prototype.appendData=function(t){var e=this._provider,i=this.count();e.appendData(t);var n=e.count();return e.persistent||(n+=i),i<n&&this._initDataFromProvider(i,n,!0),[i,n]},r.prototype.appendValues=function(t,e){for(var i=this._chunks,n=this._dimensions,a=n.length,o=this._rawExtent,s=this.count(),l=s+Math.max(t.length,e||0),u=0;u<a;u++){var h=n[u];gv(i,u,h.type,l,!0)}for(var c=[],f=s;f<l;f++)for(var d=f-s,p=0;p<a;p++){var h=n[p],v=Eu.arrayRows.call(this,t[d]||c,h.property,d,p);i[p][f]=v;var g=o[p];v<g[0]&&(g[0]=v),v>g[1]&&(g[1]=v)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(t,e,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=H(o,function(_){return _.property}),h=0;h<s;h++){var c=o[h];l[h]||(l[h]=dn()),gv(a,h,c.type,e,i)}if(n.fillStorage)n.fillStorage(t,e,a,l);else for(var f=[],d=t;d<e;d++){f=n.getItem(d,f);for(var p=0;p<s;p++){var v=a[p],g=this._dimValueGetter(f,u[p],d,p);v[d]=g;var m=l[p];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=e,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(t,e){if(!(e>=0&&e<this._count))return NaN;var i=this._chunks[t];return i?i[this.getRawIndex(e)]:NaN},r.prototype.getValues=function(t,e){var i=[],n=[];if(e==null){e=t,t=[];for(var a=0;a<this._dimensions.length;a++)n.push(a)}else n=t;for(var a=0,o=n.length;a<o;a++)i.push(this.get(n[a],e));return i},r.prototype.getByRawIndex=function(t,e){if(!(e>=0&&e<this._rawCount))return NaN;var i=this._chunks[t];return i?i[e]:NaN},r.prototype.getSum=function(t){var e=this._chunks[t],i=0;if(e)for(var n=0,a=this.count();n<a;n++){var o=this.get(t,n);isNaN(o)||(i+=o)}return i},r.prototype.getMedian=function(t){var e=[];this.each([t],function(a){isNaN(a)||e.push(a)});var i=e.sort(function(a,o){return a-o}),n=this.count();return n===0?0:n%2===1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},r.prototype.indexOfRawIndex=function(t){if(t>=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(i!=null&&i<this._count&&i===t)return t;for(var n=0,a=this._count-1;n<=a;){var o=(n+a)/2|0;if(e[o]<t)n=o+1;else if(e[o]>t)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(t,e,i){var n=this._chunks,a=n[t],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,h=0,c=this.count();h<c;h++){var f=this.getRawIndex(h),d=e-a[f],p=Math.abs(d);p<=i&&((p<s||p===s&&d>=0&&l<0)&&(s=p,l=d,u=0),d===l&&(o[u++]=h))}return o.length=u,o},r.prototype.getIndices=function(){var t,e=this._indices;if(e){var i=e.constructor,n=this._count;if(i===Array){t=new i(n);for(var a=0;a<n;a++)t[a]=e[a]}else t=new i(e.buffer,0,n)}else{var i=fn(this._rawCount);t=new i(this.count());for(var a=0;a<t.length;a++)t[a]=a}return t},r.prototype.filter=function(t,e){if(!this._count)return this;for(var i=this.clone(),n=i.count(),a=fn(i._rawCount),o=new a(n),s=[],l=t.length,u=0,h=t[0],c=i._chunks,f=0;f<n;f++){var d=void 0,p=i.getRawIndex(f);if(l===0)d=e(f);else if(l===1){var v=c[h][p];d=e(v,f)}else{for(var g=0;g<l;g++)s[g]=c[t[g]][p];s[g]=f,d=e.apply(null,s)}d&&(o[u++]=p)}return u<n&&(i._indices=o),i._count=u,i._extent=[],i._updateGetRawIdx(),i},r.prototype.selectRange=function(t){var e=this.clone(),i=e._count;if(!i)return this;var n=vt(t),a=n.length;if(!a)return this;var o=e.count(),s=fn(e._rawCount),l=new s(o),u=0,h=n[0],c=t[h][0],f=t[h][1],d=e._chunks,p=!1;if(!e._indices){var v=0;if(a===1){for(var g=d[n[0]],m=0;m<i;m++){var _=g[m];(_>=c&&_<=f||isNaN(_))&&(l[u++]=v),v++}p=!0}else if(a===2){for(var g=d[n[0]],b=d[n[1]],x=t[n[1]][0],C=t[n[1]][1],m=0;m<i;m++){var _=g[m],S=b[m];(_>=c&&_<=f||isNaN(_))&&(S>=x&&S<=C||isNaN(S))&&(l[u++]=v),v++}p=!0}}if(!p)if(a===1)for(var m=0;m<o;m++){var T=e.getRawIndex(m),_=d[n[0]][T];(_>=c&&_<=f||isNaN(_))&&(l[u++]=T)}else for(var m=0;m<o;m++){for(var I=!0,T=e.getRawIndex(m),M=0;M<a;M++){var D=n[M],_=d[D][T];(_<t[D][0]||_>t[D][1])&&(I=!1)}I&&(l[u++]=e.getRawIndex(m))}return u<o&&(e._indices=l),e._count=u,e._extent=[],e._updateGetRawIdx(),e},r.prototype.map=function(t,e){var i=this.clone(t);return this._updateDims(i,t,e),i},r.prototype.modify=function(t,e){this._updateDims(this,t,e)},r.prototype._updateDims=function(t,e,i){for(var n=t._chunks,a=[],o=e.length,s=t.count(),l=[],u=t._rawExtent,h=0;h<e.length;h++)u[e[h]]=dn();for(var c=0;c<s;c++){for(var f=t.getRawIndex(c),d=0;d<o;d++)l[d]=n[e[d]][f];l[o]=c;var p=i&&i.apply(null,l);if(p!=null){typeof p!="object"&&(a[0]=p,p=a);for(var h=0;h<p.length;h++){var v=e[h],g=p[h],m=u[v],_=n[v];_&&(_[f]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},r.prototype.lttbDownSample=function(t,e){var i=this.clone([t],!0),n=i._chunks,a=n[t],o=this.count(),s=0,l=Math.floor(1/e),u=this.getRawIndex(0),h,c,f,d=new(fn(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var p=1;p<o-1;p+=l){for(var v=Math.min(p+l,o-1),g=Math.min(p+l*2,o),m=(g+v)/2,_=0,b=v;b<g;b++){var x=this.getRawIndex(b),C=a[x];isNaN(C)||(_+=C)}_/=g-v;var S=p,T=Math.min(p+l,o),I=p-1,M=a[u];h=-1,f=S;for(var D=-1,P=0,b=S;b<T;b++){var x=this.getRawIndex(b),C=a[x];if(isNaN(C)){P++,D<0&&(D=x);continue}c=Math.abs((I-m)*(C-M)-(I-b)*(_-M)),c>h&&(h=c,f=x)}P>0&&P<T-S&&(d[s++]=Math.min(D,f),f=Math.max(D,f)),d[s++]=f,u=f}return d[s++]=this.getRawIndex(o-1),i._count=s,i._indices=d,i.getRawIndex=this._getRawIdx,i},r.prototype.minmaxDownSample=function(t,e){for(var i=this.clone([t],!0),n=i._chunks,a=Math.floor(1/e),o=n[t],s=this.count(),l=new(fn(this._rawCount))(Math.ceil(s/a)*2),u=0,h=0;h<s;h+=a){var c=h,f=o[this.getRawIndex(c)],d=h,p=o[this.getRawIndex(d)],v=a;h+a>s&&(v=s-h);for(var g=0;g<v;g++){var m=this.getRawIndex(h+g),_=o[m];_<f&&(f=_,c=h+g),_>p&&(p=_,d=h+g)}var b=this.getRawIndex(c),x=this.getRawIndex(d);c<d?(l[u++]=b,l[u++]=x):(l[u++]=x,l[u++]=b)}return i._count=u,i._indices=l,i._updateGetRawIdx(),i},r.prototype.downSample=function(t,e,i,n){for(var a=this.clone([t],!0),o=a._chunks,s=[],l=Math.floor(1/e),u=o[t],h=this.count(),c=a._rawExtent[t]=dn(),f=new(fn(this._rawCount))(Math.ceil(h/l)),d=0,p=0;p<h;p+=l){l>h-p&&(l=h-p,s.length=l);for(var v=0;v<l;v++){var g=this.getRawIndex(p+v);s[v]=u[g]}var m=i(s),_=this.getRawIndex(Math.min(p+n(s,m)||0,h-1));u[_]=m,m<c[0]&&(c[0]=m),m>c[1]&&(c[1]=m),f[d++]=_}return a._count=d,a._indices=f,a._updateGetRawIdx(),a},r.prototype.each=function(t,e){if(this._count)for(var i=t.length,n=this._chunks,a=0,o=this.count();a<o;a++){var s=this.getRawIndex(a);switch(i){case 0:e(a);break;case 1:e(n[t[0]][s],a);break;case 2:e(n[t[0]][s],n[t[1]][s],a);break;default:for(var l=0,u=[];l<i;l++)u[l]=n[t[l]][s];u[l]=a,e.apply(null,u)}}},r.prototype.getDataExtent=function(t){var e=this._chunks[t],i=dn();if(!e)return i;var n=this.count(),a=!this._indices,o;if(a)return this._rawExtent[t].slice();if(o=this._extent[t],o)return o.slice();o=i;for(var s=o[0],l=o[1],u=0;u<n;u++){var h=this.getRawIndex(u),c=e[h];c<s&&(s=c),c>l&&(l=c)}return o=[s,l],this._extent[t]=o,o},r.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var i=[],n=this._chunks,a=0;a<n.length;a++)i.push(n[a][e]);return i},r.prototype.clone=function(t,e){var i=new r,n=this._chunks,a=t&&lr(t,function(s,l){return s[l]=!0,s},{});if(a)for(var o=0;o<n.length;o++)i._chunks[o]=a[o]?jI(n[o]):n[o];else i._chunks=n;return this._copyCommonProps(i),e||(i._indices=this._cloneIndices()),i._updateGetRawIdx(),i},r.prototype._copyCommonProps=function(t){t._count=this._count,t._rawCount=this._rawCount,t._provider=this._provider,t._dimensions=this._dimensions,t._extent=it(this._extent),t._rawExtent=it(this._rawExtent)},r.prototype._cloneIndices=function(){if(this._indices){var t=this._indices.constructor,e=void 0;if(t===Array){var i=this._indices.length;e=new t(i);for(var n=0;n<i;n++)e[n]=this._indices[n]}else e=new t(this._indices);return e}return null},r.prototype._getRawIdxIdentity=function(t){return t},r.prototype._getRawIdx=function(t){return t<this._count&&t>=0?this._indices[t]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=(function(){function t(e,i,n,a){return _s(e[a],this._dimensions[a])}Eu={arrayRows:t,objectRows:function(e,i,n,a){return _s(e[i],this._dimensions[a])},keyedColumns:t,original:function(e,i,n,a){var o=e&&(e.value==null?e:e.value);return _s(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(e,i,n,a){return e[a]}}})(),r})(),NI=(function(){function r(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,e=this._getUpstreamSourceManagers(),i=!!e.length,n,a;if(Zo(t)){var o=t,s=void 0,l=void 0,u=void 0;if(i){var h=e[0];h.prepareSource(),u=h.getSource(),s=u.data,l=u.sourceFormat,a=[h._getVersionSign()]}else s=o.get("data",!0),l=ae(s)?$r:Oe,a=[];var c=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=Q(c.seriesLayoutBy,f.seriesLayoutBy)||null,p=Q(c.sourceHeader,f.sourceHeader),v=Q(c.dimensions,f.dimensions),g=d!==f.seriesLayoutBy||!!p!=!!f.sourceHeader||v;n=g?[Kh(s,{seriesLayoutBy:d,sourceHeader:p,dimensions:v},l)]:[]}else{var m=t;if(i){var _=this._applyTransform(e);n=_.sourceList,a=_.upstreamSignList}else{var b=m.get("source",!0);n=[Kh(b,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},r.prototype._applyTransform=function(t){var e=this._sourceHost,i=e.get("transform",!0),n=e.get("fromTransformResult",!0);if(n!=null){var a="";t.length!==1&&mv(a)}var o,s=[],l=[];return A(t,function(u){u.prepareSource();var h=u.getSource(n||0),c="";n!=null&&!h&&mv(c),s.push(h),l.push(u._getVersionSign())}),i?o=RI(i,s,{datasetIndex:e.componentIndex}):n!=null&&(o=[gI(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e<t.length;e++){var i=t[e];if(i._isDirty()||this._upstreamSignList[e]!==i._getVersionSign())return!0}},r.prototype.getSource=function(t){t=t||0;var e=this._sourceList[t];if(!e){var i=this._getUpstreamSourceManagers();return i[0]&&i[0].getSource(t)}return e},r.prototype.getSharedDataStore=function(t){var e=t.makeStoreSchema();return this._innerGetDataStore(e.dimensions,t.source,e.hash)},r.prototype._innerGetDataStore=function(t,e,i){var n=0,a=this._storeList,o=a[n];o||(o=a[n]={});var s=o[i];if(!s){var l=this._getUpstreamSourceManagers()[0];Zo(this._sourceHost)&&l?s=l._innerGetDataStore(t,e,i):(s=new Jh,s.initData(new t_(e,t.length),t)),o[i]=s}return s},r.prototype._getUpstreamSourceManagers=function(){var t=this._sourceHost;if(Zo(t)){var e=$0(t);return e?[e.getSourceManager()]:[]}else return H(GA(t),function(i){return i.getSourceManager()})},r.prototype._getSourceMetaRawOption=function(){var t=this._sourceHost,e,i,n;if(Zo(t))e=t.get("seriesLayoutBy",!0),i=t.get("sourceHeader",!0),n=t.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var a=t;e=a.get("seriesLayoutBy",!0),i=a.get("sourceHeader",!0),n=a.get("dimensions",!0)}return{seriesLayoutBy:e,sourceHeader:i,dimensions:n}},r})();function Zo(r){return r.mainType==="series"}function mv(r){throw new Error(r)}var FI="line-height:1";function l_(r){var t=r.lineHeight;return t==null?FI:"line-height:"+qt(t+"")+"px"}function u_(r,t){var e=r.color||"#6e7079",i=r.fontSize||12,n=r.fontWeight||"400",a=r.color||"#464646",o=r.fontSize||14,s=r.fontWeight||"900";return t==="html"?{nameStyle:"font-size:"+qt(i+"")+"px;color:"+qt(e)+";font-weight:"+qt(n+""),valueStyle:"font-size:"+qt(o+"")+"px;color:"+qt(a)+";font-weight:"+qt(s+"")}:{nameStyle:{fontSize:i,fill:e,fontWeight:n},valueStyle:{fontSize:o,fill:a,fontWeight:s}}}var BI=[0,10,20,30],zI=["",`
|
|
32
|
+
`,`
|
|
33
|
+
|
|
34
|
+
`,`
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
`];function zn(r,t){return t.type=r,t}function Qh(r){return r.type==="section"}function h_(r){return Qh(r)?VI:HI}function c_(r){if(Qh(r)){var t=0,e=r.blocks.length,i=e>1||e>0&&!r.noHeader;return A(r.blocks,function(n){var a=c_(n);a>=t&&(t=a+ +(i&&(!a||Qh(n)&&!n.noHeader)))}),t}return 0}function VI(r,t,e,i){var n=t.noHeader,a=WI(c_(t)),o=[],s=t.blocks||[];_e(!s||G(s)),s=s||[];var l=r.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Vi(u,l)){var h=new CI(u[l],null);s.sort(function(v,g){return h.evaluate(v.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}A(s,function(v,g){var m=t.valueFormatter,_=h_(v)(m?F(F({},r),{valueFormatter:m}):r,v,g>0?a.html:0,i);_!=null&&o.push(_)});var c=r.renderMode==="richText"?o.join(a.richText):tc(i,o.join(""),n?e:a.html);if(n)return c;var f=Zh(t.header,"ordinal",r.useUTC),d=u_(i,r.renderMode).nameStyle,p=l_(i);return r.renderMode==="richText"?f_(r,f,d)+a.richText+c:tc(i,'<div style="'+d+";"+p+';">'+qt(f)+"</div>"+c,e)}function HI(r,t,e,i){var n=r.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=r.useUTC,h=t.valueFormatter||r.valueFormatter||function(x){return x=G(x)?x:[x],H(x,function(C,S){return Zh(C,G(d)?d[S]:d,u)})};if(!(a&&o)){var c=s?"":r.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",n),f=a?"":Zh(l,"ordinal",u),d=t.valueType,p=o?[]:h(t.value,t.dataIndex),v=!s||!a,g=!s&&a,m=u_(i,n),_=m.nameStyle,b=m.valueStyle;return n==="richText"?(s?"":c)+(a?"":f_(r,f,_))+(o?"":$I(r,p,v,g,b)):tc(i,(s?"":c)+(a?"":GI(f,!s,_))+(o?"":UI(p,v,g,b)),e)}}function yv(r,t,e,i,n,a){if(r){var o=h_(r),s={useUTC:n,renderMode:e,orderMode:i,markupStyleCreator:t,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function WI(r){return{html:BI[r],richText:zI[r]}}function tc(r,t,e){var i='<div style="clear:both"></div>',n="margin: "+e+"px 0 0",a=l_(r);return'<div style="'+n+";"+a+';">'+t+i+"</div>"}function GI(r,t,e){var i=t?"margin-left:2px":"";return'<span style="'+e+";"+i+'">'+qt(r)+"</span>"}function UI(r,t,e,i){var n=e?"10px":"20px",a=t?"float:right;margin-left:"+n:"";return r=G(r)?r:[r],'<span style="'+a+";"+i+'">'+H(r,function(o){return qt(o)}).join(" ")+"</span>"}function f_(r,t,e){return r.markupStyleCreator.wrapRichTextStyle(t,e)}function $I(r,t,e,i,n){var a=[n],o=i?10:20;return e&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(G(t)?t.join(" "):t,a)}function YI(r,t){var e=r.getData().getItemVisual(t,"style"),i=e[r.visualDrawType];return Wi(i)}function d_(r,t){var e=r.get("padding");return e??(t==="richText"?[8,10]:10)}var ju=(function(){function r(){this.richTextStyles={},this._nextStyleNameId=jy()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(t,e,i){var n=i==="richText"?this._generateStyleName():null,a=V0({color:e,type:t,renderMode:i,markerId:n});return $(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(t,e){var i={};G(e)?A(e,function(a){return F(i,a)}):F(i,e);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+t+"}"},r})();function XI(r){var t=r.series,e=r.dataIndex,i=r.multipleSeries,n=t.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(e),l=G(s),u=YI(t,e),h,c,f,d;if(o>1||l&&!o){var p=ZI(s,t,e,a,u);h=p.inlineValues,c=p.inlineValueTypes,f=p.blocks,d=p.inlineValues[0]}else if(o){var v=n.getDimensionInfo(a[0]);d=h=Bn(n,e,a[0]),c=v.type}else d=h=l?s[0]:s;var g=Vy(t),m=g&&t.name||"",_=n.getName(e),b=i?m:_;return zn("section",{header:m,noHeader:i||!g,sortParam:d,blocks:[zn("nameValue",{markerType:"item",markerColor:u,name:b,noName:!We(b),value:h,valueType:c,dataIndex:e})].concat(f||[])})}function ZI(r,t,e,i,n){var a=t.getData(),o=lr(r,function(c,f,d){var p=a.getDimensionInfo(d);return c=c||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],u=[];i.length?A(i,function(c){h(Bn(a,e,c),c)}):A(r,h);function h(c,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(o?u.push(zn("nameValue",{markerType:"subItem",markerColor:n,name:d.displayName,value:c,valueType:d.type})):(s.push(c),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Ir=kt();function qo(r,t){return r.getName(t)||r.getId(t)}var qI="__universalTransitionEnabled",Xe=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return t.prototype.init=function(e,i,n){this.seriesIndex=this.componentIndex,this.dataTask=ja({count:JI,reset:QI}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n);var a=Ir(this).sourceManager=new NI(this);a.prepareSource();var o=this.getInitialData(e,n);bv(o,this),this.dataTask.context.data=o,Ir(this).dataBeforeProcessed=o,_v(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(e,i){var n=Qa(this),a=n?Cf(e):{},o=this.subType;dt.hasClass(o)&&(o+="Series"),st(e,i.getTheme().get(this.subType)),st(e,this.getDefaultOption()),ep(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&to(e,a,n)},t.prototype.mergeOption=function(e,i){e=st(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Qa(this);n&&to(this.option,e,n);var a=Ir(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(e,i);bv(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Ir(this).dataBeforeProcessed=o,_v(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(e){if(e&&!ae(e))for(var i=["show"],n=0;n<e.length;n++)e[n]&&e[n].label&&ep(e[n],"label",i)},t.prototype.getInitialData=function(e,i){},t.prototype.appendData=function(e){var i=this.getRawData();i.appendData(e.data)},t.prototype.getData=function(e){var i=ec(this);if(i){var n=i.context.data;return e==null||!n.getLinkedData?n:n.getLinkedData(e)}else return Ir(this).data},t.prototype.getAllData=function(){var e=this.getData();return e&&e.getLinkedDataAll?e.getLinkedDataAll():[{data:e}]},t.prototype.setData=function(e){var i=ec(this);if(i){var n=i.context;n.outputData=e,i!==this.dataTask&&(n.data=e)}Ir(this).data=e},t.prototype.getEncode=function(){var e=this.get("encode",!0);if(e)return nt(e)},t.prototype.getSourceManager=function(){return Ir(this).sourceManager},t.prototype.getSource=function(){return this.getSourceManager().getSource()},t.prototype.getRawData=function(){return Ir(this).dataBeforeProcessed},t.prototype.getColorBy=function(){var e=this.get("colorBy");return e||"series"},t.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},t.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},t.prototype.formatTooltip=function(e,i,n){return XI({series:this,dataIndex:e,multipleSeries:i})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(J.node&&!(e&&e.ssr))return!1;var i=this.getShallow("animation");return i&&this.getData().count()>this.getShallow("animationThreshold")&&(i=!1),!!i},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,i,n){var a=this.ecModel,o=Tf.prototype.getColorFromPalette.call(this,e,i,n);return o||(o=a.getColorFromPalette(e,i,n)),o},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,i){this._innerSelect(this.getData(i),e)},t.prototype.unselect=function(e,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<e.length;s++){var l=e[s],u=qo(o,l);n[u]=!1,this._selectedDataIndicesMap[u]=-1}}},t.prototype.toggleSelect=function(e,i){for(var n=[],a=0;a<e.length;a++)n[0]=e[a],this.isSelected(e[a],i)?this.unselect(n,i):this.select(n,i)},t.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var e=this._selectedDataIndicesMap,i=vt(e),n=[],a=0;a<i.length;a++){var o=e[i[a]];o>=0&&n.push(o)}return n},t.prototype.isSelected=function(e,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[qo(a,e)])&&!a.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[qI])return!0;var e=this.option.universalTransition;return e?e===!0?!0:e&&e.enabled:!1},t.prototype._innerSelect=function(e,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){q(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,h=0;h<l;h++){var c=i[h],f=qo(e,c);u[f]=!0,this._selectedDataIndicesMap[f]=e.getRawIndex(c)}}else if(s==="single"||s===!0){var d=i[l-1],f=qo(e,d);o.selectedMap=(n={},n[f]=!0,n),this._selectedDataIndicesMap=(a={},a[f]=e.getRawIndex(d),a)}}},t.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var i=[];e.hasItemOption&&e.each(function(n){var a=e.getRawDataItem(n);a&&a.selected&&i.push(n)}),i.length>0&&this._innerSelect(e,i)}},t.registerClass=function(e){return dt.registerClass(e)},t.protoInitialize=(function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"})(),t})(dt);be(Xe,n_);be(Xe,Tf);Gy(Xe,dt);function _v(r){var t=r.name;Vy(r)||(r.name=KI(r)||t)}function KI(r){var t=r.getRawData(),e=t.mapDimensionsAll("seriesName"),i=[];return A(e,function(n){var a=t.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function JI(r){return r.model.getRawData().count()}function QI(r){var t=r.model;return t.setData(t.getRawData().cloneShallow()),tM}function tM(r,t){t.outputData&&r.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function bv(r,t){A(Km(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(e){r.wrapMethod(e,Ct(eM,t))})}function eM(r,t){var e=ec(r);return e&&e.setOutputEnd((t||this).count()),t}function ec(r){var t=(r.ecModel||{}).scheduler,e=t&&t.getPipeline(r.uid);if(e){var i=e.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(r.uid))}return i}}var Kt=(function(){function r(){this.group=new Ft,this.uid=Co("viewComponent")}return r.prototype.init=function(t,e){},r.prototype.render=function(t,e,i,n){},r.prototype.dispose=function(t,e){},r.prototype.updateView=function(t,e,i,n){},r.prototype.updateLayout=function(t,e,i,n){},r.prototype.updateVisual=function(t,e,i,n){},r.prototype.toggleBlurSeries=function(t,e,i){},r.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},r})();Qc(Kt);fl(Kt);function p_(){var r=kt();return function(t){var e=r(t),i=t.pipelineContext,n=!!e.large,a=!!e.progressiveRender,o=e.large=!!(i&&i.large),s=e.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var v_=kt(),rM=p_(),ye=(function(){function r(){this.group=new Ft,this.uid=Co("viewChart"),this.renderTask=ja({plan:iM,reset:nM}),this.renderTask.context={view:this}}return r.prototype.init=function(t,e){},r.prototype.render=function(t,e,i,n){},r.prototype.highlight=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&wv(a,n,"emphasis")},r.prototype.downplay=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&wv(a,n,"normal")},r.prototype.remove=function(t,e){this.group.removeAll()},r.prototype.dispose=function(t,e){},r.prototype.updateView=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.updateLayout=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.eachRendered=function(t){ff(this.group,t)},r.markUpdateMethod=function(t,e){v_(t).updateMethod=e},r.protoInitialize=(function(){var t=r.prototype;t.type="chart"})(),r})();function xv(r,t,e){r&&Uh(r)&&(t==="emphasis"?Nn:Fn)(r,e)}function wv(r,t,e){var i=Hi(r,t),n=t&&t.highlightKey!=null?AT(t.highlightKey):null;i!=null?A(ie(i),function(a){xv(r.getItemGraphicEl(a),e,n)}):r.eachItemGraphicEl(function(a){xv(a,e,n)})}Qc(ye);fl(ye);function iM(r){return rM(r.model)}function nM(r){var t=r.model,e=r.ecModel,i=r.api,n=r.payload,a=t.pipelineContext.progressiveRender,o=r.view,s=n&&v_(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,e,i,n),aM[l]}var aM={incrementalPrepareRender:{progress:function(r,t){t.view.incrementalRender(r,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(r,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},Vs="\0__throttleOriginMethod",Sv="\0__throttleRate",Cv="\0__throttleType";function Pf(r,t,e){var i,n=0,a=0,o=null,s,l,u,h;t=t||0;function c(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var f=function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];i=new Date().getTime(),l=this,u=d;var v=h||t,g=h||e;h=null,s=i-(g?n:a)-v,clearTimeout(o),g?o=setTimeout(c,v):s>=0?c():o=setTimeout(c,-s),n=i};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(d){h=d},f}function g_(r,t,e,i){var n=r[t];if(n){var a=n[Vs]||n,o=n[Cv],s=n[Sv];if(s!==e||o!==i){if(e==null||!i)return r[t]=a;n=r[t]=Pf(a,e,i==="debounce"),n[Vs]=a,n[Cv]=i,n[Sv]=e}return n}}function rc(r,t){var e=r[t];e&&e[Vs]&&(e.clear&&e.clear(),r[t]=e[Vs])}var Tv=kt(),Av={itemStyle:Za(k0,!0),lineStyle:Za(P0,!0)},oM={lineStyle:"stroke",itemStyle:"fill"};function m_(r,t){var e=r.visualStyleMapper||Av[t];return e||(console.warn("Unknown style type '"+t+"'."),Av.itemStyle)}function y_(r,t){var e=r.visualDrawType||oM[t];return e||(console.warn("Unknown style type '"+t+"'."),"fill")}var sM={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=r.getModel(i),a=m_(r,i),o=a(n),s=n.getShallow("decal");s&&(e.setVisual("decal",s),s.dirty=!0);var l=y_(r,i),u=o[l],h=tt(u)?u:null,c=o.fill==="auto"||o.stroke==="auto";if(!o[l]||h||c){var f=r.getColorFromPalette(r.name,null,t.getSeriesCount());o[l]||(o[l]=f,e.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||tt(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||tt(o.stroke)?f:o.stroke}if(e.setVisual("style",o),e.setVisual("drawType",l),!t.isSeriesFiltered(r)&&h)return e.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var v=r.getDataParams(p),g=F({},o);g[l]=h(v),d.setItemVisual(p,"style",g)}}}},sa=new Tt,lM={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){if(!(r.ignoreStyleOnData||t.isSeriesFiltered(r))){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=m_(r,i),a=e.getVisual("drawType");return{dataEach:e.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){sa.option=l[i];var u=n(sa),h=o.ensureUniqueItemVisual(s,"style");F(h,u),sa.option.decal&&(o.setItemVisual(s,"decal",sa.option.decal),sa.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},uM={performRawSeries:!0,overallReset:function(r){var t=nt();r.eachSeries(function(e){var i=e.getColorBy();if(!e.isColorBySeries()){var n=e.type+"-"+i,a=t.get(n);a||(a={},t.set(n,a)),Tv(e).scope=a}}),r.eachSeries(function(e){if(!(e.isColorBySeries()||r.isSeriesFiltered(e))){var i=e.getRawData(),n={},a=e.getData(),o=Tv(e).scope,s=e.visualStyleAccessPath||"itemStyle",l=y_(e,s);a.each(function(u){var h=a.getRawIndex(u);n[h]=u}),i.each(function(u){var h=n[u],c=a.getItemVisual(h,"colorFromPalette");if(c){var f=a.ensureUniqueItemVisual(h,"style"),d=i.getName(u)||u+"",p=i.count();f[l]=e.getColorFromPalette(d,o,p)}})}})}},Ko=Math.PI;function hM(r,t){t=t||{},lt(t,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var e=new Ft,i=new Nt({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});e.add(i);var n=new zt({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Nt({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});e.add(a);var o;return t.showSpinner&&(o=new wo({shape:{startAngle:-Ko/2,endAngle:-Ko/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Ko*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Ko*3/2}).delay(300).start("circularInOut"),e.add(o)),e.resize=function(){var s=n.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(r.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),h=r.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:h}),a.setShape({x:u-l,y:h-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},e.resize(),e}var __=(function(){function r(t,e,i,n){this._stageTaskMap=nt(),this.ecInstance=t,this.api=e,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return r.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},r.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var i=this._pipelineMap.get(t.__pipeline.id),n=i.context,a=!e&&i.progressiveEnabled&&(!n||n.progressiveRender)&&t.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},r.prototype.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData(),a=n.count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&a>=i.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(t){var e=this,i=e._pipelineMap=nt();t.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),e._pipe(n,n.dataTask)})},r.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),i=this.api;A(this._allHandlers,function(n){var a=t.get(n.uid)||t.set(n.uid,{}),o="";_e(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,e,i),n.overallReset&&this._createOverallStageTask(n,a,e,i)},this)},r.prototype.prepareView=function(t,e,i,n){var a=t.renderTask,o=a.context;o.model=e,o.ecModel=i,o.api=n,a.__block=!t.incrementalPrepareRender,this._pipe(e,a)},r.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},r.prototype.performVisualTasks=function(t,e,i){this._performStageTasks(this._visualHandlers,t,e,i)},r.prototype._performStageTasks=function(t,e,i,n){n=n||{};var a=!1,o=this;A(t,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var h=o._stageTaskMap.get(l.uid),c=h.seriesTaskMap,f=h.overallTask;if(f){var d,p=f.agentStubMap;p.each(function(g){s(n,g)&&(g.dirty(),d=!0)}),d&&f.dirty(),o.updatePayload(f,i);var v=o.getPerformArgs(f,n.block);p.each(function(g){g.perform(v)}),f.perform(v)&&(a=!0)}else c&&c.each(function(g,m){s(n,g)&&g.dirty();var _=o.getPerformArgs(g,n.block);_.skip=!l.performRawSeries&&e.isSeriesFiltered(g.context.model),o.updatePayload(g,i),g.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(i){e=i.dataTask.perform()||e}),this.unfinished=e||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},r.prototype.updatePayload=function(t,e){e!=="remain"&&(t.context.payload=e)},r.prototype._createSeriesStageTask=function(t,e,i,n){var a=this,o=e.seriesTaskMap,s=e.seriesTaskMap=nt(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?i.eachRawSeries(h):l?i.eachRawSeriesByType(l,h):u&&u(i,n).each(h);function h(c){var f=c.uid,d=s.set(f,o&&o.get(f)||ja({plan:vM,reset:gM,count:yM}));d.context={model:c,ecModel:i,api:n,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(c,d)}},r.prototype._createOverallStageTask=function(t,e,i,n){var a=this,o=e.overallTask=e.overallTask||ja({reset:cM});o.context={ecModel:i,api:n,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=nt(),u=t.seriesType,h=t.getTargetSeries,c=!0,f=!1,d="";_e(!t.createOnAllSeries,d),u?i.eachRawSeriesByType(u,p):h?h(i,n).each(p):(c=!1,A(i.getSeries(),p));function p(v){var g=v.uid,m=l.set(g,s&&s.get(g)||(f=!0,ja({reset:fM,onDirty:pM})));m.context={model:v,overallProgress:c},m.agent=o,m.__block=c,a._pipe(v,m)}f&&o.dirty()},r.prototype._pipe=function(t,e){var i=t.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},r.wrapStageHandler=function(t,e){return tt(t)&&(t={overallReset:t,seriesType:_M(t)}),t.uid=Co("stageHandler"),e&&(t.visualType=e),t},r})();function cM(r){r.overallReset(r.ecModel,r.api,r.payload)}function fM(r){return r.overallProgress&&dM}function dM(){this.agent.dirty(),this.getDownstream().dirty()}function pM(){this.agent&&this.agent.dirty()}function vM(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function gM(r){r.useClearVisual&&r.data.clearAllVisual();var t=r.resetDefines=ie(r.reset(r.model,r.ecModel,r.api,r.payload));return t.length>1?H(t,function(e,i){return b_(i)}):mM}var mM=b_(0);function b_(r){return function(t,e){var i=e.data,n=e.resetDefines[r];if(n&&n.dataEach)for(var a=t.start;a<t.end;a++)n.dataEach(i,a);else n&&n.progress&&n.progress(t,i)}}function yM(r){return r.data.count()}function _M(r){Hs=null;try{r(ro,x_)}catch{}return Hs}var ro={},x_={},Hs;w_(ro,Af);w_(x_,X0);ro.eachSeriesByType=ro.eachRawSeriesByType=function(r){Hs=r};ro.eachComponent=function(r){r.mainType==="series"&&r.subType&&(Hs=r.subType)};function w_(r,t){for(var e in t.prototype)r[e]=Wt}var Iv=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const bM={color:Iv,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],Iv]};var Yt="#B9B8CE",Mv="#100C2A",Jo=function(){return{axisLine:{lineStyle:{color:Yt}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},Dv=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],S_={darkMode:!0,color:Dv,backgroundColor:Mv,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:Yt},pageTextStyle:{color:Yt}},textStyle:{color:Yt},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:Yt}},dataZoom:{borderColor:"#71708A",textStyle:{color:Yt},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:Yt}},timeline:{lineStyle:{color:Yt},label:{color:Yt},controlStyle:{color:Yt,borderColor:Yt}},calendar:{itemStyle:{color:Mv},dayLabel:{color:Yt},monthLabel:{color:Yt},yearLabel:{color:Yt}},timeAxis:Jo(),logAxis:Jo(),valueAxis:Jo(),categoryAxis:Jo(),line:{symbol:"circle"},graph:{color:Dv},gauge:{title:{color:Yt},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:Yt},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};S_.categoryAxis.splitLine.show=!1;var xM=(function(){function r(){}return r.prototype.normalizeQuery=function(t){var e={},i={},n={};if($(t)){var a=or(t);e.mainType=a.main||null,e.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};A(t,function(l,u){for(var h=!1,c=0;c<o.length;c++){var f=o[c],d=u.lastIndexOf(f);if(d>0&&d===u.length-f.length){var p=u.slice(0,d);p!=="data"&&(e.mainType=p,e[f.toLowerCase()]=l,h=!0)}}s.hasOwnProperty(u)&&(i[u]=l,h=!0),h||(n[u]=l)})}return{cptQuery:e,dataQuery:i,otherQuery:n}},r.prototype.filter=function(t,e){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,n,a));function h(c,f,d,p){return c[d]==null||f[p||d]===c[d]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r})(),ic=["symbol","symbolSize","symbolRotate","symbolOffset"],Pv=ic.concat(["symbolKeepAspect"]),wM={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData();if(r.legendIcon&&e.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o<ic.length;o++){var s=ic[o],l=r.get(s);tt(l)?(a=!0,n[s]=l):i[s]=l}if(i.symbol=i.symbol||r.defaultSymbol,e.setVisual(F({legendIcon:r.legendIcon||i.symbol,symbolKeepAspect:r.get("symbolKeepAspect")},i)),t.isSeriesFiltered(r))return;var u=vt(n);function h(c,f){for(var d=r.getRawValue(f),p=r.getDataParams(f),v=0;v<u.length;v++){var g=u[v];c.setItemVisual(f,g,n[g](d,p))}}return{dataEach:a?h:null}}},SM={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){if(!r.hasSymbolVisual||t.isSeriesFiltered(r))return;var e=r.getData();function i(n,a){for(var o=n.getItemModel(a),s=0;s<Pv.length;s++){var l=Pv[s],u=o.getShallow(l,!0);u!=null&&n.setItemVisual(a,l,u)}}return{dataEach:e.hasItemOption?i:null}}};function CM(r,t,e){switch(e){case"color":var i=r.getItemVisual(t,"style");return i[r.getVisual("drawType")];case"opacity":return r.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return r.getItemVisual(t,e)}}function TM(r,t){switch(t){case"color":var e=r.getVisual("style");return e[r.getVisual("drawType")];case"opacity":return r.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return r.getVisual(t)}}function pn(r,t,e,i,n){var a=r+t;e.isSilent(a)||i.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,u=n.selected,h=0;h<u.length;h++)if(u[h].seriesIndex===s){var c=o.getData(),f=Hi(c,n.fromActionPayload);e.trigger(a,{type:a,seriesId:o.id,name:G(f)?c.getName(f[0]):c.getName(f),selected:$(l)?l:F({},l)})}})}function AM(r,t,e){r.on("selectchanged",function(i){var n=e.getModel();i.isFromClick?(pn("map","selectchanged",t,n,i),pn("pie","selectchanged",t,n,i)):i.fromAction==="select"?(pn("map","selected",t,n,i),pn("pie","selected",t,n,i)):i.fromAction==="unselect"&&(pn("map","unselected",t,n,i),pn("pie","unselected",t,n,i))})}function Sa(r,t,e){for(var i;r&&!(t(r)&&(i=r,e));)r=r.__hostTarget||r.parent;return i}var IM=Math.round(Math.random()*9),MM=typeof Object.defineProperty=="function",DM=(function(){function r(){this._id="__ec_inner_"+IM++}return r.prototype.get=function(t){return this._guard(t)[this._id]},r.prototype.set=function(t,e){var i=this._guard(t);return MM?Object.defineProperty(i,this._id,{value:e,enumerable:!1,configurable:!0}):i[this._id]=e,this},r.prototype.delete=function(t){return this.has(t)?(delete this._guard(t)[this._id],!0):!1},r.prototype.has=function(t){return!!this._guard(t)[this._id]},r.prototype._guard=function(t){if(t!==Object(t))throw TypeError("Value of WeakMap is not a non-null object.");return t},r})(),PM=bt.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(r,t){var e=t.cx,i=t.cy,n=t.width/2,a=t.height/2;r.moveTo(e,i-a),r.lineTo(e+n,i+a),r.lineTo(e-n,i+a),r.closePath()}}),kM=bt.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(r,t){var e=t.cx,i=t.cy,n=t.width/2,a=t.height/2;r.moveTo(e,i-a),r.lineTo(e+n,i),r.lineTo(e,i+a),r.lineTo(e-n,i),r.closePath()}}),RM=bt.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(r,t){var e=t.x,i=t.y,n=t.width/5*3,a=Math.max(n,t.height),o=n/2,s=o*o/(a-o),l=i-a+o+s,u=Math.asin(s/o),h=Math.cos(u)*o,c=Math.sin(u),f=Math.cos(u),d=o*.6,p=o*.7;r.moveTo(e-h,l+s),r.arc(e,l,o,Math.PI-u,Math.PI*2+u),r.bezierCurveTo(e+h-c*d,l+s+f*d,e,i-p,e,i),r.bezierCurveTo(e,i-p,e-h+c*d,l+s+f*d,e-h,l+s),r.closePath()}}),LM=bt.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(r,t){var e=t.height,i=t.width,n=t.x,a=t.y,o=i/3*2;r.moveTo(n,a),r.lineTo(n+o,a+e),r.lineTo(n,a+e/4*3),r.lineTo(n-o,a+e),r.lineTo(n,a),r.closePath()}}),OM={line:Ye,rect:Nt,roundRect:Nt,square:Nt,circle:yo,diamond:kM,pin:RM,arrow:LM,triangle:PM},EM={line:function(r,t,e,i,n){n.x1=r,n.y1=t+i/2,n.x2=r+e,n.y2=t+i/2},rect:function(r,t,e,i,n){n.x=r,n.y=t,n.width=e,n.height=i},roundRect:function(r,t,e,i,n){n.x=r,n.y=t,n.width=e,n.height=i,n.r=Math.min(e,i)/4},square:function(r,t,e,i,n){var a=Math.min(e,i);n.x=r,n.y=t,n.width=a,n.height=a},circle:function(r,t,e,i,n){n.cx=r+e/2,n.cy=t+i/2,n.r=Math.min(e,i)/2},diamond:function(r,t,e,i,n){n.cx=r+e/2,n.cy=t+i/2,n.width=e,n.height=i},pin:function(r,t,e,i,n){n.x=r+e/2,n.y=t+i/2,n.width=e,n.height=i},arrow:function(r,t,e,i,n){n.x=r+e/2,n.y=t+i/2,n.width=e,n.height=i},triangle:function(r,t,e,i,n){n.cx=r+e/2,n.cy=t+i/2,n.width=e,n.height=i}},nc={};A(OM,function(r,t){nc[t]=new r});var jM=bt.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(r,t,e){var i=Iy(r,t,e),n=this.shape;return n&&n.symbolType==="pin"&&t.position==="inside"&&(i.y=e.y+e.height*.4),i},buildPath:function(r,t,e){var i=t.symbolType;if(i!=="none"){var n=nc[i];n||(i="rect",n=nc[i]),EM[i](t.x,t.y,t.width,t.height,n.shape),n.buildPath(r,n.shape,e)}}});function NM(r,t){if(this.type!=="image"){var e=this.style;this.__isEmptyBrush?(e.stroke=r,e.fill=t||"#fff",e.lineWidth=2):this.shape.symbolType==="line"?e.stroke=r:e.fill=r,this.markRedraw()}}function Gi(r,t,e,i,n,a,o){var s=r.indexOf("empty")===0;s&&(r=r.substr(5,1).toLowerCase()+r.substr(6));var l;return r.indexOf("image://")===0?l=uf(r.slice(8),new mt(t,e,i,n),o?"center":"cover"):r.indexOf("path://")===0?l=xl(r.slice(7),{},new mt(t,e,i,n),o?"center":"cover"):l=new jM({shape:{symbolType:r,x:t,y:e,width:i,height:n}}),l.__isEmptyBrush=s,l.setColor=NM,a&&l.setColor(a),l}function C_(r){return G(r)||(r=[+r,+r]),[r[0]||0,r[1]||0]}function kf(r,t){if(r!=null)return G(r)||(r=[r,r]),[te(r[0],t[0])||0,te(Q(r[1],r[0]),t[1])||0]}function Li(r){return isFinite(r)}function FM(r,t,e){var i=t.x==null?0:t.x,n=t.x2==null?1:t.x2,a=t.y==null?0:t.y,o=t.y2==null?0:t.y2;t.global||(i=i*e.width+e.x,n=n*e.width+e.x,a=a*e.height+e.y,o=o*e.height+e.y),i=Li(i)?i:0,n=Li(n)?n:1,a=Li(a)?a:0,o=Li(o)?o:0;var s=r.createLinearGradient(i,a,n,o);return s}function BM(r,t,e){var i=e.width,n=e.height,a=Math.min(i,n),o=t.x==null?.5:t.x,s=t.y==null?.5:t.y,l=t.r==null?.5:t.r;t.global||(o=o*i+e.x,s=s*n+e.y,l=l*a),o=Li(o)?o:.5,s=Li(s)?s:.5,l=l>=0&&Li(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function kv(r,t,e){for(var i=t.type==="radial"?BM(r,t,e):FM(r,t,e),n=t.colorStops,a=0;a<n.length;a++)i.addColorStop(n[a].offset,n[a].color);return i}function zM(r,t){if(r===t||!r&&!t)return!1;if(!r||!t||r.length!==t.length)return!0;for(var e=0;e<r.length;e++)if(r[e]!==t[e])return!0;return!1}function Qo(r){return parseInt(r,10)}function Rv(r,t,e){var i=["width","height"][t],n=["clientWidth","clientHeight"][t],a=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(e[i]!=null&&e[i]!=="auto")return parseFloat(e[i]);var s=document.defaultView.getComputedStyle(r);return(r[n]||Qo(s[i])||Qo(r.style[i]))-(Qo(s[a])||0)-(Qo(s[o])||0)|0}function VM(r,t){return!r||r==="solid"||!(t>0)?null:r==="dashed"?[4*t,2*t]:r==="dotted"?[t]:At(r)?[r]:G(r)?r:null}function Rf(r){var t=r.style,e=t.lineDash&&t.lineWidth>0&&VM(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(e){var n=t.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(e=H(e,function(a){return a/n}),i/=n)}return[e,i]}var HM=new Kr(!0);function Ws(r){var t=r.stroke;return!(t==null||t==="none"||!(r.lineWidth>0))}function Lv(r){return typeof r=="string"&&r!=="none"}function Gs(r){var t=r.fill;return t!=null&&t!=="none"}function Ov(r,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.fillOpacity*t.opacity,r.fill(),r.globalAlpha=e}else r.fill()}function Ev(r,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.strokeOpacity*t.opacity,r.stroke(),r.globalAlpha=e}else r.stroke()}function jv(r,t,e){var i=tf(t.image,t.__image,e);if(dl(i)){var n=r.createPattern(i,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Aa),a.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(a)}return n}}function WM(r,t,e,i){var n,a=Ws(e),o=Gs(e),s=e.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var h=t.path||HM,c=t.__dirty;if(!i){var f=e.fill,d=e.stroke,p=o&&!!f.colorStops,v=a&&!!d.colorStops,g=o&&!!f.image,m=a&&!!d.image,_=void 0,b=void 0,x=void 0,C=void 0,S=void 0;(p||v)&&(S=t.getBoundingRect()),p&&(_=c?kv(r,f,S):t.__canvasFillGradient,t.__canvasFillGradient=_),v&&(b=c?kv(r,d,S):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),g&&(x=c||!t.__canvasFillPattern?jv(r,f,t):t.__canvasFillPattern,t.__canvasFillPattern=x),m&&(C=c||!t.__canvasStrokePattern?jv(r,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=x),p?r.fillStyle=_:g&&(x?r.fillStyle=x:o=!1),v?r.strokeStyle=b:m&&(C?r.strokeStyle=C:a=!1)}var T=t.getGlobalScale();h.setScale(T[0],T[1],t.segmentIgnoreThreshold);var I,M;r.setLineDash&&e.lineDash&&(n=Rf(t),I=n[0],M=n[1]);var D=!0;(u||c&bn)&&(h.setDPR(r.dpr),l?h.setContext(null):(h.setContext(r),D=!1),h.reset(),t.buildPath(h,t.shape,i),h.toStatic(),t.pathUpdated()),D&&h.rebuildPath(r,l?s:1),I&&(r.setLineDash(I),r.lineDashOffset=M),i||(e.strokeFirst?(a&&Ev(r,e),o&&Ov(r,e)):(o&&Ov(r,e),a&&Ev(r,e))),I&&r.setLineDash([])}function GM(r,t,e){var i=t.__image=tf(e.image,t.__image,t,t.onload);if(!(!i||!dl(i))){var n=e.x||0,a=e.y||0,o=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),e.sWidth&&e.sHeight){var u=e.sx||0,h=e.sy||0;r.drawImage(i,u,h,e.sWidth,e.sHeight,n,a,o,s)}else if(e.sx&&e.sy){var u=e.sx,h=e.sy,c=o-u,f=s-h;r.drawImage(i,u,h,c,f,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function UM(r,t,e){var i,n=e.text;if(n!=null&&(n+=""),n){r.font=e.font||Xr,r.textAlign=e.textAlign,r.textBaseline=e.textBaseline;var a=void 0,o=void 0;r.setLineDash&&e.lineDash&&(i=Rf(t),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),e.strokeFirst?(Ws(e)&&r.strokeText(n,e.x,e.y),Gs(e)&&r.fillText(n,e.x,e.y)):(Gs(e)&&r.fillText(n,e.x,e.y),Ws(e)&&r.strokeText(n,e.x,e.y)),a&&r.setLineDash([])}}var Nv=["shadowBlur","shadowOffsetX","shadowOffsetY"],Fv=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function T_(r,t,e,i,n){var a=!1;if(!i&&(e=e||{},t===e))return!1;if(i||t.opacity!==e.opacity){fe(r,n),a=!0;var o=Math.max(Math.min(t.opacity,1),0);r.globalAlpha=isNaN(o)?ji.opacity:o}(i||t.blend!==e.blend)&&(a||(fe(r,n),a=!0),r.globalCompositeOperation=t.blend||ji.blend);for(var s=0;s<Nv.length;s++){var l=Nv[s];(i||t[l]!==e[l])&&(a||(fe(r,n),a=!0),r[l]=r.dpr*(t[l]||0))}return(i||t.shadowColor!==e.shadowColor)&&(a||(fe(r,n),a=!0),r.shadowColor=t.shadowColor||ji.shadowColor),a}function Bv(r,t,e,i,n){var a=io(t,n.inHover),o=i?null:e&&io(e,n.inHover)||{};if(a===o)return!1;var s=T_(r,a,o,i,n);if((i||a.fill!==o.fill)&&(s||(fe(r,n),s=!0),Lv(a.fill)&&(r.fillStyle=a.fill)),(i||a.stroke!==o.stroke)&&(s||(fe(r,n),s=!0),Lv(a.stroke)&&(r.strokeStyle=a.stroke)),(i||a.opacity!==o.opacity)&&(s||(fe(r,n),s=!0),r.globalAlpha=a.opacity==null?1:a.opacity),t.hasStroke()){var l=a.lineWidth,u=l/(a.strokeNoScale&&t.getLineScale?t.getLineScale():1);r.lineWidth!==u&&(s||(fe(r,n),s=!0),r.lineWidth=u)}for(var h=0;h<Fv.length;h++){var c=Fv[h],f=c[0];(i||a[f]!==o[f])&&(s||(fe(r,n),s=!0),r[f]=a[f]||c[1])}return s}function $M(r,t,e,i,n){return T_(r,io(t,n.inHover),e&&io(e,n.inHover),i,n)}function A_(r,t){var e=t.transform,i=r.dpr||1;e?r.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):r.setTransform(i,0,0,i,0,0)}function YM(r,t,e){for(var i=!1,n=0;n<r.length;n++){var a=r[n];i=i||a.isZeroArea(),A_(t,a),t.beginPath(),a.buildPath(t,a.shape),t.clip()}e.allClipped=i}function XM(r,t){return r&&t?r[0]!==t[0]||r[1]!==t[1]||r[2]!==t[2]||r[3]!==t[3]||r[4]!==t[4]||r[5]!==t[5]:!(!r&&!t)}var zv=1,Vv=2,Hv=3,Wv=4;function ZM(r){var t=Gs(r),e=Ws(r);return!(r.lineDash||!(+t^+e)||t&&typeof r.fill!="string"||e&&typeof r.stroke!="string"||r.strokePercent<1||r.strokeOpacity<1||r.fillOpacity<1)}function fe(r,t){t.batchFill&&r.fill(),t.batchStroke&&r.stroke(),t.batchFill="",t.batchStroke=""}function io(r,t){return t&&r.__hoverStyle||r.style}function I_(r,t){ac(r,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function ac(r,t,e,i){var n=t.transform;if(!t.shouldBePainted(e.viewWidth,e.viewHeight,!1,!1)){t.__dirty&=~ir,t.__isRendered=!1;return}var a=t.__clipPaths,o=e.prevElClipPaths,s=!1,l=!1;if((!o||zM(a,o))&&(o&&o.length&&(fe(r,e),r.restore(),l=s=!0,e.prevElClipPaths=null,e.allClipped=!1,e.prevEl=null),a&&a.length&&(fe(r,e),r.save(),YM(a,r,e),s=!0),e.prevElClipPaths=a),e.allClipped){t.__isRendered=!1;return}t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var u=e.prevEl;u||(l=s=!0);var h=t instanceof bt&&t.autoBatch&&ZM(t.style);s||XM(n,u.transform)?(fe(r,e),A_(r,t)):h||fe(r,e);var c=io(t,e.inHover);t instanceof bt?(e.lastDrawType!==zv&&(l=!0,e.lastDrawType=zv),Bv(r,t,u,l,e),(!h||!e.batchFill&&!e.batchStroke)&&r.beginPath(),WM(r,t,c,h),h&&(e.batchFill=c.fill||"",e.batchStroke=c.stroke||"")):t instanceof qa?(e.lastDrawType!==Hv&&(l=!0,e.lastDrawType=Hv),Bv(r,t,u,l,e),UM(r,t,c)):t instanceof Ze?(e.lastDrawType!==Vv&&(l=!0,e.lastDrawType=Vv),$M(r,t,u,l,e),GM(r,t,c)):t.getTemporalDisplayables&&(e.lastDrawType!==Wv&&(l=!0,e.lastDrawType=Wv),qM(r,t,e)),h&&i&&fe(r,e),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),e.prevEl=t,t.__dirty=0,t.__isRendered=!0}function qM(r,t,e){var i=t.getDisplayables(),n=t.getTemporalDisplayables();r.save();var a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:e.viewWidth,viewHeight:e.viewHeight,inHover:e.inHover},o,s;for(o=t.getCursor(),s=i.length;o<s;o++){var l=i[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),ac(r,l,a,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}for(var u=0,h=n.length;u<h;u++){var l=n[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),ac(r,l,a,u===h-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}t.clearTemporalDisplayables(),t.notClear=!0,r.restore()}var Nu=new DM,Gv=new vo(100),Uv=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function $v(r,t){if(r==="none")return null;var e=t.getDevicePixelRatio(),i=t.getZr(),n=i.painter.type==="svg";r.dirty&&Nu.delete(r);var a=Nu.get(r);if(a)return a;var o=lt(r,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=n?1:1/e,Nu.set(r,s),r.dirty=!1,s;function l(u){for(var h=[e],c=!0,f=0;f<Uv.length;++f){var d=o[Uv[f]];if(d!=null&&!G(d)&&!$(d)&&!At(d)&&typeof d!="boolean"){c=!1;break}h.push(d)}var p;if(c){p=h.join(",")+(n?"-svg":"");var v=Gv.get(p);v&&(n?u.svgElement=v:u.image=v)}var g=D_(o.dashArrayX),m=KM(o.dashArrayY),_=M_(o.symbol),b=JM(g),x=P_(m),C=!n&&Zr.createCanvas(),S=n&&{tag:"g",attrs:{},key:"dcl",children:[]},T=M(),I;C&&(C.width=T.width*e,C.height=T.height*e,I=C.getContext("2d")),D(),c&&Gv.put(p,C||S),u.image=C,u.svgElement=S,u.svgWidth=T.width,u.svgHeight=T.height;function M(){for(var P=1,k=0,R=b.length;k<R;++k)P=Qd(P,b[k]);for(var L=1,k=0,R=_.length;k<R;++k)L=Qd(L,_[k].length);P*=L;var N=x*b.length*_.length;return{width:Math.max(1,Math.min(P,o.maxTileWidth)),height:Math.max(1,Math.min(N,o.maxTileHeight))}}function D(){I&&(I.clearRect(0,0,C.width,C.height),o.backgroundColor&&(I.fillStyle=o.backgroundColor,I.fillRect(0,0,C.width,C.height)));for(var P=0,k=0;k<m.length;++k)P+=m[k];if(P<=0)return;for(var R=-x,L=0,N=0,j=0;R<T.height;){if(L%2===0){for(var Z=N/2%_.length,U=0,Y=0,et=0;U<T.width*2;){for(var ut=0,k=0;k<g[j].length;++k)ut+=g[j][k];if(ut<=0)break;if(Y%2===0){var ot=(1-o.symbolSize)*.5,ft=U+g[j][Y]*ot,gt=R+m[L]*ot,z=g[j][Y]*o.symbolSize,Rt=m[L]*o.symbolSize,It=et/2%_[Z].length;Lt(ft,gt,z,Rt,_[Z][It])}U+=g[j][Y],++et,++Y,Y===g[j].length&&(Y=0)}++j,j===g.length&&(j=0)}R+=m[L],++N,++L,L===m.length&&(L=0)}function Lt(xt,V,X,K,Ot){var St=n?1:e,oe=Gi(Ot,xt*St,V*St,X*St,K*St,o.color,o.symbolKeepAspect);if(n){var Ee=i.painter.renderOneToVNode(oe);Ee&&S.children.push(Ee)}else I_(I,oe)}}}}function M_(r){if(!r||r.length===0)return[["rect"]];if($(r))return[[r]];for(var t=!0,e=0;e<r.length;++e)if(!$(r[e])){t=!1;break}if(t)return M_([r]);for(var i=[],e=0;e<r.length;++e)$(r[e])?i.push([r[e]]):i.push(r[e]);return i}function D_(r){if(!r||r.length===0)return[[0,0]];if(At(r)){var t=Math.ceil(r);return[[t,t]]}for(var e=!0,i=0;i<r.length;++i)if(!At(r[i])){e=!1;break}if(e)return D_([r]);for(var n=[],i=0;i<r.length;++i)if(At(r[i])){var t=Math.ceil(r[i]);n.push([t,t])}else{var t=H(r[i],function(s){return Math.ceil(s)});t.length%2===1?n.push(t.concat(t)):n.push(t)}return n}function KM(r){if(!r||typeof r=="object"&&r.length===0)return[0,0];if(At(r)){var t=Math.ceil(r);return[t,t]}var e=H(r,function(i){return Math.ceil(i)});return r.length%2?e.concat(e):e}function JM(r){return H(r,function(t){return P_(t)})}function P_(r){for(var t=0,e=0;e<r.length;++e)t+=r[e];return r.length%2===1?t*2:t}function QM(r,t){r.eachRawSeries(function(e){if(!r.isSeriesFiltered(e)){var i=e.getData();i.hasItemVisual()&&i.each(function(o){var s=i.getItemVisual(o,"decal");if(s){var l=i.ensureUniqueItemVisual(o,"style");l.decal=$v(s,t)}});var n=i.getVisual("decal");if(n){var a=i.getVisual("style");a.decal=$v(n,t)}}})}var Ve=new hr,k_={};function tD(r,t){k_[r]=t}function R_(r){return k_[r]}var eD="5.6.0",rD={zrender:"5.6.1"},iD=1,nD=800,aD=900,oD=1e3,sD=2e3,lD=5e3,L_=1e3,uD=1100,Lf=2e3,O_=3e3,hD=4e3,Ll=4500,cD=4600,fD=5e3,dD=6e3,E_=7e3,j_={PROCESSOR:{FILTER:oD,SERIES_FILTER:nD,STATISTIC:lD},VISUAL:{LAYOUT:L_,PROGRESSIVE_LAYOUT:uD,GLOBAL:Lf,CHART:O_,POST_CHART_LAYOUT:cD,COMPONENT:hD,BRUSH:fD,CHART_ITEM:Ll,ARIA:dD,DECAL:E_}},$t="__flagInMainProcess",le="__pendingUpdate",Fu="__needsUpdateStatus",Yv=/^[a-zA-Z0-9_]+$/,Bu="__connectUpdateStatus",Xv=0,pD=1,vD=2;function N_(r){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this.isDisposed()){this.id;return}return B_(this,r,t)}}function F_(r){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return B_(this,r,t)}}function B_(r,t,e){return e[0]=e[0]&&e[0].toLowerCase(),hr.prototype[t].apply(r,e)}var z_=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t})(hr),V_=z_.prototype;V_.on=F_("on");V_.off=F_("off");var vn,zu,ts,Mr,Vu,Hu,Wu,la,ua,Zv,qv,Gu,Kv,es,Jv,H_,we,Qv,Us=(function(r){B(t,r);function t(e,i,n){var a=r.call(this,new xM)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},a._pendingActions=[],n=n||{},$(i)&&(i=W_[i]),a._dom=e;var o="canvas",s="auto",l=!1;n.ssr&&ky(function(f){var d=_t(f),p=d.dataIndex;if(p!=null){var v=nt();return v.set("series_index",d.seriesIndex),v.set("data_index",p),d.ssrType&&v.set("ssr_type",d.ssrType),v}});var u=a._zr=Nh(e,{renderer:n.renderer||o,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height,ssr:n.ssr,useDirtyRect:Q(n.useDirtyRect,l),useCoarsePointer:Q(n.useCoarsePointer,s),pointerSize:n.pointerSize});a._ssr=n.ssr,a._throttledZrFlush=Pf(ct(u.flush,u),17),i=it(i),i&&q0(i,!0),a._theme=i,a._locale=TA(n.locale||R0),a._coordSysMgr=new Pl;var h=a._api=Jv(a);function c(f,d){return f.__prio-d.__prio}return us(Ys,c),us(oc,c),a._scheduler=new __(a,h,oc,Ys),a._messageCenter=new z_,a._initEvents(),a.resize=ct(a.resize,a),u.animation.on("frame",a._onframe,a),Zv(u,a),qv(u,a),Is(a),a}return t.prototype._onframe=function(){if(!this._disposed){Qv(this);var e=this._scheduler;if(this[le]){var i=this[le].silent;this[$t]=!0;try{vn(this),Mr.update.call(this,null,this[le].updateParams)}catch(l){throw this[$t]=!1,this[le]=null,l}this._zr.flush(),this[$t]=!1,this[le]=null,la.call(this,i),ua.call(this,i)}else if(e.unfinished){var n=iD,a=this._model,o=this._api;e.unfinished=!1;do{var s=+new Date;e.performSeriesTasks(a),e.performDataProcessorTasks(a),Hu(this,a),e.performVisualTasks(a),es(this,this._model,o,"remain",{}),n-=+new Date-s}while(n>0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,i,n){if(!this[$t]){if(this._disposed){this.id;return}var a,o,s;if(q(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[$t]=!0,!this._model||i){var l=new rI(this._api),u=this._theme,h=this._model=new Af;h.scheduler=this._scheduler,h.ssr=this._ssr,h.init(null,null,null,u,this._locale,l)}this._model.setOption(e,{replaceMerge:o},sc);var c={seriesTransition:s,optionChanged:!0};if(n)this[le]={silent:a,updateParams:c},this[$t]=!1,this.getZr().wakeUp();else{try{vn(this),Mr.update.call(this,null,c)}catch(f){throw this[le]=null,this[$t]=!1,f}this._ssr||this._zr.flush(),this[le]=null,this[$t]=!1,la.call(this,a),ua.call(this,a)}}},t.prototype.setTheme=function(){},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||J.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var i=this._zr.painter;return i.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(J.svgSupported){var e=this._zr,i=e.storage.getDisplayList();return A(i,function(n){n.stopAnimation(null,!0)}),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e=e||{};var i=e.excludeComponents,n=this._model,a=[],o=this;A(i,function(l){n.eachComponent({mainType:l},function(u){var h=o._componentsMap[u.__viewId];h.group.ignore||(a.push(h),h.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return A(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var i=e.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(Xs[n]){var l=s,u=s,h=-s,c=-s,f=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();A(Fi,function(b,x){if(b.group===n){var C=i?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(it(e)),S=b.getDom().getBoundingClientRect();l=a(S.left,l),u=a(S.top,u),h=o(S.right,h),c=o(S.bottom,c),f.push({dom:C,left:S.left,top:S.top})}}),l*=d,u*=d,h*=d,c*=d;var p=h-l,v=c-u,g=Zr.createCanvas(),m=Nh(g,{renderer:i?"svg":"canvas"});if(m.resize({width:p,height:v}),i){var _="";return A(f,function(b){var x=b.left-l,C=b.top-u;_+='<g transform="translate('+x+","+C+')">'+b.dom+"</g>"}),m.painter.getSvgRoot().innerHTML=_,e.connectedBackgroundColor&&m.painter.setBackgroundColor(e.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return e.connectedBackgroundColor&&m.add(new Nt({shape:{x:0,y:0,width:p,height:v},style:{fill:e.connectedBackgroundColor}})),A(f,function(b){var x=new Ze({style:{x:b.left*d-l,y:b.top*d-u,image:b.dom}});m.add(x)}),m.refreshImmediately(),g.toDataURL("image/"+(e&&e.type||"png"))}else return this.getDataURL(e)},t.prototype.convertToPixel=function(e,i){return Vu(this,"convertToPixel",e,i)},t.prototype.convertFromPixel=function(e,i){return Vu(this,"convertFromPixel",e,i)},t.prototype.containPixel=function(e,i){if(this._disposed){this.id;return}var n=this._model,a,o=Da(n,e);return A(o,function(s,l){l.indexOf("Models")>=0&&A(s,function(u){var h=u.coordinateSystem;if(h&&h.containPoint)a=a||!!h.containPoint(i);else if(l==="seriesModels"){var c=this._chartsMap[u.__viewId];c&&c.containPoint&&(a=a||c.containPoint(i,u))}},this)},this),!!a},t.prototype.getVisual=function(e,i){var n=this._model,a=Da(n,e,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?CM(s,l,i):TM(s,i)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;A(gD,function(i){var n=function(a){var o=e.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&Sa(s,function(p){var v=_t(p);if(v&&v.dataIndex!=null){var g=v.dataModel||o.getSeriesByIndex(v.seriesIndex);return l=g&&g.getDataParams(v.dataIndex,v.dataType,s)||{},!0}else if(v.eventData)return l=F({},v.eventData),!0},!0),l){var h=l.componentType,c=l.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",c=l.seriesIndex);var f=h&&c!=null&&o.getComponent(h,c),d=f&&e[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];l.event=a,l.type=i,e._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:f,view:d},e.trigger(i,l)}};n.zrEventfulCallAtLast=!0,e._zr.on(i,n,e)}),A(Na,function(i,n){e._messageCenter.on(n,function(a){this.trigger(n,a)},e)}),A(["selectchanged"],function(i){e._messageCenter.on(i,function(n){this.trigger(i,n)},e)}),AM(this._messageCenter,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var e=this.getDom();e&&Hy(this.getDom(),Ef,"");var i=this,n=i._api,a=i._model;A(i._componentsViews,function(o){o.dispose(a,n)}),A(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete Fi[i.id]},t.prototype.resize=function(e){if(!this[$t]){if(this._disposed){this.id;return}this._zr.resize(e);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=e&&e.silent;this[le]&&(a==null&&(a=this[le].silent),n=!0,this[le]=null),this[$t]=!0;try{n&&vn(this),Mr.update.call(this,{type:"resize",animation:F({duration:0},e&&e.animation)})}catch(o){throw this[$t]=!1,o}this[$t]=!1,la.call(this,a),ua.call(this,a)}}},t.prototype.showLoading=function(e,i){if(this._disposed){this.id;return}if(q(e)&&(i=e,e=""),e=e||"default",this.hideLoading(),!!lc[e]){var n=lc[e](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var i=F({},e);return i.type=Na[e.type],i},t.prototype.dispatchAction=function(e,i){if(this._disposed){this.id;return}if(q(i)||(i={silent:!!i}),!!$s[e.type]&&this._model){if(this[$t]){this._pendingActions.push(e);return}var n=i.silent;Wu.call(this,e,n);var a=i.flush;a?this._zr.flush():a!==!1&&J.browser.weChat&&this._throttledZrFlush(),la.call(this,n),ua.call(this,n)}},t.prototype.updateLabelLayout=function(){Ve.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var i=e.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=(function(){vn=function(c){var f=c._scheduler;f.restorePipelines(c._model),f.prepareStageTasks(),zu(c,!0),zu(c,!1),f.plan()},zu=function(c,f){for(var d=c._model,p=c._scheduler,v=f?c._componentsViews:c._chartsViews,g=f?c._componentsMap:c._chartsMap,m=c._zr,_=c._api,b=0;b<v.length;b++)v[b].__alive=!1;f?d.eachComponent(function(S,T){S!=="series"&&x(T)}):d.eachSeries(x);function x(S){var T=S.__requireNewView;S.__requireNewView=!1;var I="_ec_"+S.id+"_"+S.type,M=!T&&g[I];if(!M){var D=or(S.type),P=f?Kt.getClass(D.main,D.sub):ye.getClass(D.sub);M=new P,M.init(d,_),g[I]=M,v.push(M),m.add(M.group)}S.__viewId=M.__id=I,M.__alive=!0,M.__model=S,M.group.__ecComponentInfo={mainType:S.mainType,index:S.componentIndex},!f&&p.prepareView(M,S,d,_)}for(var b=0;b<v.length;){var C=v[b];C.__alive?b++:(!f&&C.renderTask.dispose(),m.remove(C.group),C.dispose(d,_),v.splice(b,1),g[C.__id]===C&&delete g[C.__id],C.__id=C.group.__ecComponentInfo=null)}},ts=function(c,f,d,p,v){var g=c._model;if(g.setUpdatePayload(d),!p){A([].concat(c._componentsViews).concat(c._chartsViews),C);return}var m={};m[p+"Id"]=d[p+"Id"],m[p+"Index"]=d[p+"Index"],m[p+"Name"]=d[p+"Name"];var _={mainType:p,query:m};v&&(_.subType=v);var b=d.excludeSeriesId,x;b!=null&&(x=nt(),A(ie(b),function(S){var T=Ue(S,null);T!=null&&x.set(T,!0)})),g&&g.eachComponent(_,function(S){var T=x&&x.get(S.id)!=null;if(!T)if(Dp(d))if(S instanceof Xe)d.type===Ni&&!d.notBlur&&!S.get(["emphasis","disabled"])&&yT(S,d,c._api);else{var I=af(S.mainType,S.componentIndex,d.name,c._api),M=I.focusSelf,D=I.dispatchers;d.type===Ni&&M&&!d.notBlur&&Wh(S.mainType,S.componentIndex,c._api),D&&A(D,function(P){d.type===Ni?Nn(P):Fn(P)})}else $h(d)&&S instanceof Xe&&(xT(S,d,c._api),Ap(S),we(c))},c),g&&g.eachComponent(_,function(S){var T=x&&x.get(S.id)!=null;T||C(c[p==="series"?"_chartsMap":"_componentsMap"][S.__viewId])},c);function C(S){S&&S.__alive&&S[f]&&S[f](S.__model,g,c._api,d)}},Mr={prepareAndUpdate:function(c){vn(this),Mr.update.call(this,c,{optionChanged:c.newOption!=null})},update:function(c,f){var d=this._model,p=this._api,v=this._zr,g=this._coordSysMgr,m=this._scheduler;if(d){d.setUpdatePayload(c),m.restoreData(d,c),m.performSeriesTasks(d),g.create(d,p),m.performDataProcessorTasks(d,c),Hu(this,d),g.update(d,p),e(d),m.performVisualTasks(d,c),Gu(this,d,p,c,f);var _=d.get("backgroundColor")||"transparent",b=d.get("darkMode");v.setBackgroundColor(_),b!=null&&b!=="auto"&&v.setDarkMode(b),Ve.trigger("afterupdate",d,p)}},updateTransform:function(c){var f=this,d=this._model,p=this._api;if(d){d.setUpdatePayload(c);var v=[];d.eachComponent(function(m,_){if(m!=="series"){var b=f.getViewOfComponentModel(_);if(b&&b.__alive)if(b.updateTransform){var x=b.updateTransform(_,d,p,c);x&&x.update&&v.push(b)}else v.push(b)}});var g=nt();d.eachSeries(function(m){var _=f._chartsMap[m.__viewId];if(_.updateTransform){var b=_.updateTransform(m,d,p,c);b&&b.update&&g.set(m.uid,1)}else g.set(m.uid,1)}),e(d),this._scheduler.performVisualTasks(d,c,{setDirty:!0,dirtyMap:g}),es(this,d,p,c,{},g),Ve.trigger("afterupdate",d,p)}},updateView:function(c){var f=this._model;f&&(f.setUpdatePayload(c),ye.markUpdateMethod(c,"updateView"),e(f),this._scheduler.performVisualTasks(f,c,{setDirty:!0}),Gu(this,f,this._api,c,{}),Ve.trigger("afterupdate",f,this._api))},updateVisual:function(c){var f=this,d=this._model;d&&(d.setUpdatePayload(c),d.eachSeries(function(p){p.getData().clearAllVisual()}),ye.markUpdateMethod(c,"updateVisual"),e(d),this._scheduler.performVisualTasks(d,c,{visualType:"visual",setDirty:!0}),d.eachComponent(function(p,v){if(p!=="series"){var g=f.getViewOfComponentModel(v);g&&g.__alive&&g.updateVisual(v,d,f._api,c)}}),d.eachSeries(function(p){var v=f._chartsMap[p.__viewId];v.updateVisual(p,d,f._api,c)}),Ve.trigger("afterupdate",d,this._api))},updateLayout:function(c){Mr.update.call(this,c)}},Vu=function(c,f,d,p){if(c._disposed){c.id;return}for(var v=c._model,g=c._coordSysMgr.getCoordinateSystems(),m,_=Da(v,d),b=0;b<g.length;b++){var x=g[b];if(x[f]&&(m=x[f](v,_,p))!=null)return m}},Hu=function(c,f){var d=c._chartsMap,p=c._scheduler;f.eachSeries(function(v){p.updateStreamModes(v,d[v.__viewId])})},Wu=function(c,f){var d=this,p=this.getModel(),v=c.type,g=c.escapeConnect,m=$s[v],_=m.actionInfo,b=(_.update||"update").split(":"),x=b.pop(),C=b[0]!=null&&or(b[0]);this[$t]=!0;var S=[c],T=!1;c.batch&&(T=!0,S=H(c.batch,function(L){return L=lt(F({},L),c),L.batch=null,L}));var I=[],M,D=$h(c),P=Dp(c);if(P&&l0(this._api),A(S,function(L){if(M=m.action(L,d._model,d._api),M=M||F({},L),M.type=_.event||M.type,I.push(M),P){var N=Jc(c),j=N.queryOptionMap,Z=N.mainTypeSpecified,U=Z?j.keys()[0]:"series";ts(d,x,L,U),we(d)}else D?(ts(d,x,L,"series"),we(d)):C&&ts(d,x,L,C.main,C.sub)}),x!=="none"&&!P&&!D&&!C)try{this[le]?(vn(this),Mr.update.call(this,c),this[le]=null):Mr[x].call(this,c)}catch(L){throw this[$t]=!1,L}if(T?M={type:_.event||v,escapeConnect:g,batch:I}:M=I[0],this[$t]=!1,!f){var k=this._messageCenter;if(k.trigger(M.type,M),D){var R={type:"selectchanged",escapeConnect:g,selected:wT(p),isFromClick:c.isFromClick||!1,fromAction:c.type,fromActionPayload:c};k.trigger(R.type,R)}}},la=function(c){for(var f=this._pendingActions;f.length;){var d=f.shift();Wu.call(this,d,c)}},ua=function(c){!c&&this.trigger("updated")},Zv=function(c,f){c.on("rendered",function(d){f.trigger("rendered",d),c.animation.isFinished()&&!f[le]&&!f._scheduler.unfinished&&!f._pendingActions.length&&f.trigger("finished")})},qv=function(c,f){c.on("mouseover",function(d){var p=d.target,v=Sa(p,Uh);v&&(_T(v,d,f._api),we(f))}).on("mouseout",function(d){var p=d.target,v=Sa(p,Uh);v&&(bT(v,d,f._api),we(f))}).on("click",function(d){var p=d.target,v=Sa(p,function(_){return _t(_).dataIndex!=null},!0);if(v){var g=v.selected?"unselect":"select",m=_t(v);f._api.dispatchAction({type:g,dataType:m.dataType,dataIndexInside:m.dataIndex,seriesIndex:m.seriesIndex,isFromClick:!0})}})};function e(c){c.clearColorPalette(),c.eachSeries(function(f){f.clearColorPalette()})}function i(c){var f=[],d=[],p=!1;if(c.eachComponent(function(_,b){var x=b.get("zlevel")||0,C=b.get("z")||0,S=b.getZLevelKey();p=p||!!S,(_==="series"?d:f).push({zlevel:x,z:C,idx:b.componentIndex,type:_,key:S})}),p){var v=f.concat(d),g,m;us(v,function(_,b){return _.zlevel===b.zlevel?_.z-b.z:_.zlevel-b.zlevel}),A(v,function(_){var b=c.getComponent(_.type,_.idx),x=_.zlevel,C=_.key;g!=null&&(x=Math.max(g,x)),C?(x===g&&C!==m&&x++,m=C):m&&(x===g&&x++,m=""),g=x,b.setZLevel(x)})}}Gu=function(c,f,d,p,v){i(f),Kv(c,f,d,p,v),A(c._chartsViews,function(g){g.__alive=!1}),es(c,f,d,p,v),A(c._chartsViews,function(g){g.__alive||g.remove(f,d)})},Kv=function(c,f,d,p,v,g){A(g||c._componentsViews,function(m){var _=m.__model;u(_,m),m.render(_,f,d,p),s(_,m),h(_,m)})},es=function(c,f,d,p,v,g){var m=c._scheduler;v=F(v||{},{updatedSeries:f.getSeries()}),Ve.trigger("series:beforeupdate",f,d,v);var _=!1;f.eachSeries(function(b){var x=c._chartsMap[b.__viewId];x.__alive=!0;var C=x.renderTask;m.updatePayload(C,p),u(b,x),g&&g.get(b.uid)&&C.dirty(),C.perform(m.getPerformArgs(C))&&(_=!0),x.group.silent=!!b.get("silent"),o(b,x),Ap(b)}),m.unfinished=_||m.unfinished,Ve.trigger("series:layoutlabels",f,d,v),Ve.trigger("series:transition",f,d,v),f.eachSeries(function(b){var x=c._chartsMap[b.__viewId];s(b,x),h(b,x)}),a(c,f),Ve.trigger("series:afterupdate",f,d,v)},we=function(c){c[Fu]=!0,c.getZr().wakeUp()},Qv=function(c){c[Fu]&&(c.getZr().storage.traverse(function(f){Oa(f)||n(f)}),c[Fu]=!1)};function n(c){for(var f=[],d=c.currentStates,p=0;p<d.length;p++){var v=d[p];v==="emphasis"||v==="blur"||v==="select"||f.push(v)}c.selected&&c.states.select&&f.push("select"),c.hoverState===gl&&c.states.emphasis?f.push("emphasis"):c.hoverState===vl&&c.states.blur&&f.push("blur"),c.useStates(f)}function a(c,f){var d=c._zr,p=d.storage,v=0;p.traverse(function(g){g.isGroup||v++}),v>f.get("hoverLayerThreshold")&&!J.node&&!J.worker&&f.eachSeries(function(g){if(!g.preventUsingHoverLayer){var m=c._chartsMap[g.__viewId];m.__alive&&m.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function o(c,f){var d=c.get("blendMode")||null;f.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function s(c,f){if(!c.preventAutoZ){var d=c.get("z")||0,p=c.get("zlevel")||0;f.eachRendered(function(v){return l(v,d,p,-1/0),!0})}}function l(c,f,d,p){var v=c.getTextContent(),g=c.getTextGuideLine(),m=c.isGroup;if(m)for(var _=c.childrenRef(),b=0;b<_.length;b++)p=Math.max(l(_[b],f,d,p),p);else c.z=f,c.zlevel=d,p=Math.max(c.z2,p);if(v&&(v.z=f,v.zlevel=d,isFinite(p)&&(v.z2=p+2)),g){var x=c.textGuideLineConfig;g.z=f,g.zlevel=d,isFinite(p)&&(g.z2=p+(x&&x.showAbove?1:-1))}return p}function u(c,f){f.eachRendered(function(d){if(!Oa(d)){var p=d.getTextContent(),v=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function h(c,f){var d=c.getModel("stateAnimation"),p=c.isAnimationEnabled(),v=d.get("duration"),g=v>0?{duration:v,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(m){if(m.states&&m.states.emphasis){if(Oa(m))return;if(m instanceof bt&&IT(m),m.__dirty){var _=m.prevStates;_&&m.useStates(_)}if(p){m.stateTransition=g;var b=m.getTextContent(),x=m.getTextGuideLine();b&&(b.stateTransition=g),x&&(x.stateTransition=g)}m.__dirty&&n(m)}})}Jv=function(c){return new((function(f){B(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return c._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(p){for(;p;){var v=p.__ecComponentInfo;if(v!=null)return c._model.getComponent(v.mainType,v.index);p=p.parent}},d.prototype.enterEmphasis=function(p,v){Nn(p,v),we(c)},d.prototype.leaveEmphasis=function(p,v){Fn(p,v),we(c)},d.prototype.enterBlur=function(p){mT(p),we(c)},d.prototype.leaveBlur=function(p){n0(p),we(c)},d.prototype.enterSelect=function(p){a0(p),we(c)},d.prototype.leaveSelect=function(p){o0(p),we(c)},d.prototype.getModel=function(){return c.getModel()},d.prototype.getViewOfComponentModel=function(p){return c.getViewOfComponentModel(p)},d.prototype.getViewOfSeriesModel=function(p){return c.getViewOfSeriesModel(p)},d})(X0))(c)},H_=function(c){function f(d,p){for(var v=0;v<d.length;v++){var g=d[v];g[Bu]=p}}A(Na,function(d,p){c._messageCenter.on(p,function(v){if(Xs[c.group]&&c[Bu]!==Xv){if(v&&v.escapeConnect)return;var g=c.makeActionFromEvent(v),m=[];A(Fi,function(_){_!==c&&_.group===c.group&&m.push(_)}),f(m,Xv),A(m,function(_){_[Bu]!==pD&&_.dispatchAction(g)}),f(m,vD)}})})}})(),t})(hr),Of=Us.prototype;Of.on=N_("on");Of.off=N_("off");Of.one=function(r,t,e){var i=this;function n(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];t&&t.apply&&t.apply(this,a),i.off(r,n)}this.on.call(this,r,n,e)};var gD=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var $s={},Na={},oc=[],sc=[],Ys=[],W_={},lc={},Fi={},Xs={},mD=+new Date-0,yD=+new Date-0,Ef="_echarts_instance_";function _D(r,t,e){var i=!(e&&e.ssr);if(i){var n=jf(r);if(n)return n}var a=new Us(r,t,e);return a.id="ec_"+mD++,Fi[a.id]=a,i&&Hy(r,Ef,a.id),H_(a),Ve.trigger("afterinit",a),a}function bD(r){if(G(r)){var t=r;r=null,A(t,function(e){e.group!=null&&(r=e.group)}),r=r||"g_"+yD++,A(t,function(e){e.group=r})}return Xs[r]=!0,r}function G_(r){Xs[r]=!1}var xD=G_;function wD(r){$(r)?r=Fi[r]:r instanceof Us||(r=jf(r)),r instanceof Us&&!r.isDisposed()&&r.dispose()}function jf(r){return Fi[lC(r,Ef)]}function SD(r){return Fi[r]}function Nf(r,t){W_[r]=t}function Ff(r){pt(sc,r)<0&&sc.push(r)}function Bf(r,t){zf(oc,r,t,sD)}function U_(r){Ol("afterinit",r)}function $_(r){Ol("afterupdate",r)}function Ol(r,t){Ve.on(r,t)}function qe(r,t,e){tt(t)&&(e=t,t="");var i=q(r)?r.type:[r,r={event:t}][0];r.event=(r.event||i).toLowerCase(),t=r.event,!Na[t]&&(_e(Yv.test(i)&&Yv.test(t)),$s[i]||($s[i]={action:e,actionInfo:r}),Na[t]=i)}function Y_(r,t){Pl.register(r,t)}function CD(r){var t=Pl.get(r);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()}function X_(r,t){zf(Ys,r,t,L_,"layout")}function Qr(r,t){zf(Ys,r,t,O_,"visual")}var tg=[];function zf(r,t,e,i,n){if((tt(t)||q(t))&&(e=t,t=i),!(pt(tg,e)>=0)){tg.push(e);var a=__.wrapStageHandler(e,n);a.__prio=t,a.__raw=e,r.push(a)}}function Vf(r,t){lc[r]=t}function TD(r){Um({createCanvas:r})}function Z_(r,t,e){var i=R_("registerMap");i&&i(r,t,e)}function AD(r){var t=R_("getMap");return t&&t(r)}var q_=kI;Qr(Lf,sM);Qr(Ll,lM);Qr(Ll,uM);Qr(Lf,wM);Qr(Ll,SM);Qr(E_,QM);Ff(q0);Bf(aD,pI);Vf("default",hM);qe({type:Ni,event:Ni,update:Ni},Wt);qe({type:vs,event:vs,update:vs},Wt);qe({type:Pa,event:Pa,update:Pa},Wt);qe({type:gs,event:gs,update:gs},Wt);qe({type:ka,event:ka,update:ka},Wt);Nf("light",bM);Nf("dark",S_);var ID={};function ha(r){return r==null?0:r.length||1}function eg(r){return r}var Hf=(function(){function r(t,e,i,n,a,o){this._old=t,this._new=e,this._oldKeyGetter=i||eg,this._newKeyGetter=n||eg,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(t){return this._add=t,this},r.prototype.update=function(t){return this._update=t,this},r.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},r.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},r.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},r.prototype.remove=function(t){return this._remove=t,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var t=this._old,e=this._new,i={},n=new Array(t.length),a=new Array(e.length);this._initIndexMap(t,null,n,"_oldKeyGetter"),this._initIndexMap(e,i,a,"_newKeyGetter");for(var o=0;o<t.length;o++){var s=n[o],l=i[s],u=ha(l);if(u>1){var h=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(h,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},r.prototype._executeMultiple=function(){var t=this._old,e=this._new,i={},n={},a=[],o=[];this._initIndexMap(t,i,a,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var s=0;s<a.length;s++){var l=a[s],u=i[l],h=n[l],c=ha(u),f=ha(h);if(c>1&&f===1)this._updateManyToOne&&this._updateManyToOne(h,u),n[l]=null;else if(c===1&&f>1)this._updateOneToMany&&this._updateOneToMany(h,u),n[l]=null;else if(c===1&&f===1)this._update&&this._update(h,u),n[l]=null;else if(c>1&&f>1)this._updateManyToMany&&this._updateManyToMany(h,u),n[l]=null;else if(c>1)for(var d=0;d<c;d++)this._remove&&this._remove(u[d]);else this._remove&&this._remove(u)}this._performRestAdd(o,n)},r.prototype._performRestAdd=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],a=e[n],o=ha(a);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(a[s]);else o===1&&this._add&&this._add(a);e[n]=null}},r.prototype._initIndexMap=function(t,e,i,n){for(var a=this._diffModeMultiple,o=0;o<t.length;o++){var s="_ec_"+this[n](t[o],o);if(a||(i[o]=s),!!e){var l=e[s],u=ha(l);u===0?(e[s]=o,a&&i.push(s)):u===1?e[s]=[l,o]:l.push(o)}}},r})(),MD=(function(){function r(t,e){this._encode=t,this._schema=e}return r.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},r.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},r})();function DD(r,t){var e={},i=e.encode={},n=nt(),a=[],o=[],s={};A(r.dimensions,function(f){var d=r.getDimensionInfo(f),p=d.coordDim;if(p){var v=d.coordDimIndex;Uu(i,p)[v]=f,d.isExtraCoord||(n.set(p,1),kD(d.type)&&(a[0]=f),Uu(s,p)[v]=r.getDimensionIndex(d.name)),d.defaultTooltip&&o.push(f)}W0.each(function(g,m){var _=Uu(i,m),b=d.otherDims[m];b!=null&&b!==!1&&(_[b]=d.name)})});var l=[],u={};n.each(function(f,d){var p=i[d];u[d]=p[0],l=l.concat(p)}),e.dataDimsOnCoord=l,e.dataDimIndicesOnCoord=H(l,function(f){return r.getDimensionInfo(f).storeDimIndex}),e.encodeFirstDimNotExtra=u;var h=i.label;h&&h.length&&(a=h.slice());var c=i.tooltip;return c&&c.length?o=c.slice():o.length||(o=a.slice()),i.defaultedLabel=a,i.defaultedTooltip=o,e.userOutput=new MD(s,t),e}function Uu(r,t){return r.hasOwnProperty(t)||(r[t]=[]),r[t]}function PD(r){return r==="category"?"ordinal":r==="time"?"time":"float"}function kD(r){return!(r==="ordinal"||r==="time")}var bs=(function(){function r(t){this.otherDims={},t!=null&&F(this,t)}return r})(),RD=kt(),LD={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},K_=(function(){function r(t){this.dimensions=t.dimensions,this._dimOmitted=t.dimensionOmitted,this.source=t.source,this._fullDimCount=t.fullDimensionCount,this._updateDimOmitted(t.dimensionOmitted)}return r.prototype.isDimensionOmitted=function(){return this._dimOmitted},r.prototype._updateDimOmitted=function(t){this._dimOmitted=t,t&&(this._dimNameMap||(this._dimNameMap=tb(this.source)))},r.prototype.getSourceDimensionIndex=function(t){return Q(this._dimNameMap.get(t),-1)},r.prototype.getSourceDimension=function(t){var e=this.source.dimensionsDefine;if(e)return e[t]},r.prototype.makeStoreSchema=function(){for(var t=this._fullDimCount,e=Q0(this.source),i=!eb(t),n="",a=[],o=0,s=0;o<t;o++){var l=void 0,u=void 0,h=void 0,c=this.dimensions[s];if(c&&c.storeDimIndex===o)l=e?c.name:null,u=c.type,h=c.ordinalMeta,s++;else{var f=this.getSourceDimension(o);f&&(l=e?f.name:null,u=f.type)}a.push({property:l,type:u,ordinalMeta:h}),e&&l!=null&&(!c||!c.isCalculationCoord)&&(n+=i?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),n+="$",n+=LD[u]||"f",h&&(n+=h.uid),n+="$"}var d=this.source,p=[d.seriesLayoutBy,d.startIndex,n].join("$$");return{dimensions:a,hash:p}},r.prototype.makeOutputDimensionNames=function(){for(var t=[],e=0,i=0;e<this._fullDimCount;e++){var n=void 0,a=this.dimensions[i];if(a&&a.storeDimIndex===e)a.isCalculationCoord||(n=a.name),i++;else{var o=this.getSourceDimension(e);o&&(n=o.name)}t.push(n)}return t},r.prototype.appendCalculationDimension=function(t){this.dimensions.push(t),t.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},r})();function J_(r){return r instanceof K_}function Q_(r){for(var t=nt(),e=0;e<(r||[]).length;e++){var i=r[e],n=q(i)?i.name:i;n!=null&&t.get(n)==null&&t.set(n,e)}return t}function tb(r){var t=RD(r);return t.dimNameMap||(t.dimNameMap=Q_(r.dimensionsDefine))}function eb(r){return r>30}var ca=q,Dr=H,OD=typeof Int32Array>"u"?Array:Int32Array,ED="e\0\0",rg=-1,jD=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],ND=["_approximateExtent"],ig,rs,fa,da,$u,pa,Yu,Wf=(function(){function r(t,e){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var i,n=!1;J_(t)?(i=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(n=!0,i=t),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},h=0;h<i.length;h++){var c=i[h],f=$(c)?new bs({name:c}):c instanceof bs?c:new bs(c),d=f.name;f.type=f.type||"float",f.coordDim||(f.coordDim=d,f.coordDimIndex=0);var p=f.otherDims=f.otherDims||{};o.push(d),a[d]=f,u[d]!=null&&(l=!0),f.createInvertedIndices&&(s[d]=[]),p.itemName===0&&(this._nameDimIdx=h),p.itemId===0&&(this._idDimIdx=h),n&&(f.storeDimIndex=h)}if(this.dimensions=o,this._dimInfos=a,this._initGetDimensionInfo(l),this.hostModel=e,this._invertedIndicesMap=s,this._dimOmitted){var v=this._dimIdxToName=nt();A(o,function(g){v.set(a[g].storeDimIndex,g)})}}return r.prototype.getDimension=function(t){var e=this._recognizeDimIndex(t);if(e==null)return t;if(e=t,!this._dimOmitted)return this.dimensions[e];var i=this._dimIdxToName.get(e);if(i!=null)return i;var n=this._schema.getSourceDimension(e);if(n)return n.name},r.prototype.getDimensionIndex=function(t){var e=this._recognizeDimIndex(t);if(e!=null)return e;if(t==null)return-1;var i=this._getDimInfo(t);return i?i.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(t):-1},r.prototype._recognizeDimIndex=function(t){if(At(t)||t!=null&&!isNaN(t)&&!this._getDimInfo(t)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(t)<0))return+t},r.prototype._getStoreDimIndex=function(t){var e=this.getDimensionIndex(t);return e},r.prototype.getDimensionInfo=function(t){return this._getDimInfo(this.getDimension(t))},r.prototype._initGetDimensionInfo=function(t){var e=this._dimInfos;this._getDimInfo=t?function(i){return e.hasOwnProperty(i)?e[i]:void 0}:function(i){return e[i]}},r.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},r.prototype.mapDimension=function(t,e){var i=this._dimSummary;if(e==null)return i.encodeFirstDimNotExtra[t];var n=i.encode[t];return n?n[e]:null},r.prototype.mapDimensionsAll=function(t){var e=this._dimSummary,i=e.encode[t];return(i||[]).slice()},r.prototype.getStore=function(){return this._store},r.prototype.initData=function(t,e,i){var n=this,a;if(t instanceof Jh&&(a=t),!a){var o=this.dimensions,s=If(t)||ne(t)?new t_(t,o.length):t;a=new Jh;var l=Dr(o,function(u){return{type:n._dimInfos[u].type,property:u}});a.initData(s,l,i)}this._store=a,this._nameList=(e||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,a.count()),this._dimSummary=DD(this,this._schema),this.userOutput=this._dimSummary.userOutput},r.prototype.appendData=function(t){var e=this._store.appendData(t);this._doInit(e[0],e[1])},r.prototype.appendValues=function(t,e){var i=this._store.appendValues(t,e&&e.length),n=i.start,a=i.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),e)for(var s=n;s<a;s++){var l=s-n;this._nameList[s]=e[l],o&&Yu(this,s)}},r.prototype._updateOrdinalMeta=function(){for(var t=this._store,e=this.dimensions,i=0;i<e.length;i++){var n=this._dimInfos[e[i]];n.ordinalMeta&&t.collectOrdinalMeta(n.storeDimIndex,n.ordinalMeta)}},r.prototype._shouldMakeIdFromName=function(){var t=this._store.getProvider();return this._idDimIdx==null&&t.getSource().sourceFormat!==$r&&!t.fillStorage},r.prototype._doInit=function(t,e){if(!(t>=e)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===Oe;if(l&&!n.pure)for(var u=[],h=t;h<e;h++){var c=n.getItem(h,u);if(!this.hasItemOption&&ZS(c)&&(this.hasItemOption=!0),c){var f=c.name;a[h]==null&&f!=null&&(a[h]=Ue(f,null));var d=c.id;o[h]==null&&d!=null&&(o[h]=Ue(d,null))}}if(this._shouldMakeIdFromName())for(var h=t;h<e;h++)Yu(this,h);ig(this)}},r.prototype.getApproximateExtent=function(t){return this._approximateExtent[t]||this._store.getDataExtent(this._getStoreDimIndex(t))},r.prototype.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},r.prototype.getCalculationInfo=function(t){return this._calculationInfo[t]},r.prototype.setCalculationInfo=function(t,e){ca(t)?F(this._calculationInfo,t):this._calculationInfo[t]=e},r.prototype.getName=function(t){var e=this.getRawIndex(t),i=this._nameList[e];return i==null&&this._nameDimIdx!=null&&(i=fa(this,this._nameDimIdx,e)),i==null&&(i=""),i},r.prototype._getCategory=function(t,e){var i=this._store.get(t,e),n=this._store.getOrdinalMeta(t);return n?n.categories[i]:i},r.prototype.getId=function(t){return rs(this,this.getRawIndex(t))},r.prototype.count=function(){return this._store.count()},r.prototype.get=function(t,e){var i=this._store,n=this._dimInfos[t];if(n)return i.get(n.storeDimIndex,e)},r.prototype.getByRawIndex=function(t,e){var i=this._store,n=this._dimInfos[t];if(n)return i.getByRawIndex(n.storeDimIndex,e)},r.prototype.getIndices=function(){return this._store.getIndices()},r.prototype.getDataExtent=function(t){return this._store.getDataExtent(this._getStoreDimIndex(t))},r.prototype.getSum=function(t){return this._store.getSum(this._getStoreDimIndex(t))},r.prototype.getMedian=function(t){return this._store.getMedian(this._getStoreDimIndex(t))},r.prototype.getValues=function(t,e){var i=this,n=this._store;return G(t)?n.getValues(Dr(t,function(a){return i._getStoreDimIndex(a)}),e):n.getValues(t)},r.prototype.hasValue=function(t){for(var e=this._dimSummary.dataDimIndicesOnCoord,i=0,n=e.length;i<n;i++)if(isNaN(this._store.get(e[i],t)))return!1;return!0},r.prototype.indexOfName=function(t){for(var e=0,i=this._store.count();e<i;e++)if(this.getName(e)===t)return e;return-1},r.prototype.getRawIndex=function(t){return this._store.getRawIndex(t)},r.prototype.indexOfRawIndex=function(t){return this._store.indexOfRawIndex(t)},r.prototype.rawIndexOf=function(t,e){var i=t&&this._invertedIndicesMap[t],n=i&&i[e];return n==null||isNaN(n)?rg:n},r.prototype.indicesOfNearest=function(t,e,i){return this._store.indicesOfNearest(this._getStoreDimIndex(t),e,i)},r.prototype.each=function(t,e,i){tt(t)&&(i=e,e=t,t=[]);var n=i||this,a=Dr(da(t),this._getStoreDimIndex,this);this._store.each(a,n?ct(e,n):e)},r.prototype.filterSelf=function(t,e,i){tt(t)&&(i=e,e=t,t=[]);var n=i||this,a=Dr(da(t),this._getStoreDimIndex,this);return this._store=this._store.filter(a,n?ct(e,n):e),this},r.prototype.selectRange=function(t){var e=this,i={},n=vt(t);return A(n,function(a){var o=e._getStoreDimIndex(a);i[o]=t[a]}),this._store=this._store.selectRange(i),this},r.prototype.mapArray=function(t,e,i){tt(t)&&(i=e,e=t,t=[]),i=i||this;var n=[];return this.each(t,function(){n.push(e&&e.apply(this,arguments))},i),n},r.prototype.map=function(t,e,i,n){var a=i||n||this,o=Dr(da(t),this._getStoreDimIndex,this),s=pa(this);return s._store=this._store.map(o,a?ct(e,a):e),s},r.prototype.modify=function(t,e,i,n){var a=i||n||this,o=Dr(da(t),this._getStoreDimIndex,this);this._store.modify(o,a?ct(e,a):e)},r.prototype.downSample=function(t,e,i,n){var a=pa(this);return a._store=this._store.downSample(this._getStoreDimIndex(t),e,i,n),a},r.prototype.minmaxDownSample=function(t,e){var i=pa(this);return i._store=this._store.minmaxDownSample(this._getStoreDimIndex(t),e),i},r.prototype.lttbDownSample=function(t,e){var i=pa(this);return i._store=this._store.lttbDownSample(this._getStoreDimIndex(t),e),i},r.prototype.getRawDataItem=function(t){return this._store.getRawDataItem(t)},r.prototype.getItemModel=function(t){var e=this.hostModel,i=this.getRawDataItem(t);return new Tt(i,e,e&&e.ecModel)},r.prototype.diff=function(t){var e=this;return new Hf(t?t.getStore().getIndices():[],this.getStore().getIndices(),function(i){return rs(t,i)},function(i){return rs(e,i)})},r.prototype.getVisual=function(t){var e=this._visual;return e&&e[t]},r.prototype.setVisual=function(t,e){this._visual=this._visual||{},ca(t)?F(this._visual,t):this._visual[t]=e},r.prototype.getItemVisual=function(t,e){var i=this._itemVisuals[t],n=i&&i[e];return n??this.getVisual(e)},r.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},r.prototype.ensureUniqueItemVisual=function(t,e){var i=this._itemVisuals,n=i[t];n||(n=i[t]={});var a=n[e];return a==null&&(a=this.getVisual(e),G(a)?a=a.slice():ca(a)&&(a=F({},a)),n[e]=a),a},r.prototype.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{};this._itemVisuals[t]=n,ca(e)?F(n,e):n[e]=i},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(t,e){ca(t)?F(this._layout,t):this._layout[t]=e},r.prototype.getLayout=function(t){return this._layout[t]},r.prototype.getItemLayout=function(t){return this._itemLayouts[t]},r.prototype.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?F(this._itemLayouts[t]||{},e):e},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(t,e){var i=this.hostModel&&this.hostModel.seriesIndex;sT(i,this.dataType,t,e),this._graphicEls[t]=e},r.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},r.prototype.eachItemGraphicEl=function(t,e){A(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},r.prototype.cloneShallow=function(t){return t||(t=new r(this._schema?this._schema:Dr(this.dimensions,this._getDimInfo,this),this.hostModel)),$u(t,this),t._store=this._store,t},r.prototype.wrapMethod=function(t,e){var i=this[t];tt(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var n=i.apply(this,arguments);return e.apply(this,[n].concat(ol(arguments)))})},r.internalField=(function(){ig=function(t){var e=t._invertedIndicesMap;A(e,function(i,n){var a=t._dimInfos[n],o=a.ordinalMeta,s=t._store;if(o){i=e[n]=new OD(o.categories.length);for(var l=0;l<i.length;l++)i[l]=rg;for(var l=0;l<s.count();l++)i[s.get(a.storeDimIndex,l)]=l}})},fa=function(t,e,i){return Ue(t._getCategory(e,i),null)},rs=function(t,e){var i=t._idList[e];return i==null&&t._idDimIdx!=null&&(i=fa(t,t._idDimIdx,e)),i==null&&(i=ED+e),i},da=function(t){return G(t)||(t=t!=null?[t]:[]),t},pa=function(t){var e=new r(t._schema?t._schema:Dr(t.dimensions,t._getDimInfo,t),t.hostModel);return $u(e,t),e},$u=function(t,e){A(jD.concat(e.__wrappedMethods||[]),function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t.__wrappedMethods=e.__wrappedMethods,A(ND,function(i){t[i]=it(e[i])}),t._calculationInfo=F({},e._calculationInfo)},Yu=function(t,e){var i=t._nameList,n=t._idList,a=t._nameDimIdx,o=t._idDimIdx,s=i[e],l=n[e];if(s==null&&a!=null&&(i[e]=s=fa(t,a,e)),l==null&&o!=null&&(n[e]=l=fa(t,o,e)),l==null&&s!=null){var u=t._nameRepeatCount,h=u[s]=(u[s]||0)+1;l=s,h>1&&(l+="__ec__"+h),n[e]=l}}})(),r})();function FD(r,t){return rb(r,t).dimensions}function rb(r,t){If(r)||(r=K0(r)),t=t||{};var e=t.coordDimensions||[],i=t.dimensionsDefine||r.dimensionsDefine||[],n=nt(),a=[],o=zD(r,e,i,t.dimensionsCount),s=t.canOmitUnusedDimensions&&eb(o),l=i===r.dimensionsDefine,u=l?tb(r):Q_(i),h=t.encodeDefine;!h&&t.encodeDefaulter&&(h=t.encodeDefaulter(r,o));for(var c=nt(h),f=new o_(o),d=0;d<f.length;d++)f[d]=-1;function p(M){var D=f[M];if(D<0){var P=i[M],k=q(P)?P:{name:P},R=new bs,L=k.name;L!=null&&u.get(L)!=null&&(R.name=R.displayName=L),k.type!=null&&(R.type=k.type),k.displayName!=null&&(R.displayName=k.displayName);var N=a.length;return f[M]=N,R.storeDimIndex=M,a.push(R),R}return a[D]}if(!s)for(var d=0;d<o;d++)p(d);c.each(function(M,D){var P=ie(M).slice();if(P.length===1&&!$(P[0])&&P[0]<0){c.set(D,!1);return}var k=c.set(D,[]);A(P,function(R,L){var N=$(R)?u.get(R):R;N!=null&&N<o&&(k[L]=N,g(p(N),D,L))})});var v=0;A(e,function(M){var D,P,k,R;if($(M))D=M,R={};else{R=M,D=R.name;var L=R.ordinalMeta;R.ordinalMeta=null,R=F({},R),R.ordinalMeta=L,P=R.dimsDef,k=R.otherDims,R.name=R.coordDim=R.coordDimIndex=R.dimsDef=R.otherDims=null}var N=c.get(D);if(N!==!1){if(N=ie(N),!N.length)for(var j=0;j<(P&&P.length||1);j++){for(;v<o&&p(v).coordDim!=null;)v++;v<o&&N.push(v++)}A(N,function(Z,U){var Y=p(Z);if(l&&R.type!=null&&(Y.type=R.type),g(lt(Y,R),D,U),Y.name==null&&P){var et=P[U];!q(et)&&(et={name:et}),Y.name=Y.displayName=et.name,Y.defaultTooltip=et.defaultTooltip}k&<(Y.otherDims,k)})}});function g(M,D,P){W0.get(D)!=null?M.otherDims[D]=P:(M.coordDim=D,M.coordDimIndex=P,n.set(D,!0))}var m=t.generateCoord,_=t.generateCoordCount,b=_!=null;_=m?_||1:0;var x=m||"value";function C(M){M.name==null&&(M.name=M.coordDim)}if(s)A(a,function(M){C(M)}),a.sort(function(M,D){return M.storeDimIndex-D.storeDimIndex});else for(var S=0;S<o;S++){var T=p(S),I=T.coordDim;I==null&&(T.coordDim=VD(x,n,b),T.coordDimIndex=0,(!m||_<=0)&&(T.isExtraCoord=!0),_--),C(T),T.type==null&&(Y0(r,S)===ve.Must||T.isExtraCoord&&(T.otherDims.itemName!=null||T.otherDims.seriesName!=null))&&(T.type="ordinal")}return BD(a),new K_({source:r,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function BD(r){for(var t=nt(),e=0;e<r.length;e++){var i=r[e],n=i.name,a=t.get(n)||0;a>0&&(i.name=n+(a-1)),a++,t.set(n,a)}}function zD(r,t,e,i){var n=Math.max(r.dimensionsDetectedCount||1,t.length,e.length,i||0);return A(t,function(a){var o;q(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function VD(r,t,e){if(e||t.hasKey(r)){for(var i=0;t.hasKey(r+i);)i++;r+=i}return t.set(r,!0),r}var HD=(function(){function r(t){this.coordSysDims=[],this.axisMap=nt(),this.categoryAxisMap=nt(),this.coordSysName=t}return r})();function WD(r){var t=r.get("coordinateSystem"),e=new HD(t),i=GD[t];if(i)return i(r,e,e.axisMap,e.categoryAxisMap),e}var GD={cartesian2d:function(r,t,e,i){var n=r.getReferringComponents("xAxis",ee).models[0],a=r.getReferringComponents("yAxis",ee).models[0];t.coordSysDims=["x","y"],e.set("x",n),e.set("y",a),gn(n)&&(i.set("x",n),t.firstCategoryDimIndex=0),gn(a)&&(i.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(r,t,e,i){var n=r.getReferringComponents("singleAxis",ee).models[0];t.coordSysDims=["single"],e.set("single",n),gn(n)&&(i.set("single",n),t.firstCategoryDimIndex=0)},polar:function(r,t,e,i){var n=r.getReferringComponents("polar",ee).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],e.set("radius",a),e.set("angle",o),gn(a)&&(i.set("radius",a),t.firstCategoryDimIndex=0),gn(o)&&(i.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(r,t,e,i){t.coordSysDims=["lng","lat"]},parallel:function(r,t,e,i){var n=r.ecModel,a=n.getComponent("parallel",r.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();A(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),h=o[l];e.set(h,u),gn(u)&&(i.set(h,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})}};function gn(r){return r.get("type")==="category"}function ib(r,t,e){e=e||{};var i=e.byIndex,n=e.stackedCoordDimension,a,o,s;UD(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(r&&r.get("stack")),u,h,c,f;if(A(a,function(_,b){$(_)&&(a[b]=_={name:_}),l&&!_.isExtraCoord&&(!i&&!u&&_.ordinalMeta&&(u=_),!h&&_.type!=="ordinal"&&_.type!=="time"&&(!n||n===_.coordDim)&&(h=_))}),h&&!i&&!u&&(i=!0),h){c="__\0ecstackresult_"+r.id,f="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var d=h.coordDim,p=h.type,v=0;A(a,function(_){_.coordDim===d&&v++});var g={name:c,coordDim:d,coordDimIndex:v,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:f,coordDim:f,coordDimIndex:v+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(f,p),m.storeDimIndex=s.ensureCalculationDimension(c,p)),o.appendCalculationDimension(g),o.appendCalculationDimension(m)):(a.push(g),a.push(m))}return{stackedDimension:h&&h.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:f,stackResultDimension:c}}function UD(r){return!J_(r.schema)}function Vn(r,t){return!!t&&t===r.getCalculationInfo("stackedDimension")}function nb(r,t){return Vn(r,t)?r.getCalculationInfo("stackResultDimension"):t}function $D(r,t){var e=r.get("coordinateSystem"),i=Pl.get(e),n;return t&&t.coordSysDims&&(n=H(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=PD(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function YD(r,t,e){var i,n;return e&&A(r,function(a,o){var s=a.coordDim,l=e.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(r[i].otherDims.itemName=0),i}function ab(r,t,e){e=e||{};var i=t.getSourceManager(),n,a=!1;n=i.getSource(),a=n.sourceFormat===Oe;var o=WD(t),s=$D(t,o),l=e.useEncodeDefaulter,u=tt(l)?l:l?Ct(WA,s,t):null,h={coordDimensions:s,generateCoord:e.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},c=rb(n,h),f=YD(c.dimensions,e.createInvertedIndices,o),d=a?null:i.getSharedDataStore(c),p=ib(t,{schema:c,store:d}),v=new Wf(c,t);v.setCalculationInfo(p);var g=f!=null&&XD(n)?function(m,_,b,x){return x===f?b:this.defaultDimValueGetter(m,_,b,x)}:null;return v.hasItemOption=!1,v.initData(a?n:d,null,g),v}function XD(r){if(r.sourceFormat===Oe){var t=ZD(r.data||[]);return!G(Un(t))}}function ZD(r){for(var t=0;t<r.length&&r[t]==null;)t++;return r[t]}var fr=(function(){function r(t){this._setting=t||{},this._extent=[1/0,-1/0]}return r.prototype.getSetting=function(t){return this._setting[t]},r.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1])},r.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},r.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(t){this._isBlank=t},r})();fl(fr);var qD=0,uc=(function(){function r(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++qD}return r.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&H(i,KD);return new r({categories:n,needCollect:!n,deduplication:e.dedplication!==!1})},r.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},r.prototype.parseAndCollect=function(t){var e,i=this._needCollect;if(!$(t)&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=this._getOrCreateMap();return e=n.get(t),e==null&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e},r.prototype._getOrCreateMap=function(){return this._map||(this._map=nt(this.categories))},r})();function KD(r){return q(r)&&r.value!=null?r.value:r+""}function hc(r){return r.type==="interval"||r.type==="log"}function JD(r,t,e,i){var n={},a=r[1]-r[0],o=n.interval=Kc(a/t,!0);e!=null&&o<e&&(o=n.interval=e),i!=null&&o>i&&(o=n.interval=i);var s=n.intervalPrecision=ob(o),l=n.niceTickExtent=[Pt(Math.ceil(r[0]/o)*o,s),Pt(Math.floor(r[1]/o)*o,s)];return QD(l,r),n}function Xu(r){var t=Math.pow(10,cl(r)),e=r/t;return e?e===2?e=3:e===3?e=5:e*=2:e=1,Pt(e*t)}function ob(r){return ar(r)+2}function ng(r,t,e){r[t]=Math.max(Math.min(r[t],e[1]),e[0])}function QD(r,t){!isFinite(r[0])&&(r[0]=t[0]),!isFinite(r[1])&&(r[1]=t[1]),ng(r,0,t),ng(r,1,t),r[0]>r[1]&&(r[0]=r[1])}function El(r,t){return r>=t[0]&&r<=t[1]}function jl(r,t){return t[1]===t[0]?.5:(r-t[0])/(t[1]-t[0])}function Nl(r,t){return r*(t[1]-t[0])+t[0]}var Fl=(function(r){B(t,r);function t(e){var i=r.call(this,e)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new uc({})),G(n)&&(n=new uc({categories:H(n,function(a){return q(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return t.prototype.parse=function(e){return e==null?NaN:$(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return e=this.parse(e),El(e,this._extent)&&this._ordinalMeta.categories[e]!=null},t.prototype.normalize=function(e){return e=this._getTickNumber(this.parse(e)),jl(e,this._extent)},t.prototype.scale=function(e){return e=Math.round(Nl(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],i=this._extent,n=i[0];n<=i[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o<l;++o){var u=i[o];n[o]=u,a[u]=o}for(var h=0;o<s;++o){for(;a[h]!=null;)h++;n.push(h),a[h]=o}},t.prototype._getTickNumber=function(e){var i=this._ticksByOrdinalNumber;return i&&e>=0&&e<i.length?i[e]:e},t.prototype.getRawOrdinalNumber=function(e){var i=this._ordinalNumbersByTick;return i&&e>=0&&e<i.length?i[e]:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var i=this.getRawOrdinalNumber(e.value),n=this._ordinalMeta.categories[i];return n==null?"":n+""}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.unionExtentFromData=function(e,i){this.unionExtent(e.getApproximateExtent(i))},t.prototype.isInExtentRange=function(e){return e=this._getTickNumber(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t})(fr);fr.registerClass(Fl);var Ci=Pt,Ki=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return El(e,this._extent)},t.prototype.normalize=function(e){return jl(e,this._extent)},t.prototype.scale=function(e){return Nl(e,this._extent)},t.prototype.setExtent=function(e,i){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(i)||(n[1]=parseFloat(i))},t.prototype.unionExtent=function(e){var i=this._extent;e[0]<i[0]&&(i[0]=e[0]),e[1]>i[1]&&(i[1]=e[1]),this.setExtent(i[0],i[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=ob(e)},t.prototype.getTicks=function(e){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]<a[0]&&(e?s.push({value:Ci(a[0]-i,o)}):s.push({value:n[0]}));for(var u=a[0];u<=a[1]&&(s.push({value:u}),u=Ci(u+i,o),u!==s[s.length-1].value);)if(s.length>l)return[];var h=s.length?s[s.length-1].value:a[1];return n[1]>h&&(e?s.push({value:Ci(h+i,o)}):s.push({value:n[1]})),s},t.prototype.getMinorTicks=function(e){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;o<i.length;o++){for(var s=i[o],l=i[o-1],u=0,h=[],c=s.value-l.value,f=c/e;u<e-1;){var d=Ci(l.value+(u+1)*f);d>a[0]&&d<a[1]&&h.push(d),u++}n.push(h)}return n},t.prototype.getLabel=function(e,i){if(e==null)return"";var n=i&&i.precision;n==null?n=ar(e.value)||0:n==="auto"&&(n=this._intervalPrecision);var a=Ci(e.value,n,!0);return bf(a)},t.prototype.calcNiceTicks=function(e,i,n){e=e||5;var a=this._extent,o=a[1]-a[0];if(isFinite(o)){o<0&&(o=-o,a.reverse());var s=JD(a,e,i,n);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},t.prototype.calcNiceExtent=function(e){var i=this._extent;if(i[0]===i[1])if(i[0]!==0){var n=Math.abs(i[0]);e.fixMax||(i[1]+=n/2),i[0]-=n/2}else i[1]=1;var a=i[1]-i[0];isFinite(a)||(i[0]=0,i[1]=1),this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval);var o=this._interval;e.fixMin||(i[0]=Ci(Math.floor(i[0]/o)*o)),e.fixMax||(i[1]=Ci(Math.ceil(i[1]/o)*o))},t.prototype.setNiceExtent=function(e,i){this._niceExtent=[e,i]},t.type="interval",t})(fr);fr.registerClass(Ki);var sb=typeof Float32Array<"u",t2=sb?Float32Array:Array;function An(r){return G(r)?sb?new Float32Array(r):r:new t2(r)}var e2="__ec_stack_";function r2(r){return r.get("stack")||e2+r.seriesIndex}function lb(r){return r.dim+r.index}function i2(r,t){var e=[];return t.eachSeriesByType(r,function(i){l2(i)&&e.push(i)}),e}function n2(r){var t={};A(r,function(l){var u=l.coordinateSystem,h=u.getBaseAxis();if(!(h.type!=="time"&&h.type!=="value"))for(var c=l.getData(),f=h.dim+"_"+h.index,d=c.getDimensionIndex(c.mapDimension(h.dim)),p=c.getStore(),v=0,g=p.count();v<g;++v){var m=p.get(d,v);t[f]?t[f].push(m):t[f]=[m]}});var e={};for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];if(n){n.sort(function(l,u){return l-u});for(var a=null,o=1;o<n.length;++o){var s=n[o]-n[o-1];s>0&&(a=a===null?s:Math.min(a,s))}e[i]=a}}return e}function a2(r){var t=n2(r),e=[];return A(r,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],h=Math.abs(o[1]-o[0]),c=a.scale.getExtent(),f=Math.abs(c[1]-c[0]);s=u?h/f*u:h}else{var d=i.getData();s=Math.abs(o[1]-o[0])/d.count()}var p=te(i.get("barWidth"),s),v=te(i.get("barMaxWidth"),s),g=te(i.get("barMinWidth")||(u2(i)?.5:1),s),m=i.get("barGap"),_=i.get("barCategoryGap");e.push({bandWidth:s,barWidth:p,barMaxWidth:v,barMinWidth:g,barGap:m,barCategoryGap:_,axisKey:lb(a),stackId:r2(i)})}),o2(e)}function o2(r){var t={};A(r,function(i,n){var a=i.axisKey,o=i.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;t[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var h=i.barWidth;h&&!l[u].width&&(l[u].width=h,h=Math.min(s.remainedWidth,h),s.remainedWidth-=h);var c=i.barMaxWidth;c&&(l[u].maxWidth=c);var f=i.barMinWidth;f&&(l[u].minWidth=f);var d=i.barGap;d!=null&&(s.gap=d);var p=i.barCategoryGap;p!=null&&(s.categoryGap=p)});var e={};return A(t,function(i,n){e[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=vt(a).length;s=Math.max(35-l*4,15)+"%"}var u=te(s,o),h=te(i.gap,1),c=i.remainedWidth,f=i.autoWidthCount,d=(c-u)/(f+(f-1)*h);d=Math.max(d,0),A(a,function(m){var _=m.maxWidth,b=m.minWidth;if(m.width){var x=m.width;_&&(x=Math.min(x,_)),b&&(x=Math.max(x,b)),m.width=x,c-=x+h*x,f--}else{var x=d;_&&_<x&&(x=Math.min(_,c)),b&&b>x&&(x=b),x!==d&&(m.width=x,c-=x+h*x,f--)}}),d=(c-u)/(f+(f-1)*h),d=Math.max(d,0);var p=0,v;A(a,function(m,_){m.width||(m.width=d),v=m,p+=m.width*(1+h)}),v&&(p-=v.width*h);var g=-p/2;A(a,function(m,_){e[n][_]=e[n][_]||{bandWidth:o,offset:g,width:m.width},g+=m.width*(1+h)})}),e}function s2(r,t,e){if(r&&t){var i=r[lb(t)];return i}}function l2(r){return r.coordinateSystem&&r.coordinateSystem.type==="cartesian2d"}function u2(r){return r.pipelineContext&&r.pipelineContext.large}var h2=function(r,t,e,i){for(;e<i;){var n=e+i>>>1;r[n][1]<t?e=n+1:i=n}return e},Gf=(function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="time",i}return t.prototype.getLabel=function(e){var i=this.getSetting("useUTC");return To(e.value,$p[DA(Ln(this._minLevelUnit))]||$p.second,i,this.getSetting("locale"))},t.prototype.getFormattedLabel=function(e,i,n){var a=this.getSetting("useUTC"),o=this.getSetting("locale");return PA(e,i,n,o,a)},t.prototype.getTicks=function(){var e=this._interval,i=this._extent,n=[];if(!e)return n;n.push({value:i[0],level:0});var a=this.getSetting("useUTC"),o=m2(this._minLevelUnit,this._approxInterval,a,i);return n=n.concat(o),n.push({value:i[1],level:0}),n},t.prototype.calcNiceExtent=function(e){var i=this._extent;if(i[0]===i[1]&&(i[0]-=ke,i[1]+=ke),i[1]===-1/0&&i[0]===1/0){var n=new Date;i[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),i[0]=i[1]-ke}this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.calcNiceTicks=function(e,i,n){e=e||10;var a=this._extent,o=a[1]-a[0];this._approxInterval=o/e,i!=null&&this._approxInterval<i&&(this._approxInterval=i),n!=null&&this._approxInterval>n&&(this._approxInterval=n);var s=is.length,l=Math.min(h2(is,this._approxInterval,0,s),s-1);this._interval=is[l][1],this._minLevelUnit=is[Math.max(l-1,0)][0]},t.prototype.parse=function(e){return At(e)?e:+Re(e)},t.prototype.contain=function(e){return El(this.parse(e),this._extent)},t.prototype.normalize=function(e){return jl(this.parse(e),this._extent)},t.prototype.scale=function(e){return Nl(e,this._extent)},t.type="time",t})(Ki),is=[["second",mf],["minute",yf],["hour",Ea],["quarter-day",Ea*6],["half-day",Ea*12],["day",ke*1.2],["half-week",ke*3.5],["week",ke*7],["month",ke*31],["quarter",ke*95],["half-year",Up/2],["year",Up]];function c2(r,t,e,i){var n=Re(t),a=Re(e),o=function(p){return Yp(n,p,i)===Yp(a,p,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},h=function(){return u()&&o("hour")},c=function(){return h()&&o("minute")},f=function(){return c()&&o("second")},d=function(){return f()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return h();case"minute":return c();case"second":return f();case"millisecond":return d()}}function f2(r,t){return r/=ke,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function d2(r){var t=30*ke;return r/=t,r>6?6:r>3?3:r>2?2:1}function p2(r){return r/=Ea,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function ag(r,t){return r/=t?yf:mf,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function v2(r){return Kc(r,!0)}function g2(r,t,e){var i=new Date(r);switch(Ln(t)){case"year":case"month":i[E0(e)](0);case"day":i[j0(e)](1);case"hour":i[N0(e)](0);case"minute":i[F0(e)](0);case"second":i[B0(e)](0),i[z0(e)](0)}return i.getTime()}function m2(r,t,e,i){var n=1e4,a=L0,o=0;function s(D,P,k,R,L,N,j){for(var Z=new Date(P),U=P,Y=Z[R]();U<k&&U<=i[1];)j.push({value:U}),Y+=D,Z[L](Y),U=Z.getTime();j.push({value:U,notAdd:!0})}function l(D,P,k){var R=[],L=!P.length;if(!c2(Ln(D),i[0],i[1],e)){L&&(P=[{value:g2(new Date(i[0]),D,e)},{value:i[1]}]);for(var N=0;N<P.length-1;N++){var j=P[N].value,Z=P[N+1].value;if(j!==Z){var U=void 0,Y=void 0,et=void 0,ut=!1;switch(D){case"year":U=Math.max(1,Math.round(t/ke/365)),Y=_f(e),et=kA(e);break;case"half-year":case"quarter":case"month":U=d2(t),Y=On(e),et=E0(e);break;case"week":case"half-week":case"day":U=f2(t),Y=Al(e),et=j0(e),ut=!0;break;case"half-day":case"quarter-day":case"hour":U=p2(t),Y=Ja(e),et=N0(e);break;case"minute":U=ag(t,!0),Y=Il(e),et=F0(e);break;case"second":U=ag(t,!1),Y=Ml(e),et=B0(e);break;case"millisecond":U=v2(t),Y=Dl(e),et=z0(e);break}s(U,j,Z,Y,et,ut,R),D==="year"&&k.length>1&&N===0&&k.unshift({value:k[0].value-U})}}for(var N=0;N<R.length;N++)k.push(R[N]);return R}}for(var u=[],h=[],c=0,f=0,d=0;d<a.length&&o++<n;++d){var p=Ln(a[d]);if(MA(a[d])){l(a[d],u[u.length-1]||[],h);var v=a[d+1]?Ln(a[d+1]):null;if(p!==v){if(h.length){f=c,h.sort(function(D,P){return D.value-P.value});for(var g=[],m=0;m<h.length;++m){var _=h[m].value;(m===0||h[m-1].value!==_)&&(g.push(h[m]),_>=i[0]&&_<=i[1]&&c++)}var b=(i[1]-i[0])/t;if(c>b*1.5&&f>b/1.5||(u.push(g),c>b||r===a[d]))break}h=[]}}}for(var x=Dt(H(u,function(D){return Dt(D,function(P){return P.value>=i[0]&&P.value<=i[1]&&!P.notAdd})}),function(D){return D.length>0}),C=[],S=x.length-1,d=0;d<x.length;++d)for(var T=x[d],I=0;I<T.length;++I)C.push({value:T[I].value,level:S-d});C.sort(function(D,P){return D.value-P.value});for(var M=[],d=0;d<C.length;++d)(d===0||C[d].value!==C[d-1].value)&&M.push(C[d]);return M}fr.registerClass(Gf);var og=fr.prototype,Fa=Ki.prototype,y2=Pt,_2=Math.floor,b2=Math.ceil,ns=Math.pow,Ne=Math.log,Uf=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new Ki,e._interval=0,e}return t.prototype.getTicks=function(e){var i=this._originalScale,n=this._extent,a=i.getExtent(),o=Fa.getTicks.call(this,e);return H(o,function(s){var l=s.value,u=Pt(ns(this.base,l));return u=l===n[0]&&this._fixMin?as(u,a[0]):u,u=l===n[1]&&this._fixMax?as(u,a[1]):u,{value:u}},this)},t.prototype.setExtent=function(e,i){var n=Ne(this.base);e=Ne(Math.max(0,e))/n,i=Ne(Math.max(0,i))/n,Fa.setExtent.call(this,e,i)},t.prototype.getExtent=function(){var e=this.base,i=og.getExtent.call(this);i[0]=ns(e,i[0]),i[1]=ns(e,i[1]);var n=this._originalScale,a=n.getExtent();return this._fixMin&&(i[0]=as(i[0],a[0])),this._fixMax&&(i[1]=as(i[1],a[1])),i},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var i=this.base;e[0]=Ne(e[0])/Ne(i),e[1]=Ne(e[1])/Ne(i),og.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,i){this.unionExtent(e.getApproximateExtent(i))},t.prototype.calcNiceTicks=function(e){e=e||10;var i=this._extent,n=i[1]-i[0];if(!(n===1/0||n<=0)){var a=Oy(n),o=e/n*a;for(o<=.5&&(a*=10);!isNaN(a)&&Math.abs(a)<1&&Math.abs(a)>0;)a*=10;var s=[Pt(b2(i[0]/a)*a),Pt(_2(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},t.prototype.calcNiceExtent=function(e){Fa.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return e=Ne(e)/Ne(this.base),El(e,this._extent)},t.prototype.normalize=function(e){return e=Ne(e)/Ne(this.base),jl(e,this._extent)},t.prototype.scale=function(e){return e=Nl(e,this._extent),ns(this.base,e)},t.type="log",t})(fr),ub=Uf.prototype;ub.getMinorTicks=Fa.getMinorTicks;ub.getLabel=Fa.getLabel;function as(r,t){return y2(r,ar(t))}fr.registerClass(Uf);var x2=(function(){function r(t,e,i){this._prepareParams(t,e,i)}return r.prototype._prepareParams=function(t,e,i){i[1]<i[0]&&(i=[NaN,NaN]),this._dataMin=i[0],this._dataMax=i[1];var n=this._isOrdinal=t.type==="ordinal";this._needCrossZero=t.type==="interval"&&e.getNeedCrossZero&&e.getNeedCrossZero();var a=e.get("min",!0);a==null&&(a=e.get("startValue",!0));var o=this._modelMinRaw=a;tt(o)?this._modelMinNum=os(t,o({min:i[0],max:i[1]})):o!=="dataMin"&&(this._modelMinNum=os(t,o));var s=this._modelMaxRaw=e.get("max",!0);if(tt(s)?this._modelMaxNum=os(t,s({min:i[0],max:i[1]})):s!=="dataMax"&&(this._modelMaxNum=os(t,s)),n)this._axisDataLen=e.getCategories().length;else{var l=e.get("boundaryGap"),u=G(l)?l:[l||0,l||0];typeof u[0]=="boolean"||typeof u[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[qr(u[0],1),qr(u[1],1)]}},r.prototype.calculate=function(){var t=this._isOrdinal,e=this._dataMin,i=this._dataMax,n=this._axisDataLen,a=this._boundaryGapInner,o=t?null:i-e||Math.abs(e),s=this._modelMinRaw==="dataMin"?e:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?i:this._modelMaxNum,u=s!=null,h=l!=null;s==null&&(s=t?n?0:NaN:e-a[0]*o),l==null&&(l=t?n?n-1:NaN:i+a[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var c=Va(s)||Va(l)||t&&!n;this._needCrossZero&&(s>0&&l>0&&!u&&(s=0),s<0&&l<0&&!h&&(l=0));var f=this._determinedMin,d=this._determinedMax;return f!=null&&(s=f,u=!0),d!=null&&(l=d,h=!0),{min:s,max:l,minFixed:u,maxFixed:h,isBlank:c}},r.prototype.modifyDataMinMax=function(t,e){this[S2[t]]=e},r.prototype.setDeterminedMinMax=function(t,e){var i=w2[t];this[i]=e},r.prototype.freeze=function(){this.frozen=!0},r})(),w2={min:"_determinedMin",max:"_determinedMax"},S2={min:"_dataMin",max:"_dataMax"};function hb(r,t,e){var i=r.rawExtentInfo;return i||(i=new x2(r,t,e),r.rawExtentInfo=i,i)}function os(r,t){return t==null?null:Va(t)?NaN:r.parse(t)}function cb(r,t){var e=r.type,i=hb(r,t,r.getExtent()).calculate();r.setBlank(i.isBlank);var n=i.min,a=i.max,o=t.ecModel;if(o&&e==="time"){var s=i2("bar",o),l=!1;if(A(s,function(c){l=l||c.getBaseAxis()===t.axis}),l){var u=a2(s),h=C2(n,a,t,u);n=h.min,a=h.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function C2(r,t,e,i){var n=e.axis.getExtent(),a=Math.abs(n[1]-n[0]),o=s2(i,e.axis);if(o===void 0)return{min:r,max:t};var s=1/0;A(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;A(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=t-r,c=1-(s+l)/a,f=h/c-h;return t+=f*(l/u),r-=f*(s/u),{min:r,max:t}}function cc(r,t){var e=t,i=cb(r,e),n=i.extent,a=e.get("splitNumber");r instanceof Uf&&(r.base=e.get("logBase"));var o=r.type,s=e.get("interval"),l=o==="interval"||o==="time";r.setExtent(n[0],n[1]),r.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?e.get("minInterval"):null,maxInterval:l?e.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function fb(r,t){if(t=t||r.get("type"),t)switch(t){case"category":return new Fl({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new Gf({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(fr.getClass(t)||Ki)}}function T2(r){var t=r.scale.getExtent(),e=t[0],i=t[1];return!(e>0&&i>0||e<0&&i<0)}function Xn(r){var t=r.getLabelModel().get("formatter"),e=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?(function(i){return function(n,a){return r.scale.getFormattedLabel(n,a,i)}})(t):$(t)?(function(i){return function(n){var a=r.scale.getLabel(n),o=i.replace("{value}",a??"");return o}})(t):tt(t)?(function(i){return function(n,a){return e!=null&&(a=n.value-e),i($f(r,n),a,n.level!=null?{level:n.level}:null)}})(t):function(i){return r.scale.getLabel(i)}}function $f(r,t){return r.type==="category"?r.scale.getLabel(t):t.value}function A2(r){var t=r.model,e=r.scale;if(!(!t.get(["axisLabel","show"])||e.isBlank())){var i,n,a=e.getExtent();e instanceof Fl?n=e.count():(i=e.getTicks(),n=i.length);var o=r.getLabelModel(),s=Xn(r),l,u=1;n>40&&(u=Math.ceil(n/40));for(var h=0;h<n;h+=u){var c=i?i[h]:{value:a[0]+h},f=s(c,h),d=o.getTextRect(f),p=I2(d,o.get("rotate")||0);l?l.union(p):l=p}return l}}function I2(r,t){var e=t*Math.PI/180,i=r.width,n=r.height,a=i*Math.abs(Math.cos(e))+Math.abs(n*Math.sin(e)),o=i*Math.abs(Math.sin(e))+Math.abs(n*Math.cos(e)),s=new mt(r.x,r.y,a,o);return s}function Yf(r){var t=r.get("interval");return t??"auto"}function db(r){return r.type==="category"&&Yf(r.getLabelModel())===0}function pb(r,t){var e={};return A(r.mapDimensionsAll(t),function(i){e[nb(r,i)]=!0}),vt(e)}function M2(r,t,e){t&&A(pb(t,e),function(i){var n=t.getApproximateExtent(i);n[0]<r[0]&&(r[0]=n[0]),n[1]>r[1]&&(r[1]=n[1])})}var vb=(function(){function r(){}return r.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},r.prototype.getCoordSysModel=function(){},r})();function D2(r){return ab(null,r)}var P2={isDimensionStacked:Vn,enableDataStack:ib,getStackedDimension:nb};function k2(r,t){var e=t;t instanceof Tt||(e=new Tt(t));var i=fb(e);return i.setExtent(r[0],r[1]),cc(i,e),i}function R2(r){be(r,vb)}function L2(r,t){return t=t||{},$e(r,null,null,t.state!=="normal")}const O2=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:FD,createList:D2,createScale:k2,createSymbol:Gi,createTextStyle:L2,dataStack:P2,enableHoverEmphasis:Ra,getECData:_t,getLayoutRect:qi,mixinAxisModelCommonMethods:R2},Symbol.toStringTag,{value:"Module"}));var sg=[],E2={registerPreprocessor:Ff,registerProcessor:Bf,registerPostInit:U_,registerPostUpdate:$_,registerUpdateLifecycle:Ol,registerAction:qe,registerCoordinateSystem:Y_,registerLayout:X_,registerVisual:Qr,registerTransform:q_,registerLoading:Vf,registerMap:Z_,registerImpl:tD,PRIORITY:j_,ComponentModel:dt,ComponentView:Kt,SeriesModel:Xe,ChartView:ye,registerComponentModel:function(r){dt.registerClass(r)},registerComponentView:function(r){Kt.registerClass(r)},registerSeriesModel:function(r){Xe.registerClass(r)},registerChartView:function(r){ye.registerClass(r)},registerSubTypeDefaulter:function(r,t){dt.registerSubTypeDefaulter(r,t)},registerPainter:function(r,t){Dy(r,t)}};function Ui(r){if(G(r)){A(r,function(t){Ui(t)});return}pt(sg,r)>=0||(sg.push(r),tt(r)&&(r={install:r}),r.install(E2))}var j2=1e-8;function lg(r,t){return Math.abs(r-t)<j2}function ug(r,t,e){var i=0,n=r[0];if(!n)return!1;for(var a=1;a<r.length;a++){var o=r[a];i+=mr(n[0],n[1],o[0],o[1],t,e),n=o}var s=r[0];return(!lg(n[0],s[0])||!lg(n[1],s[1]))&&(i+=mr(n[0],n[1],s[0],s[1],t,e)),i!==0}var N2=[];function Zu(r,t){for(var e=0;e<r.length;e++)re(r[e],r[e],t)}function hg(r,t,e,i){for(var n=0;n<r.length;n++){var a=r[n];i&&(a=i.project(a)),a&&isFinite(a[0])&&isFinite(a[1])&&(jr(t,t,a),Nr(e,e,a))}}function F2(r){for(var t=0,e=0,i=0,n=r.length,a=r[n-1][0],o=r[n-1][1],s=0;s<n;s++){var l=r[s][0],u=r[s][1],h=a*u-l*o;t+=h,e+=(a+l)*h,i+=(o+u)*h,a=l,o=u}return t?[e/t/3,i/t/3,t]:[r[0][0]||0,r[0][1]||0]}var gb=(function(){function r(t){this.name=t}return r.prototype.setCenter=function(t){this._center=t},r.prototype.getCenter=function(){var t=this._center;return t||(t=this._center=this.calcCenter()),t},r})(),cg=(function(){function r(t,e){this.type="polygon",this.exterior=t,this.interiors=e}return r})(),fg=(function(){function r(t){this.type="linestring",this.points=t}return r})(),B2=(function(r){B(t,r);function t(e,i,n){var a=r.call(this,e)||this;return a.type="geoJSON",a.geometries=i,a._center=n&&[n[0],n[1]],a}return t.prototype.calcCenter=function(){for(var e=this.geometries,i,n=0,a=0;a<e.length;a++){var o=e[a],s=o.exterior,l=s&&s.length;l>n&&(i=o,n=l)}if(i)return F2(i.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},t.prototype.getBoundingRect=function(e){var i=this._rect;if(i&&!e)return i;var n=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return A(o,function(s){s.type==="polygon"?hg(s.exterior,n,a,e):A(s.points,function(l){hg(l,n,a,e)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(a[0])&&isFinite(a[1])||(n[0]=n[1]=a[0]=a[1]=0),i=new mt(n[0],n[1],a[0]-n[0],a[1]-n[1]),e||(this._rect=i),i},t.prototype.contain=function(e){var i=this.getBoundingRect(),n=this.geometries;if(!i.contain(e[0],e[1]))return!1;t:for(var a=0,o=n.length;a<o;a++){var s=n[a];if(s.type==="polygon"){var l=s.exterior,u=s.interiors;if(ug(l,e[0],e[1])){for(var h=0;h<(u?u.length:0);h++)if(ug(u[h],e[0],e[1]))continue t;return!0}}}return!1},t.prototype.transformTo=function(e,i,n,a){var o=this.getBoundingRect(),s=o.width/o.height;n?a||(a=n/s):n=s*a;for(var l=new mt(e,i,n,a),u=o.calculateTransform(l),h=this.geometries,c=0;c<h.length;c++){var f=h[c];f.type==="polygon"?(Zu(f.exterior,u),A(f.interiors,function(d){Zu(d,u)})):A(f.points,function(d){Zu(d,u)})}o=this._rect,o.copy(l),this._center=[o.x+o.width/2,o.y+o.height/2]},t.prototype.cloneShallow=function(e){e==null&&(e=this.name);var i=new t(e,this.geometries,this._center);return i._rect=this._rect,i.transformTo=null,i},t})(gb);(function(r){B(t,r);function t(e,i){var n=r.call(this,e)||this;return n.type="geoSVG",n._elOnlyForCalculate=i,n}return t.prototype.calcCenter=function(){for(var e=this._elOnlyForCalculate,i=e.getBoundingRect(),n=[i.x+i.width/2,i.y+i.height/2],a=co(N2),o=e;o&&!o.isGeoSVGGraphicRoot;)Gr(a,o.getLocalTransform(),a),o=o.parent;return po(a,a),re(n,n,a),n},t})(gb);function z2(r){if(!r.UTF8Encoding)return r;var t=r,e=t.UTF8Scale;e==null&&(e=1024);var i=t.features;return A(i,function(n){var a=n.geometry,o=a.encodeOffsets,s=a.coordinates;if(o)switch(a.type){case"LineString":a.coordinates=mb(s,o,e);break;case"Polygon":qu(s,o,e);break;case"MultiLineString":qu(s,o,e);break;case"MultiPolygon":A(s,function(l,u){return qu(l,o[u],e)})}}),t.UTF8Encoding=!1,t}function qu(r,t,e){for(var i=0;i<r.length;i++)r[i]=mb(r[i],t[i],e)}function mb(r,t,e){for(var i=[],n=t[0],a=t[1],o=0;o<r.length;o+=2){var s=r.charCodeAt(o)-64,l=r.charCodeAt(o+1)-64;s=s>>1^-(s&1),l=l>>1^-(l&1),s+=n,l+=a,n=s,a=l,i.push([s/e,l/e])}return i}function dg(r,t){return r=z2(r),H(Dt(r.features,function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0}),function(e){var i=e.properties,n=e.geometry,a=[];switch(n.type){case"Polygon":var o=n.coordinates;a.push(new cg(o[0],o.slice(1)));break;case"MultiPolygon":A(n.coordinates,function(l){l[0]&&a.push(new cg(l[0],l.slice(1)))});break;case"LineString":a.push(new fg([n.coordinates]));break;case"MultiLineString":a.push(new fg(n.coordinates))}var s=new B2(i[t||"name"],a,i.cp);return s.properties=i,s})}const V2=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:US,asc:Xc,getPercentWithPrecision:HS,getPixelPrecision:Zc,getPrecision:ar,getPrecisionSafe:Ly,isNumeric:Ey,isRadianAroundZero:$a,linearMap:Er,nice:Kc,numericToNumber:Ya,parseDate:Re,quantile:YS,quantity:Oy,quantityExponent:cl,reformIntervals:XS,remRadian:qc,round:Pt},Symbol.toStringTag,{value:"Module"})),H2=Object.freeze(Object.defineProperty({__proto__:null,format:To,parse:Re},Symbol.toStringTag,{value:"Module"})),W2=Object.freeze(Object.defineProperty({__proto__:null,Arc:wo,BezierCurve:bl,BoundingRect:mt,Circle:yo,CompoundPath:of,Ellipse:yl,Group:Ft,Image:Ze,IncrementalDisplayable:m0,Line:Ye,LinearGradient:sf,Polygon:bo,Polyline:xo,RadialGradient:g0,Rect:Nt,Ring:_l,Sector:_o,Text:zt,clipPointsByRect:cf,clipRectByRect:T0,createIcon:So,extendPath:_0,extendShape:y0,getShapeClass:b0,getTransform:wl,initProps:$n,makeImage:uf,makePath:xl,mergePath:w0,registerShape:Le,resizePath:hf,updateProps:Jr},Symbol.toStringTag,{value:"Module"})),G2=Object.freeze(Object.defineProperty({__proto__:null,addCommas:bf,capitalFirst:OA,encodeHTML:qt,formatTime:LA,formatTpl:wf,getTextRect:RA,getTooltipMarker:V0,normalizeCssArray:Ao,toCamelCase:xf,truncateText:SC},Symbol.toStringTag,{value:"Module"})),U2=Object.freeze(Object.defineProperty({__proto__:null,bind:ct,clone:it,curry:Ct,defaults:lt,each:A,extend:F,filter:Dt,indexOf:pt,inherits:Nc,isArray:G,isFunction:tt,isObject:q,isString:$,map:H,merge:st,reduce:lr},Symbol.toStringTag,{value:"Module"}));var no=kt();function yb(r,t){var e=H(t,function(i){return r.scale.parse(i)});return r.type==="time"&&e.length>0&&(e.sort(),e.unshift(e[0]),e.push(e[e.length-1])),e}function $2(r){var t=r.getLabelModel().get("customValues");if(t){var e=Xn(r),i=r.scale.getExtent(),n=yb(r,t),a=Dt(n,function(o){return o>=i[0]&&o<=i[1]});return{labels:H(a,function(o){var s={value:o};return{formattedLabel:e(s),rawLabel:r.scale.getLabel(s),tickValue:o}})}}return r.type==="category"?X2(r):q2(r)}function Y2(r,t){var e=r.getTickModel().get("customValues");if(e){var i=r.scale.getExtent(),n=yb(r,e);return{ticks:Dt(n,function(a){return a>=i[0]&&a<=i[1]})}}return r.type==="category"?Z2(r,t):{ticks:H(r.scale.getTicks(),function(a){return a.value})}}function X2(r){var t=r.getLabelModel(),e=_b(r,t);return!t.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:e.labelCategoryInterval}:e}function _b(r,t){var e=bb(r,"labels"),i=Yf(t),n=xb(e,i);if(n)return n;var a,o;return tt(i)?a=Cb(r,i):(o=i==="auto"?K2(r):i,a=Sb(r,o)),wb(e,i,{labels:a,labelCategoryInterval:o})}function Z2(r,t){var e=bb(r,"ticks"),i=Yf(t),n=xb(e,i);if(n)return n;var a,o;if((!t.get("show")||r.scale.isBlank())&&(a=[]),tt(i))a=Cb(r,i,!0);else if(i==="auto"){var s=_b(r,r.getLabelModel());o=s.labelCategoryInterval,a=H(s.labels,function(l){return l.tickValue})}else o=i,a=Sb(r,o,!0);return wb(e,i,{ticks:a,tickCategoryInterval:o})}function q2(r){var t=r.scale.getTicks(),e=Xn(r);return{labels:H(t,function(i,n){return{level:i.level,formattedLabel:e(i,n),rawLabel:r.scale.getLabel(i),tickValue:i.value}})}}function bb(r,t){return no(r)[t]||(no(r)[t]=[])}function xb(r,t){for(var e=0;e<r.length;e++)if(r[e].key===t)return r[e].value}function wb(r,t,e){return r.push({key:t,value:e}),e}function K2(r){var t=no(r).autoInterval;return t??(no(r).autoInterval=r.calculateCategoryInterval())}function J2(r){var t=Q2(r),e=Xn(r),i=(t.axisRotate-t.labelRotate)/180*Math.PI,n=r.scale,a=n.getExtent(),o=n.count();if(a[1]-a[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),f=0,d=0;l<=a[1];l+=s){var p=0,v=0,g=ll(e({value:l}),t.font,"center","top");p=g.width*1.3,v=g.height*1.3,f=Math.max(f,p,7),d=Math.max(d,v,7)}var m=f/h,_=d/c;isNaN(m)&&(m=1/0),isNaN(_)&&(_=1/0);var b=Math.max(0,Math.floor(Math.min(m,_))),x=no(r.model),C=r.getExtent(),S=x.lastAutoInterval,T=x.lastTickCount;return S!=null&&T!=null&&Math.abs(S-b)<=1&&Math.abs(T-o)<=1&&S>b&&x.axisExtent0===C[0]&&x.axisExtent1===C[1]?b=S:(x.lastTickCount=o,x.lastAutoInterval=b,x.axisExtent0=C[0],x.axisExtent1=C[1]),b}function Q2(r){var t=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function Sb(r,t,e){var i=Xn(r),n=r.scale,a=n.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],h=n.count();u!==0&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=db(r),f=o.get("showMinLabel")||c,d=o.get("showMaxLabel")||c;f&&u!==a[0]&&v(a[0]);for(var p=u;p<=a[1];p+=l)v(p);d&&p-l!==a[1]&&v(a[1]);function v(g){var m={value:g};s.push(e?g:{formattedLabel:i(m),rawLabel:n.getLabel(m),tickValue:g})}return s}function Cb(r,t,e){var i=r.scale,n=Xn(r),a=[];return A(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;t(o.value,s)&&a.push(e?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var pg=[0,1],Xf=(function(){function r(t,e,i){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=i||[0,0]}return r.prototype.contain=function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},r.prototype.containData=function(t){return this.scale.contain(t)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(t){return Zc(t||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(t,e){var i=this._extent;i[0]=t,i[1]=e},r.prototype.dataToCoord=function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&n.type==="ordinal"&&(i=i.slice(),vg(i,n.count())),Er(t,pg,i,e)},r.prototype.coordToData=function(t,e){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),vg(i,n.count()));var a=Er(t,i,pg,e);return this.scale.scale(a)},r.prototype.pointToData=function(t,e){},r.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),i=Y2(this,e),n=i.ticks,a=H(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=e.get("alignWithLabel");return tP(this,a,o,t.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var i=this.scale.getMinorTicks(e),n=H(i,function(a){return H(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},r.prototype.getViewLabels=function(){return $2(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},r.prototype.calculateCategoryInterval=function(){return J2(this)},r})();function vg(r,t){var e=r[1]-r[0],i=t,n=e/i/2;r[0]+=n,r[1]-=n}function tP(r,t,e,i){var n=t.length;if(!r.onBand||e||!n)return;var a=r.getExtent(),o,s;if(n===1)t[0].coord=a[0],o=t[1]={coord:a[1],tickValue:t[0].tickValue};else{var l=t[n-1].tickValue-t[0].tickValue,u=(t[n-1].coord-t[0].coord)/l;A(t,function(d){d.coord-=u/2});var h=r.scale.getExtent();s=1+h[1]-t[n-1].tickValue,o={coord:t[n-1].coord+u*s,tickValue:h[1]+1},t.push(o)}var c=a[0]>a[1];f(t[0].coord,a[0])&&(i?t[0].coord=a[0]:t.shift()),i&&f(a[0],t[0].coord)&&t.unshift({coord:a[0]}),f(a[1],o.coord)&&(i?o.coord=a[1]:t.pop()),i&&f(o.coord,a[1])&&t.push({coord:a[1]});function f(d,p){return d=Pt(d),p=Pt(p),c?d>p:d<p}}function eP(r){var t=dt.extend(r);return dt.registerClass(t),t}function rP(r){var t=Kt.extend(r);return Kt.registerClass(t),t}function iP(r){var t=Xe.extend(r);return Xe.registerClass(t),t}function nP(r){var t=ye.extend(r);return ye.registerClass(t),t}function aP(r){for(var t=[],e=0;e<r.length;e++){var i=r[e];if(!i.defaultAttr.ignore){var n=i.label,a=n.getComputedTransform(),o=n.getBoundingRect(),s=!a||a[1]<1e-5&&a[2]<1e-5,l=n.style.margin||0,u=o.clone();u.applyTransform(a),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var h=s?new js(o,a):null;t.push({label:n,labelLine:i.labelLine,rect:u,localRect:o,obb:h,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:a})}}return t}function oP(r){var t=[];r.sort(function(v,g){return g.priority-v.priority});var e=new mt(0,0,0,0);function i(v){if(!v.ignore){var g=v.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}v.ignore=!0}for(var n=0;n<r.length;n++){var a=r[n],o=a.axisAligned,s=a.localRect,l=a.transform,u=a.label,h=a.labelLine;e.copy(a.rect),e.width-=.1,e.height-=.1,e.x+=.05,e.y+=.05;for(var c=a.obb,f=!1,d=0;d<t.length;d++){var p=t[d];if(e.intersect(p.rect)){if(o&&p.axisAligned){f=!0;break}if(p.obb||(p.obb=new js(p.localRect,p.transform)),c||(c=new js(s,l)),c.intersect(p.obb)){f=!0;break}}}f?(i(u),h&&i(h)):(u.attr("ignore",a.defaultAttr.ignore),h&&h.attr("ignore",a.defaultAttr.labelGuideIgnore),t.push(a))}}const sP=Object.freeze(Object.defineProperty({__proto__:null,Axis:Xf,ChartView:ye,ComponentModel:dt,ComponentView:Kt,List:Wf,Model:Tt,PRIORITY:j_,SeriesModel:Xe,color:aS,connect:bD,dataTool:ID,dependencies:rD,disConnect:xD,disconnect:G_,dispose:wD,env:J,extendChartView:nP,extendComponentModel:eP,extendComponentView:rP,extendSeriesModel:iP,format:G2,getCoordinateSystemDimensions:CD,getInstanceByDom:jf,getInstanceById:SD,getMap:AD,graphic:W2,helper:O2,init:_D,innerDrawElementOnCanvas:I_,matrix:L1,number:V2,parseGeoJSON:dg,parseGeoJson:dg,registerAction:qe,registerCoordinateSystem:Y_,registerLayout:X_,registerLoading:Vf,registerLocale:gf,registerMap:Z_,registerPostInit:U_,registerPostUpdate:$_,registerPreprocessor:Ff,registerProcessor:Bf,registerTheme:Nf,registerTransform:q_,registerUpdateLifecycle:Ol,registerVisual:Qr,setCanvasCreator:TD,setPlatformAPI:Um,throttle:Pf,time:H2,use:Ui,util:U2,vector:y1,version:eD,zrUtil:s1,zrender:zS},Symbol.toStringTag,{value:"Module"}));var lP=(function(r){B(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.getInitialData=function(e){return ab(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var i=new Ft,n=Gi("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);i.add(n),n.setStyle(e.lineStyle);var a=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=a==="none"?"circle":a,l=e.itemHeight*.8,u=Gi(s,(e.itemWidth-l)/2,(e.itemHeight-l)/2,l,l,e.itemStyle.fill);i.add(u),u.setStyle(e.itemStyle);var h=e.iconRotate==="inherit"?o:e.iconRotate||0;return u.rotation=h*Math.PI/180,u.setOrigin([e.itemWidth/2,e.itemHeight/2]),s.indexOf("empty")>-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t})(Xe);function Tb(r,t){var e=r.mapDimensionsAll("defaultedLabel"),i=e.length;if(i===1){var n=Bn(r,t,e[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o<e.length;o++)a.push(Bn(r,t,e[o]));return a.join(" ")}}function uP(r,t){var e=r.mapDimensionsAll("defaultedLabel");if(!G(t))return t+"";for(var i=[],n=0;n<e.length;n++){var a=r.getDimensionIndex(e[n]);a>=0&&i.push(t[a])}return i.join(" ")}var Zf=(function(r){B(t,r);function t(e,i,n,a){var o=r.call(this)||this;return o.updateData(e,i,n,a),o}return t.prototype._createSymbol=function(e,i,n,a,o){this.removeAll();var s=Gi(e,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=hP,this._symbolType=e,this.add(s)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Nn(this.childAt(0))},t.prototype.downplay=function(){Fn(this.childAt(0))},t.prototype.setZ=function(e,i){var n=this.childAt(0);n.zlevel=e,n.z=i},t.prototype.setDraggable=function(e,i){var n=this.childAt(0);n.draggable=e,n.cursor=!i&&e?"move":n.cursor},t.prototype.updateData=function(e,i,n,a){this.silent=!1;var o=e.getItemVisual(i,"symbol")||"circle",s=e.hostModel,l=t.getSymbolSize(e,i),u=o!==this._symbolType,h=a&&a.disableAnimation;if(u){var c=e.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,e,i,l,c)}else{var f=this.childAt(0);f.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};h?f.attr(d):Jr(f,d,s,i),rA(f)}if(this._updateCommon(e,i,l,n,a),u){var f=this.childAt(0);if(!h){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,$n(f,d,s,i)}}h&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,i,n,a,o){var s=this.childAt(0),l=e.hostModel,u,h,c,f,d,p,v,g,m;if(a&&(u=a.emphasisItemStyle,h=a.blurItemStyle,c=a.selectItemStyle,f=a.focus,d=a.blurScope,v=a.labelStatesModels,g=a.hoverScale,m=a.cursorStyle,p=a.emphasisDisabled),!a||e.hasItemOption){var _=a&&a.itemModel?a.itemModel:e.getItemModel(i),b=_.getModel("emphasis");u=b.getModel("itemStyle").getItemStyle(),c=_.getModel(["select","itemStyle"]).getItemStyle(),h=_.getModel(["blur","itemStyle"]).getItemStyle(),f=b.get("focus"),d=b.get("blurScope"),p=b.get("disabled"),v=df(_),g=b.getShallow("scale"),m=_.getShallow("cursor")}var x=e.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var C=kf(e.getItemVisual(i,"symbolOffset"),n);C&&(s.x=C[0],s.y=C[1]),m&&s.attr("cursor",m);var S=e.getItemVisual(i,"style"),T=S.fill;if(s instanceof Ze){var I=s.style;s.useStyle(F({image:I.image,x:I.x,y:I.y,width:I.width,height:I.height},S))}else s.__isEmptyBrush?s.useStyle(F({},S)):s.useStyle(S),s.style.decal=null,s.setColor(T,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var M=e.getItemVisual(i,"liftZ"),D=this._z2;M!=null?D==null&&(this._z2=s.z2,s.z2+=M):D!=null&&(s.z2=D,this._z2=null);var P=o&&o.useNameLabel;I0(s,v,{labelFetcher:l,labelDataIndex:i,defaultText:k,inheritColor:T,defaultOpacity:S.opacity});function k(N){return P?e.getName(N):Tb(e,N)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var R=s.ensureState("emphasis");R.style=u,s.ensureState("select").style=c,s.ensureState("blur").style=h;var L=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;R.scaleX=this._sizeX*L,R.scaleY=this._sizeY*L,this.setSymbolScale(1),Gh(this,f,d,p)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,i,n){var a=this.childAt(0),o=_t(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&Ns(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Ns(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:e,removeOpt:s})},t.getSymbolSize=function(e,i){return C_(e.getItemVisual(i,"symbolSize"))},t})(Ft);function hP(r,t){this.parent.drift(r,t)}function Ku(r,t,e,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(e))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&r.getItemVisual(e,"symbol")!=="none"}function gg(r){return r!=null&&!q(r)&&(r={isIgnore:r}),r||{}}function mg(r){var t=r.hostModel,e=t.getModel("emphasis");return{emphasisItemStyle:e.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:e.get("focus"),blurScope:e.get("blurScope"),emphasisDisabled:e.get("disabled"),hoverScale:e.get("scale"),labelStatesModels:df(t),cursorStyle:t.get("cursor")}}var cP=(function(){function r(t){this.group=new Ft,this._SymbolCtor=t||Zf}return r.prototype.updateData=function(t,e){this._progressiveEls=null,e=gg(e);var i=this.group,n=t.hostModel,a=this._data,o=this._SymbolCtor,s=e.disableAnimation,l=mg(t),u={disableAnimation:s},h=e.getSymbolPoint||function(c){return t.getItemLayout(c)};a||i.removeAll(),t.diff(a).add(function(c){var f=h(c);if(Ku(t,f,c,e)){var d=new o(t,c,l,u);d.setPosition(f),t.setItemGraphicEl(c,d),i.add(d)}}).update(function(c,f){var d=a.getItemGraphicEl(f),p=h(c);if(!Ku(t,p,c,e)){i.remove(d);return}var v=t.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==v)i.remove(d),d=new o(t,c,l,u),d.setPosition(p);else{d.updateData(t,c,l,u);var m={x:p[0],y:p[1]};s?d.attr(m):Jr(d,m,n)}i.add(d),t.setItemGraphicEl(c,d)}).remove(function(c){var f=a.getItemGraphicEl(c);f&&f.fadeOut(function(){i.remove(f)},n)}).execute(),this._getSymbolPoint=h,this._data=t},r.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(i,n){var a=t._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=mg(t),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(t,e,i){this._progressiveEls=[],i=gg(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a<t.end;a++){var o=e.getItemLayout(a);if(Ku(e,o,a,i)){var s=new this._SymbolCtor(e,a,this._seriesScope);s.traverse(n),s.setPosition(o),this.group.add(s),e.setItemGraphicEl(a,s),this._progressiveEls.push(s)}}},r.prototype.eachRendered=function(t){ff(this._progressiveEls||this.group,t)},r.prototype.remove=function(t){var e=this.group,i=this._data;i&&t?i.eachItemGraphicEl(function(n){n.fadeOut(function(){e.remove(n)},i.hostModel)}):e.removeAll()},r})();function Ab(r,t,e){var i=r.getBaseAxis(),n=r.getOtherAxis(i),a=fP(n,e),o=i.dim,s=n.dim,l=t.mapDimension(s),u=t.mapDimension(o),h=s==="x"||s==="radius"?1:0,c=H(r.dimensions,function(p){return t.mapDimension(p)}),f=!1,d=t.getCalculationInfo("stackResultDimension");return Vn(t,c[0])&&(f=!0,c[0]=d),Vn(t,c[1])&&(f=!0,c[1]=d),{dataDimsForPoint:c,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!f,valueDim:l,baseDim:u,baseDataOffset:h,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function fP(r,t){var e=0,i=r.scale.getExtent();return t==="start"?e=i[0]:t==="end"?e=i[1]:At(t)&&!isNaN(t)?e=t:i[0]>0?e=i[0]:i[1]<0&&(e=i[1]),e}function Ib(r,t,e,i){var n=NaN;r.stacked&&(n=e.get(e.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=e.get(r.baseDim,i),o[1-a]=n,t.dataToPoint(o)}function dP(r,t){var e=[];return t.diff(r).add(function(i){e.push({cmd:"+",idx:i})}).update(function(i,n){e.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){e.push({cmd:"-",idx:i})}).execute(),e}function pP(r,t,e,i,n,a,o,s){for(var l=dP(r,t),u=[],h=[],c=[],f=[],d=[],p=[],v=[],g=Ab(n,t,o),m=r.getLayout("points")||[],_=t.getLayout("points")||[],b=0;b<l.length;b++){var x=l[b],C=!0,S=void 0,T=void 0;switch(x.cmd){case"=":S=x.idx*2,T=x.idx1*2;var I=m[S],M=m[S+1],D=_[T],P=_[T+1];(isNaN(I)||isNaN(M))&&(I=D,M=P),u.push(I,M),h.push(D,P),c.push(e[S],e[S+1]),f.push(i[T],i[T+1]),v.push(t.getRawIndex(x.idx1));break;case"+":var k=x.idx,R=g.dataDimsForPoint,L=n.dataToPoint([t.get(R[0],k),t.get(R[1],k)]);T=k*2,u.push(L[0],L[1]),h.push(_[T],_[T+1]);var N=Ib(g,n,t,k);c.push(N[0],N[1]),f.push(i[T],i[T+1]),v.push(t.getRawIndex(k));break;case"-":C=!1}C&&(d.push(x),p.push(p.length))}p.sort(function(z,Rt){return v[z]-v[Rt]});for(var j=u.length,Z=An(j),U=An(j),Y=An(j),et=An(j),ut=[],b=0;b<p.length;b++){var ot=p[b],ft=b*2,gt=ot*2;Z[ft]=u[gt],Z[ft+1]=u[gt+1],U[ft]=h[gt],U[ft+1]=h[gt+1],Y[ft]=c[gt],Y[ft+1]=c[gt+1],et[ft]=f[gt],et[ft+1]=f[gt+1],ut[b]=d[ot]}return{current:Z,next:U,stackedOnCurrent:Y,stackedOnNext:et,status:ut}}var Pr=Math.min,kr=Math.max;function Bi(r,t){return isNaN(r)||isNaN(t)}function fc(r,t,e,i,n,a,o,s,l){for(var u,h,c,f,d,p,v=e,g=0;g<i;g++){var m=t[v*2],_=t[v*2+1];if(v>=n||v<0)break;if(Bi(m,_)){if(l){v+=a;continue}break}if(v===e)r[a>0?"moveTo":"lineTo"](m,_),c=m,f=_;else{var b=m-u,x=_-h;if(b*b+x*x<.5){v+=a;continue}if(o>0){for(var C=v+a,S=t[C*2],T=t[C*2+1];S===m&&T===_&&g<i;)g++,C+=a,v+=a,S=t[C*2],T=t[C*2+1],m=t[v*2],_=t[v*2+1],b=m-u,x=_-h;var I=g+1;if(l)for(;Bi(S,T)&&I<i;)I++,C+=a,S=t[C*2],T=t[C*2+1];var M=.5,D=0,P=0,k=void 0,R=void 0;if(I>=i||Bi(S,T))d=m,p=_;else{D=S-u,P=T-h;var L=m-u,N=S-m,j=_-h,Z=T-_,U=void 0,Y=void 0;if(s==="x"){U=Math.abs(L),Y=Math.abs(N);var et=D>0?1:-1;d=m-et*U*o,p=_,k=m+et*Y*o,R=_}else if(s==="y"){U=Math.abs(j),Y=Math.abs(Z);var ut=P>0?1:-1;d=m,p=_-ut*U*o,k=m,R=_+ut*Y*o}else U=Math.sqrt(L*L+j*j),Y=Math.sqrt(N*N+Z*Z),M=Y/(Y+U),d=m-D*o*(1-M),p=_-P*o*(1-M),k=m+D*o*M,R=_+P*o*M,k=Pr(k,kr(S,m)),R=Pr(R,kr(T,_)),k=kr(k,Pr(S,m)),R=kr(R,Pr(T,_)),D=k-m,P=R-_,d=m-D*U/Y,p=_-P*U/Y,d=Pr(d,kr(u,m)),p=Pr(p,kr(h,_)),d=kr(d,Pr(u,m)),p=kr(p,Pr(h,_)),D=m-d,P=_-p,k=m+D*Y/U,R=_+P*Y/U}r.bezierCurveTo(c,f,d,p,m,_),c=k,f=R}else r.lineTo(m,_)}u=m,h=_,v+=a}return g}var Mb=(function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r})(),vP=(function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="ec-polyline",i}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Mb},t.prototype.buildPath=function(e,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&Bi(n[o*2-2],n[o*2-1]);o--);for(;a<o&&Bi(n[a*2],n[a*2+1]);a++);}for(;a<o;)a+=fc(e,n,a,o,o,1,i.smooth,i.smoothMonotone,i.connectNulls)+1},t.prototype.getPointOn=function(e,i){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n=this.path,a=n.data,o=Kr.CMD,s,l,u=i==="x",h=[],c=0;c<a.length;){var f=a[c++],d=void 0,p=void 0,v=void 0,g=void 0,m=void 0,_=void 0,b=void 0;switch(f){case o.M:s=a[c++],l=a[c++];break;case o.L:if(d=a[c++],p=a[c++],b=u?(e-s)/(d-s):(e-l)/(p-l),b<=1&&b>=0){var x=u?(p-l)*b+l:(d-s)*b+s;return u?[e,x]:[x,e]}s=d,l=p;break;case o.C:d=a[c++],p=a[c++],v=a[c++],g=a[c++],m=a[c++],_=a[c++];var C=u?Ps(s,d,v,m,e,h):Ps(l,p,g,_,e,h);if(C>0)for(var S=0;S<C;S++){var T=h[S];if(T<=1&&T>=0){var x=u?Ht(l,p,g,_,T):Ht(s,d,v,m,T);return u?[e,x]:[x,e]}}s=m,l=_;break}}},t})(bt),gP=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t})(Mb),mP=(function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="ec-polygon",i}return t.prototype.getDefaultShape=function(){return new gP},t.prototype.buildPath=function(e,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&Bi(n[s*2-2],n[s*2-1]);s--);for(;o<s&&Bi(n[o*2],n[o*2+1]);o++);}for(;o<s;){var u=fc(e,n,o,s,s,1,i.smooth,l,i.connectNulls);fc(e,a,o+u-1,u,s,-1,i.stackedOnSmooth,l,i.connectNulls),o+=u+1,e.closePath()}},t})(bt);function yP(r,t,e,i,n){var a=r.getArea(),o=a.x,s=a.y,l=a.width,u=a.height,h=e.get(["lineStyle","width"])||0;o-=h/2,s-=h/2,l+=h,u+=h,l=Math.ceil(l),o!==Math.floor(o)&&(o=Math.floor(o),l++);var c=new Nt({shape:{x:o,y:s,width:l,height:u}});if(t){var f=r.getBaseAxis(),d=f.isHorizontal(),p=f.inverse;d?(p&&(c.shape.x+=l),c.shape.width=0):(p||(c.shape.y+=u),c.shape.height=0);var v=tt(n)?function(g){n(g,c)}:null;$n(c,{shape:{width:l,height:u,x:o,y:s}},e,null,i,v)}return c}function _P(r,t,e){var i=r.getArea(),n=Pt(i.r0,1),a=Pt(i.r,1),o=new _o({shape:{cx:Pt(r.cx,1),cy:Pt(r.cy,1),r0:n,r:a,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});if(t){var s=r.getBaseAxis().dim==="angle";s?o.shape.endAngle=i.startAngle:o.shape.r=n,$n(o,{shape:{endAngle:i.endAngle,r:a}},e)}return o}function bP(r,t){return r.type===t}function yg(r,t){if(r.length===t.length){for(var e=0;e<r.length;e++)if(r[e]!==t[e])return;return!0}}function _g(r){for(var t=1/0,e=1/0,i=-1/0,n=-1/0,a=0;a<r.length;){var o=r[a++],s=r[a++];isNaN(o)||(t=Math.min(o,t),i=Math.max(o,i)),isNaN(s)||(e=Math.min(s,e),n=Math.max(s,n))}return[[t,e],[i,n]]}function bg(r,t){var e=_g(r),i=e[0],n=e[1],a=_g(t),o=a[0],s=a[1];return Math.max(Math.abs(i[0]-o[0]),Math.abs(i[1]-o[1]),Math.abs(n[0]-s[0]),Math.abs(n[1]-s[1]))}function xg(r){return At(r)?r:r?.5:0}function xP(r,t,e){if(!e.valueDim)return[];for(var i=t.count(),n=An(i*2),a=0;a<i;a++){var o=Ib(e,r,t,a);n[a*2]=o[0],n[a*2+1]=o[1]}return n}function Rr(r,t,e,i,n){var a=e.getBaseAxis(),o=a.dim==="x"||a.dim==="radius"?0:1,s=[],l=0,u=[],h=[],c=[],f=[];if(n){for(l=0;l<r.length;l+=2){var d=t||r;!isNaN(d[l])&&!isNaN(d[l+1])&&f.push(r[l],r[l+1])}r=f}for(l=0;l<r.length-2;l+=2)switch(c[0]=r[l+2],c[1]=r[l+3],h[0]=r[l],h[1]=r[l+1],s.push(h[0],h[1]),i){case"end":u[o]=c[o],u[1-o]=h[1-o],s.push(u[0],u[1]);break;case"middle":var p=(h[o]+c[o])/2,v=[];u[o]=v[o]=p,u[1-o]=h[1-o],v[1-o]=c[1-o],s.push(u[0],u[1]),s.push(v[0],v[1]);break;default:u[o]=h[o],u[1-o]=c[1-o],s.push(u[0],u[1])}return s.push(r[l++],r[l++]),s}function wP(r,t){var e=[],i=r.length,n,a;function o(h,c,f){var d=h.coord,p=(f-d)/(c.coord-d),v=Gc(p,[h.color,c.color]);return{coord:f,color:v}}for(var s=0;s<i;s++){var l=r[s],u=l.coord;if(u<0)n=l;else if(u>t){a?e.push(o(a,l,t)):n&&e.push(o(n,l,0),o(n,l,t));break}else n&&(e.push(o(n,l,0)),n=null),e.push(l),a=l}return e}function SP(r,t,e){var i=r.getVisual("visualMeta");if(!(!i||!i.length||!r.count())&&t.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=r.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=t.getAxis(n),u=H(a.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),h=u.length,c=a.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var f=wP(u,n==="x"?e.getWidth():e.getHeight()),d=f.length;if(!d&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var p=10,v=f[0].coord-p,g=f[d-1].coord+p,m=g-v;if(m<.001)return"transparent";A(f,function(b){b.offset=(b.coord-v)/m}),f.push({offset:d?f[d-1].offset:.5,color:c[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:c[0]||"transparent"});var _=new sf(0,0,0,0,f,!0);return _[n]=v,_[n+"2"]=g,_}}}function CP(r,t,e){var i=r.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=e.getAxesByScale("ordinal")[0];if(a&&!(n&&TP(a,t))){var o=t.mapDimension(a.dim),s={};return A(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function TP(r,t){var e=r.getExtent(),i=Math.abs(e[1]-e[0])/r.scale.count();isNaN(i)&&(i=0);for(var n=t.count(),a=Math.max(1,Math.round(n/5)),o=0;o<n;o+=a)if(Zf.getSymbolSize(t,o)[r.isHorizontal()?1:0]*1.5>i)return!1;return!0}function AP(r,t){return isNaN(r)||isNaN(t)}function IP(r){for(var t=r.length/2;t>0&&AP(r[t*2-2],r[t*2-1]);t--);return t-1}function wg(r,t){return[r[t*2],r[t*2+1]]}function MP(r,t,e){for(var i=r.length/2,n=e==="x"?0:1,a,o,s=0,l=-1,u=0;u<i;u++)if(o=r[u*2+n],!(isNaN(o)||isNaN(r[u*2+1-n]))){if(u===0){a=o;continue}if(a<=t&&o>=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function Db(r){if(r.get(["endLabel","show"]))return!0;for(var t=0;t<ur.length;t++)if(r.get([ur[t],"endLabel","show"]))return!0;return!1}function Ju(r,t,e,i){if(bP(t,"cartesian2d")){var n=i.getModel("endLabel"),a=n.get("valueAnimation"),o=i.getData(),s={lastFrameIndex:0},l=Db(i)?function(d,p){r._endLabelOnDuring(d,p,o,s,a,n,t)}:null,u=t.getBaseAxis().isHorizontal(),h=yP(t,e,i,function(){var d=r._endLabel;d&&e&&s.originalX!=null&&d.attr({x:s.originalX,y:s.originalY})},l);if(!i.get("clip",!0)){var c=h.shape,f=Math.max(c.width,c.height);u?(c.y-=f,c.height+=f*2):(c.x-=f,c.width+=f*2)}return l&&l(1,h),h}else return _P(t,e,i)}function DP(r,t){var e=t.getBaseAxis(),i=e.isHorizontal(),n=e.inverse,a=i?n?"right":"left":"center",o=i?"middle":n?"top":"bottom";return{normal:{align:r.get("align")||a,verticalAlign:r.get("verticalAlign")||o}}}var PP=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(){var e=new Ft,i=new cP;this.group.add(i.group),this._symbolDraw=i,this._lineGroup=e,this._changePolyState=ct(this._changePolyState,this)},t.prototype.render=function(e,i,n){var a=e.coordinateSystem,o=this.group,s=e.getData(),l=e.getModel("lineStyle"),u=e.getModel("areaStyle"),h=s.getLayout("points")||[],c=a.type==="polar",f=this._coordSys,d=this._symbolDraw,p=this._polyline,v=this._polygon,g=this._lineGroup,m=!i.ssr&&e.get("animation"),_=!u.isEmpty(),b=u.get("origin"),x=Ab(a,s,b),C=_&&xP(a,s,x),S=e.get("showSymbol"),T=e.get("connectNulls"),I=S&&!c&&CP(e,s,a),M=this._data;M&&M.eachItemGraphicEl(function(z,Rt){z.__temp&&(o.remove(z),M.setItemGraphicEl(Rt,null))}),S||d.remove(),o.add(g);var D=c?!1:e.get("step"),P;a&&a.getArea&&e.get("clip",!0)&&(P=a.getArea(),P.width!=null?(P.x-=.1,P.y-=.1,P.width+=.2,P.height+=.2):P.r0&&(P.r0-=.5,P.r+=.5)),this._clipShapeForSymbol=P;var k=SP(s,a,n)||s.getVisual("style")[s.getVisual("drawType")];if(!(p&&f.type===a.type&&D===this._step))S&&d.updateData(s,{isIgnore:I,clipShape:P,disableAnimation:!0,getSymbolPoint:function(z){return[h[z*2],h[z*2+1]]}}),m&&this._initSymbolLabelAnimation(s,a,P),D&&(C&&(C=Rr(C,h,a,D,T)),h=Rr(h,null,a,D,T)),p=this._newPolyline(h),_?v=this._newPolygon(h,C):v&&(g.remove(v),v=this._polygon=null),c||this._initOrUpdateEndLabel(e,a,Wi(k)),g.setClipPath(Ju(this,a,!0,e));else{_&&!v?v=this._newPolygon(h,C):v&&!_&&(g.remove(v),v=this._polygon=null),c||this._initOrUpdateEndLabel(e,a,Wi(k));var R=g.getClipPath();if(R){var L=Ju(this,a,!1,e);$n(R,{shape:L.shape},e)}else g.setClipPath(Ju(this,a,!0,e));S&&d.updateData(s,{isIgnore:I,clipShape:P,disableAnimation:!0,getSymbolPoint:function(z){return[h[z*2],h[z*2+1]]}}),(!yg(this._stackedOnPoints,C)||!yg(this._points,h))&&(m?this._doUpdateAnimation(s,C,a,n,D,b,T):(D&&(C&&(C=Rr(C,h,a,D,T)),h=Rr(h,null,a,D,T)),p.setShape({points:h}),v&&v.setShape({points:h,stackedOnPoints:C})))}var N=e.getModel("emphasis"),j=N.get("focus"),Z=N.get("blurScope"),U=N.get("disabled");if(p.useStyle(lt(l.getLineStyle(),{fill:"none",stroke:k,lineJoin:"bevel"})),Mp(p,e,"lineStyle"),p.style.lineWidth>0&&e.get(["emphasis","lineStyle","width"])==="bolder"){var Y=p.getState("emphasis").style;Y.lineWidth=+p.style.lineWidth+1}_t(p).seriesIndex=e.seriesIndex,Gh(p,j,Z,U);var et=xg(e.get("smooth")),ut=e.get("smoothMonotone");if(p.setShape({smooth:et,smoothMonotone:ut,connectNulls:T}),v){var ot=s.getCalculationInfo("stackedOnSeries"),ft=0;v.useStyle(lt(u.getAreaStyle(),{fill:k,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),ot&&(ft=xg(ot.get("smooth"))),v.setShape({smooth:et,stackedOnSmooth:ft,smoothMonotone:ut,connectNulls:T}),Mp(v,e,"areaStyle"),_t(v).seriesIndex=e.seriesIndex,Gh(v,j,Z,U)}var gt=this._changePolyState;s.eachItemGraphicEl(function(z){z&&(z.onHoverStateChange=gt)}),this._polyline.onHoverStateChange=gt,this._data=s,this._coordSys=a,this._stackedOnPoints=C,this._points=h,this._step=D,this._valueOrigin=b,e.get("triggerLineEvent")&&(this.packEventData(e,p),v&&this.packEventData(e,v))},t.prototype.packEventData=function(e,i){_t(i).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,i,n,a){var o=e.getData(),s=Hi(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var h=l[s*2],c=l[s*2+1];if(isNaN(h)||isNaN(c)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(h,c))return;var f=e.get("zlevel")||0,d=e.get("z")||0;u=new Zf(o,s),u.x=h,u.y=c,u.setZ(f,d);var p=u.getSymbolPath().getTextContent();p&&(p.zlevel=f,p.z=d,p.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else ye.prototype.highlight.call(this,e,i,n,a)},t.prototype.downplay=function(e,i,n,a){var o=e.getData(),s=Hi(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else ye.prototype.downplay.call(this,e,i,n,a)},t.prototype._changePolyState=function(e){var i=this._polygon;Sp(this._polyline,e),i&&Sp(i,e)},t.prototype._newPolyline=function(e){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new vP({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},t.prototype._newPolygon=function(e,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new mP({shape:{points:e,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=e.hostModel,h=u.get("animationDuration");tt(h)&&(h=h(null));var c=u.get("animationDelay")||0,f=tt(c)?c(null):c;e.eachItemGraphicEl(function(d,p){var v=d;if(v){var g=[d.x,d.y],m=void 0,_=void 0,b=void 0;if(n)if(o){var x=n,C=i.pointToCoord(g);a?(m=x.startAngle,_=x.endAngle,b=-C[1]/180*Math.PI):(m=x.r0,_=x.r,b=C[0])}else{var S=n;a?(m=S.x,_=S.x+S.width,b=d.x):(m=S.y+S.height,_=S.y,b=d.y)}var T=_===m?0:(b-m)/(_-m);l&&(T=1-T);var I=tt(c)?c(p):h*T+f,M=v.getSymbolPath(),D=M.getTextContent();v.attr({scaleX:0,scaleY:0}),v.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:I}),D&&D.animateFrom({style:{opacity:0}},{duration:300,delay:I}),M.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,i,n){var a=e.getModel("endLabel");if(Db(e)){var o=e.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new zt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var h=IP(l);h>=0&&(I0(s,df(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:h,defaultText:function(c,f,d){return d!=null?uP(o,d):Tb(o,c)},enableTextSetter:!0},DP(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,i,n,a,o,s,l){var u=this._endLabel,h=this._polyline;if(u){e<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var c=n.getLayout("points"),f=n.hostModel,d=f.get("connectNulls"),p=s.get("precision"),v=s.get("distance")||0,g=l.getBaseAxis(),m=g.isHorizontal(),_=g.inverse,b=i.shape,x=_?m?b.x:b.y+b.height:m?b.x+b.width:b.y,C=(m?v:0)*(_?-1:1),S=(m?0:-v)*(_?-1:1),T=m?"x":"y",I=MP(c,x,T),M=I.range,D=M[1]-M[0],P=void 0;if(D>=1){if(D>1&&!d){var k=wg(c,M[0]);u.attr({x:k[0]+C,y:k[1]+S}),o&&(P=f.getRawValue(M[0]))}else{var k=h.getPointOn(x,T);k&&u.attr({x:k[0]+C,y:k[1]+S});var R=f.getRawValue(M[0]),L=f.getRawValue(M[1]);o&&(P=hC(n,p,R,L,I.t))}a.lastFrameIndex=M[0]}else{var N=e===1||a.lastFrameIndex>0?M[0]:0,k=wg(c,N);o&&(P=f.getRawValue(N)),u.attr({x:k[0]+C,y:k[1]+S})}if(o){var j=D0(u);typeof j.setLabelText=="function"&&j.setLabelText(P)}}},t.prototype._doUpdateAnimation=function(e,i,n,a,o,s,l){var u=this._polyline,h=this._polygon,c=e.hostModel,f=pP(this._data,e,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin),d=f.current,p=f.stackedOnCurrent,v=f.next,g=f.stackedOnNext;if(o&&(p=Rr(f.stackedOnCurrent,f.current,n,o,l),d=Rr(f.current,null,n,o,l),g=Rr(f.stackedOnNext,f.next,n,o,l),v=Rr(f.next,null,n,o,l)),bg(d,v)>3e3||h&&bg(p,g)>3e3){u.stopAnimation(),u.setShape({points:v}),h&&(h.stopAnimation(),h.setShape({points:v,stackedOnPoints:g}));return}u.shape.__points=f.current,u.shape.points=d;var m={shape:{points:v}};f.current!==d&&(m.shape.__points=f.next),u.stopAnimation(),Jr(u,m,c),h&&(h.setShape({points:d,stackedOnPoints:p}),h.stopAnimation(),Jr(h,{shape:{stackedOnPoints:g}},c),u.shape.points!==h.shape.points&&(h.shape.points=u.shape.points));for(var _=[],b=f.status,x=0;x<b.length;x++){var C=b[x].cmd;if(C==="="){var S=e.getItemGraphicEl(b[x].idx1);S&&_.push({el:S,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){h&&h.dirtyShape();for(var T=u.shape.__points,I=0;I<_.length;I++){var M=_[I].el,D=_[I].ptIdx*2;M.x=T[D],M.y=T[D+1],M.markRedraw()}})},t.prototype.remove=function(e){var i=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(a,o){a.__temp&&(i.remove(a),n.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t})(ye);function kP(r,t){return{seriesType:r,plan:p_(),reset:function(e){var i=e.getData(),n=e.coordinateSystem;if(e.pipelineContext,!!n){var a=H(n.dimensions,function(c){return i.mapDimension(c)}).slice(0,2),o=a.length,s=i.getCalculationInfo("stackResultDimension");Vn(i,a[0])&&(a[0]=s),Vn(i,a[1])&&(a[1]=s);var l=i.getStore(),u=i.getDimensionIndex(a[0]),h=i.getDimensionIndex(a[1]);return o&&{progress:function(c,f){for(var d=c.end-c.start,p=An(d*o),v=[],g=[],m=c.start,_=0;m<c.end;m++){var b=void 0;if(o===1){var x=l.get(u,m);b=n.dataToPoint(x,null,g)}else v[0]=l.get(u,m),v[1]=l.get(h,m),b=n.dataToPoint(v,null,g);p[_++]=b[0],p[_++]=b[1]}f.setLayout("points",p)}}}}}}var RP={average:function(r){for(var t=0,e=0,i=0;i<r.length;i++)isNaN(r[i])||(t+=r[i],e++);return e===0?NaN:t/e},sum:function(r){for(var t=0,e=0;e<r.length;e++)t+=r[e]||0;return t},max:function(r){for(var t=-1/0,e=0;e<r.length;e++)r[e]>t&&(t=r[e]);return isFinite(t)?t:NaN},min:function(r){for(var t=1/0,e=0;e<r.length;e++)r[e]<t&&(t=r[e]);return isFinite(t)?t:NaN},nearest:function(r){return r[0]}},LP=function(r){return Math.round(r.length/2)};function OP(r){return{seriesType:r,reset:function(t,e,i){var n=t.getData(),a=t.get("sampling"),o=t.coordinateSystem,s=n.count();if(s>10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),h=l.getExtent(),c=i.getDevicePixelRatio(),f=Math.abs(h[1]-h[0])*(c||1),d=Math.round(s/f);if(isFinite(d)&&d>1){a==="lttb"?t.setData(n.lttbDownSample(n.mapDimension(u.dim),1/d)):a==="minmax"&&t.setData(n.minmaxDownSample(n.mapDimension(u.dim),1/d));var p=void 0;$(a)?p=RP[a]:tt(a)&&(p=a),p&&t.setData(n.downSample(n.mapDimension(u.dim),1/d,p,LP))}}}}}function EP(r){r.registerChartView(PP),r.registerSeriesModel(lP),r.registerLayout(kP("line")),r.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),i=t.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",i)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,OP("line"))}var jP=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t})(dt),dc=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ee).models[0]},t.type="cartesian2dAxis",t})(dt);be(dc,vb);var Pb={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},NP=st({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Pb),qf=st({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},Pb),FP=st({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},qf),BP=lt({logBase:10},qf);const zP={category:NP,value:qf,time:FP,log:BP};var VP={value:1,category:1,time:1,log:1};function Sg(r,t,e,i){A(VP,function(n,a){var o=st(st({},zP[a],!0),i,!0),s=(function(l){B(u,l);function u(){var h=l!==null&&l.apply(this,arguments)||this;return h.type=t+"Axis."+a,h}return u.prototype.mergeDefaultAndTheme=function(h,c){var f=Qa(this),d=f?Cf(h):{},p=c.getTheme();st(h,p.get(a+"Axis")),st(h,this.getDefaultOption()),h.type=Cg(h),f&&to(h,d,f)},u.prototype.optionUpdated=function(){var h=this.option;h.type==="category"&&(this.__ordinalMeta=uc.createByAxisModel(this))},u.prototype.getCategories=function(h){var c=this.option;if(c.type==="category")return h?c.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=t+"Axis."+a,u.defaultOption=o,u})(e);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(t+"Axis",Cg)}function Cg(r){return r.type||(r.data?"category":"value")}var HP=(function(){function r(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return r.prototype.getAxis=function(t){return this._axes[t]},r.prototype.getAxes=function(){return H(this._dimList,function(t){return this._axes[t]},this)},r.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),Dt(this.getAxes(),function(e){return e.scale.type===t})},r.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},r})(),pc=["x","y"];function Tg(r){return r.type==="interval"||r.type==="time"}var WP=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=pc,e}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!Tg(e)||!Tg(i))){var n=e.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var h=(s[0]-o[0])/l,c=(s[1]-o[1])/u,f=o[0]-n[0]*h,d=o[1]-a[0]*c,p=this._transform=[h,0,0,c,f,d];this._invTransform=po([],p)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,i){var n=this.dataToPoint(e),a=this.dataToPoint(i),o=this.getArea(),s=new mt(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},t.prototype.dataToPoint=function(e,i,n){n=n||[];var a=e[0],o=e[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return re(n,e,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},t.prototype.clampData=function(e,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(e[0]),u=a.parse(e[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},t.prototype.pointToData=function(e,i){var n=[];if(this._invTransform)return re(n,e,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(e[0]),i),n[1]=o.coordToData(o.toLocalCoord(e[1]),i),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim==="x"?"y":"x")},t.prototype.getArea=function(e){e=e||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-e,o=Math.min(n[0],n[1])-e,s=Math.max(i[0],i[1])-a+e,l=Math.max(n[0],n[1])-o+e;return new mt(a,o,s,l)},t})(HP),GP=(function(r){B(t,r);function t(e,i,n,a,o){var s=r.call(this,e,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var e=this.position;return e==="top"||e==="bottom"},t.prototype.getGlobalExtent=function(e){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),e&&i[0]>i[1]&&i.reverse(),i},t.prototype.pointToData=function(e,i){return this.coordToData(this.toLocalCoord(e[this.dim==="x"?0:1]),i)},t.prototype.setCategorySortInfo=function(e){if(this.type!=="category")return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t})(Xf);function vc(r,t,e){e=e||{};var i=r.coordinateSystem,n=t.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,h=i.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],f={left:0,right:1,top:0,bottom:1,onZero:2},d=t.get("offset")||0,p=u==="x"?[c[2]-d,c[3]+d]:[c[0]-d,c[1]+d];if(o){var v=o.toGlobalCoord(o.dataToCoord(0));p[f.onZero]=Math.max(Math.min(v,p[1]),p[0])}a.position=[u==="y"?p[f[l]]:c[0],u==="x"?p[f[l]]:c[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=g[s],a.labelOffset=o?p[f[s]]-p[f.onZero]:0,t.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),En(e.labelInside,t.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var m=t.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-m:m,a.z2=1,a}function Ag(r){return r.get("coordinateSystem")==="cartesian2d"}function Ig(r){var t={xAxisModel:null,yAxisModel:null};return A(t,function(e,i){var n=i.replace(/Model$/,""),a=r.getReferringComponents(n,ee).models[0];t[i]=a}),t}var Qu=Math.log;function UP(r,t,e){var i=Ki.prototype,n=i.getTicks.call(e),a=i.getTicks.call(e,!0),o=n.length-1,s=i.getInterval.call(e),l=cb(r,t),u=l.extent,h=l.fixMin,c=l.fixMax;if(r.type==="log"){var f=Qu(r.base);u=[Qu(u[0])/f,Qu(u[1])/f]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:h,fixMax:c});var d=i.getExtent.call(r);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var p=i.getInterval.call(r),v=u[0],g=u[1];if(h&&c)p=(g-v)/o;else if(h)for(g=u[0]+p*o;g<u[1]&&isFinite(g)&&isFinite(u[1]);)p=Xu(p),g=u[0]+p*o;else if(c)for(v=u[1]-p*o;v>u[0]&&isFinite(v)&&isFinite(u[0]);)p=Xu(p),v=u[1]-p*o;else{var m=r.getTicks().length-1;m>o&&(p=Xu(p));var _=p*o;g=Math.ceil(u[1]/p)*p,v=Pt(g-_),v<0&&u[0]>=0?(v=0,g=Pt(_)):g>0&&u[1]<=0&&(g=0,v=-Pt(_))}var b=(n[0].value-a[0].value)/s,x=(n[o].value-a[o].value)/s;i.setExtent.call(r,v+p*b,g+p*x),i.setInterval.call(r,p),(b||x)&&i.setNiceExtent.call(r,v+p,g-p)}var $P=(function(){function r(t,e,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=pc,this._initCartesian(t,e,i),this.model=t}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model);function n(o){var s,l=vt(o),u=l.length;if(u){for(var h=[],c=u-1;c>=0;c--){var f=+l[c],d=o[f],p=d.model,v=d.scale;hc(v)&&p.get("alignTicks")&&p.get("interval")==null?h.push(d):(cc(v,p),hc(v)&&(s=d))}h.length&&(s||(s=h.pop(),cc(s.scale,s.model)),A(h,function(g){UP(g.scale,g.model,s.scale)}))}}n(i.x),n(i.y);var a={};A(i.x,function(o){Mg(i,"y",o,a)}),A(i.y,function(o){Mg(i,"x",o,a)}),this.resize(this.model,e)},r.prototype.resize=function(t,e,i){var n=t.getBoxLayoutParams(),a=!i&&t.get("containLabel"),o=qi(n,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(A(s,function(u){if(!u.model.get(["axisLabel","inside"])){var h=A2(u);if(h){var c=u.isHorizontal()?"height":"width",f=u.model.get(["axisLabel","margin"]);o[c]-=h[c]+f,u.position==="top"?o.y+=h.height+f:u.position==="left"&&(o.x+=h.width+f)}}}),l()),A(this._coordsList,function(u){u.calcAffineTransform()});function l(){A(s,function(u){var h=u.isHorizontal(),c=h?[0,o.width]:[0,o.height],f=u.inverse?1:0;u.setExtent(c[f],c[1-f]),YP(u,h?o.x:o.y)})}},r.prototype.getAxis=function(t,e){var i=this._axesMap[t];if(i!=null)return i[e||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(t,e){if(t!=null&&e!=null){var i="x"+t+"y"+e;return this._coordsMap[i]}q(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,a=this._coordsList;n<a.length;n++)if(a[n].getAxis("x").index===t||a[n].getAxis("y").index===e)return a[n]},r.prototype.getCartesians=function(){return this._coordsList.slice()},r.prototype.convertToPixel=function(t,e,i){var n=this._findConvertTarget(e);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},r.prototype.convertFromPixel=function(t,e,i){var n=this._findConvertTarget(e);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},r.prototype._findConvertTarget=function(t){var e=t.seriesModel,i=t.xAxisModel||e&&e.getReferringComponents("xAxis",ee).models[0],n=t.yAxisModel||e&&e.getReferringComponents("yAxis",ee).models[0],a=t.gridModel,o=this._coordsList,s,l;if(e)s=e.coordinateSystem,pt(o,s)<0&&(s=null);else if(i&&n)s=this.getCartesian(i.componentIndex,n.componentIndex);else if(i)l=this.getAxis("x",i.componentIndex);else if(n)l=this.getAxis("y",n.componentIndex);else if(a){var u=a.coordinateSystem;u===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},r.prototype.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},r.prototype._initCartesian=function(t,e,i){var n=this,a=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(e.eachComponent("xAxis",u("x"),this),e.eachComponent("yAxis",u("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,A(s.x,function(h,c){A(s.y,function(f,d){var p="x"+c+"y"+d,v=new WP(p);v.master=n,v.model=t,n._coordsMap[p]=v,n._coordsList.push(v),v.addAxis(h),v.addAxis(f)})});function u(h){return function(c,f){if(th(c,t)){var d=c.get("position");h==="x"?d!=="top"&&d!=="bottom"&&(d=o.bottom?"top":"bottom"):d!=="left"&&d!=="right"&&(d=o.left?"right":"left"),o[d]=!0;var p=new GP(h,fb(c),[0,0],c.get("type"),d),v=p.type==="category";p.onBand=v&&c.get("boundaryGap"),p.inverse=c.get("inverse"),c.axis=p,p.model=c,p.grid=a,p.index=f,a._axesList.push(p),s[h][f]=p,l[h]++}}}},r.prototype._updateScale=function(t,e){A(this._axesList,function(n){if(n.scale.setExtent(1/0,-1/0),n.type==="category"){var a=n.model.get("categorySortInfo");n.scale.setSortInfo(a)}}),t.eachSeries(function(n){if(Ag(n)){var a=Ig(n),o=a.xAxisModel,s=a.yAxisModel;if(!th(o,e)||!th(s,e))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),u=n.getData(),h=l.getAxis("x"),c=l.getAxis("y");i(u,h),i(u,c)}},this);function i(n,a){A(pb(n,a.dim),function(o){a.scale.unionExtentFromData(n,o)})}},r.prototype.getTooltipAxes=function(t){var e=[],i=[];return A(this.getCartesians(),function(n){var a=t!=null&&t!=="auto"?n.getAxis(t):n.getBaseAxis(),o=n.getOtherAxis(a);pt(e,a)<0&&e.push(a),pt(i,o)<0&&i.push(o)}),{baseAxes:e,otherAxes:i}},r.create=function(t,e){var i=[];return t.eachComponent("grid",function(n,a){var o=new r(n,t,e);o.name="grid_"+a,o.resize(n,e,!0),n.coordinateSystem=o,i.push(o)}),t.eachSeries(function(n){if(Ag(n)){var a=Ig(n),o=a.xAxisModel,s=a.yAxisModel,l=o.getCoordSysModel(),u=l.coordinateSystem;n.coordinateSystem=u.getCartesian(o.componentIndex,s.componentIndex)}}),i},r.dimensions=pc,r})();function th(r,t){return r.getCoordSysModel()===t}function Mg(r,t,e,i){e.getAxesOnZeroOf=function(){return a?[a]:[]};var n=r[t],a,o=e.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)Dg(n[l])&&(a=n[l]);else for(var u in n)if(n.hasOwnProperty(u)&&Dg(n[u])&&!i[h(n[u])]){a=n[u];break}a&&(i[h(a)]=!0);function h(c){return c.dim+"_"+c.index}}function Dg(r){return r&&r.type!=="category"&&r.type!=="time"&&T2(r)}function YP(r,t){var e=r.getExtent(),i=e[0]+e[1];r.toGlobalCoord=r.dim==="x"?function(n){return n+t}:function(n){return i-n+t},r.toLocalCoord=r.dim==="x"?function(n){return n-t}:function(n){return i-n+t}}var Vr=Math.PI,Yr=(function(){function r(t,e){this.group=new Ft,this.opt=e,this.axisModel=t,lt(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var i=new Ft({x:e.position[0],y:e.position[1],rotation:e.rotation});i.updateTransform(),this._transformGroup=i}return r.prototype.hasBuilder=function(t){return!!Pg[t]},r.prototype.add=function(t){Pg[t](this.opt,this.axisModel,this.group,this._transformGroup)},r.prototype.getGroup=function(){return this.group},r.innerTextLayout=function(t,e,i){var n=qc(e-t),a,o;return $a(n)?(o=i>0?"top":"bottom",a="center"):$a(n-Vr)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n<Vr?a=i>0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},r.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},r})(),Pg={axisLine:function(r,t,e,i){var n=t.get(["axisLine","show"]);if(n==="auto"&&r.handleAutoShown&&(n=r.handleAutoShown("axisLine")),!!n){var a=t.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(re(s,s,o),re(l,l,o));var h=F({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new Ye({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});Ka(c.shape,c.style.lineWidth),c.anid="line",e.add(c);var f=t.get(["axisLine","symbol"]);if(f!=null){var d=t.get(["axisLine","symbolSize"]);$(f)&&(f=[f,f]),($(d)||At(d))&&(d=[d,d]);var p=kf(t.get(["axisLine","symbolOffset"])||0,d),v=d[0],g=d[1];A([{rotate:r.rotation+Math.PI/2,offset:p[0],r:0},{rotate:r.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(m,_){if(f[_]!=="none"&&f[_]!=null){var b=Gi(f[_],-v/2,-g/2,v,g,h.stroke,!0),x=m.r+m.offset,C=u?l:s;b.attr({rotation:m.rotate,x:C[0]+x*Math.cos(r.rotation),y:C[1]-x*Math.sin(r.rotation),silent:!0,z2:11}),e.add(b)}})}}},axisTickLabel:function(r,t,e,i){var n=qP(e,i,t,r),a=JP(e,i,t,r);if(ZP(t,a,n),KP(e,i,t,r.tickDirection),t.get(["axisLabel","hideOverlap"])){var o=aP(H(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));oP(o)}},axisName:function(r,t,e,i){var n=En(r.axisName,t.get("name"));if(n){var a=t.get("nameLocation"),o=r.nameDirection,s=t.getModel("nameTextStyle"),l=t.get("nameGap")||0,u=t.axis.getExtent(),h=u[0]>u[1]?-1:1,c=[a==="start"?u[0]-h*l:a==="end"?u[1]+h*l:(u[0]+u[1])/2,Rg(a)?r.labelOffset+o*l:0],f,d=t.get("nameRotate");d!=null&&(d=d*Vr/180);var p;Rg(a)?f=Yr.innerTextLayout(r.rotation,d??r.rotation,o):(f=XP(r.rotation,a,d||0,u),p=r.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(f.rotation)),!isFinite(p)&&(p=null)));var v=s.getFont(),g=t.get("nameTruncate",!0)||{},m=g.ellipsis,_=En(r.nameTruncateMaxWidth,g.maxWidth,p),b=new zt({x:c[0],y:c[1],rotation:f.rotation,silent:Yr.isLabelSilent(t),style:$e(s,{text:n,font:v,overflow:"truncate",width:_,ellipsis:m,fill:s.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:s.get("align")||f.textAlign,verticalAlign:s.get("verticalAlign")||f.textVerticalAlign}),z2:1});if(Cl({el:b,componentModel:t,itemName:n}),b.__fullText=n,b.anid="name",t.get("triggerEvent")){var x=Yr.makeAxisEventDataBase(t);x.targetType="axisName",x.name=n,_t(b).eventData=x}i.add(b),b.updateTransform(),e.add(b),b.decomposeTransform()}}};function XP(r,t,e,i){var n=qc(e-r),a,o,s=i[0]>i[1],l=t==="start"&&!s||t!=="start"&&s;return $a(n-Vr/2)?(o=l?"bottom":"top",a="center"):$a(n-Vr*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",n<Vr*1.5&&n>Vr/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function ZP(r,t,e){if(!db(r.axis)){var i=r.get(["axisLabel","showMinLabel"]),n=r.get(["axisLabel","showMaxLabel"]);t=t||[],e=e||[];var a=t[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=e[0],h=e[1],c=e[e.length-1],f=e[e.length-2];i===!1?(Se(a),Se(u)):kg(a,o)&&(i?(Se(o),Se(h)):(Se(a),Se(u))),n===!1?(Se(s),Se(c)):kg(l,s)&&(n?(Se(l),Se(f)):(Se(s),Se(c)))}}function Se(r){r&&(r.ignore=!0)}function kg(r,t){var e=r&&r.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(!(!e||!i)){var n=co([]);return fo(n,n,-r.rotation),e.applyTransform(Gr([],n,r.getLocalTransform())),i.applyTransform(Gr([],n,t.getLocalTransform())),e.intersect(i)}}function Rg(r){return r==="middle"||r==="center"}function kb(r,t,e,i,n){for(var a=[],o=[],s=[],l=0;l<r.length;l++){var u=r[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=e,t&&(re(o,o,t),re(s,s,t));var h=new Ye({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});Ka(h.shape,h.style.lineWidth),h.anid=n+"_"+r[l].tickValue,a.push(h)}return a}function qP(r,t,e,i){var n=e.axis,a=e.getModel("axisTick"),o=a.get("show");if(o==="auto"&&i.handleAutoShown&&(o=i.handleAutoShown("axisTick")),!(!o||n.scale.isBlank())){for(var s=a.getModel("lineStyle"),l=i.tickDirection*a.get("length"),u=n.getTicksCoords(),h=kb(u,t.transform,l,lt(s.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<h.length;c++)r.add(h[c]);return h}}function KP(r,t,e,i){var n=e.axis,a=e.getModel("minorTick");if(!(!a.get("show")||n.scale.isBlank())){var o=n.getMinorTicksCoords();if(o.length)for(var s=a.getModel("lineStyle"),l=i*a.get("length"),u=lt(s.getLineStyle(),lt(e.getModel("axisTick").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})),h=0;h<o.length;h++)for(var c=kb(o[h],t.transform,l,u,"minorticks_"+h),f=0;f<c.length;f++)r.add(c[f])}}function JP(r,t,e,i){var n=e.axis,a=En(i.axisLabelShow,e.get(["axisLabel","show"]));if(!(!a||n.scale.isBlank())){var o=e.getModel("axisLabel"),s=o.get("margin"),l=n.getViewLabels(),u=(En(i.labelRotate,o.get("rotate"))||0)*Vr/180,h=Yr.innerTextLayout(i.rotation,u,i.labelDirection),c=e.getCategories&&e.getCategories(!0),f=[],d=Yr.isLabelSilent(e),p=e.get("triggerEvent");return A(l,function(v,g){var m=n.scale.type==="ordinal"?n.scale.getRawOrdinalNumber(v.tickValue):v.tickValue,_=v.formattedLabel,b=v.rawLabel,x=o;if(c&&c[m]){var C=c[m];q(C)&&C.textStyle&&(x=new Tt(C.textStyle,o,e.ecModel))}var S=x.getTextColor()||e.get(["axisLine","lineStyle","color"]),T=n.dataToCoord(m),I=x.getShallow("align",!0)||h.textAlign,M=Q(x.getShallow("alignMinLabel",!0),I),D=Q(x.getShallow("alignMaxLabel",!0),I),P=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||h.textVerticalAlign,k=Q(x.getShallow("verticalAlignMinLabel",!0),P),R=Q(x.getShallow("verticalAlignMaxLabel",!0),P),L=new zt({x:T,y:i.labelOffset+i.labelDirection*s,rotation:h.rotation,silent:d,z2:10+(v.level||0),style:$e(x,{text:_,align:g===0?M:g===l.length-1?D:I,verticalAlign:g===0?k:g===l.length-1?R:P,fill:tt(S)?S(n.type==="category"?b:n.type==="value"?m+"":m,g):S})});if(L.anid="label_"+m,Cl({el:L,componentModel:e,itemName:_,formatterParamsExtra:{isTruncated:function(){return L.isTruncated},value:b,tickIndex:g}}),p){var N=Yr.makeAxisEventDataBase(e);N.targetType="axisLabel",N.value=b,N.tickIndex=g,n.type==="category"&&(N.dataIndex=m),_t(L).eventData=N}t.add(L),L.updateTransform(),f.push(L),r.add(L),L.decomposeTransform()}),f}}function QP(r,t){var e={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return tk(e,r,t),e.seriesInvolved&&rk(e,r),e}function tk(r,t,e){var i=t.getComponent("tooltip"),n=t.getComponent("axisPointer"),a=n.get("link",!0)||[],o=[];A(e.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=ao(s.model),u=r.coordSysAxesInfo[l]={};r.coordSysMap[l]=s;var h=s.model,c=h.getModel("tooltip",i);if(A(s.getAxes(),Ct(v,!1,null)),s.getTooltipAxes&&i&&c.get("show")){var f=c.get("trigger")==="axis",d=c.get(["axisPointer","type"])==="cross",p=s.getTooltipAxes(c.get(["axisPointer","axis"]));(f||d)&&A(p.baseAxes,Ct(v,d?"cross":!0,f)),d&&A(p.otherAxes,Ct(v,"cross",!1))}function v(g,m,_){var b=_.model.getModel("axisPointer",n),x=b.get("show");if(!(!x||x==="auto"&&!g&&!gc(b))){m==null&&(m=b.get("triggerTooltip")),b=g?ek(_,c,n,t,g,m):b;var C=b.get("snap"),S=b.get("triggerEmphasis"),T=ao(_.model),I=m||C||_.type==="category",M=r.axesInfo[T]={key:T,axis:_,coordSys:s,axisPointerModel:b,triggerTooltip:m,triggerEmphasis:S,involveSeries:I,snap:C,useHandle:gc(b),seriesModels:[],linkGroup:null};u[T]=M,r.seriesInvolved=r.seriesInvolved||I;var D=ik(a,_);if(D!=null){var P=o[D]||(o[D]={axesInfo:{}});P.axesInfo[T]=M,P.mapper=a[D].mapper,M.linkGroup=P}}}})}function ek(r,t,e,i,n,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};A(s,function(f){l[f]=it(o.get(f))}),l.snap=r.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),n==="cross"){var h=o.get(["label","show"]);if(u.show=h??!0,!a){var c=l.lineStyle=o.get("crossStyle");c&<(u,c.textStyle)}}return r.model.getModel("axisPointer",new Tt(l,e,i))}function rk(r,t){t.eachSeries(function(e){var i=e.coordinateSystem,n=e.get(["tooltip","trigger"],!0),a=e.get(["tooltip","show"],!0);!i||n==="none"||n===!1||n==="item"||a===!1||e.get(["axisPointer","show"],!0)===!1||A(r.coordSysAxesInfo[ao(i.model)],function(o){var s=o.axis;i.getAxis(s.dim)===s&&(o.seriesModels.push(e),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=e.getData().count())})})}function ik(r,t){for(var e=t.model,i=t.dim,n=0;n<r.length;n++){var a=r[n]||{};if(eh(a[i+"AxisId"],e.id)||eh(a[i+"AxisIndex"],e.componentIndex)||eh(a[i+"AxisName"],e.name))return n}}function eh(r,t){return r==="all"||G(r)&&pt(r,t)>=0||r===t}function nk(r){var t=Kf(r);if(t){var e=t.axisPointerModel,i=t.axis.scale,n=e.option,a=e.get("status"),o=e.get("value");o!=null&&(o=i.parse(o));var s=gc(e);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),n.value=o,s&&(n.status=t.axis.scale.isBlank()?"hide":"show")}}function Kf(r){var t=(r.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[ao(r)]}function ak(r){var t=Kf(r);return t&&t.axisPointerModel}function gc(r){return!!r.get(["handle","show"])}function ao(r){return r.type+"||"+r.id}var Lg={},Rb=(function(r){B(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,i,n,a){this.axisPointerClass&&nk(e),r.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(e,n,!0)},t.prototype.updateAxisPointer=function(e,i,n,a){this._doUpdateAxisPointerClass(e,n,!1)},t.prototype.remove=function(e,i){var n=this._axisPointer;n&&n.remove(i)},t.prototype.dispose=function(e,i){this._disposeAxisPointer(i),r.prototype.dispose.apply(this,arguments)},t.prototype._doUpdateAxisPointerClass=function(e,i,n){var a=t.getAxisPointerClass(this.axisPointerClass);if(a){var o=ak(e);o?(this._axisPointer||(this._axisPointer=new a)).render(e,o,i,n):this._disposeAxisPointer(i)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,i){Lg[e]=i},t.getAxisPointerClass=function(e){return e&&Lg[e]},t.type="axis",t})(Kt),mc=kt();function ok(r,t,e,i){var n=e.axis;if(!n.scale.isBlank()){var a=e.getModel("splitArea"),o=a.getModel("areaStyle"),s=o.get("color"),l=i.coordinateSystem.getRect(),u=n.getTicksCoords({tickModel:a,clamp:!0});if(u.length){var h=s.length,c=mc(r).splitAreaColors,f=nt(),d=0;if(c)for(var p=0;p<u.length;p++){var v=c.get(u[p].tickValue);if(v!=null){d=(v+(h-1)*p)%h;break}}var g=n.toGlobalCoord(u[0].coord),m=o.getAreaStyle();s=G(s)?s:[s];for(var p=1;p<u.length;p++){var _=n.toGlobalCoord(u[p].coord),b=void 0,x=void 0,C=void 0,S=void 0;n.isHorizontal()?(b=g,x=l.y,C=_-b,S=l.height,g=b+C):(b=l.x,x=g,C=l.width,S=_-x,g=x+S);var T=u[p-1].tickValue;T!=null&&f.set(T,d),t.add(new Nt({anid:T!=null?"area_"+T:null,shape:{x:b,y:x,width:C,height:S},style:lt({fill:s[d]},m),autoBatch:!0,silent:!0})),d=(d+1)%h}mc(r).splitAreaColors=f}}}function sk(r){mc(r).splitAreaColors=null}var lk=["axisLine","axisTickLabel","axisName"],uk=["splitArea","splitLine","minorSplitLine"],Lb=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.axisPointerClass="CartesianAxisPointer",e}return t.prototype.render=function(e,i,n,a){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ft,this.group.add(this._axisGroup),!!e.get("show")){var s=e.getCoordSysModel(),l=vc(s,e),u=new Yr(e,F({handleAutoShown:function(c){for(var f=s.coordinateSystem.getCartesians(),d=0;d<f.length;d++)if(hc(f[d].getOtherAxis(e.axis).scale))return!0;return!1}},l));A(lk,u.add,u),this._axisGroup.add(u.getGroup()),A(uk,function(c){e.get([c,"show"])&&hk[c](this,this._axisGroup,e,s)},this);var h=a&&a.type==="changeAxisOrder"&&a.isInitSort;h||C0(o,this._axisGroup,e),r.prototype.render.call(this,e,i,n,a)}},t.prototype.remove=function(){sk(this)},t.type="cartesianAxis",t})(Rb),hk={splitLine:function(r,t,e,i){var n=e.axis;if(!n.scale.isBlank()){var a=e.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color"),l=a.get("showMinLine")!==!1,u=a.get("showMaxLine")!==!1;s=G(s)?s:[s];for(var h=i.coordinateSystem.getRect(),c=n.isHorizontal(),f=0,d=n.getTicksCoords({tickModel:a}),p=[],v=[],g=o.getLineStyle(),m=0;m<d.length;m++){var _=n.toGlobalCoord(d[m].coord);if(!(m===0&&!l||m===d.length-1&&!u)){var b=d[m].tickValue;c?(p[0]=_,p[1]=h.y,v[0]=_,v[1]=h.y+h.height):(p[0]=h.x,p[1]=_,v[0]=h.x+h.width,v[1]=_);var x=f++%s.length,C=new Ye({anid:b!=null?"line_"+b:null,autoBatch:!0,shape:{x1:p[0],y1:p[1],x2:v[0],y2:v[1]},style:lt({stroke:s[x]},g),silent:!0});Ka(C.shape,g.lineWidth),t.add(C)}}}},minorSplitLine:function(r,t,e,i){var n=e.axis,a=e.getModel("minorSplitLine"),o=a.getModel("lineStyle"),s=i.coordinateSystem.getRect(),l=n.isHorizontal(),u=n.getMinorTicksCoords();if(u.length)for(var h=[],c=[],f=o.getLineStyle(),d=0;d<u.length;d++)for(var p=0;p<u[d].length;p++){var v=n.toGlobalCoord(u[d][p].coord);l?(h[0]=v,h[1]=s.y,c[0]=v,c[1]=s.y+s.height):(h[0]=s.x,h[1]=v,c[0]=s.x+s.width,c[1]=v);var g=new Ye({anid:"minor_line_"+u[d][p].tickValue,autoBatch:!0,shape:{x1:h[0],y1:h[1],x2:c[0],y2:c[1]},style:f,silent:!0});Ka(g.shape,f.lineWidth),t.add(g)}},splitArea:function(r,t,e,i){ok(r,t,e,i)}},Ob=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="xAxis",t})(Lb),ck=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=Ob.type,e}return t.type="yAxis",t})(Lb),fk=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="grid",e}return t.prototype.render=function(e,i){this.group.removeAll(),e.get("show")&&this.group.add(new Nt({shape:e.coordinateSystem.getRect(),style:lt({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t})(Kt),Og={offset:0};function dk(r){r.registerComponentView(fk),r.registerComponentModel(jP),r.registerCoordinateSystem("cartesian2d",$P),Sg(r,"x",dc,Og),Sg(r,"y",dc,Og),r.registerComponentView(Ob),r.registerComponentView(ck),r.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})}var Eg="\0_ec_interaction_mutex";function pk(r,t,e){var i=Eb(r);i[t]=e}function vk(r,t,e){var i=Eb(r),n=i[t];n===e&&(i[t]=null)}function Eb(r){return r[Eg]||(r[Eg]={})}qe({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Wt);var gk={axisPointer:1,tooltip:1,brush:1};function mk(r,t,e){var i=t.getComponentByElement(r.topTarget),n=i&&i.coordinateSystem;return i&&i!==e&&!gk.hasOwnProperty(i.mainType)&&n&&n.model!==e}function jb(r,t,e,i,n,a){r=r||0;var o=e[1]-e[0];if(n!=null&&(n=mn(n,[0,o])),a!=null&&(a=Math.max(a,n??0)),i==="all"){var s=Math.abs(t[1]-t[0]);s=mn(s,[0,o]),n=a=mn(s,[n,a]),i=0}t[0]=mn(t[0],e),t[1]=mn(t[1],e);var l=rh(t,i);t[i]+=r;var u=n||0,h=e.slice();l.sign<0?h[0]+=u:h[1]-=u,t[i]=mn(t[i],h);var c;return c=rh(t,i),n!=null&&(c.sign!==l.sign||c.span<n)&&(t[1-i]=t[i]+l.sign*n),c=rh(t,i),a!=null&&c.span>a&&(t[1-i]=t[i]+c.sign*a),t}function rh(r,t){var e=r[t]-r[1-t];return{span:Math.abs(e),sign:e>0?-1:e<0?1:t?-1:1}}function mn(r,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,r))}var $i=!0,oo=Math.min,Hn=Math.max,yk=Math.pow,_k=1e4,bk=6,xk=6,jg="globalPan",wk={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},Sk={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},Ng={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},Ck=0,Tk=(function(r){B(t,r);function t(e){var i=r.call(this)||this;return i._track=[],i._covers=[],i._handlers={},i._zr=e,i.group=new Ft,i._uid="brushController_"+Ck++,A(Rk,function(n,a){this._handlers[a]=ct(n,this)},i),i}return t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var i=this._zr;this._enableGlobalPan||pk(i,jg,this._uid),A(this._handlers,function(n,a){i.on(a,n)}),this._brushType=e.brushType,this._brushOption=st(it(Ng),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;vk(e,jg,this._uid),A(this._handlers,function(i,n){e.off(n,i)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var i=this._panels={};A(e,function(n){i[n.panelId]=it(n)})}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var i=this.group;return this._zr.add(i),i.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=i.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=H(e,function(f){return st(it(Ng),f,!0)});var i="\0-brush-index-",n=this._covers,a=this._covers=[],o=this,s=this._creatingCover;return new Hf(n,e,u,l).add(h).update(h).remove(c).execute(),this;function l(f,d){return(f.id!=null?f.id:i+d)+"-"+f.brushType}function u(f,d){return l(f.__brushOption,d)}function h(f,d){var p=e[f];if(d!=null&&n[d]===s)a[f]=n[d];else{var v=a[f]=d!=null?(n[d].__brushOption=p,n[d]):Fb(o,Nb(o,p));Jf(o,v)}}function c(f){n[f]!==s&&o.group.remove(n[f])}},t.prototype.unmount=function(){return this.enableBrush(!1),yc(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t})(hr);function Nb(r,t){var e=Bl[t.brushType].createCover(r,t);return e.__brushOption=t,zb(e,t),r.group.add(e),e}function Fb(r,t){var e=Qf(t);return e.endCreating&&(e.endCreating(r,t),zb(t,t.__brushOption)),t}function Bb(r,t){var e=t.__brushOption;Qf(t).updateCoverShape(r,t,e.range,e)}function zb(r,t){var e=t.z;e==null&&(e=_k),r.traverse(function(i){i.z=e,i.z2=e})}function Jf(r,t){Qf(t).updateCommon(r,t),Bb(r,t)}function Qf(r){return Bl[r.__brushOption.brushType]}function td(r,t,e){var i=r._panels;if(!i)return $i;var n,a=r._transform;return A(i,function(o){o.isTargetByCursor(t,e,a)&&(n=o)}),n}function Vb(r,t){var e=r._panels;if(!e)return $i;var i=t.__brushOption.panelId;return i!=null?e[i]:$i}function yc(r){var t=r._covers,e=t.length;return A(t,function(i){r.group.remove(i)},r),t.length=0,!!e}function Yi(r,t){var e=H(r._covers,function(i){var n=i.__brushOption,a=it(n.range);return{brushType:n.brushType,panelId:n.panelId,range:a}});r.trigger("brush",{areas:e,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function Ak(r){var t=r._track;if(!t.length)return!1;var e=t[t.length-1],i=t[0],n=e[0]-i[0],a=e[1]-i[1],o=yk(n*n+a*a,.5);return o>bk}function Hb(r){var t=r.length-1;return t<0&&(t=0),[r[0],r[t]]}function Wb(r,t,e,i){var n=new Ft;return n.add(new Nt({name:"main",style:ed(e),silent:!0,draggable:!0,cursor:"move",drift:Ct(Fg,r,t,n,["n","s","w","e"]),ondragend:Ct(Yi,t,{isEnd:!0})})),A(i,function(a){n.add(new Nt({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Ct(Fg,r,t,n,a),ondragend:Ct(Yi,t,{isEnd:!0})}))}),n}function Gb(r,t,e,i){var n=i.brushStyle.lineWidth||0,a=Hn(n,xk),o=e[0][0],s=e[1][0],l=o-n/2,u=s-n/2,h=e[0][1],c=e[1][1],f=h-a+n/2,d=c-a+n/2,p=h-o,v=c-s,g=p+n,m=v+n;vr(r,t,"main",o,s,p,v),i.transformable&&(vr(r,t,"w",l,u,a,m),vr(r,t,"e",f,u,a,m),vr(r,t,"n",l,u,g,a),vr(r,t,"s",l,d,g,a),vr(r,t,"nw",l,u,a,a),vr(r,t,"ne",f,u,a,a),vr(r,t,"sw",l,d,a,a),vr(r,t,"se",f,d,a,a))}function _c(r,t){var e=t.__brushOption,i=e.transformable,n=t.childAt(0);n.useStyle(ed(e)),n.attr({silent:!i,cursor:i?"move":"default"}),A([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?bc(r,a[0]):Mk(r,a);o&&o.attr({silent:!i,invisible:!i,cursor:i?Sk[s]+"-resize":null})})}function vr(r,t,e,i,n,a,o){var s=t.childOfName(e);s&&s.setShape(Pk(rd(r,t,[[i,n],[i+a,n+o]])))}function ed(r){return lt({strokeNoScale:!0},r.brushStyle)}function Ub(r,t,e,i){var n=[oo(r,e),oo(t,i)],a=[Hn(r,e),Hn(t,i)];return[[n[0],a[0]],[n[1],a[1]]]}function Ik(r){return wl(r.group)}function bc(r,t){var e={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},n=S0(e[t],Ik(r));return i[n]}function Mk(r,t){var e=[bc(r,t[0]),bc(r,t[1])];return(e[0]==="e"||e[0]==="w")&&e.reverse(),e.join("")}function Fg(r,t,e,i,n,a){var o=e.__brushOption,s=r.toRectRange(o.range),l=$b(t,n,a);A(i,function(u){var h=wk[u];s[h[0]][h[1]]+=l[h[0]]}),o.range=r.fromRectRange(Ub(s[0][0],s[1][0],s[0][1],s[1][1])),Jf(t,e),Yi(t,{isEnd:!1})}function Dk(r,t,e,i){var n=t.__brushOption.range,a=$b(r,e,i);A(n,function(o){o[0]+=a[0],o[1]+=a[1]}),Jf(r,t),Yi(r,{isEnd:!1})}function $b(r,t,e){var i=r.group,n=i.transformCoordToLocal(t,e),a=i.transformCoordToLocal(0,0);return[n[0]-a[0],n[1]-a[1]]}function rd(r,t,e){var i=Vb(r,t);return i&&i!==$i?i.clipPath(e,r._transform):it(e)}function Pk(r){var t=oo(r[0][0],r[1][0]),e=oo(r[0][1],r[1][1]),i=Hn(r[0][0],r[1][0]),n=Hn(r[0][1],r[1][1]);return{x:t,y:e,width:i-t,height:n-e}}function kk(r,t,e){if(!(!r._brushType||Lk(r,t.offsetX,t.offsetY))){var i=r._zr,n=r._covers,a=td(r,t,e);if(!r._dragging)for(var o=0;o<n.length;o++){var s=n[o].__brushOption;if(a&&(a===$i||s.panelId===a.panelId)&&Bl[s.brushType].contain(n[o],e[0],e[1]))return}a&&i.setCursorStyle("crosshair")}}function xc(r){var t=r.event;t.preventDefault&&t.preventDefault()}function wc(r,t,e){return r.childOfName("main").contain(t,e)}function Yb(r,t,e,i){var n=r._creatingCover,a=r._creatingPanel,o=r._brushOption,s;if(r._track.push(e.slice()),Ak(r)||n){if(a&&!n){o.brushMode==="single"&&yc(r);var l=it(o);l.brushType=Bg(l.brushType,a),l.panelId=a===$i?null:a.panelId,n=r._creatingCover=Nb(r,l),r._covers.push(n)}if(n){var u=Bl[Bg(r._brushType,a)],h=n.__brushOption;h.range=u.getCreatingRange(rd(r,n,r._track)),i&&(Fb(r,n),u.updateCommon(r,n)),Bb(r,n),s={isEnd:i}}}else i&&o.brushMode==="single"&&o.removeOnClick&&td(r,t,e)&&yc(r)&&(s={isEnd:i,removeOnClick:!0});return s}function Bg(r,t){return r==="auto"?t.defaultBrushType:r}var Rk={mousedown:function(r){if(this._dragging)zg(this,r);else if(!r.target||!r.target.draggable){xc(r);var t=this.group.transformCoordToLocal(r.offsetX,r.offsetY);this._creatingCover=null;var e=this._creatingPanel=td(this,r,t);e&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(r){var t=r.offsetX,e=r.offsetY,i=this.group.transformCoordToLocal(t,e);if(kk(this,r,i),this._dragging){xc(r);var n=Yb(this,r,i,!1);n&&Yi(this,n)}},mouseup:function(r){zg(this,r)}};function zg(r,t){if(r._dragging){xc(t);var e=t.offsetX,i=t.offsetY,n=r.group.transformCoordToLocal(e,i),a=Yb(r,t,n,!0);r._dragging=!1,r._track=[],r._creatingCover=null,a&&Yi(r,a)}}function Lk(r,t,e){var i=r._zr;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}var Bl={lineX:Vg(0),lineY:Vg(1),rect:{createCover:function(r,t){function e(i){return i}return Wb({toRectRange:e,fromRectRange:e},r,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(r){var t=Hb(r);return Ub(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(r,t,e,i){Gb(r,t,e,i)},updateCommon:_c,contain:wc},polygon:{createCover:function(r,t){var e=new Ft;return e.add(new xo({name:"main",style:ed(t),silent:!0})),e},getCreatingRange:function(r){return r},endCreating:function(r,t){t.remove(t.childAt(0)),t.add(new bo({name:"main",draggable:!0,drift:Ct(Dk,r,t),ondragend:Ct(Yi,r,{isEnd:!0})}))},updateCoverShape:function(r,t,e,i){t.childAt(0).setShape({points:rd(r,t,e)})},updateCommon:_c,contain:wc}};function Vg(r){return{createCover:function(t,e){return Wb({toRectRange:function(i){var n=[i,[0,100]];return r&&n.reverse(),n},fromRectRange:function(i){return i[r]}},t,e,[[["w"],["e"]],[["n"],["s"]]][r])},getCreatingRange:function(t){var e=Hb(t),i=oo(e[0][r],e[1][r]),n=Hn(e[0][r],e[1][r]);return[i,n]},updateCoverShape:function(t,e,i,n){var a,o=Vb(t,e);if(o!==$i&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(r);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-r]]}var l=[i,a];r&&l.reverse(),Gb(t,e,l,n)},updateCommon:_c,contain:wc}}function Ok(r){return r=id(r),function(t){return cf(t,r)}}function Ek(r,t){return r=id(r),function(e){var i=t??e,n=i?r.width:r.height,a=i?r.x:r.y;return[a,a+(n||0)]}}function jk(r,t,e){var i=id(r);return function(n,a){return i.contain(a[0],a[1])&&!mk(n,t,e)}}function id(r){return mt.create(r)}var Mi=kt(),Hg=it,ih=ct,Nk=(function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(t,e,i,n){var a=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,t,e,i);var h=u.graphicKey;h!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=h;var c=this._moveAnimation=this.determineAnimation(t,e);if(!s)s=this._group=new Ft,this.createPointerEl(s,u,t,e),this.createLabelEl(s,u,t,e),i.getZr().add(s);else{var f=Ct(Wg,e,c);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,e)}Ug(s,e,!0),this._renderHandle(a)}},r.prototype.remove=function(t){this.clear(t)},r.prototype.dispose=function(t){this.clear(t)},r.prototype.determineAnimation=function(t,e){var i=e.get("animation"),n=t.axis,a=n.type==="category",o=e.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=Kf(t).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},r.prototype.makeElOption=function(t,e,i,n,a){},r.prototype.createPointerEl=function(t,e,i,n){var a=e.pointer;if(a){var o=Mi(t).pointerEl=new uA[a.type](Hg(e.pointer));t.add(o)}},r.prototype.createLabelEl=function(t,e,i,n){if(e.label){var a=Mi(t).labelEl=new zt(Hg(e.label));t.add(a),Gg(a,n)}},r.prototype.updatePointerEl=function(t,e,i){var n=Mi(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},r.prototype.updateLabelEl=function(t,e,i,n){var a=Mi(t).labelEl;a&&(a.setStyle(e.label.style),i(a,{x:e.label.x,y:e.label.y}),Gg(a,n))},r.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=e.getModel("handle"),o=e.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=So(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){ny(u.event)},onmousedown:ih(this._onHandleDragMove,this,0,0),drift:ih(this._onHandleDragMove,this),ondragend:ih(this._onHandleDragEnd,this)}),i.add(n)),Ug(n,e,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");G(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,g_(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},r.prototype._moveHandleToValue=function(t,e){Wg(this._axisPointerModel,!e&&this._moveAnimation,this._handle,nh(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(nh(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(nh(n)),Mi(i).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var e=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),rc(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}},r})();function Wg(r,t,e,i){Xb(Mi(e).lastProp,i)||(Mi(e).lastProp=i,t?Jr(e,i,r):(e.stopAnimation(),e.attr(i)))}function Xb(r,t){if(q(r)&&q(t)){var e=!0;return A(t,function(i,n){e=e&&Xb(r[n],i)}),!!e}else return r===t}function Gg(r,t){r[t.get(["label","show"])?"show":"hide"]()}function nh(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function Ug(r,t,e){var i=t.get("z"),n=t.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=e)})}function Fk(r){var t=r.get("type"),e=r.getModel(t+"Style"),i;return t==="line"?(i=e.getLineStyle(),i.fill=null):t==="shadow"&&(i=e.getAreaStyle(),i.stroke=null),i}function Bk(r,t,e,i,n){var a=e.get("value"),o=Zb(a,t.axis,t.ecModel,e.get("seriesDataIndices"),{precision:e.get(["label","precision"]),formatter:e.get(["label","formatter"])}),s=e.getModel("label"),l=Ao(s.get("padding")||0),u=s.getFont(),h=ll(o,u),c=n.position,f=h.width+l[1]+l[3],d=h.height+l[0]+l[2],p=n.align;p==="right"&&(c[0]-=f),p==="center"&&(c[0]-=f/2);var v=n.verticalAlign;v==="bottom"&&(c[1]-=d),v==="middle"&&(c[1]-=d/2),zk(c,f,d,i);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=t.get(["axisLine","lineStyle","color"])),r.label={x:c[0],y:c[1],style:$e(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function zk(r,t,e,i){var n=i.getWidth(),a=i.getHeight();r[0]=Math.min(r[0]+t,n)-t,r[1]=Math.min(r[1]+e,a)-e,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function Zb(r,t,e,i,n){r=t.scale.parse(r);var a=t.scale.getLabel({value:r},{precision:n.precision}),o=n.formatter;if(o){var s={value:$f(t,{value:r}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};A(i,function(l){var u=e.getSeriesByIndex(l.seriesIndex),h=l.dataIndexInside,c=u&&u.getDataParams(h);c&&s.seriesData.push(c)}),$(o)?a=o.replace("{value}",a):tt(o)&&(a=o(s))}return a}function qb(r,t,e){var i=_r();return fo(i,i,e.rotation),jn(i,i,e.position),Sl([r.dataToCoord(t),(e.labelOffset||0)+(e.labelDirection||1)*(e.labelMargin||0)],i)}function Vk(r,t,e,i,n,a){var o=Yr.innerTextLayout(e.rotation,0,e.labelDirection);e.labelMargin=n.get(["label","margin"]),Bk(t,i,n,a,{position:qb(i.axis,r,e),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function Hk(r,t,e){return e=e||0,{x1:r[e],y1:r[1-e],x2:t[e],y2:t[1-e]}}function Wk(r,t,e){return e=e||0,{x:r[e],y:r[1-e],width:t[e],height:t[1-e]}}var Gk=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),h=$g(l,s).getOtherAxis(s).getGlobalExtent(),c=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var f=Fk(a),d=Uk[u](s,c,h);d.style=f,e.graphicKey=d.type,e.pointer=d}var p=vc(l.model,n);Vk(i,e,p,n,a,o)},t.prototype.getHandleTransform=function(e,i,n){var a=vc(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=qb(i.axis,e,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=$g(s,o).getOtherAxis(o).getGlobalExtent(),h=o.dim==="x"?0:1,c=[e.x,e.y];c[h]+=i[h],c[h]=Math.min(l[1],c[h]),c[h]=Math.max(l[0],c[h]);var f=(u[1]+u[0])/2,d=[f,f];d[h]=c[h];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:c[0],y:c[1],rotation:e.rotation,cursorPoint:d,tooltipOption:p[h]}},t})(Nk);function $g(r,t){var e={};return e[t.dim+"AxisIndex"]=t.index,r.getCartesian(e)}var Uk={line:function(r,t,e){var i=Hk([t,e[0]],[t,e[1]],Yg(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,t,e){var i=Math.max(1,r.getBandWidth()),n=e[1]-e[0];return{type:"Rect",shape:Wk([t-i/2,e[0]],[i,n],Yg(r))}}};function Yg(r){return r.dim==="x"?0:1}var $k=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t})(dt),yr=kt(),Yk=A;function Kb(r,t,e){if(!J.node){var i=t.getZr();yr(i).records||(yr(i).records={}),Xk(i,t);var n=yr(i).records[r]||(yr(i).records[r]={});n.handler=e}}function Xk(r,t){if(yr(r).initialized)return;yr(r).initialized=!0,e("click",Ct(Xg,"click")),e("mousemove",Ct(Xg,"mousemove")),e("globalout",qk);function e(i,n){r.on(i,function(a){var o=Kk(t);Yk(yr(r).records,function(s){s&&n(s,a,o.dispatchAction)}),Zk(o.pendings,t)})}}function Zk(r,t){var e=r.showTip.length,i=r.hideTip.length,n;e?n=r.showTip[e-1]:i&&(n=r.hideTip[i-1]),n&&(n.dispatchAction=null,t.dispatchAction(n))}function qk(r,t,e){r.handler("leave",null,e)}function Xg(r,t,e,i){t.handler(r,e,i)}function Kk(r){var t={showTip:[],hideTip:[]},e=function(i){var n=t[i.type];n?n.push(i):(i.dispatchAction=e,r.dispatchAction(i))};return{dispatchAction:e,pendings:t}}function Sc(r,t){if(!J.node){var e=t.getZr(),i=(yr(e).records||{})[r];i&&(yr(e).records[r]=null)}}var Jk=(function(r){B(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,i,n){var a=i.getComponent("tooltip"),o=e.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";Kb("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(e,i){Sc("axisPointer",i)},t.prototype.dispose=function(e,i){Sc("axisPointer",i)},t.type="axisPointer",t})(Kt);function Jb(r,t){var e=[],i=r.seriesIndex,n;if(i==null||!(n=t.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=Hi(a,r);if(o==null||o<0||G(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)e=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u),c=h.dim,f=u.dim,d=c==="x"||c==="radius"?1:0,p=a.mapDimension(f),v=[];v[d]=a.get(p,o),v[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),e=l.dataToPoint(v)||[]}else e=l.dataToPoint(a.getValues(H(l.dimensions,function(m){return a.mapDimension(m)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),e=[g.x+g.width/2,g.y+g.height/2]}return{point:e,el:s}}var Zg=kt();function Qk(r,t,e){var i=r.currTrigger,n=[r.x,r.y],a=r,o=r.dispatchAction||ct(e.dispatchAction,e),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){xs(n)&&(n=Jb({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=xs(n),u=a.axesInfo,h=s.axesInfo,c=i==="leave"||xs(n),f={},d={},p={list:[],map:{}},v={showPointer:Ct(eR,d),showTooltip:Ct(rR,p)};A(s.coordSysMap,function(m,_){var b=l||m.containPoint(n);A(s.coordSysAxesInfo[_],function(x,C){var S=x.axis,T=oR(u,x);if(!c&&b&&(!u||T)){var I=T&&T.value;I==null&&!l&&(I=S.pointToData(n)),I!=null&&qg(x,I,v,!1,f)}})});var g={};return A(h,function(m,_){var b=m.linkGroup;b&&!d[_]&&A(b.axesInfo,function(x,C){var S=d[C];if(x!==m&&S){var T=S.value;b.mapper&&(T=m.axis.scale.parse(b.mapper(T,Kg(x),Kg(m)))),g[m.key]=T}})}),A(g,function(m,_){qg(h[_],m,v,!0,f)}),iR(d,h,f),nR(p,n,r,o),aR(h,o,e),f}}function qg(r,t,e,i,n){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!r.involveSeries){e.showPointer(r,t);return}var o=tR(t,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&F(n,s[0]),!i&&r.snap&&a.containData(l)&&l!=null&&(t=l),e.showPointer(r,t,s),e.showTooltip(r,o,l)}}function tR(r,t){var e=t.axis,i=e.dim,n=r,a=[],o=Number.MAX_VALUE,s=-1;return A(t.seriesModels,function(l,u){var h=l.getData().mapDimensionsAll(i),c,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(h,r,e);f=d.dataIndices,c=d.nestestValue}else{if(f=l.getData().indicesOfNearest(h[0],r,e.type==="category"?.5:null),!f.length)return;c=l.getData().get(h[0],f[0])}if(!(c==null||!isFinite(c))){var p=r-c,v=Math.abs(p);v<=o&&((v<o||p>=0&&s<0)&&(o=v,s=p,n=c,a.length=0),A(f,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:n}}function eR(r,t,e,i){r[t.key]={value:e,payloadBatch:i}}function rR(r,t,e,i){var n=e.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!n.length)){var l=t.coordSys.model,u=ao(l),h=r.map[u];h||(h=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function iR(r,t,e){var i=e.axesInfo=[];A(t,function(n,a){var o=n.axisPointerModel.option,s=r[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function nR(r,t,e,i){if(xs(t)||!r.list.length){i({type:"hideTip"});return}var n=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:e.tooltipOption,position:e.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:r.list})}function aR(r,t,e){var i=e.getZr(),n="axisPointerLastHighlights",a=Zg(i)[n]||{},o=Zg(i)[n]={};A(r,function(u,h){var c=u.axisPointerModel.option;c.status==="show"&&u.triggerEmphasis&&A(c.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;o[d]=f})});var s=[],l=[];A(a,function(u,h){!o[h]&&l.push(u)}),A(o,function(u,h){!a[h]&&s.push(u)}),l.length&&e.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&e.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function oR(r,t){for(var e=0;e<(r||[]).length;e++){var i=r[e];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}function Kg(r){var t=r.axis.model,e={},i=e.axisDim=r.axis.dim;return e.axisIndex=e[i+"AxisIndex"]=t.componentIndex,e.axisName=e[i+"AxisName"]=t.name,e.axisId=e[i+"AxisId"]=t.id,e}function xs(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function Qb(r){Rb.registerAxisPointerClass("CartesianAxisPointer",Gk),r.registerComponentModel($k),r.registerComponentView(Jk),r.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!G(e)&&(t.axisPointer.link=[e])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=QP(t,e)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Qk)}function sR(r){Ui(dk),Ui(Qb)}var Jg=["x","y","radius","angle","single"],lR=["cartesian2d","polar","singleAxis"];function uR(r){var t=r.get("coordinateSystem");return pt(lR,t)>=0}function In(r){return r+"Axis"}function hR(r,t){var e=nt(),i=[],n=nt();r.eachComponent({mainType:"dataZoom",query:t},function(h){n.get(h.uid)||s(h)});var a;do a=!1,r.eachComponent("dataZoom",o);while(a);function o(h){!n.get(h.uid)&&l(h)&&(s(h),a=!0)}function s(h){n.set(h.uid,!0),i.push(h),u(h)}function l(h){var c=!1;return h.eachTargetAxis(function(f,d){var p=e.get(f);p&&p[d]&&(c=!0)}),c}function u(h){h.eachTargetAxis(function(c,f){(e.get(c)||e.set(c,[]))[f]=!0})}return i}var ah=(function(){function r(){this.indexList=[],this.indexMap=[]}return r.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},r})(),cR=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._autoThrottle=!0,e._noTarget=!0,e._rangePropMode=["percent","percent"],e}return t.prototype.init=function(e,i,n){var a=Qg(e);this.settledOption=a,this.mergeDefaultAndTheme(e,n),this._doInit(a)},t.prototype.mergeOption=function(e){var i=Qg(e);st(this.option,e,!0),st(this.settledOption,i,!0),this._doInit(i)},t.prototype._doInit=function(e){var i=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;A([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(i[a[0]]=n[a[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),i=this._targetAxisInfoMap=nt(),n=this._fillSpecifiedTargetAxis(i);n?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var i=!1;return A(Jg,function(n){var a=this.getReferringComponents(In(n),sC);if(a.specified){i=!0;var o=new ah;A(a.models,function(s){o.add(s.componentIndex)}),e.set(n,o)}},this),i},t.prototype._fillAutoTargetAxisByOrient=function(e,i){var n=this.ecModel,a=!0;if(a){var o=i==="vertical"?"y":"x",s=n.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=n.findComponents({mainType:"singleAxis",filter:function(h){return h.get("orient",!0)===i}});l(s,"single")}function l(u,h){var c=u[0];if(c){var f=new ah;if(f.add(c.componentIndex),e.set(h,f),a=!1,h==="x"||h==="y"){var d=c.getReferringComponents("grid",ee).models[0];d&&A(u,function(p){c.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",ee).models[0]&&f.add(p.componentIndex)})}}}a&&A(Jg,function(u){if(a){var h=n.findComponents({mainType:In(u),filter:function(f){return f.get("type",!0)==="category"}});if(h[0]){var c=new ah;c.add(h[0].componentIndex),e.set(u,c),a=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(i){!e&&(e=i)},this),e==="y"?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var i=this._rangePropMode,n=this.get("rangeMode");A([["start","startValue"],["end","endValue"]],function(a,o){var s=e[a[0]]!=null,l=e[a[1]]!=null;s&&!l?i[o]="percent":!s&&l?i[o]="value":n?i[o]=n[o]:s&&(i[o]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(i,n){e==null&&(e=this.ecModel.getComponent(In(i),n))},this),e},t.prototype.eachTargetAxis=function(e,i){this._targetAxisInfoMap.each(function(n,a){A(n.indexList,function(o){e.call(i,a,o)})})},t.prototype.getAxisProxy=function(e,i){var n=this.getAxisModel(e,i);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,i){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[i])return this.ecModel.getComponent(In(e),i)},t.prototype.setRawRange=function(e){var i=this.option,n=this.settledOption;A([["start","startValue"],["end","endValue"]],function(a){(e[a[0]]!=null||e[a[1]]!=null)&&(i[a[0]]=n[a[0]]=e[a[0]],i[a[1]]=n[a[1]]=e[a[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var i=this.option;A(["start","startValue","end","endValue"],function(n){i[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,i){if(e==null&&i==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(e,i).getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var i,n=this._targetAxisInfoMap.keys(),a=0;a<n.length;a++)for(var o=n[a],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var u=this.getAxisProxy(o,s.indexList[l]);if(u.hostedBy(this))return u;i||(i=u)}return i},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return this._orient},t.type="dataZoom",t.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],t.defaultOption={z:4,filterMode:"filter",start:0,end:100},t})(dt);function Qg(r){var t={};return A(["start","end","startValue","endValue","throttle"],function(e){r.hasOwnProperty(e)&&(t[e]=r[e])}),t}var fR=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="dataZoom.select",t})(cR),dR=(function(r){B(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,i,n,a){this.dataZoomModel=e,this.ecModel=i,this.api=n},t.type="dataZoom",t})(Kt),pR=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="dataZoom.select",t})(dR),wn=A,tm=Xc,vR=(function(){function r(t,e,i,n){this._dimName=t,this._axisIndex=e,this.ecModel=n,this._dataZoomModel=i}return r.prototype.hostedBy=function(t){return this._dataZoomModel===t},r.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},r.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},r.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries(function(e){if(uR(e)){var i=In(this._dimName),n=e.getReferringComponents(i,ee).models[0];n&&this._axisIndex===n.componentIndex&&t.push(e)}},this),t},r.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},r.prototype.getMinMaxSpan=function(){return it(this._minMaxSpan)},r.prototype.calculateDataWindow=function(t){var e=this._dataExtent,i=this.getAxisModel(),n=i.axis.scale,a=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],u;wn(["start","end"],function(f,d){var p=t[f],v=t[f+"Value"];a[d]==="percent"?(p==null&&(p=o[d]),v=n.parse(Er(p,o,e))):(u=!0,v=v==null?e[d]:n.parse(v),p=Er(v,e,o)),l[d]=v==null||isNaN(v)?e[d]:v,s[d]=p==null||isNaN(p)?o[d]:p}),tm(l),tm(s);var h=this._minMaxSpan;u?c(l,s,e,o,!1):c(s,l,o,e,!0);function c(f,d,p,v,g){var m=g?"Span":"ValueSpan";jb(0,f,p,"all",h["min"+m],h["max"+m]);for(var _=0;_<2;_++)d[_]=Er(f[_],p,v,!0),g&&(d[_]=n.parse(d[_]))}return{valueWindow:l,percentWindow:s}},r.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=gR(this,this._dimName,e),this._updateMinMaxSpan();var i=this.calculateDataWindow(t.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,this._setAxisModel()}},r.prototype.filterData=function(t,e){if(t!==this._dataZoomModel)return;var i=this._dimName,n=this.getTargetSeriesModels(),a=t.get("filterMode"),o=this._valueWindow;if(a==="none")return;wn(n,function(l){var u=l.getData(),h=u.mapDimensionsAll(i);if(h.length){if(a==="weakFilter"){var c=u.getStore(),f=H(h,function(d){return u.getDimensionIndex(d)},u);u.filterSelf(function(d){for(var p,v,g,m=0;m<h.length;m++){var _=c.get(f[m],d),b=!isNaN(_),x=_<o[0],C=_>o[1];if(b&&!x&&!C)return!0;b&&(g=!0),x&&(p=!0),C&&(v=!0)}return g&&p&&v})}else wn(h,function(d){if(a==="empty")l.setData(u=u.map(d,function(v){return s(v)?v:NaN}));else{var p={};p[d]=o,u.selectRange(p)}});wn(h,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},r.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,i=this._dataExtent;wn(["min","max"],function(n){var a=e.get(n+"Span"),o=e.get(n+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=Er(i[0]+o,i,[0,100],!0):a!=null&&(o=Er(a,[0,100],i,!0)-i[0]),t[n+"Span"]=a,t[n+"ValueSpan"]=o},this)},r.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,i=this._valueWindow;if(e){var n=Zc(i,[0,500]);n=Math.min(n,20);var a=t.axis.scale.rawExtentInfo;e[0]!==0&&a.setDeterminedMinMax("min",+i[0].toFixed(n)),e[1]!==100&&a.setDeterminedMinMax("max",+i[1].toFixed(n)),a.freeze()}},r})();function gR(r,t,e){var i=[1/0,-1/0];wn(e,function(o){M2(i,o.getData(),t)});var n=r.getAxisModel(),a=hb(n.axis.scale,n,i).calculate();return[a.min,a.max]}var mR={getTargetSeries:function(r){function t(n){r.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=r.getComponent(In(o),s);n(o,s,l,a)})})}t(function(n,a,o,s){o.__dzAxisProxy=null});var e=[];t(function(n,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new vR(n,a,s,r),e.push(o.__dzAxisProxy))});var i=nt();return A(e,function(n){A(n.getTargetSeriesModels(),function(a){i.set(a.uid,a)})}),i},overallReset:function(r,t){r.eachComponent("dataZoom",function(e){e.eachTargetAxis(function(i,n){e.getAxisProxy(i,n).reset(e)}),e.eachTargetAxis(function(i,n){e.getAxisProxy(i,n).filterData(e,t)})}),r.eachComponent("dataZoom",function(e){var i=e.findRepresentativeAxisProxy();if(i){var n=i.getDataPercentWindow(),a=i.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:a[0],endValue:a[1]})}})}};function yR(r){r.registerAction("dataZoom",function(t,e){var i=hR(e,t);A(i,function(n){n.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var em=!1;function _R(r){em||(em=!0,r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,mR),yR(r),r.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function bR(r){r.registerComponentModel(fR),r.registerComponentView(pR),_R(r)}var He=(function(){function r(){}return r})(),tx={};function va(r,t){tx[r]=t}function ex(r){return tx[r]}var xR=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.optionUpdated=function(){r.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;A(this.option.feature,function(i,n){var a=ex(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(e)),st(i,a.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t})(dt);function wR(r,t,e){var i=t.getBoxLayoutParams(),n=t.get("padding"),a={width:e.getWidth(),height:e.getHeight()},o=qi(i,a,n);jA(t.get("orient"),r,t.get("itemGap"),o.width,o.height),NA(r,i,a,n)}function SR(r,t){var e=Ao(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),r=new Nt({shape:{x:r.x-e[3],y:r.y-e[0],width:r.width+e[1]+e[3],height:r.height+e[0]+e[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1}),r}var CR=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,i,n,a){var o=this.group;if(o.removeAll(),!e.get("show"))return;var s=+e.get("itemSize"),l=e.get("orient")==="vertical",u=e.get("feature")||{},h=this._features||(this._features={}),c=[];A(u,function(p,v){c.push(v)}),new Hf(this._featureNames||[],c).add(f).update(f).remove(Ct(f,null)).execute(),this._featureNames=c;function f(p,v){var g=c[p],m=c[v],_=u[g],b=new Tt(_,e,e.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===g&&(_.title=a.newTitle),g&&!m){if(TR(g))x={onclick:b.option.onclick,featureName:g};else{var C=ex(g);if(!C)return;x=new C}h[g]=x}else if(x=h[m],!x)return;x.uid=Co("toolbox-feature"),x.model=b,x.ecModel=i,x.api=n;var S=x instanceof He;if(!g&&m){S&&x.dispose&&x.dispose(i,n);return}if(!b.get("show")||S&&x.unusable){S&&x.remove&&x.remove(i,n);return}d(b,x,g),b.setIconStatus=function(T,I){var M=this.option,D=this.iconPaths;M.iconStatus=M.iconStatus||{},M.iconStatus[T]=I,D[T]&&(I==="emphasis"?Nn:Fn)(D[T])},x instanceof He&&x.render&&x.render(b,i,n,a)}function d(p,v,g){var m=p.getModel("iconStyle"),_=p.getModel(["emphasis","iconStyle"]),b=v instanceof He&&v.getIcons?v.getIcons():p.get("icon"),x=p.get("title")||{},C,S;$(b)?(C={},C[g]=b):C=b,$(x)?(S={},S[g]=x):S=x;var T=p.iconPaths={};A(C,function(I,M){var D=So(I,{},{x:-s/2,y:-s/2,width:s,height:s});D.setStyle(m.getItemStyle());var P=D.ensureState("emphasis");P.style=_.getItemStyle();var k=new zt({style:{text:S[M],align:_.get("textAlign"),borderRadius:_.get("textBorderRadius"),padding:_.get("textPadding"),fill:null,font:M0({fontStyle:_.get("textFontStyle"),fontFamily:_.get("textFontFamily"),fontSize:_.get("textFontSize"),fontWeight:_.get("textFontWeight")},i)},ignore:!0});D.setTextContent(k),Cl({el:D,componentModel:e,itemName:M,formatterParamsExtra:{title:S[M]}}),D.__title=S[M],D.on("mouseover",function(){var R=_.getItemStyle(),L=l?e.get("right")==null&&e.get("left")!=="right"?"right":"left":e.get("bottom")==null&&e.get("top")!=="bottom"?"bottom":"top";k.setStyle({fill:_.get("textFill")||R.fill||R.stroke||"#000",backgroundColor:_.get("textBackgroundColor")}),D.setTextConfig({position:_.get("textPosition")||L}),k.ignore=!e.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){p.get(["iconStatus",M])!=="emphasis"&&n.leaveEmphasis(this),k.hide()}),(p.get(["iconStatus",M])==="emphasis"?Nn:Fn)(D),o.add(D),D.on("click",ct(v.onclick,v,i,n,M)),T[M]=D})}wR(o,e,n),o.add(SR(o.getBoundingRect(),e)),l||o.eachChild(function(p){var v=p.__title,g=p.ensureState("emphasis"),m=g.textConfig||(g.textConfig={}),_=p.getTextContent(),b=_&&_.ensureState("emphasis");if(b&&!tt(b)&&v){var x=b.style||(b.style={}),C=ll(v,zt.makeFont(x)),S=p.x+o.x,T=p.y+o.y+s,I=!1;T+C.height>n.getHeight()&&(m.position="top",I=!0);var M=I?-5-C.height:s+10;S+C.width/2>n.getWidth()?(m.position=["100%",M],x.align="right"):S-C.width/2<0&&(m.position=[0,M],x.align="left")}})},t.prototype.updateView=function(e,i,n,a){A(this._features,function(o){o instanceof He&&o.updateView&&o.updateView(o.model,i,n,a)})},t.prototype.remove=function(e,i){A(this._features,function(n){n instanceof He&&n.remove&&n.remove(e,i)}),this.group.removeAll()},t.prototype.dispose=function(e,i){A(this._features,function(n){n instanceof He&&n.dispose&&n.dispose(e,i)})},t.type="toolbox",t})(Kt);function TR(r){return r.indexOf("my")===0}var AR=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.onclick=function(e,i){var n=this.model,a=n.get("name")||e.get("title.0.text")||"echarts",o=i.getZr().painter.getType()==="svg",s=o?"svg":n.get("type",!0)||"png",l=i.getConnectedDataURL({type:s,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),u=J.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var h=document.createElement("a");h.download=a+"."+s,h.target="_blank",h.href=l;var c=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});h.dispatchEvent(c)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,p=o?decodeURIComponent(f[1]):f[1];d&&(p=window.atob(p));var v=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var g=p.length,m=new Uint8Array(g);g--;)m[g]=p.charCodeAt(g);var _=new Blob([m]);window.navigator.msSaveOrOpenBlob(_,v)}else{var b=document.createElement("iframe");document.body.appendChild(b);var x=b.contentWindow,C=x.document;C.open("image/svg+xml","replace"),C.write(p),C.close(),x.focus(),C.execCommand("SaveAs",!0,v),document.body.removeChild(b)}}else{var S=n.get("lang"),T='<body style="margin:0;"><img src="'+l+'" style="max-width:100%;" title="'+(S&&S[0]||"")+'" /></body>',I=window.open();I.document.write(T),I.document.title=a}},t.getDefaultOption=function(e){var i={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return i},t})(He),rm="__ec_magicType_stack__",IR=[["line","bar"],["stack"]],MR=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getIcons=function(){var e=this.model,i=e.get("icon"),n={};return A(e.get("type"),function(a){i[a]&&(n[a]=i[a])}),n},t.getDefaultOption=function(e){var i={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return i},t.prototype.onclick=function(e,i,n){var a=this.model,o=a.get(["seriesIndex",n]);if(im[n]){var s={series:[]},l=function(c){var f=c.subType,d=c.id,p=im[n](f,d,c,a);p&&(lt(p,c.option),s.series.push(p));var v=c.coordinateSystem;if(v&&v.type==="cartesian2d"&&(n==="line"||n==="bar")){var g=v.getAxesByScale("ordinal")[0];if(g){var m=g.dim,_=m+"Axis",b=c.getReferringComponents(_,ee).models[0],x=b.componentIndex;s[_]=s[_]||[];for(var C=0;C<=x;C++)s[_][x]=s[_][x]||{};s[_][x].boundaryGap=n==="bar"}}};A(IR,function(c){pt(c,n)>=0&&A(c,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,h=n;n==="stack"&&(u=st({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",n])!=="emphasis"&&(h="tiled")),i.dispatchAction({type:"changeMagicType",currentType:h,newOption:s,newTitle:u,featureName:"magicType"})}},t})(He),im={line:function(r,t,e,i){if(r==="bar")return st({id:t,type:"line",data:e.get("data"),stack:e.get("stack"),markPoint:e.get("markPoint"),markLine:e.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(r,t,e,i){if(r==="line")return st({id:t,type:"bar",data:e.get("data"),stack:e.get("stack"),markPoint:e.get("markPoint"),markLine:e.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(r,t,e,i){var n=e.get("stack")===rm;if(r==="line"||r==="bar")return i.setIconStatus("stack",n?"normal":"emphasis"),st({id:t,stack:n?"":rm},i.get(["option","stack"])||{},!0)}};qe({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(r,t){t.mergeOption(r.newOption)});var zl=new Array(60).join("-"),Wn=" ";function DR(r){var t={},e=[],i=[];return r.eachRawSeries(function(n){var a=n.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;t[s]||(t[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),t[s].series.push(n)}else e.push(n)}else e.push(n)}),{seriesGroupByCategoryAxis:t,other:e,meta:i}}function PR(r){var t=[];return A(r,function(e,i){var n=e.categoryAxis,a=e.valueAxis,o=a.dim,s=[" "].concat(H(e.series,function(d){return d.name})),l=[n.model.getCategories()];A(e.series,function(d){var p=d.getRawData();l.push(d.getRawData().mapArray(p.mapDimension(o),function(v){return v}))});for(var u=[s.join(Wn)],h=0;h<l[0].length;h++){for(var c=[],f=0;f<l.length;f++)c.push(l[f][h]);u.push(c.join(Wn))}t.push(u.join(`
|
|
38
|
+
`))}),t.join(`
|
|
39
|
+
|
|
40
|
+
`+zl+`
|
|
41
|
+
|
|
42
|
+
`)}function kR(r){return H(r,function(t){var e=t.getRawData(),i=[t.name],n=[];return e.each(e.dimensions,function(){for(var a=arguments.length,o=arguments[a-1],s=e.getName(o),l=0;l<a-1;l++)n[l]=arguments[l];i.push((s?s+Wn:"")+n.join(Wn))}),i.join(`
|
|
43
|
+
`)}).join(`
|
|
44
|
+
|
|
45
|
+
`+zl+`
|
|
46
|
+
|
|
47
|
+
`)}function RR(r){var t=DR(r);return{value:Dt([PR(t.seriesGroupByCategoryAxis),kR(t.other)],function(e){return!!e.replace(/[\n\t\s]/g,"")}).join(`
|
|
48
|
+
|
|
49
|
+
`+zl+`
|
|
50
|
+
|
|
51
|
+
`),meta:t.meta}}function Zs(r){return r.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function LR(r){var t=r.slice(0,r.indexOf(`
|
|
52
|
+
`));if(t.indexOf(Wn)>=0)return!0}var Cc=new RegExp("["+Wn+"]+","g");function OR(r){for(var t=r.split(/\n+/g),e=Zs(t.shift()).split(Cc),i=[],n=H(e,function(l){return{name:l,data:[]}}),a=0;a<t.length;a++){var o=Zs(t[a]).split(Cc);i.push(o.shift());for(var s=0;s<o.length;s++)n[s]&&(n[s].data[a]=o[s])}return{series:n,categories:i}}function ER(r){for(var t=r.split(/\n+/g),e=Zs(t.shift()),i=[],n=0;n<t.length;n++){var a=Zs(t[n]);if(a){var o=a.split(Cc),s="",l=void 0,u=!1;isNaN(o[0])?(u=!0,s=o[0],o=o.slice(1),i[n]={name:s,value:[]},l=i[n].value):l=i[n]=[];for(var h=0;h<o.length;h++)l.push(+o[h]);l.length===1&&(u?i[n].value=l[0]:i[n]=l[0])}}return{name:e,data:i}}function jR(r,t){var e=r.split(new RegExp(`
|
|
53
|
+
*`+zl+`
|
|
54
|
+
*`,"g")),i={series:[]};return A(e,function(n,a){if(LR(n)){var o=OR(n),s=t[a],l=s.axisDim+"Axis";s&&(i[l]=i[l]||[],i[l][s.axisIndex]={data:o.categories},i.series=i.series.concat(o.series))}else{var o=ER(n);i.series.push(o)}}),i}var NR=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.onclick=function(e,i){setTimeout(function(){i.dispatchAction({type:"hideTip"})});var n=i.getDom(),a=this.model;this._dom&&n.removeChild(this._dom);var o=document.createElement("div");o.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",o.style.backgroundColor=a.get("backgroundColor")||"#fff";var s=document.createElement("h4"),l=a.get("lang")||[];s.innerHTML=l[0]||a.get("title"),s.style.cssText="margin:10px 20px",s.style.color=a.get("textColor");var u=document.createElement("div"),h=document.createElement("textarea");u.style.cssText="overflow:auto";var c=a.get("optionToContent"),f=a.get("contentToOption"),d=RR(e);if(tt(c)){var p=c(i.getOption());$(p)?u.innerHTML=p:zi(p)&&u.appendChild(p)}else{h.readOnly=a.get("readOnly");var v=h.style;v.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",v.color=a.get("textColor"),v.borderColor=a.get("textareaBorderColor"),v.backgroundColor=a.get("textareaColor"),h.value=d.value,u.appendChild(h)}var g=d.meta,m=document.createElement("div");m.style.cssText="position:absolute;bottom:5px;left:0;right:0";var _="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",b=document.createElement("div"),x=document.createElement("div");_+=";background-color:"+a.get("buttonColor"),_+=";color:"+a.get("buttonTextColor");var C=this;function S(){n.removeChild(o),C._dom=null}Sh(b,"click",S),Sh(x,"click",function(){if(f==null&&c!=null||f!=null&&c==null){S();return}var T;try{tt(f)?T=f(u,i.getOption()):T=jR(h.value,g)}catch(I){throw S(),new Error("Data view format error "+I)}T&&i.dispatchAction({type:"changeDataView",newOption:T}),S()}),b.innerHTML=l[1],x.innerHTML=l[2],x.style.cssText=b.style.cssText=_,!a.get("readOnly")&&m.appendChild(x),m.appendChild(b),o.appendChild(s),o.appendChild(u),o.appendChild(m),u.style.height=n.clientHeight-80+"px",n.appendChild(o),this._dom=o},t.prototype.remove=function(e,i){this._dom&&i.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,i){this.remove(e,i)},t.getDefaultOption=function(e){var i={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:e.getLocaleModel().get(["toolbox","dataView","title"]),lang:e.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"};return i},t})(He);function FR(r,t){return H(r,function(e,i){var n=t&&t[i];if(q(n)&&!G(n)){var a=q(e)&&!G(e);a||(e={value:e});var o=n.name!=null&&e.name==null;return e=lt(e,n),o&&delete e.name,e}else return e})}qe({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(r,t){var e=[];A(r.newOption.series,function(i){var n=t.getSeriesByName(i.name)[0];if(!n)e.push(F({type:"scatter"},i));else{var a=n.get("data");e.push({name:i.name,data:FR(i.data,a)})}}),t.mergeOption(lt({series:e},r.newOption))});var rx=A,ix=kt();function BR(r,t){var e=nd(r);rx(t,function(i,n){for(var a=e.length-1;a>=0;a--){var o=e[a];if(o[n])break}if(a<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(s){var l=s.getPercentRange();e[0][n]={dataZoomId:n,start:l[0],end:l[1]}}}}),e.push(t)}function zR(r){var t=nd(r),e=t[t.length-1];t.length>1&&t.pop();var i={};return rx(e,function(n,a){for(var o=t.length-1;o>=0;o--)if(n=t[o][a],n){i[a]=n;break}}),i}function VR(r){ix(r).snapshots=null}function HR(r){return nd(r).length}function nd(r){var t=ix(r);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var WR=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.onclick=function(e,i){VR(e),i.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){var i={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])};return i},t})(He);qe({type:"restore",event:"restore",update:"prepareAndUpdate"},function(r,t){t.resetOption("recreate")});var GR=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],nx=(function(){function r(t,e,i){var n=this;this._targetInfoList=[];var a=nm(e,t);A(UR,function(o,s){(!i||!i.include||pt(i.include,s)>=0)&&o(a,n._targetInfoList)})}return r.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(i,n,a){if((i.coordRanges||(i.coordRanges=[])).push(n),!i.coordRange){i.coordRange=n;var o=oh[i.brushType](0,a,n);i.__rangeOffset={offset:lm[i.brushType](o.values,i.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},r.prototype.matchOutputRanges=function(t,e,i){A(t,function(n){var a=this.findTargetInfo(n,e);a&&a!==!0&&A(a.coordSyses,function(o){var s=oh[n.brushType](1,o,n.range,!0);i(n,s.values,o,e)})},this)},r.prototype.setInputRanges=function(t,e){A(t,function(i){var n=this.findTargetInfo(i,e);if(i.range=i.range||[],n&&n!==!0){i.panelId=n.panelId;var a=oh[i.brushType](0,n.coordSys,i.coordRange),o=i.__rangeOffset;i.range=o?lm[i.brushType](a.values,o.offset,$R(a.xyMinMax,o.xyMinMax)):a.values}},this)},r.prototype.makePanelOpts=function(t,e){return H(this._targetInfoList,function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:e?e(i):null,clipPath:Ok(n),isTargetByCursor:jk(n,t,i.coordSysModel),getLinearBrushOtherExtent:Ek(n)}})},r.prototype.controlSeries=function(t,e,i){var n=this.findTargetInfo(t,i);return n===!0||n&&pt(n.coordSyses,e.coordinateSystem)>=0},r.prototype.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=nm(e,t),a=0;a<i.length;a++){var o=i[a],s=t.panelId;if(s){if(o.panelId===s)return o}else for(var l=0;l<am.length;l++)if(am[l](n,o))return o}return!0},r})();function Tc(r){return r[0]>r[1]&&r.reverse(),r}function nm(r,t){return Da(r,t,{includeMainTypes:GR})}var UR={grid:function(r,t){var e=r.xAxisModels,i=r.yAxisModels,n=r.gridModels,a=nt(),o={},s={};!e&&!i&&!n||(A(e,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),A(i,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),A(n,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,h=[];A(u.getCartesians(),function(c,f){(pt(e,c.getAxis("x").model)>=0||pt(i,c.getAxis("y").model)>=0)&&h.push(c)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:h[0],coordSyses:h,getPanelRect:om.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(r,t){A(r.geoModels,function(e){var i=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:i,coordSyses:[i],getPanelRect:om.geo})})}},am=[function(r,t){var e=r.xAxisModel,i=r.yAxisModel,n=r.gridModel;return!n&&e&&(n=e.axis.grid.model),!n&&i&&(n=i.axis.grid.model),n&&n===t.gridModel},function(r,t){var e=r.geoModel;return e&&e===t.geoModel}],om={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var r=this.coordSys,t=r.getBoundingRect().clone();return t.applyTransform(wl(r)),t}},oh={lineX:Ct(sm,0),lineY:Ct(sm,1),rect:function(r,t,e,i){var n=r?t.pointToData([e[0][0],e[1][0]],i):t.dataToPoint([e[0][0],e[1][0]],i),a=r?t.pointToData([e[0][1],e[1][1]],i):t.dataToPoint([e[0][1],e[1][1]],i),o=[Tc([n[0],a[0]]),Tc([n[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(r,t,e,i){var n=[[1/0,-1/0],[1/0,-1/0]],a=H(e,function(o){var s=r?t.pointToData(o,i):t.dataToPoint(o,i);return n[0][0]=Math.min(n[0][0],s[0]),n[1][0]=Math.min(n[1][0],s[1]),n[0][1]=Math.max(n[0][1],s[0]),n[1][1]=Math.max(n[1][1],s[1]),s});return{values:a,xyMinMax:n}}};function sm(r,t,e,i){var n=e.getAxis(["x","y"][r]),a=Tc(H([0,1],function(s){return t?n.coordToData(n.toLocalCoord(i[s]),!0):n.toGlobalCoord(n.dataToCoord(i[s]))})),o=[];return o[r]=a,o[1-r]=[NaN,NaN],{values:a,xyMinMax:o}}var lm={lineX:Ct(um,0),lineY:Ct(um,1),rect:function(r,t,e){return[[r[0][0]-e[0]*t[0][0],r[0][1]-e[0]*t[0][1]],[r[1][0]-e[1]*t[1][0],r[1][1]-e[1]*t[1][1]]]},polygon:function(r,t,e){return H(r,function(i,n){return[i[0]-e[0]*t[n][0],i[1]-e[1]*t[n][1]]})}};function um(r,t,e,i){return[t[0]-i[r]*e[0],t[1]-i[r]*e[1]]}function $R(r,t){var e=hm(r),i=hm(t),n=[e[0]/i[0],e[1]/i[1]];return isNaN(n[0])&&(n[0]=1),isNaN(n[1])&&(n[1]=1),n}function hm(r){return r?[r[0][1]-r[0][0],r[1][1]-r[1][0]]:[NaN,NaN]}var Ac=A,YR=iC("toolbox-dataZoom_"),XR=(function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,i,n,a){this._brushController||(this._brushController=new Tk(n.getZr()),this._brushController.on("brush",ct(this._onBrush,this)).mount()),KR(e,i,this,a,n),qR(e,i)},t.prototype.onclick=function(e,i,n){ZR[n].call(this)},t.prototype.remove=function(e,i){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,i){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var i=e.areas;if(!e.isEnd||!i.length)return;var n={},a=this.ecModel;this._brushController.updateCovers([]);var o=new nx(ad(this.model),a,{include:["grid"]});o.matchOutputRanges(i,a,function(u,h,c){if(c.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",c,h[0]),s("y",c,h[1])):s({lineX:"x",lineY:"y"}[f],c,h)}}),BR(a,n),this._dispatchZoomAction(n);function s(u,h,c){var f=h.getAxis(u),d=f.model,p=l(u,d,a),v=p.findRepresentativeAxisProxy(d).getMinMaxSpan();(v.minValueSpan!=null||v.maxValueSpan!=null)&&(c=jb(0,c.slice(),f.scale.getExtent(),0,v.minValueSpan,v.maxValueSpan)),p&&(n[p.id]={dataZoomId:p.id,startValue:c[0],endValue:c[1]})}function l(u,h,c){var f;return c.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var p=d.getAxisModel(u,h.componentIndex);p&&(f=d)}),f}},t.prototype._dispatchZoomAction=function(e){var i=[];Ac(e,function(n,a){i.push(it(n))}),i.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:i})},t.getDefaultOption=function(e){var i={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return i},t})(He),ZR={zoom:function(){var r=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:r})},back:function(){this._dispatchZoomAction(zR(this.ecModel))}};function ad(r){var t={xAxisIndex:r.get("xAxisIndex",!0),yAxisIndex:r.get("yAxisIndex",!0),xAxisId:r.get("xAxisId",!0),yAxisId:r.get("yAxisId",!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex="all"),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex="all"),t}function qR(r,t){r.setIconStatus("back",HR(t)>1?"emphasis":"normal")}function KR(r,t,e,i,n){var a=e._isZoomActive;i&&i.type==="takeGlobalCursor"&&(a=i.key==="dataZoomSelect"?i.dataZoomSelectActive:!1),e._isZoomActive=a,r.setIconStatus("zoom",a?"emphasis":"normal");var o=new nx(ad(r),t,{include:["grid"]}),s=o.makePanelOpts(n,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});e._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}:!1)}$A("dataZoom",function(r){var t=r.getComponent("toolbox",0),e=["feature","dataZoom"];if(!t||t.get(e)==null)return;var i=t.getModel(e),n=[],a=ad(i),o=Da(r,a);Ac(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),Ac(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,h){var c=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:YR+u+c};f[h]=c,n.push(f)}return n});function JR(r){r.registerComponentModel(xR),r.registerComponentView(CR),va("saveAsImage",AR),va("magicType",MR),va("dataView",NR),va("dataZoom",XR),va("restore",WR),Ui(bR)}var QR=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t})(dt);function ax(r){var t=r.get("confine");return t!=null?!!t:r.get("renderMode")==="richText"}function ox(r){if(J.domSupported){for(var t=document.documentElement.style,e=0,i=r.length;e<i;e++)if(r[e]in t)return r[e]}}var sx=ox(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),tL=ox(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function lx(r,t){if(!r)return t;t=xf(t,!0);var e=r.indexOf(t);return r=e===-1?t:"-"+r.slice(0,e)+"-"+t,r.toLowerCase()}function eL(r,t){var e=r.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(r);return e?e[t]:null}var rL=lx(tL,"transition"),od=lx(sx,"transform"),iL="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(J.transform3dSupported?"will-change:transform;":"");function nL(r){return r=r==="left"?"right":r==="right"?"left":r==="top"?"bottom":"top",r}function aL(r,t,e){if(!$(e)||e==="inside")return"";var i=r.get("backgroundColor"),n=r.get("borderWidth");t=Wi(t);var a=nL(e),o=Math.max(Math.round(n)*1.5,6),s="",l=od+":",u;pt(["left","right"],a)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var h=u*Math.PI/180,c=o+n,f=c*Math.abs(Math.cos(h))+c*Math.abs(Math.sin(h)),d=Math.round(((f-Math.SQRT2*n)/2+Math.SQRT2*n-(f-c)/2)*100)/100;s+=";"+a+":-"+d+"px";var p=t+" solid "+n+"px;",v=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+i+";"];return'<div style="'+v.join("")+'"></div>'}function oL(r,t){var e="cubic-bezier(0.23,1,0.32,1)",i=" "+r/2+"s "+e,n="opacity"+i+",visibility"+i;return t||(i=" "+r+"s "+e,n+=J.transformSupported?","+od+i:",left"+i+",top"+i),rL+":"+n}function cm(r,t,e){var i=r.toFixed(0)+"px",n=t.toFixed(0)+"px";if(!J.transformSupported)return e?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=J.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return e?"top:0;left:0;"+od+":"+o+";":[["top",0],["left",0],[sx,o]]}function sL(r){var t=[],e=r.get("fontSize"),i=r.getTextColor();i&&t.push("color:"+i),t.push("font:"+r.getFont());var n=Q(r.get("lineHeight"),Math.round(e*3/2));e&&t.push("line-height:"+n+"px");var a=r.get("textShadowColor"),o=r.get("textShadowBlur")||0,s=r.get("textShadowOffsetX")||0,l=r.get("textShadowOffsetY")||0;return a&&o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),A(["decoration","align"],function(u){var h=r.get(u);h&&t.push("text-"+u+":"+h)}),t.join(";")}function lL(r,t,e){var i=[],n=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),h=r.getModel("textStyle"),c=d_(r,"html"),f=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+f),t&&n&&i.push(oL(n,e)),a&&i.push("background-color:"+a),A(["width","color","radius"],function(d){var p="border-"+d,v=xf(p),g=r.get(v);g!=null&&i.push(p+":"+g+(d==="color"?"":"px"))}),i.push(sL(h)),c!=null&&i.push("padding:"+Ao(c).join("px ")+"px"),i.join(";")+";"}function fm(r,t,e,i,n){var a=t&&t.painter;if(e){var o=a&&a.getViewportRoot();o&&x1(r,o,e,i,n)}else{r[0]=i,r[1]=n;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/t.getWidth(),r[3]=r[1]/t.getHeight()}var uL=(function(){function r(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,J.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=t.getZr(),a=e.appendTo,o=a&&($(a)?document.querySelector(a):zi(a)?a:tt(a)&&a(t.getDom()));fm(this._styleCoord,n,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(i),this._api=t,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,h=n.painter.getViewportRoot();Te(h,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),i=eL(e,"position"),n=e.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=t.get("className")||""},r.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=iL+lL(t,!this._firstShow,this._longHide)+cm(a[0],a[1],!0)+("border-color:"+Wi(e)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(t,e,i,n,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if($(a)&&i.get("trigger")==="item"&&!ax(i)&&(s=aL(i,n,a)),$(t))o.innerHTML=t+s;else if(t){o.innerHTML="",G(t)||(t=[t]);for(var l=0;l<t.length;l++)zi(t[l])&&t[l].parentNode!==o&&o.appendChild(t[l]);if(s&&o.childNodes.length){var u=document.createElement("div");u.innerHTML=s,o.appendChild(u)}}},r.prototype.setEnterable=function(t){this._enterable=t},r.prototype.getSize=function(){var t=this.el;return t?[t.offsetWidth,t.offsetHeight]:[0,0]},r.prototype.moveTo=function(t,e){if(this.el){var i=this._styleCoord;if(fm(i,this._zr,this._container,t,e),i[0]!=null&&i[1]!=null){var n=this.el.style,a=cm(i[0],i[1]);A(a,function(o){n[o[0]]=o[1]})}}},r.prototype._moveIfResized=function(){var t=this._styleCoord[2],e=this._styleCoord[3];this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},r.prototype.hide=function(){var t=this,e=this.el.style;e.visibility="hidden",e.opacity="0",J.transform3dSupported&&(e.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return t._longHide=!0},500)},r.prototype.hideLater=function(t){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(ct(this.hide,this),t)):this.hide())},r.prototype.isShow=function(){return this._show},r.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var t=this.el.parentNode;t&&t.removeChild(this.el),this.el=this._container=null},r})(),hL=(function(){function r(t){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=t.getZr(),pm(this._styleCoord,this._zr,t.getWidth()/2,t.getHeight()/2)}return r.prototype.update=function(t){var e=t.get("alwaysShowContent");e&&this._moveIfResized(),this._alwaysShowContent=e},r.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},r.prototype.setContent=function(t,e,i,n,a){var o=this;q(t)&&ce(""),this.el&&this._zr.remove(this.el);var s=i.getModel("textStyle");this.el=new zt({style:{rich:e.richTextStyles,text:t,lineHeight:22,borderWidth:1,borderColor:n,textShadowColor:s.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:d_(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),A(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(u){o.el.style[u]=i.get(u)}),A(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(u){o.el.style[u]=s.get(u)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},r.prototype.setEnterable=function(t){this._enterable=t},r.prototype.getSize=function(){var t=this.el,e=this.el.getBoundingRect(),i=dm(t.style);return[e.width+i.left+i.right,e.height+i.top+i.bottom]},r.prototype.moveTo=function(t,e){var i=this.el;if(i){var n=this._styleCoord;pm(n,this._zr,t,e),t=n[0],e=n[1];var a=i.style,o=Or(a.borderWidth||0),s=dm(a);i.x=t+o+s.left,i.y=e+o+s.top,i.markRedraw()}},r.prototype._moveIfResized=function(){var t=this._styleCoord[2],e=this._styleCoord[3];this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},r.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},r.prototype.hideLater=function(t){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(ct(this.hide,this),t)):this.hide())},r.prototype.isShow=function(){return this._show},r.prototype.dispose=function(){this._zr.remove(this.el)},r})();function Or(r){return Math.max(0,r)}function dm(r){var t=Or(r.shadowBlur||0),e=Or(r.shadowOffsetX||0),i=Or(r.shadowOffsetY||0);return{left:Or(t-e),right:Or(t+e),top:Or(t-i),bottom:Or(t+i)}}function pm(r,t,e,i){r[0]=e,r[1]=i,r[2]=r[0]/t.getWidth(),r[3]=r[1]/t.getHeight()}var cL=new Nt({shape:{x:-1,y:-1,width:2,height:2}}),fL=(function(r){B(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,i){if(!(J.node||!i.getDom())){var n=e.getComponent("tooltip"),a=this._renderMode=uC(n.get("renderMode"));this._tooltipContent=a==="richText"?new hL(i):new uL(i,{appendTo:n.get("appendToBody",!0)?"body":n.get("appendTo",!0)})}},t.prototype.render=function(e,i,n){if(!(J.node||!n.getDom())){this.group.removeAll(),this._tooltipModel=e,this._ecModel=i,this._api=n;var a=this._tooltipContent;a.update(e),a.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&e.get("transitionDuration")?g_(this,"_updatePosition",50,"fixRate"):rc(this,"_updatePosition")}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel,i=e.get("triggerOn");Kb("itemTooltip",this._api,ct(function(n,a,o){i!=="none"&&(i.indexOf(n)>=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,i=this._ecModel,n=this._api,a=e.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(e,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,i,n,a){if(!(a.from===this.uid||J.node||!n.getDom())){var o=vm(a,n);this._ticket="";var s=a.dataByCoordSys,l=gL(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var h=cL;h.x=a.x,h.y=a.y,h.update(),_t(h).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:h},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(e,i,n,a))return;var c=Jb(a,i),f=c.point[0],d=c.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:c.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(e,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(vm(a,n))},t.prototype._manuallyAxisShowTip=function(e,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var h=u.getData(),c=ga([h.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(c.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(e,i){var n=e.target,a=this._tooltipModel;if(a){this._lastX=e.offsetX,this._lastY=e.offsetY;var o=e.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,e);else if(n){var s=_t(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Sa(n,function(h){if(_t(h).dataIndex!=null)return l=h,!0;if(_t(h).tooltipConfig!=null)return u=h,!0},!0),l?this._showSeriesItemTooltip(e,l,i):u?this._showComponentItemTooltip(e,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},t.prototype._showOrMove=function(e,i){var n=e.get("showDelay");i=ct(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},t.prototype._showAxisTooltip=function(e,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=ga([i.tooltipOption],a),l=this._renderMode,u=[],h=zn("section",{blocks:[],noHeader:!0}),c=[],f=new ju;A(e,function(_){A(_.dataByAxis,function(b){var x=n.getComponent(b.axisDim+"Axis",b.axisIndex),C=b.value;if(!(!x||C==null)){var S=Zb(C,x.axis,n,b.seriesDataIndices,b.valueLabelOpt),T=zn("section",{header:S,noHeader:!We(S),sortBlocks:!0,blocks:[]});h.blocks.push(T),A(b.seriesDataIndices,function(I){var M=n.getSeriesByIndex(I.seriesIndex),D=I.dataIndexInside,P=M.getDataParams(D);if(!(P.dataIndex<0)){P.axisDim=b.axisDim,P.axisIndex=b.axisIndex,P.axisType=b.axisType,P.axisId=b.axisId,P.axisValue=$f(x.axis,{value:C}),P.axisValueLabel=S,P.marker=f.makeTooltipMarker("item",Wi(P.color),l);var k=dv(M.formatTooltip(D,!0,null)),R=k.frag;if(R){var L=ga([M],a).get("valueFormatter");T.blocks.push(L?F({valueFormatter:L},R):R)}k.text&&c.push(k.text),u.push(P)}})}})}),h.blocks.reverse(),c.reverse();var d=i.position,p=s.get("order"),v=yv(h,f,l,p,n.get("useUTC"),s.get("textStyle"));v&&c.unshift(v);var g=l==="richText"?`
|
|
55
|
+
|
|
56
|
+
`:"<br/>",m=c.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(e,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],d,null,f)})},t.prototype._showSeriesItemTooltip=function(e,i,n){var a=this._ecModel,o=_t(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,h=o.dataIndex,c=o.dataType,f=u.getData(c),d=this._renderMode,p=e.positionDefault,v=ga([f.getItemModel(h),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=v.get("trigger");if(!(g!=null&&g!=="item")){var m=u.getDataParams(h,c),_=new ju;m.marker=_.makeTooltipMarker("item",Wi(m.color),d);var b=dv(u.formatTooltip(h,!1,c)),x=v.get("order"),C=v.get("valueFormatter"),S=b.frag,T=S?yv(C?F({valueFormatter:C},S):S,_,d,x,a.get("useUTC"),v.get("textStyle")):b.text,I="item_"+u.name+"_"+h;this._showOrMove(v,function(){this._showTooltipContent(v,T,m,I,e.offsetX,e.offsetY,e.position,e.target,_)}),n({type:"showTip",dataIndexInside:h,dataIndex:f.getRawIndex(h),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,i,n){var a=this._renderMode==="html",o=_t(i),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if($(l)){var h=l;l={content:h,formatter:h},u=!0}u&&a&&l.content&&(l=it(l),l.content=qt(l.content));var c=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&c.push(f),c.push({formatter:l.content});var d=e.positionDefault,p=ga(c,this._tooltipModel,d?{position:d}:null),v=p.get("content"),g=Math.random()+"",m=new ju;this._showOrMove(p,function(){var _=it(p.get("formatterParams")||{});this._showTooltipContent(p,v,_,g,e.offsetX,e.offsetY,e.position,i,m)}),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,i,n,a,o,s,l,u,h){if(this._ticket="",!(!e.get("showContent")||!e.get("show"))){var c=this._tooltipContent;c.setEnterable(e.get("enterable"));var f=e.get("formatter");l=l||e.get("position");var d=i,p=this._getNearestPoint([o,s],n,e.get("trigger"),e.get("borderColor")),v=p.color;if(f)if($(f)){var g=e.ecModel.get("useUTC"),m=G(n)?n[0]:n,_=m&&m.axisType&&m.axisType.indexOf("time")>=0;d=f,_&&(d=To(m.axisValue,d,g)),d=wf(d,n,!0)}else if(tt(f)){var b=ct(function(x,C){x===this._ticket&&(c.setContent(C,h,e,v,l),this._updatePosition(e,l,o,s,c,n,u))},this);this._ticket=a,d=f(n,a,b)}else d=f;c.setContent(d,h,e,v,l),c.show(e,v),this._updatePosition(e,l,o,s,c,n,u)}},t.prototype._getNearestPoint=function(e,i,n,a){if(n==="axis"||G(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!G(i))return{color:a||i.color||i.borderColor}},t.prototype._updatePosition=function(e,i,n,a,o,s,l){var u=this._api.getWidth(),h=this._api.getHeight();i=i||e.get("position");var c=o.getSize(),f=e.get("align"),d=e.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),tt(i)&&(i=i([n,a],s,o.el,p,{viewSize:[u,h],contentSize:c.slice()})),G(i))n=te(i[0],u),a=te(i[1],h);else if(q(i)){var v=i;v.width=c[0],v.height=c[1];var g=qi(v,{width:u,height:h});n=g.x,a=g.y,f=null,d=null}else if($(i)&&l){var m=vL(i,p,c,e.get("borderWidth"));n=m[0],a=m[1]}else{var m=dL(n,a,o,u,h,f?null:20,d?null:20);n=m[0],a=m[1]}if(f&&(n-=gm(f)?c[0]/2:f==="right"?c[0]:0),d&&(a-=gm(d)?c[1]/2:d==="bottom"?c[1]:0),ax(e)){var m=pL(n,a,o,u,h);n=m[0],a=m[1]}o.moveTo(n,a)},t.prototype._updateContentNotChangedOnAxis=function(e,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===e.length;return o&&A(n,function(s,l){var u=s.dataByAxis||[],h=e[l]||{},c=h.dataByAxis||[];o=o&&u.length===c.length,o&&A(u,function(f,d){var p=c[d]||{},v=f.seriesDataIndices||[],g=p.seriesDataIndices||[];o=o&&f.value===p.value&&f.axisType===p.axisType&&f.axisId===p.axisId&&v.length===g.length,o&&A(v,function(m,_){var b=g[_];o=o&&m.seriesIndex===b.seriesIndex&&m.dataIndex===b.dataIndex}),a&&A(f.seriesDataIndices,function(m){var _=m.seriesIndex,b=i[_],x=a[_];b&&x&&x.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=i,!!o},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,i){J.node||!i.getDom()||(rc(this,"_updatePosition"),this._tooltipContent.dispose(),Sc("itemTooltip",i))},t.type="tooltip",t})(Kt);function ga(r,t,e){var i=t.ecModel,n;e?(n=new Tt(e,i,i),n=new Tt(t.option,n,i)):n=t;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof Tt&&(o=o.get("tooltip",!0)),$(o)&&(o={formatter:o}),o&&(n=new Tt(o,n,i)))}return n}function vm(r,t){return r.dispatchAction||ct(t.dispatchAction,t)}function dL(r,t,e,i,n,a,o){var s=e.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>i?r-=l+a:r+=a),o!=null&&(t+u+o>n?t-=u+o:t+=o),[r,t]}function pL(r,t,e,i,n){var a=e.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,i)-o,t=Math.min(t+s,n)-s,r=Math.max(r,0),t=Math.max(t,0),[r,t]}function vL(r,t,e,i){var n=e[0],a=e[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=t.width,h=t.height;switch(r){case"inside":s=t.x+u/2-n/2,l=t.y+h/2-a/2;break;case"top":s=t.x+u/2-n/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-n/2,l=t.y+h+o;break;case"left":s=t.x-n-o,l=t.y+h/2-a/2;break;case"right":s=t.x+u+o,l=t.y+h/2-a/2}return[s,l]}function gm(r){return r==="center"||r==="middle"}function gL(r,t,e){var i=Jc(r).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=go(t,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=e.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var h=_t(u).tooltipConfig;if(h&&h.name===r.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}function mL(r){Ui(Qb),r.registerComponentModel(QR),r.registerComponentView(fL),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Wt),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Wt)}var yL=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.layoutMode={type:"box",ignoreSize:!0},e}return t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t})(dt),_L=(function(r){B(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,i,n){if(this.group.removeAll(),!!e.get("show")){var a=this.group,o=e.getModel("textStyle"),s=e.getModel("subtextStyle"),l=e.get("textAlign"),u=Q(e.get("textBaseline"),e.get("textVerticalAlign")),h=new zt({style:$e(o,{text:e.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),c=h.getBoundingRect(),f=e.get("subtext"),d=new zt({style:$e(s,{text:f,fill:s.getTextColor(),y:c.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=e.get("link"),v=e.get("sublink"),g=e.get("triggerEvent",!0);h.silent=!p&&!g,d.silent=!v&&!g,p&&h.on("click",function(){Zp(p,"_"+e.get("target"))}),v&&d.on("click",function(){Zp(v,"_"+e.get("subtarget"))}),_t(h).eventData=_t(d).eventData=g?{componentType:"title",componentIndex:e.componentIndex}:null,a.add(h),f&&a.add(d);var m=a.getBoundingRect(),_=e.getBoxLayoutParams();_.width=m.width,_.height=m.height;var b=qi(_,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));l||(l=e.get("left")||e.get("right"),l==="middle"&&(l="center"),l==="right"?b.x+=b.width:l==="center"&&(b.x+=b.width/2)),u||(u=e.get("top")||e.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?b.y+=b.height:u==="middle"&&(b.y+=b.height/2),u=u||"top"),a.x=b.x,a.y=b.y,a.markRedraw();var x={align:l,verticalAlign:u};h.setStyle(x),d.setStyle(x),m=a.getBoundingRect();var C=b.margin,S=e.getItemStyle(["color","opacity"]);S.fill=e.get("backgroundColor");var T=new Nt({shape:{x:m.x-C[3],y:m.y-C[0],width:m.width+C[1]+C[3],height:m.height+C[0]+C[2],r:e.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});a.add(T)}},t.type="title",t})(Kt);function bL(r){r.registerComponentModel(yL),r.registerComponentView(_L)}var mm=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.layoutMode="box",e}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(e){r.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){e==null&&(e=this.option.currentIndex);var i=this._data.count();this.option.loop?e=(e%i+i)%i:(e>=i&&(e=i-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e=this.option,i=e.data||[],n=e.axisType,a=this._names=[],o;n==="category"?(o=[],A(i,function(u,h){var c=Ue(Un(u),""),f;q(u)?(f=it(u),f.value=h):f=h,o.push(f),a.push(c)})):o=i;var s={category:"ordinal",time:"time",value:"number"}[n]||"number",l=this._data=new Wf([{name:"value",type:s}],this);l.initData(o,a)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t})(dt),ux=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="timeline.slider",t.defaultOption=wA(mm.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t})(mm);be(ux,n_.prototype);var xL=(function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="timeline",t})(Kt),wL=(function(r){B(t,r);function t(e,i,n,a){var o=r.call(this,e,i,n)||this;return o.type=a||"value",o}return t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},t})(Xf),sh=Math.PI,ym=kt(),SL=(function(r){B(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,i){this.api=i},t.prototype.render=function(e,i,n){if(this.model=e,this.api=n,this.ecModel=i,this.group.removeAll(),e.get("show",!0)){var a=this._layout(e,n),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,e);e.formatTooltip=function(u){var h=l.scale.getLabel({value:u});return zn("nameValue",{noName:!0,value:h})},A(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,e)},this),this._renderAxisLabel(a,s,l,e),this._position(a,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,i){var n=e.get(["label","position"]),a=e.get("orient"),o=TL(e,i),s;n==null||n==="auto"?s=a==="horizontal"?o.y+o.height/2<i.getHeight()/2?"-":"+":o.x+o.width/2<i.getWidth()/2?"+":"-":$(n)?s={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[a][n]:s=n;var l={horizontal:"center",vertical:s>=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:sh/2},c=a==="vertical"?o.height:o.width,f=e.getModel("controlStyle"),d=f.get("show",!0),p=d?f.get("itemSize"):0,v=d?f.get("itemGap"):0,g=p+v,m=e.get(["label","rotate"])||0;m=m*sh/180;var _,b,x,C=f.get("position",!0),S=d&&f.get("showPlayBtn",!0),T=d&&f.get("showPrevBtn",!0),I=d&&f.get("showNextBtn",!0),M=0,D=c;C==="left"||C==="bottom"?(S&&(_=[0,0],M+=g),T&&(b=[M,0],M+=g),I&&(x=[D-p,0],D-=g)):(S&&(_=[D-p,0],D-=g),T&&(b=[0,0],M+=g),I&&(x=[D-p,0],D-=g));var P=[M,D];return e.get("inverse")&&P.reverse(),{viewRect:o,mainLength:c,orient:a,rotation:h[a],labelRotation:m,labelPosOpt:s,labelAlign:e.get(["label","align"])||l[a],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||u[a],playPosition:_,prevBtnPosition:b,nextBtnPosition:x,axisExtent:P,controlSize:p,controlGap:v}},t.prototype._position=function(e,i){var n=this._mainGroup,a=this._labelGroup,o=e.viewRect;if(e.orient==="vertical"){var s=_r(),l=o.x,u=o.y+o.height;jn(s,s,[-l,-u]),fo(s,s,-sh/2),jn(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var h=_(o),c=_(n.getBoundingRect()),f=_(a.getBoundingRect()),d=[n.x,n.y],p=[a.x,a.y];p[0]=d[0]=h[0][0];var v=e.labelPosOpt;if(v==null||$(v)){var g=v==="+"?0:1;b(d,c,h,1,g),b(p,f,h,1,1-g)}else{var g=v>=0?0:1;b(d,c,h,1,g),p[1]=d[1]+v}n.setPosition(d),a.setPosition(p),n.rotation=a.rotation=e.rotation,m(n),m(a);function m(x){x.originX=h[0][0]-x.x,x.originY=h[1][0]-x.y}function _(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function b(x,C,S,T,I){x[T]+=S[T][I]-C[T][I]}},t.prototype._createAxis=function(e,i){var n=i.getData(),a=i.get("axisType"),o=CL(i,a);o.getTicks=function(){return n.mapArray(["value"],function(u){return{value:u}})};var s=n.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new wL("value",o,e.axisExtent,a);return l.model=i,l},t.prototype._createGroup=function(e){var i=this[e]=new Ft;return this.group.add(i),i},t.prototype._renderAxisLine=function(e,i,n,a){var o=n.getExtent();if(a.get(["lineStyle","show"])){var s=new Ye({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:F({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});i.add(s);var l=this._progressLine=new Ye({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:lt({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});i.add(l)}},t.prototype._renderAxisTick=function(e,i,n,a){var o=this,s=a.getData(),l=n.scale.getTicks();this._tickSymbols=[],A(l,function(u){var h=n.dataToCoord(u.value),c=s.getItemModel(u.value),f=c.getModel("itemStyle"),d=c.getModel(["emphasis","itemStyle"]),p=c.getModel(["progress","itemStyle"]),v={x:h,y:0,onclick:ct(o._changeTimeline,o,u.value)},g=_m(c,f,i,v);g.ensureState("emphasis").style=d.getItemStyle(),g.ensureState("progress").style=p.getItemStyle(),Ra(g);var m=_t(g);c.get("tooltip")?(m.dataIndex=u.value,m.dataModel=a):m.dataIndex=m.dataModel=null,o._tickSymbols.push(g)})},t.prototype._renderAxisLabel=function(e,i,n,a){var o=this,s=n.getLabelModel();if(s.get("show")){var l=a.getData(),u=n.getViewLabels();this._tickLabels=[],A(u,function(h){var c=h.tickValue,f=l.getItemModel(c),d=f.getModel("label"),p=f.getModel(["emphasis","label"]),v=f.getModel(["progress","label"]),g=n.dataToCoord(h.tickValue),m=new zt({x:g,y:0,rotation:e.labelRotation-e.rotation,onclick:ct(o._changeTimeline,o,c),silent:!1,style:$e(d,{text:h.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});m.ensureState("emphasis").style=$e(p),m.ensureState("progress").style=$e(v),i.add(m),Ra(m),ym(m).dataIndex=c,o._tickLabels.push(m)})}},t.prototype._renderControl=function(e,i,n,a){var o=e.controlSize,s=e.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),h=a.getPlayState(),c=a.get("inverse",!0);f(e.nextBtnPosition,"next",ct(this._changeTimeline,this,c?"-":"+")),f(e.prevBtnPosition,"prev",ct(this._changeTimeline,this,c?"+":"-")),f(e.playPosition,h?"stop":"play",ct(this._handlePlayClick,this,!h),!0);function f(d,p,v,g){if(d){var m=qr(Q(a.get(["controlStyle",p+"BtnSize"]),o),o),_=[0,-m/2,m,m],b=AL(a,p+"Icon",_,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:g?-s:0,rectHover:!0,style:l,onclick:v});b.ensureState("emphasis").style=u,i.add(b),Ra(b)}}},t.prototype._renderCurrentPointer=function(e,i,n,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,h={onCreate:function(c){c.draggable=!0,c.drift=ct(u._handlePointerDrag,u),c.ondragend=ct(u._handlePointerDragend,u),bm(c,u._progressLine,s,n,a,!0)},onUpdate:function(c){bm(c,u._progressLine,s,n,a)}};this._currentPointer=_m(l,l,this._mainGroup,{},this._currentPointer,h)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,i,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,i){var n=this._toAxisCoord(e)[0],a=this._axis,o=Xc(a.getExtent().slice());n>o[1]&&(n=o[1]),n<o[0]&&(n=o[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var s=this._progressLine;s&&(s.shape.x2=n,s.dirty());var l=this._findNearestTick(n),u=this.model;(i||l!==u.getCurrentIndex()&&u.get("realtime"))&&this._changeTimeline(l)},t.prototype._doPlayStop=function(){var e=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(function(){var i=e.model;e._changeTimeline(i.getCurrentIndex()+(i.get("rewind",!0)?-1:1))},this.model.get("playInterval")))},t.prototype._toAxisCoord=function(e){var i=this._mainGroup.getLocalTransform();return Sl(e,i,!0)},t.prototype._findNearestTick=function(e){var i=this.model.getData(),n=1/0,a,o=this._axis;return i.each(["value"],function(s,l){var u=o.dataToCoord(s),h=Math.abs(u-e);h<n&&(n=h,a=l)}),a},t.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},t.prototype._changeTimeline=function(e){var i=this.model.getCurrentIndex();e==="+"?e=i+1:e==="-"&&(e=i-1),this.api.dispatchAction({type:"timelineChange",currentIndex:e,from:this.uid})},t.prototype._updateTicksStatus=function(){var e=this.model.getCurrentIndex(),i=this._tickSymbols,n=this._tickLabels;if(i)for(var a=0;a<i.length;a++)i&&i[a]&&i[a].toggleState("progress",a<e);if(n)for(var a=0;a<n.length;a++)n&&n[a]&&n[a].toggleState("progress",ym(n[a]).dataIndex<=e)},t.type="timeline.slider",t})(xL);function CL(r,t){if(t=t||r.get("type"),t)switch(t){case"category":return new Fl({ordinalMeta:r.getCategories(),extent:[1/0,-1/0]});case"time":return new Gf({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new Ki}}function TL(r,t){return qi(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},r.get("padding"))}function AL(r,t,e,i){var n=i.style,a=So(r.get(["controlStyle",t]),i||{},new mt(e[0],e[1],e[2],e[3]));return n&&a.setStyle(n),a}function _m(r,t,e,i,n,a){var o=t.get("color");if(n)n.setColor(o),e.add(n),a&&a.onUpdate(n);else{var s=r.get("symbol");n=Gi(s,-1,-1,2,2,o),n.setStyle("strokeNoScale",!0),e.add(n),a&&a.onCreate(n)}var l=t.getItemStyle(["color"]);n.setStyle(l),i=st({rectHover:!0,z2:100},i,!0);var u=C_(r.get("symbolSize"));i.scaleX=u[0]/2,i.scaleY=u[1]/2;var h=kf(r.get("symbolOffset"),u);h&&(i.x=(i.x||0)+h[0],i.y=(i.y||0)+h[1]);var c=r.get("symbolRotate");return i.rotation=(c||0)*Math.PI/180||0,n.attr(i),n.updateTransform(),n}function bm(r,t,e,i,n,a){if(!r.dragging){var o=n.getModel("checkpointStyle"),s=i.dataToCoord(n.getData().get("value",e));if(a||!o.get("animation",!0))r.attr({x:s,y:0}),t&&t.attr({shape:{x2:s}});else{var l={duration:o.get("animationDuration",!0),easing:o.get("animationEasing",!0)};r.stopAnimation(null,!0),r.animateTo({x:s,y:0},l),t&&t.animateTo({shape:{x2:s}},l)}}}function IL(r){r.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e,i){var n=e.getComponent("timeline");return n&&t.currentIndex!=null&&(n.setCurrentIndex(t.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.getPlayState()&&(n.setPlayState(!1),i.dispatchAction({type:"timelinePlayChange",playState:!1,from:t.from}))),e.resetOption("timeline",{replaceMerge:n.get("replaceMerge",!0)}),lt({currentIndex:n.option.currentIndex},t)}),r.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&t.playState!=null&&i.setPlayState(t.playState)})}function ML(r){var t=r&&r.timeline;G(t)||(t=t?[t]:[]),A(t,function(e){e&&DL(e)})}function DL(r){var t=r.type,e={number:"value",time:"time"};if(e[t]&&(r.axisType=e[t],delete r.type),xm(r),Di(r,"controlPosition")){var i=r.controlStyle||(r.controlStyle={});Di(i,"position")||(i.position=r.controlPosition),i.position==="none"&&!Di(i,"show")&&(i.show=!1,delete i.position),delete r.controlPosition}A(r.data||[],function(n){q(n)&&!G(n)&&(!Di(n,"value")&&Di(n,"name")&&(n.value=n.name),xm(n))})}function xm(r){var t=r.itemStyle||(r.itemStyle={}),e=t.emphasis||(t.emphasis={}),i=r.label||r.label||{},n=i.normal||(i.normal={}),a={normal:1,emphasis:1};A(i,function(o,s){!a[s]&&!Di(n,s)&&(n[s]=o)}),e.label&&!Di(i,"emphasis")&&(i.emphasis=e.label,delete e.label)}function Di(r,t){return r.hasOwnProperty(t)}function PL(r){r.registerComponentModel(ux),r.registerComponentView(SL),r.registerSubTypeDefaulter("timeline",function(){return"slider"}),IL(r),r.registerPreprocessor(ML)}var lh=Math.sin,uh=Math.cos,hx=Math.PI,Ti=Math.PI*2,kL=180/hx,cx=(function(){function r(){}return r.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},r.prototype.moveTo=function(t,e){this._add("M",t,e)},r.prototype.lineTo=function(t,e){this._add("L",t,e)},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){this._add("C",t,e,i,n,a,o)},r.prototype.quadraticCurveTo=function(t,e,i,n){this._add("Q",t,e,i,n)},r.prototype.arc=function(t,e,i,n,a,o){this.ellipse(t,e,i,i,0,n,a,o)},r.prototype.ellipse=function(t,e,i,n,a,o,s,l){var u=s-o,h=!l,c=Math.abs(u),f=zr(c-Ti)||(h?u>=Ti:-u>=Ti),d=u>0?u%Ti:u%Ti+Ti,p=!1;f?p=!0:zr(c)?p=!1:p=d>=hx==!!h;var v=t+i*uh(o),g=e+n*lh(o);this._start&&this._add("M",v,g);var m=Math.round(a*kL);if(f){var _=1/this._p,b=(h?1:-1)*(Ti-_);this._add("A",i,n,m,1,+h,t+i*uh(o+b),e+n*lh(o+b)),_>.01&&this._add("A",i,n,m,0,+h,v,g)}else{var x=t+i*uh(s),C=e+n*lh(s);this._add("A",i,n,m,+p,+h,x,C)}},r.prototype.rect=function(t,e,i,n){this._add("M",t,e),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(t,e,i,n,a,o,s,l,u){for(var h=[],c=this._p,f=1;f<arguments.length;f++){var d=arguments[f];if(isNaN(d)){this._invalid=!0;return}h.push(Math.round(d*c)/c)}this._d.push(t+h.join(" ")),this._start=t==="Z"},r.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},r.prototype.getStr=function(){return this._str},r})(),sd="none",RL=Math.round;function LL(r){var t=r.fill;return t!=null&&t!==sd}function OL(r){var t=r.stroke;return t!=null&&t!==sd}var Ic=["lineCap","miterLimit","lineJoin"],EL=H(Ic,function(r){return"stroke-"+r.toLowerCase()});function jL(r,t,e,i){var n=t.opacity==null?1:t.opacity;if(e instanceof Ze){r("opacity",n);return}if(LL(t)){var a=Ga(t.fill);r("fill",a.color);var o=t.fillOpacity!=null?t.fillOpacity*a.opacity*n:a.opacity*n;o<1&&r("fill-opacity",o)}else r("fill",sd);if(OL(t)){var s=Ga(t.stroke);r("stroke",s.color);var l=t.strokeNoScale?e.getLineScale():1,u=l?(t.lineWidth||0)/l:0,h=t.strokeOpacity!=null?t.strokeOpacity*s.opacity*n:s.opacity*n,c=t.strokeFirst;if(u!==1&&r("stroke-width",u),c&&r("paint-order",c?"stroke":"fill"),h<1&&r("stroke-opacity",h),t.lineDash){var f=Rf(e),d=f[0],p=f[1];d&&(p=RL(p||0),r("stroke-dasharray",d.join(",")),(p||i)&&r("stroke-dashoffset",p))}for(var v=0;v<Ic.length;v++){var g=Ic[v];if(t[g]!==Es[g]){var m=t[g]||Es[g];m&&r(EL[v],m)}}}}var fx="http://www.w3.org/2000/svg",dx="http://www.w3.org/1999/xlink",NL="http://www.w3.org/2000/xmlns/",FL="http://www.w3.org/XML/1998/namespace",wm="ecmeta_";function px(r){return document.createElementNS(fx,r)}function jt(r,t,e,i,n){return{tag:r,attrs:e||{},children:i,text:n,key:t}}function BL(r,t){var e=[];if(t)for(var i in t){var n=t[i],a=i;n!==!1&&(n!==!0&&n!=null&&(a+='="'+n+'"'),e.push(a))}return"<"+r+" "+e.join(" ")+">"}function zL(r){return"</"+r+">"}function ld(r,t){t=t||{};var e=t.newline?`
|
|
57
|
+
`:"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return BL(o,s)+(o!=="style"?qt(l):l||"")+(a?""+e+H(a,function(u){return i(u)}).join(e)+e:"")+zL(o)}return i(r)}function VL(r,t,e){e=e||{};var i=e.newline?`
|
|
58
|
+
`:"",n=" {"+i,a=i+"}",o=H(vt(r),function(l){return l+n+H(vt(r[l]),function(u){return u+":"+r[l][u]+";"}).join(i)+a}).join(i),s=H(vt(t),function(l){return"@keyframes "+l+n+H(vt(t[l]),function(u){return u+n+H(vt(t[l][u]),function(h){var c=t[l][u][h];return h==="d"&&(c='path("'+c+'")'),h+":"+c+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":["<![CDATA[",o,s,"]]>"].join(i)}function Mc(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Sm(r,t,e,i){return jt("svg","root",{width:r,height:t,xmlns:fx,"xmlns:xlink":dx,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+t:!1},e)}var HL=0;function vx(){return HL++}var Cm={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Ii="transform-origin";function WL(r,t,e){var i=F({},r.shape);F(i,t),r.buildPath(e,i);var n=new cx;return n.reset(xy(r)),e.rebuildPath(n,1),n.generateStr(),n.getStr()}function GL(r,t){var e=t.originX,i=t.originY;(e||i)&&(r[Ii]=e+"px "+i+"px")}var UL={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function gx(r,t){var e=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[e]=r,e}function $L(r,t,e){var i=r.shape.paths,n={},a,o;if(A(i,function(l){var u=Mc(e.zrId);u.animation=!0,Vl(l,{},u,!0);var h=u.cssAnims,c=u.cssNodes,f=vt(h),d=f.length;if(d){o=f[d-1];var p=h[o];for(var v in p){var g=p[v];n[v]=n[v]||{d:""},n[v].d+=g.d||""}for(var m in c){var _=c[m].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){t.d=!1;var s=gx(n,e);return a.replace(o,s)}}function Tm(r){return $(r)?Cm[r]?"cubic-bezier("+Cm[r]+")":Wc(r)?r:"":""}function Vl(r,t,e,i){var n=r.animators,a=n.length,o=[];if(r instanceof of){var s=$L(r,t,e);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u<a;u++){var h=n[u],c=[h.getMaxTime()/1e3+"s"],f=Tm(h.getClip().easing),d=h.getDelay();f?c.push(f):c.push("linear"),d&&c.push(d/1e3+"s"),h.getLoop()&&c.push("infinite");var p=c.join(" ");l[p]=l[p]||[p,[]],l[p][1].push(h)}function v(_){var b=_[1],x=b.length,C={},S={},T={},I="animation-timing-function";function M(Lt,xt,V){for(var X=Lt.getTracks(),K=Lt.getMaxTime(),Ot=0;Ot<X.length;Ot++){var St=X[Ot];if(St.needsAnimate()){var oe=St.keyframes,Ee=St.propName;if(V&&(Ee=V(Ee)),Ee)for(var ti=0;ti<oe.length;ti++){var Sr=oe[ti],ei=Math.round(Sr.time/K*100)+"%",Zn=Tm(Sr.easing),qn=Sr.rawValue;($(qn)||At(qn))&&(xt[ei]=xt[ei]||{},xt[ei][Ee]=Sr.rawValue,Zn&&(xt[ei][I]=Zn))}}}}for(var D=0;D<x;D++){var P=b[D],k=P.targetName;k?k==="shape"&&M(P,S):!i&&M(P,C)}for(var R in C){var L={};Ay(L,r),F(L,C[R]);var N=wy(L),j=C[R][I];T[R]=N?{transform:N}:{},GL(T[R],L),j&&(T[R][I]=j)}var Z,U=!0;for(var R in S){T[R]=T[R]||{};var Y=!Z,j=S[R][I];Y&&(Z=new Kr);var et=Z.len();Z.reset(),T[R].d=WL(r,S[R],Z);var ut=Z.len();if(!Y&&et!==ut){U=!1;break}j&&(T[R][I]=j)}if(!U)for(var R in T)delete T[R].d;if(!i)for(var D=0;D<x;D++){var P=b[D],k=P.targetName;k==="style"&&M(P,T,function(X){return UL[X]})}for(var ot=vt(T),ft=!0,gt,D=1;D<ot.length;D++){var z=ot[D-1],Rt=ot[D];if(T[z][Ii]!==T[Rt][Ii]){ft=!1;break}gt=T[z][Ii]}if(ft&>){for(var R in T)T[R][Ii]&&delete T[R][Ii];t[Ii]=gt}if(Dt(ot,function(Lt){return vt(T[Lt]).length>0}).length){var It=gx(T,e);return It+" "+_[0]+" both"}}for(var g in l){var s=v(l[g]);s&&o.push(s)}if(o.length){var m=e.zrId+"-cls-"+vx();e.cssNodes["."+m]={animation:o.join(",")},t.class=m}}function YL(r,t,e){if(!r.ignore)if(r.isSilent()){var i={"pointer-events":"none"};Am(i,t,e)}else{var n=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=n.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=Ls(l))}var u=n.lineWidth;if(u){var h=!n.strokeNoScale&&r.transform?r.transform[0]:1;u=u/h}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),Am(i,t,e)}}function Am(r,t,e,i){var n=JSON.stringify(r),a=e.cssStyleCache[n];a||(a=e.zrId+"-cls-"+vx(),e.cssStyleCache[n]=a,e.cssNodes["."+a+":hover"]=r),t.class=t.class?t.class+" "+a:a}var so=Math.round;function mx(r){return r&&$(r.src)}function yx(r){return r&&tt(r.toDataURL)}function ud(r,t,e,i){jL(function(n,a){var o=n==="fill"||n==="stroke";o&&by(a)?bx(t,r,n,i):o&&Uc(a)?xx(e,r,n,i):r[n]=a,o&&i.ssr&&a==="none"&&(r["pointer-events"]="visible")},t,e,!1),tO(e,r,i)}function hd(r,t){var e=Py(t);e&&(e.each(function(i,n){i!=null&&(r[(wm+n).toLowerCase()]=i+"")}),t.isSilent()&&(r[wm+"silent"]="true"))}function Im(r){return zr(r[0]-1)&&zr(r[1])&&zr(r[2])&&zr(r[3]-1)}function XL(r){return zr(r[4])&&zr(r[5])}function cd(r,t,e){if(t&&!(XL(t)&&Im(t))){var i=1e4;r.transform=Im(t)?"translate("+so(t[4]*i)/i+" "+so(t[5]*i)/i+")":oS(t)}}function Mm(r,t,e){for(var i=r.points,n=[],a=0;a<i.length;a++)n.push(so(i[a][0]*e)/e),n.push(so(i[a][1]*e)/e);t.points=n.join(" ")}function Dm(r){return!r.smooth}function ZL(r){var t=H(r,function(e){return typeof e=="string"?[e,e]:e});return function(e,i,n){for(var a=0;a<t.length;a++){var o=t[a],s=e[o[0]];s!=null&&(i[o[1]]=so(s*n)/n)}}}var qL={circle:[ZL(["cx","cy","r"])],polyline:[Mm,Dm],polygon:[Mm,Dm]};function KL(r){for(var t=r.animators,e=0;e<t.length;e++)if(t[e].targetName==="shape")return!0;return!1}function _x(r,t){var e=r.style,i=r.shape,n=qL[r.type],a={},o=t.animation,s="path",l=r.style.strokePercent,u=t.compress&&xy(r)||4;if(n&&!t.willUpdate&&!(n[1]&&!n[1](i))&&!(o&&KL(r))&&!(l<1)){s=r.type;var h=Math.pow(10,u);n[0](i,a,h)}else{var c=!r.path||r.shapeChanged();r.path||r.createPathProxy();var f=r.path;c&&(f.beginPath(),r.buildPath(f,r.shape),r.pathUpdated());var d=f.getVersion(),p=r,v=p.__svgPathBuilder;(p.__svgPathVersion!==d||!v||l!==p.__svgPathStrokePercent)&&(v||(v=p.__svgPathBuilder=new cx),v.reset(u),f.rebuildPath(v,l),v.generateStr(),p.__svgPathVersion=d,p.__svgPathStrokePercent=l),a.d=v.getStr()}return cd(a,r.transform),ud(a,e,r,t),hd(a,r),t.animation&&Vl(r,a,t),t.emphasis&&YL(r,a,t),jt(s,r.id+"",a)}function JL(r,t){var e=r.style,i=e.image;if(i&&!$(i)&&(mx(i)?i=i.src:yx(i)&&(i=i.toDataURL())),!!i){var n=e.x||0,a=e.y||0,o=e.width,s=e.height,l={href:i,width:o,height:s};return n&&(l.x=n),a&&(l.y=a),cd(l,r.transform),ud(l,e,r,t),hd(l,r),t.animation&&Vl(r,l,t),jt("image",r.id+"",l)}}function QL(r,t){var e=r.style,i=e.text;if(i!=null&&(i+=""),!(!i||isNaN(e.x)||isNaN(e.y))){var n=e.font||Xr,a=e.x||0,o=lS(e.y||0,ul(n),e.textBaseline),s=sS[e.textAlign]||e.textAlign,l={"dominant-baseline":"central","text-anchor":s};if(Qy(e)){var u="",h=e.fontStyle,c=Jy(e.fontSize);if(!parseFloat(c))return;var f=e.fontFamily||Gm,d=e.fontWeight;u+="font-size:"+c+";font-family:"+f+";",h&&h!=="normal"&&(u+="font-style:"+h+";"),d&&d!=="normal"&&(u+="font-weight:"+d+";"),l.style=u}else l.style="font: "+n;return i.match(/\s/)&&(l["xml:space"]="preserve"),a&&(l.x=a),o&&(l.y=o),cd(l,r.transform),ud(l,e,r,t),hd(l,r),t.animation&&Vl(r,l,t),jt("text",r.id+"",l,void 0,i)}}function Pm(r,t){if(r instanceof bt)return _x(r,t);if(r instanceof Ze)return JL(r,t);if(r instanceof qa)return QL(r,t)}function tO(r,t,e){var i=r.style;if(uS(i)){var n=hS(r),a=e.shadowCache,o=a[n];if(!o){var s=r.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var h=i.shadowOffsetX||0,c=i.shadowOffsetY||0,f=i.shadowBlur,d=Ga(i.shadowColor),p=d.opacity,v=d.color,g=f/2/l,m=f/2/u,_=g+" "+m;o=e.zrId+"-s"+e.shadowIdx++,e.defs[o]=jt("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[jt("feDropShadow","",{dx:h/l,dy:c/u,stdDeviation:_,"flood-color":v,"flood-opacity":p})]),a[n]=o}t.filter=sl(o)}}function bx(r,t,e,i){var n=r[e],a,o={gradientUnits:n.global?"userSpaceOnUse":"objectBoundingBox"};if(yy(n))a="linearGradient",o.x1=n.x,o.y1=n.y,o.x2=n.x2,o.y2=n.y2;else if(_y(n))a="radialGradient",o.cx=Q(n.x,.5),o.cy=Q(n.y,.5),o.r=Q(n.r,.5);else return;for(var s=n.colorStops,l=[],u=0,h=s.length;u<h;++u){var c=Mh(s[u].offset)*100+"%",f=s[u].color,d=Ga(f),p=d.color,v=d.opacity,g={offset:c};g["stop-color"]=p,v<1&&(g["stop-opacity"]=v),l.push(jt("stop",u+"",g))}var m=jt(a,"",o,l),_=ld(m),b=i.gradientCache,x=b[_];x||(x=i.zrId+"-g"+i.gradientIdx++,b[_]=x,o.id=x,i.defs[x]=jt(a,x,o,l)),t[e]=sl(x)}function xx(r,t,e,i){var n=r.style[e],a=r.getBoundingRect(),o={},s=n.repeat,l=s==="no-repeat",u=s==="repeat-x",h=s==="repeat-y",c;if(my(n)){var f=n.imageWidth,d=n.imageHeight,p=void 0,v=n.image;if($(v)?p=v:mx(v)?p=v.src:yx(v)&&(p=v.toDataURL()),typeof Image>"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";_e(f,g),_e(d,g)}else if(f==null||d==null){var m=function(D,P){if(D){var k=D.elm,R=f||P.width,L=d||P.height;D.tag==="pattern"&&(u?(L=1,R/=a.width):h&&(R=1,L/=a.height)),D.attrs.width=R,D.attrs.height=L,k&&(k.setAttribute("width",R),k.setAttribute("height",L))}},_=tf(p,null,r,function(D){l||m(S,D),m(c,D)});_&&_.width&&_.height&&(f=f||_.width,d=d||_.height)}c=jt("image","img",{href:p,width:f,height:d}),o.width=f,o.height=d}else n.svgElement&&(c=it(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(c){var b,x;l?b=x=1:u?(x=1,b=o.width/a.width):h?(b=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",b!=null&&!isNaN(b)&&(o.width=b),x!=null&&!isNaN(x)&&(o.height=x);var C=wy(n);C&&(o.patternTransform=C);var S=jt("pattern","",o,[c]),T=ld(S),I=i.patternCache,M=I[T];M||(M=i.zrId+"-p"+i.patternIdx++,I[T]=M,o.id=M,S=i.defs[M]=jt("pattern",M,o,[c])),t[e]=sl(M)}}function eO(r,t,e){var i=e.clipPathCache,n=e.defs,a=i[r.id];if(!a){a=e.zrId+"-c"+e.clipPathIdx++;var o={id:a};i[r.id]=a,n[a]=jt("clipPath",a,o,[_x(r,e)])}t["clip-path"]=sl(a)}function km(r){return document.createTextNode(r)}function Pi(r,t,e){r.insertBefore(t,e)}function Rm(r,t){r.removeChild(t)}function Lm(r,t){r.appendChild(t)}function Sx(r){return r.parentNode}function Cx(r){return r.nextSibling}function hh(r,t){r.textContent=t}var Om=58,rO=120,iO=jt("","");function Dc(r){return r===void 0}function rr(r){return r!==void 0}function nO(r,t,e){for(var i={},n=t;n<=e;++n){var a=r[n].key;a!==void 0&&(i[a]=n)}return i}function Ca(r,t){var e=r.key===t.key,i=r.tag===t.tag;return i&&e}function lo(r){var t,e=r.children,i=r.tag;if(rr(i)){var n=r.elm=px(i);if(fd(iO,r),G(e))for(t=0;t<e.length;++t){var a=e[t];a!=null&&Lm(n,lo(a))}else rr(r.text)&&!q(r.text)&&Lm(n,km(r.text))}else r.elm=km(r.text);return r.elm}function Tx(r,t,e,i,n){for(;i<=n;++i){var a=e[i];a!=null&&Pi(r,lo(a),t)}}function qs(r,t,e,i){for(;e<=i;++e){var n=t[e];if(n!=null)if(rr(n.tag)){var a=Sx(n.elm);Rm(a,n.elm)}else Rm(r,n.elm)}}function fd(r,t){var e,i=t.elm,n=r&&r.attrs||{},a=t.attrs||{};if(n!==a){for(e in a){var o=a[e],s=n[e];s!==o&&(o===!0?i.setAttribute(e,""):o===!1?i.removeAttribute(e):e==="style"?i.style.cssText=o:e.charCodeAt(0)!==rO?i.setAttribute(e,o):e==="xmlns:xlink"||e==="xmlns"?i.setAttributeNS(NL,e,o):e.charCodeAt(3)===Om?i.setAttributeNS(FL,e,o):e.charCodeAt(5)===Om?i.setAttributeNS(dx,e,o):i.setAttribute(e,o))}for(e in n)e in a||i.removeAttribute(e)}}function aO(r,t,e){for(var i=0,n=0,a=t.length-1,o=t[0],s=t[a],l=e.length-1,u=e[0],h=e[l],c,f,d,p;i<=a&&n<=l;)o==null?o=t[++i]:s==null?s=t[--a]:u==null?u=e[++n]:h==null?h=e[--l]:Ca(o,u)?(Sn(o,u),o=t[++i],u=e[++n]):Ca(s,h)?(Sn(s,h),s=t[--a],h=e[--l]):Ca(o,h)?(Sn(o,h),Pi(r,o.elm,Cx(s.elm)),o=t[++i],h=e[--l]):Ca(s,u)?(Sn(s,u),Pi(r,s.elm,o.elm),s=t[--a],u=e[++n]):(Dc(c)&&(c=nO(t,i,a)),f=c[u.key],Dc(f)?Pi(r,lo(u),o.elm):(d=t[f],d.tag!==u.tag?Pi(r,lo(u),o.elm):(Sn(d,u),t[f]=void 0,Pi(r,d.elm,o.elm))),u=e[++n]);(i<=a||n<=l)&&(i>a?(p=e[l+1]==null?null:e[l+1].elm,Tx(r,p,e,n,l)):qs(r,t,i,a))}function Sn(r,t){var e=t.elm=r.elm,i=r.children,n=t.children;r!==t&&(fd(r,t),Dc(t.text)?rr(i)&&rr(n)?i!==n&&aO(e,i,n):rr(n)?(rr(r.text)&&hh(e,""),Tx(e,null,n,0,n.length-1)):rr(i)?qs(e,i,0,i.length-1):rr(r.text)&&hh(e,""):r.text!==t.text&&(rr(i)&&qs(e,i,0,i.length-1),hh(e,t.text)))}function oO(r,t){if(Ca(r,t))Sn(r,t);else{var e=r.elm,i=Sx(e);lo(t),i!==null&&(Pi(i,t.elm,Cx(e)),qs(i,[r],0,0))}return t}var sO=0,lO=(function(){function r(t,e,i){if(this.type="svg",this.refreshHover=Em(),this.configLayer=Em(),this.storage=e,this._opts=i=F({},i),this.root=t,this._id="zr"+sO++,this._oldVNode=Sm(i.width,i.height),t&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=px("svg");fd(null,this._oldVNode),n.appendChild(a),t.appendChild(n)}this.resize(i.width,i.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",oO(this._oldVNode,t),this._oldVNode=t}},r.prototype.renderOneToVNode=function(t){return Pm(t,Mc(this._id))},r.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=Mc(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=uO(i,n,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=jt("g","main",{},[]);this._paintList(e,a,l?l.children:o),l&&o.push(l);var u=H(vt(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(jt("defs","defs",{},u)),t.animation){var h=VL(a.cssNodes,a.cssAnims,{newline:!0});if(h){var c=jt("style","stl",{},[],h);o.push(c)}}return Sm(i,n,o,t.useViewBox)},r.prototype.renderToString=function(t){return t=t||{},ld(this.renderToVNode({animation:Q(t.cssAnimation,!0),emphasis:Q(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Q(t.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(t,e,i){for(var n=t.length,a=[],o=0,s,l,u=0,h=0;h<n;h++){var c=t[h];if(!c.invisible){var f=c.__clipPaths,d=f&&f.length||0,p=l&&l.length||0,v=void 0;for(v=Math.max(d-1,p-1);v>=0&&!(f&&l&&f[v]===l[v]);v--);for(var g=p-1;g>v;g--)o--,s=a[o-1];for(var m=v+1;m<d;m++){var _={};eO(f[m],_,e);var b=jt("g","clip-g-"+u++,_,[]);(s?s.children:i).push(b),a[o++]=b,s=b}l=f;var x=Pm(c,e);x&&(s?s.children:i).push(x)}}},r.prototype.resize=function(t,e){var i=this._opts,n=this.root,a=this._viewport;if(t!=null&&(i.width=t),e!=null&&(i.height=e),n&&a&&(a.style.display="none",t=Rv(n,0,i),e=Rv(n,1,i),a.style.display=""),this._width!==t||this._height!==e){if(this._width=t,this._height=e,a){var o=a.style;o.width=t+"px",o.height=e+"px"}if(Uc(this._backgroundColor))this.refresh();else{var s=this._svgDom;s&&(s.setAttribute("width",t),s.setAttribute("height",e));var l=this._bgVNode&&this._bgVNode.elm;l&&(l.setAttribute("width",t),l.setAttribute("height",e))}}},r.prototype.getWidth=function(){return this._width},r.prototype.getHeight=function(){return this._height},r.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},r.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},r.prototype.toDataURL=function(t){var e=this.renderToString(),i="data:image/svg+xml;";return t?(e=fS(e),e&&i+"base64,"+e):i+"charset=UTF-8,"+encodeURIComponent(e)},r})();function Em(r){return function(){}}function uO(r,t,e,i){var n;if(e&&e!=="none")if(n=jt("rect","bg",{width:r,height:t,x:"0",y:"0"}),by(e))bx({fill:e},n.attrs,"fill",i);else if(Uc(e))xx({style:{fill:e},dirty:Wt,getBoundingRect:function(){return{width:r,height:t}}},n.attrs,"fill",i);else{var a=Ga(e),o=a.color,s=a.opacity;n.attrs.fill=o,s<1&&(n.attrs["fill-opacity"]=s)}return n}function hO(r){r.registerPainter("svg",lO)}const cO=""+new URL("echarts-BDq-rBJC.png",import.meta.url).href;Ui([PL,JR,bL,mL,sR,EP,hO]);const Et={paper:{height:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden",width:"100%"},chart:{width:"100%",overflow:"hidden"},chartWithToolbar:r=>({height:`calc(100% - ${parseInt(r.mixins.toolbar.minHeight,10)+8}px)`}),chartWithoutToolbar:{height:"100%"},selectHistoryControl:{width:130},selectRelativeTime:{marginLeft:10,width:200},notAliveInstance:{opacity:.5},customRange:r=>({color:r.palette.primary.main}),splitLineButtonIcon:{marginRight:8},grow:{flexGrow:1},toolbarDate:{width:124,mt:"9px","& fieldset":{display:"none"},"& input":{padding:"8px 0 0 0"},"& .MuiInputAdornment-root":{ml:0,mt:"7px"}},toolbarTime:{width:84,mt:"9px","& fieldset":{display:"none"},"& input":{padding:"8px 0 0 0"},"& .MuiInputAdornment-root":{ml:0,mt:"7px"}},toolbarTimeLabel:{position:"absolute",padding:8,fontSize:"0.8rem",left:2,top:-9},toolbarTimeGrid:{position:"relative",marginLeft:8,paddingLeft:8,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px dotted #AAAAAA",borderRadius:8,display:"flex"},buttonIcon:{width:24,height:24},echartsButton:{marginRight:8,height:34,width:34}},ue=80,Ai=25;class fO extends at.Component{echartsReact;rangeRef;readTimeout=null;chartValues;rangeValues;subscribes;unit;divRef;chart;timerResize=null;updateTimer=null;minY;maxY;timeTimer=null;maxYLenTimeout=null;mouseDown;start;end;localStorage;constructor(t){if(super(t),this.localStorage=window._localStorage||window.localStorage,this.props.from)this.start=this.props.from;else{const a=new Date;a.setHours(a.getHours()-168),this.start=a.getTime()}this.props.end?this.end=this.props.end:this.end=Date.now();let e=this.localStorage.getItem("App.relativeRange")||"30";const i=parseInt(this.localStorage.getItem("App.absoluteStart"),10)||0,n=parseInt(this.localStorage.getItem("App.absoluteEnd"),10)||0;(!i||!n)&&(!e||e==="absolute")&&(e="30"),n&&i&&(e="absolute"),this.state={historyInstance:this.props.historyInstance||"",historyInstances:null,defaultHistory:"",chartHeight:300,chartWidth:500,windowWidth:window.innerWidth,ampm:!1,relativeRange:e,splitLine:this.localStorage.getItem("App.splitLine")==="true",min:i,max:n,maxYLen:0,stepType:"",echartsJump:!1},this.echartsReact=null,this.rangeRef=at.createRef(),this.readTimeout=null,this.chartValues=null,this.rangeValues=null,this.subscribes=[],this.unit=this.props.obj.common&&this.props.obj.common.unit?` ${this.props.obj.common.unit}`:"",this.divRef=at.createRef(),this.chart={}}componentDidMount(){this.props.socket.subscribeState(this.props.obj._id,this.onChange),window.addEventListener("resize",this.onResize),this.prepareData().then(()=>!this.props.noToolbar&&this.readHistoryRange()).then(()=>this.setRelativeInterval(this.state.relativeRange,!0,()=>this.forceUpdate()))}componentWillUnmount(){this.readTimeout&&(clearTimeout(this.readTimeout),this.readTimeout=null),this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=null),this.maxYLenTimeout&&(clearTimeout(this.maxYLenTimeout),this.maxYLenTimeout=null),this.timerResize&&(clearTimeout(this.timerResize),this.timerResize=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null),this.echartsReact&&this.echartsReact.getEchartsInstance().dispose();for(let t=0;t<this.subscribes.length;t++)this.props.socket.unsubscribeState(this.subscribes[t],this.onChange);this.subscribes=[],this.props.socket.unsubscribeState(this.props.obj._id,this.onChange),window.removeEventListener("resize",this.onResize)}onResize=()=>{this.timerResize&&clearTimeout(this.timerResize),this.timerResize=setTimeout(()=>{this.timerResize=null,this.setState({windowWidth:window.innerWidth}),this.componentDidUpdate()})};onChange=(t,e)=>{if(t===this.props.obj._id&&e&&this.rangeValues&&(!this.rangeValues.length||this.rangeValues[this.rangeValues.length-1].ts<e.ts))(!this.state.max||e.ts-this.state.max<12e4)&&(this.chartValues&&this.chartValues.push({val:e.val,ts:e.ts}),this.rangeValues.push({val:e.val,ts:e.ts}),e.ts>=this.chart.min&&e.ts<=this.chart.max+3e5&&this.updateChart());else if(t.startsWith("system.adapter.")&&t.endsWith(".alive")&&this.state.historyInstances){const i=t.substring(15,t.length-6),n=this.state.historyInstances,a=n.findIndex(o=>o.id===i);if(a!==-1&&n[a].alive!==!!(e!=null&&e.val)){const o=JSON.parse(JSON.stringify(n));o[a].alive=!!(e!=null&&e.val),this.setState({historyInstances:o},()=>{o[a].alive&&this.state.historyInstance===i&&this.readHistoryRange().then(()=>this.updateChart())})}}};async prepareData(){var s;if(this.props.noToolbar){const l=this.props.defaultHistory&&await this.props.socket.getState(`system.adapter.${this.props.defaultHistory}.alive`);this.subscribes.length||(this.subscribes=[`system.adapter.${this.props.defaultHistory}.alive`],await this.props.socket.subscribeState(`system.adapter.${this.props.defaultHistory}.alive`,this.onChange)),await new Promise(u=>{this.setState({defaultHistory:this.props.defaultHistory,historyInstance:this.props.defaultHistory,historyInstances:[{id:this.props.defaultHistory,alive:!!(l!=null&&l.val)}]},()=>u(null))});return}let t=await this.getHistoryInstances();const e=await this.props.socket.getCompactSystemConfig();let i=[];this.props.showJumpToEchart&&(i=await this.props.socket.getAdapterInstances("echarts",!0));const n=!!i.find(l=>l._id.startsWith("system.adapter.echarts.")),a=e&&e.common&&e.common.defaultHistory;this.props.obj.common.custom&&(t=t.filter(l=>this.props.obj.common.custom[l.id]));let o=this.localStorage.getItem("App.historyInstance")||"";if((!o||!t.find(l=>l.id===o&&l.alive))&&(o=a),!o||!t.find(l=>l.id===o&&l.alive)){const l=t.find(u=>u.alive);l&&(o=l.id)}!o&&t.length&&(o=a),this.setState({ampm:e.common.dateFormat.includes("/"),historyInstances:t,defaultHistory:a,historyInstance:o,echartsJump:n,stepType:this.props.obj.common.custom&&((s=this.props.obj.common.custom[o])==null?void 0:s.chartStep)||""})}getHistoryInstances(){if(this.props.historyInstance)return Promise.resolve([]);const t=[],e=[];return this.props.customsInstances.forEach(i=>{var a;const n=this.props.objects[`system.adapter.${i}`];if((a=n==null?void 0:n.common)!=null&&a.getHistory){const o={id:i,alive:!1};t.push(o),e.push(`system.adapter.${i}.alive`)}}),e.length?this.props.socket.getForeignStates(e).then(async i=>{Object.keys(i).forEach(n=>{var o;const a=t.find(s=>n.endsWith(`${s.id}.alive`));a&&(a.alive=!!((o=i[n])!=null&&o.val))}),this.subscribes=e;for(let n=0;n<e.length;n++)await this.props.socket.subscribeState(e[n],this.onChange);return t}):Promise.resolve(t)}readHistoryRange(){var i;const t=new Date,e=new Date(2e3,0,1);return(i=this.state.historyInstances)!=null&&i.find(n=>n.id===this.state.historyInstance&&n.alive)?this.props.socket.getHistory(this.props.obj._id,{instance:this.state.historyInstance,start:e.getTime(),end:t.getTime(),limit:1,from:!1,ack:!1,q:!1,addId:!1,aggregate:"none"}).then(n=>{var a;n&&((a=n[0])==null?void 0:a.val)===null&&n.shift(),this.rangeValues=n}):Promise.resolve()}readHistory(t,e){var n;if(!this.state.historyInstance||!((n=this.state.historyInstances)!=null&&n.find(a=>a.id===this.state.historyInstance&&a.alive)))return Promise.resolve([]);const i={instance:this.state.historyInstance,start:t,end:e,from:!1,ack:!1,q:!1,addId:!1,aggregate:"none",returnNewestEntries:!0};return e-t>6e4*24&&!(this.props.obj.common.type==="boolean"||this.props.obj.common.type==="number"&&this.props.obj.common.states)&&(i.aggregate="minmax"),this.props.socket.getHistory(this.props.obj._id,i).then(a=>{const o=[];let s=0;const l=this.rangeValues;let u=null,h=null;for(let c=0;c<a.length;c++){if(l)for(;s<l.length&&l[s].ts<a[c].ts;)o.push(l[s]),s++;!o.length||o[o.length-1].ts<a[c].ts?o.push(a[c]):o[o.length-1].ts===a[c].ts&&o[o.length-1].val!==a[c].ts&&console.error("Strange data!"),(u===null||a[c].val<u)&&(u=a[c].val),(h===null||a[c].val>h)&&(h=a[c].val)}if(l)for(;s<l.length;)o.push(l[s]),console.log(`add range ${new Date(l[s].ts).toISOString()}: ${l[s].val}`),s++;return o.sort((c,f)=>c.ts>f.ts?1:c.ts<f.ts?-1:0),this.chartValues=o,this.minY=u,this.maxY=h,this.minY<10?this.minY=Math.round(this.minY*10)/10:this.minY=Math.ceil(this.minY),this.maxY<10?this.maxY=Math.round(this.maxY*10)/10:this.maxY=Math.ceil(this.maxY),o})}convertData(t){t=t||this.chartValues;const e=[];if(!t.length)return[];for(let i=0;i<t.length;i++){const n={value:[t[i].ts,t[i].val]};t[i].i&&(n.exact=!1),e.push(n)}return this.chart.min||(this.chart.min=t[0].ts,this.chart.max=t[t.length-1].ts),e}getOption(){let t;if(this.minY!==null&&this.minY!==void 0&&(t=(this.minY.toString()+this.unit).length*9+12),this.maxY!==null&&this.maxY!==void 0){const a=(this.maxY.toString()+this.unit).length*9+12;a>t&&(t=a)}if(this.state.maxYLen){const a=this.state.maxYLen*9+12;a>t&&(t=a)}const e={xAxisIndex:0,type:"line",step:this.state.stepType==="stepStart"?"end":this.state.stepType==="stepMiddle"?"middle":this.state.stepType==="stepEnd"?"start":void 0,showSymbol:!1,hoverAnimation:!0,animation:!1,data:this.convertData(),lineStyle:{color:"#4dabf5"},areaStyle:{}},i={type:"value",boundaryGap:[0,"100%"],splitLine:{show:this.props.noToolbar||!!this.state.splitLine},splitNumber:Math.round(this.state.chartHeight/50),axisLabel:{formatter:a=>{let o;return this.props.isFloatComma?o=a.toString().replace(",",".")+this.unit:o=a+this.unit,this.state.maxYLen<o.length&&(this.maxYLenTimeout&&clearTimeout(this.maxYLenTimeout),this.maxYLenTimeout=setTimeout(s=>{this.maxYLenTimeout=null,this.setState({maxYLen:s})},200,o.length)),o},showMaxLabel:!0,showMinLabel:!0},axisTick:{alignWithLabel:!0}};if(this.props.obj.common.type==="boolean")e.step="end",i.axisLabel.showMaxLabel=!1,i.axisLabel.formatter=a=>a===1?"TRUE":"FALSE",i.max=1.5,i.interval=1,t=50;else if(this.props.obj.common.type==="number"&&this.props.obj.common.states){e.step="end",i.axisLabel.showMaxLabel=!1;const a=this.props.obj.common.states;i.axisLabel.formatter=l=>a[l]!==void 0?a[l]:l;const o=Object.keys(this.props.obj.common.states);o.sort(),i.max=parseFloat(o[o.length-1])+.5,i.interval=1;let s="";for(let l=0;l<o.length;l++)typeof a[o[l]]=="string"&&a[o[l]].length>s.length&&(s=a[o[l]]);t=(s.length*9||50)+12}const n=this.chart.withSeconds?Math.round((this.state.chartWidth-Ai-ue)/100):Math.round((this.state.chartWidth-Ai-ue)/60);return{backgroundColor:"transparent",title:{text:this.props.noToolbar?"":O.Utils.getObjectNameFromObj(this.props.obj,this.props.lang),padding:[10,0,0,t?t+10:ue+10]},grid:{left:t||ue,top:8,right:this.props.noToolbar?5:Ai,bottom:40},tooltip:{trigger:"axis",formatter:a=>{const o=a[0],s=new Date(o.value[0]);let l=o.value[1];return l!==null&&this.props.isFloatComma&&(l=l.toString().replace(".",",")),`${o.exact===!1?"i":""}${s.toLocaleString()}.${s.getMilliseconds().toString().padStart(3,"0")}: ${l}${this.unit}`},axisPointer:{animation:!0}},xAxis:{splitLine:{show:!1},splitNumber:n,min:this.chart.min,max:this.chart.max,axisTick:{alignWithLabel:!0},axisLabel:{formatter:a=>{const o=new Date(a);return this.chart.withSeconds?`${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}:${o.getSeconds().toString().padStart(2,"0")}`:this.chart.withTime?`${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}
|
|
59
|
+
${o.getDate().toString().padStart(2,"0")}.${(o.getMonth()+1).toString().padStart(2,"0")}`:`${o.getDate().toString().padStart(2,"0")}.${(o.getMonth()+1).toString().padStart(2,"0")}
|
|
60
|
+
${o.getFullYear()}`}}},yAxis:i,toolbox:{left:"right",feature:this.props.noToolbar?void 0:{saveAsImage:{title:this.props.t("Save as image"),show:!0}}},series:[e]}}static getDerivedStateFromProps(t,e){return null}updateChart(t,e,i,n){t&&(this.start=t),e&&(this.end=e),t=t||this.start,e=e||this.end,this.readTimeout&&clearTimeout(this.readTimeout),this.readTimeout=setTimeout(()=>{var o;this.readTimeout=null;const a=this.chart.max-this.chart.min;a!==this.chart.diff&&(this.chart.diff=a,this.chart.withTime=this.chart.diff<36e5*24*7,this.chart.withSeconds=this.chart.diff<6e4*30),i?this.readHistory(t,e).then(s=>{var l;typeof((l=this.echartsReact)==null?void 0:l.getEchartsInstance)=="function"&&this.echartsReact.getEchartsInstance().setOption({series:[{data:this.convertData(s)}],xAxis:{min:this.chart.min,max:this.chart.max}}),n&&n()}):(typeof((o=this.echartsReact)==null?void 0:o.getEchartsInstance)=="function"&&this.echartsReact.getEchartsInstance().setOption({series:[{data:this.convertData()}],xAxis:{min:this.chart.min,max:this.chart.max}}),n&&n())},400)}setNewRange(t){var e;this.chart.diff=this.chart.max-this.chart.min,this.chart.withTime=this.chart.diff<36e5*24*7,this.chart.withSeconds=this.chart.diff<6e4*30,this.state.relativeRange!=="absolute"?(this.setState({relativeRange:"absolute"}),this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=null)):typeof((e=this.echartsReact)==null?void 0:e.getEchartsInstance)=="function"&&(this.echartsReact.getEchartsInstance().setOption({xAxis:{min:this.chart.min,max:this.chart.max}}),t&&this.updateChart(this.chart.min,this.chart.max,!0))}shiftTime(){const t=new Date,e=6e4-t.getSeconds()-(1e3-t.getMilliseconds());t.getMilliseconds()&&t.setMilliseconds(1e3),t.getSeconds()&&t.setSeconds(60);const i=t.getTime();let n;const a=this.state.relativeRange;if(a==="day")t.setHours(0),t.setMinutes(0),t.setSeconds(0),n=t.getTime();else if(a==="week"){t.setHours(0),t.setMinutes(0),t.setSeconds(0);const o=t.getDay()||7;o!==1&&t.setHours(-24*(o-1)),n=t.getTime()}else if(a==="2weeks"){t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setDate(t.getDate()-7);const o=t.getDay()||7;o!==1&&t.setHours(-24*(o-1)),n=t.getTime()}else a==="month"?(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setDate(1),n=t.getTime()):a==="year"?(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setDate(1),t.setMonth(0),n=t.getTime()):a==="12months"?(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setFullYear(t.getFullYear()-1),n=t.getTime()):n=i-parseInt(a,10)*6e4;this.chart.min=n,this.chart.max=i,this.setState({min:n,max:i},()=>this.updateChart(this.chart.min,this.chart.max,!0)),this.timeTimer=setTimeout(()=>{this.timeTimer=null,this.shiftTime()},e||6e4)}setRelativeInterval(t,e,i){if(e||(this.localStorage.setItem("App.relativeRange",t),this.setState({relativeRange:t})),t==="absolute"){this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=null),this.updateChart(this.chart.min,this.chart.max,!0,i);return}this.localStorage.removeItem("App.absoluteStart"),this.localStorage.removeItem("App.absoluteEnd");const n=new Date;if(!this.timeTimer){const a=6e4-n.getSeconds()-(1e3-n.getMilliseconds());this.timeTimer=setTimeout(()=>{this.timeTimer=null,this.shiftTime()},a||6e4)}if(n.getMilliseconds()&&n.setMilliseconds(1e3),n.getSeconds()&&n.setSeconds(60),this.chart.max=n.getTime(),t==="day")n.setHours(0),n.setMinutes(0),n.setSeconds(0),this.chart.min=n.getTime();else if(t==="week"){n.setHours(0),n.setMinutes(0),n.setSeconds(0);const a=n.getDay()||7;a!==1&&n.setHours(-24*(a-1)),this.chart.min=n.getTime()}else if(t==="2weeks"){n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setDate(n.getDate()-7);const a=n.getDay()||7;a!==1&&n.setHours(-24*(a-1)),this.chart.min=n.getTime()}else t==="month"?(n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setDate(1),this.chart.min=n.getTime()):t==="year"?(n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setDate(1),n.setMonth(0),this.chart.min=n.getTime()):t==="12months"?(n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setFullYear(n.getFullYear()-1),this.chart.min=n.getTime()):this.chart.min=this.chart.max-parseInt(t,10)*6e4;this.setState({min:this.chart.min,max:this.chart.max},()=>this.updateChart(this.chart.min,this.chart.max,!0,i))}installEventHandlers(){if(!this.echartsReact||typeof this.echartsReact.getEchartsInstance!="function")return;const t=this.echartsReact.getEchartsInstance().getZr();t._iobInstalled||(t._iobInstalled=!0,t.on("mousedown",e=>{console.log("mouse down"),this.mouseDown=!0,this.chart.lastX=e.offsetX}),t.on("mouseup",()=>{console.log("mouse up"),this.mouseDown=!1,this.setNewRange(!0)}),t.on("mousewheel",e=>{let i=this.chart.max-this.chart.min;const n=this.state.chartWidth-Ai-ue,o=(e.offsetX-ue)/n,s=i,l=e.wheelDelta>0?1.1:.9;i*=l;const u=s-i;this.chart.max+=u*(1-o),this.chart.min-=u*o,this.setNewRange()}),t.on("mousemove",e=>{if(this.mouseDown){const i=this.chart.lastX-(e.offsetX-ue);this.chart.lastX=e.offsetX-ue;const n=this.chart.max-this.chart.min,a=this.state.chartWidth-Ai-ue,o=Math.round(i*n/a);this.chart.min+=o,this.chart.max+=o,this.setNewRange()}}),t.on("touchstart",e=>{e.preventDefault(),this.mouseDown=!0;const i=e.touches||e.originalEvent.touches;i&&(this.chart.lastX=i[i.length-1].pageX,i.length>1?this.chart.lastWidth=Math.abs(i[0].pageX-i[1].pageX):this.chart.lastWidth=null)}),t.on("touchend",e=>{e.preventDefault(),this.mouseDown=!1,this.setNewRange(!0)}),t.on("touchmove",e=>{e.preventDefault();const i=e.touches||e.originalEvent.touches;if(!i)return;const n=i[i.length-1].pageX-ue;if(this.mouseDown)if(i.length>1){const a=Math.abs(i[0].pageX-i[1].pageX);if(this.chart.lastWidth!==null&&a!==this.chart.lastWidth){let o=this.chart.max-this.chart.min;const s=this.state.chartWidth-Ai-ue,l=a>this.chart.lastWidth?1.1:.9,h=(i[0].pageX>i[1].pageX?i[1].pageX-ue+a/2:i[0].pageX-ue+a/2)/s,c=o;o*=l;const f=c-o;this.chart.max+=f*(1-h),this.chart.min-=f*h,this.setNewRange()}this.chart.lastWidth=a}else{const a=this.chart.lastX-n,o=this.chart.max-this.chart.min,s=this.state.chartWidth-Ai-ue,l=Math.round(a*o/s);this.chart.min+=l,this.chart.max+=l,this.setNewRange()}this.chart.lastX=n}))}renderChart(){var t;return this.state.historyInstance?(t=this.state.historyInstances)!=null&&t.find(e=>e.id===this.state.historyInstance&&e.alive)?this.chartValues?y.jsx(Bw,{ref:e=>this.echartsReact=e,echarts:sP,option:this.getOption(),notMerge:!0,lazyUpdate:!0,theme:this.props.themeType==="dark"?"dark":"",style:{height:`${this.state.chartHeight}px`,width:"100%"},opts:{renderer:"svg"},onEvents:{rendered:()=>this.installEventHandlers()}}):y.jsx(w.LinearProgress,{}):y.jsx("div",{style:{marginTop:20,fontSize:24,marginLeft:24},children:this.props.t("History instance not alive")}):y.jsx("div",{style:{marginTop:20,fontSize:24,marginLeft:24},children:this.props.t("History instance not selected")})}componentDidUpdate(){if(this.divRef.current){const t=this.divRef.current.offsetWidth,e=this.divRef.current.offsetHeight;this.state.chartHeight!==e&&(this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>{this.updateTimer=null,this.setState({chartHeight:e,chartWidth:t})},100))}}setStartDate(t){const e=t.getTime();this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=null),this.localStorage.setItem("App.relativeRange","absolute"),this.localStorage.setItem("App.absoluteStart",e.toString()),this.localStorage.setItem("App.absoluteEnd",this.state.max.toString()),this.chart.min=e,this.setState({min:e,relativeRange:"absolute"},()=>this.updateChart(this.chart.min,this.chart.max,!0))}setEndDate(t){const e=t.getTime();this.localStorage.setItem("App.relativeRange","absolute"),this.localStorage.setItem("App.absoluteStart",this.state.min.toString()),this.localStorage.setItem("App.absoluteEnd",e.toString()),this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=null),this.chart.max=e,this.setState({max:e,relativeRange:"absolute"},()=>this.updateChart(this.chart.min,this.chart.max,!0))}openEcharts(){const t=[`id=${window.encodeURIComponent(this.props.obj._id)}`,`instance=${window.encodeURIComponent(this.state.historyInstance)}`,"menuOpened=false"];this.state.relativeRange==="absolute"?(t.push(`start=${this.chart.min}`),t.push(`end=${this.chart.max}`)):t.push(`range=${this.state.relativeRange}`),window.open(`${window.location.protocol}//${window.location.host}/adapter/echarts/tab.html#${t.join("&")}`,"echarts")}async onStepChanged(t){const e=await this.props.socket.getObject(this.props.obj._id);e.common.custom&&e.common.custom[this.state.historyInstance]&&e.common.custom[this.state.historyInstance].chartStep!==t&&(e.common.custom[this.state.historyInstance].chartStep=t,await this.props.socket.setObject(e._id,e)),this.setState({stepType:t,showStepMenu:null})}renderToolbar(){if(this.props.noToolbar)return null;const t=this.state.windowWidth<960;return y.jsxs(w.Toolbar,{children:[!this.props.historyInstance&&y.jsxs(w.FormControl,{variant:"standard",style:Et.selectHistoryControl,children:[y.jsx(w.InputLabel,{children:this.props.t("History instance")}),y.jsx(w.Select,{variant:"standard",value:this.state.historyInstance,onChange:e=>{this.localStorage.setItem("App.historyInstance",e.target.value),this.setState({historyInstance:e.target.value})},children:this.state.historyInstances.map(e=>y.jsx(w.MenuItem,{value:e.id,style:e.alive?void 0:Et.notAliveInstance,children:e.id},e.id))})]}),y.jsxs(w.FormControl,{variant:"standard",style:Et.selectRelativeTime,children:[y.jsx(w.InputLabel,{children:this.props.t("Relative")}),y.jsxs(w.Select,{variant:"standard",ref:this.rangeRef,value:this.state.relativeRange,onChange:e=>this.setRelativeInterval(e.target.value),children:[y.jsx(w.MenuItem,{value:"absolute",sx:Et.customRange,children:this.props.t("custom range")},"custom"),y.jsx(w.MenuItem,{value:10,children:this.props.t("last 10 minutes")},"1"),y.jsx(w.MenuItem,{value:30,children:this.props.t("last 30 minutes")},"2"),y.jsx(w.MenuItem,{value:60,children:this.props.t("last hour")},"3"),y.jsx(w.MenuItem,{value:"day",children:this.props.t("this day")},"4"),y.jsx(w.MenuItem,{value:1440,children:this.props.t("last 24 hours")},"5"),y.jsx(w.MenuItem,{value:"week",children:this.props.t("this week")},"6"),y.jsx(w.MenuItem,{value:1440*7,children:this.props.t("last week")},"7"),y.jsx(w.MenuItem,{value:"2weeks",children:this.props.t("this 2 weeks")},"8"),y.jsx(w.MenuItem,{value:1440*14,children:this.props.t("last 2 weeks")},"9"),y.jsx(w.MenuItem,{value:"month",children:this.props.t("this month")},"10"),y.jsx(w.MenuItem,{value:720*60,children:this.props.t("last 30 days")},"11"),y.jsx(w.MenuItem,{value:"year",children:this.props.t("this year")},"12"),y.jsx(w.MenuItem,{value:"12months",children:this.props.t("last 12 months")},"13")]})]}),y.jsxs(Xt.LocalizationProvider,{dateAdapter:ws,adapterLocale:Cs[this.props.lang],children:[y.jsxs("div",{style:Et.toolbarTimeGrid,children:[y.jsx("div",{style:{...Et.toolbarTimeLabel,opacity:this.state.relativeRange!=="absolute"?.5:void 0},children:this.props.t("Start time")}),y.jsx(Xt.DatePicker,{sx:Et.toolbarDate,disabled:this.state.relativeRange!=="absolute",value:new Date(this.state.min),onChange:e=>this.setStartDate(e)}),y.jsx(Xt.TimePicker,{disabled:this.state.relativeRange!=="absolute",sx:Et.toolbarTime,ampm:this.state.ampm,value:new Date(this.state.min),onChange:e=>this.setStartDate(e)})]}),y.jsxs("div",{style:Et.toolbarTimeGrid,children:[y.jsx("div",{style:{...Et.toolbarTimeLabel,opacity:this.state.relativeRange!=="absolute"?.5:void 0},children:this.props.t("End time")}),y.jsx(Xt.DatePicker,{disabled:this.state.relativeRange!=="absolute",sx:Et.toolbarDate,value:new Date(this.state.max),onChange:e=>this.setEndDate(e)}),y.jsx(Xt.TimePicker,{disabled:this.state.relativeRange!=="absolute",sx:Et.toolbarTime,ampm:this.state.ampm,value:new Date(this.state.max),onChange:e=>this.setEndDate(e)})]})]}),y.jsx("div",{style:Et.grow}),y.jsx(w.Button,{style:{marginRight:10},variant:"outlined",onClick:e=>this.setState({showStepMenu:e.target}),children:t?this.state.stepType===""?y.jsx(W.Remove,{}):this.state.stepType==="stepStart"?y.jsx(W.KeyboardArrowRight,{}):this.state.stepType==="stepMiddle"?y.jsx(W.MoreHoriz,{}):this.state.stepType==="stepEnd"?y.jsx(W.KeyboardArrowLeft,{}):this.props.t("Step type"):this.state.stepType?this.props.t(this.state.stepType):this.props.t("Step type")}),this.state.showStepMenu?y.jsxs(w.Menu,{open:!0,anchorEl:this.state.showStepMenu,onClose:()=>this.setState({showStepMenu:null}),children:[y.jsx(w.MenuItem,{selected:this.state.stepType==="",onClick:()=>this.onStepChanged(""),children:t?y.jsx(W.Remove,{}):this.props.t("None")}),y.jsx(w.MenuItem,{selected:this.state.stepType==="stepStart",onClick:()=>this.onStepChanged("stepStart"),children:t?y.jsx(W.KeyboardArrowRight,{}):this.props.t("stepStart")}),y.jsx(w.MenuItem,{selected:this.state.stepType==="stepMiddle",onClick:()=>this.onStepChanged("stepMiddle"),children:t?y.jsx(W.MoreHoriz,{}):this.props.t("stepMiddle")}),y.jsx(w.MenuItem,{selected:this.state.stepType==="stepEnd",onClick:()=>this.onStepChanged("stepEnd"),children:t?y.jsx(W.KeyboardArrowLeft,{}):this.props.t("stepEnd")})]}):null,this.props.showJumpToEchart&&this.state.echartsJump&&y.jsx(w.Fab,{style:Et.echartsButton,size:"small",onClick:()=>this.openEcharts(),title:this.props.t("Open charts in new window"),children:y.jsx("img",{src:cO,alt:"echarts",style:Et.buttonIcon})}),y.jsxs(w.Fab,{variant:"extended",size:"small",color:this.state.splitLine?"primary":"default","aria-label":"show lines",onClick:()=>{this.localStorage.setItem("App.splitLine",this.state.splitLine?"false":"true"),this.setState({splitLine:!this.state.splitLine})},children:[y.jsx(Lx,{style:Et.splitLineButtonIcon}),this.props.t("Show lines")]})]})}render(){return!this.state.historyInstances&&!this.state.defaultHistory?y.jsx(w.LinearProgress,{}):y.jsxs(w.Paper,{style:Et.paper,children:[this.renderToolbar(),y.jsx("div",{ref:this.divRef,style:O.Utils.getStyle(this.props.theme,Et.chart,this.props.noToolbar?Et.chartWithoutToolbar:Et.chartWithToolbar),children:this.renderChart()})]})}}const Ax=O.withWidth()(fO),er={dialog:{height:"100%"},paper:{height:"calc(100% - 64px)"},content:{textAlign:"center",overflow:"hidden"},tabPanel:r=>({width:"100%",overflow:"hidden",height:`calc(100% - ${r.mixins.toolbar.minHeight}px)`}),tabSelected:r=>({color:r.palette.mode==="dark"?r.palette.secondary.contrastText:"#FFFFFF !important"}),tabsIndicator:r=>({backgroundColor:r.palette.secondary.main})};class dO extends bd{chartAvailable;saveFunc=null;constructor(t){super(t);let e=parseInt((window._localStorage||window.localStorage).getItem("App.objectCustomTab")||"0",10);if(this.chartAvailable=this.isChartAvailable(),this.chartAvailable){const i=O.Router.getLocation();i.arg==="chart"?e=2:i.arg==="table"&&(e=1)}else e=0;this.state={hasChanges:!1,currentTab:e,confirmDialog:!1,mobile:bd.isMobile(),progressRunning:!1,showWarning:this.props.allVisibleObjects}}isChartAvailable(){var e,i;let t=this.props.objectIDs.length===1;if(t){const n=this.props.objectIDs[0];(i=(e=this.props.objects[n])==null?void 0:e.common)!=null&&i.custom?t=!!Object.keys(this.props.objects[n].common.custom).find(a=>{const o=this.props.objects[`system.adapter.${a}`];return o&&o.common&&o.common.getHistory}):t=!1}return t}renderCharts(){return y.jsx(Ax,{id:"custom-tabpanel-chart",isFloatComma:this.props.isFloatComma,showJumpToEchart:!0,t:this.props.t,lang:this.props.lang,expertMode:this.props.expertMode,socket:this.props.socket,obj:this.props.objects[this.props.objectIDs[0]],customsInstances:this.props.customsInstances,themeType:this.props.themeType,theme:this.props.theme,objects:this.props.objects})}renderTable(){return y.jsx(Gx,{id:"custom-tabpanel-history",t:this.props.t,isFloatComma:this.props.isFloatComma,lang:this.props.lang,expertMode:this.props.expertMode,socket:this.props.socket,obj:this.props.objects[this.props.objectIDs[0]],customsInstances:this.props.customsInstances,themeName:this.props.themeName,objects:this.props.objects})}renderCustomEditor(){return y.jsx(Bx,{id:"custom-tabpanel-settings",registerSaveFunc:t=>this.saveFunc=t,t:this.props.t,allVisibleObjects:this.props.allVisibleObjects,lang:this.props.lang,expertMode:this.props.expertMode,socket:this.props.socket,objectIDs:this.props.objectIDs,customsInstances:this.props.customsInstances,objects:this.props.objects,onProgress:t=>this.setState({progressRunning:t}),reportChangedIds:this.props.reportChangedIds,onChange:(t,e)=>{this.setState({hasChanges:t},()=>{if(e){const i=this.isChartAvailable();i!==this.chartAvailable&&(this.chartAvailable=i,this.forceUpdate())}})},theme:this.props.theme,themeName:this.props.themeName,themeType:this.props.themeType,systemConfig:this.props.systemConfig})}renderDialogConfirm(){return this.state.confirmDialog?y.jsx(O.DialogConfirm,{title:O.I18n.t("You have unsaved changes"),text:O.I18n.t("Discard?"),ok:O.I18n.t("Yes"),cancel:O.I18n.t("Cancel"),onClose:t=>this.setState({confirmDialog:!1},()=>t&&this.props.onClose())}):null}onClose(){this.state.hasChanges?this.setState({confirmDialog:!0}):this.props.onClose()}renderWarningDialog(){return this.state.showWarning?y.jsx(O.DialogConfirm,{text:y.jsx("div",{style:{color:"#F00"},children:this.props.t("Your are intend to edit ALL objects. Are you sure?")}),ok:this.props.t("Yes"),onClose:t=>{this.setState({showWarning:!1}),t||this.onClose()}}):null}render(){var e,i;const t=(i=(e=this.props.objects[this.props.objectIDs[0]])==null?void 0:e.common)==null?void 0:i.type;return y.jsxs(w.Dialog,{sx:{"&.MuiDialog-scrollPaper":er.dialog,"& .MuiDialog-paper":er.paper},scroll:"paper",open:!0,onClose:()=>this.props.onClose(),fullWidth:!0,maxWidth:"xl","aria-labelledby":"form-dialog-title",children:[this.renderDialogConfirm(),this.renderWarningDialog(),y.jsx(w.DialogTitle,{children:this.props.objectIDs.length>1?this.props.t("Edit config for %s states",this.props.objectIDs.length):this.props.t("Edit config: %s",this.props.objectIDs[0])}),y.jsxs(w.DialogContent,{style:er.content,children:[y.jsx(w.AppBar,{position:"static",children:y.jsxs(w.Tabs,{value:this.state.currentTab,onChange:(n,a)=>{O.Router.doNavigate(null,null,null,a===1?"table":a===2?"chart":"config"),this.setState({currentTab:a}),(window._localStorage||window.localStorage).setItem("App.objectCustomTab",a)},sx:{"& .MuiTabs-indicator":er.tabsIndicator},indicatorColor:"secondary",children:[y.jsx(w.Tab,{disabled:this.state.progressRunning,label:this.props.t("Custom settings"),id:"custom-settings-tab","aria-controls":"custom-tabpanel-settings",sx:{"&.Mui-selected":er.tabSelected}}),this.props.objectIDs.length===1&&this.chartAvailable?y.jsx(w.Tab,{disabled:this.state.progressRunning,label:this.props.t("History data"),id:"history-data-tab","aria-controls":"custom-tabpanel-history",sx:{"&.Mui-selected":er.tabSelected}}):null,(t==="number"||t==="boolean")&&this.props.objectIDs.length===1&&this.chartAvailable?y.jsx(w.Tab,{disabled:this.state.progressRunning,label:this.props.t("Chart"),id:"chart-tab","aria-controls":"custom-tabpanel-chart",sx:{"&.Mui-selected":er.tabSelected}}):null]})}),this.state.currentTab===0?y.jsx(w.Box,{component:"div",sx:er.tabPanel,children:this.renderCustomEditor()}):null,this.props.objectIDs.length===1&&this.chartAvailable&&this.state.currentTab===1?y.jsx(w.Box,{component:"div",sx:er.tabPanel,children:this.renderTable()}):null,(t==="number"||t==="boolean")&&this.props.objectIDs.length===1&&this.chartAvailable&&this.state.currentTab===2?y.jsx(w.Box,{component:"div",sx:er.tabPanel,children:this.renderCharts()}):null]}),y.jsxs(w.DialogActions,{children:[this.state.currentTab===0&&y.jsx(w.Button,{id:"object-custom-dialog-save",variant:"contained",color:"primary",disabled:!this.state.hasChanges||this.state.progressRunning,onClick:()=>this.saveFunc&&this.saveFunc(),children:this.getButtonTitle(y.jsx(W.Save,{}),this.props.t("Save"))}),this.state.currentTab===0&&y.jsx(w.Button,{id:"object-custom-dialog-save-close",variant:"contained",color:"primary",disabled:!this.state.hasChanges||this.state.progressRunning,onClick:()=>{this.saveFunc?this.saveFunc(n=>!n&&this.onClose()):this.onClose()},children:this.getButtonTitle(y.jsx(W.Save,{}),this.props.t("Save & close"),y.jsx(W.Close,{}))}),y.jsx(w.Button,{id:"object-custom-dialog-close",disabled:this.state.progressRunning,variant:"contained",onClick:()=>this.onClose(),color:"grey",children:this.getButtonTitle(y.jsx(W.Close,{}),this.props.t("Close"))})]})]})}}const pe={formControl:{minWidth:100},quality:{width:"calc(100% - 88px)"},expire:{ml:1,width:80},readOnly:{backgroundColor:"#b74848"},readOnlyText:{color:"#b74848",marginLeft:8},wrapperButton:{"@media screen and (max-width: 465px)":{"& *":{fontSize:12}},"@media screen and (max-width: 380px)":{"& *":{fontSize:11}}},ackCheckbox:{marginLeft:4},dialog:{minHeight:window.clientHeight-50>500?500:window.clientHeight-50},tooltip:{pointerEvents:"none"}};class Mn extends at.Component{propsValue;chartFrom;ack;inputRef=ch.createRef();q;expire;constructor(t){super(t);let e=this.props.type;e||(e=typeof this.props.value);let i=this.props.value;if(this.propsValue=i,this.propsValue===null?this.propsValue="null":this.propsValue===void 0&&(this.propsValue="undefined"),this.props.states)e="states";else if(e==="string"||e==="json"){if(i&&typeof i=="string"&&(i.startsWith("[")&&i.endsWith("]")||i.startsWith("{")&&i.endsWith("}")))try{i=JSON.parse(i),i=JSON.stringify(i,null,2),this.propsValue=i,e="json"}catch{}}else e==="number"&&(i=parseFloat(this.propsValue)||0);this.state={type:e,chart:!1,chartEnabled:(window._localStorage||window.localStorage).getItem("App.chartSetValue")!=="false",fullScreen:(window._localStorage||window.localStorage).getItem("App.fullScreen")==="true",targetValue:i,valid:!0,jsonError:!1},this.ack=!1,this.q=0,this.expire=0,this.inputRef=ch.createRef(),this.chartFrom=Date.now()-36e5*2}componentDidMount(){var t,e,i;this.props.defaultHistory&&((e=(t=this.props.object)==null?void 0:t.common)!=null&&e.custom)&&((i=this.props.object.common.custom[this.props.defaultHistory])!=null&&i.enabled)&&this.props.socket.getState(`system.adapter.${this.props.defaultHistory}.alive`).then(n=>this.setState({chart:!!(n!=null&&n.val)})),setTimeout(()=>{var n;if((n=this.inputRef)!=null&&n.current){const a=this.inputRef.current,o=a.value||"",s=a.type;a.type==="number"&&(a.type="text"),a.setSelectionRange(0,o.length),s==="number"&&(a.type=s)}},200)}onUpdate(t){t&&(t.stopPropagation(),t.preventDefault());let e=this.state.targetValue;if(this.state.type==="states")if(e==="null")e=null;else{const i=this.props.type||typeof this.state.targetValue;e=typeof e=="object"?e.value:e,i==="number"?typeof e=="string"&&(e=parseFloat(e.replace(",","."))||0):i==="boolean"&&(e=e===!0||e==="true"||e==="1"||e==="ON"||e==="on")}else this.state.type==="number"?e==="null"?e=null:typeof e=="string"&&(e=parseFloat(e.replace(",","."))||0):this.state.type==="boolean"&&(e==="null"?e=null:e=e===!0||e==="true"||e==="1"||e==="ON"||e==="on");this.props.onClose({val:e,ack:this.ack,q:this.q,expire:parseInt(this.expire,10)||void 0})}static isNumberValid(t){const{common:e,value:i}=t;if(i==="")return!1;const n=Number(i);return typeof e.min=="number"&&n<e.min?!1:!(typeof e.max=="number"&&n>e.max)}renderTimePicker(){return y.jsxs(Xt.LocalizationProvider,{adapterLocale:Cs[this.props.lang],dateAdapter:ws,children:[y.jsx(Xt.DatePicker,{value:Number(this.state.targetValue),onChange:t=>{t&&this.setState({targetValue:Math.round(t.getTime())})}}),y.jsx(Xt.TimePicker,{value:Number(this.state.targetValue),views:["hours","minutes","seconds"],onChange:t=>{t&&this.setState({targetValue:Math.round(t.getTime())})}})]})}renderChart(){return y.jsx(Ax,{t:this.props.t,isFloatComma:this.props.isFloatComma,showJumpToEchart:!1,lang:this.props.lang,socket:this.props.socket,obj:this.props.object,themeType:this.props.themeType,theme:this.props.theme,from:this.chartFrom,end:Date.now(),noToolbar:!0,dateFormat:this.props.dateFormat,defaultHistory:this.props.defaultHistory})}static checkJsonError(t){try{return JSON.parse(t),!1}catch{return!0}}renderJsonEditor(){return y.jsx(Fm,{error:this.state.jsonError,editValueMode:!0,themeType:this.props.themeType,defaultValue:(this.propsValue||"").toString(),onChange:t=>this.setState({targetValue:t,jsonError:Mn.checkJsonError(t)})})}renderStates(){if(!this.props.states)return null;if(this.props.type==="number"&&this.props.object.common.max!==void 0&&this.props.object.common.min!==void 0){const t=Object.keys(this.props.states).map(e=>({label:this.props.states[e],value:e}));return y.jsx(w.Autocomplete,{style:pe.formControl,disablePortal:!0,defaultValue:this.props.states[this.propsValue]!==void 0?this.props.states[this.propsValue]:this.propsValue,options:t,noOptionsText:"",freeSolo:!0,getOptionLabel:e=>(e==null?void 0:e.label)||(e!=null?e.toString():""),onChange:(e,i)=>this.setState({targetValue:i}),onInputChange:(e,i)=>this.setState({targetValue:i}),onKeyUp:e=>e.key==="Enter"&&this.onUpdate(e),renderInput:e=>y.jsx(w.TextField,{...e,label:this.props.t("Value"),variant:"standard"})})}return y.jsxs(w.FormControl,{variant:"standard",style:pe.formControl,children:[y.jsx(w.InputLabel,{children:this.props.t("Value")}),y.jsx(w.Select,{variant:"standard",defaultValue:this.propsValue,onChange:t=>this.setState({targetValue:t.target.value}),children:Object.keys(this.props.states).map((t,e)=>y.jsx(w.MenuItem,{value:t,children:this.props.states[t]},e))})]})}render(){var e,i,n;const t=y.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[y.jsx(w.FormControlLabel,{style:{...pe.formControl,...this.props.expertMode?void 0:pe.ackCheckbox},control:y.jsx(w.Checkbox,{defaultChecked:!1,onChange:a=>this.ack=a.target.checked}),label:this.props.t("Acknowledged")}),y.jsx(w.Tooltip,{title:this.props.t("Acknowledged explanation"),slotProps:{popper:{sx:pe.tooltip}},children:y.jsx(W.Info,{color:"primary"})})]});return y.jsxs(w.Dialog,{open:!0,maxWidth:this.state.type==="number"||this.state.type==="boolean"||this.state.type==="states"?this.state.chart&&this.state.chartEnabled?"lg":void 0:"md",fullWidth:this.state.type==="json"&&this.state.fullScreen||this.state.type!=="number"&&this.state.type!=="boolean"&&this.state.type!=="states"||this.state.chart&&this.state.chartEnabled,fullScreen:this.state.type==="json"&&this.state.fullScreen,onClose:()=>this.props.onClose(),"aria-labelledby":"edit-value-dialog-title","aria-describedby":"edit-value-dialog-description",sx:{"&. MuiDialog-paper":this.state.type==="json"?pe.dialog:void 0},children:[y.jsxs(w.DialogTitle,{id:"edit-value-dialog-title",children:[this.props.t("Write value"),((e=this.props.object.common)==null?void 0:e.write)===!1?y.jsxs("span",{style:pe.readOnlyText,children:["(",this.props.t("read only"),")"]}):null,this.state.chart?y.jsx(w.Fab,{style:{float:"right"},size:"small",color:this.state.chartEnabled?"primary":"default",onClick:()=>{(window._localStorage||window.localStorage).setItem("App.chartSetValue",this.state.chartEnabled?"false":"true"),this.setState({chartEnabled:!this.state.chartEnabled})},children:y.jsx(W.ShowChart,{})}):null,this.state.type==="json"?y.jsx(w.IconButton,{style:{float:"right"},onClick:()=>{(window._localStorage||window.localStorage).setItem("App.fullScreen",this.state.fullScreen?"false":"true"),this.setState({fullScreen:!this.state.fullScreen})},children:this.state.fullScreen?y.jsx(W.FullscreenExit,{}):y.jsx(W.Fullscreen,{})}):null]}),y.jsx(w.DialogContent,{children:y.jsx("form",{noValidate:!0,autoComplete:"off",onSubmit:()=>!1,style:{...pe.dialogForm,height:"100%"},children:y.jsxs(w.Grid2,{container:!0,direction:"row",spacing:2,style:{height:"100%"},children:[y.jsx(w.Grid2,{size:{xs:this.state.chart&&this.state.chartEnabled?6:12},style:{height:"100%"},children:y.jsxs(w.Grid2,{container:!0,direction:"column",spacing:2,style:{marginTop:0,height:"100%"},children:[this.props.expertMode?y.jsx(w.Grid2,{children:y.jsxs(w.Grid2,{container:!0,direction:"row",spacing:2,style:{marginTop:0},children:[this.props.expertMode?y.jsx(w.Grid2,{children:y.jsxs(w.FormControl,{style:pe.formControl,children:[y.jsx(w.InputLabel,{style:{marginTop:10,marginLeft:-14},children:this.props.t("Value type")}),y.jsxs(w.Select,{variant:"standard",value:this.state.type,onChange:a=>{this.setState({type:a.target.value,valid:a.target.value==="number"?Mn.isNumberValid({value:this.state.targetValue,common:this.props.object.common}):!0,jsonError:!1},()=>{this.state.type==="json"&&this.setState({targetValue:(this.state.targetValue||"").toString(),jsonError:Mn.checkJsonError((this.state.targetValue||"").toString())})})},children:[y.jsx(w.MenuItem,{value:"string",children:"String"}),y.jsx(w.MenuItem,{value:"number",children:"Number"}),y.jsx(w.MenuItem,{value:"boolean",children:"Boolean"}),y.jsx(w.MenuItem,{value:"json",children:"JSON"}),this.props.states?y.jsx(w.MenuItem,{value:"states",children:"States"}):null]})]})}):null,this.state.type==="json"?y.jsx(w.Grid2,{flex:1}):null]})}):null,y.jsx(w.Grid2,{flex:this.state.type==="json"&&this.state.fullScreen?1:void 0,style:{paddingTop:0},children:this.state.type==="boolean"?y.jsx(w.Typography,{component:"div",style:this.props.expertMode?{marginTop:20,width:"100%",backgroundColor:this.props.themeType==="dark"?"#595959":"#dadada",borderRadius:5,padding:5}:void 0,children:y.jsxs(w.Grid2,{component:"label",container:!0,alignItems:"center",spacing:1,children:[y.jsxs(w.Grid2,{style:{marginRight:10},children:[this.props.t("Value"),":"]}),y.jsx(w.Grid2,{children:"FALSE"}),y.jsx(w.Grid2,{children:y.jsx(w.Switch,{autoFocus:!0,defaultChecked:this.propsValue==="null"||this.propsValue==="undefined"?!1:!!this.propsValue,onKeyUp:a=>a.key==="Enter"&&this.onUpdate(a),onChange:a=>this.setState({targetValue:a.target.checked})})}),y.jsx(w.Grid2,{children:"TRUE"})]})}):this.state.type==="number"?y.jsx(w.TextField,{variant:"standard",fullWidth:!0,autoFocus:!0,error:!this.state.valid,type:"number",slotProps:{htmlInput:{step:this.props.object.common.step,min:this.props.object.common.min,max:this.props.object.common.max}},inputRef:this.inputRef,helperText:this.props.t("Press ENTER to write the value, when focused"),value:this.state.targetValue.toString(),label:this.props.t("Value")+(this.props.object.common.min!==void 0||this.props.object.common.unit==="%"?`, ${this.props.t("min:")} ${this.props.object.common.min!==void 0?this.props.object.common.min:0}`:"")+(this.props.object.common.max!==void 0||this.props.object.common.unit==="%"?`, ${this.props.t("max:")} ${this.props.object.common.max!==void 0?this.props.object.common.max:100}`:""),onKeyUp:a=>a.key==="Enter"&&this.state.valid&&this.onUpdate(a),onChange:a=>{this.setState({targetValue:a.target.value,valid:Mn.isNumberValid({value:a.target.value,common:this.props.object.common})})}}):this.state.type==="json"?this.renderJsonEditor():this.state.type==="states"?this.renderStates():y.jsx(w.TextField,{variant:"standard",fullWidth:!0,inputRef:this.inputRef,autoFocus:!0,helperText:this.props.t("Press CTRL+ENTER to write the value, when focused"),label:this.props.t("Value"),multiline:!0,onKeyDown:a=>a.ctrlKey&&a.key==="Enter"&&this.onUpdate(a),defaultValue:this.propsValue.toString(),onChange:a=>this.setState({targetValue:a.target.value})})}),(this.props.role==="date"||(i=this.props.role)!=null&&i.startsWith("date."))&&this.state.type==="number"?y.jsx(w.Grid2,{style:{display:"flex",gap:"5px"},size:{xs:6},children:this.renderTimePicker()}):null,this.props.expertMode?y.jsx(w.Grid2,{children:t}):null,this.props.expertMode?y.jsxs(w.Grid2,{children:[y.jsxs(w.FormControl,{variant:"standard",style:pe.quality,children:[y.jsx(w.InputLabel,{children:this.props.t("Quality")}),y.jsxs(w.Select,{variant:"standard",defaultValue:0,onChange:a=>this.q=Number(a.target.value),children:[y.jsx(w.MenuItem,{value:0,children:"0x00 - good"}),y.jsx(w.MenuItem,{value:1,children:"0x01 - general problem"}),y.jsx(w.MenuItem,{value:2,children:"0x02 - no connection problem"}),y.jsx(w.MenuItem,{value:16,children:"0x10 - substitute value from controller"}),y.jsx(w.MenuItem,{value:32,children:"0x20 - substitute initial value"}),y.jsx(w.MenuItem,{value:64,children:"0x40 - substitute value from device or instance"}),y.jsx(w.MenuItem,{value:128,children:"0x80 - substitute value from sensor"}),y.jsx(w.MenuItem,{value:17,children:"0x11 - general problem by instance"}),y.jsx(w.MenuItem,{value:65,children:"0x41 - general problem by device"}),y.jsx(w.MenuItem,{value:129,children:"0x81 - general problem by sensor"}),y.jsx(w.MenuItem,{value:18,children:"0x12 - instance not connected"}),y.jsx(w.MenuItem,{value:66,children:"0x42 - device not connected"}),y.jsx(w.MenuItem,{value:130,children:"0x82 - sensor not connected"}),y.jsx(w.MenuItem,{value:68,children:"0x44 - device reports error"}),y.jsx(w.MenuItem,{value:132,children:"0x84 - sensor reports error"})]})]}),y.jsx(w.TextField,{variant:"standard",title:this.props.t("0 - no expiration"),sx:{"&.MuiTextField-root":pe.expire},label:this.props.t("Expire"),type:"number",slotProps:{htmlInput:{min:0}},helperText:this.props.t("in seconds"),defaultValue:this.expire,onChange:a=>this.expire=Number(a.target.value)})]}):null]})}),this.state.chart&&this.state.chartEnabled&&this.state.type!=="json"?y.jsx(w.Grid2,{size:{xs:6},style:{minHeight:300},sx:{display:{sm:"none",md:"inline-block"}},children:this.renderChart()}):null]})})}),y.jsxs(w.DialogActions,{sx:pe.wrapperButton,children:[this.props.expertMode?null:t,this.props.expertMode?null:y.jsx("div",{style:{flexGrow:1}}),y.jsx(w.Button,{variant:"contained",disabled:!this.state.valid,onClick:a=>this.onUpdate(a),color:"primary",startIcon:this.props.width!=="xs"?y.jsx(W.Check,{}):void 0,style:((n=this.props.object.common)==null?void 0:n.write)===!1?pe.readOnly:void 0,children:this.props.width!=="xs"?this.props.t("Set value"):y.jsx(W.Check,{fontSize:"large"})}),y.jsx(w.Button,{variant:"contained",onClick:()=>this.props.onClose(),color:"grey",startIcon:this.props.width!=="xs"?y.jsx(W.Close,{}):void 0,children:this.props.width!=="xs"?this.props.t("Cancel"):y.jsx(W.Close,{fontSize:"large"})})]})]})}}const E={divWithoutTitle:{width:"100%",height:"100%",border:"2px solid #00000000"},divWithoutTitleAndTab:{height:"calc(100% - 48px)"},error:{border:"2px solid #FF0000"},id:{fontStyle:"italic"},dialog:{height:"calc(100% - 64px)"},aliasIdEdit:{width:368},button:{marginTop:20,marginLeft:8},funcDivEdit:{width:"100%"},funcEditName:{display:"inline-block",width:85},funcEdit:{width:400},funcIcon:{width:16,height:16},marginTop:{marginTop:20},commonTabWrapper:{flexFlow:"wrap",display:"flex",gap:8},commonWrapper:{width:500,minWidth:300},flexDrop:{width:"100%",maxWidth:500,margin:"auto",display:"flex"},marginBlock:{marginTop:20},buttonAdd:{minWidth:150},textField:{width:"100%"},flex:{display:"flex","& > div":{mr:"8px"}},close:{width:"20px",height:"20px",opacity:"0.9",cursor:"pointer",position:"relative",top:20,transition:"all 0.6s ease","&:hover":{transform:"rotate(90deg)"},"&:before":{position:"absolute",left:"9px",content:'""',height:"20px",width:"3px",backgroundColor:"#ff4f4f",transform:"rotate(45deg)"},"&:after":{position:"absolute",left:"9px",content:'""',height:"20px",width:"3px",backgroundColor:"#ff4f4f",transform:"rotate(-45deg)"}},color:{width:70},buttonRemoveWrapper:{position:"absolute",zIndex:222,right:0},tabsPadding:{padding:"0px 24px"},wrapperButton:{"@media screen and (max-width: 465px)":{"& *":{fontSize:10}},"@media screen and (max-width: 380px)":{"& *":{fontSize:9}}},commonDeleteTip:{color:"#fa4a4a"},typeNameEng:{marginLeft:8,opacity:.7,fontStyle:"italic",fontSize:"smaller"},tooltip:{pointerEvents:"none"},stateRow:{width:"100%",display:"flex",justifyContent:"space-between",padding:3},stateTitle:{minWidth:150,fontWeight:"bold"},stateUnit:{opacity:.7,marginLeft:4},stateValue:{animation:"newStateEditorAnimation 2s ease-in-out"},stateTime:{fontStyle:"italic"},stateImage:{maxWidth:200,maxHeight:200}};function pO(r,t){return{"@keyframes newStateEditorAnimation":{"0%":{color:r.palette.mode==="dark"?"#27cf00":"#174e00"},"100%":{color:t||(r.palette.mode==="dark"?"#ffffff":"#000000")}}}}const uo=[{role:"button",type:"boolean",r:!1,w:!0},{role:"button.close.blind",type:"boolean",r:!1,w:!0},{role:"button.fastforward",type:"boolean",r:!1,w:!0},{role:"button.forward",type:"boolean",r:!1,w:!0},{role:"button.long",type:"boolean",r:!1,w:!0},{role:"button.mode",type:"boolean",r:!1,w:!0},{role:"button.mode.auto",type:"boolean",r:!1,w:!0},{role:"button.mode.silent",type:"boolean",r:!1,w:!0},{role:"button.next",type:"boolean",r:!1,w:!0},{role:"button.open.blind",type:"boolean",r:!1,w:!0},{role:"button.open.door",type:"boolean",r:!1,w:!0},{role:"button.pause",type:"boolean",r:!1,w:!0},{role:"button.stop",type:"boolean",r:!1,w:!0},{role:"button.stop.tilt",type:"boolean",r:!1,w:!0},{role:"button.volume.up",type:"boolean",r:!1,w:!0},{role:"chart",type:"string"},{role:"date",type:"string"},{role:"date",type:"number"},{role:"date.end",type:"string"},{role:"date.end",type:"number"},{role:"date.forecast.1",type:"string"},{role:"date.start",type:"string"},{role:"date.start",type:"number"},{role:"date.sunrise",type:"string"},{role:"date.sunrise",type:"number"},{role:"date.sunset",type:"string"},{role:"date.sunset",type:"number"},{role:"dayofweek",type:"number"},{role:"html",type:"string"},{role:"indicator",type:"boolean",w:!1},{role:"indicator.alarm",type:"boolean",w:!1},{role:"indicator.alarm.fire",type:"boolean",w:!1},{role:"indicator.alarm.flood",type:"boolean",w:!1},{role:"indicator.alarm.health",type:"boolean",w:!1},{role:"indicator.alarm.secure",type:"boolean",w:!1},{role:"indicator.connected",type:"boolean",w:!1},{role:"indicator.maintenance",type:"boolean",w:!1},{role:"indicator.maintenance.alarm",type:"boolean",w:!1},{role:"indicator.maintenance.lowbat",type:"boolean",w:!1},{role:"indicator.maintenance.waste",type:"boolean",w:!1},{role:"indicator.reachable",type:"boolean",w:!1},{role:"info.address",type:"string",w:!1},{role:"info.display",type:"string",w:!1},{role:"info.firmware",type:"string",w:!1},{role:"info.hardware",type:"string",w:!1},{role:"info.ip",type:"string",w:!1},{role:"info.mac",type:"string",w:!1},{role:"info.name",type:"string",w:!1},{role:"info.port",type:"string",w:!1},{role:"info.port",type:"number",w:!1},{role:"info.serial",type:"string",w:!1},{role:"info.standby",type:"string",w:!1},{role:"info.status",w:!1},{role:"json",type:"string"},{role:"level",type:"number",w:!0},{role:"level.bass",type:"number",w:!0},{role:"level.blind",type:"number",w:!0},{role:"level.color.blue",type:"number",w:!0},{role:"level.color.hue",type:"number",w:!0},{role:"level.color.luminance",type:"number",w:!0},{role:"level.color.red",type:"number",w:!0},{role:"level.color.saturation",type:"number",w:!0},{role:"level.curtain",type:"number",w:!0},{role:"level.mode.airconditioner",type:"number",w:!0},{role:"level.mode.cleanup",type:"number",w:!0},{role:"level.mode.fan",type:"number",w:!0},{role:"level.mode.swing",type:"number",w:!0},{role:"level.mode.thermostat",type:"number",w:!0},{role:"level.mode.work",type:"number",w:!0},{role:"level.temperature",type:"number",w:!0},{role:"level.tilt",type:"number",w:!0},{role:"level.timer",type:"number",w:!0},{role:"level.treble",type:"number",w:!0},{role:"level.valve",type:"number",w:!0},{role:"level.volume",type:"number",w:!0},{role:"level.volume.group",type:"number",w:!0},{role:"list",type:"string"},{role:"list",type:"array"},{role:"location",type:"string"},{role:"media.add",type:"string"},{role:"media.bitrate",type:"string"},{role:"media.bitrate",type:"number"},{role:"media.broadcastDate",type:"string"},{role:"media.browser",type:"string"},{role:"media.clear",type:"boolean"},{role:"media.content",type:"string"},{role:"media.cover",type:"string"},{role:"media.cover.big",type:"string"},{role:"media.cover.small",type:"string"},{role:"media.date",type:"string"},{role:"media.duration",type:"number"},{role:"media.duration",type:"string"},{role:"media.duration.text",type:"string"},{role:"media.elapsed",type:"number"},{role:"media.elapsed",type:"string"},{role:"media.elapsed.text",type:"string"},{role:"media.episode",type:"number"},{role:"media.episode",type:"string"},{role:"media.genre",type:"string"},{role:"media.input",type:"string"},{role:"media.jump",type:"string"},{role:"media.link",type:"string"},{role:"media.mode.repeat",type:"string"},{role:"media.mode.shuffle",type:"string"},{role:"media.mute",type:"string"},{role:"media.mute.group",type:"string"},{role:"media.playid",type:"string"},{role:"media.playlist",type:"string"},{role:"media.season",type:"string"},{role:"media.seek",type:"string"},{role:"media.state",type:"string"},{role:"media.titel",type:"string"},{role:"media.track",type:"string"},{role:"media.tts",type:"string"},{role:"media.url",type:"string"},{role:"media.url.announcement",type:"string"},{role:"medien.artist",type:"string"},{role:"sensor.alarm",type:"boolean",w:!1},{role:"sensor.alarm.fire",type:"boolean",w:!1},{role:"sensor.alarm.flood",type:"boolean",w:!1},{role:"sensor.alarm.power",type:"boolean",w:!1},{role:"sensor.alarm.secure",type:"boolean",w:!1},{role:"sensor.door",type:"boolean",w:!1},{role:"sensor.light",type:"boolean",w:!1},{role:"sensor.lock",type:"boolean",w:!1},{role:"sensor.motion",type:"boolean",w:!1},{role:"sensor.noise",type:"boolean",w:!1},{role:"sensor.rain",type:"boolean",w:!1},{role:"sensor.window",type:"boolean",w:!1},{role:"state",type:"mixed"},{role:"switch",type:"boolean",w:!0},{role:"switch.enable",type:"boolean",w:!0},{role:"switch.gate",type:"boolean",w:!0},{role:"switch.gate",type:"boolean",w:!0},{role:"switch.light",type:"boolean",w:!0},{role:"switch.lock.door",type:"boolean",w:!0},{role:"switch.lock.window",type:"boolean",w:!0},{role:"switch.mode",type:"boolean",w:!0},{role:"switch.mode.auto",type:"boolean",w:!0},{role:"switch.mode.boost",type:"boolean",w:!0},{role:"switch.mode.color",type:"boolean",w:!0},{role:"switch.mode.manual",type:"boolean",w:!0},{role:"switch.mode.moonlight",type:"boolean",w:!0},{role:"switch.mode.party",type:"boolean",w:!0},{role:"switch.mode.silent",type:"boolean",w:!0},{role:"switch.power",type:"boolean",w:!0},{role:"switch.power.zone",type:"boolean",w:!0},{role:"text",type:"string"},{role:"text.phone",type:"string"},{role:"text.url",type:"string"},{role:"url",type:"string"},{role:"url.audio",type:"string"},{role:"url.blank",type:"string"},{role:"url.cam",type:"string"},{role:"url.same",type:"string"},{role:"value",type:"number",w:!1},{role:"value.battery",type:"number",w:!1},{role:"value.blind",type:"number",w:!1},{role:"value.blood.sugar",type:"number",w:!1},{role:"value.brightness",type:"number",w:!1},{role:"value.clouds",type:"number",w:!1},{role:"value.current",type:"number",w:!1},{role:"value.curtain",type:"number",w:!1},{role:"value.default",type:"number",w:!1},{role:"value.direction",type:"number",w:!1},{role:"value.direction.max.wind",type:"number",w:!1},{role:"value.direction.min.wind",type:"number",w:!1},{role:"value.direction.wind",type:"number",w:!1},{role:"value.direction.wind.forecast.0",type:"number",w:!1},{role:"value.direction.wind.forecast.1",type:"number",w:!1},{role:"value.distance",type:"number",w:!1},{role:"value.fill",type:"number",w:!1},{role:"value.gate",type:"number",w:!1},{role:"value.gps",type:"number",w:!1},{role:"value.gps.accuracy",type:"number",w:!1},{role:"value.gps.elevation",type:"number",w:!1},{role:"value.gps.latitude",type:"number",w:!1},{role:"value.gps.longitude",type:"number",w:!1},{role:"value.gps.radius",type:"number",w:!1},{role:"value.health.bmi",type:"number",w:!1},{role:"value.health.bpm",type:"number",w:!1},{role:"value.health.calories",type:"number",w:!1},{role:"value.health.fat",type:"number",w:!1},{role:"value.health.steps",type:"number",w:!1},{role:"value.health.weight",type:"number",w:!1},{role:"value.humidity",type:"number",w:!1},{role:"value.humidity",type:"number",w:!1},{role:"value.humidity.max",type:"number",w:!1},{role:"value.humidity.min",type:"number",w:!1},{role:"value.interval",type:"number",w:!1},{role:"value.lock",type:"number",w:!1},{role:"value.min",type:"number",w:!1},{role:"value.position",type:"number",w:!1},{role:"value.power",type:"number",w:!1},{role:"value.power.consumption",type:"number",w:!1},{role:"value.power.production",type:"number",w:!1},{role:"value.power.reactive",type:"number",w:!1},{role:"value.precipitation",type:"number",w:!1},{role:"value.precipitation.chance",type:"number",w:!1},{role:"value.precipitation.day.forecast.0",type:"number",w:!1},{role:"value.precipitation.forecast.0",type:"number",w:!1},{role:"value.precipitation.hour",type:"number",w:!1},{role:"value.precipitation.night.forecast.0",type:"number",w:!1},{role:"value.precipitation.today",type:"number",w:!1},{role:"value.precipitation.type",type:"number",w:!1},{role:"value.prepitation.forecast.0",type:"number",w:!1},{role:"value.prepitation.forecast.1",type:"number",w:!1},{role:"value.prepitation.forecast.1",type:"number",w:!1},{role:"value.pressure",type:"number",w:!1},{role:"value.pressure.forecast.0",type:"number",w:!1},{role:"value.pressure.forecast.1",type:"number",w:!1},{role:"value.radiation",type:"number",w:!1},{role:"value.rain",type:"number",w:!1},{role:"value.rain.hour",type:"number",w:!1},{role:"value.rain.today",type:"number",w:!1},{role:"value.severity",type:"number",w:!1},{role:"value.snow",type:"number",w:!1},{role:"value.snow.hour",type:"number",w:!1},{role:"value.snow.today",type:"number",w:!1},{role:"value.snowline",type:"number",w:!1},{role:"value.speed",type:"number",w:!1},{role:"value.speed.max.wind",type:"number",w:!1},{role:"value.speed.min.wind",type:"number",w:!1},{role:"value.speed.wind",type:"number",w:!1},{role:"value.speed.wind.forecast.0",type:"number",w:!1},{role:"value.speed.wind.gust",type:"number",w:!1},{role:"value.state",type:"number",w:!1},{role:"value.sun.azimuth",type:"number",w:!1},{role:"value.sun.elevation",type:"number",w:!1},{role:"value.temperature",type:"number",w:!1},{role:"value.temperature",type:"number",w:!1},{role:"value.temperature.dewpoint",type:"number",w:!1},{role:"value.temperature.feelslike",type:"number",w:!1},{role:"value.temperature.max",type:"number",w:!1},{role:"value.temperature.max.forecast.0",type:"number",w:!1},{role:"value.temperature.min",type:"number",w:!1},{role:"value.temperature.min.forecast.0",type:"number",w:!1},{role:"value.temperature.min.forecast.1",type:"number",w:!1},{role:"value.temperature.windchill",type:"number",w:!1},{role:"value.tilt",type:"number",w:!1},{role:"value.time",type:"number",w:!1},{role:"value.uv",type:"number",w:!1},{role:"value.valve",type:"number",w:!1},{role:"value.voltage",type:"number",w:!1},{role:"value.warning",type:"number",w:!1},{role:"value.waste",type:"number",w:!1},{role:"value.water",type:"number",w:!1},{role:"waether.title",type:"string",w:!1},{role:"weather.chart.url",type:"string",w:!1},{role:"weather.chart.url.forecast",type:"string",w:!1},{role:"weather.direction.wind",type:"number",w:!1},{role:"weather.direction.wind.forecast.0",type:"number",w:!1},{role:"weather.html",type:"string",w:!1},{role:"weather.icon",type:"string",w:!1},{role:"weather.icon.forecast.1",type:"string",w:!1},{role:"weather.icon.name",type:"string",w:!1},{role:"weather.icon.wind",type:"string",w:!1},{role:"weather.json",type:"string",w:!1},{role:"weather.state",type:"number",w:!1},{role:"weather.state",type:"string",w:!1},{role:"weather.state.forecast.0",type:"string",w:!1},{role:"weather.state.forecast.1",type:"string",w:!1},{role:"weather.title.forecast.0",type:"string",w:!1},{role:"weather.title.short",type:"string",w:!1},{role:"weather.type",type:"number",w:!1},{role:"weather.type",type:"string",w:!1}];class Vt extends at.Component{originalObj;subscribed=!1;updateTimer=null;constructor(t){super(t);const e=this.props.obj._id.startsWith("alias.0")&&this.props.obj.type==="state";let i=(window._localStorage||window.localStorage).getItem(`${this.props.dialogName||"App"}.editTab`)||"object";i==="alias"&&!e&&(i="common"),this.props.aliasTab&&e&&(i="alias");const n=this.props.obj,a=n.common&&"type"in n.common&&"alias"in n.common?n.common.alias.read:void 0,o=n.common&&"type"in n.common&&"alias"in n.common?n.common.alias.write:void 0;this.state={text:JSON.stringify(this.props.obj,null,2),error:!1,customError:!1,changed:!1,readError:this.checkFunction(a,!1),writeError:this.checkFunction(o,!0),tab:i,showCopyDialog:"",showCommonDeleteMessage:!1,selectId:!1,selectRead:!1,selectWrite:!1,newId:"",lang:O.I18n.getLanguage(),value:void 0},Hl.locale(this.state.lang),this.originalObj=JSON.stringify(this.props.obj,null,2)}async componentDidMount(){var i,n,a;const t=((n=(i=this.props.obj)==null?void 0:i.common)==null?void 0:n.editSchemas)||((a=this.props.obj)==null?void 0:a.editSchemas),e=[];if(t)if(typeof t=="object"){const o=Object.keys(t);for(let s=0;s<o.length;s++)try{const l=await O.iobUriRead(t[o[s]],this.props.socket);if(l.key=o[s],l&&typeof l=="object"&&e.push(l),l.icon)try{const u=O.iobUriParse(l.icon);if(u.type!=="base64"&&u.type!=="http"){const h=await O.iobUriRead(u,this.props.socket);h&&(l.icon=h)}}catch(u){console.warn(`Cannot get icon for schema from "${l.icon}": ${u}`),l.icon=void 0}}catch(l){console.warn(`Cannot get edit schema for "${t[o[s]]}": ${l}`)}e.length&&(e.sort((s,l)=>s.order!==void 0&&l.order!==void 0?s.order-l.order:s.order!==void 0?-1:l.order!==void 0||s.key>l.key?1:-1),this.setState({customEditTabs:e}))}else console.warn(`Invalid edit schema for "${t}": expected object, but got ${typeof t}`);this.state.tab==="alias"&&(!this.props.obj._id.startsWith("alias.0")||this.props.obj.type!=="state")?this.setState({tab:"object"}):this.state.tab==="state"&&this.props.obj.type!=="state"?this.setState({tab:"object"}):this.state.tab!=="object"&&this.state.tab!=="common"&&this.state.tab!=="alias"&&this.state.tab!=="state"&&!e.find(o=>o.key===this.state.tab)&&this.setState({tab:"object"}),this.state.tab==="state"&&this.subscribeOnState(!0),this.props.socket.subscribeObject(this.props.obj._id,this.onObjectUpdated)}componentWillUnmount(){this.updateTimer&&(clearInterval(this.updateTimer),this.updateTimer=null),this.subscribeOnState(!1),this.props.socket.unsubscribeObject(this.props.obj._id,this.onObjectUpdated)}onObjectUpdated=(t,e)=>{this.originalObj!==JSON.stringify(e,null,2)&&(this.originalObj=JSON.stringify(e,null,2),this.state.changed?this.forceUpdate():this.setState({text:this.originalObj}))};checkFunction(t,e){var a,o,s,l;if(!t||t.includes("JSON.parse("))return"";let i;try{i=JSON.parse(this.state.text)}catch{}let n;try{n=new Function("val",t.includes("return")?t:`return ${t}`)}catch{return this.props.t("Cannot parse code!")}if((a=i==null?void 0:i.common)!=null&&a.type&&((l=(s=this.props.objects[(o=i.common.alias)==null?void 0:o.id])==null?void 0:s.common)!=null&&l.type)){const u=e?i.common.type:this.props.objects[i.common.alias.id].common.type,h=e?this.props.objects[i.common.alias.id].common.type:i.common.type;if(u&&h){let c=null;if(u==="boolean"?c=!0:u==="number"?c=1:(u==="string"||u==="mixed")&&(c="string"),c!==null)try{const f=n(c);return h==="mixed"?"":f!==null&&typeof f!==h?this.props.t("Type of result is not as expected: %s",h):""}catch(f){return`${this.props.t("Cannot execute function")}: ${f.toString()}`}}}return""}prepareObject(t){var e,i,n,a;t=t||this.state.text;try{const o=JSON.parse(t);return o._id=this.props.obj._id,(e=o.common)!=null&&e.alias&&(o.common.alias.id||delete o.common.alias.id,(!o.common.alias.read&&o.common.alias.read!==void 0||o.common.alias.read==="val")&&delete o.common.alias.read,(!o.common.alias.write&&o.common.alias.write!==void 0||o.common.alias.write==="val")&&delete o.common.alias.write,!o.common.alias.id&&!o.common.alias.read&&!o.common.alias.write&&delete o.common.alias),((i=o.common)==null?void 0:i.min)!==void 0&&typeof o.common.min!="number"&&(o.common.min=parseFloat(o.common.min)),((n=o.common)==null?void 0:n.max)!==void 0&&typeof o.common.max!="number"&&(o.common.max=parseFloat(o.common.max)),((a=o.common)==null?void 0:a.step)!==void 0&&typeof o.common.step!="number"&&(o.common.step=parseFloat(o.common.step)),o}catch{return null}}onChange(t,e){var a,o,s,l;const i=this.prepareObject(t),n={text:t};if(i){n.changed=this.originalObj!==JSON.stringify(i,null,2),n.showCommonDeleteMessage=!1;const u=JSON.parse(this.originalObj);i.common&&Object.keys(u.common||{}).forEach(h=>{i.common[h]===void 0&&(n.showCommonDeleteMessage=!0)}),n.error=!1,n.readError=this.checkFunction((o=(a=i.common)==null?void 0:a.alias)==null?void 0:o.read,!1),n.writeError=this.checkFunction((l=(s=i.common)==null?void 0:s.alias)==null?void 0:l.write,!0)}else n.showCommonDeleteMessage=!1,n.error=!0;this.setState(n,()=>e&&e())}onUpdate(){var t,e,i,n;try{const a=JSON.parse(this.state.text);a._id=this.props.obj._id,(t=a.common)!=null&&t.alias&&(a.common.alias.id||delete a.common.alias.id,(!a.common.alias.read&&a.common.alias.read!==void 0||a.common.alias.read==="val")&&delete a.common.alias.read,(!a.common.alias.write&&a.common.alias.write!==void 0||a.common.alias.write==="val")&&delete a.common.alias.write,!a.common.alias.id&&!a.common.alias.read&&!a.common.alias.write&&delete a.common.alias),((e=a.common)==null?void 0:e.min)!==void 0&&typeof a.common.min!="number"&&(a.common.min=parseFloat(a.common.min)),((i=a.common)==null?void 0:i.max)!==void 0&&typeof a.common.max!="number"&&(a.common.max=parseFloat(a.common.max)),((n=a.common)==null?void 0:n.step)!==void 0&&typeof a.common.step!="number"&&(a.common.step=parseFloat(a.common.step)),this.props.onClose(a)}catch{console.error(`Cannot parse: ${this.state.text}`)}}static getPartOfObject(t,e){return e?O.getAttrInObject(JSON.parse(t),e.split(".")):JSON.parse(t)}static setPartOfObject(t,e,i){let n=JSON.parse(t);return n===void 0?t:(n=O.setAttrInObject(n,i.split("."),e),JSON.stringify(n,null,2))}renderCustomPanel(){var i;const t=(i=this.state.customEditTabs)==null?void 0:i.find(n=>n.key===this.state.tab);if(!t)return null;let e;try{e=Vt.getPartOfObject(this.state.text,t.path)}catch(n){return console.error(`Cannot get data for ${t.path}: ${n}`),y.jsx("div",{children:O.I18n.t("Cannot get data for %s: %s",t.path,n)})}return e?y.jsx(_n.JsonConfigComponent,{theme:this.props.theme,socket:this.props.socket,themeName:this.props.theme.palette.mode,themeType:this.props.theme.palette.mode,dateFormat:this.props.dateFormat,isFloatComma:this.props.isFloatComma,schema:t.json,data:e,onChange:n=>{try{const a=Vt.setPartOfObject(this.state.text,n,t.path);this.onChange(a)}catch(a){console.error(`Cannot set data for ${t.path}: ${a}`)}},adapterName:"",instance:0,onError:n=>{console.warn(`Error in JSON editor: ${n}`),this.state.customError!==n&&this.setState({customError:n})}}):y.jsx("div",{children:O.I18n.t("Cannot get data for %s",t.path)})}renderCustomTab(t,e){var a;let i;if(!e||!O.getAttrInObject(e,(a=t.path)==null?void 0:a.split(".")))return null;t.color&&(i={backgroundColor:t.color,color:O.Utils.invertColor(t.color,!0)});const n=t.label&&typeof t.label=="object"?t.label[this.state.lang]||t.label.en:t.noTranslation?t.label||t.key:this.props.t(t.label||t.key);return y.jsx(w.Tab,{disabled:this.state.error||this.state.customError,value:t.key,label:n,style:i,iconPosition:"start",icon:t.icon?y.jsx(O.Icon,{src:t.icon,style:E.funcIcon}):void 0})}renderStateTab(){return this.props.obj.type!=="state"||this.props.obj.common.type==="file"?null:y.jsx(w.Tab,{disabled:this.state.customError||this.state.error,value:"state",label:this.props.t("State")})}renderStatePanel(){var a;if(this.state.value===void 0||this.state.value===null)return y.jsx("div",{children:this.props.t("State does not exist")});if(typeof this.state.value!="object")return y.jsxs("div",{style:{maxWidth:700},children:[y.jsx("div",{children:this.props.t("State is invalid")}),y.jsx("div",{children:y.jsx("pre",{children:JSON.stringify(this.state.value,null,4)})})]});let t;const e={},i=this.state.value.val,n=typeof i;if(i===void 0)t="[undef]",e.color="#bc6400",e.fontStyle="italic";else if(i===null)t="(null)",e.color="#0047b1",e.fontStyle="italic";else if(typeof this.props.obj.common.role=="string"&&this.props.obj.common.role.match(/^value\.time|^date/))if(i&&n==="string")if(O.Utils.isStringInteger(i))t=new Date(parseInt(i,10)).toString();else try{const o=new Date(i);O.Utils.isValidDate(o)&&(t=o.toString())}catch{}else i&&n==="number"&&(i>946681200&&i<9466812e5?t=new Date(i*1e3).toString():i>9466812e8&&(t=new Date(i).toString()));return t||(n==="number"?Number.isInteger(i)||(t=(Math.round(i*1e9)/1e9).toString(),this.props.isFloatComma&&(t=t.toString().replace(".",","))):n==="boolean"?(t=i?O.I18n.t("true"):O.I18n.t("false"),e.color=i?"#139800":"#cd6b55"):n==="object"?t=JSON.stringify(i):n==="string"&&i.startsWith("data:image/")?t=y.jsx("img",{src:i,alt:"img",style:E.stateImage}):t=i.toString()),Object.assign(e,pO(this.props.theme,e.color)),y.jsxs(w.Box,{style:{...E.divWithoutTitle,padding:"24px 24px 0 24px",fontSize:16,maxWidth:400},sx:{"& .value-line:hover":{backgroundColor:"#00000030"}},children:[y.jsxs("div",{className:"value-line",style:{...E.stateRow,marginBottom:24},children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_value"),":"]}),y.jsxs(w.Box,{component:"div",sx:e,style:E.stateValue,children:[t,(a=this.props.obj.common)!=null&&a.unit?y.jsx("span",{style:E.stateUnit,children:this.props.obj.common.unit}):null]},typeof t=="string"?t:"image")]}),y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("Type"),":"]}),y.jsx("div",{style:E.stateValue,children:n})]}),y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_ts"),":"]}),y.jsx(w.Tooltip,{title:new Date(this.state.value.ts).toLocaleString(),slotProps:{popper:{sx:E.tooltip}},children:y.jsx("div",{style:E.stateValue,children:y.jsx("span",{style:E.stateTime,children:Hl(this.state.value.ts).fromNow()})})})]}),y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_ack"),":"]}),y.jsxs("div",{style:{...E.stateValue,color:this.state.value.ack?"green":"red"},children:[this.state.value.ack?O.I18n.t("Acknowledged"):O.I18n.t("Command"),this.state.value.ack?" (true)":" (false)"]})]}),y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_lc"),":"]}),y.jsx(w.Tooltip,{title:new Date(this.state.value.lc).toLocaleString(),slotProps:{popper:{sx:E.tooltip}},children:y.jsx("div",{style:E.stateValue,children:y.jsx("span",{style:E.stateTime,children:Hl(this.state.value.lc).fromNow()})})})]}),y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_quality"),":"]}),y.jsx("div",{style:E.stateValue,children:O.Utils.quality2text(this.state.value.q||0).join(", ")})]}),y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_from"),":"]}),y.jsx("div",{style:E.stateValue,children:this.state.value.from})]}),y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_user"),":"]}),y.jsx("div",{style:E.stateValue,children:this.state.value.user||"--"})]}),this.state.value.expire?y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_expire"),":"]}),y.jsxs("div",{style:E.stateValue,children:[this.state.value.expire," ",O.I18n.t("sc_seconds")]})]}):null,this.state.value.c?y.jsxs("div",{style:E.stateRow,className:"value-line",children:[y.jsxs("div",{style:E.stateTitle,children:[O.I18n.t("ra_tooltip_comment"),":"]}),y.jsx("div",{style:E.stateValue,children:this.state.value.c})]}):null]})}onStateChange=(t,e)=>{JSON.stringify(e)!==JSON.stringify(this.state.value)&&this.setState({value:e})};subscribeOnState(t){t?this.subscribed||(this.updateTimer||(this.updateTimer=setInterval(()=>{this.forceUpdate()},5e3)),this.subscribed=!0,this.props.socket.subscribeState(this.props.obj._id,this.onStateChange)):this.subscribed&&(this.updateTimer&&(clearInterval(this.updateTimer),this.updateTimer=null),this.subscribed=!1,this.props.socket.unsubscribeState(this.props.obj._id,this.onStateChange))}renderTabs(t){var e;return y.jsxs(w.Tabs,{style:E.tabsPadding,value:this.state.tab,onChange:(i,n)=>{var a,o,s;if((window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.editTab`,n),n==="object"){try{const l=JSON.parse(this.state.text);let u=!1;((a=l.common)==null?void 0:a.min)!==void 0&&typeof l.common.min!="number"&&(l.common.min=parseFloat(l.common.min),u=!0),((o=l.common)==null?void 0:o.max)!==void 0&&typeof l.common.max!="number"&&(l.common.max=parseFloat(l.common.max),u=!0),((s=l.common)==null?void 0:s.step)!==void 0&&typeof l.common.step!="number"&&(l.common.step=parseFloat(l.common.step),u=!0),u&&this.setState({text:JSON.stringify(l,null,2)})}catch{}this.subscribeOnState(!1)}else n==="state"?this.subscribeOnState(!0):this.subscribeOnState(!1);this.setState({tab:n})},children:[y.jsx(w.Tab,{value:"common",disabled:this.state.customError||this.state.error,label:this.props.t("common")}),y.jsx(w.Tab,{value:"object",disabled:this.state.customError,label:this.props.t("Object data")}),this.renderStateTab(),this.props.obj._id.startsWith("alias.0")&&this.props.obj.type==="state"&&y.jsx(w.Tab,{disabled:this.state.customError||this.state.error,value:"alias",label:this.props.t("Alias")}),(e=this.state.customEditTabs)==null?void 0:e.map(i=>this.renderCustomTab(i,t))]})}renderSelectDialog(){var i,n,a,o;if(!this.state.selectId&&!this.state.selectRead&&!this.state.selectWrite)return null;let t="",e;try{e=JSON.parse(this.state.text);const s=e.common&&"type"in e.common&&"alias"in e.common?(i=e.common.alias)==null?void 0:i.read:"",l=e.common&&"type"in e.common&&"alias"in e.common?(n=e.common.alias)==null?void 0:n.write:"";this.state.selectId?t=((o=(a=e.common)==null?void 0:a.alias)==null?void 0:o.id)||"":this.state.selectRead?t=s??"":this.state.selectWrite&&(t=l??"")}catch{console.error(`Cannot parse ${this.state.text}`)}return y.jsx(O.DialogSelectID,{imagePrefix:".",dateFormat:this.props.dateFormat,theme:this.props.theme,isFloatComma:this.props.isFloatComma,socket:this.props.socket,dialogName:"aliasesEdit",title:`${this.props.t("Select for")} ${this.props.obj._id}`,selected:t,onOk:s=>{const l=this.state.selectRead,u=this.state.selectWrite,h=this.state.selectId,c=Array.isArray(s)?s[0]:s;this.setState({selectId:!1,selectRead:!1,selectWrite:!1},()=>{l?this.setAliasItem(e,"id.read",c):u?this.setAliasItem(e,"id.write",c):h&&this.setAliasItem(e,"id",c)})},onClose:()=>this.setState({selectId:!1,selectRead:!1,selectWrite:!1})},"selectDialog")}setAliasItem(t,e,i,n){t.common=t.common||{};const a=t.common.alias||{};e==="id.read"?a.id&&typeof a.id=="object"?a.id.read=i:a.id={read:i,write:i}:e==="id.write"?a.id&&typeof a.id=="object"?a.id.write=i:a.id={read:i,write:i}:a[e]=i,t.common.alias=a,this.onChange(JSON.stringify(t,null,2),n)}setCommonItem(t,e,i){t.common[e]=i,this.onChange(JSON.stringify(t,null,2))}removeCommonItem(t,e){delete t.common[e],this.onChange(JSON.stringify(t,null,2))}static buttonAddKey(t,e){return y.jsx("div",{style:E.marginBlock,children:y.jsx(w.Button,{style:E.buttonAdd,variant:"contained",color:"secondary",startIcon:y.jsx(W.Add,{}),onClick:e,children:O.I18n.t(t)})})}buttonRemoveKey(t,e){const{t:i}=this.props;return y.jsx(w.Tooltip,{title:i("Remove attribute %s",i(t)),slotProps:{popper:{sx:E.tooltip}},children:y.jsx(w.Box,{component:"div",sx:E.close,onClick:e})})}static filterRoles(t,e){const i=[];return t.forEach(n=>(n.type==="mixed"||n.type)===e&&!i.includes(n.role)&&i.push(n.role)),uo.forEach(n=>(n.type==="mixed"||n.type)===e&&!i.includes(n.role)&&i.push(n.role)),i.sort(),i}renderCommonEdit(){try{const t=JSON.parse(this.state.text),e=["number","string","boolean","array","object","mixed"],i=!1,{t:n,obj:a}=this.props,o=a.type==="state",s=a.type==="channel"||a.type==="device"||o,l=Vt.filterRoles(this.props.roleArray,t.common.type);let u;if(t.common.icon&&(u=t.type==="instance"||t.type==="adapter"?`./adapter/${t.common.name}/${t.common.icon}`:t.common.icon,!u.startsWith(".")&&!u.startsWith("/")&&!u.startsWith("data:"))){const f=a._id.split(".");f[0]==="system"?u=`adapter/${f[2]}${u.startsWith("/")?"":"/"}${u}`:u=`adapter/${f[0]}${u.startsWith("/")?"":"/"}${u}`}const h=typeof t.common.desc=="object"&&t.common.desc?t.common.desc[O.I18n.getLanguage()]||t.common.desc.en||"":t.common.desc||"",c=O.Utils.getObjectNameFromObj(t,O.I18n.getLanguage(),{},!1,!0);return y.jsxs(w.Box,{style:E.commonTabWrapper,onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),f.stopPropagation(),this.onUpdate())},children:[y.jsxs(w.Box,{style:{...E.commonWrapper,width:this.props.width==="xs"?"100%":void 0,minWidth:this.props.width==="xs"?"100%":void 0,gap:this.props.width==="xs"?10:8,display:this.props.width==="xs"?"flex":void 0,flexDirection:this.props.width==="xs"?"column":void 0},children:[typeof t.common.name<"u"?y.jsx(w.TextField,{variant:"standard",disabled:i,label:n("Name"),style:{...E.textField,marginTop:8},fullWidth:!0,slotProps:{input:{endAdornment:c?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setCommonItem(t,"name",""),children:y.jsx(W.Close,{})})}):null}},value:c,onChange:f=>this.setCommonItem(t,"name",f.target.value)}):Vt.buttonAddKey("Name",()=>this.setCommonItem(t,"name","")),typeof t.common.desc<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.TextField,{variant:"standard",disabled:i,label:n("Description"),style:{...E.textField,marginTop:8},fullWidth:!0,slotProps:{input:{endAdornment:h?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setCommonItem(t,"desc",""),children:y.jsx(W.Close,{})})}):null}},value:h,onChange:f=>this.setCommonItem(t,"desc",f.target.value)}),this.buttonRemoveKey("Description",()=>this.removeCommonItem(t,"desc"))]}):Vt.buttonAddKey("Description",()=>this.setCommonItem(t,"desc","")),o?typeof t.common.type<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsxs(w.FormControl,{style:E.marginBlock,fullWidth:!0,children:[y.jsx(w.InputLabel,{style:{transform:"scale(0.75)"},children:n("State type")}),y.jsx(w.Select,{variant:"standard",disabled:i,value:t.common.type,onChange:f=>this.setCommonItem(t,"type",f.target.value),children:e.map(f=>y.jsxs(w.MenuItem,{value:f,children:[n(f),y.jsxs("span",{style:E.typeNameEng,children:["(",f,")"]})]},f))})]}),this.buttonRemoveKey("State type",()=>this.removeCommonItem(t,"type"))]}):Vt.buttonAddKey("State type",()=>this.setCommonItem(t,"type","string")):null,y.jsxs(w.Box,{component:"div",sx:{...E.flex,flexWrap:this.props.width==="xs"?"wrap":void 0},children:[o?typeof t.common.read<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.FormControlLabel,{style:E.marginBlock,control:y.jsx(w.Checkbox,{disabled:i,checked:t.common.read,onChange:f=>this.setCommonItem(t,"read",f.target.checked)}),label:n("Readable")}),this.buttonRemoveKey("Readable",()=>this.removeCommonItem(t,"read"))]}):Vt.buttonAddKey("Readable",()=>this.setCommonItem(t,"read",!0)):null,o?typeof t.common.write<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.FormControlLabel,{style:E.marginBlock,control:y.jsx(w.Checkbox,{disabled:i,checked:t.common.write,onChange:f=>this.setCommonItem(t,"write",f.target.checked)}),label:n("Writeable")}),this.buttonRemoveKey("Writeable",()=>this.removeCommonItem(t,"write"))]}):Vt.buttonAddKey("Writeable",()=>this.setCommonItem(t,"write",!0)):null]}),s?typeof t.common.role<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.Autocomplete,{style:E.marginBlock,fullWidth:!0,disabled:i,value:t.common.role,onChange:(f,d)=>{const p=uo.find(v=>v.role===d);p&&(p.w!==void 0&&p.r!==void 0?(this.setCommonItem(t,"write",p.w),this.setCommonItem(t,"read",p.r)):p.w!==void 0?this.setCommonItem(t,"write",p.w):p.r!==void 0&&this.setCommonItem(t,"read",p.r)),d.startsWith("level")||d.startsWith("indicator")||d.startsWith("sensor")||d.startsWith("weather")?t.common.write&&this.setCommonItem(t,"write",!1):d.startsWith("value")||d.startsWith("indicator")||d.startsWith("sensor")||d.startsWith("weather")?t.common.write&&this.setCommonItem(t,"write",!1):d.startsWith("level")||d.startsWith("switch")?t.common.write&&this.setCommonItem(t,"write",!0):d.startsWith("button")&&t.common.read&&this.setCommonItem(t,"read",!1),this.setCommonItem(t,"role",d)},options:l,renderInput:f=>y.jsx(w.TextField,{variant:"standard",...f,label:n("Role")})}),this.buttonRemoveKey("Role",()=>this.removeCommonItem(t,"role"))]}):Vt.buttonAddKey("Role",()=>this.setCommonItem(t,"role","")):null,typeof t.common.color<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.TextField,{variant:"standard",disabled:i,style:{...E.marginBlock,...E.color},label:n("Color"),type:"color",slotProps:{input:{endAdornment:t.common.color?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setCommonItem(t,"color",""),children:y.jsx(W.Close,{})})}):null}},value:t.common.color,onChange:f=>this.setCommonItem(t,"color",f.target.value)}),this.buttonRemoveKey("Color",()=>this.removeCommonItem(t,"color"))]}):Vt.buttonAddKey("Color",()=>this.setCommonItem(t,"color","")),y.jsxs(w.Box,{component:"div",sx:{...E.flex,flexWrap:this.props.width==="xs"?"wrap":void 0,gap:this.props.width==="xs"?"10px":void 0},children:[t.common.type==="number"?typeof t.common.min<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.TextField,{variant:"standard",disabled:i,className:{...E.marginBlock,...E.color},label:n("Min"),value:t.common.min,onChange:f=>this.setCommonItem(t,"min",f.target.value)}),this.buttonRemoveKey("Min",()=>this.removeCommonItem(t,"min"))]}):y.jsx(w.Box,{component:"div",sx:E.flex,children:Vt.buttonAddKey("Min",()=>this.setCommonItem(t,"min",0))}):null,t.common.type==="number"?typeof t.common.max<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.TextField,{variant:"standard",disabled:i,className:{...E.marginBlock,...E.color},label:n("Max"),value:t.common.max,onChange:f=>this.setCommonItem(t,"max",f.target.value)}),this.buttonRemoveKey("Max",()=>this.removeCommonItem(t,"max"))]}):y.jsx(w.Box,{component:"div",sx:E.flex,children:Vt.buttonAddKey("Max",()=>this.setCommonItem(t,"max",100))}):null,t.common.type==="number"?typeof t.common.step<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.TextField,{variant:"standard",disabled:i,className:{...E.marginBlock,...E.color},label:n("Step"),value:t.common.step,onChange:f=>this.setCommonItem(t,"step",f.target.value)}),this.buttonRemoveKey("Step",()=>this.removeCommonItem(t,"step"))]}):y.jsx(w.Box,{component:"div",sx:E.flex,children:Vt.buttonAddKey("Step",()=>this.setCommonItem(t,"step",1))}):null]}),t.common.type==="number"?typeof t.common.unit<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,children:[y.jsx(w.TextField,{variant:"standard",disabled:i,className:{...E.marginBlock,...E.color},label:n("Unit"),slotProps:{input:{endAdornment:t.common.unit?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setCommonItem(t,"unit",""),children:y.jsx(W.Close,{})})}):null}},value:t.common.unit,onChange:f=>this.setCommonItem(t,"unit",f.target.value)}),this.buttonRemoveKey("Unit",()=>this.removeCommonItem(t,"unit"))]}):y.jsx("div",{style:E.flexDrop,children:Vt.buttonAddKey("Unit",()=>this.setCommonItem(t,"unit",""))}):null]}),typeof t.common.icon<"u"?y.jsxs(w.Box,{component:"div",sx:E.flex,style:{flexGrow:1,minWidth:158},children:[y.jsx(O.UploadImage,{disabled:i,maxSize:10*1024,icon:u,removeIconFunc:()=>this.setCommonItem(t,"icon",""),onChange:f=>this.setCommonItem(t,"icon",f)}),this.buttonRemoveKey("Icon",()=>this.removeCommonItem(t,"icon"))]}):y.jsx(w.Box,{component:"div",sx:E.flex,children:Vt.buttonAddKey("Icon",()=>this.setCommonItem(t,"icon",""))})]})}catch{return y.jsx("div",{children:this.props.t("Cannot parse JSON!")})}}renderAliasEdit(){var t,e,i,n,a,o,s,l,u,h,c,f,d,p,v,g,m,_,b,x,C,S,T,I,M,D,P,k,R,L,N,j,Z,U,Y,et,ut,ot,ft,gt;try{const z=JSON.parse(this.state.text),Rt=((e=(t=z.common)==null?void 0:t.alias)==null?void 0:e.read)!==void 0||((n=(i=z.common)==null?void 0:i.alias)==null?void 0:n.write)!==void 0;return y.jsxs(w.Grid2,{container:!0,direction:"column",style:E.marginTop,children:[y.jsx(w.Grid2,{children:y.jsx(w.FormControlLabel,{control:y.jsx(w.Checkbox,{checked:typeof((o=(a=z.common)==null?void 0:a.alias)==null?void 0:o.id)=="object",onChange:()=>{var It,Lt,xt,V,X,K,Ot;typeof((Lt=(It=z.common)==null?void 0:It.alias)==null?void 0:Lt.id)=="object"?this.setAliasItem(z,"id",((X=(V=(xt=z.common)==null?void 0:xt.alias)==null?void 0:V.id)==null?void 0:X.read)||""):this.setAliasItem(z,"id.read",((Ot=(K=z.common)==null?void 0:K.alias)==null?void 0:Ot.id)||"")}}),label:this.props.t("Different IDs for read and write")})}),typeof((l=(s=z.common)==null?void 0:s.alias)==null?void 0:l.id)!="object"?y.jsxs(w.Grid2,{children:[y.jsx(w.TextField,{variant:"standard",label:this.props.t("Alias state"),value:((h=(u=z.common)==null?void 0:u.alias)==null?void 0:h.id)||"",style:E.aliasIdEdit,slotProps:{input:{endAdornment:(f=(c=z.common)==null?void 0:c.alias)!=null&&f.id?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"large",onClick:()=>this.setAliasItem(z,"id",""),children:y.jsx(W.Close,{})})}):null}},onChange:It=>this.setAliasItem(z,"id",It.target.value),margin:"normal"}),y.jsx(w.Fab,{style:E.button,size:"small",onClick:()=>this.setState({selectId:!0,selectRead:!1,selectWrite:!1}),children:"..."})]}):null,typeof((p=(d=z.common)==null?void 0:d.alias)==null?void 0:p.id)=="object"?y.jsxs(w.Grid2,{children:[y.jsx(w.TextField,{variant:"standard",label:this.props.t("Alias read state"),value:((m=(g=(v=z.common)==null?void 0:v.alias)==null?void 0:g.id)==null?void 0:m.read)||"",style:E.aliasIdEdit,slotProps:{input:{endAdornment:(x=(b=(_=z.common)==null?void 0:_.alias)==null?void 0:b.id)!=null&&x.read?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{size:"large",tabIndex:-1,onClick:()=>this.setAliasItem(z,"id.read",""),children:y.jsx(W.Close,{})})}):null}},onChange:It=>this.setAliasItem(z,"id.read",It.target.value),margin:"normal"}),y.jsx(w.Fab,{style:E.button,size:"small",onClick:()=>this.setState({selectId:!1,selectRead:!0,selectWrite:!1}),children:"..."})]}):null,typeof((S=(C=z.common)==null?void 0:C.alias)==null?void 0:S.id)=="object"?y.jsxs(w.Grid2,{children:[y.jsx(w.TextField,{variant:"standard",label:this.props.t("Alias write state"),value:((M=(I=(T=z.common)==null?void 0:T.alias)==null?void 0:I.id)==null?void 0:M.write)||"",style:E.aliasIdEdit,slotProps:{input:{endAdornment:(k=(P=(D=z.common)==null?void 0:D.alias)==null?void 0:P.id)!=null&&k.write?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{size:"large",tabIndex:-1,onClick:()=>this.setAliasItem(z,"id.write",""),children:y.jsx(W.Close,{})})}):null}},onChange:It=>this.setAliasItem(z,"id.write",It.target.value),margin:"normal"}),y.jsx(w.Fab,{style:E.button,size:"small",onClick:()=>this.setState({selectId:!1,selectRead:!1,selectWrite:!0}),children:"..."})]}):null,y.jsx(w.Grid2,{style:E.marginTop,children:y.jsx(w.FormControlLabel,{control:y.jsx(w.Checkbox,{checked:((L=(R=z.common)==null?void 0:R.alias)==null?void 0:L.read)!==void 0||((j=(N=z.common)==null?void 0:N.alias)==null?void 0:j.write)!==void 0,onChange:()=>{Rt?(delete z.common.alias.read,delete z.common.alias.write):(z.common=z.common||{},z.common.alias=z.common.alias||{},z.common.alias.read="val",z.common.alias.write="val"),this.onChange(JSON.stringify(z,null,2))}}),label:this.props.t("Use convert functions")})}),Rt?y.jsx(w.Grid2,{children:y.jsx(w.TextField,{variant:"standard",label:this.props.t("Read converter"),value:((U=(Z=z.common)==null?void 0:Z.alias)==null?void 0:U.read)||"val",style:E.funcEdit,error:!!this.state.readError,slotProps:{input:{endAdornment:(et=(Y=z.common)==null?void 0:Y.alias)!=null&&et.read?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{size:"large",tabIndex:-1,onClick:()=>this.setAliasItem(z,"read",""),children:y.jsx(W.Close,{})})}):null,startAdornment:y.jsx(w.InputAdornment,{position:"start",children:y.jsx(O.IconFx,{style:E.funcIcon})})}},onChange:It=>this.setAliasItem(z,"read",It.target.value),helperText:this.state.readError||`${this.props.t("JS function like")} "val / 5 + 21"`,margin:"normal"})}):null,Rt?y.jsx(w.Grid2,{children:y.jsx(w.TextField,{variant:"standard",label:this.props.t("Write converter"),error:!!this.state.writeError,value:((ot=(ut=z.common)==null?void 0:ut.alias)==null?void 0:ot.write)||"val",helperText:this.state.writeError||`${this.props.t("JS function like")} "(val - 21) * 5"`,style:E.funcEdit,slotProps:{input:{endAdornment:(gt=(ft=z.common)==null?void 0:ft.alias)!=null&>.write?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{size:"large",tabIndex:-1,onClick:()=>this.setAliasItem(z,"write",""),children:y.jsx(W.Close,{})})}):null,startAdornment:y.jsx(w.InputAdornment,{position:"start",children:y.jsx(O.IconFx,{style:E.funcIcon})})}},onChange:It=>this.setAliasItem(z,"write",It.target.value),margin:"normal"})}):null]})}catch{return y.jsx("div",{children:this.props.t("Cannot parse JSON!")})}}onCopy(t){O.Utils.copyToClipboard(this.state.text,t),window.alert(this.props.t("ra_Copied"))}onClone(t,e){const i=JSON.parse(JSON.stringify(this.props.objects[t]));delete i.from,delete i.ts,delete i.user,i._id=e,this.props.objects[i._id]=i,this.props.onNewObject(i)}renderCopyDialog(){return this.state.showCopyDialog?y.jsxs(w.Dialog,{open:!0,maxWidth:"md",fullWidth:!0,onClose:()=>this.setState({showCopyDialog:""}),children:[y.jsx(w.DialogTitle,{children:this.props.t("Enter new ID for this object")}),y.jsx(w.DialogContent,{children:y.jsx(w.TextField,{variant:"standard",autoFocus:!0,fullWidth:!0,label:this.props.t("New object ID"),value:this.state.newId,slotProps:{input:{endAdornment:this.state.newId?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{size:"small",tabIndex:-1,onClick:()=>this.setState({newId:""}),children:y.jsx(W.Close,{})})}):null}},onKeyDown:t=>{t.key==="Enter"&&!this.props.objects[this.state.newId]&&(this.setState({showCopyDialog:""}),this.onClone(this.state.showCopyDialog,this.state.newId))},onChange:t=>this.setState({newId:t.target.value})})}),y.jsxs(w.DialogActions,{children:[y.jsx(w.Button,{disabled:!!this.props.objects[this.state.newId],onClick:()=>{this.setState({showCopyDialog:""}),this.onClone(this.state.showCopyDialog,this.state.newId)},color:"primary",startIcon:y.jsx(W.FileCopy,{}),children:this.props.t("Clone")}),y.jsx(w.Button,{color:"grey",onClick:()=>this.setState({showCopyDialog:""}),startIcon:y.jsx(W.Close,{}),children:this.props.t("Cancel")})]})]}):null}renderPanelObject(t){return y.jsxs("div",{style:{...E.divWithoutTitle,...t?E.divWithoutTitleAndTab:void 0,...this.state.error?E.error:void 0},onKeyDown:e=>{e.ctrlKey&&e.key==="Enter"&&(e.preventDefault(),e.stopPropagation(),this.onUpdate())},children:[y.jsx(Fm,{value:this.state.text,onChange:e=>this.onChange(e),name:"UNIQUE_ID_OF_DIV",themeType:this.props.themeType}),this.state.showCommonDeleteMessage?y.jsx("div",{style:E.commonDeleteTip,children:O.I18n.t("common_delete_tip")}):null]})}render(){const t=this.props.obj,e=t._id.startsWith("alias.0")&&t.type==="state";let i=E.dialog;window.innerWidth>1920&&(i={...i,maxWidth:"calc(100% - 150px)"});let n;try{n=JSON.parse(this.state.text)}catch{}return y.jsxs(w.Dialog,{sx:{"& .MuiPaper-root":i},open:!0,maxWidth:"xl",fullWidth:!0,fullScreen:!1,onClose:()=>this.props.onClose(),"aria-labelledby":"edit-value-dialog-title","aria-describedby":"edit-value-dialog-description",children:[y.jsxs(w.DialogTitle,{id:"edit-value-dialog-title",style:{width:"calc(100% - 32px)",overflow:"hidden",textOverflow:"ellipsis"},children:[this.props.t("Edit object:")," ",y.jsx(w.Box,{component:"span",style:E.id,sx:{fontSize:{xs:10}},children:this.props.obj._id})]}),this.renderTabs(n),this.renderCopyDialog(),y.jsxs(w.DialogContent,{sx:{p:this.props.width==="xs"&&this.state.tab==="object"?"6px":this.state.tab==="object"||this.state.tab==="common"||this.state.tab==="alias"?"0 24px":"0 6px",overflow:this.state.tab==="object"||this.state.tab==="common"||this.state.tab==="alias"?void 0:"hidden"},children:[this.state.tab==="object"?this.renderPanelObject(e):null,this.state.tab==="alias"&&this.props.obj._id.startsWith("alias.0")&&this.props.obj.type==="state"?this.renderAliasEdit():null,this.state.tab==="common"?this.renderCommonEdit():null,this.state.tab==="state"?this.renderStatePanel():null,this.renderCustomPanel(),this.renderSelectDialog()]}),y.jsxs(w.DialogActions,{sx:E.wrapperButton,children:[y.jsx(w.Button,{color:"grey",onClick:()=>this.setState({showCopyDialog:this.props.obj._id,newId:this.props.obj._id}),disabled:this.state.error||this.state.changed,title:this.props.t("Create a copy of this object"),children:y.jsx(W.FileCopy,{fontSize:this.props.width==="xs"?"large":void 0})}),y.jsx("div",{style:{flexGrow:1}}),this.state.tab==="object"&&y.jsx(w.Button,{color:"grey",onClick:a=>this.onCopy(a),disabled:this.state.error,title:this.props.width==="xs"?this.props.t("Copy into clipboard"):"",startIcon:this.props.width==="xs"?void 0:y.jsx(xd,{}),children:this.props.width==="xs"?y.jsx(xd,{fontSize:32}):this.props.t("Copy into clipboard")}),y.jsx(w.Button,{variant:"contained",disabled:this.state.error||!this.state.changed||this.state.customError,onClick:()=>this.onUpdate(),startIcon:this.props.width==="xs"?void 0:y.jsx(W.Check,{}),color:"primary",children:this.props.width==="xs"?y.jsx(W.Check,{fontSize:"large"}):this.props.t("Write")}),y.jsx(w.Button,{color:"grey",variant:"contained",onClick:()=>this.props.onClose(),startIcon:this.props.width==="xs"?void 0:y.jsx(W.Close,{}),children:this.props.width==="xs"?y.jsx(W.Close,{fontSize:"large"}):this.props.t("Cancel")})]})]})}}class dd extends at.Component{object=null;constructor(t){super(t),this.state={role:null,initRole:null,roleInput:null}}componentDidMount(){this.props.socket.getObject(this.props.id).then(t=>{var i;this.object=t;const e=((i=t==null?void 0:t.common)==null?void 0:i.role)||null;this.setState({role:e,initRole:e,roleInput:e})}).catch(t=>console.error(t))}onUpdate(){this.object.common=this.object.common||{},this.object.common.role=this.state.roleInput,this.props.socket.setObject(this.object._id,this.object).then(()=>this.props.onClose(this.object))}static filterRoles(t,e){const i=[];return t.forEach(n=>(n.type==="mixed"||n.type)===e&&!i.includes(n.role)&&i.push(n.role)),uo.forEach(n=>(n.type==="mixed"||n.type)===e&&!i.includes(n.role)&&i.push(n.role)),i.sort(),i}render(){return y.jsxs(w.Dialog,{open:!0,maxWidth:"sm",fullWidth:!0,onClose:()=>this.props.onClose(),"aria-labelledby":"edit-role-dialog-title","aria-describedby":"edit-role-dialog-description",children:[y.jsx(w.DialogTitle,{id:"edit-role-dialog-title",children:this.object?this.props.t("Update role for %s",this.object._id):null}),y.jsx(w.DialogContent,{children:y.jsx(w.Autocomplete,{freeSolo:!0,options:dd.filterRoles(this.props.roleArray,this.props.commonType),style:{width:"100%"},value:this.state.role,onChange:(t,e)=>this.setState({role:e,roleInput:e}),onInputChange:(t,e)=>this.setState({roleInput:e}),renderInput:t=>y.jsx(w.TextField,{variant:"standard",...t,label:this.props.t("Role")})})}),y.jsxs(w.DialogActions,{children:[y.jsx(w.Button,{disabled:this.state.initRole===this.state.roleInput,variant:"contained",onClick:()=>this.onUpdate(),color:"primary",startIcon:y.jsx(W.Check,{}),children:this.props.t("Apply")}),y.jsx(w.Button,{variant:"contained",onClick:()=>this.props.onClose(),color:"grey",startIcon:y.jsx(W.Close,{}),children:this.props.t("Cancel")})]})]},"objectBrowserEditRole")}}const vO=["array","boolean","file","json","mixed","number","object","string"],gO={boolean:!1,string:"",number:0},Fe={state:{name:"State",value:"state"},channel:{name:"Channel",value:"channel"},device:{name:"Device",value:"device"},folder:{name:"Folder",value:"folder"}},mO=({onClose:r,onApply:t,selected:e,setObject:i,objects:n,expertMode:a,initialType:o,initialStateType:s})=>{var T;const l={state:O.I18n.t("New state"),channel:O.I18n.t("New channel"),device:O.I18n.t("New device"),folder:O.I18n.t("New folder")},u=[],h=(T=n[e])==null?void 0:T.type;n[e]?h==="channel"?(u.push(Fe.state),o=o||"state"):h==="device"?(o=o||"channel",u.push(Fe.state),u.push(Fe.channel)):h==="state"?o=o||"":(u.push(Fe.state),u.push(Fe.channel),u.push(Fe.device),e.startsWith("0_userdata.")||e.startsWith("alias.0.")||e==="0_userdata"||e==="alias.0"?(u.push(Fe.folder),o=o||"folder"):o=o||"state"):(u.push(Fe.folder),o=o||"folder",a&&(e.startsWith("mqtt.")||e.startsWith("javascript."))&&(u.push(Fe.state),u.push(Fe.channel),u.push(Fe.device)));const c=(window._localStorage||window.localStorage).getItem("App.lastObjectType");c&&u.find(I=>I.value===c)&&(o=c);function f(I){return`${e}.${I.toString().replace(O.Utils.FORBIDDEN_CHARS,"_").replace(/\s/g,"_").replace(/\./g,"_")}`}const[d,p]=at.useState(o),[v,g]=at.useState(l[o]),[m,_]=at.useState(s||(window._localStorage||window.localStorage).getItem("App.lastStateType")||"string"),[b,x]=at.useState(!n[f(l.state)]),C=()=>{const I={common:{name:v,desc:O.I18n.t("Manually created")},type:d};d==="state"?(I.common={...I.common,role:"state",type:m,read:!0,write:!0,def:gO[m]},I.native={}):d!=="folder"?I.common={...I.common,role:"",icon:""}:delete I.common.desc,i(`${e}.${v.split(" ").join("_")}`,I).then(()=>t())},S=O.I18n.getLanguage();return y.jsxs(w.Dialog,{open:!0,fullWidth:!0,maxWidth:"md",disableEscapeKeyDown:!1,onClose:r,children:[y.jsx(w.DialogTitle,{children:y.jsxs("div",{style:{margin:10,fontSize:20,display:"flex",alignItems:"center",gap:8},children:[y.jsx(W.AddBox,{}),O.I18n.t("Add new object:"),y.jsxs("span",{style:{fontStyle:"italic"},children:[e,".",v]})]})}),y.jsx(w.DialogContent,{children:y.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[y.jsx(w.TextField,{variant:"standard",label:O.I18n.t("Parent"),style:{margin:"5px 0"},disabled:!0,value:e}),y.jsxs(w.FormControl,{variant:"standard",style:{marginTop:10,marginBottom:16},children:[y.jsx(w.InputLabel,{children:O.I18n.t("Type")}),y.jsx(w.Select,{variant:"standard",value:d,onChange:I=>{(window._localStorage||window.localStorage).setItem("App.lastObjectType",I.target.value),v===l[d]&&(g(l[I.target.value]),x(!!n[f(l[I.target.value])])),p(I.target.value)},children:u.map(I=>y.jsxs(w.MenuItem,{value:I.value,children:[O.I18n.t(I.name),S!=="en"&&y.jsxs("span",{style:{fontSize:"smaller",opacity:.6,marginLeft:4},children:["(",I.value,")"]})]},I.value))})]}),d==="state"&&y.jsxs(w.FormControl,{style:{marginTop:10,marginBottom:16},children:[y.jsx(w.InputLabel,{style:{left:-14},children:O.I18n.t("State type")}),y.jsx(w.Select,{style:{marginTop:6},variant:"standard",value:m,onChange:I=>{(window._localStorage||window.localStorage).setItem("App.lastStateType",I.target.value),_(I.target.value)},children:vO.map(I=>y.jsxs(w.MenuItem,{value:I,children:[O.I18n.t(I),S!=="en"&&O.I18n.t(I)!==I&&y.jsxs("span",{style:{fontSize:"smaller",opacity:.6,marginLeft:4},children:["(",I,")"]})]},I))})]}),y.jsx(w.TextField,{variant:"standard",label:O.I18n.t("Name"),style:{margin:"5px 0"},autoFocus:!0,value:v,onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),v&&C())},slotProps:{input:{endAdornment:v?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>g(""),children:y.jsx(W.Close,{})})}):null}},onChange:I=>{x(!n[f(I.target.value)]),g(I.target.value)}})]})}),y.jsxs(w.DialogActions,{children:[y.jsx(w.Button,{id:"add-new-object-dialog-add",startIcon:y.jsx(W.Check,{}),disabled:!v||!d||!b||d==="state"&&!m,onClick:()=>C(),variant:"contained",color:"primary",children:O.I18n.t("add")}),y.jsx(w.Button,{id:"add-new-object-dialog-cancel",color:"grey",onClick:r,variant:"contained",startIcon:y.jsx(W.Close,{}),children:O.I18n.t("ra_Cancel")})]})]})},yO=[{Owner:[{name:"read",valueNum:1024,title:"read owner"},{name:"write",valueNum:512,title:"write owner"}]},{Group:[{name:"read",valueNum:64,title:"read group"},{name:"write",valueNum:32,title:"write group"}]},{Everyone:[{name:"read",valueNum:4,title:"read everyone"},{name:"write",valueNum:2,title:"write everyone"}]}];function jm(r,t,e){return r|=t&e,r&=t|~e&65535,r}const Nm=({value:r,setValue:t,t:e,differentValues:i,applyToChildren:n,mask:a,setMask:o,disabled:s})=>{at.useEffect(()=>{if(n){let u=0;for(let h=0;h<i.length;h++)u|=r^i[h];o(u)}else o(0)},[i,n,o,r]);let l=r;return y.jsx("div",{style:{display:"flex",width:"fit-content",margin:20,border:"1px solid",borderLeft:0},children:yO.map(u=>{const h=Object.keys(u)[0];return y.jsxs("div",{style:{width:150,height:150,display:"flex",flexDirection:"column",alignItems:"center",borderLeft:"1px solid"},children:[y.jsx("div",{style:{height:50,display:"flex",alignItems:"center",fontSize:18,borderBottom:"1px solid silver",width:"100%",justifyContent:"center"},children:e(h)}),y.jsx("div",{style:{display:"flex",width:"100%"},children:u[h].map((c,f)=>{let d=!1;l-c.valueNum>=0&&(l-=c.valueNum,d=!0);const p=a&c.valueNum;return y.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,alignItems:"center",borderRight:f===0?"1px solid":0},children:[y.jsx("div",{style:{height:50,borderBottom:"1px solid",width:"100%",justifyContent:"center",display:"flex",alignItems:"center",color:"silver"},children:e(c.name)}),y.jsx("div",{style:{height:50,display:"flex"},children:y.jsx(w.Checkbox,{disabled:s,checked:d,color:p?"primary":"secondary",indeterminate:!!p,style:p?{opacity:.5}:void 0,onChange:v=>{p&&(a&=~c.valueNum&65535,o(a));let g=r;v.target.checked?g|=c.valueNum:g&=~c.valueNum&65535,t(g)}})})]},c.valueNum)})})]},h)})})},_O=({onClose:r,onApply:t,selected:e,extendObject:i,objects:n,t:a,modalEmptyId:o,themeType:s,theme:l})=>{const[u,h]=at.useState(null),[c,f]=at.useState(null),[d,p]=at.useState([]),[v,g]=at.useState([]),[m,_]=at.useState(!1),[b,x]=at.useState(!1),[C,S]=at.useState(0),[T,I]=at.useState(null),[M,D]=at.useState(null),[P,k]=at.useState(!1),[R,L]=at.useState(!1),[N,j]=at.useState([]),[Z,U]=at.useState([]),[Y,et]=at.useState(0),[ut,ot]=at.useState(0),[ft,gt]=at.useState([]),[z,Rt]=at.useState(!1),[It,Lt]=at.useState(!0),xt=a("different");return at.useEffect(()=>{var gd,md,yd,_d;let V=0;const X=[],K=[],Ot=e||o,St=`${Ot}.`,oe=Object.keys(n).sort();let Ee=!1;const ti=[],Sr=[],ei=O.I18n.getLanguage();let Zn=!1,qn=!1,Ji=null,Qi=null,ri=null,ii=null;const vd=[];for(let ni=0;ni<oe.length;ni++){const Cr=oe[ni],ht=n[Cr];if(ht&&(Cr===Ot||Cr.startsWith(St))){if(V++,vd.push(Cr),!ht.acl)continue;ri===null&&ht.acl.object!==void 0&&(ri=ht.acl.object),ii===null&&ht.acl.state!==void 0&&(ii=ht.acl.state),Ji===null&&ht.acl.owner!==void 0&&(Ji=ht.acl.owner),Qi===null&&ht.acl.ownerGroup!==void 0&&(Qi=ht.acl.ownerGroup),!P&&Ji!==ht.acl.owner&&ht.acl.owner!==void 0&&(Zn=!0),!R&&Qi!==ht.acl.ownerGroup&&ht.acl.ownerGroup!==void 0&&(qn=!0),ht.acl.state!==void 0&&ii!==ht.acl.state&&!X.includes(ht.acl.state)&&X.push(ht.acl.state),ht.acl.object!==void 0&&ri!==ht.acl.object&&!K.includes(ht.acl.object)&&K.push(ht.acl.object),ht.type==="state"&&(Ee=!0)}Cr.startsWith("system.group.")&&(ht==null?void 0:ht.type)==="group"?ti.push({name:O.Utils.getObjectNameFromObj(ht,ei).replace("system.group.",""),value:Cr,icon:(gd=ht.common)==null?void 0:gd.icon,color:(md=ht.common)==null?void 0:md.color}):Cr.startsWith("system.user.")&&(ht==null?void 0:ht.type)==="user"&&Sr.push({name:O.Utils.getObjectNameFromObj(ht,ei).replace("system.user.",""),value:Cr,icon:(yd=ht.common)==null?void 0:yd.icon,color:(_d=ht.common)==null?void 0:_d.color})}Ji=Ji||n["system.config"].common.defaultNewAcl.owner,Qi=Qi||n["system.config"].common.defaultNewAcl.ownerGroup,ri=ri||n["system.config"].common.defaultNewAcl.object,I(Number.isNaN(ri)?n["system.config"].common.defaultNewAcl.object:ri),Ee&&(ii=ii||n["system.config"].common.defaultNewAcl.state,D(Number.isNaN(ii)?n["system.config"].common.defaultNewAcl.state:ii));const Ix=Sr.find(ni=>ni.value===Ji),Mx=ti.find(ni=>ni.value===Qi);h(Ix),f(Mx),k(Zn),L(qn),p(Sr),g(ti),Ee&&x(!0),o&&_(!0),S(V),j(X),U(K),gt(vd)},[n,e,R,P,o]),at.useEffect(()=>{m?(R&&(c.value!=="different"&&f({name:xt,value:"different"}),v.find(V=>V.value==="different")||g(V=>[{name:xt,value:"different"},...V])),P&&((!u||u.value!=="different")&&h({name:xt,value:"different"}),d.find(V=>V.value==="different")||p(V=>[{name:xt,value:"different"},...V]))):(u&&u.value==="different"&&h(n[e].acl.owner),c&&c.value==="different"&&f(n[e].acl.ownerGroup),g(V=>V.filter(({value:X})=>X!=="different")),p(V=>V.filter(({value:X})=>X!=="different")))},[d,m,P,R,n,e,c,u,xt,v]),ft.length?y.jsx(Nx,{theme:l,titleButtonApply:"apply",overflowHidden:!0,disableApply:It,progress:z,onClose:r,onApply:()=>{Rt(!0),setTimeout(()=>{if(m){const V=~Y&65535,X=~ut&65535;for(let K=0;K<ft.length;K++){const Ot=ft[K],St=n[Ot],oe=O.Utils.clone(St.acl||{});oe.object=jm(St.acl.object,T,V),u&&u.value!=="different"&&(oe.owner=u.value),c&&c.value!=="different"&&(oe.ownerGroup=c.value),St.type==="state"&&(oe.state=jm(St.acl.state,M,X)),i(Ot,{acl:oe})}}else{const V=O.Utils.clone(n[e].acl||{});V.object=T,V.owner=u?u.value:"system.user.admin",V.ownerGroup=c?c.value:"system.group.administrator",n[e].type==="state"&&(V.state=M),i(e,{acl:V})}Rt(!1),t()},200)},children:y.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[y.jsx("div",{style:{margin:10,fontSize:20},children:a("Access control list: %s",e||o)}),y.jsxs("div",{style:{display:"flex"},children:[y.jsxs(w.FormControl,{variant:"standard",fullWidth:!0,style:{marginRight:10},children:[y.jsx(w.InputLabel,{children:a("Owner user")}),y.jsx(w.Select,{variant:"standard",disabled:z,value:u?u.value:"",renderValue:()=>y.jsxs("span",{children:[u!=null&&u.icon?y.jsx(O.Icon,{src:u.icon,style:{width:16,height:16,marginRight:8}}):null,u?u.name:""]}),style:(u==null?void 0:u.value)==="different"?{opacity:.5}:{color:(u==null?void 0:u.color)||void 0,backgroundColor:O.Utils.getInvertedColor(u==null?void 0:u.color,s)},onChange:V=>{const X=d.find(K=>K.value===V.target.value);h(X),Lt(!1)},children:d.map(V=>y.jsxs(w.MenuItem,{style:V.value==="different"?{opacity:.5}:{color:V.color||void 0,backgroundColor:O.Utils.getInvertedColor(V.color,s)},value:V.value,children:[V.icon?y.jsx(O.Icon,{src:V.icon,style:{width:16,height:16,marginRight:8}}):null,V.name]},V.value))})]}),y.jsxs(w.FormControl,{variant:"standard",fullWidth:!0,children:[y.jsx(w.InputLabel,{children:a("Owner group")}),y.jsx(w.Select,{variant:"standard",disabled:z,value:c?c.value:"",renderValue:()=>y.jsxs("span",{children:[c!=null&&c.icon?y.jsx(O.Icon,{src:c.icon,style:{width:16,height:16,marginRight:8}}):null,c?c.name:""]}),style:(c==null?void 0:c.value)==="different"?{opacity:.5}:{color:(c==null?void 0:c.color)||void 0,backgroundColor:O.Utils.getInvertedColor(c==null?void 0:c.color,s)},onChange:V=>{const X=v.find(K=>K.value===V.target.value);f(X),Lt(!1)},children:v.map(V=>y.jsxs(w.MenuItem,{value:V.value,style:V.value==="different"?{opacity:.5}:{color:V.color||void 0,backgroundColor:O.Utils.getInvertedColor(V.color,s)},children:[V.icon?y.jsx(O.Icon,{src:V.icon,style:{width:16,height:16,marginRight:8}}):null,V.name]},V.value))})]})]}),y.jsxs("div",{style:{display:"flex",margin:10,alignItems:"center",fontSize:10,marginLeft:0,color:"silver"},children:[y.jsx("div",{style:m?null:{color:"green"},children:a("to apply one item")}),y.jsx(w.Switch,{disabled:z||!!o||C===1,checked:!!o||m,onChange:V=>{_(V.target.checked),Lt(!1)},color:"primary"}),y.jsxs("div",{style:m?{color:"green"}:null,children:[a("to apply with children")," ",o||C>1?`(${C} ${a("object(s)")})`:""]})]}),z&&y.jsx(w.LinearProgress,{}),y.jsxs("div",{style:{overflowY:"auto"},children:[y.jsxs("div",{children:[y.jsx("h2",{children:a("Object rights")}),y.jsx(Nm,{mask:ut,disabled:z,setMask:ot,applyToChildren:m,differentValues:Z,t:a,setValue:V=>{I(V),Lt(!1)},value:T})]}),b&&y.jsxs("div",{children:[y.jsx("h2",{children:a("States rights")}),y.jsx(Nm,{mask:Y,disabled:z,setMask:et,applyToChildren:m,differentValues:m?N:[],t:a,setValue:V=>{D(V),Lt(!1)},value:M})]})]})]})}):y.jsx(w.LinearProgress,{})},yn={dialog:{height:"100%",maxHeight:"100%",maxWidth:"100%"},content:{textAlign:"center"},error:r=>({color:r.palette.mode==="dark"?"#ff7777":"#c20000"}),image:{height:"100%",width:"auto"},text:{fontFamily:"Lucida Console, Courier, monospace",width:"100%"},download:{textDecoration:"none",textTransform:"uppercase",fontSize:14,color:"white",border:"1px solid white",borderRadius:5,padding:"8px 16px",marginRight:8}};class bO extends at.Component{audioRef;constructor(t){super(t);const e=this.props.obj._id.split(".");this.state={error:"",image:null,text:null,binary:null,fileName:`${e[e.length-2]}.${e[e.length-1]}`},this.audioRef=ch.createRef()}componentDidMount(){this.props.socket.getBinaryState(this.props.obj._id).then(t=>{let e=this.props.obj._id.toLowerCase().split(".").pop();const i=O.Utils.detectMimeType(t);if(i&&(e=i),e==="jpg")this.setState({image:!0,binary:t,mime:"image/jpeg"});else if(e==="svg")this.setState({image:!0,binary:t,mime:"image/svg+xml"});else if(e==="png"||e==="bmp")this.setState({image:!0,binary:t,mime:`image/${e}`});else if(e==="mp3")this.setState({audio:!0,binary:t,mime:"audio/mpeg"});else if(e==="ogg")this.setState({audio:!0,binary:t,mime:"audio/ogg"});else if(e==="txt"||e==="log")try{const n=btoa(t);this.setState({text:n,binary:t,mime:"text/plain"})}catch{}}).catch(t=>this.setState({error:t}))}render(){return y.jsxs(w.Dialog,{style:yn.dialog,open:!0,maxWidth:this.state.audio?"sm":"md",onClose:()=>this.props.onClose(),fullWidth:!0,"aria-labelledby":"object-view-dialog-title",children:[y.jsx(w.DialogTitle,{id:"object-view-dialog-title",children:this.props.t("View file in state: %s",this.props.obj._id)}),y.jsxs(w.DialogContent,{style:yn.content,children:[this.state.error?y.jsx(w.Box,{component:"div",sx:yn.error,children:this.state.error==="State is not binary"?this.props.t("No file stored yet"):this.props.t(this.state.error)}):null,this.state.audio?y.jsx("audio",{ref:this.audioRef,src:`data:${this.state.mime};base64,${this.state.binary}`}):null,this.state.audio?y.jsx(w.Fab,{color:"primary",onClick:()=>this.audioRef.current&&this.audioRef.current.play(),children:y.jsx(W.PlayArrow,{})}):null,this.state.image?y.jsx("img",{src:`data:${this.state.mime};base64,${this.state.binary}`,alt:this.props.obj._id,style:yn.image}):null,this.state.text!==null?y.jsx("pre",{style:yn.text,children:this.state.text}):null]}),y.jsxs(w.DialogActions,{children:[y.jsxs("a",{style:yn.download,download:this.state.fileName,href:`data:${this.state.mime};base64,${this.state.binary}`,children:[y.jsx(W.GetApp,{style:{paddingRight:8,height:12}}),y.jsx("span",{children:this.props.t("Download")})]}),y.jsx(w.Button,{variant:"contained",onClick:()=>this.props.onClose(),startIcon:y.jsx(W.Close,{}),color:"grey",children:this.props.t("Close")})]})]})}}const xO=O.withWidth()(bO),Bt={funcIcon:{width:16,height:16},formControlLabel:{marginBottom:16},color:{width:70},typeNameEng:{marginLeft:8,opacity:.7,fontStyle:"italic",fontSize:"smaller"},usedInAlias:{},addNewAlias:r=>({backgroundColor:r.palette.primary.main})},wO=["array","boolean","file","json","mixed","number","object","string"];class Ba extends at.Component{aliasIDs;constructor(t){var n;super(t);const e=[],i=this.props.obj._id;this.aliasIDs=Object.keys(this.props.objects).filter(a=>a.startsWith("alias.0"));for(let a=0;a<this.aliasIDs.length;a++){const o=(n=this.props.objects[this.aliasIDs[a]].common)==null?void 0:n.alias;((o==null?void 0:o.id)===i||typeof(o==null?void 0:o.id)=="object"&&(o.id.read===i||o.id.write===i))&&e.push(this.aliasIDs[a])}this.state={usedInAliases:e,showAddNewAlias:!e.length,newAliasId:this.props.obj._id,newAliasName:Ba.getText(this.props.obj.common.name||this.props.obj._id)||"",newAliasRole:this.props.obj.common.role||"",newAliasRead:this.props.obj.common.read,newAliasWrite:this.props.obj.common.write,newAliasUnit:this.props.obj.common.unit,newAliasDesc:Ba.getText(this.props.obj.common.desc)||"",newAliasType:this.props.obj.common.type,newAliasMin:this.props.obj.common.min===void 0?"":this.props.obj.common.min.toString(),newAliasMax:this.props.obj.common.max===void 0?"":this.props.obj.common.max.toString(),newAliasUseFormula:!1,newAliasReadFormula:"val",newAliasWriteFormula:"val",newAliasColor:this.props.obj.common.color,newAliasIcon:this.props.obj.common.icon}}static getText(t){return t?typeof t=="object"?t[O.I18n.getLanguage()]||t.en||"":t.toString():""}static filterRoles(t,e){const i=[];return uo.forEach(n=>(n.type==="mixed"||n.type===e)&&!i.includes(n.role)&&i.push(n.role)),t.forEach(n=>(n.type==="mixed"||n.type)===e&&!i.includes(n.role)&&i.push(n.role)),i.sort(),i}renderAddNewAlias(){return this.state.showAddNewAlias?y.jsxs(w.Dialog,{open:!0,onClose:()=>this.setState({showAddNewAlias:!1}),children:[y.jsx(w.DialogTitle,{children:O.I18n.t("Create new alias: %s",`alias.0.${this.state.newAliasId}`)}),y.jsxs(w.DialogContent,{children:[y.jsx(w.TextField,{style:Bt.formControlLabel,variant:"standard",value:this.state.newAliasId,slotProps:{input:{endAdornment:this.state.newAliasId?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({newAliasId:""}),children:y.jsx(W.Close,{})})}):null}},onChange:t=>this.setState({newAliasId:t.target.value}),label:O.I18n.t("Alias ID"),helperText:`alias.0.${this.state.newAliasId}`,fullWidth:!0}),y.jsx(w.TextField,{style:Bt.formControlLabel,variant:"standard",value:this.state.newAliasName,slotProps:{input:{endAdornment:this.state.newAliasName?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({newAliasName:""}),children:y.jsx(W.Close,{})})}):null}},onChange:t=>this.setState({newAliasName:t.target.value}),label:O.I18n.t("Alias name"),fullWidth:!0}),y.jsx(w.TextField,{style:Bt.formControlLabel,variant:"standard",value:this.state.newAliasDesc,slotProps:{input:{endAdornment:this.state.newAliasDesc?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({newAliasDesc:""}),children:y.jsx(W.Close,{})})}):null}},onChange:t=>this.setState({newAliasDesc:t.target.value}),label:O.I18n.t("Alias description"),fullWidth:!0}),y.jsxs(w.FormControl,{style:Bt.formControlLabel,fullWidth:!0,children:[y.jsx(w.InputLabel,{children:O.I18n.t("State type")}),y.jsx(w.Select,{variant:"standard",value:this.state.newAliasType,onChange:t=>this.setState({newAliasType:t.target.value}),children:wO.map(t=>y.jsxs(w.MenuItem,{value:t,children:[O.I18n.t(t),y.jsxs("span",{style:Bt.typeNameEng,children:["(",t,")"]})]},t))})]}),this.state.newAliasType==="number"?y.jsx(w.TextField,{style:Bt.formControlLabel,variant:"standard",value:this.state.newAliasUnit||"",slotProps:{input:{endAdornment:this.state.newAliasUnit?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({newAliasUnit:""}),children:y.jsx(W.Close,{})})}):null}},onChange:t=>this.setState({newAliasUnit:t.target.value}),label:O.I18n.t("Alias units"),fullWidth:!0}):null,this.state.newAliasType==="number"?y.jsx(w.TextField,{variant:"standard",value:this.state.newAliasMin,type:"number",error:this.state.newAliasMin?isNaN(parseFloat(this.state.newAliasMin)):!1,onChange:t=>this.setState({newAliasMin:t.target.value}),label:O.I18n.t("Min"),style:{width:"calc(50% - 4px)",marginBottom:16,marginRight:8}}):null,this.state.newAliasType==="number"?y.jsx(w.TextField,{variant:"standard",value:this.state.newAliasMax,type:"number",error:this.state.newAliasMax?isNaN(parseFloat(this.state.newAliasMax)):!1,onChange:t=>this.setState({newAliasMax:t.target.value}),label:O.I18n.t("Max"),fullWidth:!0,style:{width:"calc(50% - 4px)",marginBottom:16}}):null,y.jsx(w.TextField,{variant:"standard",style:{...Bt.formControlLabel,...Bt.color},label:O.I18n.t("Color"),type:"color",value:this.state.newAliasColor,onChange:t=>this.setState({newAliasColor:t.target.value})}),y.jsx(w.Autocomplete,{style:{...Bt.formControlLabel},fullWidth:!0,value:this.state.newAliasRole,onChange:(t,e)=>{const i=uo.find(n=>n.role===e);if(i){if(i.w!==void 0&&i.r!==void 0){this.setState({newAliasRole:e,newAliasRead:i.r,newAliasWrite:i.w});return}if(i.w!==void 0){this.setState({newAliasRole:e,newAliasWrite:i.w});return}if(i.r!==void 0){this.setState({newAliasRole:e,newAliasRead:i.r});return}}if(e.startsWith("value")||e.startsWith("indicator")||e.startsWith("sensor")||e.startsWith("weather")){if(this.state.newAliasWrite){this.setState({newAliasRole:e,newAliasWrite:!1});return}}else if(e.startsWith("level")||e.startsWith("switch")){if(!this.state.newAliasWrite){this.setState({newAliasRole:e,newAliasWrite:!0});return}}else if(e.startsWith("button")&&this.state.newAliasRead){this.setState({newAliasRole:e,newAliasRead:!1});return}this.setState({newAliasRole:e})},options:Ba.filterRoles(this.props.roleArray,this.state.newAliasType),renderInput:t=>y.jsx(w.TextField,{variant:"standard",...t,label:O.I18n.t("Role")})}),y.jsx(w.FormControlLabel,{style:{...Bt.formControlLabel,marginLeft:16},control:y.jsx(w.Checkbox,{indeterminate:this.state.newAliasRead===void 0||this.state.newAliasRead===null,checked:this.state.newAliasRead,onChange:t=>{const e={newAliasRead:t.target.checked};e.newAliasRead===!1&&this.state.newAliasWrite===!1&&(e.newAliasWrite=!0),this.setState(e)}}),label:O.I18n.t("Alias read")}),y.jsx(w.FormControlLabel,{style:Bt.formControlLabel,control:y.jsx(w.Checkbox,{indeterminate:this.state.newAliasWrite===void 0||this.state.newAliasWrite===null,checked:this.state.newAliasWrite,onChange:t=>{const e={newAliasWrite:t.target.checked};e.newAliasRead===!1&&this.state.newAliasWrite===!1&&(e.newAliasRead=!0),this.setState(e)}}),label:O.I18n.t("Alias write")}),y.jsx(w.FormControlLabel,{style:Bt.formControlLabel,control:y.jsx(w.Checkbox,{checked:this.state.newAliasUseFormula,onChange:t=>this.setState({newAliasUseFormula:t.target.checked})}),label:O.I18n.t("Use convert functions")}),this.state.newAliasUseFormula&&this.state.newAliasRead?y.jsx(w.TextField,{style:Bt.formControlLabel,variant:"standard",value:this.state.newAliasReadFormula,onChange:t=>this.setState({newAliasReadFormula:t.target.value}),label:O.I18n.t("Read formula"),helperText:`${O.I18n.t("JS function like")} "val / 5 + 21"`,slotProps:{input:{endAdornment:this.state.newAliasReadFormula&&this.state.newAliasReadFormula!=="val"?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({newAliasReadFormula:"val"}),children:y.jsx(W.Close,{})})}):null,startAdornment:y.jsx(w.InputAdornment,{position:"start",children:y.jsx(O.IconFx,{style:Bt.funcIcon})})}},fullWidth:!0}):null,this.state.newAliasUseFormula&&this.state.newAliasWrite?y.jsx(w.TextField,{style:Bt.formControlLabel,variant:"standard",value:this.state.newAliasWriteFormula,onChange:t=>this.setState({newAliasWriteFormula:t.target.value}),label:O.I18n.t("Write formula"),slotProps:{input:{endAdornment:this.state.newAliasWriteFormula&&this.state.newAliasWriteFormula!=="val"?y.jsx(w.InputAdornment,{position:"end",children:y.jsx(w.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({newAliasWriteFormula:"val"}),children:y.jsx(W.Close,{})})}):null,startAdornment:y.jsx(w.InputAdornment,{position:"start",children:y.jsx(O.IconFx,{style:Bt.funcIcon})})}},helperText:`${O.I18n.t("JS function like")} "val / 5 + 21"`,fullWidth:!0}):null]}),y.jsxs(w.DialogActions,{children:[y.jsx(w.Button,{variant:"contained",disabled:!this.state.newAliasId||!!this.props.objects[`alias.0.${this.state.newAliasId}`],onClick:async()=>{const t={_id:`alias.0.${this.state.newAliasId}`,type:"state",common:{name:this.state.newAliasName,type:this.props.obj.common.type,alias:{id:this.props.obj._id}},native:{}};this.state.newAliasDesc&&(t.common.desc=this.state.newAliasDesc),this.state.newAliasType&&(t.common.type=this.state.newAliasType),this.state.newAliasType==="number"&&this.state.newAliasUnit&&(t.common.unit=this.state.newAliasUnit),this.state.newAliasRole&&(t.common.role=this.state.newAliasRole),this.state.newAliasType==="number"&&this.state.newAliasMin&&(t.common.min=parseFloat(this.state.newAliasMin)),this.state.newAliasType==="number"&&this.state.newAliasMax&&(t.common.max=parseFloat(this.state.newAliasMax)),this.state.newAliasRole&&(t.common.role=this.state.newAliasRole),this.state.newAliasRead!==void 0&&this.state.newAliasRead!==null&&(t.common.read=this.state.newAliasRead),this.state.newAliasWrite!==void 0&&this.state.newAliasWrite!==null&&(t.common.write=this.state.newAliasWrite),this.state.newAliasColor&&(t.common.color=this.state.newAliasColor),this.state.newAliasIcon&&(t.common.icon=this.state.newAliasIcon),this.state.newAliasUseFormula&&(t.common.read!==!1&&this.state.newAliasReadFormula&&this.state.newAliasReadFormula!=="val"&&(t.common.alias.read=this.state.newAliasReadFormula),t.common.write!==!1&&this.state.newAliasWriteFormula&&this.state.newAliasWriteFormula!=="val"&&(t.common.alias.write=this.state.newAliasWriteFormula)),await this.props.socket.setObject(t._id,t),this.setState({showAddNewAlias:!1}),this.props.onRedirect(t._id,2e3),this.props.onClose()},startIcon:y.jsx(W.AddLink,{}),color:"primary",children:this.props.t("Create")}),y.jsx(w.Button,{variant:"contained",onClick:()=>this.setState({showAddNewAlias:!1}),startIcon:y.jsx(W.Close,{}),color:"grey",children:this.props.t("Close")})]})]}):null}render(){return y.jsxs(w.Dialog,{open:!0,maxWidth:"sm",onClose:()=>this.props.onClose(),fullWidth:!0,"aria-labelledby":"object-alias-dialog-title",children:[this.renderAddNewAlias(),y.jsx(w.DialogTitle,{id:"object-alias-dialog-title",children:this.state.usedInAliases.length?O.I18n.t("This object is used in aliases"):O.I18n.t("This object does not used in any aliases yet")}),y.jsx(w.DialogContent,{children:y.jsxs(w.MenuList,{style:{maxWidth:400},children:[this.state.usedInAliases.map(t=>y.jsxs(w.MenuItem,{style:Bt.usedInAlias,onClick:()=>this.props.onRedirect(t),children:[y.jsx(w.ListItemIcon,{children:y.jsx(W.Link,{fontSize:"small"})}),y.jsx(w.ListItemText,{children:t})]},t)),y.jsxs(w.MenuItem,{onClick:()=>this.setState({showAddNewAlias:!0}),sx:Bt.addNewAlias,children:[y.jsx(w.ListItemIcon,{children:y.jsx(W.AddLink,{fontSize:"small"})}),y.jsx(w.ListItemText,{children:O.I18n.t("Create alias from this ID")})]})]})}),y.jsx(w.DialogActions,{children:y.jsx(w.Button,{variant:"contained",onClick:()=>this.props.onClose(),startIcon:y.jsx(W.Close,{}),color:"grey",children:this.props.t("Close")})})]},"editAlias")}}const SO=O.withWidth()(Ba);class pd extends at.Component{checkTimer=null;objects={};constructor(t){super(t);const e=this.props.id.split("."),i=e.pop()||"";this.state={name:i,parentId:e.join("."),renameAllChildren:!0,newExists:!0,showParentDialog:!1,showHistoryWarning:!1,withHistory:[]}}componentWillUnmount(){this.checkTimer&&(clearTimeout(this.checkTimer),this.checkTimer=null)}static calculateNewId(t,e,i){const n=t.split("."),a=e.split(".");let o=0;for(;n[o]===a[o];)o++;const s=i.split(".");return s.splice(0,o+1),`${e}.${s.join(".")}`}async getInstancesWithHistory(){const t=await this.props.socket.getAdapterInstances();return t==null?void 0:t.filter(e=>e.common.getHistory).map(e=>e._id.replace("system.adapter.",""))}async checkHistory(){this.objects={};const t=await this.getInstancesWithHistory(),e=[];try{const i=await this.props.socket.getObject(this.props.id);i&&(this.objects[i._id]=i)}catch{}for(const i of this.props.childrenIds)try{const n=await this.props.socket.getObject(i);n&&(this.objects[n._id]=n)}catch{}return Object.values(this.objects).forEach(i=>{var n;(n=i.common)!=null&&n.custom&&Object.keys(i.common.custom).find(a=>t.includes(a)&&!i.common.custom[a].aliasId)&&e.push(i._id)}),e.length?(this.setState({showHistoryWarning:!0,withHistory:e}),!1):!0}showHistoryWarning(){return this.state.showHistoryWarning?y.jsxs(w.Dialog,{open:!0,onClose:()=>this.setState({showHistoryWarning:!1}),children:[y.jsx(w.DialogTitle,{children:this.props.t("Found states with history")}),y.jsxs(w.DialogContent,{children:[this.state.withHistory.length>2?this.props.t("You want to move %s states with enabled history",this.state.withHistory.length):`${this.props.t("Following states have history enabled")}: ${this.state.withHistory.join(", ")}`,y.jsx("div",{children:this.props.t("move_states_with_history_warning")})]}),y.jsxs(w.DialogActions,{children:[y.jsx(w.Button,{variant:"contained",color:"primary",onClick:async()=>{const t=`${this.state.parentId}.${this.state.name}`;await this.renameCopyObject(this.props.id,t,this.props.childrenIds.length&&this.state.renameAllChildren,!1),this.props.onClose()},startIcon:y.jsx(W.Check,{}),children:this.props.t("Confirm")}),y.jsx(w.Button,{color:"grey",variant:"contained",startIcon:y.jsx(W.Close,{}),onClick:()=>this.setState({showHistoryWarning:!1}),children:this.props.t("ra_Cancel")})]})]}):null}async renameCopyObject(t,e,i,n){var s;if(t===e)return;let a;try{a=((s=this.objects)==null?void 0:s[t])||await this.props.socket.getObject(t)}catch{}let o;if((a==null?void 0:a.type)==="state"&&(o=await this.props.socket.getState(t)),i)for(const l of this.props.childrenIds){const u=pd.calculateNewId(t,e,l);await this.renameCopyObject(l,u,!1,n)}a&&(await this.props.socket.setObject(e,a),o&&await this.props.socket.setState(e,o),n||await this.props.socket.delObject(t))}checkIfNewExists(){const t=`${this.state.parentId}.${this.state.name}`;this.checkTimer&&(clearTimeout(this.checkTimer),this.checkTimer=null),this.props.id===t?this.state.newExists||(this.checkTimer=setTimeout(()=>{this.checkTimer=null,this.setState({newExists:!0})},50)):this.checkTimer=setTimeout(async()=>{this.checkTimer=null;try{const e=await this.props.socket.getObject(t);e&&!this.state.newExists?this.setState({newExists:!0}):!e&&this.state.newExists&&this.setState({newExists:!1})}catch{this.state.newExists&&this.setState({newExists:!1})}},300)}renderParentSelectorDialog(){return this.state.showParentDialog?y.jsx(O.SelectID,{foldersFirst:!0,imagePrefix:"../..",expertMode:this.props.expertMode,socket:this.props.socket,columns:["name","type","role","room","func"],types:["folder","channel","device","meta"],notEditable:!0,selected:this.state.parentId,allowNonObjects:!0,filterFunc:t=>this.props.expertMode?!0:t._id.startsWith("0_userdata.0")||t._id.startsWith("javascript."),theme:this.props.theme,onSelectConfirm:(t,e)=>{let i;return Array.isArray(t)?i=t[0]:i=t,i.split(".").length<=1||e[i]&&(e[i].type==="state"||i.startsWith("system."))?Promise.resolve(!1):Promise.resolve(!0)},onClose:()=>this.setState({showParentDialog:!1}),onOk:t=>{let e;Array.isArray(t)?e=t[0]:e=t,e&&e.split(".").length>1&&this.setState({parentId:e})}}):null}render(){const t=`${this.state.parentId}.${this.state.name}`;return y.jsxs(w.Dialog,{open:!0,maxWidth:"md",fullWidth:!0,onClose:()=>this.props.onClose(),children:[this.renderParentSelectorDialog(),this.showHistoryWarning(),y.jsxs(w.DialogTitle,{children:[y.jsxs("span",{style:{opacity:.6,marginRight:8},children:[this.props.t("Rename or copy object")," -"]}),y.jsx("span",{style:{fontWeight:"bold"},children:this.props.id})]}),y.jsxs(w.DialogContent,{children:[y.jsxs("div",{style:{display:"flex",gap:8,alignItems:"end",opacity:.7},children:[y.jsx(w.TextField,{fullWidth:!0,variant:"standard",label:this.props.t("Parent ID"),value:`${this.state.parentId}.`,slotProps:{input:{readOnly:!0}}}),y.jsx(w.Button,{variant:"outlined",style:{maxWidth:40,width:40,height:32},onClick:()=>this.setState({showParentDialog:!0}),children:"..."})]}),y.jsx(w.TextField,{value:this.state.name,onChange:e=>{const i=e.target.value.replace(O.Utils.FORBIDDEN_CHARS,"_").replace(/\./g,"_").replace(/\s/g,"_").replace(/,/g,"_").replace(/__/g,"_").replace(/__/g,"_");this.setState({name:i},()=>this.checkIfNewExists())},style:{marginTop:20},autoFocus:!0,variant:"standard",fullWidth:!0,label:this.props.t("New object ID")}),this.props.childrenIds.length?y.jsx(w.FormControlLabel,{control:y.jsx(w.Checkbox,{checked:this.state.renameAllChildren,onChange:()=>{this.setState({renameAllChildren:!this.state.renameAllChildren})}}),label:this.props.t("Rename all children")}):null,y.jsxs("div",{children:[y.jsxs("span",{style:{opacity:.6,marginRight:8,fontSize:16},children:[this.props.t("New object ID"),":"]}),y.jsx("span",{style:{fontWeight:"bold",fontSize:16},children:t})]})]}),y.jsxs(w.DialogActions,{children:[y.jsx(w.Button,{disabled:!this.state.name||t===this.props.id,color:"primary",variant:"outlined",onClick:async()=>{await this.renameCopyObject(this.props.id,t,this.props.childrenIds.length&&this.state.renameAllChildren,!0),this.props.onClose()},children:this.props.t("Create a copy")}),y.jsx(w.Button,{disabled:!this.state.name||t===this.props.id,color:"primary",variant:"contained",onClick:async()=>{await this.checkHistory()&&(await this.renameCopyObject(this.props.id,t,this.props.childrenIds.length&&this.state.renameAllChildren,!1),this.props.onClose())},children:t!==this.props.id&&this.state.newExists?this.props.t("Replace"):this.props.t("Rename")}),y.jsx(w.Button,{variant:"contained",color:"grey",onClick:()=>this.props.onClose(),startIcon:y.jsx(W.Close,{}),children:this.props.t("ra_Cancel")})]})]})}}const CO=W.Delete,ss={buttonAll:{color:"#FF0000"},id:{fontStyle:"italic"},buttonText:{whiteSpace:"nowrap"}};class TO extends at.Component{dialogName;filters;t;wordCache;constructor(t){super(t),this.dialogName="AdminObjects";const e=(window._localStorage||window.localStorage).getItem(`${this.dialogName||"App"}.filters`)||"{}";try{this.filters=JSON.parse(e)}catch{this.filters={}}const i=(window._localStorage||window.localStorage).getItem(`${this.dialogName||"App"}.selected`)||"";this.state={selected:i,name:"",toast:"",deleteObjectShow:null},this.t=this.translate,this.wordCache={}}translate=(t,e,i)=>e!==void 0?this.props.t(t,e,i):(this.wordCache[t]||(this.wordCache[t]=this.props.t(t)),this.wordCache[t]);onDelete(t){const e=this.state.deleteObjectShow.id;t?(this.props.socket.delObjects(e,!0).then(()=>this.setState({toast:this.t("All deleted")})).catch(i=>window.alert(`Cannot delete object: ${i}`)),this.setState({deleteObjectShow:null})):(this.props.socket.delObject(e,!1).catch(i=>window.alert(`Cannot delete object: ${i}`)),this.setState({deleteObjectShow:null}))}renderToast(){return y.jsx(w.Snackbar,{anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!!this.state.toast,autoHideDuration:3e3,onClose:()=>this.setState({toast:""}),message:this.state.toast,action:y.jsx(w.IconButton,{size:"small","aria-label":"close",color:"inherit",onClick:()=>this.setState({toast:""}),children:y.jsx(W.Cancel,{fontSize:"small"})})},"toast")}renderDeleteDialog(){return this.state.deleteObjectShow?y.jsxs(w.Dialog,{maxWidth:"md",open:!0,onClose:()=>this.setState({deleteObjectShow:null}),"aria-labelledby":"delete-object-dialog-title","aria-describedby":"delete-object-dialog-description",children:[y.jsxs(w.DialogTitle,{id:"delete-object-dialog-title",children:[this.state.deleteObjectShow.hasChildren?this.t("Delete object(s)"):this.t("Delete object"),":"," ",y.jsx("span",{style:ss.id,children:this.state.deleteObjectShow.id})]}),y.jsx(w.DialogContent,{children:y.jsx(w.DialogContentText,{children:this.t("Are you sure?")})}),y.jsxs(w.DialogActions,{children:[this.state.deleteObjectShow.hasChildren?y.jsx(w.Button,{variant:"contained",color:"grey",sx:{"& .MuiButton-text":ss.buttonText},onClick:()=>this.onDelete(!0),startIcon:y.jsx(CO,{style:ss.buttonAll}),children:this.t("Delete with children",this.state.deleteObjectShow.childrenCount)}):null,this.state.deleteObjectShow.exists?y.jsx(w.Button,{variant:"contained",sx:{"& .MuiButton-text":ss.buttonText},onClick:()=>this.onDelete(!1),color:"primary",startIcon:y.jsx(W.Delete,{}),autoFocus:!0,children:this.t("Delete one item")}):null,y.jsx(w.Button,{variant:"contained",color:"grey",onClick:()=>this.setState({deleteObjectShow:null}),startIcon:y.jsx(W.Cancel,{}),children:this.t("ra_Cancel")})]})]},"delete"):null}render(){return[this.renderToast(),y.jsx(O.ObjectBrowser,{dialogName:"admin",objectsWorker:this.props.objectsWorker,prefix:this.props.prefix,defaultFilters:this.filters,statesOnly:this.props.statesOnly,style:{width:"100%",height:"100%"},socket:this.props.socket,selected:this.state.selected,name:this.state.name,expertMode:this.props.expertMode,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat,t:this.t,lang:this.props.lang,themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,objectCustomDialog:dO,objectBrowserValue:Mn,objectBrowserEditObject:Vt,objectBrowserEditRole:dd,objectBrowserViewFile:xO,objectBrowserAliasEditor:SO,objectMoveRenameDialog:pd,router:O.Router,enableStateValueEdit:!0,onObjectDelete:(t,e,i,n)=>this.setState({deleteObjectShow:{id:t,hasChildren:e,exists:i,childrenCount:n}}),onFilterChanged:t=>{this.filters=t,(window._localStorage||window.localStorage).setItem(`${this.dialogName||"App"}.filters`,JSON.stringify(t))},onSelect:t=>{Array.isArray(t)?(window._localStorage||window.localStorage).setItem(`${this.dialogName||"App"}.selected`,t[0]||""):(window._localStorage||window.localStorage).setItem(`${this.dialogName||"App"}.selected`,t||"")},objectEditBoolean:!0,objectAddBoolean:!0,objectStatesView:!0,objectImportExport:!0,objectEditOfAccessControl:!0,modalNewObject:t=>y.jsx(mO,{objects:t.objects,expertMode:this.props.expertMode,setObject:(e,i)=>this.props.socket.setObject(e,i).catch(n=>window.alert(n)),selected:t.state.modalNewObj.id,initialType:t.state.modalNewObj.initialType,initialStateType:t.state.modalNewObj.initialStateType,onClose:()=>t.setState({modalNewObj:null}),onApply:()=>t.setState({modalNewObj:null})}),modalEditOfAccessControl:(t,e)=>y.jsx(_O,{theme:this.props.theme,themeType:this.props.themeType,extendObject:(i,n)=>{this.props.socket.extendObject(i,n).catch(a=>window.alert(a)),e.aclTooltip=null},selected:t.state.selected[0],modalEmptyId:e.obj?"":e.id,objects:t.objects,t:this.t,onClose:()=>t.setState({modalEditOfAccess:!1,modalEditOfAccessObjData:null}),onApply:()=>t.setState({modalEditOfAccess:!1,modalEditOfAccessObjData:null})})},"browser"),this.renderDeleteDialog()]}}const iE=O.withWidth()(TO);export{iE as default};
|