/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/hybird-acud-pro@0.0.53-beta.1/cjs/index.cjs.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var React=require("react"),acud=require("acud"),Icon=require("acud-icon"),_=require("lodash"),PropTypes=require("prop-types"),moment=require("moment"),tmp=require("react-router-dom"),reactDom=require("react-dom"),Sentry=require("@sentry/browser"),axios=require("axios"),reactRedux=require("react-redux"),redux=require("redux");function _interopNamespaceDefault(e){var n=Object.create(null);return e&&Object.keys(e).forEach((function(k){if("default"!==k){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}})),n.default=e,Object.freeze(n)}var tmp__namespace=_interopNamespaceDefault(tmp),Sentry__namespace=_interopNamespaceDefault(Sentry),extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)Object.prototype.hasOwnProperty.call(b,p)&&(d[p]=b[p])},extendStatics(d,b)};function __extends(d,b){if("function"!=typeof b&&null!==b)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}function __awaiter(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))}function __generator(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}function __values(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spreadArray(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))}"function"==typeof SuppressedError&&SuppressedError;var timeToUtc=function(time){if(!time||!_.isString(time)&&!moment.isMoment(time))return null;var t=moment.isMoment(time)?time:moment(time);return t.isValid()?t.utc().format("YYYY-MM-DDTHH:mm:ss")+"Z":null};function unitFormat(str){return str<10?"0"+str:str}var timeUtil={getStartTime:function(date){return moment(date).format("YYYY-MM-DD 00:00:00")},getEndTime:function(date){return moment(date).format("YYYY-MM-DD 23:59:59")},getMonthFirstDay:function(d){return moment(d||new Date).format("YYYY-MM-01")},timeToUtc:function(time){return timeToUtc(time)},toTime:function(utcTimeStr,defaultTime){return void 0===defaultTime&&(defaultTime=""),utcTimeStr?moment(utcTimeStr).format("YYYY-MM-DD HH:mm:ss"):defaultTime},utcToMinute:function(utcTimeStr,defaultTime){return void 0===defaultTime&&(defaultTime=""),utcTimeStr?moment(utcTimeStr).format("YYYY-MM-DD HH:mm"):defaultTime},toDate:function(utcTimeStr,defaultTime){return void 0===defaultTime&&(defaultTime=""),utcTimeStr?moment(utcTimeStr).format("YYYY-MM-DD"):defaultTime},formatTimeRange:function(timeRange){if((timeRange=_.compact(timeRange))&&2===timeRange.length){var newTimeRange=_.map(timeRange,(function(time){return moment.isMoment(time)?time:moment(time)}));return[timeToUtc(newTimeRange[0].format("YYYY-MM-DD 00:00:00")),timeToUtc(newTimeRange[1].format("YYYY-MM-DD 23:59:59"))]}return[]},durationBySecond:function(seconds){var hour,minute=0,second=0;return(seconds=parseInt(seconds.toString(),10))<=0?"00:00":(minute=Math.floor(seconds/60))<60?(second=seconds%60,unitFormat(minute)+":"+unitFormat(second)):(second=seconds-3600*(hour=Math.floor(minute/60))-60*(minute%=60),unitFormat(hour)+":"+unitFormat(minute)+":"+unitFormat(second))}},LocaleContext=React.createContext(void 0),localeValues={locale:"zh-cn",EmptyStatus:{noResult:"暂无结果",noAccessPermissions:"没有访问权限",connectAdministrator:"如果您需要此页面的访问权限，请联系管理员配置",replaceKeywords:"请尝试更换关键词",pageNotFound:"无法找到页面",pageDoesNotExist:"您访问的页面不存在，",refreshPage:"刷新页面",serverError:"服务器错误",serverErrorNoResponse:"服务器错误无法响应，",returnHome:"返回首页，",problemStillExists:"如果问题依然存在，请联系管理员",please:"请",againLater:"请稍后重试",or:"或"},Status:{running:"运行中",warning:"警告",success:"运行成功",error:"运行错误",unavailable:"不可用"},FileUpload:{uploadFailed:"上传失败",updateCompleted:"更新成功",noticeCopywriting:"注意：请调整文件名后再上传，以便其他人可以识别"},Loading:{Loading:"玩命加载中..."},useList:{loadingData:"数据加载中...",noData:"暂无数据",total:"共",stripData:"条数据"},useTable:{confirm:"确认",requestFailedPleaseCheck:"请求失败，请检查",total:"共",stripData:"条数据",failedToGetRecords:"获取记录失败"},HooksList:{chosen:"已选择",Record:"条记录",startingTime:"开始时间",endTime:"结束时间",startDate:"开始日期",endData:"结束日期"},HooksTable:{sure:"确定",cancel:"取消",submitting:"提交中...",noResult:"暂无结果",noData:"暂无数据",no:"您还没有",any:"任何",create:"创建",new:"新建"},useDialog:{sure:"确定",cancel:"取消",submitting:"提交中..."}},useLocale=function(componentName,defaultLocale){var fullLocale=React.useContext(LocaleContext),getLocale=React.useMemo((function(){var _a,locale=defaultLocale||localeValues[componentName],localeFromContext=null!==(_a=null==fullLocale?void 0:fullLocale[componentName])&&void 0!==_a?_a:{};return __assign(__assign({},locale),localeFromContext)}),[componentName,defaultLocale,fullLocale]);return[getLocale,React.useMemo((function(){var localeCode=null==fullLocale?void 0:fullLocale.locale;return(null==fullLocale?void 0:fullLocale.exist)&&!localeCode?localeValues.locale:localeCode}),[fullLocale])]},CLS_PREFIX$c="".concat("du","-filter-item"),RangePicker$2=acud.DatePicker.RangePicker,Option$1=acud.Select.Option,FilterItem=function(props){var control=props.control,filterData=props.filterData,onItemChanged=props.onItemChanged,name=control.name,value=filterData[name]||"",locale=__read(useLocale("HooksList"),1)[0],controlItem=null,width=control.width||120;if("textbox"===control.type)controlItem=React.createElement(acud.Input,__assign({style:{width:width},value:value,onChange:function(evt){return onItemChanged(evt.target.value,name,!0)},onPressEnter:function(evt){return onItemChanged(evt.currentTarget.value,name,!1,!0)}},control.acudProps));else if("search"===control.type)controlItem=React.createElement(acud.Search,__assign({style:{width:width},value:value,onChange:function(evt){return onItemChanged(evt.target.value,name,!0)},onSearch:function(currentValue){return onItemChanged(currentValue,name,!1)}},control.acudProps));else if("select"===control.type){controlItem=React.createElement(acud.Select,__assign({style:{width:width},value:value,mode:control.multi?"multiple":"",onChange:function(currentValue){return onItemChanged(currentValue,name)}},control.acudProps),control.options.map((function(option){return React.createElement(Option$1,{key:option.value,value:option.value,title:option.text},option.text)})))}else if("rangecalendar"===control.type){var disabledDate=function(current){return!!(current&&control.range&&(control.range.begin&&timeUtil.toDate(current)<timeUtil.toDate(control.range.begin)||control.range.end&&timeUtil.toDate(current)>timeUtil.toDate(control.range.end)))},format=control.time?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD",getRangePickerValue=function(timeValue){var begin=timeValue.begin,end=timeValue.end;return[begin&&moment(begin),end&&moment(end)]},getValue_1=function(pickerValue){return control.time?{begin:timeUtil.timeToUtc(pickerValue[0]),end:timeUtil.timeToUtc(pickerValue[1])}:{begin:timeUtil.toDate(pickerValue[0]),end:timeUtil.toDate(pickerValue[1])}};controlItem=control.time?React.createElement(RangePicker$2,__assign({style:{width:370},showTime:{format:"HH:mm:ss"},format:format,placeholder:[null==locale?void 0:locale.startingTime,null==locale?void 0:locale.endTime],disabledDate:disabledDate,value:getRangePickerValue(value),onChange:function(__,dateStrings){return onItemChanged(getValue_1(dateStrings),name)}},control.acudProps)):React.createElement(RangePicker$2,__assign({style:{width:300},format:format,placeholder:[null==locale?void 0:locale.startDate,null==locale?void 0:locale.endDate],disabledDate:disabledDate,value:getRangePickerValue(value),onChange:function(__,dateStrings){return onItemChanged(getValue_1(dateStrings),name)}},control.acudProps))}else"radio"===control.type&&(controlItem=React.createElement(acud.Radio.Group,__assign({style:{width:control.width},value:value,onChange:function(e){return onItemChanged(e.target.value,name)}},control.acudProps),_.map(control.options,(function(option){return React.createElement(acud.Radio,{key:option.value,value:option.value,checked:option.value},option.text||option.label)}))));return React.createElement("div",{className:"".concat(CLS_PREFIX$c," ").concat(CLS_PREFIX$c,"-").concat(name)},control.label&&React.createElement("label",{className:"".concat(CLS_PREFIX$c,"-label")},control.label),controlItem)},CLS_PREFIX$b="".concat("du","-filter"),FilterArea=function(_super){function FilterArea(props){var _this=_super.call(this,props)||this;_this.handleItemChanged=function(value,name,preventFilterAction,forceFilterAction){void 0===preventFilterAction&&(preventFilterAction=!1),void 0===forceFilterAction&&(forceFilterAction=!1);var _a=_this.props,filterConfig=_a.filterConfig,onItemChange=_a.onItemChange,onFilterDataChange=_a.onFilterDataChange,submitText=filterConfig.submitText;_this.setState((function(prevState){var _a;return{filterData:__assign(__assign({},prevState.filterData),(_a={},_a[name]=value,_a))}}),(function(){onItemChange&&onItemChange({name:name,value:value}),forceFilterAction||!submitText&&!preventFilterAction?_this.handleFilter():onFilterDataChange&&onFilterDataChange({name:name,value:value})}))},_this.handleFilter=function(){(0,_this.props.onHandleFilter)(_this.state.filterData)};var filterData={},filterConfig=props.filterConfig;return filterConfig&&filterConfig.controls&&filterConfig.controls.length&&_.each(filterConfig.controls,(function(control){control.name&&!_.isNil(control.value)&&(filterData[control.name]=control.value)})),_this.state={filterData:filterData},_this}return __extends(FilterArea,_super),FilterArea.prototype.UNSAFE_componentWillReceiveProps=function(nextProps){var _this=this,filterData=this.state.filterData,lastFilterConfig=this.props.filterConfig,nextFilterConfig=nextProps.filterConfig;if(lastFilterConfig&&lastFilterConfig.controls&&nextFilterConfig&&nextFilterConfig.controls&&!_.isEqual(lastFilterConfig.controls,nextFilterConfig.controls)){var changedControls=_.filter(nextFilterConfig.controls,(function(control){return!_.isNil(control.value)&&!_.isEqual(control.value,filterData[control.name])})),changedControlLength_1=changedControls.length;_.each(changedControls,(function(changedControl,index){var forceFilterAction=index===changedControlLength_1-1;_this.handleItemChanged(changedControl.value,changedControl.name,!1,forceFilterAction)}))}},FilterArea.prototype.render=function(){var _this=this,_a=this.props,filterComp=_a.filterComp,filterProps=_a.filterProps,filterConfig=_a.filterConfig,onHandleFilter=_a.onHandleFilter,position=_a.position,onItemChange=_a.onItemChange,onFilterDataChange=_a.onFilterDataChange,filterData=this.state.filterData;if(filterComp){if("function"==typeof filterComp){var Filter=filterComp,customFilterProps=_.isObject(filterProps)?filterProps:{};return React.createElement(Filter,__assign({onHandleFilter:onHandleFilter,onItemChange:onItemChange,onFilterDataChange:onFilterDataChange},customFilterProps))}return filterComp}if(filterConfig&&filterConfig.controls&&filterConfig.controls.length){var filterClassName="left"===position||"right"===position?"".concat(CLS_PREFIX$b," inline"):CLS_PREFIX$b;return React.createElement("div",{className:filterClassName},_.map(filterConfig.controls,(function(control){return React.createElement(FilterItem,{key:"formItem_".concat(control.name),control:control,filterData:filterData,onItemChanged:_this.handleItemChanged})})),filterConfig.submitText&&React.createElement(acud.Button,{type:"primary",icon:React.createElement(Icon.OutlinedSearch,null),onClick:this.handleFilter},filterConfig.submitText))}return null},FilterArea.defaultProps={position:""},FilterArea.propTypes={loading:PropTypes.bool,position:PropTypes.string,filterComp:PropTypes.any,filterProps:PropTypes.any,filterConfig:PropTypes.object,onHandleFilter:PropTypes.func,onItemChange:PropTypes.func,onFilterDataChange:PropTypes.func},FilterArea}(React.Component),CLS_PREFIX$a="".concat("du","-bulk"),BulkArea=function(props){var _a=props.position,position=void 0===_a?"left":_a,loading=props.loading,onHandleAction=props.onHandleAction,selectedRowKeys=props.selectedRowKeys,checkedAll=props.checkedAll,bulkComp=props.bulkComp,bulkConfig=props.bulkConfig,hasSelected=selectedRowKeys&&selectedRowKeys.length>0,Bulk=bulkComp,locale=__read(useLocale("HooksList"),1)[0];return Bulk?React.createElement(Bulk,{loading:loading,handleAction:onHandleAction,selectedRowKeys:selectedRowKeys,hasSelected:hasSelected}):bulkConfig&&bulkConfig.length?React.createElement("div",{className:CLS_PREFIX$a},bulkConfig.map((function(item){item.position=item.position||"left";var disabled=item.disabled||item.select&&!hasSelected;return item.position===position?"checkbox"===item.type?function(item){return React.createElement(acud.Checkbox,{className:"".concat(CLS_PREFIX$a,"-checkbox"),key:item.id,checked:checkedAll,onChange:function(e){return onHandleAction(item,{checked:e.target.checked})}},item.text)}(item):function(item,disabled){return void 0===disabled&&(disabled=!1),React.createElement(acud.Button,__assign({className:"".concat(CLS_PREFIX$a,"-button"),key:item.id},"danger"!==item.skin?{type:item.skin}:{danger:!0},{icon:item.icon,disabled:disabled,onClick:function(){return onHandleAction(item)}}),item.text)}(item,disabled):null})),"left"===position&&selectedRowKeys&&React.createElement("span",{className:"".concat(CLS_PREFIX$a,"-selected-count")},hasSelected?"".concat(null==locale?void 0:locale.chosen).concat(selectedRowKeys.length).concat(null==locale?void 0:locale.Record):"")):null};BulkArea.defaultProps={position:"left",loading:!1};var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}var module,classnames={exports:{}};
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/module=classnames,function(){var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i<arguments.length;i++){var arg=arguments[i];if(arg){var argType=typeof arg;if("string"===argType||"number"===argType)classes.push(arg);else if(Array.isArray(arg)){if(arg.length){var inner=classNames.apply(null,arg);inner&&classes.push(inner)}}else if("object"===argType){if(arg.toString!==Object.prototype.toString&&!arg.toString.toString().includes("[native code]")){classes.push(arg.toString());continue}for(var key in arg)hasOwn.call(arg,key)&&arg[key]&&classes.push(key)}}}return classes.join(" ")}module.exports?(classNames.default=classNames,module.exports=classNames):window.classNames=classNames}();var classNames=getDefaultExportFromCjs(classnames.exports),DynamicFormItem=function(props){var _a=props.prefixCls,prefixCls=void 0===_a?CLS_PREFIX$9:_a,control=props.control,option=props.option,formData=props.formData,formItemLabelLayout=option.layouts.formItemLabelLayout,_b=_.get(control,"dynamic",{}),_c=_b.min,min=void 0===_c?1:_c,max=_b.max,_d=_b.rules,rules=void 0===_d?[]:_d,dynamicItemCls="".concat(prefixCls,"-item-dynamic"),infoIcon=control.infoIcon,extra=control.extra;if(infoIcon){var className=infoIcon.className,tooltipProps=infoIcon.tooltipProps;extra=React.createElement(React.Fragment,null,React.createElement("span",{className:"".concat(className||"acud-form-extra-inline")},React.createElement(acud.Tooltip,__assign({},tooltipProps),React.createElement(Icon.OutlinedQuestionCircle,{width:16}))),extra)}return React.createElement(acud.Form.Item,{label:control.label},React.createElement(acud.Form.List,{name:control.name,rules:rules},(function(fields,_a,_b){var add=_a.add,remove=_a.remove,errors=_b.errors;return fields.length<min&&add(),React.createElement("div",{className:dynamicItemCls},_.map(fields,(function(field){return React.createElement(acud.Form.Item,__assign({},formItemLabelLayout,{key:field.key}),React.createElement("div",{className:"".concat(dynamicItemCls,"-item")},React.createElement(DuFormItem,{prefixCls:prefixCls,field:field,control:__assign(__assign({},control),{label:null,extra:null}),noLabel:!0,option:option,formData:formData}),fields.length>min&&React.createElement(Icon.OutlinedMinusCircle,{className:"dynamic-delete-button",onClick:function(){return remove(field.name)}})))})),React.createElement(acud.Form.Item,__assign({},formItemLabelLayout,{extra:control.extra}),!(max&&fields.length>=max)&&React.createElement(acud.Button,{type:"enhance",onClick:function(){return add()}},React.createElement(Icon.OutlinedPlus,null)),React.createElement(acud.Form.ErrorList,{errors:errors})))})))};function expressionComparison(oper,expectedValue,realValue,customMethod){switch(oper){case"in":if(_.isArray(realValue)){var res_1=!0;return _.each(realValue,(function(item){if(-1===_.indexOf(expectedValue,item))return res_1=!1,!1})),res_1}return-1!==_.indexOf(expectedValue,realValue);case"not-in":if(_.isArray(realValue)){var res_2=!0;return _.each(realValue,(function(item){if(-1!==_.indexOf(expectedValue,item))return res_2=!1,!1})),res_2}return-1===_.indexOf(expectedValue,realValue);case"===":return _.isArray(realValue)&&_.isArray(expectedValue)?expectedValue.length===realValue.length&&expressionComparison("in",expectedValue,realValue):expectedValue===realValue;case"!==":return _.isArray(realValue)&&_.isArray(expectedValue)?expectedValue.length!==realValue.length||expressionComparison("not-in",expectedValue,realValue):expectedValue!==realValue;case">":return realValue>expectedValue;case"<":return realValue<expectedValue;case">=":return realValue>=expectedValue;case"<=":return realValue<=expectedValue;case"custom":return!!customMethod&&customMethod(expectedValue,realValue)}}function getValuePropName(control){var type=control.type,_a=control.config;return"checkbox"===type&&!(void 0===_a?{}:_a).options||"switch"===type?"checked":"value"}var CheckboxGroup$3=acud.Checkbox.Group,RelationFormItems=function(props){var _a=props||{},prefixCls=_a.prefixCls,controls=_a.controls,option=_a.option,formData=_a.formData,_b=_a.form,form=void 0===_b?{}:_b,moreSettingCollapsed=_a.moreSettingCollapsed,isHasQueryPanel=_a.isHasQueryPanel,_c=_a.defaultCheckedList,defaultCheckedList=void 0===_c?[]:_c,onReset=_a.onReset,_d=_a.showQueryNames,showQueryNames=void 0===_d?[]:_d,setShowQueryNames=_a.setShowQueryNames,colLabel=moreSettingCollapsed?moreSettingCollapsed.label:void 0,defaultExpand=moreSettingCollapsed?moreSettingCollapsed.defaultExpand:void 0,expand=null==moreSettingCollapsed?void 0:moreSettingCollapsed.expand,setExpand=null==moreSettingCollapsed?void 0:moreSettingCollapsed.setExpand,expandIdx=colLabel?controls.findIndex((function(item){return item.name===colLabel})):0,_e=__read(React.useState(defaultExpand),2),colExpand=_e[0],setColExpand=_e[1],handleColExpandChange=React.useCallback((function(){null==setExpand||setExpand(!colExpand),setColExpand(!colExpand)}),[colExpand,setExpand]);React.useEffect((function(){if(moreSettingCollapsed&&form){console.log("moreSettingCollapsed(高级配置) 改写 validateFields!!");var e_1=form.validateFields;form.validateFields=function(nameList,options){return __awaiter(void 0,void 0,void 0,(function(){var e_2,_a;return __generator(this,(function(_b){switch(_b.label){case 0:return _b.trys.push([0,2,,3]),[4,e_1(nameList,options)];case 1:return[2,_b.sent()];case 2:return e_2=_b.sent(),null===(_a=null==e_2?void 0:e_2.errorFields)||void 0===_a||_a.every((function(field){var _a=field.name,name=void 0===_a?[]:_a;return name=name[0],!(controls.findIndex((function(item){return item.name===name}))>expandIdx)||(setColExpand(!0),!1)})),[2,Promise.reject(e_2)];case 3:return[2]}}))}))}}}),[]);var relationComparison=React.useCallback((function(oper,rawData,newData){return"&&"===oper?rawData&&newData:rawData||newData}),[]),getOnDisplay=React.useCallback((function(getFieldValue,onDisplay){var result=!0;return _.each(onDisplay,(function(item,i){var formItemValue=getFieldValue(item.name),value=void 0===formItemValue?formData[item.name]:formItemValue,itemResult=!1;_.each(item.content,(function(values,index){var res=expressionComparison(values.exp,values.value,value,values.customMethod);itemResult=0===index?res:relationComparison(values.relation,itemResult,res)})),result=0===i?itemResult:relationComparison(item.relation,result,itemResult)})),result}),[formData,relationComparison]);React.useEffect((function(){expand&&(null==setColExpand||setColExpand(expand))}),[expand]);var setVisible=__read(React.useState(!1),2)[1],_g=__read(React.useState(defaultCheckedList),2),checkedList=_g[0],setCheckedList=_g[1],_h=__read(React.useState(showQueryNames.length>0&&showQueryNames.length<controls.length),2),indeterminate=_h[0],setIndeterminate=_h[1],_j=__read(React.useState(showQueryNames.length===controls.length),2),checkAll=_j[0],setCheckAll=_j[1],showQueryInfo=React.useMemo((function(){return{showBtn:showQueryNames.length>1,showQueryItems:controls.length>=2,queryItemsOptions:controls.map((function(item){return(null==item?void 0:item.label)||""}))}}),[controls,showQueryNames]),onChange=React.useCallback((function(list){setCheckedList(list),setIndeterminate(!!list.length&&list.length<showQueryInfo.queryItemsOptions.length),setCheckAll(list.length===controls.length)}),[showQueryInfo,controls]),onCheckAllChange=React.useCallback((function(e){var options=showQueryInfo.queryItemsOptions;setCheckedList(e.target.checked?options:__spreadArray([],__read(options),!1).slice(0,2)),setIndeterminate(!e.target.checked&&2!==options.length),setCheckAll(!!e.target.checked||2===options.length)}),[showQueryInfo]),handleVisibleChange=React.useCallback((function(flag){setVisible(flag),!flag&&setShowQueryNames&&setShowQueryNames(checkedList)}),[checkedList,setShowQueryNames]);return React.createElement(React.Fragment,null,_.map(controls,(function(control,index){var _a,isHidden=moreSettingCollapsed&&colLabel&&!colExpand&&index>expandIdx,itemStyle=isHidden?{visibility:"hidden",height:0,opacity:0}:{};return control&&React.createElement(React.Fragment,null,isHasQueryPanel?React.createElement(React.Fragment,null,showQueryNames.includes((null==control?void 0:control.label)||"")?React.createElement(acud.Form.Item,{shouldUpdate:!0,style:itemStyle,key:control.name,noStyle:option.noStyle&&!isHidden},React.createElement(DuFormItem,{prefixCls:prefixCls,key:control.name,isHasQueryPanel:!0,control:control,option:option,formData:formData})):null):React.createElement(acud.Form.Item,{shouldUpdate:!0,style:itemStyle,key:control.name,noStyle:option.noStyle&&!isHidden},(function(_a){var getFieldValue=_a.getFieldValue;return!(null==control?void 0:control.onDisplay)||getOnDisplay(getFieldValue,null==control?void 0:control.onDisplay)?(null==control?void 0:control.dynamic)?React.createElement(DynamicFormItem,{prefixCls:prefixCls,key:control.name,control:control,option:option,formData:formData,form:form}):React.createElement(DuFormItem,{prefixCls:prefixCls,key:control.name,control:control,option:option,formData:formData}):null})),colLabel&&(null==control?void 0:control.name)===colLabel&&React.createElement("div",{className:"more-setting-collapsed",onClick:handleColExpandChange},React.createElement("span",{className:"btn-txt"},colExpand?React.createElement(Icon.OutlinedUp,{width:16}):React.createElement(Icon.OutlinedDown,{width:16}),null!==(_a=moreSettingCollapsed.expandTitle)&&void 0!==_a?_a:"高级配置")))})),isHasQueryPanel?React.createElement(React.Fragment,null,showQueryInfo.showQueryItems?React.createElement(acud.Form.Item,{className:"".concat(prefixCls,"-footer ").concat(1===showQueryNames.length?"no-query":"")},React.createElement(React.Fragment,null,React.createElement(acud.Popover,{placement:"bottomLeft",overlayClassName:"".concat(prefixCls,"-footer-popover-root"),content:React.createElement("div",{className:"".concat(prefixCls,"-footer-popover")},React.createElement(acud.Checkbox,{indeterminate:indeterminate,onChange:onCheckAllChange,checked:checkAll,style:{marginRight:16}},"全选"),React.createElement(CheckboxGroup$3,{disabled:2===checkedList.length,options:showQueryInfo.queryItemsOptions,value:checkedList,onChange:onChange})),onVisibleChange:handleVisibleChange},React.createElement(Icon.OutlinedPlus,null),React.createElement("span",null,"筛选项")),showQueryInfo.showBtn?React.createElement(React.Fragment,null,React.createElement(acud.Button,{style:{marginLeft:16,marginRight:8},type:"primary",htmlType:"submit"},"查询"),React.createElement(acud.Button,{htmlType:"button",onClick:onReset},"重置")):null)):null):null)};RelationFormItems.propTypes={controls:PropTypes.array.isRequired,option:PropTypes.object.isRequired,form:PropTypes.object.isRequired,formData:PropTypes.object},RelationFormItems.defaultProps={controls:[],option:{},formData:{},form:{}};var ConfigContext=React.createContext({});ConfigContext.Consumer;function usePrevious$1(value){var cache=React.useRef(void 0);return React.useEffect((function(){cache.current=value}),[value]),cache.current}var Step=acud.Steps.Step,CLS_PREFIX$9="".concat("du","-form"),STEP_CLS_PREFIX="".concat("du","-step-form"),HooksForm=function(props){var _a=React.useContext(ConfigContext),defaultPrefixCls=_a.prefixCls,formConfigs=_a.form,customizePrefixCls=props.prefixCls,className=props.className,title=props.title,description=props.description,form=props.form,_b=props.controlsConfig,controlsConfig=void 0===_b?[]:_b,_c=props.formData,formData=void 0===_c?{}:_c,doSubmit=props.doSubmit,type=props.type,_d=props.stepIndex,stepIndex=void 0===_d?0:_d,stepButtonConfig=props.stepButtonConfig,formItemOptionMerge=props.formItemOptionMerge,_e=props.formExtraConfig,formExtraConfig=void 0===_e?{}:_e,moreSettingCollapsed=props.moreSettingCollapsed,_f=props.defaultValueForceUpdate,defaultValueForceUpdate=void 0===_f?null==formConfigs?void 0:formConfigs.defaultValueForceUpdate:_f,prevFormData=usePrevious$1(formData)||{},prefixCls=customizePrefixCls||(defaultPrefixCls?defaultPrefixCls+"-hooks-form":"")||CLS_PREFIX$9,stepPrefixCls=customizePrefixCls||(defaultPrefixCls?defaultPrefixCls+"-hooks-step-form":"")||STEP_CLS_PREFIX,stepTpl=_.map(controlsConfig,(function(step){return React.createElement(Step,{key:step.title,title:step.title})})),baseFormCls=classNames(className,prefixCls),stepFormItemCls="".concat(stepPrefixCls,"-item ").concat(stepPrefixCls,"-index-").concat(stepIndex),formDataStr=function(){try{return JSON.stringify(formData)}catch(error){return formData}}();return React.useEffect((function(){if(defaultValueForceUpdate){var formValues=form.getFieldsValue(),dataToUpdate={};for(var key in formData)void 0===prevFormData[key]&&void 0===formValues[key]&&(dataToUpdate[key]=formData[key]);!_.isEmpty(dataToUpdate)&&form.setFieldsValue(dataToUpdate)}}),[formDataStr,form]),React.createElement("div",{className:baseFormCls},title&&React.createElement("h2",{className:"title"},title),description&&React.createElement("div",{className:"description"},description),"step"===type?React.createElement(acud.Form,__assign({form:form,initialValues:formData,className:STEP_CLS_PREFIX,onFinish:doSubmit},formExtraConfig),stepTpl&&React.createElement(acud.Steps,{current:stepIndex},stepTpl),React.createElement("div",{className:stepFormItemCls},React.createElement(RelationFormItems,{prefixCls:prefixCls,form:form,option:formItemOptionMerge,formData:formData,controls:controlsConfig[stepIndex].controls,moreSettingCollapsed:moreSettingCollapsed})),React.createElement(DuFormItem,{prefixCls:prefixCls,control:stepButtonConfig(),option:formItemOptionMerge})):React.createElement(acud.Form,__assign({form:form,initialValues:formData,onFinish:doSubmit},formExtraConfig),React.createElement(RelationFormItems,{prefixCls:prefixCls,form:form,option:formItemOptionMerge,formData:formData,controls:controlsConfig,moreSettingCollapsed:moreSettingCollapsed})))};function isValid(item){return["",void 0,null].includes(item)}function getErrorMessage(error,defaultMessage){var res;return void 0===error&&(error={}),null!==error&&(res=error instanceof Error?error.message:error.global),res||defaultMessage}function getGlobalError(error){return void 0===error&&(error={}),error&&error.global||""}function message(type,msg){acud.toast[type]({message:msg,duration:3})}function isValue(val){return!(_.isNaN(val)||_.isNull(val)||_.isUndefined(val))}var index$b=Object.freeze({__proto__:null,filterData:function(data,predicate){return void 0===predicate&&(predicate=isValid),_.omitBy(data,predicate)},getErrorMessage:getErrorMessage,getGlobalError:getGlobalError,isValue:isValue,message:message}),CLS_PREFIX$8="".concat("du","-fileupload"),FileUpload=function(props){var locale=__read(useLocale("FileUpload"),1)[0],DEFAULT_TIP_TEXT=null==locale?void 0:locale.noticeCopywriting,_b=props.action,action=void 0===_b?"/file/upload":_b,_c=props.tipText,tipText=void 0===_c?DEFAULT_TIP_TEXT:_c,value=props.value,children=props.children,beforeUpload=props.beforeUpload,onChange=props.onChange,_d=__read(React.useState(function(value){return _.isArray(value)&&value.length?value.map((function(valueItem){return{uid:valueItem.uid,name:valueItem.name,status:"done",url:valueItem.url}})):[]}(value)),2),fileList=_d[0],setFileList=_d[1],_e=__read(React.useState({}),2),headers=_e[0],setHeaders=_e[1],handleUploadBefore=React.useCallback((function(file,fileList){return setHeaders(__assign(__assign({},headers),{"file-name":encodeURIComponent(file.name)})),beforeUpload&&beforeUpload(file,fileList),!0}),[headers,beforeUpload]),handleUploadChange=React.useCallback((function(info){var file=info.file,fileList=info.fileList;setFileList(_.cloneDeep(fileList));var status=file.status,response=file.response;if("error"===status)message("error",null==locale?void 0:locale.uploadFailed);else if("done"===status||"removed"===status){message("success",null==locale?void 0:locale.updateCompleted);var fileInList=_.find(fileList,(function(fileItem){return fileItem.uid===file.uid}));if(fileInList&&(fileInList.url=response.url),onChange){var formValue=function(fileList){var formValue=[];return fileList.forEach((function(item){var status=item.status,uid=item.uid,name=item.name,url=item.url;"done"===status&&formValue.push({uid:uid,name:name,url:url})})),formValue}(fileList);onChange(formValue)}}}),[onChange]),uploadProps=_.omit(props,"action","onChange","beforeUpload","onRemove");return React.createElement("div",null,React.createElement(acud.Upload,__assign({className:CLS_PREFIX$8,name:"file",withCredentials:!0,headers:headers,fileList:fileList,beforeUpload:handleUploadBefore,onChange:handleUploadChange,action:action},uploadProps),children||React.createElement(acud.Button,{icon:React.createElement(Icon.OutlinedUpload,null)},"Upload")),tipText&&React.createElement("span",{className:"".concat(CLS_PREFIX$8,"-tip")},tipText))},RadioButton=acud.Radio.Button,RadioGroup=acud.Radio.Group,CheckboxGroup$2=acud.Checkbox.Group,Option=acud.Select.Option,MonthPicker=acud.DatePicker.MonthPicker,RangePicker$1=acud.DatePicker.RangePicker,WeekPicker=acud.DatePicker.WeekPicker,TextArea=acud.Input.TextArea,DuFormComponents=function(props){var control=props.control,option=props.option,formData=props.formData,_a=props.isHasQueryPanel,isHasQueryPanel=void 0!==_a&&_a,formControl=__rest(props,["control","option","formData","isHasQueryPanel"]),isSubmiting=option.isSubmiting,type=control.type,name=control.name,disabled=control.disabled,content=control.content,_b=control.events,events=void 0===_b?{}:_b,_c=control.style,style=void 0===_c?{}:_c,_d=control.config,config=void 0===_d?{}:_d,defaultValue=_.get(formData,name,control.defaultValue),itemConfig=__assign(__assign(__assign(__assign({disabled:disabled,style:style},_.omit(config,"subType")),events),formControl),{onChange:function(e){events&&events.onChange&&events.onChange(e),formControl.onChange&&formControl.onChange(e)}});if("text"===type)return defaultValue;if("rangePicker"===type)return"date"===config.subType?React.createElement(acud.DatePicker,__assign({},itemConfig)):"month"===config.subType?React.createElement(MonthPicker,__assign({},itemConfig)):"week"===config.subType?React.createElement(WeekPicker,__assign({},itemConfig)):React.createElement(RangePicker$1,__assign({},itemConfig));if("input"===type){return"number"===config.subType?React.createElement(acud.InputNumber,__assign({},itemConfig)):isHasQueryPanel||"textarea"!==config.subType?isHasQueryPanel||"password"!==config.subType?React.createElement(acud.Input,__assign({type:config.subType},itemConfig)):React.createElement(acud.Input.Password,__assign({},itemConfig)):React.createElement(TextArea,__assign({rows:4},itemConfig))}if("select"===type)return delete itemConfig.options,React.createElement(acud.Select,__assign({mode:config.mode},itemConfig),config.options&&config.options.map((function(item){return React.createElement(Option,{key:item.value,value:item.value,title:item.text||item.label,disabled:item.disabled,extra:item.extra},item.text||item.label)})));if(!isHasQueryPanel&&"radio"===type){_.unset(itemConfig,"options");var isButton_1="button"===config.subType,RadioItem_1=isButton_1?RadioButton:acud.Radio;return React.createElement(RadioGroup,__assign({},itemConfig,{buttonStyle:"solid"}),config.options.map((function(item){return React.createElement(RadioItem_1,{key:item.value,value:item.value,checked:item.value,disabled:item.disabled,limit:isButton_1?item.limit:void 0},item.label||item.text)})))}return isHasQueryPanel||"checkbox"!==type?"cascader"===type?React.createElement(acud.Cascader,__assign({},itemConfig)):isHasQueryPanel||"upload"!==type?isHasQueryPanel||"custom"!==type?isHasQueryPanel||"button"!==type?isHasQueryPanel||"switch"!==type?"treeSelect"===type?React.createElement(acud.TreeSelect,__assign({},itemConfig)):"transfer"===type?React.createElement(acud.Transfer,__assign({},itemConfig)):React.createElement("div",null,content):React.createElement(acud.Switch,__assign({},itemConfig)):React.createElement("div",{key:"button"},config.map((function(item){return React.createElement(acud.Button,__assign({loading:isSubmiting,key:item.type,type:item.skin,htmlType:item.type},item.config,item.events),item.text)}))):content:React.createElement(FileUpload,__assign({},itemConfig)):config.options?React.createElement(CheckboxGroup$2,__assign({},itemConfig)):React.createElement(acud.Checkbox,__assign({},itemConfig),config.label)};DuFormComponents.propTypes={control:PropTypes.object.isRequired,option:PropTypes.object.isRequired,formData:PropTypes.object},DuFormComponents.defaultProps={formData:null};var defaultOptions$1={layouts:{formItemLabelLayout:{labelAlign:"left",labelCol:{xs:{span:24},sm:{span:4}},wrapperCol:{xs:{span:24},sm:{span:20}}},formItemEmptyLabelLayout:{labelAlign:"left",wrapperCol:{span:20,offset:4}},formItemNoneLayout:{labelAlign:"left",wrapperCol:{span:24,offset:0}}}},FormItem=acud.Form.Item,DuFormItem=function(props){var _a=props.prefixCls,prefixCls=void 0===_a?CLS_PREFIX$9:_a,_b=props.field,field=void 0===_b?{}:_b,control=props.control,option=props.option,noLabel=props.noLabel,layouts=__assign(__assign({},defaultOptions$1),option).layouts,type=control.type,name=control.name,label=control.label,rules=control.rules,infoIcon=control.infoIcon,content=control.content,formConfig=control.formConfig,tooltip=control.tooltip,extra=control.extra,formItemLabelLayout=layouts.formItemLabelLayout,formItemEmptyLabelLayout=layouts.formItemEmptyLabelLayout,formItemNoneLayout=layouts.formItemNoneLayout;if(infoIcon){var className=infoIcon.className,tooltipProps=infoIcon.tooltipProps;extra=React.createElement(React.Fragment,null,React.createElement("span",{className:"".concat(className||"acud-form-extra-inline")},React.createElement(acud.Tooltip,__assign({},tooltipProps),React.createElement(Icon.OutlinedQuestionCircle,{width:16}))),extra)}var formItemLayout=noLabel?formItemNoneLayout:label?formItemLabelLayout:formItemEmptyLabelLayout,formItemPrefixCls="".concat(prefixCls,"-item"),formItemCls="".concat(formItemPrefixCls," ").concat(formItemPrefixCls,"-").concat(name," ").concat(formItemPrefixCls,"-type-").concat(type);prefixCls!==CLS_PREFIX$9&&(formItemCls+=" du-form-item-".concat(name));var formItemConfig="text"===type?__assign({className:formItemCls,label:label,tooltip:tooltip,extra:extra,valuePropName:getValuePropName(control)},formItemLayout):__assign(__assign(__assign({className:formItemCls,label:label,tooltip:tooltip,extra:extra,rules:rules,name:name,valuePropName:getValuePropName(control),shouldUpdate:_.isEmpty(formConfig&&formConfig.dependencies)},formConfig),formItemLayout),field),duFormComponentsProps=_.omit(props,"prefixCls"),DuFormBlockTpl=DuFormComponents(duFormComponentsProps);return type?React.createElement(FormItem,__assign({},formItemConfig),DuFormBlockTpl):content};DuFormItem.propTypes={control:PropTypes.object.isRequired,option:PropTypes.object.isRequired};var shallowequal=function(objA,objB,compare,compareContext){var ret=compare?compare.call(compareContext,objA,objB):void 0;if(void 0!==ret)return!!ret;if(objA===objB)return!0;if("object"!=typeof objA||!objA||"object"!=typeof objB||!objB)return!1;var keysA=Object.keys(objA),keysB=Object.keys(objB);if(keysA.length!==keysB.length)return!1;for(var bHasOwnProperty=Object.prototype.hasOwnProperty.bind(objB),idx=0;idx<keysA.length;idx++){var key=keysA[idx];if(!bHasOwnProperty(key))return!1;var valueA=objA[key],valueB=objB[key];if(!1===(ret=compare?compare.call(compareContext,valueA,valueB,key):void 0)||void 0===ret&&valueA!==valueB)return!1}return!0},shallowEquals=getDefaultExportFromCjs(shallowequal),fastDeepEqual=function equal(a,b){if(a===b)return!0;if(a&&b&&"object"==typeof a&&"object"==typeof b){if(a.constructor!==b.constructor)return!1;var length,i,keys;if(Array.isArray(a)){if((length=a.length)!=b.length)return!1;for(i=length;0!=i--;)if(!equal(a[i],b[i]))return!1;return!0}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();if((length=(keys=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(i=length;0!=i--;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return!1;for(i=length;0!=i--;){var key=keys[i];if(!equal(a[key],b[key]))return!1}return!0}return a!=a&&b!=b},deepEquals=getDefaultExportFromCjs(fastDeepEqual);function useOriginalCopy$1(value,equals){void 0===equals&&(equals=shallowEquals);var cache=React.useRef(value),equalsRef=React.useRef(equals);return React.useEffect((function(){equalsRef.current=equals}),[equals]),React.useEffect((function(){equalsRef.current(cache.current,value)||(cache.current=value)}),[value]),equals(cache.current,value)?cache.current:value}function useOriginalDeepCopy(value){return useOriginalCopy$1(value,deepEquals)}var CLS_PREFIX$7="".concat("du","-cards"),Cards=function(_super){function Cards(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.handleCheckboxChange=function(evt,itemId){var rowSelection=_this.props.rowSelection;if(rowSelection){var selectedRowKeys=rowSelection.selectedRowKeys,newSelectedRowKeys=evt.target.checked?__spreadArray(__spreadArray([],__read(selectedRowKeys),!1),[itemId],!1):_.filter(selectedRowKeys,(function(key){return key!==itemId}));rowSelection.onChange&&rowSelection.onChange(newSelectedRowKeys)}},_this}return __extends(Cards,_super),Cards.prototype.render=function(){var _this=this,_a=this.props,dataSource=_a.dataSource,loading=_a.loading,locale=_a.locale,rowKey=_a.rowKey,Card=_a.card,rowSelection=_a.rowSelection,onHandleAction=_a.onHandleAction,onHandleTableCommand=_a.onHandleTableCommand;return React.createElement("div",{className:CLS_PREFIX$7},React.createElement(acud.Loading,{loading:loading},!loading&&dataSource.length?_.map(dataSource,(function(item){return React.createElement("div",{className:"".concat(CLS_PREFIX$7,"-card"),key:item[rowKey]},React.createElement(Card,{item:item,selectedRowKeys:rowSelection&&rowSelection.selectedRowKeys,onHandleAction:onHandleAction,onHandleTableCommand:onHandleTableCommand,onCheckboxChange:_this.handleCheckboxChange}))})):locale.emptyText))},Cards}(React.Component),CLS_PREFIX$6="".concat("du","-listpage"),EmptyStatus=function(props){var customizePrefixCls=props.prefixCls,status=props.status,className=props.className,emptyProps=__rest(props,["prefixCls","status","className"]),defaultPrefixCls=React.useContext(ConfigContext).prefixCls,prefixCls=customizePrefixCls||defaultPrefixCls||"acud-pro",locale=__read(useLocale("EmptyStatus"),1)[0],STATUS_CONFIG={NO_AUTH:{image:"data:image/svg+xml,%3csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient x1='16.498%25' y1='38.528%25' x2='56.262%25' y2='63.185%25' id='a'%3e%3cstop stop-color='%23DCE0EF' offset='0%25'/%3e%3cstop stop-color='%23DCDFEA' offset='100%25'/%3e%3c/linearGradient%3e%3clinearGradient x1='28.893%25' y1='55.707%25' x2='93.898%25' y2='48.876%25' id='b'%3e%3cstop stop-color='%23F1F3FA' offset='0%25'/%3e%3cstop stop-color='%23E8EAF0' offset='100%25'/%3e%3c/linearGradient%3e%3clinearGradient x1='21.925%25' y1='36.776%25' x2='113.366%25' y2='55.835%25' id='d'%3e%3cstop stop-color='white' stop-opacity='.4' offset='0%25'/%3e%3cstop stop-color='white' stop-opacity='0' offset='100%25'/%3e%3c/linearGradient%3e%3cellipse id='c' cx='44.4' cy='22.8' rx='44.4' ry='22.8'/%3e%3c/defs%3e%3cg fill='none' fill-rule='evenodd'%3e%3cpath d='M0 0h100v100H0z'/%3e%3cg transform='translate(5.6 36.8)'%3e%3cellipse fill='url(%23a)' fill-rule='nonzero' cx='44.4' cy='25.2' rx='44.4' ry='22.8'/%3e%3cuse fill='url(%23b)' fill-rule='nonzero' xlink:href='%23c'/%3e%3cellipse stroke='url(%23d)' stroke-width='.5' cx='43.8' cy='21.6' rx='21' ry='10.8'/%3e%3c/g%3e%3cpath d='M50.8 37.934c3.104-.429 4.773-3.337 4.705-7.637-.094-6.096-4.28-12.841-9.217-15.159-4.819-2.262-8.808.429-9.008 6.113-.143 4.004 1.18 8.28 4.055 11.749-6.698-1.128-11.953 4.439-12.472 13.928-.11 2.03-.125 4.279 3.205 6.268 3.021 1.808 21.53 12.64 28.576 16.79 3.204 1.892 3.936-.095 3.864-2.53-.314-10.78-6.462-23.23-13.708-29.522' stroke='white' stroke-width='.5' fill='%23E0E3EF' fill-rule='nonzero'/%3e%3cpath d='M51.2 47.9v17.24a.36.36 0 0 0 .196.32l18.48 9.472a.36.36 0 0 0 .524-.32V57.475a.36.36 0 0 0-.194-.32l-18.48-9.574a.36.36 0 0 0-.526.32Z' fill='%23F5F7FD'/%3e%3cpath d='M61.895 62.7c.842-.61.83-2.059-.026-3.235-.857-1.176-2.235-1.634-3.077-1.024-.843.61-.831 2.058.026 3.234.857 1.176 2.234 1.635 3.077 1.025Z' fill='%23EBEDF3'/%3e%3cpath d='M58.71 51.199v-3.365c0-1.404 1.225-1.94 2.777-1.137 1.551.804 2.776 2.612 2.776 4.013v3.309l2.067 1.07v-3.308c0-2.56-2.168-5.76-4.843-7.145-2.676-1.386-4.844-.431-4.844 2.128v3.38L58.71 51.2Z' fill='white' fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e",description:null==locale?void 0:locale.noAccessPermissions,children:null==locale?void 0:locale.connectAdministrator},NO_DATA:{image:"data:image/svg+xml,%3csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient x1='16.498%25' y1='38.528%25' x2='56.262%25' y2='63.185%25' id='a'%3e%3cstop stop-color='%23DCE0EF' offset='0%25'/%3e%3cstop stop-color='%23DCDFEA' offset='100%25'/%3e%3c/linearGradient%3e%3clinearGradient x1='28.893%25' y1='55.707%25' x2='93.898%25' y2='48.876%25' id='b'%3e%3cstop stop-color='%23F1F3FA' offset='0%25'/%3e%3cstop stop-color='%23E8EAF0' offset='100%25'/%3e%3c/linearGradient%3e%3clinearGradient x1='21.925%25' y1='36.776%25' x2='113.366%25' y2='55.835%25' id='d'%3e%3cstop stop-color='white' stop-opacity='.4' offset='0%25'/%3e%3cstop stop-color='white' stop-opacity='0' offset='100%25'/%3e%3c/linearGradient%3e%3cellipse id='c' cx='44.4' cy='22.8' rx='44.4' ry='22.8'/%3e%3c/defs%3e%3cg fill='none' fill-rule='evenodd'%3e%3cpath d='M0 0h100v100H0z'/%3e%3cg transform='translate(5.6 35.6)'%3e%3cellipse fill='url(%23a)' fill-rule='nonzero' cx='44.4' cy='25.2' rx='44.4' ry='22.8'/%3e%3cuse fill='url(%23b)' fill-rule='nonzero' xlink:href='%23c'/%3e%3cellipse stroke='url(%23d)' stroke-width='.5' cx='43.8' cy='21.6' rx='21' ry='10.8'/%3e%3c/g%3e%3cpath d='M69.343 42.018c6.904 3.985 10.08 11.235 10.057 19.162-.011 3.963-1.42 6.745-3.683 8.05-2.275 1.284-5.406 1.082-8.853-.9L34.857 50.868C27.953 46.882 22.377 37.22 22.4 29.294c.023-7.927 5.643-11.113 12.547-7.127.89.506 1.746 1.103 2.579 1.79.766-8.096 7.05-11.136 14.675-6.745 7.614 4.392 13.865 14.672 14.574 23.623.823.27 1.69.676 2.568 1.183Z' fill='%23E0E3EF' fill-rule='nonzero'/%3e%3cpath d='M42.92 29.682a.81.81 0 0 1 1.263-.671l4.86 3.274a.81.81 0 0 1 .357.672v8.163l-1.129-.715 1.129.761v7.123a.81.81 0 0 1-1.243.684l-4.86-3.076a.81.81 0 0 1-.377-.684v-15.53Z' fill='white'/%3e%3cpath d='m53.903 44.13 4.86 3.275a.81.81 0 0 1 .357.672v6.692a.81.81 0 0 1-1.243.684l-4.86-3.076a.81.81 0 0 1-.377-.684v-6.89a.81.81 0 0 1 1.263-.672Z' fill='%23F7F8FB'/%3e%3c/g%3e%3c/svg%3e",description:null==locale?void 0:locale.noResult,children:null==locale?void 0:locale.replaceKeywords},NO_PAGE:{image:"data:image/svg+xml,%3csvg width='100' height='80' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient x1='16.498%25' y1='38.528%25' x2='56.262%25' y2='63.185%25' id='a'%3e%3cstop stop-color='%23DCE0EF' offset='0%25'/%3e%3cstop stop-color='%23DCDFEA' offset='100%25'/%3e%3c/linearGradient%3e%3clinearGradient x1='28.893%25' y1='55.707%25' x2='93.898%25' y2='48.876%25' id='b'%3e%3cstop stop-color='%23F1F3FA' offset='0%25'/%3e%3cstop stop-color='%23E8EAF0' offset='100%25'/%3e%3c/linearGradient%3e%3clinearGradient x1='21.925%25' y1='36.776%25' x2='113.366%25' y2='55.835%25' id='d'%3e%3cstop stop-color='white' stop-opacity='.4' offset='0%25'/%3e%3cstop stop-color='white' stop-opacity='0' offset='100%25'/%3e%3c/linearGradient%3e%3cellipse id='c' cx='37' cy='44' rx='37' ry='19'/%3e%3c/defs%3e%3cg fill='none' fill-rule='evenodd'%3e%3cpath d='M0 0h100v80H0z'/%3e%3cg transform='translate(13 7.368)'%3e%3cellipse fill='url(%23a)' fill-rule='nonzero' cx='37' cy='46' rx='37' ry='19'/%3e%3cuse fill='url(%23b)' fill-rule='nonzero' xlink:href='%23c'/%3e%3cellipse stroke='url(%23d)' stroke-width='.5' cx='36.5' cy='43' rx='17.5' ry='9'/%3e%3cpath d='m43.99 14.587-.09 35.39a.8.8 0 0 1-1.22.678L21.38 37.51a.8.8 0 0 1-.379-.683l.085-35.396a.8.8 0 0 1 1.22-.679l21.305 13.153a.8.8 0 0 1 .38.683Z' fill='%23E0E3EF' fill-rule='nonzero'/%3e%3cpath d='m48.99 17.587-.09 35.39a.8.8 0 0 1-1.22.678L26.38 40.51a.8.8 0 0 1-.379-.683l.085-35.396a.8.8 0 0 1 1.22-.679l21.305 13.153a.8.8 0 0 1 .38.683Z' fill='%23E0E3EF' fill-rule='nonzero'/%3e%3cpath fill='white' d='m35.451 31.487 2.598-1.5 5.5 9.526-2.598 1.5z'/%3e%3cpath d='M32.516 16.847C28.93 14.877 26 16.46 26 20.401c0 3.942 2.9 8.75 6.484 10.752 3.586 1.97 6.485.388 6.516-3.554 0-3.972-2.9-8.78-6.484-10.752' stroke='white' stroke-width='3'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",description:null==locale?void 0:locale.pageNotFound,children:React.createElement(React.Fragment,null,null==locale?void 0:locale.pageDoesNotExist,null==locale?void 0:locale.please,React.createElement("a",{onClick:function(){return window.location.reload()}},null==locale?void 0:locale.refreshPage),"  ")},SERVER_ERROR:{image:"data:image/svg+xml,%3csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient x1='16.498%25' y1='38.528%25' x2='56.262%25' y2='63.185%25' id='a'%3e%3cstop stop-color='%23DCE0EF' offset='0%25'/%3e%3cstop stop-color='%23DCDFEA' offset='100%25'/%3e%3c/linearGradient%3e%3clinearGradient x1='28.893%25' y1='55.707%25' x2='93.898%25' y2='48.876%25' id='b'%3e%3cstop stop-color='%23F1F3FA' offset='0%25'/%3e%3cstop stop-color='%23E8EAF0' offset='100%25'/%3e%3c/linearGradient%3e%3clinearGradient x1='21.925%25' y1='36.776%25' x2='113.366%25' y2='55.835%25' id='d'%3e%3cstop stop-color='white' stop-opacity='.4' offset='0%25'/%3e%3cstop stop-color='white' stop-opacity='0' offset='100%25'/%3e%3c/linearGradient%3e%3cellipse id='c' cx='44.4' cy='22.8' rx='44.4' ry='22.8'/%3e%3c/defs%3e%3cg fill='none' fill-rule='evenodd'%3e%3cpath d='M0 0h100v100H0z'/%3e%3cg transform='translate(5.6 35.643)'%3e%3cellipse fill='url(%23a)' fill-rule='nonzero' cx='44.4' cy='25.2' rx='44.4' ry='22.8'/%3e%3cuse fill='url(%23b)' fill-rule='nonzero' xlink:href='%23c'/%3e%3cellipse stroke='url(%23d)' stroke-width='.5' cx='43.8' cy='21.6' rx='21' ry='10.8'/%3e%3c/g%3e%3cg fill-rule='nonzero'%3e%3cpath d='M56.153 18.843c-1.244-2.841-4.746-2.945-5.992-1.631L26.576 41.895c-1.453 1.5 0 5.714 2.599 7.307L70.08 68.561c3.756.682 4.487-3 2.93-6.342L56.153 18.843Z' fill='%23E0E3EF'/%3e%3cpath d='M49.4 52.973c1.7.98 3 .433 3-1.269 0-1.699-1.299-3.749-3-4.73-1.7-.98-3-.433-3 1.269 0 1.7 1.299 3.749 3 4.73Zm-3-11.09c0 .575.4 1.19 1 1.537l4 2.307c.6.346 1 .193 1-.383v-12.48c0-.575-.4-1.19-1-1.537l-4-2.307c-.6-.346-1-.193-1 .383v12.48Z' fill='white'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",description:null==locale?void 0:locale.serverError,children:React.createElement(React.Fragment,null,null==locale?void 0:locale.serverErrorNoResponse,null==locale?void 0:locale.againLater," ",null==locale?void 0:locale.or,React.createElement(tmp.Link,{to:"/"},null==locale?void 0:locale.returnHome),null==locale?void 0:locale.problemStillExists)}},statusEmptyProps=__assign(__assign(__assign({},status?STATUS_CONFIG[status]:{}),{className:classNames("".concat(prefixCls,"-empty-status"),className)}),emptyProps);return React.createElement(acud.Empty,__assign({},statusEmptyProps))};function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}var timePickerLocale={lang:{locale:"zh_CN",now:"此刻",ok:"确定",timeSelect:"选择时间",clear:"清除"},timePickerLocale:{placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]}}.timePickerLocale,locale={lang:_extends({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeWeekPlaceholder:["开始周","结束周"]},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"}),timePickerLocale:_extends({},timePickerLocale)};locale.lang.ok="确 定";var locale$1=locale,RenderSetColumns=function(props){var _a=props.columns,columns=void 0===_a?[]:_a,setColumns=props.setColumns,setColumnsConfig=props.setColumnsConfig,_b=__read(React.useState(!1),2),visible=_b[0],setVisible=_b[1],_c=__read(React.useState(""),2),searchValue=_c[0],setSearchValue=_c[1],_d=__read(React.useState([]),2),checkedList=_d[0],setCheckedList=_d[1],_e=__read(React.useState(!1),2),indeterminate=_e[0],setIndeterminate=_e[1],_f=__read(React.useState(!0),2),checkAll=_f[0],setCheckAll=_f[1];React.useEffect((function(){var defaultCheckedList=columns.filter((function(col){return!col.hidden})).map((function(col){return col.dataIndex}));setCheckedList(defaultCheckedList)}),[columns]);var filteredColumns=React.useMemo((function(){return columns.map((function(column){var _a,isDisplay=null===(_a=column.title)||void 0===_a?void 0:_a.toString().toLowerCase().includes(searchValue.toLowerCase());return __assign(__assign({},column),{isDisplay:isDisplay})}))}),[columns,searchValue]),updateTableColumns=function(checkedValues){var newColumns=columns.map((function(col){return __assign(__assign({},col),{hidden:!checkedValues.includes(col.dataIndex)})}));setColumns(newColumns)},content=React.createElement("div",{className:"set-columns-popover"},React.createElement("div",{className:"search-input"},React.createElement(acud.Search,{placeholder:"搜索列",value:searchValue,onChange:function(e){return setSearchValue(e.target.value)}})),React.createElement("div",{className:"check-all"},searchValue?null:React.createElement(acud.Checkbox,{indeterminate:indeterminate,onChange:function(e){var newCheckedList=e.target.checked?filteredColumns.map((function(col){return col.dataIndex})):(null==setColumnsConfig?void 0:setColumnsConfig.disabledColumns)||[];setIndeterminate(!1),setCheckAll(e.target.checked),setCheckedList(newCheckedList),updateTableColumns(newCheckedList)},checked:checkAll},"全选")),React.createElement("div",{className:"check-group"},React.createElement(acud.Checkbox.Group,{value:checkedList,onChange:function(checkedValues){var targetCheckedValues=checkedValues;setCheckedList(targetCheckedValues),setIndeterminate(!!targetCheckedValues.length&&targetCheckedValues.length<filteredColumns.length),setCheckAll(targetCheckedValues.length===filteredColumns.length),updateTableColumns(targetCheckedValues)}},filteredColumns.map((function(column){var _a;return React.createElement("div",{key:column.dataIndex,style:{padding:"8px 12px",display:column.isDisplay?"block":"none"}},React.createElement(acud.Checkbox,{value:column.dataIndex,disabled:null===(_a=null==setColumnsConfig?void 0:setColumnsConfig.disabledColumns)||void 0===_a?void 0:_a.includes(column.dataIndex)},column.title))})))));return React.createElement(acud.Popover,{content:content,trigger:"click",visible:visible,placement:"bottomLeft",onVisibleChange:function(flag){setVisible(flag)}},React.createElement(acud.Button,{className:"set-columns ".concat(visible?"active":""),type:"text",icon:React.createElement(Icon.OutlinedSetting,null)}))},renderButton=function(props){var disabled=props.disabled,skin=props.skin,text=props.text,handleCommand=props.handleCommand,customRender=props.customRender,buttonConfig=__rest(props,["disabled","skin","text","handleCommand","customRender"]),type="danger"===skin?"highlight":skin,btnPanel=React.createElement(acud.Button,__assign({key:_.uniqueId(),type:type,disabled:disabled},_.omit(buttonConfig,["actionType","select"]),{onClick:function(){return null==handleCommand?void 0:handleCommand({config:props})}}),text);return(null==customRender?void 0:customRender(btnPanel,props))||btnPanel},Bulk=function(props){var prefixCls=props.prefixCls,BulkComp=props.bulkComp,bulkConfig=props.bulkConfig,selectedRowKeys=props.selectedRowKeys,handleCommand=props.handleCommand,handleFilterChange=props.handleFilterChange,hasSelected=(null!=selectedRowKeys?selectedRowKeys:[]).length>0;return BulkComp?React.createElement(BulkComp,{selectedRowKeys:selectedRowKeys,hasSelected:hasSelected,handleCommand:handleCommand,handleFilterChange:handleFilterChange}):React.createElement("div",{className:"".concat(prefixCls,"-hooks-table-toolbar-bulk")},_.isEmpty(bulkConfig)?null:_.map(bulkConfig,(function(configItem){var disabled=configItem.disabled||configItem.select&&!hasSelected;return renderButton(__assign(__assign({},configItem),{disabled:disabled,handleCommand:handleCommand}))})))},Selected=function(props){var prefixCls=props.prefixCls,selectedRowKeys=props.selectedRowKeys,total=props.total,selected=(null!=selectedRowKeys?selectedRowKeys:[]).length;return selected?React.createElement("span",{className:"".concat(prefixCls,"-hooks-table-selected-count")},"已选中 ",selected," 条，共 ",total," 条"):React.createElement(React.Fragment,null)},Filter=function(props){var prefixCls=props.prefixCls,FilterComp=props.filterComp,filterConfig=props.filterConfig,isMore20=props.isMore20,cloumnsKeyList=props.cloumnsKeyList,columns=props.columns,setColumnsConfig=props.setColumnsConfig,handleTableCommand=props.handleTableCommand,setColumns=props.setColumns,setCloumnKeys=props.setCloumnKeys,handleCommand=props.handleCommand,handleFilterChange=props.handleFilterChange,attributeDom=isMore20?React.createElement(acud.Button,{style:{paddingRight:6,paddingLeft:8},key:_.uniqueId(),onClick:function(){return null==handleTableCommand?void 0:handleTableCommand("ATTRIBUTES",{cloumnKeys:cloumnsKeyList,setCloumnKeys:setCloumnKeys})}},React.createElement(Icon.OutlinedBceAiSetting,{style:{fontSize:16}})):null;if(FilterComp)return isMore20?React.createElement(React.Fragment,null,React.createElement(FilterComp,{handleFilterChange:handleFilterChange}),attributeDom):React.createElement(FilterComp,{handleFilterChange:handleFilterChange});var controls=null==filterConfig?void 0:filterConfig.controls;return isMore20||!_.isEmpty(filterConfig)&&!_.isEmpty(controls)?React.createElement("div",{className:"".concat(prefixCls,"-hooks-table-toolbar-filter")},_.map(controls,(function(controlItem,idx){if(controlItem.actionType)return renderButton(__assign(__assign({},controlItem),{handleCommand:handleCommand}));var label=controlItem.label,Control=controlItem.control,controlProps=controlItem.controlProps;return Control?React.createElement("div",{key:idx},label&&React.createElement("label",null,label),React.createElement(Control,__assign({},controlProps))):null})),attributeDom,setColumnsConfig?React.createElement(RenderSetColumns,{setColumnsConfig:setColumnsConfig,handleCommand:handleCommand,columns:columns,setColumns:setColumns}):""):null},RangePicker=acud.DatePicker.RangePicker,MultiFilter=function(props){var controls=props.controls,handleFilterChange=props.handleFilterChange,prefixCls=props.prefixCls,_a=__read(React.useState(props.controls[0].value),2),selectValue=_a[0],setSelectValue=_a[1],_b=__read(React.useState([]),2),allSearchArr=_b[0],setAllSearchArr=_b[1],handleSearch=function(value){if(!value||0===value.length){var obj_1=controls.find((function(item){return item.value===selectValue})),newSearchArr_1=__spreadArray(__spreadArray([],__read(allSearchArr.filter((function(item){return item.key!==(null==obj_1?void 0:obj_1.label)}))),!1),[{key:null==obj_1?void 0:obj_1.label,value:null,type:null==obj_1?void 0:obj_1.type,searchParam:null==obj_1?void 0:obj_1.value}],!1);return setAllSearchArr(__spreadArray([],__read(newSearchArr_1),!1)),void handleFilterChange(__assign(__assign({},newSearchArr_1),{multiply:!0}))}var obj=controls.find((function(item){return item.value===selectValue})),newSearchArr=__spreadArray(__spreadArray([],__read(allSearchArr.filter((function(item){return item.key!==(null==obj?void 0:obj.label)}))),!1),[{key:null==obj?void 0:obj.label,value:"rangePicker"===(null==obj?void 0:obj.type)?[value[0].format("YYYY-MM-DD HH:mm:ss"),value[1].format("YYYY-MM-DD HH:mm:ss")]:"time"===(null==obj?void 0:obj.type)?value.format("YYYY-MM-DD HH:mm:ss"):value,type:null==obj?void 0:obj.type,searchParam:null==obj?void 0:obj.value}],!1);setAllSearchArr(__spreadArray([],__read(newSearchArr),!1)),handleFilterChange(__assign(__assign({},newSearchArr),{multiply:!0}))};return React.createElement("div",{className:"".concat(prefixCls,"-filter-multi")},React.createElement("div",{className:"filter-content"},React.createElement("div",null),React.createElement("div",{className:"filter-right"},React.createElement(acud.Select,{defaultValue:controls[0].value,options:controls,onChange:function(val){setSelectValue(val)}}),controls.filter((function(val){return val.value===selectValue})).map((function(item){var component;switch(item.type){case"input":component=React.createElement(acud.Search,{allowClear:!0,onSearch:handleSearch,key:item.value});break;case"select":component=React.createElement(acud.Input.AutoComplete,{key:item.value,options:item.config.options},React.createElement(acud.Search,{allowClear:!0,onSearch:handleSearch}));break;case"rangePicker":component=React.createElement(RangePicker,{format:"YYYY-MM-DD HH:mm:ss",locale:locale$1,style:{width:260},allowClear:!0,key:item.value,showTime:!0,onChange:handleSearch});break;case"time":component=React.createElement(acud.DatePicker,{format:"YYYY-MM-DD HH:mm:ss",locale:locale$1,style:{width:260},allowClear:!0,key:"date",showTime:!0,onChange:handleSearch});break;default:component=null}return component})),React.createElement(acud.Button,{className:"refresh",onClick:function(){handleFilterChange(__assign(__assign({},allSearchArr),{multiply:!0}))}},React.createElement(Icon.OutlinedRefresh,null)))),React.createElement("div",{className:"filter-content"},React.createElement("div",{style:{flex:1}}),allSearchArr.filter((function(item){return!!item.value||0===item.value})).map((function(item){return React.createElement(acud.Tooltip,{title:"".concat(item.key,": ").concat(item.value),className:"filter-item",key:item.key},React.createElement("span",null,item.value&&"".concat(item.key,"：").concat(item.value)),React.createElement(Icon.OutlinedClose,{onClick:function(){return key=item.key,arr=allSearchArr.map((function(item){return __assign(__assign({},item),{value:item.key===key?null:item.value})})),setAllSearchArr(__spreadArray([],__read(arr),!1)),void handleFilterChange(__assign(__assign({},arr),{multiply:!0}));var key,arr},style:{marginLeft:"3px",color:"#2468f2",cursor:"pointer"}}))})),allSearchArr.filter((function(item){return!!item.value||0===item.value})).length>0?React.createElement("span",{className:"clear-all",onClick:function(){var arr=allSearchArr.map((function(item){return __assign(__assign({},item),{value:null})}));handleFilterChange(__assign(__assign({},arr),{multiply:!0})),setAllSearchArr([])}},"全部清除"):""))},ToolBar=function(props){var prefixCls=props.prefixCls,withToolbar=props.withToolbar,_a=props.controlsConfig,controlsConfig=void 0===_a?{}:_a,bulkProps=props.bulkProps,multiFilterConfig=props.multiFilterConfig,selectedProps=props.selectedProps,filterProps=props.filterProps,columns=props.columns,setColumnsConfig=props.setColumnsConfig,setColumns=props.setColumns,handleCommand=props.handleCommand,handleFilterChange=props.handleFilterChange,_b=props.containerWidth,containerWidth=void 0===_b?0:_b,defaultCheckedList=((null==controlsConfig?void 0:controlsConfig.controls)||[]).reduce((function(res,item){return(null==item?void 0:item.unShow)||res.push(null==item?void 0:item.label),res}),[]),_c=__read(React.useState(defaultCheckedList),2),showQueryNames=_c[0],setShowQueryNames=_c[1],form=__read(acud.Form.useForm(),1)[0],formData=React.useMemo((function(){return(null==controlsConfig?void 0:controlsConfig.controls)?_.reduce(null==controlsConfig?void 0:controlsConfig.controls,(function(controlRes,controlItem){return controlItem.name&&controlItem.defaultValue&&(controlRes[controlItem.name]=controlItem.defaultValue),controlRes}),{}):{}}),[controlsConfig]),defaultParams=React.useMemo((function(){return((null==controlsConfig?void 0:controlsConfig.controls)||[]).reduce((function(res,item){return res[item.name]=void 0,res}),{})}),[controlsConfig]),doSubmit=React.useCallback((function(values){handleFilterChange&&handleFilterChange(__assign(__assign({},defaultParams),values))}),[handleFilterChange,defaultParams]),onReset=React.useCallback((function(){form.resetFields()}),[form]),handleControlsChange=React.useCallback((function(_,allValues){showQueryNames.length<2&&handleFilterChange&&handleFilterChange(__assign(__assign({},defaultParams),allValues))}),[showQueryNames,defaultParams,handleFilterChange]),cols=React.useMemo((function(){return(null==controlsConfig?void 0:controlsConfig.colsNum)?null==controlsConfig?void 0:controlsConfig.colsNum:Math.floor(containerWidth/312)}),[containerWidth,null==controlsConfig?void 0:controlsConfig.colsNum]);return withToolbar?React.createElement(React.Fragment,null,_.isEmpty(controlsConfig)?null:React.createElement(acud.Form,__assign({form:form,layout:"horizontal",name:"basic",labelAlign:"left",labelWidth:(null==controlsConfig?void 0:controlsConfig.labelWidth)||72,cols:cols,initialValues:formData,onFinish:doSubmit},1===showQueryNames.length?{onValuesChange:handleControlsChange}:{}),React.createElement(RelationFormItems,{prefixCls:prefixCls,formData:formData,controls:(null==controlsConfig?void 0:controlsConfig.controls)||[],cols:cols,isHasQueryPanel:!0,defaultCheckedList:defaultCheckedList,onReset:onReset,showQueryNames:showQueryNames,setShowQueryNames:setShowQueryNames})),React.createElement("div",{className:"".concat(prefixCls,"-hooks-table-toolbar")},React.createElement("div",{className:"".concat(prefixCls,"-hooks-table-toolbar-left")},React.createElement(Bulk,__assign({prefixCls:prefixCls},bulkProps,{selectedRowKeys:null==selectedProps?void 0:selectedProps.selectedRowKeys,handleCommand:handleCommand,handleFilterChange:handleFilterChange})),React.createElement(Selected,__assign({prefixCls:prefixCls},selectedProps))),React.createElement("div",{className:"".concat(prefixCls,"-hooks-table-toolbar-right")},multiFilterConfig&&React.createElement(MultiFilter,__assign({prefixCls:prefixCls},multiFilterConfig,{handleFilterChange:handleFilterChange})),React.createElement(Filter,__assign({prefixCls:prefixCls},filterProps,{columns:columns,setColumnsConfig:setColumnsConfig,setColumns:setColumns,handleCommand:handleCommand,handleFilterChange:handleFilterChange}))))):null},EMPTY_STATUS_MAP={403:"NO_AUTH",404:"NO_PAGE",500:"SERVER_ERROR"},Card=function(props){var prefixCls=props.prefixCls,loading=props.loading,rowKey=props.rowKey,dataSource=props.dataSource,rowSelection=props.rowSelection,_a=props.locale,locale=void 0===_a?{}:_a,CardContent=props.card,pagination=props.pagination,handleCommand=props.handleCommand,handleTableCommand=props.handleTableCommand,selectedRowKeys=null==rowSelection?void 0:rowSelection.selectedRowKeys,_b=pagination||{},className=_b.className,paginationProps=__rest(_b,["className"]),paginationCls=classNames("".concat(prefixCls,"-table-pagination ").concat(prefixCls,"-table-pagination-right"),className),handleCheckboxChange=React.useCallback((function(e,id){if(rowSelection){var checked=e.target.checked,_a=rowSelection||{},selectedRowKeys=_a.selectedRowKeys,onChange=_a.onChange,newSelectedRowKeys=checked?__spreadArray(__spreadArray([],__read(selectedRowKeys),!1),[id],!1):_.filter(selectedRowKeys,(function(key){return key!==id}));null==onChange||onChange(newSelectedRowKeys)}}),[rowSelection]);return React.createElement(acud.Loading,{loading:loading},!loading&&(null==dataSource?void 0:dataSource.length)?React.createElement(React.Fragment,null,CardContent&&_.map(dataSource,(function(item,itemIndex){return React.createElement(CardContent,{key:item[null!=rowKey?rowKey:itemIndex],item:item,selectedRowKeys:selectedRowKeys,handleCommand:handleCommand,handleTableCommand:handleTableCommand,onCheckboxChange:handleCheckboxChange})})),pagination&&(null==pagination?void 0:pagination.total)&&React.createElement(acud.Pagination,__assign({className:paginationCls},paginationProps))):locale.emptyText)},Dialog=function(props){var locale=__read(useLocale("HooksTable"),1)[0],className=props.className,tablePrefixCls=props.tablePrefixCls,dialogType=props.dialogType,dialogSubType=props.dialogSubType,Content=props.content,payload=props.payload,foot=props.foot,_b=props.okText,okText=void 0===_b?null==locale?void 0:locale.sure:_b,_c=props.cancelText,cancelText=void 0===_c?null==locale?void 0:locale.cancel:_c,cancelWithSuccess=props.cancelWithSuccess,confirmLoading=props.confirmLoading,_d=props.confirmLoadingText,confirmLoadingText=void 0===_d?null==locale?void 0:locale.submitting:_d,onCancel=props.onCancel,onClose=props.onClose,onOk=props.onOk,onSuccess=props.onSuccess,onConfirmLoading=props.onConfirmLoading,onCancelConfirmLoading=props.onCancelConfirmLoading,handleDialogClose=props.handleDialogClose,compProps=__rest(props,["className","tablePrefixCls","dialogType","dialogSubType","content","payload","foot","okText","cancelText","cancelWithSuccess","confirmLoading","confirmLoadingText","onCancel","onClose","onOk","onSuccess","onConfirmLoading","onCancelConfirmLoading","handleDialogClose"]),contentRef=React.useRef(),onDialogCancel=onCancel||onClose,handleDialogCancel=React.useCallback((function(){handleDialogClose(),_.isFunction(onDialogCancel)&&onDialogCancel(),cancelWithSuccess&&(null==onSuccess||onSuccess())}),[cancelWithSuccess,onDialogCancel,onSuccess,handleDialogClose]),handleDialogOk=React.useCallback((function(){if(_.isFunction(onOk))onOk();else{null==onConfirmLoading||onConfirmLoading(confirmLoadingText);var doSubmit=(contentRef.current||{}).doSubmit;_.isFunction(doSubmit)?doSubmit().finally(onCancelConfirmLoading):handleDialogClose()}}),[confirmLoadingText,onOk,onConfirmLoading,onCancelConfirmLoading,handleDialogClose]),handleDialogSuccess=React.useCallback((function(result){null==onSuccess||onSuccess(result),handleDialogClose()}),[onSuccess,handleDialogClose]),footer=React.useMemo((function(){return!1===foot?null:"plain"===dialogSubType?React.createElement(acud.Button,{type:"primary",className:"".concat(tablePrefixCls,"-").concat(dialogType,"-ok-btn"),onClick:handleDialogCancel},okText):React.createElement(React.Fragment,null,React.createElement(acud.Button,{type:"default",className:"".concat(tablePrefixCls,"-").concat(dialogType,"-cancel-btn"),onClick:handleDialogCancel},cancelText),React.createElement(acud.Button,{type:"primary",className:"".concat(tablePrefixCls,"-").concat(dialogType,"-ok-btn"),disabled:confirmLoading,loading:confirmLoading,onClick:handleDialogOk},confirmLoading?confirmLoadingText:okText))}),[foot,dialogType,dialogSubType,tablePrefixCls,cancelText,okText,confirmLoading,confirmLoadingText,handleDialogOk,handleDialogCancel]),contentComp=React.useMemo((function(){if(value=Content,React.isValidElement(value)||"string"==typeof value||"number"==typeof value||"boolean"==typeof value||null==value)return Content;var value,wrappedComponentRef=(null==Content?void 0:Content.WrappedComponent)?{wrappedComponentRef:contentRef}:{};return React.createElement(Content,__assign({ref:contentRef},wrappedComponentRef,{payload:payload,onCancel:handleDialogCancel,onSuccess:handleDialogSuccess,onConfirmLoading:onConfirmLoading,onCancelConfirmLoading:onCancelConfirmLoading}))}),[Content,payload,onConfirmLoading,onCancelConfirmLoading,handleDialogCancel,handleDialogSuccess]),dialogCls=classNames("".concat(tablePrefixCls,"-").concat(dialogType),className);return"dialog-box"===dialogType?React.createElement(acud.DialogBox,__assign({visible:!0,className:dialogCls,content:contentComp,footer:footer,destroyOnClose:!0,onCancel:handleDialogCancel},compProps)):"modal"===dialogType?React.createElement(acud.Modal,__assign({visible:!0,className:dialogCls,footer:footer,destroyOnClose:!0,onCancel:handleDialogCancel},compProps),contentComp):"drawer"===dialogType?React.createElement(acud.Drawer,__assign({visible:!0,className:dialogCls,footerStyle:{textAlign:"right"},footer:footer,destroyOnClose:!0,onClose:handleDialogCancel},compProps),contentComp):null},Status$1=function(props){var locale=__read(useLocale("Status"),1)[0],DEFAULT_TYPE_CONFIG={pending:{text:null==locale?void 0:locale.running},warning:{text:null==locale?void 0:locale.warning},success:{text:null==locale?void 0:locale.success},error:{text:null==locale?void 0:locale.error},unavailable:{text:null==locale?void 0:locale.unavailable}},_b=props.type,type=void 0===_b?"success":_b,_c=props.text,text=void 0===_c?DEFAULT_TYPE_CONFIG.success.text:_c,style=props.style;return React.createElement("div",{className:"".concat("du","-status"),style:style},React.createElement("div",{className:"".concat("du","-status-type ").concat("du","-status-type-").concat(type)},text))};Status$1.propTypes={type:PropTypes.string.isRequired,text:PropTypes.string,style:PropTypes.object};var CLS_PREFIX$5="".concat("du","-gridview"),GridView$1=function(props){var withColon=props.withColon,labelWidth=props.labelWidth,items=props.items,colCount=props.colCount,prefixCls=props.prefixCls,color=props.color,prefixGridViewCls=prefixCls?"".concat(prefixCls,"-gridview"):CLS_PREFIX$5,width=24/colCount;_.remove(items,_.isNil);var rows=_.chunk(items,colCount);return React.createElement("div",{className:prefixGridViewCls},_.map(rows,(function(cols,key){var colums=_.map(cols,(function(col,index){return React.createElement(acud.Col,{span:width,key:col.key||index,className:"".concat(prefixGridViewCls,"-col-").concat(col.key||index)},React.createElement("div",{className:"".concat(prefixGridViewCls,"-row-label ").concat(prefixGridViewCls,"-row-label-").concat(index),style:{width:labelWidth}},col.label,withColon?":":""),React.createElement("div",{className:"".concat(prefixGridViewCls,"-row-content"),style:{marginLeft:labelWidth,color:color}},col.content))}));return React.createElement(acud.Row,{className:"".concat(prefixGridViewCls,"-row"),key:key},colums)})))};GridView$1.defaultProps={labelWidth:100,colCount:2,withColon:!0,items:[]},GridView$1.propTypes={labelWidth:PropTypes.number,colCount:PropTypes.number,withColon:PropTypes.bool,items:PropTypes.array.isRequired};var CLS_PREFIX$4="".concat("du","-gridviews"),GridViews=function(props){var contents=props.contents,labelWidth=props.labelWidth,colCount=props.colCount,withColon=props.withColon,prefixCls=props.prefixCls,prefixGridViewsCls=prefixCls?"".concat(prefixCls,"-gridviews"):CLS_PREFIX$4;return React.createElement("div",{className:prefixGridViewsCls},_.map(contents,(function(content,index){var itemKey=content.key||index,showDivider=(null==content?void 0:content.showDivider)||!1,color=(null==content?void 0:content.color)||"#151b26";return React.createElement("div",{className:"".concat(prefixGridViewsCls,"-item ").concat(prefixGridViewsCls,"-item-").concat(itemKey),key:itemKey},content.title&&React.createElement("div",{className:"".concat(prefixGridViewsCls,"-item-title")},content.title),React.createElement(GridView$1,{items:content.items,labelWidth:labelWidth,colCount:content.colCount||colCount,withColon:withColon,prefixCls:prefixCls,color:color}),showDivider&&React.createElement("div",{className:"".concat(prefixGridViewsCls,"-item-divider")}))})))};GridViews.defaultProps={labelWidth:100,colCount:2,withColon:!0,contents:[]},GridViews.propTypes={labelWidth:PropTypes.number,colCount:PropTypes.number,withColon:PropTypes.bool,contents:PropTypes.array.isRequired};var rc$3=tmp__namespace,Link=tmp__namespace.Link,generatePath=tmp__namespace.generatePath,PageTitle=function(props){var _a,_b,backLink,defaultBackUrl=props.defaultBackUrl,backUrl=props.backUrl,backParams=props.backParams,_c=props.backText,backText=void 0===_c?"返回":_c,title=props.title,btnConfig=props.btnConfig,custom=props.custom,className=props.className,extra=props.extra,description=props.description,pageTitlePrefix="".concat("acud-pro","-base-page-title"),hooksHistory=null===(_a=rc$3.useHistory)||void 0===_a?void 0:_a.call(rc$3),navigate=null===(_b=rc$3.useNavigate)||void 0===_b?void 0:_b.call(rc$3),history=hooksHistory||navigate;if(_.isString(backUrl))backLink=backParams?generatePath(backUrl,backParams):backUrl;else if(backUrl){var pathname=_.get(backUrl,"pathname");backLink=__assign(__assign({},backUrl||{}),{pathname:backParams?generatePath(pathname,backParams):pathname})}var handleAction=React.useCallback((function(btnItem){var btnAction=btnItem.btnAction;btnAction&&btnAction()}),[]),prefixClass=classNames("".concat(pageTitlePrefix,"-wrap"),className),handleBack=React.useCallback((function(){"default"===new URLSearchParams(window.location.search).get("goBack")&&defaultBackUrl?history.push(defaultBackUrl):history.goBack()}),[defaultBackUrl,history]);return React.createElement("div",{className:prefixClass},React.createElement("div",{className:pageTitlePrefix},backUrl?React.createElement("div",{className:"back-btn"},React.createElement(Link,{to:backLink},React.createElement(Icon.OutlinedLeft,null),React.createElement("span",{className:"back-text"},backText))):defaultBackUrl?React.createElement("div",{className:"back-btn",onClick:handleBack},React.createElement("a",null,React.createElement(Icon.OutlinedLeft,null),React.createElement("span",{className:"back-text"},backText))):null,title&&React.createElement("div",{className:"".concat(pageTitlePrefix,"-text ").concat(!(backUrl||defaultBackUrl)&&"noBack")},title),custom&&React.createElement("div",{className:"".concat(pageTitlePrefix,"-custom")},custom),btnConfig&&React.createElement("div",{className:"".concat(pageTitlePrefix,"-btns-area")},_.map(btnConfig,(function(btnItem,index){var disabled=btnItem.disabled,text=btnItem.text,tooltip=btnItem.tooltip,className=btnItem.className;btnItem.btnAction;var otherProps=__rest(btnItem,["disabled","text","tooltip","className","btnAction"]),classNames$1=classNames("".concat(pageTitlePrefix,"-btns-item"),className),uniqKey=btnItem.id||index,btnComp=React.createElement(acud.Button,__assign({key:uniqKey},otherProps,{className:classNames$1,disabled:!!disabled,onClick:function(){return handleAction(btnItem)}}),text);return tooltip?React.createElement(acud.Tooltip,__assign({key:uniqKey},tooltip),btnComp):btnComp}))),extra&&React.createElement("div",{className:"".concat(pageTitlePrefix,"-extra-area")},extra)),description&&React.createElement("div",{className:"".concat(pageTitlePrefix,"-description")},description))},CLS_PREFIX$3="".concat("du","-loading"),PageLoading=function(props){var locale=__read(useLocale("Loading"),1)[0],_b=props.text,text=void 0===_b?null==locale?void 0:locale.loading:_b,_c=__read(React.useState("100%"),2),height=_c[0],setHeight=_c[1],loadingRef=React.useRef(null);return React.useEffect((function(){var parentNode=reactDom.findDOMNode(loadingRef.current).parentNode,newHeight=parentNode?parentNode.offsetHeight-20:height;setHeight(newHeight)}),[]),React.createElement("div",{className:CLS_PREFIX$3,style:{height:height},ref:loadingRef},React.createElement(acud.Loading,{loading:!0,tip:text}))},ProLayout=function(props){var _a=props.prefixCls,prefixCls=void 0===_a?"".concat("acud-pro","-page-layout-list"):_a,title=props.title,btnConfig=props.btnConfig,backUrl=props.backUrl,pageTitleRender=props.pageTitleRender,description=props.description,descLink=props.descLink,tabList=props.tabList,tabInfo=props.tabInfo,children=props.children,loading=props.loading,loadingProps=props.loadingProps,emptyStatusProps=props.emptyStatusProps,extra=props.extra;if(emptyStatusProps)return React.createElement(EmptyStatus,__assign({},emptyStatusProps));var contentDom=React.createElement("div",{className:"content-area"},children),titleDom=function(props){var title=props.title,backUrl=props.backUrl,btnConfig=props.btnConfig,pageTitleRender=props.pageTitleRender,extra=props.extra,rest=__rest(props,["title","backUrl","btnConfig","pageTitleRender","extra"]);if(pageTitleRender&&"function"==typeof pageTitleRender)return pageTitleRender(props);if(backUrl)return React.createElement(PageTitle,__assign({backUrl:backUrl,title:title,btnConfig:btnConfig,extra:extra},rest));var isBtnArr=Array.isArray(btnConfig);return React.createElement("div",null,React.createElement("span",{className:"title"},title),isBtnArr&&React.createElement("div",{className:"btns-config"},btnConfig.map((function(btnItem){return React.createElement(acud.Button,{key:btnItem.id,disabled:!!btnItem.disabled,onClick:function(){return function(btnItem){var btnAction=btnItem.btnAction;btnAction&&btnAction()}(btnItem)},type:btnItem.type},btnItem.text)}))),extra&&React.createElement("div",{className:"extra"},extra))}({title:title,btnConfig:btnConfig,backUrl:backUrl,extra:extra,pageTitleRender:pageTitleRender}),descDom=function(props){var description=props.description,descLink=props.descLink;return"string"!=typeof description?React.createElement(React.Fragment,null,description):React.createElement("div",{className:"desc"},description,descLink&&React.createElement("a",{target:"_blank",href:descLink,rel:"noreferrer"},"了解详情 >"))}({description:description,descLink:descLink});return Array.isArray(tabList)&&tabInfo&&(contentDom=React.createElement("div",{className:"content-tab"},React.createElement(acud.Tabs,__assign({},tabInfo),tabList.map((function(_a){var tab=_a.tab,key=_a.key,content=_a.content,description=_a.description,descLink=_a.descLink;return React.createElement(acud.Tabs.TabPane,{tab:tab,key:key},description&&React.createElement("div",{className:"tab-desc"},"string"==typeof description?React.createElement(React.Fragment,null,description,descLink&&React.createElement("a",{target:"_blank",href:descLink,rel:"noreferrer"},"了解详情 >")):React.createElement(React.Fragment,null,description)),React.createElement("div",{className:"content-area"},content))}))))),React.createElement("div",{className:"".concat(prefixCls)},React.createElement("div",{className:"header-area"},titleDom,descDom),loading?React.createElement(PageLoading,__assign({},loadingProps)):contentDom)},BottomSubmitContainer=function(props){var _a=props.options,options=void 0===_a?[]:_a;return React.createElement("div",{className:"acud-pro-bottom-submit"},React.createElement("div",{className:"bottom-box"},_.map(options,(function(option,index){var text=option.text,buttonProps=__rest(option,["text"]);return React.createElement(acud.Button,__assign({size:"large"},buttonProps,{key:index}),text)}))))},ProContainer=function(props){var _a=props.prefixCls,customizePrefixCls=void 0===_a?"".concat("acud-pro","-page-layout-container"):_a,_b=props.backUrl,backUrl=void 0===_b?"/":_b,backText=props.backText,title=props.title,btnConfig=props.btnConfig,custom=props.custom,_c=props.className,className=void 0===_c?"":_c,_d=props.titleClassName,titleClassName=void 0===_d?"":_d,extra=props.extra,pageTitleRender=props.pageTitleRender,tabList=props.tabList,tabInfo=props.tabInfo,children=props.children,loading=props.loading,loadingProps=props.loadingProps,btnSubmitOptions=props.btnSubmitOptions,emptyStatusProps=props.emptyStatusProps,containerClass=classNames(className,customizePrefixCls);if(emptyStatusProps)return React.createElement(EmptyStatus,__assign({},emptyStatusProps));var contentDom=React.createElement("div",{className:"content-area"},children),titleDom=function(props){var _a=props.backUrl,backUrl=void 0===_a?"/":_a,backText=props.backText,_b=props.title,title=void 0===_b?"":_b,btnConfig=props.btnConfig,custom=props.custom,_c=props.className,className=void 0===_c?"":_c,pageTitleRender=props.pageTitleRender,extra=props.extra,rest=__rest(props,["backUrl","backText","title","btnConfig","custom","className","pageTitleRender","extra"]);return pageTitleRender&&"function"==typeof pageTitleRender?pageTitleRender(props):React.createElement(PageTitle,__assign({className:className,backText:backText,title:title,btnConfig:btnConfig,custom:custom,backUrl:backUrl,extra:extra},rest))}({backUrl:backUrl,backText:backText,title:title,btnConfig:btnConfig,custom:custom,extra:extra,pageTitleRender:pageTitleRender,className:titleClassName});if(Array.isArray(tabList)&&tabInfo){var tabRouter_1=tabInfo.tabRouter,onChange_1=tabInfo.onChange,history_1=tabInfo.history,tabsProps=__assign({},tabInfo);tabRouter_1&&(tabsProps.onChange=function(activeKey){null==history_1||history_1.push(tabRouter_1.replace("ProContainerActiveKey",activeKey)),"function"==typeof onChange_1&&onChange_1(activeKey)},delete tabsProps.tabRouter,delete tabsProps.history),contentDom=React.createElement(acud.Tabs,__assign({},tabsProps,{destroyInactiveTabPane:!0}),tabList.filter((function(item){return!("visible"in item)||item.visible})).map((function(item){return React.createElement(acud.Tabs.TabPane,{tab:item.tab,key:item.key,className:"card-content-area",disabled:"valid"in item&&!item.valid},React.createElement("div",{className:item.basicInfo?"":"content-detail"},!("ready"in item)||item.ready?item.content:null))})))}return React.createElement("div",{className:containerClass},React.createElement("div",{className:"header-area"},titleDom),loading?React.createElement(PageLoading,__assign({},loadingProps)):contentDom,btnSubmitOptions&&React.createElement(BottomSubmitContainer,{options:btnSubmitOptions}))},PageContainer=function(props){var _a,_b=props.showPageTitle,showPageTitle=void 0===_b||_b,_c=props.mode,mode=void 0===_c?"":_c,className=props.className,pageTitleProps=__rest(props,["showPageTitle","mode","className"]),pageContainerPrefix="".concat("acud-pro","-page-layout"),prefixClass=classNames("".concat(pageContainerPrefix,"-wrap"),className),contentClass=classNames("".concat(pageContainerPrefix,"-content"),((_a={})["".concat(pageContainerPrefix,"-card-wrap")]="card"===mode,_a["".concat(pageContainerPrefix,"-tabs-wrap")]="tabs"===mode,_a["".concat(pageContainerPrefix,"-card-wrap ").concat(pageContainerPrefix,"-tabs-wrap")]="tabs-card"===mode,_a));return React.createElement("div",{className:prefixClass},showPageTitle&&React.createElement(PageTitle,__assign({className:"".concat(pageContainerPrefix,"-header")},pageTitleProps)),React.createElement("div",{className:contentClass},props.children))};PageContainer.PageTitle=function(props){return React.createElement(PageTitle,__assign({},props))},PageContainer.List=function(props){return React.createElement(ProLayout,__assign({},props))},PageContainer.Detail=function(props){return React.createElement(ProContainer,__assign({},props))};var SubMenu=acud.Menu.SubMenu,MenuHead=acud.Menu.MenuHead,rc$2=tmp__namespace,RecursiveMenu=function(_a){var items=_a.items,activeFatherKey=_a.activeFatherKey,_b=_a.level,level=void 0===_b?1:_b;return items.map((function(item){var icon={icon:item.key===activeFatherKey?item.iconActive:item.iconDefault};return"submenu"===item.type?React.createElement(SubMenu,__assign({key:item.key,title:item.text,eventKey:item.key},icon),React.createElement(RecursiveMenu,{items:item.children,activeFatherKey:activeFatherKey,level:level+1})):React.createElement(acud.Menu.Item,__assign({key:item.key,eventKey:item.key},icon,{className:3===level?"gray-text":""}),item.text)}))},SideBar=function(props){var _a,_b,_c,menuItems=props.menuItems,moduleName=props.moduleName,navigate=null===(_a=rc$2.useNavigate)||void 0===_a?void 0:_a.call(rc$2),history=null===(_b=rc$2.useHistory)||void 0===_b?void 0:_b.call(rc$2),currentPath=(null===(_c=rc$2.useLocation)||void 0===_c?void 0:_c.call(rc$2)).pathname,findActiveMenuItem=function(items,currentPath){var e_1,_a;try{for(var items_1=__values(items),items_1_1=items_1.next();!items_1_1.done;items_1_1=items_1.next()){var item=items_1_1.value;if(currentPath.includes(item.selectKey||item.key))return item;if(item.children){var found=findActiveMenuItem(item.children,currentPath);if(found)return found}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{items_1_1&&!items_1_1.done&&(_a=items_1.return)&&_a.call(items_1)}finally{if(e_1)throw e_1.error}}return null},findItemByKey=function(items,targetKey){var e_2,_a;try{for(var items_2=__values(items),items_2_1=items_2.next();!items_2_1.done;items_2_1=items_2.next()){var item=items_2_1.value;if(item.key===targetKey)return item;if(item.children){var found=findItemByKey(item.children,targetKey);if(found)return found}}}catch(e_2_1){e_2={error:e_2_1}}finally{try{items_2_1&&!items_2_1.done&&(_a=items_2.return)&&_a.call(items_2)}finally{if(e_2)throw e_2.error}}return null},findParentByKey=function(menuItems,targetKey){var ancestors=[{key:""}],traverse=function(items,path){var e_3,_a;try{for(var items_3=__values(items),items_3_1=items_3.next();!items_3_1.done;items_3_1=items_3.next()){var item=items_3_1.value,currentPath_1=__spreadArray(__spreadArray([],__read(path),!1),[item],!1);if(item.key===targetKey)return ancestors=currentPath_1,!0;if(item.children&&traverse(item.children,currentPath_1))return!0}}catch(e_3_1){e_3={error:e_3_1}}finally{try{items_3_1&&!items_3_1.done&&(_a=items_3.return)&&_a.call(items_3)}finally{if(e_3)throw e_3.error}}return!1};return traverse(menuItems,[]),ancestors},computeActive=function(){var activeMenuItem=findActiveMenuItem(menuItems,currentPath.split("?")[0]);return{activeMenuItem:activeMenuItem,activeFatherItem:activeMenuItem?findParentByKey(menuItems,activeMenuItem.key):[{key:""}]}},_d=computeActive(),activeMenuItem=_d.activeMenuItem,activeFatherItem=_d.activeFatherItem,_e=__read(React.useState(null==activeMenuItem?void 0:activeMenuItem.key),2),activeKey=_e[0],setActiveKey=_e[1],_f=__read(React.useState(null==activeFatherItem?void 0:activeFatherItem.map((function(item){return item.key}))),2),activeFatherKey=_f[0],setActiveFatherKey=_f[1];React.useEffect((function(){var _a=computeActive(),activeMenuItem=_a.activeMenuItem,activeFatherItem=_a.activeFatherItem;setActiveKey(activeMenuItem?null==activeMenuItem?void 0:activeMenuItem.key:""),setActiveFatherKey(activeFatherItem?null==activeFatherItem?void 0:activeFatherItem.map((function(item){return item.key})):[""])}),[currentPath]);return React.createElement("div",{className:"app-menu-container"},React.createElement(acud.Menu,{onClick:function(e){var parentItem=findParentByKey(menuItems,e.key)||{key:""};setActiveFatherKey(null==parentItem?void 0:parentItem.map((function(item){return item.key})));var curItem=findItemByKey(menuItems,e.key);try{if(curItem.externalLink)return void(curItem.externalBlank?window.open(curItem.externalLink):window.location.href=curItem.externalLink);history?history.push("/".concat(e.key)):navigate&&navigate("/".concat(e.key))}catch(error){console.error("Routing failed:",error)}},mode:"inline",scope:"global",defaultOpenKeys:activeFatherKey||["/"],defaultSelectedKeys:[activeKey],className:"app-menu"},React.createElement(MenuHead,null,moduleName),React.createElement((function(){return React.createElement(RecursiveMenu,{items:menuItems,activeFatherKey:activeFatherKey})}),null)))};SideBar.propTypes={menuItems:PropTypes.array.isRequired,moduleName:PropTypes.string};var Browser=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},env=new function(){this.browser=new Browser,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="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(env.wxa=!0,env.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?env.worker=!0:!env.hasGlobalWindow||"Deno"in window?(env.node=!0,env.svgSupported=!0):function(ua,env){var browser=env.browser,firefox=ua.match(/Firefox\/([\d.]+)/),ie=ua.match(/MSIE\s([\d.]+)/)||ua.match(/Trident\/.+?rv:(([\d.]+))/),edge=ua.match(/Edge?\/([\d.]+)/),weChat=/micromessenger/i.test(ua);firefox&&(browser.firefox=!0,browser.version=firefox[1]);ie&&(browser.ie=!0,browser.version=ie[1]);edge&&(browser.edge=!0,browser.version=edge[1],browser.newEdge=+edge[1].split(".")[0]>18);weChat&&(browser.weChat=!0);env.svgSupported="undefined"!=typeof SVGRect,env.touchEventsSupported="ontouchstart"in window&&!browser.ie&&!browser.edge,env.pointerEventsSupported="onpointerdown"in window&&(browser.edge||browser.ie&&+browser.version>=11),env.domSupported="undefined"!=typeof document;var style=document.documentElement.style;env.transform3dSupported=(browser.ie&&"transition"in style||browser.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in style)&&!("OTransition"in style),env.transformSupported=env.transform3dSupported||browser.ie&&+browser.version>=9}(navigator.userAgent,env);var env$1=env,DEFAULT_FONT="12px sans-serif";var _ctx,_cachedFont,DEFAULT_TEXT_WIDTH_MAP=function(mapStr){var map={};if("undefined"==typeof JSON)return map;for(var i=0;i<mapStr.length;i++){var _char=String.fromCharCode(i+32),size=(mapStr.charCodeAt(i)-20)/100;map[_char]=size}return map}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),platformApi={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(text,font){if(!_ctx){var canvas=platformApi.createCanvas();_ctx=canvas&&canvas.getContext("2d")}if(_ctx)return _cachedFont!==font&&(_cachedFont=_ctx.font=font||DEFAULT_FONT),_ctx.measureText(text);text=text||"";var res=/((?:\d+)?\.?\d*)px/.exec(font=font||DEFAULT_FONT),fontSize=res&&+res[1]||12,width=0;if(font.indexOf("mono")>=0)width=fontSize*text.length;else for(var i=0;i<text.length;i++){var preCalcWidth=DEFAULT_TEXT_WIDTH_MAP[text[i]];width+=null==preCalcWidth?fontSize:preCalcWidth*fontSize}return{width:width}},loadImage:function(src,onload,onerror){var image=new Image;return image.onload=onload,image.onerror=onerror,image.src=src,image}},BUILTIN_OBJECT=reduce(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],(function(obj,val){return obj["[object "+val+"]"]=!0,obj}),{}),TYPED_ARRAY=reduce(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],(function(obj,val){return obj["[object "+val+"Array]"]=!0,obj}),{}),objToString=Object.prototype.toString,arrayProto=Array.prototype,nativeForEach=arrayProto.forEach,nativeFilter=arrayProto.filter,nativeSlice=arrayProto.slice,nativeMap=arrayProto.map,ctorFunction=function(){}.constructor,protoFunction=ctorFunction?ctorFunction.prototype:null,idStart=2311;function guid(){return idStart++}function logError(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];"undefined"!=typeof console&&console.error.apply(console,args)}function clone$3(source){if(null==source||"object"!=typeof source)return source;var result=source,typeStr=objToString.call(source);if("[object Array]"===typeStr){if(!isPrimitive(source)){result=[];for(var i=0,len=source.length;i<len;i++)result[i]=clone$3(source[i])}}else if(TYPED_ARRAY[typeStr]){if(!isPrimitive(source)){var Ctor=source.constructor;if(Ctor.from)result=Ctor.from(source);else{result=new Ctor(source.length);for(i=0,len=source.length;i<len;i++)result[i]=source[i]}}}else if(!BUILTIN_OBJECT[typeStr]&&!isPrimitive(source)&&!isDom(source))for(var key in result={},source)source.hasOwnProperty(key)&&"__proto__"!==key&&(result[key]=clone$3(source[key]));return result}function merge(target,source,overwrite){if(!isObject$3(source)||!isObject$3(target))return overwrite?clone$3(source):target;for(var key in source)if(source.hasOwnProperty(key)&&"__proto__"!==key){var targetProp=target[key],sourceProp=source[key];!isObject$3(sourceProp)||!isObject$3(targetProp)||isArray(sourceProp)||isArray(targetProp)||isDom(sourceProp)||isDom(targetProp)||isBuiltInObject(sourceProp)||isBuiltInObject(targetProp)||isPrimitive(sourceProp)||isPrimitive(targetProp)?!overwrite&&key in target||(target[key]=clone$3(source[key])):merge(targetProp,sourceProp,overwrite)}return target}function extend(target,source){if(Object.assign)Object.assign(target,source);else for(var key in source)source.hasOwnProperty(key)&&"__proto__"!==key&&(target[key]=source[key]);return target}function defaults(target,source,overlay){for(var keysArr=keys$1(source),i=0,len=keysArr.length;i<len;i++){var key=keysArr[i];(overlay?null!=source[key]:null==target[key])&&(target[key]=source[key])}return target}function indexOf(array,value){if(array){if(array.indexOf)return array.indexOf(value);for(var i=0,len=array.length;i<len;i++)if(array[i]===value)return i}return-1}function mixin(target,source,override){if(target="prototype"in target?target.prototype:target,source="prototype"in source?source.prototype:source,Object.getOwnPropertyNames)for(var keyList=Object.getOwnPropertyNames(source),i=0;i<keyList.length;i++){var key=keyList[i];"constructor"!==key&&(override?null!=source[key]:null==target[key])&&(target[key]=source[key])}else defaults(target,source,override)}function isArrayLike(data){return!!data&&("string"!=typeof data&&"number"==typeof data.length)}function each$b(arr,cb,context){if(arr&&cb)if(arr.forEach&&arr.forEach===nativeForEach)arr.forEach(cb,context);else if(arr.length===+arr.length)for(var i=0,len=arr.length;i<len;i++)cb.call(context,arr[i],i,arr);else for(var key in arr)arr.hasOwnProperty(key)&&cb.call(context,arr[key],key,arr)}function map$1(arr,cb,context){if(!arr)return[];if(!cb)return slice(arr);if(arr.map&&arr.map===nativeMap)return arr.map(cb,context);for(var result=[],i=0,len=arr.length;i<len;i++)result.push(cb.call(context,arr[i],i,arr));return result}function reduce(arr,cb,memo,context){if(arr&&cb){for(var i=0,len=arr.length;i<len;i++)memo=cb.call(context,memo,arr[i],i,arr);return memo}}function filter(arr,cb,context){if(!arr)return[];if(!cb)return slice(arr);if(arr.filter&&arr.filter===nativeFilter)return arr.filter(cb,context);for(var result=[],i=0,len=arr.length;i<len;i++)cb.call(context,arr[i],i,arr)&&result.push(arr[i]);return result}function keys$1(obj){if(!obj)return[];if(Object.keys)return Object.keys(obj);var keyList=[];for(var key in obj)obj.hasOwnProperty(key)&&keyList.push(key);return keyList}var bind$1=protoFunction&&isFunction(protoFunction.bind)?protoFunction.call.bind(protoFunction.bind):function(func,context){for(var args=[],_i=2;_i<arguments.length;_i++)args[_i-2]=arguments[_i];return function(){return func.apply(context,args.concat(nativeSlice.call(arguments)))}};function curry$1(func){for(var args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i];return function(){return func.apply(this,args.concat(nativeSlice.call(arguments)))}}function isArray(value){return Array.isArray?Array.isArray(value):"[object Array]"===objToString.call(value)}function isFunction(value){return"function"==typeof value}function isString(value){return"string"==typeof value}function isStringSafe(value){return"[object String]"===objToString.call(value)}function isNumber(value){return"number"==typeof value}function isObject$3(value){var type=typeof value;return"function"===type||!!value&&"object"===type}function isBuiltInObject(value){return!!BUILTIN_OBJECT[objToString.call(value)]}function isTypedArray(value){return!!TYPED_ARRAY[objToString.call(value)]}function isDom(value){return"object"==typeof value&&"number"==typeof value.nodeType&&"object"==typeof value.ownerDocument}function isGradientObject(value){return null!=value.colorStops}function eqNaN(value){return value!=value}function retrieve(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];for(var i=0,len=args.length;i<len;i++)if(null!=args[i])return args[i]}function retrieve2(value0,value1){return null!=value0?value0:value1}function retrieve3(value0,value1,value2){return null!=value0?value0:null!=value1?value1:value2}function slice(arr){for(var args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i];return nativeSlice.apply(arr,args)}function normalizeCssArray$1(val){if("number"==typeof val)return[val,val,val,val];var len=val.length;return 2===len?[val[0],val[1],val[0],val[1]]:3===len?[val[0],val[1],val[2],val[1]]:val}function assert(condition,message){if(!condition)throw new Error(message)}function trim$1(str){return null==str?null:"function"==typeof str.trim?str.trim():str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var primitiveKey="__ec_primitive__";function setAsPrimitive(obj){obj[primitiveKey]=!0}function isPrimitive(obj){return obj[primitiveKey]}var MapPolyfill=function(){function MapPolyfill(){this.data={}}return MapPolyfill.prototype.delete=function(key){var existed=this.has(key);return existed&&delete this.data[key],existed},MapPolyfill.prototype.has=function(key){return this.data.hasOwnProperty(key)},MapPolyfill.prototype.get=function(key){return this.data[key]},MapPolyfill.prototype.set=function(key,value){return this.data[key]=value,this},MapPolyfill.prototype.keys=function(){return keys$1(this.data)},MapPolyfill.prototype.forEach=function(callback){var data=this.data;for(var key in data)data.hasOwnProperty(key)&&callback(data[key],key)},MapPolyfill}(),isNativeMapSupported="function"==typeof Map;var HashMap=function(){function HashMap(obj){var isArr=isArray(obj);this.data=isNativeMapSupported?new Map:new MapPolyfill;var thisMap=this;function visit(value,key){isArr?thisMap.set(value,key):thisMap.set(key,value)}obj instanceof HashMap?obj.each(visit):obj&&each$b(obj,visit)}return HashMap.prototype.hasKey=function(key){return this.data.has(key)},HashMap.prototype.get=function(key){return this.data.get(key)},HashMap.prototype.set=function(key,value){return this.data.set(key,value),value},HashMap.prototype.each=function(cb,context){this.data.forEach((function(value,key){cb.call(context,value,key)}))},HashMap.prototype.keys=function(){var keys=this.data.keys();return isNativeMapSupported?Array.from(keys):keys},HashMap.prototype.removeKey=function(key){this.data.delete(key)},HashMap}();function createHashMap(obj){return new HashMap(obj)}function concatArray(a,b){for(var newArray=new a.constructor(a.length+b.length),i=0;i<a.length;i++)newArray[i]=a[i];var offset=a.length;for(i=0;i<b.length;i++)newArray[i+offset]=b[i];return newArray}function createObject(proto,properties){var obj;if(Object.create)obj=Object.create(proto);else{var StyleCtor=function(){};StyleCtor.prototype=proto,obj=new StyleCtor}return properties&&extend(obj,properties),obj}function disableUserSelect(dom){var domStyle=dom.style;domStyle.webkitUserSelect="none",domStyle.userSelect="none",domStyle.webkitTapHighlightColor="rgba(0,0,0,0)",domStyle["-webkit-touch-callout"]="none"}function hasOwn(own,prop){return own.hasOwnProperty(prop)}function noop$1(){}var RADIAN_TO_DEGREE=180/Math.PI;function create$1(x,y){return null==x&&(x=0),null==y&&(y=0),[x,y]}function copy$1(out,v){return out[0]=v[0],out[1]=v[1],out}function clone$2(v){return[v[0],v[1]]}function set$1(out,a,b){return out[0]=a,out[1]=b,out}function add$2(out,v1,v2){return out[0]=v1[0]+v2[0],out[1]=v1[1]+v2[1],out}function scaleAndAdd$1(out,v1,v2,a){return out[0]=v1[0]+v2[0]*a,out[1]=v1[1]+v2[1]*a,out}function sub(out,v1,v2){return out[0]=v1[0]-v2[0],out[1]=v1[1]-v2[1],out}function len(v){return Math.sqrt(function(v){return v[0]*v[0]+v[1]*v[1]}(v))}function scale$2(out,v,s){return out[0]=v[0]*s,out[1]=v[1]*s,out}function normalize$2(out,v){var d=len(v);return 0===d?(out[0]=0,out[1]=0):(out[0]=v[0]/d,out[1]=v[1]/d),out}function distance(v1,v2){return Math.sqrt((v1[0]-v2[0])*(v1[0]-v2[0])+(v1[1]-v2[1])*(v1[1]-v2[1]))}var dist$1=distance;var distSquare=function(v1,v2){return(v1[0]-v2[0])*(v1[0]-v2[0])+(v1[1]-v2[1])*(v1[1]-v2[1])};function lerp$1(out,v1,v2,t){return out[0]=v1[0]+t*(v2[0]-v1[0]),out[1]=v1[1]+t*(v2[1]-v1[1]),out}function applyTransform$1(out,v,m){var x=v[0],y=v[1];return out[0]=m[0]*x+m[2]*y+m[4],out[1]=m[1]*x+m[3]*y+m[5],out}function min$1(out,v1,v2){return out[0]=Math.min(v1[0],v2[0]),out[1]=Math.min(v1[1],v2[1]),out}function max$1(out,v1,v2){return out[0]=Math.max(v1[0],v2[0]),out[1]=Math.max(v1[1],v2[1]),out}var Param=function(target,e){this.target=target,this.topTarget=e&&e.topTarget},Draggable=function(){function Draggable(handler){this.handler=handler,handler.on("mousedown",this._dragStart,this),handler.on("mousemove",this._drag,this),handler.on("mouseup",this._dragEnd,this)}return Draggable.prototype._dragStart=function(e){for(var draggingTarget=e.target;draggingTarget&&!draggingTarget.draggable;)draggingTarget=draggingTarget.parent||draggingTarget.__hostTarget;draggingTarget&&(this._draggingTarget=draggingTarget,draggingTarget.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new Param(draggingTarget,e),"dragstart",e.event))},Draggable.prototype._drag=function(e){var draggingTarget=this._draggingTarget;if(draggingTarget){var x=e.offsetX,y=e.offsetY,dx=x-this._x,dy=y-this._y;this._x=x,this._y=y,draggingTarget.drift(dx,dy,e),this.handler.dispatchToElement(new Param(draggingTarget,e),"drag",e.event);var dropTarget=this.handler.findHover(x,y,draggingTarget).target,lastDropTarget=this._dropTarget;this._dropTarget=dropTarget,draggingTarget!==dropTarget&&(lastDropTarget&&dropTarget!==lastDropTarget&&this.handler.dispatchToElement(new Param(lastDropTarget,e),"dragleave",e.event),dropTarget&&dropTarget!==lastDropTarget&&this.handler.dispatchToElement(new Param(dropTarget,e),"dragenter",e.event))}},Draggable.prototype._dragEnd=function(e){var draggingTarget=this._draggingTarget;draggingTarget&&(draggingTarget.dragging=!1),this.handler.dispatchToElement(new Param(draggingTarget,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new Param(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},Draggable}(),Draggable$1=Draggable,Eventful=function(){function Eventful(eventProcessors){eventProcessors&&(this._$eventProcessor=eventProcessors)}return Eventful.prototype.on=function(event,query,handler,context){this._$handlers||(this._$handlers={});var _h=this._$handlers;if("function"==typeof query&&(context=handler,handler=query,query=null),!handler||!event)return this;var eventProcessor=this._$eventProcessor;null!=query&&eventProcessor&&eventProcessor.normalizeQuery&&(query=eventProcessor.normalizeQuery(query)),_h[event]||(_h[event]=[]);for(var i=0;i<_h[event].length;i++)if(_h[event][i].h===handler)return this;var wrap={h:handler,query:query,ctx:context||this,callAtLast:handler.zrEventfulCallAtLast},lastIndex=_h[event].length-1,lastWrap=_h[event][lastIndex];return lastWrap&&lastWrap.callAtLast?_h[event].splice(lastIndex,0,wrap):_h[event].push(wrap),this},Eventful.prototype.isSilent=function(eventName){var _h=this._$handlers;return!_h||!_h[eventName]||!_h[eventName].length},Eventful.prototype.off=function(eventType,handler){var _h=this._$handlers;if(!_h)return this;if(!eventType)return this._$handlers={},this;if(handler){if(_h[eventType]){for(var newList=[],i=0,l=_h[eventType].length;i<l;i++)_h[eventType][i].h!==handler&&newList.push(_h[eventType][i]);_h[eventType]=newList}_h[eventType]&&0===_h[eventType].length&&delete _h[eventType]}else delete _h[eventType];return this},Eventful.prototype.trigger=function(eventType){for(var args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i];if(!this._$handlers)return this;var _h=this._$handlers[eventType],eventProcessor=this._$eventProcessor;if(_h)for(var argLen=args.length,len=_h.length,i=0;i<len;i++){var hItem=_h[i];if(!eventProcessor||!eventProcessor.filter||null==hItem.query||eventProcessor.filter(eventType,hItem.query))switch(argLen){case 0:hItem.h.call(hItem.ctx);break;case 1:hItem.h.call(hItem.ctx,args[0]);break;case 2:hItem.h.call(hItem.ctx,args[0],args[1]);break;default:hItem.h.apply(hItem.ctx,args)}}return eventProcessor&&eventProcessor.afterTrigger&&eventProcessor.afterTrigger(eventType),this},Eventful.prototype.triggerWithContext=function(type){for(var args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i];if(!this._$handlers)return this;var _h=this._$handlers[type],eventProcessor=this._$eventProcessor;if(_h)for(var argLen=args.length,ctx=args[argLen-1],len=_h.length,i=0;i<len;i++){var hItem=_h[i];if(!eventProcessor||!eventProcessor.filter||null==hItem.query||eventProcessor.filter(type,hItem.query))switch(argLen){case 0:hItem.h.call(ctx);break;case 1:hItem.h.call(ctx,args[0]);break;case 2:hItem.h.call(ctx,args[0],args[1]);break;default:hItem.h.apply(ctx,args.slice(1,argLen-1))}}return eventProcessor&&eventProcessor.afterTrigger&&eventProcessor.afterTrigger(type),this},Eventful}(),Eventful$1=Eventful,LN2=Math.log(2);function determinant(rows,rank,rowStart,rowMask,colMask,detCache){var cacheKey=rowMask+"-"+colMask,fullRank=rows.length;if(detCache.hasOwnProperty(cacheKey))return detCache[cacheKey];if(1===rank){var colStart=Math.round(Math.log((1<<fullRank)-1&~colMask)/LN2);return rows[rowStart][colStart]}for(var subRowMask=rowMask|1<<rowStart,subRowStart=rowStart+1;rowMask&1<<subRowStart;)subRowStart++;for(var sum=0,j=0,colLocalIdx=0;j<fullRank;j++){var colTag=1<<j;colTag&colMask||(sum+=(colLocalIdx%2?-1:1)*rows[rowStart][j]*determinant(rows,rank-1,subRowStart,subRowMask,colMask|colTag,detCache),colLocalIdx++)}return detCache[cacheKey]=sum,sum}function buildTransformer(src,dest){var mA=[[src[0],src[1],1,0,0,0,-dest[0]*src[0],-dest[0]*src[1]],[0,0,0,src[0],src[1],1,-dest[1]*src[0],-dest[1]*src[1]],[src[2],src[3],1,0,0,0,-dest[2]*src[2],-dest[2]*src[3]],[0,0,0,src[2],src[3],1,-dest[3]*src[2],-dest[3]*src[3]],[src[4],src[5],1,0,0,0,-dest[4]*src[4],-dest[4]*src[5]],[0,0,0,src[4],src[5],1,-dest[5]*src[4],-dest[5]*src[5]],[src[6],src[7],1,0,0,0,-dest[6]*src[6],-dest[6]*src[7]],[0,0,0,src[6],src[7],1,-dest[7]*src[6],-dest[7]*src[7]]],detCache={},det=determinant(mA,8,0,0,0,detCache);if(0!==det){for(var vh=[],i=0;i<8;i++)for(var j=0;j<8;j++)null==vh[j]&&(vh[j]=0),vh[j]+=((i+j)%2?-1:1)*determinant(mA,7,0===i?1:0,1<<i,1<<j,detCache)/det*dest[i];return function(out,srcPointX,srcPointY){var pk=srcPointX*vh[6]+srcPointY*vh[7]+1;out[0]=(srcPointX*vh[0]+srcPointY*vh[1]+vh[2])/pk,out[1]=(srcPointX*vh[3]+srcPointY*vh[4]+vh[5])/pk}}}var _calcOut$1=[];function transformCoordWithViewport(out,el,inX,inY,inverse){if(el.getBoundingClientRect&&env$1.domSupported&&!isCanvasEl(el)){var saved=el.___zrEVENTSAVED||(el.___zrEVENTSAVED={}),markers=function(el,saved){var markers=saved.markers;if(markers)return markers;markers=saved.markers=[];for(var propLR=["left","right"],propTB=["top","bottom"],i=0;i<4;i++){var marker=document.createElement("div"),idxLR=i%2,idxTB=(i>>1)%2;marker.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",propLR[idxLR]+":0",propTB[idxTB]+":0",propLR[1-idxLR]+":auto",propTB[1-idxTB]+":auto",""].join("!important;"),el.appendChild(marker),markers.push(marker)}return markers}(el,saved),transformer=function(markers,saved,inverse){for(var transformerName=inverse?"invTrans":"trans",transformer=saved[transformerName],oldSrcCoords=saved.srcCoords,srcCoords=[],destCoords=[],oldCoordTheSame=!0,i=0;i<4;i++){var rect=markers[i].getBoundingClientRect(),ii=2*i,x=rect.left,y=rect.top;srcCoords.push(x,y),oldCoordTheSame=oldCoordTheSame&&oldSrcCoords&&x===oldSrcCoords[ii]&&y===oldSrcCoords[ii+1],destCoords.push(markers[i].offsetLeft,markers[i].offsetTop)}return oldCoordTheSame&&transformer?transformer:(saved.srcCoords=srcCoords,saved[transformerName]=inverse?buildTransformer(destCoords,srcCoords):buildTransformer(srcCoords,destCoords))}(markers,saved,inverse);if(transformer)return transformer(out,inX,inY),!0}return!1}function isCanvasEl(el){return"CANVAS"===el.nodeName.toUpperCase()}var replaceReg=/([&<>"'])/g,replaceMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function encodeHTML(source){return null==source?"":(source+"").replace(replaceReg,(function(str,c){return replaceMap[c]}))}var MOUSE_EVENT_REG=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,_calcOut=[],firefoxNotSupportOffsetXY=env$1.browser.firefox&&+env$1.browser.version.split(".")[0]<39;function clientToLocal(el,e,out,calculate){return out=out||{},calculate?calculateZrXY(el,e,out):firefoxNotSupportOffsetXY&&null!=e.layerX&&e.layerX!==e.offsetX?(out.zrX=e.layerX,out.zrY=e.layerY):null!=e.offsetX?(out.zrX=e.offsetX,out.zrY=e.offsetY):calculateZrXY(el,e,out),out}function calculateZrXY(el,e,out){if(env$1.domSupported&&el.getBoundingClientRect){var ex=e.clientX,ey=e.clientY;if(isCanvasEl(el)){var box=el.getBoundingClientRect();return out.zrX=ex-box.left,void(out.zrY=ey-box.top)}if(transformCoordWithViewport(_calcOut,el,ex,ey))return out.zrX=_calcOut[0],void(out.zrY=_calcOut[1])}out.zrX=out.zrY=0}function getNativeEvent(e){return e||window.event}function normalizeEvent(el,e,calculate){if(null!=(e=getNativeEvent(e)).zrX)return e;var eventType=e.type;if(eventType&&eventType.indexOf("touch")>=0){var touch="touchend"!==eventType?e.targetTouches[0]:e.changedTouches[0];touch&&clientToLocal(el,touch,e,calculate)}else{clientToLocal(el,e,e,calculate);var wheelDelta=function(e){var rawWheelDelta=e.wheelDelta;if(rawWheelDelta)return rawWheelDelta;var deltaX=e.deltaX,deltaY=e.deltaY;if(null==deltaX||null==deltaY)return rawWheelDelta;return 3*(0!==deltaY?Math.abs(deltaY):Math.abs(deltaX))*(deltaY>0?-1:deltaY<0?1:deltaX>0?-1:1)}(e);e.zrDelta=wheelDelta?wheelDelta/120:-(e.detail||0)/3}var button=e.button;return null==e.which&&void 0!==button&&MOUSE_EVENT_REG.test(e.type)&&(e.which=1&button?1:2&button?3:4&button?2:0),e}function addEventListener(el,name,handler,opt){el.addEventListener(name,handler,opt)}var stop=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function isMiddleOrRightButtonOnMouseUpDown(e){return 2===e.which||3===e.which}var GestureMgr=function(){function GestureMgr(){this._track=[]}return GestureMgr.prototype.recognize=function(event,target,root){return this._doTrack(event,target,root),this._recognize(event)},GestureMgr.prototype.clear=function(){return this._track.length=0,this},GestureMgr.prototype._doTrack=function(event,target,root){var touches=event.touches;if(touches){for(var trackItem={points:[],touches:[],target:target,event:event},i=0,len=touches.length;i<len;i++){var touch=touches[i],pos=clientToLocal(root,touch,{});trackItem.points.push([pos.zrX,pos.zrY]),trackItem.touches.push(touch)}this._track.push(trackItem)}},GestureMgr.prototype._recognize=function(event){for(var eventName in recognizers)if(recognizers.hasOwnProperty(eventName)){var gestureInfo=recognizers[eventName](this._track,event);if(gestureInfo)return gestureInfo}},GestureMgr}();function dist(pointPair){var dx=pointPair[1][0]-pointPair[0][0],dy=pointPair[1][1]-pointPair[0][1];return Math.sqrt(dx*dx+dy*dy)}var recognizers={pinch:function(tracks,event){var trackLen=tracks.length;if(trackLen){var pointPair,pinchEnd=(tracks[trackLen-1]||{}).points,pinchPre=(tracks[trackLen-2]||{}).points||pinchEnd;if(pinchPre&&pinchPre.length>1&&pinchEnd&&pinchEnd.length>1){var pinchScale=dist(pinchEnd)/dist(pinchPre);!isFinite(pinchScale)&&(pinchScale=1),event.pinchScale=pinchScale;var pinchCenter=[((pointPair=pinchEnd)[0][0]+pointPair[1][0])/2,(pointPair[0][1]+pointPair[1][1])/2];return event.pinchX=pinchCenter[0],event.pinchY=pinchCenter[1],{type:"pinch",target:tracks[0].target,event:event}}}}};function identity(out){return out[0]=1,out[1]=0,out[2]=0,out[3]=1,out[4]=0,out[5]=0,out}function copy(out,m){return out[0]=m[0],out[1]=m[1],out[2]=m[2],out[3]=m[3],out[4]=m[4],out[5]=m[5],out}function mul(out,m1,m2){var out0=m1[0]*m2[0]+m1[2]*m2[1],out1=m1[1]*m2[0]+m1[3]*m2[1],out2=m1[0]*m2[2]+m1[2]*m2[3],out3=m1[1]*m2[2]+m1[3]*m2[3],out4=m1[0]*m2[4]+m1[2]*m2[5]+m1[4],out5=m1[1]*m2[4]+m1[3]*m2[5]+m1[5];return out[0]=out0,out[1]=out1,out[2]=out2,out[3]=out3,out[4]=out4,out[5]=out5,out}function translate(out,a,v){return out[0]=a[0],out[1]=a[1],out[2]=a[2],out[3]=a[3],out[4]=a[4]+v[0],out[5]=a[5]+v[1],out}function rotate(out,a,rad,pivot){void 0===pivot&&(pivot=[0,0]);var aa=a[0],ac=a[2],atx=a[4],ab=a[1],ad=a[3],aty=a[5],st=Math.sin(rad),ct=Math.cos(rad);return out[0]=aa*ct+ab*st,out[1]=-aa*st+ab*ct,out[2]=ac*ct+ad*st,out[3]=-ac*st+ct*ad,out[4]=ct*(atx-pivot[0])+st*(aty-pivot[1])+pivot[0],out[5]=ct*(aty-pivot[1])-st*(atx-pivot[0])+pivot[1],out}function scale$1(out,a,v){var vx=v[0],vy=v[1];return out[0]=a[0]*vx,out[1]=a[1]*vy,out[2]=a[2]*vx,out[3]=a[3]*vy,out[4]=a[4]*vx,out[5]=a[5]*vy,out}function invert(out,a){var aa=a[0],ac=a[2],atx=a[4],ab=a[1],ad=a[3],aty=a[5],det=aa*ad-ab*ac;return det?(det=1/det,out[0]=ad*det,out[1]=-ab*det,out[2]=-ac*det,out[3]=aa*det,out[4]=(ac*aty-ad*atx)*det,out[5]=(ab*atx-aa*aty)*det,out):null}var Point=function(){function Point(x,y){this.x=x||0,this.y=y||0}return Point.prototype.copy=function(other){return this.x=other.x,this.y=other.y,this},Point.prototype.clone=function(){return new Point(this.x,this.y)},Point.prototype.set=function(x,y){return this.x=x,this.y=y,this},Point.prototype.equal=function(other){return other.x===this.x&&other.y===this.y},Point.prototype.add=function(other){return this.x+=other.x,this.y+=other.y,this},Point.prototype.scale=function(scalar){this.x*=scalar,this.y*=scalar},Point.prototype.scaleAndAdd=function(other,scalar){this.x+=other.x*scalar,this.y+=other.y*scalar},Point.prototype.sub=function(other){return this.x-=other.x,this.y-=other.y,this},Point.prototype.dot=function(other){return this.x*other.x+this.y*other.y},Point.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},Point.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},Point.prototype.normalize=function(){var len=this.len();return this.x/=len,this.y/=len,this},Point.prototype.distance=function(other){var dx=this.x-other.x,dy=this.y-other.y;return Math.sqrt(dx*dx+dy*dy)},Point.prototype.distanceSquare=function(other){var dx=this.x-other.x,dy=this.y-other.y;return dx*dx+dy*dy},Point.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},Point.prototype.transform=function(m){if(m){var x=this.x,y=this.y;return this.x=m[0]*x+m[2]*y+m[4],this.y=m[1]*x+m[3]*y+m[5],this}},Point.prototype.toArray=function(out){return out[0]=this.x,out[1]=this.y,out},Point.prototype.fromArray=function(input){this.x=input[0],this.y=input[1]},Point.set=function(p,x,y){p.x=x,p.y=y},Point.copy=function(p,p2){p.x=p2.x,p.y=p2.y},Point.len=function(p){return Math.sqrt(p.x*p.x+p.y*p.y)},Point.lenSquare=function(p){return p.x*p.x+p.y*p.y},Point.dot=function(p0,p1){return p0.x*p1.x+p0.y*p1.y},Point.add=function(out,p0,p1){out.x=p0.x+p1.x,out.y=p0.y+p1.y},Point.sub=function(out,p0,p1){out.x=p0.x-p1.x,out.y=p0.y-p1.y},Point.scale=function(out,p0,scalar){out.x=p0.x*scalar,out.y=p0.y*scalar},Point.scaleAndAdd=function(out,p0,p1,scalar){out.x=p0.x+p1.x*scalar,out.y=p0.y+p1.y*scalar},Point.lerp=function(out,p0,p1,t){var onet=1-t;out.x=onet*p0.x+t*p1.x,out.y=onet*p0.y+t*p1.y},Point}(),Point$1=Point,mathMin$9=Math.min,mathMax$9=Math.max,lt=new Point$1,rb=new Point$1,lb=new Point$1,rt=new Point$1,minTv$1=new Point$1,maxTv$1=new Point$1,BoundingRect=function(){function BoundingRect(x,y,width,height){width<0&&(x+=width,width=-width),height<0&&(y+=height,height=-height),this.x=x,this.y=y,this.width=width,this.height=height}return BoundingRect.prototype.union=function(other){var x=mathMin$9(other.x,this.x),y=mathMin$9(other.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=mathMax$9(other.x+other.width,this.x+this.width)-x:this.width=other.width,isFinite(this.y)&&isFinite(this.height)?this.height=mathMax$9(other.y+other.height,this.y+this.height)-y:this.height=other.height,this.x=x,this.y=y},BoundingRect.prototype.applyTransform=function(m){BoundingRect.applyTransform(this,this,m)},BoundingRect.prototype.calculateTransform=function(b){var a=this,sx=b.width/a.width,sy=b.height/a.height,m=[1,0,0,1,0,0];return translate(m,m,[-a.x,-a.y]),scale$1(m,m,[sx,sy]),translate(m,m,[b.x,b.y]),m},BoundingRect.prototype.intersect=function(b,mtv){if(!b)return!1;b instanceof BoundingRect||(b=BoundingRect.create(b));var a=this,ax0=a.x,ax1=a.x+a.width,ay0=a.y,ay1=a.y+a.height,bx0=b.x,bx1=b.x+b.width,by0=b.y,by1=b.y+b.height,overlap=!(ax1<bx0||bx1<ax0||ay1<by0||by1<ay0);if(mtv){var dMin=1/0,dMax=0,d0=Math.abs(ax1-bx0),d1=Math.abs(bx1-ax0),d2=Math.abs(ay1-by0),d3=Math.abs(by1-ay0),dx=Math.min(d0,d1),dy=Math.min(d2,d3);ax1<bx0||bx1<ax0?dx>dMax&&(dMax=dx,d0<d1?Point$1.set(maxTv$1,-d0,0):Point$1.set(maxTv$1,d1,0)):dx<dMin&&(dMin=dx,d0<d1?Point$1.set(minTv$1,d0,0):Point$1.set(minTv$1,-d1,0)),ay1<by0||by1<ay0?dy>dMax&&(dMax=dy,d2<d3?Point$1.set(maxTv$1,0,-d2):Point$1.set(maxTv$1,0,d3)):dx<dMin&&(dMin=dx,d2<d3?Point$1.set(minTv$1,0,d2):Point$1.set(minTv$1,0,-d3))}return mtv&&Point$1.copy(mtv,overlap?minTv$1:maxTv$1),overlap},BoundingRect.prototype.contain=function(x,y){return x>=this.x&&x<=this.x+this.width&&y>=this.y&&y<=this.y+this.height},BoundingRect.prototype.clone=function(){return new BoundingRect(this.x,this.y,this.width,this.height)},BoundingRect.prototype.copy=function(other){BoundingRect.copy(this,other)},BoundingRect.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},BoundingRect.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},BoundingRect.prototype.isZero=function(){return 0===this.width||0===this.height},BoundingRect.create=function(rect){return new BoundingRect(rect.x,rect.y,rect.width,rect.height)},BoundingRect.copy=function(target,source){target.x=source.x,target.y=source.y,target.width=source.width,target.height=source.height},BoundingRect.applyTransform=function(target,source,m){if(m){if(m[1]<1e-5&&m[1]>-1e-5&&m[2]<1e-5&&m[2]>-1e-5){var sx=m[0],sy=m[3],tx=m[4],ty=m[5];return target.x=source.x*sx+tx,target.y=source.y*sy+ty,target.width=source.width*sx,target.height=source.height*sy,target.width<0&&(target.x+=target.width,target.width=-target.width),void(target.height<0&&(target.y+=target.height,target.height=-target.height))}lt.x=lb.x=source.x,lt.y=rt.y=source.y,rb.x=rt.x=source.x+source.width,rb.y=lb.y=source.y+source.height,lt.transform(m),rt.transform(m),rb.transform(m),lb.transform(m),target.x=mathMin$9(lt.x,rb.x,lb.x,rt.x),target.y=mathMin$9(lt.y,rb.y,lb.y,rt.y);var maxX=mathMax$9(lt.x,rb.x,lb.x,rt.x),maxY=mathMax$9(lt.y,rb.y,lb.y,rt.y);target.width=maxX-target.x,target.height=maxY-target.y}else target!==source&&BoundingRect.copy(target,source)},BoundingRect}(),BoundingRect$1=BoundingRect;function stopEvent(){stop(this.event)}var EmptyProxy=function(_super){function EmptyProxy(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.handler=null,_this}return __extends(EmptyProxy,_super),EmptyProxy.prototype.dispose=function(){},EmptyProxy.prototype.setCursor=function(){},EmptyProxy}(Eventful$1),HoveredResult=function(x,y){this.x=x,this.y=y},handlerNames=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],tmpRect$1=new BoundingRect$1(0,0,0,0),Handler=function(_super){function Handler(storage,painter,proxy,painterRoot,pointerSize){var _this=_super.call(this)||this;return _this._hovered=new HoveredResult(0,0),_this.storage=storage,_this.painter=painter,_this.painterRoot=painterRoot,_this._pointerSize=pointerSize,proxy=proxy||new EmptyProxy,_this.proxy=null,_this.setHandlerProxy(proxy),_this._draggingMgr=new Draggable$1(_this),_this}return __extends(Handler,_super),Handler.prototype.setHandlerProxy=function(proxy){this.proxy&&this.proxy.dispose(),proxy&&(each$b(handlerNames,(function(name){proxy.on&&proxy.on(name,this[name],this)}),this),proxy.handler=this),this.proxy=proxy},Handler.prototype.mousemove=function(event){var x=event.zrX,y=event.zrY,isOutside=isOutsideBoundary(this,x,y),lastHovered=this._hovered,lastHoveredTarget=lastHovered.target;lastHoveredTarget&&!lastHoveredTarget.__zr&&(lastHoveredTarget=(lastHovered=this.findHover(lastHovered.x,lastHovered.y)).target);var hovered=this._hovered=isOutside?new HoveredResult(x,y):this.findHover(x,y),hoveredTarget=hovered.target,proxy=this.proxy;proxy.setCursor&&proxy.setCursor(hoveredTarget?hoveredTarget.cursor:"default"),lastHoveredTarget&&hoveredTarget!==lastHoveredTarget&&this.dispatchToElement(lastHovered,"mouseout",event),this.dispatchToElement(hovered,"mousemove",event),hoveredTarget&&hoveredTarget!==lastHoveredTarget&&this.dispatchToElement(hovered,"mouseover",event)},Handler.prototype.mouseout=function(event){var eventControl=event.zrEventControl;"only_globalout"!==eventControl&&this.dispatchToElement(this._hovered,"mouseout",event),"no_globalout"!==eventControl&&this.trigger("globalout",{type:"globalout",event:event})},Handler.prototype.resize=function(){this._hovered=new HoveredResult(0,0)},Handler.prototype.dispatch=function(eventName,eventArgs){var handler=this[eventName];handler&&handler.call(this,eventArgs)},Handler.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},Handler.prototype.setCursorStyle=function(cursorStyle){var proxy=this.proxy;proxy.setCursor&&proxy.setCursor(cursorStyle)},Handler.prototype.dispatchToElement=function(targetInfo,eventName,event){var el=(targetInfo=targetInfo||{}).target;if(!el||!el.silent){for(var eventKey="on"+eventName,eventPacket=function(eveType,targetInfo,event){return{type:eveType,event:event,target:targetInfo.target,topTarget:targetInfo.topTarget,cancelBubble:!1,offsetX:event.zrX,offsetY:event.zrY,gestureEvent:event.gestureEvent,pinchX:event.pinchX,pinchY:event.pinchY,pinchScale:event.pinchScale,wheelDelta:event.zrDelta,zrByTouch:event.zrByTouch,which:event.which,stop:stopEvent}}(eventName,targetInfo,event);el&&(el[eventKey]&&(eventPacket.cancelBubble=!!el[eventKey].call(el,eventPacket)),el.trigger(eventName,eventPacket),el=el.__hostTarget?el.__hostTarget:el.parent,!eventPacket.cancelBubble););eventPacket.cancelBubble||(this.trigger(eventName,eventPacket),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(layer){"function"==typeof layer[eventKey]&&layer[eventKey].call(layer,eventPacket),layer.trigger&&layer.trigger(eventName,eventPacket)})))}},Handler.prototype.findHover=function(x,y,exclude){var list=this.storage.getDisplayList(),out=new HoveredResult(x,y);if(setHoverTarget(list,out,x,y,exclude),this._pointerSize&&!out.target){for(var candidates=[],pointerSize=this._pointerSize,targetSizeHalf=pointerSize/2,pointerRect=new BoundingRect$1(x-targetSizeHalf,y-targetSizeHalf,pointerSize,pointerSize),i=list.length-1;i>=0;i--){var el=list[i];el===exclude||el.ignore||el.ignoreCoarsePointer||el.parent&&el.parent.ignoreCoarsePointer||(tmpRect$1.copy(el.getBoundingRect()),el.transform&&tmpRect$1.applyTransform(el.transform),tmpRect$1.intersect(pointerRect)&&candidates.push(el))}if(candidates.length)for(var thetaStep=Math.PI/12,PI2=2*Math.PI,r=0;r<targetSizeHalf;r+=4)for(var theta=0;theta<PI2;theta+=thetaStep){if(setHoverTarget(candidates,out,x+r*Math.cos(theta),y+r*Math.sin(theta),exclude),out.target)return out}}return out},Handler.prototype.processGesture=function(event,stage){this._gestureMgr||(this._gestureMgr=new GestureMgr);var gestureMgr=this._gestureMgr;"start"===stage&&gestureMgr.clear();var gestureInfo=gestureMgr.recognize(event,this.findHover(event.zrX,event.zrY,null).target,this.proxy.dom);if("end"===stage&&gestureMgr.clear(),gestureInfo){var type=gestureInfo.type;event.gestureEvent=type;var res=new HoveredResult;res.target=gestureInfo.target,this.dispatchToElement(res,type,gestureInfo.event)}},Handler}(Eventful$1);function isHover(displayable,x,y){if(displayable[displayable.rectHover?"rectContain":"contain"](x,y)){for(var el=displayable,isSilent=void 0,ignoreClip=!1;el;){if(el.ignoreClip&&(ignoreClip=!0),!ignoreClip){var clipPath=el.getClipPath();if(clipPath&&!clipPath.contain(x,y))return!1}el.silent&&(isSilent=!0);var hostEl=el.__hostTarget;el=hostEl||el.parent}return!isSilent||"silent"}return!1}function setHoverTarget(list,out,x,y,exclude){for(var i=list.length-1;i>=0;i--){var el=list[i],hoverCheckResult=void 0;if(el!==exclude&&!el.ignore&&(hoverCheckResult=isHover(el,x,y))&&(!out.topTarget&&(out.topTarget=el),"silent"!==hoverCheckResult)){out.target=el;break}}}function isOutsideBoundary(handlerInstance,x,y){var painter=handlerInstance.painter;return x<0||x>painter.getWidth()||y<0||y>painter.getHeight()}each$b(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(name){Handler.prototype[name]=function(event){var hovered,hoveredTarget,x=event.zrX,y=event.zrY,isOutside=isOutsideBoundary(this,x,y);if("mouseup"===name&&isOutside||(hoveredTarget=(hovered=this.findHover(x,y)).target),"mousedown"===name)this._downEl=hoveredTarget,this._downPoint=[event.zrX,event.zrY],this._upEl=hoveredTarget;else if("mouseup"===name)this._upEl=hoveredTarget;else if("click"===name){if(this._downEl!==this._upEl||!this._downPoint||dist$1(this._downPoint,[event.zrX,event.zrY])>4)return;this._downPoint=null}this.dispatchToElement(hovered,name,event)}}));var Handler$1=Handler;function makeAscendingRun(array,lo,hi,compare){var runHi=lo+1;if(runHi===hi)return 1;if(compare(array[runHi++],array[lo])<0){for(;runHi<hi&&compare(array[runHi],array[runHi-1])<0;)runHi++;!function(array,lo,hi){hi--;for(;lo<hi;){var t=array[lo];array[lo++]=array[hi],array[hi--]=t}}(array,lo,runHi)}else for(;runHi<hi&&compare(array[runHi],array[runHi-1])>=0;)runHi++;return runHi-lo}function binaryInsertionSort(array,lo,hi,start,compare){for(start===lo&&start++;start<hi;start++){for(var mid,pivot=array[start],left=lo,right=start;left<right;)compare(pivot,array[mid=left+right>>>1])<0?right=mid:left=mid+1;var n=start-left;switch(n){case 3:array[left+3]=array[left+2];case 2:array[left+2]=array[left+1];case 1:array[left+1]=array[left];break;default:for(;n>0;)array[left+n]=array[left+n-1],n--}array[left]=pivot}}function gallopLeft(value,array,start,length,hint,compare){var lastOffset=0,maxOffset=0,offset=1;if(compare(value,array[start+hint])>0){for(maxOffset=length-hint;offset<maxOffset&&compare(value,array[start+hint+offset])>0;)lastOffset=offset,(offset=1+(offset<<1))<=0&&(offset=maxOffset);offset>maxOffset&&(offset=maxOffset),lastOffset+=hint,offset+=hint}else{for(maxOffset=hint+1;offset<maxOffset&&compare(value,array[start+hint-offset])<=0;)lastOffset=offset,(offset=1+(offset<<1))<=0&&(offset=maxOffset);offset>maxOffset&&(offset=maxOffset);var tmp=lastOffset;lastOffset=hint-offset,offset=hint-tmp}for(lastOffset++;lastOffset<offset;){var m=lastOffset+(offset-lastOffset>>>1);compare(value,array[start+m])>0?lastOffset=m+1:offset=m}return offset}function gallopRight(value,array,start,length,hint,compare){var lastOffset=0,maxOffset=0,offset=1;if(compare(value,array[start+hint])<0){for(maxOffset=hint+1;offset<maxOffset&&compare(value,array[start+hint-offset])<0;)lastOffset=offset,(offset=1+(offset<<1))<=0&&(offset=maxOffset);offset>maxOffset&&(offset=maxOffset);var tmp=lastOffset;lastOffset=hint-offset,offset=hint-tmp}else{for(maxOffset=length-hint;offset<maxOffset&&compare(value,array[start+hint+offset])>=0;)lastOffset=offset,(offset=1+(offset<<1))<=0&&(offset=maxOffset);offset>maxOffset&&(offset=maxOffset),lastOffset+=hint,offset+=hint}for(lastOffset++;lastOffset<offset;){var m=lastOffset+(offset-lastOffset>>>1);compare(value,array[start+m])<0?offset=m:lastOffset=m+1}return offset}function TimSort(array,compare){var runStart,runLength,minGallop=7,stackSize=0,tmp=[];function mergeAt(i){var start1=runStart[i],length1=runLength[i],start2=runStart[i+1],length2=runLength[i+1];runLength[i]=length1+length2,i===stackSize-3&&(runStart[i+1]=runStart[i+2],runLength[i+1]=runLength[i+2]),stackSize--;var k=gallopRight(array[start2],array,start1,length1,0,compare);start1+=k,0!==(length1-=k)&&0!==(length2=gallopLeft(array[start1+length1-1],array,start2,length2,length2-1,compare))&&(length1<=length2?function(start1,length1,start2,length2){var i=0;for(i=0;i<length1;i++)tmp[i]=array[start1+i];var cursor1=0,cursor2=start2,dest=start1;if(array[dest++]=array[cursor2++],0==--length2){for(i=0;i<length1;i++)array[dest+i]=tmp[cursor1+i];return}if(1===length1){for(i=0;i<length2;i++)array[dest+i]=array[cursor2+i];return void(array[dest+length2]=tmp[cursor1])}var count1,count2,exit,_minGallop=minGallop;for(;;){count1=0,count2=0,exit=!1;do{if(compare(array[cursor2],tmp[cursor1])<0){if(array[dest++]=array[cursor2++],count2++,count1=0,0==--length2){exit=!0;break}}else if(array[dest++]=tmp[cursor1++],count1++,count2=0,1==--length1){exit=!0;break}}while((count1|count2)<_minGallop);if(exit)break;do{if(0!==(count1=gallopRight(array[cursor2],tmp,cursor1,length1,0,compare))){for(i=0;i<count1;i++)array[dest+i]=tmp[cursor1+i];if(dest+=count1,cursor1+=count1,(length1-=count1)<=1){exit=!0;break}}if(array[dest++]=array[cursor2++],0==--length2){exit=!0;break}if(0!==(count2=gallopLeft(tmp[cursor1],array,cursor2,length2,0,compare))){for(i=0;i<count2;i++)array[dest+i]=array[cursor2+i];if(dest+=count2,cursor2+=count2,0===(length2-=count2)){exit=!0;break}}if(array[dest++]=tmp[cursor1++],1==--length1){exit=!0;break}_minGallop--}while(count1>=7||count2>=7);if(exit)break;_minGallop<0&&(_minGallop=0),_minGallop+=2}if((minGallop=_minGallop)<1&&(minGallop=1),1===length1){for(i=0;i<length2;i++)array[dest+i]=array[cursor2+i];array[dest+length2]=tmp[cursor1]}else{if(0===length1)throw new Error;for(i=0;i<length1;i++)array[dest+i]=tmp[cursor1+i]}}(start1,length1,start2,length2):function(start1,length1,start2,length2){var i=0;for(i=0;i<length2;i++)tmp[i]=array[start2+i];var cursor1=start1+length1-1,cursor2=length2-1,dest=start2+length2-1,customCursor=0,customDest=0;if(array[dest--]=array[cursor1--],0==--length1){for(customCursor=dest-(length2-1),i=0;i<length2;i++)array[customCursor+i]=tmp[i];return}if(1===length2){for(customDest=(dest-=length1)+1,customCursor=(cursor1-=length1)+1,i=length1-1;i>=0;i--)array[customDest+i]=array[customCursor+i];return void(array[dest]=tmp[cursor2])}var _minGallop=minGallop;for(;;){var count1=0,count2=0,exit=!1;do{if(compare(tmp[cursor2],array[cursor1])<0){if(array[dest--]=array[cursor1--],count1++,count2=0,0==--length1){exit=!0;break}}else if(array[dest--]=tmp[cursor2--],count2++,count1=0,1==--length2){exit=!0;break}}while((count1|count2)<_minGallop);if(exit)break;do{if(0!==(count1=length1-gallopRight(tmp[cursor2],array,start1,length1,length1-1,compare))){for(length1-=count1,customDest=(dest-=count1)+1,customCursor=(cursor1-=count1)+1,i=count1-1;i>=0;i--)array[customDest+i]=array[customCursor+i];if(0===length1){exit=!0;break}}if(array[dest--]=tmp[cursor2--],1==--length2){exit=!0;break}if(0!==(count2=length2-gallopLeft(array[cursor1],tmp,0,length2,length2-1,compare))){for(length2-=count2,customDest=(dest-=count2)+1,customCursor=(cursor2-=count2)+1,i=0;i<count2;i++)array[customDest+i]=tmp[customCursor+i];if(length2<=1){exit=!0;break}}if(array[dest--]=array[cursor1--],0==--length1){exit=!0;break}_minGallop--}while(count1>=7||count2>=7);if(exit)break;_minGallop<0&&(_minGallop=0),_minGallop+=2}(minGallop=_minGallop)<1&&(minGallop=1);if(1===length2){for(customDest=(dest-=length1)+1,customCursor=(cursor1-=length1)+1,i=length1-1;i>=0;i--)array[customDest+i]=array[customCursor+i];array[dest]=tmp[cursor2]}else{if(0===length2)throw new Error;for(customCursor=dest-(length2-1),i=0;i<length2;i++)array[customCursor+i]=tmp[i]}}(start1,length1,start2,length2))}return runStart=[],runLength=[],{mergeRuns:function(){for(;stackSize>1;){var n=stackSize-2;if(n>=1&&runLength[n-1]<=runLength[n]+runLength[n+1]||n>=2&&runLength[n-2]<=runLength[n]+runLength[n-1])runLength[n-1]<runLength[n+1]&&n--;else if(runLength[n]>runLength[n+1])break;mergeAt(n)}},forceMergeRuns:function(){for(;stackSize>1;){var n=stackSize-2;n>0&&runLength[n-1]<runLength[n+1]&&n--,mergeAt(n)}},pushRun:function(_runStart,_runLength){runStart[stackSize]=_runStart,runLength[stackSize]=_runLength,stackSize+=1}}}function sort$2(array,compare,lo,hi){lo||(lo=0),hi||(hi=array.length);var remaining=hi-lo;if(!(remaining<2)){var runLength=0;if(remaining<32)binaryInsertionSort(array,lo,hi,lo+(runLength=makeAscendingRun(array,lo,hi,compare)),compare);else{var ts=TimSort(array,compare),minRun=function(n){for(var r=0;n>=32;)r|=1&n,n>>=1;return n+r}(remaining);do{if((runLength=makeAscendingRun(array,lo,hi,compare))<minRun){var force=remaining;force>minRun&&(force=minRun),binaryInsertionSort(array,lo,lo+force,lo+runLength,compare),runLength=force}ts.pushRun(lo,runLength),ts.mergeRuns(),remaining-=runLength,lo+=runLength}while(0!==remaining);ts.forceMergeRuns()}}}var invalidZErrorLogged=!1;function logInvalidZError(){invalidZErrorLogged||(invalidZErrorLogged=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function shapeCompareFunc(a,b){return a.zlevel===b.zlevel?a.z===b.z?a.z2-b.z2:a.z-b.z:a.zlevel-b.zlevel}var Storage=function(){function Storage(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=shapeCompareFunc}return Storage.prototype.traverse=function(cb,context){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(cb,context)},Storage.prototype.getDisplayList=function(update,includeIgnore){includeIgnore=includeIgnore||!1;var displayList=this._displayList;return!update&&displayList.length||this.updateDisplayList(includeIgnore),displayList},Storage.prototype.updateDisplayList=function(includeIgnore){this._displayListLen=0;for(var roots=this._roots,displayList=this._displayList,i=0,len=roots.length;i<len;i++)this._updateAndAddDisplayable(roots[i],null,includeIgnore);displayList.length=this._displayListLen,sort$2(displayList,shapeCompareFunc)},Storage.prototype._updateAndAddDisplayable=function(el,clipPaths,includeIgnore){if(!el.ignore||includeIgnore){el.beforeUpdate(),el.update(),el.afterUpdate();var userSetClipPath=el.getClipPath();if(el.ignoreClip)clipPaths=null;else if(userSetClipPath){clipPaths=clipPaths?clipPaths.slice():[];for(var currentClipPath=userSetClipPath,parentClipPath=el;currentClipPath;)currentClipPath.parent=parentClipPath,currentClipPath.updateTransform(),clipPaths.push(currentClipPath),parentClipPath=currentClipPath,currentClipPath=currentClipPath.getClipPath()}if(el.childrenRef){for(var children=el.childrenRef(),i=0;i<children.length;i++){var child=children[i];el.__dirty&&(child.__dirty|=1),this._updateAndAddDisplayable(child,clipPaths,includeIgnore)}el.__dirty=0}else{var disp=el;clipPaths&&clipPaths.length?disp.__clipPaths=clipPaths:disp.__clipPaths&&disp.__clipPaths.length>0&&(disp.__clipPaths=[]),isNaN(disp.z)&&(logInvalidZError(),disp.z=0),isNaN(disp.z2)&&(logInvalidZError(),disp.z2=0),isNaN(disp.zlevel)&&(logInvalidZError(),disp.zlevel=0),this._displayList[this._displayListLen++]=disp}var decalEl=el.getDecalElement&&el.getDecalElement();decalEl&&this._updateAndAddDisplayable(decalEl,clipPaths,includeIgnore);var textGuide=el.getTextGuideLine();textGuide&&this._updateAndAddDisplayable(textGuide,clipPaths,includeIgnore);var textEl=el.getTextContent();textEl&&this._updateAndAddDisplayable(textEl,clipPaths,includeIgnore)}},Storage.prototype.addRoot=function(el){el.__zr&&el.__zr.storage===this||this._roots.push(el)},Storage.prototype.delRoot=function(el){if(el instanceof Array)for(var i=0,l=el.length;i<l;i++)this.delRoot(el[i]);else{var idx=indexOf(this._roots,el);idx>=0&&this._roots.splice(idx,1)}},Storage.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},Storage.prototype.getRoots=function(){return this._roots},Storage.prototype.dispose=function(){this._displayList=null,this._roots=null},Storage}(),Storage$1=Storage,requestAnimationFrame$3=env$1.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(func){return setTimeout(func,16)},easingFuncs={linear:function(k){return k},quadraticIn:function(k){return k*k},quadraticOut:function(k){return k*(2-k)},quadraticInOut:function(k){return(k*=2)<1?.5*k*k:-.5*(--k*(k-2)-1)},cubicIn:function(k){return k*k*k},cubicOut:function(k){return--k*k*k+1},cubicInOut:function(k){return(k*=2)<1?.5*k*k*k:.5*((k-=2)*k*k+2)},quarticIn:function(k){return k*k*k*k},quarticOut:function(k){return 1- --k*k*k*k},quarticInOut:function(k){return(k*=2)<1?.5*k*k*k*k:-.5*((k-=2)*k*k*k-2)},quinticIn:function(k){return k*k*k*k*k},quinticOut:function(k){return--k*k*k*k*k+1},quinticInOut:function(k){return(k*=2)<1?.5*k*k*k*k*k:.5*((k-=2)*k*k*k*k+2)},sinusoidalIn:function(k){return 1-Math.cos(k*Math.PI/2)},sinusoidalOut:function(k){return Math.sin(k*Math.PI/2)},sinusoidalInOut:function(k){return.5*(1-Math.cos(Math.PI*k))},exponentialIn:function(k){return 0===k?0:Math.pow(1024,k-1)},exponentialOut:function(k){return 1===k?1:1-Math.pow(2,-10*k)},exponentialInOut:function(k){return 0===k?0:1===k?1:(k*=2)<1?.5*Math.pow(1024,k-1):.5*(2-Math.pow(2,-10*(k-1)))},circularIn:function(k){return 1-Math.sqrt(1-k*k)},circularOut:function(k){return Math.sqrt(1- --k*k)},circularInOut:function(k){return(k*=2)<1?-.5*(Math.sqrt(1-k*k)-1):.5*(Math.sqrt(1-(k-=2)*k)+1)},elasticIn:function(k){var s,a=.1;return 0===k?0:1===k?1:(!a||a<1?(a=1,s=.1):s=.4*Math.asin(1/a)/(2*Math.PI),-a*Math.pow(2,10*(k-=1))*Math.sin((k-s)*(2*Math.PI)/.4))},elasticOut:function(k){var s,a=.1;return 0===k?0:1===k?1:(!a||a<1?(a=1,s=.1):s=.4*Math.asin(1/a)/(2*Math.PI),a*Math.pow(2,-10*k)*Math.sin((k-s)*(2*Math.PI)/.4)+1)},elasticInOut:function(k){var s,a=.1,p=.4;return 0===k?0:1===k?1:(!a||a<1?(a=1,s=.1):s=p*Math.asin(1/a)/(2*Math.PI),(k*=2)<1?a*Math.pow(2,10*(k-=1))*Math.sin((k-s)*(2*Math.PI)/p)*-.5:a*Math.pow(2,-10*(k-=1))*Math.sin((k-s)*(2*Math.PI)/p)*.5+1)},backIn:function(k){var s=1.70158;return k*k*((s+1)*k-s)},backOut:function(k){var s=1.70158;return--k*k*((s+1)*k+s)+1},backInOut:function(k){var s=2.5949095;return(k*=2)<1?k*k*((s+1)*k-s)*.5:.5*((k-=2)*k*((s+1)*k+s)+2)},bounceIn:function(k){return 1-easingFuncs.bounceOut(1-k)},bounceOut:function(k){return k<1/2.75?7.5625*k*k:k<2/2.75?7.5625*(k-=1.5/2.75)*k+.75:k<2.5/2.75?7.5625*(k-=2.25/2.75)*k+.9375:7.5625*(k-=2.625/2.75)*k+.984375},bounceInOut:function(k){return k<.5?.5*easingFuncs.bounceIn(2*k):.5*easingFuncs.bounceOut(2*k-1)+.5}},easingFuncs$1=easingFuncs,mathPow$2=Math.pow,mathSqrt$3=Math.sqrt,THREE_SQRT=mathSqrt$3(3),ONE_THIRD=1/3,_v0=create$1(),_v1=create$1(),_v2=create$1();function isAroundZero(val){return val>-1e-8&&val<1e-8}function isNotAroundZero$1(val){return val>1e-8||val<-1e-8}function cubicAt(p0,p1,p2,p3,t){var onet=1-t;return onet*onet*(onet*p0+3*t*p1)+t*t*(t*p3+3*onet*p2)}function cubicDerivativeAt(p0,p1,p2,p3,t){var onet=1-t;return 3*(((p1-p0)*onet+2*(p2-p1)*t)*onet+(p3-p2)*t*t)}function cubicRootAt(p0,p1,p2,p3,val,roots){var a=p3+3*(p1-p2)-p0,b=3*(p2-2*p1+p0),c=3*(p1-p0),d=p0-val,A=b*b-3*a*c,B=b*c-9*a*d,C=c*c-3*b*d,n=0;if(isAroundZero(A)&&isAroundZero(B)){if(isAroundZero(b))roots[0]=0;else(t1=-c/b)>=0&&t1<=1&&(roots[n++]=t1)}else{var disc=B*B-4*A*C;if(isAroundZero(disc)){var K=B/A,t2=-K/2;(t1=-b/a+K)>=0&&t1<=1&&(roots[n++]=t1),t2>=0&&t2<=1&&(roots[n++]=t2)}else if(disc>0){var discSqrt=mathSqrt$3(disc),Y1=A*b+1.5*a*(-B+discSqrt),Y2=A*b+1.5*a*(-B-discSqrt);(t1=(-b-((Y1=Y1<0?-mathPow$2(-Y1,ONE_THIRD):mathPow$2(Y1,ONE_THIRD))+(Y2=Y2<0?-mathPow$2(-Y2,ONE_THIRD):mathPow$2(Y2,ONE_THIRD))))/(3*a))>=0&&t1<=1&&(roots[n++]=t1)}else{var T=(2*A*b-3*a*B)/(2*mathSqrt$3(A*A*A)),theta=Math.acos(T)/3,ASqrt=mathSqrt$3(A),tmp=Math.cos(theta),t1=(-b-2*ASqrt*tmp)/(3*a),t3=(t2=(-b+ASqrt*(tmp+THREE_SQRT*Math.sin(theta)))/(3*a),(-b+ASqrt*(tmp-THREE_SQRT*Math.sin(theta)))/(3*a));t1>=0&&t1<=1&&(roots[n++]=t1),t2>=0&&t2<=1&&(roots[n++]=t2),t3>=0&&t3<=1&&(roots[n++]=t3)}}return n}function cubicExtrema(p0,p1,p2,p3,extrema){var b=6*p2-12*p1+6*p0,a=9*p1+3*p3-3*p0-9*p2,c=3*p1-3*p0,n=0;if(isAroundZero(a)){if(isNotAroundZero$1(b))(t1=-c/b)>=0&&t1<=1&&(extrema[n++]=t1)}else{var disc=b*b-4*a*c;if(isAroundZero(disc))extrema[0]=-b/(2*a);else if(disc>0){var t1,discSqrt=mathSqrt$3(disc),t2=(-b-discSqrt)/(2*a);(t1=(-b+discSqrt)/(2*a))>=0&&t1<=1&&(extrema[n++]=t1),t2>=0&&t2<=1&&(extrema[n++]=t2)}}return n}function cubicSubdivide(p0,p1,p2,p3,t,out){var p01=(p1-p0)*t+p0,p12=(p2-p1)*t+p1,p23=(p3-p2)*t+p2,p012=(p12-p01)*t+p01,p123=(p23-p12)*t+p12,p0123=(p123-p012)*t+p012;out[0]=p0,out[1]=p01,out[2]=p012,out[3]=p0123,out[4]=p0123,out[5]=p123,out[6]=p23,out[7]=p3}function cubicProjectPoint(x0,y0,x1,y1,x2,y2,x3,y3,x,y,out){var t,prev,next,d1,d2,interval=.005,d=1/0;_v0[0]=x,_v0[1]=y;for(var _t=0;_t<1;_t+=.05)_v1[0]=cubicAt(x0,x1,x2,x3,_t),_v1[1]=cubicAt(y0,y1,y2,y3,_t),(d1=distSquare(_v0,_v1))<d&&(t=_t,d=d1);d=1/0;for(var i=0;i<32&&!(interval<1e-4);i++)prev=t-interval,next=t+interval,_v1[0]=cubicAt(x0,x1,x2,x3,prev),_v1[1]=cubicAt(y0,y1,y2,y3,prev),d1=distSquare(_v1,_v0),prev>=0&&d1<d?(t=prev,d=d1):(_v2[0]=cubicAt(x0,x1,x2,x3,next),_v2[1]=cubicAt(y0,y1,y2,y3,next),d2=distSquare(_v2,_v0),next<=1&&d2<d?(t=next,d=d2):interval*=.5);return out&&(out[0]=cubicAt(x0,x1,x2,x3,t),out[1]=cubicAt(y0,y1,y2,y3,t)),mathSqrt$3(d)}function cubicLength(x0,y0,x1,y1,x2,y2,x3,y3,iteration){for(var px=x0,py=y0,d=0,step=1/iteration,i=1;i<=iteration;i++){var t=i*step,x=cubicAt(x0,x1,x2,x3,t),y=cubicAt(y0,y1,y2,y3,t),dx=x-px,dy=y-py;d+=Math.sqrt(dx*dx+dy*dy),px=x,py=y}return d}function quadraticAt$1(p0,p1,p2,t){var onet=1-t;return onet*(onet*p0+2*t*p1)+t*t*p2}function quadraticDerivativeAt(p0,p1,p2,t){return 2*((1-t)*(p1-p0)+t*(p2-p1))}function quadraticExtremum(p0,p1,p2){var divider=p0+p2-2*p1;return 0===divider?.5:(p0-p1)/divider}function quadraticSubdivide(p0,p1,p2,t,out){var p01=(p1-p0)*t+p0,p12=(p2-p1)*t+p1,p012=(p12-p01)*t+p01;out[0]=p0,out[1]=p01,out[2]=p012,out[3]=p012,out[4]=p12,out[5]=p2}function quadraticProjectPoint(x0,y0,x1,y1,x2,y2,x,y,out){var t,interval=.005,d=1/0;_v0[0]=x,_v0[1]=y;for(var _t=0;_t<1;_t+=.05){_v1[0]=quadraticAt$1(x0,x1,x2,_t),_v1[1]=quadraticAt$1(y0,y1,y2,_t),(d1=distSquare(_v0,_v1))<d&&(t=_t,d=d1)}d=1/0;for(var i=0;i<32&&!(interval<1e-4);i++){var prev=t-interval,next=t+interval;_v1[0]=quadraticAt$1(x0,x1,x2,prev),_v1[1]=quadraticAt$1(y0,y1,y2,prev);var d1=distSquare(_v1,_v0);if(prev>=0&&d1<d)t=prev,d=d1;else{_v2[0]=quadraticAt$1(x0,x1,x2,next),_v2[1]=quadraticAt$1(y0,y1,y2,next);var d2=distSquare(_v2,_v0);next<=1&&d2<d?(t=next,d=d2):interval*=.5}}return out&&(out[0]=quadraticAt$1(x0,x1,x2,t),out[1]=quadraticAt$1(y0,y1,y2,t)),mathSqrt$3(d)}function quadraticLength(x0,y0,x1,y1,x2,y2,iteration){for(var px=x0,py=y0,d=0,step=1/iteration,i=1;i<=iteration;i++){var t=i*step,x=quadraticAt$1(x0,x1,x2,t),y=quadraticAt$1(y0,y1,y2,t),dx=x-px,dy=y-py;d+=Math.sqrt(dx*dx+dy*dy),px=x,py=y}return d}var regexp=/cubic-bezier\(([0-9,\.e ]+)\)/;function createCubicEasingFunc(cubicEasingStr){var cubic=cubicEasingStr&&regexp.exec(cubicEasingStr);if(cubic){var points=cubic[1].split(","),a_1=+trim$1(points[0]),b_1=+trim$1(points[1]),c_1=+trim$1(points[2]),d_1=+trim$1(points[3]);if(isNaN(a_1+b_1+c_1+d_1))return;var roots_1=[];return function(p){return p<=0?0:p>=1?1:cubicRootAt(0,a_1,c_1,1,p,roots_1)&&cubicAt(0,b_1,d_1,1,roots_1[0])}}}var Clip$1=function(){function Clip(opts){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=opts.life||1e3,this._delay=opts.delay||0,this.loop=opts.loop||!1,this.onframe=opts.onframe||noop$1,this.ondestroy=opts.ondestroy||noop$1,this.onrestart=opts.onrestart||noop$1,opts.easing&&this.setEasing(opts.easing)}return Clip.prototype.step=function(globalTime,deltaTime){if(this._inited||(this._startTime=globalTime+this._delay,this._inited=!0),!this._paused){var life=this._life,elapsedTime=globalTime-this._startTime-this._pausedTime,percent=elapsedTime/life;percent<0&&(percent=0),percent=Math.min(percent,1);var easingFunc=this.easingFunc,schedule=easingFunc?easingFunc(percent):percent;if(this.onframe(schedule),1===percent){if(!this.loop)return!0;var remainder=elapsedTime%life;this._startTime=globalTime-remainder,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=deltaTime},Clip.prototype.pause=function(){this._paused=!0},Clip.prototype.resume=function(){this._paused=!1},Clip.prototype.setEasing=function(easing){this.easing=easing,this.easingFunc=isFunction(easing)?easing:easingFuncs$1[easing]||createCubicEasingFunc(easing)},Clip}(),Entry=function(val){this.value=val},LinkedList=function(){function LinkedList(){this._len=0}return LinkedList.prototype.insert=function(val){var entry=new Entry(val);return this.insertEntry(entry),entry},LinkedList.prototype.insertEntry=function(entry){this.head?(this.tail.next=entry,entry.prev=this.tail,entry.next=null,this.tail=entry):this.head=this.tail=entry,this._len++},LinkedList.prototype.remove=function(entry){var prev=entry.prev,next=entry.next;prev?prev.next=next:this.head=next,next?next.prev=prev:this.tail=prev,entry.next=entry.prev=null,this._len--},LinkedList.prototype.len=function(){return this._len},LinkedList.prototype.clear=function(){this.head=this.tail=null,this._len=0},LinkedList}(),LRU=function(){function LRU(maxSize){this._list=new LinkedList,this._maxSize=10,this._map={},this._maxSize=maxSize}return LRU.prototype.put=function(key,value){var list=this._list,map=this._map,removed=null;if(null==map[key]){var len=list.len(),entry=this._lastRemovedEntry;if(len>=this._maxSize&&len>0){var leastUsedEntry=list.head;list.remove(leastUsedEntry),delete map[leastUsedEntry.key],removed=leastUsedEntry.value,this._lastRemovedEntry=leastUsedEntry}entry?entry.value=value:entry=new Entry(value),entry.key=key,list.insertEntry(entry),map[key]=entry}return removed},LRU.prototype.get=function(key){var entry=this._map[key],list=this._list;if(null!=entry)return entry!==list.tail&&(list.remove(entry),list.insertEntry(entry)),entry.value},LRU.prototype.clear=function(){this._list.clear(),this._map={}},LRU.prototype.len=function(){return this._list.len()},LRU}(),LRU$1=LRU,kCSSColorTable={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 clampCssByte(i){return(i=Math.round(i))<0?0:i>255?255:i}function clampCssFloat(f){return f<0?0:f>1?1:f}function parseCssInt(val){var str=val;return str.length&&"%"===str.charAt(str.length-1)?clampCssByte(parseFloat(str)/100*255):clampCssByte(parseInt(str,10))}function parseCssFloat(val){var str=val;return str.length&&"%"===str.charAt(str.length-1)?clampCssFloat(parseFloat(str)/100):clampCssFloat(parseFloat(str))}function cssHueToRgb(m1,m2,h){return h<0?h+=1:h>1&&(h-=1),6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(2/3-h)*6:m1}function lerpNumber(a,b,p){return a+(b-a)*p}function setRgba(out,r,g,b,a){return out[0]=r,out[1]=g,out[2]=b,out[3]=a,out}function copyRgba(out,a){return out[0]=a[0],out[1]=a[1],out[2]=a[2],out[3]=a[3],out}var colorCache=new LRU$1(20),lastRemovedArr=null;function putToCache(colorStr,rgbaArr){lastRemovedArr&&copyRgba(lastRemovedArr,rgbaArr),lastRemovedArr=colorCache.put(colorStr,lastRemovedArr||rgbaArr.slice())}function parse$1(colorStr,rgbaArr){if(colorStr){rgbaArr=rgbaArr||[];var cached=colorCache.get(colorStr);if(cached)return copyRgba(rgbaArr,cached);var str=(colorStr+="").replace(/ /g,"").toLowerCase();if(str in kCSSColorTable)return copyRgba(rgbaArr,kCSSColorTable[str]),putToCache(colorStr,rgbaArr),rgbaArr;var iv,strLen=str.length;if("#"===str.charAt(0))return 4===strLen||5===strLen?(iv=parseInt(str.slice(1,4),16))>=0&&iv<=4095?(setRgba(rgbaArr,(3840&iv)>>4|(3840&iv)>>8,240&iv|(240&iv)>>4,15&iv|(15&iv)<<4,5===strLen?parseInt(str.slice(4),16)/15:1),putToCache(colorStr,rgbaArr),rgbaArr):void setRgba(rgbaArr,0,0,0,1):7===strLen||9===strLen?(iv=parseInt(str.slice(1,7),16))>=0&&iv<=16777215?(setRgba(rgbaArr,(16711680&iv)>>16,(65280&iv)>>8,255&iv,9===strLen?parseInt(str.slice(7),16)/255:1),putToCache(colorStr,rgbaArr),rgbaArr):void setRgba(rgbaArr,0,0,0,1):void 0;var op=str.indexOf("("),ep=str.indexOf(")");if(-1!==op&&ep+1===strLen){var fname=str.substr(0,op),params=str.substr(op+1,ep-(op+1)).split(","),alpha=1;switch(fname){case"rgba":if(4!==params.length)return 3===params.length?setRgba(rgbaArr,+params[0],+params[1],+params[2],1):setRgba(rgbaArr,0,0,0,1);alpha=parseCssFloat(params.pop());case"rgb":return params.length>=3?(setRgba(rgbaArr,parseCssInt(params[0]),parseCssInt(params[1]),parseCssInt(params[2]),3===params.length?alpha:parseCssFloat(params[3])),putToCache(colorStr,rgbaArr),rgbaArr):void setRgba(rgbaArr,0,0,0,1);case"hsla":return 4!==params.length?void setRgba(rgbaArr,0,0,0,1):(params[3]=parseCssFloat(params[3]),hsla2rgba(params,rgbaArr),putToCache(colorStr,rgbaArr),rgbaArr);case"hsl":return 3!==params.length?void setRgba(rgbaArr,0,0,0,1):(hsla2rgba(params,rgbaArr),putToCache(colorStr,rgbaArr),rgbaArr);default:return}}setRgba(rgbaArr,0,0,0,1)}}function hsla2rgba(hsla,rgba){var h=(parseFloat(hsla[0])%360+360)%360/360,s=parseCssFloat(hsla[1]),l=parseCssFloat(hsla[2]),m2=l<=.5?l*(s+1):l+s-l*s,m1=2*l-m2;return setRgba(rgba=rgba||[],clampCssByte(255*cssHueToRgb(m1,m2,h+1/3)),clampCssByte(255*cssHueToRgb(m1,m2,h)),clampCssByte(255*cssHueToRgb(m1,m2,h-1/3)),1),4===hsla.length&&(rgba[3]=hsla[3]),rgba}function lift(color,level){var colorArr=parse$1(color);if(colorArr){for(var i=0;i<3;i++)colorArr[i]=level<0?colorArr[i]*(1-level)|0:(255-colorArr[i])*level+colorArr[i]|0,colorArr[i]>255?colorArr[i]=255:colorArr[i]<0&&(colorArr[i]=0);return stringify$1(colorArr,4===colorArr.length?"rgba":"rgb")}}function fastLerp(normalizedValue,colors,out){if(colors&&colors.length&&normalizedValue>=0&&normalizedValue<=1){out=out||[];var value=normalizedValue*(colors.length-1),leftIndex=Math.floor(value),rightIndex=Math.ceil(value),leftColor=colors[leftIndex],rightColor=colors[rightIndex],dv=value-leftIndex;return out[0]=clampCssByte(lerpNumber(leftColor[0],rightColor[0],dv)),out[1]=clampCssByte(lerpNumber(leftColor[1],rightColor[1],dv)),out[2]=clampCssByte(lerpNumber(leftColor[2],rightColor[2],dv)),out[3]=clampCssFloat(lerpNumber(leftColor[3],rightColor[3],dv)),out}}function modifyHSL(color,h,s,l){var i,colorArr=parse$1(color);if(color)return colorArr=function(rgba){if(rgba){var H,S,R=rgba[0]/255,G=rgba[1]/255,B=rgba[2]/255,vMin=Math.min(R,G,B),vMax=Math.max(R,G,B),delta=vMax-vMin,L=(vMax+vMin)/2;if(0===delta)H=0,S=0;else{S=L<.5?delta/(vMax+vMin):delta/(2-vMax-vMin);var deltaR=((vMax-R)/6+delta/2)/delta,deltaG=((vMax-G)/6+delta/2)/delta,deltaB=((vMax-B)/6+delta/2)/delta;R===vMax?H=deltaB-deltaG:G===vMax?H=1/3+deltaR-deltaB:B===vMax&&(H=2/3+deltaG-deltaR),H<0&&(H+=1),H>1&&(H-=1)}var hsla=[360*H,S,L];return null!=rgba[3]&&hsla.push(rgba[3]),hsla}}(colorArr),null!=h&&(colorArr[0]=(i=h,(i=Math.round(i))<0?0:i>360?360:i)),null!=s&&(colorArr[1]=parseCssFloat(s)),null!=l&&(colorArr[2]=parseCssFloat(l)),stringify$1(hsla2rgba(colorArr),"rgba")}function modifyAlpha(color,alpha){var colorArr=parse$1(color);if(colorArr&&null!=alpha)return colorArr[3]=clampCssFloat(alpha),stringify$1(colorArr,"rgba")}function stringify$1(arrColor,type){if(arrColor&&arrColor.length){var colorStr=arrColor[0]+","+arrColor[1]+","+arrColor[2];return"rgba"!==type&&"hsva"!==type&&"hsla"!==type||(colorStr+=","+arrColor[3]),type+"("+colorStr+")"}}function lum(color,backgroundLum){var arr=parse$1(color);return arr?(.299*arr[0]+.587*arr[1]+.114*arr[2])*arr[3]/255+(1-arr[3])*backgroundLum:0}var liftedColorCache=new LRU$1(100);function liftColor(color){if(isString(color)){var liftedColor=liftedColorCache.get(color);return liftedColor||(liftedColor=lift(color,-.1),liftedColorCache.put(color,liftedColor)),liftedColor}if(isGradientObject(color)){var ret=extend({},color);return ret.colorStops=map$1(color.colorStops,(function(stop){return{offset:stop.offset,color:lift(stop.color,-.1)}})),ret}return color}env$1.hasGlobalWindow&&isFunction(window.btoa);var arraySlice=Array.prototype.slice;function interpolateNumber$1(p0,p1,percent){return(p1-p0)*percent+p0}function interpolate1DArray(out,p0,p1,percent){for(var len=p0.length,i=0;i<len;i++)out[i]=interpolateNumber$1(p0[i],p1[i],percent);return out}function add1DArray(out,p0,p1,sign){for(var len=p0.length,i=0;i<len;i++)out[i]=p0[i]+p1[i]*sign;return out}function add2DArray(out,p0,p1,sign){for(var len=p0.length,len2=len&&p0[0].length,i=0;i<len;i++){out[i]||(out[i]=[]);for(var j=0;j<len2;j++)out[i][j]=p0[i][j]+p1[i][j]*sign}return out}function fillColorStops(val0,val1){for(var len0=val0.length,len1=val1.length,shorterArr=len0>len1?val1:val0,shorterLen=Math.min(len0,len1),last=shorterArr[shorterLen-1]||{color:[0,0,0,0],offset:0},i=shorterLen;i<Math.max(len0,len1);i++)shorterArr.push({offset:last.offset,color:last.color.slice()})}function fillArray(val0,val1,arrDim){var arr0=val0,arr1=val1;if(arr0.push&&arr1.push){var arr0Len=arr0.length,arr1Len=arr1.length;if(arr0Len!==arr1Len)if(arr0Len>arr1Len)arr0.length=arr1Len;else for(var i=arr0Len;i<arr1Len;i++)arr0.push(1===arrDim?arr1[i]:arraySlice.call(arr1[i]));var len2=arr0[0]&&arr0[0].length;for(i=0;i<arr0.length;i++)if(1===arrDim)isNaN(arr0[i])&&(arr0[i]=arr1[i]);else for(var j=0;j<len2;j++)isNaN(arr0[i][j])&&(arr0[i][j]=arr1[i][j])}}function cloneValue(value){if(isArrayLike(value)){var len=value.length;if(isArrayLike(value[0])){for(var ret=[],i=0;i<len;i++)ret.push(arraySlice.call(value[i]));return ret}return arraySlice.call(value)}return value}function rgba2String(rgba){return rgba[0]=Math.floor(rgba[0])||0,rgba[1]=Math.floor(rgba[1])||0,rgba[2]=Math.floor(rgba[2])||0,rgba[3]=null==rgba[3]?1:rgba[3],"rgba("+rgba.join(",")+")"}function isGradientValueType(valType){return 4===valType||5===valType}function isArrayValueType(valType){return 1===valType||2===valType}var tmpRgba=[0,0,0,0],Track=function(){function Track(propName){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=propName}return Track.prototype.isFinished=function(){return this._finished},Track.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},Track.prototype.needsAnimate=function(){return this.keyframes.length>=1},Track.prototype.getAdditiveTrack=function(){return this._additiveTrack},Track.prototype.addKeyframe=function(time,rawValue,easing){this._needsSort=!0;var keyframes=this.keyframes,len=keyframes.length,discrete=!1,valType=6,value=rawValue;if(isArrayLike(rawValue)){var arrayDim=function(value){return isArrayLike(value&&value[0])?2:1}(rawValue);valType=arrayDim,(1===arrayDim&&!isNumber(rawValue[0])||2===arrayDim&&!isNumber(rawValue[0][0]))&&(discrete=!0)}else if(isNumber(rawValue)&&!eqNaN(rawValue))valType=0;else if(isString(rawValue))if(isNaN(+rawValue)){var colorArray=parse$1(rawValue);colorArray&&(value=colorArray,valType=3)}else valType=0;else if(isGradientObject(rawValue)){var parsedGradient=extend({},value);parsedGradient.colorStops=map$1(rawValue.colorStops,(function(colorStop){return{offset:colorStop.offset,color:parse$1(colorStop.color)}})),"linear"===rawValue.type?valType=4:function(val){return"radial"===val.type}(rawValue)&&(valType=5),value=parsedGradient}0===len?this.valType=valType:valType===this.valType&&6!==valType||(discrete=!0),this.discrete=this.discrete||discrete;var kf={time:time,value:value,rawValue:rawValue,percent:0};return easing&&(kf.easing=easing,kf.easingFunc=isFunction(easing)?easing:easingFuncs$1[easing]||createCubicEasingFunc(easing)),keyframes.push(kf),kf},Track.prototype.prepare=function(maxTime,additiveTrack){var kfs=this.keyframes;this._needsSort&&kfs.sort((function(a,b){return a.time-b.time}));for(var valType=this.valType,kfsLen=kfs.length,lastKf=kfs[kfsLen-1],isDiscrete=this.discrete,isArr=isArrayValueType(valType),isGradient=isGradientValueType(valType),i=0;i<kfsLen;i++){var kf=kfs[i],value=kf.value,lastValue=lastKf.value;kf.percent=kf.time/maxTime,isDiscrete||(isArr&&i!==kfsLen-1?fillArray(value,lastValue,valType):isGradient&&fillColorStops(value.colorStops,lastValue.colorStops))}if(!isDiscrete&&5!==valType&&additiveTrack&&this.needsAnimate()&&additiveTrack.needsAnimate()&&valType===additiveTrack.valType&&!additiveTrack._finished){this._additiveTrack=additiveTrack;var startValue=kfs[0].value;for(i=0;i<kfsLen;i++)0===valType?kfs[i].additiveValue=kfs[i].value-startValue:3===valType?kfs[i].additiveValue=add1DArray([],kfs[i].value,startValue,-1):isArrayValueType(valType)&&(kfs[i].additiveValue=1===valType?add1DArray([],kfs[i].value,startValue,-1):add2DArray([],kfs[i].value,startValue,-1))}},Track.prototype.step=function(target,percent){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var frameIdx,frame,nextFrame,isAdditive=null!=this._additiveTrack,valueKey=isAdditive?"additiveValue":"value",valType=this.valType,keyframes=this.keyframes,kfsNum=keyframes.length,propName=this.propName,isValueColor=3===valType,lastFrame=this._lastFr,mathMin=Math.min;if(1===kfsNum)frame=nextFrame=keyframes[0];else{if(percent<0)frameIdx=0;else if(percent<this._lastFrP){for(frameIdx=mathMin(lastFrame+1,kfsNum-1);frameIdx>=0&&!(keyframes[frameIdx].percent<=percent);frameIdx--);frameIdx=mathMin(frameIdx,kfsNum-2)}else{for(frameIdx=lastFrame;frameIdx<kfsNum&&!(keyframes[frameIdx].percent>percent);frameIdx++);frameIdx=mathMin(frameIdx-1,kfsNum-2)}nextFrame=keyframes[frameIdx+1],frame=keyframes[frameIdx]}if(frame&&nextFrame){this._lastFr=frameIdx,this._lastFrP=percent;var interval=nextFrame.percent-frame.percent,w=0===interval?1:mathMin((percent-frame.percent)/interval,1);nextFrame.easingFunc&&(w=nextFrame.easingFunc(w));var targetArr=isAdditive?this._additiveValue:isValueColor?tmpRgba:target[propName];if(!isArrayValueType(valType)&&!isValueColor||targetArr||(targetArr=this._additiveValue=[]),this.discrete)target[propName]=w<1?frame.rawValue:nextFrame.rawValue;else if(isArrayValueType(valType))1===valType?interpolate1DArray(targetArr,frame[valueKey],nextFrame[valueKey],w):function(out,p0,p1,percent){for(var len=p0.length,len2=len&&p0[0].length,i=0;i<len;i++){out[i]||(out[i]=[]);for(var j=0;j<len2;j++)out[i][j]=interpolateNumber$1(p0[i][j],p1[i][j],percent)}}(targetArr,frame[valueKey],nextFrame[valueKey],w);else if(isGradientValueType(valType)){var val=frame[valueKey],nextVal_1=nextFrame[valueKey],isLinearGradient_1=4===valType;target[propName]={type:isLinearGradient_1?"linear":"radial",x:interpolateNumber$1(val.x,nextVal_1.x,w),y:interpolateNumber$1(val.y,nextVal_1.y,w),colorStops:map$1(val.colorStops,(function(colorStop,idx){var nextColorStop=nextVal_1.colorStops[idx];return{offset:interpolateNumber$1(colorStop.offset,nextColorStop.offset,w),color:rgba2String(interpolate1DArray([],colorStop.color,nextColorStop.color,w))}})),global:nextVal_1.global},isLinearGradient_1?(target[propName].x2=interpolateNumber$1(val.x2,nextVal_1.x2,w),target[propName].y2=interpolateNumber$1(val.y2,nextVal_1.y2,w)):target[propName].r=interpolateNumber$1(val.r,nextVal_1.r,w)}else if(isValueColor)interpolate1DArray(targetArr,frame[valueKey],nextFrame[valueKey],w),isAdditive||(target[propName]=rgba2String(targetArr));else{var value=interpolateNumber$1(frame[valueKey],nextFrame[valueKey],w);isAdditive?this._additiveValue=value:target[propName]=value}isAdditive&&this._addToTarget(target)}}},Track.prototype._addToTarget=function(target){var valType=this.valType,propName=this.propName,additiveValue=this._additiveValue;0===valType?target[propName]=target[propName]+additiveValue:3===valType?(parse$1(target[propName],tmpRgba),add1DArray(tmpRgba,tmpRgba,additiveValue,1),target[propName]=rgba2String(tmpRgba)):1===valType?add1DArray(target[propName],target[propName],additiveValue,1):2===valType&&add2DArray(target[propName],target[propName],additiveValue,1)},Track}(),Animator=function(){function Animator(target,loop,allowDiscreteAnimation,additiveTo){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=target,this._loop=loop,loop&&additiveTo?logError("Can' use additive animation on looped animation."):(this._additiveAnimators=additiveTo,this._allowDiscrete=allowDiscreteAnimation)}return Animator.prototype.getMaxTime=function(){return this._maxTime},Animator.prototype.getDelay=function(){return this._delay},Animator.prototype.getLoop=function(){return this._loop},Animator.prototype.getTarget=function(){return this._target},Animator.prototype.changeTarget=function(target){this._target=target},Animator.prototype.when=function(time,props,easing){return this.whenWithKeys(time,props,keys$1(props),easing)},Animator.prototype.whenWithKeys=function(time,props,propNames,easing){for(var tracks=this._tracks,i=0;i<propNames.length;i++){var propName=propNames[i],track=tracks[propName];if(!track){track=tracks[propName]=new Track(propName);var initialValue=void 0,additiveTrack=this._getAdditiveTrack(propName);if(additiveTrack){var addtiveTrackKfs=additiveTrack.keyframes,lastFinalKf=addtiveTrackKfs[addtiveTrackKfs.length-1];initialValue=lastFinalKf&&lastFinalKf.value,3===additiveTrack.valType&&initialValue&&(initialValue=rgba2String(initialValue))}else initialValue=this._target[propName];if(null==initialValue)continue;time>0&&track.addKeyframe(0,cloneValue(initialValue),easing),this._trackKeys.push(propName)}track.addKeyframe(time,cloneValue(props[propName]),easing)}return this._maxTime=Math.max(this._maxTime,time),this},Animator.prototype.pause=function(){this._clip.pause(),this._paused=!0},Animator.prototype.resume=function(){this._clip.resume(),this._paused=!1},Animator.prototype.isPaused=function(){return!!this._paused},Animator.prototype.duration=function(duration){return this._maxTime=duration,this._force=!0,this},Animator.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var doneList=this._doneCbs;if(doneList)for(var len=doneList.length,i=0;i<len;i++)doneList[i].call(this)},Animator.prototype._abortedCallback=function(){this._setTracksFinished();var animation=this.animation,abortedList=this._abortedCbs;if(animation&&animation.removeClip(this._clip),this._clip=null,abortedList)for(var i=0;i<abortedList.length;i++)abortedList[i].call(this)},Animator.prototype._setTracksFinished=function(){for(var tracks=this._tracks,tracksKeys=this._trackKeys,i=0;i<tracksKeys.length;i++)tracks[tracksKeys[i]].setFinished()},Animator.prototype._getAdditiveTrack=function(trackName){var additiveTrack,additiveAnimators=this._additiveAnimators;if(additiveAnimators)for(var i=0;i<additiveAnimators.length;i++){var track=additiveAnimators[i].getTrack(trackName);track&&(additiveTrack=track)}return additiveTrack},Animator.prototype.start=function(easing){if(!(this._started>0)){this._started=1;for(var self=this,tracks=[],maxTime=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var propName=this._trackKeys[i],track=this._tracks[propName],additiveTrack=this._getAdditiveTrack(propName),kfs=track.keyframes,kfsNum=kfs.length;if(track.prepare(maxTime,additiveTrack),track.needsAnimate())if(!this._allowDiscrete&&track.discrete){var lastKf=kfs[kfsNum-1];lastKf&&(self._target[track.propName]=lastKf.rawValue),track.setFinished()}else tracks.push(track)}if(tracks.length||this._force){var clip=new Clip$1({life:maxTime,loop:this._loop,delay:this._delay||0,onframe:function(percent){self._started=2;var additiveAnimators=self._additiveAnimators;if(additiveAnimators){for(var stillHasAdditiveAnimator=!1,i=0;i<additiveAnimators.length;i++)if(additiveAnimators[i]._clip){stillHasAdditiveAnimator=!0;break}stillHasAdditiveAnimator||(self._additiveAnimators=null)}for(i=0;i<tracks.length;i++)tracks[i].step(self._target,percent);var onframeList=self._onframeCbs;if(onframeList)for(i=0;i<onframeList.length;i++)onframeList[i](self._target,percent)},ondestroy:function(){self._doneCallback()}});this._clip=clip,this.animation&&this.animation.addClip(clip),easing&&clip.setEasing(easing)}else this._doneCallback();return this}},Animator.prototype.stop=function(forwardToLast){if(this._clip){var clip=this._clip;forwardToLast&&clip.onframe(1),this._abortedCallback()}},Animator.prototype.delay=function(time){return this._delay=time,this},Animator.prototype.during=function(cb){return cb&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(cb)),this},Animator.prototype.done=function(cb){return cb&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(cb)),this},Animator.prototype.aborted=function(cb){return cb&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(cb)),this},Animator.prototype.getClip=function(){return this._clip},Animator.prototype.getTrack=function(propName){return this._tracks[propName]},Animator.prototype.getTracks=function(){var _this=this;return map$1(this._trackKeys,(function(key){return _this._tracks[key]}))},Animator.prototype.stopTracks=function(propNames,forwardToLast){if(!propNames.length||!this._clip)return!0;for(var tracks=this._tracks,tracksKeys=this._trackKeys,i=0;i<propNames.length;i++){var track=tracks[propNames[i]];track&&!track.isFinished()&&(forwardToLast?track.step(this._target,1):1===this._started&&track.step(this._target,0),track.setFinished())}var allAborted=!0;for(i=0;i<tracksKeys.length;i++)if(!tracks[tracksKeys[i]].isFinished()){allAborted=!1;break}return allAborted&&this._abortedCallback(),allAborted},Animator.prototype.saveTo=function(target,trackKeys,firstOrLast){if(target){trackKeys=trackKeys||this._trackKeys;for(var i=0;i<trackKeys.length;i++){var propName=trackKeys[i],track=this._tracks[propName];if(track&&!track.isFinished()){var kfs=track.keyframes,kf=kfs[firstOrLast?0:kfs.length-1];kf&&(target[propName]=cloneValue(kf.rawValue))}}}},Animator.prototype.__changeFinalValue=function(finalProps,trackKeys){trackKeys=trackKeys||keys$1(finalProps);for(var i=0;i<trackKeys.length;i++){var propName=trackKeys[i],track=this._tracks[propName];if(track){var kfs=track.keyframes;if(kfs.length>1){var lastKf=kfs.pop();track.addKeyframe(lastKf.time,finalProps[propName]),track.prepare(this._maxTime,track.getAdditiveTrack())}}}},Animator}(),Animator$1=Animator;function getTime(){return(new Date).getTime()}var mouseHandlerNames,pointerEventNameMap,Animation=function(_super){function Animation(opts){var _this=_super.call(this)||this;return _this._running=!1,_this._time=0,_this._pausedTime=0,_this._pauseStart=0,_this._paused=!1,opts=opts||{},_this.stage=opts.stage||{},_this}return __extends(Animation,_super),Animation.prototype.addClip=function(clip){clip.animation&&this.removeClip(clip),this._head?(this._tail.next=clip,clip.prev=this._tail,clip.next=null,this._tail=clip):this._head=this._tail=clip,clip.animation=this},Animation.prototype.addAnimator=function(animator){animator.animation=this;var clip=animator.getClip();clip&&this.addClip(clip)},Animation.prototype.removeClip=function(clip){if(clip.animation){var prev=clip.prev,next=clip.next;prev?prev.next=next:this._head=next,next?next.prev=prev:this._tail=prev,clip.next=clip.prev=clip.animation=null}},Animation.prototype.removeAnimator=function(animator){var clip=animator.getClip();clip&&this.removeClip(clip),animator.animation=null},Animation.prototype.update=function(notTriggerFrameAndStageUpdate){for(var time=getTime()-this._pausedTime,delta=time-this._time,clip=this._head;clip;){var nextClip=clip.next;clip.step(time,delta)?(clip.ondestroy(),this.removeClip(clip),clip=nextClip):clip=nextClip}this._time=time,notTriggerFrameAndStageUpdate||(this.trigger("frame",delta),this.stage.update&&this.stage.update())},Animation.prototype._startLoop=function(){var self=this;this._running=!0,requestAnimationFrame$3((function step(){self._running&&(requestAnimationFrame$3(step),!self._paused&&self.update())}))},Animation.prototype.start=function(){this._running||(this._time=getTime(),this._pausedTime=0,this._startLoop())},Animation.prototype.stop=function(){this._running=!1},Animation.prototype.pause=function(){this._paused||(this._pauseStart=getTime(),this._paused=!0)},Animation.prototype.resume=function(){this._paused&&(this._pausedTime+=getTime()-this._pauseStart,this._paused=!1)},Animation.prototype.clear=function(){for(var clip=this._head;clip;){var nextClip=clip.next;clip.prev=clip.next=clip.animation=null,clip=nextClip}this._head=this._tail=null},Animation.prototype.isFinished=function(){return null==this._head},Animation.prototype.animate=function(target,options){options=options||{},this.start();var animator=new Animator$1(target,options.loop);return this.addAnimator(animator),animator},Animation}(Eventful$1),Animation$1=Animation,globalEventSupported=env$1.domSupported,localNativeListenerNames=(pointerEventNameMap={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:mouseHandlerNames=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:map$1(mouseHandlerNames,(function(name){var nm=name.replace("mouse","pointer");return pointerEventNameMap.hasOwnProperty(nm)?nm:name}))}),globalNativeListenerNames_mouse=["mousemove","mouseup"],globalNativeListenerNames_pointer=["pointermove","pointerup"],wheelEventSupported=!1;function isPointerFromTouch(event){var pointerType=event.pointerType;return"pen"===pointerType||"touch"===pointerType}function markTouch(event){event&&(event.zrByTouch=!0)}function isLocalEl(instance,el){for(var elTmp=el,isLocal=!1;elTmp&&9!==elTmp.nodeType&&!(isLocal=elTmp.domBelongToZr||elTmp!==el&&elTmp===instance.painterRoot);)elTmp=elTmp.parentNode;return isLocal}var FakeGlobalEvent=function(instance,event){this.stopPropagation=noop$1,this.stopImmediatePropagation=noop$1,this.preventDefault=noop$1,this.type=event.type,this.target=this.currentTarget=instance.dom,this.pointerType=event.pointerType,this.clientX=event.clientX,this.clientY=event.clientY},localDOMHandlers={mousedown:function(event){event=normalizeEvent(this.dom,event),this.__mayPointerCapture=[event.zrX,event.zrY],this.trigger("mousedown",event)},mousemove:function(event){event=normalizeEvent(this.dom,event);var downPoint=this.__mayPointerCapture;!downPoint||event.zrX===downPoint[0]&&event.zrY===downPoint[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",event)},mouseup:function(event){event=normalizeEvent(this.dom,event),this.__togglePointerCapture(!1),this.trigger("mouseup",event)},mouseout:function(event){isLocalEl(this,(event=normalizeEvent(this.dom,event)).toElement||event.relatedTarget)||(this.__pointerCapturing&&(event.zrEventControl="no_globalout"),this.trigger("mouseout",event))},wheel:function(event){wheelEventSupported=!0,event=normalizeEvent(this.dom,event),this.trigger("mousewheel",event)},mousewheel:function(event){wheelEventSupported||(event=normalizeEvent(this.dom,event),this.trigger("mousewheel",event))},touchstart:function(event){markTouch(event=normalizeEvent(this.dom,event)),this.__lastTouchMoment=new Date,this.handler.processGesture(event,"start"),localDOMHandlers.mousemove.call(this,event),localDOMHandlers.mousedown.call(this,event)},touchmove:function(event){markTouch(event=normalizeEvent(this.dom,event)),this.handler.processGesture(event,"change"),localDOMHandlers.mousemove.call(this,event)},touchend:function(event){markTouch(event=normalizeEvent(this.dom,event)),this.handler.processGesture(event,"end"),localDOMHandlers.mouseup.call(this,event),+new Date-+this.__lastTouchMoment<300&&localDOMHandlers.click.call(this,event)},pointerdown:function(event){localDOMHandlers.mousedown.call(this,event)},pointermove:function(event){isPointerFromTouch(event)||localDOMHandlers.mousemove.call(this,event)},pointerup:function(event){localDOMHandlers.mouseup.call(this,event)},pointerout:function(event){isPointerFromTouch(event)||localDOMHandlers.mouseout.call(this,event)}};each$b(["click","dblclick","contextmenu"],(function(name){localDOMHandlers[name]=function(event){event=normalizeEvent(this.dom,event),this.trigger(name,event)}}));var globalDOMHandlers={pointermove:function(event){isPointerFromTouch(event)||globalDOMHandlers.mousemove.call(this,event)},pointerup:function(event){globalDOMHandlers.mouseup.call(this,event)},mousemove:function(event){this.trigger("mousemove",event)},mouseup:function(event){var pointerCaptureReleasing=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",event),pointerCaptureReleasing&&(event.zrEventControl="only_globalout",this.trigger("mouseout",event))}};function mountLocalDOMEventListeners(instance,scope){var domHandlers=scope.domHandlers;env$1.pointerEventsSupported?each$b(localNativeListenerNames.pointer,(function(nativeEventName){mountSingleDOMEventListener(scope,nativeEventName,(function(event){domHandlers[nativeEventName].call(instance,event)}))})):(env$1.touchEventsSupported&&each$b(localNativeListenerNames.touch,(function(nativeEventName){mountSingleDOMEventListener(scope,nativeEventName,(function(event){domHandlers[nativeEventName].call(instance,event),function(scope){scope.touching=!0,null!=scope.touchTimer&&(clearTimeout(scope.touchTimer),scope.touchTimer=null),scope.touchTimer=setTimeout((function(){scope.touching=!1,scope.touchTimer=null}),700)}(scope)}))})),each$b(localNativeListenerNames.mouse,(function(nativeEventName){mountSingleDOMEventListener(scope,nativeEventName,(function(event){event=getNativeEvent(event),scope.touching||domHandlers[nativeEventName].call(instance,event)}))})))}function mountGlobalDOMEventListeners(instance,scope){function mount(nativeEventName){mountSingleDOMEventListener(scope,nativeEventName,(function(event){event=getNativeEvent(event),isLocalEl(instance,event.target)||(event=function(instance,event){return normalizeEvent(instance.dom,new FakeGlobalEvent(instance,event),!0)}(instance,event),scope.domHandlers[nativeEventName].call(instance,event))}),{capture:!0})}env$1.pointerEventsSupported?each$b(globalNativeListenerNames_pointer,mount):env$1.touchEventsSupported||each$b(globalNativeListenerNames_mouse,mount)}function mountSingleDOMEventListener(scope,nativeEventName,listener,opt){scope.mounted[nativeEventName]=listener,scope.listenerOpts[nativeEventName]=opt,addEventListener(scope.domTarget,nativeEventName,listener,opt)}function unmountDOMEventListeners(scope){var el,name,handler,opt,mounted=scope.mounted;for(var nativeEventName in mounted)mounted.hasOwnProperty(nativeEventName)&&(el=scope.domTarget,name=nativeEventName,handler=mounted[nativeEventName],opt=scope.listenerOpts[nativeEventName],el.removeEventListener(name,handler,opt));scope.mounted={}}var DOMHandlerScope=function(domTarget,domHandlers){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=domTarget,this.domHandlers=domHandlers},HandlerProxy=function(_super){function HandlerDomProxy(dom,painterRoot){var _this=_super.call(this)||this;return _this.__pointerCapturing=!1,_this.dom=dom,_this.painterRoot=painterRoot,_this._localHandlerScope=new DOMHandlerScope(dom,localDOMHandlers),globalEventSupported&&(_this._globalHandlerScope=new DOMHandlerScope(document,globalDOMHandlers)),mountLocalDOMEventListeners(_this,_this._localHandlerScope),_this}return __extends(HandlerDomProxy,_super),HandlerDomProxy.prototype.dispose=function(){unmountDOMEventListeners(this._localHandlerScope),globalEventSupported&&unmountDOMEventListeners(this._globalHandlerScope)},HandlerDomProxy.prototype.setCursor=function(cursorStyle){this.dom.style&&(this.dom.style.cursor=cursorStyle||"default")},HandlerDomProxy.prototype.__togglePointerCapture=function(isPointerCapturing){if(this.__mayPointerCapture=null,globalEventSupported&&+this.__pointerCapturing^+isPointerCapturing){this.__pointerCapturing=isPointerCapturing;var globalHandlerScope=this._globalHandlerScope;isPointerCapturing?mountGlobalDOMEventListeners(this,globalHandlerScope):unmountDOMEventListeners(globalHandlerScope)}},HandlerDomProxy}(Eventful$1),dpr=1;env$1.hasGlobalWindow&&(dpr=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var devicePixelRatio=dpr,mIdentity=identity;function isNotAroundZero(val){return val>5e-5||val<-5e-5}var scaleTmp=[],tmpTransform=[],originTransform=[1,0,0,1,0,0],abs=Math.abs,Transformable=function(){function Transformable(){}return Transformable.prototype.getLocalTransform=function(m){return Transformable.getLocalTransform(this,m)},Transformable.prototype.setPosition=function(arr){this.x=arr[0],this.y=arr[1]},Transformable.prototype.setScale=function(arr){this.scaleX=arr[0],this.scaleY=arr[1]},Transformable.prototype.setSkew=function(arr){this.skewX=arr[0],this.skewY=arr[1]},Transformable.prototype.setOrigin=function(arr){this.originX=arr[0],this.originY=arr[1]},Transformable.prototype.needLocalTransform=function(){return isNotAroundZero(this.rotation)||isNotAroundZero(this.x)||isNotAroundZero(this.y)||isNotAroundZero(this.scaleX-1)||isNotAroundZero(this.scaleY-1)||isNotAroundZero(this.skewX)||isNotAroundZero(this.skewY)},Transformable.prototype.updateTransform=function(){var parentTransform=this.parent&&this.parent.transform,needLocalTransform=this.needLocalTransform(),m=this.transform;needLocalTransform||parentTransform?(m=m||[1,0,0,1,0,0],needLocalTransform?this.getLocalTransform(m):mIdentity(m),parentTransform&&(needLocalTransform?mul(m,parentTransform,m):copy(m,parentTransform)),this.transform=m,this._resolveGlobalScaleRatio(m)):m&&(mIdentity(m),this.invTransform=null)},Transformable.prototype._resolveGlobalScaleRatio=function(m){var globalScaleRatio=this.globalScaleRatio;if(null!=globalScaleRatio&&1!==globalScaleRatio){this.getGlobalScale(scaleTmp);var relX=scaleTmp[0]<0?-1:1,relY=scaleTmp[1]<0?-1:1,sx=((scaleTmp[0]-relX)*globalScaleRatio+relX)/scaleTmp[0]||0,sy=((scaleTmp[1]-relY)*globalScaleRatio+relY)/scaleTmp[1]||0;m[0]*=sx,m[1]*=sx,m[2]*=sy,m[3]*=sy}this.invTransform=this.invTransform||[1,0,0,1,0,0],invert(this.invTransform,m)},Transformable.prototype.getComputedTransform=function(){for(var transformNode=this,ancestors=[];transformNode;)ancestors.push(transformNode),transformNode=transformNode.parent;for(;transformNode=ancestors.pop();)transformNode.updateTransform();return this.transform},Transformable.prototype.setLocalTransform=function(m){if(m){var sx=m[0]*m[0]+m[1]*m[1],sy=m[2]*m[2]+m[3]*m[3],rotation=Math.atan2(m[1],m[0]),shearX=Math.PI/2+rotation-Math.atan2(m[3],m[2]);sy=Math.sqrt(sy)*Math.cos(shearX),sx=Math.sqrt(sx),this.skewX=shearX,this.skewY=0,this.rotation=-rotation,this.x=+m[4],this.y=+m[5],this.scaleX=sx,this.scaleY=sy,this.originX=0,this.originY=0}},Transformable.prototype.decomposeTransform=function(){if(this.transform){var parent=this.parent,m=this.transform;parent&&parent.transform&&(parent.invTransform=parent.invTransform||[1,0,0,1,0,0],mul(tmpTransform,parent.invTransform,m),m=tmpTransform);var ox=this.originX,oy=this.originY;(ox||oy)&&(originTransform[4]=ox,originTransform[5]=oy,mul(tmpTransform,m,originTransform),tmpTransform[4]-=ox,tmpTransform[5]-=oy,m=tmpTransform),this.setLocalTransform(m)}},Transformable.prototype.getGlobalScale=function(out){var m=this.transform;return out=out||[],m?(out[0]=Math.sqrt(m[0]*m[0]+m[1]*m[1]),out[1]=Math.sqrt(m[2]*m[2]+m[3]*m[3]),m[0]<0&&(out[0]=-out[0]),m[3]<0&&(out[1]=-out[1]),out):(out[0]=1,out[1]=1,out)},Transformable.prototype.transformCoordToLocal=function(x,y){var v2=[x,y],invTransform=this.invTransform;return invTransform&&applyTransform$1(v2,v2,invTransform),v2},Transformable.prototype.transformCoordToGlobal=function(x,y){var v2=[x,y],transform=this.transform;return transform&&applyTransform$1(v2,v2,transform),v2},Transformable.prototype.getLineScale=function(){var m=this.transform;return m&&abs(m[0]-1)>1e-10&&abs(m[3]-1)>1e-10?Math.sqrt(abs(m[0]*m[3]-m[2]*m[1])):1},Transformable.prototype.copyTransform=function(source){!function(target,source){for(var i=0;i<TRANSFORMABLE_PROPS.length;i++){var propName=TRANSFORMABLE_PROPS[i];target[propName]=source[propName]}}(this,source)},Transformable.getLocalTransform=function(target,m){m=m||[];var ox=target.originX||0,oy=target.originY||0,sx=target.scaleX,sy=target.scaleY,ax=target.anchorX,ay=target.anchorY,rotation=target.rotation||0,x=target.x,y=target.y,skewX=target.skewX?Math.tan(target.skewX):0,skewY=target.skewY?Math.tan(-target.skewY):0;if(ox||oy||ax||ay){var dx=ox+ax,dy=oy+ay;m[4]=-dx*sx-skewX*dy*sy,m[5]=-dy*sy-skewY*dx*sx}else m[4]=m[5]=0;return m[0]=sx,m[3]=sy,m[1]=skewY*sx,m[2]=skewX*sy,rotation&&rotate(m,m,rotation),m[4]+=ox+x,m[5]+=oy+y,m},Transformable.initDefaultProps=function(){var proto=Transformable.prototype;proto.scaleX=proto.scaleY=proto.globalScaleRatio=1,proto.x=proto.y=proto.originX=proto.originY=proto.skewX=proto.skewY=proto.rotation=proto.anchorX=proto.anchorY=0}(),Transformable}(),TRANSFORMABLE_PROPS=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];var Transformable$1=Transformable,textWidthCache={};function getWidth(text,font){var cacheOfFont=textWidthCache[font=font||DEFAULT_FONT];cacheOfFont||(cacheOfFont=textWidthCache[font]=new LRU$1(500));var width=cacheOfFont.get(text);return null==width&&(width=platformApi.measureText(text,font).width,cacheOfFont.put(text,width)),width}function innerGetBoundingRect(text,font,textAlign,textBaseline){var width=getWidth(text,font),height=getLineHeight(font),x=adjustTextX(0,width,textAlign),y=adjustTextY(0,height,textBaseline);return new BoundingRect$1(x,y,width,height)}function getBoundingRect(text,font,textAlign,textBaseline){var textLines=((text||"")+"").split("\n");if(1===textLines.length)return innerGetBoundingRect(textLines[0],font,textAlign,textBaseline);for(var uniondRect=new BoundingRect$1(0,0,0,0),i=0;i<textLines.length;i++){var rect=innerGetBoundingRect(textLines[i],font,textAlign,textBaseline);0===i?uniondRect.copy(rect):uniondRect.union(rect)}return uniondRect}function adjustTextX(x,width,textAlign){return"right"===textAlign?x-=width:"center"===textAlign&&(x-=width/2),x}function adjustTextY(y,height,verticalAlign){return"middle"===verticalAlign?y-=height/2:"bottom"===verticalAlign&&(y-=height),y}function getLineHeight(font){return getWidth("国",font)}function parsePercent$1(value,maxValue){return"string"==typeof value?value.lastIndexOf("%")>=0?parseFloat(value)/100*maxValue:parseFloat(value):value}function calculateTextPosition(out,opts,rect){var textPosition=opts.position||"inside",distance=null!=opts.distance?opts.distance:5,height=rect.height,width=rect.width,halfHeight=height/2,x=rect.x,y=rect.y,textAlign="left",textVerticalAlign="top";if(textPosition instanceof Array)x+=parsePercent$1(textPosition[0],rect.width),y+=parsePercent$1(textPosition[1],rect.height),textAlign=null,textVerticalAlign=null;else switch(textPosition){case"left":x-=distance,y+=halfHeight,textAlign="right",textVerticalAlign="middle";break;case"right":x+=distance+width,y+=halfHeight,textVerticalAlign="middle";break;case"top":x+=width/2,y-=distance,textAlign="center",textVerticalAlign="bottom";break;case"bottom":x+=width/2,y+=height+distance,textAlign="center";break;case"inside":x+=width/2,y+=halfHeight,textAlign="center",textVerticalAlign="middle";break;case"insideLeft":x+=distance,y+=halfHeight,textVerticalAlign="middle";break;case"insideRight":x+=width-distance,y+=halfHeight,textAlign="right",textVerticalAlign="middle";break;case"insideTop":x+=width/2,y+=distance,textAlign="center";break;case"insideBottom":x+=width/2,y+=height-distance,textAlign="center",textVerticalAlign="bottom";break;case"insideTopLeft":x+=distance,y+=distance;break;case"insideTopRight":x+=width-distance,y+=distance,textAlign="right";break;case"insideBottomLeft":x+=distance,y+=height-distance,textVerticalAlign="bottom";break;case"insideBottomRight":x+=width-distance,y+=height-distance,textAlign="right",textVerticalAlign="bottom"}return(out=out||{}).x=x,out.y=y,out.align=textAlign,out.verticalAlign=textVerticalAlign,out}var PRIMARY_STATES_KEYS$1=TRANSFORMABLE_PROPS.concat(["ignore"]),DEFAULT_ANIMATABLE_MAP=reduce(TRANSFORMABLE_PROPS,(function(obj,key){return obj[key]=!0,obj}),{ignore:!1}),tmpTextPosCalcRes={},tmpBoundingRect=new BoundingRect$1(0,0,0,0),Element=function(){function Element(props){this.id=guid(),this.animators=[],this.currentStates=[],this.states={},this._init(props)}return Element.prototype._init=function(props){this.attr(props)},Element.prototype.drift=function(dx,dy,e){switch(this.draggable){case"horizontal":dy=0;break;case"vertical":dx=0}var m=this.transform;m||(m=this.transform=[1,0,0,1,0,0]),m[4]+=dx,m[5]+=dy,this.decomposeTransform(),this.markRedraw()},Element.prototype.beforeUpdate=function(){},Element.prototype.afterUpdate=function(){},Element.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},Element.prototype.updateInnerText=function(forceUpdate){var textEl=this._textContent;if(textEl&&(!textEl.ignore||forceUpdate)){this.textConfig||(this.textConfig={});var textConfig=this.textConfig,isLocal=textConfig.local,innerTransformable=textEl.innerTransformable,textAlign=void 0,textVerticalAlign=void 0,textStyleChanged=!1;innerTransformable.parent=isLocal?this:null;var innerOrigin=!1;if(innerTransformable.copyTransform(textEl),null!=textConfig.position){var layoutRect=tmpBoundingRect;textConfig.layoutRect?layoutRect.copy(textConfig.layoutRect):layoutRect.copy(this.getBoundingRect()),isLocal||layoutRect.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(tmpTextPosCalcRes,textConfig,layoutRect):calculateTextPosition(tmpTextPosCalcRes,textConfig,layoutRect),innerTransformable.x=tmpTextPosCalcRes.x,innerTransformable.y=tmpTextPosCalcRes.y,textAlign=tmpTextPosCalcRes.align,textVerticalAlign=tmpTextPosCalcRes.verticalAlign;var textOrigin=textConfig.origin;if(textOrigin&&null!=textConfig.rotation){var relOriginX=void 0,relOriginY=void 0;"center"===textOrigin?(relOriginX=.5*layoutRect.width,relOriginY=.5*layoutRect.height):(relOriginX=parsePercent$1(textOrigin[0],layoutRect.width),relOriginY=parsePercent$1(textOrigin[1],layoutRect.height)),innerOrigin=!0,innerTransformable.originX=-innerTransformable.x+relOriginX+(isLocal?0:layoutRect.x),innerTransformable.originY=-innerTransformable.y+relOriginY+(isLocal?0:layoutRect.y)}}null!=textConfig.rotation&&(innerTransformable.rotation=textConfig.rotation);var textOffset=textConfig.offset;textOffset&&(innerTransformable.x+=textOffset[0],innerTransformable.y+=textOffset[1],innerOrigin||(innerTransformable.originX=-textOffset[0],innerTransformable.originY=-textOffset[1]));var isInside=null==textConfig.inside?"string"==typeof textConfig.position&&textConfig.position.indexOf("inside")>=0:textConfig.inside,innerTextDefaultStyle=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),textFill=void 0,textStroke=void 0,autoStroke=void 0;isInside&&this.canBeInsideText()?(textFill=textConfig.insideFill,textStroke=textConfig.insideStroke,null!=textFill&&"auto"!==textFill||(textFill=this.getInsideTextFill()),null!=textStroke&&"auto"!==textStroke||(textStroke=this.getInsideTextStroke(textFill),autoStroke=!0)):(textFill=textConfig.outsideFill,textStroke=textConfig.outsideStroke,null!=textFill&&"auto"!==textFill||(textFill=this.getOutsideFill()),null!=textStroke&&"auto"!==textStroke||(textStroke=this.getOutsideStroke(textFill),autoStroke=!0)),(textFill=textFill||"#000")===innerTextDefaultStyle.fill&&textStroke===innerTextDefaultStyle.stroke&&autoStroke===innerTextDefaultStyle.autoStroke&&textAlign===innerTextDefaultStyle.align&&textVerticalAlign===innerTextDefaultStyle.verticalAlign||(textStyleChanged=!0,innerTextDefaultStyle.fill=textFill,innerTextDefaultStyle.stroke=textStroke,innerTextDefaultStyle.autoStroke=autoStroke,innerTextDefaultStyle.align=textAlign,innerTextDefaultStyle.verticalAlign=textVerticalAlign,textEl.setDefaultTextStyle(innerTextDefaultStyle)),textEl.__dirty|=1,textStyleChanged&&textEl.dirtyStyle(!0)}},Element.prototype.canBeInsideText=function(){return!0},Element.prototype.getInsideTextFill=function(){return"#fff"},Element.prototype.getInsideTextStroke=function(textFill){return"#000"},Element.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?"#ccc":"#333"},Element.prototype.getOutsideStroke=function(textFill){var backgroundColor=this.__zr&&this.__zr.getBackgroundColor(),colorArr="string"==typeof backgroundColor&&parse$1(backgroundColor);colorArr||(colorArr=[255,255,255,1]);for(var alpha=colorArr[3],isDark=this.__zr.isDarkMode(),i=0;i<3;i++)colorArr[i]=colorArr[i]*alpha+(isDark?0:255)*(1-alpha);return colorArr[3]=1,stringify$1(colorArr,"rgba")},Element.prototype.traverse=function(cb,context){},Element.prototype.attrKV=function(key,value){"textConfig"===key?this.setTextConfig(value):"textContent"===key?this.setTextContent(value):"clipPath"===key?this.setClipPath(value):"extra"===key?(this.extra=this.extra||{},extend(this.extra,value)):this[key]=value},Element.prototype.hide=function(){this.ignore=!0,this.markRedraw()},Element.prototype.show=function(){this.ignore=!1,this.markRedraw()},Element.prototype.attr=function(keyOrObj,value){if("string"==typeof keyOrObj)this.attrKV(keyOrObj,value);else if(isObject$3(keyOrObj))for(var keysArr=keys$1(keyOrObj),i=0;i<keysArr.length;i++){var key=keysArr[i];this.attrKV(key,keyOrObj[key])}return this.markRedraw(),this},Element.prototype.saveCurrentToNormalState=function(toState){this._innerSaveToNormal(toState);for(var normalState=this._normalState,i=0;i<this.animators.length;i++){var animator=this.animators[i],fromStateTransition=animator.__fromStateTransition;if(!(animator.getLoop()||fromStateTransition&&"__zr_normal__"!==fromStateTransition)){var targetName=animator.targetName,target=targetName?normalState[targetName]:normalState;animator.saveTo(target)}}},Element.prototype._innerSaveToNormal=function(toState){var normalState=this._normalState;normalState||(normalState=this._normalState={}),toState.textConfig&&!normalState.textConfig&&(normalState.textConfig=this.textConfig),this._savePrimaryToNormal(toState,normalState,PRIMARY_STATES_KEYS$1)},Element.prototype._savePrimaryToNormal=function(toState,normalState,primaryKeys){for(var i=0;i<primaryKeys.length;i++){var key=primaryKeys[i];null==toState[key]||key in normalState||(normalState[key]=this[key])}},Element.prototype.hasState=function(){return this.currentStates.length>0},Element.prototype.getState=function(name){return this.states[name]},Element.prototype.ensureState=function(name){var states=this.states;return states[name]||(states[name]={}),states[name]},Element.prototype.clearStates=function(noAnimation){this.useState("__zr_normal__",!1,noAnimation)},Element.prototype.useState=function(stateName,keepCurrentStates,noAnimation,forceUseHoverLayer){var toNormalState="__zr_normal__"===stateName;if(this.hasState()||!toNormalState){var currentStates=this.currentStates,animationCfg=this.stateTransition;if(!(indexOf(currentStates,stateName)>=0)||!keepCurrentStates&&1!==currentStates.length){var state;if(this.stateProxy&&!toNormalState&&(state=this.stateProxy(stateName)),state||(state=this.states&&this.states[stateName]),state||toNormalState){toNormalState||this.saveCurrentToNormalState(state);var useHoverLayer=!!(state&&state.hoverLayer||forceUseHoverLayer);useHoverLayer&&this._toggleHoverLayerFlag(!0),this._applyStateObj(stateName,state,this._normalState,keepCurrentStates,!noAnimation&&!this.__inHover&&animationCfg&&animationCfg.duration>0,animationCfg);var textContent=this._textContent,textGuide=this._textGuide;return textContent&&textContent.useState(stateName,keepCurrentStates,noAnimation,useHoverLayer),textGuide&&textGuide.useState(stateName,keepCurrentStates,noAnimation,useHoverLayer),toNormalState?(this.currentStates=[],this._normalState={}):keepCurrentStates?this.currentStates.push(stateName):this.currentStates=[stateName],this._updateAnimationTargets(),this.markRedraw(),!useHoverLayer&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),state}logError("State "+stateName+" not exists.")}}},Element.prototype.useStates=function(states,noAnimation,forceUseHoverLayer){if(states.length){var stateObjects=[],currentStates=this.currentStates,len=states.length,notChange=len===currentStates.length;if(notChange)for(var i=0;i<len;i++)if(states[i]!==currentStates[i]){notChange=!1;break}if(notChange)return;for(i=0;i<len;i++){var stateName=states[i],stateObj=void 0;this.stateProxy&&(stateObj=this.stateProxy(stateName,states)),stateObj||(stateObj=this.states[stateName]),stateObj&&stateObjects.push(stateObj)}var lastStateObj=stateObjects[len-1],useHoverLayer=!!(lastStateObj&&lastStateObj.hoverLayer||forceUseHoverLayer);useHoverLayer&&this._toggleHoverLayerFlag(!0);var mergedState=this._mergeStates(stateObjects),animationCfg=this.stateTransition;this.saveCurrentToNormalState(mergedState),this._applyStateObj(states.join(","),mergedState,this._normalState,!1,!noAnimation&&!this.__inHover&&animationCfg&&animationCfg.duration>0,animationCfg);var textContent=this._textContent,textGuide=this._textGuide;textContent&&textContent.useStates(states,noAnimation,useHoverLayer),textGuide&&textGuide.useStates(states,noAnimation,useHoverLayer),this._updateAnimationTargets(),this.currentStates=states.slice(),this.markRedraw(),!useHoverLayer&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},Element.prototype.isSilent=function(){for(var isSilent=this.silent,ancestor=this.parent;!isSilent&&ancestor;){if(ancestor.silent){isSilent=!0;break}ancestor=ancestor.parent}return isSilent},Element.prototype._updateAnimationTargets=function(){for(var i=0;i<this.animators.length;i++){var animator=this.animators[i];animator.targetName&&animator.changeTarget(this[animator.targetName])}},Element.prototype.removeState=function(state){var idx=indexOf(this.currentStates,state);if(idx>=0){var currentStates=this.currentStates.slice();currentStates.splice(idx,1),this.useStates(currentStates)}},Element.prototype.replaceState=function(oldState,newState,forceAdd){var currentStates=this.currentStates.slice(),idx=indexOf(currentStates,oldState),newStateExists=indexOf(currentStates,newState)>=0;idx>=0?newStateExists?currentStates.splice(idx,1):currentStates[idx]=newState:forceAdd&&!newStateExists&&currentStates.push(newState),this.useStates(currentStates)},Element.prototype.toggleState=function(state,enable){enable?this.useState(state,!0):this.removeState(state)},Element.prototype._mergeStates=function(states){for(var mergedTextConfig,mergedState={},i=0;i<states.length;i++){var state=states[i];extend(mergedState,state),state.textConfig&&extend(mergedTextConfig=mergedTextConfig||{},state.textConfig)}return mergedTextConfig&&(mergedState.textConfig=mergedTextConfig),mergedState},Element.prototype._applyStateObj=function(stateName,state,normalState,keepCurrentStates,transition,animationCfg){var needsRestoreToNormal=!(state&&keepCurrentStates);state&&state.textConfig?(this.textConfig=extend({},keepCurrentStates?this.textConfig:normalState.textConfig),extend(this.textConfig,state.textConfig)):needsRestoreToNormal&&normalState.textConfig&&(this.textConfig=normalState.textConfig);for(var transitionTarget={},hasTransition=!1,i=0;i<PRIMARY_STATES_KEYS$1.length;i++){var key=PRIMARY_STATES_KEYS$1[i],propNeedsTransition=transition&&DEFAULT_ANIMATABLE_MAP[key];state&&null!=state[key]?propNeedsTransition?(hasTransition=!0,transitionTarget[key]=state[key]):this[key]=state[key]:needsRestoreToNormal&&null!=normalState[key]&&(propNeedsTransition?(hasTransition=!0,transitionTarget[key]=normalState[key]):this[key]=normalState[key])}if(!transition)for(i=0;i<this.animators.length;i++){var animator=this.animators[i],targetName=animator.targetName;animator.getLoop()||animator.__changeFinalValue(targetName?(state||normalState)[targetName]:state||normalState)}hasTransition&&this._transitionState(stateName,transitionTarget,animationCfg)},Element.prototype._attachComponent=function(componentEl){if(!componentEl.__zr||componentEl.__hostTarget){if(componentEl!==this){var zr=this.__zr;zr&&componentEl.addSelfToZr(zr),componentEl.__zr=zr,componentEl.__hostTarget=this}else if("production"!==process.env.NODE_ENV)throw new Error("Recursive component attachment.")}else if("production"!==process.env.NODE_ENV)throw new Error("Text element has been added to zrender.")},Element.prototype._detachComponent=function(componentEl){componentEl.__zr&&componentEl.removeSelfFromZr(componentEl.__zr),componentEl.__zr=null,componentEl.__hostTarget=null},Element.prototype.getClipPath=function(){return this._clipPath},Element.prototype.setClipPath=function(clipPath){this._clipPath&&this._clipPath!==clipPath&&this.removeClipPath(),this._attachComponent(clipPath),this._clipPath=clipPath,this.markRedraw()},Element.prototype.removeClipPath=function(){var clipPath=this._clipPath;clipPath&&(this._detachComponent(clipPath),this._clipPath=null,this.markRedraw())},Element.prototype.getTextContent=function(){return this._textContent},Element.prototype.setTextContent=function(textEl){var previousTextContent=this._textContent;if(previousTextContent!==textEl){if(previousTextContent&&previousTextContent!==textEl&&this.removeTextContent(),"production"!==process.env.NODE_ENV&&textEl.__zr&&!textEl.__hostTarget)throw new Error("Text element has been added to zrender.");textEl.innerTransformable=new Transformable$1,this._attachComponent(textEl),this._textContent=textEl,this.markRedraw()}},Element.prototype.setTextConfig=function(cfg){this.textConfig||(this.textConfig={}),extend(this.textConfig,cfg),this.markRedraw()},Element.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},Element.prototype.removeTextContent=function(){var textEl=this._textContent;textEl&&(textEl.innerTransformable=null,this._detachComponent(textEl),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},Element.prototype.getTextGuideLine=function(){return this._textGuide},Element.prototype.setTextGuideLine=function(guideLine){this._textGuide&&this._textGuide!==guideLine&&this.removeTextGuideLine(),this._attachComponent(guideLine),this._textGuide=guideLine,this.markRedraw()},Element.prototype.removeTextGuideLine=function(){var textGuide=this._textGuide;textGuide&&(this._detachComponent(textGuide),this._textGuide=null,this.markRedraw())},Element.prototype.markRedraw=function(){this.__dirty|=1;var zr=this.__zr;zr&&(this.__inHover?zr.refreshHover():zr.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},Element.prototype.dirty=function(){this.markRedraw()},Element.prototype._toggleHoverLayerFlag=function(inHover){this.__inHover=inHover;var textContent=this._textContent,textGuide=this._textGuide;textContent&&(textContent.__inHover=inHover),textGuide&&(textGuide.__inHover=inHover)},Element.prototype.addSelfToZr=function(zr){if(this.__zr!==zr){this.__zr=zr;var animators=this.animators;if(animators)for(var i=0;i<animators.length;i++)zr.animation.addAnimator(animators[i]);this._clipPath&&this._clipPath.addSelfToZr(zr),this._textContent&&this._textContent.addSelfToZr(zr),this._textGuide&&this._textGuide.addSelfToZr(zr)}},Element.prototype.removeSelfFromZr=function(zr){if(this.__zr){this.__zr=null;var animators=this.animators;if(animators)for(var i=0;i<animators.length;i++)zr.animation.removeAnimator(animators[i]);this._clipPath&&this._clipPath.removeSelfFromZr(zr),this._textContent&&this._textContent.removeSelfFromZr(zr),this._textGuide&&this._textGuide.removeSelfFromZr(zr)}},Element.prototype.animate=function(key,loop,allowDiscreteAnimation){var target=key?this[key]:this;if("production"===process.env.NODE_ENV||target){var animator=new Animator$1(target,loop,allowDiscreteAnimation);return key&&(animator.targetName=key),this.addAnimator(animator,key),animator}logError('Property "'+key+'" is not existed in element '+this.id)},Element.prototype.addAnimator=function(animator,key){var zr=this.__zr,el=this;animator.during((function(){el.updateDuringAnimation(key)})).done((function(){var animators=el.animators,idx=indexOf(animators,animator);idx>=0&&animators.splice(idx,1)})),this.animators.push(animator),zr&&zr.animation.addAnimator(animator),zr&&zr.wakeUp()},Element.prototype.updateDuringAnimation=function(key){this.markRedraw()},Element.prototype.stopAnimation=function(scope,forwardToLast){for(var animators=this.animators,len=animators.length,leftAnimators=[],i=0;i<len;i++){var animator=animators[i];scope&&scope!==animator.scope?leftAnimators.push(animator):animator.stop(forwardToLast)}return this.animators=leftAnimators,this},Element.prototype.animateTo=function(target,cfg,animationProps){animateTo(this,target,cfg,animationProps)},Element.prototype.animateFrom=function(target,cfg,animationProps){animateTo(this,target,cfg,animationProps,!0)},Element.prototype._transitionState=function(stateName,target,cfg,animationProps){for(var animators=animateTo(this,target,cfg,animationProps),i=0;i<animators.length;i++)animators[i].__fromStateTransition=stateName},Element.prototype.getBoundingRect=function(){return null},Element.prototype.getPaintRect=function(){return null},Element.initDefaultProps=function(){var elProto=Element.prototype;elProto.type="element",elProto.name="",elProto.ignore=elProto.silent=elProto.isGroup=elProto.draggable=elProto.dragging=elProto.ignoreClip=elProto.__inHover=!1,elProto.__dirty=1;var logs={};function logDeprecatedError(key,xKey,yKey){logs[key+xKey+yKey]||(console.warn("DEPRECATED: '"+key+"' has been deprecated. use '"+xKey+"', '"+yKey+"' instead"),logs[key+xKey+yKey]=!0)}function createLegacyProperty(key,privateKey,xKey,yKey){function enhanceArray(self,pos){Object.defineProperty(pos,0,{get:function(){return self[xKey]},set:function(val){self[xKey]=val}}),Object.defineProperty(pos,1,{get:function(){return self[yKey]},set:function(val){self[yKey]=val}})}Object.defineProperty(elProto,key,{get:function(){("production"!==process.env.NODE_ENV&&logDeprecatedError(key,xKey,yKey),this[privateKey])||enhanceArray(this,this[privateKey]=[]);return this[privateKey]},set:function(pos){"production"!==process.env.NODE_ENV&&logDeprecatedError(key,xKey,yKey),this[xKey]=pos[0],this[yKey]=pos[1],this[privateKey]=pos,enhanceArray(this,pos)}})}Object.defineProperty&&(createLegacyProperty("position","_legacyPos","x","y"),createLegacyProperty("scale","_legacyScale","scaleX","scaleY"),createLegacyProperty("origin","_legacyOrigin","originX","originY"))}(),Element}();function animateTo(animatable,target,cfg,animationProps,reverse){var animators=[];animateToShallow(animatable,"",animatable,target,cfg=cfg||{},animationProps,animators,reverse);var finishCount=animators.length,doneHappened=!1,cfgDone=cfg.done,cfgAborted=cfg.aborted,doneCb=function(){doneHappened=!0,--finishCount<=0&&(doneHappened?cfgDone&&cfgDone():cfgAborted&&cfgAborted())},abortedCb=function(){--finishCount<=0&&(doneHappened?cfgDone&&cfgDone():cfgAborted&&cfgAborted())};finishCount||cfgDone&&cfgDone(),animators.length>0&&cfg.during&&animators[0].during((function(target,percent){cfg.during(percent)}));for(var i=0;i<animators.length;i++){var animator=animators[i];doneCb&&animator.done(doneCb),abortedCb&&animator.aborted(abortedCb),cfg.force&&animator.duration(cfg.duration),animator.start(cfg.easing)}return animators}function copyArrShallow(source,target,len){for(var i=0;i<len;i++)source[i]=target[i]}function copyValue(target,source,key){if(isArrayLike(source[key]))if(isArrayLike(target[key])||(target[key]=[]),isTypedArray(source[key])){var len=source[key].length;target[key].length!==len&&(target[key]=new source[key].constructor(len),copyArrShallow(target[key],source[key],len))}else{var sourceArr=source[key],targetArr=target[key],len0=sourceArr.length;if(isArrayLike(sourceArr[0]))for(var len1=sourceArr[0].length,i=0;i<len0;i++)targetArr[i]?copyArrShallow(targetArr[i],sourceArr[i],len1):targetArr[i]=Array.prototype.slice.call(sourceArr[i]);else copyArrShallow(targetArr,sourceArr,len0);targetArr.length=sourceArr.length}else target[key]=source[key]}function animateToShallow(animatable,topKey,animateObj,target,cfg,animationProps,animators,reverse){for(var targetKeys=keys$1(target),duration=cfg.duration,delay=cfg.delay,additive=cfg.additive,setToFinal=cfg.setToFinal,animateAll=!isObject$3(animationProps),existsAnimators=animatable.animators,animationKeys=[],k=0;k<targetKeys.length;k++){var innerKey=targetKeys[k],targetVal=target[innerKey];if(null!=targetVal&&null!=animateObj[innerKey]&&(animateAll||animationProps[innerKey]))if(!isObject$3(targetVal)||isArrayLike(targetVal)||isGradientObject(targetVal))animationKeys.push(innerKey);else{if(topKey){reverse||(animateObj[innerKey]=targetVal,animatable.updateDuringAnimation(topKey));continue}animateToShallow(animatable,innerKey,animateObj[innerKey],targetVal,cfg,animationProps&&animationProps[innerKey],animators,reverse)}else reverse||(animateObj[innerKey]=targetVal,animatable.updateDuringAnimation(topKey),animationKeys.push(innerKey))}var keyLen=animationKeys.length;if(!additive&&keyLen)for(var i=0;i<existsAnimators.length;i++){if((animator=existsAnimators[i]).targetName===topKey)if(animator.stopTracks(animationKeys)){var idx=indexOf(existsAnimators,animator);existsAnimators.splice(idx,1)}}if(cfg.force||(animationKeys=filter(animationKeys,(function(key){return val1=target[key],val2=animateObj[key],!(val1===val2||isArrayLike(val1)&&isArrayLike(val2)&&function(arr0,arr1){var len=arr0.length;if(len!==arr1.length)return!1;for(var i=0;i<len;i++)if(arr0[i]!==arr1[i])return!1;return!0}(val1,val2));var val1,val2})),keyLen=animationKeys.length),keyLen>0||cfg.force&&!animators.length){var animator,revertedSource=void 0,reversedTarget=void 0,sourceClone=void 0;if(reverse){reversedTarget={},setToFinal&&(revertedSource={});for(i=0;i<keyLen;i++){reversedTarget[innerKey=animationKeys[i]]=animateObj[innerKey],setToFinal?revertedSource[innerKey]=target[innerKey]:animateObj[innerKey]=target[innerKey]}}else if(setToFinal){sourceClone={};for(i=0;i<keyLen;i++){sourceClone[innerKey=animationKeys[i]]=cloneValue(animateObj[innerKey]),copyValue(animateObj,target,innerKey)}}(animator=new Animator$1(animateObj,!1,!1,additive?filter(existsAnimators,(function(animator){return animator.targetName===topKey})):null)).targetName=topKey,cfg.scope&&(animator.scope=cfg.scope),setToFinal&&revertedSource&&animator.whenWithKeys(0,revertedSource,animationKeys),sourceClone&&animator.whenWithKeys(0,sourceClone,animationKeys),animator.whenWithKeys(null==duration?500:duration,reverse?reversedTarget:target,animationKeys).delay(delay||0),animatable.addAnimator(animator,topKey),animators.push(animator)}}mixin(Element,Eventful$1),mixin(Element,Transformable$1);var Element$1=Element,Group$3=function(_super){function Group(opts){var _this=_super.call(this)||this;return _this.isGroup=!0,_this._children=[],_this.attr(opts),_this}return __extends(Group,_super),Group.prototype.childrenRef=function(){return this._children},Group.prototype.children=function(){return this._children.slice()},Group.prototype.childAt=function(idx){return this._children[idx]},Group.prototype.childOfName=function(name){for(var children=this._children,i=0;i<children.length;i++)if(children[i].name===name)return children[i]},Group.prototype.childCount=function(){return this._children.length},Group.prototype.add=function(child){if(child&&(child!==this&&child.parent!==this&&(this._children.push(child),this._doAdd(child)),"production"!==process.env.NODE_ENV&&child.__hostTarget))throw"This elemenet has been used as an attachment";return this},Group.prototype.addBefore=function(child,nextSibling){if(child&&child!==this&&child.parent!==this&&nextSibling&&nextSibling.parent===this){var children=this._children,idx=children.indexOf(nextSibling);idx>=0&&(children.splice(idx,0,child),this._doAdd(child))}return this},Group.prototype.replace=function(oldChild,newChild){var idx=indexOf(this._children,oldChild);return idx>=0&&this.replaceAt(newChild,idx),this},Group.prototype.replaceAt=function(child,index){var children=this._children,old=children[index];if(child&&child!==this&&child.parent!==this&&child!==old){children[index]=child,old.parent=null;var zr=this.__zr;zr&&old.removeSelfFromZr(zr),this._doAdd(child)}return this},Group.prototype._doAdd=function(child){child.parent&&child.parent.remove(child),child.parent=this;var zr=this.__zr;zr&&zr!==child.__zr&&child.addSelfToZr(zr),zr&&zr.refresh()},Group.prototype.remove=function(child){var zr=this.__zr,children=this._children,idx=indexOf(children,child);return idx<0||(children.splice(idx,1),child.parent=null,zr&&child.removeSelfFromZr(zr),zr&&zr.refresh()),this},Group.prototype.removeAll=function(){for(var children=this._children,zr=this.__zr,i=0;i<children.length;i++){var child=children[i];zr&&child.removeSelfFromZr(zr),child.parent=null}return children.length=0,this},Group.prototype.eachChild=function(cb,context){for(var children=this._children,i=0;i<children.length;i++){var child=children[i];cb.call(context,child,i)}return this},Group.prototype.traverse=function(cb,context){for(var i=0;i<this._children.length;i++){var child=this._children[i],stopped=cb.call(context,child);child.isGroup&&!stopped&&child.traverse(cb,context)}return this},Group.prototype.addSelfToZr=function(zr){_super.prototype.addSelfToZr.call(this,zr);for(var i=0;i<this._children.length;i++){this._children[i].addSelfToZr(zr)}},Group.prototype.removeSelfFromZr=function(zr){_super.prototype.removeSelfFromZr.call(this,zr);for(var i=0;i<this._children.length;i++){this._children[i].removeSelfFromZr(zr)}},Group.prototype.getBoundingRect=function(includeChildren){for(var tmpRect=new BoundingRect$1(0,0,0,0),children=includeChildren||this._children,tmpMat=[],rect=null,i=0;i<children.length;i++){var child=children[i];if(!child.ignore&&!child.invisible){var childRect=child.getBoundingRect(),transform=child.getLocalTransform(tmpMat);transform?(BoundingRect$1.applyTransform(tmpRect,childRect,transform),(rect=rect||tmpRect.clone()).union(tmpRect)):(rect=rect||childRect.clone()).union(childRect)}}return rect||tmpRect},Group}(Element$1);Group$3.prototype.type="group";var Group$4=Group$3,painterCtors={},instances$1={};
/*!
* ZRender, a high performance 2d drawing library.
*
* Copyright (c) 2013, Baidu Inc.
* All rights reserved.
*
* LICENSE
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
*/var ZRender=function(){function ZRender(id,dom,opts){var _this=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,opts=opts||{},this.dom=dom,this.id=id;var storage=new Storage$1,rendererType=opts.renderer||"canvas";if(painterCtors[rendererType]||(rendererType=keys$1(painterCtors)[0]),"production"!==process.env.NODE_ENV&&!painterCtors[rendererType])throw new Error("Renderer '"+rendererType+"' is not imported. Please import it first.");opts.useDirtyRect=null!=opts.useDirtyRect&&opts.useDirtyRect;var painter=new painterCtors[rendererType](dom,storage,opts,id),ssrMode=opts.ssr||painter.ssrOnly;this.storage=storage,this.painter=painter;var pointerSize,handlerProxy=env$1.node||env$1.worker||ssrMode?null:new HandlerProxy(painter.getViewportRoot(),painter.root),useCoarsePointer=opts.useCoarsePointer;(null==useCoarsePointer||"auto"===useCoarsePointer?env$1.touchEventsSupported:!!useCoarsePointer)&&(pointerSize=retrieve2(opts.pointerSize,44)),this.handler=new Handler$1(storage,painter,handlerProxy,painter.root,pointerSize),this.animation=new Animation$1({stage:{update:ssrMode?null:function(){return _this._flush(!0)}}}),ssrMode||this.animation.start()}return ZRender.prototype.add=function(el){!this._disposed&&el&&(this.storage.addRoot(el),el.addSelfToZr(this),this.refresh())},ZRender.prototype.remove=function(el){!this._disposed&&el&&(this.storage.delRoot(el),el.removeSelfFromZr(this),this.refresh())},ZRender.prototype.configLayer=function(zLevel,config){this._disposed||(this.painter.configLayer&&this.painter.configLayer(zLevel,config),this.refresh())},ZRender.prototype.setBackgroundColor=function(backgroundColor){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(backgroundColor),this.refresh(),this._backgroundColor=backgroundColor,this._darkMode=function(backgroundColor){if(!backgroundColor)return!1;if("string"==typeof backgroundColor)return lum(backgroundColor,1)<.4;if(backgroundColor.colorStops){for(var colorStops=backgroundColor.colorStops,totalLum=0,len=colorStops.length,i=0;i<len;i++)totalLum+=lum(colorStops[i].color,1);return(totalLum/=len)<.4}return!1}(backgroundColor))},ZRender.prototype.getBackgroundColor=function(){return this._backgroundColor},ZRender.prototype.setDarkMode=function(darkMode){this._darkMode=darkMode},ZRender.prototype.isDarkMode=function(){return this._darkMode},ZRender.prototype.refreshImmediately=function(fromInside){this._disposed||(fromInside||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},ZRender.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},ZRender.prototype.flush=function(){this._disposed||this._flush(!1)},ZRender.prototype._flush=function(fromInside){var triggerRendered,start=getTime();this._needsRefresh&&(triggerRendered=!0,this.refreshImmediately(fromInside)),this._needsRefreshHover&&(triggerRendered=!0,this.refreshHoverImmediately());var end=getTime();triggerRendered?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:end-start})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},ZRender.prototype.setSleepAfterStill=function(stillFramesCount){this._sleepAfterStill=stillFramesCount},ZRender.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},ZRender.prototype.refreshHover=function(){this._needsRefreshHover=!0},ZRender.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},ZRender.prototype.resize=function(opts){this._disposed||(opts=opts||{},this.painter.resize(opts.width,opts.height),this.handler.resize())},ZRender.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},ZRender.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},ZRender.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},ZRender.prototype.setCursorStyle=function(cursorStyle){this._disposed||this.handler.setCursorStyle(cursorStyle)},ZRender.prototype.findHover=function(x,y){if(!this._disposed)return this.handler.findHover(x,y)},ZRender.prototype.on=function(eventName,eventHandler,context){return this._disposed||this.handler.on(eventName,eventHandler,context),this},ZRender.prototype.off=function(eventName,eventHandler){this._disposed||this.handler.off(eventName,eventHandler)},ZRender.prototype.trigger=function(eventName,event){this._disposed||this.handler.trigger(eventName,event)},ZRender.prototype.clear=function(){if(!this._disposed){for(var roots=this.storage.getRoots(),i=0;i<roots.length;i++)roots[i]instanceof Group$4&&roots[i].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},ZRender.prototype.dispose=function(){var id;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,id=this.id,delete instances$1[id])},ZRender}();function init$2(dom,opts){var zr=new ZRender(guid(),dom,opts);return instances$1[zr.id]=zr,zr}function linearMap(val,domain,range,clamp){var d0=domain[0],d1=domain[1],r0=range[0],r1=range[1],subDomain=d1-d0,subRange=r1-r0;if(0===subDomain)return 0===subRange?r0:(r0+r1)/2;if(clamp)if(subDomain>0){if(val<=d0)return r0;if(val>=d1)return r1}else{if(val>=d0)return r0;if(val<=d1)return r1}else{if(val===d0)return r0;if(val===d1)return r1}return(val-d0)/subDomain*subRange+r0}function parsePercent(percent,all){switch(percent){case"center":case"middle":percent="50%";break;case"left":case"top":percent="0%";break;case"right":case"bottom":percent="100%"}return isString(percent)?(str=percent,str.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(percent)/100*all:parseFloat(percent):null==percent?NaN:+percent;var str}function round$3(x,precision,returnStr){return null==precision&&(precision=10),precision=Math.min(Math.max(0,precision),20),x=(+x).toFixed(precision),returnStr?x:+x}function asc$1(arr){return arr.sort((function(a,b){return a-b})),arr}function getPrecision(val){if(val=+val,isNaN(val))return 0;if(val>1e-14)for(var e=1,i=0;i<15;i++,e*=10)if(Math.round(val*e)/e===val)return i;return getPrecisionSafe(val)}function getPrecisionSafe(val){var str=val.toString().toLowerCase(),eIndex=str.indexOf("e"),exp=eIndex>0?+str.slice(eIndex+1):0,significandPartLen=eIndex>0?eIndex:str.length,dotIndex=str.indexOf("."),decimalPartLen=dotIndex<0?0:significandPartLen-1-dotIndex;return Math.max(0,decimalPartLen-exp)}function getPixelPrecision(dataExtent,pixelExtent){var log=Math.log,LN10=Math.LN10,dataQuantity=Math.floor(log(dataExtent[1]-dataExtent[0])/LN10),sizeQuantity=Math.round(log(Math.abs(pixelExtent[1]-pixelExtent[0]))/LN10),precision=Math.min(Math.max(-dataQuantity+sizeQuantity,0),20);return isFinite(precision)?precision:20}function addSafe(val0,val1){var maxPrecision=Math.max(getPrecision(val0),getPrecision(val1)),sum=val0+val1;return maxPrecision>20?sum:round$3(sum,maxPrecision)}function remRadian(radian){var pi2=2*Math.PI;return(radian%pi2+pi2)%pi2}function isRadianAroundZero(val){return val>-1e-4&&val<1e-4}var TIME_REG=/^(?:(\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 parseDate$1(value){if(value instanceof Date)return value;if(isString(value)){var match=TIME_REG.exec(value);if(!match)return new Date(NaN);if(match[8]){var hour=+match[4]||0;return"Z"!==match[8].toUpperCase()&&(hour-=+match[8].slice(0,3)),new Date(Date.UTC(+match[1],+(match[2]||1)-1,+match[3]||1,hour,+(match[5]||0),+match[6]||0,match[7]?+match[7].substring(0,3):0))}return new Date(+match[1],+(match[2]||1)-1,+match[3]||1,+match[4]||0,+(match[5]||0),+match[6]||0,match[7]?+match[7].substring(0,3):0)}return null==value?new Date(NaN):new Date(Math.round(value))}function quantityExponent(val){if(0===val)return 0;var exp=Math.floor(Math.log(val)/Math.LN10);return val/Math.pow(10,exp)>=10&&exp++,exp}function nice(val,round){var exponent=quantityExponent(val),exp10=Math.pow(10,exponent),f=val/exp10;return val=(round?f<1.5?1:f<2.5?2:f<4?3:f<7?5:10:f<1?1:f<2?2:f<3?3:f<5?5:10)*exp10,exponent>=-20?+val.toFixed(exponent<0?-exponent:0):val}function quantile(ascArr,p){var H=(ascArr.length-1)*p+1,h=Math.floor(H),v=+ascArr[h-1],e=H-h;return e?v+e*(ascArr[h]-v):v}function numericToNumber(val){var valFloat=parseFloat(val);return valFloat==val&&(0!==valFloat||!isString(val)||val.indexOf("x")<=0)?valFloat:NaN}function isNumeric(val){return!isNaN(numericToNumber(val))}function getRandomIdBase(){return Math.round(9*Math.random())}function getGreatestCommonDividor(a,b){return 0===b?a:getGreatestCommonDividor(b,a%b)}function getLeastCommonMultiple(a,b){return null==a?b:null==b?a:a*b/getGreatestCommonDividor(a,b)}var storedLogs={},hasConsole="undefined"!=typeof console&&console.warn&&console.log;function outputLog(type,str,onlyOnce){if(hasConsole){if(onlyOnce){if(storedLogs[str])return;storedLogs[str]=!0}console[type]("[ECharts] "+str)}}function warn(str,onlyOnce){outputLog("warn",str,onlyOnce)}function error(str,onlyOnce){outputLog("error",str,onlyOnce)}function deprecateLog(str){"production"!==process.env.NODE_ENV&&outputLog("warn","DEPRECATED: "+str,!0)}function deprecateReplaceLog(oldOpt,newOpt,scope){"production"!==process.env.NODE_ENV&&deprecateLog((scope?"["+scope+"]":"")+oldOpt+" is deprecated, use "+newOpt+" instead.")}function makePrintable(){for(var hintInfo=[],_i=0;_i<arguments.length;_i++)hintInfo[_i]=arguments[_i];var msg="";if("production"!==process.env.NODE_ENV){var makePrintableStringIfPossible_1=function(val){return void 0===val?"undefined":val===1/0?"Infinity":val===-1/0?"-Infinity":eqNaN(val)?"NaN":val instanceof Date?"Date("+val.toISOString()+")":isFunction(val)?"function () { ... }":(value=val,"[object RegExp]"===objToString.call(value)?val+"":null);var value};msg=map$1(hintInfo,(function(arg){if(isString(arg))return arg;var printableStr=makePrintableStringIfPossible_1(arg);if(null!=printableStr)return printableStr;if("undefined"==typeof JSON||!JSON.stringify)return"?";try{return JSON.stringify(arg,(function(n,val){var printableStr=makePrintableStringIfPossible_1(val);return null==printableStr?val:printableStr}))}catch(err){return"?"}})).join(" ")}return msg}function throwError(msg){throw new Error(msg)}function interpolateNumber(p0,p1,percent){return(p1-p0)*percent+p0}function normalizeToArray(value){return value instanceof Array?value:null==value?[]:[value]}function defaultEmphasis(opt,key,subOpts){if(opt){opt[key]=opt[key]||{},opt.emphasis=opt.emphasis||{},opt.emphasis[key]=opt.emphasis[key]||{};for(var i=0,len=subOpts.length;i<len;i++){var subOptName=subOpts[i];!opt.emphasis[key].hasOwnProperty(subOptName)&&opt[key].hasOwnProperty(subOptName)&&(opt.emphasis[key][subOptName]=opt[key][subOptName])}}}var TEXT_STYLE_OPTIONS=["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 getDataItemValue(dataItem){return!isObject$3(dataItem)||isArray(dataItem)||dataItem instanceof Date?dataItem:dataItem.value}function isDataItemOption(dataItem){return isObject$3(dataItem)&&!(dataItem instanceof Array)}function mappingToExists(existings,newCmptOptions,mode){var isNormalMergeMode="normalMerge"===mode,isReplaceMergeMode="replaceMerge"===mode,isReplaceAllMode="replaceAll"===mode;existings=existings||[],newCmptOptions=(newCmptOptions||[]).slice();var existingIdIdxMap=createHashMap();each$b(newCmptOptions,(function(cmptOption,index){isObject$3(cmptOption)?"production"!==process.env.NODE_ENV&&(null==cmptOption.id||isValidIdOrName(cmptOption.id)||warnInvalidateIdOrName(cmptOption.id),null==cmptOption.name||isValidIdOrName(cmptOption.name)||warnInvalidateIdOrName(cmptOption.name)):newCmptOptions[index]=null}));var mapResult,idMap,result=function(existings,existingIdIdxMap,mode){var result=[];if("replaceAll"===mode)return result;for(var index=0;index<existings.length;index++){var existing=existings[index];existing&&null!=existing.id&&existingIdIdxMap.set(existing.id,index),result.push({existing:"replaceMerge"===mode||isComponentIdInternal(existing)?null:existing,newOption:null,keyInfo:null,brandNew:null})}return result}(existings,existingIdIdxMap,mode);return(isNormalMergeMode||isReplaceMergeMode)&&function(result,existings,existingIdIdxMap,newCmptOptions){each$b(newCmptOptions,(function(cmptOption,index){if(cmptOption&&null!=cmptOption.id){var optionId=makeComparableKey(cmptOption.id),existingIdx=existingIdIdxMap.get(optionId);if(null!=existingIdx){var resultItem=result[existingIdx];assert(!resultItem.newOption,'Duplicated option on id "'+optionId+'".'),resultItem.newOption=cmptOption,resultItem.existing=existings[existingIdx],newCmptOptions[index]=null}}}))}(result,existings,existingIdIdxMap,newCmptOptions),isNormalMergeMode&&function(result,newCmptOptions){each$b(newCmptOptions,(function(cmptOption,index){if(cmptOption&&null!=cmptOption.name)for(var i=0;i<result.length;i++){var existing=result[i].existing;if(!result[i].newOption&&existing&&(null==existing.id||null==cmptOption.id)&&!isComponentIdInternal(cmptOption)&&!isComponentIdInternal(existing)&&keyExistAndEqual("name",existing,cmptOption))return result[i].newOption=cmptOption,void(newCmptOptions[index]=null)}}))}(result,newCmptOptions),isNormalMergeMode||isReplaceMergeMode?function(result,newCmptOptions,brandNew){each$b(newCmptOptions,(function(cmptOption){if(cmptOption){for(var resultItem,nextIdx=0;(resultItem=result[nextIdx])&&(resultItem.newOption||isComponentIdInternal(resultItem.existing)||resultItem.existing&&null!=cmptOption.id&&!keyExistAndEqual("id",cmptOption,resultItem.existing));)nextIdx++;resultItem?(resultItem.newOption=cmptOption,resultItem.brandNew=brandNew):result.push({newOption:cmptOption,brandNew:brandNew,existing:null,keyInfo:null}),nextIdx++}}))}(result,newCmptOptions,isReplaceMergeMode):isReplaceAllMode&&function(result,newCmptOptions){each$b(newCmptOptions,(function(cmptOption){result.push({newOption:cmptOption,brandNew:!0,existing:null,keyInfo:null})}))}(result,newCmptOptions),mapResult=result,idMap=createHashMap(),each$b(mapResult,(function(item){var existing=item.existing;existing&&idMap.set(existing.id,item)})),each$b(mapResult,(function(item){var opt=item.newOption;assert(!opt||null==opt.id||!idMap.get(opt.id)||idMap.get(opt.id)===item,"id duplicates: "+(opt&&opt.id)),opt&&null!=opt.id&&idMap.set(opt.id,item),!item.keyInfo&&(item.keyInfo={})})),each$b(mapResult,(function(item,index){var existing=item.existing,opt=item.newOption,keyInfo=item.keyInfo;if(isObject$3(opt)){if(keyInfo.name=null!=opt.name?makeComparableKey(opt.name):existing?existing.name:"series\0"+index,existing)keyInfo.id=makeComparableKey(existing.id);else if(null!=opt.id)keyInfo.id=makeComparableKey(opt.id);else{var idNum=0;do{keyInfo.id="\0"+keyInfo.name+"\0"+idNum++}while(idMap.get(keyInfo.id))}idMap.set(keyInfo.id,item)}})),result}function keyExistAndEqual(attr,obj1,obj2){var key1=convertOptionIdName(obj1[attr],null),key2=convertOptionIdName(obj2[attr],null);return null!=key1&&null!=key2&&key1===key2}function makeComparableKey(val){if("production"!==process.env.NODE_ENV&&null==val)throw new Error;return convertOptionIdName(val,"")}function convertOptionIdName(idOrName,defaultValue){return null==idOrName?defaultValue:isString(idOrName)?idOrName:isNumber(idOrName)||isStringSafe(idOrName)?idOrName+"":defaultValue}function warnInvalidateIdOrName(idOrName){"production"!==process.env.NODE_ENV&&warn("`"+idOrName+"` is invalid id or name. Must be a string or number.")}function isValidIdOrName(idOrName){return isStringSafe(idOrName)||isNumeric(idOrName)}function isNameSpecified(componentModel){var name=componentModel.name;return!(!name||!name.indexOf("series\0"))}function isComponentIdInternal(cmptOption){return cmptOption&&null!=cmptOption.id&&0===makeComparableKey(cmptOption.id).indexOf("\0_ec_\0")}function queryDataIndex(data,payload){return null!=payload.dataIndexInside?payload.dataIndexInside:null!=payload.dataIndex?isArray(payload.dataIndex)?map$1(payload.dataIndex,(function(value){return data.indexOfRawIndex(value)})):data.indexOfRawIndex(payload.dataIndex):null!=payload.name?isArray(payload.name)?map$1(payload.name,(function(value){return data.indexOfName(value)})):data.indexOfName(payload.name):void 0}function makeInner(){var key="__ec_inner_"+innerUniqueIndex++;return function(hostObj){return hostObj[key]||(hostObj[key]={})}}var innerUniqueIndex=getRandomIdBase();function parseFinder$1(ecModel,finderInput,opt){var _a=preParseFinder(finderInput,opt),mainTypeSpecified=_a.mainTypeSpecified,queryOptionMap=_a.queryOptionMap,result=_a.others,defaultMainType=opt?opt.defaultMainType:null;return!mainTypeSpecified&&defaultMainType&&queryOptionMap.set(defaultMainType,{}),queryOptionMap.each((function(queryOption,mainType){var queryResult=queryReferringComponents(ecModel,mainType,queryOption,{useDefault:defaultMainType===mainType,enableAll:!opt||null==opt.enableAll||opt.enableAll,enableNone:!opt||null==opt.enableNone||opt.enableNone});result[mainType+"Models"]=queryResult.models,result[mainType+"Model"]=queryResult.models[0]})),result}function preParseFinder(finderInput,opt){var finder;if(isString(finderInput)){var obj={};obj[finderInput+"Index"]=0,finder=obj}else finder=finderInput;var queryOptionMap=createHashMap(),others={},mainTypeSpecified=!1;return each$b(finder,(function(value,key){if("dataIndex"!==key&&"dataIndexInside"!==key){var parsedKey=key.match(/^(\w+)(Index|Id|Name)$/)||[],mainType=parsedKey[1],queryType=(parsedKey[2]||"").toLowerCase();if(mainType&&queryType&&!(opt&&opt.includeMainTypes&&indexOf(opt.includeMainTypes,mainType)<0))mainTypeSpecified=mainTypeSpecified||!!mainType,(queryOptionMap.get(mainType)||queryOptionMap.set(mainType,{}))[queryType]=value}else others[key]=value})),{mainTypeSpecified:mainTypeSpecified,queryOptionMap:queryOptionMap,others:others}}var SINGLE_REFERRING={useDefault:!0,enableAll:!1,enableNone:!1},MULTIPLE_REFERRING={useDefault:!1,enableAll:!0,enableNone:!0};function queryReferringComponents(ecModel,mainType,userOption,opt){opt=opt||SINGLE_REFERRING;var indexOption=userOption.index,idOption=userOption.id,nameOption=userOption.name,result={models:null,specified:null!=indexOption||null!=idOption||null!=nameOption};if(!result.specified){var firstCmpt=void 0;return result.models=opt.useDefault&&(firstCmpt=ecModel.getComponent(mainType))?[firstCmpt]:[],result}return"none"===indexOption||!1===indexOption?(assert(opt.enableNone,'`"none"` or `false` is not a valid value on index option.'),result.models=[],result):("all"===indexOption&&(assert(opt.enableAll,'`"all"` is not a valid value on index option.'),indexOption=idOption=nameOption=null),result.models=ecModel.queryComponents({mainType:mainType,index:indexOption,id:idOption,name:nameOption}),result)}function setAttribute(dom,key,value){dom.setAttribute?dom.setAttribute(key,value):dom[key]=value}function groupData(array,getKey){var buckets=createHashMap(),keys=[];return each$b(array,(function(item){var key=getKey(item);(buckets.get(key)||(keys.push(key),buckets.set(key,[]))).push(item)})),{keys:keys,buckets:buckets}}function interpolateRawValues(data,precision,sourceValue,targetValue,percent){var isAutoPrecision=null==precision||"auto"===precision;if(null==targetValue)return targetValue;if(isNumber(targetValue))return round$3(value=interpolateNumber(sourceValue||0,targetValue,percent),isAutoPrecision?Math.max(getPrecision(sourceValue||0),getPrecision(targetValue)):precision);if(isString(targetValue))return percent<1?sourceValue:targetValue;for(var interpolated=[],leftArr=sourceValue,rightArr=targetValue,length_1=Math.max(leftArr?leftArr.length:0,rightArr.length),i=0;i<length_1;++i){var info=data.getDimensionInfo(i);if(info&&"ordinal"===info.type)interpolated[i]=(percent<1&&leftArr?leftArr:rightArr)[i];else{var leftVal=leftArr&&leftArr[i]?leftArr[i]:0,rightVal=rightArr[i],value=interpolateNumber(leftVal,rightVal,percent);interpolated[i]=round$3(value,isAutoPrecision?Math.max(getPrecision(leftVal),getPrecision(rightVal)):precision)}}return interpolated}var IS_CONTAINER="___EC__COMPONENT__CONTAINER___";function parseClassType(componentType){var ret={main:"",sub:""};if(componentType){var typeArr=componentType.split(".");ret.main=typeArr[0]||"",ret.sub=typeArr[1]||""}return ret}function enableClassExtend(rootClz,mandatoryMethods){rootClz.$constructor=rootClz,rootClz.extend=function(proto){"production"!==process.env.NODE_ENV&&each$b(mandatoryMethods,(function(method){proto[method]||console.warn("Method `"+method+"` should be implemented"+(proto.type?" in "+proto.type:"")+".")}));var ExtendedClass,fn,superClass=this;return isFunction(fn=superClass)&&/^class\s/.test(Function.prototype.toString.call(fn))?ExtendedClass=function(_super){function class_1(){return _super.apply(this,arguments)||this}return __extends(class_1,_super),class_1}(superClass):(ExtendedClass=function(){(proto.$constructor||superClass).apply(this,arguments)},function(clazz,baseClazz){var clazzPrototype=clazz.prototype;function F(){}for(var prop in F.prototype=baseClazz.prototype,clazz.prototype=new F,clazzPrototype)clazzPrototype.hasOwnProperty(prop)&&(clazz.prototype[prop]=clazzPrototype[prop]);clazz.prototype.constructor=clazz,clazz.superClass=baseClazz}(ExtendedClass,this)),extend(ExtendedClass.prototype,proto),ExtendedClass.___EC__EXTENDED_CLASS___=!0,ExtendedClass.extend=this.extend,ExtendedClass.superCall=superCall,ExtendedClass.superApply=superApply,ExtendedClass.superClass=superClass,ExtendedClass}}function mountExtend(SubClz,SupperClz){SubClz.extend=SupperClz.extend}var classBase=Math.round(10*Math.random());function superCall(context,methodName){for(var args=[],_i=2;_i<arguments.length;_i++)args[_i-2]=arguments[_i];return this.superClass.prototype[methodName].apply(context,args)}function superApply(context,methodName,args){return this.superClass.prototype[methodName].apply(context,args)}function enableClassManagement(target){var storage={};target.registerClass=function(clz){var componentType,componentFullType=clz.type||clz.prototype.type;if(componentFullType){assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType=componentFullType),'componentType "'+componentType+'" illegal'),clz.prototype.type=componentFullType;var componentTypeInfo=parseClassType(componentFullType);if(componentTypeInfo.sub){if(componentTypeInfo.sub!==IS_CONTAINER){var container=function(componentTypeInfo){var container=storage[componentTypeInfo.main];container&&container[IS_CONTAINER]||((container=storage[componentTypeInfo.main]={})[IS_CONTAINER]=!0);return container}(componentTypeInfo);container[componentTypeInfo.sub]=clz}}else"production"!==process.env.NODE_ENV&&storage[componentTypeInfo.main]&&console.warn(componentTypeInfo.main+" exists."),storage[componentTypeInfo.main]=clz}return clz},target.getClass=function(mainType,subType,throwWhenNotFound){var clz=storage[mainType];if(clz&&clz[IS_CONTAINER]&&(clz=subType?clz[subType]:null),throwWhenNotFound&&!clz)throw new Error(subType?"Component "+mainType+"."+(subType||"")+" is used but not imported.":mainType+".type should be specified.");return clz},target.getClassesByMainType=function(componentType){var componentTypeInfo=parseClassType(componentType),result=[],obj=storage[componentTypeInfo.main];return obj&&obj[IS_CONTAINER]?each$b(obj,(function(o,type){type!==IS_CONTAINER&&result.push(o)})):result.push(obj),result},target.hasClass=function(componentType){var componentTypeInfo=parseClassType(componentType);return!!storage[componentTypeInfo.main]},target.getAllClassMainTypes=function(){var types=[];return each$b(storage,(function(obj,type){types.push(type)})),types},target.hasSubTypes=function(componentType){var componentTypeInfo=parseClassType(componentType),obj=storage[componentTypeInfo.main];return obj&&obj[IS_CONTAINER]}}function makeStyleMapper(properties,ignoreParent){for(var i=0;i<properties.length;i++)properties[i][1]||(properties[i][1]=properties[i][0]);return ignoreParent=ignoreParent||!1,function(model,excludes,includes){for(var style={},i=0;i<properties.length;i++){var propName=properties[i][1];if(!(excludes&&indexOf(excludes,propName)>=0||includes&&indexOf(includes,propName)<0)){var val=model.getShallow(propName,ignoreParent);null!=val&&(style[properties[i][0]]=val)}}return style}}var getAreaStyle=makeStyleMapper([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),AreaStyleMixin=function(){function AreaStyleMixin(){}return AreaStyleMixin.prototype.getAreaStyle=function(excludes,includes){return getAreaStyle(this,excludes,includes)},AreaStyleMixin}(),globalImageCache=new LRU$1(50);function findExistImage(newImageOrSrc){if("string"==typeof newImageOrSrc){var cachedImgObj=globalImageCache.get(newImageOrSrc);return cachedImgObj&&cachedImgObj.image}return newImageOrSrc}function createOrUpdateImage(newImageOrSrc,image,hostEl,onload,cbPayload){if(newImageOrSrc){if("string"==typeof newImageOrSrc){if(image&&image.__zrImageSrc===newImageOrSrc||!hostEl)return image;var cachedImgObj=globalImageCache.get(newImageOrSrc),pendingWrap={hostEl:hostEl,cb:onload,cbPayload:cbPayload};return cachedImgObj?!isImageReady(image=cachedImgObj.image)&&cachedImgObj.pending.push(pendingWrap):((image=platformApi.loadImage(newImageOrSrc,imageOnLoad,imageOnLoad)).__zrImageSrc=newImageOrSrc,globalImageCache.put(newImageOrSrc,image.__cachedImgObj={image:image,pending:[pendingWrap]})),image}return newImageOrSrc}return image}function imageOnLoad(){var cachedImgObj=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var i=0;i<cachedImgObj.pending.length;i++){var pendingWrap=cachedImgObj.pending[i],cb=pendingWrap.cb;cb&&cb(this,pendingWrap.cbPayload),pendingWrap.hostEl.dirty()}cachedImgObj.pending.length=0}function isImageReady(image){return image&&image.width&&image.height}var STYLE_REG=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function truncateText2(out,text,containerWidth,font,ellipsis,options){if(!containerWidth)return out.text="",void(out.isTruncated=!1);var textLines=(text+"").split("\n");options=prepareTruncateOptions(containerWidth,font,ellipsis,options);for(var isTruncated=!1,truncateOut={},i=0,len=textLines.length;i<len;i++)truncateSingleLine(truncateOut,textLines[i],options),textLines[i]=truncateOut.textLine,isTruncated=isTruncated||truncateOut.isTruncated;out.text=textLines.join("\n"),out.isTruncated=isTruncated}function prepareTruncateOptions(containerWidth,font,ellipsis,options){var preparedOpts=extend({},options=options||{});preparedOpts.font=font,ellipsis=retrieve2(ellipsis,"..."),preparedOpts.maxIterations=retrieve2(options.maxIterations,2);var minChar=preparedOpts.minChar=retrieve2(options.minChar,0);preparedOpts.cnCharWidth=getWidth("国",font);var ascCharWidth=preparedOpts.ascCharWidth=getWidth("a",font);preparedOpts.placeholder=retrieve2(options.placeholder,"");for(var contentWidth=containerWidth=Math.max(0,containerWidth-1),i=0;i<minChar&&contentWidth>=ascCharWidth;i++)contentWidth-=ascCharWidth;var ellipsisWidth=getWidth(ellipsis,font);return ellipsisWidth>contentWidth&&(ellipsis="",ellipsisWidth=0),contentWidth=containerWidth-ellipsisWidth,preparedOpts.ellipsis=ellipsis,preparedOpts.ellipsisWidth=ellipsisWidth,preparedOpts.contentWidth=contentWidth,preparedOpts.containerWidth=containerWidth,preparedOpts}function truncateSingleLine(out,textLine,options){var containerWidth=options.containerWidth,font=options.font,contentWidth=options.contentWidth;if(!containerWidth)return out.textLine="",void(out.isTruncated=!1);var lineWidth=getWidth(textLine,font);if(lineWidth<=containerWidth)return out.textLine=textLine,void(out.isTruncated=!1);for(var j=0;;j++){if(lineWidth<=contentWidth||j>=options.maxIterations){textLine+=options.ellipsis;break}var subLength=0===j?estimateLength(textLine,contentWidth,options.ascCharWidth,options.cnCharWidth):lineWidth>0?Math.floor(textLine.length*contentWidth/lineWidth):0;lineWidth=getWidth(textLine=textLine.substr(0,subLength),font)}""===textLine&&(textLine=options.placeholder),out.textLine=textLine,out.isTruncated=!0}function estimateLength(text,contentWidth,ascCharWidth,cnCharWidth){for(var width=0,i=0,len=text.length;i<len&&width<contentWidth;i++){var charCode=text.charCodeAt(i);width+=0<=charCode&&charCode<=127?ascCharWidth:cnCharWidth}return i}var RichTextToken=function(){},RichTextLine=function(tokens){this.tokens=[],tokens&&(this.tokens=tokens)},RichTextContentBlock=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1};function pushTokens(block,str,style,wrapInfo,styleName){var strLines,linesWidths,isEmptyStr=""===str,tokenStyle=styleName&&style.rich[styleName]||{},lines=block.lines,font=tokenStyle.font||style.font,newLine=!1;if(wrapInfo){var tokenPadding=tokenStyle.padding,tokenPaddingH=tokenPadding?tokenPadding[1]+tokenPadding[3]:0;if(null!=tokenStyle.width&&"auto"!==tokenStyle.width){var outerWidth_1=parsePercent$1(tokenStyle.width,wrapInfo.width)+tokenPaddingH;lines.length>0&&outerWidth_1+wrapInfo.accumWidth>wrapInfo.width&&(strLines=str.split("\n"),newLine=!0),wrapInfo.accumWidth=outerWidth_1}else{var res=wrapText(str,font,wrapInfo.width,wrapInfo.breakAll,wrapInfo.accumWidth);wrapInfo.accumWidth=res.accumWidth+tokenPaddingH,linesWidths=res.linesWidths,strLines=res.lines}}else strLines=str.split("\n");for(var i=0;i<strLines.length;i++){var text=strLines[i],token=new RichTextToken;if(token.styleName=styleName,token.text=text,token.isLineHolder=!text&&!isEmptyStr,"number"==typeof tokenStyle.width?token.width=tokenStyle.width:token.width=linesWidths?linesWidths[i]:getWidth(text,font),i||newLine)lines.push(new RichTextLine([token]));else{var tokens=(lines[lines.length-1]||(lines[0]=new RichTextLine)).tokens,tokensLen=tokens.length;1===tokensLen&&tokens[0].isLineHolder?tokens[0]=token:(text||!tokensLen||isEmptyStr)&&tokens.push(token)}}}var breakCharMap=reduce(",&?/;] ".split(""),(function(obj,ch){return obj[ch]=!0,obj}),{});function isWordBreakChar(ch){return!function(ch){var code=ch.charCodeAt(0);return code>=32&&code<=591||code>=880&&code<=4351||code>=4608&&code<=5119||code>=7680&&code<=8303}(ch)||!!breakCharMap[ch]}function wrapText(text,font,lineWidth,isBreakAll,lastAccumWidth){for(var lines=[],linesWidths=[],line="",currentWord="",currentWordWidth=0,accumWidth=0,i=0;i<text.length;i++){var ch=text.charAt(i);if("\n"!==ch){var chWidth=getWidth(ch,font),inWord=!isBreakAll&&!isWordBreakChar(ch);(lines.length?accumWidth+chWidth>lineWidth:lastAccumWidth+accumWidth+chWidth>lineWidth)?accumWidth?(line||currentWord)&&(inWord?(line||(line=currentWord,currentWord="",accumWidth=currentWordWidth=0),lines.push(line),linesWidths.push(accumWidth-currentWordWidth),currentWord+=ch,line="",accumWidth=currentWordWidth+=chWidth):(currentWord&&(line+=currentWord,currentWord="",currentWordWidth=0),lines.push(line),linesWidths.push(accumWidth),line=ch,accumWidth=chWidth)):inWord?(lines.push(currentWord),linesWidths.push(currentWordWidth),currentWord=ch,currentWordWidth=chWidth):(lines.push(ch),linesWidths.push(chWidth)):(accumWidth+=chWidth,inWord?(currentWord+=ch,currentWordWidth+=chWidth):(currentWord&&(line+=currentWord,currentWord="",currentWordWidth=0),line+=ch))}else currentWord&&(line+=currentWord,accumWidth+=currentWordWidth),lines.push(line),linesWidths.push(accumWidth),line="",currentWord="",currentWordWidth=0,accumWidth=0}return lines.length||line||(line=text,currentWord="",currentWordWidth=0),currentWord&&(line+=currentWord),line&&(lines.push(line),linesWidths.push(accumWidth)),1===lines.length&&(accumWidth+=lastAccumWidth),{accumWidth:accumWidth,lines:lines,linesWidths:linesWidths}}var STYLE_MAGIC_KEY="__zr_style_"+Math.round(10*Math.random()),DEFAULT_COMMON_STYLE={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},DEFAULT_COMMON_ANIMATION_PROPS={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY]=!0;var PRIMARY_STATES_KEYS=["z","z2","invisible"],PRIMARY_STATES_KEYS_IN_HOVER_LAYER=["invisible"],Displayable=function(_super){function Displayable(props){return _super.call(this,props)||this}var dispProto;return __extends(Displayable,_super),Displayable.prototype._init=function(props){for(var keysArr=keys$1(props),i=0;i<keysArr.length;i++){var key=keysArr[i];"style"===key?this.useStyle(props[key]):_super.prototype.attrKV.call(this,key,props[key])}this.style||this.useStyle({})},Displayable.prototype.beforeBrush=function(){},Displayable.prototype.afterBrush=function(){},Displayable.prototype.innerBeforeBrush=function(){},Displayable.prototype.innerAfterBrush=function(){},Displayable.prototype.shouldBePainted=function(viewWidth,viewHeight,considerClipPath,considerAncestors){var m=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&function(el,width,height){tmpRect.copy(el.getBoundingRect()),el.transform&&tmpRect.applyTransform(el.transform);return viewRect.width=width,viewRect.height=height,!tmpRect.intersect(viewRect)}(this,viewWidth,viewHeight)||m&&!m[0]&&!m[3])return!1;if(considerClipPath&&this.__clipPaths)for(var i=0;i<this.__clipPaths.length;++i)if(this.__clipPaths[i].isZeroArea())return!1;if(considerAncestors&&this.parent)for(var parent_1=this.parent;parent_1;){if(parent_1.ignore)return!1;parent_1=parent_1.parent}return!0},Displayable.prototype.contain=function(x,y){return this.rectContain(x,y)},Displayable.prototype.traverse=function(cb,context){cb.call(context,this)},Displayable.prototype.rectContain=function(x,y){var coord=this.transformCoordToLocal(x,y);return this.getBoundingRect().contain(coord[0],coord[1])},Displayable.prototype.getPaintRect=function(){var rect=this._paintRect;if(!this._paintRect||this.__dirty){var transform=this.transform,elRect=this.getBoundingRect(),style=this.style,shadowSize=style.shadowBlur||0,shadowOffsetX=style.shadowOffsetX||0,shadowOffsetY=style.shadowOffsetY||0;rect=this._paintRect||(this._paintRect=new BoundingRect$1(0,0,0,0)),transform?BoundingRect$1.applyTransform(rect,elRect,transform):rect.copy(elRect),(shadowSize||shadowOffsetX||shadowOffsetY)&&(rect.width+=2*shadowSize+Math.abs(shadowOffsetX),rect.height+=2*shadowSize+Math.abs(shadowOffsetY),rect.x=Math.min(rect.x,rect.x+shadowOffsetX-shadowSize),rect.y=Math.min(rect.y,rect.y+shadowOffsetY-shadowSize));var tolerance=this.dirtyRectTolerance;rect.isZero()||(rect.x=Math.floor(rect.x-tolerance),rect.y=Math.floor(rect.y-tolerance),rect.width=Math.ceil(rect.width+1+2*tolerance),rect.height=Math.ceil(rect.height+1+2*tolerance))}return rect},Displayable.prototype.setPrevPaintRect=function(paintRect){paintRect?(this._prevPaintRect=this._prevPaintRect||new BoundingRect$1(0,0,0,0),this._prevPaintRect.copy(paintRect)):this._prevPaintRect=null},Displayable.prototype.getPrevPaintRect=function(){return this._prevPaintRect},Displayable.prototype.animateStyle=function(loop){return this.animate("style",loop)},Displayable.prototype.updateDuringAnimation=function(targetKey){"style"===targetKey?this.dirtyStyle():this.markRedraw()},Displayable.prototype.attrKV=function(key,value){"style"!==key?_super.prototype.attrKV.call(this,key,value):this.style?this.setStyle(value):this.useStyle(value)},Displayable.prototype.setStyle=function(keyOrObj,value){return"string"==typeof keyOrObj?this.style[keyOrObj]=value:extend(this.style,keyOrObj),this.dirtyStyle(),this},Displayable.prototype.dirtyStyle=function(notRedraw){notRedraw||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},Displayable.prototype.dirty=function(){this.dirtyStyle()},Displayable.prototype.styleChanged=function(){return!!(2&this.__dirty)},Displayable.prototype.styleUpdated=function(){this.__dirty&=-3},Displayable.prototype.createStyle=function(obj){return createObject(DEFAULT_COMMON_STYLE,obj)},Displayable.prototype.useStyle=function(obj){obj[STYLE_MAGIC_KEY]||(obj=this.createStyle(obj)),this.__inHover?this.__hoverStyle=obj:this.style=obj,this.dirtyStyle()},Displayable.prototype.isStyleObject=function(obj){return obj[STYLE_MAGIC_KEY]},Displayable.prototype._innerSaveToNormal=function(toState){_super.prototype._innerSaveToNormal.call(this,toState);var normalState=this._normalState;toState.style&&!normalState.style&&(normalState.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(toState,normalState,PRIMARY_STATES_KEYS)},Displayable.prototype._applyStateObj=function(stateName,state,normalState,keepCurrentStates,transition,animationCfg){_super.prototype._applyStateObj.call(this,stateName,state,normalState,keepCurrentStates,transition,animationCfg);var targetStyle,needsRestoreToNormal=!(state&&keepCurrentStates);if(state&&state.style?transition?keepCurrentStates?targetStyle=state.style:(targetStyle=this._mergeStyle(this.createStyle(),normalState.style),this._mergeStyle(targetStyle,state.style)):(targetStyle=this._mergeStyle(this.createStyle(),keepCurrentStates?this.style:normalState.style),this._mergeStyle(targetStyle,state.style)):needsRestoreToNormal&&(targetStyle=normalState.style),targetStyle)if(transition){var sourceStyle=this.style;if(this.style=this.createStyle(needsRestoreToNormal?{}:sourceStyle),needsRestoreToNormal)for(var changedKeys=keys$1(sourceStyle),i=0;i<changedKeys.length;i++){(key=changedKeys[i])in targetStyle&&(targetStyle[key]=targetStyle[key],this.style[key]=sourceStyle[key])}var targetKeys=keys$1(targetStyle);for(i=0;i<targetKeys.length;i++){var key=targetKeys[i];this.style[key]=this.style[key]}this._transitionState(stateName,{style:targetStyle},animationCfg,this.getAnimationStyleProps())}else this.useStyle(targetStyle);var statesKeys=this.__inHover?PRIMARY_STATES_KEYS_IN_HOVER_LAYER:PRIMARY_STATES_KEYS;for(i=0;i<statesKeys.length;i++){key=statesKeys[i];state&&null!=state[key]?this[key]=state[key]:needsRestoreToNormal&&null!=normalState[key]&&(this[key]=normalState[key])}},Displayable.prototype._mergeStates=function(states){for(var mergedStyle,mergedState=_super.prototype._mergeStates.call(this,states),i=0;i<states.length;i++){var state=states[i];state.style&&(mergedStyle=mergedStyle||{},this._mergeStyle(mergedStyle,state.style))}return mergedStyle&&(mergedState.style=mergedStyle),mergedState},Displayable.prototype._mergeStyle=function(targetStyle,sourceStyle){return extend(targetStyle,sourceStyle),targetStyle},Displayable.prototype.getAnimationStyleProps=function(){return DEFAULT_COMMON_ANIMATION_PROPS},Displayable.initDefaultProps=((dispProto=Displayable.prototype).type="displayable",dispProto.invisible=!1,dispProto.z=0,dispProto.z2=0,dispProto.zlevel=0,dispProto.culling=!1,dispProto.cursor="pointer",dispProto.rectHover=!1,dispProto.incremental=!1,dispProto._rect=null,dispProto.dirtyRectTolerance=0,void(dispProto.__dirty=3)),Displayable}(Element$1),tmpRect=new BoundingRect$1(0,0,0,0),viewRect=new BoundingRect$1(0,0,0,0);var Displayable$1=Displayable,mathMin$8=Math.min,mathMax$8=Math.max,mathSin$3=Math.sin,mathCos$3=Math.cos,PI2$7=2*Math.PI,start=create$1(),end=create$1(),extremity=create$1();function fromPoints(points,min,max){if(0!==points.length){for(var p=points[0],left=p[0],right=p[0],top=p[1],bottom=p[1],i=1;i<points.length;i++)p=points[i],left=mathMin$8(left,p[0]),right=mathMax$8(right,p[0]),top=mathMin$8(top,p[1]),bottom=mathMax$8(bottom,p[1]);min[0]=left,min[1]=top,max[0]=right,max[1]=bottom}}function fromLine(x0,y0,x1,y1,min,max){min[0]=mathMin$8(x0,x1),min[1]=mathMin$8(y0,y1),max[0]=mathMax$8(x0,x1),max[1]=mathMax$8(y0,y1)}var xDim=[],yDim=[];function fromCubic(x0,y0,x1,y1,x2,y2,x3,y3,min,max){var cubicExtrema$1=cubicExtrema,cubicAt$1=cubicAt,n=cubicExtrema$1(x0,x1,x2,x3,xDim);min[0]=1/0,min[1]=1/0,max[0]=-1/0,max[1]=-1/0;for(var i=0;i<n;i++){var x=cubicAt$1(x0,x1,x2,x3,xDim[i]);min[0]=mathMin$8(x,min[0]),max[0]=mathMax$8(x,max[0])}n=cubicExtrema$1(y0,y1,y2,y3,yDim);for(i=0;i<n;i++){var y=cubicAt$1(y0,y1,y2,y3,yDim[i]);min[1]=mathMin$8(y,min[1]),max[1]=mathMax$8(y,max[1])}min[0]=mathMin$8(x0,min[0]),max[0]=mathMax$8(x0,max[0]),min[0]=mathMin$8(x3,min[0]),max[0]=mathMax$8(x3,max[0]),min[1]=mathMin$8(y0,min[1]),max[1]=mathMax$8(y0,max[1]),min[1]=mathMin$8(y3,min[1]),max[1]=mathMax$8(y3,max[1])}function fromQuadratic(x0,y0,x1,y1,x2,y2,min,max){var quadraticExtremum$1=quadraticExtremum,quadraticAt=quadraticAt$1,tx=mathMax$8(mathMin$8(quadraticExtremum$1(x0,x1,x2),1),0),ty=mathMax$8(mathMin$8(quadraticExtremum$1(y0,y1,y2),1),0),x=quadraticAt(x0,x1,x2,tx),y=quadraticAt(y0,y1,y2,ty);min[0]=mathMin$8(x0,x2,x),min[1]=mathMin$8(y0,y2,y),max[0]=mathMax$8(x0,x2,x),max[1]=mathMax$8(y0,y2,y)}function fromArc(x,y,rx,ry,startAngle,endAngle,anticlockwise,min,max){var vec2Min=min$1,vec2Max=max$1,diff=Math.abs(startAngle-endAngle);if(diff%PI2$7<1e-4&&diff>1e-4)return min[0]=x-rx,min[1]=y-ry,max[0]=x+rx,void(max[1]=y+ry);if(start[0]=mathCos$3(startAngle)*rx+x,start[1]=mathSin$3(startAngle)*ry+y,end[0]=mathCos$3(endAngle)*rx+x,end[1]=mathSin$3(endAngle)*ry+y,vec2Min(min,start,end),vec2Max(max,start,end),(startAngle%=PI2$7)<0&&(startAngle+=PI2$7),(endAngle%=PI2$7)<0&&(endAngle+=PI2$7),startAngle>endAngle&&!anticlockwise?endAngle+=PI2$7:startAngle<endAngle&&anticlockwise&&(startAngle+=PI2$7),anticlockwise){var tmp=endAngle;endAngle=startAngle,startAngle=tmp}for(var angle=0;angle<endAngle;angle+=Math.PI/2)angle>startAngle&&(extremity[0]=mathCos$3(angle)*rx+x,extremity[1]=mathSin$3(angle)*ry+y,vec2Min(min,extremity,min),vec2Max(max,extremity,max))}var CMD$4={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},tmpOutX=[],tmpOutY=[],min=[],max=[],min2=[],max2=[],mathMin$7=Math.min,mathMax$7=Math.max,mathCos$2=Math.cos,mathSin$2=Math.sin,mathAbs$2=Math.abs,PI$6=Math.PI,PI2$6=2*PI$6,hasTypedArray="undefined"!=typeof Float32Array,tmpAngles=[];function modPI2(radian){return Math.round(radian/PI$6*1e8)/1e8%2*PI$6}function normalizeArcAngles(angles,anticlockwise){var newStartAngle=modPI2(angles[0]);newStartAngle<0&&(newStartAngle+=PI2$6);var delta=newStartAngle-angles[0],newEndAngle=angles[1];newEndAngle+=delta,!anticlockwise&&newEndAngle-newStartAngle>=PI2$6?newEndAngle=newStartAngle+PI2$6:anticlockwise&&newStartAngle-newEndAngle>=PI2$6?newEndAngle=newStartAngle-PI2$6:!anticlockwise&&newStartAngle>newEndAngle?newEndAngle=newStartAngle+(PI2$6-modPI2(newStartAngle-newEndAngle)):anticlockwise&&newStartAngle<newEndAngle&&(newEndAngle=newStartAngle-(PI2$6-modPI2(newEndAngle-newStartAngle))),angles[0]=newStartAngle,angles[1]=newEndAngle}var PathProxy=function(){function PathProxy(notSaveData){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,notSaveData&&(this._saveData=!1),this._saveData&&(this.data=[])}return PathProxy.prototype.increaseVersion=function(){this._version++},PathProxy.prototype.getVersion=function(){return this._version},PathProxy.prototype.setScale=function(sx,sy,segmentIgnoreThreshold){(segmentIgnoreThreshold=segmentIgnoreThreshold||0)>0&&(this._ux=mathAbs$2(segmentIgnoreThreshold/devicePixelRatio/sx)||0,this._uy=mathAbs$2(segmentIgnoreThreshold/devicePixelRatio/sy)||0)},PathProxy.prototype.setDPR=function(dpr){this.dpr=dpr},PathProxy.prototype.setContext=function(ctx){this._ctx=ctx},PathProxy.prototype.getContext=function(){return this._ctx},PathProxy.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},PathProxy.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},PathProxy.prototype.moveTo=function(x,y){return this._drawPendingPt(),this.addData(CMD$4.M,x,y),this._ctx&&this._ctx.moveTo(x,y),this._x0=x,this._y0=y,this._xi=x,this._yi=y,this},PathProxy.prototype.lineTo=function(x,y){var dx=mathAbs$2(x-this._xi),dy=mathAbs$2(y-this._yi),exceedUnit=dx>this._ux||dy>this._uy;if(this.addData(CMD$4.L,x,y),this._ctx&&exceedUnit&&this._ctx.lineTo(x,y),exceedUnit)this._xi=x,this._yi=y,this._pendingPtDist=0;else{var d2=dx*dx+dy*dy;d2>this._pendingPtDist&&(this._pendingPtX=x,this._pendingPtY=y,this._pendingPtDist=d2)}return this},PathProxy.prototype.bezierCurveTo=function(x1,y1,x2,y2,x3,y3){return this._drawPendingPt(),this.addData(CMD$4.C,x1,y1,x2,y2,x3,y3),this._ctx&&this._ctx.bezierCurveTo(x1,y1,x2,y2,x3,y3),this._xi=x3,this._yi=y3,this},PathProxy.prototype.quadraticCurveTo=function(x1,y1,x2,y2){return this._drawPendingPt(),this.addData(CMD$4.Q,x1,y1,x2,y2),this._ctx&&this._ctx.quadraticCurveTo(x1,y1,x2,y2),this._xi=x2,this._yi=y2,this},PathProxy.prototype.arc=function(cx,cy,r,startAngle,endAngle,anticlockwise){this._drawPendingPt(),tmpAngles[0]=startAngle,tmpAngles[1]=endAngle,normalizeArcAngles(tmpAngles,anticlockwise),startAngle=tmpAngles[0];var delta=(endAngle=tmpAngles[1])-startAngle;return this.addData(CMD$4.A,cx,cy,r,r,startAngle,delta,0,anticlockwise?0:1),this._ctx&&this._ctx.arc(cx,cy,r,startAngle,endAngle,anticlockwise),this._xi=mathCos$2(endAngle)*r+cx,this._yi=mathSin$2(endAngle)*r+cy,this},PathProxy.prototype.arcTo=function(x1,y1,x2,y2,radius){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(x1,y1,x2,y2,radius),this},PathProxy.prototype.rect=function(x,y,w,h){return this._drawPendingPt(),this._ctx&&this._ctx.rect(x,y,w,h),this.addData(CMD$4.R,x,y,w,h),this},PathProxy.prototype.closePath=function(){this._drawPendingPt(),this.addData(CMD$4.Z);var ctx=this._ctx,x0=this._x0,y0=this._y0;return ctx&&ctx.closePath(),this._xi=x0,this._yi=y0,this},PathProxy.prototype.fill=function(ctx){ctx&&ctx.fill(),this.toStatic()},PathProxy.prototype.stroke=function(ctx){ctx&&ctx.stroke(),this.toStatic()},PathProxy.prototype.len=function(){return this._len},PathProxy.prototype.setData=function(data){var len=data.length;this.data&&this.data.length===len||!hasTypedArray||(this.data=new Float32Array(len));for(var i=0;i<len;i++)this.data[i]=data[i];this._len=len},PathProxy.prototype.appendPath=function(path){path instanceof Array||(path=[path]);for(var len=path.length,appendSize=0,offset=this._len,i=0;i<len;i++)appendSize+=path[i].len();hasTypedArray&&this.data instanceof Float32Array&&(this.data=new Float32Array(offset+appendSize));for(i=0;i<len;i++)for(var appendPathData=path[i].data,k=0;k<appendPathData.length;k++)this.data[offset++]=appendPathData[k];this._len=offset},PathProxy.prototype.addData=function(cmd,a,b,c,d,e,f,g,h){if(this._saveData){var data=this.data;this._len+arguments.length>data.length&&(this._expandData(),data=this.data);for(var i=0;i<arguments.length;i++)data[this._len++]=arguments[i]}},PathProxy.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},PathProxy.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var newData=[],i=0;i<this._len;i++)newData[i]=this.data[i];this.data=newData}},PathProxy.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var data=this.data;data instanceof Array&&(data.length=this._len,hasTypedArray&&this._len>11&&(this.data=new Float32Array(data)))}},PathProxy.prototype.getBoundingRect=function(){min[0]=min[1]=min2[0]=min2[1]=Number.MAX_VALUE,max[0]=max[1]=max2[0]=max2[1]=-Number.MAX_VALUE;var i,data=this.data,xi=0,yi=0,x0=0,y0=0;for(i=0;i<this._len;){var cmd=data[i++],isFirst=1===i;switch(isFirst&&(x0=xi=data[i],y0=yi=data[i+1]),cmd){case CMD$4.M:xi=x0=data[i++],yi=y0=data[i++],min2[0]=x0,min2[1]=y0,max2[0]=x0,max2[1]=y0;break;case CMD$4.L:fromLine(xi,yi,data[i],data[i+1],min2,max2),xi=data[i++],yi=data[i++];break;case CMD$4.C:fromCubic(xi,yi,data[i++],data[i++],data[i++],data[i++],data[i],data[i+1],min2,max2),xi=data[i++],yi=data[i++];break;case CMD$4.Q:fromQuadratic(xi,yi,data[i++],data[i++],data[i],data[i+1],min2,max2),xi=data[i++],yi=data[i++];break;case CMD$4.A:var cx=data[i++],cy=data[i++],rx=data[i++],ry=data[i++],startAngle=data[i++],endAngle=data[i++]+startAngle;i+=1;var anticlockwise=!data[i++];isFirst&&(x0=mathCos$2(startAngle)*rx+cx,y0=mathSin$2(startAngle)*ry+cy),fromArc(cx,cy,rx,ry,startAngle,endAngle,anticlockwise,min2,max2),xi=mathCos$2(endAngle)*rx+cx,yi=mathSin$2(endAngle)*ry+cy;break;case CMD$4.R:fromLine(x0=xi=data[i++],y0=yi=data[i++],x0+data[i++],y0+data[i++],min2,max2);break;case CMD$4.Z:xi=x0,yi=y0}min$1(min,min,min2),max$1(max,max,max2)}return 0===i&&(min[0]=min[1]=max[0]=max[1]=0),new BoundingRect$1(min[0],min[1],max[0]-min[0],max[1]-min[1])},PathProxy.prototype._calculateLength=function(){var data=this.data,len=this._len,ux=this._ux,uy=this._uy,xi=0,yi=0,x0=0,y0=0;this._pathSegLen||(this._pathSegLen=[]);for(var pathSegLen=this._pathSegLen,pathTotalLen=0,segCount=0,i=0;i<len;){var cmd=data[i++],isFirst=1===i;isFirst&&(x0=xi=data[i],y0=yi=data[i+1]);var l=-1;switch(cmd){case CMD$4.M:xi=x0=data[i++],yi=y0=data[i++];break;case CMD$4.L:var x2=data[i++],dy=(y2=data[i++])-yi;(mathAbs$2(dx=x2-xi)>ux||mathAbs$2(dy)>uy||i===len-1)&&(l=Math.sqrt(dx*dx+dy*dy),xi=x2,yi=y2);break;case CMD$4.C:var x1=data[i++],y1=data[i++],y2=(x2=data[i++],data[i++]),x3=data[i++],y3=data[i++];l=cubicLength(xi,yi,x1,y1,x2,y2,x3,y3,10),xi=x3,yi=y3;break;case CMD$4.Q:l=quadraticLength(xi,yi,x1=data[i++],y1=data[i++],x2=data[i++],y2=data[i++],10),xi=x2,yi=y2;break;case CMD$4.A:var cx=data[i++],cy=data[i++],rx=data[i++],ry=data[i++],startAngle=data[i++],delta=data[i++],endAngle=delta+startAngle;i+=1,isFirst&&(x0=mathCos$2(startAngle)*rx+cx,y0=mathSin$2(startAngle)*ry+cy),l=mathMax$7(rx,ry)*mathMin$7(PI2$6,Math.abs(delta)),xi=mathCos$2(endAngle)*rx+cx,yi=mathSin$2(endAngle)*ry+cy;break;case CMD$4.R:x0=xi=data[i++],y0=yi=data[i++],l=2*data[i++]+2*data[i++];break;case CMD$4.Z:var dx=x0-xi;dy=y0-yi;l=Math.sqrt(dx*dx+dy*dy),xi=x0,yi=y0}l>=0&&(pathSegLen[segCount++]=l,pathTotalLen+=l)}return this._pathLen=pathTotalLen,pathTotalLen},PathProxy.prototype.rebuildPath=function(ctx,percent){var x0,y0,xi,yi,x,y,pathSegLen,displayedLength,pendingPtX,pendingPtY,d=this.data,ux=this._ux,uy=this._uy,len=this._len,drawPart=percent<1,accumLength=0,segCount=0,pendingPtDist=0;if(!drawPart||(this._pathSegLen||this._calculateLength(),pathSegLen=this._pathSegLen,displayedLength=percent*this._pathLen))lo:for(var i=0;i<len;){var cmd=d[i++],isFirst=1===i;switch(isFirst&&(x0=xi=d[i],y0=yi=d[i+1]),cmd!==CMD$4.L&&pendingPtDist>0&&(ctx.lineTo(pendingPtX,pendingPtY),pendingPtDist=0),cmd){case CMD$4.M:x0=xi=d[i++],y0=yi=d[i++],ctx.moveTo(xi,yi);break;case CMD$4.L:x=d[i++],y=d[i++];var dx=mathAbs$2(x-xi),dy=mathAbs$2(y-yi);if(dx>ux||dy>uy){if(drawPart){if(accumLength+(l=pathSegLen[segCount++])>displayedLength){var t=(displayedLength-accumLength)/l;ctx.lineTo(xi*(1-t)+x*t,yi*(1-t)+y*t);break lo}accumLength+=l}ctx.lineTo(x,y),xi=x,yi=y,pendingPtDist=0}else{var d2=dx*dx+dy*dy;d2>pendingPtDist&&(pendingPtX=x,pendingPtY=y,pendingPtDist=d2)}break;case CMD$4.C:var x1=d[i++],y1=d[i++],x2=d[i++],y2=d[i++],x3=d[i++],y3=d[i++];if(drawPart){if(accumLength+(l=pathSegLen[segCount++])>displayedLength){cubicSubdivide(xi,x1,x2,x3,t=(displayedLength-accumLength)/l,tmpOutX),cubicSubdivide(yi,y1,y2,y3,t,tmpOutY),ctx.bezierCurveTo(tmpOutX[1],tmpOutY[1],tmpOutX[2],tmpOutY[2],tmpOutX[3],tmpOutY[3]);break lo}accumLength+=l}ctx.bezierCurveTo(x1,y1,x2,y2,x3,y3),xi=x3,yi=y3;break;case CMD$4.Q:x1=d[i++],y1=d[i++],x2=d[i++],y2=d[i++];if(drawPart){if(accumLength+(l=pathSegLen[segCount++])>displayedLength){quadraticSubdivide(xi,x1,x2,t=(displayedLength-accumLength)/l,tmpOutX),quadraticSubdivide(yi,y1,y2,t,tmpOutY),ctx.quadraticCurveTo(tmpOutX[1],tmpOutY[1],tmpOutX[2],tmpOutY[2]);break lo}accumLength+=l}ctx.quadraticCurveTo(x1,y1,x2,y2),xi=x2,yi=y2;break;case CMD$4.A:var cx=d[i++],cy=d[i++],rx=d[i++],ry=d[i++],startAngle=d[i++],delta=d[i++],psi=d[i++],anticlockwise=!d[i++],r=rx>ry?rx:ry,isEllipse=mathAbs$2(rx-ry)>.001,endAngle=startAngle+delta,breakBuild=!1;if(drawPart)accumLength+(l=pathSegLen[segCount++])>displayedLength&&(endAngle=startAngle+delta*(displayedLength-accumLength)/l,breakBuild=!0),accumLength+=l;if(isEllipse&&ctx.ellipse?ctx.ellipse(cx,cy,rx,ry,psi,startAngle,endAngle,anticlockwise):ctx.arc(cx,cy,r,startAngle,endAngle,anticlockwise),breakBuild)break lo;isFirst&&(x0=mathCos$2(startAngle)*rx+cx,y0=mathSin$2(startAngle)*ry+cy),xi=mathCos$2(endAngle)*rx+cx,yi=mathSin$2(endAngle)*ry+cy;break;case CMD$4.R:x0=xi=d[i],y0=yi=d[i+1],x=d[i++],y=d[i++];var width=d[i++],height=d[i++];if(drawPart){if(accumLength+(l=pathSegLen[segCount++])>displayedLength){var d_1=displayedLength-accumLength;ctx.moveTo(x,y),ctx.lineTo(x+mathMin$7(d_1,width),y),(d_1-=width)>0&&ctx.lineTo(x+width,y+mathMin$7(d_1,height)),(d_1-=height)>0&&ctx.lineTo(x+mathMax$7(width-d_1,0),y+height),(d_1-=width)>0&&ctx.lineTo(x,y+mathMax$7(height-d_1,0));break lo}accumLength+=l}ctx.rect(x,y,width,height);break;case CMD$4.Z:if(drawPart){var l;if(accumLength+(l=pathSegLen[segCount++])>displayedLength){t=(displayedLength-accumLength)/l;ctx.lineTo(xi*(1-t)+x0*t,yi*(1-t)+y0*t);break lo}accumLength+=l}ctx.closePath(),xi=x0,yi=y0}}},PathProxy.prototype.clone=function(){var newProxy=new PathProxy,data=this.data;return newProxy.data=data.slice?data.slice():Array.prototype.slice.call(data),newProxy._len=this._len,newProxy},PathProxy.CMD=CMD$4,PathProxy.initDefaultProps=function(){var proto=PathProxy.prototype;proto._saveData=!0,proto._ux=0,proto._uy=0,proto._pendingPtDist=0,proto._version=0}(),PathProxy}(),PathProxy$1=PathProxy;function containStroke$4(x0,y0,x1,y1,lineWidth,x,y){if(0===lineWidth)return!1;var _l=lineWidth,_a=0;if(y>y0+_l&&y>y1+_l||y<y0-_l&&y<y1-_l||x>x0+_l&&x>x1+_l||x<x0-_l&&x<x1-_l)return!1;if(x0===x1)return Math.abs(x-x0)<=_l/2;var tmp=(_a=(y0-y1)/(x0-x1))*x-y+(x0*y1-x1*y0)/(x0-x1);return tmp*tmp/(_a*_a+1)<=_l/2*_l/2}function containStroke$3(x0,y0,x1,y1,x2,y2,x3,y3,lineWidth,x,y){if(0===lineWidth)return!1;var _l=lineWidth;return!(y>y0+_l&&y>y1+_l&&y>y2+_l&&y>y3+_l||y<y0-_l&&y<y1-_l&&y<y2-_l&&y<y3-_l||x>x0+_l&&x>x1+_l&&x>x2+_l&&x>x3+_l||x<x0-_l&&x<x1-_l&&x<x2-_l&&x<x3-_l)&&cubicProjectPoint(x0,y0,x1,y1,x2,y2,x3,y3,x,y,null)<=_l/2}function containStroke$2(x0,y0,x1,y1,x2,y2,lineWidth,x,y){if(0===lineWidth)return!1;var _l=lineWidth;return!(y>y0+_l&&y>y1+_l&&y>y2+_l||y<y0-_l&&y<y1-_l&&y<y2-_l||x>x0+_l&&x>x1+_l&&x>x2+_l||x<x0-_l&&x<x1-_l&&x<x2-_l)&&quadraticProjectPoint(x0,y0,x1,y1,x2,y2,x,y,null)<=_l/2}var PI2$5=2*Math.PI;function normalizeRadian(angle){return(angle%=PI2$5)<0&&(angle+=PI2$5),angle}var PI2$4=2*Math.PI;function containStroke$1(cx,cy,r,startAngle,endAngle,anticlockwise,lineWidth,x,y){if(0===lineWidth)return!1;var _l=lineWidth;x-=cx,y-=cy;var d=Math.sqrt(x*x+y*y);if(d-_l>r||d+_l<r)return!1;if(Math.abs(startAngle-endAngle)%PI2$4<1e-4)return!0;if(anticlockwise){var tmp=startAngle;startAngle=normalizeRadian(endAngle),endAngle=normalizeRadian(tmp)}else startAngle=normalizeRadian(startAngle),endAngle=normalizeRadian(endAngle);startAngle>endAngle&&(endAngle+=PI2$4);var angle=Math.atan2(y,x);return angle<0&&(angle+=PI2$4),angle>=startAngle&&angle<=endAngle||angle+PI2$4>=startAngle&&angle+PI2$4<=endAngle}function windingLine(x0,y0,x1,y1,x,y){if(y>y0&&y>y1||y<y0&&y<y1)return 0;if(y1===y0)return 0;var t=(y-y0)/(y1-y0),dir=y1<y0?1:-1;1!==t&&0!==t||(dir=y1<y0?.5:-.5);var x_=t*(x1-x0)+x0;return x_===x?1/0:x_>x?dir:0}var CMD$3=PathProxy$1.CMD,PI2$3=2*Math.PI;var roots=[-1,-1,-1],extrema=[-1,-1];function swapExtrema(){var tmp=extrema[0];extrema[0]=extrema[1],extrema[1]=tmp}function windingCubic(x0,y0,x1,y1,x2,y2,x3,y3,x,y){if(y>y0&&y>y1&&y>y2&&y>y3||y<y0&&y<y1&&y<y2&&y<y3)return 0;var nRoots=cubicRootAt(y0,y1,y2,y3,y,roots);if(0===nRoots)return 0;for(var w=0,nExtrema=-1,y0_=void 0,y1_=void 0,i=0;i<nRoots;i++){var t=roots[i],unit=0===t||1===t?.5:1;cubicAt(x0,x1,x2,x3,t)<x||(nExtrema<0&&(nExtrema=cubicExtrema(y0,y1,y2,y3,extrema),extrema[1]<extrema[0]&&nExtrema>1&&swapExtrema(),y0_=cubicAt(y0,y1,y2,y3,extrema[0]),nExtrema>1&&(y1_=cubicAt(y0,y1,y2,y3,extrema[1]))),2===nExtrema?t<extrema[0]?w+=y0_<y0?unit:-unit:t<extrema[1]?w+=y1_<y0_?unit:-unit:w+=y3<y1_?unit:-unit:t<extrema[0]?w+=y0_<y0?unit:-unit:w+=y3<y0_?unit:-unit)}return w}function windingQuadratic(x0,y0,x1,y1,x2,y2,x,y){if(y>y0&&y>y1&&y>y2||y<y0&&y<y1&&y<y2)return 0;var nRoots=function(p0,p1,p2,val,roots){var a=p0-2*p1+p2,b=2*(p1-p0),c=p0-val,n=0;if(isAroundZero(a))isNotAroundZero$1(b)&&(t1=-c/b)>=0&&t1<=1&&(roots[n++]=t1);else{var disc=b*b-4*a*c;if(isAroundZero(disc))(t1=-b/(2*a))>=0&&t1<=1&&(roots[n++]=t1);else if(disc>0){var t1,discSqrt=mathSqrt$3(disc),t2=(-b-discSqrt)/(2*a);(t1=(-b+discSqrt)/(2*a))>=0&&t1<=1&&(roots[n++]=t1),t2>=0&&t2<=1&&(roots[n++]=t2)}}return n}(y0,y1,y2,y,roots);if(0===nRoots)return 0;var t=quadraticExtremum(y0,y1,y2);if(t>=0&&t<=1){for(var w=0,y_=quadraticAt$1(y0,y1,y2,t),i=0;i<nRoots;i++){var unit=0===roots[i]||1===roots[i]?.5:1;quadraticAt$1(x0,x1,x2,roots[i])<x||(roots[i]<t?w+=y_<y0?unit:-unit:w+=y2<y_?unit:-unit)}return w}unit=0===roots[0]||1===roots[0]?.5:1;return quadraticAt$1(x0,x1,x2,roots[0])<x?0:y2<y0?unit:-unit}function windingArc(cx,cy,r,startAngle,endAngle,anticlockwise,x,y){if((y-=cy)>r||y<-r)return 0;var tmp=Math.sqrt(r*r-y*y);roots[0]=-tmp,roots[1]=tmp;var dTheta=Math.abs(startAngle-endAngle);if(dTheta<1e-4)return 0;if(dTheta>=PI2$3-1e-4){startAngle=0,endAngle=PI2$3;var dir=anticlockwise?1:-1;return x>=roots[0]+cx&&x<=roots[1]+cx?dir:0}if(startAngle>endAngle){var tmp_1=startAngle;startAngle=endAngle,endAngle=tmp_1}startAngle<0&&(startAngle+=PI2$3,endAngle+=PI2$3);for(var w=0,i=0;i<2;i++){var x_=roots[i];if(x_+cx>x){var angle=Math.atan2(y,x_);dir=anticlockwise?1:-1;angle<0&&(angle=PI2$3+angle),(angle>=startAngle&&angle<=endAngle||angle+PI2$3>=startAngle&&angle+PI2$3<=endAngle)&&(angle>Math.PI/2&&angle<1.5*Math.PI&&(dir=-dir),w+=dir)}}return w}function containPath(path,lineWidth,isStroke,x,y){for(var x1,y1,a,b,data=path.data,len=path.len(),w=0,xi=0,yi=0,x0=0,y0=0,i=0;i<len;){var cmd=data[i++],isFirst=1===i;switch(cmd===CMD$3.M&&i>1&&(isStroke||(w+=windingLine(xi,yi,x0,y0,x,y))),isFirst&&(x0=xi=data[i],y0=yi=data[i+1]),cmd){case CMD$3.M:xi=x0=data[i++],yi=y0=data[i++];break;case CMD$3.L:if(isStroke){if(containStroke$4(xi,yi,data[i],data[i+1],lineWidth,x,y))return!0}else w+=windingLine(xi,yi,data[i],data[i+1],x,y)||0;xi=data[i++],yi=data[i++];break;case CMD$3.C:if(isStroke){if(containStroke$3(xi,yi,data[i++],data[i++],data[i++],data[i++],data[i],data[i+1],lineWidth,x,y))return!0}else w+=windingCubic(xi,yi,data[i++],data[i++],data[i++],data[i++],data[i],data[i+1],x,y)||0;xi=data[i++],yi=data[i++];break;case CMD$3.Q:if(isStroke){if(containStroke$2(xi,yi,data[i++],data[i++],data[i],data[i+1],lineWidth,x,y))return!0}else w+=windingQuadratic(xi,yi,data[i++],data[i++],data[i],data[i+1],x,y)||0;xi=data[i++],yi=data[i++];break;case CMD$3.A:var cx=data[i++],cy=data[i++],rx=data[i++],ry=data[i++],theta=data[i++],dTheta=data[i++];i+=1;var anticlockwise=!!(1-data[i++]);x1=Math.cos(theta)*rx+cx,y1=Math.sin(theta)*ry+cy,isFirst?(x0=x1,y0=y1):w+=windingLine(xi,yi,x1,y1,x,y);var _x=(x-cx)*ry/rx+cx;if(isStroke){if(containStroke$1(cx,cy,ry,theta,theta+dTheta,anticlockwise,lineWidth,_x,y))return!0}else w+=windingArc(cx,cy,ry,theta,theta+dTheta,anticlockwise,_x,y);xi=Math.cos(theta+dTheta)*rx+cx,yi=Math.sin(theta+dTheta)*ry+cy;break;case CMD$3.R:if(x0=xi=data[i++],y0=yi=data[i++],x1=x0+data[i++],y1=y0+data[i++],isStroke){if(containStroke$4(x0,y0,x1,y0,lineWidth,x,y)||containStroke$4(x1,y0,x1,y1,lineWidth,x,y)||containStroke$4(x1,y1,x0,y1,lineWidth,x,y)||containStroke$4(x0,y1,x0,y0,lineWidth,x,y))return!0}else w+=windingLine(x1,y0,x1,y1,x,y),w+=windingLine(x0,y1,x0,y0,x,y);break;case CMD$3.Z:if(isStroke){if(containStroke$4(xi,yi,x0,y0,lineWidth,x,y))return!0}else w+=windingLine(xi,yi,x0,y0,x,y);xi=x0,yi=y0}}return isStroke||(a=yi,b=y0,Math.abs(a-b)<1e-4)||(w+=windingLine(xi,yi,x0,y0,x,y)||0),0!==w}var DEFAULT_PATH_STYLE=defaults({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},DEFAULT_COMMON_STYLE),DEFAULT_PATH_ANIMATION_PROPS={style:defaults({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},DEFAULT_COMMON_ANIMATION_PROPS.style)},pathCopyParams=TRANSFORMABLE_PROPS.concat(["invisible","culling","z","z2","zlevel","parent"]),Path=function(_super){function Path(opts){return _super.call(this,opts)||this}var pathProto;return __extends(Path,_super),Path.prototype.update=function(){var _this=this;_super.prototype.update.call(this);var style=this.style;if(style.decal){var decalEl=this._decalEl=this._decalEl||new Path;decalEl.buildPath===Path.prototype.buildPath&&(decalEl.buildPath=function(ctx){_this.buildPath(ctx,_this.shape)}),decalEl.silent=!0;var decalElStyle=decalEl.style;for(var key in style)decalElStyle[key]!==style[key]&&(decalElStyle[key]=style[key]);decalElStyle.fill=style.fill?style.decal:null,decalElStyle.decal=null,decalElStyle.shadowColor=null,style.strokeFirst&&(decalElStyle.stroke=null);for(var i=0;i<pathCopyParams.length;++i)decalEl[pathCopyParams[i]]=this[pathCopyParams[i]];decalEl.__dirty|=1}else this._decalEl&&(this._decalEl=null)},Path.prototype.getDecalElement=function(){return this._decalEl},Path.prototype._init=function(props){var keysArr=keys$1(props);this.shape=this.getDefaultShape();var defaultStyle=this.getDefaultStyle();defaultStyle&&this.useStyle(defaultStyle);for(var i=0;i<keysArr.length;i++){var key=keysArr[i],value=props[key];"style"===key?this.style?extend(this.style,value):this.useStyle(value):"shape"===key?extend(this.shape,value):_super.prototype.attrKV.call(this,key,value)}this.style||this.useStyle({})},Path.prototype.getDefaultStyle=function(){return null},Path.prototype.getDefaultShape=function(){return{}},Path.prototype.canBeInsideText=function(){return this.hasFill()},Path.prototype.getInsideTextFill=function(){var pathFill=this.style.fill;if("none"!==pathFill){if(isString(pathFill)){var fillLum=lum(pathFill,0);return fillLum>.5?"#333":fillLum>.2?"#eee":"#ccc"}if(pathFill)return"#ccc"}return"#333"},Path.prototype.getInsideTextStroke=function(textFill){var pathFill=this.style.fill;if(isString(pathFill)){var zr=this.__zr;if(!(!zr||!zr.isDarkMode())===lum(textFill,0)<.4)return pathFill}},Path.prototype.buildPath=function(ctx,shapeCfg,inBatch){},Path.prototype.pathUpdated=function(){this.__dirty&=-5},Path.prototype.getUpdatedPathProxy=function(inBatch){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,inBatch),this.path},Path.prototype.createPathProxy=function(){this.path=new PathProxy$1(!1)},Path.prototype.hasStroke=function(){var style=this.style,stroke=style.stroke;return!(null==stroke||"none"===stroke||!(style.lineWidth>0))},Path.prototype.hasFill=function(){var fill=this.style.fill;return null!=fill&&"none"!==fill},Path.prototype.getBoundingRect=function(){var rect=this._rect,style=this.style,needsUpdateRect=!rect;if(needsUpdateRect){var firstInvoke=!1;this.path||(firstInvoke=!0,this.createPathProxy());var path=this.path;(firstInvoke||4&this.__dirty)&&(path.beginPath(),this.buildPath(path,this.shape,!1),this.pathUpdated()),rect=path.getBoundingRect()}if(this._rect=rect,this.hasStroke()&&this.path&&this.path.len()>0){var rectStroke=this._rectStroke||(this._rectStroke=rect.clone());if(this.__dirty||needsUpdateRect){rectStroke.copy(rect);var lineScale=style.strokeNoScale?this.getLineScale():1,w=style.lineWidth;if(!this.hasFill()){var strokeContainThreshold=this.strokeContainThreshold;w=Math.max(w,null==strokeContainThreshold?4:strokeContainThreshold)}lineScale>1e-10&&(rectStroke.width+=w/lineScale,rectStroke.height+=w/lineScale,rectStroke.x-=w/lineScale/2,rectStroke.y-=w/lineScale/2)}return rectStroke}return rect},Path.prototype.contain=function(x,y){var localPos=this.transformCoordToLocal(x,y),rect=this.getBoundingRect(),style=this.style;if(x=localPos[0],y=localPos[1],rect.contain(x,y)){var pathProxy=this.path;if(this.hasStroke()){var lineWidth=style.lineWidth,lineScale=style.strokeNoScale?this.getLineScale():1;if(lineScale>1e-10&&(this.hasFill()||(lineWidth=Math.max(lineWidth,this.strokeContainThreshold)),function(pathProxy,lineWidth,x,y){return containPath(pathProxy,lineWidth,!0,x,y)}(pathProxy,lineWidth/lineScale,x,y)))return!0}if(this.hasFill())return function(pathProxy,x,y){return containPath(pathProxy,0,!1,x,y)}(pathProxy,x,y)}return!1},Path.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},Path.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},Path.prototype.animateShape=function(loop){return this.animate("shape",loop)},Path.prototype.updateDuringAnimation=function(targetKey){"style"===targetKey?this.dirtyStyle():"shape"===targetKey?this.dirtyShape():this.markRedraw()},Path.prototype.attrKV=function(key,value){"shape"===key?this.setShape(value):_super.prototype.attrKV.call(this,key,value)},Path.prototype.setShape=function(keyOrObj,value){var shape=this.shape;return shape||(shape=this.shape={}),"string"==typeof keyOrObj?shape[keyOrObj]=value:extend(shape,keyOrObj),this.dirtyShape(),this},Path.prototype.shapeChanged=function(){return!!(4&this.__dirty)},Path.prototype.createStyle=function(obj){return createObject(DEFAULT_PATH_STYLE,obj)},Path.prototype._innerSaveToNormal=function(toState){_super.prototype._innerSaveToNormal.call(this,toState);var normalState=this._normalState;toState.shape&&!normalState.shape&&(normalState.shape=extend({},this.shape))},Path.prototype._applyStateObj=function(stateName,state,normalState,keepCurrentStates,transition,animationCfg){_super.prototype._applyStateObj.call(this,stateName,state,normalState,keepCurrentStates,transition,animationCfg);var targetShape,needsRestoreToNormal=!(state&&keepCurrentStates);if(state&&state.shape?transition?keepCurrentStates?targetShape=state.shape:(targetShape=extend({},normalState.shape),extend(targetShape,state.shape)):(targetShape=extend({},keepCurrentStates?this.shape:normalState.shape),extend(targetShape,state.shape)):needsRestoreToNormal&&(targetShape=normalState.shape),targetShape)if(transition){this.shape=extend({},this.shape);for(var targetShapePrimaryProps={},shapeKeys=keys$1(targetShape),i=0;i<shapeKeys.length;i++){var key=shapeKeys[i];"object"==typeof targetShape[key]?this.shape[key]=targetShape[key]:targetShapePrimaryProps[key]=targetShape[key]}this._transitionState(stateName,{shape:targetShapePrimaryProps},animationCfg)}else this.shape=targetShape,this.dirtyShape()},Path.prototype._mergeStates=function(states){for(var mergedShape,mergedState=_super.prototype._mergeStates.call(this,states),i=0;i<states.length;i++){var state=states[i];state.shape&&(mergedShape=mergedShape||{},this._mergeStyle(mergedShape,state.shape))}return mergedShape&&(mergedState.shape=mergedShape),mergedState},Path.prototype.getAnimationStyleProps=function(){return DEFAULT_PATH_ANIMATION_PROPS},Path.prototype.isZeroArea=function(){return!1},Path.extend=function(defaultProps){var Sub=function(_super){function Sub(opts){var _this=_super.call(this,opts)||this;return defaultProps.init&&defaultProps.init.call(_this,opts),_this}return __extends(Sub,_super),Sub.prototype.getDefaultStyle=function(){return clone$3(defaultProps.style)},Sub.prototype.getDefaultShape=function(){return clone$3(defaultProps.shape)},Sub}(Path);for(var key in defaultProps)"function"==typeof defaultProps[key]&&(Sub.prototype[key]=defaultProps[key]);return Sub},Path.initDefaultProps=((pathProto=Path.prototype).type="path",pathProto.strokeContainThreshold=5,pathProto.segmentIgnoreThreshold=0,pathProto.subPixelOptimize=!1,pathProto.autoBatch=!1,void(pathProto.__dirty=7)),Path}(Displayable$1),Path$1=Path,DEFAULT_TSPAN_STYLE=defaults({strokeFirst:!0,font:DEFAULT_FONT,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},DEFAULT_PATH_STYLE),TSpan=function(_super){function TSpan(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(TSpan,_super),TSpan.prototype.hasStroke=function(){var style=this.style,stroke=style.stroke;return null!=stroke&&"none"!==stroke&&style.lineWidth>0},TSpan.prototype.hasFill=function(){var fill=this.style.fill;return null!=fill&&"none"!==fill},TSpan.prototype.createStyle=function(obj){return createObject(DEFAULT_TSPAN_STYLE,obj)},TSpan.prototype.setBoundingRect=function(rect){this._rect=rect},TSpan.prototype.getBoundingRect=function(){var style=this.style;if(!this._rect){var text=style.text;null!=text?text+="":text="";var rect=getBoundingRect(text,style.font,style.textAlign,style.textBaseline);if(rect.x+=style.x||0,rect.y+=style.y||0,this.hasStroke()){var w=style.lineWidth;rect.x-=w/2,rect.y-=w/2,rect.width+=w,rect.height+=w}this._rect=rect}return this._rect},TSpan.initDefaultProps=void(TSpan.prototype.dirtyRectTolerance=10),TSpan}(Displayable$1);TSpan.prototype.type="tspan";var TSpan$1=TSpan,DEFAULT_IMAGE_STYLE=defaults({x:0,y:0},DEFAULT_COMMON_STYLE),DEFAULT_IMAGE_ANIMATION_PROPS={style:defaults({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},DEFAULT_COMMON_ANIMATION_PROPS.style)};var ZRImage=function(_super){function ZRImage(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ZRImage,_super),ZRImage.prototype.createStyle=function(obj){return createObject(DEFAULT_IMAGE_STYLE,obj)},ZRImage.prototype._getSize=function(dim){var style=this.style,size=style[dim];if(null!=size)return size;var source,imageSource=(source=style.image)&&"string"!=typeof source&&source.width&&source.height?style.image:this.__image;if(!imageSource)return 0;var otherDim="width"===dim?"height":"width",otherDimSize=style[otherDim];return null==otherDimSize?imageSource[dim]:imageSource[dim]/imageSource[otherDim]*otherDimSize},ZRImage.prototype.getWidth=function(){return this._getSize("width")},ZRImage.prototype.getHeight=function(){return this._getSize("height")},ZRImage.prototype.getAnimationStyleProps=function(){return DEFAULT_IMAGE_ANIMATION_PROPS},ZRImage.prototype.getBoundingRect=function(){var style=this.style;return this._rect||(this._rect=new BoundingRect$1(style.x||0,style.y||0,this.getWidth(),this.getHeight())),this._rect},ZRImage}(Displayable$1);ZRImage.prototype.type="image";var ZRImage$1=ZRImage;var round$2=Math.round;function subPixelOptimizeLine$1(outputShape,inputShape,style){if(inputShape){var x1=inputShape.x1,x2=inputShape.x2,y1=inputShape.y1,y2=inputShape.y2;outputShape.x1=x1,outputShape.x2=x2,outputShape.y1=y1,outputShape.y2=y2;var lineWidth=style&&style.lineWidth;return lineWidth?(round$2(2*x1)===round$2(2*x2)&&(outputShape.x1=outputShape.x2=subPixelOptimize$1(x1,lineWidth,!0)),round$2(2*y1)===round$2(2*y2)&&(outputShape.y1=outputShape.y2=subPixelOptimize$1(y1,lineWidth,!0)),outputShape):outputShape}}function subPixelOptimizeRect$1(outputShape,inputShape,style){if(inputShape){var originX=inputShape.x,originY=inputShape.y,originWidth=inputShape.width,originHeight=inputShape.height;outputShape.x=originX,outputShape.y=originY,outputShape.width=originWidth,outputShape.height=originHeight;var lineWidth=style&&style.lineWidth;return lineWidth?(outputShape.x=subPixelOptimize$1(originX,lineWidth,!0),outputShape.y=subPixelOptimize$1(originY,lineWidth,!0),outputShape.width=Math.max(subPixelOptimize$1(originX+originWidth,lineWidth,!1)-outputShape.x,0===originWidth?0:1),outputShape.height=Math.max(subPixelOptimize$1(originY+originHeight,lineWidth,!1)-outputShape.y,0===originHeight?0:1),outputShape):outputShape}}function subPixelOptimize$1(position,lineWidth,positiveOrNegative){if(!lineWidth)return position;var doubledPosition=round$2(2*position);return(doubledPosition+round$2(lineWidth))%2==0?doubledPosition/2:(doubledPosition+(positiveOrNegative?1:-1))/2}var RectShape=function(){this.x=0,this.y=0,this.width=0,this.height=0},subPixelOptimizeOutputShape$1={},Rect$3=function(_super){function Rect(opts){return _super.call(this,opts)||this}return __extends(Rect,_super),Rect.prototype.getDefaultShape=function(){return new RectShape},Rect.prototype.buildPath=function(ctx,shape){var x,y,width,height;if(this.subPixelOptimize){var optimizedShape=subPixelOptimizeRect$1(subPixelOptimizeOutputShape$1,shape,this.style);x=optimizedShape.x,y=optimizedShape.y,width=optimizedShape.width,height=optimizedShape.height,optimizedShape.r=shape.r,shape=optimizedShape}else x=shape.x,y=shape.y,width=shape.width,height=shape.height;shape.r?function(ctx,shape){var r1,r2,r3,r4,total,x=shape.x,y=shape.y,width=shape.width,height=shape.height,r=shape.r;width<0&&(x+=width,width=-width),height<0&&(y+=height,height=-height),"number"==typeof r?r1=r2=r3=r4=r:r instanceof Array?1===r.length?r1=r2=r3=r4=r[0]:2===r.length?(r1=r3=r[0],r2=r4=r[1]):3===r.length?(r1=r[0],r2=r4=r[1],r3=r[2]):(r1=r[0],r2=r[1],r3=r[2],r4=r[3]):r1=r2=r3=r4=0,r1+r2>width&&(r1*=width/(total=r1+r2),r2*=width/total),r3+r4>width&&(r3*=width/(total=r3+r4),r4*=width/total),r2+r3>height&&(r2*=height/(total=r2+r3),r3*=height/total),r1+r4>height&&(r1*=height/(total=r1+r4),r4*=height/total),ctx.moveTo(x+r1,y),ctx.lineTo(x+width-r2,y),0!==r2&&ctx.arc(x+width-r2,y+r2,r2,-Math.PI/2,0),ctx.lineTo(x+width,y+height-r3),0!==r3&&ctx.arc(x+width-r3,y+height-r3,r3,0,Math.PI/2),ctx.lineTo(x+r4,y+height),0!==r4&&ctx.arc(x+r4,y+height-r4,r4,Math.PI/2,Math.PI),ctx.lineTo(x,y+r1),0!==r1&&ctx.arc(x+r1,y+r1,r1,Math.PI,1.5*Math.PI)}(ctx,shape):ctx.rect(x,y,width,height)},Rect.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},Rect}(Path$1);Rect$3.prototype.type="rect";var Rect$4=Rect$3,DEFAULT_RICH_TEXT_COLOR={fill:"#000"},DEFAULT_TEXT_ANIMATION_PROPS={style:defaults({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},DEFAULT_COMMON_ANIMATION_PROPS.style)},ZRText=function(_super){function ZRText(opts){var _this=_super.call(this)||this;return _this.type="text",_this._children=[],_this._defaultStyle=DEFAULT_RICH_TEXT_COLOR,_this.attr(opts),_this}return __extends(ZRText,_super),ZRText.prototype.childrenRef=function(){return this._children},ZRText.prototype.update=function(){_super.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var i=0;i<this._children.length;i++){var child=this._children[i];child.zlevel=this.zlevel,child.z=this.z,child.z2=this.z2,child.culling=this.culling,child.cursor=this.cursor,child.invisible=this.invisible}},ZRText.prototype.updateTransform=function(){var innerTransformable=this.innerTransformable;innerTransformable?(innerTransformable.updateTransform(),innerTransformable.transform&&(this.transform=innerTransformable.transform)):_super.prototype.updateTransform.call(this)},ZRText.prototype.getLocalTransform=function(m){var innerTransformable=this.innerTransformable;return innerTransformable?innerTransformable.getLocalTransform(m):_super.prototype.getLocalTransform.call(this,m)},ZRText.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),_super.prototype.getComputedTransform.call(this)},ZRText.prototype._updateSubTexts=function(){this._childCursor=0,function(style){normalizeStyle(style),each$b(style.rich,normalizeStyle)}(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},ZRText.prototype.addSelfToZr=function(zr){_super.prototype.addSelfToZr.call(this,zr);for(var i=0;i<this._children.length;i++)this._children[i].__zr=zr},ZRText.prototype.removeSelfFromZr=function(zr){_super.prototype.removeSelfFromZr.call(this,zr);for(var i=0;i<this._children.length;i++)this._children[i].__zr=null},ZRText.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var tmpRect=new BoundingRect$1(0,0,0,0),children=this._children,tmpMat=[],rect=null,i=0;i<children.length;i++){var child=children[i],childRect=child.getBoundingRect(),transform=child.getLocalTransform(tmpMat);transform?(tmpRect.copy(childRect),tmpRect.applyTransform(transform),(rect=rect||tmpRect.clone()).union(tmpRect)):(rect=rect||childRect.clone()).union(childRect)}this._rect=rect||tmpRect}return this._rect},ZRText.prototype.setDefaultTextStyle=function(defaultTextStyle){this._defaultStyle=defaultTextStyle||DEFAULT_RICH_TEXT_COLOR},ZRText.prototype.setTextContent=function(textContent){if("production"!==process.env.NODE_ENV)throw new Error("Can't attach text on another text")},ZRText.prototype._mergeStyle=function(targetStyle,sourceStyle){if(!sourceStyle)return targetStyle;var sourceRich=sourceStyle.rich,targetRich=targetStyle.rich||sourceRich&&{};return extend(targetStyle,sourceStyle),sourceRich&&targetRich?(this._mergeRich(targetRich,sourceRich),targetStyle.rich=targetRich):targetRich&&(targetStyle.rich=targetRich),targetStyle},ZRText.prototype._mergeRich=function(targetRich,sourceRich){for(var richNames=keys$1(sourceRich),i=0;i<richNames.length;i++){var richName=richNames[i];targetRich[richName]=targetRich[richName]||{},extend(targetRich[richName],sourceRich[richName])}},ZRText.prototype.getAnimationStyleProps=function(){return DEFAULT_TEXT_ANIMATION_PROPS},ZRText.prototype._getOrCreateChild=function(Ctor){var child=this._children[this._childCursor];return child&&child instanceof Ctor||(child=new Ctor),this._children[this._childCursor++]=child,child.__zr=this.__zr,child.parent=this,child},ZRText.prototype._updatePlainTexts=function(){var style=this.style,textFont=style.font||DEFAULT_FONT,textPadding=style.padding,contentBlock=function(text,style){null!=text&&(text+="");var lines,overflow=style.overflow,padding=style.padding,font=style.font,truncate="truncate"===overflow,calculatedLineHeight=getLineHeight(font),lineHeight=retrieve2(style.lineHeight,calculatedLineHeight),bgColorDrawn=!!style.backgroundColor,truncateLineOverflow="truncate"===style.lineOverflow,isTruncated=!1,width=style.width,contentHeight=(lines=null==width||"break"!==overflow&&"breakAll"!==overflow?text?text.split("\n"):[]:text?wrapText(text,style.font,width,"breakAll"===overflow,0).lines:[]).length*lineHeight,height=retrieve2(style.height,contentHeight);if(contentHeight>height&&truncateLineOverflow){var lineCount=Math.floor(height/lineHeight);isTruncated=isTruncated||lines.length>lineCount,lines=lines.slice(0,lineCount)}if(text&&truncate&&null!=width)for(var options=prepareTruncateOptions(width,font,style.ellipsis,{minChar:style.truncateMinChar,placeholder:style.placeholder}),singleOut={},i=0;i<lines.length;i++)truncateSingleLine(singleOut,lines[i],options),lines[i]=singleOut.textLine,isTruncated=isTruncated||singleOut.isTruncated;var outerHeight=height,contentWidth=0;for(i=0;i<lines.length;i++)contentWidth=Math.max(getWidth(lines[i],font),contentWidth);null==width&&(width=contentWidth);var outerWidth=contentWidth;return padding&&(outerHeight+=padding[0]+padding[2],outerWidth+=padding[1]+padding[3],width+=padding[1]+padding[3]),bgColorDrawn&&(outerWidth=width),{lines:lines,height:height,outerWidth:outerWidth,outerHeight:outerHeight,lineHeight:lineHeight,calculatedLineHeight:calculatedLineHeight,contentWidth:contentWidth,contentHeight:contentHeight,width:width,isTruncated:isTruncated}}(getStyleText(style),style),needDrawBg=needDrawBackground(style),bgColorDrawn=!!style.backgroundColor,outerHeight=contentBlock.outerHeight,outerWidth=contentBlock.outerWidth,contentWidth=contentBlock.contentWidth,textLines=contentBlock.lines,lineHeight=contentBlock.lineHeight,defaultStyle=this._defaultStyle;this.isTruncated=!!contentBlock.isTruncated;var baseX=style.x||0,baseY=style.y||0,textAlign=style.align||defaultStyle.align||"left",verticalAlign=style.verticalAlign||defaultStyle.verticalAlign||"top",textX=baseX,textY=adjustTextY(baseY,contentBlock.contentHeight,verticalAlign);if(needDrawBg||textPadding){var boxX=adjustTextX(baseX,outerWidth,textAlign),boxY=adjustTextY(baseY,outerHeight,verticalAlign);needDrawBg&&this._renderBackground(style,style,boxX,boxY,outerWidth,outerHeight)}textY+=lineHeight/2,textPadding&&(textX=getTextXForPadding(baseX,textAlign,textPadding),"top"===verticalAlign?textY+=textPadding[0]:"bottom"===verticalAlign&&(textY-=textPadding[2]));for(var defaultLineWidth=0,useDefaultFill=!1,textFill=(getFill("fill"in style?style.fill:(useDefaultFill=!0,defaultStyle.fill))),textStroke=(getStroke("stroke"in style?style.stroke:bgColorDrawn||defaultStyle.autoStroke&&!useDefaultFill?null:(defaultLineWidth=2,defaultStyle.stroke))),hasShadow=style.textShadowBlur>0,fixedBoundingRect=null!=style.width&&("truncate"===style.overflow||"break"===style.overflow||"breakAll"===style.overflow),calculatedLineHeight=contentBlock.calculatedLineHeight,i=0;i<textLines.length;i++){var el=this._getOrCreateChild(TSpan$1),subElStyle=el.createStyle();el.useStyle(subElStyle),subElStyle.text=textLines[i],subElStyle.x=textX,subElStyle.y=textY,textAlign&&(subElStyle.textAlign=textAlign),subElStyle.textBaseline="middle",subElStyle.opacity=style.opacity,subElStyle.strokeFirst=!0,hasShadow&&(subElStyle.shadowBlur=style.textShadowBlur||0,subElStyle.shadowColor=style.textShadowColor||"transparent",subElStyle.shadowOffsetX=style.textShadowOffsetX||0,subElStyle.shadowOffsetY=style.textShadowOffsetY||0),subElStyle.stroke=textStroke,subElStyle.fill=textFill,textStroke&&(subElStyle.lineWidth=style.lineWidth||defaultLineWidth,subElStyle.lineDash=style.lineDash,subElStyle.lineDashOffset=style.lineDashOffset||0),subElStyle.font=textFont,setSeparateFont(subElStyle,style),textY+=lineHeight,fixedBoundingRect&&el.setBoundingRect(new BoundingRect$1(adjustTextX(subElStyle.x,contentWidth,subElStyle.textAlign),adjustTextY(subElStyle.y,calculatedLineHeight,subElStyle.textBaseline),contentWidth,calculatedLineHeight))}},ZRText.prototype._updateRichTexts=function(){var style=this.style,contentBlock=function(text,style){var contentBlock=new RichTextContentBlock;if(null!=text&&(text+=""),!text)return contentBlock;for(var result,topWidth=style.width,topHeight=style.height,overflow=style.overflow,wrapInfo="break"!==overflow&&"breakAll"!==overflow||null==topWidth?null:{width:topWidth,accumWidth:0,breakAll:"breakAll"===overflow},lastIndex=STYLE_REG.lastIndex=0;null!=(result=STYLE_REG.exec(text));){var matchedIndex=result.index;matchedIndex>lastIndex&&pushTokens(contentBlock,text.substring(lastIndex,matchedIndex),style,wrapInfo),pushTokens(contentBlock,result[2],style,wrapInfo,result[1]),lastIndex=STYLE_REG.lastIndex}lastIndex<text.length&&pushTokens(contentBlock,text.substring(lastIndex,text.length),style,wrapInfo);var pendingList=[],calculatedHeight=0,calculatedWidth=0,stlPadding=style.padding,truncate="truncate"===overflow,truncateLine="truncate"===style.lineOverflow,tmpTruncateOut={};function finishLine(line,lineWidth,lineHeight){line.width=lineWidth,line.lineHeight=lineHeight,calculatedHeight+=lineHeight,calculatedWidth=Math.max(calculatedWidth,lineWidth)}outer:for(var i=0;i<contentBlock.lines.length;i++){for(var line=contentBlock.lines[i],lineHeight=0,lineWidth=0,j=0;j<line.tokens.length;j++){var tokenStyle=(token=line.tokens[j]).styleName&&style.rich[token.styleName]||{},textPadding=token.textPadding=tokenStyle.padding,paddingH=textPadding?textPadding[1]+textPadding[3]:0,font=token.font=tokenStyle.font||style.font;token.contentHeight=getLineHeight(font);var tokenHeight=retrieve2(tokenStyle.height,token.contentHeight);if(token.innerHeight=tokenHeight,textPadding&&(tokenHeight+=textPadding[0]+textPadding[2]),token.height=tokenHeight,token.lineHeight=retrieve3(tokenStyle.lineHeight,style.lineHeight,tokenHeight),token.align=tokenStyle&&tokenStyle.align||style.align,token.verticalAlign=tokenStyle&&tokenStyle.verticalAlign||"middle",truncateLine&&null!=topHeight&&calculatedHeight+token.lineHeight>topHeight){var originalLength=contentBlock.lines.length;j>0?(line.tokens=line.tokens.slice(0,j),finishLine(line,lineWidth,lineHeight),contentBlock.lines=contentBlock.lines.slice(0,i+1)):contentBlock.lines=contentBlock.lines.slice(0,i),contentBlock.isTruncated=contentBlock.isTruncated||contentBlock.lines.length<originalLength;break outer}var styleTokenWidth=tokenStyle.width,tokenWidthNotSpecified=null==styleTokenWidth||"auto"===styleTokenWidth;if("string"==typeof styleTokenWidth&&"%"===styleTokenWidth.charAt(styleTokenWidth.length-1))token.percentWidth=styleTokenWidth,pendingList.push(token),token.contentWidth=getWidth(token.text,font);else{if(tokenWidthNotSpecified){var textBackgroundColor=tokenStyle.backgroundColor,bgImg=textBackgroundColor&&textBackgroundColor.image;bgImg&&isImageReady(bgImg=findExistImage(bgImg))&&(token.width=Math.max(token.width,bgImg.width*tokenHeight/bgImg.height))}var remainTruncWidth=truncate&&null!=topWidth?topWidth-lineWidth:null;null!=remainTruncWidth&&remainTruncWidth<token.width?!tokenWidthNotSpecified||remainTruncWidth<paddingH?(token.text="",token.width=token.contentWidth=0):(truncateText2(tmpTruncateOut,token.text,remainTruncWidth-paddingH,font,style.ellipsis,{minChar:style.truncateMinChar}),token.text=tmpTruncateOut.text,contentBlock.isTruncated=contentBlock.isTruncated||tmpTruncateOut.isTruncated,token.width=token.contentWidth=getWidth(token.text,font)):token.contentWidth=getWidth(token.text,font)}token.width+=paddingH,lineWidth+=token.width,tokenStyle&&(lineHeight=Math.max(lineHeight,token.lineHeight))}finishLine(line,lineWidth,lineHeight)}for(contentBlock.outerWidth=contentBlock.width=retrieve2(topWidth,calculatedWidth),contentBlock.outerHeight=contentBlock.height=retrieve2(topHeight,calculatedHeight),contentBlock.contentHeight=calculatedHeight,contentBlock.contentWidth=calculatedWidth,stlPadding&&(contentBlock.outerWidth+=stlPadding[1]+stlPadding[3],contentBlock.outerHeight+=stlPadding[0]+stlPadding[2]),i=0;i<pendingList.length;i++){var token,percentWidth=(token=pendingList[i]).percentWidth;token.width=parseInt(percentWidth,10)/100*contentBlock.width}return contentBlock}(getStyleText(style),style),contentWidth=contentBlock.width,outerWidth=contentBlock.outerWidth,outerHeight=contentBlock.outerHeight,textPadding=style.padding,baseX=style.x||0,baseY=style.y||0,defaultStyle=this._defaultStyle,textAlign=style.align||defaultStyle.align,verticalAlign=style.verticalAlign||defaultStyle.verticalAlign;this.isTruncated=!!contentBlock.isTruncated;var boxX=adjustTextX(baseX,outerWidth,textAlign),boxY=adjustTextY(baseY,outerHeight,verticalAlign),xLeft=boxX,lineTop=boxY;textPadding&&(xLeft+=textPadding[3],lineTop+=textPadding[0]);var xRight=xLeft+contentWidth;needDrawBackground(style)&&this._renderBackground(style,style,boxX,boxY,outerWidth,outerHeight);for(var bgColorDrawn=!!style.backgroundColor,i=0;i<contentBlock.lines.length;i++){for(var line=contentBlock.lines[i],tokens=line.tokens,tokenCount=tokens.length,lineHeight=line.lineHeight,remainedWidth=line.width,leftIndex=0,lineXLeft=xLeft,lineXRight=xRight,rightIndex=tokenCount-1,token=void 0;leftIndex<tokenCount&&(!(token=tokens[leftIndex]).align||"left"===token.align);)this._placeToken(token,style,lineHeight,lineTop,lineXLeft,"left",bgColorDrawn),remainedWidth-=token.width,lineXLeft+=token.width,leftIndex++;for(;rightIndex>=0&&"right"===(token=tokens[rightIndex]).align;)this._placeToken(token,style,lineHeight,lineTop,lineXRight,"right",bgColorDrawn),remainedWidth-=token.width,lineXRight-=token.width,rightIndex--;for(lineXLeft+=(contentWidth-(lineXLeft-xLeft)-(xRight-lineXRight)-remainedWidth)/2;leftIndex<=rightIndex;)token=tokens[leftIndex],this._placeToken(token,style,lineHeight,lineTop,lineXLeft+token.width/2,"center",bgColorDrawn),lineXLeft+=token.width,leftIndex++;lineTop+=lineHeight}},ZRText.prototype._placeToken=function(token,style,lineHeight,lineTop,x,textAlign,parentBgColorDrawn){var tokenStyle=style.rich[token.styleName]||{};tokenStyle.text=token.text;var verticalAlign=token.verticalAlign,y=lineTop+lineHeight/2;"top"===verticalAlign?y=lineTop+token.height/2:"bottom"===verticalAlign&&(y=lineTop+lineHeight-token.height/2),!token.isLineHolder&&needDrawBackground(tokenStyle)&&this._renderBackground(tokenStyle,style,"right"===textAlign?x-token.width:"center"===textAlign?x-token.width/2:x,y-token.height/2,token.width,token.height);var bgColorDrawn=!!tokenStyle.backgroundColor,textPadding=token.textPadding;textPadding&&(x=getTextXForPadding(x,textAlign,textPadding),y-=token.height/2-textPadding[0]-token.innerHeight/2);var el=this._getOrCreateChild(TSpan$1),subElStyle=el.createStyle();el.useStyle(subElStyle);var defaultStyle=this._defaultStyle,useDefaultFill=!1,defaultLineWidth=0,textFill=getFill("fill"in tokenStyle?tokenStyle.fill:"fill"in style?style.fill:(useDefaultFill=!0,defaultStyle.fill)),textStroke=getStroke("stroke"in tokenStyle?tokenStyle.stroke:"stroke"in style?style.stroke:bgColorDrawn||parentBgColorDrawn||defaultStyle.autoStroke&&!useDefaultFill?null:(defaultLineWidth=2,defaultStyle.stroke)),hasShadow=tokenStyle.textShadowBlur>0||style.textShadowBlur>0;subElStyle.text=token.text,subElStyle.x=x,subElStyle.y=y,hasShadow&&(subElStyle.shadowBlur=tokenStyle.textShadowBlur||style.textShadowBlur||0,subElStyle.shadowColor=tokenStyle.textShadowColor||style.textShadowColor||"transparent",subElStyle.shadowOffsetX=tokenStyle.textShadowOffsetX||style.textShadowOffsetX||0,subElStyle.shadowOffsetY=tokenStyle.textShadowOffsetY||style.textShadowOffsetY||0),subElStyle.textAlign=textAlign,subElStyle.textBaseline="middle",subElStyle.font=token.font||DEFAULT_FONT,subElStyle.opacity=retrieve3(tokenStyle.opacity,style.opacity,1),setSeparateFont(subElStyle,tokenStyle),textStroke&&(subElStyle.lineWidth=retrieve3(tokenStyle.lineWidth,style.lineWidth,defaultLineWidth),subElStyle.lineDash=retrieve2(tokenStyle.lineDash,style.lineDash),subElStyle.lineDashOffset=style.lineDashOffset||0,subElStyle.stroke=textStroke),textFill&&(subElStyle.fill=textFill);var textWidth=token.contentWidth,textHeight=token.contentHeight;el.setBoundingRect(new BoundingRect$1(adjustTextX(subElStyle.x,textWidth,subElStyle.textAlign),adjustTextY(subElStyle.y,textHeight,subElStyle.textBaseline),textWidth,textHeight))},ZRText.prototype._renderBackground=function(style,topStyle,x,y,width,height){var rectEl,imgEl,rectStyle,textBackgroundColor=style.backgroundColor,textBorderWidth=style.borderWidth,textBorderColor=style.borderColor,isImageBg=textBackgroundColor&&textBackgroundColor.image,isPlainOrGradientBg=textBackgroundColor&&!isImageBg,textBorderRadius=style.borderRadius,self=this;if(isPlainOrGradientBg||style.lineHeight||textBorderWidth&&textBorderColor){(rectEl=this._getOrCreateChild(Rect$4)).useStyle(rectEl.createStyle()),rectEl.style.fill=null;var rectShape=rectEl.shape;rectShape.x=x,rectShape.y=y,rectShape.width=width,rectShape.height=height,rectShape.r=textBorderRadius,rectEl.dirtyShape()}if(isPlainOrGradientBg)(rectStyle=rectEl.style).fill=textBackgroundColor||null,rectStyle.fillOpacity=retrieve2(style.fillOpacity,1);else if(isImageBg){(imgEl=this._getOrCreateChild(ZRImage$1)).onload=function(){self.dirtyStyle()};var imgStyle=imgEl.style;imgStyle.image=textBackgroundColor.image,imgStyle.x=x,imgStyle.y=y,imgStyle.width=width,imgStyle.height=height}textBorderWidth&&textBorderColor&&((rectStyle=rectEl.style).lineWidth=textBorderWidth,rectStyle.stroke=textBorderColor,rectStyle.strokeOpacity=retrieve2(style.strokeOpacity,1),rectStyle.lineDash=style.borderDash,rectStyle.lineDashOffset=style.borderDashOffset||0,rectEl.strokeContainThreshold=0,rectEl.hasFill()&&rectEl.hasStroke()&&(rectStyle.strokeFirst=!0,rectStyle.lineWidth*=2));var commonStyle=(rectEl||imgEl).style;commonStyle.shadowBlur=style.shadowBlur||0,commonStyle.shadowColor=style.shadowColor||"transparent",commonStyle.shadowOffsetX=style.shadowOffsetX||0,commonStyle.shadowOffsetY=style.shadowOffsetY||0,commonStyle.opacity=retrieve3(style.opacity,topStyle.opacity,1)},ZRText.makeFont=function(style){var font="";return function(style){return null!=style.fontSize||style.fontFamily||style.fontWeight}(style)&&(font=[style.fontStyle,style.fontWeight,parseFontSize(style.fontSize),style.fontFamily||"sans-serif"].join(" ")),font&&trim$1(font)||style.textFont||style.font},ZRText}(Displayable$1),VALID_TEXT_ALIGN={left:!0,right:1,center:1},VALID_TEXT_VERTICAL_ALIGN={top:1,bottom:1,middle:1},FONT_PARTS=["fontStyle","fontWeight","fontSize","fontFamily"];function parseFontSize(fontSize){return"string"!=typeof fontSize||-1===fontSize.indexOf("px")&&-1===fontSize.indexOf("rem")&&-1===fontSize.indexOf("em")?isNaN(+fontSize)?"12px":fontSize+"px":fontSize}function setSeparateFont(targetStyle,sourceStyle){for(var i=0;i<FONT_PARTS.length;i++){var fontProp=FONT_PARTS[i],val=sourceStyle[fontProp];null!=val&&(targetStyle[fontProp]=val)}}function normalizeStyle(style){if(style){style.font=ZRText.makeFont(style);var textAlign=style.align;"middle"===textAlign&&(textAlign="center"),style.align=null==textAlign||VALID_TEXT_ALIGN[textAlign]?textAlign:"left";var verticalAlign=style.verticalAlign;"center"===verticalAlign&&(verticalAlign="middle"),style.verticalAlign=null==verticalAlign||VALID_TEXT_VERTICAL_ALIGN[verticalAlign]?verticalAlign:"top",style.padding&&(style.padding=normalizeCssArray$1(style.padding))}}function getStroke(stroke,lineWidth){return null==stroke||lineWidth<=0||"transparent"===stroke||"none"===stroke?null:stroke.image||stroke.colorStops?"#000":stroke}function getFill(fill){return null==fill||"none"===fill?null:fill.image||fill.colorStops?"#000":fill}function getTextXForPadding(x,textAlign,textPadding){return"right"===textAlign?x-textPadding[1]:"center"===textAlign?x+textPadding[3]/2-textPadding[1]/2:x+textPadding[3]}function getStyleText(style){var text=style.text;return null!=text&&(text+=""),text}function needDrawBackground(style){return!!(style.backgroundColor||style.lineHeight||style.borderWidth&&style.borderColor)}var ZRText$1=ZRText,getECData=makeInner(),setCommonECData=function(seriesIndex,dataType,dataIdx,el){if(el){var ecData=getECData(el);ecData.dataIndex=dataIdx,ecData.dataType=dataType,ecData.seriesIndex=seriesIndex,ecData.ssrType="chart","group"===el.type&&el.traverse((function(child){var childECData=getECData(child);childECData.seriesIndex=seriesIndex,childECData.dataIndex=dataIdx,childECData.dataType=dataType,childECData.ssrType="chart"}))}},_highlightNextDigit=1,_highlightKeyMap={},getSavedStates=makeInner(),getComponentStates=makeInner(),SPECIAL_STATES=["emphasis","blur","select"],DISPLAY_STATES=["normal","emphasis","blur","select"];function hasFillOrStroke(fillOrStroke){return null!=fillOrStroke&&"none"!==fillOrStroke}function doChangeHoverState(el,stateName,hoverStateEnum){el.onHoverStateChange&&(el.hoverState||0)!==hoverStateEnum&&el.onHoverStateChange(stateName),el.hoverState=hoverStateEnum}function singleEnterEmphasis(el){doChangeHoverState(el,"emphasis",2)}function singleLeaveEmphasis(el){2===el.hoverState&&doChangeHoverState(el,"normal",0)}function singleEnterBlur(el){doChangeHoverState(el,"blur",1)}function singleLeaveBlur(el){1===el.hoverState&&doChangeHoverState(el,"normal",0)}function singleEnterSelect(el){el.selected=!0}function singleLeaveSelect(el){el.selected=!1}function updateElementState(el,updater,commonParam){updater(el,commonParam)}function traverseUpdateState(el,updater,commonParam){updateElementState(el,updater,commonParam),el.isGroup&&el.traverse((function(child){updateElementState(child,updater,commonParam)}))}function setStatesFlag(el,stateName){switch(stateName){case"emphasis":el.hoverState=2;break;case"normal":el.hoverState=0;break;case"blur":el.hoverState=1;break;case"select":el.selected=!0}}function elementStateProxy(stateName,targetStates){var state=this.states[stateName];if(this.style){if("emphasis"===stateName)return function(el,stateName,targetStates,state){var hasSelect=targetStates&&indexOf(targetStates,"select")>=0,cloned=!1;if(el instanceof Path$1){var store=getSavedStates(el),fromFill=hasSelect&&store.selectFill||store.normalFill,fromStroke=hasSelect&&store.selectStroke||store.normalStroke;if(hasFillOrStroke(fromFill)||hasFillOrStroke(fromStroke)){var emphasisStyle=(state=state||{}).style||{};"inherit"===emphasisStyle.fill?(cloned=!0,state=extend({},state),(emphasisStyle=extend({},emphasisStyle)).fill=fromFill):!hasFillOrStroke(emphasisStyle.fill)&&hasFillOrStroke(fromFill)?(cloned=!0,state=extend({},state),(emphasisStyle=extend({},emphasisStyle)).fill=liftColor(fromFill)):!hasFillOrStroke(emphasisStyle.stroke)&&hasFillOrStroke(fromStroke)&&(cloned||(state=extend({},state),emphasisStyle=extend({},emphasisStyle)),emphasisStyle.stroke=liftColor(fromStroke)),state.style=emphasisStyle}}if(state&&null==state.z2){cloned||(state=extend({},state));var z2EmphasisLift=el.z2EmphasisLift;state.z2=el.z2+(null!=z2EmphasisLift?z2EmphasisLift:10)}return state}(this,0,targetStates,state);if("blur"===stateName)return function(el,stateName,state){var hasBlur=indexOf(el.currentStates,stateName)>=0,currentOpacity=el.style.opacity,fromState=hasBlur?null:function(el,props,toStateName,defaultValue){for(var style=el.style,fromState={},i=0;i<props.length;i++){var propName=props[i],val=style[propName];fromState[propName]=null==val?defaultValue&&defaultValue[propName]:val}for(i=0;i<el.animators.length;i++){var animator=el.animators[i];animator.__fromStateTransition&&animator.__fromStateTransition.indexOf(toStateName)<0&&"style"===animator.targetName&&animator.saveTo(fromState,props)}return fromState}(el,["opacity"],stateName,{opacity:1}),blurStyle=(state=state||{}).style||{};return null==blurStyle.opacity&&(state=extend({},state),blurStyle=extend({opacity:hasBlur?currentOpacity:.1*fromState.opacity},blurStyle),state.style=blurStyle),state}(this,stateName,state);if("select"===stateName)return function(el,stateName,state){if(state&&null==state.z2){state=extend({},state);var z2SelectLift=el.z2SelectLift;state.z2=el.z2+(null!=z2SelectLift?z2SelectLift:9)}return state}(this,0,state)}return state}function setDefaultStateProxy(el){el.stateProxy=elementStateProxy;var textContent=el.getTextContent(),textGuide=el.getTextGuideLine();textContent&&(textContent.stateProxy=elementStateProxy),textGuide&&(textGuide.stateProxy=elementStateProxy)}function enterEmphasisWhenMouseOver(el,e){!shouldSilent(el,e)&&!el.__highByOuter&&traverseUpdateState(el,singleEnterEmphasis)}function leaveEmphasisWhenMouseOut(el,e){!shouldSilent(el,e)&&!el.__highByOuter&&traverseUpdateState(el,singleLeaveEmphasis)}function enterEmphasis(el,highlightDigit){el.__highByOuter|=1<<(highlightDigit||0),traverseUpdateState(el,singleEnterEmphasis)}function leaveEmphasis(el,highlightDigit){!(el.__highByOuter&=~(1<<(highlightDigit||0)))&&traverseUpdateState(el,singleLeaveEmphasis)}function enterBlur(el){traverseUpdateState(el,singleEnterBlur)}function leaveBlur(el){traverseUpdateState(el,singleLeaveBlur)}function enterSelect(el){traverseUpdateState(el,singleEnterSelect)}function leaveSelect(el){traverseUpdateState(el,singleLeaveSelect)}function shouldSilent(el,e){return el.__highDownSilentOnTouch&&e.zrByTouch}function allLeaveBlur(api){var model=api.getModel(),leaveBlurredSeries=[],allComponentViews=[];model.eachComponent((function(componentType,componentModel){var componentStates=getComponentStates(componentModel),isSeries="series"===componentType,view=isSeries?api.getViewOfSeriesModel(componentModel):api.getViewOfComponentModel(componentModel);!isSeries&&allComponentViews.push(view),componentStates.isBlured&&(view.group.traverse((function(child){singleLeaveBlur(child)})),isSeries&&leaveBlurredSeries.push(componentModel)),componentStates.isBlured=!1})),each$b(allComponentViews,(function(view){view&&view.toggleBlurSeries&&view.toggleBlurSeries(leaveBlurredSeries,!1,model)}))}function blurSeries(targetSeriesIndex,focus,blurScope,api){var ecModel=api.getModel();function leaveBlurOfIndices(data,dataIndices){for(var i=0;i<dataIndices.length;i++){var itemEl=data.getItemGraphicEl(dataIndices[i]);itemEl&&leaveBlur(itemEl)}}if(blurScope=blurScope||"coordinateSystem",null!=targetSeriesIndex&&focus&&"none"!==focus){var targetSeriesModel=ecModel.getSeriesByIndex(targetSeriesIndex),targetCoordSys=targetSeriesModel.coordinateSystem;targetCoordSys&&targetCoordSys.master&&(targetCoordSys=targetCoordSys.master);var blurredSeries=[];ecModel.eachSeries((function(seriesModel){var sameSeries=targetSeriesModel===seriesModel,coordSys=seriesModel.coordinateSystem;if(coordSys&&coordSys.master&&(coordSys=coordSys.master),!("series"===blurScope&&!sameSeries||"coordinateSystem"===blurScope&&!(coordSys&&targetCoordSys?coordSys===targetCoordSys:sameSeries)||"series"===focus&&sameSeries)){if(api.getViewOfSeriesModel(seriesModel).group.traverse((function(child){child.__highByOuter&&sameSeries&&"self"===focus||singleEnterBlur(child)})),isArrayLike(focus))leaveBlurOfIndices(seriesModel.getData(),focus);else if(isObject$3(focus))for(var dataTypes=keys$1(focus),d=0;d<dataTypes.length;d++)leaveBlurOfIndices(seriesModel.getData(dataTypes[d]),focus[dataTypes[d]]);blurredSeries.push(seriesModel),getComponentStates(seriesModel).isBlured=!0}})),ecModel.eachComponent((function(componentType,componentModel){if("series"!==componentType){var view=api.getViewOfComponentModel(componentModel);view&&view.toggleBlurSeries&&view.toggleBlurSeries(blurredSeries,!0,ecModel)}}))}}function blurComponent(componentMainType,componentIndex,api){if(null!=componentMainType&&null!=componentIndex){var componentModel=api.getModel().getComponent(componentMainType,componentIndex);if(componentModel){getComponentStates(componentModel).isBlured=!0;var view=api.getViewOfComponentModel(componentModel);view&&view.focusBlurEnabled&&view.group.traverse((function(child){singleEnterBlur(child)}))}}}function findComponentHighDownDispatchers(componentMainType,componentIndex,name,api){var ret={focusSelf:!1,dispatchers:null};if(null==componentMainType||"series"===componentMainType||null==componentIndex||null==name)return ret;var componentModel=api.getModel().getComponent(componentMainType,componentIndex);if(!componentModel)return ret;var view=api.getViewOfComponentModel(componentModel);if(!view||!view.findHighDownDispatchers)return ret;for(var focusSelf,dispatchers=view.findHighDownDispatchers(name),i=0;i<dispatchers.length;i++)if("production"===process.env.NODE_ENV||isHighDownDispatcher(dispatchers[i])||error("param should be highDownDispatcher"),"self"===getECData(dispatchers[i]).focus){focusSelf=!0;break}return{focusSelf:focusSelf,dispatchers:dispatchers}}function updateSeriesElementSelection(seriesModel){each$b(seriesModel.getAllData(),(function(_a){var data=_a.data,type=_a.type;data.eachItemGraphicEl((function(el,idx){seriesModel.isSelected(idx,type)?enterSelect(el):leaveSelect(el)}))}))}function getAllSelectedIndices(ecModel){var ret=[];return ecModel.eachSeries((function(seriesModel){each$b(seriesModel.getAllData(),(function(_a){_a.data;var type=_a.type,dataIndices=seriesModel.getSelectedDataIndices();if(dataIndices.length>0){var item={dataIndex:dataIndices,seriesIndex:seriesModel.seriesIndex};null!=type&&(item.dataType=type),ret.push(item)}}))})),ret}function enableHoverEmphasis(el,focus,blurScope){setAsHighDownDispatcher(el,!0),traverseUpdateState(el,setDefaultStateProxy),enableHoverFocus(el,focus,blurScope)}function toggleHoverEmphasis(el,focus,blurScope,isDisabled){isDisabled?function(el){setAsHighDownDispatcher(el,!1)}(el):enableHoverEmphasis(el,focus,blurScope)}function enableHoverFocus(el,focus,blurScope){var ecData=getECData(el);null!=focus?(ecData.focus=focus,ecData.blurScope=blurScope):ecData.focus&&(ecData.focus=null)}var OTHER_STATES=["emphasis","blur","select"],defaultStyleGetterMap={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function setStatesStylesFromModel(el,itemModel,styleType,getter){styleType=styleType||"itemStyle";for(var i=0;i<OTHER_STATES.length;i++){var stateName=OTHER_STATES[i],model=itemModel.getModel([stateName,styleType]);el.ensureState(stateName).style=getter?getter(model):model[defaultStyleGetterMap[styleType]]()}}function setAsHighDownDispatcher(el,asDispatcher){var disable=!1===asDispatcher,extendedEl=el;el.highDownSilentOnTouch&&(extendedEl.__highDownSilentOnTouch=el.highDownSilentOnTouch),disable&&!extendedEl.__highDownDispatcher||(extendedEl.__highByOuter=extendedEl.__highByOuter||0,extendedEl.__highDownDispatcher=!disable)}function isHighDownDispatcher(el){return!(!el||!el.__highDownDispatcher)}function isSelectChangePayload(payload){var payloadType=payload.type;return"select"===payloadType||"unselect"===payloadType||"toggleSelect"===payloadType}function isHighDownPayload(payload){var payloadType=payload.type;return"highlight"===payloadType||"downplay"===payloadType}var CMD$2=PathProxy$1.CMD,points=[[],[],[]],mathSqrt$2=Math.sqrt,mathAtan2=Math.atan2;function transformPath(path,m){if(m){var cmd,nPoint,i,j,k,p,data=path.data,len=path.len(),M=CMD$2.M,C=CMD$2.C,L=CMD$2.L,R=CMD$2.R,A=CMD$2.A,Q=CMD$2.Q;for(i=0,j=0;i<len;){switch(cmd=data[i++],j=i,nPoint=0,cmd){case M:case L:nPoint=1;break;case C:nPoint=3;break;case Q:nPoint=2;break;case A:var x=m[4],y=m[5],sx=mathSqrt$2(m[0]*m[0]+m[1]*m[1]),sy=mathSqrt$2(m[2]*m[2]+m[3]*m[3]),angle=mathAtan2(-m[1]/sy,m[0]/sx);data[i]*=sx,data[i++]+=x,data[i]*=sy,data[i++]+=y,data[i++]*=sx,data[i++]*=sy,data[i++]+=angle,data[i++]+=angle,j=i+=2;break;case R:p[0]=data[i++],p[1]=data[i++],applyTransform$1(p,p,m),data[j++]=p[0],data[j++]=p[1],p[0]+=data[i++],p[1]+=data[i++],applyTransform$1(p,p,m),data[j++]=p[0],data[j++]=p[1]}for(k=0;k<nPoint;k++){var p_1=points[k];p_1[0]=data[i++],p_1[1]=data[i++],applyTransform$1(p_1,p_1,m),data[j++]=p_1[0],data[j++]=p_1[1]}}path.increaseVersion()}}var mathSqrt$1=Math.sqrt,mathSin$1=Math.sin,mathCos$1=Math.cos,PI$5=Math.PI;function vMag(v){return Math.sqrt(v[0]*v[0]+v[1]*v[1])}function vRatio(u,v){return(u[0]*v[0]+u[1]*v[1])/(vMag(u)*vMag(v))}function vAngle(u,v){return(u[0]*v[1]<u[1]*v[0]?-1:1)*Math.acos(vRatio(u,v))}function processArc(x1,y1,x2,y2,fa,fs,rx,ry,psiDeg,cmd,path){var psi=psiDeg*(PI$5/180),xp=mathCos$1(psi)*(x1-x2)/2+mathSin$1(psi)*(y1-y2)/2,yp=-1*mathSin$1(psi)*(x1-x2)/2+mathCos$1(psi)*(y1-y2)/2,lambda=xp*xp/(rx*rx)+yp*yp/(ry*ry);lambda>1&&(rx*=mathSqrt$1(lambda),ry*=mathSqrt$1(lambda));var f=(fa===fs?-1:1)*mathSqrt$1((rx*rx*(ry*ry)-rx*rx*(yp*yp)-ry*ry*(xp*xp))/(rx*rx*(yp*yp)+ry*ry*(xp*xp)))||0,cxp=f*rx*yp/ry,cyp=f*-ry*xp/rx,cx=(x1+x2)/2+mathCos$1(psi)*cxp-mathSin$1(psi)*cyp,cy=(y1+y2)/2+mathSin$1(psi)*cxp+mathCos$1(psi)*cyp,theta=vAngle([1,0],[(xp-cxp)/rx,(yp-cyp)/ry]),u=[(xp-cxp)/rx,(yp-cyp)/ry],v=[(-1*xp-cxp)/rx,(-1*yp-cyp)/ry],dTheta=vAngle(u,v);if(vRatio(u,v)<=-1&&(dTheta=PI$5),vRatio(u,v)>=1&&(dTheta=0),dTheta<0){var n=Math.round(dTheta/PI$5*1e6)/1e6;dTheta=2*PI$5+n%2*PI$5}path.addData(cmd,cx,cy,rx,ry,theta,dTheta,psi,fs)}var commandReg=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,numberReg=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var SVGPath=function(_super){function SVGPath(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(SVGPath,_super),SVGPath.prototype.applyTransform=function(m){},SVGPath}(Path$1);function isPathProxy(path){return null!=path.setData}function createPathOptions(str,opts){var pathProxy=function(data){var path=new PathProxy$1;if(!data)return path;var prevCmd,cpx=0,cpy=0,subpathX=cpx,subpathY=cpy,CMD=PathProxy$1.CMD,cmdList=data.match(commandReg);if(!cmdList)return path;for(var l=0;l<cmdList.length;l++){for(var cmdText=cmdList[l],cmdStr=cmdText.charAt(0),cmd=void 0,p=cmdText.match(numberReg)||[],pLen=p.length,i=0;i<pLen;i++)p[i]=parseFloat(p[i]);for(var off=0;off<pLen;){var ctlPtx=void 0,ctlPty=void 0,rx=void 0,ry=void 0,psi=void 0,fa=void 0,fs=void 0,x1=cpx,y1=cpy,len=void 0,pathData=void 0;switch(cmdStr){case"l":cpx+=p[off++],cpy+=p[off++],cmd=CMD.L,path.addData(cmd,cpx,cpy);break;case"L":cpx=p[off++],cpy=p[off++],cmd=CMD.L,path.addData(cmd,cpx,cpy);break;case"m":cpx+=p[off++],cpy+=p[off++],cmd=CMD.M,path.addData(cmd,cpx,cpy),subpathX=cpx,subpathY=cpy,cmdStr="l";break;case"M":cpx=p[off++],cpy=p[off++],cmd=CMD.M,path.addData(cmd,cpx,cpy),subpathX=cpx,subpathY=cpy,cmdStr="L";break;case"h":cpx+=p[off++],cmd=CMD.L,path.addData(cmd,cpx,cpy);break;case"H":cpx=p[off++],cmd=CMD.L,path.addData(cmd,cpx,cpy);break;case"v":cpy+=p[off++],cmd=CMD.L,path.addData(cmd,cpx,cpy);break;case"V":cpy=p[off++],cmd=CMD.L,path.addData(cmd,cpx,cpy);break;case"C":cmd=CMD.C,path.addData(cmd,p[off++],p[off++],p[off++],p[off++],p[off++],p[off++]),cpx=p[off-2],cpy=p[off-1];break;case"c":cmd=CMD.C,path.addData(cmd,p[off++]+cpx,p[off++]+cpy,p[off++]+cpx,p[off++]+cpy,p[off++]+cpx,p[off++]+cpy),cpx+=p[off-2],cpy+=p[off-1];break;case"S":ctlPtx=cpx,ctlPty=cpy,len=path.len(),pathData=path.data,prevCmd===CMD.C&&(ctlPtx+=cpx-pathData[len-4],ctlPty+=cpy-pathData[len-3]),cmd=CMD.C,x1=p[off++],y1=p[off++],cpx=p[off++],cpy=p[off++],path.addData(cmd,ctlPtx,ctlPty,x1,y1,cpx,cpy);break;case"s":ctlPtx=cpx,ctlPty=cpy,len=path.len(),pathData=path.data,prevCmd===CMD.C&&(ctlPtx+=cpx-pathData[len-4],ctlPty+=cpy-pathData[len-3]),cmd=CMD.C,x1=cpx+p[off++],y1=cpy+p[off++],cpx+=p[off++],cpy+=p[off++],path.addData(cmd,ctlPtx,ctlPty,x1,y1,cpx,cpy);break;case"Q":x1=p[off++],y1=p[off++],cpx=p[off++],cpy=p[off++],cmd=CMD.Q,path.addData(cmd,x1,y1,cpx,cpy);break;case"q":x1=p[off++]+cpx,y1=p[off++]+cpy,cpx+=p[off++],cpy+=p[off++],cmd=CMD.Q,path.addData(cmd,x1,y1,cpx,cpy);break;case"T":ctlPtx=cpx,ctlPty=cpy,len=path.len(),pathData=path.data,prevCmd===CMD.Q&&(ctlPtx+=cpx-pathData[len-4],ctlPty+=cpy-pathData[len-3]),cpx=p[off++],cpy=p[off++],cmd=CMD.Q,path.addData(cmd,ctlPtx,ctlPty,cpx,cpy);break;case"t":ctlPtx=cpx,ctlPty=cpy,len=path.len(),pathData=path.data,prevCmd===CMD.Q&&(ctlPtx+=cpx-pathData[len-4],ctlPty+=cpy-pathData[len-3]),cpx+=p[off++],cpy+=p[off++],cmd=CMD.Q,path.addData(cmd,ctlPtx,ctlPty,cpx,cpy);break;case"A":rx=p[off++],ry=p[off++],psi=p[off++],fa=p[off++],fs=p[off++],processArc(x1=cpx,y1=cpy,cpx=p[off++],cpy=p[off++],fa,fs,rx,ry,psi,cmd=CMD.A,path);break;case"a":rx=p[off++],ry=p[off++],psi=p[off++],fa=p[off++],fs=p[off++],processArc(x1=cpx,y1=cpy,cpx+=p[off++],cpy+=p[off++],fa,fs,rx,ry,psi,cmd=CMD.A,path)}}"z"!==cmdStr&&"Z"!==cmdStr||(cmd=CMD.Z,path.addData(cmd),cpx=subpathX,cpy=subpathY),prevCmd=cmd}return path.toStatic(),path}(str),innerOpts=extend({},opts);return innerOpts.buildPath=function(path){if(isPathProxy(path)){path.setData(pathProxy.data),(ctx=path.getContext())&&path.rebuildPath(ctx,1)}else{var ctx=path;pathProxy.rebuildPath(ctx,1)}},innerOpts.applyTransform=function(m){transformPath(pathProxy,m),this.dirtyShape()},innerOpts}function clonePath(sourcePath,opts){opts=opts||{};var path=new Path$1;return sourcePath.shape&&path.setShape(sourcePath.shape),path.setStyle(sourcePath.style),opts.bakeTransform?transformPath(path.path,sourcePath.getComputedTransform()):opts.toLocal?path.setLocalTransform(sourcePath.getComputedTransform()):path.copyTransform(sourcePath),path.buildPath=sourcePath.buildPath,path.applyTransform=path.applyTransform,path.z=sourcePath.z,path.z2=sourcePath.z2,path.zlevel=sourcePath.zlevel,path}var CircleShape=function(){this.cx=0,this.cy=0,this.r=0},Circle=function(_super){function Circle(opts){return _super.call(this,opts)||this}return __extends(Circle,_super),Circle.prototype.getDefaultShape=function(){return new CircleShape},Circle.prototype.buildPath=function(ctx,shape){ctx.moveTo(shape.cx+shape.r,shape.cy),ctx.arc(shape.cx,shape.cy,shape.r,0,2*Math.PI)},Circle}(Path$1);Circle.prototype.type="circle";var Circle$1=Circle,EllipseShape=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Ellipse=function(_super){function Ellipse(opts){return _super.call(this,opts)||this}return __extends(Ellipse,_super),Ellipse.prototype.getDefaultShape=function(){return new EllipseShape},Ellipse.prototype.buildPath=function(ctx,shape){var k=.5522848,x=shape.cx,y=shape.cy,a=shape.rx,b=shape.ry,ox=a*k,oy=b*k;ctx.moveTo(x-a,y),ctx.bezierCurveTo(x-a,y-oy,x-ox,y-b,x,y-b),ctx.bezierCurveTo(x+ox,y-b,x+a,y-oy,x+a,y),ctx.bezierCurveTo(x+a,y+oy,x+ox,y+b,x,y+b),ctx.bezierCurveTo(x-ox,y+b,x-a,y+oy,x-a,y),ctx.closePath()},Ellipse}(Path$1);Ellipse.prototype.type="ellipse";var Ellipse$1=Ellipse,PI$4=Math.PI,PI2$2=2*PI$4,mathSin=Math.sin,mathCos=Math.cos,mathACos=Math.acos,mathATan2=Math.atan2,mathAbs$1=Math.abs,mathSqrt=Math.sqrt,mathMax$6=Math.max,mathMin$6=Math.min,e=1e-4;function computeCornerTangents(x0,y0,x1,y1,radius,cr,clockwise){var x01=x0-x1,y01=y0-y1,lo=(clockwise?cr:-cr)/mathSqrt(x01*x01+y01*y01),ox=lo*y01,oy=-lo*x01,x11=x0+ox,y11=y0+oy,x10=x1+ox,y10=y1+oy,x00=(x11+x10)/2,y00=(y11+y10)/2,dx=x10-x11,dy=y10-y11,d2=dx*dx+dy*dy,r=radius-cr,s=x11*y10-x10*y11,d=(dy<0?-1:1)*mathSqrt(mathMax$6(0,r*r*d2-s*s)),cx0=(s*dy-dx*d)/d2,cy0=(-s*dx-dy*d)/d2,cx1=(s*dy+dx*d)/d2,cy1=(-s*dx+dy*d)/d2,dx0=cx0-x00,dy0=cy0-y00,dx1=cx1-x00,dy1=cy1-y00;return dx0*dx0+dy0*dy0>dx1*dx1+dy1*dy1&&(cx0=cx1,cy0=cy1),{cx:cx0,cy:cy0,x0:-ox,y0:-oy,x1:cx0*(radius/r-1),y1:cy0*(radius/r-1)}}function buildPath$1(ctx,shape){var _a,radius=mathMax$6(shape.r,0),innerRadius=mathMax$6(shape.r0||0,0),hasRadius=radius>0;if(hasRadius||innerRadius>0){if(hasRadius||(radius=innerRadius,innerRadius=0),innerRadius>radius){var tmp=radius;radius=innerRadius,innerRadius=tmp}var startAngle=shape.startAngle,endAngle=shape.endAngle;if(!isNaN(startAngle)&&!isNaN(endAngle)){var cx=shape.cx,cy=shape.cy,clockwise=!!shape.clockwise,arc=mathAbs$1(endAngle-startAngle),mod=arc>PI2$2&&arc%PI2$2;if(mod>e&&(arc=mod),radius>e)if(arc>PI2$2-e)ctx.moveTo(cx+radius*mathCos(startAngle),cy+radius*mathSin(startAngle)),ctx.arc(cx,cy,radius,startAngle,endAngle,!clockwise),innerRadius>e&&(ctx.moveTo(cx+innerRadius*mathCos(endAngle),cy+innerRadius*mathSin(endAngle)),ctx.arc(cx,cy,innerRadius,endAngle,startAngle,clockwise));else{var icrStart=void 0,icrEnd=void 0,ocrStart=void 0,ocrEnd=void 0,ocrs=void 0,ocre=void 0,icrs=void 0,icre=void 0,ocrMax=void 0,icrMax=void 0,limitedOcrMax=void 0,limitedIcrMax=void 0,xre=void 0,yre=void 0,xirs=void 0,yirs=void 0,xrs=radius*mathCos(startAngle),yrs=radius*mathSin(startAngle),xire=innerRadius*mathCos(endAngle),yire=innerRadius*mathSin(endAngle),hasArc=arc>e;if(hasArc){var cornerRadius=shape.cornerRadius;cornerRadius&&(_a=function(cr){var arr;if(isArray(cr)){var len=cr.length;if(!len)return cr;arr=1===len?[cr[0],cr[0],0,0]:2===len?[cr[0],cr[0],cr[1],cr[1]]:3===len?cr.concat(cr[2]):cr}else arr=[cr,cr,cr,cr];return arr}(cornerRadius),icrStart=_a[0],icrEnd=_a[1],ocrStart=_a[2],ocrEnd=_a[3]);var halfRd=mathAbs$1(radius-innerRadius)/2;if(ocrs=mathMin$6(halfRd,ocrStart),ocre=mathMin$6(halfRd,ocrEnd),icrs=mathMin$6(halfRd,icrStart),icre=mathMin$6(halfRd,icrEnd),limitedOcrMax=ocrMax=mathMax$6(ocrs,ocre),limitedIcrMax=icrMax=mathMax$6(icrs,icre),(ocrMax>e||icrMax>e)&&(xre=radius*mathCos(endAngle),yre=radius*mathSin(endAngle),xirs=innerRadius*mathCos(startAngle),yirs=innerRadius*mathSin(startAngle),arc<PI$4)){var it_1=function(x0,y0,x1,y1,x2,y2,x3,y3){var dx10=x1-x0,dy10=y1-y0,dx32=x3-x2,dy32=y3-y2,t=dy32*dx10-dx32*dy10;if(!(t*t<e))return[x0+(t=(dx32*(y0-y2)-dy32*(x0-x2))/t)*dx10,y0+t*dy10]}(xrs,yrs,xirs,yirs,xre,yre,xire,yire);if(it_1){var x0=xrs-it_1[0],y0=yrs-it_1[1],x1=xre-it_1[0],y1=yre-it_1[1],a=1/mathSin(mathACos((x0*x1+y0*y1)/(mathSqrt(x0*x0+y0*y0)*mathSqrt(x1*x1+y1*y1)))/2),b=mathSqrt(it_1[0]*it_1[0]+it_1[1]*it_1[1]);limitedOcrMax=mathMin$6(ocrMax,(radius-b)/(a+1)),limitedIcrMax=mathMin$6(icrMax,(innerRadius-b)/(a-1))}}}if(hasArc)if(limitedOcrMax>e){var crStart=mathMin$6(ocrStart,limitedOcrMax),crEnd=mathMin$6(ocrEnd,limitedOcrMax),ct0=computeCornerTangents(xirs,yirs,xrs,yrs,radius,crStart,clockwise),ct1=computeCornerTangents(xre,yre,xire,yire,radius,crEnd,clockwise);ctx.moveTo(cx+ct0.cx+ct0.x0,cy+ct0.cy+ct0.y0),limitedOcrMax<ocrMax&&crStart===crEnd?ctx.arc(cx+ct0.cx,cy+ct0.cy,limitedOcrMax,mathATan2(ct0.y0,ct0.x0),mathATan2(ct1.y0,ct1.x0),!clockwise):(crStart>0&&ctx.arc(cx+ct0.cx,cy+ct0.cy,crStart,mathATan2(ct0.y0,ct0.x0),mathATan2(ct0.y1,ct0.x1),!clockwise),ctx.arc(cx,cy,radius,mathATan2(ct0.cy+ct0.y1,ct0.cx+ct0.x1),mathATan2(ct1.cy+ct1.y1,ct1.cx+ct1.x1),!clockwise),crEnd>0&&ctx.arc(cx+ct1.cx,cy+ct1.cy,crEnd,mathATan2(ct1.y1,ct1.x1),mathATan2(ct1.y0,ct1.x0),!clockwise))}else ctx.moveTo(cx+xrs,cy+yrs),ctx.arc(cx,cy,radius,startAngle,endAngle,!clockwise);else ctx.moveTo(cx+xrs,cy+yrs);if(innerRadius>e&&hasArc)if(limitedIcrMax>e){crStart=mathMin$6(icrStart,limitedIcrMax),ct0=computeCornerTangents(xire,yire,xre,yre,innerRadius,-(crEnd=mathMin$6(icrEnd,limitedIcrMax)),clockwise),ct1=computeCornerTangents(xrs,yrs,xirs,yirs,innerRadius,-crStart,clockwise);ctx.lineTo(cx+ct0.cx+ct0.x0,cy+ct0.cy+ct0.y0),limitedIcrMax<icrMax&&crStart===crEnd?ctx.arc(cx+ct0.cx,cy+ct0.cy,limitedIcrMax,mathATan2(ct0.y0,ct0.x0),mathATan2(ct1.y0,ct1.x0),!clockwise):(crEnd>0&&ctx.arc(cx+ct0.cx,cy+ct0.cy,crEnd,mathATan2(ct0.y0,ct0.x0),mathATan2(ct0.y1,ct0.x1),!clockwise),ctx.arc(cx,cy,innerRadius,mathATan2(ct0.cy+ct0.y1,ct0.cx+ct0.x1),mathATan2(ct1.cy+ct1.y1,ct1.cx+ct1.x1),clockwise),crStart>0&&ctx.arc(cx+ct1.cx,cy+ct1.cy,crStart,mathATan2(ct1.y1,ct1.x1),mathATan2(ct1.y0,ct1.x0),!clockwise))}else ctx.lineTo(cx+xire,cy+yire),ctx.arc(cx,cy,innerRadius,endAngle,startAngle,clockwise);else ctx.lineTo(cx+xire,cy+yire)}else ctx.moveTo(cx,cy);ctx.closePath()}}}var SectorShape=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},Sector=function(_super){function Sector(opts){return _super.call(this,opts)||this}return __extends(Sector,_super),Sector.prototype.getDefaultShape=function(){return new SectorShape},Sector.prototype.buildPath=function(ctx,shape){buildPath$1(ctx,shape)},Sector.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},Sector}(Path$1);Sector.prototype.type="sector";var Sector$1=Sector,RingShape=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},Ring=function(_super){function Ring(opts){return _super.call(this,opts)||this}return __extends(Ring,_super),Ring.prototype.getDefaultShape=function(){return new RingShape},Ring.prototype.buildPath=function(ctx,shape){var x=shape.cx,y=shape.cy,PI2=2*Math.PI;ctx.moveTo(x+shape.r,y),ctx.arc(x,y,shape.r,0,PI2,!1),ctx.moveTo(x+shape.r0,y),ctx.arc(x,y,shape.r0,0,PI2,!0)},Ring}(Path$1);Ring.prototype.type="ring";var Ring$1=Ring;function buildPath(ctx,shape,closePath){var smooth=shape.smooth,points=shape.points;if(points&&points.length>=2){if(smooth){var controlPoints=function(points,smooth,isLoop,constraint){var prevPoint,nextPoint,min,max,cps=[],v=[],v1=[],v2=[];if(constraint){min=[1/0,1/0],max=[-1/0,-1/0];for(var i=0,len=points.length;i<len;i++)min$1(min,min,points[i]),max$1(max,max,points[i]);min$1(min,min,constraint[0]),max$1(max,max,constraint[1])}for(i=0,len=points.length;i<len;i++){var point=points[i];if(isLoop)prevPoint=points[i?i-1:len-1],nextPoint=points[(i+1)%len];else{if(0===i||i===len-1){cps.push(clone$2(points[i]));continue}prevPoint=points[i-1],nextPoint=points[i+1]}sub(v,nextPoint,prevPoint),scale$2(v,v,smooth);var d0=distance(point,prevPoint),d1=distance(point,nextPoint),sum=d0+d1;0!==sum&&(d0/=sum,d1/=sum),scale$2(v1,v,-d0),scale$2(v2,v,d1);var cp0=add$2([],point,v1),cp1=add$2([],point,v2);constraint&&(max$1(cp0,cp0,min),min$1(cp0,cp0,max),max$1(cp1,cp1,min),min$1(cp1,cp1,max)),cps.push(cp0),cps.push(cp1)}return isLoop&&cps.push(cps.shift()),cps}(points,smooth,closePath,shape.smoothConstraint);ctx.moveTo(points[0][0],points[0][1]);for(var len=points.length,i=0;i<(closePath?len:len-1);i++){var cp1=controlPoints[2*i],cp2=controlPoints[2*i+1],p=points[(i+1)%len];ctx.bezierCurveTo(cp1[0],cp1[1],cp2[0],cp2[1],p[0],p[1])}}else{ctx.moveTo(points[0][0],points[0][1]);i=1;for(var l=points.length;i<l;i++)ctx.lineTo(points[i][0],points[i][1])}closePath&&ctx.closePath()}}var PolygonShape=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},Polygon=function(_super){function Polygon(opts){return _super.call(this,opts)||this}return __extends(Polygon,_super),Polygon.prototype.getDefaultShape=function(){return new PolygonShape},Polygon.prototype.buildPath=function(ctx,shape){buildPath(ctx,shape,!0)},Polygon}(Path$1);Polygon.prototype.type="polygon";var Polygon$1=Polygon,PolylineShape=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},Polyline=function(_super){function Polyline(opts){return _super.call(this,opts)||this}return __extends(Polyline,_super),Polyline.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},Polyline.prototype.getDefaultShape=function(){return new PolylineShape},Polyline.prototype.buildPath=function(ctx,shape){buildPath(ctx,shape,!1)},Polyline}(Path$1);Polyline.prototype.type="polyline";var Polyline$1=Polyline,subPixelOptimizeOutputShape={},LineShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},Line$2=function(_super){function Line(opts){return _super.call(this,opts)||this}return __extends(Line,_super),Line.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},Line.prototype.getDefaultShape=function(){return new LineShape},Line.prototype.buildPath=function(ctx,shape){var x1,y1,x2,y2;if(this.subPixelOptimize){var optimizedShape=subPixelOptimizeLine$1(subPixelOptimizeOutputShape,shape,this.style);x1=optimizedShape.x1,y1=optimizedShape.y1,x2=optimizedShape.x2,y2=optimizedShape.y2}else x1=shape.x1,y1=shape.y1,x2=shape.x2,y2=shape.y2;var percent=shape.percent;0!==percent&&(ctx.moveTo(x1,y1),percent<1&&(x2=x1*(1-percent)+x2*percent,y2=y1*(1-percent)+y2*percent),ctx.lineTo(x2,y2))},Line.prototype.pointAt=function(p){var shape=this.shape;return[shape.x1*(1-p)+shape.x2*p,shape.y1*(1-p)+shape.y2*p]},Line}(Path$1);Line$2.prototype.type="line";var Line$3=Line$2,out=[],BezierCurveShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function someVectorAt(shape,t,isTangent){var cpx2=shape.cpx2,cpy2=shape.cpy2;return null!=cpx2||null!=cpy2?[(isTangent?cubicDerivativeAt:cubicAt)(shape.x1,shape.cpx1,shape.cpx2,shape.x2,t),(isTangent?cubicDerivativeAt:cubicAt)(shape.y1,shape.cpy1,shape.cpy2,shape.y2,t)]:[(isTangent?quadraticDerivativeAt:quadraticAt$1)(shape.x1,shape.cpx1,shape.x2,t),(isTangent?quadraticDerivativeAt:quadraticAt$1)(shape.y1,shape.cpy1,shape.y2,t)]}var BezierCurve=function(_super){function BezierCurve(opts){return _super.call(this,opts)||this}return __extends(BezierCurve,_super),BezierCurve.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},BezierCurve.prototype.getDefaultShape=function(){return new BezierCurveShape},BezierCurve.prototype.buildPath=function(ctx,shape){var x1=shape.x1,y1=shape.y1,x2=shape.x2,y2=shape.y2,cpx1=shape.cpx1,cpy1=shape.cpy1,cpx2=shape.cpx2,cpy2=shape.cpy2,percent=shape.percent;0!==percent&&(ctx.moveTo(x1,y1),null==cpx2||null==cpy2?(percent<1&&(quadraticSubdivide(x1,cpx1,x2,percent,out),cpx1=out[1],x2=out[2],quadraticSubdivide(y1,cpy1,y2,percent,out),cpy1=out[1],y2=out[2]),ctx.quadraticCurveTo(cpx1,cpy1,x2,y2)):(percent<1&&(cubicSubdivide(x1,cpx1,cpx2,x2,percent,out),cpx1=out[1],cpx2=out[2],x2=out[3],cubicSubdivide(y1,cpy1,cpy2,y2,percent,out),cpy1=out[1],cpy2=out[2],y2=out[3]),ctx.bezierCurveTo(cpx1,cpy1,cpx2,cpy2,x2,y2)))},BezierCurve.prototype.pointAt=function(t){return someVectorAt(this.shape,t,!1)},BezierCurve.prototype.tangentAt=function(t){var p=someVectorAt(this.shape,t,!0);return normalize$2(p,p)},BezierCurve}(Path$1);BezierCurve.prototype.type="bezier-curve";var BezierCurve$1=BezierCurve,ArcShape=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Arc=function(_super){function Arc(opts){return _super.call(this,opts)||this}return __extends(Arc,_super),Arc.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},Arc.prototype.getDefaultShape=function(){return new ArcShape},Arc.prototype.buildPath=function(ctx,shape){var x=shape.cx,y=shape.cy,r=Math.max(shape.r,0),startAngle=shape.startAngle,endAngle=shape.endAngle,clockwise=shape.clockwise,unitX=Math.cos(startAngle),unitY=Math.sin(startAngle);ctx.moveTo(unitX*r+x,unitY*r+y),ctx.arc(x,y,r,startAngle,endAngle,!clockwise)},Arc}(Path$1);Arc.prototype.type="arc";var Arc$1=Arc,CompoundPath=function(_super){function CompoundPath(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type="compound",_this}return __extends(CompoundPath,_super),CompoundPath.prototype._updatePathDirty=function(){for(var paths=this.shape.paths,dirtyPath=this.shapeChanged(),i=0;i<paths.length;i++)dirtyPath=dirtyPath||paths[i].shapeChanged();dirtyPath&&this.dirtyShape()},CompoundPath.prototype.beforeBrush=function(){this._updatePathDirty();for(var paths=this.shape.paths||[],scale=this.getGlobalScale(),i=0;i<paths.length;i++)paths[i].path||paths[i].createPathProxy(),paths[i].path.setScale(scale[0],scale[1],paths[i].segmentIgnoreThreshold)},CompoundPath.prototype.buildPath=function(ctx,shape){for(var paths=shape.paths||[],i=0;i<paths.length;i++)paths[i].buildPath(ctx,paths[i].shape,!0)},CompoundPath.prototype.afterBrush=function(){for(var paths=this.shape.paths||[],i=0;i<paths.length;i++)paths[i].pathUpdated()},CompoundPath.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Path$1.prototype.getBoundingRect.call(this)},CompoundPath}(Path$1),CompoundPath$1=CompoundPath,Gradient$1=function(){function Gradient(colorStops){this.colorStops=colorStops||[]}return Gradient.prototype.addColorStop=function(offset,color){this.colorStops.push({offset:offset,color:color})},Gradient}(),LinearGradient$1=function(_super){function LinearGradient(x,y,x2,y2,colorStops,globalCoord){var _this=_super.call(this,colorStops)||this;return _this.x=null==x?0:x,_this.y=null==y?0:y,_this.x2=null==x2?1:x2,_this.y2=null==y2?0:y2,_this.type="linear",_this.global=globalCoord||!1,_this}return __extends(LinearGradient,_super),LinearGradient}(Gradient$1),RadialGradient$1=function(_super){function RadialGradient(x,y,r,colorStops,globalCoord){var _this=_super.call(this,colorStops)||this;return _this.x=null==x?.5:x,_this.y=null==y?.5:y,_this.r=null==r?.5:r,_this.type="radial",_this.global=globalCoord||!1,_this}return __extends(RadialGradient,_super),RadialGradient}(Gradient$1),extent=[0,0],extent2=[0,0],minTv=new Point$1,maxTv=new Point$1,OrientedBoundingRect=function(){function OrientedBoundingRect(rect,transform){this._corners=[],this._axes=[],this._origin=[0,0];for(var i=0;i<4;i++)this._corners[i]=new Point$1;for(i=0;i<2;i++)this._axes[i]=new Point$1;rect&&this.fromBoundingRect(rect,transform)}return OrientedBoundingRect.prototype.fromBoundingRect=function(rect,transform){var corners=this._corners,axes=this._axes,x=rect.x,y=rect.y,x2=x+rect.width,y2=y+rect.height;if(corners[0].set(x,y),corners[1].set(x2,y),corners[2].set(x2,y2),corners[3].set(x,y2),transform)for(var i=0;i<4;i++)corners[i].transform(transform);Point$1.sub(axes[0],corners[1],corners[0]),Point$1.sub(axes[1],corners[3],corners[0]),axes[0].normalize(),axes[1].normalize();for(i=0;i<2;i++)this._origin[i]=axes[i].dot(corners[0])},OrientedBoundingRect.prototype.intersect=function(other,mtv){var overlapped=!0,noMtv=!mtv;return minTv.set(1/0,1/0),maxTv.set(0,0),!this._intersectCheckOneSide(this,other,minTv,maxTv,noMtv,1)&&(overlapped=!1,noMtv)||!this._intersectCheckOneSide(other,this,minTv,maxTv,noMtv,-1)&&(overlapped=!1,noMtv)||noMtv||Point$1.copy(mtv,overlapped?minTv:maxTv),overlapped},OrientedBoundingRect.prototype._intersectCheckOneSide=function(self,other,minTv,maxTv,noMtv,inverse){for(var overlapped=!0,i=0;i<2;i++){var axis=this._axes[i];if(this._getProjMinMaxOnAxis(i,self._corners,extent),this._getProjMinMaxOnAxis(i,other._corners,extent2),extent[1]<extent2[0]||extent[0]>extent2[1]){if(overlapped=!1,noMtv)return overlapped;var dist0=Math.abs(extent2[0]-extent[1]),dist1=Math.abs(extent[0]-extent2[1]);Math.min(dist0,dist1)>maxTv.len()&&(dist0<dist1?Point$1.scale(maxTv,axis,-dist0*inverse):Point$1.scale(maxTv,axis,dist1*inverse))}else if(minTv){dist0=Math.abs(extent2[0]-extent[1]),dist1=Math.abs(extent[0]-extent2[1]);Math.min(dist0,dist1)<minTv.len()&&(dist0<dist1?Point$1.scale(minTv,axis,dist0*inverse):Point$1.scale(minTv,axis,-dist1*inverse))}}return overlapped},OrientedBoundingRect.prototype._getProjMinMaxOnAxis=function(dim,corners,out){for(var axis=this._axes[dim],origin=this._origin,proj=corners[0].dot(axis)+origin[dim],min=proj,max=proj,i=1;i<corners.length;i++){var proj_1=corners[i].dot(axis)+origin[dim];min=Math.min(proj_1,min),max=Math.max(proj_1,max)}out[0]=min,out[1]=max},OrientedBoundingRect}(),OrientedBoundingRect$1=OrientedBoundingRect,m=[],IncrementalDisplayable$1=function(_super){function IncrementalDisplayable(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.notClear=!0,_this.incremental=!0,_this._displayables=[],_this._temporaryDisplayables=[],_this._cursor=0,_this}return __extends(IncrementalDisplayable,_super),IncrementalDisplayable.prototype.traverse=function(cb,context){cb.call(context,this)},IncrementalDisplayable.prototype.useStyle=function(){this.style={}},IncrementalDisplayable.prototype.getCursor=function(){return this._cursor},IncrementalDisplayable.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},IncrementalDisplayable.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},IncrementalDisplayable.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},IncrementalDisplayable.prototype.addDisplayable=function(displayable,notPersistent){notPersistent?this._temporaryDisplayables.push(displayable):this._displayables.push(displayable),this.markRedraw()},IncrementalDisplayable.prototype.addDisplayables=function(displayables,notPersistent){notPersistent=notPersistent||!1;for(var i=0;i<displayables.length;i++)this.addDisplayable(displayables[i],notPersistent)},IncrementalDisplayable.prototype.getDisplayables=function(){return this._displayables},IncrementalDisplayable.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},IncrementalDisplayable.prototype.eachPendingDisplayable=function(cb){for(var i=this._cursor;i<this._displayables.length;i++)cb&&cb(this._displayables[i]);for(i=0;i<this._temporaryDisplayables.length;i++)cb&&cb(this._temporaryDisplayables[i])},IncrementalDisplayable.prototype.update=function(){this.updateTransform();for(var i=this._cursor;i<this._displayables.length;i++){(displayable=this._displayables[i]).parent=this,displayable.update(),displayable.parent=null}for(i=0;i<this._temporaryDisplayables.length;i++){var displayable;(displayable=this._temporaryDisplayables[i]).parent=this,displayable.update(),displayable.parent=null}},IncrementalDisplayable.prototype.getBoundingRect=function(){if(!this._rect){for(var rect=new BoundingRect$1(1/0,1/0,-1/0,-1/0),i=0;i<this._displayables.length;i++){var displayable=this._displayables[i],childRect=displayable.getBoundingRect().clone();displayable.needLocalTransform()&&childRect.applyTransform(displayable.getLocalTransform(m)),rect.union(childRect)}this._rect=rect}return this._rect},IncrementalDisplayable.prototype.contain=function(x,y){var localPos=this.transformCoordToLocal(x,y);if(this.getBoundingRect().contain(localPos[0],localPos[1]))for(var i=0;i<this._displayables.length;i++){if(this._displayables[i].contain(x,y))return!0}return!1},IncrementalDisplayable}(Displayable$1),transitionStore=makeInner();function getAnimationConfig(animationType,animatableModel,dataIndex,extraOpts,extraDelayParams){var animationPayload;if(animatableModel&&animatableModel.ecModel){var updatePayload=animatableModel.ecModel.getUpdatePayload();animationPayload=updatePayload&&updatePayload.animation}var isUpdate="update"===animationType;if(animatableModel&&animatableModel.isAnimationEnabled()){var duration=void 0,easing=void 0,delay=void 0;return extraOpts?(duration=retrieve2(extraOpts.duration,200),easing=retrieve2(extraOpts.easing,"cubicOut"),delay=0):(duration=animatableModel.getShallow(isUpdate?"animationDurationUpdate":"animationDuration"),easing=animatableModel.getShallow(isUpdate?"animationEasingUpdate":"animationEasing"),delay=animatableModel.getShallow(isUpdate?"animationDelayUpdate":"animationDelay")),animationPayload&&(null!=animationPayload.duration&&(duration=animationPayload.duration),null!=animationPayload.easing&&(easing=animationPayload.easing),null!=animationPayload.delay&&(delay=animationPayload.delay)),isFunction(delay)&&(delay=delay(dataIndex,extraDelayParams)),isFunction(duration)&&(duration=duration(dataIndex)),{duration:duration||0,delay:delay,easing:easing}}return null}function animateOrSetProps(animationType,el,props,animatableModel,dataIndex,cb,during){var removeOpt,isFrom=!1;isFunction(dataIndex)?(during=cb,cb=dataIndex,dataIndex=null):isObject$3(dataIndex)&&(cb=dataIndex.cb,during=dataIndex.during,isFrom=dataIndex.isFrom,removeOpt=dataIndex.removeOpt,dataIndex=dataIndex.dataIndex);var isRemove="leave"===animationType;isRemove||el.stopAnimation("leave");var animationConfig=getAnimationConfig(animationType,animatableModel,dataIndex,isRemove?removeOpt||{}:null,animatableModel&&animatableModel.getAnimationDelayParams?animatableModel.getAnimationDelayParams(el,dataIndex):null);if(animationConfig&&animationConfig.duration>0){var animateConfig={duration:animationConfig.duration,delay:animationConfig.delay||0,easing:animationConfig.easing,done:cb,force:!!cb||!!during,setToFinal:!isRemove,scope:animationType,during:during};isFrom?el.animateFrom(props,animateConfig):el.animateTo(props,animateConfig)}else el.stopAnimation(),!isFrom&&el.attr(props),during&&during(1),cb&&cb()}function updateProps$1(el,props,animatableModel,dataIndex,cb,during){animateOrSetProps("update",el,props,animatableModel,dataIndex,cb,during)}function initProps(el,props,animatableModel,dataIndex,cb,during){animateOrSetProps("enter",el,props,animatableModel,dataIndex,cb,during)}function isElementRemoved(el){if(!el.__zr)return!0;for(var i=0;i<el.animators.length;i++){if("leave"===el.animators[i].scope)return!0}return!1}function removeElement(el,props,animatableModel,dataIndex,cb,during){isElementRemoved(el)||animateOrSetProps("leave",el,props,animatableModel,dataIndex,cb,during)}function fadeOutDisplayable(el,animatableModel,dataIndex,done){el.removeTextContent(),el.removeTextGuideLine(),removeElement(el,{style:{opacity:0}},animatableModel,dataIndex,done)}function removeElementWithFadeOut(el,animatableModel,dataIndex){function doRemove(){el.parent&&el.parent.remove(el)}el.isGroup?el.traverse((function(disp){disp.isGroup||fadeOutDisplayable(disp,animatableModel,dataIndex,doRemove)})):fadeOutDisplayable(el,animatableModel,dataIndex,doRemove)}function saveOldStyle(el){transitionStore(el).oldStyle=el.style}var mathMax$5=Math.max,mathMin$5=Math.min,_customShapeMap={};var extendPathFromString=function(str,defaultOpts){var innerOpts=createPathOptions(str,defaultOpts);return function(_super){function Sub(opts){var _this=_super.call(this,opts)||this;return _this.applyTransform=innerOpts.applyTransform,_this.buildPath=innerOpts.buildPath,_this}return __extends(Sub,_super),Sub}(SVGPath)};function registerShape(name,ShapeClass){_customShapeMap[name]=ShapeClass}function makePath(pathData,opts,rect,layout){var path=function(str,opts){return new SVGPath(createPathOptions(str,opts))}(pathData,opts);return rect&&("center"===layout&&(rect=centerGraphic(rect,path.getBoundingRect())),resizePath(path,rect)),path}function makeImage(imageUrl,rect,layout){var zrImg=new ZRImage$1({style:{image:imageUrl,x:rect.x,y:rect.y,width:rect.width,height:rect.height},onload:function(img){if("center"===layout){var boundingRect={width:img.width,height:img.height};zrImg.setStyle(centerGraphic(rect,boundingRect))}}});return zrImg}function centerGraphic(rect,boundingRect){var height,aspect=boundingRect.width/boundingRect.height,width=rect.height*aspect;return height=width<=rect.width?rect.height:(width=rect.width)/aspect,{x:rect.x+rect.width/2-width/2,y:rect.y+rect.height/2-height/2,width:width,height:height}}var mergePath=function(pathEls,opts){for(var pathList=[],len=pathEls.length,i=0;i<len;i++){var pathEl=pathEls[i];pathList.push(pathEl.getUpdatedPathProxy(!0))}var pathBundle=new Path$1(opts);return pathBundle.createPathProxy(),pathBundle.buildPath=function(path){if(isPathProxy(path)){path.appendPath(pathList);var ctx=path.getContext();ctx&&path.rebuildPath(ctx,1)}},pathBundle};function resizePath(path,rect){if(path.applyTransform){var m=path.getBoundingRect().calculateTransform(rect);path.applyTransform(m)}}function subPixelOptimizeLine(shape,lineWidth){return subPixelOptimizeLine$1(shape,shape,{lineWidth:lineWidth}),shape}var subPixelOptimize=subPixelOptimize$1;function getTransform$1(target,ancestor){for(var mat=identity([]);target&&target!==ancestor;)mul(mat,target.getLocalTransform(),mat),target=target.parent;return mat}function applyTransform(target,transform,invert$1){return transform&&!isArrayLike(transform)&&(transform=Transformable$1.getLocalTransform(transform)),invert$1&&(transform=invert([],transform)),applyTransform$1([],target,transform)}function transformDirection(direction,transform,invert){var hBase=0===transform[4]||0===transform[5]||0===transform[0]?1:Math.abs(2*transform[4]/transform[0]),vBase=0===transform[4]||0===transform[5]||0===transform[2]?1:Math.abs(2*transform[4]/transform[2]),vertex=["left"===direction?-hBase:"right"===direction?hBase:0,"top"===direction?-vBase:"bottom"===direction?vBase:0];return vertex=applyTransform(vertex,transform,invert),Math.abs(vertex[0])>Math.abs(vertex[1])?vertex[0]>0?"right":"left":vertex[1]>0?"bottom":"top"}function isNotGroup(el){return!el.isGroup}function groupTransition(g1,g2,animatableModel){if(g1&&g2){var elMap,elMap1=(elMap={},g1.traverse((function(el){isNotGroup(el)&&el.anid&&(elMap[el.anid]=el)})),elMap);g2.traverse((function(el){if(isNotGroup(el)&&el.anid){var oldEl=elMap1[el.anid];if(oldEl){var newProp=getAnimatableProps(el);el.attr(getAnimatableProps(oldEl)),updateProps$1(el,newProp,animatableModel,getECData(el).dataIndex)}}}))}function getAnimatableProps(el){var obj={x:el.x,y:el.y,rotation:el.rotation};return function(el){return null!=el.shape}(el)&&(obj.shape=extend({},el.shape)),obj}}function clipPointsByRect(points,rect){return map$1(points,(function(point){var x=point[0];x=mathMax$5(x,rect.x),x=mathMin$5(x,rect.x+rect.width);var y=point[1];return y=mathMax$5(y,rect.y),[x,y=mathMin$5(y,rect.y+rect.height)]}))}function createIcon(iconStr,opt,rect){var innerOpts=extend({rectHover:!0},opt),style=innerOpts.style={strokeNoScale:!0};if(rect=rect||{x:-1,y:-1,width:2,height:2},iconStr)return 0===iconStr.indexOf("image://")?(style.image=iconStr.slice(8),defaults(style,rect),new ZRImage$1(innerOpts)):makePath(iconStr.replace("path://",""),innerOpts,rect,"center")}function lineLineIntersect$1(a1x,a1y,a2x,a2y,b1x,b1y,b2x,b2y){var val,mx=a2x-a1x,my=a2y-a1y,nx=b2x-b1x,ny=b2y-b1y,nmCrossProduct=crossProduct2d$1(nx,ny,mx,my);if((val=nmCrossProduct)<=1e-6&&val>=-1e-6)return!1;var b1a1x=a1x-b1x,b1a1y=a1y-b1y,q=crossProduct2d$1(b1a1x,b1a1y,mx,my)/nmCrossProduct;if(q<0||q>1)return!1;var p=crossProduct2d$1(b1a1x,b1a1y,nx,ny)/nmCrossProduct;return!(p<0||p>1)}function crossProduct2d$1(x1,y1,x2,y2){return x1*y2-x2*y1}function setTooltipConfig(opt){var itemTooltipOption=opt.itemTooltipOption,componentModel=opt.componentModel,itemName=opt.itemName,itemTooltipOptionObj=isString(itemTooltipOption)?{formatter:itemTooltipOption}:itemTooltipOption,mainType=componentModel.mainType,componentIndex=componentModel.componentIndex,formatterParams={componentType:mainType,name:itemName,$vars:["name"]};formatterParams[mainType+"Index"]=componentIndex;var formatterParamsExtra=opt.formatterParamsExtra;formatterParamsExtra&&each$b(keys$1(formatterParamsExtra),(function(key){hasOwn(formatterParams,key)||(formatterParams[key]=formatterParamsExtra[key],formatterParams.$vars.push(key))}));var ecData=getECData(opt.el);ecData.componentMainType=mainType,ecData.componentIndex=componentIndex,ecData.tooltipConfig={name:itemName,option:defaults({content:itemName,encodeHTMLContent:!0,formatterParams:formatterParams},itemTooltipOptionObj)}}function traverseElement(el,cb){var stopped;el.isGroup&&(stopped=cb(el)),stopped||el.traverse(cb)}function traverseElements(els,cb){if(els)if(isArray(els))for(var i=0;i<els.length;i++)traverseElement(els[i],cb);else traverseElement(els,cb)}registerShape("circle",Circle$1),registerShape("ellipse",Ellipse$1),registerShape("sector",Sector$1),registerShape("ring",Ring$1),registerShape("polygon",Polygon$1),registerShape("polyline",Polyline$1),registerShape("rect",Rect$4),registerShape("line",Line$3),registerShape("bezierCurve",BezierCurve$1),registerShape("arc",Arc$1);var graphic=Object.freeze({__proto__:null,Arc:Arc$1,BezierCurve:BezierCurve$1,BoundingRect:BoundingRect$1,Circle:Circle$1,CompoundPath:CompoundPath$1,Ellipse:Ellipse$1,Group:Group$4,Image:ZRImage$1,IncrementalDisplayable:IncrementalDisplayable$1,Line:Line$3,LinearGradient:LinearGradient$1,OrientedBoundingRect:OrientedBoundingRect$1,Path:Path$1,Point:Point$1,Polygon:Polygon$1,Polyline:Polyline$1,RadialGradient:RadialGradient$1,Rect:Rect$4,Ring:Ring$1,Sector:Sector$1,Text:ZRText$1,applyTransform:applyTransform,clipPointsByRect:clipPointsByRect,clipRectByRect:function(targetRect,rect){var x=mathMax$5(targetRect.x,rect.x),x2=mathMin$5(targetRect.x+targetRect.width,rect.x+rect.width),y=mathMax$5(targetRect.y,rect.y),y2=mathMin$5(targetRect.y+targetRect.height,rect.y+rect.height);if(x2>=x&&y2>=y)return{x:x,y:y,width:x2-x,height:y2-y}},createIcon:createIcon,extendPath:function(pathData,opts){return extendPathFromString(pathData,opts)},extendShape:function(opts){return Path$1.extend(opts)},getShapeClass:function(name){if(_customShapeMap.hasOwnProperty(name))return _customShapeMap[name]},getTransform:getTransform$1,groupTransition:groupTransition,initProps:initProps,isElementRemoved:isElementRemoved,lineLineIntersect:lineLineIntersect$1,linePolygonIntersect:function(a1x,a1y,a2x,a2y,points){for(var i=0,p2=points[points.length-1];i<points.length;i++){var p=points[i];if(lineLineIntersect$1(a1x,a1y,a2x,a2y,p[0],p[1],p2[0],p2[1]))return!0;p2=p}},makeImage:makeImage,makePath:makePath,mergePath:mergePath,registerShape:registerShape,removeElement:removeElement,removeElementWithFadeOut:removeElementWithFadeOut,resizePath:resizePath,setTooltipConfig:setTooltipConfig,subPixelOptimize:subPixelOptimize,subPixelOptimizeLine:subPixelOptimizeLine,subPixelOptimizeRect:function(param){return subPixelOptimizeRect$1(param.shape,param.shape,param.style),param},transformDirection:transformDirection,traverseElements:traverseElements,updateProps:updateProps$1}),EMPTY_OBJ={};function setLabelText(label,labelTexts){for(var i=0;i<SPECIAL_STATES.length;i++){var stateName=SPECIAL_STATES[i],text=labelTexts[stateName],state=label.ensureState(stateName);state.style=state.style||{},state.style.text=text}var oldStates=label.currentStates.slice();label.clearStates(!0),label.setStyle({text:labelTexts.normal}),label.useStates(oldStates,!0)}function getLabelText(opt,stateModels,interpolatedValue){var baseText,labelFetcher=opt.labelFetcher,labelDataIndex=opt.labelDataIndex,labelDimIndex=opt.labelDimIndex,normalModel=stateModels.normal;labelFetcher&&(baseText=labelFetcher.getFormattedLabel(labelDataIndex,"normal",null,labelDimIndex,normalModel&&normalModel.get("formatter"),null!=interpolatedValue?{interpolatedValue:interpolatedValue}:null)),null==baseText&&(baseText=isFunction(opt.defaultText)?opt.defaultText(labelDataIndex,opt,interpolatedValue):opt.defaultText);for(var statesText={normal:baseText},i=0;i<SPECIAL_STATES.length;i++){var stateName=SPECIAL_STATES[i],stateModel=stateModels[stateName];statesText[stateName]=retrieve2(labelFetcher?labelFetcher.getFormattedLabel(labelDataIndex,stateName,null,labelDimIndex,stateModel&&stateModel.get("formatter")):null,baseText)}return statesText}function setLabelStyle(targetEl,labelStatesModels,opt,stateSpecified){opt=opt||EMPTY_OBJ;for(var isSetOnText=targetEl instanceof ZRText$1,needsCreateText=!1,i=0;i<DISPLAY_STATES.length;i++){if((stateModel=labelStatesModels[DISPLAY_STATES[i]])&&stateModel.getShallow("show")){needsCreateText=!0;break}}var textContent=isSetOnText?targetEl:targetEl.getTextContent();if(needsCreateText){isSetOnText||(textContent||(textContent=new ZRText$1,targetEl.setTextContent(textContent)),targetEl.stateProxy&&(textContent.stateProxy=targetEl.stateProxy));var labelStatesTexts=getLabelText(opt,labelStatesModels),normalModel=labelStatesModels.normal,showNormal=!!normalModel.getShallow("show"),normalStyle=createTextStyle(normalModel,stateSpecified&&stateSpecified.normal,opt,!1,!isSetOnText);normalStyle.text=labelStatesTexts.normal,isSetOnText||targetEl.setTextConfig(createTextConfig(normalModel,opt,!1));for(i=0;i<SPECIAL_STATES.length;i++){var stateModel,stateName=SPECIAL_STATES[i];if(stateModel=labelStatesModels[stateName]){var stateObj=textContent.ensureState(stateName),stateShow=!!retrieve2(stateModel.getShallow("show"),showNormal);if(stateShow!==showNormal&&(stateObj.ignore=!stateShow),stateObj.style=createTextStyle(stateModel,stateSpecified&&stateSpecified[stateName],opt,!0,!isSetOnText),stateObj.style.text=labelStatesTexts[stateName],!isSetOnText)targetEl.ensureState(stateName).textConfig=createTextConfig(stateModel,opt,!0)}}textContent.silent=!!normalModel.getShallow("silent"),null!=textContent.style.x&&(normalStyle.x=textContent.style.x),null!=textContent.style.y&&(normalStyle.y=textContent.style.y),textContent.ignore=!showNormal,textContent.useStyle(normalStyle),textContent.dirty(),opt.enableTextSetter&&(labelInner(textContent).setLabelText=function(interpolatedValue){var labelStatesTexts=getLabelText(opt,labelStatesModels,interpolatedValue);setLabelText(textContent,labelStatesTexts)})}else textContent&&(textContent.ignore=!0);targetEl.dirty()}function getLabelStatesModels(itemModel,labelName){labelName=labelName||"label";for(var statesModels={normal:itemModel.getModel(labelName)},i=0;i<SPECIAL_STATES.length;i++){var stateName=SPECIAL_STATES[i];statesModels[stateName]=itemModel.getModel([stateName,labelName])}return statesModels}function createTextStyle(textStyleModel,specifiedTextStyle,opt,isNotNormal,isAttached){var textStyle={};return function(textStyle,textStyleModel,opt,isNotNormal,isAttached){opt=opt||EMPTY_OBJ;var richResult,ecModel=textStyleModel.ecModel,globalTextStyle=ecModel&&ecModel.option.textStyle,richItemNames=function(textStyleModel){var richItemNameMap;for(;textStyleModel&&textStyleModel!==textStyleModel.ecModel;){var rich=(textStyleModel.option||EMPTY_OBJ).rich;if(rich){richItemNameMap=richItemNameMap||{};for(var richKeys=keys$1(rich),i=0;i<richKeys.length;i++){richItemNameMap[richKeys[i]]=1}}textStyleModel=textStyleModel.parentModel}return richItemNameMap}(textStyleModel);if(richItemNames)for(var name_1 in richResult={},richItemNames)if(richItemNames.hasOwnProperty(name_1)){var richTextStyle=textStyleModel.getModel(["rich",name_1]);setTokenTextStyle(richResult[name_1]={},richTextStyle,globalTextStyle,opt,isNotNormal,isAttached,!1,!0)}richResult&&(textStyle.rich=richResult);var overflow=textStyleModel.get("overflow");overflow&&(textStyle.overflow=overflow);var margin=textStyleModel.get("minMargin");null!=margin&&(textStyle.margin=margin);setTokenTextStyle(textStyle,textStyleModel,globalTextStyle,opt,isNotNormal,isAttached,!0,!1)}(textStyle,textStyleModel,opt,isNotNormal,isAttached),specifiedTextStyle&&extend(textStyle,specifiedTextStyle),textStyle}function createTextConfig(textStyleModel,opt,isNotNormal){opt=opt||{};var labelPosition,textConfig={},labelRotate=textStyleModel.getShallow("rotate"),labelDistance=retrieve2(textStyleModel.getShallow("distance"),isNotNormal?null:5),labelOffset=textStyleModel.getShallow("offset");return"outside"===(labelPosition=textStyleModel.getShallow("position")||(isNotNormal?null:"inside"))&&(labelPosition=opt.defaultOutsidePosition||"top"),null!=labelPosition&&(textConfig.position=labelPosition),null!=labelOffset&&(textConfig.offset=labelOffset),null!=labelRotate&&(labelRotate*=Math.PI/180,textConfig.rotation=labelRotate),null!=labelDistance&&(textConfig.distance=labelDistance),textConfig.outsideFill="inherit"===textStyleModel.get("color")?opt.inheritColor||null:"auto",textConfig}var TEXT_PROPS_WITH_GLOBAL=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],TEXT_PROPS_SELF=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],TEXT_PROPS_BOX=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function setTokenTextStyle(textStyle,textStyleModel,globalTextStyle,opt,isNotNormal,isAttached,isBlock,inRich){globalTextStyle=!isNotNormal&&globalTextStyle||EMPTY_OBJ;var inheritColor=opt&&opt.inheritColor,fillColor=textStyleModel.getShallow("color"),strokeColor=textStyleModel.getShallow("textBorderColor"),opacity=retrieve2(textStyleModel.getShallow("opacity"),globalTextStyle.opacity);"inherit"!==fillColor&&"auto"!==fillColor||("production"!==process.env.NODE_ENV&&"auto"===fillColor&&deprecateReplaceLog("color: 'auto'","color: 'inherit'"),fillColor=inheritColor||null),"inherit"!==strokeColor&&"auto"!==strokeColor||("production"!==process.env.NODE_ENV&&"auto"===strokeColor&&deprecateReplaceLog("color: 'auto'","color: 'inherit'"),strokeColor=inheritColor||null),isAttached||(fillColor=fillColor||globalTextStyle.color,strokeColor=strokeColor||globalTextStyle.textBorderColor),null!=fillColor&&(textStyle.fill=fillColor),null!=strokeColor&&(textStyle.stroke=strokeColor);var textBorderWidth=retrieve2(textStyleModel.getShallow("textBorderWidth"),globalTextStyle.textBorderWidth);null!=textBorderWidth&&(textStyle.lineWidth=textBorderWidth);var textBorderType=retrieve2(textStyleModel.getShallow("textBorderType"),globalTextStyle.textBorderType);null!=textBorderType&&(textStyle.lineDash=textBorderType);var textBorderDashOffset=retrieve2(textStyleModel.getShallow("textBorderDashOffset"),globalTextStyle.textBorderDashOffset);null!=textBorderDashOffset&&(textStyle.lineDashOffset=textBorderDashOffset),isNotNormal||null!=opacity||inRich||(opacity=opt&&opt.defaultOpacity),null!=opacity&&(textStyle.opacity=opacity),isNotNormal||isAttached||null==textStyle.fill&&opt.inheritColor&&(textStyle.fill=opt.inheritColor);for(var i=0;i<TEXT_PROPS_WITH_GLOBAL.length;i++){var key=TEXT_PROPS_WITH_GLOBAL[i];null!=(val=retrieve2(textStyleModel.getShallow(key),globalTextStyle[key]))&&(textStyle[key]=val)}for(i=0;i<TEXT_PROPS_SELF.length;i++){key=TEXT_PROPS_SELF[i];null!=(val=textStyleModel.getShallow(key))&&(textStyle[key]=val)}if(null==textStyle.verticalAlign){var baseline=textStyleModel.getShallow("baseline");null!=baseline&&(textStyle.verticalAlign=baseline)}if(!isBlock||!opt.disableBox){for(i=0;i<TEXT_PROPS_BOX.length;i++){var val;key=TEXT_PROPS_BOX[i];null!=(val=textStyleModel.getShallow(key))&&(textStyle[key]=val)}var borderType=textStyleModel.getShallow("borderType");null!=borderType&&(textStyle.borderDash=borderType),"auto"!==textStyle.backgroundColor&&"inherit"!==textStyle.backgroundColor||!inheritColor||("production"!==process.env.NODE_ENV&&"auto"===textStyle.backgroundColor&&deprecateReplaceLog("backgroundColor: 'auto'","backgroundColor: 'inherit'"),textStyle.backgroundColor=inheritColor),"auto"!==textStyle.borderColor&&"inherit"!==textStyle.borderColor||!inheritColor||("production"!==process.env.NODE_ENV&&"auto"===textStyle.borderColor&&deprecateReplaceLog("borderColor: 'auto'","borderColor: 'inherit'"),textStyle.borderColor=inheritColor)}}function getFont(opt,ecModel){var gTextStyleModel=ecModel&&ecModel.getModel("textStyle");return trim$1([opt.fontStyle||gTextStyleModel&&gTextStyleModel.getShallow("fontStyle")||"",opt.fontWeight||gTextStyleModel&&gTextStyleModel.getShallow("fontWeight")||"",(opt.fontSize||gTextStyleModel&&gTextStyleModel.getShallow("fontSize")||12)+"px",opt.fontFamily||gTextStyleModel&&gTextStyleModel.getShallow("fontFamily")||"sans-serif"].join(" "))}var labelInner=makeInner();function setLabelValueAnimation(label,labelStatesModels,value,getDefaultText){if(label){var obj=labelInner(label);obj.prevValue=obj.value,obj.value=value;var normalLabelModel=labelStatesModels.normal;obj.valueAnimation=normalLabelModel.get("valueAnimation"),obj.valueAnimation&&(obj.precision=normalLabelModel.get("precision"),obj.defaultInterpolatedText=getDefaultText,obj.statesModels=labelStatesModels)}}function animateLabelValue(textEl,dataIndex,data,animatableModel,labelFetcher){var labelInnerStore=labelInner(textEl);if(labelInnerStore.valueAnimation&&labelInnerStore.prevValue!==labelInnerStore.value){var defaultInterpolatedText=labelInnerStore.defaultInterpolatedText,currValue=retrieve2(labelInnerStore.interpolatedValue,labelInnerStore.prevValue),targetValue=labelInnerStore.value;textEl.percent=0,(null==labelInnerStore.prevValue?initProps:updateProps$1)(textEl,{percent:1},animatableModel,dataIndex,null,(function(percent){var interpolated=interpolateRawValues(data,labelInnerStore.precision,currValue,targetValue,percent);labelInnerStore.interpolatedValue=1===percent?null:interpolated;var labelText=getLabelText({labelDataIndex:dataIndex,labelFetcher:labelFetcher,defaultText:defaultInterpolatedText?defaultInterpolatedText(interpolated):interpolated+""},labelInnerStore.statesModels,interpolated);setLabelText(textEl,labelText)}))}}var target,classAttr,PATH_COLOR=["textStyle","color"],textStyleParams=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],tmpText=new ZRText$1,TextStyleMixin=function(){function TextStyleMixin(){}return TextStyleMixin.prototype.getTextColor=function(isEmphasis){var ecModel=this.ecModel;return this.getShallow("color")||(!isEmphasis&&ecModel?ecModel.get(PATH_COLOR):null)},TextStyleMixin.prototype.getFont=function(){return getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},TextStyleMixin.prototype.getTextRect=function(text){for(var style={text:text,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},i=0;i<textStyleParams.length;i++)style[textStyleParams[i]]=this.getShallow(textStyleParams[i]);return tmpText.useStyle(style),tmpText.update(),tmpText.getBoundingRect()},TextStyleMixin}(),TextStyleMixin$1=TextStyleMixin,LINE_STYLE_KEY_MAP=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],getLineStyle=makeStyleMapper(LINE_STYLE_KEY_MAP),LineStyleMixin=function(){function LineStyleMixin(){}return LineStyleMixin.prototype.getLineStyle=function(excludes){return getLineStyle(this,excludes)},LineStyleMixin}(),ITEM_STYLE_KEY_MAP=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],getItemStyle=makeStyleMapper(ITEM_STYLE_KEY_MAP),ItemStyleMixin=function(){function ItemStyleMixin(){}return ItemStyleMixin.prototype.getItemStyle=function(excludes,includes){return getItemStyle(this,excludes,includes)},ItemStyleMixin}(),Model=function(){function Model(option,parentModel,ecModel){this.parentModel=parentModel,this.ecModel=ecModel,this.option=option}return Model.prototype.init=function(option,parentModel,ecModel){},Model.prototype.mergeOption=function(option,ecModel){merge(this.option,option,!0)},Model.prototype.get=function(path,ignoreParent){return null==path?this.option:this._doGet(this.parsePath(path),!ignoreParent&&this.parentModel)},Model.prototype.getShallow=function(key,ignoreParent){var option=this.option,val=null==option?option:option[key];if(null==val&&!ignoreParent){var parentModel=this.parentModel;parentModel&&(val=parentModel.getShallow(key))}return val},Model.prototype.getModel=function(path,parentModel){var hasPath=null!=path,pathFinal=hasPath?this.parsePath(path):null;return new Model(hasPath?this._doGet(pathFinal):this.option,parentModel=parentModel||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(pathFinal)),this.ecModel)},Model.prototype.isEmpty=function(){return null==this.option},Model.prototype.restoreData=function(){},Model.prototype.clone=function(){return new(0,this.constructor)(clone$3(this.option))},Model.prototype.parsePath=function(path){return"string"==typeof path?path.split("."):path},Model.prototype.resolveParentPath=function(path){return path},Model.prototype.isAnimationEnabled=function(){if(!env$1.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},Model.prototype._doGet=function(pathArr,parentModel){var obj=this.option;if(!pathArr)return obj;for(var i=0;i<pathArr.length&&(!pathArr[i]||null!=(obj=obj&&"object"==typeof obj?obj[pathArr[i]]:null));i++);return null==obj&&parentModel&&(obj=parentModel._doGet(this.resolveParentPath(pathArr),parentModel.parentModel)),obj},Model}();enableClassExtend(Model),target=Model,classAttr=["__\0is_clz",classBase++].join("_"),target.prototype[classAttr]=!0,"production"!==process.env.NODE_ENV&&assert(!target.isInstance,'The method "is" can not be defined.'),target.isInstance=function(obj){return!(!obj||!obj[classAttr])},mixin(Model,LineStyleMixin),mixin(Model,ItemStyleMixin),mixin(Model,AreaStyleMixin),mixin(Model,TextStyleMixin$1);var Model$1=Model,base=Math.round(10*Math.random());function getUID(type){return[type||"",base++].join("_")}function inheritDefaultOption(superOption,subOption){return merge(merge({},superOption,!0),subOption,!0)}var localeStorage={},localeModels={},SYSTEM_LANG=env$1.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||"EN").toUpperCase().indexOf("ZH")>-1?"ZH":"EN";function registerLocale(locale,localeObj){locale=locale.toUpperCase(),localeModels[locale]=new Model$1(localeObj),localeStorage[locale]=localeObj}registerLocale("EN",{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:". "}}}}),registerLocale("ZH",{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 defaultLeveledFormatter={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}"},fullLeveledFormatter={year:"{yyyy}",month:"{yyyy}-{MM}",day:"{yyyy}-{MM}-{dd}",hour:"{yyyy}-{MM}-{dd} "+defaultLeveledFormatter.hour,minute:"{yyyy}-{MM}-{dd} "+defaultLeveledFormatter.minute,second:"{yyyy}-{MM}-{dd} "+defaultLeveledFormatter.second,millisecond:defaultLeveledFormatter.none},primaryTimeUnits=["year","month","day","hour","minute","second","millisecond"],timeUnits=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function pad(str,len){return"0000".substr(0,len-(str+="").length)+str}function getPrimaryTimeUnit(timeUnit){switch(timeUnit){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return timeUnit}}function isPrimaryTimeUnit(timeUnit){return timeUnit===getPrimaryTimeUnit(timeUnit)}function format(time,template,isUTC,lang){var date=parseDate$1(time),y=date[fullYearGetterName(isUTC)](),M=date[monthGetterName(isUTC)]()+1,q=Math.floor((M-1)/3)+1,d=date[dateGetterName(isUTC)](),e=date["get"+(isUTC?"UTC":"")+"Day"](),H=date[hoursGetterName(isUTC)](),h=(H-1)%12+1,m=date[minutesGetterName(isUTC)](),s=date[secondsGetterName(isUTC)](),S=date[millisecondsGetterName(isUTC)](),a=H>=12?"pm":"am",A=a.toUpperCase(),localeModel=lang instanceof Model$1?lang:function(lang){return localeModels[lang]}(lang||SYSTEM_LANG)||localeModels.EN,timeModel=localeModel.getModel("time"),month=timeModel.get("month"),monthAbbr=timeModel.get("monthAbbr"),dayOfWeek=timeModel.get("dayOfWeek"),dayOfWeekAbbr=timeModel.get("dayOfWeekAbbr");return(template||"").replace(/{a}/g,a+"").replace(/{A}/g,A+"").replace(/{yyyy}/g,y+"").replace(/{yy}/g,pad(y%100+"",2)).replace(/{Q}/g,q+"").replace(/{MMMM}/g,month[M-1]).replace(/{MMM}/g,monthAbbr[M-1]).replace(/{MM}/g,pad(M,2)).replace(/{M}/g,M+"").replace(/{dd}/g,pad(d,2)).replace(/{d}/g,d+"").replace(/{eeee}/g,dayOfWeek[e]).replace(/{ee}/g,dayOfWeekAbbr[e]).replace(/{e}/g,e+"").replace(/{HH}/g,pad(H,2)).replace(/{H}/g,H+"").replace(/{hh}/g,pad(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,pad(m,2)).replace(/{m}/g,m+"").replace(/{ss}/g,pad(s,2)).replace(/{s}/g,s+"").replace(/{SSS}/g,pad(S,3)).replace(/{S}/g,S+"")}function getUnitFromValue(value,isUTC){var date=parseDate$1(value),M=date[monthGetterName(isUTC)]()+1,d=date[dateGetterName(isUTC)](),h=date[hoursGetterName(isUTC)](),m=date[minutesGetterName(isUTC)](),s=date[secondsGetterName(isUTC)](),isSecond=0===date[millisecondsGetterName(isUTC)](),isMinute=isSecond&&0===s,isHour=isMinute&&0===m,isDay=isHour&&0===h,isMonth=isDay&&1===d;return isMonth&&1===M?"year":isMonth?"month":isDay?"day":isHour?"hour":isMinute?"minute":isSecond?"second":"millisecond"}function getUnitValue(value,unit,isUTC){var date=isNumber(value)?parseDate$1(value):value;switch(unit=unit||getUnitFromValue(value,isUTC)){case"year":return date[fullYearGetterName(isUTC)]();case"half-year":return date[monthGetterName(isUTC)]()>=6?1:0;case"quarter":return Math.floor((date[monthGetterName(isUTC)]()+1)/4);case"month":return date[monthGetterName(isUTC)]();case"day":return date[dateGetterName(isUTC)]();case"half-day":return date[hoursGetterName(isUTC)]()/24;case"hour":return date[hoursGetterName(isUTC)]();case"minute":return date[minutesGetterName(isUTC)]();case"second":return date[secondsGetterName(isUTC)]();case"millisecond":return date[millisecondsGetterName(isUTC)]()}}function fullYearGetterName(isUTC){return isUTC?"getUTCFullYear":"getFullYear"}function monthGetterName(isUTC){return isUTC?"getUTCMonth":"getMonth"}function dateGetterName(isUTC){return isUTC?"getUTCDate":"getDate"}function hoursGetterName(isUTC){return isUTC?"getUTCHours":"getHours"}function minutesGetterName(isUTC){return isUTC?"getUTCMinutes":"getMinutes"}function secondsGetterName(isUTC){return isUTC?"getUTCSeconds":"getSeconds"}function millisecondsGetterName(isUTC){return isUTC?"getUTCMilliseconds":"getMilliseconds"}function fullYearSetterName(isUTC){return isUTC?"setUTCFullYear":"setFullYear"}function monthSetterName(isUTC){return isUTC?"setUTCMonth":"setMonth"}function dateSetterName(isUTC){return isUTC?"setUTCDate":"setDate"}function hoursSetterName(isUTC){return isUTC?"setUTCHours":"setHours"}function minutesSetterName(isUTC){return isUTC?"setUTCMinutes":"setMinutes"}function secondsSetterName(isUTC){return isUTC?"setUTCSeconds":"setSeconds"}function millisecondsSetterName(isUTC){return isUTC?"setUTCMilliseconds":"setMilliseconds"}function addCommas(x){if(!isNumeric(x))return isString(x)?x:"-";var parts=(x+"").split(".");return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(parts.length>1?"."+parts[1]:"")}function toCamelCase(str,upperCaseFirst){return str=(str||"").toLowerCase().replace(/-(.)/g,(function(match,group1){return group1.toUpperCase()})),upperCaseFirst&&str&&(str=str.charAt(0).toUpperCase()+str.slice(1)),str}var normalizeCssArray=normalizeCssArray$1;function makeValueReadable(value,valueType,useUTC){function stringToUserReadable(str){return str&&trim$1(str)?str:"-"}function isNumberUserReadable(num){return!(null==num||isNaN(num)||!isFinite(num))}var isTypeTime="time"===valueType,isValueDate=value instanceof Date;if(isTypeTime||isValueDate){var date=isTypeTime?parseDate$1(value):value;if(!isNaN(+date))return format(date,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",useUTC);if(isValueDate)return"-"}if("ordinal"===valueType)return isStringSafe(value)?stringToUserReadable(value):isNumber(value)&&isNumberUserReadable(value)?value+"":"-";var numericResult=numericToNumber(value);return isNumberUserReadable(numericResult)?addCommas(numericResult):isStringSafe(value)?stringToUserReadable(value):"boolean"==typeof value?value+"":"-"}var TPL_VAR_ALIAS=["a","b","c","d","e","f","g"],wrapVar=function(varName,seriesIdx){return"{"+varName+(null==seriesIdx?"":seriesIdx)+"}"};function formatTpl(tpl,paramsList,encode){isArray(paramsList)||(paramsList=[paramsList]);var seriesLen=paramsList.length;if(!seriesLen)return"";for(var $vars=paramsList[0].$vars||[],i=0;i<$vars.length;i++){var alias=TPL_VAR_ALIAS[i];tpl=tpl.replace(wrapVar(alias),wrapVar(alias,0))}for(var seriesIdx=0;seriesIdx<seriesLen;seriesIdx++)for(var k=0;k<$vars.length;k++){var val=paramsList[seriesIdx][$vars[k]];tpl=tpl.replace(wrapVar(TPL_VAR_ALIAS[k],seriesIdx),encode?encodeHTML(val):val)}return tpl}function convertToColorString(color,defaultColor){return defaultColor=defaultColor||"transparent",isString(color)?color:isObject$3(color)&&color.colorStops&&(color.colorStops[0]||{}).color||defaultColor}function windowOpen(link,target){if("_blank"===target||"blank"===target){var blank=window.open();blank.opener=null,blank.location.href=link}else window.open(link,target)}var each$a=each$b,LOCATION_PARAMS=["left","right","top","bottom","width","height"],HV_NAMES=[["width","left","right"],["height","top","bottom"]];function boxLayout(orient,group,gap,maxWidth,maxHeight){var x=0,y=0;null==maxWidth&&(maxWidth=1/0),null==maxHeight&&(maxHeight=1/0);var currentLineMaxSize=0;group.eachChild((function(child,idx){var nextX,nextY,rect=child.getBoundingRect(),nextChild=group.childAt(idx+1),nextChildRect=nextChild&&nextChild.getBoundingRect();if("horizontal"===orient){var moveX=rect.width+(nextChildRect?-nextChildRect.x+rect.x:0);(nextX=x+moveX)>maxWidth||child.newline?(x=0,nextX=moveX,y+=currentLineMaxSize+gap,currentLineMaxSize=rect.height):currentLineMaxSize=Math.max(currentLineMaxSize,rect.height)}else{var moveY=rect.height+(nextChildRect?-nextChildRect.y+rect.y:0);(nextY=y+moveY)>maxHeight||child.newline?(x+=currentLineMaxSize+gap,y=0,nextY=moveY,currentLineMaxSize=rect.width):currentLineMaxSize=Math.max(currentLineMaxSize,rect.width)}child.newline||(child.x=x,child.y=y,child.markRedraw(),"horizontal"===orient?x=nextX+gap:y=nextY+gap)}))}var box=boxLayout;function getLayoutRect(positionInfo,containerRect,margin){margin=normalizeCssArray(margin||0);var containerWidth=containerRect.width,containerHeight=containerRect.height,left=parsePercent(positionInfo.left,containerWidth),top=parsePercent(positionInfo.top,containerHeight),right=parsePercent(positionInfo.right,containerWidth),bottom=parsePercent(positionInfo.bottom,containerHeight),width=parsePercent(positionInfo.width,containerWidth),height=parsePercent(positionInfo.height,containerHeight),verticalMargin=margin[2]+margin[0],horizontalMargin=margin[1]+margin[3],aspect=positionInfo.aspect;switch(isNaN(width)&&(width=containerWidth-right-horizontalMargin-left),isNaN(height)&&(height=containerHeight-bottom-verticalMargin-top),null!=aspect&&(isNaN(width)&&isNaN(height)&&(aspect>containerWidth/containerHeight?width=.8*containerWidth:height=.8*containerHeight),isNaN(width)&&(width=aspect*height),isNaN(height)&&(height=width/aspect)),isNaN(left)&&(left=containerWidth-right-width-horizontalMargin),isNaN(top)&&(top=containerHeight-bottom-height-verticalMargin),positionInfo.left||positionInfo.right){case"center":left=containerWidth/2-width/2-margin[3];break;case"right":left=containerWidth-width-horizontalMargin}switch(positionInfo.top||positionInfo.bottom){case"middle":case"center":top=containerHeight/2-height/2-margin[0];break;case"bottom":top=containerHeight-height-verticalMargin}left=left||0,top=top||0,isNaN(width)&&(width=containerWidth-horizontalMargin-left-(right||0)),isNaN(height)&&(height=containerHeight-verticalMargin-top-(bottom||0));var rect=new BoundingRect$1(left+margin[3],top+margin[0],width,height);return rect.margin=margin,rect}function positionElement(el,positionInfo,containerRect,margin,opt,out){var rect,h=!opt||!opt.hv||opt.hv[0],v=!opt||!opt.hv||opt.hv[1],boundingMode=opt&&opt.boundingMode||"all";if((out=out||el).x=el.x,out.y=el.y,!h&&!v)return!1;if("raw"===boundingMode)rect="group"===el.type?new BoundingRect$1(0,0,+positionInfo.width||0,+positionInfo.height||0):el.getBoundingRect();else if(rect=el.getBoundingRect(),el.needLocalTransform()){var transform=el.getLocalTransform();(rect=rect.clone()).applyTransform(transform)}var layoutRect=getLayoutRect(defaults({width:rect.width,height:rect.height},positionInfo),containerRect,margin),dx=h?layoutRect.x-rect.x:0,dy=v?layoutRect.y-rect.y:0;return"raw"===boundingMode?(out.x=dx,out.y=dy):(out.x+=dx,out.y+=dy),out===el&&el.markRedraw(),!0}function fetchLayoutMode(ins){var layoutMode=ins.layoutMode||ins.constructor.layoutMode;return isObject$3(layoutMode)?layoutMode:layoutMode?{type:layoutMode}:null}function mergeLayoutParam(targetOption,newOption,opt){var ignoreSize=opt&&opt.ignoreSize;!isArray(ignoreSize)&&(ignoreSize=[ignoreSize,ignoreSize]);var hResult=merge(HV_NAMES[0],0),vResult=merge(HV_NAMES[1],1);function merge(names,hvIdx){var newParams={},newValueCount=0,merged={},mergedValueCount=0;if(each$a(names,(function(name){merged[name]=targetOption[name]})),each$a(names,(function(name){hasProp(newOption,name)&&(newParams[name]=merged[name]=newOption[name]),hasValue(newParams,name)&&newValueCount++,hasValue(merged,name)&&mergedValueCount++})),ignoreSize[hvIdx])return hasValue(newOption,names[1])?merged[names[2]]=null:hasValue(newOption,names[2])&&(merged[names[1]]=null),merged;if(2!==mergedValueCount&&newValueCount){if(newValueCount>=2)return newParams;for(var i=0;i<names.length;i++){var name_1=names[i];if(!hasProp(newParams,name_1)&&hasProp(targetOption,name_1)){newParams[name_1]=targetOption[name_1];break}}return newParams}return merged}function hasProp(obj,name){return obj.hasOwnProperty(name)}function hasValue(obj,name){return null!=obj[name]&&"auto"!==obj[name]}function copy(names,target,source){each$a(names,(function(name){target[name]=source[name]}))}copy(HV_NAMES[0],targetOption,hResult),copy(HV_NAMES[1],targetOption,vResult)}function getLayoutParams(source){return function(target,source){return source&&target&&each$a(LOCATION_PARAMS,(function(name){source.hasOwnProperty(name)&&(target[name]=source[name])})),target}({},source)}curry$1(boxLayout,"vertical"),curry$1(boxLayout,"horizontal");var inner$i=makeInner(),ComponentModel=function(_super){function ComponentModel(option,parentModel,ecModel){var _this=_super.call(this,option,parentModel,ecModel)||this;return _this.uid=getUID("ec_cpt_model"),_this}return __extends(ComponentModel,_super),ComponentModel.prototype.init=function(option,parentModel,ecModel){this.mergeDefaultAndTheme(option,ecModel)},ComponentModel.prototype.mergeDefaultAndTheme=function(option,ecModel){var layoutMode=fetchLayoutMode(this),inputPositionParams=layoutMode?getLayoutParams(option):{};merge(option,ecModel.getTheme().get(this.mainType)),merge(option,this.getDefaultOption()),layoutMode&&mergeLayoutParam(option,inputPositionParams,layoutMode)},ComponentModel.prototype.mergeOption=function(option,ecModel){merge(this.option,option,!0);var layoutMode=fetchLayoutMode(this);layoutMode&&mergeLayoutParam(this.option,option,layoutMode)},ComponentModel.prototype.optionUpdated=function(newCptOption,isInit){},ComponentModel.prototype.getDefaultOption=function(){var ctor=this.constructor;if(!function(clz){return!(!clz||!clz.___EC__EXTENDED_CLASS___)}(ctor))return ctor.defaultOption;var fields=inner$i(this);if(!fields.defaultOption){for(var optList=[],clz=ctor;clz;){var opt=clz.prototype.defaultOption;opt&&optList.push(opt),clz=clz.superClass}for(var defaultOption={},i=optList.length-1;i>=0;i--)defaultOption=merge(defaultOption,optList[i],!0);fields.defaultOption=defaultOption}return fields.defaultOption},ComponentModel.prototype.getReferringComponents=function(mainType,opt){var indexKey=mainType+"Index",idKey=mainType+"Id";return queryReferringComponents(this.ecModel,mainType,{index:this.get(indexKey,!0),id:this.get(idKey,!0)},opt)},ComponentModel.prototype.getBoxLayoutParams=function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}},ComponentModel.prototype.getZLevelKey=function(){return""},ComponentModel.prototype.setZLevel=function(zlevel){this.option.zlevel=zlevel},ComponentModel.protoInitialize=function(){var proto=ComponentModel.prototype;proto.type="component",proto.id="",proto.name="",proto.mainType="",proto.subType="",proto.componentIndex=0}(),ComponentModel}(Model$1);mountExtend(ComponentModel,Model$1),enableClassManagement(ComponentModel),function(target){var subTypeDefaulters={};target.registerSubTypeDefaulter=function(componentType,defaulter){var componentTypeInfo=parseClassType(componentType);subTypeDefaulters[componentTypeInfo.main]=defaulter},target.determineSubType=function(componentType,option){var type=option.type;if(!type){var componentTypeMain=parseClassType(componentType).main;target.hasSubTypes(componentType)&&subTypeDefaulters[componentTypeMain]&&(type=subTypeDefaulters[componentTypeMain](option))}return type}}(ComponentModel),function(entity,dependencyGetter){function createDependencyGraphItem(graph,name){return graph[name]||(graph[name]={predecessor:[],successor:[]}),graph[name]}entity.topologicalTravel=function(targetNameList,fullNameList,callback,context){if(targetNameList.length){var result=function(fullNameList){var graph={},noEntryList=[];return each$b(fullNameList,(function(name){var thisItem=createDependencyGraphItem(graph,name),availableDeps=function(originalDeps,fullNameList){var availableDeps=[];return each$b(originalDeps,(function(dep){indexOf(fullNameList,dep)>=0&&availableDeps.push(dep)})),availableDeps}(thisItem.originalDeps=dependencyGetter(name),fullNameList);thisItem.entryCount=availableDeps.length,0===thisItem.entryCount&&noEntryList.push(name),each$b(availableDeps,(function(dependentName){indexOf(thisItem.predecessor,dependentName)<0&&thisItem.predecessor.push(dependentName);var thatItem=createDependencyGraphItem(graph,dependentName);indexOf(thatItem.successor,dependentName)<0&&thatItem.successor.push(name)}))})),{graph:graph,noEntryList:noEntryList}}(fullNameList),graph=result.graph,noEntryList=result.noEntryList,targetNameSet={};for(each$b(targetNameList,(function(name){targetNameSet[name]=!0}));noEntryList.length;){var currComponentType=noEntryList.pop(),currVertex=graph[currComponentType],isInTargetNameSet=!!targetNameSet[currComponentType];isInTargetNameSet&&(callback.call(context,currComponentType,currVertex.originalDeps.slice()),delete targetNameSet[currComponentType]),each$b(currVertex.successor,isInTargetNameSet?removeEdgeAndAdd:removeEdge)}each$b(targetNameSet,(function(){var errMsg="";throw"production"!==process.env.NODE_ENV&&(errMsg=makePrintable("Circular dependency may exists: ",targetNameSet,targetNameList,fullNameList)),new Error(errMsg)}))}function removeEdge(succComponentType){graph[succComponentType].entryCount--,0===graph[succComponentType].entryCount&&noEntryList.push(succComponentType)}function removeEdgeAndAdd(succComponentType){targetNameSet[succComponentType]=!0,removeEdge(succComponentType)}}}(ComponentModel,(function(componentType){var deps=[];each$b(ComponentModel.getClassesByMainType(componentType),(function(clz){deps=deps.concat(clz.dependencies||clz.prototype.dependencies||[])})),deps=map$1(deps,(function(type){return parseClassType(type).main})),"dataset"!==componentType&&indexOf(deps,"dataset")<=0&&deps.unshift("dataset");return deps}));var ComponentModel$1=ComponentModel,platform="";"undefined"!=typeof navigator&&(platform=navigator.platform||"");var decalColor="rgba(0, 0, 0, 0.2)",globalDefault={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:decalColor,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:decalColor,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:decalColor,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:decalColor,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:decalColor,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:decalColor,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:platform.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},VISUAL_DIMENSIONS=createHashMap(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),BE_ORDINAL_Must=1,BE_ORDINAL_Might=2,BE_ORDINAL_Not=3,innerGlobalModel=makeInner();function makeSeriesEncodeForAxisCoordSys(coordDimensions,seriesModel,source){var encode={},datasetModel=querySeriesUpstreamDatasetModel(seriesModel);if(!datasetModel||!coordDimensions)return encode;var baseCategoryDimIndex,categoryWayValueDimStart,encodeItemName=[],encodeSeriesName=[],ecModel=seriesModel.ecModel,datasetMap=innerGlobalModel(ecModel).datasetMap,key=datasetModel.uid+"_"+source.seriesLayoutBy;each$b(coordDimensions=coordDimensions.slice(),(function(coordDimInfoLoose,coordDimIdx){var coordDimInfo=isObject$3(coordDimInfoLoose)?coordDimInfoLoose:coordDimensions[coordDimIdx]={name:coordDimInfoLoose};"ordinal"===coordDimInfo.type&&null==baseCategoryDimIndex&&(baseCategoryDimIndex=coordDimIdx,categoryWayValueDimStart=getDataDimCountOnCoordDim(coordDimInfo)),encode[coordDimInfo.name]=[]}));var datasetRecord=datasetMap.get(key)||datasetMap.set(key,{categoryWayDim:categoryWayValueDimStart,valueWayDim:0});function pushDim(dimIdxArr,idxFrom,idxCount){for(var i=0;i<idxCount;i++)dimIdxArr.push(idxFrom+i)}function getDataDimCountOnCoordDim(coordDimInfo){var dimsDef=coordDimInfo.dimsDef;return dimsDef?dimsDef.length:1}return each$b(coordDimensions,(function(coordDimInfo,coordDimIdx){var coordDimName=coordDimInfo.name,count=getDataDimCountOnCoordDim(coordDimInfo);if(null==baseCategoryDimIndex){var start=datasetRecord.valueWayDim;pushDim(encode[coordDimName],start,count),pushDim(encodeSeriesName,start,count),datasetRecord.valueWayDim+=count}else if(baseCategoryDimIndex===coordDimIdx)pushDim(encode[coordDimName],0,count),pushDim(encodeItemName,0,count);else{start=datasetRecord.categoryWayDim;pushDim(encode[coordDimName],start,count),pushDim(encodeSeriesName,start,count),datasetRecord.categoryWayDim+=count}})),encodeItemName.length&&(encode.itemName=encodeItemName),encodeSeriesName.length&&(encode.seriesName=encodeSeriesName),encode}function makeSeriesEncodeForNameBased(seriesModel,source,dimCount){var encode={};if(!querySeriesUpstreamDatasetModel(seriesModel))return encode;var potentialNameDimIndex,sourceFormat=source.sourceFormat,dimensionsDefine=source.dimensionsDefine;"objectRows"!==sourceFormat&&"keyedColumns"!==sourceFormat||each$b(dimensionsDefine,(function(dim,idx){"name"===(isObject$3(dim)?dim.name:dim)&&(potentialNameDimIndex=idx)}));var idxResult=function(){for(var idxRes0={},idxRes1={},guessRecords=[],i=0,len=Math.min(5,dimCount);i<len;i++){var guessResult=doGuessOrdinal(source.data,sourceFormat,source.seriesLayoutBy,dimensionsDefine,source.startIndex,i);guessRecords.push(guessResult);var isPureNumber=guessResult===BE_ORDINAL_Not;if(isPureNumber&&null==idxRes0.v&&i!==potentialNameDimIndex&&(idxRes0.v=i),(null==idxRes0.n||idxRes0.n===idxRes0.v||!isPureNumber&&guessRecords[idxRes0.n]===BE_ORDINAL_Not)&&(idxRes0.n=i),fulfilled(idxRes0)&&guessRecords[idxRes0.n]!==BE_ORDINAL_Not)return idxRes0;isPureNumber||(guessResult===BE_ORDINAL_Might&&null==idxRes1.v&&i!==potentialNameDimIndex&&(idxRes1.v=i),null!=idxRes1.n&&idxRes1.n!==idxRes1.v||(idxRes1.n=i))}function fulfilled(idxResult){return null!=idxResult.v&&null!=idxResult.n}return fulfilled(idxRes0)?idxRes0:fulfilled(idxRes1)?idxRes1:null}();if(idxResult){encode.value=[idxResult.v];var nameDimIndex=null!=potentialNameDimIndex?potentialNameDimIndex:idxResult.n;encode.itemName=[nameDimIndex],encode.seriesName=[nameDimIndex]}return encode}function querySeriesUpstreamDatasetModel(seriesModel){if(!seriesModel.get("data",!0))return queryReferringComponents(seriesModel.ecModel,"dataset",{index:seriesModel.get("datasetIndex",!0),id:seriesModel.get("datasetId",!0)},SINGLE_REFERRING).models[0]}function guessOrdinal(source,dimIndex){return doGuessOrdinal(source.data,source.sourceFormat,source.seriesLayoutBy,source.dimensionsDefine,source.startIndex,dimIndex)}function doGuessOrdinal(data,sourceFormat,seriesLayoutBy,dimensionsDefine,startIndex,dimIndex){var result,dimName,dimType;if(isTypedArray(data))return BE_ORDINAL_Not;if(dimensionsDefine){var dimDefItem=dimensionsDefine[dimIndex];isObject$3(dimDefItem)?(dimName=dimDefItem.name,dimType=dimDefItem.type):isString(dimDefItem)&&(dimName=dimDefItem)}if(null!=dimType)return"ordinal"===dimType?BE_ORDINAL_Must:BE_ORDINAL_Not;if("arrayRows"===sourceFormat){var dataArrayRows=data;if("row"===seriesLayoutBy){for(var sample=dataArrayRows[dimIndex],i=0;i<(sample||[]).length&&i<5;i++)if(null!=(result=detectValue(sample[startIndex+i])))return result}else for(i=0;i<dataArrayRows.length&&i<5;i++){var row=dataArrayRows[startIndex+i];if(row&&null!=(result=detectValue(row[dimIndex])))return result}}else if("objectRows"===sourceFormat){var dataObjectRows=data;if(!dimName)return BE_ORDINAL_Not;for(i=0;i<dataObjectRows.length&&i<5;i++){if((item=dataObjectRows[i])&&null!=(result=detectValue(item[dimName])))return result}}else if("keyedColumns"===sourceFormat){if(!dimName)return BE_ORDINAL_Not;if(!(sample=data[dimName])||isTypedArray(sample))return BE_ORDINAL_Not;for(i=0;i<sample.length&&i<5;i++)if(null!=(result=detectValue(sample[i])))return result}else if("original"===sourceFormat){var dataOriginal=data;for(i=0;i<dataOriginal.length&&i<5;i++){var item,val=getDataItemValue(item=dataOriginal[i]);if(!isArray(val))return BE_ORDINAL_Not;if(null!=(result=detectValue(val[dimIndex])))return result}}function detectValue(val){var beStr=isString(val);return null!=val&&Number.isFinite(Number(val))&&""!==val?beStr?BE_ORDINAL_Might:BE_ORDINAL_Not:beStr&&"-"!==val?BE_ORDINAL_Must:void 0}return BE_ORDINAL_Not}var internalOptionCreatorMap=createHashMap();var reCreateSeriesIndices,assertSeriesInitialized,initBase,innerColor=makeInner(),innerDecal=makeInner(),PaletteMixin=function(){function PaletteMixin(){}return PaletteMixin.prototype.getColorFromPalette=function(name,scope,requestNum){var defaultPalette=normalizeToArray(this.get("color",!0)),layeredPalette=this.get("colorLayer",!0);return getFromPalette(this,innerColor,defaultPalette,layeredPalette,name,scope,requestNum)},PaletteMixin.prototype.clearColorPalette=function(){!function(that,inner){inner(that).paletteIdx=0,inner(that).paletteNameMap={}}(this,innerColor)},PaletteMixin}();function getFromPalette(that,inner,defaultPalette,layeredPalette,name,scope,requestNum){var scopeFields=inner(scope=scope||that),paletteIdx=scopeFields.paletteIdx||0,paletteNameMap=scopeFields.paletteNameMap=scopeFields.paletteNameMap||{};if(paletteNameMap.hasOwnProperty(name))return paletteNameMap[name];var palette=null!=requestNum&&layeredPalette?function(palettes,requestColorNum){for(var paletteNum=palettes.length,i=0;i<paletteNum;i++)if(palettes[i].length>requestColorNum)return palettes[i];return palettes[paletteNum-1]}(layeredPalette,requestNum):defaultPalette;if((palette=palette||defaultPalette)&&palette.length){var pickedPaletteItem=palette[paletteIdx];return name&&(paletteNameMap[name]=pickedPaletteItem),scopeFields.paletteIdx=(paletteIdx+1)%palette.length,pickedPaletteItem}}var BUITIN_COMPONENTS_MAP={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},BUILTIN_CHARTS_MAP={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},componetsMissingLogPrinted={};var GlobalModel=function(_super){function GlobalModel(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(GlobalModel,_super),GlobalModel.prototype.init=function(option,parentModel,ecModel,theme,locale,optionManager){theme=theme||{},this.option=null,this._theme=new Model$1(theme),this._locale=new Model$1(locale),this._optionManager=optionManager},GlobalModel.prototype.setOption=function(option,opts,optionPreprocessorFuncs){"production"!==process.env.NODE_ENV&&(assert(null!=option,"option is null/undefined"),assert(1!==option["\0_ec_inner"],"please use chart.getOption()"));var innerOpt=normalizeSetOptionInput(opts);this._optionManager.setOption(option,optionPreprocessorFuncs,innerOpt),this._resetOption(null,innerOpt)},GlobalModel.prototype.resetOption=function(type,opt){return this._resetOption(type,normalizeSetOptionInput(opt))},GlobalModel.prototype._resetOption=function(type,opt){var optionChanged=!1,optionManager=this._optionManager;if(!type||"recreate"===type){var baseOption=optionManager.mountOption("recreate"===type);"production"!==process.env.NODE_ENV&&each$b(baseOption,(function(componentOption,mainType){if(!ComponentModel$1.hasClass(mainType)){var componentImportName=BUITIN_COMPONENTS_MAP[mainType];componentImportName&&!componetsMissingLogPrinted[componentImportName]&&(error("Component "+mainType+" is used but not imported.\nimport { "+componentImportName+" } from 'echarts/components';\necharts.use(["+componentImportName+"]);"),componetsMissingLogPrinted[componentImportName]=!0)}})),this.option&&"recreate"!==type?(this.restoreData(),this._mergeOption(baseOption,opt)):initBase(this,baseOption),optionChanged=!0}if("timeline"!==type&&"media"!==type||this.restoreData(),!type||"recreate"===type||"timeline"===type){var timelineOption=optionManager.getTimelineOption(this);timelineOption&&(optionChanged=!0,this._mergeOption(timelineOption,opt))}if(!type||"recreate"===type||"media"===type){var mediaOptions=optionManager.getMediaOption(this);mediaOptions.length&&each$b(mediaOptions,(function(mediaOption){optionChanged=!0,this._mergeOption(mediaOption,opt)}),this)}return optionChanged},GlobalModel.prototype.mergeOption=function(option){this._mergeOption(option,null)},GlobalModel.prototype._mergeOption=function(newOption,opt){var option=this.option,componentsMap=this._componentsMap,componentsCount=this._componentsCount,newCmptTypes=[],newCmptTypeMap=createHashMap(),replaceMergeMainTypeMap=opt&&opt.replaceMergeMainTypeMap;innerGlobalModel(this).datasetMap=createHashMap(),each$b(newOption,(function(componentOption,mainType){null!=componentOption&&(ComponentModel$1.hasClass(mainType)?mainType&&(newCmptTypes.push(mainType),newCmptTypeMap.set(mainType,!0)):option[mainType]=null==option[mainType]?clone$3(componentOption):merge(option[mainType],componentOption,!0))})),replaceMergeMainTypeMap&&replaceMergeMainTypeMap.each((function(val,mainTypeInReplaceMerge){ComponentModel$1.hasClass(mainTypeInReplaceMerge)&&!newCmptTypeMap.get(mainTypeInReplaceMerge)&&(newCmptTypes.push(mainTypeInReplaceMerge),newCmptTypeMap.set(mainTypeInReplaceMerge,!0))})),ComponentModel$1.topologicalTravel(newCmptTypes,ComponentModel$1.getAllClassMainTypes(),(function(mainType){var newCmptOptionList=function(ecModel,mainType,newCmptOptionList){var internalOptionCreator=internalOptionCreatorMap.get(mainType);if(!internalOptionCreator)return newCmptOptionList;var internalOptions=internalOptionCreator(ecModel);if(!internalOptions)return newCmptOptionList;if("production"!==process.env.NODE_ENV)for(var i=0;i<internalOptions.length;i++)assert(isComponentIdInternal(internalOptions[i]));return newCmptOptionList.concat(internalOptions)}(this,mainType,normalizeToArray(newOption[mainType])),oldCmptList=componentsMap.get(mainType),mergeMode=oldCmptList?replaceMergeMainTypeMap&&replaceMergeMainTypeMap.get(mainType)?"replaceMerge":"normalMerge":"replaceAll",mappingResult=mappingToExists(oldCmptList,newCmptOptionList,mergeMode);(function(mappingResult,mainType,componentModelCtor){each$b(mappingResult,(function(item){var newOption=item.newOption;isObject$3(newOption)&&(item.keyInfo.mainType=mainType,item.keyInfo.subType=function(mainType,newCmptOption,existComponent,componentModelCtor){return newCmptOption.type?newCmptOption.type:existComponent?existComponent.subType:componentModelCtor.determineSubType(mainType,newCmptOption)}(mainType,newOption,item.existing,componentModelCtor))}))})(mappingResult,mainType,ComponentModel$1),option[mainType]=null,componentsMap.set(mainType,null),componentsCount.set(mainType,0);var tooltipExists,tooltipWarningLogged,optionsByMainType=[],cmptsByMainType=[],cmptsCountByMainType=0;each$b(mappingResult,(function(resultItem,index){var componentModel=resultItem.existing,newCmptOption=resultItem.newOption;if(newCmptOption){var isSeriesType="series"===mainType,ComponentModelClass=ComponentModel$1.getClass(mainType,resultItem.keyInfo.subType,!isSeriesType);if(!ComponentModelClass){if("production"!==process.env.NODE_ENV){var subType=resultItem.keyInfo.subType,seriesImportName=BUILTIN_CHARTS_MAP[subType];componetsMissingLogPrinted[subType]||(componetsMissingLogPrinted[subType]=!0,error(seriesImportName?"Series "+subType+" is used but not imported.\nimport { "+seriesImportName+" } from 'echarts/charts';\necharts.use(["+seriesImportName+"]);":"Unknown series "+subType))}return}if("tooltip"===mainType){if(tooltipExists)return void("production"!==process.env.NODE_ENV&&(tooltipWarningLogged||(warn("Currently only one tooltip component is allowed."),tooltipWarningLogged=!0)));tooltipExists=!0}if(componentModel&&componentModel.constructor===ComponentModelClass)componentModel.name=resultItem.keyInfo.name,componentModel.mergeOption(newCmptOption,this),componentModel.optionUpdated(newCmptOption,!1);else{var extraOpt=extend({componentIndex:index},resultItem.keyInfo);extend(componentModel=new ComponentModelClass(newCmptOption,this,this,extraOpt),extraOpt),resultItem.brandNew&&(componentModel.__requireNewView=!0),componentModel.init(newCmptOption,this,this),componentModel.optionUpdated(null,!0)}}else componentModel&&(componentModel.mergeOption({},this),componentModel.optionUpdated({},!1));componentModel?(optionsByMainType.push(componentModel.option),cmptsByMainType.push(componentModel),cmptsCountByMainType++):(optionsByMainType.push(void 0),cmptsByMainType.push(void 0))}),this),option[mainType]=optionsByMainType,componentsMap.set(mainType,cmptsByMainType),componentsCount.set(mainType,cmptsCountByMainType),"series"===mainType&&reCreateSeriesIndices(this)}),this),this._seriesIndices||reCreateSeriesIndices(this)},GlobalModel.prototype.getOption=function(){var option=clone$3(this.option);return each$b(option,(function(optInMainType,mainType){if(ComponentModel$1.hasClass(mainType)){for(var opts=normalizeToArray(optInMainType),realLen=opts.length,metNonInner=!1,i=realLen-1;i>=0;i--)opts[i]&&!isComponentIdInternal(opts[i])?metNonInner=!0:(opts[i]=null,!metNonInner&&realLen--);opts.length=realLen,option[mainType]=opts}})),delete option["\0_ec_inner"],option},GlobalModel.prototype.getTheme=function(){return this._theme},GlobalModel.prototype.getLocaleModel=function(){return this._locale},GlobalModel.prototype.setUpdatePayload=function(payload){this._payload=payload},GlobalModel.prototype.getUpdatePayload=function(){return this._payload},GlobalModel.prototype.getComponent=function(mainType,idx){var list=this._componentsMap.get(mainType);if(list){var cmpt=list[idx||0];if(cmpt)return cmpt;if(null==idx)for(var i=0;i<list.length;i++)if(list[i])return list[i]}},GlobalModel.prototype.queryComponents=function(condition){var mainType=condition.mainType;if(!mainType)return[];var result,index=condition.index,id=condition.id,name=condition.name,cmpts=this._componentsMap.get(mainType);return cmpts&&cmpts.length?(null!=index?(result=[],each$b(normalizeToArray(index),(function(idx){cmpts[idx]&&result.push(cmpts[idx])}))):result=null!=id?queryByIdOrName("id",id,cmpts):null!=name?queryByIdOrName("name",name,cmpts):filter(cmpts,(function(cmpt){return!!cmpt})),filterBySubType(result,condition)):[]},GlobalModel.prototype.findComponents=function(condition){var q,indexAttr,idAttr,nameAttr,res,query=condition.query,mainType=condition.mainType,queryCond=(indexAttr=mainType+"Index",idAttr=mainType+"Id",nameAttr=mainType+"Name",!(q=query)||null==q[indexAttr]&&null==q[idAttr]&&null==q[nameAttr]?null:{mainType:mainType,index:q[indexAttr],id:q[idAttr],name:q[nameAttr]}),result=queryCond?this.queryComponents(queryCond):filter(this._componentsMap.get(mainType),(function(cmpt){return!!cmpt}));return res=filterBySubType(result,condition),condition.filter?filter(res,condition.filter):res},GlobalModel.prototype.eachComponent=function(mainType,cb,context){var componentsMap=this._componentsMap;if(isFunction(mainType)){var ctxForAll_1=cb,cbForAll_1=mainType;componentsMap.each((function(cmpts,componentType){for(var i=0;cmpts&&i<cmpts.length;i++){var cmpt=cmpts[i];cmpt&&cbForAll_1.call(ctxForAll_1,componentType,cmpt,cmpt.componentIndex)}}))}else for(var cmpts=isString(mainType)?componentsMap.get(mainType):isObject$3(mainType)?this.findComponents(mainType):null,i=0;cmpts&&i<cmpts.length;i++){var cmpt=cmpts[i];cmpt&&cb.call(context,cmpt,cmpt.componentIndex)}},GlobalModel.prototype.getSeriesByName=function(name){var nameStr=convertOptionIdName(name,null);return filter(this._componentsMap.get("series"),(function(oneSeries){return!!oneSeries&&null!=nameStr&&oneSeries.name===nameStr}))},GlobalModel.prototype.getSeriesByIndex=function(seriesIndex){return this._componentsMap.get("series")[seriesIndex]},GlobalModel.prototype.getSeriesByType=function(subType){return filter(this._componentsMap.get("series"),(function(oneSeries){return!!oneSeries&&oneSeries.subType===subType}))},GlobalModel.prototype.getSeries=function(){return filter(this._componentsMap.get("series"),(function(oneSeries){return!!oneSeries}))},GlobalModel.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},GlobalModel.prototype.eachSeries=function(cb,context){assertSeriesInitialized(this),each$b(this._seriesIndices,(function(rawSeriesIndex){var series=this._componentsMap.get("series")[rawSeriesIndex];cb.call(context,series,rawSeriesIndex)}),this)},GlobalModel.prototype.eachRawSeries=function(cb,context){each$b(this._componentsMap.get("series"),(function(series){series&&cb.call(context,series,series.componentIndex)}))},GlobalModel.prototype.eachSeriesByType=function(subType,cb,context){assertSeriesInitialized(this),each$b(this._seriesIndices,(function(rawSeriesIndex){var series=this._componentsMap.get("series")[rawSeriesIndex];series.subType===subType&&cb.call(context,series,rawSeriesIndex)}),this)},GlobalModel.prototype.eachRawSeriesByType=function(subType,cb,context){return each$b(this.getSeriesByType(subType),cb,context)},GlobalModel.prototype.isSeriesFiltered=function(seriesModel){return assertSeriesInitialized(this),null==this._seriesIndicesMap.get(seriesModel.componentIndex)},GlobalModel.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},GlobalModel.prototype.filterSeries=function(cb,context){assertSeriesInitialized(this);var newSeriesIndices=[];each$b(this._seriesIndices,(function(seriesRawIdx){var series=this._componentsMap.get("series")[seriesRawIdx];cb.call(context,series,seriesRawIdx)&&newSeriesIndices.push(seriesRawIdx)}),this),this._seriesIndices=newSeriesIndices,this._seriesIndicesMap=createHashMap(newSeriesIndices)},GlobalModel.prototype.restoreData=function(payload){reCreateSeriesIndices(this);var componentsMap=this._componentsMap,componentTypes=[];componentsMap.each((function(components,componentType){ComponentModel$1.hasClass(componentType)&&componentTypes.push(componentType)})),ComponentModel$1.topologicalTravel(componentTypes,ComponentModel$1.getAllClassMainTypes(),(function(componentType){each$b(componentsMap.get(componentType),(function(component){!component||"series"===componentType&&function(seriesModel,payload){if(payload){var index=payload.seriesIndex,id=payload.seriesId,name_1=payload.seriesName;return null!=index&&seriesModel.componentIndex!==index||null!=id&&seriesModel.id!==id||null!=name_1&&seriesModel.name!==name_1}}(component,payload)||component.restoreData()}))}))},GlobalModel.internalField=(reCreateSeriesIndices=function(ecModel){var seriesIndices=ecModel._seriesIndices=[];each$b(ecModel._componentsMap.get("series"),(function(series){series&&seriesIndices.push(series.componentIndex)})),ecModel._seriesIndicesMap=createHashMap(seriesIndices)},assertSeriesInitialized=function(ecModel){if("production"!==process.env.NODE_ENV&&!ecModel._seriesIndices)throw new Error("Option should contains series.")},void(initBase=function(ecModel,baseOption){ecModel.option={},ecModel.option["\0_ec_inner"]=1,ecModel._componentsMap=createHashMap({series:[]}),ecModel._componentsCount=createHashMap();var airaOption=baseOption.aria;isObject$3(airaOption)&&null==airaOption.enabled&&(airaOption.enabled=!0),function(option,theme){var notMergeColorLayer=option.color&&!option.colorLayer;each$b(theme,(function(themeItem,name){"colorLayer"===name&&notMergeColorLayer||ComponentModel$1.hasClass(name)||("object"==typeof themeItem?option[name]=option[name]?merge(option[name],themeItem,!1):clone$3(themeItem):null==option[name]&&(option[name]=themeItem))}))}(baseOption,ecModel._theme.option),merge(baseOption,globalDefault,!1),ecModel._mergeOption(baseOption,null)})),GlobalModel}(Model$1);function queryByIdOrName(attr,idOrName,cmpts){if(isArray(idOrName)){var keyMap_1=createHashMap();return each$b(idOrName,(function(idOrNameItem){null!=idOrNameItem&&(null!=convertOptionIdName(idOrNameItem,null)&&keyMap_1.set(idOrNameItem,!0))})),filter(cmpts,(function(cmpt){return cmpt&&keyMap_1.get(cmpt[attr])}))}var idName_1=convertOptionIdName(idOrName,null);return filter(cmpts,(function(cmpt){return cmpt&&null!=idName_1&&cmpt[attr]===idName_1}))}function filterBySubType(components,condition){return condition.hasOwnProperty("subType")?filter(components,(function(cmpt){return cmpt&&cmpt.subType===condition.subType})):components}function normalizeSetOptionInput(opts){var replaceMergeMainTypeMap=createHashMap();return opts&&each$b(normalizeToArray(opts.replaceMerge),(function(mainType){"production"!==process.env.NODE_ENV&&assert(ComponentModel$1.hasClass(mainType),'"'+mainType+'" is not valid component main type in "replaceMerge"'),replaceMergeMainTypeMap.set(mainType,!0)})),{replaceMergeMainTypeMap:replaceMergeMainTypeMap}}mixin(GlobalModel,PaletteMixin);var GlobalModel$1=GlobalModel,availableMethods=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],ExtensionAPI$1=function(ecInstance){each$b(availableMethods,(function(methodName){this[methodName]=bind$1(ecInstance[methodName],ecInstance)}),this)},coordinateSystemCreators={},CoordinateSystemManager=function(){function CoordinateSystemManager(){this._coordinateSystems=[]}return CoordinateSystemManager.prototype.create=function(ecModel,api){var coordinateSystems=[];each$b(coordinateSystemCreators,(function(creator,type){var list=creator.create(ecModel,api);coordinateSystems=coordinateSystems.concat(list||[])})),this._coordinateSystems=coordinateSystems},CoordinateSystemManager.prototype.update=function(ecModel,api){each$b(this._coordinateSystems,(function(coordSys){coordSys.update&&coordSys.update(ecModel,api)}))},CoordinateSystemManager.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},CoordinateSystemManager.register=function(type,creator){coordinateSystemCreators[type]=creator},CoordinateSystemManager.get=function(type){return coordinateSystemCreators[type]},CoordinateSystemManager}(),CoordinateSystem=CoordinateSystemManager,QUERY_REG=/^(min|max)?(.+)$/,OptionManager=function(){function OptionManager(api){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=api}return OptionManager.prototype.setOption=function(rawOption,optionPreprocessorFuncs,opt){rawOption&&(each$b(normalizeToArray(rawOption.series),(function(series){series&&series.data&&isTypedArray(series.data)&&setAsPrimitive(series.data)})),each$b(normalizeToArray(rawOption.dataset),(function(dataset){dataset&&dataset.source&&isTypedArray(dataset.source)&&setAsPrimitive(dataset.source)}))),rawOption=clone$3(rawOption);var optionBackup=this._optionBackup,newParsedOption=function(rawOption,optionPreprocessorFuncs,isNew){var mediaDefault,baseOption,mediaList=[],declaredBaseOption=rawOption.baseOption,timelineOnRoot=rawOption.timeline,timelineOptionsOnRoot=rawOption.options,mediaOnRoot=rawOption.media,hasMedia=!!rawOption.media,hasTimeline=!!(timelineOptionsOnRoot||timelineOnRoot||declaredBaseOption&&declaredBaseOption.timeline);declaredBaseOption?(baseOption=declaredBaseOption).timeline||(baseOption.timeline=timelineOnRoot):((hasTimeline||hasMedia)&&(rawOption.options=rawOption.media=null),baseOption=rawOption);hasMedia&&(isArray(mediaOnRoot)?each$b(mediaOnRoot,(function(singleMedia){"production"!==process.env.NODE_ENV&&singleMedia&&!singleMedia.option&&isObject$3(singleMedia.query)&&isObject$3(singleMedia.query.option)&&error("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"),singleMedia&&singleMedia.option&&(singleMedia.query?mediaList.push(singleMedia):mediaDefault||(mediaDefault=singleMedia))})):"production"!==process.env.NODE_ENV&&error("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }"));function doPreprocess(option){each$b(optionPreprocessorFuncs,(function(preProcess){preProcess(option,isNew)}))}return doPreprocess(baseOption),each$b(timelineOptionsOnRoot,(function(option){return doPreprocess(option)})),each$b(mediaList,(function(media){return doPreprocess(media.option)})),{baseOption:baseOption,timelineOptions:timelineOptionsOnRoot||[],mediaDefault:mediaDefault,mediaList:mediaList}}(rawOption,optionPreprocessorFuncs,!optionBackup);this._newBaseOption=newParsedOption.baseOption,optionBackup?(newParsedOption.timelineOptions.length&&(optionBackup.timelineOptions=newParsedOption.timelineOptions),newParsedOption.mediaList.length&&(optionBackup.mediaList=newParsedOption.mediaList),newParsedOption.mediaDefault&&(optionBackup.mediaDefault=newParsedOption.mediaDefault)):this._optionBackup=newParsedOption},OptionManager.prototype.mountOption=function(isRecreate){var optionBackup=this._optionBackup;return this._timelineOptions=optionBackup.timelineOptions,this._mediaList=optionBackup.mediaList,this._mediaDefault=optionBackup.mediaDefault,this._currentMediaIndices=[],clone$3(isRecreate?optionBackup.baseOption:this._newBaseOption)},OptionManager.prototype.getTimelineOption=function(ecModel){var option,timelineOptions=this._timelineOptions;if(timelineOptions.length){var timelineModel=ecModel.getComponent("timeline");timelineModel&&(option=clone$3(timelineOptions[timelineModel.getCurrentIndex()]))}return option},OptionManager.prototype.getMediaOption=function(ecModel){var indices1,indices2,ecWidth=this._api.getWidth(),ecHeight=this._api.getHeight(),mediaList=this._mediaList,mediaDefault=this._mediaDefault,indices=[],result=[];if(!mediaList.length&&!mediaDefault)return result;for(var i=0,len=mediaList.length;i<len;i++)applyMediaQuery(mediaList[i].query,ecWidth,ecHeight)&&indices.push(i);return!indices.length&&mediaDefault&&(indices=[-1]),indices.length&&(indices1=indices,indices2=this._currentMediaIndices,indices1.join(",")!==indices2.join(","))&&(result=map$1(indices,(function(index){return clone$3(-1===index?mediaDefault.option:mediaList[index].option)}))),this._currentMediaIndices=indices,result},OptionManager}();function applyMediaQuery(query,ecWidth,ecHeight){var realMap={width:ecWidth,height:ecHeight,aspectratio:ecWidth/ecHeight},applicable=!0;return each$b(query,(function(value,attr){var matched=attr.match(QUERY_REG);if(matched&&matched[1]&&matched[2]){var operator=matched[1],realAttr=matched[2].toLowerCase();(function(real,expect,operator){return"min"===operator?real>=expect:"max"===operator?real<=expect:real===expect})(realMap[realAttr],value,operator)||(applicable=!1)}})),applicable}var OptionManager$1=OptionManager,each$9=each$b,isObject$2=isObject$3,POSSIBLE_STYLES=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function compatEC2ItemStyle(opt){var itemStyleOpt=opt&&opt.itemStyle;if(itemStyleOpt)for(var i=0,len=POSSIBLE_STYLES.length;i<len;i++){var styleName=POSSIBLE_STYLES[i],normalItemStyleOpt=itemStyleOpt.normal,emphasisItemStyleOpt=itemStyleOpt.emphasis;normalItemStyleOpt&&normalItemStyleOpt[styleName]&&("production"!==process.env.NODE_ENV&&deprecateReplaceLog("itemStyle.normal."+styleName,styleName),opt[styleName]=opt[styleName]||{},opt[styleName].normal?merge(opt[styleName].normal,normalItemStyleOpt[styleName]):opt[styleName].normal=normalItemStyleOpt[styleName],normalItemStyleOpt[styleName]=null),emphasisItemStyleOpt&&emphasisItemStyleOpt[styleName]&&("production"!==process.env.NODE_ENV&&deprecateReplaceLog("itemStyle.emphasis."+styleName,"emphasis."+styleName),opt[styleName]=opt[styleName]||{},opt[styleName].emphasis?merge(opt[styleName].emphasis,emphasisItemStyleOpt[styleName]):opt[styleName].emphasis=emphasisItemStyleOpt[styleName],emphasisItemStyleOpt[styleName]=null)}}function convertNormalEmphasis(opt,optType,useExtend){if(opt&&opt[optType]&&(opt[optType].normal||opt[optType].emphasis)){var normalOpt=opt[optType].normal,emphasisOpt=opt[optType].emphasis;normalOpt&&("production"!==process.env.NODE_ENV&&deprecateLog("'normal' hierarchy in "+optType+" has been removed since 4.0. All style properties are configured in "+optType+" directly now."),useExtend?(opt[optType].normal=opt[optType].emphasis=null,defaults(opt[optType],normalOpt)):opt[optType]=normalOpt),emphasisOpt&&("production"!==process.env.NODE_ENV&&deprecateLog(optType+".emphasis has been changed to emphasis."+optType+" since 4.0"),opt.emphasis=opt.emphasis||{},opt.emphasis[optType]=emphasisOpt,emphasisOpt.focus&&(opt.emphasis.focus=emphasisOpt.focus),emphasisOpt.blurScope&&(opt.emphasis.blurScope=emphasisOpt.blurScope))}}function removeEC3NormalStatus(opt){convertNormalEmphasis(opt,"itemStyle"),convertNormalEmphasis(opt,"lineStyle"),convertNormalEmphasis(opt,"areaStyle"),convertNormalEmphasis(opt,"label"),convertNormalEmphasis(opt,"labelLine"),convertNormalEmphasis(opt,"upperLabel"),convertNormalEmphasis(opt,"edgeLabel")}function compatTextStyle(opt,propName){var labelOptSingle=isObject$2(opt)&&opt[propName],textStyle=isObject$2(labelOptSingle)&&labelOptSingle.textStyle;if(textStyle){"production"!==process.env.NODE_ENV&&deprecateLog("textStyle hierarchy in "+propName+" has been removed since 4.0. All textStyle properties are configured in "+propName+" directly now.");for(var i=0,len=TEXT_STYLE_OPTIONS.length;i<len;i++){var textPropName=TEXT_STYLE_OPTIONS[i];textStyle.hasOwnProperty(textPropName)&&(labelOptSingle[textPropName]=textStyle[textPropName])}}}function compatEC3CommonStyles(opt){opt&&(removeEC3NormalStatus(opt),compatTextStyle(opt,"label"),opt.emphasis&&compatTextStyle(opt.emphasis,"label"))}function toArr(o){return isArray(o)?o:o?[o]:[]}function toObj(o){return(isArray(o)?o[0]:o)||{}}function globalCompatStyle(option,isTheme){each$9(toArr(option.series),(function(seriesOpt){isObject$2(seriesOpt)&&function(seriesOpt){if(isObject$2(seriesOpt)){compatEC2ItemStyle(seriesOpt),removeEC3NormalStatus(seriesOpt),compatTextStyle(seriesOpt,"label"),compatTextStyle(seriesOpt,"upperLabel"),compatTextStyle(seriesOpt,"edgeLabel"),seriesOpt.emphasis&&(compatTextStyle(seriesOpt.emphasis,"label"),compatTextStyle(seriesOpt.emphasis,"upperLabel"),compatTextStyle(seriesOpt.emphasis,"edgeLabel"));var markPoint=seriesOpt.markPoint;markPoint&&(compatEC2ItemStyle(markPoint),compatEC3CommonStyles(markPoint));var markLine=seriesOpt.markLine;markLine&&(compatEC2ItemStyle(markLine),compatEC3CommonStyles(markLine));var markArea=seriesOpt.markArea;markArea&&compatEC3CommonStyles(markArea);var data=seriesOpt.data;if("graph"===seriesOpt.type){data=data||seriesOpt.nodes;var edgeData=seriesOpt.links||seriesOpt.edges;if(edgeData&&!isTypedArray(edgeData))for(var i=0;i<edgeData.length;i++)compatEC3CommonStyles(edgeData[i]);each$b(seriesOpt.categories,(function(opt){removeEC3NormalStatus(opt)}))}if(data&&!isTypedArray(data))for(i=0;i<data.length;i++)compatEC3CommonStyles(data[i]);if((markPoint=seriesOpt.markPoint)&&markPoint.data){var mpData=markPoint.data;for(i=0;i<mpData.length;i++)compatEC3CommonStyles(mpData[i])}if((markLine=seriesOpt.markLine)&&markLine.data){var mlData=markLine.data;for(i=0;i<mlData.length;i++)isArray(mlData[i])?(compatEC3CommonStyles(mlData[i][0]),compatEC3CommonStyles(mlData[i][1])):compatEC3CommonStyles(mlData[i])}"gauge"===seriesOpt.type?(compatTextStyle(seriesOpt,"axisLabel"),compatTextStyle(seriesOpt,"title"),compatTextStyle(seriesOpt,"detail")):"treemap"===seriesOpt.type?(convertNormalEmphasis(seriesOpt.breadcrumb,"itemStyle"),each$b(seriesOpt.levels,(function(opt){removeEC3NormalStatus(opt)}))):"tree"===seriesOpt.type&&removeEC3NormalStatus(seriesOpt.leaves)}}(seriesOpt)}));var axes=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];isTheme&&axes.push("valueAxis","categoryAxis","logAxis","timeAxis"),each$9(axes,(function(axisName){each$9(toArr(option[axisName]),(function(axisOpt){axisOpt&&(compatTextStyle(axisOpt,"axisLabel"),compatTextStyle(axisOpt.axisPointer,"label"))}))})),each$9(toArr(option.parallel),(function(parallelOpt){var parallelAxisDefault=parallelOpt&&parallelOpt.parallelAxisDefault;compatTextStyle(parallelAxisDefault,"axisLabel"),compatTextStyle(parallelAxisDefault&&parallelAxisDefault.axisPointer,"label")})),each$9(toArr(option.calendar),(function(calendarOpt){convertNormalEmphasis(calendarOpt,"itemStyle"),compatTextStyle(calendarOpt,"dayLabel"),compatTextStyle(calendarOpt,"monthLabel"),compatTextStyle(calendarOpt,"yearLabel")})),each$9(toArr(option.radar),(function(radarOpt){compatTextStyle(radarOpt,"name"),radarOpt.name&&null==radarOpt.axisName&&(radarOpt.axisName=radarOpt.name,delete radarOpt.name,"production"!==process.env.NODE_ENV&&deprecateLog("name property in radar component has been changed to axisName")),null!=radarOpt.nameGap&&null==radarOpt.axisNameGap&&(radarOpt.axisNameGap=radarOpt.nameGap,delete radarOpt.nameGap,"production"!==process.env.NODE_ENV&&deprecateLog("nameGap property in radar component has been changed to axisNameGap")),"production"!==process.env.NODE_ENV&&each$9(radarOpt.indicator,(function(indicatorOpt){indicatorOpt.text&&deprecateReplaceLog("text","name","radar.indicator")}))})),each$9(toArr(option.geo),(function(geoOpt){isObject$2(geoOpt)&&(compatEC3CommonStyles(geoOpt),each$9(toArr(geoOpt.regions),(function(regionObj){compatEC3CommonStyles(regionObj)})))})),each$9(toArr(option.timeline),(function(timelineOpt){compatEC3CommonStyles(timelineOpt),convertNormalEmphasis(timelineOpt,"label"),convertNormalEmphasis(timelineOpt,"itemStyle"),convertNormalEmphasis(timelineOpt,"controlStyle",!0);var data=timelineOpt.data;isArray(data)&&each$b(data,(function(item){isObject$3(item)&&(convertNormalEmphasis(item,"label"),convertNormalEmphasis(item,"itemStyle"))}))})),each$9(toArr(option.toolbox),(function(toolboxOpt){convertNormalEmphasis(toolboxOpt,"iconStyle"),each$9(toolboxOpt.feature,(function(featureOpt){convertNormalEmphasis(featureOpt,"iconStyle")}))})),compatTextStyle(toObj(option.axisPointer),"label"),compatTextStyle(toObj(option.tooltip).axisPointer,"label")}function compatLayoutProperties(option){option&&each$b(LAYOUT_PROPERTIES,(function(prop){prop[0]in option&&!(prop[1]in option)&&(option[prop[1]]=option[prop[0]])}))}var LAYOUT_PROPERTIES=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],COMPATITABLE_COMPONENTS=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],BAR_ITEM_STYLE_MAP=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function compatBarItemStyle(option){var itemStyle=option&&option.itemStyle;if(itemStyle)for(var i=0;i<BAR_ITEM_STYLE_MAP.length;i++){var oldName=BAR_ITEM_STYLE_MAP[i][1],newName=BAR_ITEM_STYLE_MAP[i][0];null!=itemStyle[oldName]&&(itemStyle[newName]=itemStyle[oldName],"production"!==process.env.NODE_ENV&&deprecateReplaceLog(oldName,newName))}}function compatPieLabel(option){option&&"edge"===option.alignTo&&null!=option.margin&&null==option.edgeDistance&&("production"!==process.env.NODE_ENV&&deprecateReplaceLog("label.margin","label.edgeDistance","pie"),option.edgeDistance=option.margin)}function compatSunburstState(option){option&&option.downplay&&!option.blur&&(option.blur=option.downplay,"production"!==process.env.NODE_ENV&&deprecateReplaceLog("downplay","blur","sunburst"))}function traverseTree(data,cb){if(data)for(var i=0;i<data.length;i++)cb(data[i]),data[i]&&traverseTree(data[i].children,cb)}function globalBackwardCompat(option,isTheme){globalCompatStyle(option,isTheme),option.series=normalizeToArray(option.series),each$b(option.series,(function(seriesOpt){if(isObject$3(seriesOpt)){var seriesType=seriesOpt.type;if("line"===seriesType)null!=seriesOpt.clipOverflow&&(seriesOpt.clip=seriesOpt.clipOverflow,"production"!==process.env.NODE_ENV&&deprecateReplaceLog("clipOverflow","clip","line"));else if("pie"===seriesType||"gauge"===seriesType){if(null!=seriesOpt.clockWise&&(seriesOpt.clockwise=seriesOpt.clockWise,"production"!==process.env.NODE_ENV&&deprecateReplaceLog("clockWise","clockwise")),compatPieLabel(seriesOpt.label),(data=seriesOpt.data)&&!isTypedArray(data))for(var i=0;i<data.length;i++)compatPieLabel(data[i]);null!=seriesOpt.hoverOffset&&(seriesOpt.emphasis=seriesOpt.emphasis||{},(seriesOpt.emphasis.scaleSize=null)&&("production"!==process.env.NODE_ENV&&deprecateReplaceLog("hoverOffset","emphasis.scaleSize"),seriesOpt.emphasis.scaleSize=seriesOpt.hoverOffset))}else if("gauge"===seriesType){var pointerColor=function(opt,path){for(var pathArr=path.split(","),obj=opt,i=0;i<pathArr.length&&null!=(obj=obj&&obj[pathArr[i]]);i++);return obj}(seriesOpt,"pointer.color");null!=pointerColor&&function(opt,path,val,overwrite){for(var key,pathArr=path.split(","),obj=opt,i=0;i<pathArr.length-1;i++)null==obj[key=pathArr[i]]&&(obj[key]={}),obj=obj[key];(overwrite||null==obj[pathArr[i]])&&(obj[pathArr[i]]=val)}(seriesOpt,"itemStyle.color",pointerColor)}else if("bar"===seriesType){var data;if(compatBarItemStyle(seriesOpt),compatBarItemStyle(seriesOpt.backgroundStyle),compatBarItemStyle(seriesOpt.emphasis),(data=seriesOpt.data)&&!isTypedArray(data))for(i=0;i<data.length;i++)"object"==typeof data[i]&&(compatBarItemStyle(data[i]),compatBarItemStyle(data[i]&&data[i].emphasis))}else if("sunburst"===seriesType){var highlightPolicy=seriesOpt.highlightPolicy;highlightPolicy&&(seriesOpt.emphasis=seriesOpt.emphasis||{},seriesOpt.emphasis.focus||(seriesOpt.emphasis.focus=highlightPolicy,"production"!==process.env.NODE_ENV&&deprecateReplaceLog("highlightPolicy","emphasis.focus","sunburst"))),compatSunburstState(seriesOpt),traverseTree(seriesOpt.data,compatSunburstState)}else"graph"===seriesType||"sankey"===seriesType?function(option){option&&null!=option.focusNodeAdjacency&&(option.emphasis=option.emphasis||{},null==option.emphasis.focus&&("production"!==process.env.NODE_ENV&&deprecateReplaceLog("focusNodeAdjacency","emphasis: { focus: 'adjacency'}","graph/sankey"),option.emphasis.focus="adjacency"))}(seriesOpt):"map"===seriesType&&(seriesOpt.mapType&&!seriesOpt.map&&("production"!==process.env.NODE_ENV&&deprecateReplaceLog("mapType","map","map"),seriesOpt.map=seriesOpt.mapType),seriesOpt.mapLocation&&("production"!==process.env.NODE_ENV&&deprecateLog("`mapLocation` is not used anymore."),defaults(seriesOpt,seriesOpt.mapLocation)));null!=seriesOpt.hoverAnimation&&(seriesOpt.emphasis=seriesOpt.emphasis||{},seriesOpt.emphasis&&null==seriesOpt.emphasis.scale&&("production"!==process.env.NODE_ENV&&deprecateReplaceLog("hoverAnimation","emphasis.scale"),seriesOpt.emphasis.scale=seriesOpt.hoverAnimation)),compatLayoutProperties(seriesOpt)}})),option.dataRange&&(option.visualMap=option.dataRange),each$b(COMPATITABLE_COMPONENTS,(function(componentName){var options=option[componentName];options&&(isArray(options)||(options=[options]),each$b(options,(function(option){compatLayoutProperties(option)})))}))}function calculateStack(stackInfoList){each$b(stackInfoList,(function(targetStackInfo,idxInStack){var resultVal=[],resultNaN=[NaN,NaN],dims=[targetStackInfo.stackResultDimension,targetStackInfo.stackedOverDimension],targetData=targetStackInfo.data,isStackedByIndex=targetStackInfo.isStackedByIndex,stackStrategy=targetStackInfo.seriesModel.get("stackStrategy")||"samesign";targetData.modify(dims,(function(v0,v1,dataIndex){var byValue,stackedDataRawIndex,sum=targetData.get(targetStackInfo.stackedDimension,dataIndex);if(isNaN(sum))return resultNaN;isStackedByIndex?stackedDataRawIndex=targetData.getRawIndex(dataIndex):byValue=targetData.get(targetStackInfo.stackedByDimension,dataIndex);for(var stackedOver=NaN,j=idxInStack-1;j>=0;j--){var stackInfo=stackInfoList[j];if(isStackedByIndex||(stackedDataRawIndex=stackInfo.data.rawIndexOf(stackInfo.stackedByDimension,byValue)),stackedDataRawIndex>=0){var val=stackInfo.data.getByRawIndex(stackInfo.stackResultDimension,stackedDataRawIndex);if("all"===stackStrategy||"positive"===stackStrategy&&val>0||"negative"===stackStrategy&&val<0||"samesign"===stackStrategy&&sum>=0&&val>0||"samesign"===stackStrategy&&sum<=0&&val<0){sum=addSafe(sum,val),stackedOver=val;break}}}return resultVal[0]=sum,resultVal[1]=stackedOver,resultVal}))}))}var _a,_b,_c,providerMethods,mountMethods,SourceImpl=function(fields){this.data=fields.data||("keyedColumns"===fields.sourceFormat?{}:[]),this.sourceFormat=fields.sourceFormat||"unknown",this.seriesLayoutBy=fields.seriesLayoutBy||"column",this.startIndex=fields.startIndex||0,this.dimensionsDetectedCount=fields.dimensionsDetectedCount,this.metaRawOption=fields.metaRawOption;var dimensionsDefine=this.dimensionsDefine=fields.dimensionsDefine;if(dimensionsDefine)for(var i=0;i<dimensionsDefine.length;i++){var dim=dimensionsDefine[i];null==dim.type&&guessOrdinal(this,i)===BE_ORDINAL_Must&&(dim.type="ordinal")}};function isSourceInstance(val){return val instanceof SourceImpl}function createSource(sourceData,thisMetaRawOption,sourceFormat){sourceFormat=sourceFormat||detectSourceFormat(sourceData);var seriesLayoutBy=thisMetaRawOption.seriesLayoutBy,determined=function(data,sourceFormat,seriesLayoutBy,sourceHeader,dimensionsDefine){var dimensionsDetectedCount,startIndex;if(!data)return{dimensionsDefine:normalizeDimensionsOption(dimensionsDefine),startIndex:startIndex,dimensionsDetectedCount:dimensionsDetectedCount};if("arrayRows"===sourceFormat){var dataArrayRows=data;"auto"===sourceHeader||null==sourceHeader?arrayRowsTravelFirst((function(val){null!=val&&"-"!==val&&(isString(val)?null==startIndex&&(startIndex=1):startIndex=0)}),seriesLayoutBy,dataArrayRows,10):startIndex=isNumber(sourceHeader)?sourceHeader:sourceHeader?1:0,dimensionsDefine||1!==startIndex||(dimensionsDefine=[],arrayRowsTravelFirst((function(val,index){dimensionsDefine[index]=null!=val?val+"":""}),seriesLayoutBy,dataArrayRows,1/0)),dimensionsDetectedCount=dimensionsDefine?dimensionsDefine.length:"row"===seriesLayoutBy?dataArrayRows.length:dataArrayRows[0]?dataArrayRows[0].length:null}else if("objectRows"===sourceFormat)dimensionsDefine||(dimensionsDefine=function(data){var obj,firstIndex=0;for(;firstIndex<data.length&&!(obj=data[firstIndex++]););if(obj)return keys$1(obj)}(data));else if("keyedColumns"===sourceFormat)dimensionsDefine||(dimensionsDefine=[],each$b(data,(function(colArr,key){dimensionsDefine.push(key)})));else if("original"===sourceFormat){var value0=getDataItemValue(data[0]);dimensionsDetectedCount=isArray(value0)&&value0.length||1}else"typedArray"===sourceFormat&&"production"!==process.env.NODE_ENV&&assert(!!dimensionsDefine,"dimensions must be given if data is TypedArray.");return{startIndex:startIndex,dimensionsDefine:normalizeDimensionsOption(dimensionsDefine),dimensionsDetectedCount:dimensionsDetectedCount}}(sourceData,sourceFormat,seriesLayoutBy,thisMetaRawOption.sourceHeader,thisMetaRawOption.dimensions);return new SourceImpl({data:sourceData,sourceFormat:sourceFormat,seriesLayoutBy:seriesLayoutBy,dimensionsDefine:determined.dimensionsDefine,startIndex:determined.startIndex,dimensionsDetectedCount:determined.dimensionsDetectedCount,metaRawOption:clone$3(thisMetaRawOption)})}function createSourceFromSeriesDataOption(data){return new SourceImpl({data:data,sourceFormat:isTypedArray(data)?"typedArray":"original"})}function detectSourceFormat(data){var sourceFormat="unknown";if(isTypedArray(data))sourceFormat="typedArray";else if(isArray(data)){0===data.length&&(sourceFormat="arrayRows");for(var i=0,len=data.length;i<len;i++){var item=data[i];if(null!=item){if(isArray(item)||isTypedArray(item)){sourceFormat="arrayRows";break}if(isObject$3(item)){sourceFormat="objectRows";break}}}}else if(isObject$3(data))for(var key in data)if(hasOwn(data,key)&&isArrayLike(data[key])){sourceFormat="keyedColumns";break}return sourceFormat}function normalizeDimensionsOption(dimensionsDefine){if(dimensionsDefine){var nameMap=createHashMap();return map$1(dimensionsDefine,(function(rawItem,index){var item={name:(rawItem=isObject$3(rawItem)?rawItem:{name:rawItem}).name,displayName:rawItem.displayName,type:rawItem.type};if(null==item.name)return item;item.name+="",null==item.displayName&&(item.displayName=item.name);var exist=nameMap.get(item.name);return exist?item.name+="-"+exist.count++:nameMap.set(item.name,{count:1}),item}))}}function arrayRowsTravelFirst(cb,seriesLayoutBy,data,maxLoop){if("row"===seriesLayoutBy)for(var i=0;i<data.length&&i<maxLoop;i++)cb(data[i]?data[i][0]:null,i);else{var value0=data[0]||[];for(i=0;i<value0.length&&i<maxLoop;i++)cb(value0[i],i)}}function shouldRetrieveDataByName(source){var sourceFormat=source.sourceFormat;return"objectRows"===sourceFormat||"keyedColumns"===sourceFormat}var DefaultDataProvider=function(){function DefaultDataProvider(sourceParam,dimSize){var source=isSourceInstance(sourceParam)?sourceParam:createSourceFromSeriesDataOption(sourceParam);this._source=source;var data=this._data=source.data;if("typedArray"===source.sourceFormat){if("production"!==process.env.NODE_ENV&&null==dimSize)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=dimSize,this._data=data}mountMethods(this,data,source)}return DefaultDataProvider.prototype.getSource=function(){return this._source},DefaultDataProvider.prototype.count=function(){return 0},DefaultDataProvider.prototype.getItem=function(idx,out){},DefaultDataProvider.prototype.appendData=function(newData){},DefaultDataProvider.prototype.clean=function(){},DefaultDataProvider.protoInitialize=function(){var proto=DefaultDataProvider.prototype;proto.pure=!1,proto.persistent=!0}(),DefaultDataProvider.internalField=function(){var _a;mountMethods=function(provider,data,source){var sourceFormat=source.sourceFormat,seriesLayoutBy=source.seriesLayoutBy,startIndex=source.startIndex,dimsDef=source.dimensionsDefine,methods=providerMethods[getMethodMapKey(sourceFormat,seriesLayoutBy)];if("production"!==process.env.NODE_ENV&&assert(methods,"Invalide sourceFormat: "+sourceFormat),extend(provider,methods),"typedArray"===sourceFormat)provider.getItem=getItemForTypedArray,provider.count=countForTypedArray,provider.fillStorage=fillStorageForTypedArray;else{var rawItemGetter=getRawSourceItemGetter(sourceFormat,seriesLayoutBy);provider.getItem=bind$1(rawItemGetter,null,data,startIndex,dimsDef);var rawCounter=getRawSourceDataCounter(sourceFormat,seriesLayoutBy);provider.count=bind$1(rawCounter,null,data,startIndex,dimsDef)}};var getItemForTypedArray=function(idx,out){idx-=this._offset,out=out||[];for(var data=this._data,dimSize=this._dimSize,offset=dimSize*idx,i=0;i<dimSize;i++)out[i]=data[offset+i];return out},fillStorageForTypedArray=function(start,end,storage,extent){for(var data=this._data,dimSize=this._dimSize,dim=0;dim<dimSize;dim++){for(var dimExtent=extent[dim],min=null==dimExtent[0]?1/0:dimExtent[0],max=null==dimExtent[1]?-1/0:dimExtent[1],count=end-start,arr=storage[dim],i=0;i<count;i++){var val=data[i*dimSize+dim];arr[start+i]=val,val<min&&(min=val),val>max&&(max=val)}dimExtent[0]=min,dimExtent[1]=max}},countForTypedArray=function(){return this._data?this._data.length/this._dimSize:0};function appendDataSimply(newData){for(var i=0;i<newData.length;i++)this._data.push(newData[i])}(_a={}).arrayRows_column={pure:!0,appendData:appendDataSimply},_a.arrayRows_row={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},_a.objectRows={pure:!0,appendData:appendDataSimply},_a.keyedColumns={pure:!0,appendData:function(newData){var data=this._data;each$b(newData,(function(newCol,key){for(var oldCol=data[key]||(data[key]=[]),i=0;i<(newCol||[]).length;i++)oldCol.push(newCol[i])}))}},_a.original={appendData:appendDataSimply},_a.typedArray={persistent:!1,pure:!0,appendData:function(newData){"production"!==process.env.NODE_ENV&&assert(isTypedArray(newData),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=newData},clean:function(){this._offset+=this.count(),this._data=null}},providerMethods=_a}(),DefaultDataProvider}(),getItemSimply=function(rawData,startIndex,dimsDef,idx){return rawData[idx]},rawSourceItemGetterMap=((_a={}).arrayRows_column=function(rawData,startIndex,dimsDef,idx){return rawData[idx+startIndex]},_a.arrayRows_row=function(rawData,startIndex,dimsDef,idx,out){idx+=startIndex;for(var item=out||[],data=rawData,i=0;i<data.length;i++){var row=data[i];item[i]=row?row[idx]:null}return item},_a.objectRows=getItemSimply,_a.keyedColumns=function(rawData,startIndex,dimsDef,idx,out){for(var item=out||[],i=0;i<dimsDef.length;i++){var dimName=dimsDef[i].name;if("production"!==process.env.NODE_ENV&&null==dimName)throw new Error;var col=rawData[dimName];item[i]=col?col[idx]:null}return item},_a.original=getItemSimply,_a);function getRawSourceItemGetter(sourceFormat,seriesLayoutBy){var method=rawSourceItemGetterMap[getMethodMapKey(sourceFormat,seriesLayoutBy)];return"production"!==process.env.NODE_ENV&&assert(method,'Do not support get item on "'+sourceFormat+'", "'+seriesLayoutBy+'".'),method}var countSimply=function(rawData,startIndex,dimsDef){return rawData.length},rawSourceDataCounterMap=((_b={}).arrayRows_column=function(rawData,startIndex,dimsDef){return Math.max(0,rawData.length-startIndex)},_b.arrayRows_row=function(rawData,startIndex,dimsDef){var row=rawData[0];return row?Math.max(0,row.length-startIndex):0},_b.objectRows=countSimply,_b.keyedColumns=function(rawData,startIndex,dimsDef){var dimName=dimsDef[0].name;if("production"!==process.env.NODE_ENV&&null==dimName)throw new Error;var col=rawData[dimName];return col?col.length:0},_b.original=countSimply,_b);function getRawSourceDataCounter(sourceFormat,seriesLayoutBy){var method=rawSourceDataCounterMap[getMethodMapKey(sourceFormat,seriesLayoutBy)];return"production"!==process.env.NODE_ENV&&assert(method,'Do not support count on "'+sourceFormat+'", "'+seriesLayoutBy+'".'),method}var getRawValueSimply=function(dataItem,dimIndex,property){return dataItem[dimIndex]},rawSourceValueGetterMap=((_c={}).arrayRows=getRawValueSimply,_c.objectRows=function(dataItem,dimIndex,property){return dataItem[property]},_c.keyedColumns=getRawValueSimply,_c.original=function(dataItem,dimIndex,property){var value=getDataItemValue(dataItem);return value instanceof Array?value[dimIndex]:value},_c.typedArray=getRawValueSimply,_c);function getRawSourceValueGetter(sourceFormat){var method=rawSourceValueGetterMap[sourceFormat];return"production"!==process.env.NODE_ENV&&assert(method,'Do not support get value on "'+sourceFormat+'".'),method}function getMethodMapKey(sourceFormat,seriesLayoutBy){return"arrayRows"===sourceFormat?sourceFormat+"_"+seriesLayoutBy:sourceFormat}function retrieveRawValue(data,dataIndex,dim){if(data){var dataItem=data.getRawDataItem(dataIndex);if(null!=dataItem){var store=data.getStore(),sourceFormat=store.getSource().sourceFormat;if(null!=dim){var dimIndex=data.getDimensionIndex(dim),property=store.getDimensionProperty(dimIndex);return getRawSourceValueGetter(sourceFormat)(dataItem,dimIndex,property)}var result=dataItem;return"original"===sourceFormat&&(result=getDataItemValue(dataItem)),result}}}var DIMENSION_LABEL_REG=/\{@(.+?)\}/g,DataFormatMixin=function(){function DataFormatMixin(){}return DataFormatMixin.prototype.getDataParams=function(dataIndex,dataType){var data=this.getData(dataType),rawValue=this.getRawValue(dataIndex,dataType),rawDataIndex=data.getRawIndex(dataIndex),name=data.getName(dataIndex),itemOpt=data.getRawDataItem(dataIndex),style=data.getItemVisual(dataIndex,"style"),color=style&&style[data.getItemVisual(dataIndex,"drawType")||"fill"],borderColor=style&&style.stroke,mainType=this.mainType,isSeries="series"===mainType,userOutput=data.userOutput&&data.userOutput.get();return{componentType:mainType,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:isSeries?this.subType:null,seriesIndex:this.seriesIndex,seriesId:isSeries?this.id:null,seriesName:isSeries?this.name:null,name:name,dataIndex:rawDataIndex,data:itemOpt,dataType:dataType,value:rawValue,color:color,borderColor:borderColor,dimensionNames:userOutput?userOutput.fullDimensions:null,encode:userOutput?userOutput.encode:null,$vars:["seriesName","name","value"]}},DataFormatMixin.prototype.getFormattedLabel=function(dataIndex,status,dataType,labelDimIndex,formatter,extendParams){status=status||"normal";var data=this.getData(dataType),params=this.getDataParams(dataIndex,dataType);(extendParams&&(params.value=extendParams.interpolatedValue),null!=labelDimIndex&&isArray(params.value)&&(params.value=params.value[labelDimIndex]),formatter)||(formatter=data.getItemModel(dataIndex).get("normal"===status?["label","formatter"]:[status,"label","formatter"]));return isFunction(formatter)?(params.status=status,params.dimensionIndex=labelDimIndex,formatter(params)):isString(formatter)?formatTpl(formatter,params).replace(DIMENSION_LABEL_REG,(function(origin,dimStr){var len=dimStr.length,dimLoose=dimStr;"["===dimLoose.charAt(0)&&"]"===dimLoose.charAt(len-1)&&(dimLoose=+dimLoose.slice(1,len-1),"production"!==process.env.NODE_ENV&&isNaN(dimLoose)&&error("Invalide label formatter: @"+dimStr+", only support @[0], @[1], @[2], ..."));var val=retrieveRawValue(data,dataIndex,dimLoose);if(extendParams&&isArray(extendParams.interpolatedValue)){var dimIndex=data.getDimensionIndex(dimLoose);dimIndex>=0&&(val=extendParams.interpolatedValue[dimIndex])}return null!=val?val+"":""})):void 0},DataFormatMixin.prototype.getRawValue=function(idx,dataType){return retrieveRawValue(this.getData(dataType),idx)},DataFormatMixin.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){},DataFormatMixin}();function normalizeTooltipFormatResult(result){var markupText,markupFragment;return isObject$3(result)?result.type?markupFragment=result:"production"!==process.env.NODE_ENV&&console.warn("The return type of `formatTooltip` is not supported: "+makePrintable(result)):markupText=result,{text:markupText,frag:markupFragment}}function createTask(define){return new Task(define)}var Task=function(){function Task(define){define=define||{},this._reset=define.reset,this._plan=define.plan,this._count=define.count,this._onDirty=define.onDirty,this._dirty=!0}return Task.prototype.perform=function(performArgs){var planResult,upTask=this._upstream,skip=performArgs&&performArgs.skip;if(this._dirty&&upTask){var context=this.context;context.data=context.outputData=upTask.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!skip&&(planResult=this._plan(this.context));var forceFirstProgress,lastModBy=normalizeModBy(this._modBy),lastModDataCount=this._modDataCount||0,modBy=normalizeModBy(performArgs&&performArgs.modBy),modDataCount=performArgs&&performArgs.modDataCount||0;function normalizeModBy(val){return!(val>=1)&&(val=1),val}lastModBy===modBy&&lastModDataCount===modDataCount||(planResult="reset"),(this._dirty||"reset"===planResult)&&(this._dirty=!1,forceFirstProgress=this._doReset(skip)),this._modBy=modBy,this._modDataCount=modDataCount;var step=performArgs&&performArgs.step;if(upTask?("production"!==process.env.NODE_ENV&&assert(null!=upTask._outputDueEnd),this._dueEnd=upTask._outputDueEnd):("production"!==process.env.NODE_ENV&&assert(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var start=this._dueIndex,end=Math.min(null!=step?this._dueIndex+step:1/0,this._dueEnd);if(!skip&&(forceFirstProgress||start<end)){var progress=this._progress;if(isArray(progress))for(var i=0;i<progress.length;i++)this._doProgress(progress[i],start,end,modBy,modDataCount);else this._doProgress(progress,start,end,modBy,modDataCount)}this._dueIndex=end;var outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:end;"production"!==process.env.NODE_ENV&&assert(outputDueEnd>=this._outputDueEnd),this._outputDueEnd=outputDueEnd}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},Task.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},Task.prototype._doProgress=function(progress,start,end,modBy,modDataCount){iterator.reset(start,end,modBy,modDataCount),this._callingProgress=progress,this._callingProgress({start:start,end:end,count:end-start,next:iterator.next},this.context)},Task.prototype._doReset=function(skip){var progress,forceFirstProgress;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!skip&&this._reset&&((progress=this._reset(this.context))&&progress.progress&&(forceFirstProgress=progress.forceFirstProgress,progress=progress.progress),isArray(progress)&&!progress.length&&(progress=null)),this._progress=progress,this._modBy=this._modDataCount=null;var downstream=this._downstream;return downstream&&downstream.dirty(),forceFirstProgress},Task.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},Task.prototype.pipe=function(downTask){"production"!==process.env.NODE_ENV&&assert(downTask&&!downTask._disposed&&downTask!==this),(this._downstream!==downTask||this._dirty)&&(this._downstream=downTask,downTask._upstream=this,downTask.dirty())},Task.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},Task.prototype.getUpstream=function(){return this._upstream},Task.prototype.getDownstream=function(){return this._downstream},Task.prototype.setOutputEnd=function(end){this._outputDueEnd=this._settedOutputEnd=end},Task}(),iterator=function(){var end,current,modBy,modDataCount,winCount,it={reset:function(s,e,sStep,sCount){current=s,end=e,modBy=sStep,modDataCount=sCount,winCount=Math.ceil(modDataCount/modBy),it.next=modBy>1&&modDataCount>0?modNext:sequentialNext}};return it;function sequentialNext(){return current<end?current++:null}function modNext(){var dataIndex=current%winCount*modBy+Math.ceil(current/winCount),result=current>=end?null:dataIndex<modDataCount?dataIndex:current;return current++,result}}();function parseDataValue(value,opt){var dimType=opt&&opt.type;return"ordinal"===dimType?value:("time"!==dimType||isNumber(value)||null==value||"-"===value||(value=+parseDate$1(value)),null==value||""===value?NaN:Number(value))}createHashMap({number:function(val){return parseFloat(val)},time:function(val){return+parseDate$1(val)},trim:function(val){return isString(val)?trim$1(val):val}});var SortOrderComparator=function(){function SortOrderComparator(order,incomparable){var isDesc="desc"===order;this._resultLT=isDesc?1:-1,null==incomparable&&(incomparable=isDesc?"min":"max"),this._incomparable="min"===incomparable?-1/0:1/0}return SortOrderComparator.prototype.evaluate=function(lval,rval){var lvalFloat=isNumber(lval)?lval:numericToNumber(lval),rvalFloat=isNumber(rval)?rval:numericToNumber(rval),lvalNotNumeric=isNaN(lvalFloat),rvalNotNumeric=isNaN(rvalFloat);if(lvalNotNumeric&&(lvalFloat=this._incomparable),rvalNotNumeric&&(rvalFloat=this._incomparable),lvalNotNumeric&&rvalNotNumeric){var lvalIsStr=isString(lval),rvalIsStr=isString(rval);lvalIsStr&&(lvalFloat=rvalIsStr?lval:0),rvalIsStr&&(rvalFloat=lvalIsStr?rval:0)}return lvalFloat<rvalFloat?this._resultLT:lvalFloat>rvalFloat?-this._resultLT:0},SortOrderComparator}(),ExternalSource=function(){function ExternalSource(){}return ExternalSource.prototype.getRawData=function(){throw new Error("not supported")},ExternalSource.prototype.getRawDataItem=function(dataIndex){throw new Error("not supported")},ExternalSource.prototype.cloneRawData=function(){},ExternalSource.prototype.getDimensionInfo=function(dim){},ExternalSource.prototype.cloneAllDimensionInfo=function(){},ExternalSource.prototype.count=function(){},ExternalSource.prototype.retrieveValue=function(dataIndex,dimIndex){},ExternalSource.prototype.retrieveValueFromItem=function(dataItem,dimIndex){},ExternalSource.prototype.convertValue=function(rawVal,dimInfo){return parseDataValue(rawVal,dimInfo)},ExternalSource}();function getRawData(upstream){var sourceFormat=upstream.sourceFormat;if(!isSupportedSourceFormat(sourceFormat)){var errMsg="";"production"!==process.env.NODE_ENV&&(errMsg="`getRawData` is not supported in source format "+sourceFormat),throwError(errMsg)}return upstream.data}function cloneRawData(upstream){var sourceFormat=upstream.sourceFormat,data=upstream.data;if(!isSupportedSourceFormat(sourceFormat)){var errMsg="";"production"!==process.env.NODE_ENV&&(errMsg="`cloneRawData` is not supported in source format "+sourceFormat),throwError(errMsg)}if("arrayRows"===sourceFormat){for(var result=[],i=0,len=data.length;i<len;i++)result.push(data[i].slice());return result}if("objectRows"===sourceFormat){for(result=[],i=0,len=data.length;i<len;i++)result.push(extend({},data[i]));return result}}function getDimensionInfo(dimensions,dimsByName,dim){if(null!=dim)return isNumber(dim)||!isNaN(dim)&&!hasOwn(dimsByName,dim)?dimensions[dim]:hasOwn(dimsByName,dim)?dimsByName[dim]:void 0}function cloneAllDimensionInfo(dimensions){return clone$3(dimensions)}var externalTransformMap=createHashMap();function applySingleDataTransform(transOption,upSourceList,infoForPrint,pipeIndex){var errMsg="";upSourceList.length||("production"!==process.env.NODE_ENV&&(errMsg="Must have at least one upstream dataset."),throwError(errMsg)),isObject$3(transOption)||("production"!==process.env.NODE_ENV&&(errMsg="transform declaration must be an object rather than "+typeof transOption+"."),throwError(errMsg));var transType=transOption.type,externalTransform=externalTransformMap.get(transType);externalTransform||("production"!==process.env.NODE_ENV&&(errMsg='Can not find transform on type "'+transType+'".'),throwError(errMsg));var onlyOnce,extUpSourceList=map$1(upSourceList,(function(upSource){return function(internalSource,externalTransform){var extSource=new ExternalSource,data=internalSource.data,sourceFormat=extSource.sourceFormat=internalSource.sourceFormat,sourceHeaderCount=internalSource.startIndex,errMsg="";"column"!==internalSource.seriesLayoutBy&&("production"!==process.env.NODE_ENV&&(errMsg='`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'),throwError(errMsg));var dimensions=[],dimsByName={},dimsDef=internalSource.dimensionsDefine;if(dimsDef)each$b(dimsDef,(function(dimDef,idx){var name=dimDef.name,dimDefExt={index:idx,name:name,displayName:dimDef.displayName};if(dimensions.push(dimDefExt),null!=name){var errMsg_1="";hasOwn(dimsByName,name)&&("production"!==process.env.NODE_ENV&&(errMsg_1='dimension name "'+name+'" duplicated.'),throwError(errMsg_1)),dimsByName[name]=dimDefExt}}));else for(var i=0;i<internalSource.dimensionsDetectedCount;i++)dimensions.push({index:i});var rawItemGetter=getRawSourceItemGetter(sourceFormat,"column");externalTransform.__isBuiltIn&&(extSource.getRawDataItem=function(dataIndex){return rawItemGetter(data,sourceHeaderCount,dimensions,dataIndex)},extSource.getRawData=bind$1(getRawData,null,internalSource)),extSource.cloneRawData=bind$1(cloneRawData,null,internalSource);var rawCounter=getRawSourceDataCounter(sourceFormat,"column");extSource.count=bind$1(rawCounter,null,data,sourceHeaderCount,dimensions);var rawValueGetter=getRawSourceValueGetter(sourceFormat);extSource.retrieveValue=function(dataIndex,dimIndex){var rawItem=rawItemGetter(data,sourceHeaderCount,dimensions,dataIndex);return retrieveValueFromItem(rawItem,dimIndex)};var retrieveValueFromItem=extSource.retrieveValueFromItem=function(dataItem,dimIndex){if(null!=dataItem){var dimDef=dimensions[dimIndex];return dimDef?rawValueGetter(dataItem,dimIndex,dimDef.name):void 0}};return extSource.getDimensionInfo=bind$1(getDimensionInfo,null,dimensions,dimsByName),extSource.cloneAllDimensionInfo=bind$1(cloneAllDimensionInfo,null,dimensions),extSource}(upSource,externalTransform)})),resultList=normalizeToArray(externalTransform.transform({upstream:extUpSourceList[0],upstreamList:extUpSourceList,config:clone$3(transOption.config)}));if("production"!==process.env.NODE_ENV&&transOption.print){var printStrArr=map$1(resultList,(function(extSource){var pipeIndexStr=null!=pipeIndex?" === pipe index: "+pipeIndex:"";return["=== dataset index: "+infoForPrint.datasetIndex+pipeIndexStr+" ===","- transform result data:",makePrintable(extSource.data),"- transform result dimensions:",makePrintable(extSource.dimensions)].join("\n")})).join("\n");outputLog("log",printStrArr,onlyOnce)}return map$1(resultList,(function(result,resultIndex){var resultMetaRawOption,errMsg="";isObject$3(result)||("production"!==process.env.NODE_ENV&&(errMsg="A transform should not return some empty results."),throwError(errMsg)),result.data||("production"!==process.env.NODE_ENV&&(errMsg="Transform result data should be not be null or undefined"),throwError(errMsg)),isSupportedSourceFormat(detectSourceFormat(result.data))||("production"!==process.env.NODE_ENV&&(errMsg="Transform result data should be array rows or object rows."),throwError(errMsg));var firstUpSource=upSourceList[0];if(firstUpSource&&0===resultIndex&&!result.dimensions){var startIndex=firstUpSource.startIndex;startIndex&&(result.data=firstUpSource.data.slice(0,startIndex).concat(result.data)),resultMetaRawOption={seriesLayoutBy:"column",sourceHeader:startIndex,dimensions:firstUpSource.metaRawOption.dimensions}}else resultMetaRawOption={seriesLayoutBy:"column",sourceHeader:0,dimensions:result.dimensions};return createSource(result.data,resultMetaRawOption,null)}))}function isSupportedSourceFormat(sourceFormat){return"arrayRows"===sourceFormat||"objectRows"===sourceFormat}var defaultDimValueGetters,CtorUint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,CtorUint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,CtorInt32Array$1="undefined"==typeof Int32Array?Array:Int32Array,CtorFloat64Array="undefined"==typeof Float64Array?Array:Float64Array,dataCtors={float:CtorFloat64Array,int:CtorInt32Array$1,ordinal:Array,number:Array,time:CtorFloat64Array};function getIndicesCtor(rawCount){return rawCount>65535?CtorUint32Array:CtorUint16Array}function prepareStore(store,dimIdx,dimType,end,append){var DataCtor=dataCtors[dimType||"float"];if(append){var oldStore=store[dimIdx],oldLen=oldStore&&oldStore.length;if(oldLen!==end){for(var newStore=new DataCtor(end),j=0;j<oldLen;j++)newStore[j]=oldStore[j];store[dimIdx]=newStore}}else store[dimIdx]=new DataCtor(end)}var DataStore=function(){function DataStore(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=createHashMap()}return DataStore.prototype.initData=function(provider,inputDimensions,dimValueGetter){"production"!==process.env.NODE_ENV&&assert(isFunction(provider.getItem)&&isFunction(provider.count),"Invalid data provider."),this._provider=provider,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var source=provider.getSource(),defaultGetter=this.defaultDimValueGetter=defaultDimValueGetters[source.sourceFormat];this._dimValueGetter=dimValueGetter||defaultGetter,this._rawExtent=[];var willRetrieveDataByName=shouldRetrieveDataByName(source);this._dimensions=map$1(inputDimensions,(function(dim){return"production"!==process.env.NODE_ENV&&willRetrieveDataByName&&assert(null!=dim.property),{type:dim.type,property:dim.property}})),this._initDataFromProvider(0,provider.count())},DataStore.prototype.getProvider=function(){return this._provider},DataStore.prototype.getSource=function(){return this._provider.getSource()},DataStore.prototype.ensureCalculationDimension=function(dimName,type){var calcDimNameToIdx=this._calcDimNameToIdx,dimensions=this._dimensions,calcDimIdx=calcDimNameToIdx.get(dimName);if(null!=calcDimIdx){if(dimensions[calcDimIdx].type===type)return calcDimIdx}else calcDimIdx=dimensions.length;return dimensions[calcDimIdx]={type:type},calcDimNameToIdx.set(dimName,calcDimIdx),this._chunks[calcDimIdx]=new dataCtors[type||"float"](this._rawCount),this._rawExtent[calcDimIdx]=[1/0,-1/0],calcDimIdx},DataStore.prototype.collectOrdinalMeta=function(dimIdx,ordinalMeta){var chunk=this._chunks[dimIdx],dim=this._dimensions[dimIdx],rawExtents=this._rawExtent,offset=dim.ordinalOffset||0,len=chunk.length;0===offset&&(rawExtents[dimIdx]=[1/0,-1/0]);for(var dimRawExtent=rawExtents[dimIdx],i=offset;i<len;i++){var val=chunk[i]=ordinalMeta.parseAndCollect(chunk[i]);isNaN(val)||(dimRawExtent[0]=Math.min(val,dimRawExtent[0]),dimRawExtent[1]=Math.max(val,dimRawExtent[1]))}dim.ordinalMeta=ordinalMeta,dim.ordinalOffset=len,dim.type="ordinal"},DataStore.prototype.getOrdinalMeta=function(dimIdx){return this._dimensions[dimIdx].ordinalMeta},DataStore.prototype.getDimensionProperty=function(dimIndex){var item=this._dimensions[dimIndex];return item&&item.property},DataStore.prototype.appendData=function(data){"production"!==process.env.NODE_ENV&&assert(!this._indices,"appendData can only be called on raw data.");var provider=this._provider,start=this.count();provider.appendData(data);var end=provider.count();return provider.persistent||(end+=start),start<end&&this._initDataFromProvider(start,end,!0),[start,end]},DataStore.prototype.appendValues=function(values,minFillLen){for(var chunks=this._chunks,dimensions=this._dimensions,dimLen=dimensions.length,rawExtent=this._rawExtent,start=this.count(),end=start+Math.max(values.length,minFillLen||0),i=0;i<dimLen;i++){prepareStore(chunks,i,(dim=dimensions[i]).type,end,!0)}for(var emptyDataItem=[],idx=start;idx<end;idx++)for(var sourceIdx=idx-start,dimIdx=0;dimIdx<dimLen;dimIdx++){var dim=dimensions[dimIdx],val=defaultDimValueGetters.arrayRows.call(this,values[sourceIdx]||emptyDataItem,dim.property,sourceIdx,dimIdx);chunks[dimIdx][idx]=val;var dimRawExtent=rawExtent[dimIdx];val<dimRawExtent[0]&&(dimRawExtent[0]=val),val>dimRawExtent[1]&&(dimRawExtent[1]=val)}return this._rawCount=this._count=end,{start:start,end:end}},DataStore.prototype._initDataFromProvider=function(start,end,append){for(var provider=this._provider,chunks=this._chunks,dimensions=this._dimensions,dimLen=dimensions.length,rawExtent=this._rawExtent,dimNames=map$1(dimensions,(function(dim){return dim.property})),i=0;i<dimLen;i++){var dim=dimensions[i];rawExtent[i]||(rawExtent[i]=[1/0,-1/0]),prepareStore(chunks,i,dim.type,end,append)}if(provider.fillStorage)provider.fillStorage(start,end,chunks,rawExtent);else for(var dataItem=[],idx=start;idx<end;idx++){dataItem=provider.getItem(idx,dataItem);for(var dimIdx=0;dimIdx<dimLen;dimIdx++){var dimStorage=chunks[dimIdx],val=this._dimValueGetter(dataItem,dimNames[dimIdx],idx,dimIdx);dimStorage[idx]=val;var dimRawExtent=rawExtent[dimIdx];val<dimRawExtent[0]&&(dimRawExtent[0]=val),val>dimRawExtent[1]&&(dimRawExtent[1]=val)}}!provider.persistent&&provider.clean&&provider.clean(),this._rawCount=this._count=end,this._extent=[]},DataStore.prototype.count=function(){return this._count},DataStore.prototype.get=function(dim,idx){if(!(idx>=0&&idx<this._count))return NaN;var dimStore=this._chunks[dim];return dimStore?dimStore[this.getRawIndex(idx)]:NaN},DataStore.prototype.getValues=function(dimensions,idx){var values=[],dimArr=[];if(null==idx){idx=dimensions,dimensions=[];for(var i=0;i<this._dimensions.length;i++)dimArr.push(i)}else dimArr=dimensions;i=0;for(var len=dimArr.length;i<len;i++)values.push(this.get(dimArr[i],idx));return values},DataStore.prototype.getByRawIndex=function(dim,rawIdx){if(!(rawIdx>=0&&rawIdx<this._rawCount))return NaN;var dimStore=this._chunks[dim];return dimStore?dimStore[rawIdx]:NaN},DataStore.prototype.getSum=function(dim){var sum=0;if(this._chunks[dim])for(var i=0,len=this.count();i<len;i++){var value=this.get(dim,i);isNaN(value)||(sum+=value)}return sum},DataStore.prototype.getMedian=function(dim){var dimDataArray=[];this.each([dim],(function(val){isNaN(val)||dimDataArray.push(val)}));var sortedDimDataArray=dimDataArray.sort((function(a,b){return a-b})),len=this.count();return 0===len?0:len%2==1?sortedDimDataArray[(len-1)/2]:(sortedDimDataArray[len/2]+sortedDimDataArray[len/2-1])/2},DataStore.prototype.indexOfRawIndex=function(rawIndex){if(rawIndex>=this._rawCount||rawIndex<0)return-1;if(!this._indices)return rawIndex;var indices=this._indices,rawDataIndex=indices[rawIndex];if(null!=rawDataIndex&&rawDataIndex<this._count&&rawDataIndex===rawIndex)return rawIndex;for(var left=0,right=this._count-1;left<=right;){var mid=(left+right)/2|0;if(indices[mid]<rawIndex)left=mid+1;else{if(!(indices[mid]>rawIndex))return mid;right=mid-1}}return-1},DataStore.prototype.indicesOfNearest=function(dim,value,maxDistance){var dimData=this._chunks[dim],nearestIndices=[];if(!dimData)return nearestIndices;null==maxDistance&&(maxDistance=1/0);for(var minDist=1/0,minDiff=-1,nearestIndicesLen=0,i=0,len=this.count();i<len;i++){var diff=value-dimData[this.getRawIndex(i)],dist=Math.abs(diff);dist<=maxDistance&&((dist<minDist||dist===minDist&&diff>=0&&minDiff<0)&&(minDist=dist,minDiff=diff,nearestIndicesLen=0),diff===minDiff&&(nearestIndices[nearestIndicesLen++]=i))}return nearestIndices.length=nearestIndicesLen,nearestIndices},DataStore.prototype.getIndices=function(){var newIndices,indices=this._indices;if(indices){var Ctor=indices.constructor,thisCount=this._count;if(Ctor===Array){newIndices=new Ctor(thisCount);for(var i=0;i<thisCount;i++)newIndices[i]=indices[i]}else newIndices=new Ctor(indices.buffer,0,thisCount)}else{newIndices=new(Ctor=getIndicesCtor(this._rawCount))(this.count());for(i=0;i<newIndices.length;i++)newIndices[i]=i}return newIndices},DataStore.prototype.filter=function(dims,cb){if(!this._count)return this;for(var newStore=this.clone(),count=newStore.count(),newIndices=new(getIndicesCtor(newStore._rawCount))(count),value=[],dimSize=dims.length,offset=0,dim0=dims[0],chunks=newStore._chunks,i=0;i<count;i++){var keep=void 0,rawIdx=newStore.getRawIndex(i);if(0===dimSize)keep=cb(i);else if(1===dimSize){keep=cb(chunks[dim0][rawIdx],i)}else{for(var k=0;k<dimSize;k++)value[k]=chunks[dims[k]][rawIdx];value[k]=i,keep=cb.apply(null,value)}keep&&(newIndices[offset++]=rawIdx)}return offset<count&&(newStore._indices=newIndices),newStore._count=offset,newStore._extent=[],newStore._updateGetRawIdx(),newStore},DataStore.prototype.selectRange=function(range){var newStore=this.clone(),len=newStore._count;if(!len)return this;var dims=keys$1(range),dimSize=dims.length;if(!dimSize)return this;var originalCount=newStore.count(),newIndices=new(getIndicesCtor(newStore._rawCount))(originalCount),offset=0,dim0=dims[0],min=range[dim0][0],max=range[dim0][1],storeArr=newStore._chunks,quickFinished=!1;if(!newStore._indices){var idx=0;if(1===dimSize){for(var dimStorage=storeArr[dims[0]],i=0;i<len;i++){((val=dimStorage[i])>=min&&val<=max||isNaN(val))&&(newIndices[offset++]=idx),idx++}quickFinished=!0}else if(2===dimSize){dimStorage=storeArr[dims[0]];var dimStorage2=storeArr[dims[1]],min2=range[dims[1]][0],max2=range[dims[1]][1];for(i=0;i<len;i++){var val=dimStorage[i],val2=dimStorage2[i];(val>=min&&val<=max||isNaN(val))&&(val2>=min2&&val2<=max2||isNaN(val2))&&(newIndices[offset++]=idx),idx++}quickFinished=!0}}if(!quickFinished)if(1===dimSize)for(i=0;i<originalCount;i++){var rawIndex=newStore.getRawIndex(i);((val=storeArr[dims[0]][rawIndex])>=min&&val<=max||isNaN(val))&&(newIndices[offset++]=rawIndex)}else for(i=0;i<originalCount;i++){for(var keep=!0,k=(rawIndex=newStore.getRawIndex(i),0);k<dimSize;k++){var dimk=dims[k];((val=storeArr[dimk][rawIndex])<range[dimk][0]||val>range[dimk][1])&&(keep=!1)}keep&&(newIndices[offset++]=newStore.getRawIndex(i))}return offset<originalCount&&(newStore._indices=newIndices),newStore._count=offset,newStore._extent=[],newStore._updateGetRawIdx(),newStore},DataStore.prototype.map=function(dims,cb){var target=this.clone(dims);return this._updateDims(target,dims,cb),target},DataStore.prototype.modify=function(dims,cb){this._updateDims(this,dims,cb)},DataStore.prototype._updateDims=function(target,dims,cb){for(var targetChunks=target._chunks,tmpRetValue=[],dimSize=dims.length,dataCount=target.count(),values=[],rawExtent=target._rawExtent,i=0;i<dims.length;i++)rawExtent[dims[i]]=[1/0,-1/0];for(var dataIndex=0;dataIndex<dataCount;dataIndex++){for(var rawIndex=target.getRawIndex(dataIndex),k=0;k<dimSize;k++)values[k]=targetChunks[dims[k]][rawIndex];values[dimSize]=dataIndex;var retValue=cb&&cb.apply(null,values);if(null!=retValue){"object"!=typeof retValue&&(tmpRetValue[0]=retValue,retValue=tmpRetValue);for(i=0;i<retValue.length;i++){var dim=dims[i],val=retValue[i],rawExtentOnDim=rawExtent[dim],dimStore=targetChunks[dim];dimStore&&(dimStore[rawIndex]=val),val<rawExtentOnDim[0]&&(rawExtentOnDim[0]=val),val>rawExtentOnDim[1]&&(rawExtentOnDim[1]=val)}}}},DataStore.prototype.lttbDownSample=function(valueDimension,rate){var maxArea,area,nextRawIndex,target=this.clone([valueDimension],!0),dimStore=target._chunks[valueDimension],len=this.count(),sampledIndex=0,frameSize=Math.floor(1/rate),currentRawIndex=this.getRawIndex(0),newIndices=new(getIndicesCtor(this._rawCount))(Math.min(2*(Math.ceil(len/frameSize)+2),len));newIndices[sampledIndex++]=currentRawIndex;for(var i=1;i<len-1;i+=frameSize){for(var nextFrameStart=Math.min(i+frameSize,len-1),nextFrameEnd=Math.min(i+2*frameSize,len),avgX=(nextFrameEnd+nextFrameStart)/2,avgY=0,idx=nextFrameStart;idx<nextFrameEnd;idx++){var y=dimStore[rawIndex=this.getRawIndex(idx)];isNaN(y)||(avgY+=y)}avgY/=nextFrameEnd-nextFrameStart;var frameStart=i,frameEnd=Math.min(i+frameSize,len),pointAX=i-1,pointAY=dimStore[currentRawIndex];maxArea=-1,nextRawIndex=frameStart;var firstNaNIndex=-1,countNaN=0;for(idx=frameStart;idx<frameEnd;idx++){var rawIndex;y=dimStore[rawIndex=this.getRawIndex(idx)];isNaN(y)?(countNaN++,firstNaNIndex<0&&(firstNaNIndex=rawIndex)):(area=Math.abs((pointAX-avgX)*(y-pointAY)-(pointAX-idx)*(avgY-pointAY)))>maxArea&&(maxArea=area,nextRawIndex=rawIndex)}countNaN>0&&countNaN<frameEnd-frameStart&&(newIndices[sampledIndex++]=Math.min(firstNaNIndex,nextRawIndex),nextRawIndex=Math.max(firstNaNIndex,nextRawIndex)),newIndices[sampledIndex++]=nextRawIndex,currentRawIndex=nextRawIndex}return newIndices[sampledIndex++]=this.getRawIndex(len-1),target._count=sampledIndex,target._indices=newIndices,target.getRawIndex=this._getRawIdx,target},DataStore.prototype.minmaxDownSample=function(valueDimension,rate){for(var target=this.clone([valueDimension],!0),targetStorage=target._chunks,frameSize=Math.floor(1/rate),dimStore=targetStorage[valueDimension],len=this.count(),newIndices=new(getIndicesCtor(this._rawCount))(2*Math.ceil(len/frameSize)),offset=0,i=0;i<len;i+=frameSize){var minIndex=i,minValue=dimStore[this.getRawIndex(minIndex)],maxIndex=i,maxValue=dimStore[this.getRawIndex(maxIndex)],thisFrameSize=frameSize;i+frameSize>len&&(thisFrameSize=len-i);for(var k=0;k<thisFrameSize;k++){var value=dimStore[this.getRawIndex(i+k)];value<minValue&&(minValue=value,minIndex=i+k),value>maxValue&&(maxValue=value,maxIndex=i+k)}var rawMinIndex=this.getRawIndex(minIndex),rawMaxIndex=this.getRawIndex(maxIndex);minIndex<maxIndex?(newIndices[offset++]=rawMinIndex,newIndices[offset++]=rawMaxIndex):(newIndices[offset++]=rawMaxIndex,newIndices[offset++]=rawMinIndex)}return target._count=offset,target._indices=newIndices,target._updateGetRawIdx(),target},DataStore.prototype.downSample=function(dimension,rate,sampleValue,sampleIndex){for(var target=this.clone([dimension],!0),targetStorage=target._chunks,frameValues=[],frameSize=Math.floor(1/rate),dimStore=targetStorage[dimension],len=this.count(),rawExtentOnDim=target._rawExtent[dimension]=[1/0,-1/0],newIndices=new(getIndicesCtor(this._rawCount))(Math.ceil(len/frameSize)),offset=0,i=0;i<len;i+=frameSize){frameSize>len-i&&(frameSize=len-i,frameValues.length=frameSize);for(var k=0;k<frameSize;k++){var dataIdx=this.getRawIndex(i+k);frameValues[k]=dimStore[dataIdx]}var value=sampleValue(frameValues),sampleFrameIdx=this.getRawIndex(Math.min(i+sampleIndex(frameValues,value)||0,len-1));dimStore[sampleFrameIdx]=value,value<rawExtentOnDim[0]&&(rawExtentOnDim[0]=value),value>rawExtentOnDim[1]&&(rawExtentOnDim[1]=value),newIndices[offset++]=sampleFrameIdx}return target._count=offset,target._indices=newIndices,target._updateGetRawIdx(),target},DataStore.prototype.each=function(dims,cb){if(this._count)for(var dimSize=dims.length,chunks=this._chunks,i=0,len=this.count();i<len;i++){var rawIdx=this.getRawIndex(i);switch(dimSize){case 0:cb(i);break;case 1:cb(chunks[dims[0]][rawIdx],i);break;case 2:cb(chunks[dims[0]][rawIdx],chunks[dims[1]][rawIdx],i);break;default:for(var k=0,value=[];k<dimSize;k++)value[k]=chunks[dims[k]][rawIdx];value[k]=i,cb.apply(null,value)}}},DataStore.prototype.getDataExtent=function(dim){var dimData=this._chunks[dim],initialExtent=[1/0,-1/0];if(!dimData)return initialExtent;var dimExtent,currEnd=this.count();if(!this._indices)return this._rawExtent[dim].slice();if(dimExtent=this._extent[dim])return dimExtent.slice();for(var min=(dimExtent=initialExtent)[0],max=dimExtent[1],i=0;i<currEnd;i++){var value=dimData[this.getRawIndex(i)];value<min&&(min=value),value>max&&(max=value)}return dimExtent=[min,max],this._extent[dim]=dimExtent,dimExtent},DataStore.prototype.getRawDataItem=function(idx){var rawIdx=this.getRawIndex(idx);if(this._provider.persistent)return this._provider.getItem(rawIdx);for(var val=[],chunks=this._chunks,i=0;i<chunks.length;i++)val.push(chunks[i][rawIdx]);return val},DataStore.prototype.clone=function(clonedDims,ignoreIndices){var originalChunk,Ctor,target=new DataStore,chunks=this._chunks,clonedDimsMap=clonedDims&&reduce(clonedDims,(function(obj,dimIdx){return obj[dimIdx]=!0,obj}),{});if(clonedDimsMap)for(var i=0;i<chunks.length;i++)target._chunks[i]=clonedDimsMap[i]?(originalChunk=chunks[i],Ctor=void 0,(Ctor=originalChunk.constructor)===Array?originalChunk.slice():new Ctor(originalChunk)):chunks[i];else target._chunks=chunks;return this._copyCommonProps(target),ignoreIndices||(target._indices=this._cloneIndices()),target._updateGetRawIdx(),target},DataStore.prototype._copyCommonProps=function(target){target._count=this._count,target._rawCount=this._rawCount,target._provider=this._provider,target._dimensions=this._dimensions,target._extent=clone$3(this._extent),target._rawExtent=clone$3(this._rawExtent)},DataStore.prototype._cloneIndices=function(){if(this._indices){var Ctor=this._indices.constructor,indices=void 0;if(Ctor===Array){var thisCount=this._indices.length;indices=new Ctor(thisCount);for(var i=0;i<thisCount;i++)indices[i]=this._indices[i]}else indices=new Ctor(this._indices);return indices}return null},DataStore.prototype._getRawIdxIdentity=function(idx){return idx},DataStore.prototype._getRawIdx=function(idx){return idx<this._count&&idx>=0?this._indices[idx]:-1},DataStore.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},DataStore.internalField=function(){function getDimValueSimply(dataItem,property,dataIndex,dimIndex){return parseDataValue(dataItem[dimIndex],this._dimensions[dimIndex])}defaultDimValueGetters={arrayRows:getDimValueSimply,objectRows:function(dataItem,property,dataIndex,dimIndex){return parseDataValue(dataItem[property],this._dimensions[dimIndex])},keyedColumns:getDimValueSimply,original:function(dataItem,property,dataIndex,dimIndex){var value=dataItem&&(null==dataItem.value?dataItem:dataItem.value);return parseDataValue(value instanceof Array?value[dimIndex]:value,this._dimensions[dimIndex])},typedArray:function(dataItem,property,dataIndex,dimIndex){return dataItem[dimIndex]}}}(),DataStore}(),SourceManager=function(){function SourceManager(sourceHost){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=sourceHost}return SourceManager.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},SourceManager.prototype._setLocalSource=function(sourceList,upstreamSignList){this._sourceList=sourceList,this._upstreamSignList=upstreamSignList,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},SourceManager.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},SourceManager.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},SourceManager.prototype._createSource=function(){this._setLocalSource([],[]);var resultSourceList,upstreamSignList,sourceHost=this._sourceHost,upSourceMgrList=this._getUpstreamSourceManagers(),hasUpstream=!!upSourceMgrList.length;if(isSeries(sourceHost)){var seriesModel=sourceHost,data=void 0,sourceFormat=void 0,upSource=void 0;if(hasUpstream){var upSourceMgr=upSourceMgrList[0];upSourceMgr.prepareSource(),data=(upSource=upSourceMgr.getSource()).data,sourceFormat=upSource.sourceFormat,upstreamSignList=[upSourceMgr._getVersionSign()]}else sourceFormat=isTypedArray(data=seriesModel.get("data",!0))?"typedArray":"original",upstreamSignList=[];var newMetaRawOption=this._getSourceMetaRawOption()||{},upMetaRawOption=upSource&&upSource.metaRawOption||{},seriesLayoutBy=retrieve2(newMetaRawOption.seriesLayoutBy,upMetaRawOption.seriesLayoutBy)||null,sourceHeader=retrieve2(newMetaRawOption.sourceHeader,upMetaRawOption.sourceHeader),dimensions=retrieve2(newMetaRawOption.dimensions,upMetaRawOption.dimensions);resultSourceList=seriesLayoutBy!==upMetaRawOption.seriesLayoutBy||!!sourceHeader!=!!upMetaRawOption.sourceHeader||dimensions?[createSource(data,{seriesLayoutBy:seriesLayoutBy,sourceHeader:sourceHeader,dimensions:dimensions},sourceFormat)]:[]}else{var datasetModel=sourceHost;if(hasUpstream){var result=this._applyTransform(upSourceMgrList);resultSourceList=result.sourceList,upstreamSignList=result.upstreamSignList}else{resultSourceList=[createSource(datasetModel.get("source",!0),this._getSourceMetaRawOption(),null)],upstreamSignList=[]}}"production"!==process.env.NODE_ENV&&assert(resultSourceList&&upstreamSignList),this._setLocalSource(resultSourceList,upstreamSignList)},SourceManager.prototype._applyTransform=function(upMgrList){var sourceList,datasetModel=this._sourceHost,transformOption=datasetModel.get("transform",!0),fromTransformResult=datasetModel.get("fromTransformResult",!0);if("production"!==process.env.NODE_ENV&&assert(null!=fromTransformResult||null!=transformOption),null!=fromTransformResult){var errMsg="";1!==upMgrList.length&&("production"!==process.env.NODE_ENV&&(errMsg="When using `fromTransformResult`, there should be only one upstream dataset"),doThrow(errMsg))}var source,upSourceList=[],upstreamSignList=[];return each$b(upMgrList,(function(upMgr){upMgr.prepareSource();var upSource=upMgr.getSource(fromTransformResult||0),errMsg="";null==fromTransformResult||upSource||("production"!==process.env.NODE_ENV&&(errMsg="Can not retrieve result by `fromTransformResult`: "+fromTransformResult),doThrow(errMsg)),upSourceList.push(upSource),upstreamSignList.push(upMgr._getVersionSign())})),transformOption?sourceList=function(rawTransOption,sourceList,infoForPrint){var pipedTransOption=normalizeToArray(rawTransOption),pipeLen=pipedTransOption.length,errMsg="";pipeLen||("production"!==process.env.NODE_ENV&&(errMsg="If `transform` declared, it should at least contain one transform."),throwError(errMsg));for(var i=0,len=pipeLen;i<len;i++)sourceList=applySingleDataTransform(pipedTransOption[i],sourceList,infoForPrint,1===pipeLen?null:i),i!==len-1&&(sourceList.length=Math.max(sourceList.length,1));return sourceList}(transformOption,upSourceList,{datasetIndex:datasetModel.componentIndex}):null!=fromTransformResult&&(sourceList=[(source=upSourceList[0],new SourceImpl({data:source.data,sourceFormat:source.sourceFormat,seriesLayoutBy:source.seriesLayoutBy,dimensionsDefine:clone$3(source.dimensionsDefine),startIndex:source.startIndex,dimensionsDetectedCount:source.dimensionsDetectedCount}))]),{sourceList:sourceList,upstreamSignList:upstreamSignList}},SourceManager.prototype._isDirty=function(){if(this._dirty)return!0;for(var upSourceMgrList=this._getUpstreamSourceManagers(),i=0;i<upSourceMgrList.length;i++){var upSrcMgr=upSourceMgrList[i];if(upSrcMgr._isDirty()||this._upstreamSignList[i]!==upSrcMgr._getVersionSign())return!0}},SourceManager.prototype.getSource=function(sourceIndex){sourceIndex=sourceIndex||0;var source=this._sourceList[sourceIndex];if(!source){var upSourceMgrList=this._getUpstreamSourceManagers();return upSourceMgrList[0]&&upSourceMgrList[0].getSource(sourceIndex)}return source},SourceManager.prototype.getSharedDataStore=function(seriesDimRequest){"production"!==process.env.NODE_ENV&&assert(isSeries(this._sourceHost),"Can only call getDataStore on series source manager.");var schema=seriesDimRequest.makeStoreSchema();return this._innerGetDataStore(schema.dimensions,seriesDimRequest.source,schema.hash)},SourceManager.prototype._innerGetDataStore=function(storeDims,seriesSource,sourceReadKey){var storeList=this._storeList,cachedStoreMap=storeList[0];cachedStoreMap||(cachedStoreMap=storeList[0]={});var cachedStore=cachedStoreMap[sourceReadKey];if(!cachedStore){var upSourceMgr=this._getUpstreamSourceManagers()[0];isSeries(this._sourceHost)&&upSourceMgr?cachedStore=upSourceMgr._innerGetDataStore(storeDims,seriesSource,sourceReadKey):(cachedStore=new DataStore).initData(new DefaultDataProvider(seriesSource,storeDims.length),storeDims),cachedStoreMap[sourceReadKey]=cachedStore}return cachedStore},SourceManager.prototype._getUpstreamSourceManagers=function(){var sourceHost=this._sourceHost;if(isSeries(sourceHost)){var datasetModel=querySeriesUpstreamDatasetModel(sourceHost);return datasetModel?[datasetModel.getSourceManager()]:[]}return map$1(function(datasetModel){return datasetModel.get("transform",!0)||datasetModel.get("fromTransformResult",!0)?queryReferringComponents(datasetModel.ecModel,"dataset",{index:datasetModel.get("fromDatasetIndex",!0),id:datasetModel.get("fromDatasetId",!0)},SINGLE_REFERRING).models:[]}(sourceHost),(function(datasetModel){return datasetModel.getSourceManager()}))},SourceManager.prototype._getSourceMetaRawOption=function(){var seriesLayoutBy,sourceHeader,dimensions,sourceHost=this._sourceHost;if(isSeries(sourceHost))seriesLayoutBy=sourceHost.get("seriesLayoutBy",!0),sourceHeader=sourceHost.get("sourceHeader",!0),dimensions=sourceHost.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var model=sourceHost;seriesLayoutBy=model.get("seriesLayoutBy",!0),sourceHeader=model.get("sourceHeader",!0),dimensions=model.get("dimensions",!0)}return{seriesLayoutBy:seriesLayoutBy,sourceHeader:sourceHeader,dimensions:dimensions}},SourceManager}();function isSeries(sourceHost){return"series"===sourceHost.mainType}function doThrow(errMsg){throw new Error(errMsg)}function getTooltipLineHeight(textStyle){var lineHeight=textStyle.lineHeight;return null==lineHeight?"line-height:1":"line-height:"+encodeHTML(lineHeight+"")+"px"}function getTooltipTextStyle(textStyle,renderMode){var nameFontColor=textStyle.color||"#6e7079",nameFontSize=textStyle.fontSize||12,nameFontWeight=textStyle.fontWeight||"400",valueFontColor=textStyle.color||"#464646",valueFontSize=textStyle.fontSize||14,valueFontWeight=textStyle.fontWeight||"900";return"html"===renderMode?{nameStyle:"font-size:"+encodeHTML(nameFontSize+"")+"px;color:"+encodeHTML(nameFontColor)+";font-weight:"+encodeHTML(nameFontWeight+""),valueStyle:"font-size:"+encodeHTML(valueFontSize+"")+"px;color:"+encodeHTML(valueFontColor)+";font-weight:"+encodeHTML(valueFontWeight+"")}:{nameStyle:{fontSize:nameFontSize,fill:nameFontColor,fontWeight:nameFontWeight},valueStyle:{fontSize:valueFontSize,fill:valueFontColor,fontWeight:valueFontWeight}}}var HTML_GAPS=[0,10,20,30],RICH_TEXT_GAPS=["","\n","\n\n","\n\n\n"];function createTooltipMarkup(type,option){return option.type=type,option}function isSectionFragment(frag){return"section"===frag.type}function getBuilder(frag){return isSectionFragment(frag)?buildSection:buildNameValue}function getBlockGapLevel(frag){if(isSectionFragment(frag)){var gapLevel_1=0,subBlockLen=frag.blocks.length,hasInnerGap_1=subBlockLen>1||subBlockLen>0&&!frag.noHeader;return each$b(frag.blocks,(function(subBlock){var subGapLevel=getBlockGapLevel(subBlock);subGapLevel>=gapLevel_1&&(gapLevel_1=subGapLevel+ +(hasInnerGap_1&&(!subGapLevel||isSectionFragment(subBlock)&&!subBlock.noHeader)))})),gapLevel_1}return 0}function buildSection(ctx,fragment,topMarginForOuterGap,toolTipTextStyle){var gapLevel,noHeader=fragment.noHeader,gaps=(gapLevel=getBlockGapLevel(fragment),{html:HTML_GAPS[gapLevel],richText:RICH_TEXT_GAPS[gapLevel]}),subMarkupTextList=[],subBlocks=fragment.blocks||[];assert(!subBlocks||isArray(subBlocks)),subBlocks=subBlocks||[];var orderMode=ctx.orderMode;if(fragment.sortBlocks&&orderMode){subBlocks=subBlocks.slice();var orderMap={valueAsc:"asc",valueDesc:"desc"};if(hasOwn(orderMap,orderMode)){var comparator_1=new SortOrderComparator(orderMap[orderMode],null);subBlocks.sort((function(a,b){return comparator_1.evaluate(a.sortParam,b.sortParam)}))}else"seriesDesc"===orderMode&&subBlocks.reverse()}each$b(subBlocks,(function(subBlock,idx){var valueFormatter=fragment.valueFormatter,subMarkupText=getBuilder(subBlock)(valueFormatter?extend(extend({},ctx),{valueFormatter:valueFormatter}):ctx,subBlock,idx>0?gaps.html:0,toolTipTextStyle);null!=subMarkupText&&subMarkupTextList.push(subMarkupText)}));var subMarkupText="richText"===ctx.renderMode?subMarkupTextList.join(gaps.richText):wrapBlockHTML(toolTipTextStyle,subMarkupTextList.join(""),noHeader?topMarginForOuterGap:gaps.html);if(noHeader)return subMarkupText;var displayableHeader=makeValueReadable(fragment.header,"ordinal",ctx.useUTC),nameStyle=getTooltipTextStyle(toolTipTextStyle,ctx.renderMode).nameStyle,tooltipLineHeight=getTooltipLineHeight(toolTipTextStyle);return"richText"===ctx.renderMode?wrapInlineNameRichText(ctx,displayableHeader,nameStyle)+gaps.richText+subMarkupText:wrapBlockHTML(toolTipTextStyle,'<div style="'+nameStyle+";"+tooltipLineHeight+';">'+encodeHTML(displayableHeader)+"</div>"+subMarkupText,topMarginForOuterGap)}function buildNameValue(ctx,fragment,topMarginForOuterGap,toolTipTextStyle){var renderMode=ctx.renderMode,noName=fragment.noName,noValue=fragment.noValue,noMarker=!fragment.markerType,name=fragment.name,useUTC=ctx.useUTC,valueFormatter=fragment.valueFormatter||ctx.valueFormatter||function(value){return map$1(value=isArray(value)?value:[value],(function(val,idx){return makeValueReadable(val,isArray(valueTypeOption)?valueTypeOption[idx]:valueTypeOption,useUTC)}))};if(!noName||!noValue){var markerStr=noMarker?"":ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType,fragment.markerColor||"#333",renderMode),readableName=noName?"":makeValueReadable(name,"ordinal",useUTC),valueTypeOption=fragment.valueType,readableValueList=noValue?[]:valueFormatter(fragment.value,fragment.dataIndex),valueAlignRight=!noMarker||!noName,valueCloseToMarker=!noMarker&&noName,_a=getTooltipTextStyle(toolTipTextStyle,renderMode),nameStyle=_a.nameStyle,valueStyle=_a.valueStyle;return"richText"===renderMode?(noMarker?"":markerStr)+(noName?"":wrapInlineNameRichText(ctx,readableName,nameStyle))+(noValue?"":function(ctx,values,alignRight,valueCloseToMarker,style){var styles=[style],paddingLeft=valueCloseToMarker?10:20;return alignRight&&styles.push({padding:[0,0,0,paddingLeft],align:"right"}),ctx.markupStyleCreator.wrapRichTextStyle(isArray(values)?values.join("  "):values,styles)}(ctx,readableValueList,valueAlignRight,valueCloseToMarker,valueStyle)):wrapBlockHTML(toolTipTextStyle,(noMarker?"":markerStr)+(noName?"":function(name,leftHasMarker,style){return'<span style="'+style+";"+(leftHasMarker?"margin-left:2px":"")+'">'+encodeHTML(name)+"</span>"}(readableName,!noMarker,nameStyle))+(noValue?"":function(valueList,alignRight,valueCloseToMarker,style){var paddingStr=valueCloseToMarker?"10px":"20px",alignCSS=alignRight?"float:right;margin-left:"+paddingStr:"";return valueList=isArray(valueList)?valueList:[valueList],'<span style="'+alignCSS+";"+style+'">'+map$1(valueList,(function(value){return encodeHTML(value)})).join("&nbsp;&nbsp;")+"</span>"}(readableValueList,valueAlignRight,valueCloseToMarker,valueStyle)),topMarginForOuterGap)}}function buildTooltipMarkup(fragment,markupStyleCreator,renderMode,orderMode,useUTC,toolTipTextStyle){if(fragment)return getBuilder(fragment)({useUTC:useUTC,renderMode:renderMode,orderMode:orderMode,markupStyleCreator:markupStyleCreator,valueFormatter:fragment.valueFormatter},fragment,0,toolTipTextStyle)}function wrapBlockHTML(textStyle,encodedContent,topGap){return'<div style="'+("margin: "+topGap+"px 0 0")+";"+getTooltipLineHeight(textStyle)+';">'+encodedContent+'<div style="clear:both"></div></div>'}function wrapInlineNameRichText(ctx,name,style){return ctx.markupStyleCreator.wrapRichTextStyle(name,style)}function retrieveVisualColorForTooltipMarker(series,dataIndex){return convertToColorString(series.getData().getItemVisual(dataIndex,"style")[series.visualDrawType])}function getPaddingFromTooltipModel(model,renderMode){var padding=model.get("padding");return null!=padding?padding:"richText"===renderMode?[8,10]:10}var TooltipMarkupStyleCreator=function(){function TooltipMarkupStyleCreator(){this.richTextStyles={},this._nextStyleNameId=getRandomIdBase()}return TooltipMarkupStyleCreator.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},TooltipMarkupStyleCreator.prototype.makeTooltipMarker=function(markerType,colorStr,renderMode){var markerId="richText"===renderMode?this._generateStyleName():null,marker=function(inOpt,extraCssText){var opt=isString(inOpt)?{color:inOpt,extraCssText:extraCssText}:inOpt||{},color=opt.color,type=opt.type;extraCssText=opt.extraCssText;var renderMode=opt.renderMode||"html";return color?"html"===renderMode?"subItem"===type?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+encodeHTML(color)+";"+(extraCssText||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+encodeHTML(color)+";"+(extraCssText||"")+'"></span>':{renderMode:renderMode,content:"{"+(opt.markerId||"markerX")+"|}  ",style:"subItem"===type?{width:4,height:4,borderRadius:2,backgroundColor:color}:{width:10,height:10,borderRadius:5,backgroundColor:color}}:""}({color:colorStr,type:markerType,renderMode:renderMode,markerId:markerId});return isString(marker)?marker:("production"!==process.env.NODE_ENV&&assert(markerId),this.richTextStyles[markerId]=marker.style,marker.content)},TooltipMarkupStyleCreator.prototype.wrapRichTextStyle=function(text,styles){var finalStl={};isArray(styles)?each$b(styles,(function(stl){return extend(finalStl,stl)})):extend(finalStl,styles);var styleName=this._generateStyleName();return this.richTextStyles[styleName]=finalStl,"{"+styleName+"|"+text+"}"},TooltipMarkupStyleCreator}();function defaultSeriesFormatTooltip(opt){var inlineValue,inlineValueType,subBlocks,sortParam,series=opt.series,dataIndex=opt.dataIndex,multipleSeries=opt.multipleSeries,data=series.getData(),tooltipDims=data.mapDimensionsAll("defaultedTooltip"),tooltipDimLen=tooltipDims.length,value=series.getRawValue(dataIndex),isValueArr=isArray(value),markerColor=retrieveVisualColorForTooltipMarker(series,dataIndex);if(tooltipDimLen>1||isValueArr&&!tooltipDimLen){var formatArrResult=function(value,series,dataIndex,tooltipDims,colorStr){var data=series.getData(),isValueMultipleLine=reduce(value,(function(isValueMultipleLine,val,idx){var dimItem=data.getDimensionInfo(idx);return isValueMultipleLine||dimItem&&!1!==dimItem.tooltip&&null!=dimItem.displayName}),!1),inlineValues=[],inlineValueTypes=[],blocks=[];function setEachItem(val,dim){var dimInfo=data.getDimensionInfo(dim);dimInfo&&!1!==dimInfo.otherDims.tooltip&&(isValueMultipleLine?blocks.push(createTooltipMarkup("nameValue",{markerType:"subItem",markerColor:colorStr,name:dimInfo.displayName,value:val,valueType:dimInfo.type})):(inlineValues.push(val),inlineValueTypes.push(dimInfo.type)))}return tooltipDims.length?each$b(tooltipDims,(function(dim){setEachItem(retrieveRawValue(data,dataIndex,dim),dim)})):each$b(value,setEachItem),{inlineValues:inlineValues,inlineValueTypes:inlineValueTypes,blocks:blocks}}(value,series,dataIndex,tooltipDims,markerColor);inlineValue=formatArrResult.inlineValues,inlineValueType=formatArrResult.inlineValueTypes,subBlocks=formatArrResult.blocks,sortParam=formatArrResult.inlineValues[0]}else if(tooltipDimLen){var dimInfo=data.getDimensionInfo(tooltipDims[0]);sortParam=inlineValue=retrieveRawValue(data,dataIndex,tooltipDims[0]),inlineValueType=dimInfo.type}else sortParam=inlineValue=isValueArr?value[0]:value;var seriesNameSpecified=isNameSpecified(series),seriesName=seriesNameSpecified&&series.name||"",itemName=data.getName(dataIndex),inlineName=multipleSeries?seriesName:itemName;return createTooltipMarkup("section",{header:seriesName,noHeader:multipleSeries||!seriesNameSpecified,sortParam:sortParam,blocks:[createTooltipMarkup("nameValue",{markerType:"item",markerColor:markerColor,name:inlineName,noName:!trim$1(inlineName),value:inlineValue,valueType:inlineValueType,dataIndex:dataIndex})].concat(subBlocks||[])})}var inner$h=makeInner();function getSelectionKey(data,dataIndex){return data.getName(dataIndex)||data.getId(dataIndex)}var SeriesModel=function(_super){function SeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this._selectedDataIndicesMap={},_this}return __extends(SeriesModel,_super),SeriesModel.prototype.init=function(option,parentModel,ecModel){this.seriesIndex=this.componentIndex,this.dataTask=createTask({count:dataTaskCount,reset:dataTaskReset}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(option,ecModel),(inner$h(this).sourceManager=new SourceManager(this)).prepareSource();var data=this.getInitialData(option,ecModel);wrapData(data,this),this.dataTask.context.data=data,"production"!==process.env.NODE_ENV&&assert(data,"getInitialData returned invalid data."),inner$h(this).dataBeforeProcessed=data,autoSeriesName(this),this._initSelectedMapFromData(data)},SeriesModel.prototype.mergeDefaultAndTheme=function(option,ecModel){var layoutMode=fetchLayoutMode(this),inputPositionParams=layoutMode?getLayoutParams(option):{},themeSubType=this.subType;ComponentModel$1.hasClass(themeSubType)&&(themeSubType+="Series"),merge(option,ecModel.getTheme().get(this.subType)),merge(option,this.getDefaultOption()),defaultEmphasis(option,"label",["show"]),this.fillDataTextStyle(option.data),layoutMode&&mergeLayoutParam(option,inputPositionParams,layoutMode)},SeriesModel.prototype.mergeOption=function(newSeriesOption,ecModel){newSeriesOption=merge(this.option,newSeriesOption,!0),this.fillDataTextStyle(newSeriesOption.data);var layoutMode=fetchLayoutMode(this);layoutMode&&mergeLayoutParam(this.option,newSeriesOption,layoutMode);var sourceManager=inner$h(this).sourceManager;sourceManager.dirty(),sourceManager.prepareSource();var data=this.getInitialData(newSeriesOption,ecModel);wrapData(data,this),this.dataTask.dirty(),this.dataTask.context.data=data,inner$h(this).dataBeforeProcessed=data,autoSeriesName(this),this._initSelectedMapFromData(data)},SeriesModel.prototype.fillDataTextStyle=function(data){if(data&&!isTypedArray(data))for(var props=["show"],i=0;i<data.length;i++)data[i]&&data[i].label&&defaultEmphasis(data[i],"label",props)},SeriesModel.prototype.getInitialData=function(option,ecModel){},SeriesModel.prototype.appendData=function(params){this.getRawData().appendData(params.data)},SeriesModel.prototype.getData=function(dataType){var task=getCurrentTask(this);if(task){var data=task.context.data;return null!=dataType&&data.getLinkedData?data.getLinkedData(dataType):data}return inner$h(this).data},SeriesModel.prototype.getAllData=function(){var mainData=this.getData();return mainData&&mainData.getLinkedDataAll?mainData.getLinkedDataAll():[{data:mainData}]},SeriesModel.prototype.setData=function(data){var task=getCurrentTask(this);if(task){var context=task.context;context.outputData=data,task!==this.dataTask&&(context.data=data)}inner$h(this).data=data},SeriesModel.prototype.getEncode=function(){var encode=this.get("encode",!0);if(encode)return createHashMap(encode)},SeriesModel.prototype.getSourceManager=function(){return inner$h(this).sourceManager},SeriesModel.prototype.getSource=function(){return this.getSourceManager().getSource()},SeriesModel.prototype.getRawData=function(){return inner$h(this).dataBeforeProcessed},SeriesModel.prototype.getColorBy=function(){return this.get("colorBy")||"series"},SeriesModel.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},SeriesModel.prototype.getBaseAxis=function(){var coordSys=this.coordinateSystem;return coordSys&&coordSys.getBaseAxis&&coordSys.getBaseAxis()},SeriesModel.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){return defaultSeriesFormatTooltip({series:this,dataIndex:dataIndex,multipleSeries:multipleSeries})},SeriesModel.prototype.isAnimationEnabled=function(){var ecModel=this.ecModel;if(env$1.node&&(!ecModel||!ecModel.ssr))return!1;var animationEnabled=this.getShallow("animation");return animationEnabled&&this.getData().count()>this.getShallow("animationThreshold")&&(animationEnabled=!1),!!animationEnabled},SeriesModel.prototype.restoreData=function(){this.dataTask.dirty()},SeriesModel.prototype.getColorFromPalette=function(name,scope,requestColorNum){var ecModel=this.ecModel,color=PaletteMixin.prototype.getColorFromPalette.call(this,name,scope,requestColorNum);return color||(color=ecModel.getColorFromPalette(name,scope,requestColorNum)),color},SeriesModel.prototype.coordDimToDataDim=function(coordDim){return this.getRawData().mapDimensionsAll(coordDim)},SeriesModel.prototype.getProgressive=function(){return this.get("progressive")},SeriesModel.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},SeriesModel.prototype.select=function(innerDataIndices,dataType){this._innerSelect(this.getData(dataType),innerDataIndices)},SeriesModel.prototype.unselect=function(innerDataIndices,dataType){var selectedMap=this.option.selectedMap;if(selectedMap){var selectedMode=this.option.selectedMode,data=this.getData(dataType);if("series"===selectedMode||"all"===selectedMap)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var i=0;i<innerDataIndices.length;i++){var nameOrId=getSelectionKey(data,innerDataIndices[i]);selectedMap[nameOrId]=!1,this._selectedDataIndicesMap[nameOrId]=-1}}},SeriesModel.prototype.toggleSelect=function(innerDataIndices,dataType){for(var tmpArr=[],i=0;i<innerDataIndices.length;i++)tmpArr[0]=innerDataIndices[i],this.isSelected(innerDataIndices[i],dataType)?this.unselect(tmpArr,dataType):this.select(tmpArr,dataType)},SeriesModel.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var selectedDataIndicesMap=this._selectedDataIndicesMap,nameOrIds=keys$1(selectedDataIndicesMap),dataIndices=[],i=0;i<nameOrIds.length;i++){var dataIndex=selectedDataIndicesMap[nameOrIds[i]];dataIndex>=0&&dataIndices.push(dataIndex)}return dataIndices},SeriesModel.prototype.isSelected=function(dataIndex,dataType){var selectedMap=this.option.selectedMap;if(!selectedMap)return!1;var data=this.getData(dataType);return("all"===selectedMap||selectedMap[getSelectionKey(data,dataIndex)])&&!data.getItemModel(dataIndex).get(["select","disabled"])},SeriesModel.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var universalTransitionOpt=this.option.universalTransition;return!!universalTransitionOpt&&(!0===universalTransitionOpt||universalTransitionOpt&&universalTransitionOpt.enabled)},SeriesModel.prototype._innerSelect=function(data,innerDataIndices){var _a,_b,option=this.option,selectedMode=option.selectedMode,len=innerDataIndices.length;if(selectedMode&&len)if("series"===selectedMode)option.selectedMap="all";else if("multiple"===selectedMode){isObject$3(option.selectedMap)||(option.selectedMap={});for(var selectedMap=option.selectedMap,i=0;i<len;i++){var dataIndex=innerDataIndices[i];selectedMap[nameOrId=getSelectionKey(data,dataIndex)]=!0,this._selectedDataIndicesMap[nameOrId]=data.getRawIndex(dataIndex)}}else if("single"===selectedMode||!0===selectedMode){var lastDataIndex=innerDataIndices[len-1],nameOrId=getSelectionKey(data,lastDataIndex);option.selectedMap=((_a={})[nameOrId]=!0,_a),this._selectedDataIndicesMap=((_b={})[nameOrId]=data.getRawIndex(lastDataIndex),_b)}},SeriesModel.prototype._initSelectedMapFromData=function(data){if(!this.option.selectedMap){var dataIndices=[];data.hasItemOption&&data.each((function(idx){var rawItem=data.getRawDataItem(idx);rawItem&&rawItem.selected&&dataIndices.push(idx)})),dataIndices.length>0&&this._innerSelect(data,dataIndices)}},SeriesModel.registerClass=function(clz){return ComponentModel$1.registerClass(clz)},SeriesModel.protoInitialize=function(){var proto=SeriesModel.prototype;proto.type="series.__base__",proto.seriesIndex=0,proto.ignoreStyleOnData=!1,proto.hasSymbolVisual=!1,proto.defaultSymbol="circle",proto.visualStyleAccessPath="itemStyle",proto.visualDrawType="fill"}(),SeriesModel}(ComponentModel$1);function autoSeriesName(seriesModel){var name=seriesModel.name;isNameSpecified(seriesModel)||(seriesModel.name=function(seriesModel){var data=seriesModel.getRawData(),dataDims=data.mapDimensionsAll("seriesName"),nameArr=[];return each$b(dataDims,(function(dataDim){var dimInfo=data.getDimensionInfo(dataDim);dimInfo.displayName&&nameArr.push(dimInfo.displayName)})),nameArr.join(" ")}(seriesModel)||name)}function dataTaskCount(context){return context.model.getRawData().count()}function dataTaskReset(context){var seriesModel=context.model;return seriesModel.setData(seriesModel.getRawData().cloneShallow()),dataTaskProgress}function dataTaskProgress(param,context){context.outputData&&param.end>context.outputData.count()&&context.model.getRawData().cloneShallow(context.outputData)}function wrapData(data,seriesModel){each$b(concatArray(data.CHANGABLE_METHODS,data.DOWNSAMPLE_METHODS),(function(methodName){data.wrapMethod(methodName,curry$1(onDataChange,seriesModel))}))}function onDataChange(seriesModel,newList){var task=getCurrentTask(seriesModel);return task&&task.setOutputEnd((newList||this).count()),newList}function getCurrentTask(seriesModel){var scheduler=(seriesModel.ecModel||{}).scheduler,pipeline=scheduler&&scheduler.getPipeline(seriesModel.uid);if(pipeline){var task=pipeline.currentTask;if(task){var agentStubMap=task.agentStubMap;agentStubMap&&(task=agentStubMap.get(seriesModel.uid))}return task}}mixin(SeriesModel,DataFormatMixin),mixin(SeriesModel,PaletteMixin),mountExtend(SeriesModel,ComponentModel$1);var SeriesModel$1=SeriesModel,ComponentView=function(){function ComponentView(){this.group=new Group$4,this.uid=getUID("viewComponent")}return ComponentView.prototype.init=function(ecModel,api){},ComponentView.prototype.render=function(model,ecModel,api,payload){},ComponentView.prototype.dispose=function(ecModel,api){},ComponentView.prototype.updateView=function(model,ecModel,api,payload){},ComponentView.prototype.updateLayout=function(model,ecModel,api,payload){},ComponentView.prototype.updateVisual=function(model,ecModel,api,payload){},ComponentView.prototype.toggleBlurSeries=function(seriesModels,isBlur,ecModel){},ComponentView.prototype.eachRendered=function(cb){var group=this.group;group&&group.traverse(cb)},ComponentView}();enableClassExtend(ComponentView),enableClassManagement(ComponentView);var ComponentView$1=ComponentView;function createRenderPlanner(){var inner=makeInner();return function(seriesModel){var fields=inner(seriesModel),pipelineContext=seriesModel.pipelineContext,originalLarge=!!fields.large,originalProgressive=!!fields.progressiveRender,large=fields.large=!(!pipelineContext||!pipelineContext.large),progressive=fields.progressiveRender=!(!pipelineContext||!pipelineContext.progressiveRender);return!(originalLarge===large&&originalProgressive===progressive)&&"reset"}}var inner$g=makeInner(),renderPlanner=createRenderPlanner(),ChartView=function(){function ChartView(){this.group=new Group$4,this.uid=getUID("viewChart"),this.renderTask=createTask({plan:renderTaskPlan,reset:renderTaskReset}),this.renderTask.context={view:this}}return ChartView.prototype.init=function(ecModel,api){},ChartView.prototype.render=function(seriesModel,ecModel,api,payload){if("production"!==process.env.NODE_ENV)throw new Error("render method must been implemented")},ChartView.prototype.highlight=function(seriesModel,ecModel,api,payload){var data=seriesModel.getData(payload&&payload.dataType);data?toggleHighlight(data,payload,"emphasis"):"production"!==process.env.NODE_ENV&&error("Unknown dataType "+payload.dataType)},ChartView.prototype.downplay=function(seriesModel,ecModel,api,payload){var data=seriesModel.getData(payload&&payload.dataType);data?toggleHighlight(data,payload,"normal"):"production"!==process.env.NODE_ENV&&error("Unknown dataType "+payload.dataType)},ChartView.prototype.remove=function(ecModel,api){this.group.removeAll()},ChartView.prototype.dispose=function(ecModel,api){},ChartView.prototype.updateView=function(seriesModel,ecModel,api,payload){this.render(seriesModel,ecModel,api,payload)},ChartView.prototype.updateLayout=function(seriesModel,ecModel,api,payload){this.render(seriesModel,ecModel,api,payload)},ChartView.prototype.updateVisual=function(seriesModel,ecModel,api,payload){this.render(seriesModel,ecModel,api,payload)},ChartView.prototype.eachRendered=function(cb){traverseElements(this.group,cb)},ChartView.markUpdateMethod=function(payload,methodName){inner$g(payload).updateMethod=methodName},ChartView.protoInitialize=void(ChartView.prototype.type="chart"),ChartView}();function elSetState(el,state,highlightDigit){el&&isHighDownDispatcher(el)&&("emphasis"===state?enterEmphasis:leaveEmphasis)(el,highlightDigit)}function toggleHighlight(data,payload,state){var dataIndex=queryDataIndex(data,payload),highlightDigit=payload&&null!=payload.highlightKey?function(highlightKey){var highlightDigit=_highlightKeyMap[highlightKey];return null==highlightDigit&&_highlightNextDigit<=32&&(highlightDigit=_highlightKeyMap[highlightKey]=_highlightNextDigit++),highlightDigit}(payload.highlightKey):null;null!=dataIndex?each$b(normalizeToArray(dataIndex),(function(dataIdx){elSetState(data.getItemGraphicEl(dataIdx),state,highlightDigit)})):data.eachItemGraphicEl((function(el){elSetState(el,state,highlightDigit)}))}function renderTaskPlan(context){return renderPlanner(context.model)}function renderTaskReset(context){var seriesModel=context.model,ecModel=context.ecModel,api=context.api,payload=context.payload,progressiveRender=seriesModel.pipelineContext.progressiveRender,view=context.view,updateMethod=payload&&inner$g(payload).updateMethod,methodName=progressiveRender?"incrementalPrepareRender":updateMethod&&view[updateMethod]?updateMethod:"render";return"render"!==methodName&&view[methodName](seriesModel,ecModel,api,payload),progressMethodMap[methodName]}enableClassExtend(ChartView,["dispose"]),enableClassManagement(ChartView);var progressMethodMap={incrementalPrepareRender:{progress:function(params,context){context.view.incrementalRender(params,context.model,context.ecModel,context.api,context.payload)}},render:{forceFirstProgress:!0,progress:function(params,context){context.view.render(context.model,context.ecModel,context.api,context.payload)}}},ChartView$1=ChartView,ORIGIN_METHOD="\0__throttleOriginMethod",RATE="\0__throttleRate";function throttle(fn,delay,debounce){var currCall,diff,scope,args,debounceNextCall,lastCall=0,lastExec=0,timer=null;function exec(){lastExec=(new Date).getTime(),timer=null,fn.apply(scope,args||[])}delay=delay||0;var cb=function(){for(var cbArgs=[],_i=0;_i<arguments.length;_i++)cbArgs[_i]=arguments[_i];currCall=(new Date).getTime(),scope=this,args=cbArgs;var thisDelay=debounceNextCall||delay,thisDebounce=debounceNextCall||debounce;debounceNextCall=null,diff=currCall-(thisDebounce?lastCall:lastExec)-thisDelay,clearTimeout(timer),thisDebounce?timer=setTimeout(exec,thisDelay):diff>=0?exec():timer=setTimeout(exec,-diff),lastCall=currCall};return cb.clear=function(){timer&&(clearTimeout(timer),timer=null)},cb.debounceNextCall=function(debounceDelay){debounceNextCall=debounceDelay},cb}function createOrUpdate(obj,fnAttr,rate,throttleType){var fn=obj[fnAttr];if(fn){var originFn=fn[ORIGIN_METHOD]||fn,lastThrottleType=fn["\0__throttleType"];if(fn[RATE]!==rate||lastThrottleType!==throttleType){if(null==rate||!throttleType)return obj[fnAttr]=originFn;(fn=obj[fnAttr]=throttle(originFn,rate,"debounce"===throttleType))[ORIGIN_METHOD]=originFn,fn["\0__throttleType"]=throttleType,fn[RATE]=rate}return fn}}function clear$1(obj,fnAttr){var fn=obj[fnAttr];fn&&fn[ORIGIN_METHOD]&&(fn.clear&&fn.clear(),obj[fnAttr]=fn[ORIGIN_METHOD])}var inner$f=makeInner(),defaultStyleMappers={itemStyle:makeStyleMapper(ITEM_STYLE_KEY_MAP,!0),lineStyle:makeStyleMapper(LINE_STYLE_KEY_MAP,!0)},defaultColorKey={lineStyle:"stroke",itemStyle:"fill"};function getStyleMapper(seriesModel,stylePath){var styleMapper=seriesModel.visualStyleMapper||defaultStyleMappers[stylePath];return styleMapper||(console.warn("Unknown style type '"+stylePath+"'."),defaultStyleMappers.itemStyle)}function getDefaultColorKey(seriesModel,stylePath){var colorKey=seriesModel.visualDrawType||defaultColorKey[stylePath];return colorKey||(console.warn("Unknown style type '"+stylePath+"'."),"fill")}var seriesStyleTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(seriesModel,ecModel){var data=seriesModel.getData(),stylePath=seriesModel.visualStyleAccessPath||"itemStyle",styleModel=seriesModel.getModel(stylePath),globalStyle=getStyleMapper(seriesModel,stylePath)(styleModel),decalOption=styleModel.getShallow("decal");decalOption&&(data.setVisual("decal",decalOption),decalOption.dirty=!0);var colorKey=getDefaultColorKey(seriesModel,stylePath),color=globalStyle[colorKey],colorCallback=isFunction(color)?color:null,hasAutoColor="auto"===globalStyle.fill||"auto"===globalStyle.stroke;if(!globalStyle[colorKey]||colorCallback||hasAutoColor){var colorPalette=seriesModel.getColorFromPalette(seriesModel.name,null,ecModel.getSeriesCount());globalStyle[colorKey]||(globalStyle[colorKey]=colorPalette,data.setVisual("colorFromPalette",!0)),globalStyle.fill="auto"===globalStyle.fill||isFunction(globalStyle.fill)?colorPalette:globalStyle.fill,globalStyle.stroke="auto"===globalStyle.stroke||isFunction(globalStyle.stroke)?colorPalette:globalStyle.stroke}if(data.setVisual("style",globalStyle),data.setVisual("drawType",colorKey),!ecModel.isSeriesFiltered(seriesModel)&&colorCallback)return data.setVisual("colorFromPalette",!1),{dataEach:function(data,idx){var dataParams=seriesModel.getDataParams(idx),itemStyle=extend({},globalStyle);itemStyle[colorKey]=colorCallback(dataParams),data.setItemVisual(idx,"style",itemStyle)}}}},sharedModel=new Model$1,dataStyleTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(seriesModel,ecModel){if(!seriesModel.ignoreStyleOnData&&!ecModel.isSeriesFiltered(seriesModel)){var data=seriesModel.getData(),stylePath=seriesModel.visualStyleAccessPath||"itemStyle",getStyle=getStyleMapper(seriesModel,stylePath),colorKey=data.getVisual("drawType");return{dataEach:data.hasItemOption?function(data,idx){var rawItem=data.getRawDataItem(idx);if(rawItem&&rawItem[stylePath]){sharedModel.option=rawItem[stylePath];var style=getStyle(sharedModel);extend(data.ensureUniqueItemVisual(idx,"style"),style),sharedModel.option.decal&&(data.setItemVisual(idx,"decal",sharedModel.option.decal),sharedModel.option.decal.dirty=!0),colorKey in style&&data.setItemVisual(idx,"colorFromPalette",!1)}}:null}}}},dataColorPaletteTask={performRawSeries:!0,overallReset:function(ecModel){var paletteScopeGroupByType=createHashMap();ecModel.eachSeries((function(seriesModel){var colorBy=seriesModel.getColorBy();if(!seriesModel.isColorBySeries()){var key=seriesModel.type+"-"+colorBy,colorScope=paletteScopeGroupByType.get(key);colorScope||(colorScope={},paletteScopeGroupByType.set(key,colorScope)),inner$f(seriesModel).scope=colorScope}})),ecModel.eachSeries((function(seriesModel){if(!seriesModel.isColorBySeries()&&!ecModel.isSeriesFiltered(seriesModel)){var dataAll=seriesModel.getRawData(),idxMap={},data=seriesModel.getData(),colorScope=inner$f(seriesModel).scope,stylePath=seriesModel.visualStyleAccessPath||"itemStyle",colorKey=getDefaultColorKey(seriesModel,stylePath);data.each((function(idx){var rawIdx=data.getRawIndex(idx);idxMap[rawIdx]=idx})),dataAll.each((function(rawIdx){var idx=idxMap[rawIdx];if(data.getItemVisual(idx,"colorFromPalette")){var itemStyle=data.ensureUniqueItemVisual(idx,"style"),name_1=dataAll.getName(rawIdx)||rawIdx+"",dataCount=dataAll.count();itemStyle[colorKey]=seriesModel.getColorFromPalette(name_1,colorScope,dataCount)}}))}}))}},PI$3=Math.PI;var Scheduler=function(){function Scheduler(ecInstance,api,dataProcessorHandlers,visualHandlers){this._stageTaskMap=createHashMap(),this.ecInstance=ecInstance,this.api=api,dataProcessorHandlers=this._dataProcessorHandlers=dataProcessorHandlers.slice(),visualHandlers=this._visualHandlers=visualHandlers.slice(),this._allHandlers=dataProcessorHandlers.concat(visualHandlers)}return Scheduler.prototype.restoreData=function(ecModel,payload){ecModel.restoreData(payload),this._stageTaskMap.each((function(taskRecord){var overallTask=taskRecord.overallTask;overallTask&&overallTask.dirty()}))},Scheduler.prototype.getPerformArgs=function(task,isBlock){if(task.__pipeline){var pipeline=this._pipelineMap.get(task.__pipeline.id),pCtx=pipeline.context,step=!isBlock&&pipeline.progressiveEnabled&&(!pCtx||pCtx.progressiveRender)&&task.__idxInPipeline>pipeline.blockIndex?pipeline.step:null,modDataCount=pCtx&&pCtx.modDataCount;return{step:step,modBy:null!=modDataCount?Math.ceil(modDataCount/step):null,modDataCount:modDataCount}}},Scheduler.prototype.getPipeline=function(pipelineId){return this._pipelineMap.get(pipelineId)},Scheduler.prototype.updateStreamModes=function(seriesModel,view){var pipeline=this._pipelineMap.get(seriesModel.uid),dataLen=seriesModel.getData().count(),progressiveRender=pipeline.progressiveEnabled&&view.incrementalPrepareRender&&dataLen>=pipeline.threshold,large=seriesModel.get("large")&&dataLen>=seriesModel.get("largeThreshold"),modDataCount="mod"===seriesModel.get("progressiveChunkMode")?dataLen:null;seriesModel.pipelineContext=pipeline.context={progressiveRender:progressiveRender,modDataCount:modDataCount,large:large}},Scheduler.prototype.restorePipelines=function(ecModel){var scheduler=this,pipelineMap=scheduler._pipelineMap=createHashMap();ecModel.eachSeries((function(seriesModel){var progressive=seriesModel.getProgressive(),pipelineId=seriesModel.uid;pipelineMap.set(pipelineId,{id:pipelineId,head:null,tail:null,threshold:seriesModel.getProgressiveThreshold(),progressiveEnabled:progressive&&!(seriesModel.preventIncremental&&seriesModel.preventIncremental()),blockIndex:-1,step:Math.round(progressive||700),count:0}),scheduler._pipe(seriesModel,seriesModel.dataTask)}))},Scheduler.prototype.prepareStageTasks=function(){var stageTaskMap=this._stageTaskMap,ecModel=this.api.getModel(),api=this.api;each$b(this._allHandlers,(function(handler){var record=stageTaskMap.get(handler.uid)||stageTaskMap.set(handler.uid,{}),errMsg="";"production"!==process.env.NODE_ENV&&(errMsg='"reset" and "overallReset" must not be both specified.'),assert(!(handler.reset&&handler.overallReset),errMsg),handler.reset&&this._createSeriesStageTask(handler,record,ecModel,api),handler.overallReset&&this._createOverallStageTask(handler,record,ecModel,api)}),this)},Scheduler.prototype.prepareView=function(view,model,ecModel,api){var renderTask=view.renderTask,context=renderTask.context;context.model=model,context.ecModel=ecModel,context.api=api,renderTask.__block=!view.incrementalPrepareRender,this._pipe(model,renderTask)},Scheduler.prototype.performDataProcessorTasks=function(ecModel,payload){this._performStageTasks(this._dataProcessorHandlers,ecModel,payload,{block:!0})},Scheduler.prototype.performVisualTasks=function(ecModel,payload,opt){this._performStageTasks(this._visualHandlers,ecModel,payload,opt)},Scheduler.prototype._performStageTasks=function(stageHandlers,ecModel,payload,opt){opt=opt||{};var unfinished=!1,scheduler=this;function needSetDirty(opt,task){return opt.setDirty&&(!opt.dirtyMap||opt.dirtyMap.get(task.__pipeline.id))}each$b(stageHandlers,(function(stageHandler,idx){if(!opt.visualType||opt.visualType===stageHandler.visualType){var stageHandlerRecord=scheduler._stageTaskMap.get(stageHandler.uid),seriesTaskMap=stageHandlerRecord.seriesTaskMap,overallTask=stageHandlerRecord.overallTask;if(overallTask){var overallNeedDirty_1,agentStubMap=overallTask.agentStubMap;agentStubMap.each((function(stub){needSetDirty(opt,stub)&&(stub.dirty(),overallNeedDirty_1=!0)})),overallNeedDirty_1&&overallTask.dirty(),scheduler.updatePayload(overallTask,payload);var performArgs_1=scheduler.getPerformArgs(overallTask,opt.block);agentStubMap.each((function(stub){stub.perform(performArgs_1)})),overallTask.perform(performArgs_1)&&(unfinished=!0)}else seriesTaskMap&&seriesTaskMap.each((function(task,pipelineId){needSetDirty(opt,task)&&task.dirty();var performArgs=scheduler.getPerformArgs(task,opt.block);performArgs.skip=!stageHandler.performRawSeries&&ecModel.isSeriesFiltered(task.context.model),scheduler.updatePayload(task,payload),task.perform(performArgs)&&(unfinished=!0)}))}})),this.unfinished=unfinished||this.unfinished},Scheduler.prototype.performSeriesTasks=function(ecModel){var unfinished;ecModel.eachSeries((function(seriesModel){unfinished=seriesModel.dataTask.perform()||unfinished})),this.unfinished=unfinished||this.unfinished},Scheduler.prototype.plan=function(){this._pipelineMap.each((function(pipeline){var task=pipeline.tail;do{if(task.__block){pipeline.blockIndex=task.__idxInPipeline;break}task=task.getUpstream()}while(task)}))},Scheduler.prototype.updatePayload=function(task,payload){"remain"!==payload&&(task.context.payload=payload)},Scheduler.prototype._createSeriesStageTask=function(stageHandler,stageHandlerRecord,ecModel,api){var scheduler=this,oldSeriesTaskMap=stageHandlerRecord.seriesTaskMap,newSeriesTaskMap=stageHandlerRecord.seriesTaskMap=createHashMap(),seriesType=stageHandler.seriesType,getTargetSeries=stageHandler.getTargetSeries;function create(seriesModel){var pipelineId=seriesModel.uid,task=newSeriesTaskMap.set(pipelineId,oldSeriesTaskMap&&oldSeriesTaskMap.get(pipelineId)||createTask({plan:seriesTaskPlan,reset:seriesTaskReset,count:seriesTaskCount}));task.context={model:seriesModel,ecModel:ecModel,api:api,useClearVisual:stageHandler.isVisual&&!stageHandler.isLayout,plan:stageHandler.plan,reset:stageHandler.reset,scheduler:scheduler},scheduler._pipe(seriesModel,task)}stageHandler.createOnAllSeries?ecModel.eachRawSeries(create):seriesType?ecModel.eachRawSeriesByType(seriesType,create):getTargetSeries&&getTargetSeries(ecModel,api).each(create)},Scheduler.prototype._createOverallStageTask=function(stageHandler,stageHandlerRecord,ecModel,api){var scheduler=this,overallTask=stageHandlerRecord.overallTask=stageHandlerRecord.overallTask||createTask({reset:overallTaskReset});overallTask.context={ecModel:ecModel,api:api,overallReset:stageHandler.overallReset,scheduler:scheduler};var oldAgentStubMap=overallTask.agentStubMap,newAgentStubMap=overallTask.agentStubMap=createHashMap(),seriesType=stageHandler.seriesType,getTargetSeries=stageHandler.getTargetSeries,overallProgress=!0,shouldOverallTaskDirty=!1,errMsg="";function createStub(seriesModel){var pipelineId=seriesModel.uid,stub=newAgentStubMap.set(pipelineId,oldAgentStubMap&&oldAgentStubMap.get(pipelineId)||(shouldOverallTaskDirty=!0,createTask({reset:stubReset,onDirty:stubOnDirty})));stub.context={model:seriesModel,overallProgress:overallProgress},stub.agent=overallTask,stub.__block=overallProgress,scheduler._pipe(seriesModel,stub)}"production"!==process.env.NODE_ENV&&(errMsg='"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),assert(!stageHandler.createOnAllSeries,errMsg),seriesType?ecModel.eachRawSeriesByType(seriesType,createStub):getTargetSeries?getTargetSeries(ecModel,api).each(createStub):(overallProgress=!1,each$b(ecModel.getSeries(),createStub)),shouldOverallTaskDirty&&overallTask.dirty()},Scheduler.prototype._pipe=function(seriesModel,task){var pipelineId=seriesModel.uid,pipeline=this._pipelineMap.get(pipelineId);!pipeline.head&&(pipeline.head=task),pipeline.tail&&pipeline.tail.pipe(task),pipeline.tail=task,task.__idxInPipeline=pipeline.count++,task.__pipeline=pipeline},Scheduler.wrapStageHandler=function(stageHandler,visualType){return isFunction(stageHandler)&&(stageHandler={overallReset:stageHandler,seriesType:detectSeriseType(stageHandler)}),stageHandler.uid=getUID("stageHandler"),visualType&&(stageHandler.visualType=visualType),stageHandler},Scheduler}();function overallTaskReset(context){context.overallReset(context.ecModel,context.api,context.payload)}function stubReset(context){return context.overallProgress&&stubProgress}function stubProgress(){this.agent.dirty(),this.getDownstream().dirty()}function stubOnDirty(){this.agent&&this.agent.dirty()}function seriesTaskPlan(context){return context.plan?context.plan(context.model,context.ecModel,context.api,context.payload):null}function seriesTaskReset(context){context.useClearVisual&&context.data.clearAllVisual();var resetDefines=context.resetDefines=normalizeToArray(context.reset(context.model,context.ecModel,context.api,context.payload));return resetDefines.length>1?map$1(resetDefines,(function(v,idx){return makeSeriesTaskProgress(idx)})):singleSeriesTaskProgress}var singleSeriesTaskProgress=makeSeriesTaskProgress(0);function makeSeriesTaskProgress(resetDefineIdx){return function(params,context){var data=context.data,resetDefine=context.resetDefines[resetDefineIdx];if(resetDefine&&resetDefine.dataEach)for(var i=params.start;i<params.end;i++)resetDefine.dataEach(data,i);else resetDefine&&resetDefine.progress&&resetDefine.progress(params,data)}}function seriesTaskCount(context){return context.data.count()}function detectSeriseType(legacyFunc){seriesType=null;try{legacyFunc(ecModelMock,apiMock)}catch(e){}return seriesType}var seriesType,ecModelMock={},apiMock={};function mockMethods(target,Clz){for(var name_1 in Clz.prototype)target[name_1]=noop$1}mockMethods(ecModelMock,GlobalModel$1),mockMethods(apiMock,ExtensionAPI$1),ecModelMock.eachSeriesByType=ecModelMock.eachRawSeriesByType=function(type){seriesType=type},ecModelMock.eachComponent=function(cond){"series"===cond.mainType&&cond.subType&&(seriesType=cond.subType)};var Scheduler$1=Scheduler,colorAll=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],lightTheme={color:colorAll,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],colorAll]},colorPalette=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],theme={darkMode:!0,color:colorPalette,backgroundColor:"#100C2A",axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:"#B9B8CE"},pageTextStyle:{color:"#B9B8CE"}},textStyle:{color:"#B9B8CE"},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:"#B9B8CE"}},dataZoom:{borderColor:"#71708A",textStyle:{color:"#B9B8CE"},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:"#B9B8CE"}},timeline:{lineStyle:{color:"#B9B8CE"},label:{color:"#B9B8CE"},controlStyle:{color:"#B9B8CE",borderColor:"#B9B8CE"}},calendar:{itemStyle:{color:"#100C2A"},dayLabel:{color:"#B9B8CE"},monthLabel:{color:"#B9B8CE"},yearLabel:{color:"#B9B8CE"}},timeAxis:{axisLine:{lineStyle:{color:"#B9B8CE"}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}},logAxis:{axisLine:{lineStyle:{color:"#B9B8CE"}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}},valueAxis:{axisLine:{lineStyle:{color:"#B9B8CE"}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}},categoryAxis:{axisLine:{lineStyle:{color:"#B9B8CE"}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}},line:{symbol:"circle"},graph:{color:colorPalette},gauge:{title:{color:"#B9B8CE"},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:"#B9B8CE"},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};theme.categoryAxis.splitLine.show=!1;var darkTheme=theme,ECEventProcessor=function(){function ECEventProcessor(){}return ECEventProcessor.prototype.normalizeQuery=function(query){var cptQuery={},dataQuery={},otherQuery={};if(isString(query)){var condCptType=parseClassType(query);cptQuery.mainType=condCptType.main||null,cptQuery.subType=condCptType.sub||null}else{var suffixes_1=["Index","Name","Id"],dataKeys_1={name:1,dataIndex:1,dataType:1};each$b(query,(function(val,key){for(var reserved=!1,i=0;i<suffixes_1.length;i++){var propSuffix=suffixes_1[i],suffixPos=key.lastIndexOf(propSuffix);if(suffixPos>0&&suffixPos===key.length-propSuffix.length){var mainType=key.slice(0,suffixPos);"data"!==mainType&&(cptQuery.mainType=mainType,cptQuery[propSuffix.toLowerCase()]=val,reserved=!0)}}dataKeys_1.hasOwnProperty(key)&&(dataQuery[key]=val,reserved=!0),reserved||(otherQuery[key]=val)}))}return{cptQuery:cptQuery,dataQuery:dataQuery,otherQuery:otherQuery}},ECEventProcessor.prototype.filter=function(eventType,query){var eventInfo=this.eventInfo;if(!eventInfo)return!0;var targetEl=eventInfo.targetEl,packedEvent=eventInfo.packedEvent,model=eventInfo.model,view=eventInfo.view;if(!model||!view)return!0;var cptQuery=query.cptQuery,dataQuery=query.dataQuery;return check(cptQuery,model,"mainType")&&check(cptQuery,model,"subType")&&check(cptQuery,model,"index","componentIndex")&&check(cptQuery,model,"name")&&check(cptQuery,model,"id")&&check(dataQuery,packedEvent,"name")&&check(dataQuery,packedEvent,"dataIndex")&&check(dataQuery,packedEvent,"dataType")&&(!view.filterForExposedEvent||view.filterForExposedEvent(eventType,query.otherQuery,targetEl,packedEvent));function check(query,host,prop,propOnHost){return null==query[prop]||host[propOnHost||prop]===query[prop]}},ECEventProcessor.prototype.afterTrigger=function(){this.eventInfo=null},ECEventProcessor}(),SYMBOL_PROPS_WITH_CB=["symbol","symbolSize","symbolRotate","symbolOffset"],SYMBOL_PROPS=SYMBOL_PROPS_WITH_CB.concat(["symbolKeepAspect"]),seriesSymbolTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(seriesModel,ecModel){var data=seriesModel.getData();if(seriesModel.legendIcon&&data.setVisual("legendIcon",seriesModel.legendIcon),seriesModel.hasSymbolVisual){for(var symbolOptions={},symbolOptionsCb={},hasCallback=!1,i=0;i<SYMBOL_PROPS_WITH_CB.length;i++){var symbolPropName=SYMBOL_PROPS_WITH_CB[i],val=seriesModel.get(symbolPropName);isFunction(val)?(hasCallback=!0,symbolOptionsCb[symbolPropName]=val):symbolOptions[symbolPropName]=val}if(symbolOptions.symbol=symbolOptions.symbol||seriesModel.defaultSymbol,data.setVisual(extend({legendIcon:seriesModel.legendIcon||symbolOptions.symbol,symbolKeepAspect:seriesModel.get("symbolKeepAspect")},symbolOptions)),!ecModel.isSeriesFiltered(seriesModel)){var symbolPropsCb=keys$1(symbolOptionsCb);return{dataEach:hasCallback?function(data,idx){for(var rawValue=seriesModel.getRawValue(idx),params=seriesModel.getDataParams(idx),i=0;i<symbolPropsCb.length;i++){var symbolPropName=symbolPropsCb[i];data.setItemVisual(idx,symbolPropName,symbolOptionsCb[symbolPropName](rawValue,params))}}:null}}}}},dataSymbolTask={createOnAllSeries:!0,performRawSeries:!0,reset:function(seriesModel,ecModel){if(seriesModel.hasSymbolVisual&&!ecModel.isSeriesFiltered(seriesModel))return{dataEach:seriesModel.getData().hasItemOption?function(data,idx){for(var itemModel=data.getItemModel(idx),i=0;i<SYMBOL_PROPS.length;i++){var symbolPropName=SYMBOL_PROPS[i],val=itemModel.getShallow(symbolPropName,!0);null!=val&&data.setItemVisual(idx,symbolPropName,val)}}:null}}};function getVisualFromData(data,key){switch(key){case"color":return data.getVisual("style")[data.getVisual("drawType")];case"opacity":return data.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return data.getVisual(key);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+key)}}function handleSeriesLegacySelectEvents(type,eventPostfix,ecIns,ecModel,payload){var legacyEventName=type+eventPostfix;ecIns.isSilent(legacyEventName)||("production"!==process.env.NODE_ENV&&deprecateLog("event "+legacyEventName+" is deprecated."),ecModel.eachComponent({mainType:"series",subType:"pie"},(function(seriesModel){for(var seriesIndex=seriesModel.seriesIndex,selectedMap=seriesModel.option.selectedMap,selected=payload.selected,i=0;i<selected.length;i++)if(selected[i].seriesIndex===seriesIndex){var data=seriesModel.getData(),dataIndex=queryDataIndex(data,payload.fromActionPayload);ecIns.trigger(legacyEventName,{type:legacyEventName,seriesId:seriesModel.id,name:isArray(dataIndex)?data.getName(dataIndex[0]):data.getName(dataIndex),selected:isString(selectedMap)?selectedMap:extend({},selectedMap)})}})))}function findEventDispatcher(target,det,returnFirstMatch){for(var found;target&&(!det(target)||(found=target,!returnFirstMatch));)target=target.__hostTarget||target.parent;return found}var wmUniqueIndex=Math.round(9*Math.random()),supportDefineProperty="function"==typeof Object.defineProperty,WeakMap=function(){function WeakMap(){this._id="__ec_inner_"+wmUniqueIndex++}return WeakMap.prototype.get=function(key){return this._guard(key)[this._id]},WeakMap.prototype.set=function(key,value){var target=this._guard(key);return supportDefineProperty?Object.defineProperty(target,this._id,{value:value,enumerable:!1,configurable:!0}):target[this._id]=value,this},WeakMap.prototype.delete=function(key){return!!this.has(key)&&(delete this._guard(key)[this._id],!0)},WeakMap.prototype.has=function(key){return!!this._guard(key)[this._id]},WeakMap.prototype._guard=function(key){if(key!==Object(key))throw TypeError("Value of WeakMap is not a non-null object.");return key},WeakMap}(),WeakMap$1=WeakMap,Triangle=Path$1.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(path,shape){var cx=shape.cx,cy=shape.cy,width=shape.width/2,height=shape.height/2;path.moveTo(cx,cy-height),path.lineTo(cx+width,cy+height),path.lineTo(cx-width,cy+height),path.closePath()}}),Diamond=Path$1.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(path,shape){var cx=shape.cx,cy=shape.cy,width=shape.width/2,height=shape.height/2;path.moveTo(cx,cy-height),path.lineTo(cx+width,cy),path.lineTo(cx,cy+height),path.lineTo(cx-width,cy),path.closePath()}}),Pin=Path$1.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(path,shape){var x=shape.x,y=shape.y,w=shape.width/5*3,h=Math.max(w,shape.height),r=w/2,dy=r*r/(h-r),cy=y-h+r+dy,angle=Math.asin(dy/r),dx=Math.cos(angle)*r,tanX=Math.sin(angle),tanY=Math.cos(angle),cpLen=.6*r,cpLen2=.7*r;path.moveTo(x-dx,cy+dy),path.arc(x,cy,r,Math.PI-angle,2*Math.PI+angle),path.bezierCurveTo(x+dx-tanX*cpLen,cy+dy+tanY*cpLen,x,y-cpLen2,x,y),path.bezierCurveTo(x,y-cpLen2,x-dx+tanX*cpLen,cy+dy+tanY*cpLen,x-dx,cy+dy),path.closePath()}}),Arrow=Path$1.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(ctx,shape){var height=shape.height,width=shape.width,x=shape.x,y=shape.y,dx=width/3*2;ctx.moveTo(x,y),ctx.lineTo(x+dx,y+height),ctx.lineTo(x,y+height/4*3),ctx.lineTo(x-dx,y+height),ctx.lineTo(x,y),ctx.closePath()}}),symbolShapeMakers={line:function(x,y,w,h,shape){shape.x1=x,shape.y1=y+h/2,shape.x2=x+w,shape.y2=y+h/2},rect:function(x,y,w,h,shape){shape.x=x,shape.y=y,shape.width=w,shape.height=h},roundRect:function(x,y,w,h,shape){shape.x=x,shape.y=y,shape.width=w,shape.height=h,shape.r=Math.min(w,h)/4},square:function(x,y,w,h,shape){var size=Math.min(w,h);shape.x=x,shape.y=y,shape.width=size,shape.height=size},circle:function(x,y,w,h,shape){shape.cx=x+w/2,shape.cy=y+h/2,shape.r=Math.min(w,h)/2},diamond:function(x,y,w,h,shape){shape.cx=x+w/2,shape.cy=y+h/2,shape.width=w,shape.height=h},pin:function(x,y,w,h,shape){shape.x=x+w/2,shape.y=y+h/2,shape.width=w,shape.height=h},arrow:function(x,y,w,h,shape){shape.x=x+w/2,shape.y=y+h/2,shape.width=w,shape.height=h},triangle:function(x,y,w,h,shape){shape.cx=x+w/2,shape.cy=y+h/2,shape.width=w,shape.height=h}},symbolBuildProxies={};each$b({line:Line$3,rect:Rect$4,roundRect:Rect$4,square:Rect$4,circle:Circle$1,diamond:Diamond,pin:Pin,arrow:Arrow,triangle:Triangle},(function(Ctor,name){symbolBuildProxies[name]=new Ctor}));var SymbolClz$1=Path$1.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(out,config,rect){var res=calculateTextPosition(out,config,rect),shape=this.shape;return shape&&"pin"===shape.symbolType&&"inside"===config.position&&(res.y=rect.y+.4*rect.height),res},buildPath:function(ctx,shape,inBundle){var symbolType=shape.symbolType;if("none"!==symbolType){var proxySymbol=symbolBuildProxies[symbolType];proxySymbol||(proxySymbol=symbolBuildProxies[symbolType="rect"]),symbolShapeMakers[symbolType](shape.x,shape.y,shape.width,shape.height,proxySymbol.shape),proxySymbol.buildPath(ctx,proxySymbol.shape,inBundle)}}});function symbolPathSetColor(color,innerColor){if("image"!==this.type){var symbolStyle=this.style;this.__isEmptyBrush?(symbolStyle.stroke=color,symbolStyle.fill=innerColor||"#fff",symbolStyle.lineWidth=2):"line"===this.shape.symbolType?symbolStyle.stroke=color:symbolStyle.fill=color,this.markRedraw()}}function createSymbol$1(symbolType,x,y,w,h,color,keepAspect){var symbolPath,isEmpty=0===symbolType.indexOf("empty");return isEmpty&&(symbolType=symbolType.substr(5,1).toLowerCase()+symbolType.substr(6)),(symbolPath=0===symbolType.indexOf("image://")?makeImage(symbolType.slice(8),new BoundingRect$1(x,y,w,h),keepAspect?"center":"cover"):0===symbolType.indexOf("path://")?makePath(symbolType.slice(7),{},new BoundingRect$1(x,y,w,h),keepAspect?"center":"cover"):new SymbolClz$1({shape:{symbolType:symbolType,x:x,y:y,width:w,height:h}})).__isEmptyBrush=isEmpty,symbolPath.setColor=symbolPathSetColor,color&&symbolPath.setColor(color),symbolPath}function normalizeSymbolSize(symbolSize){return isArray(symbolSize)||(symbolSize=[+symbolSize,+symbolSize]),[symbolSize[0]||0,symbolSize[1]||0]}function normalizeSymbolOffset(symbolOffset,symbolSize){if(null!=symbolOffset)return isArray(symbolOffset)||(symbolOffset=[symbolOffset,symbolOffset]),[parsePercent(symbolOffset[0],symbolSize[0])||0,parsePercent(retrieve2(symbolOffset[1],symbolOffset[0]),symbolSize[1])||0]}function isSafeNum(num){return isFinite(num)}function getCanvasGradient(ctx,obj,rect){for(var canvasGradient="radial"===obj.type?function(ctx,obj,rect){var width=rect.width,height=rect.height,min=Math.min(width,height),x=null==obj.x?.5:obj.x,y=null==obj.y?.5:obj.y,r=null==obj.r?.5:obj.r;return obj.global||(x=x*width+rect.x,y=y*height+rect.y,r*=min),x=isSafeNum(x)?x:.5,y=isSafeNum(y)?y:.5,r=r>=0&&isSafeNum(r)?r:.5,ctx.createRadialGradient(x,y,0,x,y,r)}(ctx,obj,rect):function(ctx,obj,rect){var x=null==obj.x?0:obj.x,x2=null==obj.x2?1:obj.x2,y=null==obj.y?0:obj.y,y2=null==obj.y2?0:obj.y2;return obj.global||(x=x*rect.width+rect.x,x2=x2*rect.width+rect.x,y=y*rect.height+rect.y,y2=y2*rect.height+rect.y),x=isSafeNum(x)?x:0,x2=isSafeNum(x2)?x2:1,y=isSafeNum(y)?y:0,y2=isSafeNum(y2)?y2:0,ctx.createLinearGradient(x,y,x2,y2)}(ctx,obj,rect),colorStops=obj.colorStops,i=0;i<colorStops.length;i++)canvasGradient.addColorStop(colorStops[i].offset,colorStops[i].color);return canvasGradient}function parseInt10(val){return parseInt(val,10)}function getSize$1(root,whIdx,opts){var wh=["width","height"][whIdx],cwh=["clientWidth","clientHeight"][whIdx],plt=["paddingLeft","paddingTop"][whIdx],prb=["paddingRight","paddingBottom"][whIdx];if(null!=opts[wh]&&"auto"!==opts[wh])return parseFloat(opts[wh]);var stl=document.defaultView.getComputedStyle(root);return(root[cwh]||parseInt10(stl[wh])||parseInt10(root.style[wh]))-(parseInt10(stl[plt])||0)-(parseInt10(stl[prb])||0)|0}function getLineDash(el){var lineType,lineWidth,style=el.style,lineDash=style.lineDash&&style.lineWidth>0&&(lineType=style.lineDash,lineWidth=style.lineWidth,lineType&&"solid"!==lineType&&lineWidth>0?"dashed"===lineType?[4*lineWidth,2*lineWidth]:"dotted"===lineType?[lineWidth]:isNumber(lineType)?[lineType]:isArray(lineType)?lineType:null:null),lineDashOffset=style.lineDashOffset;if(lineDash){var lineScale_1=style.strokeNoScale&&el.getLineScale?el.getLineScale():1;lineScale_1&&1!==lineScale_1&&(lineDash=map$1(lineDash,(function(rawVal){return rawVal/lineScale_1})),lineDashOffset/=lineScale_1)}return[lineDash,lineDashOffset]}var pathProxyForDraw=new PathProxy$1(!0);function styleHasStroke(style){var stroke=style.stroke;return!(null==stroke||"none"===stroke||!(style.lineWidth>0))}function isValidStrokeFillStyle(strokeOrFill){return"string"==typeof strokeOrFill&&"none"!==strokeOrFill}function styleHasFill(style){var fill=style.fill;return null!=fill&&"none"!==fill}function doFillPath(ctx,style){if(null!=style.fillOpacity&&1!==style.fillOpacity){var originalGlobalAlpha=ctx.globalAlpha;ctx.globalAlpha=style.fillOpacity*style.opacity,ctx.fill(),ctx.globalAlpha=originalGlobalAlpha}else ctx.fill()}function doStrokePath(ctx,style){if(null!=style.strokeOpacity&&1!==style.strokeOpacity){var originalGlobalAlpha=ctx.globalAlpha;ctx.globalAlpha=style.strokeOpacity*style.opacity,ctx.stroke(),ctx.globalAlpha=originalGlobalAlpha}else ctx.stroke()}function createCanvasPattern(ctx,pattern,el){var image=createOrUpdateImage(pattern.image,pattern.__image,el);if(isImageReady(image)){var canvasPattern=ctx.createPattern(image,pattern.repeat||"repeat");if("function"==typeof DOMMatrix&&canvasPattern&&canvasPattern.setTransform){var matrix=new DOMMatrix;matrix.translateSelf(pattern.x||0,pattern.y||0),matrix.rotateSelf(0,0,(pattern.rotation||0)*RADIAN_TO_DEGREE),matrix.scaleSelf(pattern.scaleX||1,pattern.scaleY||1),canvasPattern.setTransform(matrix)}return canvasPattern}}var SHADOW_NUMBER_PROPS=["shadowBlur","shadowOffsetX","shadowOffsetY"],STROKE_PROPS=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function bindCommonProps(ctx,style,prevStyle,forceSetAll,scope){var styleChanged=!1;if(!forceSetAll&&style===(prevStyle=prevStyle||{}))return!1;if(forceSetAll||style.opacity!==prevStyle.opacity){flushPathDrawn(ctx,scope),styleChanged=!0;var opacity=Math.max(Math.min(style.opacity,1),0);ctx.globalAlpha=isNaN(opacity)?DEFAULT_COMMON_STYLE.opacity:opacity}(forceSetAll||style.blend!==prevStyle.blend)&&(styleChanged||(flushPathDrawn(ctx,scope),styleChanged=!0),ctx.globalCompositeOperation=style.blend||DEFAULT_COMMON_STYLE.blend);for(var i=0;i<SHADOW_NUMBER_PROPS.length;i++){var propName=SHADOW_NUMBER_PROPS[i];(forceSetAll||style[propName]!==prevStyle[propName])&&(styleChanged||(flushPathDrawn(ctx,scope),styleChanged=!0),ctx[propName]=ctx.dpr*(style[propName]||0))}return(forceSetAll||style.shadowColor!==prevStyle.shadowColor)&&(styleChanged||(flushPathDrawn(ctx,scope),styleChanged=!0),ctx.shadowColor=style.shadowColor||DEFAULT_COMMON_STYLE.shadowColor),styleChanged}function bindPathAndTextCommonStyle(ctx,el,prevEl,forceSetAll,scope){var style=getStyle(el,scope.inHover),prevStyle=forceSetAll?null:prevEl&&getStyle(prevEl,scope.inHover)||{};if(style===prevStyle)return!1;var styleChanged=bindCommonProps(ctx,style,prevStyle,forceSetAll,scope);if((forceSetAll||style.fill!==prevStyle.fill)&&(styleChanged||(flushPathDrawn(ctx,scope),styleChanged=!0),isValidStrokeFillStyle(style.fill)&&(ctx.fillStyle=style.fill)),(forceSetAll||style.stroke!==prevStyle.stroke)&&(styleChanged||(flushPathDrawn(ctx,scope),styleChanged=!0),isValidStrokeFillStyle(style.stroke)&&(ctx.strokeStyle=style.stroke)),(forceSetAll||style.opacity!==prevStyle.opacity)&&(styleChanged||(flushPathDrawn(ctx,scope),styleChanged=!0),ctx.globalAlpha=null==style.opacity?1:style.opacity),el.hasStroke()){var newLineWidth=style.lineWidth/(style.strokeNoScale&&el.getLineScale?el.getLineScale():1);ctx.lineWidth!==newLineWidth&&(styleChanged||(flushPathDrawn(ctx,scope),styleChanged=!0),ctx.lineWidth=newLineWidth)}for(var i=0;i<STROKE_PROPS.length;i++){var prop=STROKE_PROPS[i],propName=prop[0];(forceSetAll||style[propName]!==prevStyle[propName])&&(styleChanged||(flushPathDrawn(ctx,scope),styleChanged=!0),ctx[propName]=style[propName]||prop[1])}return styleChanged}function setContextTransform(ctx,el){var m=el.transform,dpr=ctx.dpr||1;m?ctx.setTransform(dpr*m[0],dpr*m[1],dpr*m[2],dpr*m[3],dpr*m[4],dpr*m[5]):ctx.setTransform(dpr,0,0,dpr,0,0)}function flushPathDrawn(ctx,scope){scope.batchFill&&ctx.fill(),scope.batchStroke&&ctx.stroke(),scope.batchFill="",scope.batchStroke=""}function getStyle(el,inHover){return inHover&&el.__hoverStyle||el.style}function brushSingle(ctx,el){brush(ctx,el,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function brush(ctx,el,scope,isLast){var m=el.transform;if(!el.shouldBePainted(scope.viewWidth,scope.viewHeight,!1,!1))return el.__dirty&=-2,void(el.__isRendered=!1);var clipPaths=el.__clipPaths,prevElClipPaths=scope.prevElClipPaths,forceSetTransform=!1,forceSetStyle=!1;if(prevElClipPaths&&!function(clipPaths,prevClipPaths){if(clipPaths===prevClipPaths||!clipPaths&&!prevClipPaths)return!1;if(!clipPaths||!prevClipPaths||clipPaths.length!==prevClipPaths.length)return!0;for(var i=0;i<clipPaths.length;i++)if(clipPaths[i]!==prevClipPaths[i])return!0;return!1}(clipPaths,prevElClipPaths)||(prevElClipPaths&&prevElClipPaths.length&&(flushPathDrawn(ctx,scope),ctx.restore(),forceSetStyle=forceSetTransform=!0,scope.prevElClipPaths=null,scope.allClipped=!1,scope.prevEl=null),clipPaths&&clipPaths.length&&(flushPathDrawn(ctx,scope),ctx.save(),function(clipPaths,ctx,scope){for(var allClipped=!1,i=0;i<clipPaths.length;i++){var clipPath=clipPaths[i];allClipped=allClipped||clipPath.isZeroArea(),setContextTransform(ctx,clipPath),ctx.beginPath(),clipPath.buildPath(ctx,clipPath.shape),ctx.clip()}scope.allClipped=allClipped}(clipPaths,ctx,scope),forceSetTransform=!0),scope.prevElClipPaths=clipPaths),scope.allClipped)el.__isRendered=!1;else{el.beforeBrush&&el.beforeBrush(),el.innerBeforeBrush();var prevEl=scope.prevEl;prevEl||(forceSetStyle=forceSetTransform=!0);var m0,m1,canBatchPath=el instanceof Path$1&&el.autoBatch&&function(style){var hasFill=styleHasFill(style),hasStroke=styleHasStroke(style);return!(style.lineDash||!(+hasFill^+hasStroke)||hasFill&&"string"!=typeof style.fill||hasStroke&&"string"!=typeof style.stroke||style.strokePercent<1||style.strokeOpacity<1||style.fillOpacity<1)}(el.style);forceSetTransform||(m0=m,m1=prevEl.transform,m0&&m1?m0[0]!==m1[0]||m0[1]!==m1[1]||m0[2]!==m1[2]||m0[3]!==m1[3]||m0[4]!==m1[4]||m0[5]!==m1[5]:m0||m1)?(flushPathDrawn(ctx,scope),setContextTransform(ctx,el)):canBatchPath||flushPathDrawn(ctx,scope);var style=getStyle(el,scope.inHover);el instanceof Path$1?(1!==scope.lastDrawType&&(forceSetStyle=!0,scope.lastDrawType=1),bindPathAndTextCommonStyle(ctx,el,prevEl,forceSetStyle,scope),canBatchPath&&(scope.batchFill||scope.batchStroke)||ctx.beginPath(),function(ctx,el,style,inBatch){var _a,hasStroke=styleHasStroke(style),hasFill=styleHasFill(style),strokePercent=style.strokePercent,strokePart=strokePercent<1,firstDraw=!el.path;el.silent&&!strokePart||!firstDraw||el.createPathProxy();var path=el.path||pathProxyForDraw,dirtyFlag=el.__dirty;if(!inBatch){var fill=style.fill,stroke=style.stroke,hasFillGradient=hasFill&&!!fill.colorStops,hasStrokeGradient=hasStroke&&!!stroke.colorStops,hasFillPattern=hasFill&&!!fill.image,hasStrokePattern=hasStroke&&!!stroke.image,fillGradient=void 0,strokeGradient=void 0,fillPattern=void 0,strokePattern=void 0,rect=void 0;(hasFillGradient||hasStrokeGradient)&&(rect=el.getBoundingRect()),hasFillGradient&&(fillGradient=dirtyFlag?getCanvasGradient(ctx,fill,rect):el.__canvasFillGradient,el.__canvasFillGradient=fillGradient),hasStrokeGradient&&(strokeGradient=dirtyFlag?getCanvasGradient(ctx,stroke,rect):el.__canvasStrokeGradient,el.__canvasStrokeGradient=strokeGradient),hasFillPattern&&(fillPattern=dirtyFlag||!el.__canvasFillPattern?createCanvasPattern(ctx,fill,el):el.__canvasFillPattern,el.__canvasFillPattern=fillPattern),hasStrokePattern&&(strokePattern=dirtyFlag||!el.__canvasStrokePattern?createCanvasPattern(ctx,stroke,el):el.__canvasStrokePattern,el.__canvasStrokePattern=fillPattern),hasFillGradient?ctx.fillStyle=fillGradient:hasFillPattern&&(fillPattern?ctx.fillStyle=fillPattern:hasFill=!1),hasStrokeGradient?ctx.strokeStyle=strokeGradient:hasStrokePattern&&(strokePattern?ctx.strokeStyle=strokePattern:hasStroke=!1)}var lineDash,lineDashOffset,scale=el.getGlobalScale();path.setScale(scale[0],scale[1],el.segmentIgnoreThreshold),ctx.setLineDash&&style.lineDash&&(lineDash=(_a=getLineDash(el))[0],lineDashOffset=_a[1]);var needsRebuild=!0;(firstDraw||4&dirtyFlag)&&(path.setDPR(ctx.dpr),strokePart?path.setContext(null):(path.setContext(ctx),needsRebuild=!1),path.reset(),el.buildPath(path,el.shape,inBatch),path.toStatic(),el.pathUpdated()),needsRebuild&&path.rebuildPath(ctx,strokePart?strokePercent:1),lineDash&&(ctx.setLineDash(lineDash),ctx.lineDashOffset=lineDashOffset),inBatch||(style.strokeFirst?(hasStroke&&doStrokePath(ctx,style),hasFill&&doFillPath(ctx,style)):(hasFill&&doFillPath(ctx,style),hasStroke&&doStrokePath(ctx,style))),lineDash&&ctx.setLineDash([])}(ctx,el,style,canBatchPath),canBatchPath&&(scope.batchFill=style.fill||"",scope.batchStroke=style.stroke||"")):el instanceof TSpan$1?(3!==scope.lastDrawType&&(forceSetStyle=!0,scope.lastDrawType=3),bindPathAndTextCommonStyle(ctx,el,prevEl,forceSetStyle,scope),function(ctx,el,style){var _a,text=style.text;if(null!=text&&(text+=""),text){ctx.font=style.font||DEFAULT_FONT,ctx.textAlign=style.textAlign,ctx.textBaseline=style.textBaseline;var lineDash=void 0,lineDashOffset=void 0;ctx.setLineDash&&style.lineDash&&(lineDash=(_a=getLineDash(el))[0],lineDashOffset=_a[1]),lineDash&&(ctx.setLineDash(lineDash),ctx.lineDashOffset=lineDashOffset),style.strokeFirst?(styleHasStroke(style)&&ctx.strokeText(text,style.x,style.y),styleHasFill(style)&&ctx.fillText(text,style.x,style.y)):(styleHasFill(style)&&ctx.fillText(text,style.x,style.y),styleHasStroke(style)&&ctx.strokeText(text,style.x,style.y)),lineDash&&ctx.setLineDash([])}}(ctx,el,style)):el instanceof ZRImage$1?(2!==scope.lastDrawType&&(forceSetStyle=!0,scope.lastDrawType=2),function(ctx,el,prevEl,forceSetAll,scope){bindCommonProps(ctx,getStyle(el,scope.inHover),prevEl&&getStyle(prevEl,scope.inHover),forceSetAll,scope)}(ctx,el,prevEl,forceSetStyle,scope),function(ctx,el,style){var image=el.__image=createOrUpdateImage(style.image,el.__image,el,el.onload);if(image&&isImageReady(image)){var x=style.x||0,y=style.y||0,width=el.getWidth(),height=el.getHeight(),aspect=image.width/image.height;if(null==width&&null!=height?width=height*aspect:null==height&&null!=width?height=width/aspect:null==width&&null==height&&(width=image.width,height=image.height),style.sWidth&&style.sHeight){var sx=style.sx||0,sy=style.sy||0;ctx.drawImage(image,sx,sy,style.sWidth,style.sHeight,x,y,width,height)}else if(style.sx&&style.sy){var sWidth=width-(sx=style.sx),sHeight=height-(sy=style.sy);ctx.drawImage(image,sx,sy,sWidth,sHeight,x,y,width,height)}else ctx.drawImage(image,x,y,width,height)}}(ctx,el,style)):el.getTemporalDisplayables&&(4!==scope.lastDrawType&&(forceSetStyle=!0,scope.lastDrawType=4),function(ctx,el,scope){var displayables=el.getDisplayables(),temporalDisplayables=el.getTemporalDisplayables();ctx.save();var i,len,innerScope={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:scope.viewWidth,viewHeight:scope.viewHeight,inHover:scope.inHover};for(i=el.getCursor(),len=displayables.length;i<len;i++){(displayable=displayables[i]).beforeBrush&&displayable.beforeBrush(),displayable.innerBeforeBrush(),brush(ctx,displayable,innerScope,i===len-1),displayable.innerAfterBrush(),displayable.afterBrush&&displayable.afterBrush(),innerScope.prevEl=displayable}for(var i_1=0,len_1=temporalDisplayables.length;i_1<len_1;i_1++){var displayable;(displayable=temporalDisplayables[i_1]).beforeBrush&&displayable.beforeBrush(),displayable.innerBeforeBrush(),brush(ctx,displayable,innerScope,i_1===len_1-1),displayable.innerAfterBrush(),displayable.afterBrush&&displayable.afterBrush(),innerScope.prevEl=displayable}el.clearTemporalDisplayables(),el.notClear=!0,ctx.restore()}(ctx,el,scope)),canBatchPath&&isLast&&flushPathDrawn(ctx,scope),el.innerAfterBrush(),el.afterBrush&&el.afterBrush(),scope.prevEl=el,el.__dirty=0,el.__isRendered=!0}}var decalMap=new WeakMap$1,decalCache=new LRU$1(100),decalKeys=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function createOrUpdatePatternFromDecal(decalObject,api){if("none"===decalObject)return null;var dpr=api.getDevicePixelRatio(),zr=api.getZr(),isSVG="svg"===zr.painter.type;decalObject.dirty&&decalMap.delete(decalObject);var oldPattern=decalMap.get(decalObject);if(oldPattern)return oldPattern;var decalOpt=defaults(decalObject,{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});"none"===decalOpt.backgroundColor&&(decalOpt.backgroundColor=null);var pattern={repeat:"repeat"};return function(pattern){for(var cacheKey,keys=[dpr],isValidKey=!0,i=0;i<decalKeys.length;++i){var value=decalOpt[decalKeys[i]];if(null!=value&&!isArray(value)&&!isString(value)&&!isNumber(value)&&"boolean"!=typeof value){isValidKey=!1;break}keys.push(value)}if(isValidKey){cacheKey=keys.join(",")+(isSVG?"-svg":"");var cache=decalCache.get(cacheKey);cache&&(isSVG?pattern.svgElement=cache:pattern.image=cache)}var ctx,dashArrayX=normalizeDashArrayX(decalOpt.dashArrayX),dashArrayY=function(dash){if(!dash||"object"==typeof dash&&0===dash.length)return[0,0];if(isNumber(dash)){var dashValue_1=Math.ceil(dash);return[dashValue_1,dashValue_1]}var dashValue=map$1(dash,(function(n){return Math.ceil(n)}));return dash.length%2?dashValue.concat(dashValue):dashValue}(decalOpt.dashArrayY),symbolArray=normalizeSymbolArray(decalOpt.symbol),lineBlockLengthsX=(dash=dashArrayX,map$1(dash,(function(line){return getLineBlockLengthY(line)}))),lineBlockLengthY=getLineBlockLengthY(dashArrayY),canvas=!isSVG&&platformApi.createCanvas(),svgRoot=isSVG&&{tag:"g",attrs:{},key:"dcl",children:[]},pSize=function(){for(var width=1,i=0,xlen=lineBlockLengthsX.length;i<xlen;++i)width=getLeastCommonMultiple(width,lineBlockLengthsX[i]);var symbolRepeats=1;for(i=0,xlen=symbolArray.length;i<xlen;++i)symbolRepeats=getLeastCommonMultiple(symbolRepeats,symbolArray[i].length);width*=symbolRepeats;var height=lineBlockLengthY*lineBlockLengthsX.length*symbolArray.length;if("production"!==process.env.NODE_ENV){var warn=function(attrName){console.warn("Calculated decal size is greater than "+attrName+" due to decal option settings so "+attrName+" is used for the decal size. Please consider changing the decal option to make a smaller decal or set "+attrName+" to be larger to avoid incontinuity.")};width>decalOpt.maxTileWidth&&warn("maxTileWidth"),height>decalOpt.maxTileHeight&&warn("maxTileHeight")}return{width:Math.max(1,Math.min(width,decalOpt.maxTileWidth)),height:Math.max(1,Math.min(height,decalOpt.maxTileHeight))}}();var dash;canvas&&(canvas.width=pSize.width*dpr,canvas.height=pSize.height*dpr,ctx=canvas.getContext("2d"));(function(){ctx&&(ctx.clearRect(0,0,canvas.width,canvas.height),decalOpt.backgroundColor&&(ctx.fillStyle=decalOpt.backgroundColor,ctx.fillRect(0,0,canvas.width,canvas.height)));for(var ySum=0,i=0;i<dashArrayY.length;++i)ySum+=dashArrayY[i];if(ySum<=0)return;var y=-lineBlockLengthY,yId=0,yIdTotal=0,xId0=0;for(;y<pSize.height;){if(yId%2==0){for(var symbolYId=yIdTotal/2%symbolArray.length,x=0,xId1=0,xId1Total=0;x<2*pSize.width;){var xSum=0;for(i=0;i<dashArrayX[xId0].length;++i)xSum+=dashArrayX[xId0][i];if(xSum<=0)break;if(xId1%2==0){var size=.5*(1-decalOpt.symbolSize),left=x+dashArrayX[xId0][xId1]*size,top_1=y+dashArrayY[yId]*size,width=dashArrayX[xId0][xId1]*decalOpt.symbolSize,height=dashArrayY[yId]*decalOpt.symbolSize,symbolXId=xId1Total/2%symbolArray[symbolYId].length;brushSymbol(left,top_1,width,height,symbolArray[symbolYId][symbolXId])}x+=dashArrayX[xId0][xId1],++xId1Total,++xId1===dashArrayX[xId0].length&&(xId1=0)}++xId0===dashArrayX.length&&(xId0=0)}y+=dashArrayY[yId],++yIdTotal,++yId===dashArrayY.length&&(yId=0)}function brushSymbol(x,y,width,height,symbolType){var scale=isSVG?1:dpr,symbol=createSymbol$1(symbolType,x*scale,y*scale,width*scale,height*scale,decalOpt.color,decalOpt.symbolKeepAspect);if(isSVG){var symbolVNode=zr.painter.renderOneToVNode(symbol);symbolVNode&&svgRoot.children.push(symbolVNode)}else brushSingle(ctx,symbol)}})(),isValidKey&&decalCache.put(cacheKey,canvas||svgRoot);pattern.image=canvas,pattern.svgElement=svgRoot,pattern.svgWidth=pSize.width,pattern.svgHeight=pSize.height}(pattern),pattern.rotation=decalOpt.rotation,pattern.scaleX=pattern.scaleY=isSVG?1:1/dpr,decalMap.set(decalObject,pattern),decalObject.dirty=!1,pattern}function normalizeSymbolArray(symbol){if(!symbol||0===symbol.length)return[["rect"]];if(isString(symbol))return[[symbol]];for(var isAllString=!0,i=0;i<symbol.length;++i)if(!isString(symbol[i])){isAllString=!1;break}if(isAllString)return normalizeSymbolArray([symbol]);var result=[];for(i=0;i<symbol.length;++i)isString(symbol[i])?result.push([symbol[i]]):result.push(symbol[i]);return result}function normalizeDashArrayX(dash){if(!dash||0===dash.length)return[[0,0]];if(isNumber(dash))return[[dashValue=Math.ceil(dash),dashValue]];for(var isAllNumber=!0,i=0;i<dash.length;++i)if(!isNumber(dash[i])){isAllNumber=!1;break}if(isAllNumber)return normalizeDashArrayX([dash]);var result=[];for(i=0;i<dash.length;++i)if(isNumber(dash[i])){var dashValue=Math.ceil(dash[i]);result.push([dashValue,dashValue])}else{(dashValue=map$1(dash[i],(function(n){return Math.ceil(n)}))).length%2==1?result.push(dashValue.concat(dashValue)):result.push(dashValue)}return result}function getLineBlockLengthY(dash){for(var blockLength=0,i=0;i<dash.length;++i)blockLength+=dash[i];return dash.length%2==1?2*blockLength:blockLength}var lifecycle$1=new Eventful$1,implsStore={};var PRIORITY={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:4500,ARIA:6e3,DECAL:7e3}},PENDING_UPDATE="__pendingUpdate",ACTION_REG=/^[a-zA-Z0-9_]+$/;function createRegisterEventWithLowercaseECharts(method){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];if(!this.isDisposed())return toLowercaseNameAndCallEventful(this,method,args);disposedWarning(this.id)}}function createRegisterEventWithLowercaseMessageCenter(method){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return toLowercaseNameAndCallEventful(this,method,args)}}function toLowercaseNameAndCallEventful(host,method,args){return args[0]=args[0]&&args[0].toLowerCase(),Eventful$1.prototype[method].apply(host,args)}var prepare,prepareView,updateDirectly,updateMethods,doConvertPixel,updateStreamModes,doDispatchAction,flushPendingActions,triggerUpdatedEvent,bindRenderedEvent,bindMouseEvent,render,renderComponents,renderSeries,createExtensionAPI,enableConnect,markStatusToUpdate,applyChangedStates,MessageCenter=function(_super){function MessageCenter(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(MessageCenter,_super),MessageCenter}(Eventful$1),messageCenterProto=MessageCenter.prototype;messageCenterProto.on=createRegisterEventWithLowercaseMessageCenter("on"),messageCenterProto.off=createRegisterEventWithLowercaseMessageCenter("off");var ECharts=function(_super){function ECharts(dom,theme,opts){var _this=_super.call(this,new ECEventProcessor)||this;_this._chartsViews=[],_this._chartsMap={},_this._componentsViews=[],_this._componentsMap={},_this._pendingActions=[],opts=opts||{},isString(theme)&&(theme=themeStorage[theme]),_this._dom=dom;var defaultRenderer="canvas",defaultCoarsePointer="auto",defaultUseDirtyRect=!1;if("production"!==process.env.NODE_ENV){var root=env$1.hasGlobalWindow?window:global;root&&(defaultRenderer=retrieve2(root.__ECHARTS__DEFAULT__RENDERER__,defaultRenderer),defaultCoarsePointer=retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER,defaultCoarsePointer),defaultUseDirtyRect=retrieve2(root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__,defaultUseDirtyRect))}opts.ssr;var zr=_this._zr=init$2(dom,{renderer:opts.renderer||defaultRenderer,devicePixelRatio:opts.devicePixelRatio,width:opts.width,height:opts.height,ssr:opts.ssr,useDirtyRect:retrieve2(opts.useDirtyRect,defaultUseDirtyRect),useCoarsePointer:retrieve2(opts.useCoarsePointer,defaultCoarsePointer),pointerSize:opts.pointerSize});_this._ssr=opts.ssr,_this._throttledZrFlush=throttle(bind$1(zr.flush,zr),17),(theme=clone$3(theme))&&globalBackwardCompat(theme,!0),_this._theme=theme,_this._locale=function(locale){if(isString(locale)){var localeObj=localeStorage[locale.toUpperCase()]||{};return"ZH"===locale||"EN"===locale?clone$3(localeObj):merge(clone$3(localeObj),clone$3(localeStorage.EN),!1)}return merge(clone$3(locale),clone$3(localeStorage.EN),!1)}(opts.locale||SYSTEM_LANG),_this._coordSysMgr=new CoordinateSystem;var api=_this._api=createExtensionAPI(_this);function prioritySortFunc(a,b){return a.__prio-b.__prio}return sort$2(visualFuncs,prioritySortFunc),sort$2(dataProcessorFuncs,prioritySortFunc),_this._scheduler=new Scheduler$1(_this,api,dataProcessorFuncs,visualFuncs),_this._messageCenter=new MessageCenter,_this._initEvents(),_this.resize=bind$1(_this.resize,_this),zr.animation.on("frame",_this._onframe,_this),bindRenderedEvent(zr,_this),bindMouseEvent(zr,_this),setAsPrimitive(_this),_this}return __extends(ECharts,_super),ECharts.prototype._onframe=function(){if(!this._disposed){applyChangedStates(this);var scheduler=this._scheduler;if(this[PENDING_UPDATE]){var silent=this[PENDING_UPDATE].silent;this.__flagInMainProcess=!0;try{prepare(this),updateMethods.update.call(this,null,this[PENDING_UPDATE].updateParams)}catch(e){throw this.__flagInMainProcess=!1,this[PENDING_UPDATE]=null,e}this._zr.flush(),this.__flagInMainProcess=!1,this[PENDING_UPDATE]=null,flushPendingActions.call(this,silent),triggerUpdatedEvent.call(this,silent)}else if(scheduler.unfinished){var remainTime=1,ecModel=this._model,api=this._api;scheduler.unfinished=!1;do{var startTime=+new Date;scheduler.performSeriesTasks(ecModel),scheduler.performDataProcessorTasks(ecModel),updateStreamModes(this,ecModel),scheduler.performVisualTasks(ecModel),renderSeries(this,this._model,api,"remain",{}),remainTime-=+new Date-startTime}while(remainTime>0&&scheduler.unfinished);scheduler.unfinished||this._zr.flush()}}},ECharts.prototype.getDom=function(){return this._dom},ECharts.prototype.getId=function(){return this.id},ECharts.prototype.getZr=function(){return this._zr},ECharts.prototype.isSSR=function(){return this._ssr},ECharts.prototype.setOption=function(option,notMerge,lazyUpdate){if(this.__flagInMainProcess)"production"!==process.env.NODE_ENV&&error("`setOption` should not be called during main process.");else if(this._disposed)disposedWarning(this.id);else{var silent,replaceMerge,transitionOpt;if(isObject$3(notMerge)&&(lazyUpdate=notMerge.lazyUpdate,silent=notMerge.silent,replaceMerge=notMerge.replaceMerge,transitionOpt=notMerge.transition,notMerge=notMerge.notMerge),this.__flagInMainProcess=!0,!this._model||notMerge){var optionManager=new OptionManager$1(this._api),theme=this._theme,ecModel=this._model=new GlobalModel$1;ecModel.scheduler=this._scheduler,ecModel.ssr=this._ssr,ecModel.init(null,null,null,theme,this._locale,optionManager)}this._model.setOption(option,{replaceMerge:replaceMerge},optionPreprocessorFuncs);var updateParams={seriesTransition:transitionOpt,optionChanged:!0};if(lazyUpdate)this[PENDING_UPDATE]={silent:silent,updateParams:updateParams},this.__flagInMainProcess=!1,this.getZr().wakeUp();else{try{prepare(this),updateMethods.update.call(this,null,updateParams)}catch(e){throw this[PENDING_UPDATE]=null,this.__flagInMainProcess=!1,e}this._ssr||this._zr.flush(),this[PENDING_UPDATE]=null,this.__flagInMainProcess=!1,flushPendingActions.call(this,silent),triggerUpdatedEvent.call(this,silent)}}},ECharts.prototype.setTheme=function(){deprecateLog("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},ECharts.prototype.getModel=function(){return this._model},ECharts.prototype.getOption=function(){return this._model&&this._model.getOption()},ECharts.prototype.getWidth=function(){return this._zr.getWidth()},ECharts.prototype.getHeight=function(){return this._zr.getHeight()},ECharts.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||env$1.hasGlobalWindow&&window.devicePixelRatio||1},ECharts.prototype.getRenderedCanvas=function(opts){return"production"!==process.env.NODE_ENV&&deprecateReplaceLog("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(opts)},ECharts.prototype.renderToCanvas=function(opts){opts=opts||{};var painter=this._zr.painter;if("production"!==process.env.NODE_ENV&&"canvas"!==painter.type)throw new Error("renderToCanvas can only be used in the canvas renderer.");return painter.getRenderedCanvas({backgroundColor:opts.backgroundColor||this._model.get("backgroundColor"),pixelRatio:opts.pixelRatio||this.getDevicePixelRatio()})},ECharts.prototype.renderToSVGString=function(opts){opts=opts||{};var painter=this._zr.painter;if("production"!==process.env.NODE_ENV&&"svg"!==painter.type)throw new Error("renderToSVGString can only be used in the svg renderer.");return painter.renderToString({useViewBox:opts.useViewBox})},ECharts.prototype.getSvgDataURL=function(){if(env$1.svgSupported){var zr=this._zr;return each$b(zr.storage.getDisplayList(),(function(el){el.stopAnimation(null,!0)})),zr.painter.toDataURL()}},ECharts.prototype.getDataURL=function(opts){if(!this._disposed){var excludeComponents=(opts=opts||{}).excludeComponents,ecModel=this._model,excludesComponentViews=[],self=this;each$b(excludeComponents,(function(componentType){ecModel.eachComponent({mainType:componentType},(function(component){var view=self._componentsMap[component.__viewId];view.group.ignore||(excludesComponentViews.push(view),view.group.ignore=!0)}))}));var url="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(opts).toDataURL("image/"+(opts&&opts.type||"png"));return each$b(excludesComponentViews,(function(view){view.group.ignore=!1})),url}disposedWarning(this.id)},ECharts.prototype.getConnectedDataURL=function(opts){if(!this._disposed){var isSvg="svg"===opts.type,groupId=this.group,mathMin=Math.min,mathMax=Math.max;if(connectedGroups[groupId]){var left_1=Infinity,top_1=Infinity,right_1=-Infinity,bottom_1=-Infinity,canvasList_1=[],dpr_1=opts&&opts.pixelRatio||this.getDevicePixelRatio();each$b(instances,(function(chart,id){if(chart.group===groupId){var canvas=isSvg?chart.getZr().painter.getSvgDom().innerHTML:chart.renderToCanvas(clone$3(opts)),boundingRect=chart.getDom().getBoundingClientRect();left_1=mathMin(boundingRect.left,left_1),top_1=mathMin(boundingRect.top,top_1),right_1=mathMax(boundingRect.right,right_1),bottom_1=mathMax(boundingRect.bottom,bottom_1),canvasList_1.push({dom:canvas,left:boundingRect.left,top:boundingRect.top})}}));var width=(right_1*=dpr_1)-(left_1*=dpr_1),height=(bottom_1*=dpr_1)-(top_1*=dpr_1),targetCanvas=platformApi.createCanvas(),zr_1=init$2(targetCanvas,{renderer:isSvg?"svg":"canvas"});if(zr_1.resize({width:width,height:height}),isSvg){var content_1="";return each$b(canvasList_1,(function(item){var x=item.left-left_1,y=item.top-top_1;content_1+='<g transform="translate('+x+","+y+')">'+item.dom+"</g>"})),zr_1.painter.getSvgRoot().innerHTML=content_1,opts.connectedBackgroundColor&&zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor),zr_1.refreshImmediately(),zr_1.painter.toDataURL()}return opts.connectedBackgroundColor&&zr_1.add(new Rect$4({shape:{x:0,y:0,width:width,height:height},style:{fill:opts.connectedBackgroundColor}})),each$b(canvasList_1,(function(item){var img=new ZRImage$1({style:{x:item.left*dpr_1-left_1,y:item.top*dpr_1-top_1,image:item.dom}});zr_1.add(img)})),zr_1.refreshImmediately(),targetCanvas.toDataURL("image/"+(opts&&opts.type||"png"))}return this.getDataURL(opts)}disposedWarning(this.id)},ECharts.prototype.convertToPixel=function(finder,value){return doConvertPixel(this,"convertToPixel",finder,value)},ECharts.prototype.convertFromPixel=function(finder,value){return doConvertPixel(this,"convertFromPixel",finder,value)},ECharts.prototype.containPixel=function(finder,value){var result;if(!this._disposed)return each$b(parseFinder$1(this._model,finder),(function(models,key){key.indexOf("Models")>=0&&each$b(models,(function(model){var coordSys=model.coordinateSystem;if(coordSys&&coordSys.containPoint)result=result||!!coordSys.containPoint(value);else if("seriesModels"===key){var view=this._chartsMap[model.__viewId];view&&view.containPoint?result=result||view.containPoint(value,model):"production"!==process.env.NODE_ENV&&warn(key+": "+(view?"The found component do not support containPoint.":"No view mapping to the found component."))}else"production"!==process.env.NODE_ENV&&warn(key+": containPoint is not supported")}),this)}),this),!!result;disposedWarning(this.id)},ECharts.prototype.getVisual=function(finder,visualType){var parsedFinder=parseFinder$1(this._model,finder,{defaultMainType:"series"}),seriesModel=parsedFinder.seriesModel;"production"!==process.env.NODE_ENV&&(seriesModel||warn("There is no specified series model"));var data=seriesModel.getData(),dataIndexInside=parsedFinder.hasOwnProperty("dataIndexInside")?parsedFinder.dataIndexInside:parsedFinder.hasOwnProperty("dataIndex")?data.indexOfRawIndex(parsedFinder.dataIndex):null;return null!=dataIndexInside?function(data,dataIndex,key){switch(key){case"color":return data.getItemVisual(dataIndex,"style")[data.getVisual("drawType")];case"opacity":return data.getItemVisual(dataIndex,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return data.getItemVisual(dataIndex,key);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+key)}}(data,dataIndexInside,visualType):getVisualFromData(data,visualType)},ECharts.prototype.getViewOfComponentModel=function(componentModel){return this._componentsMap[componentModel.__viewId]},ECharts.prototype.getViewOfSeriesModel=function(seriesModel){return this._chartsMap[seriesModel.__viewId]},ECharts.prototype._initEvents=function(){var messageCenter,ecIns,api,_this=this;each$b(MOUSE_EVENT_NAMES,(function(eveName){var handler=function(e){var params,ecModel=_this.getModel(),el=e.target,isGlobalOut="globalout"===eveName;if(isGlobalOut?params={}:el&&findEventDispatcher(el,(function(parent){var ecData=getECData(parent);if(ecData&&null!=ecData.dataIndex){var dataModel=ecData.dataModel||ecModel.getSeriesByIndex(ecData.seriesIndex);return params=dataModel&&dataModel.getDataParams(ecData.dataIndex,ecData.dataType,el)||{},!0}if(ecData.eventData)return params=extend({},ecData.eventData),!0}),!0),params){var componentType=params.componentType,componentIndex=params.componentIndex;"markLine"!==componentType&&"markPoint"!==componentType&&"markArea"!==componentType||(componentType="series",componentIndex=params.seriesIndex);var model=componentType&&null!=componentIndex&&ecModel.getComponent(componentType,componentIndex),view=model&&_this["series"===model.mainType?"_chartsMap":"_componentsMap"][model.__viewId];"production"!==process.env.NODE_ENV&&(isGlobalOut||model&&view||warn("model or view can not be found by params")),params.event=e,params.type=eveName,_this._$eventProcessor.eventInfo={targetEl:el,packedEvent:params,model:model,view:view},_this.trigger(eveName,params)}};handler.zrEventfulCallAtLast=!0,_this._zr.on(eveName,handler,_this)})),each$b(eventActionMap,(function(actionType,eventType){_this._messageCenter.on(eventType,(function(event){this.trigger(eventType,event)}),_this)})),each$b(["selectchanged"],(function(eventType){_this._messageCenter.on(eventType,(function(event){this.trigger(eventType,event)}),_this)})),messageCenter=this._messageCenter,ecIns=this,api=this._api,messageCenter.on("selectchanged",(function(params){var ecModel=api.getModel();params.isFromClick?(handleSeriesLegacySelectEvents("map","selectchanged",ecIns,ecModel,params),handleSeriesLegacySelectEvents("pie","selectchanged",ecIns,ecModel,params)):"select"===params.fromAction?(handleSeriesLegacySelectEvents("map","selected",ecIns,ecModel,params),handleSeriesLegacySelectEvents("pie","selected",ecIns,ecModel,params)):"unselect"===params.fromAction&&(handleSeriesLegacySelectEvents("map","unselected",ecIns,ecModel,params),handleSeriesLegacySelectEvents("pie","unselected",ecIns,ecModel,params))}))},ECharts.prototype.isDisposed=function(){return this._disposed},ECharts.prototype.clear=function(){this._disposed?disposedWarning(this.id):this.setOption({series:[]},!0)},ECharts.prototype.dispose=function(){if(this._disposed)disposedWarning(this.id);else{this._disposed=!0,this.getDom()&&setAttribute(this.getDom(),DOM_ATTRIBUTE_KEY,"");var api=this._api,ecModel=this._model;each$b(this._componentsViews,(function(component){component.dispose(ecModel,api)})),each$b(this._chartsViews,(function(chart){chart.dispose(ecModel,api)})),this._zr.dispose(),this._dom=this._model=this._chartsMap=this._componentsMap=this._chartsViews=this._componentsViews=this._scheduler=this._api=this._zr=this._throttledZrFlush=this._theme=this._coordSysMgr=this._messageCenter=null,delete instances[this.id]}},ECharts.prototype.resize=function(opts){if(this.__flagInMainProcess)"production"!==process.env.NODE_ENV&&error("`resize` should not be called during main process.");else if(this._disposed)disposedWarning(this.id);else{this._zr.resize(opts);var ecModel=this._model;if(this._loadingFX&&this._loadingFX.resize(),ecModel){var needPrepare=ecModel.resetOption("media"),silent=opts&&opts.silent;this[PENDING_UPDATE]&&(null==silent&&(silent=this[PENDING_UPDATE].silent),needPrepare=!0,this[PENDING_UPDATE]=null),this.__flagInMainProcess=!0;try{needPrepare&&prepare(this),updateMethods.update.call(this,{type:"resize",animation:extend({duration:0},opts&&opts.animation)})}catch(e){throw this.__flagInMainProcess=!1,e}this.__flagInMainProcess=!1,flushPendingActions.call(this,silent),triggerUpdatedEvent.call(this,silent)}}},ECharts.prototype.showLoading=function(name,cfg){if(this._disposed)disposedWarning(this.id);else if(isObject$3(name)&&(cfg=name,name=""),name=name||"default",this.hideLoading(),loadingEffects[name]){var el=loadingEffects[name](this._api,cfg),zr=this._zr;this._loadingFX=el,zr.add(el)}else"production"!==process.env.NODE_ENV&&warn("Loading effects "+name+" not exists.")},ECharts.prototype.hideLoading=function(){this._disposed?disposedWarning(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},ECharts.prototype.makeActionFromEvent=function(eventObj){var payload=extend({},eventObj);return payload.type=eventActionMap[eventObj.type],payload},ECharts.prototype.dispatchAction=function(payload,opt){if(this._disposed)disposedWarning(this.id);else if(isObject$3(opt)||(opt={silent:!!opt}),actions[payload.type]&&this._model)if(this.__flagInMainProcess)this._pendingActions.push(payload);else{var silent=opt.silent;doDispatchAction.call(this,payload,silent);var flush=opt.flush;flush?this._zr.flush():!1!==flush&&env$1.browser.weChat&&this._throttledZrFlush(),flushPendingActions.call(this,silent),triggerUpdatedEvent.call(this,silent)}},ECharts.prototype.updateLabelLayout=function(){lifecycle$1.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},ECharts.prototype.appendData=function(params){if(this._disposed)disposedWarning(this.id);else{var seriesIndex=params.seriesIndex,seriesModel=this.getModel().getSeriesByIndex(seriesIndex);"production"!==process.env.NODE_ENV&&assert(params.data&&seriesModel),seriesModel.appendData(params),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},ECharts.internalField=function(){function clearColorPalette(ecModel){ecModel.clearColorPalette(),ecModel.eachSeries((function(seriesModel){seriesModel.clearColorPalette()}))}function applyElementStates(el){for(var newStates=[],oldStates=el.currentStates,i=0;i<oldStates.length;i++){var stateName=oldStates[i];"emphasis"!==stateName&&"blur"!==stateName&&"select"!==stateName&&newStates.push(stateName)}el.selected&&el.states.select&&newStates.push("select"),2===el.hoverState&&el.states.emphasis?newStates.push("emphasis"):1===el.hoverState&&el.states.blur&&newStates.push("blur"),el.useStates(newStates)}function updateZ(model,view){if(!model.preventAutoZ){var z=model.get("z")||0,zlevel=model.get("zlevel")||0;view.eachRendered((function(el){return doUpdateZ(el,z,zlevel,-1/0),!0}))}}function doUpdateZ(el,z,zlevel,maxZ2){var label=el.getTextContent(),labelLine=el.getTextGuideLine();if(el.isGroup)for(var children=el.childrenRef(),i=0;i<children.length;i++)maxZ2=Math.max(doUpdateZ(children[i],z,zlevel,maxZ2),maxZ2);else el.z=z,el.zlevel=zlevel,maxZ2=Math.max(el.z2,maxZ2);if(label&&(label.z=z,label.zlevel=zlevel,isFinite(maxZ2)&&(label.z2=maxZ2+2)),labelLine){var textGuideLineConfig=el.textGuideLineConfig;labelLine.z=z,labelLine.zlevel=zlevel,isFinite(maxZ2)&&(labelLine.z2=maxZ2+(textGuideLineConfig&&textGuideLineConfig.showAbove?1:-1))}return maxZ2}function clearStates(model,view){view.eachRendered((function(el){if(!isElementRemoved(el)){var textContent=el.getTextContent(),textGuide=el.getTextGuideLine();el.stateTransition&&(el.stateTransition=null),textContent&&textContent.stateTransition&&(textContent.stateTransition=null),textGuide&&textGuide.stateTransition&&(textGuide.stateTransition=null),el.hasState()?(el.prevStates=el.currentStates,el.clearStates()):el.prevStates&&(el.prevStates=null)}}))}function updateStates(model,view){var stateAnimationModel=model.getModel("stateAnimation"),enableAnimation=model.isAnimationEnabled(),duration=stateAnimationModel.get("duration"),stateTransition=duration>0?{duration:duration,delay:stateAnimationModel.get("delay"),easing:stateAnimationModel.get("easing")}:null;view.eachRendered((function(el){if(el.states&&el.states.emphasis){if(isElementRemoved(el))return;if(el instanceof Path$1&&function(el){var store=getSavedStates(el);store.normalFill=el.style.fill,store.normalStroke=el.style.stroke;var selectState=el.states.select||{};store.selectFill=selectState.style&&selectState.style.fill||null,store.selectStroke=selectState.style&&selectState.style.stroke||null}(el),el.__dirty){var prevStates=el.prevStates;prevStates&&el.useStates(prevStates)}if(enableAnimation){el.stateTransition=stateTransition;var textContent=el.getTextContent(),textGuide=el.getTextGuideLine();textContent&&(textContent.stateTransition=stateTransition),textGuide&&(textGuide.stateTransition=stateTransition)}el.__dirty&&applyElementStates(el)}}))}prepare=function(ecIns){var scheduler=ecIns._scheduler;scheduler.restorePipelines(ecIns._model),scheduler.prepareStageTasks(),prepareView(ecIns,!0),prepareView(ecIns,!1),scheduler.plan()},prepareView=function(ecIns,isComponent){for(var ecModel=ecIns._model,scheduler=ecIns._scheduler,viewList=isComponent?ecIns._componentsViews:ecIns._chartsViews,viewMap=isComponent?ecIns._componentsMap:ecIns._chartsMap,zr=ecIns._zr,api=ecIns._api,i=0;i<viewList.length;i++)viewList[i].__alive=!1;function doPrepare(model){var requireNewView=model.__requireNewView;model.__requireNewView=!1;var viewId="_ec_"+model.id+"_"+model.type,view=!requireNewView&&viewMap[viewId];if(!view){var classType=parseClassType(model.type),Clazz=isComponent?ComponentView$1.getClass(classType.main,classType.sub):ChartView$1.getClass(classType.sub);"production"!==process.env.NODE_ENV&&assert(Clazz,classType.sub+" does not exist."),(view=new Clazz).init(ecModel,api),viewMap[viewId]=view,viewList.push(view),zr.add(view.group)}model.__viewId=view.__id=viewId,view.__alive=!0,view.__model=model,view.group.__ecComponentInfo={mainType:model.mainType,index:model.componentIndex},!isComponent&&scheduler.prepareView(view,model,ecModel,api)}isComponent?ecModel.eachComponent((function(componentType,model){"series"!==componentType&&doPrepare(model)})):ecModel.eachSeries(doPrepare);for(i=0;i<viewList.length;){var view=viewList[i];view.__alive?i++:(!isComponent&&view.renderTask.dispose(),zr.remove(view.group),view.dispose(ecModel,api),viewList.splice(i,1),viewMap[view.__id]===view&&delete viewMap[view.__id],view.__id=view.group.__ecComponentInfo=null)}},updateDirectly=function(ecIns,method,payload,mainType,subType){var ecModel=ecIns._model;if(ecModel.setUpdatePayload(payload),mainType){var query={};query[mainType+"Id"]=payload[mainType+"Id"],query[mainType+"Index"]=payload[mainType+"Index"],query[mainType+"Name"]=payload[mainType+"Name"];var condition={mainType:mainType,query:query};subType&&(condition.subType=subType);var excludeSeriesIdMap,excludeSeriesId=payload.excludeSeriesId;null!=excludeSeriesId&&(excludeSeriesIdMap=createHashMap(),each$b(normalizeToArray(excludeSeriesId),(function(id){var modelId=convertOptionIdName(id,null);null!=modelId&&excludeSeriesIdMap.set(modelId,!0)}))),ecModel&&ecModel.eachComponent(condition,(function(model){if(!(excludeSeriesIdMap&&null!=excludeSeriesIdMap.get(model.id)))if(isHighDownPayload(payload))if(model instanceof SeriesModel$1)"highlight"!==payload.type||payload.notBlur||model.get(["emphasis","disabled"])||function(seriesModel,payload,api){var seriesIndex=seriesModel.seriesIndex,data=seriesModel.getData(payload.dataType);if(data){var dataIndex=queryDataIndex(data,payload);dataIndex=(isArray(dataIndex)?dataIndex[0]:dataIndex)||0;var el=data.getItemGraphicEl(dataIndex);if(!el)for(var count=data.count(),current=0;!el&&current<count;)el=data.getItemGraphicEl(current++);if(el){var ecData=getECData(el);blurSeries(seriesIndex,ecData.focus,ecData.blurScope,api)}else{var focus_1=seriesModel.get(["emphasis","focus"]),blurScope=seriesModel.get(["emphasis","blurScope"]);null!=focus_1&&blurSeries(seriesIndex,focus_1,blurScope,api)}}else"production"!==process.env.NODE_ENV&&error("Unknown dataType "+payload.dataType)}(model,payload,ecIns._api);else{var _a=findComponentHighDownDispatchers(model.mainType,model.componentIndex,payload.name,ecIns._api),focusSelf=_a.focusSelf,dispatchers=_a.dispatchers;"highlight"===payload.type&&focusSelf&&!payload.notBlur&&blurComponent(model.mainType,model.componentIndex,ecIns._api),dispatchers&&each$b(dispatchers,(function(dispatcher){"highlight"===payload.type?enterEmphasis(dispatcher):leaveEmphasis(dispatcher)}))}else isSelectChangePayload(payload)&&model instanceof SeriesModel$1&&(!function(seriesModel,payload){if(isSelectChangePayload(payload)){var dataType=payload.dataType,dataIndex=queryDataIndex(seriesModel.getData(dataType),payload);isArray(dataIndex)||(dataIndex=[dataIndex]),seriesModel["toggleSelect"===payload.type?"toggleSelect":"select"===payload.type?"select":"unselect"](dataIndex,dataType)}}(model,payload,ecIns._api),updateSeriesElementSelection(model),markStatusToUpdate(ecIns))}),ecIns),ecModel&&ecModel.eachComponent(condition,(function(model){excludeSeriesIdMap&&null!=excludeSeriesIdMap.get(model.id)||callView(ecIns["series"===mainType?"_chartsMap":"_componentsMap"][model.__viewId])}),ecIns)}else each$b([].concat(ecIns._componentsViews).concat(ecIns._chartsViews),callView);function callView(view){view&&view.__alive&&view[method]&&view[method](view.__model,ecModel,ecIns._api,payload)}},updateMethods={prepareAndUpdate:function(payload){prepare(this),updateMethods.update.call(this,payload,{optionChanged:null!=payload.newOption})},update:function(payload,updateParams){var ecModel=this._model,api=this._api,zr=this._zr,coordSysMgr=this._coordSysMgr,scheduler=this._scheduler;if(ecModel){ecModel.setUpdatePayload(payload),scheduler.restoreData(ecModel,payload),scheduler.performSeriesTasks(ecModel),coordSysMgr.create(ecModel,api),scheduler.performDataProcessorTasks(ecModel,payload),updateStreamModes(this,ecModel),coordSysMgr.update(ecModel,api),clearColorPalette(ecModel),scheduler.performVisualTasks(ecModel,payload),render(this,ecModel,api,payload,updateParams);var backgroundColor=ecModel.get("backgroundColor")||"transparent",darkMode=ecModel.get("darkMode");zr.setBackgroundColor(backgroundColor),null!=darkMode&&"auto"!==darkMode&&zr.setDarkMode(darkMode),lifecycle$1.trigger("afterupdate",ecModel,api)}},updateTransform:function(payload){var _this=this,ecModel=this._model,api=this._api;if(ecModel){ecModel.setUpdatePayload(payload);var componentDirtyList=[];ecModel.eachComponent((function(componentType,componentModel){if("series"!==componentType){var componentView=_this.getViewOfComponentModel(componentModel);if(componentView&&componentView.__alive)if(componentView.updateTransform){var result=componentView.updateTransform(componentModel,ecModel,api,payload);result&&result.update&&componentDirtyList.push(componentView)}else componentDirtyList.push(componentView)}}));var seriesDirtyMap=createHashMap();ecModel.eachSeries((function(seriesModel){var chartView=_this._chartsMap[seriesModel.__viewId];if(chartView.updateTransform){var result=chartView.updateTransform(seriesModel,ecModel,api,payload);result&&result.update&&seriesDirtyMap.set(seriesModel.uid,1)}else seriesDirtyMap.set(seriesModel.uid,1)})),clearColorPalette(ecModel),this._scheduler.performVisualTasks(ecModel,payload,{setDirty:!0,dirtyMap:seriesDirtyMap}),renderSeries(this,ecModel,api,payload,{},seriesDirtyMap),lifecycle$1.trigger("afterupdate",ecModel,api)}},updateView:function(payload){var ecModel=this._model;ecModel&&(ecModel.setUpdatePayload(payload),ChartView$1.markUpdateMethod(payload,"updateView"),clearColorPalette(ecModel),this._scheduler.performVisualTasks(ecModel,payload,{setDirty:!0}),render(this,ecModel,this._api,payload,{}),lifecycle$1.trigger("afterupdate",ecModel,this._api))},updateVisual:function(payload){var _this=this,ecModel=this._model;ecModel&&(ecModel.setUpdatePayload(payload),ecModel.eachSeries((function(seriesModel){seriesModel.getData().clearAllVisual()})),ChartView$1.markUpdateMethod(payload,"updateVisual"),clearColorPalette(ecModel),this._scheduler.performVisualTasks(ecModel,payload,{visualType:"visual",setDirty:!0}),ecModel.eachComponent((function(componentType,componentModel){if("series"!==componentType){var componentView=_this.getViewOfComponentModel(componentModel);componentView&&componentView.__alive&&componentView.updateVisual(componentModel,ecModel,_this._api,payload)}})),ecModel.eachSeries((function(seriesModel){_this._chartsMap[seriesModel.__viewId].updateVisual(seriesModel,ecModel,_this._api,payload)})),lifecycle$1.trigger("afterupdate",ecModel,this._api))},updateLayout:function(payload){updateMethods.update.call(this,payload)}},doConvertPixel=function(ecIns,methodName,finder,value){if(ecIns._disposed)disposedWarning(ecIns.id);else{for(var result,ecModel=ecIns._model,coordSysList=ecIns._coordSysMgr.getCoordinateSystems(),parsedFinder=parseFinder$1(ecModel,finder),i=0;i<coordSysList.length;i++){var coordSys=coordSysList[i];if(coordSys[methodName]&&null!=(result=coordSys[methodName](ecModel,parsedFinder,value)))return result}"production"!==process.env.NODE_ENV&&warn("No coordinate system that supports "+methodName+" found by the given finder.")}},updateStreamModes=function(ecIns,ecModel){var chartsMap=ecIns._chartsMap,scheduler=ecIns._scheduler;ecModel.eachSeries((function(seriesModel){scheduler.updateStreamModes(seriesModel,chartsMap[seriesModel.__viewId])}))},doDispatchAction=function(payload,silent){var _this=this,ecModel=this.getModel(),payloadType=payload.type,escapeConnect=payload.escapeConnect,actionWrap=actions[payloadType],actionInfo=actionWrap.actionInfo,cptTypeTmp=(actionInfo.update||"update").split(":"),updateMethod=cptTypeTmp.pop(),cptType=null!=cptTypeTmp[0]&&parseClassType(cptTypeTmp[0]);this.__flagInMainProcess=!0;var payloads=[payload],batched=!1;payload.batch&&(batched=!0,payloads=map$1(payload.batch,(function(item){return(item=defaults(extend({},item),payload)).batch=null,item})));var eventObj,eventObjBatch=[],isSelectChange=isSelectChangePayload(payload),isHighDown=isHighDownPayload(payload);if(isHighDown&&allLeaveBlur(this._api),each$b(payloads,(function(batchItem){if((eventObj=(eventObj=actionWrap.action(batchItem,_this._model,_this._api))||extend({},batchItem)).type=actionInfo.event||eventObj.type,eventObjBatch.push(eventObj),isHighDown){var _a=preParseFinder(payload),queryOptionMap=_a.queryOptionMap,componentMainType=_a.mainTypeSpecified?queryOptionMap.keys()[0]:"series";updateDirectly(_this,updateMethod,batchItem,componentMainType),markStatusToUpdate(_this)}else isSelectChange?(updateDirectly(_this,updateMethod,batchItem,"series"),markStatusToUpdate(_this)):cptType&&updateDirectly(_this,updateMethod,batchItem,cptType.main,cptType.sub)})),"none"!==updateMethod&&!isHighDown&&!isSelectChange&&!cptType)try{this[PENDING_UPDATE]?(prepare(this),updateMethods.update.call(this,payload),this[PENDING_UPDATE]=null):updateMethods[updateMethod].call(this,payload)}catch(e){throw this.__flagInMainProcess=!1,e}if(eventObj=batched?{type:actionInfo.event||payloadType,escapeConnect:escapeConnect,batch:eventObjBatch}:eventObjBatch[0],this.__flagInMainProcess=!1,!silent){var messageCenter=this._messageCenter;if(messageCenter.trigger(eventObj.type,eventObj),isSelectChange){var newObj={type:"selectchanged",escapeConnect:escapeConnect,selected:getAllSelectedIndices(ecModel),isFromClick:payload.isFromClick||!1,fromAction:payload.type,fromActionPayload:payload};messageCenter.trigger(newObj.type,newObj)}}},flushPendingActions=function(silent){for(var pendingActions=this._pendingActions;pendingActions.length;){var payload=pendingActions.shift();doDispatchAction.call(this,payload,silent)}},triggerUpdatedEvent=function(silent){!silent&&this.trigger("updated")},bindRenderedEvent=function(zr,ecIns){zr.on("rendered",(function(params){ecIns.trigger("rendered",params),!zr.animation.isFinished()||ecIns[PENDING_UPDATE]||ecIns._scheduler.unfinished||ecIns._pendingActions.length||ecIns.trigger("finished")}))},bindMouseEvent=function(zr,ecIns){zr.on("mouseover",(function(e){var dispatcher=findEventDispatcher(e.target,isHighDownDispatcher);dispatcher&&(!function(dispatcher,e,api){"production"===process.env.NODE_ENV||isHighDownDispatcher(dispatcher)||error("param should be highDownDispatcher");var ecData=getECData(dispatcher),_a=findComponentHighDownDispatchers(ecData.componentMainType,ecData.componentIndex,ecData.componentHighDownName,api),dispatchers=_a.dispatchers,focusSelf=_a.focusSelf;dispatchers?(focusSelf&&blurComponent(ecData.componentMainType,ecData.componentIndex,api),each$b(dispatchers,(function(dispatcher){return enterEmphasisWhenMouseOver(dispatcher,e)}))):(blurSeries(ecData.seriesIndex,ecData.focus,ecData.blurScope,api),"self"===ecData.focus&&blurComponent(ecData.componentMainType,ecData.componentIndex,api),enterEmphasisWhenMouseOver(dispatcher,e))}(dispatcher,e,ecIns._api),markStatusToUpdate(ecIns))})).on("mouseout",(function(e){var dispatcher=findEventDispatcher(e.target,isHighDownDispatcher);dispatcher&&(!function(dispatcher,e,api){"production"===process.env.NODE_ENV||isHighDownDispatcher(dispatcher)||error("param should be highDownDispatcher"),allLeaveBlur(api);var ecData=getECData(dispatcher),dispatchers=findComponentHighDownDispatchers(ecData.componentMainType,ecData.componentIndex,ecData.componentHighDownName,api).dispatchers;dispatchers?each$b(dispatchers,(function(dispatcher){return leaveEmphasisWhenMouseOut(dispatcher,e)})):leaveEmphasisWhenMouseOut(dispatcher,e)}(dispatcher,e,ecIns._api),markStatusToUpdate(ecIns))})).on("click",(function(e){var dispatcher=findEventDispatcher(e.target,(function(target){return null!=getECData(target).dataIndex}),!0);if(dispatcher){var actionType=dispatcher.selected?"unselect":"select",ecData=getECData(dispatcher);ecIns._api.dispatchAction({type:actionType,dataType:ecData.dataType,dataIndexInside:ecData.dataIndex,seriesIndex:ecData.seriesIndex,isFromClick:!0})}}))},render=function(ecIns,ecModel,api,payload,updateParams){!function(ecModel){var componentZLevels=[],seriesZLevels=[],hasSeparateZLevel=!1;if(ecModel.eachComponent((function(componentType,componentModel){var zlevel=componentModel.get("zlevel")||0,z=componentModel.get("z")||0,zlevelKey=componentModel.getZLevelKey();hasSeparateZLevel=hasSeparateZLevel||!!zlevelKey,("series"===componentType?seriesZLevels:componentZLevels).push({zlevel:zlevel,z:z,idx:componentModel.componentIndex,type:componentType,key:zlevelKey})})),hasSeparateZLevel){var lastSeriesZLevel_1,lastSeriesKey_1,zLevels=componentZLevels.concat(seriesZLevels);sort$2(zLevels,(function(a,b){return a.zlevel===b.zlevel?a.z-b.z:a.zlevel-b.zlevel})),each$b(zLevels,(function(item){var componentModel=ecModel.getComponent(item.type,item.idx),zlevel=item.zlevel,key=item.key;null!=lastSeriesZLevel_1&&(zlevel=Math.max(lastSeriesZLevel_1,zlevel)),key?(zlevel===lastSeriesZLevel_1&&key!==lastSeriesKey_1&&zlevel++,lastSeriesKey_1=key):lastSeriesKey_1&&(zlevel===lastSeriesZLevel_1&&zlevel++,lastSeriesKey_1=""),lastSeriesZLevel_1=zlevel,componentModel.setZLevel(zlevel)}))}}(ecModel),renderComponents(ecIns,ecModel,api,payload,updateParams),each$b(ecIns._chartsViews,(function(chart){chart.__alive=!1})),renderSeries(ecIns,ecModel,api,payload,updateParams),each$b(ecIns._chartsViews,(function(chart){chart.__alive||chart.remove(ecModel,api)}))},renderComponents=function(ecIns,ecModel,api,payload,updateParams,dirtyList){each$b(dirtyList||ecIns._componentsViews,(function(componentView){var componentModel=componentView.__model;clearStates(componentModel,componentView),componentView.render(componentModel,ecModel,api,payload),updateZ(componentModel,componentView),updateStates(componentModel,componentView)}))},renderSeries=function(ecIns,ecModel,api,payload,updateParams,dirtyMap){var scheduler=ecIns._scheduler;updateParams=extend(updateParams||{},{updatedSeries:ecModel.getSeries()}),lifecycle$1.trigger("series:beforeupdate",ecModel,api,updateParams);var unfinished=!1;ecModel.eachSeries((function(seriesModel){var chartView=ecIns._chartsMap[seriesModel.__viewId];chartView.__alive=!0;var renderTask=chartView.renderTask;scheduler.updatePayload(renderTask,payload),clearStates(seriesModel,chartView),dirtyMap&&dirtyMap.get(seriesModel.uid)&&renderTask.dirty(),renderTask.perform(scheduler.getPerformArgs(renderTask))&&(unfinished=!0),chartView.group.silent=!!seriesModel.get("silent"),function(seriesModel,chartView){var blendMode=seriesModel.get("blendMode")||null;chartView.eachRendered((function(el){el.isGroup||(el.style.blend=blendMode)}))}(seriesModel,chartView),updateSeriesElementSelection(seriesModel)})),scheduler.unfinished=unfinished||scheduler.unfinished,lifecycle$1.trigger("series:layoutlabels",ecModel,api,updateParams),lifecycle$1.trigger("series:transition",ecModel,api,updateParams),ecModel.eachSeries((function(seriesModel){var chartView=ecIns._chartsMap[seriesModel.__viewId];updateZ(seriesModel,chartView),updateStates(seriesModel,chartView)})),function(ecIns,ecModel){var zr=ecIns._zr,storage=zr.storage,elCount=0;storage.traverse((function(el){el.isGroup||elCount++})),elCount>ecModel.get("hoverLayerThreshold")&&!env$1.node&&!env$1.worker&&ecModel.eachSeries((function(seriesModel){if(!seriesModel.preventUsingHoverLayer){var chartView=ecIns._chartsMap[seriesModel.__viewId];chartView.__alive&&chartView.eachRendered((function(el){el.states.emphasis&&(el.states.emphasis.hoverLayer=!0)}))}}))}(ecIns,ecModel),lifecycle$1.trigger("series:afterupdate",ecModel,api,updateParams)},markStatusToUpdate=function(ecIns){ecIns.__needsUpdateStatus=!0,ecIns.getZr().wakeUp()},applyChangedStates=function(ecIns){ecIns.__needsUpdateStatus&&(ecIns.getZr().storage.traverse((function(el){isElementRemoved(el)||applyElementStates(el)})),ecIns.__needsUpdateStatus=!1)},createExtensionAPI=function(ecIns){return new(function(_super){function class_1(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(class_1,_super),class_1.prototype.getCoordinateSystems=function(){return ecIns._coordSysMgr.getCoordinateSystems()},class_1.prototype.getComponentByElement=function(el){for(;el;){var modelInfo=el.__ecComponentInfo;if(null!=modelInfo)return ecIns._model.getComponent(modelInfo.mainType,modelInfo.index);el=el.parent}},class_1.prototype.enterEmphasis=function(el,highlightDigit){enterEmphasis(el,highlightDigit),markStatusToUpdate(ecIns)},class_1.prototype.leaveEmphasis=function(el,highlightDigit){leaveEmphasis(el,highlightDigit),markStatusToUpdate(ecIns)},class_1.prototype.enterBlur=function(el){enterBlur(el),markStatusToUpdate(ecIns)},class_1.prototype.leaveBlur=function(el){leaveBlur(el),markStatusToUpdate(ecIns)},class_1.prototype.enterSelect=function(el){enterSelect(el),markStatusToUpdate(ecIns)},class_1.prototype.leaveSelect=function(el){leaveSelect(el),markStatusToUpdate(ecIns)},class_1.prototype.getModel=function(){return ecIns.getModel()},class_1.prototype.getViewOfComponentModel=function(componentModel){return ecIns.getViewOfComponentModel(componentModel)},class_1.prototype.getViewOfSeriesModel=function(seriesModel){return ecIns.getViewOfSeriesModel(seriesModel)},class_1}(ExtensionAPI$1))(ecIns)},enableConnect=function(chart){function updateConnectedChartsStatus(charts,status){for(var i=0;i<charts.length;i++){charts[i].__connectUpdateStatus=status}}each$b(eventActionMap,(function(actionType,eventType){chart._messageCenter.on(eventType,(function(event){if(connectedGroups[chart.group]&&0!==chart.__connectUpdateStatus){if(event&&event.escapeConnect)return;var action_1=chart.makeActionFromEvent(event),otherCharts_1=[];each$b(instances,(function(otherChart){otherChart!==chart&&otherChart.group===chart.group&&otherCharts_1.push(otherChart)})),updateConnectedChartsStatus(otherCharts_1,0),each$b(otherCharts_1,(function(otherChart){1!==otherChart.__connectUpdateStatus&&otherChart.dispatchAction(action_1)})),updateConnectedChartsStatus(otherCharts_1,2)}}))}))}}(),ECharts}(Eventful$1),echartsProto=ECharts.prototype;echartsProto.on=createRegisterEventWithLowercaseECharts("on"),echartsProto.off=createRegisterEventWithLowercaseECharts("off"),echartsProto.one=function(eventName,cb,ctx){var self=this;deprecateLog("ECharts#one is deprecated."),this.on.call(this,eventName,(function wrapped(){for(var args2=[],_i=0;_i<arguments.length;_i++)args2[_i]=arguments[_i];cb&&cb.apply&&cb.apply(this,args2),self.off(eventName,wrapped)}),ctx)};var MOUSE_EVENT_NAMES=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function disposedWarning(id){"production"!==process.env.NODE_ENV&&warn("Instance "+id+" has been disposed")}var actions={},eventActionMap={},dataProcessorFuncs=[],optionPreprocessorFuncs=[],visualFuncs=[],themeStorage={},loadingEffects={},instances={},connectedGroups={},idBase=+new Date-0,DOM_ATTRIBUTE_KEY="_echarts_instance_";function init$1(dom,theme,opts){var isClient=!(opts&&opts.ssr);if(isClient){if("production"!==process.env.NODE_ENV&&!dom)throw new Error("Initialize failed: invalid dom.");var existInstance=function(dom){return instances[function(dom,key){return dom.getAttribute?dom.getAttribute(key):dom[key]}(dom,DOM_ATTRIBUTE_KEY)]}(dom);if(existInstance)return"production"!==process.env.NODE_ENV&&warn("There is a chart instance already initialized on the dom."),existInstance;"production"!==process.env.NODE_ENV&&(!isDom(dom)||"CANVAS"===dom.nodeName.toUpperCase()||(dom.clientWidth||opts&&null!=opts.width)&&(dom.clientHeight||opts&&null!=opts.height)||warn("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload."))}var chart=new ECharts(dom,theme,opts);return chart.id="ec_"+idBase++,instances[chart.id]=chart,isClient&&setAttribute(dom,DOM_ATTRIBUTE_KEY,chart.id),enableConnect(chart),lifecycle$1.trigger("afterinit",chart),chart}function registerTheme(name,theme){themeStorage[name]=theme}function registerPreprocessor(preprocessorFunc){indexOf(optionPreprocessorFuncs,preprocessorFunc)<0&&optionPreprocessorFuncs.push(preprocessorFunc)}function registerProcessor(priority,processor){normalizeRegister(dataProcessorFuncs,priority,processor,2e3)}function registerUpdateLifecycle(name,cb){lifecycle$1.on(name,cb)}function registerAction(actionInfo,eventName,action){isFunction(eventName)&&(action=eventName,eventName="");var actionType=isObject$3(actionInfo)?actionInfo.type:[actionInfo,actionInfo={event:eventName}][0];actionInfo.event=(actionInfo.event||actionType).toLowerCase(),eventName=actionInfo.event,eventActionMap[eventName]||(assert(ACTION_REG.test(actionType)&&ACTION_REG.test(eventName)),actions[actionType]||(actions[actionType]={action:action,actionInfo:actionInfo}),eventActionMap[eventName]=actionType)}function registerVisual(priority,visualTask){normalizeRegister(visualFuncs,priority,visualTask,3e3,"visual")}var registeredTasks=[];function normalizeRegister(targetList,priority,fn,defaultPriority,visualType){if((isFunction(priority)||isObject$3(priority))&&(fn=priority,priority=defaultPriority),"production"!==process.env.NODE_ENV){if(isNaN(priority)||null==priority)throw new Error("Illegal priority");each$b(targetList,(function(wrap){assert(wrap.__raw!==fn)}))}if(!(indexOf(registeredTasks,fn)>=0)){registeredTasks.push(fn);var stageHandler=Scheduler$1.wrapStageHandler(fn,visualType);stageHandler.__prio=priority,stageHandler.__raw=fn,targetList.push(stageHandler)}}function registerLoading(name,loadingFx){loadingEffects[name]=loadingFx}var registerTransform=function(externalTransform){var type=(externalTransform=clone$3(externalTransform)).type,errMsg="";type||("production"!==process.env.NODE_ENV&&(errMsg="Must have a `type` when `registerTransform`."),throwError(errMsg));var typeParsed=type.split(":");2!==typeParsed.length&&("production"!==process.env.NODE_ENV&&(errMsg='Name must include namespace like "ns:regression".'),throwError(errMsg));var isBuiltIn=!1;"echarts"===typeParsed[0]&&(type=typeParsed[1],isBuiltIn=!0),externalTransform.__isBuiltIn=isBuiltIn,externalTransformMap.set(type,externalTransform)};function dataIndexMapValueLength(valNumOrArrLengthMoreThan2){return null==valNumOrArrLengthMoreThan2?0:valNumOrArrLengthMoreThan2.length||1}function defaultKeyGetter(item){return item}registerVisual(2e3,seriesStyleTask),registerVisual(4500,dataStyleTask),registerVisual(4500,dataColorPaletteTask),registerVisual(2e3,seriesSymbolTask),registerVisual(4500,dataSymbolTask),registerVisual(7e3,(function(ecModel,api){ecModel.eachRawSeries((function(seriesModel){if(!ecModel.isSeriesFiltered(seriesModel)){var data=seriesModel.getData();data.hasItemVisual()&&data.each((function(idx){var decal=data.getItemVisual(idx,"decal");decal&&(data.ensureUniqueItemVisual(idx,"style").decal=createOrUpdatePatternFromDecal(decal,api))}));var decal=data.getVisual("decal");if(decal)data.getVisual("style").decal=createOrUpdatePatternFromDecal(decal,api)}}))})),registerPreprocessor(globalBackwardCompat),registerProcessor(900,(function(ecModel){var stackInfoMap=createHashMap();ecModel.eachSeries((function(seriesModel){var stack=seriesModel.get("stack");if(stack){var stackInfoList=stackInfoMap.get(stack)||stackInfoMap.set(stack,[]),data=seriesModel.getData(),stackInfo={stackResultDimension:data.getCalculationInfo("stackResultDimension"),stackedOverDimension:data.getCalculationInfo("stackedOverDimension"),stackedDimension:data.getCalculationInfo("stackedDimension"),stackedByDimension:data.getCalculationInfo("stackedByDimension"),isStackedByIndex:data.getCalculationInfo("isStackedByIndex"),data:data,seriesModel:seriesModel};if(!stackInfo.stackedDimension||!stackInfo.isStackedByIndex&&!stackInfo.stackedByDimension)return;stackInfoList.length&&data.setCalculationInfo("stackedOnSeries",stackInfoList[stackInfoList.length-1].seriesModel),stackInfoList.push(stackInfo)}})),stackInfoMap.each(calculateStack)})),registerLoading("default",(function(api,opts){defaults(opts=opts||{},{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 group=new Group$4,mask=new Rect$4({style:{fill:opts.maskColor},zlevel:opts.zlevel,z:1e4});group.add(mask);var arc,textContent=new ZRText$1({style:{text:opts.text,fill:opts.textColor,fontSize:opts.fontSize,fontWeight:opts.fontWeight,fontStyle:opts.fontStyle,fontFamily:opts.fontFamily},zlevel:opts.zlevel,z:10001}),labelRect=new Rect$4({style:{fill:"none"},textContent:textContent,textConfig:{position:"right",distance:10},zlevel:opts.zlevel,z:10001});return group.add(labelRect),opts.showSpinner&&((arc=new Arc$1({shape:{startAngle:-PI$3/2,endAngle:-PI$3/2+.1,r:opts.spinnerRadius},style:{stroke:opts.color,lineCap:"round",lineWidth:opts.lineWidth},zlevel:opts.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*PI$3/2}).start("circularInOut"),arc.animateShape(!0).when(1e3,{startAngle:3*PI$3/2}).delay(300).start("circularInOut"),group.add(arc)),group.resize=function(){var textWidth=textContent.getBoundingRect().width,r=opts.showSpinner?opts.spinnerRadius:0,cx=(api.getWidth()-2*r-(opts.showSpinner&&textWidth?10:0)-textWidth)/2-(opts.showSpinner&&textWidth?0:5+textWidth/2)+(opts.showSpinner?0:textWidth/2)+(textWidth?0:r),cy=api.getHeight()/2;opts.showSpinner&&arc.setShape({cx:cx,cy:cy}),labelRect.setShape({x:cx-r,y:cy-r,width:2*r,height:2*r}),mask.setShape({x:0,y:0,width:api.getWidth(),height:api.getHeight()})},group.resize(),group})),registerAction({type:"highlight",event:"highlight",update:"highlight"},noop$1),registerAction({type:"downplay",event:"downplay",update:"downplay"},noop$1),registerAction({type:"select",event:"select",update:"select"},noop$1),registerAction({type:"unselect",event:"unselect",update:"unselect"},noop$1),registerAction({type:"toggleSelect",event:"toggleSelect",update:"toggleSelect"},noop$1),registerTheme("light",lightTheme),registerTheme("dark",darkTheme);var DataDiffer=function(){function DataDiffer(oldArr,newArr,oldKeyGetter,newKeyGetter,context,diffMode){this._old=oldArr,this._new=newArr,this._oldKeyGetter=oldKeyGetter||defaultKeyGetter,this._newKeyGetter=newKeyGetter||defaultKeyGetter,this.context=context,this._diffModeMultiple="multiple"===diffMode}return DataDiffer.prototype.add=function(func){return this._add=func,this},DataDiffer.prototype.update=function(func){return this._update=func,this},DataDiffer.prototype.updateManyToOne=function(func){return this._updateManyToOne=func,this},DataDiffer.prototype.updateOneToMany=function(func){return this._updateOneToMany=func,this},DataDiffer.prototype.updateManyToMany=function(func){return this._updateManyToMany=func,this},DataDiffer.prototype.remove=function(func){return this._remove=func,this},DataDiffer.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},DataDiffer.prototype._executeOneToOne=function(){var oldArr=this._old,newArr=this._new,newDataIndexMap={},oldDataKeyArr=new Array(oldArr.length),newDataKeyArr=new Array(newArr.length);this._initIndexMap(oldArr,null,oldDataKeyArr,"_oldKeyGetter"),this._initIndexMap(newArr,newDataIndexMap,newDataKeyArr,"_newKeyGetter");for(var i=0;i<oldArr.length;i++){var oldKey=oldDataKeyArr[i],newIdxMapVal=newDataIndexMap[oldKey],newIdxMapValLen=dataIndexMapValueLength(newIdxMapVal);if(newIdxMapValLen>1){var newIdx=newIdxMapVal.shift();1===newIdxMapVal.length&&(newDataIndexMap[oldKey]=newIdxMapVal[0]),this._update&&this._update(newIdx,i)}else 1===newIdxMapValLen?(newDataIndexMap[oldKey]=null,this._update&&this._update(newIdxMapVal,i)):this._remove&&this._remove(i)}this._performRestAdd(newDataKeyArr,newDataIndexMap)},DataDiffer.prototype._executeMultiple=function(){var oldArr=this._old,newArr=this._new,oldDataIndexMap={},newDataIndexMap={},oldDataKeyArr=[],newDataKeyArr=[];this._initIndexMap(oldArr,oldDataIndexMap,oldDataKeyArr,"_oldKeyGetter"),this._initIndexMap(newArr,newDataIndexMap,newDataKeyArr,"_newKeyGetter");for(var i=0;i<oldDataKeyArr.length;i++){var oldKey=oldDataKeyArr[i],oldIdxMapVal=oldDataIndexMap[oldKey],newIdxMapVal=newDataIndexMap[oldKey],oldIdxMapValLen=dataIndexMapValueLength(oldIdxMapVal),newIdxMapValLen=dataIndexMapValueLength(newIdxMapVal);if(oldIdxMapValLen>1&&1===newIdxMapValLen)this._updateManyToOne&&this._updateManyToOne(newIdxMapVal,oldIdxMapVal),newDataIndexMap[oldKey]=null;else if(1===oldIdxMapValLen&&newIdxMapValLen>1)this._updateOneToMany&&this._updateOneToMany(newIdxMapVal,oldIdxMapVal),newDataIndexMap[oldKey]=null;else if(1===oldIdxMapValLen&&1===newIdxMapValLen)this._update&&this._update(newIdxMapVal,oldIdxMapVal),newDataIndexMap[oldKey]=null;else if(oldIdxMapValLen>1&&newIdxMapValLen>1)this._updateManyToMany&&this._updateManyToMany(newIdxMapVal,oldIdxMapVal),newDataIndexMap[oldKey]=null;else if(oldIdxMapValLen>1)for(var i_1=0;i_1<oldIdxMapValLen;i_1++)this._remove&&this._remove(oldIdxMapVal[i_1]);else this._remove&&this._remove(oldIdxMapVal)}this._performRestAdd(newDataKeyArr,newDataIndexMap)},DataDiffer.prototype._performRestAdd=function(newDataKeyArr,newDataIndexMap){for(var i=0;i<newDataKeyArr.length;i++){var newKey=newDataKeyArr[i],newIdxMapVal=newDataIndexMap[newKey],idxMapValLen=dataIndexMapValueLength(newIdxMapVal);if(idxMapValLen>1)for(var j=0;j<idxMapValLen;j++)this._add&&this._add(newIdxMapVal[j]);else 1===idxMapValLen&&this._add&&this._add(newIdxMapVal);newDataIndexMap[newKey]=null}},DataDiffer.prototype._initIndexMap=function(arr,map,keyArr,keyGetterName){for(var cbModeMultiple=this._diffModeMultiple,i=0;i<arr.length;i++){var key="_ec_"+this[keyGetterName](arr[i],i);if(cbModeMultiple||(keyArr[i]=key),map){var idxMapVal=map[key],idxMapValLen=dataIndexMapValueLength(idxMapVal);0===idxMapValLen?(map[key]=i,cbModeMultiple&&keyArr.push(key)):1===idxMapValLen?map[key]=[idxMapVal,i]:idxMapVal.push(i)}}},DataDiffer}(),DataDiffer$1=DataDiffer,DimensionUserOuput=function(){function DimensionUserOuput(encode,dimRequest){this._encode=encode,this._schema=dimRequest}return DimensionUserOuput.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},DimensionUserOuput.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},DimensionUserOuput}();function getOrCreateEncodeArr(encode,dim){return encode.hasOwnProperty(dim)||(encode[dim]=[]),encode[dim]}function getDimensionTypeByAxis(axisType){return"category"===axisType?"ordinal":"time"===axisType?"time":"float"}var SeriesDimensionDefine$1=function(opt){this.otherDims={},null!=opt&&extend(this,opt)},inner$e=makeInner(),dimTypeShort={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},SeriesDataSchema=function(){function SeriesDataSchema(opt){this.dimensions=opt.dimensions,this._dimOmitted=opt.dimensionOmitted,this.source=opt.source,this._fullDimCount=opt.fullDimensionCount,this._updateDimOmitted(opt.dimensionOmitted)}return SeriesDataSchema.prototype.isDimensionOmitted=function(){return this._dimOmitted},SeriesDataSchema.prototype._updateDimOmitted=function(dimensionOmitted){this._dimOmitted=dimensionOmitted,dimensionOmitted&&(this._dimNameMap||(this._dimNameMap=ensureSourceDimNameMap(this.source)))},SeriesDataSchema.prototype.getSourceDimensionIndex=function(dimName){return retrieve2(this._dimNameMap.get(dimName),-1)},SeriesDataSchema.prototype.getSourceDimension=function(dimIndex){var dimensionsDefine=this.source.dimensionsDefine;if(dimensionsDefine)return dimensionsDefine[dimIndex]},SeriesDataSchema.prototype.makeStoreSchema=function(){for(var dimCount=this._fullDimCount,willRetrieveDataByName=shouldRetrieveDataByName(this.source),makeHashStrict=!shouldOmitUnusedDimensions(dimCount),dimHash="",dims=[],fullDimIdx=0,seriesDimIdx=0;fullDimIdx<dimCount;fullDimIdx++){var property=void 0,type=void 0,ordinalMeta=void 0,seriesDimDef=this.dimensions[seriesDimIdx];if(seriesDimDef&&seriesDimDef.storeDimIndex===fullDimIdx)property=willRetrieveDataByName?seriesDimDef.name:null,type=seriesDimDef.type,ordinalMeta=seriesDimDef.ordinalMeta,seriesDimIdx++;else{var sourceDimDef=this.getSourceDimension(fullDimIdx);sourceDimDef&&(property=willRetrieveDataByName?sourceDimDef.name:null,type=sourceDimDef.type)}dims.push({property:property,type:type,ordinalMeta:ordinalMeta}),!willRetrieveDataByName||null==property||seriesDimDef&&seriesDimDef.isCalculationCoord||(dimHash+=makeHashStrict?property.replace(/\`/g,"`1").replace(/\$/g,"`2"):property),dimHash+="$",dimHash+=dimTypeShort[type]||"f",ordinalMeta&&(dimHash+=ordinalMeta.uid),dimHash+="$"}var source=this.source;return{dimensions:dims,hash:[source.seriesLayoutBy,source.startIndex,dimHash].join("$$")}},SeriesDataSchema.prototype.makeOutputDimensionNames=function(){for(var result=[],fullDimIdx=0,seriesDimIdx=0;fullDimIdx<this._fullDimCount;fullDimIdx++){var name_1=void 0,seriesDimDef=this.dimensions[seriesDimIdx];if(seriesDimDef&&seriesDimDef.storeDimIndex===fullDimIdx)seriesDimDef.isCalculationCoord||(name_1=seriesDimDef.name),seriesDimIdx++;else{var sourceDimDef=this.getSourceDimension(fullDimIdx);sourceDimDef&&(name_1=sourceDimDef.name)}result.push(name_1)}return result},SeriesDataSchema.prototype.appendCalculationDimension=function(dimDef){this.dimensions.push(dimDef),dimDef.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},SeriesDataSchema}();function isSeriesDataSchema(schema){return schema instanceof SeriesDataSchema}function createDimNameMap(dimsDef){for(var dataDimNameMap=createHashMap(),i=0;i<(dimsDef||[]).length;i++){var dimDefItemRaw=dimsDef[i],userDimName=isObject$3(dimDefItemRaw)?dimDefItemRaw.name:dimDefItemRaw;null!=userDimName&&null==dataDimNameMap.get(userDimName)&&dataDimNameMap.set(userDimName,i)}return dataDimNameMap}function ensureSourceDimNameMap(source){var innerSource=inner$e(source);return innerSource.dimNameMap||(innerSource.dimNameMap=createDimNameMap(source.dimensionsDefine))}function shouldOmitUnusedDimensions(dimCount){return dimCount>30}var prepareInvertedIndex,getId,getIdNameFromStore,normalizeDimensions,transferProperties,cloneListForMapAndSample,makeIdFromName,isObject$1=isObject$3,map=map$1,CtorInt32Array="undefined"==typeof Int32Array?Array:Int32Array,TRANSFERABLE_PROPERTIES=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],CLONE_PROPERTIES=["_approximateExtent"],SeriesData=function(){function SeriesData(dimensionsInput,hostModel){var dimensions;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 assignStoreDimIdx=!1;isSeriesDataSchema(dimensionsInput)?(dimensions=dimensionsInput.dimensions,this._dimOmitted=dimensionsInput.isDimensionOmitted(),this._schema=dimensionsInput):(assignStoreDimIdx=!0,dimensions=dimensionsInput),dimensions=dimensions||["x","y"];for(var dimensionInfos={},dimensionNames=[],invertedIndicesMap={},needsHasOwn=!1,emptyObj={},i=0;i<dimensions.length;i++){var dimInfoInput=dimensions[i],dimensionInfo=isString(dimInfoInput)?new SeriesDimensionDefine$1({name:dimInfoInput}):dimInfoInput instanceof SeriesDimensionDefine$1?dimInfoInput:new SeriesDimensionDefine$1(dimInfoInput),dimensionName=dimensionInfo.name;dimensionInfo.type=dimensionInfo.type||"float",dimensionInfo.coordDim||(dimensionInfo.coordDim=dimensionName,dimensionInfo.coordDimIndex=0);var otherDims=dimensionInfo.otherDims=dimensionInfo.otherDims||{};dimensionNames.push(dimensionName),dimensionInfos[dimensionName]=dimensionInfo,null!=emptyObj[dimensionName]&&(needsHasOwn=!0),dimensionInfo.createInvertedIndices&&(invertedIndicesMap[dimensionName]=[]),0===otherDims.itemName&&(this._nameDimIdx=i),0===otherDims.itemId&&(this._idDimIdx=i),"production"!==process.env.NODE_ENV&&assert(assignStoreDimIdx||dimensionInfo.storeDimIndex>=0),assignStoreDimIdx&&(dimensionInfo.storeDimIndex=i)}if(this.dimensions=dimensionNames,this._dimInfos=dimensionInfos,this._initGetDimensionInfo(needsHasOwn),this.hostModel=hostModel,this._invertedIndicesMap=invertedIndicesMap,this._dimOmitted){var dimIdxToName_1=this._dimIdxToName=createHashMap();each$b(dimensionNames,(function(dimName){dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex,dimName)}))}}return SeriesData.prototype.getDimension=function(dim){var dimIdx=this._recognizeDimIndex(dim);if(null==dimIdx)return dim;if(dimIdx=dim,!this._dimOmitted)return this.dimensions[dimIdx];var dimName=this._dimIdxToName.get(dimIdx);if(null!=dimName)return dimName;var sourceDimDef=this._schema.getSourceDimension(dimIdx);return sourceDimDef?sourceDimDef.name:void 0},SeriesData.prototype.getDimensionIndex=function(dim){var dimIdx=this._recognizeDimIndex(dim);if(null!=dimIdx)return dimIdx;if(null==dim)return-1;var dimInfo=this._getDimInfo(dim);return dimInfo?dimInfo.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(dim):-1},SeriesData.prototype._recognizeDimIndex=function(dim){if(isNumber(dim)||null!=dim&&!isNaN(dim)&&!this._getDimInfo(dim)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(dim)<0))return+dim},SeriesData.prototype._getStoreDimIndex=function(dim){var dimIdx=this.getDimensionIndex(dim);if("production"!==process.env.NODE_ENV&&null==dimIdx)throw new Error("Unknown dimension "+dim);return dimIdx},SeriesData.prototype.getDimensionInfo=function(dim){return this._getDimInfo(this.getDimension(dim))},SeriesData.prototype._initGetDimensionInfo=function(needsHasOwn){var dimensionInfos=this._dimInfos;this._getDimInfo=needsHasOwn?function(dimName){return dimensionInfos.hasOwnProperty(dimName)?dimensionInfos[dimName]:void 0}:function(dimName){return dimensionInfos[dimName]}},SeriesData.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},SeriesData.prototype.mapDimension=function(coordDim,idx){var dimensionsSummary=this._dimSummary;if(null==idx)return dimensionsSummary.encodeFirstDimNotExtra[coordDim];var dims=dimensionsSummary.encode[coordDim];return dims?dims[idx]:null},SeriesData.prototype.mapDimensionsAll=function(coordDim){return(this._dimSummary.encode[coordDim]||[]).slice()},SeriesData.prototype.getStore=function(){return this._store},SeriesData.prototype.initData=function(data,nameList,dimValueGetter){var store,_this=this;if(data instanceof DataStore&&(store=data),!store){var dimensions=this.dimensions,provider=isSourceInstance(data)||isArrayLike(data)?new DefaultDataProvider(data,dimensions.length):data;store=new DataStore;var dimensionInfos=map(dimensions,(function(dimName){return{type:_this._dimInfos[dimName].type,property:dimName}}));store.initData(provider,dimensionInfos,dimValueGetter)}this._store=store,this._nameList=(nameList||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,store.count()),this._dimSummary=function(data,schema){var summary={},encode=summary.encode={},notExtraCoordDimMap=createHashMap(),defaultedLabel=[],defaultedTooltip=[],userOutputEncode={};each$b(data.dimensions,(function(dimName){var dimType,dimItem=data.getDimensionInfo(dimName),coordDim=dimItem.coordDim;if(coordDim){"production"!==process.env.NODE_ENV&&assert(null==VISUAL_DIMENSIONS.get(coordDim));var coordDimIndex=dimItem.coordDimIndex;getOrCreateEncodeArr(encode,coordDim)[coordDimIndex]=dimName,dimItem.isExtraCoord||(notExtraCoordDimMap.set(coordDim,1),"ordinal"!==(dimType=dimItem.type)&&"time"!==dimType&&(defaultedLabel[0]=dimName),getOrCreateEncodeArr(userOutputEncode,coordDim)[coordDimIndex]=data.getDimensionIndex(dimItem.name)),dimItem.defaultTooltip&&defaultedTooltip.push(dimName)}VISUAL_DIMENSIONS.each((function(v,otherDim){var encodeArr=getOrCreateEncodeArr(encode,otherDim),dimIndex=dimItem.otherDims[otherDim];null!=dimIndex&&!1!==dimIndex&&(encodeArr[dimIndex]=dimItem.name)}))}));var dataDimsOnCoord=[],encodeFirstDimNotExtra={};notExtraCoordDimMap.each((function(v,coordDim){var dimArr=encode[coordDim];encodeFirstDimNotExtra[coordDim]=dimArr[0],dataDimsOnCoord=dataDimsOnCoord.concat(dimArr)})),summary.dataDimsOnCoord=dataDimsOnCoord,summary.dataDimIndicesOnCoord=map$1(dataDimsOnCoord,(function(dimName){return data.getDimensionInfo(dimName).storeDimIndex})),summary.encodeFirstDimNotExtra=encodeFirstDimNotExtra;var encodeLabel=encode.label;encodeLabel&&encodeLabel.length&&(defaultedLabel=encodeLabel.slice());var encodeTooltip=encode.tooltip;return encodeTooltip&&encodeTooltip.length?defaultedTooltip=encodeTooltip.slice():defaultedTooltip.length||(defaultedTooltip=defaultedLabel.slice()),encode.defaultedLabel=defaultedLabel,encode.defaultedTooltip=defaultedTooltip,summary.userOutput=new DimensionUserOuput(userOutputEncode,schema),summary}(this,this._schema),this.userOutput=this._dimSummary.userOutput},SeriesData.prototype.appendData=function(data){var range=this._store.appendData(data);this._doInit(range[0],range[1])},SeriesData.prototype.appendValues=function(values,names){var _a=this._store.appendValues(values,names&&names.length),start=_a.start,end=_a.end,shouldMakeIdFromName=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),names)for(var idx=start;idx<end;idx++){var sourceIdx=idx-start;this._nameList[idx]=names[sourceIdx],shouldMakeIdFromName&&makeIdFromName(this,idx)}},SeriesData.prototype._updateOrdinalMeta=function(){for(var store=this._store,dimensions=this.dimensions,i=0;i<dimensions.length;i++){var dimInfo=this._dimInfos[dimensions[i]];dimInfo.ordinalMeta&&store.collectOrdinalMeta(dimInfo.storeDimIndex,dimInfo.ordinalMeta)}},SeriesData.prototype._shouldMakeIdFromName=function(){var provider=this._store.getProvider();return null==this._idDimIdx&&"typedArray"!==provider.getSource().sourceFormat&&!provider.fillStorage},SeriesData.prototype._doInit=function(start,end){if(!(start>=end)){var provider=this._store.getProvider();this._updateOrdinalMeta();var nameList=this._nameList,idList=this._idList;if("original"===provider.getSource().sourceFormat&&!provider.pure)for(var sharedDataItem=[],idx=start;idx<end;idx++){var dataItem=provider.getItem(idx,sharedDataItem);if(!this.hasItemOption&&isDataItemOption(dataItem)&&(this.hasItemOption=!0),dataItem){var itemName=dataItem.name;null==nameList[idx]&&null!=itemName&&(nameList[idx]=convertOptionIdName(itemName,null));var itemId=dataItem.id;null==idList[idx]&&null!=itemId&&(idList[idx]=convertOptionIdName(itemId,null))}}if(this._shouldMakeIdFromName())for(idx=start;idx<end;idx++)makeIdFromName(this,idx);prepareInvertedIndex(this)}},SeriesData.prototype.getApproximateExtent=function(dim){return this._approximateExtent[dim]||this._store.getDataExtent(this._getStoreDimIndex(dim))},SeriesData.prototype.setApproximateExtent=function(extent,dim){dim=this.getDimension(dim),this._approximateExtent[dim]=extent.slice()},SeriesData.prototype.getCalculationInfo=function(key){return this._calculationInfo[key]},SeriesData.prototype.setCalculationInfo=function(key,value){isObject$1(key)?extend(this._calculationInfo,key):this._calculationInfo[key]=value},SeriesData.prototype.getName=function(idx){var rawIndex=this.getRawIndex(idx),name=this._nameList[rawIndex];return null==name&&null!=this._nameDimIdx&&(name=getIdNameFromStore(this,this._nameDimIdx,rawIndex)),null==name&&(name=""),name},SeriesData.prototype._getCategory=function(dimIdx,idx){var ordinal=this._store.get(dimIdx,idx),ordinalMeta=this._store.getOrdinalMeta(dimIdx);return ordinalMeta?ordinalMeta.categories[ordinal]:ordinal},SeriesData.prototype.getId=function(idx){return getId(this,this.getRawIndex(idx))},SeriesData.prototype.count=function(){return this._store.count()},SeriesData.prototype.get=function(dim,idx){var store=this._store,dimInfo=this._dimInfos[dim];if(dimInfo)return store.get(dimInfo.storeDimIndex,idx)},SeriesData.prototype.getByRawIndex=function(dim,rawIdx){var store=this._store,dimInfo=this._dimInfos[dim];if(dimInfo)return store.getByRawIndex(dimInfo.storeDimIndex,rawIdx)},SeriesData.prototype.getIndices=function(){return this._store.getIndices()},SeriesData.prototype.getDataExtent=function(dim){return this._store.getDataExtent(this._getStoreDimIndex(dim))},SeriesData.prototype.getSum=function(dim){return this._store.getSum(this._getStoreDimIndex(dim))},SeriesData.prototype.getMedian=function(dim){return this._store.getMedian(this._getStoreDimIndex(dim))},SeriesData.prototype.getValues=function(dimensions,idx){var _this=this,store=this._store;return isArray(dimensions)?store.getValues(map(dimensions,(function(dim){return _this._getStoreDimIndex(dim)})),idx):store.getValues(dimensions)},SeriesData.prototype.hasValue=function(idx){for(var dataDimIndicesOnCoord=this._dimSummary.dataDimIndicesOnCoord,i=0,len=dataDimIndicesOnCoord.length;i<len;i++)if(isNaN(this._store.get(dataDimIndicesOnCoord[i],idx)))return!1;return!0},SeriesData.prototype.indexOfName=function(name){for(var i=0,len=this._store.count();i<len;i++)if(this.getName(i)===name)return i;return-1},SeriesData.prototype.getRawIndex=function(idx){return this._store.getRawIndex(idx)},SeriesData.prototype.indexOfRawIndex=function(rawIndex){return this._store.indexOfRawIndex(rawIndex)},SeriesData.prototype.rawIndexOf=function(dim,value){var invertedIndices=dim&&this._invertedIndicesMap[dim];if("production"!==process.env.NODE_ENV&&!invertedIndices)throw new Error("Do not supported yet");var rawIndex=invertedIndices&&invertedIndices[value];return null==rawIndex||isNaN(rawIndex)?-1:rawIndex},SeriesData.prototype.indicesOfNearest=function(dim,value,maxDistance){return this._store.indicesOfNearest(this._getStoreDimIndex(dim),value,maxDistance)},SeriesData.prototype.each=function(dims,cb,ctx){isFunction(dims)&&(ctx=cb,cb=dims,dims=[]);var fCtx=ctx||this,dimIndices=map(normalizeDimensions(dims),this._getStoreDimIndex,this);this._store.each(dimIndices,fCtx?bind$1(cb,fCtx):cb)},SeriesData.prototype.filterSelf=function(dims,cb,ctx){isFunction(dims)&&(ctx=cb,cb=dims,dims=[]);var fCtx=ctx||this,dimIndices=map(normalizeDimensions(dims),this._getStoreDimIndex,this);return this._store=this._store.filter(dimIndices,fCtx?bind$1(cb,fCtx):cb),this},SeriesData.prototype.selectRange=function(range){var _this=this,innerRange={};return each$b(keys$1(range),(function(dim){var dimIdx=_this._getStoreDimIndex(dim);innerRange[dimIdx]=range[dim]})),this._store=this._store.selectRange(innerRange),this},SeriesData.prototype.mapArray=function(dims,cb,ctx){isFunction(dims)&&(ctx=cb,cb=dims,dims=[]),ctx=ctx||this;var result=[];return this.each(dims,(function(){result.push(cb&&cb.apply(this,arguments))}),ctx),result},SeriesData.prototype.map=function(dims,cb,ctx,ctxCompat){var fCtx=ctx||ctxCompat||this,dimIndices=map(normalizeDimensions(dims),this._getStoreDimIndex,this),list=cloneListForMapAndSample(this);return list._store=this._store.map(dimIndices,fCtx?bind$1(cb,fCtx):cb),list},SeriesData.prototype.modify=function(dims,cb,ctx,ctxCompat){var _this=this,fCtx=ctx||ctxCompat||this;"production"!==process.env.NODE_ENV&&each$b(normalizeDimensions(dims),(function(dim){_this.getDimensionInfo(dim).isCalculationCoord||console.error("Danger: only stack dimension can be modified")}));var dimIndices=map(normalizeDimensions(dims),this._getStoreDimIndex,this);this._store.modify(dimIndices,fCtx?bind$1(cb,fCtx):cb)},SeriesData.prototype.downSample=function(dimension,rate,sampleValue,sampleIndex){var list=cloneListForMapAndSample(this);return list._store=this._store.downSample(this._getStoreDimIndex(dimension),rate,sampleValue,sampleIndex),list},SeriesData.prototype.minmaxDownSample=function(valueDimension,rate){var list=cloneListForMapAndSample(this);return list._store=this._store.minmaxDownSample(this._getStoreDimIndex(valueDimension),rate),list},SeriesData.prototype.lttbDownSample=function(valueDimension,rate){var list=cloneListForMapAndSample(this);return list._store=this._store.lttbDownSample(this._getStoreDimIndex(valueDimension),rate),list},SeriesData.prototype.getRawDataItem=function(idx){return this._store.getRawDataItem(idx)},SeriesData.prototype.getItemModel=function(idx){var hostModel=this.hostModel,dataItem=this.getRawDataItem(idx);return new Model$1(dataItem,hostModel,hostModel&&hostModel.ecModel)},SeriesData.prototype.diff=function(otherList){var thisList=this;return new DataDiffer$1(otherList?otherList.getStore().getIndices():[],this.getStore().getIndices(),(function(idx){return getId(otherList,idx)}),(function(idx){return getId(thisList,idx)}))},SeriesData.prototype.getVisual=function(key){var visual=this._visual;return visual&&visual[key]},SeriesData.prototype.setVisual=function(kvObj,val){this._visual=this._visual||{},isObject$1(kvObj)?extend(this._visual,kvObj):this._visual[kvObj]=val},SeriesData.prototype.getItemVisual=function(idx,key){var itemVisual=this._itemVisuals[idx],val=itemVisual&&itemVisual[key];return null==val?this.getVisual(key):val},SeriesData.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},SeriesData.prototype.ensureUniqueItemVisual=function(idx,key){var itemVisuals=this._itemVisuals,itemVisual=itemVisuals[idx];itemVisual||(itemVisual=itemVisuals[idx]={});var val=itemVisual[key];return null==val&&(isArray(val=this.getVisual(key))?val=val.slice():isObject$1(val)&&(val=extend({},val)),itemVisual[key]=val),val},SeriesData.prototype.setItemVisual=function(idx,key,value){var itemVisual=this._itemVisuals[idx]||{};this._itemVisuals[idx]=itemVisual,isObject$1(key)?extend(itemVisual,key):itemVisual[key]=value},SeriesData.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},SeriesData.prototype.setLayout=function(key,val){isObject$1(key)?extend(this._layout,key):this._layout[key]=val},SeriesData.prototype.getLayout=function(key){return this._layout[key]},SeriesData.prototype.getItemLayout=function(idx){return this._itemLayouts[idx]},SeriesData.prototype.setItemLayout=function(idx,layout,merge){this._itemLayouts[idx]=merge?extend(this._itemLayouts[idx]||{},layout):layout},SeriesData.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},SeriesData.prototype.setItemGraphicEl=function(idx,el){var seriesIndex=this.hostModel&&this.hostModel.seriesIndex;setCommonECData(seriesIndex,this.dataType,idx,el),this._graphicEls[idx]=el},SeriesData.prototype.getItemGraphicEl=function(idx){return this._graphicEls[idx]},SeriesData.prototype.eachItemGraphicEl=function(cb,context){each$b(this._graphicEls,(function(el,idx){el&&cb&&cb.call(context,el,idx)}))},SeriesData.prototype.cloneShallow=function(list){return list||(list=new SeriesData(this._schema?this._schema:map(this.dimensions,this._getDimInfo,this),this.hostModel)),transferProperties(list,this),list._store=this._store,list},SeriesData.prototype.wrapMethod=function(methodName,injectFunction){var originalMethod=this[methodName];isFunction(originalMethod)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(methodName),this[methodName]=function(){var res=originalMethod.apply(this,arguments);return injectFunction.apply(this,[res].concat(slice(arguments)))})},SeriesData.internalField=(prepareInvertedIndex=function(data){var invertedIndicesMap=data._invertedIndicesMap;each$b(invertedIndicesMap,(function(invertedIndices,dim){var dimInfo=data._dimInfos[dim],ordinalMeta=dimInfo.ordinalMeta,store=data._store;if(ordinalMeta){invertedIndices=invertedIndicesMap[dim]=new CtorInt32Array(ordinalMeta.categories.length);for(var i=0;i<invertedIndices.length;i++)invertedIndices[i]=-1;for(i=0;i<store.count();i++)invertedIndices[store.get(dimInfo.storeDimIndex,i)]=i}}))},getIdNameFromStore=function(data,dimIdx,idx){return convertOptionIdName(data._getCategory(dimIdx,idx),null)},getId=function(data,rawIndex){var id=data._idList[rawIndex];return null==id&&null!=data._idDimIdx&&(id=getIdNameFromStore(data,data._idDimIdx,rawIndex)),null==id&&(id="e\0\0"+rawIndex),id},normalizeDimensions=function(dimensions){return isArray(dimensions)||(dimensions=null!=dimensions?[dimensions]:[]),dimensions},cloneListForMapAndSample=function(original){var list=new SeriesData(original._schema?original._schema:map(original.dimensions,original._getDimInfo,original),original.hostModel);return transferProperties(list,original),list},transferProperties=function(target,source){each$b(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods||[]),(function(propName){source.hasOwnProperty(propName)&&(target[propName]=source[propName])})),target.__wrappedMethods=source.__wrappedMethods,each$b(CLONE_PROPERTIES,(function(propName){target[propName]=clone$3(source[propName])})),target._calculationInfo=extend({},source._calculationInfo)},void(makeIdFromName=function(data,idx){var nameList=data._nameList,idList=data._idList,nameDimIdx=data._nameDimIdx,idDimIdx=data._idDimIdx,name=nameList[idx],id=idList[idx];if(null==name&&null!=nameDimIdx&&(nameList[idx]=name=getIdNameFromStore(data,nameDimIdx,idx)),null==id&&null!=idDimIdx&&(idList[idx]=id=getIdNameFromStore(data,idDimIdx,idx)),null==id&&null!=name){var nameRepeatCount=data._nameRepeatCount,nmCnt=nameRepeatCount[name]=(nameRepeatCount[name]||0)+1;id=name,nmCnt>1&&(id+="__ec__"+nmCnt),idList[idx]=id}})),SeriesData}(),SeriesData$1=SeriesData;function prepareSeriesDataSchema(source,opt){isSourceInstance(source)||(source=createSourceFromSeriesDataOption(source));var sysDims=(opt=opt||{}).coordDimensions||[],dimsDef=opt.dimensionsDefine||source.dimensionsDefine||[],coordDimNameMap=createHashMap(),resultList=[],dimCount=function(source,sysDims,dimsDef,optDimCount){var dimCount=Math.max(source.dimensionsDetectedCount||1,sysDims.length,dimsDef.length,optDimCount||0);return each$b(sysDims,(function(sysDimItem){var sysDimItemDimsDef;isObject$3(sysDimItem)&&(sysDimItemDimsDef=sysDimItem.dimsDef)&&(dimCount=Math.max(dimCount,sysDimItemDimsDef.length))})),dimCount}(source,sysDims,dimsDef,opt.dimensionsCount),omitUnusedDimensions=opt.canOmitUnusedDimensions&&shouldOmitUnusedDimensions(dimCount),isUsingSourceDimensionsDef=dimsDef===source.dimensionsDefine,dataDimNameMap=isUsingSourceDimensionsDef?ensureSourceDimNameMap(source):createDimNameMap(dimsDef),encodeDef=opt.encodeDefine;!encodeDef&&opt.encodeDefaulter&&(encodeDef=opt.encodeDefaulter(source,dimCount));for(var encodeDefMap=createHashMap(encodeDef),indicesMap=new CtorInt32Array$1(dimCount),i=0;i<indicesMap.length;i++)indicesMap[i]=-1;function getResultItem(dimIdx){var idx=indicesMap[dimIdx];if(idx<0){var dimDefItemRaw=dimsDef[dimIdx],dimDefItem=isObject$3(dimDefItemRaw)?dimDefItemRaw:{name:dimDefItemRaw},resultItem=new SeriesDimensionDefine$1,userDimName=dimDefItem.name;null!=userDimName&&null!=dataDimNameMap.get(userDimName)&&(resultItem.name=resultItem.displayName=userDimName),null!=dimDefItem.type&&(resultItem.type=dimDefItem.type),null!=dimDefItem.displayName&&(resultItem.displayName=dimDefItem.displayName);var newIdx=resultList.length;return indicesMap[dimIdx]=newIdx,resultItem.storeDimIndex=dimIdx,resultList.push(resultItem),resultItem}return resultList[idx]}if(!omitUnusedDimensions)for(i=0;i<dimCount;i++)getResultItem(i);encodeDefMap.each((function(dataDimsRaw,coordDim){var dataDims=normalizeToArray(dataDimsRaw).slice();if(1===dataDims.length&&!isString(dataDims[0])&&dataDims[0]<0)encodeDefMap.set(coordDim,!1);else{var validDataDims=encodeDefMap.set(coordDim,[]);each$b(dataDims,(function(resultDimIdxOrName,idx){var resultDimIdx=isString(resultDimIdxOrName)?dataDimNameMap.get(resultDimIdxOrName):resultDimIdxOrName;null!=resultDimIdx&&resultDimIdx<dimCount&&(validDataDims[idx]=resultDimIdx,applyDim(getResultItem(resultDimIdx),coordDim,idx))}))}}));var availDimIdx=0;function applyDim(resultItem,coordDim,coordDimIndex){null!=VISUAL_DIMENSIONS.get(coordDim)?resultItem.otherDims[coordDim]=coordDimIndex:(resultItem.coordDim=coordDim,resultItem.coordDimIndex=coordDimIndex,coordDimNameMap.set(coordDim,!0))}each$b(sysDims,(function(sysDimItemRaw){var coordDim,sysDimItemDimsDef,sysDimItemOtherDims,sysDimItem;if(isString(sysDimItemRaw))coordDim=sysDimItemRaw,sysDimItem={};else{coordDim=(sysDimItem=sysDimItemRaw).name;var ordinalMeta=sysDimItem.ordinalMeta;sysDimItem.ordinalMeta=null,(sysDimItem=extend({},sysDimItem)).ordinalMeta=ordinalMeta,sysDimItemDimsDef=sysDimItem.dimsDef,sysDimItemOtherDims=sysDimItem.otherDims,sysDimItem.name=sysDimItem.coordDim=sysDimItem.coordDimIndex=sysDimItem.dimsDef=sysDimItem.otherDims=null}var dataDims=encodeDefMap.get(coordDim);if(!1!==dataDims){if(!(dataDims=normalizeToArray(dataDims)).length)for(var i=0;i<(sysDimItemDimsDef&&sysDimItemDimsDef.length||1);i++){for(;availDimIdx<dimCount&&null!=getResultItem(availDimIdx).coordDim;)availDimIdx++;availDimIdx<dimCount&&dataDims.push(availDimIdx++)}each$b(dataDims,(function(resultDimIdx,coordDimIndex){var resultItem=getResultItem(resultDimIdx);if(isUsingSourceDimensionsDef&&null!=sysDimItem.type&&(resultItem.type=sysDimItem.type),applyDim(defaults(resultItem,sysDimItem),coordDim,coordDimIndex),null==resultItem.name&&sysDimItemDimsDef){var sysDimItemDimsDefItem=sysDimItemDimsDef[coordDimIndex];!isObject$3(sysDimItemDimsDefItem)&&(sysDimItemDimsDefItem={name:sysDimItemDimsDefItem}),resultItem.name=resultItem.displayName=sysDimItemDimsDefItem.name,resultItem.defaultTooltip=sysDimItemDimsDefItem.defaultTooltip}sysDimItemOtherDims&&defaults(resultItem.otherDims,sysDimItemOtherDims)}))}}));var generateCoord=opt.generateCoord,generateCoordCount=opt.generateCoordCount,fromZero=null!=generateCoordCount;generateCoordCount=generateCoord?generateCoordCount||1:0;var extra=generateCoord||"value";function ifNoNameFillWithCoordName(resultItem){null==resultItem.name&&(resultItem.name=resultItem.coordDim)}if(omitUnusedDimensions)each$b(resultList,(function(resultItem){ifNoNameFillWithCoordName(resultItem)})),resultList.sort((function(item0,item1){return item0.storeDimIndex-item1.storeDimIndex}));else for(var resultDimIdx=0;resultDimIdx<dimCount;resultDimIdx++){var resultItem=getResultItem(resultDimIdx);null==resultItem.coordDim&&(resultItem.coordDim=genCoordDimName(extra,coordDimNameMap,fromZero),resultItem.coordDimIndex=0,(!generateCoord||generateCoordCount<=0)&&(resultItem.isExtraCoord=!0),generateCoordCount--),ifNoNameFillWithCoordName(resultItem),null!=resultItem.type||guessOrdinal(source,resultDimIdx)!==BE_ORDINAL_Must&&(!resultItem.isExtraCoord||null==resultItem.otherDims.itemName&&null==resultItem.otherDims.seriesName)||(resultItem.type="ordinal")}return function(result){for(var duplicationMap=createHashMap(),i=0;i<result.length;i++){var dim=result[i],dimOriginalName=dim.name,count=duplicationMap.get(dimOriginalName)||0;count>0&&(dim.name=dimOriginalName+(count-1)),count++,duplicationMap.set(dimOriginalName,count)}}(resultList),new SeriesDataSchema({source:source,dimensions:resultList,fullDimensionCount:dimCount,dimensionOmitted:omitUnusedDimensions})}function genCoordDimName(name,map,fromZero){if(fromZero||map.hasKey(name)){for(var i=0;map.hasKey(name+i);)i++;name+=i}return map.set(name,!0),name}var CoordSysInfo=function(coordSysName){this.coordSysDims=[],this.axisMap=createHashMap(),this.categoryAxisMap=createHashMap(),this.coordSysName=coordSysName};var fetchers={cartesian2d:function(seriesModel,result,axisMap,categoryAxisMap){var xAxisModel=seriesModel.getReferringComponents("xAxis",SINGLE_REFERRING).models[0],yAxisModel=seriesModel.getReferringComponents("yAxis",SINGLE_REFERRING).models[0];if("production"!==process.env.NODE_ENV){if(!xAxisModel)throw new Error('xAxis "'+retrieve(seriesModel.get("xAxisIndex"),seriesModel.get("xAxisId"),0)+'" not found');if(!yAxisModel)throw new Error('yAxis "'+retrieve(seriesModel.get("xAxisIndex"),seriesModel.get("yAxisId"),0)+'" not found')}result.coordSysDims=["x","y"],axisMap.set("x",xAxisModel),axisMap.set("y",yAxisModel),isCategory(xAxisModel)&&(categoryAxisMap.set("x",xAxisModel),result.firstCategoryDimIndex=0),isCategory(yAxisModel)&&(categoryAxisMap.set("y",yAxisModel),null==result.firstCategoryDimIndex&&(result.firstCategoryDimIndex=1))},singleAxis:function(seriesModel,result,axisMap,categoryAxisMap){var singleAxisModel=seriesModel.getReferringComponents("singleAxis",SINGLE_REFERRING).models[0];if("production"!==process.env.NODE_ENV&&!singleAxisModel)throw new Error("singleAxis should be specified.");result.coordSysDims=["single"],axisMap.set("single",singleAxisModel),isCategory(singleAxisModel)&&(categoryAxisMap.set("single",singleAxisModel),result.firstCategoryDimIndex=0)},polar:function(seriesModel,result,axisMap,categoryAxisMap){var polarModel=seriesModel.getReferringComponents("polar",SINGLE_REFERRING).models[0],radiusAxisModel=polarModel.findAxisModel("radiusAxis"),angleAxisModel=polarModel.findAxisModel("angleAxis");if("production"!==process.env.NODE_ENV){if(!angleAxisModel)throw new Error("angleAxis option not found");if(!radiusAxisModel)throw new Error("radiusAxis option not found")}result.coordSysDims=["radius","angle"],axisMap.set("radius",radiusAxisModel),axisMap.set("angle",angleAxisModel),isCategory(radiusAxisModel)&&(categoryAxisMap.set("radius",radiusAxisModel),result.firstCategoryDimIndex=0),isCategory(angleAxisModel)&&(categoryAxisMap.set("angle",angleAxisModel),null==result.firstCategoryDimIndex&&(result.firstCategoryDimIndex=1))},geo:function(seriesModel,result,axisMap,categoryAxisMap){result.coordSysDims=["lng","lat"]},parallel:function(seriesModel,result,axisMap,categoryAxisMap){var ecModel=seriesModel.ecModel,parallelModel=ecModel.getComponent("parallel",seriesModel.get("parallelIndex")),coordSysDims=result.coordSysDims=parallelModel.dimensions.slice();each$b(parallelModel.parallelAxisIndex,(function(axisIndex,index){var axisModel=ecModel.getComponent("parallelAxis",axisIndex),axisDim=coordSysDims[index];axisMap.set(axisDim,axisModel),isCategory(axisModel)&&(categoryAxisMap.set(axisDim,axisModel),null==result.firstCategoryDimIndex&&(result.firstCategoryDimIndex=index))}))}};function isCategory(axisModel){return"category"===axisModel.get("type")}function enableDataStack(seriesModel,dimensionsInput,opt){var dimensionDefineList,schema,store,byIndex=(opt=opt||{}).byIndex,stackedCoordDimension=opt.stackedCoordDimension;!function(dimensionsInput){return!isSeriesDataSchema(dimensionsInput.schema)}(dimensionsInput)?(schema=dimensionsInput.schema,dimensionDefineList=schema.dimensions,store=dimensionsInput.store):dimensionDefineList=dimensionsInput;var stackedByDimInfo,stackedDimInfo,stackResultDimension,stackedOverDimension,mayStack=!(!seriesModel||!seriesModel.get("stack"));if(each$b(dimensionDefineList,(function(dimensionInfo,index){isString(dimensionInfo)&&(dimensionDefineList[index]=dimensionInfo={name:dimensionInfo}),mayStack&&!dimensionInfo.isExtraCoord&&(byIndex||stackedByDimInfo||!dimensionInfo.ordinalMeta||(stackedByDimInfo=dimensionInfo),stackedDimInfo||"ordinal"===dimensionInfo.type||"time"===dimensionInfo.type||stackedCoordDimension&&stackedCoordDimension!==dimensionInfo.coordDim||(stackedDimInfo=dimensionInfo))})),!stackedDimInfo||byIndex||stackedByDimInfo||(byIndex=!0),stackedDimInfo){stackResultDimension="__\0ecstackresult_"+seriesModel.id,stackedOverDimension="__\0ecstackedover_"+seriesModel.id,stackedByDimInfo&&(stackedByDimInfo.createInvertedIndices=!0);var stackedDimCoordDim_1=stackedDimInfo.coordDim,stackedDimType=stackedDimInfo.type,stackedDimCoordIndex_1=0;each$b(dimensionDefineList,(function(dimensionInfo){dimensionInfo.coordDim===stackedDimCoordDim_1&&stackedDimCoordIndex_1++}));var stackedOverDimensionDefine={name:stackResultDimension,coordDim:stackedDimCoordDim_1,coordDimIndex:stackedDimCoordIndex_1,type:stackedDimType,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:dimensionDefineList.length},stackResultDimensionDefine={name:stackedOverDimension,coordDim:stackedOverDimension,coordDimIndex:stackedDimCoordIndex_1+1,type:stackedDimType,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:dimensionDefineList.length+1};schema?(store&&(stackedOverDimensionDefine.storeDimIndex=store.ensureCalculationDimension(stackedOverDimension,stackedDimType),stackResultDimensionDefine.storeDimIndex=store.ensureCalculationDimension(stackResultDimension,stackedDimType)),schema.appendCalculationDimension(stackedOverDimensionDefine),schema.appendCalculationDimension(stackResultDimensionDefine)):(dimensionDefineList.push(stackedOverDimensionDefine),dimensionDefineList.push(stackResultDimensionDefine))}return{stackedDimension:stackedDimInfo&&stackedDimInfo.name,stackedByDimension:stackedByDimInfo&&stackedByDimInfo.name,isStackedByIndex:byIndex,stackedOverDimension:stackedOverDimension,stackResultDimension:stackResultDimension}}function isDimensionStacked(data,stackedDim){return!!stackedDim&&stackedDim===data.getCalculationInfo("stackedDimension")}function getStackedDimension(data,targetDim){return isDimensionStacked(data,targetDim)?data.getCalculationInfo("stackResultDimension"):targetDim}function createSeriesData(sourceRaw,seriesModel,opt){opt=opt||{};var source,sourceManager=seriesModel.getSourceManager(),isOriginalSource=!1;sourceRaw?(isOriginalSource=!0,source=createSourceFromSeriesDataOption(sourceRaw)):isOriginalSource="original"===(source=sourceManager.getSource()).sourceFormat;var coordSysInfo=function(seriesModel){var coordSysName=seriesModel.get("coordinateSystem"),result=new CoordSysInfo(coordSysName),fetch=fetchers[coordSysName];if(fetch)return fetch(seriesModel,result,result.axisMap,result.categoryAxisMap),result}(seriesModel),coordSysDimDefs=function(seriesModel,coordSysInfo){var coordSysDimDefs,coordSysName=seriesModel.get("coordinateSystem"),registeredCoordSys=CoordinateSystem.get(coordSysName);return coordSysInfo&&coordSysInfo.coordSysDims&&(coordSysDimDefs=map$1(coordSysInfo.coordSysDims,(function(dim){var dimInfo={name:dim},axisModel=coordSysInfo.axisMap.get(dim);if(axisModel){var axisType=axisModel.get("type");dimInfo.type=getDimensionTypeByAxis(axisType)}return dimInfo}))),coordSysDimDefs||(coordSysDimDefs=registeredCoordSys&&(registeredCoordSys.getDimensionsInfo?registeredCoordSys.getDimensionsInfo():registeredCoordSys.dimensions.slice())||["x","y"]),coordSysDimDefs}(seriesModel,coordSysInfo),useEncodeDefaulter=opt.useEncodeDefaulter,encodeDefaulter=isFunction(useEncodeDefaulter)?useEncodeDefaulter:useEncodeDefaulter?curry$1(makeSeriesEncodeForAxisCoordSys,coordSysDimDefs,seriesModel):null,schema=prepareSeriesDataSchema(source,{coordDimensions:coordSysDimDefs,generateCoord:opt.generateCoord,encodeDefine:seriesModel.getEncode(),encodeDefaulter:encodeDefaulter,canOmitUnusedDimensions:!isOriginalSource}),firstCategoryDimIndex=function(dimInfoList,createInvertedIndices,coordSysInfo){var firstCategoryDimIndex,hasNameEncode;return coordSysInfo&&each$b(dimInfoList,(function(dimInfo,dimIndex){var coordDim=dimInfo.coordDim,categoryAxisModel=coordSysInfo.categoryAxisMap.get(coordDim);categoryAxisModel&&(null==firstCategoryDimIndex&&(firstCategoryDimIndex=dimIndex),dimInfo.ordinalMeta=categoryAxisModel.getOrdinalMeta(),createInvertedIndices&&(dimInfo.createInvertedIndices=!0)),null!=dimInfo.otherDims.itemName&&(hasNameEncode=!0)})),hasNameEncode||null==firstCategoryDimIndex||(dimInfoList[firstCategoryDimIndex].otherDims.itemName=0),firstCategoryDimIndex}(schema.dimensions,opt.createInvertedIndices,coordSysInfo),store=isOriginalSource?null:sourceManager.getSharedDataStore(schema),stackCalculationInfo=enableDataStack(seriesModel,{schema:schema,store:store}),data=new SeriesData$1(schema,seriesModel);data.setCalculationInfo(stackCalculationInfo);var dimValueGetter=null!=firstCategoryDimIndex&&function(source){if("original"===source.sourceFormat){return!isArray(getDataItemValue(function(arr){var i=0;for(;i<arr.length&&null==arr[i];)i++;return arr[i]}(source.data||[])))}}(source)?function(itemOpt,dimName,dataIndex,dimIndex){return dimIndex===firstCategoryDimIndex?dataIndex:this.defaultDimValueGetter(itemOpt,dimName,dataIndex,dimIndex)}:null;return data.hasItemOption=!1,data.initData(isOriginalSource?source:store,null,dimValueGetter),data}var Scale=function(){function Scale(setting){this._setting=setting||{},this._extent=[1/0,-1/0]}return Scale.prototype.getSetting=function(name){return this._setting[name]},Scale.prototype.unionExtent=function(other){var extent=this._extent;other[0]<extent[0]&&(extent[0]=other[0]),other[1]>extent[1]&&(extent[1]=other[1])},Scale.prototype.unionExtentFromData=function(data,dim){this.unionExtent(data.getApproximateExtent(dim))},Scale.prototype.getExtent=function(){return this._extent.slice()},Scale.prototype.setExtent=function(start,end){var thisExtent=this._extent;isNaN(start)||(thisExtent[0]=start),isNaN(end)||(thisExtent[1]=end)},Scale.prototype.isInExtentRange=function(value){return this._extent[0]<=value&&this._extent[1]>=value},Scale.prototype.isBlank=function(){return this._isBlank},Scale.prototype.setBlank=function(isBlank){this._isBlank=isBlank},Scale}();enableClassManagement(Scale);var Scale$1=Scale,uidBase=0,OrdinalMeta=function(){function OrdinalMeta(opt){this.categories=opt.categories||[],this._needCollect=opt.needCollect,this._deduplication=opt.deduplication,this.uid=++uidBase}return OrdinalMeta.createByAxisModel=function(axisModel){var option=axisModel.option,data=option.data,categories=data&&map$1(data,getName);return new OrdinalMeta({categories:categories,needCollect:!categories,deduplication:!1!==option.dedplication})},OrdinalMeta.prototype.getOrdinal=function(category){return this._getOrCreateMap().get(category)},OrdinalMeta.prototype.parseAndCollect=function(category){var index,needCollect=this._needCollect;if(!isString(category)&&!needCollect)return category;if(needCollect&&!this._deduplication)return index=this.categories.length,this.categories[index]=category,index;var map=this._getOrCreateMap();return null==(index=map.get(category))&&(needCollect?(index=this.categories.length,this.categories[index]=category,map.set(category,index)):index=NaN),index},OrdinalMeta.prototype._getOrCreateMap=function(){return this._map||(this._map=createHashMap(this.categories))},OrdinalMeta}();function getName(obj){return isObject$3(obj)&&null!=obj.value?obj.value:obj+""}var OrdinalMeta$1=OrdinalMeta;function isIntervalOrLogScale(scale){return"interval"===scale.type||"log"===scale.type}function intervalScaleNiceTicks(extent,splitNumber,minInterval,maxInterval){var result={},span=extent[1]-extent[0],interval=result.interval=nice(span/splitNumber,!0);null!=minInterval&&interval<minInterval&&(interval=result.interval=minInterval),null!=maxInterval&&interval>maxInterval&&(interval=result.interval=maxInterval);var precision=result.intervalPrecision=getIntervalPrecision(interval);return function(niceTickExtent,extent){!isFinite(niceTickExtent[0])&&(niceTickExtent[0]=extent[0]),!isFinite(niceTickExtent[1])&&(niceTickExtent[1]=extent[1]),clamp(niceTickExtent,0,extent),clamp(niceTickExtent,1,extent),niceTickExtent[0]>niceTickExtent[1]&&(niceTickExtent[0]=niceTickExtent[1])}(result.niceTickExtent=[round$3(Math.ceil(extent[0]/interval)*interval,precision),round$3(Math.floor(extent[1]/interval)*interval,precision)],extent),result}function increaseInterval(interval){var exp10=Math.pow(10,quantityExponent(interval)),f=interval/exp10;return f?2===f?f=3:3===f?f=5:f*=2:f=1,round$3(f*exp10)}function getIntervalPrecision(interval){return getPrecision(interval)+2}function clamp(niceTickExtent,idx,extent){niceTickExtent[idx]=Math.max(Math.min(niceTickExtent[idx],extent[1]),extent[0])}function contain(val,extent){return val>=extent[0]&&val<=extent[1]}function normalize$1(val,extent){return extent[1]===extent[0]?.5:(val-extent[0])/(extent[1]-extent[0])}function scale(val,extent){return val*(extent[1]-extent[0])+extent[0]}var OrdinalScale=function(_super){function OrdinalScale(setting){var _this=_super.call(this,setting)||this;_this.type="ordinal";var ordinalMeta=_this.getSetting("ordinalMeta");return ordinalMeta||(ordinalMeta=new OrdinalMeta$1({})),isArray(ordinalMeta)&&(ordinalMeta=new OrdinalMeta$1({categories:map$1(ordinalMeta,(function(item){return isObject$3(item)?item.value:item}))})),_this._ordinalMeta=ordinalMeta,_this._extent=_this.getSetting("extent")||[0,ordinalMeta.categories.length-1],_this}return __extends(OrdinalScale,_super),OrdinalScale.prototype.parse=function(val){return null==val?NaN:isString(val)?this._ordinalMeta.getOrdinal(val):Math.round(val)},OrdinalScale.prototype.contain=function(rank){return contain(rank=this.parse(rank),this._extent)&&null!=this._ordinalMeta.categories[rank]},OrdinalScale.prototype.normalize=function(val){return normalize$1(val=this._getTickNumber(this.parse(val)),this._extent)},OrdinalScale.prototype.scale=function(val){return val=Math.round(scale(val,this._extent)),this.getRawOrdinalNumber(val)},OrdinalScale.prototype.getTicks=function(){for(var ticks=[],extent=this._extent,rank=extent[0];rank<=extent[1];)ticks.push({value:rank}),rank++;return ticks},OrdinalScale.prototype.getMinorTicks=function(splitNumber){},OrdinalScale.prototype.setSortInfo=function(info){if(null!=info){for(var infoOrdinalNumbers=info.ordinalNumbers,ordinalsByTick=this._ordinalNumbersByTick=[],ticksByOrdinal=this._ticksByOrdinalNumber=[],tickNum=0,allCategoryLen=this._ordinalMeta.categories.length,len=Math.min(allCategoryLen,infoOrdinalNumbers.length);tickNum<len;++tickNum){var ordinalNumber=infoOrdinalNumbers[tickNum];ordinalsByTick[tickNum]=ordinalNumber,ticksByOrdinal[ordinalNumber]=tickNum}for(var unusedOrdinal=0;tickNum<allCategoryLen;++tickNum){for(;null!=ticksByOrdinal[unusedOrdinal];)unusedOrdinal++;ordinalsByTick.push(unusedOrdinal),ticksByOrdinal[unusedOrdinal]=tickNum}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},OrdinalScale.prototype._getTickNumber=function(ordinal){var ticksByOrdinalNumber=this._ticksByOrdinalNumber;return ticksByOrdinalNumber&&ordinal>=0&&ordinal<ticksByOrdinalNumber.length?ticksByOrdinalNumber[ordinal]:ordinal},OrdinalScale.prototype.getRawOrdinalNumber=function(tickNumber){var ordinalNumbersByTick=this._ordinalNumbersByTick;return ordinalNumbersByTick&&tickNumber>=0&&tickNumber<ordinalNumbersByTick.length?ordinalNumbersByTick[tickNumber]:tickNumber},OrdinalScale.prototype.getLabel=function(tick){if(!this.isBlank()){var ordinalNumber=this.getRawOrdinalNumber(tick.value),cateogry=this._ordinalMeta.categories[ordinalNumber];return null==cateogry?"":cateogry+""}},OrdinalScale.prototype.count=function(){return this._extent[1]-this._extent[0]+1},OrdinalScale.prototype.unionExtentFromData=function(data,dim){this.unionExtent(data.getApproximateExtent(dim))},OrdinalScale.prototype.isInExtentRange=function(value){return value=this._getTickNumber(value),this._extent[0]<=value&&this._extent[1]>=value},OrdinalScale.prototype.getOrdinalMeta=function(){return this._ordinalMeta},OrdinalScale.prototype.calcNiceTicks=function(){},OrdinalScale.prototype.calcNiceExtent=function(){},OrdinalScale.type="ordinal",OrdinalScale}(Scale$1);Scale$1.registerClass(OrdinalScale);var OrdinalScale$1=OrdinalScale,roundNumber=round$3,IntervalScale=function(_super){function IntervalScale(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type="interval",_this._interval=0,_this._intervalPrecision=2,_this}return __extends(IntervalScale,_super),IntervalScale.prototype.parse=function(val){return val},IntervalScale.prototype.contain=function(val){return contain(val,this._extent)},IntervalScale.prototype.normalize=function(val){return normalize$1(val,this._extent)},IntervalScale.prototype.scale=function(val){return scale(val,this._extent)},IntervalScale.prototype.setExtent=function(start,end){var thisExtent=this._extent;isNaN(start)||(thisExtent[0]=parseFloat(start)),isNaN(end)||(thisExtent[1]=parseFloat(end))},IntervalScale.prototype.unionExtent=function(other){var extent=this._extent;other[0]<extent[0]&&(extent[0]=other[0]),other[1]>extent[1]&&(extent[1]=other[1]),this.setExtent(extent[0],extent[1])},IntervalScale.prototype.getInterval=function(){return this._interval},IntervalScale.prototype.setInterval=function(interval){this._interval=interval,this._niceExtent=this._extent.slice(),this._intervalPrecision=getIntervalPrecision(interval)},IntervalScale.prototype.getTicks=function(expandToNicedExtent){var interval=this._interval,extent=this._extent,niceTickExtent=this._niceExtent,intervalPrecision=this._intervalPrecision,ticks=[];if(!interval)return ticks;extent[0]<niceTickExtent[0]&&(expandToNicedExtent?ticks.push({value:roundNumber(niceTickExtent[0]-interval,intervalPrecision)}):ticks.push({value:extent[0]}));for(var tick=niceTickExtent[0];tick<=niceTickExtent[1]&&(ticks.push({value:tick}),(tick=roundNumber(tick+interval,intervalPrecision))!==ticks[ticks.length-1].value);)if(ticks.length>1e4)return[];var lastNiceTick=ticks.length?ticks[ticks.length-1].value:niceTickExtent[1];return extent[1]>lastNiceTick&&(expandToNicedExtent?ticks.push({value:roundNumber(lastNiceTick+interval,intervalPrecision)}):ticks.push({value:extent[1]})),ticks},IntervalScale.prototype.getMinorTicks=function(splitNumber){for(var ticks=this.getTicks(!0),minorTicks=[],extent=this.getExtent(),i=1;i<ticks.length;i++){for(var nextTick=ticks[i],prevTick=ticks[i-1],count=0,minorTicksGroup=[],minorInterval=(nextTick.value-prevTick.value)/splitNumber;count<splitNumber-1;){var minorTick=roundNumber(prevTick.value+(count+1)*minorInterval);minorTick>extent[0]&&minorTick<extent[1]&&minorTicksGroup.push(minorTick),count++}minorTicks.push(minorTicksGroup)}return minorTicks},IntervalScale.prototype.getLabel=function(data,opt){if(null==data)return"";var precision=opt&&opt.precision;return null==precision?precision=getPrecision(data.value)||0:"auto"===precision&&(precision=this._intervalPrecision),addCommas(roundNumber(data.value,precision,!0))},IntervalScale.prototype.calcNiceTicks=function(splitNumber,minInterval,maxInterval){splitNumber=splitNumber||5;var extent=this._extent,span=extent[1]-extent[0];if(isFinite(span)){span<0&&(span=-span,extent.reverse());var result=intervalScaleNiceTicks(extent,splitNumber,minInterval,maxInterval);this._intervalPrecision=result.intervalPrecision,this._interval=result.interval,this._niceExtent=result.niceTickExtent}},IntervalScale.prototype.calcNiceExtent=function(opt){var extent=this._extent;if(extent[0]===extent[1])if(0!==extent[0]){var expandSize=Math.abs(extent[0]);opt.fixMax||(extent[1]+=expandSize/2),extent[0]-=expandSize/2}else extent[1]=1;var span=extent[1]-extent[0];isFinite(span)||(extent[0]=0,extent[1]=1),this.calcNiceTicks(opt.splitNumber,opt.minInterval,opt.maxInterval);var interval=this._interval;opt.fixMin||(extent[0]=roundNumber(Math.floor(extent[0]/interval)*interval)),opt.fixMax||(extent[1]=roundNumber(Math.ceil(extent[1]/interval)*interval))},IntervalScale.prototype.setNiceExtent=function(min,max){this._niceExtent=[min,max]},IntervalScale.type="interval",IntervalScale}(Scale$1);Scale$1.registerClass(IntervalScale);var IntervalScale$1=IntervalScale,supportFloat32Array="undefined"!=typeof Float32Array,Float32ArrayCtor=supportFloat32Array?Float32Array:Array;function createFloat32Array(arg){return isArray(arg)?supportFloat32Array?new Float32Array(arg):arg:new Float32ArrayCtor(arg)}function getSeriesStackId(seriesModel){return seriesModel.get("stack")||"__ec_stack_"+seriesModel.seriesIndex}function getAxisKey(axis){return axis.dim+axis.index}function prepareLayoutBarSeries(seriesType,ecModel){var seriesModels=[];return ecModel.eachSeriesByType(seriesType,(function(seriesModel){isOnCartesian(seriesModel)&&seriesModels.push(seriesModel)})),seriesModels}function makeColumnLayout(barSeries){var axisMinGaps=function(barSeries){var axisValues={};each$b(barSeries,(function(seriesModel){var baseAxis=seriesModel.coordinateSystem.getBaseAxis();if("time"===baseAxis.type||"value"===baseAxis.type)for(var data=seriesModel.getData(),key=baseAxis.dim+"_"+baseAxis.index,dimIdx=data.getDimensionIndex(data.mapDimension(baseAxis.dim)),store=data.getStore(),i=0,cnt=store.count();i<cnt;++i){var value=store.get(dimIdx,i);axisValues[key]?axisValues[key].push(value):axisValues[key]=[value]}}));var axisMinGaps={};for(var key in axisValues)if(axisValues.hasOwnProperty(key)){var valuesInAxis=axisValues[key];if(valuesInAxis){valuesInAxis.sort((function(a,b){return a-b}));for(var min=null,j=1;j<valuesInAxis.length;++j){var delta=valuesInAxis[j]-valuesInAxis[j-1];delta>0&&(min=null===min?delta:Math.min(min,delta))}axisMinGaps[key]=min}}return axisMinGaps}(barSeries),seriesInfoList=[];return each$b(barSeries,(function(seriesModel){var bandWidth,baseAxis=seriesModel.coordinateSystem.getBaseAxis(),axisExtent=baseAxis.getExtent();if("category"===baseAxis.type)bandWidth=baseAxis.getBandWidth();else if("value"===baseAxis.type||"time"===baseAxis.type){var key=baseAxis.dim+"_"+baseAxis.index,minGap=axisMinGaps[key],extentSpan=Math.abs(axisExtent[1]-axisExtent[0]),scale=baseAxis.scale.getExtent(),scaleSpan=Math.abs(scale[1]-scale[0]);bandWidth=minGap?extentSpan/scaleSpan*minGap:extentSpan}else{var data=seriesModel.getData();bandWidth=Math.abs(axisExtent[1]-axisExtent[0])/data.count()}var barWidth=parsePercent(seriesModel.get("barWidth"),bandWidth),barMaxWidth=parsePercent(seriesModel.get("barMaxWidth"),bandWidth),barMinWidth=parsePercent(seriesModel.get("barMinWidth")||(isInLargeMode(seriesModel)?.5:1),bandWidth),barGap=seriesModel.get("barGap"),barCategoryGap=seriesModel.get("barCategoryGap");seriesInfoList.push({bandWidth:bandWidth,barWidth:barWidth,barMaxWidth:barMaxWidth,barMinWidth:barMinWidth,barGap:barGap,barCategoryGap:barCategoryGap,axisKey:getAxisKey(baseAxis),stackId:getSeriesStackId(seriesModel)})})),function(seriesInfoList){var columnsMap={};each$b(seriesInfoList,(function(seriesInfo,idx){var axisKey=seriesInfo.axisKey,bandWidth=seriesInfo.bandWidth,columnsOnAxis=columnsMap[axisKey]||{bandWidth:bandWidth,remainedWidth:bandWidth,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},stacks=columnsOnAxis.stacks;columnsMap[axisKey]=columnsOnAxis;var stackId=seriesInfo.stackId;stacks[stackId]||columnsOnAxis.autoWidthCount++,stacks[stackId]=stacks[stackId]||{width:0,maxWidth:0};var barWidth=seriesInfo.barWidth;barWidth&&!stacks[stackId].width&&(stacks[stackId].width=barWidth,barWidth=Math.min(columnsOnAxis.remainedWidth,barWidth),columnsOnAxis.remainedWidth-=barWidth);var barMaxWidth=seriesInfo.barMaxWidth;barMaxWidth&&(stacks[stackId].maxWidth=barMaxWidth);var barMinWidth=seriesInfo.barMinWidth;barMinWidth&&(stacks[stackId].minWidth=barMinWidth);var barGap=seriesInfo.barGap;null!=barGap&&(columnsOnAxis.gap=barGap);var barCategoryGap=seriesInfo.barCategoryGap;null!=barCategoryGap&&(columnsOnAxis.categoryGap=barCategoryGap)}));var result={};return each$b(columnsMap,(function(columnsOnAxis,coordSysName){result[coordSysName]={};var stacks=columnsOnAxis.stacks,bandWidth=columnsOnAxis.bandWidth,categoryGapPercent=columnsOnAxis.categoryGap;if(null==categoryGapPercent){var columnCount=keys$1(stacks).length;categoryGapPercent=Math.max(35-4*columnCount,15)+"%"}var categoryGap=parsePercent(categoryGapPercent,bandWidth),barGapPercent=parsePercent(columnsOnAxis.gap,1),remainedWidth=columnsOnAxis.remainedWidth,autoWidthCount=columnsOnAxis.autoWidthCount,autoWidth=(remainedWidth-categoryGap)/(autoWidthCount+(autoWidthCount-1)*barGapPercent);autoWidth=Math.max(autoWidth,0),each$b(stacks,(function(column){var maxWidth=column.maxWidth,minWidth=column.minWidth;if(column.width){finalWidth=column.width;maxWidth&&(finalWidth=Math.min(finalWidth,maxWidth)),minWidth&&(finalWidth=Math.max(finalWidth,minWidth)),column.width=finalWidth,remainedWidth-=finalWidth+barGapPercent*finalWidth,autoWidthCount--}else{var finalWidth=autoWidth;maxWidth&&maxWidth<finalWidth&&(finalWidth=Math.min(maxWidth,remainedWidth)),minWidth&&minWidth>finalWidth&&(finalWidth=minWidth),finalWidth!==autoWidth&&(column.width=finalWidth,remainedWidth-=finalWidth+barGapPercent*finalWidth,autoWidthCount--)}})),autoWidth=(remainedWidth-categoryGap)/(autoWidthCount+(autoWidthCount-1)*barGapPercent),autoWidth=Math.max(autoWidth,0);var lastColumn,widthSum=0;each$b(stacks,(function(column,idx){column.width||(column.width=autoWidth),lastColumn=column,widthSum+=column.width*(1+barGapPercent)})),lastColumn&&(widthSum-=lastColumn.width*barGapPercent);var offset=-widthSum/2;each$b(stacks,(function(column,stackId){result[coordSysName][stackId]=result[coordSysName][stackId]||{bandWidth:bandWidth,offset:offset,width:column.width},offset+=column.width*(1+barGapPercent)}))})),result}(seriesInfoList)}function layout$2(seriesType,ecModel){var seriesModels=prepareLayoutBarSeries(seriesType,ecModel),barWidthAndOffset=makeColumnLayout(seriesModels);each$b(seriesModels,(function(seriesModel){var data=seriesModel.getData(),baseAxis=seriesModel.coordinateSystem.getBaseAxis(),stackId=getSeriesStackId(seriesModel),columnLayoutInfo=barWidthAndOffset[getAxisKey(baseAxis)][stackId],columnOffset=columnLayoutInfo.offset,columnWidth=columnLayoutInfo.width;data.setLayout({bandWidth:columnLayoutInfo.bandWidth,offset:columnOffset,size:columnWidth})}))}function createProgressiveLayout(seriesType){return{seriesType:seriesType,plan:createRenderPlanner(),reset:function(seriesModel){if(isOnCartesian(seriesModel)){var data=seriesModel.getData(),cartesian=seriesModel.coordinateSystem,baseAxis=cartesian.getBaseAxis(),valueAxis=cartesian.getOtherAxis(baseAxis),valueDimIdx=data.getDimensionIndex(data.mapDimension(valueAxis.dim)),baseDimIdx=data.getDimensionIndex(data.mapDimension(baseAxis.dim)),drawBackground=seriesModel.get("showBackground",!0),valueDim=data.mapDimension(valueAxis.dim),stackResultDim=data.getCalculationInfo("stackResultDimension"),stacked=isDimensionStacked(data,valueDim)&&!!data.getCalculationInfo("stackedOnSeries"),isValueAxisH=valueAxis.isHorizontal(),valueAxisStart=function(baseAxis,valueAxis){var startValue=valueAxis.model.get("startValue");startValue||(startValue=0);return valueAxis.toGlobalCoord(valueAxis.dataToCoord("log"===valueAxis.type?startValue>0?startValue:1:startValue))}(0,valueAxis),isLarge=isInLargeMode(seriesModel),barMinHeight=seriesModel.get("barMinHeight")||0,stackedDimIdx=stackResultDim&&data.getDimensionIndex(stackResultDim),columnWidth=data.getLayout("size"),columnOffset=data.getLayout("offset");return{progress:function(params,data){for(var dataIndex,count=params.count,largePoints=isLarge&&createFloat32Array(3*count),largeBackgroundPoints=isLarge&&drawBackground&&createFloat32Array(3*count),largeDataIndices=isLarge&&createFloat32Array(count),coordLayout=cartesian.master.getRect(),bgSize=isValueAxisH?coordLayout.width:coordLayout.height,store=data.getStore(),idxOffset=0;null!=(dataIndex=params.next());){var value=store.get(stacked?stackedDimIdx:valueDimIdx,dataIndex),baseValue=store.get(baseDimIdx,dataIndex),baseCoord=valueAxisStart,stackStartValue=void 0;stacked&&(stackStartValue=+value-store.get(valueDimIdx,dataIndex));var x=void 0,y=void 0,width=void 0,height=void 0;if(isValueAxisH){var coord=cartesian.dataToPoint([value,baseValue]);if(stacked)baseCoord=cartesian.dataToPoint([stackStartValue,baseValue])[0];x=baseCoord,y=coord[1]+columnOffset,width=coord[0]-baseCoord,height=columnWidth,Math.abs(width)<barMinHeight&&(width=(width<0?-1:1)*barMinHeight)}else{coord=cartesian.dataToPoint([baseValue,value]);if(stacked)baseCoord=cartesian.dataToPoint([baseValue,stackStartValue])[1];x=coord[0]+columnOffset,y=baseCoord,width=columnWidth,height=coord[1]-baseCoord,Math.abs(height)<barMinHeight&&(height=(height<=0?-1:1)*barMinHeight)}isLarge?(largePoints[idxOffset]=x,largePoints[idxOffset+1]=y,largePoints[idxOffset+2]=isValueAxisH?width:height,largeBackgroundPoints&&(largeBackgroundPoints[idxOffset]=isValueAxisH?coordLayout.x:x,largeBackgroundPoints[idxOffset+1]=isValueAxisH?y:coordLayout.y,largeBackgroundPoints[idxOffset+2]=bgSize),largeDataIndices[dataIndex]=dataIndex):data.setItemLayout(dataIndex,{x:x,y:y,width:width,height:height}),idxOffset+=3}isLarge&&data.setLayout({largePoints:largePoints,largeDataIndices:largeDataIndices,largeBackgroundPoints:largeBackgroundPoints,valueAxisHorizontal:isValueAxisH})}}}}}}function isOnCartesian(seriesModel){return seriesModel.coordinateSystem&&"cartesian2d"===seriesModel.coordinateSystem.type}function isInLargeMode(seriesModel){return seriesModel.pipelineContext&&seriesModel.pipelineContext.large}var TimeScale=function(_super){function TimeScale(settings){var _this=_super.call(this,settings)||this;return _this.type="time",_this}return __extends(TimeScale,_super),TimeScale.prototype.getLabel=function(tick){var useUTC=this.getSetting("useUTC");return format(tick.value,fullLeveledFormatter[function(timeUnit){switch(timeUnit){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(getPrimaryTimeUnit(this._minLevelUnit))]||fullLeveledFormatter.second,useUTC,this.getSetting("locale"))},TimeScale.prototype.getFormattedLabel=function(tick,idx,labelFormatter){var isUTC=this.getSetting("useUTC");return function(tick,idx,formatter,lang,isUTC){var template=null;if(isString(formatter))template=formatter;else if(isFunction(formatter))template=formatter(tick.value,idx,{level:tick.level});else{var defaults$1=extend({},defaultLeveledFormatter);if(tick.level>0)for(var i=0;i<primaryTimeUnits.length;++i)defaults$1[primaryTimeUnits[i]]="{primary|"+defaults$1[primaryTimeUnits[i]]+"}";var mergedFormatter=formatter?!1===formatter.inherit?formatter:defaults(formatter,defaults$1):defaults$1,unit=getUnitFromValue(tick.value,isUTC);if(mergedFormatter[unit])template=mergedFormatter[unit];else if(mergedFormatter.inherit){for(i=timeUnits.indexOf(unit)-1;i>=0;--i)if(mergedFormatter[unit]){template=mergedFormatter[unit];break}template=template||defaults$1.none}if(isArray(template)){var levelId=null==tick.level?0:tick.level>=0?tick.level:template.length+tick.level;template=template[levelId=Math.min(levelId,template.length-1)]}}return format(new Date(tick.value),template,isUTC,lang)}(tick,idx,labelFormatter,this.getSetting("locale"),isUTC)},TimeScale.prototype.getTicks=function(){var interval=this._interval,extent=this._extent,ticks=[];if(!interval)return ticks;ticks.push({value:extent[0],level:0});var useUTC=this.getSetting("useUTC"),innerTicks=function(bottomUnitName,approxInterval,isUTC,extent){var safeLimit=1e4,unitNames=timeUnits,iter=0;function addTicksInSpan(interval,minTimestamp,maxTimestamp,getMethodName,setMethodName,isDate,out){for(var date=new Date(minTimestamp),dateTime=minTimestamp,d=date[getMethodName]();dateTime<maxTimestamp&&dateTime<=extent[1];)out.push({value:dateTime}),d+=interval,date[setMethodName](d),dateTime=date.getTime();out.push({value:dateTime,notAdd:!0})}function addLevelTicks(unitName,lastLevelTicks,levelTicks){var newAddedTicks=[],isFirstLevel=!lastLevelTicks.length;if(!function(unit,valueA,valueB,isUTC){var dateA=parseDate$1(valueA),dateB=parseDate$1(valueB),isSame=function(unit){return getUnitValue(dateA,unit,isUTC)===getUnitValue(dateB,unit,isUTC)},isSameYear=function(){return isSame("year")},isSameMonth=function(){return isSameYear()&&isSame("month")},isSameDay=function(){return isSameMonth()&&isSame("day")},isSameHour=function(){return isSameDay()&&isSame("hour")},isSameMinute=function(){return isSameHour()&&isSame("minute")},isSameSecond=function(){return isSameMinute()&&isSame("second")},isSameMilliSecond=function(){return isSameSecond()&&isSame("millisecond")};switch(unit){case"year":return isSameYear();case"month":return isSameMonth();case"day":return isSameDay();case"hour":return isSameHour();case"minute":return isSameMinute();case"second":return isSameSecond();case"millisecond":return isSameMilliSecond()}}(getPrimaryTimeUnit(unitName),extent[0],extent[1],isUTC)){isFirstLevel&&(lastLevelTicks=[{value:getFirstTimestampOfUnit(new Date(extent[0]),unitName,isUTC)},{value:extent[1]}]);for(var i=0;i<lastLevelTicks.length-1;i++){var startTick=lastLevelTicks[i].value,endTick=lastLevelTicks[i+1].value;if(startTick!==endTick){var interval=void 0,getterName=void 0,setterName=void 0,isDate=!1;switch(unitName){case"year":interval=Math.max(1,Math.round(approxInterval/864e5/365)),getterName=fullYearGetterName(isUTC),setterName=fullYearSetterName(isUTC);break;case"half-year":case"quarter":case"month":interval=getMonthInterval(approxInterval),getterName=monthGetterName(isUTC),setterName=monthSetterName(isUTC);break;case"week":case"half-week":case"day":interval=getDateInterval(approxInterval),getterName=dateGetterName(isUTC),setterName=dateSetterName(isUTC),isDate=!0;break;case"half-day":case"quarter-day":case"hour":interval=getHourInterval(approxInterval),getterName=hoursGetterName(isUTC),setterName=hoursSetterName(isUTC);break;case"minute":interval=getMinutesAndSecondsInterval(approxInterval,!0),getterName=minutesGetterName(isUTC),setterName=minutesSetterName(isUTC);break;case"second":interval=getMinutesAndSecondsInterval(approxInterval,!1),getterName=secondsGetterName(isUTC),setterName=secondsSetterName(isUTC);break;case"millisecond":interval=getMillisecondsInterval(approxInterval),getterName=millisecondsGetterName(isUTC),setterName=millisecondsSetterName(isUTC)}addTicksInSpan(interval,startTick,endTick,getterName,setterName,isDate,newAddedTicks),"year"===unitName&&levelTicks.length>1&&0===i&&levelTicks.unshift({value:levelTicks[0].value-interval})}}for(i=0;i<newAddedTicks.length;i++)levelTicks.push(newAddedTicks[i]);return newAddedTicks}}for(var levelsTicks=[],currentLevelTicks=[],tickCount=0,lastLevelTickCount=0,i=0;i<unitNames.length&&iter++<safeLimit;++i){var primaryTimeUnit=getPrimaryTimeUnit(unitNames[i]);if(isPrimaryTimeUnit(unitNames[i]))if(addLevelTicks(unitNames[i],levelsTicks[levelsTicks.length-1]||[],currentLevelTicks),primaryTimeUnit!==(unitNames[i+1]?getPrimaryTimeUnit(unitNames[i+1]):null)){if(currentLevelTicks.length){lastLevelTickCount=tickCount,currentLevelTicks.sort((function(a,b){return a.value-b.value}));for(var levelTicksRemoveDuplicated=[],i_1=0;i_1<currentLevelTicks.length;++i_1){var tickValue=currentLevelTicks[i_1].value;0!==i_1&&currentLevelTicks[i_1-1].value===tickValue||(levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]),tickValue>=extent[0]&&tickValue<=extent[1]&&tickCount++)}var targetTickNum=(extent[1]-extent[0])/approxInterval;if(tickCount>1.5*targetTickNum&&lastLevelTickCount>targetTickNum/1.5)break;if(levelsTicks.push(levelTicksRemoveDuplicated),tickCount>targetTickNum||bottomUnitName===unitNames[i])break}currentLevelTicks=[]}}"production"!==process.env.NODE_ENV&&iter>=safeLimit&&warn("Exceed safe limit.");var levelsTicksInExtent=filter(map$1(levelsTicks,(function(levelTicks){return filter(levelTicks,(function(tick){return tick.value>=extent[0]&&tick.value<=extent[1]&&!tick.notAdd}))})),(function(levelTicks){return levelTicks.length>0})),ticks=[],maxLevel=levelsTicksInExtent.length-1;for(i=0;i<levelsTicksInExtent.length;++i)for(var levelTicks=levelsTicksInExtent[i],k=0;k<levelTicks.length;++k)ticks.push({value:levelTicks[k].value,level:maxLevel-i});ticks.sort((function(a,b){return a.value-b.value}));var result=[];for(i=0;i<ticks.length;++i)0!==i&&ticks[i].value===ticks[i-1].value||result.push(ticks[i]);return result}(this._minLevelUnit,this._approxInterval,useUTC,extent);return(ticks=ticks.concat(innerTicks)).push({value:extent[1],level:0}),ticks},TimeScale.prototype.calcNiceExtent=function(opt){var extent=this._extent;if(extent[0]===extent[1]&&(extent[0]-=864e5,extent[1]+=864e5),extent[1]===-1/0&&extent[0]===1/0){var d=new Date;extent[1]=+new Date(d.getFullYear(),d.getMonth(),d.getDate()),extent[0]=extent[1]-864e5}this.calcNiceTicks(opt.splitNumber,opt.minInterval,opt.maxInterval)},TimeScale.prototype.calcNiceTicks=function(approxTickNum,minInterval,maxInterval){approxTickNum=approxTickNum||10;var extent=this._extent,span=extent[1]-extent[0];this._approxInterval=span/approxTickNum,null!=minInterval&&this._approxInterval<minInterval&&(this._approxInterval=minInterval),null!=maxInterval&&this._approxInterval>maxInterval&&(this._approxInterval=maxInterval);var scaleIntervalsLen=scaleIntervals.length,idx=Math.min(function(a,x,lo,hi){for(;lo<hi;){var mid=lo+hi>>>1;a[mid][1]<x?lo=mid+1:hi=mid}return lo}(scaleIntervals,this._approxInterval,0,scaleIntervalsLen),scaleIntervalsLen-1);this._interval=scaleIntervals[idx][1],this._minLevelUnit=scaleIntervals[Math.max(idx-1,0)][0]},TimeScale.prototype.parse=function(val){return isNumber(val)?val:+parseDate$1(val)},TimeScale.prototype.contain=function(val){return contain(this.parse(val),this._extent)},TimeScale.prototype.normalize=function(val){return normalize$1(this.parse(val),this._extent)},TimeScale.prototype.scale=function(val){return scale(val,this._extent)},TimeScale.type="time",TimeScale}(IntervalScale$1),scaleIntervals=[["second",1e3],["minute",6e4],["hour",36e5],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",15768e6],["year",31536e6]];function getDateInterval(approxInterval,daysInMonth){return(approxInterval/=864e5)>16?16:approxInterval>7.5?7:approxInterval>3.5?4:approxInterval>1.5?2:1}function getMonthInterval(approxInterval){return(approxInterval/=2592e6)>6?6:approxInterval>3?3:approxInterval>2?2:1}function getHourInterval(approxInterval){return(approxInterval/=36e5)>12?12:approxInterval>6?6:approxInterval>3.5?4:approxInterval>2?2:1}function getMinutesAndSecondsInterval(approxInterval,isMinutes){return(approxInterval/=isMinutes?6e4:1e3)>30?30:approxInterval>20?20:approxInterval>15?15:approxInterval>10?10:approxInterval>5?5:approxInterval>2?2:1}function getMillisecondsInterval(approxInterval){return nice(approxInterval,!0)}function getFirstTimestampOfUnit(date,unitName,isUTC){var outDate=new Date(date);switch(getPrimaryTimeUnit(unitName)){case"year":case"month":outDate[monthSetterName(isUTC)](0);case"day":outDate[dateSetterName(isUTC)](1);case"hour":outDate[hoursSetterName(isUTC)](0);case"minute":outDate[minutesSetterName(isUTC)](0);case"second":outDate[secondsSetterName(isUTC)](0),outDate[millisecondsSetterName(isUTC)](0)}return outDate.getTime()}Scale$1.registerClass(TimeScale);var TimeScale$1=TimeScale,scaleProto=Scale$1.prototype,intervalScaleProto=IntervalScale$1.prototype,roundingErrorFix=round$3,mathFloor$1=Math.floor,mathCeil$1=Math.ceil,mathPow$1=Math.pow,mathLog$1=Math.log,LogScale=function(_super){function LogScale(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type="log",_this.base=10,_this._originalScale=new IntervalScale$1,_this._interval=0,_this}return __extends(LogScale,_super),LogScale.prototype.getTicks=function(expandToNicedExtent){var originalScale=this._originalScale,extent=this._extent,originalExtent=originalScale.getExtent();return map$1(intervalScaleProto.getTicks.call(this,expandToNicedExtent),(function(tick){var val=tick.value,powVal=round$3(mathPow$1(this.base,val));return powVal=val===extent[0]&&this._fixMin?fixRoundingError(powVal,originalExtent[0]):powVal,{value:powVal=val===extent[1]&&this._fixMax?fixRoundingError(powVal,originalExtent[1]):powVal}}),this)},LogScale.prototype.setExtent=function(start,end){var base=mathLog$1(this.base);start=mathLog$1(Math.max(0,start))/base,end=mathLog$1(Math.max(0,end))/base,intervalScaleProto.setExtent.call(this,start,end)},LogScale.prototype.getExtent=function(){var base=this.base,extent=scaleProto.getExtent.call(this);extent[0]=mathPow$1(base,extent[0]),extent[1]=mathPow$1(base,extent[1]);var originalExtent=this._originalScale.getExtent();return this._fixMin&&(extent[0]=fixRoundingError(extent[0],originalExtent[0])),this._fixMax&&(extent[1]=fixRoundingError(extent[1],originalExtent[1])),extent},LogScale.prototype.unionExtent=function(extent){this._originalScale.unionExtent(extent);var base=this.base;extent[0]=mathLog$1(extent[0])/mathLog$1(base),extent[1]=mathLog$1(extent[1])/mathLog$1(base),scaleProto.unionExtent.call(this,extent)},LogScale.prototype.unionExtentFromData=function(data,dim){this.unionExtent(data.getApproximateExtent(dim))},LogScale.prototype.calcNiceTicks=function(approxTickNum){approxTickNum=approxTickNum||10;var extent=this._extent,span=extent[1]-extent[0];if(!(span===1/0||span<=0)){var val,interval=(val=span,Math.pow(10,quantityExponent(val)));for(approxTickNum/span*interval<=.5&&(interval*=10);!isNaN(interval)&&Math.abs(interval)<1&&Math.abs(interval)>0;)interval*=10;var niceExtent=[round$3(mathCeil$1(extent[0]/interval)*interval),round$3(mathFloor$1(extent[1]/interval)*interval)];this._interval=interval,this._niceExtent=niceExtent}},LogScale.prototype.calcNiceExtent=function(opt){intervalScaleProto.calcNiceExtent.call(this,opt),this._fixMin=opt.fixMin,this._fixMax=opt.fixMax},LogScale.prototype.parse=function(val){return val},LogScale.prototype.contain=function(val){return contain(val=mathLog$1(val)/mathLog$1(this.base),this._extent)},LogScale.prototype.normalize=function(val){return normalize$1(val=mathLog$1(val)/mathLog$1(this.base),this._extent)},LogScale.prototype.scale=function(val){return val=scale(val,this._extent),mathPow$1(this.base,val)},LogScale.type="log",LogScale}(Scale$1),proto=LogScale.prototype;function fixRoundingError(val,originalVal){return roundingErrorFix(val,getPrecision(originalVal))}proto.getMinorTicks=intervalScaleProto.getMinorTicks,proto.getLabel=intervalScaleProto.getLabel,Scale$1.registerClass(LogScale);var LogScale$1=LogScale,ScaleRawExtentInfo=function(){function ScaleRawExtentInfo(scale,model,originalExtent){this._prepareParams(scale,model,originalExtent)}return ScaleRawExtentInfo.prototype._prepareParams=function(scale,model,dataExtent){dataExtent[1]<dataExtent[0]&&(dataExtent=[NaN,NaN]),this._dataMin=dataExtent[0],this._dataMax=dataExtent[1];var isOrdinal=this._isOrdinal="ordinal"===scale.type;this._needCrossZero="interval"===scale.type&&model.getNeedCrossZero&&model.getNeedCrossZero();var axisMinValue=model.get("min",!0);null==axisMinValue&&(axisMinValue=model.get("startValue",!0));var modelMinRaw=this._modelMinRaw=axisMinValue;isFunction(modelMinRaw)?this._modelMinNum=parseAxisModelMinMax(scale,modelMinRaw({min:dataExtent[0],max:dataExtent[1]})):"dataMin"!==modelMinRaw&&(this._modelMinNum=parseAxisModelMinMax(scale,modelMinRaw));var modelMaxRaw=this._modelMaxRaw=model.get("max",!0);if(isFunction(modelMaxRaw)?this._modelMaxNum=parseAxisModelMinMax(scale,modelMaxRaw({min:dataExtent[0],max:dataExtent[1]})):"dataMax"!==modelMaxRaw&&(this._modelMaxNum=parseAxisModelMinMax(scale,modelMaxRaw)),isOrdinal)this._axisDataLen=model.getCategories().length;else{var boundaryGap=model.get("boundaryGap"),boundaryGapArr=isArray(boundaryGap)?boundaryGap:[boundaryGap||0,boundaryGap||0];"boolean"==typeof boundaryGapArr[0]||"boolean"==typeof boundaryGapArr[1]?("production"!==process.env.NODE_ENV&&console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'),this._boundaryGapInner=[0,0]):this._boundaryGapInner=[parsePercent$1(boundaryGapArr[0],1),parsePercent$1(boundaryGapArr[1],1)]}},ScaleRawExtentInfo.prototype.calculate=function(){var isOrdinal=this._isOrdinal,dataMin=this._dataMin,dataMax=this._dataMax,axisDataLen=this._axisDataLen,boundaryGapInner=this._boundaryGapInner,span=isOrdinal?null:dataMax-dataMin||Math.abs(dataMin),min="dataMin"===this._modelMinRaw?dataMin:this._modelMinNum,max="dataMax"===this._modelMaxRaw?dataMax:this._modelMaxNum,minFixed=null!=min,maxFixed=null!=max;null==min&&(min=isOrdinal?axisDataLen?0:NaN:dataMin-boundaryGapInner[0]*span),null==max&&(max=isOrdinal?axisDataLen?axisDataLen-1:NaN:dataMax+boundaryGapInner[1]*span),(null==min||!isFinite(min))&&(min=NaN),(null==max||!isFinite(max))&&(max=NaN);var isBlank=eqNaN(min)||eqNaN(max)||isOrdinal&&!axisDataLen;this._needCrossZero&&(min>0&&max>0&&!minFixed&&(min=0),min<0&&max<0&&!maxFixed&&(max=0));var determinedMin=this._determinedMin,determinedMax=this._determinedMax;return null!=determinedMin&&(min=determinedMin,minFixed=!0),null!=determinedMax&&(max=determinedMax,maxFixed=!0),{min:min,max:max,minFixed:minFixed,maxFixed:maxFixed,isBlank:isBlank}},ScaleRawExtentInfo.prototype.modifyDataMinMax=function(minMaxName,val){"production"!==process.env.NODE_ENV&&assert(!this.frozen),this[DATA_MIN_MAX_ATTR[minMaxName]]=val},ScaleRawExtentInfo.prototype.setDeterminedMinMax=function(minMaxName,val){var attr=DETERMINED_MIN_MAX_ATTR[minMaxName];"production"!==process.env.NODE_ENV&&assert(!this.frozen&&null==this[attr]),this[attr]=val},ScaleRawExtentInfo.prototype.freeze=function(){this.frozen=!0},ScaleRawExtentInfo}(),DETERMINED_MIN_MAX_ATTR={min:"_determinedMin",max:"_determinedMax"},DATA_MIN_MAX_ATTR={min:"_dataMin",max:"_dataMax"};function ensureScaleRawExtentInfo(scale,model,originalExtent){var rawExtentInfo=scale.rawExtentInfo;return rawExtentInfo||(rawExtentInfo=new ScaleRawExtentInfo(scale,model,originalExtent),scale.rawExtentInfo=rawExtentInfo,rawExtentInfo)}function parseAxisModelMinMax(scale,minMax){return null==minMax?null:eqNaN(minMax)?NaN:scale.parse(minMax)}function getScaleExtent(scale,model){var scaleType=scale.type,rawExtentResult=ensureScaleRawExtentInfo(scale,model,scale.getExtent()).calculate();scale.setBlank(rawExtentResult.isBlank);var min=rawExtentResult.min,max=rawExtentResult.max,ecModel=model.ecModel;if(ecModel&&"time"===scaleType){var barSeriesModels=prepareLayoutBarSeries("bar",ecModel),isBaseAxisAndHasBarSeries_1=!1;if(each$b(barSeriesModels,(function(seriesModel){isBaseAxisAndHasBarSeries_1=isBaseAxisAndHasBarSeries_1||seriesModel.getBaseAxis()===model.axis})),isBaseAxisAndHasBarSeries_1){var barWidthAndOffset=makeColumnLayout(barSeriesModels),adjustedScale=function(min,max,model,barWidthAndOffset){var axisExtent=model.axis.getExtent(),axisLength=Math.abs(axisExtent[1]-axisExtent[0]),barsOnCurrentAxis=function(barWidthAndOffset,axis,seriesModel){if(barWidthAndOffset&&axis){var result=barWidthAndOffset[getAxisKey(axis)];return null!=result&&null!=seriesModel?result[getSeriesStackId(seriesModel)]:result}}(barWidthAndOffset,model.axis);if(void 0===barsOnCurrentAxis)return{min:min,max:max};var minOverflow=1/0;each$b(barsOnCurrentAxis,(function(item){minOverflow=Math.min(item.offset,minOverflow)}));var maxOverflow=-1/0;each$b(barsOnCurrentAxis,(function(item){maxOverflow=Math.max(item.offset+item.width,maxOverflow)})),minOverflow=Math.abs(minOverflow),maxOverflow=Math.abs(maxOverflow);var totalOverFlow=minOverflow+maxOverflow,oldRange=max-min,overflowBuffer=oldRange/(1-(minOverflow+maxOverflow)/axisLength)-oldRange;return max+=overflowBuffer*(maxOverflow/totalOverFlow),min-=overflowBuffer*(minOverflow/totalOverFlow),{min:min,max:max}}(min,max,model,barWidthAndOffset);min=adjustedScale.min,max=adjustedScale.max}}return{extent:[min,max],fixMin:rawExtentResult.minFixed,fixMax:rawExtentResult.maxFixed}}function niceScaleExtent(scale,inModel){var model=inModel,extentInfo=getScaleExtent(scale,model),extent=extentInfo.extent,splitNumber=model.get("splitNumber");scale instanceof LogScale$1&&(scale.base=model.get("logBase"));var scaleType=scale.type,interval=model.get("interval"),isIntervalOrTime="interval"===scaleType||"time"===scaleType;scale.setExtent(extent[0],extent[1]),scale.calcNiceExtent({splitNumber:splitNumber,fixMin:extentInfo.fixMin,fixMax:extentInfo.fixMax,minInterval:isIntervalOrTime?model.get("minInterval"):null,maxInterval:isIntervalOrTime?model.get("maxInterval"):null}),null!=interval&&scale.setInterval&&scale.setInterval(interval)}function createScaleByModel(model,axisType){if(axisType=axisType||model.get("type"))switch(axisType){case"category":return new OrdinalScale$1({ordinalMeta:model.getOrdinalMeta?model.getOrdinalMeta():model.getCategories(),extent:[1/0,-1/0]});case"time":return new TimeScale$1({locale:model.ecModel.getLocaleModel(),useUTC:model.ecModel.get("useUTC")});default:return new(Scale$1.getClass(axisType)||IntervalScale$1)}}function makeLabelFormatter(axis){var cb,tpl,labelFormatter=axis.getLabelModel().get("formatter"),categoryTickStart="category"===axis.type?axis.scale.getExtent()[0]:null;return"time"===axis.scale.type?(tpl=labelFormatter,function(tick,idx){return axis.scale.getFormattedLabel(tick,idx,tpl)}):isString(labelFormatter)?function(tpl){return function(tick){var label=axis.scale.getLabel(tick);return tpl.replace("{value}",null!=label?label:"")}}(labelFormatter):isFunction(labelFormatter)?(cb=labelFormatter,function(tick,idx){return null!=categoryTickStart&&(idx=tick.value-categoryTickStart),cb(getAxisRawValue(axis,tick),idx,null!=tick.level?{level:tick.level}:null)}):function(tick){return axis.scale.getLabel(tick)}}function getAxisRawValue(axis,tick){return"category"===axis.type?axis.scale.getLabel(tick):tick.value}function rotateTextRect(textRect,rotate){var rotateRadians=rotate*Math.PI/180,beforeWidth=textRect.width,beforeHeight=textRect.height,afterWidth=beforeWidth*Math.abs(Math.cos(rotateRadians))+Math.abs(beforeHeight*Math.sin(rotateRadians)),afterHeight=beforeWidth*Math.abs(Math.sin(rotateRadians))+Math.abs(beforeHeight*Math.cos(rotateRadians));return new BoundingRect$1(textRect.x,textRect.y,afterWidth,afterHeight)}function getOptionCategoryInterval(model){var interval=model.get("interval");return null==interval?"auto":interval}function shouldShowAllLabels(axis){return"category"===axis.type&&0===getOptionCategoryInterval(axis.getLabelModel())}function getDataDimensionsOnAxis(data,axisDim){var dataDimMap={};return each$b(data.mapDimensionsAll(axisDim),(function(dataDim){dataDimMap[getStackedDimension(data,dataDim)]=!0})),keys$1(dataDimMap)}var AxisModelCommonMixin=function(){function AxisModelCommonMixin(){}return AxisModelCommonMixin.prototype.getNeedCrossZero=function(){return!this.option.scale},AxisModelCommonMixin.prototype.getCoordSysModel=function(){},AxisModelCommonMixin}(),extensions=[],extensionRegisters={registerPreprocessor:registerPreprocessor,registerProcessor:registerProcessor,registerPostInit:function(postInitFunc){registerUpdateLifecycle("afterinit",postInitFunc)},registerPostUpdate:function(postUpdateFunc){registerUpdateLifecycle("afterupdate",postUpdateFunc)},registerUpdateLifecycle:registerUpdateLifecycle,registerAction:registerAction,registerCoordinateSystem:function(type,coordSysCreator){CoordinateSystem.register(type,coordSysCreator)},registerLayout:function(priority,layoutTask){normalizeRegister(visualFuncs,priority,layoutTask,1e3,"layout")},registerVisual:registerVisual,registerTransform:registerTransform,registerLoading:registerLoading,registerMap:function(mapName,geoJson,specialAreas){var name,registerMap=(name="registerMap","production"!==process.env.NODE_ENV&&(implsStore[name]||error("Implementation of "+name+" doesn't exists.")),implsStore[name]);registerMap&&registerMap(mapName,geoJson,specialAreas)},registerImpl:function(name,impl){"production"!==process.env.NODE_ENV&&implsStore[name]&&error("Already has an implementation of "+name+"."),implsStore[name]=impl},PRIORITY:PRIORITY,ComponentModel:ComponentModel$1,ComponentView:ComponentView$1,SeriesModel:SeriesModel$1,ChartView:ChartView$1,registerComponentModel:function(ComponentModelClass){ComponentModel$1.registerClass(ComponentModelClass)},registerComponentView:function(ComponentViewClass){ComponentView$1.registerClass(ComponentViewClass)},registerSeriesModel:function(SeriesModelClass){SeriesModel$1.registerClass(SeriesModelClass)},registerChartView:function(ChartViewClass){ChartView$1.registerClass(ChartViewClass)},registerSubTypeDefaulter:function(componentType,defaulter){ComponentModel$1.registerSubTypeDefaulter(componentType,defaulter)},registerPainter:function(painterType,PainterCtor){var Ctor;Ctor=PainterCtor,painterCtors[painterType]=Ctor}};function use(ext){isArray(ext)?each$b(ext,(function(singleExt){use(singleExt)})):indexOf(extensions,ext)>=0||(extensions.push(ext),isFunction(ext)&&(ext={install:ext}),ext.install(extensionRegisters))}var inner$d=makeInner();function tickValuesToNumbers(axis,values){var nums=map$1(values,(function(val){return axis.scale.parse(val)}));return"time"===axis.type&&nums.length>0&&(nums.sort(),nums.unshift(nums[0]),nums.push(nums[nums.length-1])),nums}function createAxisLabels(axis){var custom=axis.getLabelModel().get("customValues");if(custom){var labelFormatter_1=makeLabelFormatter(axis),extent_1=axis.scale.getExtent();return{labels:map$1(filter(tickValuesToNumbers(axis,custom),(function(val){return val>=extent_1[0]&&val<=extent_1[1]})),(function(numval){var tick={value:numval};return{formattedLabel:labelFormatter_1(tick),rawLabel:axis.scale.getLabel(tick),tickValue:numval}}))}}return"category"===axis.type?function(axis){var labelModel=axis.getLabelModel(),result=makeCategoryLabelsActually(axis,labelModel);return!labelModel.get("show")||axis.scale.isBlank()?{labels:[],labelCategoryInterval:result.labelCategoryInterval}:result}(axis):function(axis){var ticks=axis.scale.getTicks(),labelFormatter=makeLabelFormatter(axis);return{labels:map$1(ticks,(function(tick,idx){return{level:tick.level,formattedLabel:labelFormatter(tick,idx),rawLabel:axis.scale.getLabel(tick),tickValue:tick.value}}))}}(axis)}function createAxisTicks(axis,tickModel){var custom=axis.getTickModel().get("customValues");if(custom){var extent_2=axis.scale.getExtent();return{ticks:filter(tickValuesToNumbers(axis,custom),(function(val){return val>=extent_2[0]&&val<=extent_2[1]}))}}return"category"===axis.type?function(axis,tickModel){var ticks,tickCategoryInterval,ticksCache=getListCache(axis,"ticks"),optionTickInterval=getOptionCategoryInterval(tickModel),result=listCacheGet(ticksCache,optionTickInterval);if(result)return result;tickModel.get("show")&&!axis.scale.isBlank()||(ticks=[]);if(isFunction(optionTickInterval))ticks=makeLabelsByCustomizedCategoryInterval(axis,optionTickInterval,!0);else if("auto"===optionTickInterval){var labelsResult=makeCategoryLabelsActually(axis,axis.getLabelModel());tickCategoryInterval=labelsResult.labelCategoryInterval,ticks=map$1(labelsResult.labels,(function(labelItem){return labelItem.tickValue}))}else ticks=makeLabelsByNumericCategoryInterval(axis,tickCategoryInterval=optionTickInterval,!0);return listCacheSet(ticksCache,optionTickInterval,{ticks:ticks,tickCategoryInterval:tickCategoryInterval})}(axis,tickModel):{ticks:map$1(axis.scale.getTicks(),(function(tick){return tick.value}))}}function makeCategoryLabelsActually(axis,labelModel){var labels,numericLabelInterval,labelsCache=getListCache(axis,"labels"),optionLabelInterval=getOptionCategoryInterval(labelModel),result=listCacheGet(labelsCache,optionLabelInterval);return result||(isFunction(optionLabelInterval)?labels=makeLabelsByCustomizedCategoryInterval(axis,optionLabelInterval):(numericLabelInterval="auto"===optionLabelInterval?function(axis){var result=inner$d(axis).autoInterval;return null!=result?result:inner$d(axis).autoInterval=axis.calculateCategoryInterval()}(axis):optionLabelInterval,labels=makeLabelsByNumericCategoryInterval(axis,numericLabelInterval)),listCacheSet(labelsCache,optionLabelInterval,{labels:labels,labelCategoryInterval:numericLabelInterval}))}function getListCache(axis,prop){return inner$d(axis)[prop]||(inner$d(axis)[prop]=[])}function listCacheGet(cache,key){for(var i=0;i<cache.length;i++)if(cache[i].key===key)return cache[i].value}function listCacheSet(cache,key,value){return cache.push({key:key,value:value}),value}function makeLabelsByNumericCategoryInterval(axis,categoryInterval,onlyTick){var labelFormatter=makeLabelFormatter(axis),ordinalScale=axis.scale,ordinalExtent=ordinalScale.getExtent(),labelModel=axis.getLabelModel(),result=[],step=Math.max((categoryInterval||0)+1,1),startTick=ordinalExtent[0],tickCount=ordinalScale.count();0!==startTick&&step>1&&tickCount/step>2&&(startTick=Math.round(Math.ceil(startTick/step)*step));var showAllLabel=shouldShowAllLabels(axis),includeMinLabel=labelModel.get("showMinLabel")||showAllLabel,includeMaxLabel=labelModel.get("showMaxLabel")||showAllLabel;includeMinLabel&&startTick!==ordinalExtent[0]&&addItem(ordinalExtent[0]);for(var tickValue=startTick;tickValue<=ordinalExtent[1];tickValue+=step)addItem(tickValue);function addItem(tickValue){var tickObj={value:tickValue};result.push(onlyTick?tickValue:{formattedLabel:labelFormatter(tickObj),rawLabel:ordinalScale.getLabel(tickObj),tickValue:tickValue})}return includeMaxLabel&&tickValue-step!==ordinalExtent[1]&&addItem(ordinalExtent[1]),result}function makeLabelsByCustomizedCategoryInterval(axis,categoryInterval,onlyTick){var ordinalScale=axis.scale,labelFormatter=makeLabelFormatter(axis),result=[];return each$b(ordinalScale.getTicks(),(function(tick){var rawLabel=ordinalScale.getLabel(tick),tickValue=tick.value;categoryInterval(tick.value,rawLabel)&&result.push(onlyTick?tickValue:{formattedLabel:labelFormatter(tick),rawLabel:rawLabel,tickValue:tickValue})})),result}var NORMALIZED_EXTENT=[0,1],Axis=function(){function Axis(dim,scale,extent){this.onBand=!1,this.inverse=!1,this.dim=dim,this.scale=scale,this._extent=extent||[0,0]}return Axis.prototype.contain=function(coord){var extent=this._extent,min=Math.min(extent[0],extent[1]),max=Math.max(extent[0],extent[1]);return coord>=min&&coord<=max},Axis.prototype.containData=function(data){return this.scale.contain(data)},Axis.prototype.getExtent=function(){return this._extent.slice()},Axis.prototype.getPixelPrecision=function(dataExtent){return getPixelPrecision(dataExtent||this.scale.getExtent(),this._extent)},Axis.prototype.setExtent=function(start,end){var extent=this._extent;extent[0]=start,extent[1]=end},Axis.prototype.dataToCoord=function(data,clamp){var extent=this._extent,scale=this.scale;return data=scale.normalize(data),this.onBand&&"ordinal"===scale.type&&fixExtentWithBands(extent=extent.slice(),scale.count()),linearMap(data,NORMALIZED_EXTENT,extent,clamp)},Axis.prototype.coordToData=function(coord,clamp){var extent=this._extent,scale=this.scale;this.onBand&&"ordinal"===scale.type&&fixExtentWithBands(extent=extent.slice(),scale.count());var t=linearMap(coord,extent,NORMALIZED_EXTENT,clamp);return this.scale.scale(t)},Axis.prototype.pointToData=function(point,clamp){},Axis.prototype.getTicksCoords=function(opt){var tickModel=(opt=opt||{}).tickModel||this.getTickModel(),ticksCoords=map$1(createAxisTicks(this,tickModel).ticks,(function(tickVal){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(tickVal):tickVal),tickValue:tickVal}}),this);return function(axis,ticksCoords,alignWithLabel,clamp){var ticksLen=ticksCoords.length;if(!axis.onBand||alignWithLabel||!ticksLen)return;var last,diffSize,axisExtent=axis.getExtent();if(1===ticksLen)ticksCoords[0].coord=axisExtent[0],last=ticksCoords[1]={coord:axisExtent[1],tickValue:ticksCoords[0].tickValue};else{var crossLen=ticksCoords[ticksLen-1].tickValue-ticksCoords[0].tickValue,shift_1=(ticksCoords[ticksLen-1].coord-ticksCoords[0].coord)/crossLen;each$b(ticksCoords,(function(ticksItem){ticksItem.coord-=shift_1/2}));var dataExtent=axis.scale.getExtent();diffSize=1+dataExtent[1]-ticksCoords[ticksLen-1].tickValue,last={coord:ticksCoords[ticksLen-1].coord+shift_1*diffSize,tickValue:dataExtent[1]+1},ticksCoords.push(last)}var inverse=axisExtent[0]>axisExtent[1];littleThan(ticksCoords[0].coord,axisExtent[0])&&(clamp?ticksCoords[0].coord=axisExtent[0]:ticksCoords.shift());clamp&&littleThan(axisExtent[0],ticksCoords[0].coord)&&ticksCoords.unshift({coord:axisExtent[0]});littleThan(axisExtent[1],last.coord)&&(clamp?last.coord=axisExtent[1]:ticksCoords.pop());clamp&&littleThan(last.coord,axisExtent[1])&&ticksCoords.push({coord:axisExtent[1]});function littleThan(a,b){return a=round$3(a),b=round$3(b),inverse?a>b:a<b}}(this,ticksCoords,tickModel.get("alignWithLabel"),opt.clamp),ticksCoords},Axis.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var splitNumber=this.model.getModel("minorTick").get("splitNumber");return splitNumber>0&&splitNumber<100||(splitNumber=5),map$1(this.scale.getMinorTicks(splitNumber),(function(minorTicksGroup){return map$1(minorTicksGroup,(function(minorTick){return{coord:this.dataToCoord(minorTick),tickValue:minorTick}}),this)}),this)},Axis.prototype.getViewLabels=function(){return createAxisLabels(this).labels},Axis.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},Axis.prototype.getTickModel=function(){return this.model.getModel("axisTick")},Axis.prototype.getBandWidth=function(){var axisExtent=this._extent,dataExtent=this.scale.getExtent(),len=dataExtent[1]-dataExtent[0]+(this.onBand?1:0);0===len&&(len=1);var size=Math.abs(axisExtent[1]-axisExtent[0]);return Math.abs(size)/len},Axis.prototype.calculateCategoryInterval=function(){return function(axis){var params=function(axis){var labelModel=axis.getLabelModel();return{axisRotate:axis.getRotate?axis.getRotate():axis.isHorizontal&&!axis.isHorizontal()?90:0,labelRotate:labelModel.get("rotate")||0,font:labelModel.getFont()}}(axis),labelFormatter=makeLabelFormatter(axis),rotation=(params.axisRotate-params.labelRotate)/180*Math.PI,ordinalScale=axis.scale,ordinalExtent=ordinalScale.getExtent(),tickCount=ordinalScale.count();if(ordinalExtent[1]-ordinalExtent[0]<1)return 0;var step=1;tickCount>40&&(step=Math.max(1,Math.floor(tickCount/40)));for(var tickValue=ordinalExtent[0],unitSpan=axis.dataToCoord(tickValue+1)-axis.dataToCoord(tickValue),unitW=Math.abs(unitSpan*Math.cos(rotation)),unitH=Math.abs(unitSpan*Math.sin(rotation)),maxW=0,maxH=0;tickValue<=ordinalExtent[1];tickValue+=step){var width,height,rect=getBoundingRect(labelFormatter({value:tickValue}),params.font,"center","top");width=1.3*rect.width,height=1.3*rect.height,maxW=Math.max(maxW,width,7),maxH=Math.max(maxH,height,7)}var dw=maxW/unitW,dh=maxH/unitH;isNaN(dw)&&(dw=1/0),isNaN(dh)&&(dh=1/0);var interval=Math.max(0,Math.floor(Math.min(dw,dh))),cache=inner$d(axis.model),axisExtent=axis.getExtent(),lastAutoInterval=cache.lastAutoInterval,lastTickCount=cache.lastTickCount;return null!=lastAutoInterval&&null!=lastTickCount&&Math.abs(lastAutoInterval-interval)<=1&&Math.abs(lastTickCount-tickCount)<=1&&lastAutoInterval>interval&&cache.axisExtent0===axisExtent[0]&&cache.axisExtent1===axisExtent[1]?interval=lastAutoInterval:(cache.lastTickCount=tickCount,cache.lastAutoInterval=interval,cache.axisExtent0=axisExtent[0],cache.axisExtent1=axisExtent[1]),interval}(this)},Axis}();function fixExtentWithBands(extent,nTick){var margin=(extent[1]-extent[0])/nTick/2;extent[0]+=margin,extent[1]-=margin}var Axis$1=Axis,PI2$1=2*Math.PI,CMD$1=PathProxy$1.CMD,DEFAULT_SEARCH_SPACE=["top","right","bottom","left"];function getCandidateAnchor(pos,distance,rect,outPt,outDir){var width=rect.width,height=rect.height;switch(pos){case"top":outPt.set(rect.x+width/2,rect.y-distance),outDir.set(0,-1);break;case"bottom":outPt.set(rect.x+width/2,rect.y+height+distance),outDir.set(0,1);break;case"left":outPt.set(rect.x-distance,rect.y+height/2),outDir.set(-1,0);break;case"right":outPt.set(rect.x+width+distance,rect.y+height/2),outDir.set(1,0)}}function projectPointToArc(cx,cy,r,startAngle,endAngle,anticlockwise,x,y,out){x-=cx,y-=cy;var d=Math.sqrt(x*x+y*y),ox=(x/=d)*r+cx,oy=(y/=d)*r+cy;if(Math.abs(startAngle-endAngle)%PI2$1<1e-4)return out[0]=ox,out[1]=oy,d-r;if(anticlockwise){var tmp=startAngle;startAngle=normalizeRadian(endAngle),endAngle=normalizeRadian(tmp)}else startAngle=normalizeRadian(startAngle),endAngle=normalizeRadian(endAngle);startAngle>endAngle&&(endAngle+=PI2$1);var angle=Math.atan2(y,x);if(angle<0&&(angle+=PI2$1),angle>=startAngle&&angle<=endAngle||angle+PI2$1>=startAngle&&angle+PI2$1<=endAngle)return out[0]=ox,out[1]=oy,d-r;var x1=r*Math.cos(startAngle)+cx,y1=r*Math.sin(startAngle)+cy,x2=r*Math.cos(endAngle)+cx,y2=r*Math.sin(endAngle)+cy,d1=(x1-x)*(x1-x)+(y1-y)*(y1-y),d2=(x2-x)*(x2-x)+(y2-y)*(y2-y);return d1<d2?(out[0]=x1,out[1]=y1,Math.sqrt(d1)):(out[0]=x2,out[1]=y2,Math.sqrt(d2))}function projectPointToLine(x1,y1,x2,y2,x,y,out,limitToEnds){var dx=x-x1,dy=y-y1,dx1=x2-x1,dy1=y2-y1,lineLen=Math.sqrt(dx1*dx1+dy1*dy1),t=(dx*(dx1/=lineLen)+dy*(dy1/=lineLen))/lineLen;limitToEnds&&(t=Math.min(Math.max(t,0),1)),t*=lineLen;var ox=out[0]=x1+t*dx1,oy=out[1]=y1+t*dy1;return Math.sqrt((ox-x)*(ox-x)+(oy-y)*(oy-y))}function projectPointToRect(x1,y1,width,height,x,y,out){width<0&&(x1+=width,width=-width),height<0&&(y1+=height,height=-height);var x2=x1+width,y2=y1+height,ox=out[0]=Math.min(Math.max(x,x1),x2),oy=out[1]=Math.min(Math.max(y,y1),y2);return Math.sqrt((ox-x)*(ox-x)+(oy-y)*(oy-y))}var tmpPt=[];function nearestPointOnRect(pt,rect,out){var dist=projectPointToRect(rect.x,rect.y,rect.width,rect.height,pt.x,pt.y,tmpPt);return out.set(tmpPt[0],tmpPt[1]),dist}function nearestPointOnPath(pt,path,out){for(var x1,y1,xi=0,yi=0,x0=0,y0=0,minDist=1/0,data=path.data,x=pt.x,y=pt.y,i=0;i<data.length;){var cmd=data[i++];1===i&&(x0=xi=data[i],y0=yi=data[i+1]);var d=minDist;switch(cmd){case CMD$1.M:xi=x0=data[i++],yi=y0=data[i++];break;case CMD$1.L:d=projectPointToLine(xi,yi,data[i],data[i+1],x,y,tmpPt,!0),xi=data[i++],yi=data[i++];break;case CMD$1.C:d=cubicProjectPoint(xi,yi,data[i++],data[i++],data[i++],data[i++],data[i],data[i+1],x,y,tmpPt),xi=data[i++],yi=data[i++];break;case CMD$1.Q:d=quadraticProjectPoint(xi,yi,data[i++],data[i++],data[i],data[i+1],x,y,tmpPt),xi=data[i++],yi=data[i++];break;case CMD$1.A:var cx=data[i++],cy=data[i++],rx=data[i++],ry=data[i++],theta=data[i++],dTheta=data[i++];i+=1;var anticlockwise=!!(1-data[i++]);x1=Math.cos(theta)*rx+cx,y1=Math.sin(theta)*ry+cy,i<=1&&(x0=x1,y0=y1),d=projectPointToArc(cx,cy,ry,theta,theta+dTheta,anticlockwise,(x-cx)*ry/rx+cx,y,tmpPt),xi=Math.cos(theta+dTheta)*rx+cx,yi=Math.sin(theta+dTheta)*ry+cy;break;case CMD$1.R:d=projectPointToRect(x0=xi=data[i++],y0=yi=data[i++],data[i++],data[i++],x,y,tmpPt);break;case CMD$1.Z:d=projectPointToLine(xi,yi,x0,y0,x,y,tmpPt,!0),xi=x0,yi=y0}d<minDist&&(minDist=d,out.set(tmpPt[0],tmpPt[1]))}return minDist}var pt0=new Point$1,pt1=new Point$1,pt2=new Point$1,dir=new Point$1,dir2=new Point$1;function updateLabelLinePoints(target,labelLineModel){if(target){var labelLine=target.getTextGuideLine(),label=target.getTextContent();if(label&&labelLine){var labelGuideConfig=target.textGuideLineConfig||{},points=[[0,0],[0,0],[0,0]],searchSpace=labelGuideConfig.candidates||DEFAULT_SEARCH_SPACE,labelRect=label.getBoundingRect().clone();labelRect.applyTransform(label.getComputedTransform());var minDist=1/0,anchorPoint=labelGuideConfig.anchor,targetTransform=target.getComputedTransform(),targetInversedTransform=targetTransform&&invert([],targetTransform),len=labelLineModel.get("length2")||0;anchorPoint&&pt2.copy(anchorPoint);for(var i=0;i<searchSpace.length;i++){getCandidateAnchor(searchSpace[i],0,labelRect,pt0,dir),Point$1.scaleAndAdd(pt1,pt0,dir,len),pt1.transform(targetInversedTransform);var boundingRect=target.getBoundingRect(),dist=anchorPoint?anchorPoint.distance(pt1):target instanceof Path$1?nearestPointOnPath(pt1,target.path,pt2):nearestPointOnRect(pt1,boundingRect,pt2);dist<minDist&&(minDist=dist,pt1.transform(targetTransform),pt2.transform(targetTransform),pt2.toArray(points[0]),pt1.toArray(points[1]),pt0.toArray(points[2]))}limitTurnAngle(points,labelLineModel.get("minTurnAngle")),labelLine.setShape({points:points})}}}var tmpArr=[],tmpProjPoint=new Point$1;function limitTurnAngle(linePoints,minTurnAngle){if(minTurnAngle<=180&&minTurnAngle>0){minTurnAngle=minTurnAngle/180*Math.PI,pt0.fromArray(linePoints[0]),pt1.fromArray(linePoints[1]),pt2.fromArray(linePoints[2]),Point$1.sub(dir,pt0,pt1),Point$1.sub(dir2,pt2,pt1);var len1=dir.len(),len2=dir2.len();if(!(len1<.001||len2<.001)){dir.scale(1/len1),dir2.scale(1/len2);var angleCos=dir.dot(dir2);if(Math.cos(minTurnAngle)<angleCos){var d=projectPointToLine(pt1.x,pt1.y,pt2.x,pt2.y,pt0.x,pt0.y,tmpArr,!1);tmpProjPoint.fromArray(tmpArr),tmpProjPoint.scaleAndAdd(dir2,d/Math.tan(Math.PI-minTurnAngle));var t=pt2.x!==pt1.x?(tmpProjPoint.x-pt1.x)/(pt2.x-pt1.x):(tmpProjPoint.y-pt1.y)/(pt2.y-pt1.y);if(isNaN(t))return;t<0?Point$1.copy(tmpProjPoint,pt1):t>1&&Point$1.copy(tmpProjPoint,pt2),tmpProjPoint.toArray(linePoints[1])}}}}function limitSurfaceAngle(linePoints,surfaceNormal,maxSurfaceAngle){if(maxSurfaceAngle<=180&&maxSurfaceAngle>0){maxSurfaceAngle=maxSurfaceAngle/180*Math.PI,pt0.fromArray(linePoints[0]),pt1.fromArray(linePoints[1]),pt2.fromArray(linePoints[2]),Point$1.sub(dir,pt1,pt0),Point$1.sub(dir2,pt2,pt1);var len1=dir.len(),len2=dir2.len();if(!(len1<.001||len2<.001))if(dir.scale(1/len1),dir2.scale(1/len2),dir.dot(surfaceNormal)<Math.cos(maxSurfaceAngle)){var d=projectPointToLine(pt1.x,pt1.y,pt2.x,pt2.y,pt0.x,pt0.y,tmpArr,!1);tmpProjPoint.fromArray(tmpArr);var HALF_PI=Math.PI/2,newAngle=HALF_PI+Math.acos(dir2.dot(surfaceNormal))-maxSurfaceAngle;if(newAngle>=HALF_PI)Point$1.copy(tmpProjPoint,pt2);else{tmpProjPoint.scaleAndAdd(dir2,d/Math.tan(Math.PI/2-newAngle));var t=pt2.x!==pt1.x?(tmpProjPoint.x-pt1.x)/(pt2.x-pt1.x):(tmpProjPoint.y-pt1.y)/(pt2.y-pt1.y);if(isNaN(t))return;t<0?Point$1.copy(tmpProjPoint,pt1):t>1&&Point$1.copy(tmpProjPoint,pt2)}tmpProjPoint.toArray(linePoints[1])}}}function setLabelLineState(labelLine,ignore,stateName,stateModel){var isNormal="normal"===stateName,stateObj=isNormal?labelLine:labelLine.ensureState(stateName);stateObj.ignore=ignore;var smooth=stateModel.get("smooth");smooth&&!0===smooth&&(smooth=.3),stateObj.shape=stateObj.shape||{},smooth>0&&(stateObj.shape.smooth=smooth);var styleObj=stateModel.getModel("lineStyle").getLineStyle();isNormal?labelLine.useStyle(styleObj):stateObj.style=styleObj}function buildLabelLinePath(path,shape){var smooth=shape.smooth,points=shape.points;if(points)if(path.moveTo(points[0][0],points[0][1]),smooth>0&&points.length>=3){var len1=dist$1(points[0],points[1]),len2=dist$1(points[1],points[2]);if(!len1||!len2)return path.lineTo(points[1][0],points[1][1]),void path.lineTo(points[2][0],points[2][1]);var moveLen=Math.min(len1,len2)*smooth,midPoint0=lerp$1([],points[1],points[0],moveLen/len1),midPoint2=lerp$1([],points[1],points[2],moveLen/len2),midPoint1=lerp$1([],midPoint0,midPoint2,.5);path.bezierCurveTo(midPoint0[0],midPoint0[1],midPoint0[0],midPoint0[1],midPoint1[0],midPoint1[1]),path.bezierCurveTo(midPoint2[0],midPoint2[1],midPoint2[0],midPoint2[1],points[2][0],points[2][1])}else for(var i=1;i<points.length;i++)path.lineTo(points[i][0],points[i][1])}function setLabelLineStyle(targetEl,statesModels,defaultStyle){var labelLine=targetEl.getTextGuideLine(),label=targetEl.getTextContent();if(label){for(var normalModel=statesModels.normal,showNormal=normalModel.get("show"),labelIgnoreNormal=label.ignore,i=0;i<DISPLAY_STATES.length;i++){var stateName=DISPLAY_STATES[i],stateModel=statesModels[stateName],isNormal="normal"===stateName;if(stateModel){var stateShow=stateModel.get("show");if((isNormal?labelIgnoreNormal:retrieve2(label.states[stateName]&&label.states[stateName].ignore,labelIgnoreNormal))||!retrieve2(stateShow,showNormal)){var stateObj=isNormal?labelLine:labelLine&&labelLine.states[stateName];stateObj&&(stateObj.ignore=!0),labelLine&&setLabelLineState(labelLine,!0,stateName,stateModel);continue}labelLine||(labelLine=new Polyline$1,targetEl.setTextGuideLine(labelLine),isNormal||!labelIgnoreNormal&&showNormal||setLabelLineState(labelLine,!0,"normal",statesModels.normal),targetEl.stateProxy&&(labelLine.stateProxy=targetEl.stateProxy)),setLabelLineState(labelLine,!1,stateName,stateModel)}}if(labelLine){defaults(labelLine.style,defaultStyle),labelLine.style.fill=null;var showAbove=normalModel.get("showAbove");(targetEl.textGuideLineConfig=targetEl.textGuideLineConfig||{}).showAbove=showAbove||!1,labelLine.buildPath=buildLabelLinePath}}else labelLine&&targetEl.removeTextGuideLine()}function getLabelLineStatesModels(itemModel,labelLineName){labelLineName=labelLineName||"labelLine";for(var statesModels={normal:itemModel.getModel(labelLineName)},i=0;i<SPECIAL_STATES.length;i++){var stateName=SPECIAL_STATES[i];statesModels[stateName]=itemModel.getModel([stateName,labelLineName])}return statesModels}function prepareLayoutList(input){for(var list=[],i=0;i<input.length;i++){var rawItem=input[i];if(!rawItem.defaultAttr.ignore){var label=rawItem.label,transform=label.getComputedTransform(),localRect=label.getBoundingRect(),isAxisAligned=!transform||transform[1]<1e-5&&transform[2]<1e-5,minMargin=label.style.margin||0,globalRect=localRect.clone();globalRect.applyTransform(transform),globalRect.x-=minMargin/2,globalRect.y-=minMargin/2,globalRect.width+=minMargin,globalRect.height+=minMargin;var obb=isAxisAligned?new OrientedBoundingRect$1(localRect,transform):null;list.push({label:label,labelLine:rawItem.labelLine,rect:globalRect,localRect:localRect,obb:obb,priority:rawItem.priority,defaultAttr:rawItem.defaultAttr,layoutOption:rawItem.computedLayoutOption,axisAligned:isAxisAligned,transform:transform})}}return list}function shiftLayout(list,xyDim,sizeDim,minBound,maxBound,balanceShift){var len=list.length;if(!(len<2)){list.sort((function(a,b){return a.rect[xyDim]-b.rect[xyDim]}));for(var delta,lastPos=0,adjusted=!1,totalShifts=0,i=0;i<len;i++){var item=list[i],rect=item.rect;(delta=rect[xyDim]-lastPos)<0&&(rect[xyDim]-=delta,item.label[xyDim]-=delta,adjusted=!0),totalShifts+=Math.max(-delta,0),lastPos=rect[xyDim]+rect[sizeDim]}totalShifts>0&&balanceShift&&shiftList(-totalShifts/len,0,len);var minGap,maxGap,first=list[0],last=list[len-1];return updateMinMaxGap(),minGap<0&&squeezeGaps(-minGap,.8),maxGap<0&&squeezeGaps(maxGap,.8),updateMinMaxGap(),takeBoundsGap(minGap,maxGap,1),takeBoundsGap(maxGap,minGap,-1),updateMinMaxGap(),minGap<0&&squeezeWhenBailout(-minGap),maxGap<0&&squeezeWhenBailout(maxGap),adjusted}function updateMinMaxGap(){minGap=first.rect[xyDim]-minBound,maxGap=maxBound-last.rect[xyDim]-last.rect[sizeDim]}function takeBoundsGap(gapThisBound,gapOtherBound,moveDir){if(gapThisBound<0){var moveFromMaxGap=Math.min(gapOtherBound,-gapThisBound);if(moveFromMaxGap>0){shiftList(moveFromMaxGap*moveDir,0,len);var remained=moveFromMaxGap+gapThisBound;remained<0&&squeezeGaps(-remained*moveDir,1)}else squeezeGaps(-gapThisBound*moveDir,1)}}function shiftList(delta,start,end){0!==delta&&(adjusted=!0);for(var i=start;i<end;i++){var item=list[i];item.rect[xyDim]+=delta,item.label[xyDim]+=delta}}function squeezeGaps(delta,maxSqeezePercent){for(var gaps=[],totalGaps=0,i=1;i<len;i++){var prevItemRect=list[i-1].rect,gap=Math.max(list[i].rect[xyDim]-prevItemRect[xyDim]-prevItemRect[sizeDim],0);gaps.push(gap),totalGaps+=gap}if(totalGaps){var squeezePercent=Math.min(Math.abs(delta)/totalGaps,maxSqeezePercent);if(delta>0)for(i=0;i<len-1;i++){shiftList(gaps[i]*squeezePercent,0,i+1)}else for(i=len-1;i>0;i--){shiftList(-(gaps[i-1]*squeezePercent),i,len)}}}function squeezeWhenBailout(delta){var dir=delta<0?-1:1;delta=Math.abs(delta);for(var moveForEachLabel=Math.ceil(delta/(len-1)),i=0;i<len-1;i++)if(dir>0?shiftList(moveForEachLabel,0,i+1):shiftList(-moveForEachLabel,len-i-1,len),(delta-=moveForEachLabel)<=0)return}}function shiftLayoutOnY(list,topBound,bottomBound,balanceShift){return shiftLayout(list,"y","height",topBound,bottomBound,balanceShift)}function hideOverlap(labelList){var displayedLabels=[];labelList.sort((function(a,b){return b.priority-a.priority}));var globalRect=new BoundingRect$1(0,0,0,0);function hideEl(el){if(!el.ignore){var emphasisState=el.ensureState("emphasis");null==emphasisState.ignore&&(emphasisState.ignore=!1)}el.ignore=!0}for(var i=0;i<labelList.length;i++){var labelItem=labelList[i],isAxisAligned=labelItem.axisAligned,localRect=labelItem.localRect,transform=labelItem.transform,label=labelItem.label,labelLine=labelItem.labelLine;globalRect.copy(labelItem.rect),globalRect.width-=.1,globalRect.height-=.1,globalRect.x+=.05,globalRect.y+=.05;for(var obb=labelItem.obb,overlapped=!1,j=0;j<displayedLabels.length;j++){var existsTextCfg=displayedLabels[j];if(globalRect.intersect(existsTextCfg.rect)){if(isAxisAligned&&existsTextCfg.axisAligned){overlapped=!0;break}if(existsTextCfg.obb||(existsTextCfg.obb=new OrientedBoundingRect$1(existsTextCfg.localRect,existsTextCfg.transform)),obb||(obb=new OrientedBoundingRect$1(localRect,transform)),obb.intersect(existsTextCfg.obb)){overlapped=!0;break}}}overlapped?(hideEl(label),labelLine&&hideEl(labelLine)):(label.attr("ignore",labelItem.defaultAttr.ignore),labelLine&&labelLine.attr("ignore",labelItem.defaultAttr.labelGuideIgnore),displayedLabels.push(labelItem))}}function cloneArr(points){if(points){for(var newPoints=[],i=0;i<points.length;i++)newPoints.push(points[i].slice());return newPoints}}function prepareLayoutCallbackParams(labelItem,hostEl){var label=labelItem.label,labelLine=hostEl&&hostEl.getTextGuideLine();return{dataIndex:labelItem.dataIndex,dataType:labelItem.dataType,seriesIndex:labelItem.seriesModel.seriesIndex,text:labelItem.label.style.text,rect:labelItem.hostRect,labelRect:labelItem.rect,align:label.style.align,verticalAlign:label.style.verticalAlign,labelLinePoints:cloneArr(labelLine&&labelLine.shape.points)}}var LABEL_OPTION_TO_STYLE_KEYS=["align","verticalAlign","width","height","fontSize"],dummyTransformable=new Transformable$1,labelLayoutInnerStore=makeInner(),labelLineAnimationStore=makeInner();function extendWithKeys(target,source,keys){for(var i=0;i<keys.length;i++){var key=keys[i];null!=source[key]&&(target[key]=source[key])}}var LABEL_LAYOUT_PROPS=["x","y","rotation"],LabelManager$1=function(){function LabelManager(){this._labelList=[],this._chartViewList=[]}return LabelManager.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},LabelManager.prototype._addLabel=function(dataIndex,dataType,seriesModel,label,layoutOption){var labelStyle=label.style,textConfig=label.__hostTarget.textConfig||{},labelTransform=label.getComputedTransform(),labelRect=label.getBoundingRect().plain();BoundingRect$1.applyTransform(labelRect,labelRect,labelTransform),labelTransform?dummyTransformable.setLocalTransform(labelTransform):(dummyTransformable.x=dummyTransformable.y=dummyTransformable.rotation=dummyTransformable.originX=dummyTransformable.originY=0,dummyTransformable.scaleX=dummyTransformable.scaleY=1),dummyTransformable.rotation=normalizeRadian(dummyTransformable.rotation);var hostRect,host=label.__hostTarget;if(host){hostRect=host.getBoundingRect().plain();var transform=host.getComputedTransform();BoundingRect$1.applyTransform(hostRect,hostRect,transform)}var labelGuide=hostRect&&host.getTextGuideLine();this._labelList.push({label:label,labelLine:labelGuide,seriesModel:seriesModel,dataIndex:dataIndex,dataType:dataType,layoutOption:layoutOption,computedLayoutOption:null,rect:labelRect,hostRect:hostRect,priority:hostRect?hostRect.width*hostRect.height:0,defaultAttr:{ignore:label.ignore,labelGuideIgnore:labelGuide&&labelGuide.ignore,x:dummyTransformable.x,y:dummyTransformable.y,scaleX:dummyTransformable.scaleX,scaleY:dummyTransformable.scaleY,rotation:dummyTransformable.rotation,style:{x:labelStyle.x,y:labelStyle.y,align:labelStyle.align,verticalAlign:labelStyle.verticalAlign,width:labelStyle.width,height:labelStyle.height,fontSize:labelStyle.fontSize},cursor:label.cursor,attachedPos:textConfig.position,attachedRot:textConfig.rotation}})},LabelManager.prototype.addLabelsOfSeries=function(chartView){var _this=this;this._chartViewList.push(chartView);var seriesModel=chartView.__model,layoutOption=seriesModel.get("labelLayout");(isFunction(layoutOption)||keys$1(layoutOption).length)&&chartView.group.traverse((function(child){if(child.ignore)return!0;var textEl=child.getTextContent(),ecData=getECData(child);textEl&&!textEl.disableLabelLayout&&_this._addLabel(ecData.dataIndex,ecData.dataType,seriesModel,textEl,layoutOption)}))},LabelManager.prototype.updateLayoutConfig=function(api){var width=api.getWidth(),height=api.getHeight();function createDragHandler(el,labelLineModel){return function(){updateLabelLinePoints(el,labelLineModel)}}for(var i=0;i<this._labelList.length;i++){var labelItem=this._labelList[i],label=labelItem.label,hostEl=label.__hostTarget,defaultLabelAttr=labelItem.defaultAttr,layoutOption=void 0;layoutOption=(layoutOption=isFunction(labelItem.layoutOption)?labelItem.layoutOption(prepareLayoutCallbackParams(labelItem,hostEl)):labelItem.layoutOption)||{},labelItem.computedLayoutOption=layoutOption;var degreeToRadian=Math.PI/180;hostEl&&hostEl.setTextConfig({local:!1,position:null!=layoutOption.x||null!=layoutOption.y?null:defaultLabelAttr.attachedPos,rotation:null!=layoutOption.rotate?layoutOption.rotate*degreeToRadian:defaultLabelAttr.attachedRot,offset:[layoutOption.dx||0,layoutOption.dy||0]});var needsUpdateLabelLine=!1;if(null!=layoutOption.x?(label.x=parsePercent(layoutOption.x,width),label.setStyle("x",0),needsUpdateLabelLine=!0):(label.x=defaultLabelAttr.x,label.setStyle("x",defaultLabelAttr.style.x)),null!=layoutOption.y?(label.y=parsePercent(layoutOption.y,height),label.setStyle("y",0),needsUpdateLabelLine=!0):(label.y=defaultLabelAttr.y,label.setStyle("y",defaultLabelAttr.style.y)),layoutOption.labelLinePoints){var guideLine=hostEl.getTextGuideLine();guideLine&&(guideLine.setShape({points:layoutOption.labelLinePoints}),needsUpdateLabelLine=!1)}labelLayoutInnerStore(label).needsUpdateLabelLine=needsUpdateLabelLine,label.rotation=null!=layoutOption.rotate?layoutOption.rotate*degreeToRadian:defaultLabelAttr.rotation,label.scaleX=defaultLabelAttr.scaleX,label.scaleY=defaultLabelAttr.scaleY;for(var k=0;k<LABEL_OPTION_TO_STYLE_KEYS.length;k++){var key=LABEL_OPTION_TO_STYLE_KEYS[k];label.setStyle(key,null!=layoutOption[key]?layoutOption[key]:defaultLabelAttr.style[key])}if(layoutOption.draggable){if(label.draggable=!0,label.cursor="move",hostEl){var hostModel=labelItem.seriesModel;if(null!=labelItem.dataIndex)hostModel=labelItem.seriesModel.getData(labelItem.dataType).getItemModel(labelItem.dataIndex);label.on("drag",createDragHandler(hostEl,hostModel.getModel("labelLine")))}}else label.off("drag"),label.cursor=defaultLabelAttr.cursor}},LabelManager.prototype.layout=function(api){var balanceShift,width=api.getWidth(),height=api.getHeight(),labelList=prepareLayoutList(this._labelList),labelsNeedsAdjustOnX=filter(labelList,(function(item){return"shiftX"===item.layoutOption.moveOverlap})),labelsNeedsAdjustOnY=filter(labelList,(function(item){return"shiftY"===item.layoutOption.moveOverlap}));shiftLayout(labelsNeedsAdjustOnX,"x","width",0,width,balanceShift),shiftLayoutOnY(labelsNeedsAdjustOnY,0,height),hideOverlap(filter(labelList,(function(item){return item.layoutOption.hideOverlap})))},LabelManager.prototype.processLabelsOverall=function(){var _this=this;each$b(this._chartViewList,(function(chartView){var seriesModel=chartView.__model,ignoreLabelLineUpdate=chartView.ignoreLabelLineUpdate,animationEnabled=seriesModel.isAnimationEnabled();chartView.group.traverse((function(child){if(child.ignore&&!child.forceLabelAnimation)return!0;var needsUpdateLabelLine=!ignoreLabelLineUpdate,label=child.getTextContent();!needsUpdateLabelLine&&label&&(needsUpdateLabelLine=labelLayoutInnerStore(label).needsUpdateLabelLine),needsUpdateLabelLine&&_this._updateLabelLine(child,seriesModel),animationEnabled&&_this._animateLabels(child,seriesModel)}))}))},LabelManager.prototype._updateLabelLine=function(el,seriesModel){var textEl=el.getTextContent(),ecData=getECData(el),dataIndex=ecData.dataIndex;if(textEl&&null!=dataIndex){var data=seriesModel.getData(ecData.dataType),itemModel=data.getItemModel(dataIndex),defaultStyle={},visualStyle=data.getItemVisual(dataIndex,"style");if(visualStyle){var visualType=data.getVisual("drawType");defaultStyle.stroke=visualStyle[visualType]}var labelLineModel=itemModel.getModel("labelLine");setLabelLineStyle(el,getLabelLineStatesModels(itemModel),defaultStyle),updateLabelLinePoints(el,labelLineModel)}},LabelManager.prototype._animateLabels=function(el,seriesModel){var textEl=el.getTextContent(),guideLine=el.getTextGuideLine();if(textEl&&(el.forceLabelAnimation||!textEl.ignore&&!textEl.invisible&&!el.disableLabelAnimation&&!isElementRemoved(el))){var oldLayout=(layoutStore=labelLayoutInnerStore(textEl)).oldLayout,ecData=getECData(el),dataIndex=ecData.dataIndex,newProps={x:textEl.x,y:textEl.y,rotation:textEl.rotation},data=seriesModel.getData(ecData.dataType);if(oldLayout){textEl.attr(oldLayout);var prevStates=el.prevStates;prevStates&&(indexOf(prevStates,"select")>=0&&textEl.attr(layoutStore.oldLayoutSelect),indexOf(prevStates,"emphasis")>=0&&textEl.attr(layoutStore.oldLayoutEmphasis)),updateProps$1(textEl,newProps,seriesModel,dataIndex)}else if(textEl.attr(newProps),!labelInner(textEl).valueAnimation){var oldOpacity=retrieve2(textEl.style.opacity,1);textEl.style.opacity=0,initProps(textEl,{style:{opacity:oldOpacity}},seriesModel,dataIndex)}if(layoutStore.oldLayout=newProps,textEl.states.select){var layoutSelect=layoutStore.oldLayoutSelect={};extendWithKeys(layoutSelect,newProps,LABEL_LAYOUT_PROPS),extendWithKeys(layoutSelect,textEl.states.select,LABEL_LAYOUT_PROPS)}if(textEl.states.emphasis){var layoutEmphasis=layoutStore.oldLayoutEmphasis={};extendWithKeys(layoutEmphasis,newProps,LABEL_LAYOUT_PROPS),extendWithKeys(layoutEmphasis,textEl.states.emphasis,LABEL_LAYOUT_PROPS)}animateLabelValue(textEl,dataIndex,data,seriesModel,seriesModel)}if(guideLine&&!guideLine.ignore&&!guideLine.invisible){oldLayout=(layoutStore=labelLineAnimationStore(guideLine)).oldLayout;var layoutStore,newLayout={points:guideLine.shape.points};oldLayout?(guideLine.attr({shape:oldLayout}),updateProps$1(guideLine,{shape:newLayout},seriesModel)):(guideLine.setShape(newLayout),guideLine.style.strokePercent=0,initProps(guideLine,{style:{strokePercent:1}},seriesModel)),layoutStore.oldLayout=newLayout}},LabelManager}(),getLabelManager=makeInner();var LineSeries=function(_super){function LineSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=LineSeriesModel.type,_this.hasSymbolVisual=!0,_this}return __extends(LineSeriesModel,_super),LineSeriesModel.prototype.getInitialData=function(option){if("production"!==process.env.NODE_ENV){var coordSys=option.coordinateSystem;if("polar"!==coordSys&&"cartesian2d"!==coordSys)throw new Error("Line not support coordinateSystem besides cartesian and polar")}return createSeriesData(null,this,{useEncodeDefaulter:!0})},LineSeriesModel.prototype.getLegendIcon=function(opt){var group=new Group$4,line=createSymbol$1("line",0,opt.itemHeight/2,opt.itemWidth,0,opt.lineStyle.stroke,!1);group.add(line),line.setStyle(opt.lineStyle);var visualType=this.getData().getVisual("symbol"),visualRotate=this.getData().getVisual("symbolRotate"),symbolType="none"===visualType?"circle":visualType,size=.8*opt.itemHeight,symbol=createSymbol$1(symbolType,(opt.itemWidth-size)/2,(opt.itemHeight-size)/2,size,size,opt.itemStyle.fill);group.add(symbol),symbol.setStyle(opt.itemStyle);var symbolRotate="inherit"===opt.iconRotate?visualRotate:opt.iconRotate||0;return symbol.rotation=symbolRotate*Math.PI/180,symbol.setOrigin([opt.itemWidth/2,opt.itemHeight/2]),symbolType.indexOf("empty")>-1&&(symbol.style.stroke=symbol.style.fill,symbol.style.fill="#fff",symbol.style.lineWidth=2),group},LineSeriesModel.type="series.line",LineSeriesModel.dependencies=["grid","polar"],LineSeriesModel.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},LineSeriesModel}(SeriesModel$1);function getDefaultLabel(data,dataIndex){var labelDims=data.mapDimensionsAll("defaultedLabel"),len=labelDims.length;if(1===len){var rawVal=retrieveRawValue(data,dataIndex,labelDims[0]);return null!=rawVal?rawVal+"":null}if(len){for(var vals=[],i=0;i<labelDims.length;i++)vals.push(retrieveRawValue(data,dataIndex,labelDims[i]));return vals.join(" ")}}function getDefaultInterpolatedLabel(data,interpolatedValue){var labelDims=data.mapDimensionsAll("defaultedLabel");if(!isArray(interpolatedValue))return interpolatedValue+"";for(var vals=[],i=0;i<labelDims.length;i++){var dimIndex=data.getDimensionIndex(labelDims[i]);dimIndex>=0&&vals.push(interpolatedValue[dimIndex])}return vals.join(" ")}var Symbol$1=function(_super){function Symbol(data,idx,seriesScope,opts){var _this=_super.call(this)||this;return _this.updateData(data,idx,seriesScope,opts),_this}return __extends(Symbol,_super),Symbol.prototype._createSymbol=function(symbolType,data,idx,symbolSize,keepAspect){this.removeAll();var symbolPath=createSymbol$1(symbolType,-1,-1,2,2,null,keepAspect);symbolPath.attr({z2:100,culling:!0,scaleX:symbolSize[0]/2,scaleY:symbolSize[1]/2}),symbolPath.drift=driftSymbol,this._symbolType=symbolType,this.add(symbolPath)},Symbol.prototype.stopSymbolAnimation=function(toLastFrame){this.childAt(0).stopAnimation(null,toLastFrame)},Symbol.prototype.getSymbolType=function(){return this._symbolType},Symbol.prototype.getSymbolPath=function(){return this.childAt(0)},Symbol.prototype.highlight=function(){enterEmphasis(this.childAt(0))},Symbol.prototype.downplay=function(){leaveEmphasis(this.childAt(0))},Symbol.prototype.setZ=function(zlevel,z){var symbolPath=this.childAt(0);symbolPath.zlevel=zlevel,symbolPath.z=z},Symbol.prototype.setDraggable=function(draggable,hasCursorOption){var symbolPath=this.childAt(0);symbolPath.draggable=draggable,symbolPath.cursor=!hasCursorOption&&draggable?"move":symbolPath.cursor},Symbol.prototype.updateData=function(data,idx,seriesScope,opts){this.silent=!1;var symbolType=data.getItemVisual(idx,"symbol")||"circle",seriesModel=data.hostModel,symbolSize=Symbol.getSymbolSize(data,idx),isInit=symbolType!==this._symbolType,disableAnimation=opts&&opts.disableAnimation;if(isInit){var keepAspect=data.getItemVisual(idx,"symbolKeepAspect");this._createSymbol(symbolType,data,idx,symbolSize,keepAspect)}else{(symbolPath=this.childAt(0)).silent=!1;var target={scaleX:symbolSize[0]/2,scaleY:symbolSize[1]/2};disableAnimation?symbolPath.attr(target):updateProps$1(symbolPath,target,seriesModel,idx),saveOldStyle(symbolPath)}if(this._updateCommon(data,idx,symbolSize,seriesScope,opts),isInit){var symbolPath=this.childAt(0);if(!disableAnimation){target={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:symbolPath.style.opacity}};symbolPath.scaleX=symbolPath.scaleY=0,symbolPath.style.opacity=0,initProps(symbolPath,target,seriesModel,idx)}}disableAnimation&&this.childAt(0).stopAnimation("leave")},Symbol.prototype._updateCommon=function(data,idx,symbolSize,seriesScope,opts){var emphasisItemStyle,blurItemStyle,selectItemStyle,focus,blurScope,emphasisDisabled,labelStatesModels,hoverScale,cursorStyle,symbolPath=this.childAt(0),seriesModel=data.hostModel;if(seriesScope&&(emphasisItemStyle=seriesScope.emphasisItemStyle,blurItemStyle=seriesScope.blurItemStyle,selectItemStyle=seriesScope.selectItemStyle,focus=seriesScope.focus,blurScope=seriesScope.blurScope,labelStatesModels=seriesScope.labelStatesModels,hoverScale=seriesScope.hoverScale,cursorStyle=seriesScope.cursorStyle,emphasisDisabled=seriesScope.emphasisDisabled),!seriesScope||data.hasItemOption){var itemModel=seriesScope&&seriesScope.itemModel?seriesScope.itemModel:data.getItemModel(idx),emphasisModel=itemModel.getModel("emphasis");emphasisItemStyle=emphasisModel.getModel("itemStyle").getItemStyle(),selectItemStyle=itemModel.getModel(["select","itemStyle"]).getItemStyle(),blurItemStyle=itemModel.getModel(["blur","itemStyle"]).getItemStyle(),focus=emphasisModel.get("focus"),blurScope=emphasisModel.get("blurScope"),emphasisDisabled=emphasisModel.get("disabled"),labelStatesModels=getLabelStatesModels(itemModel),hoverScale=emphasisModel.getShallow("scale"),cursorStyle=itemModel.getShallow("cursor")}var symbolRotate=data.getItemVisual(idx,"symbolRotate");symbolPath.attr("rotation",(symbolRotate||0)*Math.PI/180||0);var symbolOffset=normalizeSymbolOffset(data.getItemVisual(idx,"symbolOffset"),symbolSize);symbolOffset&&(symbolPath.x=symbolOffset[0],symbolPath.y=symbolOffset[1]),cursorStyle&&symbolPath.attr("cursor",cursorStyle);var symbolStyle=data.getItemVisual(idx,"style"),visualColor=symbolStyle.fill;if(symbolPath instanceof ZRImage$1){var pathStyle=symbolPath.style;symbolPath.useStyle(extend({image:pathStyle.image,x:pathStyle.x,y:pathStyle.y,width:pathStyle.width,height:pathStyle.height},symbolStyle))}else symbolPath.__isEmptyBrush?symbolPath.useStyle(extend({},symbolStyle)):symbolPath.useStyle(symbolStyle),symbolPath.style.decal=null,symbolPath.setColor(visualColor,opts&&opts.symbolInnerColor),symbolPath.style.strokeNoScale=!0;var liftZ=data.getItemVisual(idx,"liftZ"),z2Origin=this._z2;null!=liftZ?null==z2Origin&&(this._z2=symbolPath.z2,symbolPath.z2+=liftZ):null!=z2Origin&&(symbolPath.z2=z2Origin,this._z2=null);var useNameLabel=opts&&opts.useNameLabel;setLabelStyle(symbolPath,labelStatesModels,{labelFetcher:seriesModel,labelDataIndex:idx,defaultText:function(idx){return useNameLabel?data.getName(idx):getDefaultLabel(data,idx)},inheritColor:visualColor,defaultOpacity:symbolStyle.opacity}),this._sizeX=symbolSize[0]/2,this._sizeY=symbolSize[1]/2;var emphasisState=symbolPath.ensureState("emphasis");emphasisState.style=emphasisItemStyle,symbolPath.ensureState("select").style=selectItemStyle,symbolPath.ensureState("blur").style=blurItemStyle;var scaleRatio=null==hoverScale||!0===hoverScale?Math.max(1.1,3/this._sizeY):isFinite(hoverScale)&&hoverScale>0?+hoverScale:1;emphasisState.scaleX=this._sizeX*scaleRatio,emphasisState.scaleY=this._sizeY*scaleRatio,this.setSymbolScale(1),toggleHoverEmphasis(this,focus,blurScope,emphasisDisabled)},Symbol.prototype.setSymbolScale=function(scale){this.scaleX=this.scaleY=scale},Symbol.prototype.fadeOut=function(cb,seriesModel,opt){var symbolPath=this.childAt(0),dataIndex=getECData(this).dataIndex,animationOpt=opt&&opt.animation;if(this.silent=symbolPath.silent=!0,opt&&opt.fadeLabel){var textContent=symbolPath.getTextContent();textContent&&removeElement(textContent,{style:{opacity:0}},seriesModel,{dataIndex:dataIndex,removeOpt:animationOpt,cb:function(){symbolPath.removeTextContent()}})}else symbolPath.removeTextContent();removeElement(symbolPath,{style:{opacity:0},scaleX:0,scaleY:0},seriesModel,{dataIndex:dataIndex,cb:cb,removeOpt:animationOpt})},Symbol.getSymbolSize=function(data,idx){return normalizeSymbolSize(data.getItemVisual(idx,"symbolSize"))},Symbol}(Group$4);function driftSymbol(dx,dy){this.parent.drift(dx,dy)}var SymbolClz=Symbol$1;function symbolNeedsDraw$1(data,point,idx,opt){return point&&!isNaN(point[0])&&!isNaN(point[1])&&!(opt.isIgnore&&opt.isIgnore(idx))&&!(opt.clipShape&&!opt.clipShape.contain(point[0],point[1]))&&"none"!==data.getItemVisual(idx,"symbol")}function normalizeUpdateOpt(opt){return null==opt||isObject$3(opt)||(opt={isIgnore:opt}),opt||{}}function makeSeriesScope$2(data){var seriesModel=data.hostModel,emphasisModel=seriesModel.getModel("emphasis");return{emphasisItemStyle:emphasisModel.getModel("itemStyle").getItemStyle(),blurItemStyle:seriesModel.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:seriesModel.getModel(["select","itemStyle"]).getItemStyle(),focus:emphasisModel.get("focus"),blurScope:emphasisModel.get("blurScope"),emphasisDisabled:emphasisModel.get("disabled"),hoverScale:emphasisModel.get("scale"),labelStatesModels:getLabelStatesModels(seriesModel),cursorStyle:seriesModel.get("cursor")}}var SymbolDraw=function(){function SymbolDraw(SymbolCtor){this.group=new Group$4,this._SymbolCtor=SymbolCtor||SymbolClz}return SymbolDraw.prototype.updateData=function(data,opt){this._progressiveEls=null,opt=normalizeUpdateOpt(opt);var group=this.group,seriesModel=data.hostModel,oldData=this._data,SymbolCtor=this._SymbolCtor,disableAnimation=opt.disableAnimation,seriesScope=makeSeriesScope$2(data),symbolUpdateOpt={disableAnimation:disableAnimation},getSymbolPoint=opt.getSymbolPoint||function(idx){return data.getItemLayout(idx)};oldData||group.removeAll(),data.diff(oldData).add((function(newIdx){var point=getSymbolPoint(newIdx);if(symbolNeedsDraw$1(data,point,newIdx,opt)){var symbolEl=new SymbolCtor(data,newIdx,seriesScope,symbolUpdateOpt);symbolEl.setPosition(point),data.setItemGraphicEl(newIdx,symbolEl),group.add(symbolEl)}})).update((function(newIdx,oldIdx){var symbolEl=oldData.getItemGraphicEl(oldIdx),point=getSymbolPoint(newIdx);if(symbolNeedsDraw$1(data,point,newIdx,opt)){var newSymbolType=data.getItemVisual(newIdx,"symbol")||"circle",oldSymbolType=symbolEl&&symbolEl.getSymbolType&&symbolEl.getSymbolType();if(!symbolEl||oldSymbolType&&oldSymbolType!==newSymbolType)group.remove(symbolEl),(symbolEl=new SymbolCtor(data,newIdx,seriesScope,symbolUpdateOpt)).setPosition(point);else{symbolEl.updateData(data,newIdx,seriesScope,symbolUpdateOpt);var target={x:point[0],y:point[1]};disableAnimation?symbolEl.attr(target):updateProps$1(symbolEl,target,seriesModel)}group.add(symbolEl),data.setItemGraphicEl(newIdx,symbolEl)}else group.remove(symbolEl)})).remove((function(oldIdx){var el=oldData.getItemGraphicEl(oldIdx);el&&el.fadeOut((function(){group.remove(el)}),seriesModel)})).execute(),this._getSymbolPoint=getSymbolPoint,this._data=data},SymbolDraw.prototype.updateLayout=function(){var _this=this,data=this._data;data&&data.eachItemGraphicEl((function(el,idx){var point=_this._getSymbolPoint(idx);el.setPosition(point),el.markRedraw()}))},SymbolDraw.prototype.incrementalPrepareUpdate=function(data){this._seriesScope=makeSeriesScope$2(data),this._data=null,this.group.removeAll()},SymbolDraw.prototype.incrementalUpdate=function(taskParams,data,opt){function updateIncrementalAndHover(el){el.isGroup||(el.incremental=!0,el.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],opt=normalizeUpdateOpt(opt);for(var idx=taskParams.start;idx<taskParams.end;idx++){var point=data.getItemLayout(idx);if(symbolNeedsDraw$1(data,point,idx,opt)){var el=new this._SymbolCtor(data,idx,this._seriesScope);el.traverse(updateIncrementalAndHover),el.setPosition(point),this.group.add(el),data.setItemGraphicEl(idx,el),this._progressiveEls.push(el)}}},SymbolDraw.prototype.eachRendered=function(cb){traverseElements(this._progressiveEls||this.group,cb)},SymbolDraw.prototype.remove=function(enableAnimation){var group=this.group,data=this._data;data&&enableAnimation?data.eachItemGraphicEl((function(el){el.fadeOut((function(){group.remove(el)}),data.hostModel)})):group.removeAll()},SymbolDraw}(),SymbolDraw$1=SymbolDraw;function prepareDataCoordInfo(coordSys,data,valueOrigin){var baseAxis=coordSys.getBaseAxis(),valueAxis=coordSys.getOtherAxis(baseAxis),valueStart=function(valueAxis,valueOrigin){var valueStart=0,extent=valueAxis.scale.getExtent();"start"===valueOrigin?valueStart=extent[0]:"end"===valueOrigin?valueStart=extent[1]:isNumber(valueOrigin)&&!isNaN(valueOrigin)?valueStart=valueOrigin:extent[0]>0?valueStart=extent[0]:extent[1]<0&&(valueStart=extent[1]);return valueStart}(valueAxis,valueOrigin),baseAxisDim=baseAxis.dim,valueAxisDim=valueAxis.dim,valueDim=data.mapDimension(valueAxisDim),baseDim=data.mapDimension(baseAxisDim),baseDataOffset="x"===valueAxisDim||"radius"===valueAxisDim?1:0,dims=map$1(coordSys.dimensions,(function(coordDim){return data.mapDimension(coordDim)})),stacked=!1,stackResultDim=data.getCalculationInfo("stackResultDimension");return isDimensionStacked(data,dims[0])&&(stacked=!0,dims[0]=stackResultDim),isDimensionStacked(data,dims[1])&&(stacked=!0,dims[1]=stackResultDim),{dataDimsForPoint:dims,valueStart:valueStart,valueAxisDim:valueAxisDim,baseAxisDim:baseAxisDim,stacked:!!stacked,valueDim:valueDim,baseDim:baseDim,baseDataOffset:baseDataOffset,stackedOverDimension:data.getCalculationInfo("stackedOverDimension")}}function getStackedOnPoint(dataCoordInfo,coordSys,data,idx){var value=NaN;dataCoordInfo.stacked&&(value=data.get(data.getCalculationInfo("stackedOverDimension"),idx)),isNaN(value)&&(value=dataCoordInfo.valueStart);var baseDataOffset=dataCoordInfo.baseDataOffset,stackedData=[];return stackedData[baseDataOffset]=data.get(dataCoordInfo.baseDim,idx),stackedData[1-baseDataOffset]=value,coordSys.dataToPoint(stackedData)}var mathMin$4=Math.min,mathMax$4=Math.max;function isPointNull$1(x,y){return isNaN(x)||isNaN(y)}function drawSegment(ctx,points,start,segLen,allLen,dir,smooth,smoothMonotone,connectNulls){for(var prevX,prevY,cpx0,cpy0,cpx1,cpy1,idx=start,k=0;k<segLen;k++){var x=points[2*idx],y=points[2*idx+1];if(idx>=allLen||idx<0)break;if(isPointNull$1(x,y)){if(connectNulls){idx+=dir;continue}break}if(idx===start)ctx[dir>0?"moveTo":"lineTo"](x,y),cpx0=x,cpy0=y;else{var dx=x-prevX,dy=y-prevY;if(dx*dx+dy*dy<.5){idx+=dir;continue}if(smooth>0){for(var nextIdx=idx+dir,nextX=points[2*nextIdx],nextY=points[2*nextIdx+1];nextX===x&&nextY===y&&k<segLen;)k++,idx+=dir,nextX=points[2*(nextIdx+=dir)],nextY=points[2*nextIdx+1],dx=(x=points[2*idx])-prevX,dy=(y=points[2*idx+1])-prevY;var tmpK=k+1;if(connectNulls)for(;isPointNull$1(nextX,nextY)&&tmpK<segLen;)tmpK++,nextX=points[2*(nextIdx+=dir)],nextY=points[2*nextIdx+1];var ratioNextSeg=.5,vx=0,vy=0,nextCpx0=void 0,nextCpy0=void 0;if(tmpK>=segLen||isPointNull$1(nextX,nextY))cpx1=x,cpy1=y;else{vx=nextX-prevX,vy=nextY-prevY;var dx0=x-prevX,dx1=nextX-x,dy0=y-prevY,dy1=nextY-y,lenPrevSeg=void 0,lenNextSeg=void 0;if("x"===smoothMonotone){var dir_1=vx>0?1:-1;cpx1=x-dir_1*(lenPrevSeg=Math.abs(dx0))*smooth,cpy1=y,nextCpx0=x+dir_1*(lenNextSeg=Math.abs(dx1))*smooth,nextCpy0=y}else if("y"===smoothMonotone){var dir_2=vy>0?1:-1;cpx1=x,cpy1=y-dir_2*(lenPrevSeg=Math.abs(dy0))*smooth,nextCpx0=x,nextCpy0=y+dir_2*(lenNextSeg=Math.abs(dy1))*smooth}else lenPrevSeg=Math.sqrt(dx0*dx0+dy0*dy0),cpx1=x-vx*smooth*(1-(ratioNextSeg=(lenNextSeg=Math.sqrt(dx1*dx1+dy1*dy1))/(lenNextSeg+lenPrevSeg))),cpy1=y-vy*smooth*(1-ratioNextSeg),nextCpy0=y+vy*smooth*ratioNextSeg,nextCpx0=mathMin$4(nextCpx0=x+vx*smooth*ratioNextSeg,mathMax$4(nextX,x)),nextCpy0=mathMin$4(nextCpy0,mathMax$4(nextY,y)),nextCpx0=mathMax$4(nextCpx0,mathMin$4(nextX,x)),cpy1=y-(vy=(nextCpy0=mathMax$4(nextCpy0,mathMin$4(nextY,y)))-y)*lenPrevSeg/lenNextSeg,cpx1=mathMin$4(cpx1=x-(vx=nextCpx0-x)*lenPrevSeg/lenNextSeg,mathMax$4(prevX,x)),cpy1=mathMin$4(cpy1,mathMax$4(prevY,y)),nextCpx0=x+(vx=x-(cpx1=mathMax$4(cpx1,mathMin$4(prevX,x))))*lenNextSeg/lenPrevSeg,nextCpy0=y+(vy=y-(cpy1=mathMax$4(cpy1,mathMin$4(prevY,y))))*lenNextSeg/lenPrevSeg}ctx.bezierCurveTo(cpx0,cpy0,cpx1,cpy1,x,y),cpx0=nextCpx0,cpy0=nextCpy0}else ctx.lineTo(x,y)}prevX=x,prevY=y,idx+=dir}return k}var ECPolylineShape=function(){this.smooth=0,this.smoothConstraint=!0},ECPolyline=function(_super){function ECPolyline(opts){var _this=_super.call(this,opts)||this;return _this.type="ec-polyline",_this}return __extends(ECPolyline,_super),ECPolyline.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},ECPolyline.prototype.getDefaultShape=function(){return new ECPolylineShape},ECPolyline.prototype.buildPath=function(ctx,shape){var points=shape.points,i=0,len=points.length/2;if(shape.connectNulls){for(;len>0&&isPointNull$1(points[2*len-2],points[2*len-1]);len--);for(;i<len&&isPointNull$1(points[2*i],points[2*i+1]);i++);}for(;i<len;)i+=drawSegment(ctx,points,i,len,len,1,shape.smooth,shape.smoothMonotone,shape.connectNulls)+1},ECPolyline.prototype.getPointOn=function(xOrY,dim){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var x0,y0,data=this.path.data,CMD=PathProxy$1.CMD,isDimX="x"===dim,roots=[],i=0;i<data.length;){var x=void 0,y=void 0,x2=void 0,y2=void 0,x3=void 0,y3=void 0,t=void 0;switch(data[i++]){case CMD.M:x0=data[i++],y0=data[i++];break;case CMD.L:if(x=data[i++],y=data[i++],(t=isDimX?(xOrY-x0)/(x-x0):(xOrY-y0)/(y-y0))<=1&&t>=0){var val=isDimX?(y-y0)*t+y0:(x-x0)*t+x0;return isDimX?[xOrY,val]:[val,xOrY]}x0=x,y0=y;break;case CMD.C:x=data[i++],y=data[i++],x2=data[i++],y2=data[i++],x3=data[i++],y3=data[i++];var nRoot=isDimX?cubicRootAt(x0,x,x2,x3,xOrY,roots):cubicRootAt(y0,y,y2,y3,xOrY,roots);if(nRoot>0)for(var i_1=0;i_1<nRoot;i_1++){var t_1=roots[i_1];if(t_1<=1&&t_1>=0){val=isDimX?cubicAt(y0,y,y2,y3,t_1):cubicAt(x0,x,x2,x3,t_1);return isDimX?[xOrY,val]:[val,xOrY]}}x0=x3,y0=y3}}},ECPolyline}(Path$1),ECPolygonShape=function(_super){function ECPolygonShape(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ECPolygonShape,_super),ECPolygonShape}(ECPolylineShape),ECPolygon=function(_super){function ECPolygon(opts){var _this=_super.call(this,opts)||this;return _this.type="ec-polygon",_this}return __extends(ECPolygon,_super),ECPolygon.prototype.getDefaultShape=function(){return new ECPolygonShape},ECPolygon.prototype.buildPath=function(ctx,shape){var points=shape.points,stackedOnPoints=shape.stackedOnPoints,i=0,len=points.length/2,smoothMonotone=shape.smoothMonotone;if(shape.connectNulls){for(;len>0&&isPointNull$1(points[2*len-2],points[2*len-1]);len--);for(;i<len&&isPointNull$1(points[2*i],points[2*i+1]);i++);}for(;i<len;){var k=drawSegment(ctx,points,i,len,len,1,shape.smooth,smoothMonotone,shape.connectNulls);drawSegment(ctx,stackedOnPoints,i+k-1,k,len,-1,shape.stackedOnSmooth,smoothMonotone,shape.connectNulls),i+=k+1,ctx.closePath()}},ECPolygon}(Path$1);function createGridClipPath(cartesian,hasAnimation,seriesModel,done,during){var rect=cartesian.getArea(),x=rect.x,y=rect.y,width=rect.width,height=rect.height,lineWidth=seriesModel.get(["lineStyle","width"])||0;x-=lineWidth/2,y-=lineWidth/2,width+=lineWidth,height+=lineWidth,width=Math.ceil(width),x!==Math.floor(x)&&(x=Math.floor(x),width++);var clipPath=new Rect$4({shape:{x:x,y:y,width:width,height:height}});if(hasAnimation){var baseAxis=cartesian.getBaseAxis(),isHorizontal=baseAxis.isHorizontal(),isAxisInversed=baseAxis.inverse;isHorizontal?(isAxisInversed&&(clipPath.shape.x+=width),clipPath.shape.width=0):(isAxisInversed||(clipPath.shape.y+=height),clipPath.shape.height=0);var duringCb=isFunction(during)?function(percent){during(percent,clipPath)}:null;initProps(clipPath,{shape:{width:width,height:height,x:x,y:y}},seriesModel,null,done,duringCb)}return clipPath}function createPolarClipPath(polar,hasAnimation,seriesModel){var sectorArea=polar.getArea(),r0=round$3(sectorArea.r0,1),r=round$3(sectorArea.r,1),clipPath=new Sector$1({shape:{cx:round$3(polar.cx,1),cy:round$3(polar.cy,1),r0:r0,r:r,startAngle:sectorArea.startAngle,endAngle:sectorArea.endAngle,clockwise:sectorArea.clockwise}});hasAnimation&&("angle"===polar.getBaseAxis().dim?clipPath.shape.endAngle=sectorArea.startAngle:clipPath.shape.r=r0,initProps(clipPath,{shape:{endAngle:sectorArea.endAngle,r:r}},seriesModel));return clipPath}function createClipPath(coordSys,hasAnimation,seriesModel,done,during){return coordSys?"polar"===coordSys.type?createPolarClipPath(coordSys,hasAnimation,seriesModel):"cartesian2d"===coordSys.type?createGridClipPath(coordSys,hasAnimation,seriesModel,done,during):null:null}function isCoordinateSystemType(coordSys,type){return coordSys.type===type}function isPointsSame(points1,points2){if(points1.length===points2.length){for(var i=0;i<points1.length;i++)if(points1[i]!==points2[i])return;return!0}}function bboxFromPoints(points){for(var minX=1/0,minY=1/0,maxX=-1/0,maxY=-1/0,i=0;i<points.length;){var x=points[i++],y=points[i++];isNaN(x)||(minX=Math.min(x,minX),maxX=Math.max(x,maxX)),isNaN(y)||(minY=Math.min(y,minY),maxY=Math.max(y,maxY))}return[[minX,minY],[maxX,maxY]]}function getBoundingDiff(points1,points2){var _a=bboxFromPoints(points1),min1=_a[0],max1=_a[1],_b=bboxFromPoints(points2),min2=_b[0],max2=_b[1];return Math.max(Math.abs(min1[0]-min2[0]),Math.abs(min1[1]-min2[1]),Math.abs(max1[0]-max2[0]),Math.abs(max1[1]-max2[1]))}function getSmooth(smooth){return isNumber(smooth)?smooth:smooth?.5:0}function turnPointsIntoStep(points,basePoints,coordSys,stepTurnAt,connectNulls){var baseAxis=coordSys.getBaseAxis(),baseIndex="x"===baseAxis.dim||"radius"===baseAxis.dim?0:1,stepPoints=[],i=0,stepPt=[],pt=[],nextPt=[],filteredPoints=[];if(connectNulls){for(i=0;i<points.length;i+=2){var reference=basePoints||points;isNaN(reference[i])||isNaN(reference[i+1])||filteredPoints.push(points[i],points[i+1])}points=filteredPoints}for(i=0;i<points.length-2;i+=2)switch(nextPt[0]=points[i+2],nextPt[1]=points[i+3],pt[0]=points[i],pt[1]=points[i+1],stepPoints.push(pt[0],pt[1]),stepTurnAt){case"end":stepPt[baseIndex]=nextPt[baseIndex],stepPt[1-baseIndex]=pt[1-baseIndex],stepPoints.push(stepPt[0],stepPt[1]);break;case"middle":var middle=(pt[baseIndex]+nextPt[baseIndex])/2,stepPt2=[];stepPt[baseIndex]=stepPt2[baseIndex]=middle,stepPt[1-baseIndex]=pt[1-baseIndex],stepPt2[1-baseIndex]=nextPt[1-baseIndex],stepPoints.push(stepPt[0],stepPt[1]),stepPoints.push(stepPt2[0],stepPt2[1]);break;default:stepPt[baseIndex]=pt[baseIndex],stepPt[1-baseIndex]=nextPt[1-baseIndex],stepPoints.push(stepPt[0],stepPt[1])}return stepPoints.push(points[i++],points[i++]),stepPoints}function clipColorStops(colorStops,maxSize){var prevOutOfRangeColorStop,prevInRangeColorStop,newColorStops=[],len=colorStops.length;function lerpStop(stop0,stop1,clippedCoord){var coord0=stop0.coord;return{coord:clippedCoord,color:function(normalizedValue,colors,fullOutput){if(colors&&colors.length&&normalizedValue>=0&&normalizedValue<=1){var value=normalizedValue*(colors.length-1),leftIndex=Math.floor(value),rightIndex=Math.ceil(value),leftColor=parse$1(colors[leftIndex]),rightColor=parse$1(colors[rightIndex]),dv=value-leftIndex,color=stringify$1([clampCssByte(lerpNumber(leftColor[0],rightColor[0],dv)),clampCssByte(lerpNumber(leftColor[1],rightColor[1],dv)),clampCssByte(lerpNumber(leftColor[2],rightColor[2],dv)),clampCssFloat(lerpNumber(leftColor[3],rightColor[3],dv))],"rgba");return fullOutput?{color:color,leftIndex:leftIndex,rightIndex:rightIndex,value:value}:color}}((clippedCoord-coord0)/(stop1.coord-coord0),[stop0.color,stop1.color])}}for(var i=0;i<len;i++){var stop_1=colorStops[i],coord=stop_1.coord;if(coord<0)prevOutOfRangeColorStop=stop_1;else{if(coord>maxSize){prevInRangeColorStop?newColorStops.push(lerpStop(prevInRangeColorStop,stop_1,maxSize)):prevOutOfRangeColorStop&&newColorStops.push(lerpStop(prevOutOfRangeColorStop,stop_1,0),lerpStop(prevOutOfRangeColorStop,stop_1,maxSize));break}prevOutOfRangeColorStop&&(newColorStops.push(lerpStop(prevOutOfRangeColorStop,stop_1,0)),prevOutOfRangeColorStop=null),newColorStops.push(stop_1),prevInRangeColorStop=stop_1}}return newColorStops}function getIsIgnoreFunc(seriesModel,data,coordSys){var showAllSymbol=seriesModel.get("showAllSymbol"),isAuto="auto"===showAllSymbol;if(!showAllSymbol||isAuto){var categoryAxis=coordSys.getAxesByScale("ordinal")[0];if(categoryAxis&&(!isAuto||!function(categoryAxis,data){var axisExtent=categoryAxis.getExtent(),availSize=Math.abs(axisExtent[1]-axisExtent[0])/categoryAxis.scale.count();isNaN(availSize)&&(availSize=0);for(var dataLen=data.count(),step=Math.max(1,Math.round(dataLen/5)),dataIndex=0;dataIndex<dataLen;dataIndex+=step)if(1.5*SymbolClz.getSymbolSize(data,dataIndex)[categoryAxis.isHorizontal()?1:0]>availSize)return!1;return!0}(categoryAxis,data))){var categoryDataDim=data.mapDimension(categoryAxis.dim),labelMap={};return each$b(categoryAxis.getViewLabels(),(function(labelItem){var ordinalNumber=categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue);labelMap[ordinalNumber]=1})),function(dataIndex){return!labelMap.hasOwnProperty(data.get(categoryDataDim,dataIndex))}}}}function getPointAtIndex(points,idx){return[points[2*idx],points[2*idx+1]]}function anyStateShowEndLabel(seriesModel){if(seriesModel.get(["endLabel","show"]))return!0;for(var i=0;i<SPECIAL_STATES.length;i++)if(seriesModel.get([SPECIAL_STATES[i],"endLabel","show"]))return!0;return!1}function createLineClipPath(lineView,coordSys,hasAnimation,seriesModel){if(isCoordinateSystemType(coordSys,"cartesian2d")){var endLabelModel_1=seriesModel.getModel("endLabel"),valueAnimation_1=endLabelModel_1.get("valueAnimation"),data_1=seriesModel.getData(),labelAnimationRecord_1={lastFrameIndex:0},during=anyStateShowEndLabel(seriesModel)?function(percent,clipRect){lineView._endLabelOnDuring(percent,clipRect,data_1,labelAnimationRecord_1,valueAnimation_1,endLabelModel_1,coordSys)}:null,isHorizontal=coordSys.getBaseAxis().isHorizontal(),clipPath=createGridClipPath(coordSys,hasAnimation,seriesModel,(function(){var endLabel=lineView._endLabel;endLabel&&hasAnimation&&null!=labelAnimationRecord_1.originalX&&endLabel.attr({x:labelAnimationRecord_1.originalX,y:labelAnimationRecord_1.originalY})}),during);if(!seriesModel.get("clip",!0)){var rectShape=clipPath.shape,expandSize=Math.max(rectShape.width,rectShape.height);isHorizontal?(rectShape.y-=expandSize,rectShape.height+=2*expandSize):(rectShape.x-=expandSize,rectShape.width+=2*expandSize)}return during&&during(1,clipPath),clipPath}return"production"!==process.env.NODE_ENV&&seriesModel.get(["endLabel","show"])&&console.warn("endLabel is not supported for lines in polar systems."),createPolarClipPath(coordSys,hasAnimation,seriesModel)}var LineView=function(_super){function LineView(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(LineView,_super),LineView.prototype.init=function(){var lineGroup=new Group$4,symbolDraw=new SymbolDraw$1;this.group.add(symbolDraw.group),this._symbolDraw=symbolDraw,this._lineGroup=lineGroup,this._changePolyState=bind$1(this._changePolyState,this)},LineView.prototype.render=function(seriesModel,ecModel,api){var coordSys=seriesModel.coordinateSystem,group=this.group,data=seriesModel.getData(),lineStyleModel=seriesModel.getModel("lineStyle"),areaStyleModel=seriesModel.getModel("areaStyle"),points=data.getLayout("points")||[],isCoordSysPolar="polar"===coordSys.type,prevCoordSys=this._coordSys,symbolDraw=this._symbolDraw,polyline=this._polyline,polygon=this._polygon,lineGroup=this._lineGroup,hasAnimation=!ecModel.ssr&&seriesModel.get("animation"),isAreaChart=!areaStyleModel.isEmpty(),valueOrigin=areaStyleModel.get("origin"),dataCoordInfo=prepareDataCoordInfo(coordSys,data,valueOrigin),stackedOnPoints=isAreaChart&&function(coordSys,data,dataCoordInfo){if(!dataCoordInfo.valueDim)return[];for(var len=data.count(),points=createFloat32Array(2*len),idx=0;idx<len;idx++){var pt=getStackedOnPoint(dataCoordInfo,coordSys,data,idx);points[2*idx]=pt[0],points[2*idx+1]=pt[1]}return points}(coordSys,data,dataCoordInfo),showSymbol=seriesModel.get("showSymbol"),connectNulls=seriesModel.get("connectNulls"),isIgnoreFunc=showSymbol&&!isCoordSysPolar&&getIsIgnoreFunc(seriesModel,data,coordSys),oldData=this._data;oldData&&oldData.eachItemGraphicEl((function(el,idx){el.__temp&&(group.remove(el),oldData.setItemGraphicEl(idx,null))})),showSymbol||symbolDraw.remove(),group.add(lineGroup);var clipShapeForSymbol,step=!isCoordSysPolar&&seriesModel.get("step");coordSys&&coordSys.getArea&&seriesModel.get("clip",!0)&&(null!=(clipShapeForSymbol=coordSys.getArea()).width?(clipShapeForSymbol.x-=.1,clipShapeForSymbol.y-=.1,clipShapeForSymbol.width+=.2,clipShapeForSymbol.height+=.2):clipShapeForSymbol.r0&&(clipShapeForSymbol.r0-=.5,clipShapeForSymbol.r+=.5)),this._clipShapeForSymbol=clipShapeForSymbol;var visualColor=function(data,coordSys,api){var visualMetaList=data.getVisual("visualMeta");if(visualMetaList&&visualMetaList.length&&data.count())if("cartesian2d"===coordSys.type){for(var coordDim,visualMeta,i=visualMetaList.length-1;i>=0;i--){var dimInfo=data.getDimensionInfo(visualMetaList[i].dimension);if("x"===(coordDim=dimInfo&&dimInfo.coordDim)||"y"===coordDim){visualMeta=visualMetaList[i];break}}if(visualMeta){var axis=coordSys.getAxis(coordDim),colorStops=map$1(visualMeta.stops,(function(stop){return{coord:axis.toGlobalCoord(axis.dataToCoord(stop.value)),color:stop.color}})),stopLen=colorStops.length,outerColors=visualMeta.outerColors.slice();stopLen&&colorStops[0].coord>colorStops[stopLen-1].coord&&(colorStops.reverse(),outerColors.reverse());var colorStopsInRange=clipColorStops(colorStops,"x"===coordDim?api.getWidth():api.getHeight()),inRangeStopLen=colorStopsInRange.length;if(!inRangeStopLen&&stopLen)return colorStops[0].coord<0?outerColors[1]?outerColors[1]:colorStops[stopLen-1].color:outerColors[0]?outerColors[0]:colorStops[0].color;var minCoord=colorStopsInRange[0].coord-10,maxCoord=colorStopsInRange[inRangeStopLen-1].coord+10,coordSpan=maxCoord-minCoord;if(coordSpan<.001)return"transparent";each$b(colorStopsInRange,(function(stop){stop.offset=(stop.coord-minCoord)/coordSpan})),colorStopsInRange.push({offset:inRangeStopLen?colorStopsInRange[inRangeStopLen-1].offset:.5,color:outerColors[1]||"transparent"}),colorStopsInRange.unshift({offset:inRangeStopLen?colorStopsInRange[0].offset:.5,color:outerColors[0]||"transparent"});var gradient=new LinearGradient$1(0,0,0,0,colorStopsInRange,!0);return gradient[coordDim]=minCoord,gradient[coordDim+"2"]=maxCoord,gradient}"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style only support x or y dimension.")}else"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style is only supported on cartesian2d.")}(data,coordSys,api)||data.getVisual("style")[data.getVisual("drawType")];if(polyline&&prevCoordSys.type===coordSys.type&&step===this._step){isAreaChart&&!polygon?polygon=this._newPolygon(points,stackedOnPoints):polygon&&!isAreaChart&&(lineGroup.remove(polygon),polygon=this._polygon=null),isCoordSysPolar||this._initOrUpdateEndLabel(seriesModel,coordSys,convertToColorString(visualColor));var oldClipPath=lineGroup.getClipPath();if(oldClipPath)initProps(oldClipPath,{shape:createLineClipPath(this,coordSys,!1,seriesModel).shape},seriesModel);else lineGroup.setClipPath(createLineClipPath(this,coordSys,!0,seriesModel));showSymbol&&symbolDraw.updateData(data,{isIgnore:isIgnoreFunc,clipShape:clipShapeForSymbol,disableAnimation:!0,getSymbolPoint:function(idx){return[points[2*idx],points[2*idx+1]]}}),isPointsSame(this._stackedOnPoints,stackedOnPoints)&&isPointsSame(this._points,points)||(hasAnimation?this._doUpdateAnimation(data,stackedOnPoints,coordSys,api,step,valueOrigin,connectNulls):(step&&(stackedOnPoints&&(stackedOnPoints=turnPointsIntoStep(stackedOnPoints,points,coordSys,step,connectNulls)),points=turnPointsIntoStep(points,null,coordSys,step,connectNulls)),polyline.setShape({points:points}),polygon&&polygon.setShape({points:points,stackedOnPoints:stackedOnPoints})))}else showSymbol&&symbolDraw.updateData(data,{isIgnore:isIgnoreFunc,clipShape:clipShapeForSymbol,disableAnimation:!0,getSymbolPoint:function(idx){return[points[2*idx],points[2*idx+1]]}}),hasAnimation&&this._initSymbolLabelAnimation(data,coordSys,clipShapeForSymbol),step&&(stackedOnPoints&&(stackedOnPoints=turnPointsIntoStep(stackedOnPoints,points,coordSys,step,connectNulls)),points=turnPointsIntoStep(points,null,coordSys,step,connectNulls)),polyline=this._newPolyline(points),isAreaChart?polygon=this._newPolygon(points,stackedOnPoints):polygon&&(lineGroup.remove(polygon),polygon=this._polygon=null),isCoordSysPolar||this._initOrUpdateEndLabel(seriesModel,coordSys,convertToColorString(visualColor)),lineGroup.setClipPath(createLineClipPath(this,coordSys,!0,seriesModel));var emphasisModel=seriesModel.getModel("emphasis"),focus=emphasisModel.get("focus"),blurScope=emphasisModel.get("blurScope"),emphasisDisabled=emphasisModel.get("disabled");(polyline.useStyle(defaults(lineStyleModel.getLineStyle(),{fill:"none",stroke:visualColor,lineJoin:"bevel"})),setStatesStylesFromModel(polyline,seriesModel,"lineStyle"),polyline.style.lineWidth>0&&"bolder"===seriesModel.get(["emphasis","lineStyle","width"]))&&(polyline.getState("emphasis").style.lineWidth=+polyline.style.lineWidth+1);getECData(polyline).seriesIndex=seriesModel.seriesIndex,toggleHoverEmphasis(polyline,focus,blurScope,emphasisDisabled);var smooth=getSmooth(seriesModel.get("smooth")),smoothMonotone=seriesModel.get("smoothMonotone");if(polyline.setShape({smooth:smooth,smoothMonotone:smoothMonotone,connectNulls:connectNulls}),polygon){var stackedOnSeries=data.getCalculationInfo("stackedOnSeries"),stackedOnSmooth=0;polygon.useStyle(defaults(areaStyleModel.getAreaStyle(),{fill:visualColor,opacity:.7,lineJoin:"bevel",decal:data.getVisual("style").decal})),stackedOnSeries&&(stackedOnSmooth=getSmooth(stackedOnSeries.get("smooth"))),polygon.setShape({smooth:smooth,stackedOnSmooth:stackedOnSmooth,smoothMonotone:smoothMonotone,connectNulls:connectNulls}),setStatesStylesFromModel(polygon,seriesModel,"areaStyle"),getECData(polygon).seriesIndex=seriesModel.seriesIndex,toggleHoverEmphasis(polygon,focus,blurScope,emphasisDisabled)}var changePolyState=this._changePolyState;data.eachItemGraphicEl((function(el){el&&(el.onHoverStateChange=changePolyState)})),this._polyline.onHoverStateChange=changePolyState,this._data=data,this._coordSys=coordSys,this._stackedOnPoints=stackedOnPoints,this._points=points,this._step=step,this._valueOrigin=valueOrigin,seriesModel.get("triggerLineEvent")&&(this.packEventData(seriesModel,polyline),polygon&&this.packEventData(seriesModel,polygon))},LineView.prototype.packEventData=function(seriesModel,el){getECData(el).eventData={componentType:"series",componentSubType:"line",componentIndex:seriesModel.componentIndex,seriesIndex:seriesModel.seriesIndex,seriesName:seriesModel.name,seriesType:"line"}},LineView.prototype.highlight=function(seriesModel,ecModel,api,payload){var data=seriesModel.getData(),dataIndex=queryDataIndex(data,payload);if(this._changePolyState("emphasis"),!(dataIndex instanceof Array)&&null!=dataIndex&&dataIndex>=0){var points=data.getLayout("points"),symbol=data.getItemGraphicEl(dataIndex);if(!symbol){var x=points[2*dataIndex],y=points[2*dataIndex+1];if(isNaN(x)||isNaN(y))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(x,y))return;var zlevel=seriesModel.get("zlevel")||0,z=seriesModel.get("z")||0;(symbol=new SymbolClz(data,dataIndex)).x=x,symbol.y=y,symbol.setZ(zlevel,z);var symbolLabel=symbol.getSymbolPath().getTextContent();symbolLabel&&(symbolLabel.zlevel=zlevel,symbolLabel.z=z,symbolLabel.z2=this._polyline.z2+1),symbol.__temp=!0,data.setItemGraphicEl(dataIndex,symbol),symbol.stopSymbolAnimation(!0),this.group.add(symbol)}symbol.highlight()}else ChartView$1.prototype.highlight.call(this,seriesModel,ecModel,api,payload)},LineView.prototype.downplay=function(seriesModel,ecModel,api,payload){var data=seriesModel.getData(),dataIndex=queryDataIndex(data,payload);if(this._changePolyState("normal"),null!=dataIndex&&dataIndex>=0){var symbol=data.getItemGraphicEl(dataIndex);symbol&&(symbol.__temp?(data.setItemGraphicEl(dataIndex,null),this.group.remove(symbol)):symbol.downplay())}else ChartView$1.prototype.downplay.call(this,seriesModel,ecModel,api,payload)},LineView.prototype._changePolyState=function(toState){var polygon=this._polygon;setStatesFlag(this._polyline,toState),polygon&&setStatesFlag(polygon,toState)},LineView.prototype._newPolyline=function(points){var polyline=this._polyline;return polyline&&this._lineGroup.remove(polyline),polyline=new ECPolyline({shape:{points:points},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(polyline),this._polyline=polyline,polyline},LineView.prototype._newPolygon=function(points,stackedOnPoints){var polygon=this._polygon;return polygon&&this._lineGroup.remove(polygon),polygon=new ECPolygon({shape:{points:points,stackedOnPoints:stackedOnPoints},segmentIgnoreThreshold:2}),this._lineGroup.add(polygon),this._polygon=polygon,polygon},LineView.prototype._initSymbolLabelAnimation=function(data,coordSys,clipShape){var isHorizontalOrRadial,isCoordSysPolar,baseAxis=coordSys.getBaseAxis(),isAxisInverse=baseAxis.inverse;"cartesian2d"===coordSys.type?(isHorizontalOrRadial=baseAxis.isHorizontal(),isCoordSysPolar=!1):"polar"===coordSys.type&&(isHorizontalOrRadial="angle"===baseAxis.dim,isCoordSysPolar=!0);var seriesModel=data.hostModel,seriesDuration=seriesModel.get("animationDuration");isFunction(seriesDuration)&&(seriesDuration=seriesDuration(null));var seriesDelay=seriesModel.get("animationDelay")||0,seriesDelayValue=isFunction(seriesDelay)?seriesDelay(null):seriesDelay;data.eachItemGraphicEl((function(symbol,idx){var el=symbol;if(el){var point=[symbol.x,symbol.y],start=void 0,end=void 0,current=void 0;if(clipShape)if(isCoordSysPolar){var polarClip=clipShape,coord=coordSys.pointToCoord(point);isHorizontalOrRadial?(start=polarClip.startAngle,end=polarClip.endAngle,current=-coord[1]/180*Math.PI):(start=polarClip.r0,end=polarClip.r,current=coord[0])}else{var gridClip=clipShape;isHorizontalOrRadial?(start=gridClip.x,end=gridClip.x+gridClip.width,current=symbol.x):(start=gridClip.y+gridClip.height,end=gridClip.y,current=symbol.y)}var ratio=end===start?0:(current-start)/(end-start);isAxisInverse&&(ratio=1-ratio);var delay=isFunction(seriesDelay)?seriesDelay(idx):seriesDuration*ratio+seriesDelayValue,symbolPath=el.getSymbolPath(),text=symbolPath.getTextContent();el.attr({scaleX:0,scaleY:0}),el.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:delay}),text&&text.animateFrom({style:{opacity:0}},{duration:300,delay:delay}),symbolPath.disableLabelAnimation=!0}}))},LineView.prototype._initOrUpdateEndLabel=function(seriesModel,coordSys,inheritColor){var endLabelModel=seriesModel.getModel("endLabel");if(anyStateShowEndLabel(seriesModel)){var data_2=seriesModel.getData(),polyline=this._polyline,points=data_2.getLayout("points");if(!points)return polyline.removeTextContent(),void(this._endLabel=null);var endLabel=this._endLabel;endLabel||((endLabel=this._endLabel=new ZRText$1({z2:200})).ignoreClip=!0,polyline.setTextContent(this._endLabel),polyline.disableLabelAnimation=!0);var dataIndex=function(points){for(var x,y,len=points.length/2;len>0&&(x=points[2*len-2],y=points[2*len-1],isNaN(x)||isNaN(y));len--);return len-1}(points);dataIndex>=0&&(setLabelStyle(polyline,getLabelStatesModels(seriesModel,"endLabel"),{inheritColor:inheritColor,labelFetcher:seriesModel,labelDataIndex:dataIndex,defaultText:function(dataIndex,opt,interpolatedValue){return null!=interpolatedValue?getDefaultInterpolatedLabel(data_2,interpolatedValue):getDefaultLabel(data_2,dataIndex)},enableTextSetter:!0},function(endLabelModel,coordSys){var baseAxis=coordSys.getBaseAxis(),isHorizontal=baseAxis.isHorizontal(),isBaseInversed=baseAxis.inverse,align=isHorizontal?isBaseInversed?"right":"left":"center",verticalAlign=isHorizontal?"middle":isBaseInversed?"top":"bottom";return{normal:{align:endLabelModel.get("align")||align,verticalAlign:endLabelModel.get("verticalAlign")||verticalAlign}}}(endLabelModel,coordSys)),polyline.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},LineView.prototype._endLabelOnDuring=function(percent,clipRect,data,animationRecord,valueAnimation,endLabelModel,coordSys){var endLabel=this._endLabel,polyline=this._polyline;if(endLabel){percent<1&&null==animationRecord.originalX&&(animationRecord.originalX=endLabel.x,animationRecord.originalY=endLabel.y);var points=data.getLayout("points"),seriesModel=data.hostModel,connectNulls=seriesModel.get("connectNulls"),precision=endLabelModel.get("precision"),distance=endLabelModel.get("distance")||0,baseAxis=coordSys.getBaseAxis(),isHorizontal=baseAxis.isHorizontal(),isBaseInversed=baseAxis.inverse,clipShape=clipRect.shape,xOrY=isBaseInversed?isHorizontal?clipShape.x:clipShape.y+clipShape.height:isHorizontal?clipShape.x+clipShape.width:clipShape.y,distanceX=(isHorizontal?distance:0)*(isBaseInversed?-1:1),distanceY=(isHorizontal?0:-distance)*(isBaseInversed?-1:1),dim=isHorizontal?"x":"y",dataIndexRange=function(points,xOrY,dim){for(var a,b,len=points.length/2,dimIdx="x"===dim?0:1,prevIndex=0,nextIndex=-1,i=0;i<len;i++)if(b=points[2*i+dimIdx],!isNaN(b)&&!isNaN(points[2*i+1-dimIdx]))if(0!==i){if(a<=xOrY&&b>=xOrY||a>=xOrY&&b<=xOrY){nextIndex=i;break}prevIndex=i,a=b}else a=b;return{range:[prevIndex,nextIndex],t:(xOrY-a)/(b-a)}}(points,xOrY,dim),indices=dataIndexRange.range,diff=indices[1]-indices[0],value=void 0;if(diff>=1){if(diff>1&&!connectNulls){var pt=getPointAtIndex(points,indices[0]);endLabel.attr({x:pt[0]+distanceX,y:pt[1]+distanceY}),valueAnimation&&(value=seriesModel.getRawValue(indices[0]))}else{(pt=polyline.getPointOn(xOrY,dim))&&endLabel.attr({x:pt[0]+distanceX,y:pt[1]+distanceY});var startValue=seriesModel.getRawValue(indices[0]),endValue=seriesModel.getRawValue(indices[1]);valueAnimation&&(value=interpolateRawValues(data,precision,startValue,endValue,dataIndexRange.t))}animationRecord.lastFrameIndex=indices[0]}else{var idx=1===percent||animationRecord.lastFrameIndex>0?indices[0]:0;pt=getPointAtIndex(points,idx);valueAnimation&&(value=seriesModel.getRawValue(idx)),endLabel.attr({x:pt[0]+distanceX,y:pt[1]+distanceY})}if(valueAnimation){var inner=labelInner(endLabel);"function"==typeof inner.setLabelText&&inner.setLabelText(value)}}},LineView.prototype._doUpdateAnimation=function(data,stackedOnPoints,coordSys,api,step,valueOrigin,connectNulls){var polyline=this._polyline,polygon=this._polygon,seriesModel=data.hostModel,diff=function(oldData,newData,oldStackedOnPoints,newStackedOnPoints,oldCoordSys,newCoordSys,oldValueOrigin){for(var diff=function(oldData,newData){var diffResult=[];return newData.diff(oldData).add((function(idx){diffResult.push({cmd:"+",idx:idx})})).update((function(newIdx,oldIdx){diffResult.push({cmd:"=",idx:oldIdx,idx1:newIdx})})).remove((function(idx){diffResult.push({cmd:"-",idx:idx})})).execute(),diffResult}(oldData,newData),currPoints=[],nextPoints=[],currStackedPoints=[],nextStackedPoints=[],status=[],sortedIndices=[],rawIndices=[],newDataOldCoordInfo=prepareDataCoordInfo(oldCoordSys,newData,oldValueOrigin),oldPoints=oldData.getLayout("points")||[],newPoints=newData.getLayout("points")||[],i=0;i<diff.length;i++){var diffItem=diff[i],pointAdded=!0,oldIdx2=void 0,newIdx2=void 0;switch(diffItem.cmd){case"=":oldIdx2=2*diffItem.idx,newIdx2=2*diffItem.idx1;var currentX=oldPoints[oldIdx2],currentY=oldPoints[oldIdx2+1],nextX=newPoints[newIdx2],nextY=newPoints[newIdx2+1];(isNaN(currentX)||isNaN(currentY))&&(currentX=nextX,currentY=nextY),currPoints.push(currentX,currentY),nextPoints.push(nextX,nextY),currStackedPoints.push(oldStackedOnPoints[oldIdx2],oldStackedOnPoints[oldIdx2+1]),nextStackedPoints.push(newStackedOnPoints[newIdx2],newStackedOnPoints[newIdx2+1]),rawIndices.push(newData.getRawIndex(diffItem.idx1));break;case"+":var newIdx=diffItem.idx,newDataDimsForPoint=newDataOldCoordInfo.dataDimsForPoint,oldPt=oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0],newIdx),newData.get(newDataDimsForPoint[1],newIdx)]);newIdx2=2*newIdx,currPoints.push(oldPt[0],oldPt[1]),nextPoints.push(newPoints[newIdx2],newPoints[newIdx2+1]);var stackedOnPoint=getStackedOnPoint(newDataOldCoordInfo,oldCoordSys,newData,newIdx);currStackedPoints.push(stackedOnPoint[0],stackedOnPoint[1]),nextStackedPoints.push(newStackedOnPoints[newIdx2],newStackedOnPoints[newIdx2+1]),rawIndices.push(newData.getRawIndex(newIdx));break;case"-":pointAdded=!1}pointAdded&&(status.push(diffItem),sortedIndices.push(sortedIndices.length))}sortedIndices.sort((function(a,b){return rawIndices[a]-rawIndices[b]}));var len=currPoints.length,sortedCurrPoints=createFloat32Array(len),sortedNextPoints=createFloat32Array(len),sortedCurrStackedPoints=createFloat32Array(len),sortedNextStackedPoints=createFloat32Array(len),sortedStatus=[];for(i=0;i<sortedIndices.length;i++){var idx=sortedIndices[i],i2=2*i,idx2=2*idx;sortedCurrPoints[i2]=currPoints[idx2],sortedCurrPoints[i2+1]=currPoints[idx2+1],sortedNextPoints[i2]=nextPoints[idx2],sortedNextPoints[i2+1]=nextPoints[idx2+1],sortedCurrStackedPoints[i2]=currStackedPoints[idx2],sortedCurrStackedPoints[i2+1]=currStackedPoints[idx2+1],sortedNextStackedPoints[i2]=nextStackedPoints[idx2],sortedNextStackedPoints[i2+1]=nextStackedPoints[idx2+1],sortedStatus[i]=status[idx]}return{current:sortedCurrPoints,next:sortedNextPoints,stackedOnCurrent:sortedCurrStackedPoints,stackedOnNext:sortedNextStackedPoints,status:sortedStatus}}(this._data,data,this._stackedOnPoints,stackedOnPoints,this._coordSys,0,this._valueOrigin),current=diff.current,stackedOnCurrent=diff.stackedOnCurrent,next=diff.next,stackedOnNext=diff.stackedOnNext;if(step&&(stackedOnCurrent=turnPointsIntoStep(diff.stackedOnCurrent,diff.current,coordSys,step,connectNulls),current=turnPointsIntoStep(diff.current,null,coordSys,step,connectNulls),stackedOnNext=turnPointsIntoStep(diff.stackedOnNext,diff.next,coordSys,step,connectNulls),next=turnPointsIntoStep(diff.next,null,coordSys,step,connectNulls)),getBoundingDiff(current,next)>3e3||polygon&&getBoundingDiff(stackedOnCurrent,stackedOnNext)>3e3)return polyline.stopAnimation(),polyline.setShape({points:next}),void(polygon&&(polygon.stopAnimation(),polygon.setShape({points:next,stackedOnPoints:stackedOnNext})));polyline.shape.__points=diff.current,polyline.shape.points=current;var target={shape:{points:next}};diff.current!==current&&(target.shape.__points=diff.next),polyline.stopAnimation(),updateProps$1(polyline,target,seriesModel),polygon&&(polygon.setShape({points:current,stackedOnPoints:stackedOnCurrent}),polygon.stopAnimation(),updateProps$1(polygon,{shape:{stackedOnPoints:stackedOnNext}},seriesModel),polyline.shape.points!==polygon.shape.points&&(polygon.shape.points=polyline.shape.points));for(var updatedDataInfo=[],diffStatus=diff.status,i=0;i<diffStatus.length;i++){if("="===diffStatus[i].cmd){var el=data.getItemGraphicEl(diffStatus[i].idx1);el&&updatedDataInfo.push({el:el,ptIdx:i})}}polyline.animators&&polyline.animators.length&&polyline.animators[0].during((function(){polygon&&polygon.dirtyShape();for(var points=polyline.shape.__points,i=0;i<updatedDataInfo.length;i++){var el=updatedDataInfo[i].el,offset=2*updatedDataInfo[i].ptIdx;el.x=points[offset],el.y=points[offset+1],el.markRedraw()}}))},LineView.prototype.remove=function(ecModel){var group=this.group,oldData=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),oldData&&oldData.eachItemGraphicEl((function(el,idx){el.__temp&&(group.remove(el),oldData.setItemGraphicEl(idx,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},LineView.type="line",LineView}(ChartView$1),LineView$1=LineView;function pointsLayout(seriesType,forceStoreInTypedArray){return{seriesType:seriesType,plan:createRenderPlanner(),reset:function(seriesModel){var data=seriesModel.getData(),coordSys=seriesModel.coordinateSystem,pipelineContext=seriesModel.pipelineContext,useTypedArray=forceStoreInTypedArray||pipelineContext.large;if(coordSys){var dims=map$1(coordSys.dimensions,(function(dim){return data.mapDimension(dim)})).slice(0,2),dimLen=dims.length,stackResultDim=data.getCalculationInfo("stackResultDimension");isDimensionStacked(data,dims[0])&&(dims[0]=stackResultDim),isDimensionStacked(data,dims[1])&&(dims[1]=stackResultDim);var store=data.getStore(),dimIdx0=data.getDimensionIndex(dims[0]),dimIdx1=data.getDimensionIndex(dims[1]);return dimLen&&{progress:function(params,data){for(var segCount=params.end-params.start,points=useTypedArray&&createFloat32Array(segCount*dimLen),tmpIn=[],tmpOut=[],i=params.start,offset=0;i<params.end;i++){var point=void 0;if(1===dimLen){var x=store.get(dimIdx0,i);point=coordSys.dataToPoint(x,null,tmpOut)}else tmpIn[0]=store.get(dimIdx0,i),tmpIn[1]=store.get(dimIdx1,i),point=coordSys.dataToPoint(tmpIn,null,tmpOut);useTypedArray?(points[offset++]=point[0],points[offset++]=point[1]):data.setItemLayout(i,point.slice())}useTypedArray&&data.setLayout("points",points)}}}}}}var samplers={average:function(frame){for(var sum=0,count=0,i=0;i<frame.length;i++)isNaN(frame[i])||(sum+=frame[i],count++);return 0===count?NaN:sum/count},sum:function(frame){for(var sum=0,i=0;i<frame.length;i++)sum+=frame[i]||0;return sum},max:function(frame){for(var max=-1/0,i=0;i<frame.length;i++)frame[i]>max&&(max=frame[i]);return isFinite(max)?max:NaN},min:function(frame){for(var min=1/0,i=0;i<frame.length;i++)frame[i]<min&&(min=frame[i]);return isFinite(min)?min:NaN},nearest:function(frame){return frame[0]}},indexSampler=function(frame){return Math.round(frame.length/2)};function dataSample(seriesType){return{seriesType:seriesType,reset:function(seriesModel,ecModel,api){var data=seriesModel.getData(),sampling=seriesModel.get("sampling"),coordSys=seriesModel.coordinateSystem,count=data.count();if(count>10&&"cartesian2d"===coordSys.type&&sampling){var baseAxis=coordSys.getBaseAxis(),valueAxis=coordSys.getOtherAxis(baseAxis),extent=baseAxis.getExtent(),dpr=api.getDevicePixelRatio(),size=Math.abs(extent[1]-extent[0])*(dpr||1),rate=Math.round(count/size);if(isFinite(rate)&&rate>1){"lttb"===sampling?seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim),1/rate)):"minmax"===sampling&&seriesModel.setData(data.minmaxDownSample(data.mapDimension(valueAxis.dim),1/rate));var sampler=void 0;isString(sampling)?sampler=samplers[sampling]:isFunction(sampling)&&(sampler=sampling),sampler&&seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim),1/rate,sampler,indexSampler))}}}}}function install$y(registers){registers.registerChartView(LineView$1),registers.registerSeriesModel(LineSeries),registers.registerLayout(pointsLayout("line",!0)),registers.registerVisual({seriesType:"line",reset:function(seriesModel){var data=seriesModel.getData(),lineStyle=seriesModel.getModel("lineStyle").getLineStyle();lineStyle&&!lineStyle.stroke&&(lineStyle.stroke=data.getVisual("style").fill),data.setVisual("legendLineStyle",lineStyle)}}),registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC,dataSample("line"))}var BaseBarSeriesModel=function(_super){function BaseBarSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=BaseBarSeriesModel.type,_this}return __extends(BaseBarSeriesModel,_super),BaseBarSeriesModel.prototype.getInitialData=function(option,ecModel){return createSeriesData(null,this,{useEncodeDefaulter:!0})},BaseBarSeriesModel.prototype.getMarkerPosition=function(value,dims,startingAtTick){var coordSys=this.coordinateSystem;if(coordSys&&coordSys.clampData){var clampData_1=coordSys.clampData(value),pt_1=coordSys.dataToPoint(clampData_1);if(startingAtTick)each$b(coordSys.getAxes(),(function(axis,idx){if("category"===axis.type&&null!=dims){var tickCoords=axis.getTicksCoords(),alignTicksWithLabel=axis.getTickModel().get("alignWithLabel"),targetTickId=clampData_1[idx],isEnd="x1"===dims[idx]||"y1"===dims[idx];if(isEnd&&!alignTicksWithLabel&&(targetTickId+=1),tickCoords.length<2)return;if(2===tickCoords.length)return void(pt_1[idx]=axis.toGlobalCoord(axis.getExtent()[isEnd?1:0]));for(var leftCoord=void 0,coord=void 0,stepTickValue=1,i=0;i<tickCoords.length;i++){var tickCoord=tickCoords[i].coord,tickValue=i===tickCoords.length-1?tickCoords[i-1].tickValue+stepTickValue:tickCoords[i].tickValue;if(tickValue===targetTickId){coord=tickCoord;break}if(tickValue<targetTickId)leftCoord=tickCoord;else if(null!=leftCoord&&tickValue>targetTickId){coord=(tickCoord+leftCoord)/2;break}1===i&&(stepTickValue=tickValue-tickCoords[0].tickValue)}null==coord&&(leftCoord?leftCoord&&(coord=tickCoords[tickCoords.length-1].coord):coord=tickCoords[0].coord),pt_1[idx]=axis.toGlobalCoord(coord)}}));else{var data=this.getData(),offset=data.getLayout("offset"),size=data.getLayout("size"),offsetIndex=coordSys.getBaseAxis().isHorizontal()?0:1;pt_1[offsetIndex]+=offset+size/2}return pt_1}return[NaN,NaN]},BaseBarSeriesModel.type="series.__base_bar__",BaseBarSeriesModel.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},BaseBarSeriesModel}(SeriesModel$1);SeriesModel$1.registerClass(BaseBarSeriesModel);var BaseBarSeriesModel$1=BaseBarSeriesModel,BarSeries=function(_super){function BarSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=BarSeriesModel.type,_this}return __extends(BarSeriesModel,_super),BarSeriesModel.prototype.getInitialData=function(){return createSeriesData(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},BarSeriesModel.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},BarSeriesModel.prototype.getProgressiveThreshold=function(){var progressiveThreshold=this.get("progressiveThreshold"),largeThreshold=this.get("largeThreshold");return largeThreshold>progressiveThreshold&&(progressiveThreshold=largeThreshold),progressiveThreshold},BarSeriesModel.prototype.brushSelector=function(dataIndex,data,selectors){return selectors.rect(data.getItemLayout(dataIndex))},BarSeriesModel.type="series.bar",BarSeriesModel.dependencies=["grid","polar"],BarSeriesModel.defaultOption=inheritDefaultOption(BaseBarSeriesModel$1.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),BarSeriesModel}(BaseBarSeriesModel$1),SausageShape=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},SausagePath=function(_super){function SausagePath(opts){var _this=_super.call(this,opts)||this;return _this.type="sausage",_this}return __extends(SausagePath,_super),SausagePath.prototype.getDefaultShape=function(){return new SausageShape},SausagePath.prototype.buildPath=function(ctx,shape){var cx=shape.cx,cy=shape.cy,r0=Math.max(shape.r0||0,0),r=Math.max(shape.r,0),dr=.5*(r-r0),rCenter=r0+dr,startAngle=shape.startAngle,endAngle=shape.endAngle,clockwise=shape.clockwise,PI2=2*Math.PI,lessThanCircle=clockwise?endAngle-startAngle<PI2:startAngle-endAngle<PI2;lessThanCircle||(startAngle=endAngle-(clockwise?PI2:-PI2));var unitStartX=Math.cos(startAngle),unitStartY=Math.sin(startAngle),unitEndX=Math.cos(endAngle),unitEndY=Math.sin(endAngle);lessThanCircle?(ctx.moveTo(unitStartX*r0+cx,unitStartY*r0+cy),ctx.arc(unitStartX*rCenter+cx,unitStartY*rCenter+cy,dr,-Math.PI+startAngle,startAngle,!clockwise)):ctx.moveTo(unitStartX*r+cx,unitStartY*r+cy),ctx.arc(cx,cy,r,startAngle,endAngle,!clockwise),ctx.arc(unitEndX*rCenter+cx,unitEndY*rCenter+cy,dr,endAngle-2*Math.PI,endAngle-Math.PI,!clockwise),0!==r0&&ctx.arc(cx,cy,r0,endAngle,startAngle,clockwise)},SausagePath}(Path$1),Sausage=SausagePath;function adjustAngleDistanceX(angle,distance,isEnd){return distance*Math.sin(angle)*(isEnd?-1:1)}function adjustAngleDistanceY(angle,distance,isEnd){return distance*Math.cos(angle)*(isEnd?1:-1)}function getSectorCornerRadius(model,shape,zeroIfNull){var cornerRadius=model.get("borderRadius");if(null==cornerRadius)return zeroIfNull?{cornerRadius:0}:null;isArray(cornerRadius)||(cornerRadius=[cornerRadius,cornerRadius,cornerRadius,cornerRadius]);var dr=Math.abs(shape.r||0-shape.r0||0);return{cornerRadius:map$1(cornerRadius,(function(cr){return parsePercent$1(cr,dr)}))}}var mathMax$3=Math.max,mathMin$3=Math.min;var BarView=function(_super){function BarView(){var _this=_super.call(this)||this;return _this.type=BarView.type,_this._isFirstFrame=!0,_this}return __extends(BarView,_super),BarView.prototype.render=function(seriesModel,ecModel,api,payload){this._model=seriesModel,this._removeOnRenderedListener(api),this._updateDrawMode(seriesModel);var coordinateSystemType=seriesModel.get("coordinateSystem");"cartesian2d"===coordinateSystemType||"polar"===coordinateSystemType?(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(seriesModel,ecModel,api):this._renderNormal(seriesModel,ecModel,api,payload)):"production"!==process.env.NODE_ENV&&warn("Only cartesian2d and polar supported for bar.")},BarView.prototype.incrementalPrepareRender=function(seriesModel){this._clear(),this._updateDrawMode(seriesModel),this._updateLargeClip(seriesModel)},BarView.prototype.incrementalRender=function(params,seriesModel){this._progressiveEls=[],this._incrementalRenderLarge(params,seriesModel)},BarView.prototype.eachRendered=function(cb){traverseElements(this._progressiveEls||this.group,cb)},BarView.prototype._updateDrawMode=function(seriesModel){var isLargeDraw=seriesModel.pipelineContext.large;null!=this._isLargeDraw&&isLargeDraw===this._isLargeDraw||(this._isLargeDraw=isLargeDraw,this._clear())},BarView.prototype._renderNormal=function(seriesModel,ecModel,api,payload){var isHorizontalOrRadial,group=this.group,data=seriesModel.getData(),oldData=this._data,coord=seriesModel.coordinateSystem,baseAxis=coord.getBaseAxis();"cartesian2d"===coord.type?isHorizontalOrRadial=baseAxis.isHorizontal():"polar"===coord.type&&(isHorizontalOrRadial="angle"===baseAxis.dim);var animationModel=seriesModel.isAnimationEnabled()?seriesModel:null,realtimeSortCfg=function(seriesModel,coordSys){var realtimeSortOption=seriesModel.get("realtimeSort",!0),baseAxis=coordSys.getBaseAxis();"production"!==process.env.NODE_ENV&&realtimeSortOption&&("category"!==baseAxis.type&&warn("`realtimeSort` will not work because this bar series is not based on a category axis."),"cartesian2d"!==coordSys.type&&warn("`realtimeSort` will not work because this bar series is not on cartesian2d."));if(realtimeSortOption&&"category"===baseAxis.type&&"cartesian2d"===coordSys.type)return{baseAxis:baseAxis,otherAxis:coordSys.getOtherAxis(baseAxis)}}(seriesModel,coord);realtimeSortCfg&&this._enableRealtimeSort(realtimeSortCfg,data,api);var needsClip=seriesModel.get("clip",!0)||realtimeSortCfg,coordSysClipArea=function(coord,data){var coordSysClipArea=coord.getArea&&coord.getArea();if(isCoordinateSystemType(coord,"cartesian2d")){var baseAxis=coord.getBaseAxis();if("category"!==baseAxis.type||!baseAxis.onBand){var expandWidth=data.getLayout("bandWidth");baseAxis.isHorizontal()?(coordSysClipArea.x-=expandWidth,coordSysClipArea.width+=2*expandWidth):(coordSysClipArea.y-=expandWidth,coordSysClipArea.height+=2*expandWidth)}}return coordSysClipArea}(coord,data);group.removeClipPath();var roundCap=seriesModel.get("roundCap",!0),drawBackground=seriesModel.get("showBackground",!0),backgroundModel=seriesModel.getModel("backgroundStyle"),barBorderRadius=backgroundModel.get("borderRadius")||0,bgEls=[],oldBgEls=this._backgroundEls,isInitSort=payload&&payload.isInitSort,isChangeOrder=payload&&"changeAxisOrder"===payload.type;function createBackground(dataIndex){var bgLayout=getLayout[coord.type](data,dataIndex),bgEl=function(coord,isHorizontalOrRadial,layout){var ElementClz="polar"===coord.type?Sector$1:Rect$4;return new ElementClz({shape:createBackgroundShape(isHorizontalOrRadial,layout,coord),silent:!0,z2:0})}(coord,isHorizontalOrRadial,bgLayout);return bgEl.useStyle(backgroundModel.getItemStyle()),"cartesian2d"===coord.type?bgEl.setShape("r",barBorderRadius):bgEl.setShape("cornerRadius",barBorderRadius),bgEls[dataIndex]=bgEl,bgEl}data.diff(oldData).add((function(dataIndex){var itemModel=data.getItemModel(dataIndex),layout=getLayout[coord.type](data,dataIndex,itemModel);if(drawBackground&&createBackground(dataIndex),data.hasValue(dataIndex)&&isValidLayout[coord.type](layout)){var isClipped=!1;needsClip&&(isClipped=clip[coord.type](coordSysClipArea,layout));var el=elementCreator[coord.type](seriesModel,data,dataIndex,layout,isHorizontalOrRadial,animationModel,baseAxis.model,!1,roundCap);realtimeSortCfg&&(el.forceLabelAnimation=!0),updateStyle(el,data,dataIndex,itemModel,layout,seriesModel,isHorizontalOrRadial,"polar"===coord.type),isInitSort?el.attr({shape:layout}):realtimeSortCfg?updateRealtimeAnimation(realtimeSortCfg,animationModel,el,layout,dataIndex,isHorizontalOrRadial,!1,!1):initProps(el,{shape:layout},seriesModel,dataIndex),data.setItemGraphicEl(dataIndex,el),group.add(el),el.ignore=isClipped}})).update((function(newIndex,oldIndex){var itemModel=data.getItemModel(newIndex),layout=getLayout[coord.type](data,newIndex,itemModel);if(drawBackground){var bgEl=void 0;0===oldBgEls.length?bgEl=createBackground(oldIndex):((bgEl=oldBgEls[oldIndex]).useStyle(backgroundModel.getItemStyle()),"cartesian2d"===coord.type?bgEl.setShape("r",barBorderRadius):bgEl.setShape("cornerRadius",barBorderRadius),bgEls[newIndex]=bgEl);var bgLayout=getLayout[coord.type](data,newIndex);updateProps$1(bgEl,{shape:createBackgroundShape(isHorizontalOrRadial,bgLayout,coord)},animationModel,newIndex)}var el=oldData.getItemGraphicEl(oldIndex);if(data.hasValue(newIndex)&&isValidLayout[coord.type](layout)){var isClipped=!1;if(needsClip&&(isClipped=clip[coord.type](coordSysClipArea,layout))&&group.remove(el),el?saveOldStyle(el):el=elementCreator[coord.type](seriesModel,data,newIndex,layout,isHorizontalOrRadial,animationModel,baseAxis.model,!!el,roundCap),realtimeSortCfg&&(el.forceLabelAnimation=!0),isChangeOrder){var textEl=el.getTextContent();if(textEl){var labelInnerStore=labelInner(textEl);null!=labelInnerStore.prevValue&&(labelInnerStore.prevValue=labelInnerStore.value)}}else updateStyle(el,data,newIndex,itemModel,layout,seriesModel,isHorizontalOrRadial,"polar"===coord.type);isInitSort?el.attr({shape:layout}):realtimeSortCfg?updateRealtimeAnimation(realtimeSortCfg,animationModel,el,layout,newIndex,isHorizontalOrRadial,!0,isChangeOrder):updateProps$1(el,{shape:layout},seriesModel,newIndex,null),data.setItemGraphicEl(newIndex,el),el.ignore=isClipped,group.add(el)}else group.remove(el)})).remove((function(dataIndex){var el=oldData.getItemGraphicEl(dataIndex);el&&removeElementWithFadeOut(el,seriesModel,dataIndex)})).execute();var bgGroup=this._backgroundGroup||(this._backgroundGroup=new Group$4);bgGroup.removeAll();for(var i=0;i<bgEls.length;++i)bgGroup.add(bgEls[i]);group.add(bgGroup),this._backgroundEls=bgEls,this._data=data},BarView.prototype._renderLarge=function(seriesModel,ecModel,api){this._clear(),createLarge(seriesModel,this.group),this._updateLargeClip(seriesModel)},BarView.prototype._incrementalRenderLarge=function(params,seriesModel){this._removeBackground(),createLarge(seriesModel,this.group,this._progressiveEls,!0)},BarView.prototype._updateLargeClip=function(seriesModel){var clipPath=seriesModel.get("clip",!0)&&createClipPath(seriesModel.coordinateSystem,!1,seriesModel),group=this.group;clipPath?group.setClipPath(clipPath):group.removeClipPath()},BarView.prototype._enableRealtimeSort=function(realtimeSortCfg,data,api){var _this=this;if(data.count()){var baseAxis=realtimeSortCfg.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(data,realtimeSortCfg,api),this._isFirstFrame=!1;else{var orderMapping_1=function(idx){var el=data.getItemGraphicEl(idx),shape=el&&el.shape;return shape&&Math.abs(baseAxis.isHorizontal()?shape.height:shape.width)||0};this._onRendered=function(){_this._updateSortWithinSameData(data,orderMapping_1,baseAxis,api)},api.getZr().on("rendered",this._onRendered)}}},BarView.prototype._dataSort=function(data,baseAxis,orderMapping){var info=[];return data.each(data.mapDimension(baseAxis.dim),(function(ordinalNumber,dataIdx){var mappedValue=orderMapping(dataIdx);mappedValue=null==mappedValue?NaN:mappedValue,info.push({dataIndex:dataIdx,mappedValue:mappedValue,ordinalNumber:ordinalNumber})})),info.sort((function(a,b){return b.mappedValue-a.mappedValue})),{ordinalNumbers:map$1(info,(function(item){return item.ordinalNumber}))}},BarView.prototype._isOrderChangedWithinSameData=function(data,orderMapping,baseAxis){for(var scale=baseAxis.scale,ordinalDataDim=data.mapDimension(baseAxis.dim),lastValue=Number.MAX_VALUE,tickNum=0,len=scale.getOrdinalMeta().categories.length;tickNum<len;++tickNum){var rawIdx=data.rawIndexOf(ordinalDataDim,scale.getRawOrdinalNumber(tickNum)),value=rawIdx<0?Number.MIN_VALUE:orderMapping(data.indexOfRawIndex(rawIdx));if(value>lastValue)return!0;lastValue=value}return!1},BarView.prototype._isOrderDifferentInView=function(orderInfo,baseAxis){for(var scale=baseAxis.scale,extent=scale.getExtent(),tickNum=Math.max(0,extent[0]),tickMax=Math.min(extent[1],scale.getOrdinalMeta().categories.length-1);tickNum<=tickMax;++tickNum)if(orderInfo.ordinalNumbers[tickNum]!==scale.getRawOrdinalNumber(tickNum))return!0},BarView.prototype._updateSortWithinSameData=function(data,orderMapping,baseAxis,api){if(this._isOrderChangedWithinSameData(data,orderMapping,baseAxis)){var sortInfo=this._dataSort(data,baseAxis,orderMapping);this._isOrderDifferentInView(sortInfo,baseAxis)&&(this._removeOnRenderedListener(api),api.dispatchAction({type:"changeAxisOrder",componentType:baseAxis.dim+"Axis",axisId:baseAxis.index,sortInfo:sortInfo}))}},BarView.prototype._dispatchInitSort=function(data,realtimeSortCfg,api){var baseAxis=realtimeSortCfg.baseAxis,sortResult=this._dataSort(data,baseAxis,(function(dataIdx){return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim),dataIdx)}));api.dispatchAction({type:"changeAxisOrder",componentType:baseAxis.dim+"Axis",isInitSort:!0,axisId:baseAxis.index,sortInfo:sortResult})},BarView.prototype.remove=function(ecModel,api){this._clear(this._model),this._removeOnRenderedListener(api)},BarView.prototype.dispose=function(ecModel,api){this._removeOnRenderedListener(api)},BarView.prototype._removeOnRenderedListener=function(api){this._onRendered&&(api.getZr().off("rendered",this._onRendered),this._onRendered=null)},BarView.prototype._clear=function(model){var group=this.group,data=this._data;model&&model.isAnimationEnabled()&&data&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],data.eachItemGraphicEl((function(el){removeElementWithFadeOut(el,model,getECData(el).dataIndex)}))):group.removeAll(),this._data=null,this._isFirstFrame=!0},BarView.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},BarView.type="bar",BarView}(ChartView$1),clip={cartesian2d:function(coordSysBoundingRect,layout){var signWidth=layout.width<0?-1:1,signHeight=layout.height<0?-1:1;signWidth<0&&(layout.x+=layout.width,layout.width=-layout.width),signHeight<0&&(layout.y+=layout.height,layout.height=-layout.height);var coordSysX2=coordSysBoundingRect.x+coordSysBoundingRect.width,coordSysY2=coordSysBoundingRect.y+coordSysBoundingRect.height,x=mathMax$3(layout.x,coordSysBoundingRect.x),x2=mathMin$3(layout.x+layout.width,coordSysX2),y=mathMax$3(layout.y,coordSysBoundingRect.y),y2=mathMin$3(layout.y+layout.height,coordSysY2),xClipped=x2<x,yClipped=y2<y;return layout.x=xClipped&&x>coordSysX2?x2:x,layout.y=yClipped&&y>coordSysY2?y2:y,layout.width=xClipped?0:x2-x,layout.height=yClipped?0:y2-y,signWidth<0&&(layout.x+=layout.width,layout.width=-layout.width),signHeight<0&&(layout.y+=layout.height,layout.height=-layout.height),xClipped||yClipped},polar:function(coordSysClipArea,layout){var signR=layout.r0<=layout.r?1:-1;if(signR<0){var tmp=layout.r;layout.r=layout.r0,layout.r0=tmp}var r=mathMin$3(layout.r,coordSysClipArea.r),r0=mathMax$3(layout.r0,coordSysClipArea.r0);layout.r=r,layout.r0=r0;var clipped=r-r0<0;if(signR<0){tmp=layout.r;layout.r=layout.r0,layout.r0=tmp}return clipped}},elementCreator={cartesian2d:function(seriesModel,data,newIndex,layout,isHorizontal,animationModel,axisModel,isUpdate,roundCap){var rect=new Rect$4({shape:extend({},layout),z2:1});(rect.__dataIndex=newIndex,rect.name="item",animationModel)&&(rect.shape[isHorizontal?"height":"width"]=0);return rect},polar:function(seriesModel,data,newIndex,layout,isRadial,animationModel,axisModel,isUpdate,roundCap){var ShapeClass=!isRadial&&roundCap?Sausage:Sector$1,sector=new ShapeClass({shape:layout,z2:1});sector.name="item";var positionMapping,isRoundCap,positionMap=createPolarPositionMapping(isRadial);if(sector.calculateTextPosition=(positionMapping=positionMap,isRoundCap=({isRoundCap:ShapeClass===Sausage}||{}).isRoundCap,function(out,opts,boundingRect){var textPosition=opts.position;if(!textPosition||textPosition instanceof Array)return calculateTextPosition(out,opts,boundingRect);var mappedSectorPosition=positionMapping(textPosition),distance=null!=opts.distance?opts.distance:5,sector=this.shape,cx=sector.cx,cy=sector.cy,r=sector.r,r0=sector.r0,middleR=(r+r0)/2,startAngle=sector.startAngle,endAngle=sector.endAngle,middleAngle=(startAngle+endAngle)/2,extraDist=isRoundCap?Math.abs(r-r0)/2:0,mathCos=Math.cos,mathSin=Math.sin,x=cx+r*mathCos(startAngle),y=cy+r*mathSin(startAngle),textAlign="left",textVerticalAlign="top";switch(mappedSectorPosition){case"startArc":x=cx+(r0-distance)*mathCos(middleAngle),y=cy+(r0-distance)*mathSin(middleAngle),textAlign="center",textVerticalAlign="top";break;case"insideStartArc":x=cx+(r0+distance)*mathCos(middleAngle),y=cy+(r0+distance)*mathSin(middleAngle),textAlign="center",textVerticalAlign="bottom";break;case"startAngle":x=cx+middleR*mathCos(startAngle)+adjustAngleDistanceX(startAngle,distance+extraDist,!1),y=cy+middleR*mathSin(startAngle)+adjustAngleDistanceY(startAngle,distance+extraDist,!1),textAlign="right",textVerticalAlign="middle";break;case"insideStartAngle":x=cx+middleR*mathCos(startAngle)+adjustAngleDistanceX(startAngle,-distance+extraDist,!1),y=cy+middleR*mathSin(startAngle)+adjustAngleDistanceY(startAngle,-distance+extraDist,!1),textAlign="left",textVerticalAlign="middle";break;case"middle":x=cx+middleR*mathCos(middleAngle),y=cy+middleR*mathSin(middleAngle),textAlign="center",textVerticalAlign="middle";break;case"endArc":x=cx+(r+distance)*mathCos(middleAngle),y=cy+(r+distance)*mathSin(middleAngle),textAlign="center",textVerticalAlign="bottom";break;case"insideEndArc":x=cx+(r-distance)*mathCos(middleAngle),y=cy+(r-distance)*mathSin(middleAngle),textAlign="center",textVerticalAlign="top";break;case"endAngle":x=cx+middleR*mathCos(endAngle)+adjustAngleDistanceX(endAngle,distance+extraDist,!0),y=cy+middleR*mathSin(endAngle)+adjustAngleDistanceY(endAngle,distance+extraDist,!0),textAlign="left",textVerticalAlign="middle";break;case"insideEndAngle":x=cx+middleR*mathCos(endAngle)+adjustAngleDistanceX(endAngle,-distance+extraDist,!0),y=cy+middleR*mathSin(endAngle)+adjustAngleDistanceY(endAngle,-distance+extraDist,!0),textAlign="right",textVerticalAlign="middle";break;default:return calculateTextPosition(out,opts,boundingRect)}return(out=out||{}).x=x,out.y=y,out.align=textAlign,out.verticalAlign=textVerticalAlign,out}),animationModel){var animateProperty=isRadial?"r":"endAngle",animateTarget={};sector.shape[animateProperty]=isRadial?layout.r0:layout.startAngle,animateTarget[animateProperty]=layout[animateProperty],(isUpdate?updateProps$1:initProps)(sector,{shape:animateTarget},animationModel)}return sector}};function updateRealtimeAnimation(realtimeSortCfg,seriesAnimationModel,el,layout,newIndex,isHorizontal,isUpdate,isChangeOrder){var seriesTarget,axisTarget;isHorizontal?(axisTarget={x:layout.x,width:layout.width},seriesTarget={y:layout.y,height:layout.height}):(axisTarget={y:layout.y,height:layout.height},seriesTarget={x:layout.x,width:layout.width}),isChangeOrder||(isUpdate?updateProps$1:initProps)(el,{shape:seriesTarget},seriesAnimationModel,newIndex,null),(isUpdate?updateProps$1:initProps)(el,{shape:axisTarget},seriesAnimationModel?realtimeSortCfg.baseAxis.model:null,newIndex)}function checkPropertiesNotValid(obj,props){for(var i=0;i<props.length;i++)if(!isFinite(obj[props[i]]))return!0;return!1}var rectPropties=["x","y","width","height"],polarPropties=["cx","cy","r","startAngle","endAngle"],isValidLayout={cartesian2d:function(layout){return!checkPropertiesNotValid(layout,rectPropties)},polar:function(layout){return!checkPropertiesNotValid(layout,polarPropties)}},getLayout={cartesian2d:function(data,dataIndex,itemModel){var layout=data.getItemLayout(dataIndex),fixedLineWidth=itemModel?function(itemModel,rawLayout){var borderColor=itemModel.get(["itemStyle","borderColor"]);if(!borderColor||"none"===borderColor)return 0;var lineWidth=itemModel.get(["itemStyle","borderWidth"])||0,width=isNaN(rawLayout.width)?Number.MAX_VALUE:Math.abs(rawLayout.width),height=isNaN(rawLayout.height)?Number.MAX_VALUE:Math.abs(rawLayout.height);return Math.min(lineWidth,width,height)}(itemModel,layout):0,signX=layout.width>0?1:-1,signY=layout.height>0?1:-1;return{x:layout.x+signX*fixedLineWidth/2,y:layout.y+signY*fixedLineWidth/2,width:layout.width-signX*fixedLineWidth,height:layout.height-signY*fixedLineWidth}},polar:function(data,dataIndex,itemModel){var layout=data.getItemLayout(dataIndex);return{cx:layout.cx,cy:layout.cy,r0:layout.r0,r:layout.r,startAngle:layout.startAngle,endAngle:layout.endAngle,clockwise:layout.clockwise}}};function createPolarPositionMapping(isRadial){return function(isRadial){var arcOrAngle=isRadial?"Arc":"Angle";return function(position){switch(position){case"start":case"insideStart":case"end":case"insideEnd":return position+arcOrAngle;default:return position}}}(isRadial)}function updateStyle(el,data,dataIndex,itemModel,layout,seriesModel,isHorizontalOrRadial,isPolar){var style=data.getItemVisual(dataIndex,"style");if(isPolar){if(!seriesModel.get("roundCap")){var sectorShape=el.shape;extend(sectorShape,getSectorCornerRadius(itemModel.getModel("itemStyle"),sectorShape,!0)),el.setShape(sectorShape)}}else{var borderRadius=itemModel.get(["itemStyle","borderRadius"])||0;el.setShape("r",borderRadius)}el.useStyle(style);var cursorStyle=itemModel.getShallow("cursor");cursorStyle&&el.attr("cursor",cursorStyle);var labelPositionOutside=isPolar?isHorizontalOrRadial?layout.r>=layout.r0?"endArc":"startArc":layout.endAngle>=layout.startAngle?"endAngle":"startAngle":isHorizontalOrRadial?layout.height>=0?"bottom":"top":layout.width>=0?"right":"left",labelStatesModels=getLabelStatesModels(itemModel);setLabelStyle(el,labelStatesModels,{labelFetcher:seriesModel,labelDataIndex:dataIndex,defaultText:getDefaultLabel(seriesModel.getData(),dataIndex),inheritColor:style.fill,defaultOpacity:style.opacity,defaultOutsidePosition:labelPositionOutside});var label=el.getTextContent();if(isPolar&&label){var position=itemModel.get(["label","position"]);el.textConfig.inside="middle"===position||null,function(sector,textPosition,positionMapping,rotateType){if(isNumber(rotateType))sector.setTextConfig({rotation:rotateType});else if(isArray(textPosition))sector.setTextConfig({rotation:0});else{var anchorAngle,shape=sector.shape,startAngle=shape.clockwise?shape.startAngle:shape.endAngle,endAngle=shape.clockwise?shape.endAngle:shape.startAngle,middleAngle=(startAngle+endAngle)/2,mappedSectorPosition=positionMapping(textPosition);switch(mappedSectorPosition){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":anchorAngle=middleAngle;break;case"startAngle":case"insideStartAngle":anchorAngle=startAngle;break;case"endAngle":case"insideEndAngle":anchorAngle=endAngle;break;default:return void sector.setTextConfig({rotation:0})}var rotate=1.5*Math.PI-anchorAngle;"middle"===mappedSectorPosition&&rotate>Math.PI/2&&rotate<1.5*Math.PI&&(rotate-=Math.PI),sector.setTextConfig({rotation:rotate})}}(el,"outside"===position?labelPositionOutside:position,createPolarPositionMapping(isHorizontalOrRadial),itemModel.get(["label","rotate"]))}setLabelValueAnimation(label,labelStatesModels,seriesModel.getRawValue(dataIndex),(function(value){return getDefaultInterpolatedLabel(data,value)}));var emphasisModel=itemModel.getModel(["emphasis"]);toggleHoverEmphasis(el,emphasisModel.get("focus"),emphasisModel.get("blurScope"),emphasisModel.get("disabled")),setStatesStylesFromModel(el,itemModel),function(layout){return null!=layout.startAngle&&null!=layout.endAngle&&layout.startAngle===layout.endAngle}(layout)&&(el.style.fill="none",el.style.stroke="none",each$b(el.states,(function(state){state.style&&(state.style.fill=state.style.stroke="none")})))}var LagePathShape=function(){},LargePath=function(_super){function LargePath(opts){var _this=_super.call(this,opts)||this;return _this.type="largeBar",_this}return __extends(LargePath,_super),LargePath.prototype.getDefaultShape=function(){return new LagePathShape},LargePath.prototype.buildPath=function(ctx,shape){for(var points=shape.points,baseDimIdx=this.baseDimIdx,valueDimIdx=1-this.baseDimIdx,startPoint=[],size=[],barWidth=this.barWidth,i=0;i<points.length;i+=3)size[baseDimIdx]=barWidth,size[valueDimIdx]=points[i+2],startPoint[baseDimIdx]=points[i+baseDimIdx],startPoint[valueDimIdx]=points[i+valueDimIdx],ctx.rect(startPoint[0],startPoint[1],size[0],size[1])},LargePath}(Path$1);function createLarge(seriesModel,group,progressiveEls,incremental){var data=seriesModel.getData(),baseDimIdx=data.getLayout("valueAxisHorizontal")?1:0,largeDataIndices=data.getLayout("largeDataIndices"),barWidth=data.getLayout("size"),backgroundModel=seriesModel.getModel("backgroundStyle"),bgPoints=data.getLayout("largeBackgroundPoints");if(bgPoints){var bgEl=new LargePath({shape:{points:bgPoints},incremental:!!incremental,silent:!0,z2:0});bgEl.baseDimIdx=baseDimIdx,bgEl.largeDataIndices=largeDataIndices,bgEl.barWidth=barWidth,bgEl.useStyle(backgroundModel.getItemStyle()),group.add(bgEl),progressiveEls&&progressiveEls.push(bgEl)}var el=new LargePath({shape:{points:data.getLayout("largePoints")},incremental:!!incremental,ignoreCoarsePointer:!0,z2:1});el.baseDimIdx=baseDimIdx,el.largeDataIndices=largeDataIndices,el.barWidth=barWidth,group.add(el),el.useStyle(data.getVisual("style")),el.style.stroke=null,getECData(el).seriesIndex=seriesModel.seriesIndex,seriesModel.get("silent")||(el.on("mousedown",largePathUpdateDataIndex),el.on("mousemove",largePathUpdateDataIndex)),progressiveEls&&progressiveEls.push(el)}var largePathUpdateDataIndex=throttle((function(event){var dataIndex=function(largePath,x,y){for(var baseDimIdx=largePath.baseDimIdx,valueDimIdx=1-baseDimIdx,points=largePath.shape.points,largeDataIndices=largePath.largeDataIndices,startPoint=[],size=[],barWidth=largePath.barWidth,i=0,len=points.length/3;i<len;i++){var ii=3*i;if(size[baseDimIdx]=barWidth,size[valueDimIdx]=points[ii+2],startPoint[baseDimIdx]=points[ii+baseDimIdx],startPoint[valueDimIdx]=points[ii+valueDimIdx],size[valueDimIdx]<0&&(startPoint[valueDimIdx]+=size[valueDimIdx],size[valueDimIdx]=-size[valueDimIdx]),x>=startPoint[0]&&x<=startPoint[0]+size[0]&&y>=startPoint[1]&&y<=startPoint[1]+size[1])return largeDataIndices[i]}return-1}(this,event.offsetX,event.offsetY);getECData(this).dataIndex=dataIndex>=0?dataIndex:null}),30,!1);function createBackgroundShape(isHorizontalOrRadial,layout,coord){if(isCoordinateSystemType(coord,"cartesian2d")){var rectShape=layout,coordLayout=coord.getArea();return{x:isHorizontalOrRadial?rectShape.x:coordLayout.x,y:isHorizontalOrRadial?coordLayout.y:rectShape.y,width:isHorizontalOrRadial?rectShape.width:coordLayout.width,height:isHorizontalOrRadial?coordLayout.height:rectShape.height}}var sectorShape=layout;return{cx:(coordLayout=coord.getArea()).cx,cy:coordLayout.cy,r0:isHorizontalOrRadial?coordLayout.r0:sectorShape.r0,r:isHorizontalOrRadial?coordLayout.r:sectorShape.r,startAngle:isHorizontalOrRadial?sectorShape.startAngle:0,endAngle:isHorizontalOrRadial?sectorShape.endAngle:2*Math.PI}}var BarView$1=BarView;function install$x(registers){registers.registerChartView(BarView$1),registers.registerSeriesModel(BarSeries),registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT,curry$1(layout$2,"bar")),registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,createProgressiveLayout("bar")),registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC,dataSample("bar")),registers.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(payload,ecModel){var componentType=payload.componentType||"series";ecModel.eachComponent({mainType:componentType,query:payload},(function(componentModel){payload.sortInfo&&componentModel.axis.setCategorySortInfo(payload.sortInfo)}))}))}var PI2=2*Math.PI,RADIAN$2=Math.PI/180;function getViewRect$3(seriesModel,api){return getLayoutRect(seriesModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()})}function getBasicPieLayout(seriesModel,api){var viewRect=getViewRect$3(seriesModel,api),center=seriesModel.get("center"),radius=seriesModel.get("radius");isArray(radius)||(radius=[0,radius]);var cx,cy,width=parsePercent(viewRect.width,api.getWidth()),height=parsePercent(viewRect.height,api.getHeight()),size=Math.min(width,height),r0=parsePercent(radius[0],size/2),r=parsePercent(radius[1],size/2),coordSys=seriesModel.coordinateSystem;if(coordSys){var point=coordSys.dataToPoint(center);cx=point[0]||0,cy=point[1]||0}else isArray(center)||(center=[center,center]),cx=parsePercent(center[0],width)+viewRect.x,cy=parsePercent(center[1],height)+viewRect.y;return{cx:cx,cy:cy,r0:r0,r:r}}function pieLayout(seriesType,ecModel,api){ecModel.eachSeriesByType(seriesType,(function(seriesModel){var data=seriesModel.getData(),valueDim=data.mapDimension("value"),viewRect=getViewRect$3(seriesModel,api),_a=getBasicPieLayout(seriesModel,api),cx=_a.cx,cy=_a.cy,r=_a.r,r0=_a.r0,startAngle=-seriesModel.get("startAngle")*RADIAN$2,endAngle=seriesModel.get("endAngle"),padAngle=seriesModel.get("padAngle")*RADIAN$2;endAngle="auto"===endAngle?startAngle-PI2:-endAngle*RADIAN$2;var minAndPadAngle=seriesModel.get("minAngle")*RADIAN$2+padAngle,validDataCount=0;data.each(valueDim,(function(value){!isNaN(value)&&validDataCount++}));var sum=data.getSum(valueDim),unitRadian=Math.PI/(sum||validDataCount)*2,clockwise=seriesModel.get("clockwise"),roseType=seriesModel.get("roseType"),stillShowZeroSum=seriesModel.get("stillShowZeroSum"),extent=data.getDataExtent(valueDim);extent[0]=0;var dir=clockwise?1:-1,angles=[startAngle,endAngle],halfPadAngle=dir*padAngle/2;normalizeArcAngles(angles,!clockwise),startAngle=angles[0],endAngle=angles[1];var layoutData=getSeriesLayoutData(seriesModel);layoutData.startAngle=startAngle,layoutData.endAngle=endAngle,layoutData.clockwise=clockwise;var angleRange=Math.abs(endAngle-startAngle),restAngle=angleRange,valueSumLargerThanMinAngle=0,currentAngle=startAngle;if(data.setLayout({viewRect:viewRect,r:r}),data.each(valueDim,(function(value,idx){var angle;if(isNaN(value))data.setItemLayout(idx,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:clockwise,cx:cx,cy:cy,r0:r0,r:roseType?NaN:r});else{(angle="area"!==roseType?0===sum&&stillShowZeroSum?unitRadian:value*unitRadian:angleRange/validDataCount)<minAndPadAngle?(angle=minAndPadAngle,restAngle-=minAndPadAngle):valueSumLargerThanMinAngle+=value;var endAngle=currentAngle+dir*angle,actualStartAngle=0,actualEndAngle=0;padAngle>angle?actualEndAngle=actualStartAngle=currentAngle+dir*angle/2:(actualStartAngle=currentAngle+halfPadAngle,actualEndAngle=endAngle-halfPadAngle),data.setItemLayout(idx,{angle:angle,startAngle:actualStartAngle,endAngle:actualEndAngle,clockwise:clockwise,cx:cx,cy:cy,r0:r0,r:roseType?linearMap(value,extent,[r0,r]):r}),currentAngle=endAngle}})),restAngle<PI2&&validDataCount)if(restAngle<=.001){var angle_1=angleRange/validDataCount;data.each(valueDim,(function(value,idx){if(!isNaN(value)){var layout_1=data.getItemLayout(idx);layout_1.angle=angle_1;var actualStartAngle=0,actualEndAngle=0;angle_1<padAngle?actualEndAngle=actualStartAngle=startAngle+dir*(idx+.5)*angle_1:(actualStartAngle=startAngle+dir*idx*angle_1+halfPadAngle,actualEndAngle=startAngle+dir*(idx+1)*angle_1-halfPadAngle),layout_1.startAngle=actualStartAngle,layout_1.endAngle=actualEndAngle}}))}else unitRadian=restAngle/valueSumLargerThanMinAngle,currentAngle=startAngle,data.each(valueDim,(function(value,idx){if(!isNaN(value)){var layout_2=data.getItemLayout(idx),angle=layout_2.angle===minAndPadAngle?minAndPadAngle:value*unitRadian,actualStartAngle=0,actualEndAngle=0;angle<padAngle?actualEndAngle=actualStartAngle=currentAngle+dir*angle/2:(actualStartAngle=currentAngle+halfPadAngle,actualEndAngle=currentAngle+dir*angle-halfPadAngle),layout_2.startAngle=actualStartAngle,layout_2.endAngle=actualEndAngle,currentAngle+=dir*angle}}))}))}var getSeriesLayoutData=makeInner();function dataFilter$1(seriesType){return{seriesType:seriesType,reset:function(seriesModel,ecModel){var legendModels=ecModel.findComponents({mainType:"legend"});if(legendModels&&legendModels.length){var data=seriesModel.getData();data.filterSelf((function(idx){for(var name=data.getName(idx),i=0;i<legendModels.length;i++)if(!legendModels[i].isSelected(name))return!1;return!0}))}}}}var RADIAN$1=Math.PI/180;function adjustSingleSide(list,cx,cy,r,dir,viewWidth,viewHeight,viewLeft,viewTop,farthestX){if(!(list.length<2)){for(var len=list.length,i=0;i<len;i++)if("outer"===list[i].position&&"labelLine"===list[i].labelAlignTo){var dx=list[i].label.x-farthestX;list[i].linePoints[1][0]+=dx,list[i].label.x=farthestX}shiftLayoutOnY(list,viewTop,viewTop+viewHeight)&&function(items){for(var topSemi={list:[],maxY:0},bottomSemi={list:[],maxY:0},i=0;i<items.length;i++)if("none"===items[i].labelAlignTo){var item=items[i],semi=item.label.y>cy?bottomSemi:topSemi,dy=Math.abs(item.label.y-cy);if(dy>=semi.maxY){var dx=item.label.x-cx-item.len2*dir,rA=r+item.len,rB=Math.abs(dx)<rA?Math.sqrt(dy*dy/(1-dx*dx/rA/rA)):rA;semi.rB=rB,semi.maxY=dy}semi.list.push(item)}recalculateXOnSemiToAlignOnEllipseCurve(topSemi),recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi)}(list)}function recalculateXOnSemiToAlignOnEllipseCurve(semi){for(var rB=semi.rB,rB2=rB*rB,i=0;i<semi.list.length;i++){var item=semi.list[i],dy=Math.abs(item.label.y-cy),rA=r+item.len,rA2=rA*rA,dx=Math.sqrt(Math.abs((1-dy*dy/rB2)*rA2)),newX=cx+(dx+item.len2)*dir,deltaX=newX-item.label.x;constrainTextWidth(item,item.targetTextWidth-deltaX*dir,!0),item.label.x=newX}}}function constrainTextWidth(layout,availableWidth,forceRecalculate){if(void 0===forceRecalculate&&(forceRecalculate=!1),null==layout.labelStyleWidth){var label=layout.label,style=label.style,textRect=layout.rect,bgColor=style.backgroundColor,padding=style.padding,paddingH=padding?padding[1]+padding[3]:0,overflow=style.overflow,oldOuterWidth=textRect.width+(bgColor?0:paddingH);if(availableWidth<oldOuterWidth||forceRecalculate){var oldHeight=textRect.height;if(overflow&&overflow.match("break")){label.setStyle("backgroundColor",null),label.setStyle("width",availableWidth-paddingH);var innerRect=label.getBoundingRect();label.setStyle("width",Math.ceil(innerRect.width)),label.setStyle("backgroundColor",bgColor)}else{var availableInnerWidth=availableWidth-paddingH,newWidth=availableWidth<oldOuterWidth?availableInnerWidth:forceRecalculate?availableInnerWidth>layout.unconstrainedWidth?null:availableInnerWidth:null;label.setStyle("width",newWidth)}var newRect=label.getBoundingRect();textRect.width=newRect.width;var margin=(label.style.margin||0)+2.1;textRect.height=newRect.height+margin,textRect.y-=(textRect.height-oldHeight)/2}}}function isPositionCenter(sectorShape){return"center"===sectorShape.position}function pieLabelLayout(seriesModel){var cx,cy,data=seriesModel.getData(),labelLayoutList=[],hasLabelRotate=!1,minShowLabelRadian=(seriesModel.get("minShowLabelAngle")||0)*RADIAN$1,viewRect=data.getLayout("viewRect"),r=data.getLayout("r"),viewWidth=viewRect.width,viewLeft=viewRect.x,viewTop=viewRect.y,viewHeight=viewRect.height;function setNotShow(el){el.ignore=!0}data.each((function(idx){var sector=data.getItemGraphicEl(idx),sectorShape=sector.shape,label=sector.getTextContent(),labelLine=sector.getTextGuideLine(),itemModel=data.getItemModel(idx),labelModel=itemModel.getModel("label"),labelPosition=labelModel.get("position")||itemModel.get(["emphasis","label","position"]),labelDistance=labelModel.get("distanceToLabelLine"),labelAlignTo=labelModel.get("alignTo"),edgeDistance=parsePercent(labelModel.get("edgeDistance"),viewWidth),bleedMargin=labelModel.get("bleedMargin"),labelLineModel=itemModel.getModel("labelLine"),labelLineLen=labelLineModel.get("length");labelLineLen=parsePercent(labelLineLen,viewWidth);var labelLineLen2=labelLineModel.get("length2");if(labelLineLen2=parsePercent(labelLineLen2,viewWidth),Math.abs(sectorShape.endAngle-sectorShape.startAngle)<minShowLabelRadian)return each$b(label.states,setNotShow),label.ignore=!0,void(labelLine&&(each$b(labelLine.states,setNotShow),labelLine.ignore=!0));if(function(label){if(!label.ignore)return!0;for(var key in label.states)if(!1===label.states[key].ignore)return!0;return!1}(label)){var textX,textY,linePoints,textAlign,midAngle=(sectorShape.startAngle+sectorShape.endAngle)/2,nx=Math.cos(midAngle),ny=Math.sin(midAngle);cx=sectorShape.cx,cy=sectorShape.cy;var isLabelInside="inside"===labelPosition||"inner"===labelPosition;if("center"===labelPosition)textX=sectorShape.cx,textY=sectorShape.cy,textAlign="center";else{var x1=(isLabelInside?(sectorShape.r+sectorShape.r0)/2*nx:sectorShape.r*nx)+cx,y1=(isLabelInside?(sectorShape.r+sectorShape.r0)/2*ny:sectorShape.r*ny)+cy;if(textX=x1+3*nx,textY=y1+3*ny,!isLabelInside){var x2=x1+nx*(labelLineLen+r-sectorShape.r),y2=y1+ny*(labelLineLen+r-sectorShape.r),x3=x2+(nx<0?-1:1)*labelLineLen2;textX="edge"===labelAlignTo?nx<0?viewLeft+edgeDistance:viewLeft+viewWidth-edgeDistance:x3+(nx<0?-labelDistance:labelDistance),textY=y2,linePoints=[[x1,y1],[x2,y2],[x3,y2]]}textAlign=isLabelInside?"center":"edge"===labelAlignTo?nx>0?"right":"left":nx>0?"left":"right"}var PI=Math.PI,labelRotate=0,rotate=labelModel.get("rotate");if(isNumber(rotate))labelRotate=rotate*(PI/180);else if("center"===labelPosition)labelRotate=0;else if("radial"===rotate||!0===rotate){labelRotate=nx<0?-midAngle+PI:-midAngle}else if("tangential"===rotate&&"outside"!==labelPosition&&"outer"!==labelPosition){var rad=Math.atan2(nx,ny);rad<0&&(rad=2*PI+rad),ny>0&&(rad=PI+rad),labelRotate=rad-PI}if(hasLabelRotate=!!labelRotate,label.x=textX,label.y=textY,label.rotation=labelRotate,label.setStyle({verticalAlign:"middle"}),isLabelInside){label.setStyle({align:textAlign});var selectState=label.states.select;selectState&&(selectState.x+=label.x,selectState.y+=label.y)}else{var textRect=label.getBoundingRect().clone();textRect.applyTransform(label.getComputedTransform());var margin=(label.style.margin||0)+2.1;textRect.y-=margin/2,textRect.height+=margin,labelLayoutList.push({label:label,labelLine:labelLine,position:labelPosition,len:labelLineLen,len2:labelLineLen2,minTurnAngle:labelLineModel.get("minTurnAngle"),maxSurfaceAngle:labelLineModel.get("maxSurfaceAngle"),surfaceNormal:new Point$1(nx,ny),linePoints:linePoints,textAlign:textAlign,labelDistance:labelDistance,labelAlignTo:labelAlignTo,edgeDistance:edgeDistance,bleedMargin:bleedMargin,rect:textRect,unconstrainedWidth:textRect.width,labelStyleWidth:label.style.width})}sector.setTextConfig({inside:isLabelInside})}})),!hasLabelRotate&&seriesModel.get("avoidLabelOverlap")&&function(labelLayoutList,cx,cy,r,viewWidth,viewHeight,viewLeft,viewTop){for(var leftList=[],rightList=[],leftmostX=Number.MAX_VALUE,rightmostX=-Number.MAX_VALUE,i=0;i<labelLayoutList.length;i++){var label=labelLayoutList[i].label;isPositionCenter(labelLayoutList[i])||(label.x<cx?(leftmostX=Math.min(leftmostX,label.x),leftList.push(labelLayoutList[i])):(rightmostX=Math.max(rightmostX,label.x),rightList.push(labelLayoutList[i])))}for(i=0;i<labelLayoutList.length;i++)if(!isPositionCenter(layout=labelLayoutList[i])&&layout.linePoints){if(null!=layout.labelStyleWidth)continue;label=layout.label;var linePoints=layout.linePoints,targetTextWidth=void 0;targetTextWidth="edge"===layout.labelAlignTo?label.x<cx?linePoints[2][0]-layout.labelDistance-viewLeft-layout.edgeDistance:viewLeft+viewWidth-layout.edgeDistance-linePoints[2][0]-layout.labelDistance:"labelLine"===layout.labelAlignTo?label.x<cx?leftmostX-viewLeft-layout.bleedMargin:viewLeft+viewWidth-rightmostX-layout.bleedMargin:label.x<cx?label.x-viewLeft-layout.bleedMargin:viewLeft+viewWidth-label.x-layout.bleedMargin,layout.targetTextWidth=targetTextWidth,constrainTextWidth(layout,targetTextWidth)}for(adjustSingleSide(rightList,cx,cy,r,1,0,viewHeight,0,viewTop,rightmostX),adjustSingleSide(leftList,cx,cy,r,-1,0,viewHeight,0,viewTop,leftmostX),i=0;i<labelLayoutList.length;i++){var layout;if(!isPositionCenter(layout=labelLayoutList[i])&&layout.linePoints){label=layout.label,linePoints=layout.linePoints;var isAlignToEdge="edge"===layout.labelAlignTo,padding=label.style.padding,paddingH=padding?padding[1]+padding[3]:0,extraPaddingH=label.style.backgroundColor?0:paddingH,realTextWidth=layout.rect.width+extraPaddingH,dist=linePoints[1][0]-linePoints[2][0];isAlignToEdge?label.x<cx?linePoints[2][0]=viewLeft+layout.edgeDistance+realTextWidth+layout.labelDistance:linePoints[2][0]=viewLeft+viewWidth-layout.edgeDistance-realTextWidth-layout.labelDistance:(label.x<cx?linePoints[2][0]=label.x+layout.labelDistance:linePoints[2][0]=label.x-layout.labelDistance,linePoints[1][0]=linePoints[2][0]+dist),linePoints[1][1]=linePoints[2][1]=label.y}}}(labelLayoutList,cx,cy,r,viewWidth,viewHeight,viewLeft,viewTop);for(var i=0;i<labelLayoutList.length;i++){var layout=labelLayoutList[i],label=layout.label,labelLine=layout.labelLine,notShowLabel=isNaN(label.x)||isNaN(label.y);if(label){label.setStyle({align:layout.textAlign}),notShowLabel&&(each$b(label.states,setNotShow),label.ignore=!0);var selectState=label.states.select;selectState&&(selectState.x+=label.x,selectState.y+=label.y)}if(labelLine){var linePoints=layout.linePoints;notShowLabel||!linePoints?(each$b(labelLine.states,setNotShow),labelLine.ignore=!0):(limitTurnAngle(linePoints,layout.minTurnAngle),limitSurfaceAngle(linePoints,layout.surfaceNormal,layout.maxSurfaceAngle),labelLine.setShape({points:linePoints}),label.__hostTarget.textGuideLineConfig={anchor:new Point$1(linePoints[0][0],linePoints[0][1])})}}}var PiePiece=function(_super){function PiePiece(data,idx,startAngle){var _this=_super.call(this)||this;_this.z2=2;var text=new ZRText$1;return _this.setTextContent(text),_this.updateData(data,idx,startAngle,!0),_this}return __extends(PiePiece,_super),PiePiece.prototype.updateData=function(data,idx,startAngle,firstCreate){var seriesModel=data.hostModel,itemModel=data.getItemModel(idx),emphasisModel=itemModel.getModel("emphasis"),layout=data.getItemLayout(idx),sectorShape=extend(getSectorCornerRadius(itemModel.getModel("itemStyle"),layout,!0),layout);if(isNaN(sectorShape.startAngle))this.setShape(sectorShape);else{if(firstCreate){this.setShape(sectorShape);var animationType=seriesModel.getShallow("animationType");seriesModel.ecModel.ssr?(initProps(this,{scaleX:0,scaleY:0},seriesModel,{dataIndex:idx,isFrom:!0}),this.originX=sectorShape.cx,this.originY=sectorShape.cy):"scale"===animationType?(this.shape.r=layout.r0,initProps(this,{shape:{r:layout.r}},seriesModel,idx)):null!=startAngle?(this.setShape({startAngle:startAngle,endAngle:startAngle}),initProps(this,{shape:{startAngle:layout.startAngle,endAngle:layout.endAngle}},seriesModel,idx)):(this.shape.endAngle=layout.startAngle,updateProps$1(this,{shape:{endAngle:layout.endAngle}},seriesModel,idx))}else saveOldStyle(this),updateProps$1(this,{shape:sectorShape},seriesModel,idx);this.useStyle(data.getItemVisual(idx,"style")),setStatesStylesFromModel(this,itemModel);var midAngle=(layout.startAngle+layout.endAngle)/2,offset=seriesModel.get("selectedOffset"),dx=Math.cos(midAngle)*offset,dy=Math.sin(midAngle)*offset,cursorStyle=itemModel.getShallow("cursor");cursorStyle&&this.attr("cursor",cursorStyle),this._updateLabel(seriesModel,data,idx),this.ensureState("emphasis").shape=extend({r:layout.r+(emphasisModel.get("scale")&&emphasisModel.get("scaleSize")||0)},getSectorCornerRadius(emphasisModel.getModel("itemStyle"),layout)),extend(this.ensureState("select"),{x:dx,y:dy,shape:getSectorCornerRadius(itemModel.getModel(["select","itemStyle"]),layout)}),extend(this.ensureState("blur"),{shape:getSectorCornerRadius(itemModel.getModel(["blur","itemStyle"]),layout)});var labelLine=this.getTextGuideLine(),labelText=this.getTextContent();labelLine&&extend(labelLine.ensureState("select"),{x:dx,y:dy}),extend(labelText.ensureState("select"),{x:dx,y:dy}),toggleHoverEmphasis(this,emphasisModel.get("focus"),emphasisModel.get("blurScope"),emphasisModel.get("disabled"))}},PiePiece.prototype._updateLabel=function(seriesModel,data,idx){var itemModel=data.getItemModel(idx),labelLineModel=itemModel.getModel("labelLine"),style=data.getItemVisual(idx,"style"),visualColor=style&&style.fill,visualOpacity=style&&style.opacity;setLabelStyle(this,getLabelStatesModels(itemModel),{labelFetcher:data.hostModel,labelDataIndex:idx,inheritColor:visualColor,defaultOpacity:visualOpacity,defaultText:seriesModel.getFormattedLabel(idx,"normal")||data.getName(idx)});var labelText=this.getTextContent();this.setTextConfig({position:null,rotation:null}),labelText.attr({z2:10});var labelPosition=seriesModel.get(["label","position"]);if("outside"!==labelPosition&&"outer"!==labelPosition)this.removeTextGuideLine();else{var polyline=this.getTextGuideLine();polyline||(polyline=new Polyline$1,this.setTextGuideLine(polyline)),setLabelLineStyle(this,getLabelLineStatesModels(itemModel),{stroke:visualColor,opacity:retrieve3(labelLineModel.get(["lineStyle","opacity"]),visualOpacity,1)})}},PiePiece}(Sector$1),PieView$1=function(_super){function PieView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.ignoreLabelLineUpdate=!0,_this}return __extends(PieView,_super),PieView.prototype.render=function(seriesModel,ecModel,api,payload){var startAngle,data=seriesModel.getData(),oldData=this._data,group=this.group;if(!oldData&&data.count()>0){for(var shape=data.getItemLayout(0),s=1;isNaN(shape&&shape.startAngle)&&s<data.count();++s)shape=data.getItemLayout(s);shape&&(startAngle=shape.startAngle)}if(this._emptyCircleSector&&group.remove(this._emptyCircleSector),0===data.count()&&seriesModel.get("showEmptyCircle")){var layoutData=getSeriesLayoutData(seriesModel),sector=new Sector$1({shape:extend(getBasicPieLayout(seriesModel,api),layoutData)});sector.useStyle(seriesModel.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=sector,group.add(sector)}data.diff(oldData).add((function(idx){var piePiece=new PiePiece(data,idx,startAngle);data.setItemGraphicEl(idx,piePiece),group.add(piePiece)})).update((function(newIdx,oldIdx){var piePiece=oldData.getItemGraphicEl(oldIdx);piePiece.updateData(data,newIdx,startAngle),piePiece.off("click"),group.add(piePiece),data.setItemGraphicEl(newIdx,piePiece)})).remove((function(idx){removeElementWithFadeOut(oldData.getItemGraphicEl(idx),seriesModel,idx)})).execute(),pieLabelLayout(seriesModel),"expansion"!==seriesModel.get("animationTypeUpdate")&&(this._data=data)},PieView.prototype.dispose=function(){},PieView.prototype.containPoint=function(point,seriesModel){var itemLayout=seriesModel.getData().getItemLayout(0);if(itemLayout){var dx=point[0]-itemLayout.cx,dy=point[1]-itemLayout.cy,radius=Math.sqrt(dx*dx+dy*dy);return radius<=itemLayout.r&&radius>=itemLayout.r0}},PieView.type="pie",PieView}(ChartView$1);function createSeriesDataSimply(seriesModel,opt,nameList){opt=isArray(opt)&&{coordDimensions:opt}||extend({encodeDefine:seriesModel.getEncode()},opt);var source=seriesModel.getSource(),dimensions=prepareSeriesDataSchema(source,opt).dimensions,list=new SeriesData$1(dimensions,seriesModel);return list.initData(source,nameList),list}var LegendVisualProvider=function(){function LegendVisualProvider(getDataWithEncodedVisual,getRawData){this._getDataWithEncodedVisual=getDataWithEncodedVisual,this._getRawData=getRawData}return LegendVisualProvider.prototype.getAllNames=function(){var rawData=this._getRawData();return rawData.mapArray(rawData.getName)},LegendVisualProvider.prototype.containName=function(name){return this._getRawData().indexOfName(name)>=0},LegendVisualProvider.prototype.indexOfName=function(name){return this._getDataWithEncodedVisual().indexOfName(name)},LegendVisualProvider.prototype.getItemVisual=function(dataIndex,key){return this._getDataWithEncodedVisual().getItemVisual(dataIndex,key)},LegendVisualProvider}(),LegendVisualProvider$1=LegendVisualProvider,innerData=makeInner(),PieSeriesModel=function(_super){function PieSeriesModel(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(PieSeriesModel,_super),PieSeriesModel.prototype.init=function(option){_super.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider$1(bind$1(this.getData,this),bind$1(this.getRawData,this)),this._defaultLabelLine(option)},PieSeriesModel.prototype.mergeOption=function(){_super.prototype.mergeOption.apply(this,arguments)},PieSeriesModel.prototype.getInitialData=function(){return createSeriesDataSimply(this,{coordDimensions:["value"],encodeDefaulter:curry$1(makeSeriesEncodeForNameBased,this)})},PieSeriesModel.prototype.getDataParams=function(dataIndex){var data=this.getData(),dataInner=innerData(data),seats=dataInner.seats;if(!seats){var valueList_1=[];data.each(data.mapDimension("value"),(function(value){valueList_1.push(value)})),seats=dataInner.seats=function(valueList,precision){var sum=reduce(valueList,(function(acc,val){return acc+(isNaN(val)?0:val)}),0);if(0===sum)return[];for(var digits=Math.pow(10,precision),votesPerQuota=map$1(valueList,(function(val){return(isNaN(val)?0:val)/sum*digits*100})),targetSeats=100*digits,seats=map$1(votesPerQuota,(function(votes){return Math.floor(votes)})),currentSum=reduce(seats,(function(acc,val){return acc+val}),0),remainder=map$1(votesPerQuota,(function(votes,idx){return votes-seats[idx]}));currentSum<targetSeats;){for(var max=Number.NEGATIVE_INFINITY,maxId=null,i=0,len=remainder.length;i<len;++i)remainder[i]>max&&(max=remainder[i],maxId=i);++seats[maxId],remainder[maxId]=0,++currentSum}return map$1(seats,(function(seat){return seat/digits}))}(valueList_1,data.hostModel.get("percentPrecision"))}var params=_super.prototype.getDataParams.call(this,dataIndex);return params.percent=seats[dataIndex]||0,params.$vars.push("percent"),params},PieSeriesModel.prototype._defaultLabelLine=function(option){defaultEmphasis(option,"labelLine",["show"]);var labelLineNormalOpt=option.labelLine,labelLineEmphasisOpt=option.emphasis.labelLine;labelLineNormalOpt.show=labelLineNormalOpt.show&&option.label.show,labelLineEmphasisOpt.show=labelLineEmphasisOpt.show&&option.emphasis.label.show},PieSeriesModel.type="series.pie",PieSeriesModel.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},PieSeriesModel}(SeriesModel$1),PieSeriesModel$1=PieSeriesModel;function install$w(registers){registers.registerChartView(PieView$1),registers.registerSeriesModel(PieSeriesModel$1),function(seriesType,ecRegisterAction){function getSeriesIndices(ecModel,payload){var seriesIndices=[];return ecModel.eachComponent({mainType:"series",subType:seriesType,query:payload},(function(seriesModel){seriesIndices.push(seriesModel.seriesIndex)})),seriesIndices}each$b([[seriesType+"ToggleSelect","toggleSelect"],[seriesType+"Select","select"],[seriesType+"UnSelect","unselect"]],(function(eventsMap){ecRegisterAction(eventsMap[0],(function(payload,ecModel,api){payload=extend({},payload),"production"!==process.env.NODE_ENV&&deprecateReplaceLog(payload.type,eventsMap[1]),api.dispatchAction(extend(payload,{type:eventsMap[1],seriesIndex:getSeriesIndices(ecModel,payload)}))}))}))}("pie",registers.registerAction),registers.registerLayout(curry$1(pieLayout,"pie")),registers.registerProcessor(dataFilter$1("pie")),registers.registerProcessor(function(seriesType){return{seriesType:seriesType,reset:function(seriesModel,ecModel){var data=seriesModel.getData();data.filterSelf((function(idx){var valueDim=data.mapDimension("value"),curValue=data.get(valueDim,idx);return!(isNumber(curValue)&&!isNaN(curValue)&&curValue<0)}))}}}("pie"))}var ScatterSeriesModel$1=function(_super){function ScatterSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ScatterSeriesModel.type,_this.hasSymbolVisual=!0,_this}return __extends(ScatterSeriesModel,_super),ScatterSeriesModel.prototype.getInitialData=function(option,ecModel){return createSeriesData(null,this,{useEncodeDefaulter:!0})},ScatterSeriesModel.prototype.getProgressive=function(){var progressive=this.option.progressive;return null==progressive?this.option.large?5e3:this.get("progressive"):progressive},ScatterSeriesModel.prototype.getProgressiveThreshold=function(){var progressiveThreshold=this.option.progressiveThreshold;return null==progressiveThreshold?this.option.large?1e4:this.get("progressiveThreshold"):progressiveThreshold},ScatterSeriesModel.prototype.brushSelector=function(dataIndex,data,selectors){return selectors.point(data.getItemLayout(dataIndex))},ScatterSeriesModel.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},ScatterSeriesModel.type="series.scatter",ScatterSeriesModel.dependencies=["grid","polar","geo","singleAxis","calendar"],ScatterSeriesModel.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},ScatterSeriesModel}(SeriesModel$1),LargeSymbolPathShape=function(){},LargeSymbolPath=function(_super){function LargeSymbolPath(opts){var _this=_super.call(this,opts)||this;return _this._off=0,_this.hoverDataIdx=-1,_this}return __extends(LargeSymbolPath,_super),LargeSymbolPath.prototype.getDefaultShape=function(){return new LargeSymbolPathShape},LargeSymbolPath.prototype.reset=function(){this.notClear=!1,this._off=0},LargeSymbolPath.prototype.buildPath=function(path,shape){var i,points=shape.points,size=shape.size,symbolProxy=this.symbolProxy,symbolProxyShape=symbolProxy.shape,ctx=path.getContext?path.getContext():path,canBoost=ctx&&size[0]<4,softClipShape=this.softClipShape;if(canBoost)this._ctx=ctx;else{for(this._ctx=null,i=this._off;i<points.length;){var x=points[i++],y=points[i++];isNaN(x)||isNaN(y)||(softClipShape&&!softClipShape.contain(x,y)||(symbolProxyShape.x=x-size[0]/2,symbolProxyShape.y=y-size[1]/2,symbolProxyShape.width=size[0],symbolProxyShape.height=size[1],symbolProxy.buildPath(path,symbolProxyShape,!0)))}this.incremental&&(this._off=i,this.notClear=!0)}},LargeSymbolPath.prototype.afterBrush=function(){var i,shape=this.shape,points=shape.points,size=shape.size,ctx=this._ctx,softClipShape=this.softClipShape;if(ctx){for(i=this._off;i<points.length;){var x=points[i++],y=points[i++];isNaN(x)||isNaN(y)||(softClipShape&&!softClipShape.contain(x,y)||ctx.fillRect(x-size[0]/2,y-size[1]/2,size[0],size[1]))}this.incremental&&(this._off=i,this.notClear=!0)}},LargeSymbolPath.prototype.findDataIndex=function(x,y){for(var shape=this.shape,points=shape.points,size=shape.size,w=Math.max(size[0],4),h=Math.max(size[1],4),idx=points.length/2-1;idx>=0;idx--){var i=2*idx,x0=points[i]-w/2,y0=points[i+1]-h/2;if(x>=x0&&y>=y0&&x<=x0+w&&y<=y0+h)return idx}return-1},LargeSymbolPath.prototype.contain=function(x,y){var localPos=this.transformCoordToLocal(x,y),rect=this.getBoundingRect();return x=localPos[0],y=localPos[1],rect.contain(x,y)?(this.hoverDataIdx=this.findDataIndex(x,y))>=0:(this.hoverDataIdx=-1,!1)},LargeSymbolPath.prototype.getBoundingRect=function(){var rect=this._rect;if(!rect){for(var shape=this.shape,points=shape.points,size=shape.size,w=size[0],h=size[1],minX=1/0,minY=1/0,maxX=-1/0,maxY=-1/0,i=0;i<points.length;){var x=points[i++],y=points[i++];minX=Math.min(x,minX),maxX=Math.max(x,maxX),minY=Math.min(y,minY),maxY=Math.max(y,maxY)}rect=this._rect=new BoundingRect$1(minX-w/2,minY-h/2,maxX-minX+w,maxY-minY+h)}return rect},LargeSymbolPath}(Path$1),LargeSymbolDraw=function(){function LargeSymbolDraw(){this.group=new Group$4}return LargeSymbolDraw.prototype.updateData=function(data,opt){this._clear();var symbolEl=this._create();symbolEl.setShape({points:data.getLayout("points")}),this._setCommon(symbolEl,data,opt)},LargeSymbolDraw.prototype.updateLayout=function(data){var points=data.getLayout("points");this.group.eachChild((function(child){if(null!=child.startIndex){var len=2*(child.endIndex-child.startIndex),byteOffset=4*child.startIndex*2;points=new Float32Array(points.buffer,byteOffset,len)}child.setShape("points",points),child.reset()}))},LargeSymbolDraw.prototype.incrementalPrepareUpdate=function(data){this._clear()},LargeSymbolDraw.prototype.incrementalUpdate=function(taskParams,data,opt){var lastAdded=this._newAdded[0],points=data.getLayout("points"),oldPoints=lastAdded&&lastAdded.shape.points;if(oldPoints&&oldPoints.length<2e4){var oldLen=oldPoints.length,newPoints=new Float32Array(oldLen+points.length);newPoints.set(oldPoints),newPoints.set(points,oldLen),lastAdded.endIndex=taskParams.end,lastAdded.setShape({points:newPoints})}else{this._newAdded=[];var symbolEl=this._create();symbolEl.startIndex=taskParams.start,symbolEl.endIndex=taskParams.end,symbolEl.incremental=!0,symbolEl.setShape({points:points}),this._setCommon(symbolEl,data,opt)}},LargeSymbolDraw.prototype.eachRendered=function(cb){this._newAdded[0]&&cb(this._newAdded[0])},LargeSymbolDraw.prototype._create=function(){var symbolEl=new LargeSymbolPath({cursor:"default"});return symbolEl.ignoreCoarsePointer=!0,this.group.add(symbolEl),this._newAdded.push(symbolEl),symbolEl},LargeSymbolDraw.prototype._setCommon=function(symbolEl,data,opt){var hostModel=data.hostModel;opt=opt||{};var size=data.getVisual("symbolSize");symbolEl.setShape("size",size instanceof Array?size:[size,size]),symbolEl.softClipShape=opt.clipShape||null,symbolEl.symbolProxy=createSymbol$1(data.getVisual("symbol"),0,0,0,0),symbolEl.setColor=symbolEl.symbolProxy.setColor;var extrudeShadow=symbolEl.shape.size[0]<4;symbolEl.useStyle(hostModel.getModel("itemStyle").getItemStyle(extrudeShadow?["color","shadowBlur","shadowColor"]:["color"]));var globalStyle=data.getVisual("style"),visualColor=globalStyle&&globalStyle.fill;visualColor&&symbolEl.setColor(visualColor);var ecData=getECData(symbolEl);ecData.seriesIndex=hostModel.seriesIndex,symbolEl.on("mousemove",(function(e){ecData.dataIndex=null;var dataIndex=symbolEl.hoverDataIdx;dataIndex>=0&&(ecData.dataIndex=dataIndex+(symbolEl.startIndex||0))}))},LargeSymbolDraw.prototype.remove=function(){this._clear()},LargeSymbolDraw.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},LargeSymbolDraw}(),LargeSymbolDraw$1=LargeSymbolDraw,ScatterView$1=function(_super){function ScatterView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ScatterView.type,_this}return __extends(ScatterView,_super),ScatterView.prototype.render=function(seriesModel,ecModel,api){var data=seriesModel.getData();this._updateSymbolDraw(data,seriesModel).updateData(data,{clipShape:this._getClipShape(seriesModel)}),this._finished=!0},ScatterView.prototype.incrementalPrepareRender=function(seriesModel,ecModel,api){var data=seriesModel.getData();this._updateSymbolDraw(data,seriesModel).incrementalPrepareUpdate(data),this._finished=!1},ScatterView.prototype.incrementalRender=function(taskParams,seriesModel,ecModel){this._symbolDraw.incrementalUpdate(taskParams,seriesModel.getData(),{clipShape:this._getClipShape(seriesModel)}),this._finished=taskParams.end===seriesModel.getData().count()},ScatterView.prototype.updateTransform=function(seriesModel,ecModel,api){var data=seriesModel.getData();if(this.group.dirty(),!this._finished||data.count()>1e4)return{update:!0};var res=pointsLayout("").reset(seriesModel,ecModel,api);res.progress&&res.progress({start:0,end:data.count(),count:data.count()},data),this._symbolDraw.updateLayout(data)},ScatterView.prototype.eachRendered=function(cb){this._symbolDraw&&this._symbolDraw.eachRendered(cb)},ScatterView.prototype._getClipShape=function(seriesModel){if(seriesModel.get("clip",!0)){var coordSys=seriesModel.coordinateSystem;return coordSys&&coordSys.getArea&&coordSys.getArea(.1)}},ScatterView.prototype._updateSymbolDraw=function(data,seriesModel){var symbolDraw=this._symbolDraw,isLargeDraw=seriesModel.pipelineContext.large;return symbolDraw&&isLargeDraw===this._isLargeDraw||(symbolDraw&&symbolDraw.remove(),symbolDraw=this._symbolDraw=isLargeDraw?new LargeSymbolDraw$1:new SymbolDraw$1,this._isLargeDraw=isLargeDraw,this.group.removeAll()),this.group.add(symbolDraw.group),symbolDraw},ScatterView.prototype.remove=function(ecModel,api){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},ScatterView.prototype.dispose=function(){},ScatterView.type="scatter",ScatterView}(ChartView$1),GridModel$1=function(_super){function GridModel(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(GridModel,_super),GridModel.type="grid",GridModel.dependencies=["xAxis","yAxis"],GridModel.layoutMode="box",GridModel.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"},GridModel}(ComponentModel$1),CartesianAxisModel=function(_super){function CartesianAxisModel(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(CartesianAxisModel,_super),CartesianAxisModel.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",SINGLE_REFERRING).models[0]},CartesianAxisModel.type="cartesian2dAxis",CartesianAxisModel}(ComponentModel$1);mixin(CartesianAxisModel,AxisModelCommonMixin);var defaultOption={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)"]}}},categoryAxis=merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},defaultOption),valueAxis=merge({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}}},defaultOption),axisDefault={category:categoryAxis,value:valueAxis,time:merge({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},valueAxis),log:defaults({logBase:10},valueAxis)},AXIS_TYPES={value:1,category:1,time:1,log:1};function axisModelCreator(registers,axisName,BaseAxisModelClass,extraDefaultOption){each$b(AXIS_TYPES,(function(v,axisType){var defaultOption=merge(merge({},axisDefault[axisType],!0),extraDefaultOption,!0),AxisModel=function(_super){function AxisModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=axisName+"Axis."+axisType,_this}return __extends(AxisModel,_super),AxisModel.prototype.mergeDefaultAndTheme=function(option,ecModel){var layoutMode=fetchLayoutMode(this),inputPositionParams=layoutMode?getLayoutParams(option):{};merge(option,ecModel.getTheme().get(axisType+"Axis")),merge(option,this.getDefaultOption()),option.type=getAxisType(option),layoutMode&&mergeLayoutParam(option,inputPositionParams,layoutMode)},AxisModel.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=OrdinalMeta$1.createByAxisModel(this))},AxisModel.prototype.getCategories=function(rawData){var option=this.option;if("category"===option.type)return rawData?option.data:this.__ordinalMeta.categories},AxisModel.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},AxisModel.type=axisName+"Axis."+axisType,AxisModel.defaultOption=defaultOption,AxisModel}(BaseAxisModelClass);registers.registerComponentModel(AxisModel)})),registers.registerSubTypeDefaulter(axisName+"Axis",getAxisType)}function getAxisType(option){return option.type||(option.data?"category":"value")}var Cartesian=function(){function Cartesian(name){this.type="cartesian",this._dimList=[],this._axes={},this.name=name||""}return Cartesian.prototype.getAxis=function(dim){return this._axes[dim]},Cartesian.prototype.getAxes=function(){return map$1(this._dimList,(function(dim){return this._axes[dim]}),this)},Cartesian.prototype.getAxesByScale=function(scaleType){return scaleType=scaleType.toLowerCase(),filter(this.getAxes(),(function(axis){return axis.scale.type===scaleType}))},Cartesian.prototype.addAxis=function(axis){var dim=axis.dim;this._axes[dim]=axis,this._dimList.push(dim)},Cartesian}(),cartesian2DDimensions=["x","y"];function canCalculateAffineTransform(scale){return"interval"===scale.type||"time"===scale.type}var Cartesian2D=function(_super){function Cartesian2D(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type="cartesian2d",_this.dimensions=cartesian2DDimensions,_this}return __extends(Cartesian2D,_super),Cartesian2D.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var xAxisScale=this.getAxis("x").scale,yAxisScale=this.getAxis("y").scale;if(canCalculateAffineTransform(xAxisScale)&&canCalculateAffineTransform(yAxisScale)){var xScaleExtent=xAxisScale.getExtent(),yScaleExtent=yAxisScale.getExtent(),start=this.dataToPoint([xScaleExtent[0],yScaleExtent[0]]),end=this.dataToPoint([xScaleExtent[1],yScaleExtent[1]]),xScaleSpan=xScaleExtent[1]-xScaleExtent[0],yScaleSpan=yScaleExtent[1]-yScaleExtent[0];if(xScaleSpan&&yScaleSpan){var scaleX=(end[0]-start[0])/xScaleSpan,scaleY=(end[1]-start[1])/yScaleSpan,translateX=start[0]-xScaleExtent[0]*scaleX,translateY=start[1]-yScaleExtent[0]*scaleY,m=this._transform=[scaleX,0,0,scaleY,translateX,translateY];this._invTransform=invert([],m)}}},Cartesian2D.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},Cartesian2D.prototype.containPoint=function(point){var axisX=this.getAxis("x"),axisY=this.getAxis("y");return axisX.contain(axisX.toLocalCoord(point[0]))&&axisY.contain(axisY.toLocalCoord(point[1]))},Cartesian2D.prototype.containData=function(data){return this.getAxis("x").containData(data[0])&&this.getAxis("y").containData(data[1])},Cartesian2D.prototype.containZone=function(data1,data2){var zoneDiag1=this.dataToPoint(data1),zoneDiag2=this.dataToPoint(data2),area=this.getArea(),zone=new BoundingRect$1(zoneDiag1[0],zoneDiag1[1],zoneDiag2[0]-zoneDiag1[0],zoneDiag2[1]-zoneDiag1[1]);return area.intersect(zone)},Cartesian2D.prototype.dataToPoint=function(data,clamp,out){out=out||[];var xVal=data[0],yVal=data[1];if(this._transform&&null!=xVal&&isFinite(xVal)&&null!=yVal&&isFinite(yVal))return applyTransform$1(out,data,this._transform);var xAxis=this.getAxis("x"),yAxis=this.getAxis("y");return out[0]=xAxis.toGlobalCoord(xAxis.dataToCoord(xVal,clamp)),out[1]=yAxis.toGlobalCoord(yAxis.dataToCoord(yVal,clamp)),out},Cartesian2D.prototype.clampData=function(data,out){var xScale=this.getAxis("x").scale,yScale=this.getAxis("y").scale,xAxisExtent=xScale.getExtent(),yAxisExtent=yScale.getExtent(),x=xScale.parse(data[0]),y=yScale.parse(data[1]);return(out=out||[])[0]=Math.min(Math.max(Math.min(xAxisExtent[0],xAxisExtent[1]),x),Math.max(xAxisExtent[0],xAxisExtent[1])),out[1]=Math.min(Math.max(Math.min(yAxisExtent[0],yAxisExtent[1]),y),Math.max(yAxisExtent[0],yAxisExtent[1])),out},Cartesian2D.prototype.pointToData=function(point,clamp){var out=[];if(this._invTransform)return applyTransform$1(out,point,this._invTransform);var xAxis=this.getAxis("x"),yAxis=this.getAxis("y");return out[0]=xAxis.coordToData(xAxis.toLocalCoord(point[0]),clamp),out[1]=yAxis.coordToData(yAxis.toLocalCoord(point[1]),clamp),out},Cartesian2D.prototype.getOtherAxis=function(axis){return this.getAxis("x"===axis.dim?"y":"x")},Cartesian2D.prototype.getArea=function(tolerance){tolerance=tolerance||0;var xExtent=this.getAxis("x").getGlobalExtent(),yExtent=this.getAxis("y").getGlobalExtent(),x=Math.min(xExtent[0],xExtent[1])-tolerance,y=Math.min(yExtent[0],yExtent[1])-tolerance,width=Math.max(xExtent[0],xExtent[1])-x+tolerance,height=Math.max(yExtent[0],yExtent[1])-y+tolerance;return new BoundingRect$1(x,y,width,height)},Cartesian2D}(Cartesian),Axis2D=function(_super){function Axis2D(dim,scale,coordExtent,axisType,position){var _this=_super.call(this,dim,scale,coordExtent)||this;return _this.index=0,_this.type=axisType||"value",_this.position=position||"bottom",_this}return __extends(Axis2D,_super),Axis2D.prototype.isHorizontal=function(){var position=this.position;return"top"===position||"bottom"===position},Axis2D.prototype.getGlobalExtent=function(asc){var ret=this.getExtent();return ret[0]=this.toGlobalCoord(ret[0]),ret[1]=this.toGlobalCoord(ret[1]),asc&&ret[0]>ret[1]&&ret.reverse(),ret},Axis2D.prototype.pointToData=function(point,clamp){return this.coordToData(this.toLocalCoord(point["x"===this.dim?0:1]),clamp)},Axis2D.prototype.setCategorySortInfo=function(info){if("category"!==this.type)return!1;this.model.option.categorySortInfo=info,this.scale.setSortInfo(info)},Axis2D}(Axis$1),Axis2D$1=Axis2D;function layout$1(gridModel,axisModel,opt){opt=opt||{};var grid=gridModel.coordinateSystem,axis=axisModel.axis,layout={},otherAxisOnZeroOf=axis.getAxesOnZeroOf()[0],rawAxisPosition=axis.position,axisPosition=otherAxisOnZeroOf?"onZero":rawAxisPosition,axisDim=axis.dim,rect=grid.getRect(),rectBound=[rect.x,rect.x+rect.width,rect.y,rect.y+rect.height],idx={left:0,right:1,top:0,bottom:1,onZero:2},axisOffset=axisModel.get("offset")||0,posBound="x"===axisDim?[rectBound[2]-axisOffset,rectBound[3]+axisOffset]:[rectBound[0]-axisOffset,rectBound[1]+axisOffset];if(otherAxisOnZeroOf){var onZeroCoord=otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));posBound[idx.onZero]=Math.max(Math.min(onZeroCoord,posBound[1]),posBound[0])}layout.position=["y"===axisDim?posBound[idx[axisPosition]]:rectBound[0],"x"===axisDim?posBound[idx[axisPosition]]:rectBound[3]],layout.rotation=Math.PI/2*("x"===axisDim?0:1);layout.labelDirection=layout.tickDirection=layout.nameDirection={top:-1,bottom:1,left:-1,right:1}[rawAxisPosition],layout.labelOffset=otherAxisOnZeroOf?posBound[idx[rawAxisPosition]]-posBound[idx.onZero]:0,axisModel.get(["axisTick","inside"])&&(layout.tickDirection=-layout.tickDirection),retrieve(opt.labelInside,axisModel.get(["axisLabel","inside"]))&&(layout.labelDirection=-layout.labelDirection);var labelRotate=axisModel.get(["axisLabel","rotate"]);return layout.labelRotate="top"===axisPosition?-labelRotate:labelRotate,layout.z2=1,layout}function isCartesian2DSeries(seriesModel){return"cartesian2d"===seriesModel.get("coordinateSystem")}function findAxisModels(seriesModel){var axisModelMap={xAxisModel:null,yAxisModel:null};return each$b(axisModelMap,(function(v,key){var axisType=key.replace(/Model$/,""),axisModel=seriesModel.getReferringComponents(axisType,SINGLE_REFERRING).models[0];if("production"!==process.env.NODE_ENV&&!axisModel)throw new Error(axisType+' "'+retrieve3(seriesModel.get(axisType+"Index"),seriesModel.get(axisType+"Id"),0)+'" not found');axisModelMap[key]=axisModel})),axisModelMap}var mathLog=Math.log;function alignScaleTicks(scale,axisModel,alignToScale){var intervalScaleProto=IntervalScale$1.prototype,alignToTicks=intervalScaleProto.getTicks.call(alignToScale),alignToNicedTicks=intervalScaleProto.getTicks.call(alignToScale,!0),alignToSplitNumber=alignToTicks.length-1,alignToInterval=intervalScaleProto.getInterval.call(alignToScale),scaleExtent=getScaleExtent(scale,axisModel),rawExtent=scaleExtent.extent,isMinFixed=scaleExtent.fixMin,isMaxFixed=scaleExtent.fixMax;if("log"===scale.type){var logBase=mathLog(scale.base);rawExtent=[mathLog(rawExtent[0])/logBase,mathLog(rawExtent[1])/logBase]}scale.setExtent(rawExtent[0],rawExtent[1]),scale.calcNiceExtent({splitNumber:alignToSplitNumber,fixMin:isMinFixed,fixMax:isMaxFixed});var extent=intervalScaleProto.getExtent.call(scale);isMinFixed&&(rawExtent[0]=extent[0]),isMaxFixed&&(rawExtent[1]=extent[1]);var interval=intervalScaleProto.getInterval.call(scale),min=rawExtent[0],max=rawExtent[1];if(isMinFixed&&isMaxFixed)interval=(max-min)/alignToSplitNumber;else if(isMinFixed)for(max=rawExtent[0]+interval*alignToSplitNumber;max<rawExtent[1]&&isFinite(max)&&isFinite(rawExtent[1]);)interval=increaseInterval(interval),max=rawExtent[0]+interval*alignToSplitNumber;else if(isMaxFixed)for(min=rawExtent[1]-interval*alignToSplitNumber;min>rawExtent[0]&&isFinite(min)&&isFinite(rawExtent[0]);)interval=increaseInterval(interval),min=rawExtent[1]-interval*alignToSplitNumber;else{scale.getTicks().length-1>alignToSplitNumber&&(interval=increaseInterval(interval));var range=interval*alignToSplitNumber;(min=round$3((max=Math.ceil(rawExtent[1]/interval)*interval)-range))<0&&rawExtent[0]>=0?(min=0,max=round$3(range)):max>0&&rawExtent[1]<=0&&(max=0,min=-round$3(range))}var val,exp10,f,t0=(alignToTicks[0].value-alignToNicedTicks[0].value)/alignToInterval,t1=(alignToTicks[alignToSplitNumber].value-alignToNicedTicks[alignToSplitNumber].value)/alignToInterval;if(intervalScaleProto.setExtent.call(scale,min+interval*t0,max+interval*t1),intervalScaleProto.setInterval.call(scale,interval),(t0||t1)&&intervalScaleProto.setNiceExtent.call(scale,min+interval,max-interval),"production"!==process.env.NODE_ENV){var ticks=intervalScaleProto.getTicks.call(scale);ticks[1]&&(val=interval,exp10=Math.pow(10,quantityExponent(Math.abs(val))),0!==(f=Math.abs(val/exp10))&&1!==f&&2!==f&&3!==f&&5!==f||getPrecisionSafe(ticks[1].value)>getPrecisionSafe(interval))&&warn("The ticks may be not readable when set min: "+axisModel.get("min")+", max: "+axisModel.get("max")+" and alignTicks: true")}}var Grid=function(){function Grid(gridModel,ecModel,api){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=cartesian2DDimensions,this._initCartesian(gridModel,ecModel,api),this.model=gridModel}return Grid.prototype.getRect=function(){return this._rect},Grid.prototype.update=function(ecModel,api){var axesMap=this._axesMap;function updateAxisTicks(axes){var alignTo,axesIndices=keys$1(axes),len=axesIndices.length;if(len){for(var axisNeedsAlign=[],i=len-1;i>=0;i--){var axis=axes[+axesIndices[i]],model=axis.model,scale=axis.scale;isIntervalOrLogScale(scale)&&model.get("alignTicks")&&null==model.get("interval")?axisNeedsAlign.push(axis):(niceScaleExtent(scale,model),isIntervalOrLogScale(scale)&&(alignTo=axis))}axisNeedsAlign.length&&(alignTo||niceScaleExtent((alignTo=axisNeedsAlign.pop()).scale,alignTo.model),each$b(axisNeedsAlign,(function(axis){alignScaleTicks(axis.scale,axis.model,alignTo.scale)})))}}this._updateScale(ecModel,this.model),updateAxisTicks(axesMap.x),updateAxisTicks(axesMap.y);var onZeroRecords={};each$b(axesMap.x,(function(xAxis){fixAxisOnZero(axesMap,"y",xAxis,onZeroRecords)})),each$b(axesMap.y,(function(yAxis){fixAxisOnZero(axesMap,"x",yAxis,onZeroRecords)})),this.resize(this.model,api)},Grid.prototype.resize=function(gridModel,api,ignoreContainLabel){var boxLayoutParams=gridModel.getBoxLayoutParams(),isContainLabel=!ignoreContainLabel&&gridModel.get("containLabel"),gridRect=getLayoutRect(boxLayoutParams,{width:api.getWidth(),height:api.getHeight()});this._rect=gridRect;var axesList=this._axesList;function adjustAxes(){each$b(axesList,(function(axis){var isHorizontal=axis.isHorizontal(),extent=isHorizontal?[0,gridRect.width]:[0,gridRect.height],idx=axis.inverse?1:0;axis.setExtent(extent[idx],extent[1-idx]),function(axis,coordBase){var axisExtent=axis.getExtent(),axisExtentSum=axisExtent[0]+axisExtent[1];axis.toGlobalCoord="x"===axis.dim?function(coord){return coord+coordBase}:function(coord){return axisExtentSum-coord+coordBase},axis.toLocalCoord="x"===axis.dim?function(coord){return coord-coordBase}:function(coord){return axisExtentSum-coord+coordBase}}(axis,isHorizontal?gridRect.x:gridRect.y)}))}adjustAxes(),isContainLabel&&(each$b(axesList,(function(axis){if(!axis.model.get(["axisLabel","inside"])){var labelUnionRect=function(axis){var axisModel=axis.model,scale=axis.scale;if(axisModel.get(["axisLabel","show"])&&!scale.isBlank()){var realNumberScaleTicks,tickCount,categoryScaleExtent=scale.getExtent();tickCount=scale instanceof OrdinalScale$1?scale.count():(realNumberScaleTicks=scale.getTicks()).length;var rect,axisLabelModel=axis.getLabelModel(),labelFormatter=makeLabelFormatter(axis),step=1;tickCount>40&&(step=Math.ceil(tickCount/40));for(var i=0;i<tickCount;i+=step){var label=labelFormatter(realNumberScaleTicks?realNumberScaleTicks[i]:{value:categoryScaleExtent[0]+i},i),singleRect=rotateTextRect(axisLabelModel.getTextRect(label),axisLabelModel.get("rotate")||0);rect?rect.union(singleRect):rect=singleRect}return rect}}(axis);if(labelUnionRect){var dim=axis.isHorizontal()?"height":"width",margin=axis.model.get(["axisLabel","margin"]);gridRect[dim]-=labelUnionRect[dim]+margin,"top"===axis.position?gridRect.y+=labelUnionRect.height+margin:"left"===axis.position&&(gridRect.x+=labelUnionRect.width+margin)}}})),adjustAxes()),each$b(this._coordsList,(function(coord){coord.calcAffineTransform()}))},Grid.prototype.getAxis=function(dim,axisIndex){var axesMapOnDim=this._axesMap[dim];if(null!=axesMapOnDim)return axesMapOnDim[axisIndex||0]},Grid.prototype.getAxes=function(){return this._axesList.slice()},Grid.prototype.getCartesian=function(xAxisIndex,yAxisIndex){if(null!=xAxisIndex&&null!=yAxisIndex){var key="x"+xAxisIndex+"y"+yAxisIndex;return this._coordsMap[key]}isObject$3(xAxisIndex)&&(yAxisIndex=xAxisIndex.yAxisIndex,xAxisIndex=xAxisIndex.xAxisIndex);for(var i=0,coordList=this._coordsList;i<coordList.length;i++)if(coordList[i].getAxis("x").index===xAxisIndex||coordList[i].getAxis("y").index===yAxisIndex)return coordList[i]},Grid.prototype.getCartesians=function(){return this._coordsList.slice()},Grid.prototype.convertToPixel=function(ecModel,finder,value){var target=this._findConvertTarget(finder);return target.cartesian?target.cartesian.dataToPoint(value):target.axis?target.axis.toGlobalCoord(target.axis.dataToCoord(value)):null},Grid.prototype.convertFromPixel=function(ecModel,finder,value){var target=this._findConvertTarget(finder);return target.cartesian?target.cartesian.pointToData(value):target.axis?target.axis.coordToData(target.axis.toLocalCoord(value)):null},Grid.prototype._findConvertTarget=function(finder){var cartesian,axis,seriesModel=finder.seriesModel,xAxisModel=finder.xAxisModel||seriesModel&&seriesModel.getReferringComponents("xAxis",SINGLE_REFERRING).models[0],yAxisModel=finder.yAxisModel||seriesModel&&seriesModel.getReferringComponents("yAxis",SINGLE_REFERRING).models[0],gridModel=finder.gridModel,coordsList=this._coordsList;if(seriesModel)indexOf(coordsList,cartesian=seriesModel.coordinateSystem)<0&&(cartesian=null);else if(xAxisModel&&yAxisModel)cartesian=this.getCartesian(xAxisModel.componentIndex,yAxisModel.componentIndex);else if(xAxisModel)axis=this.getAxis("x",xAxisModel.componentIndex);else if(yAxisModel)axis=this.getAxis("y",yAxisModel.componentIndex);else if(gridModel){gridModel.coordinateSystem===this&&(cartesian=this._coordsList[0])}return{cartesian:cartesian,axis:axis}},Grid.prototype.containPoint=function(point){var coord=this._coordsList[0];if(coord)return coord.containPoint(point)},Grid.prototype._initCartesian=function(gridModel,ecModel,api){var _this=this,grid=this,axisPositionUsed={left:!1,right:!1,top:!1,bottom:!1},axesMap={x:{},y:{}},axesCount={x:0,y:0};if(ecModel.eachComponent("xAxis",createAxisCreator("x"),this),ecModel.eachComponent("yAxis",createAxisCreator("y"),this),!axesCount.x||!axesCount.y)return this._axesMap={},void(this._axesList=[]);function createAxisCreator(dimName){return function(axisModel,idx){if(isAxisUsedInTheGrid(axisModel,gridModel)){var axisPosition=axisModel.get("position");"x"===dimName?"top"!==axisPosition&&"bottom"!==axisPosition&&(axisPosition=axisPositionUsed.bottom?"top":"bottom"):"left"!==axisPosition&&"right"!==axisPosition&&(axisPosition=axisPositionUsed.left?"right":"left"),axisPositionUsed[axisPosition]=!0;var axis=new Axis2D$1(dimName,createScaleByModel(axisModel),[0,0],axisModel.get("type"),axisPosition),isCategory="category"===axis.type;axis.onBand=isCategory&&axisModel.get("boundaryGap"),axis.inverse=axisModel.get("inverse"),axisModel.axis=axis,axis.model=axisModel,axis.grid=grid,axis.index=idx,grid._axesList.push(axis),axesMap[dimName][idx]=axis,axesCount[dimName]++}}}this._axesMap=axesMap,each$b(axesMap.x,(function(xAxis,xAxisIndex){each$b(axesMap.y,(function(yAxis,yAxisIndex){var key="x"+xAxisIndex+"y"+yAxisIndex,cartesian=new Cartesian2D(key);cartesian.master=_this,cartesian.model=gridModel,_this._coordsMap[key]=cartesian,_this._coordsList.push(cartesian),cartesian.addAxis(xAxis),cartesian.addAxis(yAxis)}))}))},Grid.prototype._updateScale=function(ecModel,gridModel){function unionExtent(data,axis){each$b(getDataDimensionsOnAxis(data,axis.dim),(function(dim){axis.scale.unionExtentFromData(data,dim)}))}each$b(this._axesList,(function(axis){if(axis.scale.setExtent(1/0,-1/0),"category"===axis.type){var categorySortInfo=axis.model.get("categorySortInfo");axis.scale.setSortInfo(categorySortInfo)}})),ecModel.eachSeries((function(seriesModel){if(isCartesian2DSeries(seriesModel)){var axesModelMap=findAxisModels(seriesModel),xAxisModel=axesModelMap.xAxisModel,yAxisModel=axesModelMap.yAxisModel;if(!isAxisUsedInTheGrid(xAxisModel,gridModel)||!isAxisUsedInTheGrid(yAxisModel,gridModel))return;var cartesian=this.getCartesian(xAxisModel.componentIndex,yAxisModel.componentIndex),data=seriesModel.getData(),xAxis=cartesian.getAxis("x"),yAxis=cartesian.getAxis("y");unionExtent(data,xAxis),unionExtent(data,yAxis)}}),this)},Grid.prototype.getTooltipAxes=function(dim){var baseAxes=[],otherAxes=[];return each$b(this.getCartesians(),(function(cartesian){var baseAxis=null!=dim&&"auto"!==dim?cartesian.getAxis(dim):cartesian.getBaseAxis(),otherAxis=cartesian.getOtherAxis(baseAxis);indexOf(baseAxes,baseAxis)<0&&baseAxes.push(baseAxis),indexOf(otherAxes,otherAxis)<0&&otherAxes.push(otherAxis)})),{baseAxes:baseAxes,otherAxes:otherAxes}},Grid.create=function(ecModel,api){var grids=[];return ecModel.eachComponent("grid",(function(gridModel,idx){var grid=new Grid(gridModel,ecModel,api);grid.name="grid_"+idx,grid.resize(gridModel,api,!0),gridModel.coordinateSystem=grid,grids.push(grid)})),ecModel.eachSeries((function(seriesModel){if(isCartesian2DSeries(seriesModel)){var axesModelMap=findAxisModels(seriesModel),xAxisModel=axesModelMap.xAxisModel,yAxisModel=axesModelMap.yAxisModel,gridModel=xAxisModel.getCoordSysModel();if("production"!==process.env.NODE_ENV){if(!gridModel)throw new Error('Grid "'+retrieve3(xAxisModel.get("gridIndex"),xAxisModel.get("gridId"),0)+'" not found');if(xAxisModel.getCoordSysModel()!==yAxisModel.getCoordSysModel())throw new Error("xAxis and yAxis must use the same grid")}var grid=gridModel.coordinateSystem;seriesModel.coordinateSystem=grid.getCartesian(xAxisModel.componentIndex,yAxisModel.componentIndex)}})),grids},Grid.dimensions=cartesian2DDimensions,Grid}();function isAxisUsedInTheGrid(axisModel,gridModel){return axisModel.getCoordSysModel()===gridModel}function fixAxisOnZero(axesMap,otherAxisDim,axis,onZeroRecords){axis.getAxesOnZeroOf=function(){return otherAxisOnZeroOf?[otherAxisOnZeroOf]:[]};var otherAxisOnZeroOf,otherAxes=axesMap[otherAxisDim],axisModel=axis.model,onZero=axisModel.get(["axisLine","onZero"]),onZeroAxisIndex=axisModel.get(["axisLine","onZeroAxisIndex"]);if(onZero){if(null!=onZeroAxisIndex)canOnZeroToAxis(otherAxes[onZeroAxisIndex])&&(otherAxisOnZeroOf=otherAxes[onZeroAxisIndex]);else for(var idx in otherAxes)if(otherAxes.hasOwnProperty(idx)&&canOnZeroToAxis(otherAxes[idx])&&!onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]){otherAxisOnZeroOf=otherAxes[idx];break}otherAxisOnZeroOf&&(onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)]=!0)}function getOnZeroRecordKey(axis){return axis.dim+"_"+axis.index}}function canOnZeroToAxis(axis){return axis&&"category"!==axis.type&&"time"!==axis.type&&function(axis){var dataExtent=axis.scale.getExtent(),min=dataExtent[0],max=dataExtent[1];return!(min>0&&max>0||min<0&&max<0)}(axis)}var Grid$1=Grid,PI$2=Math.PI,AxisBuilder=function(){function AxisBuilder(axisModel,opt){this.group=new Group$4,this.opt=opt,this.axisModel=axisModel,defaults(opt,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var transformGroup=new Group$4({x:opt.position[0],y:opt.position[1],rotation:opt.rotation});transformGroup.updateTransform(),this._transformGroup=transformGroup}return AxisBuilder.prototype.hasBuilder=function(name){return!!builders[name]},AxisBuilder.prototype.add=function(name){builders[name](this.opt,this.axisModel,this.group,this._transformGroup)},AxisBuilder.prototype.getGroup=function(){return this.group},AxisBuilder.innerTextLayout=function(axisRotation,textRotation,direction){var textAlign,textVerticalAlign,rotationDiff=remRadian(textRotation-axisRotation);return isRadianAroundZero(rotationDiff)?(textVerticalAlign=direction>0?"top":"bottom",textAlign="center"):isRadianAroundZero(rotationDiff-PI$2)?(textVerticalAlign=direction>0?"bottom":"top",textAlign="center"):(textVerticalAlign="middle",textAlign=rotationDiff>0&&rotationDiff<PI$2?direction>0?"right":"left":direction>0?"left":"right"),{rotation:rotationDiff,textAlign:textAlign,textVerticalAlign:textVerticalAlign}},AxisBuilder.makeAxisEventDataBase=function(axisModel){var eventData={componentType:axisModel.mainType,componentIndex:axisModel.componentIndex};return eventData[axisModel.mainType+"Index"]=axisModel.componentIndex,eventData},AxisBuilder.isLabelSilent=function(axisModel){var tooltipOpt=axisModel.get("tooltip");return axisModel.get("silent")||!(axisModel.get("triggerEvent")||tooltipOpt&&tooltipOpt.show)},AxisBuilder}(),builders={axisLine:function(opt,axisModel,group,transformGroup){var shown=axisModel.get(["axisLine","show"]);if("auto"===shown&&opt.handleAutoShown&&(shown=opt.handleAutoShown("axisLine")),shown){var extent=axisModel.axis.getExtent(),matrix=transformGroup.transform,pt1=[extent[0],0],pt2=[extent[1],0],inverse=pt1[0]>pt2[0];matrix&&(applyTransform$1(pt1,pt1,matrix),applyTransform$1(pt2,pt2,matrix));var lineStyle=extend({lineCap:"round"},axisModel.getModel(["axisLine","lineStyle"]).getLineStyle()),line=new Line$3({shape:{x1:pt1[0],y1:pt1[1],x2:pt2[0],y2:pt2[1]},style:lineStyle,strokeContainThreshold:opt.strokeContainThreshold||5,silent:!0,z2:1});subPixelOptimizeLine(line.shape,line.style.lineWidth),line.anid="line",group.add(line);var arrows=axisModel.get(["axisLine","symbol"]);if(null!=arrows){var arrowSize=axisModel.get(["axisLine","symbolSize"]);isString(arrows)&&(arrows=[arrows,arrows]),(isString(arrowSize)||isNumber(arrowSize))&&(arrowSize=[arrowSize,arrowSize]);var arrowOffset=normalizeSymbolOffset(axisModel.get(["axisLine","symbolOffset"])||0,arrowSize),symbolWidth_1=arrowSize[0],symbolHeight_1=arrowSize[1];each$b([{rotate:opt.rotation+Math.PI/2,offset:arrowOffset[0],r:0},{rotate:opt.rotation-Math.PI/2,offset:arrowOffset[1],r:Math.sqrt((pt1[0]-pt2[0])*(pt1[0]-pt2[0])+(pt1[1]-pt2[1])*(pt1[1]-pt2[1]))}],(function(point,index){if("none"!==arrows[index]&&null!=arrows[index]){var symbol=createSymbol$1(arrows[index],-symbolWidth_1/2,-symbolHeight_1/2,symbolWidth_1,symbolHeight_1,lineStyle.stroke,!0),r=point.r+point.offset,pt=inverse?pt2:pt1;symbol.attr({rotation:point.rotate,x:pt[0]+r*Math.cos(opt.rotation),y:pt[1]-r*Math.sin(opt.rotation),silent:!0,z2:11}),group.add(symbol)}}))}}},axisTickLabel:function(opt,axisModel,group,transformGroup){var ticksEls=function(group,transformGroup,axisModel,opt){var axis=axisModel.axis,tickModel=axisModel.getModel("axisTick"),shown=tickModel.get("show");"auto"===shown&&opt.handleAutoShown&&(shown=opt.handleAutoShown("axisTick"));if(!shown||axis.scale.isBlank())return;for(var lineStyleModel=tickModel.getModel("lineStyle"),tickEndCoord=opt.tickDirection*tickModel.get("length"),ticksEls=createTicks(axis.getTicksCoords(),transformGroup.transform,tickEndCoord,defaults(lineStyleModel.getLineStyle(),{stroke:axisModel.get(["axisLine","lineStyle","color"])}),"ticks"),i=0;i<ticksEls.length;i++)group.add(ticksEls[i]);return ticksEls}(group,transformGroup,axisModel,opt),labelEls=function(group,transformGroup,axisModel,opt){var axis=axisModel.axis,show=retrieve(opt.axisLabelShow,axisModel.get(["axisLabel","show"]));if(!show||axis.scale.isBlank())return;var labelModel=axisModel.getModel("axisLabel"),labelMargin=labelModel.get("margin"),labels=axis.getViewLabels(),labelRotation=(retrieve(opt.labelRotate,labelModel.get("rotate"))||0)*PI$2/180,labelLayout=AxisBuilder.innerTextLayout(opt.rotation,labelRotation,opt.labelDirection),rawCategoryData=axisModel.getCategories&&axisModel.getCategories(!0),labelEls=[],silent=AxisBuilder.isLabelSilent(axisModel),triggerEvent=axisModel.get("triggerEvent");return each$b(labels,(function(labelItem,index){var tickValue="ordinal"===axis.scale.type?axis.scale.getRawOrdinalNumber(labelItem.tickValue):labelItem.tickValue,formattedLabel=labelItem.formattedLabel,rawLabel=labelItem.rawLabel,itemLabelModel=labelModel;if(rawCategoryData&&rawCategoryData[tickValue]){var rawCategoryItem=rawCategoryData[tickValue];isObject$3(rawCategoryItem)&&rawCategoryItem.textStyle&&(itemLabelModel=new Model$1(rawCategoryItem.textStyle,labelModel,axisModel.ecModel))}var textColor=itemLabelModel.getTextColor()||axisModel.get(["axisLine","lineStyle","color"]),tickCoord=axis.dataToCoord(tickValue),align=itemLabelModel.getShallow("align",!0)||labelLayout.textAlign,alignMin=retrieve2(itemLabelModel.getShallow("alignMinLabel",!0),align),alignMax=retrieve2(itemLabelModel.getShallow("alignMaxLabel",!0),align),verticalAlign=itemLabelModel.getShallow("verticalAlign",!0)||itemLabelModel.getShallow("baseline",!0)||labelLayout.textVerticalAlign,verticalAlignMin=retrieve2(itemLabelModel.getShallow("verticalAlignMinLabel",!0),verticalAlign),verticalAlignMax=retrieve2(itemLabelModel.getShallow("verticalAlignMaxLabel",!0),verticalAlign),textEl=new ZRText$1({x:tickCoord,y:opt.labelOffset+opt.labelDirection*labelMargin,rotation:labelLayout.rotation,silent:silent,z2:10+(labelItem.level||0),style:createTextStyle(itemLabelModel,{text:formattedLabel,align:0===index?alignMin:index===labels.length-1?alignMax:align,verticalAlign:0===index?verticalAlignMin:index===labels.length-1?verticalAlignMax:verticalAlign,fill:isFunction(textColor)?textColor("category"===axis.type?rawLabel:"value"===axis.type?tickValue+"":tickValue,index):textColor})});if(textEl.anid="label_"+tickValue,setTooltipConfig({el:textEl,componentModel:axisModel,itemName:formattedLabel,formatterParamsExtra:{isTruncated:function(){return textEl.isTruncated},value:rawLabel,tickIndex:index}}),triggerEvent){var eventData=AxisBuilder.makeAxisEventDataBase(axisModel);eventData.targetType="axisLabel",eventData.value=rawLabel,eventData.tickIndex=index,"category"===axis.type&&(eventData.dataIndex=tickValue),getECData(textEl).eventData=eventData}transformGroup.add(textEl),textEl.updateTransform(),labelEls.push(textEl),group.add(textEl),textEl.decomposeTransform()})),labelEls}(group,transformGroup,axisModel,opt);(function(axisModel,labelEls,tickEls){if(shouldShowAllLabels(axisModel.axis))return;var showMinLabel=axisModel.get(["axisLabel","showMinLabel"]),showMaxLabel=axisModel.get(["axisLabel","showMaxLabel"]);labelEls=labelEls||[],tickEls=tickEls||[];var firstLabel=labelEls[0],nextLabel=labelEls[1],lastLabel=labelEls[labelEls.length-1],prevLabel=labelEls[labelEls.length-2],firstTick=tickEls[0],nextTick=tickEls[1],lastTick=tickEls[tickEls.length-1],prevTick=tickEls[tickEls.length-2];!1===showMinLabel?(ignoreEl(firstLabel),ignoreEl(firstTick)):isTwoLabelOverlapped(firstLabel,nextLabel)&&(showMinLabel?(ignoreEl(nextLabel),ignoreEl(nextTick)):(ignoreEl(firstLabel),ignoreEl(firstTick)));!1===showMaxLabel?(ignoreEl(lastLabel),ignoreEl(lastTick)):isTwoLabelOverlapped(prevLabel,lastLabel)&&(showMaxLabel?(ignoreEl(prevLabel),ignoreEl(prevTick)):(ignoreEl(lastLabel),ignoreEl(lastTick)))}(axisModel,labelEls,ticksEls),function(group,transformGroup,axisModel,tickDirection){var axis=axisModel.axis,minorTickModel=axisModel.getModel("minorTick");if(!minorTickModel.get("show")||axis.scale.isBlank())return;var minorTicksCoords=axis.getMinorTicksCoords();if(!minorTicksCoords.length)return;for(var lineStyleModel=minorTickModel.getModel("lineStyle"),tickEndCoord=tickDirection*minorTickModel.get("length"),minorTickLineStyle=defaults(lineStyleModel.getLineStyle(),defaults(axisModel.getModel("axisTick").getLineStyle(),{stroke:axisModel.get(["axisLine","lineStyle","color"])})),i=0;i<minorTicksCoords.length;i++)for(var minorTicksEls=createTicks(minorTicksCoords[i],transformGroup.transform,tickEndCoord,minorTickLineStyle,"minorticks_"+i),k=0;k<minorTicksEls.length;k++)group.add(minorTicksEls[k])}(group,transformGroup,axisModel,opt.tickDirection),axisModel.get(["axisLabel","hideOverlap"]))&&hideOverlap(prepareLayoutList(map$1(labelEls,(function(label){return{label:label,priority:label.z2,defaultAttr:{ignore:label.ignore}}}))))},axisName:function(opt,axisModel,group,transformGroup){var name=retrieve(opt.axisName,axisModel.get("name"));if(name){var labelLayout,axisNameAvailableWidth,nameLocation=axisModel.get("nameLocation"),nameDirection=opt.nameDirection,textStyleModel=axisModel.getModel("nameTextStyle"),gap=axisModel.get("nameGap")||0,extent=axisModel.axis.getExtent(),gapSignal=extent[0]>extent[1]?-1:1,pos=["start"===nameLocation?extent[0]-gapSignal*gap:"end"===nameLocation?extent[1]+gapSignal*gap:(extent[0]+extent[1])/2,isNameLocationCenter(nameLocation)?opt.labelOffset+nameDirection*gap:0],nameRotation=axisModel.get("nameRotate");null!=nameRotation&&(nameRotation=nameRotation*PI$2/180),isNameLocationCenter(nameLocation)?labelLayout=AxisBuilder.innerTextLayout(opt.rotation,null!=nameRotation?nameRotation:opt.rotation,nameDirection):(labelLayout=function(rotation,textPosition,textRotate,extent){var textAlign,textVerticalAlign,rotationDiff=remRadian(textRotate-rotation),inverse=extent[0]>extent[1],onLeft="start"===textPosition&&!inverse||"start"!==textPosition&&inverse;isRadianAroundZero(rotationDiff-PI$2/2)?(textVerticalAlign=onLeft?"bottom":"top",textAlign="center"):isRadianAroundZero(rotationDiff-1.5*PI$2)?(textVerticalAlign=onLeft?"top":"bottom",textAlign="center"):(textVerticalAlign="middle",textAlign=rotationDiff<1.5*PI$2&&rotationDiff>PI$2/2?onLeft?"left":"right":onLeft?"right":"left");return{rotation:rotationDiff,textAlign:textAlign,textVerticalAlign:textVerticalAlign}}(opt.rotation,nameLocation,nameRotation||0,extent),null!=(axisNameAvailableWidth=opt.axisNameAvailableWidth)&&(axisNameAvailableWidth=Math.abs(axisNameAvailableWidth/Math.sin(labelLayout.rotation)),!isFinite(axisNameAvailableWidth)&&(axisNameAvailableWidth=null)));var textFont=textStyleModel.getFont(),truncateOpt=axisModel.get("nameTruncate",!0)||{},ellipsis=truncateOpt.ellipsis,maxWidth=retrieve(opt.nameTruncateMaxWidth,truncateOpt.maxWidth,axisNameAvailableWidth),textEl=new ZRText$1({x:pos[0],y:pos[1],rotation:labelLayout.rotation,silent:AxisBuilder.isLabelSilent(axisModel),style:createTextStyle(textStyleModel,{text:name,font:textFont,overflow:"truncate",width:maxWidth,ellipsis:ellipsis,fill:textStyleModel.getTextColor()||axisModel.get(["axisLine","lineStyle","color"]),align:textStyleModel.get("align")||labelLayout.textAlign,verticalAlign:textStyleModel.get("verticalAlign")||labelLayout.textVerticalAlign}),z2:1});if(setTooltipConfig({el:textEl,componentModel:axisModel,itemName:name}),textEl.__fullText=name,textEl.anid="name",axisModel.get("triggerEvent")){var eventData=AxisBuilder.makeAxisEventDataBase(axisModel);eventData.targetType="axisName",eventData.name=name,getECData(textEl).eventData=eventData}transformGroup.add(textEl),textEl.updateTransform(),group.add(textEl),textEl.decomposeTransform()}}};function ignoreEl(el){el&&(el.ignore=!0)}function isTwoLabelOverlapped(current,next){var firstRect=current&&current.getBoundingRect().clone(),nextRect=next&&next.getBoundingRect().clone();if(firstRect&&nextRect){var mRotationBack=identity([]);return rotate(mRotationBack,mRotationBack,-current.rotation),firstRect.applyTransform(mul([],mRotationBack,current.getLocalTransform())),nextRect.applyTransform(mul([],mRotationBack,next.getLocalTransform())),firstRect.intersect(nextRect)}}function isNameLocationCenter(nameLocation){return"middle"===nameLocation||"center"===nameLocation}function createTicks(ticksCoords,tickTransform,tickEndCoord,tickLineStyle,anidPrefix){for(var tickEls=[],pt1=[],pt2=[],i=0;i<ticksCoords.length;i++){var tickCoord=ticksCoords[i].coord;pt1[0]=tickCoord,pt1[1]=0,pt2[0]=tickCoord,pt2[1]=tickEndCoord,tickTransform&&(applyTransform$1(pt1,pt1,tickTransform),applyTransform$1(pt2,pt2,tickTransform));var tickEl=new Line$3({shape:{x1:pt1[0],y1:pt1[1],x2:pt2[0],y2:pt2[1]},style:tickLineStyle,z2:2,autoBatch:!0,silent:!0});subPixelOptimizeLine(tickEl.shape,tickEl.style.lineWidth),tickEl.anid=anidPrefix+"_"+ticksCoords[i].tickValue,tickEls.push(tickEl)}return tickEls}var AxisBuilder$1=AxisBuilder;function collect(ecModel,api){var result={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(result,ecModel,api){var globalTooltipModel=ecModel.getComponent("tooltip"),globalAxisPointerModel=ecModel.getComponent("axisPointer"),linksOption=globalAxisPointerModel.get("link",!0)||[],linkGroups=[];each$b(api.getCoordinateSystems(),(function(coordSys){if(coordSys.axisPointerEnabled){var coordSysKey=makeKey(coordSys.model),axesInfoInCoordSys=result.coordSysAxesInfo[coordSysKey]={};result.coordSysMap[coordSysKey]=coordSys;var baseTooltipModel=coordSys.model.getModel("tooltip",globalTooltipModel);if(each$b(coordSys.getAxes(),curry$1(saveTooltipAxisInfo,!1,null)),coordSys.getTooltipAxes&&globalTooltipModel&&baseTooltipModel.get("show")){var triggerAxis="axis"===baseTooltipModel.get("trigger"),cross="cross"===baseTooltipModel.get(["axisPointer","type"]),tooltipAxes=coordSys.getTooltipAxes(baseTooltipModel.get(["axisPointer","axis"]));(triggerAxis||cross)&&each$b(tooltipAxes.baseAxes,curry$1(saveTooltipAxisInfo,!cross||"cross",triggerAxis)),cross&&each$b(tooltipAxes.otherAxes,curry$1(saveTooltipAxisInfo,"cross",!1))}}function saveTooltipAxisInfo(fromTooltip,triggerTooltip,axis){var axisPointerModel=axis.model.getModel("axisPointer",globalAxisPointerModel),axisPointerShow=axisPointerModel.get("show");if(axisPointerShow&&("auto"!==axisPointerShow||fromTooltip||isHandleTrigger(axisPointerModel))){null==triggerTooltip&&(triggerTooltip=axisPointerModel.get("triggerTooltip")),axisPointerModel=fromTooltip?function(axis,baseTooltipModel,globalAxisPointerModel,ecModel,fromTooltip,triggerTooltip){var tooltipAxisPointerModel=baseTooltipModel.getModel("axisPointer"),volatileOption={};each$b(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(field){volatileOption[field]=clone$3(tooltipAxisPointerModel.get(field))})),volatileOption.snap="category"!==axis.type&&!!triggerTooltip,"cross"===tooltipAxisPointerModel.get("type")&&(volatileOption.type="line");var labelOption=volatileOption.label||(volatileOption.label={});if(null==labelOption.show&&(labelOption.show=!1),"cross"===fromTooltip){var tooltipAxisPointerLabelShow=tooltipAxisPointerModel.get(["label","show"]);if(labelOption.show=null==tooltipAxisPointerLabelShow||tooltipAxisPointerLabelShow,!triggerTooltip){var crossStyle=volatileOption.lineStyle=tooltipAxisPointerModel.get("crossStyle");crossStyle&&defaults(labelOption,crossStyle.textStyle)}}return axis.model.getModel("axisPointer",new Model$1(volatileOption,globalAxisPointerModel,ecModel))}(axis,baseTooltipModel,globalAxisPointerModel,ecModel,fromTooltip,triggerTooltip):axisPointerModel;var snap=axisPointerModel.get("snap"),triggerEmphasis=axisPointerModel.get("triggerEmphasis"),axisKey=makeKey(axis.model),involveSeries=triggerTooltip||snap||"category"===axis.type,axisInfo=result.axesInfo[axisKey]={key:axisKey,axis:axis,coordSys:coordSys,axisPointerModel:axisPointerModel,triggerTooltip:triggerTooltip,triggerEmphasis:triggerEmphasis,involveSeries:involveSeries,snap:snap,useHandle:isHandleTrigger(axisPointerModel),seriesModels:[],linkGroup:null};axesInfoInCoordSys[axisKey]=axisInfo,result.seriesInvolved=result.seriesInvolved||involveSeries;var groupIndex=function(linksOption,axis){for(var axisModel=axis.model,dim=axis.dim,i=0;i<linksOption.length;i++){var linkOption=linksOption[i]||{};if(checkPropInLink(linkOption[dim+"AxisId"],axisModel.id)||checkPropInLink(linkOption[dim+"AxisIndex"],axisModel.componentIndex)||checkPropInLink(linkOption[dim+"AxisName"],axisModel.name))return i}}(linksOption,axis);if(null!=groupIndex){var linkGroup=linkGroups[groupIndex]||(linkGroups[groupIndex]={axesInfo:{}});linkGroup.axesInfo[axisKey]=axisInfo,linkGroup.mapper=linksOption[groupIndex].mapper,axisInfo.linkGroup=linkGroup}}}}))}(result,ecModel,api),result.seriesInvolved&&function(result,ecModel){ecModel.eachSeries((function(seriesModel){var coordSys=seriesModel.coordinateSystem,seriesTooltipTrigger=seriesModel.get(["tooltip","trigger"],!0),seriesTooltipShow=seriesModel.get(["tooltip","show"],!0);coordSys&&"none"!==seriesTooltipTrigger&&!1!==seriesTooltipTrigger&&"item"!==seriesTooltipTrigger&&!1!==seriesTooltipShow&&!1!==seriesModel.get(["axisPointer","show"],!0)&&each$b(result.coordSysAxesInfo[makeKey(coordSys.model)],(function(axisInfo){var axis=axisInfo.axis;coordSys.getAxis(axis.dim)===axis&&(axisInfo.seriesModels.push(seriesModel),null==axisInfo.seriesDataCount&&(axisInfo.seriesDataCount=0),axisInfo.seriesDataCount+=seriesModel.getData().count())}))}))}(result,ecModel),result}function checkPropInLink(linkPropValue,axisPropValue){return"all"===linkPropValue||isArray(linkPropValue)&&indexOf(linkPropValue,axisPropValue)>=0||linkPropValue===axisPropValue}function getAxisInfo$1(axisModel){var coordSysAxesInfo=(axisModel.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return coordSysAxesInfo&&coordSysAxesInfo.axesInfo[makeKey(axisModel)]}function isHandleTrigger(axisPointerModel){return!!axisPointerModel.get(["handle","show"])}function makeKey(model){return model.type+"||"+model.id}var axisPointerClazz={},AxisView=function(_super){function AxisView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=AxisView.type,_this}return __extends(AxisView,_super),AxisView.prototype.render=function(axisModel,ecModel,api,payload){this.axisPointerClass&&function(axisModel){var axisInfo=getAxisInfo$1(axisModel);if(axisInfo){var axisPointerModel=axisInfo.axisPointerModel,scale=axisInfo.axis.scale,option=axisPointerModel.option,status=axisPointerModel.get("status"),value=axisPointerModel.get("value");null!=value&&(value=scale.parse(value));var useHandle=isHandleTrigger(axisPointerModel);null==status&&(option.status=useHandle?"show":"hide");var extent=scale.getExtent().slice();extent[0]>extent[1]&&extent.reverse(),(null==value||value>extent[1])&&(value=extent[1]),value<extent[0]&&(value=extent[0]),option.value=value,useHandle&&(option.status=axisInfo.axis.scale.isBlank()?"hide":"show")}}(axisModel),_super.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(axisModel,api,!0)},AxisView.prototype.updateAxisPointer=function(axisModel,ecModel,api,payload){this._doUpdateAxisPointerClass(axisModel,api,!1)},AxisView.prototype.remove=function(ecModel,api){var axisPointer=this._axisPointer;axisPointer&&axisPointer.remove(api)},AxisView.prototype.dispose=function(ecModel,api){this._disposeAxisPointer(api),_super.prototype.dispose.apply(this,arguments)},AxisView.prototype._doUpdateAxisPointerClass=function(axisModel,api,forceRender){var Clazz=AxisView.getAxisPointerClass(this.axisPointerClass);if(Clazz){var axisPointerModel=function(axisModel){var axisInfo=getAxisInfo$1(axisModel);return axisInfo&&axisInfo.axisPointerModel}(axisModel);axisPointerModel?(this._axisPointer||(this._axisPointer=new Clazz)).render(axisModel,axisPointerModel,api,forceRender):this._disposeAxisPointer(api)}},AxisView.prototype._disposeAxisPointer=function(api){this._axisPointer&&this._axisPointer.dispose(api),this._axisPointer=null},AxisView.registerAxisPointerClass=function(type,clazz){if("production"!==process.env.NODE_ENV&&axisPointerClazz[type])throw new Error("axisPointer "+type+" exists");axisPointerClazz[type]=clazz},AxisView.getAxisPointerClass=function(type){return type&&axisPointerClazz[type]},AxisView.type="axis",AxisView}(ComponentView$1),AxisView$1=AxisView,inner$c=makeInner();var axisBuilderAttrs$1=["axisLine","axisTickLabel","axisName"],selfBuilderAttrs=["splitArea","splitLine","minorSplitLine"],CartesianAxisView=function(_super){function CartesianAxisView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=CartesianAxisView.type,_this.axisPointerClass="CartesianAxisPointer",_this}return __extends(CartesianAxisView,_super),CartesianAxisView.prototype.render=function(axisModel,ecModel,api,payload){this.group.removeAll();var oldAxisGroup=this._axisGroup;if(this._axisGroup=new Group$4,this.group.add(this._axisGroup),axisModel.get("show")){var gridModel=axisModel.getCoordSysModel(),layout=layout$1(gridModel,axisModel),axisBuilder=new AxisBuilder$1(axisModel,extend({handleAutoShown:function(elementType){for(var cartesians=gridModel.coordinateSystem.getCartesians(),i=0;i<cartesians.length;i++)if(isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale))return!0;return!1}},layout));each$b(axisBuilderAttrs$1,axisBuilder.add,axisBuilder),this._axisGroup.add(axisBuilder.getGroup()),each$b(selfBuilderAttrs,(function(name){axisModel.get([name,"show"])&&axisElementBuilders[name](this,this._axisGroup,axisModel,gridModel)}),this),payload&&"changeAxisOrder"===payload.type&&payload.isInitSort||groupTransition(oldAxisGroup,this._axisGroup,axisModel),_super.prototype.render.call(this,axisModel,ecModel,api,payload)}},CartesianAxisView.prototype.remove=function(){inner$c(this).splitAreaColors=null},CartesianAxisView.type="cartesianAxis",CartesianAxisView}(AxisView$1),axisElementBuilders={splitLine:function(axisView,axisGroup,axisModel,gridModel){var axis=axisModel.axis;if(!axis.scale.isBlank()){var splitLineModel=axisModel.getModel("splitLine"),lineStyleModel=splitLineModel.getModel("lineStyle"),lineColors=lineStyleModel.get("color"),showMinLine=!1!==splitLineModel.get("showMinLine"),showMaxLine=!1!==splitLineModel.get("showMaxLine");lineColors=isArray(lineColors)?lineColors:[lineColors];for(var gridRect=gridModel.coordinateSystem.getRect(),isHorizontal=axis.isHorizontal(),lineCount=0,ticksCoords=axis.getTicksCoords({tickModel:splitLineModel}),p1=[],p2=[],lineStyle=lineStyleModel.getLineStyle(),i=0;i<ticksCoords.length;i++){var tickCoord=axis.toGlobalCoord(ticksCoords[i].coord);if((0!==i||showMinLine)&&(i!==ticksCoords.length-1||showMaxLine)){var tickValue=ticksCoords[i].tickValue;isHorizontal?(p1[0]=tickCoord,p1[1]=gridRect.y,p2[0]=tickCoord,p2[1]=gridRect.y+gridRect.height):(p1[0]=gridRect.x,p1[1]=tickCoord,p2[0]=gridRect.x+gridRect.width,p2[1]=tickCoord);var colorIndex=lineCount++%lineColors.length,line=new Line$3({anid:null!=tickValue?"line_"+tickValue:null,autoBatch:!0,shape:{x1:p1[0],y1:p1[1],x2:p2[0],y2:p2[1]},style:defaults({stroke:lineColors[colorIndex]},lineStyle),silent:!0});subPixelOptimizeLine(line.shape,lineStyle.lineWidth),axisGroup.add(line)}}}},minorSplitLine:function(axisView,axisGroup,axisModel,gridModel){var axis=axisModel.axis,lineStyleModel=axisModel.getModel("minorSplitLine").getModel("lineStyle"),gridRect=gridModel.coordinateSystem.getRect(),isHorizontal=axis.isHorizontal(),minorTicksCoords=axis.getMinorTicksCoords();if(minorTicksCoords.length)for(var p1=[],p2=[],lineStyle=lineStyleModel.getLineStyle(),i=0;i<minorTicksCoords.length;i++)for(var k=0;k<minorTicksCoords[i].length;k++){var tickCoord=axis.toGlobalCoord(minorTicksCoords[i][k].coord);isHorizontal?(p1[0]=tickCoord,p1[1]=gridRect.y,p2[0]=tickCoord,p2[1]=gridRect.y+gridRect.height):(p1[0]=gridRect.x,p1[1]=tickCoord,p2[0]=gridRect.x+gridRect.width,p2[1]=tickCoord);var line=new Line$3({anid:"minor_line_"+minorTicksCoords[i][k].tickValue,autoBatch:!0,shape:{x1:p1[0],y1:p1[1],x2:p2[0],y2:p2[1]},style:lineStyle,silent:!0});subPixelOptimizeLine(line.shape,lineStyle.lineWidth),axisGroup.add(line)}},splitArea:function(axisView,axisGroup,axisModel,gridModel){!function(axisView,axisGroup,axisModel,gridModel){var axis=axisModel.axis;if(!axis.scale.isBlank()){var splitAreaModel=axisModel.getModel("splitArea"),areaStyleModel=splitAreaModel.getModel("areaStyle"),areaColors=areaStyleModel.get("color"),gridRect=gridModel.coordinateSystem.getRect(),ticksCoords=axis.getTicksCoords({tickModel:splitAreaModel,clamp:!0});if(ticksCoords.length){var areaColorsLen=areaColors.length,lastSplitAreaColors=inner$c(axisView).splitAreaColors,newSplitAreaColors=createHashMap(),colorIndex=0;if(lastSplitAreaColors)for(var i=0;i<ticksCoords.length;i++){var cIndex=lastSplitAreaColors.get(ticksCoords[i].tickValue);if(null!=cIndex){colorIndex=(cIndex+(areaColorsLen-1)*i)%areaColorsLen;break}}var prev=axis.toGlobalCoord(ticksCoords[0].coord),areaStyle=areaStyleModel.getAreaStyle();for(areaColors=isArray(areaColors)?areaColors:[areaColors],i=1;i<ticksCoords.length;i++){var tickCoord=axis.toGlobalCoord(ticksCoords[i].coord),x=void 0,y=void 0,width=void 0,height=void 0;axis.isHorizontal()?(x=prev,y=gridRect.y,width=tickCoord-x,height=gridRect.height,prev=x+width):(x=gridRect.x,y=prev,width=gridRect.width,prev=y+(height=tickCoord-y));var tickValue=ticksCoords[i-1].tickValue;null!=tickValue&&newSplitAreaColors.set(tickValue,colorIndex),axisGroup.add(new Rect$4({anid:null!=tickValue?"area_"+tickValue:null,shape:{x:x,y:y,width:width,height:height},style:defaults({fill:areaColors[colorIndex]},areaStyle),autoBatch:!0,silent:!0})),colorIndex=(colorIndex+1)%areaColorsLen}inner$c(axisView).splitAreaColors=newSplitAreaColors}}}(axisView,axisGroup,axisModel,gridModel)}},CartesianXAxisView=function(_super){function CartesianXAxisView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=CartesianXAxisView.type,_this}return __extends(CartesianXAxisView,_super),CartesianXAxisView.type="xAxis",CartesianXAxisView}(CartesianAxisView),CartesianYAxisView=function(_super){function CartesianYAxisView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=CartesianXAxisView.type,_this}return __extends(CartesianYAxisView,_super),CartesianYAxisView.type="yAxis",CartesianYAxisView}(CartesianAxisView),GridView=function(_super){function GridView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type="grid",_this}return __extends(GridView,_super),GridView.prototype.render=function(gridModel,ecModel){this.group.removeAll(),gridModel.get("show")&&this.group.add(new Rect$4({shape:gridModel.coordinateSystem.getRect(),style:defaults({fill:gridModel.get("backgroundColor")},gridModel.getItemStyle()),silent:!0,z2:-1}))},GridView.type="grid",GridView}(ComponentView$1),extraOption={offset:0};function install$v(registers){registers.registerComponentView(GridView),registers.registerComponentModel(GridModel$1),registers.registerCoordinateSystem("cartesian2d",Grid$1),axisModelCreator(registers,"x",CartesianAxisModel,extraOption),axisModelCreator(registers,"y",CartesianAxisModel,extraOption),registers.registerComponentView(CartesianXAxisView),registers.registerComponentView(CartesianYAxisView),registers.registerPreprocessor((function(option){option.xAxis&&option.yAxis&&!option.grid&&(option.grid={})}))}function install$u(registers){use(install$v),registers.registerSeriesModel(ScatterSeriesModel$1),registers.registerChartView(ScatterView$1),registers.registerLayout(pointsLayout("scatter"))}function radarLayout(ecModel){ecModel.eachSeriesByType("radar",(function(seriesModel){var data=seriesModel.getData(),points=[],coordSys=seriesModel.coordinateSystem;if(coordSys){var axes=coordSys.getIndicatorAxes();each$b(axes,(function(axis,axisIndex){data.each(data.mapDimension(axes[axisIndex].dim),(function(val,dataIndex){points[dataIndex]=points[dataIndex]||[];var point=coordSys.dataToPoint(val,axisIndex);points[dataIndex][axisIndex]=isValidPoint(point)?point:getValueMissingPoint(coordSys)}))})),data.each((function(idx){var firstPoint=function(arr,cb,context){if(arr&&cb)for(var i=0,len=arr.length;i<len;i++)if(cb.call(context,arr[i],i,arr))return arr[i]}(points[idx],(function(point){return isValidPoint(point)}))||getValueMissingPoint(coordSys);points[idx].push(firstPoint.slice()),data.setItemLayout(idx,points[idx])}))}}))}function isValidPoint(point){return!isNaN(point[0])&&!isNaN(point[1])}function getValueMissingPoint(coordSys){return[coordSys.cx,coordSys.cy]}function radarBackwardCompat(option){var polarOptArr=option.polar;if(polarOptArr){isArray(polarOptArr)||(polarOptArr=[polarOptArr]);var polarNotRadar_1=[];each$b(polarOptArr,(function(polarOpt,idx){polarOpt.indicator?(polarOpt.type&&!polarOpt.shape&&(polarOpt.shape=polarOpt.type),option.radar=option.radar||[],isArray(option.radar)||(option.radar=[option.radar]),option.radar.push(polarOpt)):polarNotRadar_1.push(polarOpt)})),option.polar=polarNotRadar_1}each$b(option.series,(function(seriesOpt){seriesOpt&&"radar"===seriesOpt.type&&seriesOpt.polarIndex&&(seriesOpt.radarIndex=seriesOpt.polarIndex)}))}var RadarView$2=function(_super){function RadarView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=RadarView.type,_this}return __extends(RadarView,_super),RadarView.prototype.render=function(seriesModel,ecModel,api){var polar=seriesModel.coordinateSystem,group=this.group,data=seriesModel.getData(),oldData=this._data;function createSymbol(data,idx){var symbolType=data.getItemVisual(idx,"symbol")||"circle";if("none"!==symbolType){var symbolSize=normalizeSymbolSize(data.getItemVisual(idx,"symbolSize")),symbolPath=createSymbol$1(symbolType,-1,-1,2,2),symbolRotate=data.getItemVisual(idx,"symbolRotate")||0;return symbolPath.attr({style:{strokeNoScale:!0},z2:100,scaleX:symbolSize[0]/2,scaleY:symbolSize[1]/2,rotation:symbolRotate*Math.PI/180||0}),symbolPath}}function updateSymbols(oldPoints,newPoints,symbolGroup,data,idx,isInit){symbolGroup.removeAll();for(var i=0;i<newPoints.length-1;i++){var symbolPath=createSymbol(data,idx);symbolPath&&(symbolPath.__dimIdx=i,oldPoints[i]?(symbolPath.setPosition(oldPoints[i]),graphic[isInit?"initProps":"updateProps"](symbolPath,{x:newPoints[i][0],y:newPoints[i][1]},seriesModel,idx)):symbolPath.setPosition(newPoints[i]),symbolGroup.add(symbolPath))}}function getInitialPoints(points){return map$1(points,(function(pt){return[polar.cx,polar.cy]}))}data.diff(oldData).add((function(idx){var points=data.getItemLayout(idx);if(points){var polygon=new Polygon$1,polyline=new Polyline$1,target={shape:{points:points}};polygon.shape.points=getInitialPoints(points),polyline.shape.points=getInitialPoints(points),initProps(polygon,target,seriesModel,idx),initProps(polyline,target,seriesModel,idx);var itemGroup=new Group$4,symbolGroup=new Group$4;itemGroup.add(polyline),itemGroup.add(polygon),itemGroup.add(symbolGroup),updateSymbols(polyline.shape.points,points,symbolGroup,data,idx,!0),data.setItemGraphicEl(idx,itemGroup)}})).update((function(newIdx,oldIdx){var itemGroup=oldData.getItemGraphicEl(oldIdx),polyline=itemGroup.childAt(0),polygon=itemGroup.childAt(1),symbolGroup=itemGroup.childAt(2),target={shape:{points:data.getItemLayout(newIdx)}};target.shape.points&&(updateSymbols(polyline.shape.points,target.shape.points,symbolGroup,data,newIdx,!1),saveOldStyle(polygon),saveOldStyle(polyline),updateProps$1(polyline,target,seriesModel),updateProps$1(polygon,target,seriesModel),data.setItemGraphicEl(newIdx,itemGroup))})).remove((function(idx){group.remove(oldData.getItemGraphicEl(idx))})).execute(),data.eachItemGraphicEl((function(itemGroup,idx){var itemModel=data.getItemModel(idx),polyline=itemGroup.childAt(0),polygon=itemGroup.childAt(1),symbolGroup=itemGroup.childAt(2),itemStyle=data.getItemVisual(idx,"style"),color=itemStyle.fill;group.add(itemGroup),polyline.useStyle(defaults(itemModel.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:color})),setStatesStylesFromModel(polyline,itemModel,"lineStyle"),setStatesStylesFromModel(polygon,itemModel,"areaStyle");var areaStyleModel=itemModel.getModel("areaStyle"),polygonIgnore=areaStyleModel.isEmpty()&&areaStyleModel.parentModel.isEmpty();polygon.ignore=polygonIgnore,each$b(["emphasis","select","blur"],(function(stateName){var stateModel=itemModel.getModel([stateName,"areaStyle"]),stateIgnore=stateModel.isEmpty()&&stateModel.parentModel.isEmpty();polygon.ensureState(stateName).ignore=stateIgnore&&polygonIgnore})),polygon.useStyle(defaults(areaStyleModel.getAreaStyle(),{fill:color,opacity:.7,decal:itemStyle.decal}));var emphasisModel=itemModel.getModel("emphasis"),itemHoverStyle=emphasisModel.getModel("itemStyle").getItemStyle();symbolGroup.eachChild((function(symbolPath){if(symbolPath instanceof ZRImage$1){var pathStyle=symbolPath.style;symbolPath.useStyle(extend({image:pathStyle.image,x:pathStyle.x,y:pathStyle.y,width:pathStyle.width,height:pathStyle.height},itemStyle))}else symbolPath.useStyle(itemStyle),symbolPath.setColor(color),symbolPath.style.strokeNoScale=!0;symbolPath.ensureState("emphasis").style=clone$3(itemHoverStyle);var defaultText=data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx),idx);(null==defaultText||isNaN(defaultText))&&(defaultText=""),setLabelStyle(symbolPath,getLabelStatesModels(itemModel),{labelFetcher:data.hostModel,labelDataIndex:idx,labelDimIndex:symbolPath.__dimIdx,defaultText:defaultText,inheritColor:color,defaultOpacity:itemStyle.opacity})})),toggleHoverEmphasis(itemGroup,emphasisModel.get("focus"),emphasisModel.get("blurScope"),emphasisModel.get("disabled"))})),this._data=data},RadarView.prototype.remove=function(){this.group.removeAll(),this._data=null},RadarView.type="radar",RadarView}(ChartView$1),RadarView$3=RadarView$2,RadarSeriesModel=function(_super){function RadarSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=RadarSeriesModel.type,_this.hasSymbolVisual=!0,_this}return __extends(RadarSeriesModel,_super),RadarSeriesModel.prototype.init=function(option){_super.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider$1(bind$1(this.getData,this),bind$1(this.getRawData,this))},RadarSeriesModel.prototype.getInitialData=function(option,ecModel){return createSeriesDataSimply(this,{generateCoord:"indicator_",generateCoordCount:1/0})},RadarSeriesModel.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){var data=this.getData(),indicatorAxes=this.coordinateSystem.getIndicatorAxes(),name=this.getData().getName(dataIndex),nameToDisplay=""===name?this.name:name,markerColor=retrieveVisualColorForTooltipMarker(this,dataIndex);return createTooltipMarkup("section",{header:nameToDisplay,sortBlocks:!0,blocks:map$1(indicatorAxes,(function(axis){var val=data.get(data.mapDimension(axis.dim),dataIndex);return createTooltipMarkup("nameValue",{markerType:"subItem",markerColor:markerColor,name:axis.name,value:val,sortParam:val})}))})},RadarSeriesModel.prototype.getTooltipPosition=function(dataIndex){if(null!=dataIndex)for(var data_1=this.getData(),coordSys=this.coordinateSystem,values=data_1.getValues(map$1(coordSys.dimensions,(function(dim){return data_1.mapDimension(dim)})),dataIndex),i=0,len=values.length;i<len;i++)if(!isNaN(values[i])){var indicatorAxes=coordSys.getIndicatorAxes();return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]),i)}},RadarSeriesModel.type="series.radar",RadarSeriesModel.dependencies=["radar"],RadarSeriesModel.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},RadarSeriesModel}(SeriesModel$1),RadarSeriesModel$1=RadarSeriesModel,valueAxisDefault=axisDefault.value;function defaultsShow(opt,show){return defaults({show:show},opt)}var RadarModel=function(_super){function RadarModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=RadarModel.type,_this}return __extends(RadarModel,_super),RadarModel.prototype.optionUpdated=function(){var boundaryGap=this.get("boundaryGap"),splitNumber=this.get("splitNumber"),scale=this.get("scale"),axisLine=this.get("axisLine"),axisTick=this.get("axisTick"),axisLabel=this.get("axisLabel"),nameTextStyle=this.get("axisName"),showName=this.get(["axisName","show"]),nameFormatter=this.get(["axisName","formatter"]),nameGap=this.get("axisNameGap"),triggerEvent=this.get("triggerEvent"),indicatorModels=map$1(this.get("indicator")||[],(function(indicatorOpt){null!=indicatorOpt.max&&indicatorOpt.max>0&&!indicatorOpt.min?indicatorOpt.min=0:null!=indicatorOpt.min&&indicatorOpt.min<0&&!indicatorOpt.max&&(indicatorOpt.max=0);var iNameTextStyle=nameTextStyle;null!=indicatorOpt.color&&(iNameTextStyle=defaults({color:indicatorOpt.color},nameTextStyle));var innerIndicatorOpt=merge(clone$3(indicatorOpt),{boundaryGap:boundaryGap,splitNumber:splitNumber,scale:scale,axisLine:axisLine,axisTick:axisTick,axisLabel:axisLabel,name:indicatorOpt.text,showName:showName,nameLocation:"end",nameGap:nameGap,nameTextStyle:iNameTextStyle,triggerEvent:triggerEvent},!1);if(isString(nameFormatter)){var indName=innerIndicatorOpt.name;innerIndicatorOpt.name=nameFormatter.replace("{value}",null!=indName?indName:"")}else isFunction(nameFormatter)&&(innerIndicatorOpt.name=nameFormatter(innerIndicatorOpt.name,innerIndicatorOpt));var model=new Model$1(innerIndicatorOpt,null,this.ecModel);return mixin(model,AxisModelCommonMixin.prototype),model.mainType="radar",model.componentIndex=this.componentIndex,model}),this);this._indicatorModels=indicatorModels},RadarModel.prototype.getIndicatorModels=function(){return this._indicatorModels},RadarModel.type="radar",RadarModel.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:merge({lineStyle:{color:"#bbb"}},valueAxisDefault.axisLine),axisLabel:defaultsShow(valueAxisDefault.axisLabel,!1),axisTick:defaultsShow(valueAxisDefault.axisTick,!1),splitLine:defaultsShow(valueAxisDefault.splitLine,!0),splitArea:defaultsShow(valueAxisDefault.splitArea,!0),indicator:[]},RadarModel}(ComponentModel$1),RadarModel$1=RadarModel,axisBuilderAttrs=["axisLine","axisTickLabel","axisName"],RadarView=function(_super){function RadarView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=RadarView.type,_this}return __extends(RadarView,_super),RadarView.prototype.render=function(radarModel,ecModel,api){this.group.removeAll(),this._buildAxes(radarModel),this._buildSplitLineAndArea(radarModel)},RadarView.prototype._buildAxes=function(radarModel){var radar=radarModel.coordinateSystem;each$b(map$1(radar.getIndicatorAxes(),(function(indicatorAxis){var axisName=indicatorAxis.model.get("showName")?indicatorAxis.name:"";return new AxisBuilder$1(indicatorAxis.model,{axisName:axisName,position:[radar.cx,radar.cy],rotation:indicatorAxis.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(axisBuilder){each$b(axisBuilderAttrs,axisBuilder.add,axisBuilder),this.group.add(axisBuilder.getGroup())}),this)},RadarView.prototype._buildSplitLineAndArea=function(radarModel){var radar=radarModel.coordinateSystem,indicatorAxes=radar.getIndicatorAxes();if(indicatorAxes.length){var shape=radarModel.get("shape"),splitLineModel=radarModel.getModel("splitLine"),splitAreaModel=radarModel.getModel("splitArea"),lineStyleModel=splitLineModel.getModel("lineStyle"),areaStyleModel=splitAreaModel.getModel("areaStyle"),showSplitLine=splitLineModel.get("show"),showSplitArea=splitAreaModel.get("show"),splitLineColors=lineStyleModel.get("color"),splitAreaColors=areaStyleModel.get("color"),splitLineColorsArr=isArray(splitLineColors)?splitLineColors:[splitLineColors],splitAreaColorsArr=isArray(splitAreaColors)?splitAreaColors:[splitAreaColors],splitLines=[],splitAreas=[];if("circle"===shape)for(var ticksRadius=indicatorAxes[0].getTicksCoords(),cx=radar.cx,cy=radar.cy,i=0;i<ticksRadius.length;i++){if(showSplitLine)splitLines[getColorIndex(splitLines,splitLineColorsArr,i)].push(new Circle$1({shape:{cx:cx,cy:cy,r:ticksRadius[i].coord}}));if(showSplitArea&&i<ticksRadius.length-1)splitAreas[getColorIndex(splitAreas,splitAreaColorsArr,i)].push(new Ring$1({shape:{cx:cx,cy:cy,r0:ticksRadius[i].coord,r:ticksRadius[i+1].coord}}))}else{var realSplitNumber_1,axesTicksPoints=map$1(indicatorAxes,(function(indicatorAxis,idx){var ticksCoords=indicatorAxis.getTicksCoords();return realSplitNumber_1=null==realSplitNumber_1?ticksCoords.length-1:Math.min(ticksCoords.length-1,realSplitNumber_1),map$1(ticksCoords,(function(tickCoord){return radar.coordToPoint(tickCoord.coord,idx)}))})),prevPoints=[];for(i=0;i<=realSplitNumber_1;i++){for(var points=[],j=0;j<indicatorAxes.length;j++)points.push(axesTicksPoints[j][i]);if(points[0]?points.push(points[0].slice()):"production"!==process.env.NODE_ENV&&console.error("Can't draw value axis "+i),showSplitLine)splitLines[getColorIndex(splitLines,splitLineColorsArr,i)].push(new Polyline$1({shape:{points:points}}));if(showSplitArea&&prevPoints)splitAreas[getColorIndex(splitAreas,splitAreaColorsArr,i-1)].push(new Polygon$1({shape:{points:points.concat(prevPoints)}}));prevPoints=points.slice().reverse()}}var lineStyle=lineStyleModel.getLineStyle(),areaStyle=areaStyleModel.getAreaStyle();each$b(splitAreas,(function(splitAreas,idx){this.group.add(mergePath(splitAreas,{style:defaults({stroke:"none",fill:splitAreaColorsArr[idx%splitAreaColorsArr.length]},areaStyle),silent:!0}))}),this),each$b(splitLines,(function(splitLines,idx){this.group.add(mergePath(splitLines,{style:defaults({fill:"none",stroke:splitLineColorsArr[idx%splitLineColorsArr.length]},lineStyle),silent:!0}))}),this)}function getColorIndex(areaOrLine,areaOrLineColorList,idx){var colorIndex=idx%areaOrLineColorList.length;return areaOrLine[colorIndex]=areaOrLine[colorIndex]||[],colorIndex}},RadarView.type="radar",RadarView}(ComponentView$1),RadarView$1=RadarView,IndicatorAxis=function(_super){function IndicatorAxis(dim,scale,radiusExtent){var _this=_super.call(this,dim,scale,radiusExtent)||this;return _this.type="value",_this.angle=0,_this.name="",_this}return __extends(IndicatorAxis,_super),IndicatorAxis}(Axis$1),IndicatorAxis$1=IndicatorAxis,Radar=function(){function Radar(radarModel,ecModel,api){this.dimensions=[],this._model=radarModel,this._indicatorAxes=map$1(radarModel.getIndicatorModels(),(function(indicatorModel,idx){var dim="indicator_"+idx,indicatorAxis=new IndicatorAxis$1(dim,new IntervalScale$1);return indicatorAxis.name=indicatorModel.get("name"),indicatorAxis.model=indicatorModel,indicatorModel.axis=indicatorAxis,this.dimensions.push(dim),indicatorAxis}),this),this.resize(radarModel,api)}return Radar.prototype.getIndicatorAxes=function(){return this._indicatorAxes},Radar.prototype.dataToPoint=function(value,indicatorIndex){var indicatorAxis=this._indicatorAxes[indicatorIndex];return this.coordToPoint(indicatorAxis.dataToCoord(value),indicatorIndex)},Radar.prototype.coordToPoint=function(coord,indicatorIndex){var angle=this._indicatorAxes[indicatorIndex].angle;return[this.cx+coord*Math.cos(angle),this.cy-coord*Math.sin(angle)]},Radar.prototype.pointToData=function(pt){var dx=pt[0]-this.cx,dy=pt[1]-this.cy,radius=Math.sqrt(dx*dx+dy*dy);dx/=radius,dy/=radius;for(var closestAxis,radian=Math.atan2(-dy,dx),minRadianDiff=1/0,closestAxisIdx=-1,i=0;i<this._indicatorAxes.length;i++){var indicatorAxis=this._indicatorAxes[i],diff=Math.abs(radian-indicatorAxis.angle);diff<minRadianDiff&&(closestAxis=indicatorAxis,closestAxisIdx=i,minRadianDiff=diff)}return[closestAxisIdx,+(closestAxis&&closestAxis.coordToData(radius))]},Radar.prototype.resize=function(radarModel,api){var center=radarModel.get("center"),viewWidth=api.getWidth(),viewHeight=api.getHeight(),viewSize=Math.min(viewWidth,viewHeight)/2;this.cx=parsePercent(center[0],viewWidth),this.cy=parsePercent(center[1],viewHeight),this.startAngle=radarModel.get("startAngle")*Math.PI/180;var radius=radarModel.get("radius");(isString(radius)||isNumber(radius))&&(radius=[0,radius]),this.r0=parsePercent(radius[0],viewSize),this.r=parsePercent(radius[1],viewSize),each$b(this._indicatorAxes,(function(indicatorAxis,idx){indicatorAxis.setExtent(this.r0,this.r);var angle=this.startAngle+idx*Math.PI*2/this._indicatorAxes.length;angle=Math.atan2(Math.sin(angle),Math.cos(angle)),indicatorAxis.angle=angle}),this)},Radar.prototype.update=function(ecModel,api){var indicatorAxes=this._indicatorAxes,radarModel=this._model;each$b(indicatorAxes,(function(indicatorAxis){indicatorAxis.scale.setExtent(1/0,-1/0)})),ecModel.eachSeriesByType("radar",(function(radarSeries,idx){if("radar"===radarSeries.get("coordinateSystem")&&ecModel.getComponent("radar",radarSeries.get("radarIndex"))===radarModel){var data=radarSeries.getData();each$b(indicatorAxes,(function(indicatorAxis){indicatorAxis.scale.unionExtentFromData(data,data.mapDimension(indicatorAxis.dim))}))}}),this);var splitNumber=radarModel.get("splitNumber"),dummyScale=new IntervalScale$1;dummyScale.setExtent(0,splitNumber),dummyScale.setInterval(1),each$b(indicatorAxes,(function(indicatorAxis,idx){alignScaleTicks(indicatorAxis.scale,indicatorAxis.model,dummyScale)}))},Radar.prototype.convertToPixel=function(ecModel,finder,value){return console.warn("Not implemented."),null},Radar.prototype.convertFromPixel=function(ecModel,finder,pixel){return console.warn("Not implemented."),null},Radar.prototype.containPoint=function(point){return console.warn("Not implemented."),!1},Radar.create=function(ecModel,api){var radarList=[];return ecModel.eachComponent("radar",(function(radarModel){var radar=new Radar(radarModel,ecModel,api);radarList.push(radar),radarModel.coordinateSystem=radar})),ecModel.eachSeriesByType("radar",(function(radarSeries){"radar"===radarSeries.get("coordinateSystem")&&(radarSeries.coordinateSystem=radarList[radarSeries.get("radarIndex")||0])})),radarList},Radar.dimensions=[],Radar}(),Radar$1=Radar;function install$t(registers){registers.registerCoordinateSystem("radar",Radar$1),registers.registerComponentModel(RadarModel$1),registers.registerComponentView(RadarView$1),registers.registerVisual({seriesType:"radar",reset:function(seriesModel){var data=seriesModel.getData();data.each((function(idx){data.setItemVisual(idx,"legendIcon","roundRect")})),data.setVisual("legendIcon","roundRect")}})}var ATTR="\0_ec_interaction_mutex";function isTaken(zr,resourceKey){return!!getStore(zr)[resourceKey]}function getStore(zr){return zr[ATTR]||(zr[ATTR]={})}registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},noop$1);var RoamController=function(_super){function RoamController(zr){var _this=_super.call(this)||this;_this._zr=zr;var mousedownHandler=bind$1(_this._mousedownHandler,_this),mousemoveHandler=bind$1(_this._mousemoveHandler,_this),mouseupHandler=bind$1(_this._mouseupHandler,_this),mousewheelHandler=bind$1(_this._mousewheelHandler,_this),pinchHandler=bind$1(_this._pinchHandler,_this);return _this.enable=function(controlType,opt){this.disable(),this._opt=defaults(clone$3(opt)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==controlType&&(controlType=!0),!0!==controlType&&"move"!==controlType&&"pan"!==controlType||(zr.on("mousedown",mousedownHandler),zr.on("mousemove",mousemoveHandler),zr.on("mouseup",mouseupHandler)),!0!==controlType&&"scale"!==controlType&&"zoom"!==controlType||(zr.on("mousewheel",mousewheelHandler),zr.on("pinch",pinchHandler))},_this.disable=function(){zr.off("mousedown",mousedownHandler),zr.off("mousemove",mousemoveHandler),zr.off("mouseup",mouseupHandler),zr.off("mousewheel",mousewheelHandler),zr.off("pinch",pinchHandler)},_this}return __extends(RoamController,_super),RoamController.prototype.isDragging=function(){return this._dragging},RoamController.prototype.isPinching=function(){return this._pinching},RoamController.prototype.setPointerChecker=function(pointerChecker){this.pointerChecker=pointerChecker},RoamController.prototype.dispose=function(){this.disable()},RoamController.prototype._mousedownHandler=function(e){if(!isMiddleOrRightButtonOnMouseUpDown(e)){for(var el=e.target;el;){if(el.draggable)return;el=el.__hostTarget||el.parent}var x=e.offsetX,y=e.offsetY;this.pointerChecker&&this.pointerChecker(e,x,y)&&(this._x=x,this._y=y,this._dragging=!0)}},RoamController.prototype._mousemoveHandler=function(e){if(this._dragging&&isAvailableBehavior("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!isTaken(this._zr,"globalPan")){var x=e.offsetX,y=e.offsetY,oldX=this._x,oldY=this._y,dx=x-oldX,dy=y-oldY;this._x=x,this._y=y,this._opt.preventDefaultMouseMove&&stop(e.event),trigger$1(this,"pan","moveOnMouseMove",e,{dx:dx,dy:dy,oldX:oldX,oldY:oldY,newX:x,newY:y,isAvailableBehavior:null})}},RoamController.prototype._mouseupHandler=function(e){isMiddleOrRightButtonOnMouseUpDown(e)||(this._dragging=!1)},RoamController.prototype._mousewheelHandler=function(e){var shouldZoom=isAvailableBehavior("zoomOnMouseWheel",e,this._opt),shouldMove=isAvailableBehavior("moveOnMouseWheel",e,this._opt),wheelDelta=e.wheelDelta,absWheelDeltaDelta=Math.abs(wheelDelta),originX=e.offsetX,originY=e.offsetY;if(0!==wheelDelta&&(shouldZoom||shouldMove)){if(shouldZoom){var factor=absWheelDeltaDelta>3?1.4:absWheelDeltaDelta>1?1.2:1.1;checkPointerAndTrigger(this,"zoom","zoomOnMouseWheel",e,{scale:wheelDelta>0?factor:1/factor,originX:originX,originY:originY,isAvailableBehavior:null})}if(shouldMove){var absDelta=Math.abs(wheelDelta);checkPointerAndTrigger(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(wheelDelta>0?1:-1)*(absDelta>3?.4:absDelta>1?.15:.05),originX:originX,originY:originY,isAvailableBehavior:null})}}},RoamController.prototype._pinchHandler=function(e){isTaken(this._zr,"globalPan")||checkPointerAndTrigger(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},RoamController}(Eventful$1);function checkPointerAndTrigger(controller,eventName,behaviorToCheck,e,contollerEvent){controller.pointerChecker&&controller.pointerChecker(e,contollerEvent.originX,contollerEvent.originY)&&(stop(e.event),trigger$1(controller,eventName,behaviorToCheck,e,contollerEvent))}function trigger$1(controller,eventName,behaviorToCheck,e,contollerEvent){contollerEvent.isAvailableBehavior=bind$1(isAvailableBehavior,null,behaviorToCheck,e),controller.trigger(eventName,contollerEvent)}function isAvailableBehavior(behaviorToCheck,e,settings){var setting=settings[behaviorToCheck];return!behaviorToCheck||setting&&(!isString(setting)||e.event[setting+"Key"])}var RoamController$1=RoamController;function updateViewOnPan(controllerHost,dx,dy){var target=controllerHost.target;target.x+=dx,target.y+=dy,target.dirty()}function updateViewOnZoom(controllerHost,zoomDelta,zoomX,zoomY){var target=controllerHost.target,zoomLimit=controllerHost.zoomLimit,newZoom=controllerHost.zoom=controllerHost.zoom||1;if(newZoom*=zoomDelta,zoomLimit){var zoomMin=zoomLimit.min||0,zoomMax=zoomLimit.max||1/0;newZoom=Math.max(Math.min(zoomMax,newZoom),zoomMin)}var zoomScale=newZoom/controllerHost.zoom;controllerHost.zoom=newZoom,target.x-=(zoomX-target.x)*(zoomScale-1),target.y-=(zoomY-target.y)*(zoomScale-1),target.scaleX*=zoomScale,target.scaleY*=zoomScale,target.dirty()}var IRRELEVANT_EXCLUDES={axisPointer:1,tooltip:1,brush:1};function onIrrelevantElement(e,api,targetCoordSysModel){var model=api.getComponentByElement(e.topTarget),coordSys=model&&model.coordinateSystem;return model&&model!==targetCoordSysModel&&!IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType)&&coordSys&&coordSys.model!==targetCoordSysModel}var v2ApplyTransform=applyTransform$1,View=function(_super){function View(name){var _this=_super.call(this)||this;return _this.type="view",_this.dimensions=["x","y"],_this._roamTransformable=new Transformable$1,_this._rawTransformable=new Transformable$1,_this.name=name,_this}return __extends(View,_super),View.prototype.setBoundingRect=function(x,y,width,height){return this._rect=new BoundingRect$1(x,y,width,height),this._rect},View.prototype.getBoundingRect=function(){return this._rect},View.prototype.setViewRect=function(x,y,width,height){this._transformTo(x,y,width,height),this._viewRect=new BoundingRect$1(x,y,width,height)},View.prototype._transformTo=function(x,y,width,height){var rect=this.getBoundingRect(),rawTransform=this._rawTransformable;rawTransform.transform=rect.calculateTransform(new BoundingRect$1(x,y,width,height));var rawParent=rawTransform.parent;rawTransform.parent=null,rawTransform.decomposeTransform(),rawTransform.parent=rawParent,this._updateTransform()},View.prototype.setCenter=function(centerCoord,api){centerCoord&&(this._center=[parsePercent(centerCoord[0],api.getWidth()),parsePercent(centerCoord[1],api.getHeight())],this._updateCenterAndZoom())},View.prototype.setZoom=function(zoom){zoom=zoom||1;var zoomLimit=this.zoomLimit;zoomLimit&&(null!=zoomLimit.max&&(zoom=Math.min(zoomLimit.max,zoom)),null!=zoomLimit.min&&(zoom=Math.max(zoomLimit.min,zoom))),this._zoom=zoom,this._updateCenterAndZoom()},View.prototype.getDefaultCenter=function(){var rawRect=this.getBoundingRect();return[rawRect.x+rawRect.width/2,rawRect.y+rawRect.height/2]},View.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},View.prototype.getZoom=function(){return this._zoom||1},View.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},View.prototype._updateCenterAndZoom=function(){var rawTransformMatrix=this._rawTransformable.getLocalTransform(),roamTransform=this._roamTransformable,defaultCenter=this.getDefaultCenter(),center=this.getCenter(),zoom=this.getZoom();center=applyTransform$1([],center,rawTransformMatrix),defaultCenter=applyTransform$1([],defaultCenter,rawTransformMatrix),roamTransform.originX=center[0],roamTransform.originY=center[1],roamTransform.x=defaultCenter[0]-center[0],roamTransform.y=defaultCenter[1]-center[1],roamTransform.scaleX=roamTransform.scaleY=zoom,this._updateTransform()},View.prototype._updateTransform=function(){var roamTransformable=this._roamTransformable,rawTransformable=this._rawTransformable;rawTransformable.parent=roamTransformable,roamTransformable.updateTransform(),rawTransformable.updateTransform(),copy(this.transform||(this.transform=[]),rawTransformable.transform||[1,0,0,1,0,0]),this._rawTransform=rawTransformable.getLocalTransform(),this.invTransform=this.invTransform||[],invert(this.invTransform,this.transform),this.decomposeTransform()},View.prototype.getTransformInfo=function(){var rawTransformable=this._rawTransformable,roamTransformable=this._roamTransformable,dummyTransformable=new Transformable$1;return dummyTransformable.transform=roamTransformable.transform,dummyTransformable.decomposeTransform(),{roam:{x:dummyTransformable.x,y:dummyTransformable.y,scaleX:dummyTransformable.scaleX,scaleY:dummyTransformable.scaleY},raw:{x:rawTransformable.x,y:rawTransformable.y,scaleX:rawTransformable.scaleX,scaleY:rawTransformable.scaleY}}},View.prototype.getViewRect=function(){return this._viewRect},View.prototype.getViewRectAfterRoam=function(){var rect=this.getBoundingRect().clone();return rect.applyTransform(this.transform),rect},View.prototype.dataToPoint=function(data,noRoam,out){var transform=noRoam?this._rawTransform:this.transform;return out=out||[],transform?v2ApplyTransform(out,data,transform):copy$1(out,data)},View.prototype.pointToData=function(point){var invTransform=this.invTransform;return invTransform?v2ApplyTransform([],point,invTransform):[point[0],point[1]]},View.prototype.convertToPixel=function(ecModel,finder,value){var coordSys=getCoordSys(finder);return coordSys===this?coordSys.dataToPoint(value):null},View.prototype.convertFromPixel=function(ecModel,finder,pixel){var coordSys=getCoordSys(finder);return coordSys===this?coordSys.pointToData(pixel):null},View.prototype.containPoint=function(point){return this.getViewRectAfterRoam().contain(point[0],point[1])},View.dimensions=["x","y"],View}(Transformable$1);function getCoordSys(finder){var seriesModel=finder.seriesModel;return seriesModel?seriesModel.coordinateSystem:null}var View$1=View;function getCenterCoord(view,point){return view.pointToProjected?view.pointToProjected(point):view.pointToData(point)}function updateCenterAndZoom(view,payload,zoomLimit,api){var previousZoom=view.getZoom(),center=view.getCenter(),zoom=payload.zoom,point=view.projectedToPoint?view.projectedToPoint(center):view.dataToPoint(center);if(null!=payload.dx&&null!=payload.dy&&(point[0]-=payload.dx,point[1]-=payload.dy,view.setCenter(getCenterCoord(view,point),api)),null!=zoom){if(zoomLimit){var zoomMin=zoomLimit.min||0,zoomMax=zoomLimit.max||1/0;zoom=Math.max(Math.min(previousZoom*zoom,zoomMax),zoomMin)/previousZoom}view.scaleX*=zoom,view.scaleY*=zoom;var fixX=(payload.originX-view.x)*(zoom-1),fixY=(payload.originY-view.y)*(zoom-1);view.x-=fixX,view.y-=fixY,view.updateTransform(),view.setCenter(getCenterCoord(view,point),api),view.setZoom(zoom*previousZoom)}return{center:view.getCenter(),zoom:view.getZoom()}}function firstWalk(node,separation){var children=node.isExpand?node.children:[],siblings=node.parentNode.children,subtreeW=node.hierNode.i?siblings[node.hierNode.i-1]:null;if(children.length){!function(node){var children=node.children,n=children.length,shift=0,change=0;for(;--n>=0;){var child=children[n];child.hierNode.prelim+=shift,child.hierNode.modifier+=shift,change+=child.hierNode.change,shift+=child.hierNode.shift+change}}(node);var midPoint=(children[0].hierNode.prelim+children[children.length-1].hierNode.prelim)/2;subtreeW?(node.hierNode.prelim=subtreeW.hierNode.prelim+separation(node,subtreeW),node.hierNode.modifier=node.hierNode.prelim-midPoint):node.hierNode.prelim=midPoint}else subtreeW&&(node.hierNode.prelim=subtreeW.hierNode.prelim+separation(node,subtreeW));node.parentNode.hierNode.defaultAncestor=function(subtreeV,subtreeW,ancestor,separation){if(subtreeW){for(var nodeOutRight=subtreeV,nodeInRight=subtreeV,nodeOutLeft=nodeInRight.parentNode.children[0],nodeInLeft=subtreeW,sumOutRight=nodeOutRight.hierNode.modifier,sumInRight=nodeInRight.hierNode.modifier,sumOutLeft=nodeOutLeft.hierNode.modifier,sumInLeft=nodeInLeft.hierNode.modifier;nodeInLeft=nextRight(nodeInLeft),nodeInRight=nextLeft(nodeInRight),nodeInLeft&&nodeInRight;){nodeOutRight=nextRight(nodeOutRight),nodeOutLeft=nextLeft(nodeOutLeft),nodeOutRight.hierNode.ancestor=subtreeV;var shift=nodeInLeft.hierNode.prelim+sumInLeft-nodeInRight.hierNode.prelim-sumInRight+separation(nodeInLeft,nodeInRight);shift>0&&(moveSubtree(nextAncestor(nodeInLeft,subtreeV,ancestor),subtreeV,shift),sumInRight+=shift,sumOutRight+=shift),sumInLeft+=nodeInLeft.hierNode.modifier,sumInRight+=nodeInRight.hierNode.modifier,sumOutRight+=nodeOutRight.hierNode.modifier,sumOutLeft+=nodeOutLeft.hierNode.modifier}nodeInLeft&&!nextRight(nodeOutRight)&&(nodeOutRight.hierNode.thread=nodeInLeft,nodeOutRight.hierNode.modifier+=sumInLeft-sumOutRight),nodeInRight&&!nextLeft(nodeOutLeft)&&(nodeOutLeft.hierNode.thread=nodeInRight,nodeOutLeft.hierNode.modifier+=sumInRight-sumOutLeft,ancestor=subtreeV)}return ancestor}(node,subtreeW,node.parentNode.hierNode.defaultAncestor||siblings[0],separation)}function secondWalk(node){var nodeX=node.hierNode.prelim+node.parentNode.hierNode.modifier;node.setLayout({x:nodeX},!0),node.hierNode.modifier+=node.parentNode.hierNode.modifier}function separation(cb){return arguments.length?cb:defaultSeparation}function radialCoordinate(rad,r){return rad-=Math.PI/2,{x:r*Math.cos(rad),y:r*Math.sin(rad)}}function nextRight(node){var children=node.children;return children.length&&node.isExpand?children[children.length-1]:node.hierNode.thread}function nextLeft(node){var children=node.children;return children.length&&node.isExpand?children[0]:node.hierNode.thread}function nextAncestor(nodeInLeft,node,ancestor){return nodeInLeft.hierNode.ancestor.parentNode===node.parentNode?nodeInLeft.hierNode.ancestor:ancestor}function moveSubtree(wl,wr,shift){var change=shift/(wr.hierNode.i-wl.hierNode.i);wr.hierNode.change-=change,wr.hierNode.shift+=shift,wr.hierNode.modifier+=shift,wr.hierNode.prelim+=shift,wl.hierNode.change+=change}function defaultSeparation(node1,node2){return node1.parentNode===node2.parentNode?1:2}var TreeEdgeShape=function(){this.parentPoint=[],this.childPoints=[]},TreePath=function(_super){function TreePath(opts){return _super.call(this,opts)||this}return __extends(TreePath,_super),TreePath.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},TreePath.prototype.getDefaultShape=function(){return new TreeEdgeShape},TreePath.prototype.buildPath=function(ctx,shape){var childPoints=shape.childPoints,childLen=childPoints.length,parentPoint=shape.parentPoint,firstChildPos=childPoints[0],lastChildPos=childPoints[childLen-1];if(1===childLen)return ctx.moveTo(parentPoint[0],parentPoint[1]),void ctx.lineTo(firstChildPos[0],firstChildPos[1]);var orient=shape.orient,forkDim="TB"===orient||"BT"===orient?0:1,otherDim=1-forkDim,forkPosition=parsePercent(shape.forkPosition,1),tmpPoint=[];tmpPoint[forkDim]=parentPoint[forkDim],tmpPoint[otherDim]=parentPoint[otherDim]+(lastChildPos[otherDim]-parentPoint[otherDim])*forkPosition,ctx.moveTo(parentPoint[0],parentPoint[1]),ctx.lineTo(tmpPoint[0],tmpPoint[1]),ctx.moveTo(firstChildPos[0],firstChildPos[1]),tmpPoint[forkDim]=firstChildPos[forkDim],ctx.lineTo(tmpPoint[0],tmpPoint[1]),tmpPoint[forkDim]=lastChildPos[forkDim],ctx.lineTo(tmpPoint[0],tmpPoint[1]),ctx.lineTo(lastChildPos[0],lastChildPos[1]);for(var i=1;i<childLen-1;i++){var point=childPoints[i];ctx.moveTo(point[0],point[1]),tmpPoint[forkDim]=point[forkDim],ctx.lineTo(tmpPoint[0],tmpPoint[1])}},TreePath}(Path$1),TreeView=function(_super){function TreeView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=TreeView.type,_this._mainGroup=new Group$4,_this}return __extends(TreeView,_super),TreeView.prototype.init=function(ecModel,api){this._controller=new RoamController$1(api.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},TreeView.prototype.render=function(seriesModel,ecModel,api){var data=seriesModel.getData(),layoutInfo=seriesModel.layoutInfo,group=this._mainGroup;"radial"===seriesModel.get("layout")?(group.x=layoutInfo.x+layoutInfo.width/2,group.y=layoutInfo.y+layoutInfo.height/2):(group.x=layoutInfo.x,group.y=layoutInfo.y),this._updateViewCoordSys(seriesModel,api),this._updateController(seriesModel,ecModel,api);var oldData=this._data;data.diff(oldData).add((function(newIdx){symbolNeedsDraw(data,newIdx)&&updateNode(data,newIdx,null,group,seriesModel)})).update((function(newIdx,oldIdx){var symbolEl=oldData.getItemGraphicEl(oldIdx);symbolNeedsDraw(data,newIdx)?updateNode(data,newIdx,symbolEl,group,seriesModel):symbolEl&&removeNode(oldData,oldIdx,symbolEl,group,seriesModel)})).remove((function(oldIdx){var symbolEl=oldData.getItemGraphicEl(oldIdx);symbolEl&&removeNode(oldData,oldIdx,symbolEl,group,seriesModel)})).execute(),this._nodeScaleRatio=seriesModel.get("nodeScaleRatio"),this._updateNodeAndLinkScale(seriesModel),!0===seriesModel.get("expandAndCollapse")&&data.eachItemGraphicEl((function(el,dataIndex){el.off("click").on("click",(function(){api.dispatchAction({type:"treeExpandAndCollapse",seriesId:seriesModel.id,dataIndex:dataIndex})}))})),this._data=data},TreeView.prototype._updateViewCoordSys=function(seriesModel,api){var data=seriesModel.getData(),points=[];data.each((function(idx){var layout=data.getItemLayout(idx);!layout||isNaN(layout.x)||isNaN(layout.y)||points.push([+layout.x,+layout.y])}));var min=[],max=[];fromPoints(points,min,max);var oldMin=this._min,oldMax=this._max;max[0]-min[0]==0&&(min[0]=oldMin?oldMin[0]:min[0]-1,max[0]=oldMax?oldMax[0]:max[0]+1),max[1]-min[1]==0&&(min[1]=oldMin?oldMin[1]:min[1]-1,max[1]=oldMax?oldMax[1]:max[1]+1);var viewCoordSys=seriesModel.coordinateSystem=new View$1;viewCoordSys.zoomLimit=seriesModel.get("scaleLimit"),viewCoordSys.setBoundingRect(min[0],min[1],max[0]-min[0],max[1]-min[1]),viewCoordSys.setCenter(seriesModel.get("center"),api),viewCoordSys.setZoom(seriesModel.get("zoom")),this.group.attr({x:viewCoordSys.x,y:viewCoordSys.y,scaleX:viewCoordSys.scaleX,scaleY:viewCoordSys.scaleY}),this._min=min,this._max=max},TreeView.prototype._updateController=function(seriesModel,ecModel,api){var _this=this,controller=this._controller,controllerHost=this._controllerHost,group=this.group;controller.setPointerChecker((function(e,x,y){var rect=group.getBoundingRect();return rect.applyTransform(group.transform),rect.contain(x,y)&&!onIrrelevantElement(e,api,seriesModel)})),controller.enable(seriesModel.get("roam")),controllerHost.zoomLimit=seriesModel.get("scaleLimit"),controllerHost.zoom=seriesModel.coordinateSystem.getZoom(),controller.off("pan").off("zoom").on("pan",(function(e){updateViewOnPan(controllerHost,e.dx,e.dy),api.dispatchAction({seriesId:seriesModel.id,type:"treeRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){updateViewOnZoom(controllerHost,e.scale,e.originX,e.originY),api.dispatchAction({seriesId:seriesModel.id,type:"treeRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),_this._updateNodeAndLinkScale(seriesModel),api.updateLabelLayout()}))},TreeView.prototype._updateNodeAndLinkScale=function(seriesModel){var data=seriesModel.getData(),nodeScale=this._getNodeGlobalScale(seriesModel);data.eachItemGraphicEl((function(el,idx){el.setSymbolScale(nodeScale)}))},TreeView.prototype._getNodeGlobalScale=function(seriesModel){var coordSys=seriesModel.coordinateSystem;if("view"!==coordSys.type)return 1;var nodeScaleRatio=this._nodeScaleRatio,groupZoom=coordSys.scaleX||1;return((coordSys.getZoom()-1)*nodeScaleRatio+1)/groupZoom},TreeView.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},TreeView.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},TreeView.type="tree",TreeView}(ChartView$1);function symbolNeedsDraw(data,dataIndex){var layout=data.getItemLayout(dataIndex);return layout&&!isNaN(layout.x)&&!isNaN(layout.y)}function updateNode(data,dataIndex,symbolEl,group,seriesModel){var isInit=!symbolEl,node=data.tree.getNodeByDataIndex(dataIndex),itemModel=node.getModel(),visualColor=node.getVisual("style").fill,symbolInnerColor=!1===node.isExpand&&0!==node.children.length?visualColor:"#fff",virtualRoot=data.tree.root,source=node.parentNode===virtualRoot?node:node.parentNode||node,sourceSymbolEl=data.getItemGraphicEl(source.dataIndex),sourceLayout=source.getLayout(),sourceOldLayout=sourceSymbolEl?{x:sourceSymbolEl.__oldX,y:sourceSymbolEl.__oldY,rawX:sourceSymbolEl.__radialOldRawX,rawY:sourceSymbolEl.__radialOldRawY}:sourceLayout,targetLayout=node.getLayout();isInit?((symbolEl=new SymbolClz(data,dataIndex,null,{symbolInnerColor:symbolInnerColor,useNameLabel:!0})).x=sourceOldLayout.x,symbolEl.y=sourceOldLayout.y):symbolEl.updateData(data,dataIndex,null,{symbolInnerColor:symbolInnerColor,useNameLabel:!0}),symbolEl.__radialOldRawX=symbolEl.__radialRawX,symbolEl.__radialOldRawY=symbolEl.__radialRawY,symbolEl.__radialRawX=targetLayout.rawX,symbolEl.__radialRawY=targetLayout.rawY,group.add(symbolEl),data.setItemGraphicEl(dataIndex,symbolEl),symbolEl.__oldX=symbolEl.x,symbolEl.__oldY=symbolEl.y,updateProps$1(symbolEl,{x:targetLayout.x,y:targetLayout.y},seriesModel);var symbolPath=symbolEl.getSymbolPath();if("radial"===seriesModel.get("layout")){var realRoot=virtualRoot.children[0],rootLayout=realRoot.getLayout(),length_1=realRoot.children.length,rad=void 0,isLeft=void 0;if(targetLayout.x===rootLayout.x&&!0===node.isExpand&&realRoot.children.length){var center={x:(realRoot.children[0].getLayout().x+realRoot.children[length_1-1].getLayout().x)/2,y:(realRoot.children[0].getLayout().y+realRoot.children[length_1-1].getLayout().y)/2};(rad=Math.atan2(center.y-rootLayout.y,center.x-rootLayout.x))<0&&(rad=2*Math.PI+rad),(isLeft=center.x<rootLayout.x)&&(rad-=Math.PI)}else(rad=Math.atan2(targetLayout.y-rootLayout.y,targetLayout.x-rootLayout.x))<0&&(rad=2*Math.PI+rad),0===node.children.length||0!==node.children.length&&!1===node.isExpand?(isLeft=targetLayout.x<rootLayout.x)&&(rad-=Math.PI):(isLeft=targetLayout.x>rootLayout.x)||(rad-=Math.PI);var textPosition=isLeft?"left":"right",normalLabelModel=itemModel.getModel("label"),rotate=normalLabelModel.get("rotate"),labelRotateRadian=rotate*(Math.PI/180),textContent=symbolPath.getTextContent();textContent&&(symbolPath.setTextConfig({position:normalLabelModel.get("position")||textPosition,rotation:null==rotate?-rad:labelRotateRadian,origin:"center"}),textContent.setStyle("verticalAlign","middle"))}var focus=itemModel.get(["emphasis","focus"]),focusDataIndices="relative"===focus?concatArray(node.getAncestorsIndices(),node.getDescendantIndices()):"ancestor"===focus?node.getAncestorsIndices():"descendant"===focus?node.getDescendantIndices():null;focusDataIndices&&(getECData(symbolEl).focus=focusDataIndices),function(seriesModel,node,virtualRoot,symbolEl,sourceOldLayout,sourceLayout,targetLayout,group){var itemModel=node.getModel(),edgeShape=seriesModel.get("edgeShape"),layout=seriesModel.get("layout"),orient=seriesModel.getOrient(),curvature=seriesModel.get(["lineStyle","curveness"]),edgeForkPosition=seriesModel.get("edgeForkPosition"),lineStyle=itemModel.getModel("lineStyle").getLineStyle(),edge=symbolEl.__edge;if("curve"===edgeShape)node.parentNode&&node.parentNode!==virtualRoot&&(edge||(edge=symbolEl.__edge=new BezierCurve$1({shape:getEdgeShape(layout,orient,curvature,sourceOldLayout,sourceOldLayout)})),updateProps$1(edge,{shape:getEdgeShape(layout,orient,curvature,sourceLayout,targetLayout)},seriesModel));else if("polyline"===edgeShape)if("orthogonal"===layout){if(node!==virtualRoot&&node.children&&0!==node.children.length&&!0===node.isExpand){for(var children=node.children,childPoints=[],i=0;i<children.length;i++){var childLayout=children[i].getLayout();childPoints.push([childLayout.x,childLayout.y])}edge||(edge=symbolEl.__edge=new TreePath({shape:{parentPoint:[targetLayout.x,targetLayout.y],childPoints:[[targetLayout.x,targetLayout.y]],orient:orient,forkPosition:edgeForkPosition}})),updateProps$1(edge,{shape:{parentPoint:[targetLayout.x,targetLayout.y],childPoints:childPoints}},seriesModel)}}else if("production"!==process.env.NODE_ENV)throw new Error("The polyline edgeShape can only be used in orthogonal layout");edge&&("polyline"!==edgeShape||node.isExpand)&&(edge.useStyle(defaults({strokeNoScale:!0,fill:null},lineStyle)),setStatesStylesFromModel(edge,itemModel,"lineStyle"),setDefaultStateProxy(edge),group.add(edge))}(seriesModel,node,virtualRoot,symbolEl,sourceOldLayout,sourceLayout,targetLayout,group),symbolEl.__edge&&(symbolEl.onHoverStateChange=function(toState){if("blur"!==toState){var parentEl=node.parentNode&&data.getItemGraphicEl(node.parentNode.dataIndex);parentEl&&1===parentEl.hoverState||setStatesFlag(symbolEl.__edge,toState)}})}function removeNodeEdge(node,data,group,seriesModel,removeAnimationOpt){var _a=getSourceNode(data.tree.root,node),source=_a.source,sourceLayout=_a.sourceLayout,symbolEl=data.getItemGraphicEl(node.dataIndex);if(symbolEl){var sourceEdge=data.getItemGraphicEl(source.dataIndex).__edge,edge=symbolEl.__edge||(!1===source.isExpand||1===source.children.length?sourceEdge:void 0),edgeShape=seriesModel.get("edgeShape"),layoutOpt=seriesModel.get("layout"),orient=seriesModel.get("orient"),curvature=seriesModel.get(["lineStyle","curveness"]);edge&&("curve"===edgeShape?removeElement(edge,{shape:getEdgeShape(layoutOpt,orient,curvature,sourceLayout,sourceLayout),style:{opacity:0}},seriesModel,{cb:function(){group.remove(edge)},removeOpt:removeAnimationOpt}):"polyline"===edgeShape&&"orthogonal"===seriesModel.get("layout")&&removeElement(edge,{shape:{parentPoint:[sourceLayout.x,sourceLayout.y],childPoints:[[sourceLayout.x,sourceLayout.y]]},style:{opacity:0}},seriesModel,{cb:function(){group.remove(edge)},removeOpt:removeAnimationOpt}))}}function getSourceNode(virtualRoot,node){for(var sourceLayout,source=node.parentNode===virtualRoot?node:node.parentNode||node;null==(sourceLayout=source.getLayout());)source=source.parentNode===virtualRoot?source:source.parentNode||source;return{source:source,sourceLayout:sourceLayout}}function removeNode(data,dataIndex,symbolEl,group,seriesModel){var node=data.tree.getNodeByDataIndex(dataIndex),sourceLayout=getSourceNode(data.tree.root,node).sourceLayout,removeAnimationOpt={duration:seriesModel.get("animationDurationUpdate"),easing:seriesModel.get("animationEasingUpdate")};removeElement(symbolEl,{x:sourceLayout.x+1,y:sourceLayout.y+1},seriesModel,{cb:function(){group.remove(symbolEl),data.setItemGraphicEl(dataIndex,null)},removeOpt:removeAnimationOpt}),symbolEl.fadeOut(null,data.hostModel,{fadeLabel:!0,animation:removeAnimationOpt}),node.children.forEach((function(childNode){removeNodeEdge(childNode,data,group,seriesModel,removeAnimationOpt)})),removeNodeEdge(node,data,group,seriesModel,removeAnimationOpt)}function getEdgeShape(layoutOpt,orient,curvature,sourceLayout,targetLayout){var cpx1,cpy1,cpx2,cpy2,x1,x2,y1,y2;if("radial"===layoutOpt){x1=sourceLayout.rawX,y1=sourceLayout.rawY,x2=targetLayout.rawX,y2=targetLayout.rawY;var radialCoor1=radialCoordinate(x1,y1),radialCoor2=radialCoordinate(x1,y1+(y2-y1)*curvature),radialCoor3=radialCoordinate(x2,y2+(y1-y2)*curvature),radialCoor4=radialCoordinate(x2,y2);return{x1:radialCoor1.x||0,y1:radialCoor1.y||0,x2:radialCoor4.x||0,y2:radialCoor4.y||0,cpx1:radialCoor2.x||0,cpy1:radialCoor2.y||0,cpx2:radialCoor3.x||0,cpy2:radialCoor3.y||0}}return x1=sourceLayout.x,y1=sourceLayout.y,x2=targetLayout.x,y2=targetLayout.y,"LR"!==orient&&"RL"!==orient||(cpx1=x1+(x2-x1)*curvature,cpy1=y1,cpx2=x2+(x1-x2)*curvature,cpy2=y2),"TB"!==orient&&"BT"!==orient||(cpx1=x1,cpy1=y1+(y2-y1)*curvature,cpx2=x2,cpy2=y2+(y1-y2)*curvature),{x1:x1,y1:y1,x2:x2,y2:y2,cpx1:cpx1,cpy1:cpy1,cpx2:cpx2,cpy2:cpy2}}var TreeView$1=TreeView,inner$b=makeInner();function linkSeriesData(opt){var mainData=opt.mainData,datas=opt.datas;datas||(datas={main:mainData},opt.datasAttr={main:"data"}),opt.datas=opt.mainData=null,linkAll(mainData,datas,opt),each$b(datas,(function(data){each$b(mainData.TRANSFERABLE_METHODS,(function(methodName){data.wrapMethod(methodName,curry$1(transferInjection,opt))}))})),mainData.wrapMethod("cloneShallow",curry$1(cloneShallowInjection,opt)),each$b(mainData.CHANGABLE_METHODS,(function(methodName){mainData.wrapMethod(methodName,curry$1(changeInjection,opt))})),assert(datas[mainData.dataType]===mainData)}function transferInjection(opt,res){if(inner$b(data=this).mainData===data){var datas=extend({},inner$b(this).datas);datas[this.dataType]=res,linkAll(res,datas,opt)}else linkSingle(res,this.dataType,inner$b(this).mainData,opt);var data;return res}function changeInjection(opt,res){return opt.struct&&opt.struct.update(),res}function cloneShallowInjection(opt,res){return each$b(inner$b(res).datas,(function(data,dataType){data!==res&&linkSingle(data.cloneShallow(),dataType,res,opt)})),res}function getLinkedData(dataType){var mainData=inner$b(this).mainData;return null==dataType||null==mainData?mainData:inner$b(mainData).datas[dataType]}function getLinkedDataAll(){var mainData=inner$b(this).mainData;return null==mainData?[{data:mainData}]:map$1(keys$1(inner$b(mainData).datas),(function(type){return{type:type,data:inner$b(mainData).datas[type]}}))}function linkAll(mainData,datas,opt){inner$b(mainData).datas={},each$b(datas,(function(data,dataType){linkSingle(data,dataType,mainData,opt)}))}function linkSingle(data,dataType,mainData,opt){inner$b(mainData).datas[dataType]=data,inner$b(data).mainData=mainData,data.dataType=dataType,opt.struct&&(data[opt.structAttr]=opt.struct,opt.struct[opt.datasAttr[dataType]]=data),data.getLinkedData=getLinkedData,data.getLinkedDataAll=getLinkedDataAll}var TreeNode=function(){function TreeNode(name,hostTree){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=name||"",this.hostTree=hostTree}return TreeNode.prototype.isRemoved=function(){return this.dataIndex<0},TreeNode.prototype.eachNode=function(options,cb,context){isFunction(options)&&(context=cb,cb=options,options=null),isString(options=options||{})&&(options={order:options});var suppressVisitSub,order=options.order||"preorder",children=this[options.attr||"children"];"preorder"===order&&(suppressVisitSub=cb.call(context,this));for(var i=0;!suppressVisitSub&&i<children.length;i++)children[i].eachNode(options,cb,context);"postorder"===order&&cb.call(context,this)},TreeNode.prototype.updateDepthAndHeight=function(depth){var height=0;this.depth=depth;for(var i=0;i<this.children.length;i++){var child=this.children[i];child.updateDepthAndHeight(depth+1),child.height>height&&(height=child.height)}this.height=height+1},TreeNode.prototype.getNodeById=function(id){if(this.getId()===id)return this;for(var i=0,children=this.children,len=children.length;i<len;i++){var res=children[i].getNodeById(id);if(res)return res}},TreeNode.prototype.contains=function(node){if(node===this)return!0;for(var i=0,children=this.children,len=children.length;i<len;i++){var res=children[i].contains(node);if(res)return res}},TreeNode.prototype.getAncestors=function(includeSelf){for(var ancestors=[],node=includeSelf?this:this.parentNode;node;)ancestors.push(node),node=node.parentNode;return ancestors.reverse(),ancestors},TreeNode.prototype.getAncestorsIndices=function(){for(var indices=[],currNode=this;currNode;)indices.push(currNode.dataIndex),currNode=currNode.parentNode;return indices.reverse(),indices},TreeNode.prototype.getDescendantIndices=function(){var indices=[];return this.eachNode((function(childNode){indices.push(childNode.dataIndex)})),indices},TreeNode.prototype.getValue=function(dimension){var data=this.hostTree.data;return data.getStore().get(data.getDimensionIndex(dimension||"value"),this.dataIndex)},TreeNode.prototype.setLayout=function(layout,merge){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,layout,merge)},TreeNode.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},TreeNode.prototype.getModel=function(path){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(path)},TreeNode.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},TreeNode.prototype.setVisual=function(key,value){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,key,value)},TreeNode.prototype.getVisual=function(key){return this.hostTree.data.getItemVisual(this.dataIndex,key)},TreeNode.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},TreeNode.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},TreeNode.prototype.getChildIndex=function(){if(this.parentNode){for(var children=this.parentNode.children,i=0;i<children.length;++i)if(children[i]===this)return i;return-1}return-1},TreeNode.prototype.isAncestorOf=function(node){for(var parent=node.parentNode;parent;){if(parent===this)return!0;parent=parent.parentNode}return!1},TreeNode.prototype.isDescendantOf=function(node){return node!==this&&node.isAncestorOf(this)},TreeNode}(),Tree=function(){function Tree(hostModel){this.type="tree",this._nodes=[],this.hostModel=hostModel}return Tree.prototype.eachNode=function(options,cb,context){this.root.eachNode(options,cb,context)},Tree.prototype.getNodeByDataIndex=function(dataIndex){var rawIndex=this.data.getRawIndex(dataIndex);return this._nodes[rawIndex]},Tree.prototype.getNodeById=function(name){return this.root.getNodeById(name)},Tree.prototype.update=function(){for(var data=this.data,nodes=this._nodes,i=0,len=nodes.length;i<len;i++)nodes[i].dataIndex=-1;for(i=0,len=data.count();i<len;i++)nodes[data.getRawIndex(i)].dataIndex=i},Tree.prototype.clearLayouts=function(){this.data.clearItemLayouts()},Tree.createTree=function(dataRoot,hostModel,beforeLink){var tree=new Tree(hostModel),listData=[],dimMax=1;!function buildHierarchy(dataNode,parentNode){var value=dataNode.value;dimMax=Math.max(dimMax,isArray(value)?value.length:1),listData.push(dataNode);var node=new TreeNode(convertOptionIdName(dataNode.name,""),tree);parentNode?function(child,node){var children=node.children;if(child.parentNode===node)return;children.push(child),child.parentNode=node}(node,parentNode):tree.root=node,tree._nodes.push(node);var children=dataNode.children;if(children)for(var i=0;i<children.length;i++)buildHierarchy(children[i],node)}(dataRoot),tree.root.updateDepthAndHeight(0);var dimensions=prepareSeriesDataSchema(listData,{coordDimensions:["value"],dimensionsCount:dimMax}).dimensions,list=new SeriesData$1(dimensions,hostModel);return list.initData(listData),beforeLink&&beforeLink(list),linkSeriesData({mainData:list,struct:tree,structAttr:"tree"}),tree.update(),tree},Tree}();var Tree$1=Tree;function retrieveTargetInfo(payload,validPayloadTypes,seriesModel){if(payload&&indexOf(validPayloadTypes,payload.type)>=0){var root=seriesModel.getData().tree.root,targetNode=payload.targetNode;if(isString(targetNode)&&(targetNode=root.getNodeById(targetNode)),targetNode&&root.contains(targetNode))return{node:targetNode};var targetNodeId=payload.targetNodeId;if(null!=targetNodeId&&(targetNode=root.getNodeById(targetNodeId)))return{node:targetNode}}}function getPathToRoot(node){for(var path=[];node;)(node=node.parentNode)&&path.push(node);return path.reverse()}function aboveViewRoot(viewRoot,node){return indexOf(getPathToRoot(viewRoot),node)>=0}function wrapTreePathInfo(node,seriesModel){for(var treePathInfo=[];node;){var nodeDataIndex=node.dataIndex;treePathInfo.push({name:node.name,dataIndex:nodeDataIndex,value:seriesModel.getRawValue(nodeDataIndex)}),node=node.parentNode}return treePathInfo.reverse(),treePathInfo}var TreeSeriesModel=function(_super){function TreeSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.hasSymbolVisual=!0,_this.ignoreStyleOnData=!0,_this}return __extends(TreeSeriesModel,_super),TreeSeriesModel.prototype.getInitialData=function(option){var root={name:option.name,children:option.data},leaves=option.leaves||{},leavesModel=new Model$1(leaves,this,this.ecModel),tree=Tree$1.createTree(root,this,(function(nodeData){nodeData.wrapMethod("getItemModel",(function(model,idx){var node=tree.getNodeByDataIndex(idx);return node&&node.children.length&&node.isExpand||(model.parentModel=leavesModel),model}))}));var treeDepth=0;tree.eachNode("preorder",(function(node){node.depth>treeDepth&&(treeDepth=node.depth)}));var expandTreeDepth=option.expandAndCollapse&&option.initialTreeDepth>=0?option.initialTreeDepth:treeDepth;return tree.root.eachNode("preorder",(function(node){var item=node.hostTree.data.getRawDataItem(node.dataIndex);node.isExpand=item&&null!=item.collapsed?!item.collapsed:node.depth<=expandTreeDepth})),tree.data},TreeSeriesModel.prototype.getOrient=function(){var orient=this.get("orient");return"horizontal"===orient?orient="LR":"vertical"===orient&&(orient="TB"),orient},TreeSeriesModel.prototype.setZoom=function(zoom){this.option.zoom=zoom},TreeSeriesModel.prototype.setCenter=function(center){this.option.center=center},TreeSeriesModel.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){for(var tree=this.getData().tree,realRoot=tree.root.children[0],node=tree.getNodeByDataIndex(dataIndex),value=node.getValue(),name=node.name;node&&node!==realRoot;)name=node.parentNode.name+"."+name,node=node.parentNode;return createTooltipMarkup("nameValue",{name:name,value:value,noValue:isNaN(value)||null==value})},TreeSeriesModel.prototype.getDataParams=function(dataIndex){var params=_super.prototype.getDataParams.apply(this,arguments),node=this.getData().tree.getNodeByDataIndex(dataIndex);return params.treeAncestors=wrapTreePathInfo(node,this),params.collapsed=!node.isExpand,params},TreeSeriesModel.type="series.tree",TreeSeriesModel.layoutMode="box",TreeSeriesModel.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},TreeSeriesModel}(SeriesModel$1),TreeSeriesModel$1=TreeSeriesModel;function eachBefore(root,callback){for(var node,nodes=[root];node=nodes.pop();)if(callback(node),node.isExpand){var children=node.children;if(children.length)for(var i=children.length-1;i>=0;i--)nodes.push(children[i])}}function treeLayout(ecModel,api){ecModel.eachSeriesByType("tree",(function(seriesModel){!function(seriesModel,api){var layoutInfo=function(seriesModel,api){return getLayoutRect(seriesModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()})}(seriesModel,api);seriesModel.layoutInfo=layoutInfo;var layout=seriesModel.get("layout"),width=0,height=0,separation$1=null;"radial"===layout?(width=2*Math.PI,height=Math.min(layoutInfo.height,layoutInfo.width)/2,separation$1=separation((function(node1,node2){return(node1.parentNode===node2.parentNode?1:2)/node1.depth}))):(width=layoutInfo.width,height=layoutInfo.height,separation$1=separation());var virtualRoot=seriesModel.getData().tree.root,realRoot=virtualRoot.children[0];if(realRoot){!function(inRoot){var root=inRoot;root.hierNode={defaultAncestor:null,ancestor:root,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var node,children,nodes=[root];node=nodes.pop();)if(children=node.children,node.isExpand&&children.length)for(var i=children.length-1;i>=0;i--){var child=children[i];child.hierNode={defaultAncestor:null,ancestor:child,prelim:0,modifier:0,change:0,shift:0,i:i,thread:null},nodes.push(child)}}(virtualRoot),function(root,callback,separation){for(var node,nodes=[root],next=[];node=nodes.pop();)if(next.push(node),node.isExpand){var children=node.children;if(children.length)for(var i=0;i<children.length;i++)nodes.push(children[i])}for(;node=next.pop();)callback(node,separation)}(realRoot,firstWalk,separation$1),virtualRoot.hierNode.modifier=-realRoot.hierNode.prelim,eachBefore(realRoot,secondWalk);var left_1=realRoot,right_1=realRoot,bottom_1=realRoot;eachBefore(realRoot,(function(node){var x=node.getLayout().x;x<left_1.getLayout().x&&(left_1=node),x>right_1.getLayout().x&&(right_1=node),node.depth>bottom_1.depth&&(bottom_1=node)}));var delta=left_1===right_1?1:separation$1(left_1,right_1)/2,tx_1=delta-left_1.getLayout().x,kx_1=0,ky_1=0,coorX_1=0,coorY_1=0;if("radial"===layout)kx_1=width/(right_1.getLayout().x+delta+tx_1),ky_1=height/(bottom_1.depth-1||1),eachBefore(realRoot,(function(node){coorX_1=(node.getLayout().x+tx_1)*kx_1,coorY_1=(node.depth-1)*ky_1;var finalCoor=radialCoordinate(coorX_1,coorY_1);node.setLayout({x:finalCoor.x,y:finalCoor.y,rawX:coorX_1,rawY:coorY_1},!0)}));else{var orient_1=seriesModel.getOrient();"RL"===orient_1||"LR"===orient_1?(ky_1=height/(right_1.getLayout().x+delta+tx_1),kx_1=width/(bottom_1.depth-1||1),eachBefore(realRoot,(function(node){coorY_1=(node.getLayout().x+tx_1)*ky_1,coorX_1="LR"===orient_1?(node.depth-1)*kx_1:width-(node.depth-1)*kx_1,node.setLayout({x:coorX_1,y:coorY_1},!0)}))):"TB"!==orient_1&&"BT"!==orient_1||(kx_1=width/(right_1.getLayout().x+delta+tx_1),ky_1=height/(bottom_1.depth-1||1),eachBefore(realRoot,(function(node){coorX_1=(node.getLayout().x+tx_1)*kx_1,coorY_1="TB"===orient_1?(node.depth-1)*ky_1:height-(node.depth-1)*ky_1,node.setLayout({x:coorX_1,y:coorY_1},!0)})))}}}(seriesModel,api)}))}function treeVisual(ecModel){ecModel.eachSeriesByType("tree",(function(seriesModel){var data=seriesModel.getData();data.tree.eachNode((function(node){var style=node.getModel().getModel("itemStyle").getItemStyle();extend(data.ensureUniqueItemVisual(node.dataIndex,"style"),style)}))}))}var actionTypes=["treemapZoomToNode","treemapRender","treemapMove"];function enableAriaDecalForTree(seriesModel){var tree=seriesModel.getData().tree,decalPaletteScope={};tree.eachNode((function(node){for(var current=node;current&&current.depth>1;)current=current.parentNode;var ecModel,name,scope,requestNum,defaultDecals,decal=(ecModel=seriesModel.ecModel,name=current.name||current.dataIndex+"",scope=decalPaletteScope,defaultDecals=normalizeToArray(ecModel.get(["aria","decal","decals"])),getFromPalette(ecModel,innerDecal,defaultDecals,null,name,scope,requestNum));node.setVisual("decal",decal)}))}var TreemapSeriesModel=function(_super){function TreemapSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=TreemapSeriesModel.type,_this.preventUsingHoverLayer=!0,_this}return __extends(TreemapSeriesModel,_super),TreemapSeriesModel.prototype.getInitialData=function(option,ecModel){var root={name:option.name,children:option.data};completeTreeValue$1(root);var levels=option.levels||[],designatedVisualItemStyle=this.designatedVisualItemStyle={},designatedVisualModel=new Model$1({itemStyle:designatedVisualItemStyle},this,ecModel);levels=option.levels=function(levels,ecModel){var hasColorDefine,hasDecalDefine,globalColorList=normalizeToArray(ecModel.get("color")),globalDecalList=normalizeToArray(ecModel.get(["aria","decal","decals"]));if(!globalColorList)return;levels=levels||[],each$b(levels,(function(levelDefine){var model=new Model$1(levelDefine),modelColor=model.get("color"),modelDecal=model.get("decal");(model.get(["itemStyle","color"])||modelColor&&"none"!==modelColor)&&(hasColorDefine=!0),(model.get(["itemStyle","decal"])||modelDecal&&"none"!==modelDecal)&&(hasDecalDefine=!0)}));var level0=levels[0]||(levels[0]={});hasColorDefine||(level0.color=globalColorList.slice());!hasDecalDefine&&globalDecalList&&(level0.decal=globalDecalList.slice());return levels}(levels,ecModel);var levelModels=map$1(levels||[],(function(levelDefine){return new Model$1(levelDefine,designatedVisualModel,ecModel)}),this),tree=Tree$1.createTree(root,this,(function(nodeData){nodeData.wrapMethod("getItemModel",(function(model,idx){var node=tree.getNodeByDataIndex(idx),levelModel=node?levelModels[node.depth]:null;return model.parentModel=levelModel||designatedVisualModel,model}))}));return tree.data},TreemapSeriesModel.prototype.optionUpdated=function(){this.resetViewRoot()},TreemapSeriesModel.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){var data=this.getData(),value=this.getRawValue(dataIndex);return createTooltipMarkup("nameValue",{name:data.getName(dataIndex),value:value})},TreemapSeriesModel.prototype.getDataParams=function(dataIndex){var params=_super.prototype.getDataParams.apply(this,arguments),node=this.getData().tree.getNodeByDataIndex(dataIndex);return params.treeAncestors=wrapTreePathInfo(node,this),params.treePathInfo=params.treeAncestors,params},TreemapSeriesModel.prototype.setLayoutInfo=function(layoutInfo){this.layoutInfo=this.layoutInfo||{},extend(this.layoutInfo,layoutInfo)},TreemapSeriesModel.prototype.mapIdToIndex=function(id){var idIndexMap=this._idIndexMap;idIndexMap||(idIndexMap=this._idIndexMap=createHashMap(),this._idIndexMapCount=0);var index=idIndexMap.get(id);return null==index&&idIndexMap.set(id,index=this._idIndexMapCount++),index},TreemapSeriesModel.prototype.getViewRoot=function(){return this._viewRoot},TreemapSeriesModel.prototype.resetViewRoot=function(viewRoot){viewRoot?this._viewRoot=viewRoot:viewRoot=this._viewRoot;var root=this.getRawData().tree.root;viewRoot&&(viewRoot===root||root.contains(viewRoot))||(this._viewRoot=root)},TreemapSeriesModel.prototype.enableAriaDecal=function(){enableAriaDecalForTree(this)},TreemapSeriesModel.type="series.treemap",TreemapSeriesModel.layoutMode="box",TreemapSeriesModel.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},TreemapSeriesModel}(SeriesModel$1);function completeTreeValue$1(dataNode){var sum=0;each$b(dataNode.children,(function(child){completeTreeValue$1(child);var childValue=child.value;isArray(childValue)&&(childValue=childValue[0]),sum+=childValue}));var thisValue=dataNode.value;isArray(thisValue)&&(thisValue=thisValue[0]),(null==thisValue||isNaN(thisValue))&&(thisValue=sum),thisValue<0&&(thisValue=0),isArray(dataNode.value)?dataNode.value[0]=thisValue:dataNode.value=thisValue}var TreemapSeriesModel$1=TreemapSeriesModel;function makeItemPoints(x,y,itemWidth,itemHeight,head,tail){var points=[[head?x:x-5,y],[x+itemWidth,y],[x+itemWidth,y+itemHeight],[head?x:x-5,y+itemHeight]];return!tail&&points.splice(2,0,[x+itemWidth+5,y+itemHeight/2]),!head&&points.push([x,y+itemHeight/2]),points}function packEventData(el,seriesModel,itemNode){getECData(el).eventData={componentType:"series",componentSubType:"treemap",componentIndex:seriesModel.componentIndex,seriesIndex:seriesModel.seriesIndex,seriesName:seriesModel.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:itemNode&&itemNode.dataIndex,name:itemNode&&itemNode.name},treePathInfo:itemNode&&wrapTreePathInfo(itemNode,seriesModel)}}var Breadcrumb$1=function(){function Breadcrumb(containerGroup){this.group=new Group$4,containerGroup.add(this.group)}return Breadcrumb.prototype.render=function(seriesModel,api,targetNode,onSelect){var model=seriesModel.getModel("breadcrumb"),thisGroup=this.group;if(thisGroup.removeAll(),model.get("show")&&targetNode){var normalStyleModel=model.getModel("itemStyle"),emphasisModel=model.getModel("emphasis"),textStyleModel=normalStyleModel.getModel("textStyle"),emphasisTextStyleModel=emphasisModel.getModel(["itemStyle","textStyle"]),layoutParam={pos:{left:model.get("left"),right:model.get("right"),top:model.get("top"),bottom:model.get("bottom")},box:{width:api.getWidth(),height:api.getHeight()},emptyItemWidth:model.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(targetNode,layoutParam,textStyleModel),this._renderContent(seriesModel,layoutParam,normalStyleModel,emphasisModel,textStyleModel,emphasisTextStyleModel,onSelect),positionElement(thisGroup,layoutParam.pos,layoutParam.box)}},Breadcrumb.prototype._prepare=function(targetNode,layoutParam,textStyleModel){for(var node=targetNode;node;node=node.parentNode){var text=convertOptionIdName(node.getModel().get("name"),""),textRect=textStyleModel.getTextRect(text),itemWidth=Math.max(textRect.width+16,layoutParam.emptyItemWidth);layoutParam.totalWidth+=itemWidth+8,layoutParam.renderList.push({node:node,text:text,width:itemWidth})}},Breadcrumb.prototype._renderContent=function(seriesModel,layoutParam,normalStyleModel,emphasisModel,textStyleModel,emphasisTextStyleModel,onSelect){for(var positionInfo,containerRect,margin,containerWidth,containerHeight,x,y,x2,y2,lastX=0,emptyItemWidth=layoutParam.emptyItemWidth,height=seriesModel.get(["breadcrumb","height"]),availableSize=(positionInfo=layoutParam.pos,containerRect=layoutParam.box,containerWidth=containerRect.width,containerHeight=containerRect.height,x=parsePercent(positionInfo.left,containerWidth),y=parsePercent(positionInfo.top,containerHeight),x2=parsePercent(positionInfo.right,containerWidth),y2=parsePercent(positionInfo.bottom,containerHeight),(isNaN(x)||isNaN(parseFloat(positionInfo.left)))&&(x=0),(isNaN(x2)||isNaN(parseFloat(positionInfo.right)))&&(x2=containerWidth),(isNaN(y)||isNaN(parseFloat(positionInfo.top)))&&(y=0),(isNaN(y2)||isNaN(parseFloat(positionInfo.bottom)))&&(y2=containerHeight),margin=normalizeCssArray(margin||0),{width:Math.max(x2-x-margin[1]-margin[3],0),height:Math.max(y2-y-margin[0]-margin[2],0)}),totalWidth=layoutParam.totalWidth,renderList=layoutParam.renderList,emphasisItemStyle=emphasisModel.getModel("itemStyle").getItemStyle(),i=renderList.length-1;i>=0;i--){var item=renderList[i],itemNode=item.node,itemWidth=item.width,text=item.text;totalWidth>availableSize.width&&(totalWidth-=itemWidth-emptyItemWidth,itemWidth=emptyItemWidth,text=null);var el=new Polygon$1({shape:{points:makeItemPoints(lastX,0,itemWidth,height,i===renderList.length-1,0===i)},style:defaults(normalStyleModel.getItemStyle(),{lineJoin:"bevel"}),textContent:new ZRText$1({style:createTextStyle(textStyleModel,{text:text})}),textConfig:{position:"inside"},z2:1e5,onclick:curry$1(onSelect,itemNode)});el.disableLabelAnimation=!0,el.getTextContent().ensureState("emphasis").style=createTextStyle(emphasisTextStyleModel,{text:text}),el.ensureState("emphasis").style=emphasisItemStyle,toggleHoverEmphasis(el,emphasisModel.get("focus"),emphasisModel.get("blurScope"),emphasisModel.get("disabled")),this.group.add(el),packEventData(el,seriesModel,itemNode),lastX+=itemWidth+8}},Breadcrumb.prototype.remove=function(){this.group.removeAll()},Breadcrumb}(),AnimationWrap=function(){function AnimationWrap(){this._storage=[],this._elExistsMap={}}return AnimationWrap.prototype.add=function(el,target,duration,delay,easing){return!this._elExistsMap[el.id]&&(this._elExistsMap[el.id]=!0,this._storage.push({el:el,target:target,duration:duration,delay:delay,easing:easing}),!0)},AnimationWrap.prototype.finished=function(callback){return this._finishedCallback=callback,this},AnimationWrap.prototype.start=function(){for(var _this=this,count=this._storage.length,checkTerminate=function(){--count<=0&&(_this._storage.length=0,_this._elExistsMap={},_this._finishedCallback&&_this._finishedCallback())},i=0,len=this._storage.length;i<len;i++){var item=this._storage[i];item.el.animateTo(item.target,{duration:item.duration,delay:item.delay,easing:item.easing,setToFinal:!0,done:checkTerminate,aborted:checkTerminate})}return this},AnimationWrap}();var Group$2=Group$4,Rect$2=Rect$4,getStateItemStyle=makeStyleMapper([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),getItemStyleNormal=function(model){var itemStyle=getStateItemStyle(model);return itemStyle.stroke=itemStyle.fill=itemStyle.lineWidth=null,itemStyle},inner$a=makeInner(),TreemapView=function(_super){function TreemapView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=TreemapView.type,_this._state="ready",_this._storage={nodeGroup:[],background:[],content:[]},_this}return __extends(TreemapView,_super),TreemapView.prototype.render=function(seriesModel,ecModel,api,payload){if(!(indexOf(ecModel.findComponents({mainType:"series",subType:"treemap",query:payload}),seriesModel)<0)){this.seriesModel=seriesModel,this.api=api,this.ecModel=ecModel;var targetInfo=retrieveTargetInfo(payload,["treemapZoomToNode","treemapRootToNode"],seriesModel),payloadType=payload&&payload.type,layoutInfo=seriesModel.layoutInfo,isInit=!this._oldTree,thisStorage=this._storage,reRoot="treemapRootToNode"===payloadType&&targetInfo&&thisStorage?{rootNodeGroup:thisStorage.nodeGroup[targetInfo.node.getRawIndex()],direction:payload.direction}:null,containerGroup=this._giveContainerGroup(layoutInfo),hasAnimation=seriesModel.get("animation"),renderResult=this._doRender(containerGroup,seriesModel,reRoot);!hasAnimation||isInit||payloadType&&"treemapZoomToNode"!==payloadType&&"treemapRootToNode"!==payloadType?renderResult.renderFinally():this._doAnimation(containerGroup,renderResult,seriesModel,reRoot),this._resetController(api),this._renderBreadcrumb(seriesModel,api,targetInfo)}},TreemapView.prototype._giveContainerGroup=function(layoutInfo){var containerGroup=this._containerGroup;return containerGroup||(containerGroup=this._containerGroup=new Group$2,this._initEvents(containerGroup),this.group.add(containerGroup)),containerGroup.x=layoutInfo.x,containerGroup.y=layoutInfo.y,containerGroup},TreemapView.prototype._doRender=function(containerGroup,seriesModel,reRoot){var thisTree=seriesModel.getData().tree,oldTree=this._oldTree,lastsForAnimation={nodeGroup:[],background:[],content:[]},thisStorage={nodeGroup:[],background:[],content:[]},oldStorage=this._storage,willInvisibleEls=[];function doRenderNode(thisNode,oldNode,parentGroup,depth){return function(seriesModel,thisStorage,oldStorage,reRoot,lastsForAnimation,willInvisibleEls,thisNode,oldNode,parentGroup,depth){if(!thisNode)return;var thisLayout=thisNode.getLayout(),data=seriesModel.getData(),nodeModel=thisNode.getModel();if(data.setItemGraphicEl(thisNode.dataIndex,null),!thisLayout||!thisLayout.isInView)return;var thisWidth=thisLayout.width,thisHeight=thisLayout.height,borderWidth=thisLayout.borderWidth,thisInvisible=thisLayout.invisible,thisRawIndex=thisNode.getRawIndex(),oldRawIndex=oldNode&&oldNode.getRawIndex(),thisViewChildren=thisNode.viewChildren,upperHeight=thisLayout.upperHeight,isParent=thisViewChildren&&thisViewChildren.length,itemStyleNormalModel=nodeModel.getModel("itemStyle"),itemStyleEmphasisModel=nodeModel.getModel(["emphasis","itemStyle"]),itemStyleBlurModel=nodeModel.getModel(["blur","itemStyle"]),itemStyleSelectModel=nodeModel.getModel(["select","itemStyle"]),borderRadius=itemStyleNormalModel.get("borderRadius")||0,group=giveGraphic("nodeGroup",Group$2);if(!group)return;if(parentGroup.add(group),group.x=thisLayout.x||0,group.y=thisLayout.y||0,group.markRedraw(),inner$a(group).nodeWidth=thisWidth,inner$a(group).nodeHeight=thisHeight,thisLayout.isAboveViewRoot)return group;var bg=giveGraphic("background",Rect$2,depth,20);bg&&renderBackground(group,bg,isParent&&thisLayout.upperLabelHeight);var emphasisModel=nodeModel.getModel("emphasis"),focus=emphasisModel.get("focus"),blurScope=emphasisModel.get("blurScope"),isDisabled=emphasisModel.get("disabled"),focusOrIndices="ancestor"===focus?thisNode.getAncestorsIndices():"descendant"===focus?thisNode.getDescendantIndices():focus;if(isParent)isHighDownDispatcher(group)&&setAsHighDownDispatcher(group,!1),bg&&(setAsHighDownDispatcher(bg,!isDisabled),data.setItemGraphicEl(thisNode.dataIndex,bg),enableHoverFocus(bg,focusOrIndices,blurScope));else{var content=giveGraphic("content",Rect$2,depth,30);content&&renderContent(group,content),bg.disableMorphing=!0,bg&&isHighDownDispatcher(bg)&&setAsHighDownDispatcher(bg,!1),setAsHighDownDispatcher(group,!isDisabled),data.setItemGraphicEl(thisNode.dataIndex,group);var cursorStyle=nodeModel.getShallow("cursor");cursorStyle&&content.attr("cursor",cursorStyle),enableHoverFocus(group,focusOrIndices,blurScope)}return group;function renderBackground(group,bg,useUpperLabel){var ecData=getECData(bg);if(ecData.dataIndex=thisNode.dataIndex,ecData.seriesIndex=seriesModel.seriesIndex,bg.setShape({x:0,y:0,width:thisWidth,height:thisHeight,r:borderRadius}),thisInvisible)processInvisible(bg);else{bg.invisible=!1;var style=thisNode.getVisual("style"),visualBorderColor=style.stroke,normalStyle=getItemStyleNormal(itemStyleNormalModel);normalStyle.fill=visualBorderColor;var emphasisStyle=getStateItemStyle(itemStyleEmphasisModel);emphasisStyle.fill=itemStyleEmphasisModel.get("borderColor");var blurStyle=getStateItemStyle(itemStyleBlurModel);blurStyle.fill=itemStyleBlurModel.get("borderColor");var selectStyle=getStateItemStyle(itemStyleSelectModel);if(selectStyle.fill=itemStyleSelectModel.get("borderColor"),useUpperLabel){var upperLabelWidth=thisWidth-2*borderWidth;prepareText(bg,visualBorderColor,style.opacity,{x:borderWidth,y:0,width:upperLabelWidth,height:upperHeight})}else bg.removeTextContent();bg.setStyle(normalStyle),bg.ensureState("emphasis").style=emphasisStyle,bg.ensureState("blur").style=blurStyle,bg.ensureState("select").style=selectStyle,setDefaultStateProxy(bg)}group.add(bg)}function renderContent(group,content){var ecData=getECData(content);ecData.dataIndex=thisNode.dataIndex,ecData.seriesIndex=seriesModel.seriesIndex;var contentWidth=Math.max(thisWidth-2*borderWidth,0),contentHeight=Math.max(thisHeight-2*borderWidth,0);if(content.culling=!0,content.setShape({x:borderWidth,y:borderWidth,width:contentWidth,height:contentHeight,r:borderRadius}),thisInvisible)processInvisible(content);else{content.invisible=!1;var nodeStyle=thisNode.getVisual("style"),visualColor=nodeStyle.fill,normalStyle=getItemStyleNormal(itemStyleNormalModel);normalStyle.fill=visualColor,normalStyle.decal=nodeStyle.decal;var emphasisStyle=getStateItemStyle(itemStyleEmphasisModel),blurStyle=getStateItemStyle(itemStyleBlurModel),selectStyle=getStateItemStyle(itemStyleSelectModel);prepareText(content,visualColor,nodeStyle.opacity,null),content.setStyle(normalStyle),content.ensureState("emphasis").style=emphasisStyle,content.ensureState("blur").style=blurStyle,content.ensureState("select").style=selectStyle,setDefaultStateProxy(content)}group.add(content)}function processInvisible(element){!element.invisible&&willInvisibleEls.push(element)}function prepareText(rectEl,visualColor,visualOpacity,upperLabelRect){var normalLabelModel=nodeModel.getModel(upperLabelRect?"upperLabel":"label"),defaultText=convertOptionIdName(nodeModel.get("name"),null),isShow=normalLabelModel.getShallow("show");setLabelStyle(rectEl,getLabelStatesModels(nodeModel,upperLabelRect?"upperLabel":"label"),{defaultText:isShow?defaultText:null,inheritColor:visualColor,defaultOpacity:visualOpacity,labelFetcher:seriesModel,labelDataIndex:thisNode.dataIndex});var textEl=rectEl.getTextContent();if(textEl){var textStyle=textEl.style,textPadding=normalizeCssArray$1(textStyle.padding||0);upperLabelRect&&(rectEl.setTextConfig({layoutRect:upperLabelRect}),textEl.disableLabelLayout=!0),textEl.beforeUpdate=function(){var width=Math.max((upperLabelRect?upperLabelRect.width:rectEl.shape.width)-textPadding[1]-textPadding[3],0),height=Math.max((upperLabelRect?upperLabelRect.height:rectEl.shape.height)-textPadding[0]-textPadding[2],0);textStyle.width===width&&textStyle.height===height||textEl.setStyle({width:width,height:height})},textStyle.truncateMinChar=2,textStyle.lineOverflow="truncate",addDrillDownIcon(textStyle,upperLabelRect,thisLayout);var textEmphasisState=textEl.getState("emphasis");addDrillDownIcon(textEmphasisState?textEmphasisState.style:null,upperLabelRect,thisLayout)}}function addDrillDownIcon(style,upperLabelRect,thisLayout){var text=style?style.text:null;if(!upperLabelRect&&thisLayout.isLeafRoot&&null!=text){var iconChar=seriesModel.get("drillDownIcon",!0);style.text=iconChar?iconChar+" "+text:text}}function giveGraphic(storageName,Ctor,depth,z){var element=null!=oldRawIndex&&oldStorage[storageName][oldRawIndex],lasts=lastsForAnimation[storageName];return element?(oldStorage[storageName][oldRawIndex]=null,prepareAnimationWhenHasOld(lasts,element)):thisInvisible||((element=new Ctor)instanceof Displayable$1&&(element.z2=function(depth,z2InLevel){return 100*depth+z2InLevel}(depth,z)),prepareAnimationWhenNoOld(lasts,element)),thisStorage[storageName][thisRawIndex]=element}function prepareAnimationWhenHasOld(lasts,element){var lastCfg=lasts[thisRawIndex]={};element instanceof Group$2?(lastCfg.oldX=element.x,lastCfg.oldY=element.y):lastCfg.oldShape=extend({},element.shape)}function prepareAnimationWhenNoOld(lasts,element){var lastCfg=lasts[thisRawIndex]={},parentNode=thisNode.parentNode,isGroup=element instanceof Group$4;if(parentNode&&(!reRoot||"drillDown"===reRoot.direction)){var parentOldX=0,parentOldY=0,parentOldBg=lastsForAnimation.background[parentNode.getRawIndex()];!reRoot&&parentOldBg&&parentOldBg.oldShape&&(parentOldX=parentOldBg.oldShape.width,parentOldY=parentOldBg.oldShape.height),isGroup?(lastCfg.oldX=0,lastCfg.oldY=parentOldY):lastCfg.oldShape={x:parentOldX,y:parentOldY,width:0,height:0}}lastCfg.fadein=!isGroup}}(seriesModel,thisStorage,oldStorage,reRoot,lastsForAnimation,willInvisibleEls,thisNode,oldNode,parentGroup,depth)}!function dualTravel(thisViewChildren,oldViewChildren,parentGroup,sameTree,depth){sameTree?(oldViewChildren=thisViewChildren,each$b(thisViewChildren,(function(child,index){!child.isRemoved()&&processNode(index,index)}))):new DataDiffer$1(oldViewChildren,thisViewChildren,getKey,getKey).add(processNode).update(processNode).remove(curry$1(processNode,null)).execute();function getKey(node){return node.getId()}function processNode(newIndex,oldIndex){var thisNode=null!=newIndex?thisViewChildren[newIndex]:null,oldNode=null!=oldIndex?oldViewChildren[oldIndex]:null,group=doRenderNode(thisNode,oldNode,parentGroup,depth);group&&dualTravel(thisNode&&thisNode.viewChildren||[],oldNode&&oldNode.viewChildren||[],group,sameTree,depth+1)}}(thisTree.root?[thisTree.root]:[],oldTree&&oldTree.root?[oldTree.root]:[],containerGroup,thisTree===oldTree||!oldTree,0);var willDeleteEls=function(storage){var willDeleteEls={nodeGroup:[],background:[],content:[]};return storage&&each$b(storage,(function(store,storageName){var delEls=willDeleteEls[storageName];each$b(store,(function(el){el&&(delEls.push(el),inner$a(el).willDelete=!0)}))})),willDeleteEls}(oldStorage);if(this._oldTree=thisTree,this._storage=thisStorage,this._controllerHost){var _oldRootLayout=this.seriesModel.layoutInfo,rootLayout=thisTree.root.getLayout();rootLayout.width===_oldRootLayout.width&&rootLayout.height===_oldRootLayout.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:lastsForAnimation,willDeleteEls:willDeleteEls,renderFinally:function(){each$b(willDeleteEls,(function(els){each$b(els,(function(el){el.parent&&el.parent.remove(el)}))})),each$b(willInvisibleEls,(function(el){el.invisible=!0,el.dirty()}))}}},TreemapView.prototype._doAnimation=function(containerGroup,renderResult,seriesModel,reRoot){var durationOption=seriesModel.get("animationDurationUpdate"),easingOption=seriesModel.get("animationEasing"),duration=(isFunction(durationOption)?0:durationOption)||0,easing=(isFunction(easingOption)?null:easingOption)||"cubicOut",animationWrap=new AnimationWrap;each$b(renderResult.willDeleteEls,(function(store,storageName){each$b(store,(function(el,rawIndex){if(!el.invisible){var target,parent=el.parent,innerStore=inner$a(parent);if(reRoot&&"drillDown"===reRoot.direction)target=parent===reRoot.rootNodeGroup?{shape:{x:0,y:0,width:innerStore.nodeWidth,height:innerStore.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var targetX=0,targetY=0;innerStore.willDelete||(targetX=innerStore.nodeWidth/2,targetY=innerStore.nodeHeight/2),target="nodeGroup"===storageName?{x:targetX,y:targetY,style:{opacity:0}}:{shape:{x:targetX,y:targetY,width:0,height:0},style:{opacity:0}}}target&&animationWrap.add(el,target,duration,0,easing)}}))})),each$b(this._storage,(function(store,storageName){each$b(store,(function(el,rawIndex){var last=renderResult.lastsForAnimation[storageName][rawIndex],target={};last&&(el instanceof Group$4?null!=last.oldX&&(target.x=el.x,target.y=el.y,el.x=last.oldX,el.y=last.oldY):(last.oldShape&&(target.shape=extend({},el.shape),el.setShape(last.oldShape)),last.fadein?(el.setStyle("opacity",0),target.style={opacity:1}):1!==el.style.opacity&&(target.style={opacity:1})),animationWrap.add(el,target,duration,0,easing))}))}),this),this._state="animating",animationWrap.finished(bind$1((function(){this._state="ready",renderResult.renderFinally()}),this)).start()},TreemapView.prototype._resetController=function(api){var controller=this._controller,controllerHost=this._controllerHost;controllerHost||(this._controllerHost={target:this.group},controllerHost=this._controllerHost),controller||((controller=this._controller=new RoamController$1(api.getZr())).enable(this.seriesModel.get("roam")),controllerHost.zoomLimit=this.seriesModel.get("scaleLimit"),controllerHost.zoom=this.seriesModel.get("zoom"),controller.on("pan",bind$1(this._onPan,this)),controller.on("zoom",bind$1(this._onZoom,this)));var rect=new BoundingRect$1(0,0,api.getWidth(),api.getHeight());controller.setPointerChecker((function(e,x,y){return rect.contain(x,y)}))},TreemapView.prototype._clearController=function(){var controller=this._controller;this._controllerHost=null,controller&&(controller.dispose(),controller=null)},TreemapView.prototype._onPan=function(e){if("animating"!==this._state&&(Math.abs(e.dx)>3||Math.abs(e.dy)>3)){var root=this.seriesModel.getData().tree.root;if(!root)return;var rootLayout=root.getLayout();if(!rootLayout)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:rootLayout.x+e.dx,y:rootLayout.y+e.dy,width:rootLayout.width,height:rootLayout.height}})}},TreemapView.prototype._onZoom=function(e){var mouseX=e.originX,mouseY=e.originY,zoomDelta=e.scale;if("animating"!==this._state){var root=this.seriesModel.getData().tree.root;if(!root)return;var rootLayout=root.getLayout();if(!rootLayout)return;var zoomLimit,rect=new BoundingRect$1(rootLayout.x,rootLayout.y,rootLayout.width,rootLayout.height),_controllerHost=this._controllerHost;zoomLimit=_controllerHost.zoomLimit;var newZoom=_controllerHost.zoom=_controllerHost.zoom||1;if(newZoom*=zoomDelta,zoomLimit){var zoomMin=zoomLimit.min||0,zoomMax=zoomLimit.max||1/0;newZoom=Math.max(Math.min(zoomMax,newZoom),zoomMin)}var zoomScale=newZoom/_controllerHost.zoom;_controllerHost.zoom=newZoom;var layoutInfo=this.seriesModel.layoutInfo,m=[1,0,0,1,0,0];translate(m,m,[-(mouseX-=layoutInfo.x),-(mouseY-=layoutInfo.y)]),scale$1(m,m,[zoomScale,zoomScale]),translate(m,m,[mouseX,mouseY]),rect.applyTransform(m),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:rect.x,y:rect.y,width:rect.width,height:rect.height}})}},TreemapView.prototype._initEvents=function(containerGroup){var _this=this;containerGroup.on("click",(function(e){if("ready"===_this._state){var nodeClick=_this.seriesModel.get("nodeClick",!0);if(nodeClick){var targetInfo=_this.findTarget(e.offsetX,e.offsetY);if(targetInfo){var node=targetInfo.node;if(node.getLayout().isLeafRoot)_this._rootToNode(targetInfo);else if("zoomToNode"===nodeClick)_this._zoomToNode(targetInfo);else if("link"===nodeClick){var itemModel=node.hostTree.data.getItemModel(node.dataIndex),link=itemModel.get("link",!0),linkTarget=itemModel.get("target",!0)||"blank";link&&windowOpen(link,linkTarget)}}}}}),this)},TreemapView.prototype._renderBreadcrumb=function(seriesModel,api,targetInfo){var _this=this;targetInfo||(targetInfo=null!=seriesModel.get("leafDepth",!0)?{node:seriesModel.getViewRoot()}:this.findTarget(api.getWidth()/2,api.getHeight()/2))||(targetInfo={node:seriesModel.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new Breadcrumb$1(this.group))).render(seriesModel,api,targetInfo.node,(function(node){"animating"!==_this._state&&(aboveViewRoot(seriesModel.getViewRoot(),node)?_this._rootToNode({node:node}):_this._zoomToNode({node:node}))}))},TreemapView.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},TreemapView.prototype.dispose=function(){this._clearController()},TreemapView.prototype._zoomToNode=function(targetInfo){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:targetInfo.node})},TreemapView.prototype._rootToNode=function(targetInfo){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:targetInfo.node})},TreemapView.prototype.findTarget=function(x,y){var targetInfo;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(node){var bgEl=this._storage.background[node.getRawIndex()];if(bgEl){var point=bgEl.transformCoordToLocal(x,y),shape=bgEl.shape;if(!(shape.x<=point[0]&&point[0]<=shape.x+shape.width&&shape.y<=point[1]&&point[1]<=shape.y+shape.height))return!1;targetInfo={node:node,offsetX:point[0],offsetY:point[1]}}}),this),targetInfo},TreemapView.type="treemap",TreemapView}(ChartView$1);var TreemapView$1=TreemapView,each$8=each$b,isObject=isObject$3,VisualMapping=function(){function VisualMapping(option){var mappingMethod=option.mappingMethod,visualType=option.type,thisOption=this.option=clone$3(option);this.type=visualType,this.mappingMethod=mappingMethod,this._normalizeData=normalizers[mappingMethod];var visualHandler=VisualMapping.visualHandlers[visualType];this.applyVisual=visualHandler.applyVisual,this.getColorMapper=visualHandler.getColorMapper,this._normalizedToVisual=visualHandler._normalizedToVisual[mappingMethod],"piecewise"===mappingMethod?(normalizeVisualRange(thisOption),function(thisOption){var pieceList=thisOption.pieceList;thisOption.hasSpecialVisual=!1,each$b(pieceList,(function(piece,index){piece.originIndex=index,null!=piece.visual&&(thisOption.hasSpecialVisual=!0)}))}(thisOption)):"category"===mappingMethod?thisOption.categories?function(thisOption){var categories=thisOption.categories,categoryMap=thisOption.categoryMap={},visual=thisOption.visual;if(each$8(categories,(function(cate,index){categoryMap[cate]=index})),!isArray(visual)){var visualArr_1=[];isObject$3(visual)?each$8(visual,(function(v,cate){var index=categoryMap[cate];visualArr_1[null!=index?index:-1]=v})):visualArr_1[-1]=visual,visual=setVisualToOption(thisOption,visualArr_1)}for(var i=categories.length-1;i>=0;i--)null==visual[i]&&(delete categoryMap[categories[i]],categories.pop())}(thisOption):normalizeVisualRange(thisOption,!0):(assert("linear"!==mappingMethod||thisOption.dataExtent),normalizeVisualRange(thisOption))}return VisualMapping.prototype.mapValueToVisual=function(value){var normalized=this._normalizeData(value);return this._normalizedToVisual(normalized,value)},VisualMapping.prototype.getNormalizer=function(){return bind$1(this._normalizeData,this)},VisualMapping.listVisualTypes=function(){return keys$1(VisualMapping.visualHandlers)},VisualMapping.isValidType=function(visualType){return VisualMapping.visualHandlers.hasOwnProperty(visualType)},VisualMapping.eachVisual=function(visual,callback,context){isObject$3(visual)?each$b(visual,callback,context):callback.call(context,visual)},VisualMapping.mapVisual=function(visual,callback,context){var isPrimary,newVisual=isArray(visual)?[]:isObject$3(visual)?{}:(isPrimary=!0,null);return VisualMapping.eachVisual(visual,(function(v,key){var newVal=callback.call(context,v,key);isPrimary?newVisual=newVal:newVisual[key]=newVal})),newVisual},VisualMapping.retrieveVisuals=function(obj){var hasVisual,ret={};return obj&&each$8(VisualMapping.visualHandlers,(function(h,visualType){obj.hasOwnProperty(visualType)&&(ret[visualType]=obj[visualType],hasVisual=!0)})),hasVisual?ret:null},VisualMapping.prepareVisualTypes=function(visualTypes){if(isArray(visualTypes))visualTypes=visualTypes.slice();else{if(!isObject(visualTypes))return[];var types_1=[];each$8(visualTypes,(function(item,type){types_1.push(type)})),visualTypes=types_1}return visualTypes.sort((function(type1,type2){return"color"===type2&&"color"!==type1&&0===type1.indexOf("color")?1:-1})),visualTypes},VisualMapping.dependsOn=function(visualType1,visualType2){return"color"===visualType2?!(!visualType1||0!==visualType1.indexOf(visualType2)):visualType1===visualType2},VisualMapping.findPieceIndex=function(value,pieceList,findClosestWhenOutside){for(var possibleI,abs=1/0,i=0,len=pieceList.length;i<len;i++){var pieceValue=pieceList[i].value;if(null!=pieceValue){if(pieceValue===value||isString(pieceValue)&&pieceValue===value+"")return i;findClosestWhenOutside&&updatePossible(pieceValue,i)}}for(i=0,len=pieceList.length;i<len;i++){var piece=pieceList[i],interval=piece.interval,close_1=piece.close;if(interval){if(interval[0]===-1/0){if(littleThan(close_1[1],value,interval[1]))return i}else if(interval[1]===1/0){if(littleThan(close_1[0],interval[0],value))return i}else if(littleThan(close_1[0],interval[0],value)&&littleThan(close_1[1],value,interval[1]))return i;findClosestWhenOutside&&updatePossible(interval[0],i),findClosestWhenOutside&&updatePossible(interval[1],i)}}if(findClosestWhenOutside)return value===1/0?pieceList.length-1:value===-1/0?0:possibleI;function updatePossible(val,index){var newAbs=Math.abs(val-value);newAbs<abs&&(abs=newAbs,possibleI=index)}},VisualMapping.visualHandlers={color:{applyVisual:makeApplyVisual("color"),getColorMapper:function(){var thisOption=this.option;return bind$1("category"===thisOption.mappingMethod?function(value,isNormalized){return!isNormalized&&(value=this._normalizeData(value)),doMapCategory.call(this,value)}:function(value,isNormalized,out){var returnRGBArray=!!out;return!isNormalized&&(value=this._normalizeData(value)),out=fastLerp(value,thisOption.parsedVisual,out),returnRGBArray?out:stringify$1(out,"rgba")},this)},_normalizedToVisual:{linear:function(normalized){return stringify$1(fastLerp(normalized,this.option.parsedVisual),"rgba")},category:doMapCategory,piecewise:function(normalized,value){var result=getSpecifiedVisual.call(this,value);return null==result&&(result=stringify$1(fastLerp(normalized,this.option.parsedVisual),"rgba")),result},fixed:doMapFixed}},colorHue:makePartialColorVisualHandler((function(color,value){return modifyHSL(color,value)})),colorSaturation:makePartialColorVisualHandler((function(color,value){return modifyHSL(color,null,value)})),colorLightness:makePartialColorVisualHandler((function(color,value){return modifyHSL(color,null,null,value)})),colorAlpha:makePartialColorVisualHandler((function(color,value){return modifyAlpha(color,value)})),decal:{applyVisual:makeApplyVisual("decal"),_normalizedToVisual:{linear:null,category:doMapCategory,piecewise:null,fixed:null}},opacity:{applyVisual:makeApplyVisual("opacity"),_normalizedToVisual:createNormalizedToNumericVisual([0,1])},liftZ:{applyVisual:makeApplyVisual("liftZ"),_normalizedToVisual:{linear:doMapFixed,category:doMapFixed,piecewise:doMapFixed,fixed:doMapFixed}},symbol:{applyVisual:function(value,getter,setter){setter("symbol",this.mapValueToVisual(value))},_normalizedToVisual:{linear:doMapToArray,category:doMapCategory,piecewise:function(normalized,value){var result=getSpecifiedVisual.call(this,value);return null==result&&(result=doMapToArray.call(this,normalized)),result},fixed:doMapFixed}},symbolSize:{applyVisual:makeApplyVisual("symbolSize"),_normalizedToVisual:createNormalizedToNumericVisual([0,1])}},VisualMapping}();function normalizeVisualRange(thisOption,isCategory){var visual=thisOption.visual,visualArr=[];isObject$3(visual)?each$8(visual,(function(v){visualArr.push(v)})):null!=visual&&visualArr.push(visual);isCategory||1!==visualArr.length||{color:1,symbol:1}.hasOwnProperty(thisOption.type)||(visualArr[1]=visualArr[0]),setVisualToOption(thisOption,visualArr)}function makePartialColorVisualHandler(applyValue){return{applyVisual:function(value,getter,setter){var colorChannel=this.mapValueToVisual(value);setter("color",applyValue(getter("color"),colorChannel))},_normalizedToVisual:createNormalizedToNumericVisual([0,1])}}function doMapToArray(normalized){var visual=this.option.visual;return visual[Math.round(linearMap(normalized,[0,1],[0,visual.length-1],!0))]||{}}function makeApplyVisual(visualType){return function(value,getter,setter){setter(visualType,this.mapValueToVisual(value))}}function doMapCategory(normalized){var visual=this.option.visual;return visual[this.option.loop&&-1!==normalized?normalized%visual.length:normalized]}function doMapFixed(){return this.option.visual[0]}function createNormalizedToNumericVisual(sourceExtent){return{linear:function(normalized){return linearMap(normalized,sourceExtent,this.option.visual,!0)},category:doMapCategory,piecewise:function(normalized,value){var result=getSpecifiedVisual.call(this,value);return null==result&&(result=linearMap(normalized,sourceExtent,this.option.visual,!0)),result},fixed:doMapFixed}}function getSpecifiedVisual(value){var thisOption=this.option,pieceList=thisOption.pieceList;if(thisOption.hasSpecialVisual){var piece=pieceList[VisualMapping.findPieceIndex(value,pieceList)];if(piece&&piece.visual)return piece.visual[this.type]}}function setVisualToOption(thisOption,visualArr){return thisOption.visual=visualArr,"color"===thisOption.type&&(thisOption.parsedVisual=map$1(visualArr,(function(item){var color=parse$1(item);return color||"production"===process.env.NODE_ENV||warn("'"+item+"' is an illegal color, fallback to '#000000'",!0),color||[0,0,0,1]}))),visualArr}var normalizers={linear:function(value){return linearMap(value,this.option.dataExtent,[0,1],!0)},piecewise:function(value){var pieceList=this.option.pieceList,pieceIndex=VisualMapping.findPieceIndex(value,pieceList,!0);if(null!=pieceIndex)return linearMap(pieceIndex,[0,pieceList.length-1],[0,1],!0)},category:function(value){var index=this.option.categories?this.option.categoryMap[value]:value;return null==index?-1:index},fixed:noop$1};function littleThan(close,a,b){return close?a<=b:a<b}var VisualMapping$1=VisualMapping,inner$9=makeInner(),treemapVisual={seriesType:"treemap",reset:function(seriesModel){var root=seriesModel.getData().tree.root;root.isRemoved()||travelTree(root,{},seriesModel.getViewRoot().getAncestors(),seriesModel)}};function travelTree(node,designatedVisual,viewRootAncestors,seriesModel){var nodeModel=node.getModel(),nodeLayout=node.getLayout(),data=node.hostTree.data;if(nodeLayout&&!nodeLayout.invisible&&nodeLayout.isInView){var thisNodeColor,nodeItemStyleModel=nodeModel.getModel("itemStyle"),visuals=function(nodeItemStyleModel,designatedVisual,seriesModel){var visuals=extend({},designatedVisual),designatedVisualItemStyle=seriesModel.designatedVisualItemStyle;return each$b(["color","colorAlpha","colorSaturation"],(function(visualName){designatedVisualItemStyle[visualName]=designatedVisual[visualName];var val=nodeItemStyleModel.get(visualName);designatedVisualItemStyle[visualName]=null,null!=val&&(visuals[visualName]=val)})),visuals}(nodeItemStyleModel,designatedVisual,seriesModel),existsStyle=data.ensureUniqueItemVisual(node.dataIndex,"style"),borderColor=nodeItemStyleModel.get("borderColor"),borderColorSaturation=nodeItemStyleModel.get("borderColorSaturation");null!=borderColorSaturation&&(borderColor=function(borderColorSaturation,thisNodeColor){return null!=thisNodeColor?modifyHSL(thisNodeColor,null,null,borderColorSaturation):null}(borderColorSaturation,thisNodeColor=calculateColor(visuals))),existsStyle.stroke=borderColor;var viewChildren=node.viewChildren;if(viewChildren&&viewChildren.length){var mapping_1=function(node,nodeModel,nodeLayout,nodeItemStyleModel,visuals,viewChildren){if(!viewChildren||!viewChildren.length)return;var rangeVisual=getRangeVisual(nodeModel,"color")||null!=visuals.color&&"none"!==visuals.color&&(getRangeVisual(nodeModel,"colorAlpha")||getRangeVisual(nodeModel,"colorSaturation"));if(!rangeVisual)return;var visualMin=nodeModel.get("visualMin"),visualMax=nodeModel.get("visualMax"),dataExtent=nodeLayout.dataExtent.slice();null!=visualMin&&visualMin<dataExtent[0]&&(dataExtent[0]=visualMin),null!=visualMax&&visualMax>dataExtent[1]&&(dataExtent[1]=visualMax);var colorMappingBy=nodeModel.get("colorMappingBy"),opt={type:rangeVisual.name,dataExtent:dataExtent,visual:rangeVisual.range};"color"!==opt.type||"index"!==colorMappingBy&&"id"!==colorMappingBy?opt.mappingMethod="linear":(opt.mappingMethod="category",opt.loop=!0);var mapping=new VisualMapping$1(opt);return inner$9(mapping).drColorMappingBy=colorMappingBy,mapping}(0,nodeModel,nodeLayout,0,visuals,viewChildren);each$b(viewChildren,(function(child,index){if(child.depth>=viewRootAncestors.length||child===viewRootAncestors[child.depth]){var childVisual=function(nodeModel,visuals,child,index,mapping,seriesModel){var childVisuals=extend({},visuals);if(mapping){var mappingType=mapping.type,colorMappingBy="color"===mappingType&&inner$9(mapping).drColorMappingBy,value="index"===colorMappingBy?index:"id"===colorMappingBy?seriesModel.mapIdToIndex(child.getId()):child.getValue(nodeModel.get("visualDimension"));childVisuals[mappingType]=mapping.mapValueToVisual(value)}return childVisuals}(nodeModel,visuals,child,index,mapping_1,seriesModel);travelTree(child,childVisual,viewRootAncestors,seriesModel)}}))}else thisNodeColor=calculateColor(visuals),existsStyle.fill=thisNodeColor}}function calculateColor(visuals){var color=getValueVisualDefine(visuals,"color");if(color){var colorAlpha=getValueVisualDefine(visuals,"colorAlpha"),colorSaturation=getValueVisualDefine(visuals,"colorSaturation");return colorSaturation&&(color=modifyHSL(color,null,null,colorSaturation)),colorAlpha&&(color=modifyAlpha(color,colorAlpha)),color}}function getValueVisualDefine(visuals,name){var value=visuals[name];if(null!=value&&"none"!==value)return value}function getRangeVisual(nodeModel,name){var range=nodeModel.get(name);return isArray(range)&&range.length?{name:name,range:range}:null}var mathMax$2=Math.max,mathMin$2=Math.min,retrieveValue=retrieve,each$7=each$b,PATH_BORDER_WIDTH=["itemStyle","borderWidth"],PATH_GAP_WIDTH=["itemStyle","gapWidth"],PATH_UPPER_LABEL_SHOW=["upperLabel","show"],PATH_UPPER_LABEL_HEIGHT=["upperLabel","height"],treemapLayout={seriesType:"treemap",reset:function(seriesModel,ecModel,api,payload){var ecWidth=api.getWidth(),ecHeight=api.getHeight(),seriesOption=seriesModel.option,layoutInfo=getLayoutRect(seriesModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()}),size=seriesOption.size||[],containerWidth=parsePercent(retrieveValue(layoutInfo.width,size[0]),ecWidth),containerHeight=parsePercent(retrieveValue(layoutInfo.height,size[1]),ecHeight),payloadType=payload&&payload.type,targetInfo=retrieveTargetInfo(payload,["treemapZoomToNode","treemapRootToNode"],seriesModel),rootRect="treemapRender"===payloadType||"treemapMove"===payloadType?payload.rootRect:null,viewRoot=seriesModel.getViewRoot(),viewAbovePath=getPathToRoot(viewRoot);if("treemapMove"!==payloadType){var rootSize="treemapZoomToNode"===payloadType?function(seriesModel,targetInfo,viewRoot,containerWidth,containerHeight){var parent,currNode=(targetInfo||{}).node,defaultSize=[containerWidth,containerHeight];if(!currNode||currNode===viewRoot)return defaultSize;var viewArea=containerWidth*containerHeight,area=viewArea*seriesModel.option.zoomToNodeRatio;for(;parent=currNode.parentNode;){for(var sum=0,siblings=parent.children,i=0,len=siblings.length;i<len;i++)sum+=siblings[i].getValue();var currNodeValue=currNode.getValue();if(0===currNodeValue)return defaultSize;area*=sum/currNodeValue;var parentModel=parent.getModel(),borderWidth=parentModel.get(PATH_BORDER_WIDTH);(area+=4*borderWidth*borderWidth+(3*borderWidth+Math.max(borderWidth,getUpperLabelHeight(parentModel)))*Math.pow(area,.5))>9007199254740991&&(area=9007199254740991),currNode=parent}area<viewArea&&(area=viewArea);var scale=Math.pow(area/viewArea,.5);return[containerWidth*scale,containerHeight*scale]}(seriesModel,targetInfo,viewRoot,containerWidth,containerHeight):rootRect?[rootRect.width,rootRect.height]:[containerWidth,containerHeight],sort_1=seriesOption.sort;sort_1&&"asc"!==sort_1&&"desc"!==sort_1&&(sort_1="desc");var options={squareRatio:seriesOption.squareRatio,sort:sort_1,leafDepth:seriesOption.leafDepth};viewRoot.hostTree.clearLayouts();var viewRootLayout_1={x:0,y:0,width:rootSize[0],height:rootSize[1],area:rootSize[0]*rootSize[1]};viewRoot.setLayout(viewRootLayout_1),squarify(viewRoot,options,!1,0),viewRootLayout_1=viewRoot.getLayout(),each$7(viewAbovePath,(function(node,index){var childValue=(viewAbovePath[index+1]||viewRoot).getValue();node.setLayout(extend({dataExtent:[childValue,childValue],borderWidth:0,upperHeight:0},viewRootLayout_1))}))}var treeRoot=seriesModel.getData().tree.root;treeRoot.setLayout(function(layoutInfo,rootRect,targetInfo){if(rootRect)return{x:rootRect.x,y:rootRect.y};var defaultPosition={x:0,y:0};if(!targetInfo)return defaultPosition;var targetNode=targetInfo.node,layout=targetNode.getLayout();if(!layout)return defaultPosition;var targetCenter=[layout.width/2,layout.height/2],node=targetNode;for(;node;){var nodeLayout=node.getLayout();targetCenter[0]+=nodeLayout.x,targetCenter[1]+=nodeLayout.y,node=node.parentNode}return{x:layoutInfo.width/2-targetCenter[0],y:layoutInfo.height/2-targetCenter[1]}}(layoutInfo,rootRect,targetInfo),!0),seriesModel.setLayoutInfo(layoutInfo),prunning(treeRoot,new BoundingRect$1(-layoutInfo.x,-layoutInfo.y,ecWidth,ecHeight),viewAbovePath,viewRoot,0)}};function squarify(node,options,hideChildren,depth){var width,height;if(!node.isRemoved()){var thisLayout=node.getLayout();width=thisLayout.width,height=thisLayout.height;var nodeModel=node.getModel(),borderWidth=nodeModel.get(PATH_BORDER_WIDTH),halfGapWidth=nodeModel.get(PATH_GAP_WIDTH)/2,upperLabelHeight=getUpperLabelHeight(nodeModel),upperHeight=Math.max(borderWidth,upperLabelHeight),layoutOffset=borderWidth-halfGapWidth,layoutOffsetUpper=upperHeight-halfGapWidth;node.setLayout({borderWidth:borderWidth,upperHeight:upperHeight,upperLabelHeight:upperLabelHeight},!0);var totalArea=(width=mathMax$2(width-2*layoutOffset,0))*(height=mathMax$2(height-layoutOffset-layoutOffsetUpper,0)),viewChildren=function(node,nodeModel,totalArea,options,hideChildren,depth){var viewChildren=node.children||[],orderBy=options.sort;"asc"!==orderBy&&"desc"!==orderBy&&(orderBy=null);var overLeafDepth=null!=options.leafDepth&&options.leafDepth<=depth;if(hideChildren&&!overLeafDepth)return node.viewChildren=[];viewChildren=filter(viewChildren,(function(child){return!child.isRemoved()})),function(viewChildren,orderBy){orderBy&&viewChildren.sort((function(a,b){var diff="asc"===orderBy?a.getValue()-b.getValue():b.getValue()-a.getValue();return 0===diff?"asc"===orderBy?a.dataIndex-b.dataIndex:b.dataIndex-a.dataIndex:diff}))}(viewChildren,orderBy);var info=function(nodeModel,children,orderBy){for(var sum=0,i=0,len=children.length;i<len;i++)sum+=children[i].getValue();var dataExtent,dimension=nodeModel.get("visualDimension");children&&children.length?"value"===dimension&&orderBy?(dataExtent=[children[children.length-1].getValue(),children[0].getValue()],"asc"===orderBy&&dataExtent.reverse()):(dataExtent=[1/0,-1/0],each$7(children,(function(child){var value=child.getValue(dimension);value<dataExtent[0]&&(dataExtent[0]=value),value>dataExtent[1]&&(dataExtent[1]=value)}))):dataExtent=[NaN,NaN];return{sum:sum,dataExtent:dataExtent}}(nodeModel,viewChildren,orderBy);if(0===info.sum)return node.viewChildren=[];if(info.sum=function(nodeModel,totalArea,sum,orderBy,orderedChildren){if(!orderBy)return sum;for(var visibleMin=nodeModel.get("visibleMin"),len=orderedChildren.length,deletePoint=len,i=len-1;i>=0;i--){var value=orderedChildren["asc"===orderBy?len-i-1:i].getValue();value/sum*totalArea<visibleMin&&(deletePoint=i,sum-=value)}return"asc"===orderBy?orderedChildren.splice(0,len-deletePoint):orderedChildren.splice(deletePoint,len-deletePoint),sum}(nodeModel,totalArea,info.sum,orderBy,viewChildren),0===info.sum)return node.viewChildren=[];for(var i=0,len=viewChildren.length;i<len;i++){var area=viewChildren[i].getValue()/info.sum*totalArea;viewChildren[i].setLayout({area:area})}overLeafDepth&&(viewChildren.length&&node.setLayout({isLeafRoot:!0},!0),viewChildren.length=0);return node.viewChildren=viewChildren,node.setLayout({dataExtent:info.dataExtent},!0),viewChildren}(node,nodeModel,totalArea,options,hideChildren,depth);if(viewChildren.length){var rect={x:layoutOffset,y:layoutOffsetUpper,width:width,height:height},rowFixedLength=mathMin$2(width,height),best=1/0,row=[];row.area=0;for(var i=0,len=viewChildren.length;i<len;){var child=viewChildren[i];row.push(child),row.area+=child.getLayout().area;var score=worst(row,rowFixedLength,options.squareRatio);score<=best?(i++,best=score):(row.area-=row.pop().getLayout().area,position(row,rowFixedLength,rect,halfGapWidth,!1),rowFixedLength=mathMin$2(rect.width,rect.height),row.length=row.area=0,best=1/0)}if(row.length&&position(row,rowFixedLength,rect,halfGapWidth,!0),!hideChildren){var childrenVisibleMin=nodeModel.get("childrenVisibleMin");null!=childrenVisibleMin&&totalArea<childrenVisibleMin&&(hideChildren=!0)}for(i=0,len=viewChildren.length;i<len;i++)squarify(viewChildren[i],options,hideChildren,depth+1)}}}function worst(row,rowFixedLength,ratio){for(var areaMax=0,areaMin=1/0,i=0,area=void 0,len=row.length;i<len;i++)(area=row[i].getLayout().area)&&(area<areaMin&&(areaMin=area),area>areaMax&&(areaMax=area));var squareArea=row.area*row.area,f=rowFixedLength*rowFixedLength*ratio;return squareArea?mathMax$2(f*areaMax/squareArea,squareArea/(f*areaMin)):1/0}function position(row,rowFixedLength,rect,halfGapWidth,flush){var idx0WhenH=rowFixedLength===rect.width?0:1,idx1WhenH=1-idx0WhenH,xy=["x","y"],wh=["width","height"],last=rect[xy[idx0WhenH]],rowOtherLength=rowFixedLength?row.area/rowFixedLength:0;(flush||rowOtherLength>rect[wh[idx1WhenH]])&&(rowOtherLength=rect[wh[idx1WhenH]]);for(var i=0,rowLen=row.length;i<rowLen;i++){var node=row[i],nodeLayout={},step=rowOtherLength?node.getLayout().area/rowOtherLength:0,wh1=nodeLayout[wh[idx1WhenH]]=mathMax$2(rowOtherLength-2*halfGapWidth,0),remain=rect[xy[idx0WhenH]]+rect[wh[idx0WhenH]]-last,modWH=i===rowLen-1||remain<step?remain:step,wh0=nodeLayout[wh[idx0WhenH]]=mathMax$2(modWH-2*halfGapWidth,0);nodeLayout[xy[idx1WhenH]]=rect[xy[idx1WhenH]]+mathMin$2(halfGapWidth,wh1/2),nodeLayout[xy[idx0WhenH]]=last+mathMin$2(halfGapWidth,wh0/2),last+=modWH,node.setLayout(nodeLayout,!0)}rect[xy[idx1WhenH]]+=rowOtherLength,rect[wh[idx1WhenH]]-=rowOtherLength}function prunning(node,clipRect,viewAbovePath,viewRoot,depth){var nodeLayout=node.getLayout(),nodeInViewAbovePath=viewAbovePath[depth],isAboveViewRoot=nodeInViewAbovePath&&nodeInViewAbovePath===node;if(!(nodeInViewAbovePath&&!isAboveViewRoot||depth===viewAbovePath.length&&node!==viewRoot)){node.setLayout({isInView:!0,invisible:!isAboveViewRoot&&!clipRect.intersect(nodeLayout),isAboveViewRoot:isAboveViewRoot},!0);var childClipRect=new BoundingRect$1(clipRect.x-nodeLayout.x,clipRect.y-nodeLayout.y,clipRect.width,clipRect.height);each$7(node.viewChildren||[],(function(child){prunning(child,childClipRect,viewAbovePath,viewRoot,depth+1)}))}}function getUpperLabelHeight(model){return model.get(PATH_UPPER_LABEL_SHOW)?model.get(PATH_UPPER_LABEL_HEIGHT):0}function categoryFilter(ecModel){var legendModels=ecModel.findComponents({mainType:"legend"});legendModels&&legendModels.length&&ecModel.eachSeriesByType("graph",(function(graphSeries){var categoriesData=graphSeries.getCategoriesData(),data=graphSeries.getGraph().data,categoryNames=categoriesData.mapArray(categoriesData.getName);data.filterSelf((function(idx){var category=data.getItemModel(idx).getShallow("category");if(null!=category){isNumber(category)&&(category=categoryNames[category]);for(var i=0;i<legendModels.length;i++)if(!legendModels[i].isSelected(category))return!1}return!0}))}))}function categoryVisual(ecModel){var paletteScope={};ecModel.eachSeriesByType("graph",(function(seriesModel){var categoriesData=seriesModel.getCategoriesData(),data=seriesModel.getData(),categoryNameIdxMap={};categoriesData.each((function(idx){var name=categoriesData.getName(idx);categoryNameIdxMap["ec-"+name]=idx;var itemModel=categoriesData.getItemModel(idx),style=itemModel.getModel("itemStyle").getItemStyle();style.fill||(style.fill=seriesModel.getColorFromPalette(name,paletteScope)),categoriesData.setItemVisual(idx,"style",style);for(var symbolVisualList=["symbol","symbolSize","symbolKeepAspect"],i=0;i<symbolVisualList.length;i++){var symbolVisual=itemModel.getShallow(symbolVisualList[i],!0);null!=symbolVisual&&categoriesData.setItemVisual(idx,symbolVisualList[i],symbolVisual)}})),categoriesData.count()&&data.each((function(idx){var categoryIdx=data.getItemModel(idx).getShallow("category");if(null!=categoryIdx){isString(categoryIdx)&&(categoryIdx=categoryNameIdxMap["ec-"+categoryIdx]);var categoryStyle=categoriesData.getItemVisual(categoryIdx,"style");extend(data.ensureUniqueItemVisual(idx,"style"),categoryStyle);for(var visualList=["symbol","symbolSize","symbolKeepAspect"],i=0;i<visualList.length;i++)data.setItemVisual(idx,visualList[i],categoriesData.getItemVisual(categoryIdx,visualList[i]))}}))}))}function normalize(a){return a instanceof Array||(a=[a,a]),a}function graphEdgeVisual(ecModel){ecModel.eachSeriesByType("graph",(function(seriesModel){var graph=seriesModel.getGraph(),edgeData=seriesModel.getEdgeData(),symbolType=normalize(seriesModel.get("edgeSymbol")),symbolSize=normalize(seriesModel.get("edgeSymbolSize"));edgeData.setVisual("fromSymbol",symbolType&&symbolType[0]),edgeData.setVisual("toSymbol",symbolType&&symbolType[1]),edgeData.setVisual("fromSymbolSize",symbolSize&&symbolSize[0]),edgeData.setVisual("toSymbolSize",symbolSize&&symbolSize[1]),edgeData.setVisual("style",seriesModel.getModel("lineStyle").getLineStyle()),edgeData.each((function(idx){var itemModel=edgeData.getItemModel(idx),edge=graph.getEdgeByIndex(idx),symbolType=normalize(itemModel.getShallow("symbol",!0)),symbolSize=normalize(itemModel.getShallow("symbolSize",!0)),style=itemModel.getModel("lineStyle").getLineStyle(),existsStyle=edgeData.ensureUniqueItemVisual(idx,"style");switch(extend(existsStyle,style),existsStyle.stroke){case"source":var nodeStyle=edge.node1.getVisual("style");existsStyle.stroke=nodeStyle&&nodeStyle.fill;break;case"target":nodeStyle=edge.node2.getVisual("style");existsStyle.stroke=nodeStyle&&nodeStyle.fill}symbolType[0]&&edge.setVisual("fromSymbol",symbolType[0]),symbolType[1]&&edge.setVisual("toSymbol",symbolType[1]),symbolSize[0]&&edge.setVisual("fromSymbolSize",symbolSize[0]),symbolSize[1]&&edge.setVisual("toSymbolSize",symbolSize[1])}))}))}var getAutoCurvenessParams=function(seriesModel){return seriesModel.get("autoCurveness")||null},createCurveness=function(seriesModel,appendLength){var autoCurvenessParmas=getAutoCurvenessParams(seriesModel),length=20,curvenessList=[];if(isNumber(autoCurvenessParmas))length=autoCurvenessParmas;else if(isArray(autoCurvenessParmas))return void(seriesModel.__curvenessList=autoCurvenessParmas);appendLength>length&&(length=appendLength);var len=length%2?length+2:length+3;curvenessList=[];for(var i=0;i<len;i++)curvenessList.push((i%2?i+1:i)/10*(i%2?-1:1));seriesModel.__curvenessList=curvenessList},getKeyOfEdges=function(n1,n2,seriesModel){var source=[n1.id,n1.dataIndex].join("."),target=[n2.id,n2.dataIndex].join(".");return[seriesModel.uid,source,target].join("--\x3e")},getOppositeKey=function(key){var keys=key.split("--\x3e");return[keys[0],keys[2],keys[1]].join("--\x3e")},getEdgeMapLengthWithKey=function(key,seriesModel){var edgeMap=seriesModel.__edgeMap;return edgeMap[key]?edgeMap[key].length:0};function getCurvenessForEdge(edge,seriesModel,index,needReverse){var autoCurvenessParams=getAutoCurvenessParams(seriesModel),isArrayParam=isArray(autoCurvenessParams);if(!autoCurvenessParams)return null;var edgeArray=function(edge,seriesModel){var key=getKeyOfEdges(edge.node1,edge.node2,seriesModel);return seriesModel.__edgeMap[key]}(edge,seriesModel);if(!edgeArray)return null;for(var edgeIndex=-1,i=0;i<edgeArray.length;i++)if(edgeArray[i]===index){edgeIndex=i;break}var totalLen=function(edge,seriesModel){return getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1,edge.node2,seriesModel),seriesModel)+getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2,edge.node1,seriesModel),seriesModel)}(edge,seriesModel);createCurveness(seriesModel,totalLen),edge.lineStyle=edge.lineStyle||{};var curKey=getKeyOfEdges(edge.node1,edge.node2,seriesModel),curvenessList=seriesModel.__curvenessList,parityCorrection=isArrayParam||totalLen%2?0:1;if(edgeArray.isForward)return curvenessList[parityCorrection+edgeIndex];var oppositeKey=getOppositeKey(curKey),len=getEdgeMapLengthWithKey(oppositeKey,seriesModel),resValue=curvenessList[edgeIndex+len+parityCorrection];return needReverse?isArrayParam?autoCurvenessParams&&0===autoCurvenessParams[0]?(len+parityCorrection)%2?resValue:-resValue:((len%2?0:1)+parityCorrection)%2?resValue:-resValue:(len+parityCorrection)%2?resValue:-resValue:curvenessList[edgeIndex+len+parityCorrection]}function simpleLayout(seriesModel){var coordSys=seriesModel.coordinateSystem;if(!coordSys||"view"===coordSys.type){var graph=seriesModel.getGraph();graph.eachNode((function(node){var model=node.getModel();node.setLayout([+model.get("x"),+model.get("y")])})),simpleLayoutEdge(graph,seriesModel)}}function simpleLayoutEdge(graph,seriesModel){graph.eachEdge((function(edge,index){var curveness=retrieve3(edge.getModel().get(["lineStyle","curveness"]),-getCurvenessForEdge(edge,seriesModel,index,!0),0),p1=clone$2(edge.node1.getLayout()),p2=clone$2(edge.node2.getLayout()),points=[p1,p2];+curveness&&points.push([(p1[0]+p2[0])/2-(p1[1]-p2[1])*curveness,(p1[1]+p2[1])/2-(p2[0]-p1[0])*curveness]),edge.setLayout(points)}))}function graphSimpleLayout(ecModel,api){ecModel.eachSeriesByType("graph",(function(seriesModel){var layout=seriesModel.get("layout"),coordSys=seriesModel.coordinateSystem;if(coordSys&&"view"!==coordSys.type){var data_1=seriesModel.getData(),dimensions_1=[];each$b(coordSys.dimensions,(function(coordDim){dimensions_1=dimensions_1.concat(data_1.mapDimensionsAll(coordDim))}));for(var dataIndex=0;dataIndex<data_1.count();dataIndex++){for(var value=[],hasValue=!1,i=0;i<dimensions_1.length;i++){var val=data_1.get(dimensions_1[i],dataIndex);isNaN(val)||(hasValue=!0),value.push(val)}hasValue?data_1.setItemLayout(dataIndex,coordSys.dataToPoint(value)):data_1.setItemLayout(dataIndex,[NaN,NaN])}simpleLayoutEdge(data_1.graph,seriesModel)}else layout&&"none"!==layout||simpleLayout(seriesModel)}))}function getNodeGlobalScale(seriesModel){var coordSys=seriesModel.coordinateSystem;if("view"!==coordSys.type)return 1;var nodeScaleRatio=seriesModel.option.nodeScaleRatio,groupZoom=coordSys.scaleX;return((coordSys.getZoom()-1)*nodeScaleRatio+1)/groupZoom}function getSymbolSize(node){var symbolSize=node.getVisual("symbolSize");return symbolSize instanceof Array&&(symbolSize=(symbolSize[0]+symbolSize[1])/2),+symbolSize}var PI$1=Math.PI,_symbolRadiansHalf=[];function circularLayout(seriesModel,basedOn,draggingNode,pointer){var coordSys=seriesModel.coordinateSystem;if(!coordSys||"view"===coordSys.type){var rect=coordSys.getBoundingRect(),nodeData=seriesModel.getData(),graph=nodeData.graph,cx=rect.width/2+rect.x,cy=rect.height/2+rect.y,r=Math.min(rect.width,rect.height)/2,count=nodeData.count();if(nodeData.setLayout({cx:cx,cy:cy}),count){if(draggingNode){var _a=coordSys.pointToData(pointer),tempX=_a[0],tempY=_a[1],v=[tempX-cx,tempY-cy];normalize$2(v,v),scale$2(v,v,r),draggingNode.setLayout([cx+v[0],cy+v[1]],!0),rotateNodeLabel(draggingNode,seriesModel.get(["circular","rotateLabel"]),cx,cy)}_layoutNodesBasedOn[basedOn](seriesModel,graph,nodeData,r,cx,cy,count),graph.eachEdge((function(edge,index){var cp1,curveness=retrieve3(edge.getModel().get(["lineStyle","curveness"]),getCurvenessForEdge(edge,seriesModel,index),0),p1=clone$2(edge.node1.getLayout()),p2=clone$2(edge.node2.getLayout()),x12=(p1[0]+p2[0])/2,y12=(p1[1]+p2[1])/2;+curveness&&(cp1=[cx*(curveness*=3)+x12*(1-curveness),cy*curveness+y12*(1-curveness)]),edge.setLayout([p1,p2,cp1])}))}}}var _layoutNodesBasedOn={value:function(seriesModel,graph,nodeData,r,cx,cy,count){var angle=0,sum=nodeData.getSum("value"),unitAngle=2*Math.PI/(sum||count);graph.eachNode((function(node){var value=node.getValue("value"),radianHalf=unitAngle*(sum?value:1)/2;angle+=radianHalf,node.setLayout([r*Math.cos(angle)+cx,r*Math.sin(angle)+cy]),angle+=radianHalf}))},symbolSize:function(seriesModel,graph,nodeData,r,cx,cy,count){var sumRadian=0;_symbolRadiansHalf.length=count;var nodeScale=getNodeGlobalScale(seriesModel);graph.eachNode((function(node){var symbolSize=getSymbolSize(node);isNaN(symbolSize)&&(symbolSize=2),symbolSize<0&&(symbolSize=0),symbolSize*=nodeScale;var symbolRadianHalf=Math.asin(symbolSize/2/r);isNaN(symbolRadianHalf)&&(symbolRadianHalf=PI$1/2),_symbolRadiansHalf[node.dataIndex]=symbolRadianHalf,sumRadian+=2*symbolRadianHalf}));var halfRemainRadian=(2*PI$1-sumRadian)/count/2,angle=0;graph.eachNode((function(node){var radianHalf=halfRemainRadian+_symbolRadiansHalf[node.dataIndex];angle+=radianHalf,(!node.getLayout()||!node.getLayout().fixed)&&node.setLayout([r*Math.cos(angle)+cx,r*Math.sin(angle)+cy]),angle+=radianHalf}))}};function rotateNodeLabel(node,circularRotateLabel,cx,cy){var el=node.getGraphicEl();if(el){var labelRotate=node.getModel().get(["label","rotate"])||0,symbolPath=el.getSymbolPath();if(circularRotateLabel){var pos=node.getLayout(),rad=Math.atan2(pos[1]-cy,pos[0]-cx);rad<0&&(rad=2*Math.PI+rad);var isLeft=pos[0]<cx;isLeft&&(rad-=Math.PI);var textPosition=isLeft?"left":"right";symbolPath.setTextConfig({rotation:-rad,position:textPosition,origin:"center"});var emphasisState=symbolPath.ensureState("emphasis");extend(emphasisState.textConfig||(emphasisState.textConfig={}),{position:textPosition})}else symbolPath.setTextConfig({rotation:labelRotate*=Math.PI/180})}}function graphCircularLayout(ecModel){ecModel.eachSeriesByType("graph",(function(seriesModel){"circular"===seriesModel.get("layout")&&circularLayout(seriesModel,"symbolSize")}))}var scaleAndAdd=scaleAndAdd$1;function graphForceLayout(ecModel){ecModel.eachSeriesByType("graph",(function(graphSeries){var coordSys=graphSeries.coordinateSystem;if(!coordSys||"view"===coordSys.type)if("force"===graphSeries.get("layout")){var preservedPoints_1=graphSeries.preservedPoints||{},graph_1=graphSeries.getGraph(),nodeData_1=graph_1.data,edgeData=graph_1.edgeData,forceModel=graphSeries.getModel("force"),initLayout=forceModel.get("initLayout");graphSeries.preservedPoints?nodeData_1.each((function(idx){var id=nodeData_1.getId(idx);nodeData_1.setItemLayout(idx,preservedPoints_1[id]||[NaN,NaN])})):initLayout&&"none"!==initLayout?"circular"===initLayout&&circularLayout(graphSeries,"value"):simpleLayout(graphSeries);var nodeDataExtent_1=nodeData_1.getDataExtent("value"),edgeDataExtent_1=edgeData.getDataExtent("value"),repulsion=forceModel.get("repulsion"),edgeLength=forceModel.get("edgeLength"),repulsionArr_1=isArray(repulsion)?repulsion:[repulsion,repulsion],edgeLengthArr_1=isArray(edgeLength)?edgeLength:[edgeLength,edgeLength];edgeLengthArr_1=[edgeLengthArr_1[1],edgeLengthArr_1[0]];var nodes_1=nodeData_1.mapArray("value",(function(value,idx){var point=nodeData_1.getItemLayout(idx),rep=linearMap(value,nodeDataExtent_1,repulsionArr_1);return isNaN(rep)&&(rep=(repulsionArr_1[0]+repulsionArr_1[1])/2),{w:rep,rep:rep,fixed:nodeData_1.getItemModel(idx).get("fixed"),p:!point||isNaN(point[0])||isNaN(point[1])?null:point}})),edges=edgeData.mapArray("value",(function(value,idx){var edge=graph_1.getEdgeByIndex(idx),d=linearMap(value,edgeDataExtent_1,edgeLengthArr_1);isNaN(d)&&(d=(edgeLengthArr_1[0]+edgeLengthArr_1[1])/2);var edgeModel=edge.getModel(),curveness=retrieve3(edge.getModel().get(["lineStyle","curveness"]),-getCurvenessForEdge(edge,graphSeries,idx,!0),0);return{n1:nodes_1[edge.node1.dataIndex],n2:nodes_1[edge.node2.dataIndex],d:d,curveness:curveness,ignoreForceLayout:edgeModel.get("ignoreForceLayout")}})),rect=coordSys.getBoundingRect(),forceInstance=function(inNodes,inEdges,opts){for(var nodes=inNodes,edges=inEdges,rect=opts.rect,width=rect.width,height=rect.height,center=[rect.x+width/2,rect.y+height/2],gravity=null==opts.gravity?.1:opts.gravity,i=0;i<nodes.length;i++){var n=nodes[i];n.p||(n.p=create$1(width*(Math.random()-.5)+center[0],height*(Math.random()-.5)+center[1])),n.pp=clone$2(n.p),n.edges=null}var beforeStepCallback,afterStepCallback,initialFriction=null==opts.friction?.6:opts.friction,friction=initialFriction;return{warmUp:function(){friction=.8*initialFriction},setFixed:function(idx){nodes[idx].fixed=!0},setUnfixed:function(idx){nodes[idx].fixed=!1},beforeStep:function(cb){beforeStepCallback=cb},afterStep:function(cb){afterStepCallback=cb},step:function(cb){beforeStepCallback&&beforeStepCallback(nodes,edges);for(var v12=[],nLen=nodes.length,i=0;i<edges.length;i++){var e=edges[i];if(!e.ignoreForceLayout){var n1=e.n1;sub(v12,(n2=e.n2).p,n1.p);var d=len(v12)-e.d,w=n2.w/(n1.w+n2.w);isNaN(w)&&(w=0),normalize$2(v12,v12),!n1.fixed&&scaleAndAdd(n1.p,n1.p,v12,w*d*friction),!n2.fixed&&scaleAndAdd(n2.p,n2.p,v12,-(1-w)*d*friction)}}for(i=0;i<nLen;i++)(n=nodes[i]).fixed||(sub(v12,center,n.p),scaleAndAdd(n.p,n.p,v12,gravity*friction));for(i=0;i<nLen;i++){n1=nodes[i];for(var j=i+1;j<nLen;j++){var n2;sub(v12,(n2=nodes[j]).p,n1.p),0===(d=len(v12))&&(set$1(v12,Math.random()-.5,Math.random()-.5),d=1);var repFact=(n1.rep+n2.rep)/d/d;!n1.fixed&&scaleAndAdd(n1.pp,n1.pp,v12,repFact),!n2.fixed&&scaleAndAdd(n2.pp,n2.pp,v12,-repFact)}}var v=[];for(i=0;i<nLen;i++){var n;(n=nodes[i]).fixed||(sub(v,n.p,n.pp),scaleAndAdd(n.p,n.p,v,friction),copy$1(n.pp,n.p))}var finished=(friction*=.992)<.01;afterStepCallback&&afterStepCallback(nodes,edges,finished),cb&&cb(finished)}}}(nodes_1,edges,{rect:rect,gravity:forceModel.get("gravity"),friction:forceModel.get("friction")});forceInstance.beforeStep((function(nodes,edges){for(var i=0,l=nodes.length;i<l;i++)nodes[i].fixed&&copy$1(nodes[i].p,graph_1.getNodeByIndex(i).getLayout())})),forceInstance.afterStep((function(nodes,edges,stopped){for(var i=0,l=nodes.length;i<l;i++)nodes[i].fixed||graph_1.getNodeByIndex(i).setLayout(nodes[i].p),preservedPoints_1[nodeData_1.getId(i)]=nodes[i].p;for(i=0,l=edges.length;i<l;i++){var e=edges[i],edge=graph_1.getEdgeByIndex(i),p1=e.n1.p,p2=e.n2.p,points=edge.getLayout();(points=points?points.slice():[])[0]=points[0]||[],points[1]=points[1]||[],copy$1(points[0],p1),copy$1(points[1],p2),+e.curveness&&(points[2]=[(p1[0]+p2[0])/2-(p1[1]-p2[1])*e.curveness,(p1[1]+p2[1])/2-(p2[0]-p1[0])*e.curveness]),edge.setLayout(points)}})),graphSeries.forceLayout=forceInstance,graphSeries.preservedPoints=preservedPoints_1,forceInstance.step()}else graphSeries.forceLayout=null}))}function createViewCoordSys(ecModel,api){var viewList=[];return ecModel.eachSeriesByType("graph",(function(seriesModel){var coordSysType=seriesModel.get("coordinateSystem");if(!coordSysType||"view"===coordSysType){var data_1=seriesModel.getData(),min=[],max=[];fromPoints(data_1.mapArray((function(idx){var itemModel=data_1.getItemModel(idx);return[+itemModel.get("x"),+itemModel.get("y")]})),min,max),max[0]-min[0]==0&&(max[0]+=1,min[0]-=1),max[1]-min[1]==0&&(max[1]+=1,min[1]-=1);var aspect=(max[0]-min[0])/(max[1]-min[1]),viewRect=function(seriesModel,api,aspect){return getLayoutRect(extend(seriesModel.getBoxLayoutParams(),{aspect:aspect}),{width:api.getWidth(),height:api.getHeight()})}(seriesModel,api,aspect);isNaN(aspect)&&(min=[viewRect.x,viewRect.y],max=[viewRect.x+viewRect.width,viewRect.y+viewRect.height]);var bbWidth=max[0]-min[0],bbHeight=max[1]-min[1],viewWidth=viewRect.width,viewHeight=viewRect.height,viewCoordSys=seriesModel.coordinateSystem=new View$1;viewCoordSys.zoomLimit=seriesModel.get("scaleLimit"),viewCoordSys.setBoundingRect(min[0],min[1],bbWidth,bbHeight),viewCoordSys.setViewRect(viewRect.x,viewRect.y,viewWidth,viewHeight),viewCoordSys.setCenter(seriesModel.get("center"),api),viewCoordSys.setZoom(seriesModel.get("zoom")),viewList.push(viewCoordSys)}})),viewList}var straightLineProto=Line$3.prototype,bezierCurveProto=BezierCurve$1.prototype,StraightLineShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function isStraightLine(shape){return isNaN(+shape.cpx1)||isNaN(+shape.cpy1)}!function(_super){function CurveShape(){return null!==_super&&_super.apply(this,arguments)||this}__extends(CurveShape,_super)}(StraightLineShape);var ECLinePath$1=function(_super){function ECLinePath(opts){var _this=_super.call(this,opts)||this;return _this.type="ec-line",_this}return __extends(ECLinePath,_super),ECLinePath.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},ECLinePath.prototype.getDefaultShape=function(){return new StraightLineShape},ECLinePath.prototype.buildPath=function(ctx,shape){isStraightLine(shape)?straightLineProto.buildPath.call(this,ctx,shape):bezierCurveProto.buildPath.call(this,ctx,shape)},ECLinePath.prototype.pointAt=function(t){return isStraightLine(this.shape)?straightLineProto.pointAt.call(this,t):bezierCurveProto.pointAt.call(this,t)},ECLinePath.prototype.tangentAt=function(t){var shape=this.shape,p=isStraightLine(shape)?[shape.x2-shape.x1,shape.y2-shape.y1]:bezierCurveProto.tangentAt.call(this,t);return normalize$2(p,p)},ECLinePath}(Path$1),SYMBOL_CATEGORIES=["fromSymbol","toSymbol"];function makeSymbolTypeKey(symbolCategory){return"_"+symbolCategory+"Type"}function makeSymbolTypeValue(name,lineData,idx){var symbolType=lineData.getItemVisual(idx,name);if(!symbolType||"none"===symbolType)return symbolType;var symbolSize=lineData.getItemVisual(idx,name+"Size"),symbolRotate=lineData.getItemVisual(idx,name+"Rotate"),symbolOffset=lineData.getItemVisual(idx,name+"Offset"),symbolKeepAspect=lineData.getItemVisual(idx,name+"KeepAspect"),symbolSizeArr=normalizeSymbolSize(symbolSize);return symbolType+symbolSizeArr+normalizeSymbolOffset(symbolOffset||0,symbolSizeArr)+(symbolRotate||"")+(symbolKeepAspect||"")}function createSymbol(name,lineData,idx){var symbolType=lineData.getItemVisual(idx,name);if(symbolType&&"none"!==symbolType){var symbolSize=lineData.getItemVisual(idx,name+"Size"),symbolRotate=lineData.getItemVisual(idx,name+"Rotate"),symbolOffset=lineData.getItemVisual(idx,name+"Offset"),symbolKeepAspect=lineData.getItemVisual(idx,name+"KeepAspect"),symbolSizeArr=normalizeSymbolSize(symbolSize),symbolOffsetArr=normalizeSymbolOffset(symbolOffset||0,symbolSizeArr),symbolPath=createSymbol$1(symbolType,-symbolSizeArr[0]/2+symbolOffsetArr[0],-symbolSizeArr[1]/2+symbolOffsetArr[1],symbolSizeArr[0],symbolSizeArr[1],null,symbolKeepAspect);return symbolPath.__specifiedRotation=null==symbolRotate||isNaN(symbolRotate)?void 0:+symbolRotate*Math.PI/180||0,symbolPath.name=name,symbolPath}}function setLinePoints(targetShape,points){targetShape.x1=points[0][0],targetShape.y1=points[0][1],targetShape.x2=points[1][0],targetShape.y2=points[1][1],targetShape.percent=1;var cp1=points[2];cp1?(targetShape.cpx1=cp1[0],targetShape.cpy1=cp1[1]):(targetShape.cpx1=NaN,targetShape.cpy1=NaN)}var Line=function(_super){function Line(lineData,idx,seriesScope){var _this=_super.call(this)||this;return _this._createLine(lineData,idx,seriesScope),_this}return __extends(Line,_super),Line.prototype._createLine=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel,line=function(points){var line=new ECLinePath$1({name:"line",subPixelOptimize:!0});return setLinePoints(line.shape,points),line}(lineData.getItemLayout(idx));line.shape.percent=0,initProps(line,{shape:{percent:1}},seriesModel,idx),this.add(line),each$b(SYMBOL_CATEGORIES,(function(symbolCategory){var symbol=createSymbol(symbolCategory,lineData,idx);this.add(symbol),this[makeSymbolTypeKey(symbolCategory)]=makeSymbolTypeValue(symbolCategory,lineData,idx)}),this),this._updateCommonStl(lineData,idx,seriesScope)},Line.prototype.updateData=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel,line=this.childOfName("line"),linePoints=lineData.getItemLayout(idx),target={shape:{}};setLinePoints(target.shape,linePoints),updateProps$1(line,target,seriesModel,idx),each$b(SYMBOL_CATEGORIES,(function(symbolCategory){var symbolType=makeSymbolTypeValue(symbolCategory,lineData,idx),key=makeSymbolTypeKey(symbolCategory);if(this[key]!==symbolType){this.remove(this.childOfName(symbolCategory));var symbol=createSymbol(symbolCategory,lineData,idx);this.add(symbol)}this[key]=symbolType}),this),this._updateCommonStl(lineData,idx,seriesScope)},Line.prototype.getLinePath=function(){return this.childAt(0)},Line.prototype._updateCommonStl=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel,line=this.childOfName("line"),emphasisLineStyle=seriesScope&&seriesScope.emphasisLineStyle,blurLineStyle=seriesScope&&seriesScope.blurLineStyle,selectLineStyle=seriesScope&&seriesScope.selectLineStyle,labelStatesModels=seriesScope&&seriesScope.labelStatesModels,emphasisDisabled=seriesScope&&seriesScope.emphasisDisabled,focus=seriesScope&&seriesScope.focus,blurScope=seriesScope&&seriesScope.blurScope;if(!seriesScope||lineData.hasItemOption){var itemModel=lineData.getItemModel(idx),emphasisModel=itemModel.getModel("emphasis");emphasisLineStyle=emphasisModel.getModel("lineStyle").getLineStyle(),blurLineStyle=itemModel.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle=itemModel.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled=emphasisModel.get("disabled"),focus=emphasisModel.get("focus"),blurScope=emphasisModel.get("blurScope"),labelStatesModels=getLabelStatesModels(itemModel)}var lineStyle=lineData.getItemVisual(idx,"style"),visualColor=lineStyle.stroke;line.useStyle(lineStyle),line.style.fill=null,line.style.strokeNoScale=!0,line.ensureState("emphasis").style=emphasisLineStyle,line.ensureState("blur").style=blurLineStyle,line.ensureState("select").style=selectLineStyle,each$b(SYMBOL_CATEGORIES,(function(symbolCategory){var symbol=this.childOfName(symbolCategory);if(symbol){symbol.setColor(visualColor),symbol.style.opacity=lineStyle.opacity;for(var i=0;i<SPECIAL_STATES.length;i++){var stateName=SPECIAL_STATES[i],lineState=line.getState(stateName);if(lineState){var lineStateStyle=lineState.style||{},state=symbol.ensureState(stateName),stateStyle=state.style||(state.style={});null!=lineStateStyle.stroke&&(stateStyle[symbol.__isEmptyBrush?"stroke":"fill"]=lineStateStyle.stroke),null!=lineStateStyle.opacity&&(stateStyle.opacity=lineStateStyle.opacity)}}symbol.markRedraw()}}),this);var rawVal=seriesModel.getRawValue(idx);setLabelStyle(this,labelStatesModels,{labelDataIndex:idx,labelFetcher:{getFormattedLabel:function(dataIndex,stateName){return seriesModel.getFormattedLabel(dataIndex,stateName,lineData.dataType)}},inheritColor:visualColor||"#000",defaultOpacity:lineStyle.opacity,defaultText:(null==rawVal?lineData.getName(idx):isFinite(rawVal)?round$3(rawVal):rawVal)+""});var label=this.getTextContent();if(label){var labelNormalModel=labelStatesModels.normal;label.__align=label.style.align,label.__verticalAlign=label.style.verticalAlign,label.__position=labelNormalModel.get("position")||"middle";var distance=labelNormalModel.get("distance");isArray(distance)||(distance=[distance,distance]),label.__labelDistance=distance}this.setTextConfig({position:null,local:!0,inside:!1}),toggleHoverEmphasis(this,focus,blurScope,emphasisDisabled)},Line.prototype.highlight=function(){enterEmphasis(this)},Line.prototype.downplay=function(){leaveEmphasis(this)},Line.prototype.updateLayout=function(lineData,idx){this.setLinePoints(lineData.getItemLayout(idx))},Line.prototype.setLinePoints=function(points){var linePath=this.childOfName("line");setLinePoints(linePath.shape,points),linePath.dirty()},Line.prototype.beforeUpdate=function(){var symbolFrom=this.childOfName("fromSymbol"),symbolTo=this.childOfName("toSymbol"),label=this.getTextContent();if(symbolFrom||symbolTo||label&&!label.ignore){for(var invScale=1,parentNode=this.parent;parentNode;)parentNode.scaleX&&(invScale/=parentNode.scaleX),parentNode=parentNode.parent;var line=this.childOfName("line");if(this.__dirty||line.__dirty){var percent=line.shape.percent,fromPos=line.pointAt(0),toPos=line.pointAt(percent),d=sub([],toPos,fromPos);if(normalize$2(d,d),symbolFrom&&(symbolFrom.setPosition(fromPos),setSymbolRotation(symbolFrom,0),symbolFrom.scaleX=symbolFrom.scaleY=invScale*percent,symbolFrom.markRedraw()),symbolTo&&(symbolTo.setPosition(toPos),setSymbolRotation(symbolTo,1),symbolTo.scaleX=symbolTo.scaleY=invScale*percent,symbolTo.markRedraw()),label&&!label.ignore){label.x=label.y=0,label.originX=label.originY=0;var textAlign=void 0,textVerticalAlign=void 0,distance=label.__labelDistance,distanceX=distance[0]*invScale,distanceY=distance[1]*invScale,halfPercent=percent/2,tangent=line.tangentAt(halfPercent),n=[tangent[1],-tangent[0]],cp=line.pointAt(halfPercent);n[1]>0&&(n[0]=-n[0],n[1]=-n[1]);var dir=tangent[0]<0?-1:1;if("start"!==label.__position&&"end"!==label.__position){var rotation=-Math.atan2(tangent[1],tangent[0]);toPos[0]<fromPos[0]&&(rotation=Math.PI+rotation),label.rotation=rotation}var dy=void 0;switch(label.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":dy=-distanceY,textVerticalAlign="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":dy=distanceY,textVerticalAlign="top";break;default:dy=0,textVerticalAlign="middle"}switch(label.__position){case"end":label.x=d[0]*distanceX+toPos[0],label.y=d[1]*distanceY+toPos[1],textAlign=d[0]>.8?"left":d[0]<-.8?"right":"center",textVerticalAlign=d[1]>.8?"top":d[1]<-.8?"bottom":"middle";break;case"start":label.x=-d[0]*distanceX+fromPos[0],label.y=-d[1]*distanceY+fromPos[1],textAlign=d[0]>.8?"right":d[0]<-.8?"left":"center",textVerticalAlign=d[1]>.8?"bottom":d[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":label.x=distanceX*dir+fromPos[0],label.y=fromPos[1]+dy,textAlign=tangent[0]<0?"right":"left",label.originX=-distanceX*dir,label.originY=-dy;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":label.x=cp[0],label.y=cp[1]+dy,textAlign="center",label.originY=-dy;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":label.x=-distanceX*dir+toPos[0],label.y=toPos[1]+dy,textAlign=tangent[0]>=0?"right":"left",label.originX=distanceX*dir,label.originY=-dy}label.scaleX=label.scaleY=invScale,label.setStyle({verticalAlign:label.__verticalAlign||textVerticalAlign,align:label.__align||textAlign})}}}function setSymbolRotation(symbol,percent){var specifiedRotation=symbol.__specifiedRotation;if(null==specifiedRotation){var tangent=line.tangentAt(percent);symbol.attr("rotation",(1===percent?-1:1)*Math.PI/2-Math.atan2(tangent[1],tangent[0]))}else symbol.attr("rotation",specifiedRotation)}},Line}(Group$4),Line$1=Line;function makeSeriesScope$1(lineData){var hostModel=lineData.hostModel,emphasisModel=hostModel.getModel("emphasis");return{lineStyle:hostModel.getModel("lineStyle").getLineStyle(),emphasisLineStyle:emphasisModel.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:hostModel.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:hostModel.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:emphasisModel.get("disabled"),blurScope:emphasisModel.get("blurScope"),focus:emphasisModel.get("focus"),labelStatesModels:getLabelStatesModels(hostModel)}}function isPointNaN(pt){return isNaN(pt[0])||isNaN(pt[1])}function lineNeedsDraw(pts){return pts&&!isPointNaN(pts[0])&&!isPointNaN(pts[1])}var LineDraw$1=function(){function LineDraw(LineCtor){this.group=new Group$4,this._LineCtor=LineCtor||Line$1}return LineDraw.prototype.updateData=function(lineData){var _this=this;this._progressiveEls=null;var group=this.group,oldLineData=this._lineData;this._lineData=lineData,oldLineData||group.removeAll();var seriesScope=makeSeriesScope$1(lineData);lineData.diff(oldLineData).add((function(idx){_this._doAdd(lineData,idx,seriesScope)})).update((function(newIdx,oldIdx){_this._doUpdate(oldLineData,lineData,oldIdx,newIdx,seriesScope)})).remove((function(idx){group.remove(oldLineData.getItemGraphicEl(idx))})).execute()},LineDraw.prototype.updateLayout=function(){var lineData=this._lineData;lineData&&lineData.eachItemGraphicEl((function(el,idx){el.updateLayout(lineData,idx)}),this)},LineDraw.prototype.incrementalPrepareUpdate=function(lineData){this._seriesScope=makeSeriesScope$1(lineData),this._lineData=null,this.group.removeAll()},LineDraw.prototype.incrementalUpdate=function(taskParams,lineData){function updateIncrementalAndHover(el){el.isGroup||function(el){return el.animators&&el.animators.length>0}(el)||(el.incremental=!0,el.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var idx=taskParams.start;idx<taskParams.end;idx++){if(lineNeedsDraw(lineData.getItemLayout(idx))){var el=new this._LineCtor(lineData,idx,this._seriesScope);el.traverse(updateIncrementalAndHover),this.group.add(el),lineData.setItemGraphicEl(idx,el),this._progressiveEls.push(el)}}},LineDraw.prototype.remove=function(){this.group.removeAll()},LineDraw.prototype.eachRendered=function(cb){traverseElements(this._progressiveEls||this.group,cb)},LineDraw.prototype._doAdd=function(lineData,idx,seriesScope){if(lineNeedsDraw(lineData.getItemLayout(idx))){var el=new this._LineCtor(lineData,idx,seriesScope);lineData.setItemGraphicEl(idx,el),this.group.add(el)}},LineDraw.prototype._doUpdate=function(oldLineData,newLineData,oldIdx,newIdx,seriesScope){var itemEl=oldLineData.getItemGraphicEl(oldIdx);lineNeedsDraw(newLineData.getItemLayout(newIdx))?(itemEl?itemEl.updateData(newLineData,newIdx,seriesScope):itemEl=new this._LineCtor(newLineData,newIdx,seriesScope),newLineData.setItemGraphicEl(newIdx,itemEl),this.group.add(itemEl)):this.group.remove(itemEl)},LineDraw}(),v1=[],v2=[],v3=[],quadraticAt=quadraticAt$1,v2DistSquare=distSquare,mathAbs=Math.abs;function intersectCurveCircle(curvePoints,center,radius){for(var t,p0=curvePoints[0],p1=curvePoints[1],p2=curvePoints[2],d=1/0,radiusSquare=radius*radius,interval=.1,_t=.1;_t<=.9;_t+=.1){v1[0]=quadraticAt(p0[0],p1[0],p2[0],_t),v1[1]=quadraticAt(p0[1],p1[1],p2[1],_t),(diff=mathAbs(v2DistSquare(v1,center)-radiusSquare))<d&&(d=diff,t=_t)}for(var i=0;i<32;i++){var next=t+interval;v2[0]=quadraticAt(p0[0],p1[0],p2[0],t),v2[1]=quadraticAt(p0[1],p1[1],p2[1],t),v3[0]=quadraticAt(p0[0],p1[0],p2[0],next),v3[1]=quadraticAt(p0[1],p1[1],p2[1],next);var diff=v2DistSquare(v2,center)-radiusSquare;if(mathAbs(diff)<.01)break;var nextDiff=v2DistSquare(v3,center)-radiusSquare;interval/=2,diff<0?nextDiff>=0?t+=interval:t-=interval:nextDiff>=0?t-=interval:t+=interval}return t}function adjustEdge(graph,scale){var tmp0=[],quadraticSubdivide$1=quadraticSubdivide,pts=[[],[],[]],pts2=[[],[]],v=[];scale/=2,graph.eachEdge((function(edge,idx){var linePoints=edge.getLayout(),fromSymbol=edge.getVisual("fromSymbol"),toSymbol=edge.getVisual("toSymbol");linePoints.__original||(linePoints.__original=[clone$2(linePoints[0]),clone$2(linePoints[1])],linePoints[2]&&linePoints.__original.push(clone$2(linePoints[2])));var originalPoints=linePoints.__original;if(null!=linePoints[2]){if(copy$1(pts[0],originalPoints[0]),copy$1(pts[1],originalPoints[2]),copy$1(pts[2],originalPoints[1]),fromSymbol&&"none"!==fromSymbol){var symbolSize=getSymbolSize(edge.node1),t=intersectCurveCircle(pts,originalPoints[0],symbolSize*scale);quadraticSubdivide$1(pts[0][0],pts[1][0],pts[2][0],t,tmp0),pts[0][0]=tmp0[3],pts[1][0]=tmp0[4],quadraticSubdivide$1(pts[0][1],pts[1][1],pts[2][1],t,tmp0),pts[0][1]=tmp0[3],pts[1][1]=tmp0[4]}if(toSymbol&&"none"!==toSymbol){symbolSize=getSymbolSize(edge.node2),t=intersectCurveCircle(pts,originalPoints[1],symbolSize*scale);quadraticSubdivide$1(pts[0][0],pts[1][0],pts[2][0],t,tmp0),pts[1][0]=tmp0[1],pts[2][0]=tmp0[2],quadraticSubdivide$1(pts[0][1],pts[1][1],pts[2][1],t,tmp0),pts[1][1]=tmp0[1],pts[2][1]=tmp0[2]}copy$1(linePoints[0],pts[0]),copy$1(linePoints[1],pts[2]),copy$1(linePoints[2],pts[1])}else{if(copy$1(pts2[0],originalPoints[0]),copy$1(pts2[1],originalPoints[1]),sub(v,pts2[1],pts2[0]),normalize$2(v,v),fromSymbol&&"none"!==fromSymbol){symbolSize=getSymbolSize(edge.node1);scaleAndAdd$1(pts2[0],pts2[0],v,symbolSize*scale)}if(toSymbol&&"none"!==toSymbol){symbolSize=getSymbolSize(edge.node2);scaleAndAdd$1(pts2[1],pts2[1],v,-symbolSize*scale)}copy$1(linePoints[0],pts2[0]),copy$1(linePoints[1],pts2[1])}}))}function isViewCoordSys(coordSys){return"view"===coordSys.type}var GraphView=function(_super){function GraphView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=GraphView.type,_this}return __extends(GraphView,_super),GraphView.prototype.init=function(ecModel,api){var symbolDraw=new SymbolDraw$1,lineDraw=new LineDraw$1,group=this.group;this._controller=new RoamController$1(api.getZr()),this._controllerHost={target:group},group.add(symbolDraw.group),group.add(lineDraw.group),this._symbolDraw=symbolDraw,this._lineDraw=lineDraw,this._firstRender=!0},GraphView.prototype.render=function(seriesModel,ecModel,api){var _this=this,coordSys=seriesModel.coordinateSystem;this._model=seriesModel;var symbolDraw=this._symbolDraw,lineDraw=this._lineDraw,group=this.group;if(isViewCoordSys(coordSys)){var groupNewProp={x:coordSys.x,y:coordSys.y,scaleX:coordSys.scaleX,scaleY:coordSys.scaleY};this._firstRender?group.attr(groupNewProp):updateProps$1(group,groupNewProp,seriesModel)}adjustEdge(seriesModel.getGraph(),getNodeGlobalScale(seriesModel));var data=seriesModel.getData();symbolDraw.updateData(data);var edgeData=seriesModel.getEdgeData();lineDraw.updateData(edgeData),this._updateNodeAndLinkScale(),this._updateController(seriesModel,ecModel,api),clearTimeout(this._layoutTimeout);var forceLayout=seriesModel.forceLayout,layoutAnimation=seriesModel.get(["force","layoutAnimation"]);forceLayout&&this._startForceLayoutIteration(forceLayout,layoutAnimation);var layout=seriesModel.get("layout");data.graph.eachNode((function(node){var idx=node.dataIndex,el=node.getGraphicEl(),itemModel=node.getModel();if(el){el.off("drag").off("dragend");var draggable=itemModel.get("draggable");draggable&&el.on("drag",(function(e){switch(layout){case"force":forceLayout.warmUp(),!_this._layouting&&_this._startForceLayoutIteration(forceLayout,layoutAnimation),forceLayout.setFixed(idx),data.setItemLayout(idx,[el.x,el.y]);break;case"circular":data.setItemLayout(idx,[el.x,el.y]),node.setLayout({fixed:!0},!0),circularLayout(seriesModel,"symbolSize",node,[e.offsetX,e.offsetY]),_this.updateLayout(seriesModel);break;default:data.setItemLayout(idx,[el.x,el.y]),simpleLayoutEdge(seriesModel.getGraph(),seriesModel),_this.updateLayout(seriesModel)}})).on("dragend",(function(){forceLayout&&forceLayout.setUnfixed(idx)})),el.setDraggable(draggable,!!itemModel.get("cursor")),"adjacency"===itemModel.get(["emphasis","focus"])&&(getECData(el).focus=node.getAdjacentDataIndices())}})),data.graph.eachEdge((function(edge){var el=edge.getGraphicEl(),focus=edge.getModel().get(["emphasis","focus"]);el&&"adjacency"===focus&&(getECData(el).focus={edge:[edge.dataIndex],node:[edge.node1.dataIndex,edge.node2.dataIndex]})}));var circularRotateLabel="circular"===seriesModel.get("layout")&&seriesModel.get(["circular","rotateLabel"]),cx=data.getLayout("cx"),cy=data.getLayout("cy");data.graph.eachNode((function(node){rotateNodeLabel(node,circularRotateLabel,cx,cy)})),this._firstRender=!1},GraphView.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},GraphView.prototype._startForceLayoutIteration=function(forceLayout,layoutAnimation){var self=this;!function step(){forceLayout.step((function(stopped){self.updateLayout(self._model),(self._layouting=!stopped)&&(layoutAnimation?self._layoutTimeout=setTimeout(step,16):step())}))}()},GraphView.prototype._updateController=function(seriesModel,ecModel,api){var _this=this,controller=this._controller,controllerHost=this._controllerHost,group=this.group;controller.setPointerChecker((function(e,x,y){var rect=group.getBoundingRect();return rect.applyTransform(group.transform),rect.contain(x,y)&&!onIrrelevantElement(e,api,seriesModel)})),isViewCoordSys(seriesModel.coordinateSystem)?(controller.enable(seriesModel.get("roam")),controllerHost.zoomLimit=seriesModel.get("scaleLimit"),controllerHost.zoom=seriesModel.coordinateSystem.getZoom(),controller.off("pan").off("zoom").on("pan",(function(e){updateViewOnPan(controllerHost,e.dx,e.dy),api.dispatchAction({seriesId:seriesModel.id,type:"graphRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){updateViewOnZoom(controllerHost,e.scale,e.originX,e.originY),api.dispatchAction({seriesId:seriesModel.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),_this._updateNodeAndLinkScale(),adjustEdge(seriesModel.getGraph(),getNodeGlobalScale(seriesModel)),_this._lineDraw.updateLayout(),api.updateLabelLayout()}))):controller.disable()},GraphView.prototype._updateNodeAndLinkScale=function(){var seriesModel=this._model,data=seriesModel.getData(),nodeScale=getNodeGlobalScale(seriesModel);data.eachItemGraphicEl((function(el,idx){el&&el.setSymbolScale(nodeScale)}))},GraphView.prototype.updateLayout=function(seriesModel){adjustEdge(seriesModel.getGraph(),getNodeGlobalScale(seriesModel)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},GraphView.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},GraphView.type="graph",GraphView}(ChartView$1),GraphView$1=GraphView;function generateNodeKey(id){return"_EC_"+id}var Graph=function(){function Graph(directed){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=directed||!1}return Graph.prototype.isDirected=function(){return this._directed},Graph.prototype.addNode=function(id,dataIndex){id=null==id?""+dataIndex:""+id;var nodesMap=this._nodesMap;if(!nodesMap[generateNodeKey(id)]){var node=new GraphNode(id,dataIndex);return node.hostGraph=this,this.nodes.push(node),nodesMap[generateNodeKey(id)]=node,node}"production"!==process.env.NODE_ENV&&console.error("Graph nodes have duplicate name or id")},Graph.prototype.getNodeByIndex=function(dataIndex){var rawIdx=this.data.getRawIndex(dataIndex);return this.nodes[rawIdx]},Graph.prototype.getNodeById=function(id){return this._nodesMap[generateNodeKey(id)]},Graph.prototype.addEdge=function(n1,n2,dataIndex){var nodesMap=this._nodesMap,edgesMap=this._edgesMap;if(isNumber(n1)&&(n1=this.nodes[n1]),isNumber(n2)&&(n2=this.nodes[n2]),n1 instanceof GraphNode||(n1=nodesMap[generateNodeKey(n1)]),n2 instanceof GraphNode||(n2=nodesMap[generateNodeKey(n2)]),n1&&n2){var key=n1.id+"-"+n2.id,edge=new GraphEdge(n1,n2,dataIndex);return edge.hostGraph=this,this._directed&&(n1.outEdges.push(edge),n2.inEdges.push(edge)),n1.edges.push(edge),n1!==n2&&n2.edges.push(edge),this.edges.push(edge),edgesMap[key]=edge,edge}},Graph.prototype.getEdgeByIndex=function(dataIndex){var rawIdx=this.edgeData.getRawIndex(dataIndex);return this.edges[rawIdx]},Graph.prototype.getEdge=function(n1,n2){n1 instanceof GraphNode&&(n1=n1.id),n2 instanceof GraphNode&&(n2=n2.id);var edgesMap=this._edgesMap;return this._directed?edgesMap[n1+"-"+n2]:edgesMap[n1+"-"+n2]||edgesMap[n2+"-"+n1]},Graph.prototype.eachNode=function(cb,context){for(var nodes=this.nodes,len=nodes.length,i=0;i<len;i++)nodes[i].dataIndex>=0&&cb.call(context,nodes[i],i)},Graph.prototype.eachEdge=function(cb,context){for(var edges=this.edges,len=edges.length,i=0;i<len;i++)edges[i].dataIndex>=0&&edges[i].node1.dataIndex>=0&&edges[i].node2.dataIndex>=0&&cb.call(context,edges[i],i)},Graph.prototype.breadthFirstTraverse=function(cb,startNode,direction,context){if(startNode instanceof GraphNode||(startNode=this._nodesMap[generateNodeKey(startNode)]),startNode){for(var edgeType="out"===direction?"outEdges":"in"===direction?"inEdges":"edges",i=0;i<this.nodes.length;i++)this.nodes[i].__visited=!1;if(!cb.call(context,startNode,null))for(var queue=[startNode];queue.length;){var currentNode=queue.shift(),edges=currentNode[edgeType];for(i=0;i<edges.length;i++){var e=edges[i],otherNode=e.node1===currentNode?e.node2:e.node1;if(!otherNode.__visited){if(cb.call(context,otherNode,currentNode))return;queue.push(otherNode),otherNode.__visited=!0}}}}},Graph.prototype.update=function(){for(var data=this.data,edgeData=this.edgeData,nodes=this.nodes,edges=this.edges,i=0,len=nodes.length;i<len;i++)nodes[i].dataIndex=-1;for(i=0,len=data.count();i<len;i++)nodes[data.getRawIndex(i)].dataIndex=i;edgeData.filterSelf((function(idx){var edge=edges[edgeData.getRawIndex(idx)];return edge.node1.dataIndex>=0&&edge.node2.dataIndex>=0}));for(i=0,len=edges.length;i<len;i++)edges[i].dataIndex=-1;for(i=0,len=edgeData.count();i<len;i++)edges[edgeData.getRawIndex(i)].dataIndex=i},Graph.prototype.clone=function(){for(var graph=new Graph(this._directed),nodes=this.nodes,edges=this.edges,i=0;i<nodes.length;i++)graph.addNode(nodes[i].id,nodes[i].dataIndex);for(i=0;i<edges.length;i++){var e=edges[i];graph.addEdge(e.node1.id,e.node2.id,e.dataIndex)}return graph},Graph}(),GraphNode=function(){function GraphNode(id,dataIndex){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==id?"":id,this.dataIndex=null==dataIndex?-1:dataIndex}return GraphNode.prototype.degree=function(){return this.edges.length},GraphNode.prototype.inDegree=function(){return this.inEdges.length},GraphNode.prototype.outDegree=function(){return this.outEdges.length},GraphNode.prototype.getModel=function(path){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(path)},GraphNode.prototype.getAdjacentDataIndices=function(){for(var dataIndices={edge:[],node:[]},i=0;i<this.edges.length;i++){var adjacentEdge=this.edges[i];adjacentEdge.dataIndex<0||(dataIndices.edge.push(adjacentEdge.dataIndex),dataIndices.node.push(adjacentEdge.node1.dataIndex,adjacentEdge.node2.dataIndex))}return dataIndices},GraphNode.prototype.getTrajectoryDataIndices=function(){for(var connectedEdgesMap=createHashMap(),connectedNodesMap=createHashMap(),i=0;i<this.edges.length;i++){var adjacentEdge=this.edges[i];if(!(adjacentEdge.dataIndex<0)){connectedEdgesMap.set(adjacentEdge.dataIndex,!0);for(var sourceNodesQueue=[adjacentEdge.node1],targetNodesQueue=[adjacentEdge.node2],nodeIteratorIndex=0;nodeIteratorIndex<sourceNodesQueue.length;){var sourceNode=sourceNodesQueue[nodeIteratorIndex];nodeIteratorIndex++,connectedNodesMap.set(sourceNode.dataIndex,!0);for(var j=0;j<sourceNode.inEdges.length;j++)connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex,!0),sourceNodesQueue.push(sourceNode.inEdges[j].node1)}for(nodeIteratorIndex=0;nodeIteratorIndex<targetNodesQueue.length;){var targetNode=targetNodesQueue[nodeIteratorIndex];nodeIteratorIndex++,connectedNodesMap.set(targetNode.dataIndex,!0);for(j=0;j<targetNode.outEdges.length;j++)connectedEdgesMap.set(targetNode.outEdges[j].dataIndex,!0),targetNodesQueue.push(targetNode.outEdges[j].node2)}}}return{edge:connectedEdgesMap.keys(),node:connectedNodesMap.keys()}},GraphNode}(),GraphEdge=function(){function GraphEdge(n1,n2,dataIndex){this.dataIndex=-1,this.node1=n1,this.node2=n2,this.dataIndex=null==dataIndex?-1:dataIndex}return GraphEdge.prototype.getModel=function(path){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(path)},GraphEdge.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},GraphEdge.prototype.getTrajectoryDataIndices=function(){var connectedEdgesMap=createHashMap(),connectedNodesMap=createHashMap();connectedEdgesMap.set(this.dataIndex,!0);for(var sourceNodes=[this.node1],targetNodes=[this.node2],nodeIteratorIndex=0;nodeIteratorIndex<sourceNodes.length;){var sourceNode=sourceNodes[nodeIteratorIndex];nodeIteratorIndex++,connectedNodesMap.set(sourceNode.dataIndex,!0);for(var j=0;j<sourceNode.inEdges.length;j++)connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex,!0),sourceNodes.push(sourceNode.inEdges[j].node1)}for(nodeIteratorIndex=0;nodeIteratorIndex<targetNodes.length;){var targetNode=targetNodes[nodeIteratorIndex];nodeIteratorIndex++,connectedNodesMap.set(targetNode.dataIndex,!0);for(j=0;j<targetNode.outEdges.length;j++)connectedEdgesMap.set(targetNode.outEdges[j].dataIndex,!0),targetNodes.push(targetNode.outEdges[j].node2)}return{edge:connectedEdgesMap.keys(),node:connectedNodesMap.keys()}},GraphEdge}();function createGraphDataProxyMixin(hostName,dataName){return{getValue:function(dimension){var data=this[hostName][dataName];return data.getStore().get(data.getDimensionIndex(dimension||"value"),this.dataIndex)},setVisual:function(key,value){this.dataIndex>=0&&this[hostName][dataName].setItemVisual(this.dataIndex,key,value)},getVisual:function(key){return this[hostName][dataName].getItemVisual(this.dataIndex,key)},setLayout:function(layout,merge){this.dataIndex>=0&&this[hostName][dataName].setItemLayout(this.dataIndex,layout,merge)},getLayout:function(){return this[hostName][dataName].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[hostName][dataName].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[hostName][dataName].getRawIndex(this.dataIndex)}}}mixin(GraphNode,createGraphDataProxyMixin("hostGraph","data")),mixin(GraphEdge,createGraphDataProxyMixin("hostGraph","edgeData"));var Graph$1=Graph;function createGraphFromNodeEdge(nodes,edges,seriesModel,directed,beforeLink){for(var graph=new Graph$1(directed),i=0;i<nodes.length;i++)graph.addNode(retrieve(nodes[i].id,nodes[i].name,i),i);var linkNameList=[],validEdges=[],linkCount=0;for(i=0;i<edges.length;i++){var link=edges[i],source=link.source,target=link.target;graph.addEdge(source,target,linkCount)&&(validEdges.push(link),linkNameList.push(retrieve(convertOptionIdName(link.id,null),source+" > "+target)),linkCount++)}var nodeData,coordSys=seriesModel.get("coordinateSystem");if("cartesian2d"===coordSys||"polar"===coordSys)nodeData=createSeriesData(nodes,seriesModel);else{var coordSysCtor=CoordinateSystem.get(coordSys),coordDimensions=coordSysCtor&&coordSysCtor.dimensions||[];indexOf(coordDimensions,"value")<0&&coordDimensions.concat(["value"]);var dimensions=prepareSeriesDataSchema(nodes,{coordDimensions:coordDimensions,encodeDefine:seriesModel.getEncode()}).dimensions;(nodeData=new SeriesData$1(dimensions,seriesModel)).initData(nodes)}var edgeData=new SeriesData$1(["value"],seriesModel);return edgeData.initData(validEdges,linkNameList),beforeLink&&beforeLink(nodeData,edgeData),linkSeriesData({mainData:nodeData,struct:graph,structAttr:"graph",datas:{node:nodeData,edge:edgeData},datasAttr:{node:"data",edge:"edgeData"}}),graph.update(),graph}var GraphSeriesModel=function(_super){function GraphSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=GraphSeriesModel.type,_this.hasSymbolVisual=!0,_this}return __extends(GraphSeriesModel,_super),GraphSeriesModel.prototype.init=function(option){_super.prototype.init.apply(this,arguments);var self=this;function getCategoriesData(){return self._categoriesData}this.legendVisualProvider=new LegendVisualProvider$1(getCategoriesData,getCategoriesData),this.fillDataTextStyle(option.edges||option.links),this._updateCategoriesData()},GraphSeriesModel.prototype.mergeOption=function(option){_super.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(option.edges||option.links),this._updateCategoriesData()},GraphSeriesModel.prototype.mergeDefaultAndTheme=function(option){_super.prototype.mergeDefaultAndTheme.apply(this,arguments),defaultEmphasis(option,"edgeLabel",["show"])},GraphSeriesModel.prototype.getInitialData=function(option,ecModel){var seriesModel,edges=option.edges||option.links||[],nodes=option.data||option.nodes||[],self=this;if(nodes&&edges){getAutoCurvenessParams(seriesModel=this)&&(seriesModel.__curvenessList=[],seriesModel.__edgeMap={},createCurveness(seriesModel));var graph=createGraphFromNodeEdge(nodes,edges,this,!0,(function(nodeData,edgeData){nodeData.wrapMethod("getItemModel",(function(model){var categoryModel=self._categoriesModels[model.getShallow("category")];return categoryModel&&(categoryModel.parentModel=model.parentModel,model.parentModel=categoryModel),model}));var oldGetModel=Model$1.prototype.getModel;function newGetModel(path,parentModel){var model=oldGetModel.call(this,path,parentModel);return model.resolveParentPath=resolveParentPath,model}function resolveParentPath(pathArr){if(pathArr&&("label"===pathArr[0]||"label"===pathArr[1])){var newPathArr=pathArr.slice();return"label"===pathArr[0]?newPathArr[0]="edgeLabel":"label"===pathArr[1]&&(newPathArr[1]="edgeLabel"),newPathArr}return pathArr}edgeData.wrapMethod("getItemModel",(function(model){return model.resolveParentPath=resolveParentPath,model.getModel=newGetModel,model}))}));return each$b(graph.edges,(function(edge){!function(n1,n2,seriesModel,index){if(getAutoCurvenessParams(seriesModel)){var key=getKeyOfEdges(n1,n2,seriesModel),edgeMap=seriesModel.__edgeMap,oppositeEdges=edgeMap[getOppositeKey(key)];edgeMap[key]&&!oppositeEdges?edgeMap[key].isForward=!0:oppositeEdges&&edgeMap[key]&&(oppositeEdges.isForward=!0,edgeMap[key].isForward=!1),edgeMap[key]=edgeMap[key]||[],edgeMap[key].push(index)}}(edge.node1,edge.node2,this,edge.dataIndex)}),this),graph.data}},GraphSeriesModel.prototype.getGraph=function(){return this.getData().graph},GraphSeriesModel.prototype.getEdgeData=function(){return this.getGraph().edgeData},GraphSeriesModel.prototype.getCategoriesData=function(){return this._categoriesData},GraphSeriesModel.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){if("edge"===dataType){var nodeData=this.getData(),params=this.getDataParams(dataIndex,dataType),edge=nodeData.graph.getEdgeByIndex(dataIndex),sourceName=nodeData.getName(edge.node1.dataIndex),targetName=nodeData.getName(edge.node2.dataIndex),nameArr=[];return null!=sourceName&&nameArr.push(sourceName),null!=targetName&&nameArr.push(targetName),createTooltipMarkup("nameValue",{name:nameArr.join(" > "),value:params.value,noValue:null==params.value})}return defaultSeriesFormatTooltip({series:this,dataIndex:dataIndex,multipleSeries:multipleSeries})},GraphSeriesModel.prototype._updateCategoriesData=function(){var categories=map$1(this.option.categories||[],(function(category){return null!=category.value?category:extend({value:0},category)})),categoriesData=new SeriesData$1(["value"],this);categoriesData.initData(categories),this._categoriesData=categoriesData,this._categoriesModels=categoriesData.mapArray((function(idx){return categoriesData.getItemModel(idx)}))},GraphSeriesModel.prototype.setZoom=function(zoom){this.option.zoom=zoom},GraphSeriesModel.prototype.setCenter=function(center){this.option.center=center},GraphSeriesModel.prototype.isAnimationEnabled=function(){return _super.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},GraphSeriesModel.type="series.graph",GraphSeriesModel.dependencies=["grid","polar","geo","singleAxis","calendar"],GraphSeriesModel.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},GraphSeriesModel}(SeriesModel$1),GraphSeriesModel$1=GraphSeriesModel,actionInfo$1={type:"graphRoam",event:"graphRoam",update:"none"};var PointerShape=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},PointerPath=function(_super){function PointerPath(opts){var _this=_super.call(this,opts)||this;return _this.type="pointer",_this}return __extends(PointerPath,_super),PointerPath.prototype.getDefaultShape=function(){return new PointerShape},PointerPath.prototype.buildPath=function(ctx,shape){var mathCos=Math.cos,mathSin=Math.sin,r=shape.r,width=shape.width,angle=shape.angle,x=shape.x-mathCos(angle)*width*(width>=r/3?1:2),y=shape.y-mathSin(angle)*width*(width>=r/3?1:2);angle=shape.angle-Math.PI/2,ctx.moveTo(x,y),ctx.lineTo(shape.x+mathCos(angle)*width,shape.y+mathSin(angle)*width),ctx.lineTo(shape.x+mathCos(shape.angle)*r,shape.y+mathSin(shape.angle)*r),ctx.lineTo(shape.x-mathCos(angle)*width,shape.y-mathSin(angle)*width),ctx.lineTo(x,y)},PointerPath}(Path$1),PointerPath$1=PointerPath;function formatLabel(value,labelFormatter){var label=null==value?"":value+"";return labelFormatter&&(isString(labelFormatter)?label=labelFormatter.replace("{value}",label):isFunction(labelFormatter)&&(label=labelFormatter(value))),label}var GaugeView=function(_super){function GaugeView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=GaugeView.type,_this}return __extends(GaugeView,_super),GaugeView.prototype.render=function(seriesModel,ecModel,api){this.group.removeAll();var colorList=seriesModel.get(["axisLine","lineStyle","color"]),posInfo=function(seriesModel,api){var center=seriesModel.get("center"),width=api.getWidth(),height=api.getHeight(),size=Math.min(width,height);return{cx:parsePercent(center[0],api.getWidth()),cy:parsePercent(center[1],api.getHeight()),r:parsePercent(seriesModel.get("radius"),size/2)}}(seriesModel,api);this._renderMain(seriesModel,ecModel,api,colorList,posInfo),this._data=seriesModel.getData()},GaugeView.prototype.dispose=function(){},GaugeView.prototype._renderMain=function(seriesModel,ecModel,api,colorList,posInfo){var group=this.group,clockwise=seriesModel.get("clockwise"),startAngle=-seriesModel.get("startAngle")/180*Math.PI,endAngle=-seriesModel.get("endAngle")/180*Math.PI,axisLineModel=seriesModel.getModel("axisLine"),MainPath=axisLineModel.get("roundCap")?Sausage:Sector$1,showAxis=axisLineModel.get("show"),lineStyleModel=axisLineModel.getModel("lineStyle"),axisLineWidth=lineStyleModel.get("width"),angles=[startAngle,endAngle];normalizeArcAngles(angles,!clockwise);for(var angleRangeSpan=(endAngle=angles[1])-(startAngle=angles[0]),prevEndAngle=startAngle,sectors=[],i=0;showAxis&&i<colorList.length;i++){var sector=new MainPath({shape:{startAngle:prevEndAngle,endAngle:endAngle=startAngle+angleRangeSpan*Math.min(Math.max(colorList[i][0],0),1),cx:posInfo.cx,cy:posInfo.cy,clockwise:clockwise,r0:posInfo.r-axisLineWidth,r:posInfo.r},silent:!0});sector.setStyle({fill:colorList[i][1]}),sector.setStyle(lineStyleModel.getLineStyle(["color","width"])),sectors.push(sector),prevEndAngle=endAngle}sectors.reverse(),each$b(sectors,(function(sector){return group.add(sector)}));var getColor=function(percent){if(percent<=0)return colorList[0][1];var i;for(i=0;i<colorList.length;i++)if(colorList[i][0]>=percent&&(0===i?0:colorList[i-1][0])<percent)return colorList[i][1];return colorList[i-1][1]};this._renderTicks(seriesModel,ecModel,api,getColor,posInfo,startAngle,endAngle,clockwise,axisLineWidth),this._renderTitleAndDetail(seriesModel,ecModel,api,getColor,posInfo),this._renderAnchor(seriesModel,posInfo),this._renderPointer(seriesModel,ecModel,api,getColor,posInfo,startAngle,endAngle,clockwise,axisLineWidth)},GaugeView.prototype._renderTicks=function(seriesModel,ecModel,api,getColor,posInfo,startAngle,endAngle,clockwise,axisLineWidth){for(var unitX,unitY,group=this.group,cx=posInfo.cx,cy=posInfo.cy,r=posInfo.r,minVal=+seriesModel.get("min"),maxVal=+seriesModel.get("max"),splitLineModel=seriesModel.getModel("splitLine"),tickModel=seriesModel.getModel("axisTick"),labelModel=seriesModel.getModel("axisLabel"),splitNumber=seriesModel.get("splitNumber"),subSplitNumber=tickModel.get("splitNumber"),splitLineLen=parsePercent(splitLineModel.get("length"),r),tickLen=parsePercent(tickModel.get("length"),r),angle=startAngle,step=(endAngle-startAngle)/splitNumber,subStep=step/subSplitNumber,splitLineStyle=splitLineModel.getModel("lineStyle").getLineStyle(),tickLineStyle=tickModel.getModel("lineStyle").getLineStyle(),splitLineDistance=splitLineModel.get("distance"),i=0;i<=splitNumber;i++){if(unitX=Math.cos(angle),unitY=Math.sin(angle),splitLineModel.get("show")){var splitLine=new Line$3({shape:{x1:unitX*(r-(distance=splitLineDistance?splitLineDistance+axisLineWidth:axisLineWidth))+cx,y1:unitY*(r-distance)+cy,x2:unitX*(r-splitLineLen-distance)+cx,y2:unitY*(r-splitLineLen-distance)+cy},style:splitLineStyle,silent:!0});"auto"===splitLineStyle.stroke&&splitLine.setStyle({stroke:getColor(i/splitNumber)}),group.add(splitLine)}if(labelModel.get("show")){var distance=labelModel.get("distance")+splitLineDistance,label=formatLabel(round$3(i/splitNumber*(maxVal-minVal)+minVal),labelModel.get("formatter")),autoColor=getColor(i/splitNumber),textStyleX=unitX*(r-splitLineLen-distance)+cx,textStyleY=unitY*(r-splitLineLen-distance)+cy,rotateType=labelModel.get("rotate"),rotate=0;"radial"===rotateType?(rotate=-angle+2*Math.PI)>Math.PI/2&&(rotate+=Math.PI):"tangential"===rotateType?rotate=-angle-Math.PI/2:isNumber(rotateType)&&(rotate=rotateType*Math.PI/180),0===rotate?group.add(new ZRText$1({style:createTextStyle(labelModel,{text:label,x:textStyleX,y:textStyleY,verticalAlign:unitY<-.8?"top":unitY>.8?"bottom":"middle",align:unitX<-.4?"left":unitX>.4?"right":"center"},{inheritColor:autoColor}),silent:!0})):group.add(new ZRText$1({style:createTextStyle(labelModel,{text:label,x:textStyleX,y:textStyleY,verticalAlign:"middle",align:"center"},{inheritColor:autoColor}),silent:!0,originX:textStyleX,originY:textStyleY,rotation:rotate}))}if(tickModel.get("show")&&i!==splitNumber){distance=(distance=tickModel.get("distance"))?distance+axisLineWidth:axisLineWidth;for(var j=0;j<=subSplitNumber;j++){unitX=Math.cos(angle),unitY=Math.sin(angle);var tickLine=new Line$3({shape:{x1:unitX*(r-distance)+cx,y1:unitY*(r-distance)+cy,x2:unitX*(r-tickLen-distance)+cx,y2:unitY*(r-tickLen-distance)+cy},silent:!0,style:tickLineStyle});"auto"===tickLineStyle.stroke&&tickLine.setStyle({stroke:getColor((i+j/subSplitNumber)/splitNumber)}),group.add(tickLine),angle+=subStep}angle-=subStep}else angle+=step}},GaugeView.prototype._renderPointer=function(seriesModel,ecModel,api,getColor,posInfo,startAngle,endAngle,clockwise,axisLineWidth){var group=this.group,oldData=this._data,oldProgressData=this._progressEls,progressList=[],showPointer=seriesModel.get(["pointer","show"]),progressModel=seriesModel.getModel("progress"),showProgress=progressModel.get("show"),data=seriesModel.getData(),valueDim=data.mapDimension("value"),minVal=+seriesModel.get("min"),maxVal=+seriesModel.get("max"),valueExtent=[minVal,maxVal],angleExtent=[startAngle,endAngle];function createPointer(idx,angle){var pointer,pointerModel=data.getItemModel(idx).getModel("pointer"),pointerWidth=parsePercent(pointerModel.get("width"),posInfo.r),pointerLength=parsePercent(pointerModel.get("length"),posInfo.r),pointerStr=seriesModel.get(["pointer","icon"]),pointerOffset=pointerModel.get("offsetCenter"),pointerOffsetX=parsePercent(pointerOffset[0],posInfo.r),pointerOffsetY=parsePercent(pointerOffset[1],posInfo.r),pointerKeepAspect=pointerModel.get("keepAspect");return(pointer=pointerStr?createSymbol$1(pointerStr,pointerOffsetX-pointerWidth/2,pointerOffsetY-pointerLength,pointerWidth,pointerLength,null,pointerKeepAspect):new PointerPath$1({shape:{angle:-Math.PI/2,width:pointerWidth,r:pointerLength,x:pointerOffsetX,y:pointerOffsetY}})).rotation=-(angle+Math.PI/2),pointer.x=posInfo.cx,pointer.y=posInfo.cy,pointer}function createProgress(idx,endAngle){var ProgressPath=progressModel.get("roundCap")?Sausage:Sector$1,isOverlap=progressModel.get("overlap"),progressWidth=isOverlap?progressModel.get("width"):axisLineWidth/data.count(),r0=isOverlap?posInfo.r-progressWidth:posInfo.r-(idx+1)*progressWidth,r=isOverlap?posInfo.r:posInfo.r-idx*progressWidth,progress=new ProgressPath({shape:{startAngle:startAngle,endAngle:endAngle,cx:posInfo.cx,cy:posInfo.cy,clockwise:clockwise,r0:r0,r:r}});return isOverlap&&(progress.z2=linearMap(data.get(valueDim,idx),[minVal,maxVal],[100,0],!0)),progress}(showProgress||showPointer)&&(data.diff(oldData).add((function(idx){var val=data.get(valueDim,idx);if(showPointer){var pointer=createPointer(idx,startAngle);initProps(pointer,{rotation:-((isNaN(+val)?angleExtent[0]:linearMap(val,valueExtent,angleExtent,!0))+Math.PI/2)},seriesModel),group.add(pointer),data.setItemGraphicEl(idx,pointer)}if(showProgress){var progress=createProgress(idx,startAngle),isClip=progressModel.get("clip");initProps(progress,{shape:{endAngle:linearMap(val,valueExtent,angleExtent,isClip)}},seriesModel),group.add(progress),setCommonECData(seriesModel.seriesIndex,data.dataType,idx,progress),progressList[idx]=progress}})).update((function(newIdx,oldIdx){var val=data.get(valueDim,newIdx);if(showPointer){var previousPointer=oldData.getItemGraphicEl(oldIdx),previousRotate=previousPointer?previousPointer.rotation:startAngle,pointer=createPointer(newIdx,previousRotate);pointer.rotation=previousRotate,updateProps$1(pointer,{rotation:-((isNaN(+val)?angleExtent[0]:linearMap(val,valueExtent,angleExtent,!0))+Math.PI/2)},seriesModel),group.add(pointer),data.setItemGraphicEl(newIdx,pointer)}if(showProgress){var previousProgress=oldProgressData[oldIdx],progress=createProgress(newIdx,previousProgress?previousProgress.shape.endAngle:startAngle),isClip=progressModel.get("clip");updateProps$1(progress,{shape:{endAngle:linearMap(val,valueExtent,angleExtent,isClip)}},seriesModel),group.add(progress),setCommonECData(seriesModel.seriesIndex,data.dataType,newIdx,progress),progressList[newIdx]=progress}})).execute(),data.each((function(idx){var itemModel=data.getItemModel(idx),emphasisModel=itemModel.getModel("emphasis"),focus=emphasisModel.get("focus"),blurScope=emphasisModel.get("blurScope"),emphasisDisabled=emphasisModel.get("disabled");if(showPointer){var pointer=data.getItemGraphicEl(idx),symbolStyle=data.getItemVisual(idx,"style"),visualColor=symbolStyle.fill;if(pointer instanceof ZRImage$1){var pathStyle=pointer.style;pointer.useStyle(extend({image:pathStyle.image,x:pathStyle.x,y:pathStyle.y,width:pathStyle.width,height:pathStyle.height},symbolStyle))}else pointer.useStyle(symbolStyle),"pointer"!==pointer.type&&pointer.setColor(visualColor);pointer.setStyle(itemModel.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===pointer.style.fill&&pointer.setStyle("fill",getColor(linearMap(data.get(valueDim,idx),valueExtent,[0,1],!0))),pointer.z2EmphasisLift=0,setStatesStylesFromModel(pointer,itemModel),toggleHoverEmphasis(pointer,focus,blurScope,emphasisDisabled)}if(showProgress){var progress=progressList[idx];progress.useStyle(data.getItemVisual(idx,"style")),progress.setStyle(itemModel.getModel(["progress","itemStyle"]).getItemStyle()),progress.z2EmphasisLift=0,setStatesStylesFromModel(progress,itemModel),toggleHoverEmphasis(progress,focus,blurScope,emphasisDisabled)}})),this._progressEls=progressList)},GaugeView.prototype._renderAnchor=function(seriesModel,posInfo){var anchorModel=seriesModel.getModel("anchor");if(anchorModel.get("show")){var anchorSize=anchorModel.get("size"),anchorType=anchorModel.get("icon"),offsetCenter=anchorModel.get("offsetCenter"),anchorKeepAspect=anchorModel.get("keepAspect"),anchor=createSymbol$1(anchorType,posInfo.cx-anchorSize/2+parsePercent(offsetCenter[0],posInfo.r),posInfo.cy-anchorSize/2+parsePercent(offsetCenter[1],posInfo.r),anchorSize,anchorSize,null,anchorKeepAspect);anchor.z2=anchorModel.get("showAbove")?1:0,anchor.setStyle(anchorModel.getModel("itemStyle").getItemStyle()),this.group.add(anchor)}},GaugeView.prototype._renderTitleAndDetail=function(seriesModel,ecModel,api,getColor,posInfo){var _this=this,data=seriesModel.getData(),valueDim=data.mapDimension("value"),minVal=+seriesModel.get("min"),maxVal=+seriesModel.get("max"),contentGroup=new Group$4,newTitleEls=[],newDetailEls=[],hasAnimation=seriesModel.isAnimationEnabled(),showPointerAbove=seriesModel.get(["pointer","showAbove"]);data.diff(this._data).add((function(idx){newTitleEls[idx]=new ZRText$1({silent:!0}),newDetailEls[idx]=new ZRText$1({silent:!0})})).update((function(idx,oldIdx){newTitleEls[idx]=_this._titleEls[oldIdx],newDetailEls[idx]=_this._detailEls[oldIdx]})).execute(),data.each((function(idx){var itemModel=data.getItemModel(idx),value=data.get(valueDim,idx),itemGroup=new Group$4,autoColor=getColor(linearMap(value,[minVal,maxVal],[0,1],!0)),itemTitleModel=itemModel.getModel("title");if(itemTitleModel.get("show")){var titleOffsetCenter=itemTitleModel.get("offsetCenter"),titleX=posInfo.cx+parsePercent(titleOffsetCenter[0],posInfo.r),titleY=posInfo.cy+parsePercent(titleOffsetCenter[1],posInfo.r);(labelEl=newTitleEls[idx]).attr({z2:showPointerAbove?0:2,style:createTextStyle(itemTitleModel,{x:titleX,y:titleY,text:data.getName(idx),align:"center",verticalAlign:"middle"},{inheritColor:autoColor})}),itemGroup.add(labelEl)}var itemDetailModel=itemModel.getModel("detail");if(itemDetailModel.get("show")){var detailOffsetCenter=itemDetailModel.get("offsetCenter"),detailX=posInfo.cx+parsePercent(detailOffsetCenter[0],posInfo.r),detailY=posInfo.cy+parsePercent(detailOffsetCenter[1],posInfo.r),width=parsePercent(itemDetailModel.get("width"),posInfo.r),height=parsePercent(itemDetailModel.get("height"),posInfo.r),detailColor=seriesModel.get(["progress","show"])?data.getItemVisual(idx,"style").fill:autoColor,labelEl=newDetailEls[idx],formatter_1=itemDetailModel.get("formatter");labelEl.attr({z2:showPointerAbove?0:2,style:createTextStyle(itemDetailModel,{x:detailX,y:detailY,text:formatLabel(value,formatter_1),width:isNaN(width)?null:width,height:isNaN(height)?null:height,align:"center",verticalAlign:"middle"},{inheritColor:detailColor})}),setLabelValueAnimation(labelEl,{normal:itemDetailModel},value,(function(value){return formatLabel(value,formatter_1)})),hasAnimation&&animateLabelValue(labelEl,idx,data,seriesModel,{getFormattedLabel:function(labelDataIndex,status,dataType,labelDimIndex,fmt,extendParams){return formatLabel(extendParams?extendParams.interpolatedValue:value,formatter_1)}}),itemGroup.add(labelEl)}contentGroup.add(itemGroup)})),this.group.add(contentGroup),this._titleEls=newTitleEls,this._detailEls=newDetailEls},GaugeView.type="gauge",GaugeView}(ChartView$1),GaugeView$1=GaugeView,GaugeSeriesModel$1=function(_super){function GaugeSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=GaugeSeriesModel.type,_this.visualStyleAccessPath="itemStyle",_this}return __extends(GaugeSeriesModel,_super),GaugeSeriesModel.prototype.getInitialData=function(option,ecModel){return createSeriesDataSimply(this,["value"])},GaugeSeriesModel.type="series.gauge",GaugeSeriesModel.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},GaugeSeriesModel}(SeriesModel$1);var ParallelView$2=function(_super){function ParallelView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ParallelView.type,_this._dataGroup=new Group$4,_this._initialized=!1,_this}return __extends(ParallelView,_super),ParallelView.prototype.init=function(){this.group.add(this._dataGroup)},ParallelView.prototype.render=function(seriesModel,ecModel,api,payload){this._progressiveEls=null;var dataGroup=this._dataGroup,data=seriesModel.getData(),oldData=this._data,coordSys=seriesModel.coordinateSystem,dimensions=coordSys.dimensions,seriesScope=makeSeriesScope(seriesModel);if(data.diff(oldData).add((function(newDataIndex){updateElCommon(addEl(data,dataGroup,newDataIndex,dimensions,coordSys),data,newDataIndex,seriesScope)})).update((function(newDataIndex,oldDataIndex){var line=oldData.getItemGraphicEl(oldDataIndex),points=createLinePoints(data,newDataIndex,dimensions,coordSys);data.setItemGraphicEl(newDataIndex,line),updateProps$1(line,{shape:{points:points}},seriesModel,newDataIndex),saveOldStyle(line),updateElCommon(line,data,newDataIndex,seriesScope)})).remove((function(oldDataIndex){var line=oldData.getItemGraphicEl(oldDataIndex);dataGroup.remove(line)})).execute(),!this._initialized){this._initialized=!0;var clipPath=function(coordSys,seriesModel,cb){var parallelModel=coordSys.model,rect=coordSys.getRect(),rectEl=new Rect$4({shape:{x:rect.x,y:rect.y,width:rect.width,height:rect.height}}),dim="horizontal"===parallelModel.get("layout")?"width":"height";return rectEl.setShape(dim,0),initProps(rectEl,{shape:{width:rect.width,height:rect.height}},seriesModel,cb),rectEl}(coordSys,seriesModel,(function(){setTimeout((function(){dataGroup.removeClipPath()}))}));dataGroup.setClipPath(clipPath)}this._data=data},ParallelView.prototype.incrementalPrepareRender=function(seriesModel,ecModel,api){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},ParallelView.prototype.incrementalRender=function(taskParams,seriesModel,ecModel){for(var data=seriesModel.getData(),coordSys=seriesModel.coordinateSystem,dimensions=coordSys.dimensions,seriesScope=makeSeriesScope(seriesModel),progressiveEls=this._progressiveEls=[],dataIndex=taskParams.start;dataIndex<taskParams.end;dataIndex++){var line=addEl(data,this._dataGroup,dataIndex,dimensions,coordSys);line.incremental=!0,updateElCommon(line,data,dataIndex,seriesScope),progressiveEls.push(line)}},ParallelView.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},ParallelView.type="parallel",ParallelView}(ChartView$1);function createLinePoints(data,dataIndex,dimensions,coordSys){for(var val,points=[],i=0;i<dimensions.length;i++){var dimName=dimensions[i],value=data.get(data.mapDimension(dimName),dataIndex);val=value,("category"===coordSys.getAxis(dimName).type?null==val:null==val||isNaN(val))||points.push(coordSys.dataToPoint(value,dimName))}return points}function addEl(data,dataGroup,dataIndex,dimensions,coordSys){var points=createLinePoints(data,dataIndex,dimensions,coordSys),line=new Polyline$1({shape:{points:points},z2:10});return dataGroup.add(line),data.setItemGraphicEl(dataIndex,line),line}function makeSeriesScope(seriesModel){var smooth=seriesModel.get("smooth",!0);return!0===smooth&&(smooth=.3),eqNaN(smooth=numericToNumber(smooth))&&(smooth=0),{smooth:smooth}}function updateElCommon(el,data,dataIndex,seriesScope){el.useStyle(data.getItemVisual(dataIndex,"style")),el.style.fill=null,el.setShape("smooth",seriesScope.smooth);var itemModel=data.getItemModel(dataIndex),emphasisModel=itemModel.getModel("emphasis");setStatesStylesFromModel(el,itemModel,"lineStyle"),toggleHoverEmphasis(el,emphasisModel.get("focus"),emphasisModel.get("blurScope"),emphasisModel.get("disabled"))}var ParallelView$3=ParallelView$2;function makeDefaultEncode(seriesModel){var parallelModel=seriesModel.ecModel.getComponent("parallel",seriesModel.get("parallelIndex"));if(parallelModel){var encodeDefine={};return each$b(parallelModel.dimensions,(function(axisDim){var dataDimIndex=+axisDim.replace("dim","");encodeDefine[axisDim]=dataDimIndex})),encodeDefine}}var ParallelSeriesModel$1=function(_super){function ParallelSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ParallelSeriesModel.type,_this.visualStyleAccessPath="lineStyle",_this.visualDrawType="stroke",_this}return __extends(ParallelSeriesModel,_super),ParallelSeriesModel.prototype.getInitialData=function(option,ecModel){return createSeriesData(null,this,{useEncodeDefaulter:bind$1(makeDefaultEncode,null,this)})},ParallelSeriesModel.prototype.getRawIndicesByActiveState=function(activeState){var coordSys=this.coordinateSystem,data=this.getData(),indices=[];return coordSys.eachActiveState(data,(function(theActiveState,dataIndex){activeState===theActiveState&&indices.push(data.getRawIndex(dataIndex))})),indices},ParallelSeriesModel.type="series.parallel",ParallelSeriesModel.dependencies=["parallel"],ParallelSeriesModel.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},ParallelSeriesModel}(SeriesModel$1),opacityAccessPath=["lineStyle","opacity"],parallelVisual$1={seriesType:"parallel",reset:function(seriesModel,ecModel){var coordSys=seriesModel.coordinateSystem,opacityMap={normal:seriesModel.get(["lineStyle","opacity"]),active:seriesModel.get("activeOpacity"),inactive:seriesModel.get("inactiveOpacity")};return{progress:function(params,data){coordSys.eachActiveState(data,(function(activeState,dataIndex){var opacity=opacityMap[activeState];if("normal"===activeState&&data.hasItemOption){var itemOpacity=data.getItemModel(dataIndex).get(opacityAccessPath,!0);null!=itemOpacity&&(opacity=itemOpacity)}data.ensureUniqueItemVisual(dataIndex,"style").opacity=opacity}),params.start,params.end)}}}};function parallelPreprocessor(option){!function(option){if(option.parallel)return;var hasParallelSeries=!1;each$b(option.series,(function(seriesOpt){seriesOpt&&"parallel"===seriesOpt.type&&(hasParallelSeries=!0)})),hasParallelSeries&&(option.parallel=[{}])}(option),function(option){var axes=normalizeToArray(option.parallelAxis);each$b(axes,(function(axisOption){if(isObject$3(axisOption)){var parallelIndex=axisOption.parallelIndex||0,parallelOption=normalizeToArray(option.parallel)[parallelIndex];parallelOption&&parallelOption.parallelAxisDefault&&merge(axisOption,parallelOption.parallelAxisDefault,!1)}}))}(option)}var ParallelView=function(_super){function ParallelView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ParallelView.type,_this}return __extends(ParallelView,_super),ParallelView.prototype.render=function(parallelModel,ecModel,api){this._model=parallelModel,this._api=api,this._handlers||(this._handlers={},each$b(handlers$1,(function(handler,eventName){api.getZr().on(eventName,this._handlers[eventName]=bind$1(handler,this))}),this)),createOrUpdate(this,"_throttledDispatchExpand",parallelModel.get("axisExpandRate"),"fixRate")},ParallelView.prototype.dispose=function(ecModel,api){clear$1(this,"_throttledDispatchExpand"),each$b(this._handlers,(function(handler,eventName){api.getZr().off(eventName,handler)})),this._handlers=null},ParallelView.prototype._throttledDispatchExpand=function(opt){this._dispatchExpand(opt)},ParallelView.prototype._dispatchExpand=function(opt){opt&&this._api.dispatchAction(extend({type:"parallelAxisExpand"},opt))},ParallelView.type="parallel",ParallelView}(ComponentView$1),handlers$1={mousedown:function(e){checkTrigger(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var mouseDownPoint=this._mouseDownPoint;if(checkTrigger(this,"click")&&mouseDownPoint){var point=[e.offsetX,e.offsetY];if(Math.pow(mouseDownPoint[0]-point[0],2)+Math.pow(mouseDownPoint[1]-point[1],2)>5)return;var result=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==result.behavior&&this._dispatchExpand({axisExpandWindow:result.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&checkTrigger(this,"mousemove")){var model=this._model,result=model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),behavior=result.behavior;"jump"===behavior&&this._throttledDispatchExpand.debounceNextCall(model.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===behavior?null:{axisExpandWindow:result.axisExpandWindow,animation:"jump"===behavior?null:{duration:0}})}}};function checkTrigger(view,triggerOn){var model=view._model;return model.get("axisExpandable")&&model.get("axisExpandTriggerOn")===triggerOn}var ParallelView$1=ParallelView,ParallelModel$1=function(_super){function ParallelModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ParallelModel.type,_this}return __extends(ParallelModel,_super),ParallelModel.prototype.init=function(){_super.prototype.init.apply(this,arguments),this.mergeOption({})},ParallelModel.prototype.mergeOption=function(newOption){var thisOption=this.option;newOption&&merge(thisOption,newOption,!0),this._initDimensions()},ParallelModel.prototype.contains=function(model,ecModel){var parallelIndex=model.get("parallelIndex");return null!=parallelIndex&&ecModel.getComponent("parallel",parallelIndex)===this},ParallelModel.prototype.setAxisExpand=function(opt){each$b(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(name){opt.hasOwnProperty(name)&&(this.option[name]=opt[name])}),this)},ParallelModel.prototype._initDimensions=function(){var dimensions=this.dimensions=[],parallelAxisIndex=this.parallelAxisIndex=[];each$b(filter(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(axisModel){return(axisModel.get("parallelIndex")||0)===this.componentIndex}),this),(function(axisModel){dimensions.push("dim"+axisModel.get("dim")),parallelAxisIndex.push(axisModel.componentIndex)}))},ParallelModel.type="parallel",ParallelModel.dependencies=["parallelAxis"],ParallelModel.layoutMode="box",ParallelModel.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},ParallelModel}(ComponentModel$1),ParallelAxis=function(_super){function ParallelAxis(dim,scale,coordExtent,axisType,axisIndex){var _this=_super.call(this,dim,scale,coordExtent)||this;return _this.type=axisType||"value",_this.axisIndex=axisIndex,_this}return __extends(ParallelAxis,_super),ParallelAxis.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},ParallelAxis}(Axis$1),ParallelAxis$1=ParallelAxis;function sliderMove(delta,handleEnds,extent,handleIndex,minSpan,maxSpan){delta=delta||0;var extentSpan=extent[1]-extent[0];if(null!=minSpan&&(minSpan=restrict$1(minSpan,[0,extentSpan])),null!=maxSpan&&(maxSpan=Math.max(maxSpan,null!=minSpan?minSpan:0)),"all"===handleIndex){var handleSpan=Math.abs(handleEnds[1]-handleEnds[0]);handleSpan=restrict$1(handleSpan,[0,extentSpan]),minSpan=maxSpan=restrict$1(handleSpan,[minSpan,maxSpan]),handleIndex=0}handleEnds[0]=restrict$1(handleEnds[0],extent),handleEnds[1]=restrict$1(handleEnds[1],extent);var originalDistSign=getSpanSign(handleEnds,handleIndex);handleEnds[handleIndex]+=delta;var currDistSign,extentMinSpan=minSpan||0,realExtent=extent.slice();return originalDistSign.sign<0?realExtent[0]+=extentMinSpan:realExtent[1]-=extentMinSpan,handleEnds[handleIndex]=restrict$1(handleEnds[handleIndex],realExtent),currDistSign=getSpanSign(handleEnds,handleIndex),null!=minSpan&&(currDistSign.sign!==originalDistSign.sign||currDistSign.span<minSpan)&&(handleEnds[1-handleIndex]=handleEnds[handleIndex]+originalDistSign.sign*minSpan),currDistSign=getSpanSign(handleEnds,handleIndex),null!=maxSpan&&currDistSign.span>maxSpan&&(handleEnds[1-handleIndex]=handleEnds[handleIndex]+currDistSign.sign*maxSpan),handleEnds}function getSpanSign(handleEnds,handleIndex){var dist=handleEnds[handleIndex]-handleEnds[1-handleIndex];return{span:Math.abs(dist),sign:dist>0?-1:dist<0?1:handleIndex?-1:1}}function restrict$1(value,extend){return Math.min(null!=extend[1]?extend[1]:1/0,Math.max(null!=extend[0]?extend[0]:-1/0,value))}var each$6=each$b,mathMin$1=Math.min,mathMax$1=Math.max,mathFloor=Math.floor,mathCeil=Math.ceil,round$1=round$3,PI=Math.PI,Parallel=function(){function Parallel(parallelModel,ecModel,api){this.type="parallel",this._axesMap=createHashMap(),this._axesLayout={},this.dimensions=parallelModel.dimensions,this._model=parallelModel,this._init(parallelModel,ecModel,api)}return Parallel.prototype._init=function(parallelModel,ecModel,api){var dimensions=parallelModel.dimensions,parallelAxisIndex=parallelModel.parallelAxisIndex;each$6(dimensions,(function(dim,idx){var axisIndex=parallelAxisIndex[idx],axisModel=ecModel.getComponent("parallelAxis",axisIndex),axis=this._axesMap.set(dim,new ParallelAxis$1(dim,createScaleByModel(axisModel),[0,0],axisModel.get("type"),axisIndex)),isCategory="category"===axis.type;axis.onBand=isCategory&&axisModel.get("boundaryGap"),axis.inverse=axisModel.get("inverse"),axisModel.axis=axis,axis.model=axisModel,axis.coordinateSystem=axisModel.coordinateSystem=this}),this)},Parallel.prototype.update=function(ecModel,api){this._updateAxesFromSeries(this._model,ecModel)},Parallel.prototype.containPoint=function(point){var layoutInfo=this._makeLayoutInfo(),axisBase=layoutInfo.axisBase,layoutBase=layoutInfo.layoutBase,pixelDimIndex=layoutInfo.pixelDimIndex,pAxis=point[1-pixelDimIndex],pLayout=point[pixelDimIndex];return pAxis>=axisBase&&pAxis<=axisBase+layoutInfo.axisLength&&pLayout>=layoutBase&&pLayout<=layoutBase+layoutInfo.layoutLength},Parallel.prototype.getModel=function(){return this._model},Parallel.prototype._updateAxesFromSeries=function(parallelModel,ecModel){ecModel.eachSeries((function(seriesModel){if(parallelModel.contains(seriesModel,ecModel)){var data=seriesModel.getData();each$6(this.dimensions,(function(dim){var axis=this._axesMap.get(dim);axis.scale.unionExtentFromData(data,data.mapDimension(dim)),niceScaleExtent(axis.scale,axis.model)}),this)}}),this)},Parallel.prototype.resize=function(parallelModel,api){this._rect=getLayoutRect(parallelModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()}),this._layoutAxes()},Parallel.prototype.getRect=function(){return this._rect},Parallel.prototype._makeLayoutInfo=function(){var winSize,parallelModel=this._model,rect=this._rect,xy=["x","y"],wh=["width","height"],layout=parallelModel.get("layout"),pixelDimIndex="horizontal"===layout?0:1,layoutLength=rect[wh[pixelDimIndex]],layoutExtent=[0,layoutLength],axisCount=this.dimensions.length,axisExpandWidth=restrict(parallelModel.get("axisExpandWidth"),layoutExtent),axisExpandCount=restrict(parallelModel.get("axisExpandCount")||0,[0,axisCount]),axisExpandable=parallelModel.get("axisExpandable")&&axisCount>3&&axisCount>axisExpandCount&&axisExpandCount>1&&axisExpandWidth>0&&layoutLength>0,axisExpandWindow=parallelModel.get("axisExpandWindow");axisExpandWindow?(winSize=restrict(axisExpandWindow[1]-axisExpandWindow[0],layoutExtent),axisExpandWindow[1]=axisExpandWindow[0]+winSize):(winSize=restrict(axisExpandWidth*(axisExpandCount-1),layoutExtent),(axisExpandWindow=[axisExpandWidth*(parallelModel.get("axisExpandCenter")||mathFloor(axisCount/2))-winSize/2])[1]=axisExpandWindow[0]+winSize);var axisCollapseWidth=(layoutLength-winSize)/(axisCount-axisExpandCount);axisCollapseWidth<3&&(axisCollapseWidth=0);var winInnerIndices=[mathFloor(round$1(axisExpandWindow[0]/axisExpandWidth,1))+1,mathCeil(round$1(axisExpandWindow[1]/axisExpandWidth,1))-1],axisExpandWindow0Pos=axisCollapseWidth/axisExpandWidth*axisExpandWindow[0];return{layout:layout,pixelDimIndex:pixelDimIndex,layoutBase:rect[xy[pixelDimIndex]],layoutLength:layoutLength,axisBase:rect[xy[1-pixelDimIndex]],axisLength:rect[wh[1-pixelDimIndex]],axisExpandable:axisExpandable,axisExpandWidth:axisExpandWidth,axisCollapseWidth:axisCollapseWidth,axisExpandWindow:axisExpandWindow,axisCount:axisCount,winInnerIndices:winInnerIndices,axisExpandWindow0Pos:axisExpandWindow0Pos}},Parallel.prototype._layoutAxes=function(){var rect=this._rect,axes=this._axesMap,dimensions=this.dimensions,layoutInfo=this._makeLayoutInfo(),layout=layoutInfo.layout;axes.each((function(axis){var axisExtent=[0,layoutInfo.axisLength],idx=axis.inverse?1:0;axis.setExtent(axisExtent[idx],axisExtent[1-idx])})),each$6(dimensions,(function(dim,idx){var posInfo=(layoutInfo.axisExpandable?layoutAxisWithExpand:layoutAxisWithoutExpand)(idx,layoutInfo),positionTable={horizontal:{x:posInfo.position,y:layoutInfo.axisLength},vertical:{x:0,y:posInfo.position}},rotationTable={horizontal:PI/2,vertical:0},position=[positionTable[layout].x+rect.x,positionTable[layout].y+rect.y],rotation=rotationTable[layout],transform=[1,0,0,1,0,0];rotate(transform,transform,rotation),translate(transform,transform,position),this._axesLayout[dim]={position:position,rotation:rotation,transform:transform,axisNameAvailableWidth:posInfo.axisNameAvailableWidth,axisLabelShow:posInfo.axisLabelShow,nameTruncateMaxWidth:posInfo.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},Parallel.prototype.getAxis=function(dim){return this._axesMap.get(dim)},Parallel.prototype.dataToPoint=function(value,dim){return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value),dim)},Parallel.prototype.eachActiveState=function(data,callback,start,end){null==start&&(start=0),null==end&&(end=data.count());var axesMap=this._axesMap,dimensions=this.dimensions,dataDimensions=[],axisModels=[];each$b(dimensions,(function(axisDim){dataDimensions.push(data.mapDimension(axisDim)),axisModels.push(axesMap.get(axisDim).model)}));for(var hasActiveSet=this.hasAxisBrushed(),dataIndex=start;dataIndex<end;dataIndex++){var activeState=void 0;if(hasActiveSet){activeState="active";for(var values=data.getValues(dataDimensions,dataIndex),j=0,lenj=dimensions.length;j<lenj;j++){if("inactive"===axisModels[j].getActiveState(values[j])){activeState="inactive";break}}}else activeState="normal";callback(activeState,dataIndex)}},Parallel.prototype.hasAxisBrushed=function(){for(var dimensions=this.dimensions,axesMap=this._axesMap,hasActiveSet=!1,j=0,lenj=dimensions.length;j<lenj;j++)"normal"!==axesMap.get(dimensions[j]).model.getActiveState()&&(hasActiveSet=!0);return hasActiveSet},Parallel.prototype.axisCoordToPoint=function(coord,dim){return applyTransform([coord,0],this._axesLayout[dim].transform)},Parallel.prototype.getAxisLayout=function(dim){return clone$3(this._axesLayout[dim])},Parallel.prototype.getSlidedAxisExpandWindow=function(point){var layoutInfo=this._makeLayoutInfo(),pixelDimIndex=layoutInfo.pixelDimIndex,axisExpandWindow=layoutInfo.axisExpandWindow.slice(),winSize=axisExpandWindow[1]-axisExpandWindow[0],extent=[0,layoutInfo.axisExpandWidth*(layoutInfo.axisCount-1)];if(!this.containPoint(point))return{behavior:"none",axisExpandWindow:axisExpandWindow};var delta,pointCoord=point[pixelDimIndex]-layoutInfo.layoutBase-layoutInfo.axisExpandWindow0Pos,behavior="slide",axisCollapseWidth=layoutInfo.axisCollapseWidth,triggerArea=this._model.get("axisExpandSlideTriggerArea"),useJump=null!=triggerArea[0];if(axisCollapseWidth)useJump&&axisCollapseWidth&&pointCoord<winSize*triggerArea[0]?(behavior="jump",delta=pointCoord-winSize*triggerArea[2]):useJump&&axisCollapseWidth&&pointCoord>winSize*(1-triggerArea[0])?(behavior="jump",delta=pointCoord-winSize*(1-triggerArea[2])):(delta=pointCoord-winSize*triggerArea[1])>=0&&(delta=pointCoord-winSize*(1-triggerArea[1]))<=0&&(delta=0),(delta*=layoutInfo.axisExpandWidth/axisCollapseWidth)?sliderMove(delta,axisExpandWindow,extent,"all"):behavior="none";else{var winSize2=axisExpandWindow[1]-axisExpandWindow[0];(axisExpandWindow=[mathMax$1(0,extent[1]*pointCoord/winSize2-winSize2/2)])[1]=mathMin$1(extent[1],axisExpandWindow[0]+winSize2),axisExpandWindow[0]=axisExpandWindow[1]-winSize2}return{axisExpandWindow:axisExpandWindow,behavior:behavior}},Parallel}();function restrict(len,extent){return mathMin$1(mathMax$1(len,extent[0]),extent[1])}function layoutAxisWithoutExpand(axisIndex,layoutInfo){var step=layoutInfo.layoutLength/(layoutInfo.axisCount-1);return{position:step*axisIndex,axisNameAvailableWidth:step,axisLabelShow:!0}}function layoutAxisWithExpand(axisIndex,layoutInfo){var position,nameTruncateMaxWidth,layoutLength=layoutInfo.layoutLength,axisExpandWidth=layoutInfo.axisExpandWidth,axisCount=layoutInfo.axisCount,axisCollapseWidth=layoutInfo.axisCollapseWidth,winInnerIndices=layoutInfo.winInnerIndices,axisNameAvailableWidth=axisCollapseWidth,axisLabelShow=!1;return axisIndex<winInnerIndices[0]?(position=axisIndex*axisCollapseWidth,nameTruncateMaxWidth=axisCollapseWidth):axisIndex<=winInnerIndices[1]?(position=layoutInfo.axisExpandWindow0Pos+axisIndex*axisExpandWidth-layoutInfo.axisExpandWindow[0],axisNameAvailableWidth=axisExpandWidth,axisLabelShow=!0):(position=layoutLength-(axisCount-1-axisIndex)*axisCollapseWidth,nameTruncateMaxWidth=axisCollapseWidth),{position:position,axisNameAvailableWidth:axisNameAvailableWidth,axisLabelShow:axisLabelShow,nameTruncateMaxWidth:nameTruncateMaxWidth}}var Parallel$1=Parallel;var parallelCoordSysCreator$1={create:function(ecModel,api){var coordSysList=[];return ecModel.eachComponent("parallel",(function(parallelModel,idx){var coordSys=new Parallel$1(parallelModel,ecModel,api);coordSys.name="parallel_"+idx,coordSys.resize(parallelModel,api),parallelModel.coordinateSystem=coordSys,coordSys.model=parallelModel,coordSysList.push(coordSys)})),ecModel.eachSeries((function(seriesModel){if("parallel"===seriesModel.get("coordinateSystem")){var parallelModel=seriesModel.getReferringComponents("parallel",SINGLE_REFERRING).models[0];seriesModel.coordinateSystem=parallelModel.coordinateSystem}})),coordSysList}},ParallelAxisModel=function(_super){function ParallelAxisModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ParallelAxisModel.type,_this.activeIntervals=[],_this}return __extends(ParallelAxisModel,_super),ParallelAxisModel.prototype.getAreaSelectStyle=function(){return makeStyleMapper([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},ParallelAxisModel.prototype.setActiveIntervals=function(intervals){var activeIntervals=this.activeIntervals=clone$3(intervals);if(activeIntervals)for(var i=activeIntervals.length-1;i>=0;i--)asc$1(activeIntervals[i])},ParallelAxisModel.prototype.getActiveState=function(value){var activeIntervals=this.activeIntervals;if(!activeIntervals.length)return"normal";if(null==value||isNaN(+value))return"inactive";if(1===activeIntervals.length){var interval=activeIntervals[0];if(interval[0]<=value&&value<=interval[1])return"active"}else for(var i=0,len=activeIntervals.length;i<len;i++)if(activeIntervals[i][0]<=value&&value<=activeIntervals[i][1])return"active";return"inactive"},ParallelAxisModel}(ComponentModel$1);mixin(ParallelAxisModel,AxisModelCommonMixin);var ParallelAxisModel$1=ParallelAxisModel,mathMin=Math.min,mathMax=Math.max,mathPow=Math.pow,DIRECTION_MAP={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},CURSOR_MAP={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},DEFAULT_BRUSH_OPT={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},baseUID=0,BrushController=function(_super){function BrushController(zr){var _this=_super.call(this)||this;return _this._track=[],_this._covers=[],_this._handlers={},"production"!==process.env.NODE_ENV&&assert(zr),_this._zr=zr,_this.group=new Group$4,_this._uid="brushController_"+baseUID++,each$b(pointerHandlers,(function(handler,eventName){this._handlers[eventName]=bind$1(handler,this)}),_this),_this}return __extends(BrushController,_super),BrushController.prototype.enableBrush=function(brushOption){return"production"!==process.env.NODE_ENV&&assert(this._mounted),this._brushType&&this._doDisableBrush(),brushOption.brushType&&this._doEnableBrush(brushOption),this},BrushController.prototype._doEnableBrush=function(brushOption){var zr=this._zr;this._enableGlobalPan||function(zr,resourceKey,userKey){getStore(zr)[resourceKey]=userKey}(zr,"globalPan",this._uid),each$b(this._handlers,(function(handler,eventName){zr.on(eventName,handler)})),this._brushType=brushOption.brushType,this._brushOption=merge(clone$3(DEFAULT_BRUSH_OPT),brushOption,!0)},BrushController.prototype._doDisableBrush=function(){var zr=this._zr;!function(zr,resourceKey,userKey){var store=getStore(zr);store[resourceKey]===userKey&&(store[resourceKey]=null)}(zr,"globalPan",this._uid),each$b(this._handlers,(function(handler,eventName){zr.off(eventName,handler)})),this._brushType=this._brushOption=null},BrushController.prototype.setPanels=function(panelOpts){if(panelOpts&&panelOpts.length){var panels_1=this._panels={};each$b(panelOpts,(function(panelOpts){panels_1[panelOpts.panelId]=clone$3(panelOpts)}))}else this._panels=null;return this},BrushController.prototype.mount=function(opt){opt=opt||{},"production"!==process.env.NODE_ENV&&(this._mounted=!0),this._enableGlobalPan=opt.enableGlobalPan;var thisGroup=this.group;return this._zr.add(thisGroup),thisGroup.attr({x:opt.x||0,y:opt.y||0,rotation:opt.rotation||0,scaleX:opt.scaleX||1,scaleY:opt.scaleY||1}),this._transform=thisGroup.getLocalTransform(),this},BrushController.prototype.updateCovers=function(coverConfigList){"production"!==process.env.NODE_ENV&&assert(this._mounted),coverConfigList=map$1(coverConfigList,(function(coverConfig){return merge(clone$3(DEFAULT_BRUSH_OPT),coverConfig,!0)}));var oldCovers=this._covers,newCovers=this._covers=[],controller=this,creatingCover=this._creatingCover;return new DataDiffer$1(oldCovers,coverConfigList,(function(cover,index){return getKey(cover.__brushOption,index)}),getKey).add(addOrUpdate).update(addOrUpdate).remove((function(oldIndex){oldCovers[oldIndex]!==creatingCover&&controller.group.remove(oldCovers[oldIndex])})).execute(),this;function getKey(brushOption,index){return(null!=brushOption.id?brushOption.id:"\0-brush-index-"+index)+"-"+brushOption.brushType}function addOrUpdate(newIndex,oldIndex){var newBrushInternal=coverConfigList[newIndex];if(null!=oldIndex&&oldCovers[oldIndex]===creatingCover)newCovers[newIndex]=oldCovers[oldIndex];else{var cover=newCovers[newIndex]=null!=oldIndex?(oldCovers[oldIndex].__brushOption=newBrushInternal,oldCovers[oldIndex]):endCreating(controller,createCover(controller,newBrushInternal));updateCoverAfterCreation(controller,cover)}}},BrushController.prototype.unmount=function(){if("production"===process.env.NODE_ENV||this._mounted)return this.enableBrush(!1),clearCovers(this),this._zr.remove(this.group),"production"!==process.env.NODE_ENV&&(this._mounted=!1),this},BrushController.prototype.dispose=function(){this.unmount(),this.off()},BrushController}(Eventful$1);function createCover(controller,brushOption){var cover=coverRenderers[brushOption.brushType].createCover(controller,brushOption);return cover.__brushOption=brushOption,updateZ(cover,brushOption),controller.group.add(cover),cover}function endCreating(controller,creatingCover){var coverRenderer=getCoverRenderer(creatingCover);return coverRenderer.endCreating&&(coverRenderer.endCreating(controller,creatingCover),updateZ(creatingCover,creatingCover.__brushOption)),creatingCover}function updateCoverShape(controller,cover){var brushOption=cover.__brushOption;getCoverRenderer(cover).updateCoverShape(controller,cover,brushOption.range,brushOption)}function updateZ(cover,brushOption){var z=brushOption.z;null==z&&(z=1e4),cover.traverse((function(el){el.z=z,el.z2=z}))}function updateCoverAfterCreation(controller,cover){getCoverRenderer(cover).updateCommon(controller,cover),updateCoverShape(controller,cover)}function getCoverRenderer(cover){return coverRenderers[cover.__brushOption.brushType]}function getPanelByPoint(controller,e,localCursorPoint){var panel,panels=controller._panels;if(!panels)return true;var transform=controller._transform;return each$b(panels,(function(pn){pn.isTargetByCursor(e,localCursorPoint,transform)&&(panel=pn)})),panel}function getPanelByCover(controller,cover){var panels=controller._panels;if(!panels)return true;var panelId=cover.__brushOption.panelId;return null==panelId||panels[panelId]}function clearCovers(controller){var covers=controller._covers,originalLength=covers.length;return each$b(covers,(function(cover){controller.group.remove(cover)}),controller),covers.length=0,!!originalLength}function trigger(controller,opt){var areas=map$1(controller._covers,(function(cover){var brushOption=cover.__brushOption,range=clone$3(brushOption.range);return{brushType:brushOption.brushType,panelId:brushOption.panelId,range:range}}));controller.trigger("brush",{areas:areas,isEnd:!!opt.isEnd,removeOnClick:!!opt.removeOnClick})}function getTrackEnds(track){var tail=track.length-1;return tail<0&&(tail=0),[track[0],track[tail]]}function createBaseRectCover(rectRangeConverter,controller,brushOption,edgeNameSequences){var cover=new Group$4;return cover.add(new Rect$4({name:"main",style:makeStyle(brushOption),silent:!0,draggable:!0,cursor:"move",drift:curry$1(driftRect,rectRangeConverter,controller,cover,["n","s","w","e"]),ondragend:curry$1(trigger,controller,{isEnd:!0})})),each$b(edgeNameSequences,(function(nameSequence){cover.add(new Rect$4({name:nameSequence.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:curry$1(driftRect,rectRangeConverter,controller,cover,nameSequence),ondragend:curry$1(trigger,controller,{isEnd:!0})}))})),cover}function updateBaseRect(controller,cover,localRange,brushOption){var lineWidth=brushOption.brushStyle.lineWidth||0,handleSize=mathMax(lineWidth,6),x=localRange[0][0],y=localRange[1][0],xa=x-lineWidth/2,ya=y-lineWidth/2,x2=localRange[0][1],y2=localRange[1][1],x2a=x2-handleSize+lineWidth/2,y2a=y2-handleSize+lineWidth/2,width=x2-x,height=y2-y,widtha=width+lineWidth,heighta=height+lineWidth;updateRectShape(controller,cover,"main",x,y,width,height),brushOption.transformable&&(updateRectShape(controller,cover,"w",xa,ya,handleSize,heighta),updateRectShape(controller,cover,"e",x2a,ya,handleSize,heighta),updateRectShape(controller,cover,"n",xa,ya,widtha,handleSize),updateRectShape(controller,cover,"s",xa,y2a,widtha,handleSize),updateRectShape(controller,cover,"nw",xa,ya,handleSize,handleSize),updateRectShape(controller,cover,"ne",x2a,ya,handleSize,handleSize),updateRectShape(controller,cover,"sw",xa,y2a,handleSize,handleSize),updateRectShape(controller,cover,"se",x2a,y2a,handleSize,handleSize))}function updateCommon$1(controller,cover){var brushOption=cover.__brushOption,transformable=brushOption.transformable,mainEl=cover.childAt(0);mainEl.useStyle(makeStyle(brushOption)),mainEl.attr({silent:!transformable,cursor:transformable?"move":"default"}),each$b([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(nameSequence){var el=cover.childOfName(nameSequence.join("")),globalDir=1===nameSequence.length?getGlobalDirection1(controller,nameSequence[0]):function(controller,localDirNameSeq){var globalDir=[getGlobalDirection1(controller,localDirNameSeq[0]),getGlobalDirection1(controller,localDirNameSeq[1])];return("e"===globalDir[0]||"w"===globalDir[0])&&globalDir.reverse(),globalDir.join("")}(controller,nameSequence);el&&el.attr({silent:!transformable,invisible:!transformable,cursor:transformable?CURSOR_MAP[globalDir]+"-resize":null})}))}function updateRectShape(controller,cover,name,x,y,w,h){var el=cover.childOfName(name);el&&el.setShape(function(points){var xmin=mathMin(points[0][0],points[1][0]),ymin=mathMin(points[0][1],points[1][1]),xmax=mathMax(points[0][0],points[1][0]),ymax=mathMax(points[0][1],points[1][1]);return{x:xmin,y:ymin,width:xmax-xmin,height:ymax-ymin}}(clipByPanel(controller,cover,[[x,y],[x+w,y+h]])))}function makeStyle(brushOption){return defaults({strokeNoScale:!0},brushOption.brushStyle)}function formatRectRange(x,y,x2,y2){var min=[mathMin(x,x2),mathMin(y,y2)],max=[mathMax(x,x2),mathMax(y,y2)];return[[min[0],max[0]],[min[1],max[1]]]}function getGlobalDirection1(controller,localDirName){var dir=transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[localDirName],function(controller){return getTransform$1(controller.group)}(controller));return{left:"w",right:"e",top:"n",bottom:"s"}[dir]}function driftRect(rectRangeConverter,controller,cover,dirNameSequence,dx,dy){var brushOption=cover.__brushOption,rectRange=rectRangeConverter.toRectRange(brushOption.range),localDelta=toLocalDelta(controller,dx,dy);each$b(dirNameSequence,(function(dirName){var ind=DIRECTION_MAP[dirName];rectRange[ind[0]][ind[1]]+=localDelta[ind[0]]})),brushOption.range=rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0],rectRange[1][0],rectRange[0][1],rectRange[1][1])),updateCoverAfterCreation(controller,cover),trigger(controller,{isEnd:!1})}function driftPolygon(controller,cover,dx,dy){var range=cover.__brushOption.range,localDelta=toLocalDelta(controller,dx,dy);each$b(range,(function(point){point[0]+=localDelta[0],point[1]+=localDelta[1]})),updateCoverAfterCreation(controller,cover),trigger(controller,{isEnd:!1})}function toLocalDelta(controller,dx,dy){var thisGroup=controller.group,localD=thisGroup.transformCoordToLocal(dx,dy),localZero=thisGroup.transformCoordToLocal(0,0);return[localD[0]-localZero[0],localD[1]-localZero[1]]}function clipByPanel(controller,cover,data){var panel=getPanelByCover(controller,cover);return panel&&true!==panel?panel.clipPath(data,controller._transform):clone$3(data)}function preventDefault$1(e){var rawE=e.event;rawE.preventDefault&&rawE.preventDefault()}function mainShapeContain(cover,x,y){return cover.childOfName("main").contain(x,y)}function updateCoverByMouse(controller,e,localCursorPoint,isEnd){var eventParams,creatingCover=controller._creatingCover,panel=controller._creatingPanel,thisBrushOption=controller._brushOption;if(controller._track.push(localCursorPoint.slice()),function(controller){var track=controller._track;if(!track.length)return!1;var p2=track[track.length-1],p1=track[0],dx=p2[0]-p1[0],dy=p2[1]-p1[1];return mathPow(dx*dx+dy*dy,.5)>6}(controller)||creatingCover){if(panel&&!creatingCover){"single"===thisBrushOption.brushMode&&clearCovers(controller);var brushOption=clone$3(thisBrushOption);brushOption.brushType=determineBrushType(brushOption.brushType,panel),brushOption.panelId=true===panel?null:panel.panelId,creatingCover=controller._creatingCover=createCover(controller,brushOption),controller._covers.push(creatingCover)}if(creatingCover){var coverRenderer=coverRenderers[determineBrushType(controller._brushType,panel)];creatingCover.__brushOption.range=coverRenderer.getCreatingRange(clipByPanel(controller,creatingCover,controller._track)),isEnd&&(endCreating(controller,creatingCover),coverRenderer.updateCommon(controller,creatingCover)),updateCoverShape(controller,creatingCover),eventParams={isEnd:isEnd}}}else isEnd&&"single"===thisBrushOption.brushMode&&thisBrushOption.removeOnClick&&getPanelByPoint(controller,e,localCursorPoint)&&clearCovers(controller)&&(eventParams={isEnd:isEnd,removeOnClick:!0});return eventParams}function determineBrushType(brushType,panel){return"auto"===brushType?("production"!==process.env.NODE_ENV&&assert(panel&&panel.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),panel.defaultBrushType):brushType}var pointerHandlers={mousedown:function(e){if(this._dragging)handleDragEnd(this,e);else if(!e.target||!e.target.draggable){preventDefault$1(e);var localCursorPoint=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=getPanelByPoint(this,e,localCursorPoint))&&(this._dragging=!0,this._track=[localCursorPoint.slice()])}},mousemove:function(e){var x=e.offsetX,y=e.offsetY,localCursorPoint=this.group.transformCoordToLocal(x,y);if(function(controller,e,localCursorPoint){if(controller._brushType&&!function(controller,x,y){var zr=controller._zr;return x<0||x>zr.getWidth()||y<0||y>zr.getHeight()}(controller,e.offsetX,e.offsetY)){var zr=controller._zr,covers=controller._covers,currPanel=getPanelByPoint(controller,e,localCursorPoint);if(!controller._dragging)for(var i=0;i<covers.length;i++){var brushOption=covers[i].__brushOption;if(currPanel&&(!0===currPanel||brushOption.panelId===currPanel.panelId)&&coverRenderers[brushOption.brushType].contain(covers[i],localCursorPoint[0],localCursorPoint[1]))return}currPanel&&zr.setCursorStyle("crosshair")}}(this,e,localCursorPoint),this._dragging){preventDefault$1(e);var eventParams=updateCoverByMouse(this,e,localCursorPoint,!1);eventParams&&trigger(this,eventParams)}},mouseup:function(e){handleDragEnd(this,e)}};function handleDragEnd(controller,e){if(controller._dragging){preventDefault$1(e);var x=e.offsetX,y=e.offsetY,localCursorPoint=controller.group.transformCoordToLocal(x,y),eventParams=updateCoverByMouse(controller,e,localCursorPoint,!0);controller._dragging=!1,controller._track=[],controller._creatingCover=null,eventParams&&trigger(controller,eventParams)}}var coverRenderers={lineX:getLineRenderer(0),lineY:getLineRenderer(1),rect:{createCover:function(controller,brushOption){function returnInput(range){return range}return createBaseRectCover({toRectRange:returnInput,fromRectRange:returnInput},controller,brushOption,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(localTrack){var ends=getTrackEnds(localTrack);return formatRectRange(ends[1][0],ends[1][1],ends[0][0],ends[0][1])},updateCoverShape:function(controller,cover,localRange,brushOption){updateBaseRect(controller,cover,localRange,brushOption)},updateCommon:updateCommon$1,contain:mainShapeContain},polygon:{createCover:function(controller,brushOption){var cover=new Group$4;return cover.add(new Polyline$1({name:"main",style:makeStyle(brushOption),silent:!0})),cover},getCreatingRange:function(localTrack){return localTrack},endCreating:function(controller,cover){cover.remove(cover.childAt(0)),cover.add(new Polygon$1({name:"main",draggable:!0,drift:curry$1(driftPolygon,controller,cover),ondragend:curry$1(trigger,controller,{isEnd:!0})}))},updateCoverShape:function(controller,cover,localRange,brushOption){cover.childAt(0).setShape({points:clipByPanel(controller,cover,localRange)})},updateCommon:updateCommon$1,contain:mainShapeContain}};function getLineRenderer(xyIndex){return{createCover:function(controller,brushOption){return createBaseRectCover({toRectRange:function(range){var rectRange=[range,[0,100]];return xyIndex&&rectRange.reverse(),rectRange},fromRectRange:function(rectRange){return rectRange[xyIndex]}},controller,brushOption,[[["w"],["e"]],[["n"],["s"]]][xyIndex])},getCreatingRange:function(localTrack){var ends=getTrackEnds(localTrack);return[mathMin(ends[0][xyIndex],ends[1][xyIndex]),mathMax(ends[0][xyIndex],ends[1][xyIndex])]},updateCoverShape:function(controller,cover,localRange,brushOption){var otherExtent,panel=getPanelByCover(controller,cover);if(true!==panel&&panel.getLinearBrushOtherExtent)otherExtent=panel.getLinearBrushOtherExtent(xyIndex);else{var zr=controller._zr;otherExtent=[0,[zr.getWidth(),zr.getHeight()][1-xyIndex]]}var rectRange=[localRange,otherExtent];xyIndex&&rectRange.reverse(),updateBaseRect(controller,cover,rectRange,brushOption)},updateCommon:updateCommon$1,contain:mainShapeContain}}var BrushController$1=BrushController;function makeRectPanelClipPath(rect){return rect=normalizeRect(rect),function(localPoints){return clipPointsByRect(localPoints,rect)}}function makeLinearBrushOtherExtent(rect,specifiedXYIndex){return rect=normalizeRect(rect),function(xyIndex){var idx=null!=specifiedXYIndex?specifiedXYIndex:xyIndex,brushWidth=idx?rect.width:rect.height,base=idx?rect.x:rect.y;return[base,base+(brushWidth||0)]}}function makeRectIsTargetByCursor(rect,api,targetModel){var boundingRect=normalizeRect(rect);return function(e,localCursorPoint){return boundingRect.contain(localCursorPoint[0],localCursorPoint[1])&&!onIrrelevantElement(e,api,targetModel)}}function normalizeRect(rect){return BoundingRect$1.create(rect)}var elementList=["axisLine","axisTickLabel","axisName"],ParallelAxisView=function(_super){function ParallelAxisView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ParallelAxisView.type,_this}return __extends(ParallelAxisView,_super),ParallelAxisView.prototype.init=function(ecModel,api){_super.prototype.init.apply(this,arguments),(this._brushController=new BrushController$1(api.getZr())).on("brush",bind$1(this._onBrush,this))},ParallelAxisView.prototype.render=function(axisModel,ecModel,api,payload){if(!function(axisModel,ecModel,payload){return payload&&"axisAreaSelect"===payload.type&&ecModel.findComponents({mainType:"parallelAxis",query:payload})[0]===axisModel}(axisModel,ecModel,payload)){this.axisModel=axisModel,this.api=api,this.group.removeAll();var oldAxisGroup=this._axisGroup;if(this._axisGroup=new Group$4,this.group.add(this._axisGroup),axisModel.get("show")){var coordSysModel=function(axisModel,ecModel){return ecModel.getComponent("parallel",axisModel.get("parallelIndex"))}(axisModel,ecModel),coordSys=coordSysModel.coordinateSystem,areaSelectStyle=axisModel.getAreaSelectStyle(),areaWidth=areaSelectStyle.width,dim=axisModel.axis.dim,builderOpt=extend({strokeContainThreshold:areaWidth},coordSys.getAxisLayout(dim)),axisBuilder=new AxisBuilder$1(axisModel,builderOpt);each$b(elementList,axisBuilder.add,axisBuilder),this._axisGroup.add(axisBuilder.getGroup()),this._refreshBrushController(builderOpt,areaSelectStyle,axisModel,coordSysModel,areaWidth,api),groupTransition(oldAxisGroup,this._axisGroup,axisModel)}}},ParallelAxisView.prototype._refreshBrushController=function(builderOpt,areaSelectStyle,axisModel,coordSysModel,areaWidth,api){var extent=axisModel.axis.getExtent(),extentLen=extent[1]-extent[0],extra=Math.min(30,.1*Math.abs(extentLen)),rect=BoundingRect$1.create({x:extent[0],y:-areaWidth/2,width:extentLen,height:areaWidth});rect.x-=extra,rect.width+=2*extra,this._brushController.mount({enableGlobalPan:!0,rotation:builderOpt.rotation,x:builderOpt.position[0],y:builderOpt.position[1]}).setPanels([{panelId:"pl",clipPath:makeRectPanelClipPath(rect),isTargetByCursor:makeRectIsTargetByCursor(rect,api,coordSysModel),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(rect,0)}]).enableBrush({brushType:"lineX",brushStyle:areaSelectStyle,removeOnClick:!0}).updateCovers(function(axisModel){var axis=axisModel.axis;return map$1(axisModel.activeIntervals,(function(interval){return{brushType:"lineX",panelId:"pl",range:[axis.dataToCoord(interval[0],!0),axis.dataToCoord(interval[1],!0)]}}))}(axisModel))},ParallelAxisView.prototype._onBrush=function(eventParam){var coverInfoList=eventParam.areas,axisModel=this.axisModel,axis=axisModel.axis,intervals=map$1(coverInfoList,(function(coverInfo){return[axis.coordToData(coverInfo.range[0],!0),axis.coordToData(coverInfo.range[1],!0)]}));(!axisModel.option.realtime===eventParam.isEnd||eventParam.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:axisModel.id,intervals:intervals})},ParallelAxisView.prototype.dispose=function(){this._brushController.dispose()},ParallelAxisView.type="parallelAxis",ParallelAxisView}(ComponentView$1);var ParallelAxisView$1=ParallelAxisView,actionInfo={type:"axisAreaSelect",event:"axisAreaSelected"};var defaultAxisOption={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function install$n(registers){registers.registerComponentView(ParallelView$1),registers.registerComponentModel(ParallelModel$1),registers.registerCoordinateSystem("parallel",parallelCoordSysCreator$1),registers.registerPreprocessor(parallelPreprocessor),registers.registerComponentModel(ParallelAxisModel$1),registers.registerComponentView(ParallelAxisView$1),axisModelCreator(registers,"parallel",ParallelAxisModel$1,defaultAxisOption),function(registers){registers.registerAction(actionInfo,(function(payload,ecModel){ecModel.eachComponent({mainType:"parallelAxis",query:payload},(function(parallelAxisModel){parallelAxisModel.axis.model.setActiveIntervals(payload.intervals)}))})),registers.registerAction("parallelAxisExpand",(function(payload,ecModel){ecModel.eachComponent({mainType:"parallel",query:payload},(function(parallelModel){parallelModel.setAxisExpand(payload)}))}))}(registers)}var SankeyPathShape=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},SankeyPath=function(_super){function SankeyPath(opts){return _super.call(this,opts)||this}return __extends(SankeyPath,_super),SankeyPath.prototype.getDefaultShape=function(){return new SankeyPathShape},SankeyPath.prototype.buildPath=function(ctx,shape){var extent=shape.extent;ctx.moveTo(shape.x1,shape.y1),ctx.bezierCurveTo(shape.cpx1,shape.cpy1,shape.cpx2,shape.cpy2,shape.x2,shape.y2),"vertical"===shape.orient?(ctx.lineTo(shape.x2+extent,shape.y2),ctx.bezierCurveTo(shape.cpx2+extent,shape.cpy2,shape.cpx1+extent,shape.cpy1,shape.x1+extent,shape.y1)):(ctx.lineTo(shape.x2,shape.y2+extent),ctx.bezierCurveTo(shape.cpx2,shape.cpy2+extent,shape.cpx1,shape.cpy1+extent,shape.x1,shape.y1+extent)),ctx.closePath()},SankeyPath.prototype.highlight=function(){enterEmphasis(this)},SankeyPath.prototype.downplay=function(){leaveEmphasis(this)},SankeyPath}(Path$1),SankeyView=function(_super){function SankeyView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=SankeyView.type,_this._focusAdjacencyDisabled=!1,_this}return __extends(SankeyView,_super),SankeyView.prototype.render=function(seriesModel,ecModel,api){var sankeyView=this,graph=seriesModel.getGraph(),group=this.group,layoutInfo=seriesModel.layoutInfo,width=layoutInfo.width,height=layoutInfo.height,nodeData=seriesModel.getData(),edgeData=seriesModel.getData("edge"),orient=seriesModel.get("orient");this._model=seriesModel,group.removeAll(),group.x=layoutInfo.x,group.y=layoutInfo.y,graph.eachEdge((function(edge){var curve=new SankeyPath,ecData=getECData(curve);ecData.dataIndex=edge.dataIndex,ecData.seriesIndex=seriesModel.seriesIndex,ecData.dataType="edge";var x1,y1,x2,y2,cpx1,cpy1,cpx2,cpy2,edgeModel=edge.getModel(),lineStyleModel=edgeModel.getModel("lineStyle"),curvature=lineStyleModel.get("curveness"),n1Layout=edge.node1.getLayout(),node1Model=edge.node1.getModel(),dragX1=node1Model.get("localX"),dragY1=node1Model.get("localY"),n2Layout=edge.node2.getLayout(),node2Model=edge.node2.getModel(),dragX2=node2Model.get("localX"),dragY2=node2Model.get("localY"),edgeLayout=edge.getLayout();curve.shape.extent=Math.max(1,edgeLayout.dy),curve.shape.orient=orient,"vertical"===orient?(x1=(null!=dragX1?dragX1*width:n1Layout.x)+edgeLayout.sy,y1=(null!=dragY1?dragY1*height:n1Layout.y)+n1Layout.dy,x2=(null!=dragX2?dragX2*width:n2Layout.x)+edgeLayout.ty,cpx1=x1,cpy1=y1*(1-curvature)+(y2=null!=dragY2?dragY2*height:n2Layout.y)*curvature,cpx2=x2,cpy2=y1*curvature+y2*(1-curvature)):(x1=(null!=dragX1?dragX1*width:n1Layout.x)+n1Layout.dx,y1=(null!=dragY1?dragY1*height:n1Layout.y)+edgeLayout.sy,cpx1=x1*(1-curvature)+(x2=null!=dragX2?dragX2*width:n2Layout.x)*curvature,cpy1=y1,cpx2=x1*curvature+x2*(1-curvature),cpy2=y2=(null!=dragY2?dragY2*height:n2Layout.y)+edgeLayout.ty),curve.setShape({x1:x1,y1:y1,x2:x2,y2:y2,cpx1:cpx1,cpy1:cpy1,cpx2:cpx2,cpy2:cpy2}),curve.useStyle(lineStyleModel.getItemStyle()),applyCurveStyle(curve.style,orient,edge);var defaultEdgeLabelText=""+edgeModel.get("value"),edgeLabelStateModels=getLabelStatesModels(edgeModel,"edgeLabel");setLabelStyle(curve,edgeLabelStateModels,{labelFetcher:{getFormattedLabel:function(dataIndex,stateName,dataType,labelDimIndex,formatter,extendParams){return seriesModel.getFormattedLabel(dataIndex,stateName,"edge",labelDimIndex,retrieve3(formatter,edgeLabelStateModels.normal&&edgeLabelStateModels.normal.get("formatter"),defaultEdgeLabelText),extendParams)}},labelDataIndex:edge.dataIndex,defaultText:defaultEdgeLabelText}),curve.setTextConfig({position:"inside"});var emphasisModel=edgeModel.getModel("emphasis");setStatesStylesFromModel(curve,edgeModel,"lineStyle",(function(model){var style=model.getItemStyle();return applyCurveStyle(style,orient,edge),style})),group.add(curve),edgeData.setItemGraphicEl(edge.dataIndex,curve);var focus=emphasisModel.get("focus");toggleHoverEmphasis(curve,"adjacency"===focus?edge.getAdjacentDataIndices():"trajectory"===focus?edge.getTrajectoryDataIndices():focus,emphasisModel.get("blurScope"),emphasisModel.get("disabled"))})),graph.eachNode((function(node){var layout=node.getLayout(),itemModel=node.getModel(),dragX=itemModel.get("localX"),dragY=itemModel.get("localY"),emphasisModel=itemModel.getModel("emphasis"),borderRadius=itemModel.get(["itemStyle","borderRadius"])||0,rect=new Rect$4({shape:{x:null!=dragX?dragX*width:layout.x,y:null!=dragY?dragY*height:layout.y,width:layout.dx,height:layout.dy,r:borderRadius},style:itemModel.getModel("itemStyle").getItemStyle(),z2:10});setLabelStyle(rect,getLabelStatesModels(itemModel),{labelFetcher:{getFormattedLabel:function(dataIndex,stateName){return seriesModel.getFormattedLabel(dataIndex,stateName,"node")}},labelDataIndex:node.dataIndex,defaultText:node.id}),rect.disableLabelAnimation=!0,rect.setStyle("fill",node.getVisual("color")),rect.setStyle("decal",node.getVisual("style").decal),setStatesStylesFromModel(rect,itemModel),group.add(rect),nodeData.setItemGraphicEl(node.dataIndex,rect),getECData(rect).dataType="node";var focus=emphasisModel.get("focus");toggleHoverEmphasis(rect,"adjacency"===focus?node.getAdjacentDataIndices():"trajectory"===focus?node.getTrajectoryDataIndices():focus,emphasisModel.get("blurScope"),emphasisModel.get("disabled"))})),nodeData.eachItemGraphicEl((function(el,dataIndex){nodeData.getItemModel(dataIndex).get("draggable")&&(el.drift=function(dx,dy){sankeyView._focusAdjacencyDisabled=!0,this.shape.x+=dx,this.shape.y+=dy,this.dirty(),api.dispatchAction({type:"dragNode",seriesId:seriesModel.id,dataIndex:nodeData.getRawIndex(dataIndex),localX:this.shape.x/width,localY:this.shape.y/height})},el.ondragend=function(){sankeyView._focusAdjacencyDisabled=!1},el.draggable=!0,el.cursor="move")})),!this._data&&seriesModel.isAnimationEnabled()&&group.setClipPath(function(rect,seriesModel,cb){var rectEl=new Rect$4({shape:{x:rect.x-10,y:rect.y-10,width:0,height:rect.height+20}});return initProps(rectEl,{shape:{width:rect.width+20}},seriesModel,cb),rectEl}(group.getBoundingRect(),seriesModel,(function(){group.removeClipPath()}))),this._data=seriesModel.getData()},SankeyView.prototype.dispose=function(){},SankeyView.type="sankey",SankeyView}(ChartView$1);function applyCurveStyle(curveProps,orient,edge){switch(curveProps.fill){case"source":curveProps.fill=edge.node1.getVisual("color"),curveProps.decal=edge.node1.getVisual("style").decal;break;case"target":curveProps.fill=edge.node2.getVisual("color"),curveProps.decal=edge.node2.getVisual("style").decal;break;case"gradient":var sourceColor=edge.node1.getVisual("color"),targetColor=edge.node2.getVisual("color");isString(sourceColor)&&isString(targetColor)&&(curveProps.fill=new LinearGradient$1(0,0,+("horizontal"===orient),+("vertical"===orient),[{color:sourceColor,offset:0},{color:targetColor,offset:1}]))}}var SankeyView$1=SankeyView,SankeySeriesModel=function(_super){function SankeySeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=SankeySeriesModel.type,_this}return __extends(SankeySeriesModel,_super),SankeySeriesModel.prototype.getInitialData=function(option,ecModel){var links=option.edges||option.links||[],nodes=option.data||option.nodes||[],levels=option.levels||[];this.levelModels=[];for(var levelModels=this.levelModels,i=0;i<levels.length;i++)if(null!=levels[i].depth&&levels[i].depth>=0)levelModels[levels[i].depth]=new Model$1(levels[i],this,ecModel);else if("production"!==process.env.NODE_ENV)throw new Error("levels[i].depth is mandatory and should be natural number");var graph=createGraphFromNodeEdge(nodes,links,this,!0,(function(nodeData,edgeData){nodeData.wrapMethod("getItemModel",(function(model,idx){var seriesModel=model.parentModel,layout=seriesModel.getData().getItemLayout(idx);if(layout){var nodeDepth=layout.depth,levelModel=seriesModel.levelModels[nodeDepth];levelModel&&(model.parentModel=levelModel)}return model})),edgeData.wrapMethod("getItemModel",(function(model,idx){var seriesModel=model.parentModel,layout=seriesModel.getGraph().getEdgeByIndex(idx).node1.getLayout();if(layout){var depth=layout.depth,levelModel=seriesModel.levelModels[depth];levelModel&&(model.parentModel=levelModel)}return model}))}));return graph.data},SankeySeriesModel.prototype.setNodePosition=function(dataIndex,localPosition){var dataItem=(this.option.data||this.option.nodes)[dataIndex];dataItem.localX=localPosition[0],dataItem.localY=localPosition[1]},SankeySeriesModel.prototype.getGraph=function(){return this.getData().graph},SankeySeriesModel.prototype.getEdgeData=function(){return this.getGraph().edgeData},SankeySeriesModel.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){function noValue(val){return isNaN(val)||null==val}if("edge"===dataType){var params=this.getDataParams(dataIndex,dataType),rawDataOpt=params.data,edgeValue=params.value;return createTooltipMarkup("nameValue",{name:rawDataOpt.source+" -- "+rawDataOpt.target,value:edgeValue,noValue:noValue(edgeValue)})}var value=this.getGraph().getNodeByIndex(dataIndex).getLayout().value,name_1=this.getDataParams(dataIndex,dataType).data.name;return createTooltipMarkup("nameValue",{name:null!=name_1?name_1+"":null,value:value,noValue:noValue(value)})},SankeySeriesModel.prototype.optionUpdated=function(){},SankeySeriesModel.prototype.getDataParams=function(dataIndex,dataType){var params=_super.prototype.getDataParams.call(this,dataIndex,dataType);if(null==params.value&&"node"===dataType){var nodeValue=this.getGraph().getNodeByIndex(dataIndex).getLayout().value;params.value=nodeValue}return params},SankeySeriesModel.type="series.sankey",SankeySeriesModel.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},SankeySeriesModel}(SeriesModel$1),SankeySeriesModel$1=SankeySeriesModel;function sankeyLayout(ecModel,api){ecModel.eachSeriesByType("sankey",(function(seriesModel){var nodeWidth=seriesModel.get("nodeWidth"),nodeGap=seriesModel.get("nodeGap"),layoutInfo=function(seriesModel,api){return getLayoutRect(seriesModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()})}(seriesModel,api);seriesModel.layoutInfo=layoutInfo;var width=layoutInfo.width,height=layoutInfo.height,graph=seriesModel.getGraph(),nodes=graph.nodes,edges=graph.edges;!function(nodes){each$b(nodes,(function(node){var value1=sum(node.outEdges,getEdgeValue),value2=sum(node.inEdges,getEdgeValue),nodeRawValue=node.getValue()||0,value=Math.max(value1,value2,nodeRawValue);node.setLayout({value:value},!0)}))}(nodes),function(nodes,edges,nodeWidth,nodeGap,width,height,iterations,orient,nodeAlign){(function(nodes,edges,nodeWidth,width,height,orient,nodeAlign){for(var remainEdges=[],indegreeArr=[],zeroIndegrees=[],nextTargetNode=[],x=0,i=0;i<edges.length;i++)remainEdges[i]=1;for(i=0;i<nodes.length;i++)indegreeArr[i]=nodes[i].inEdges.length,0===indegreeArr[i]&&zeroIndegrees.push(nodes[i]);var maxNodeDepth=-1;for(;zeroIndegrees.length;){for(var idx=0;idx<zeroIndegrees.length;idx++){var node=zeroIndegrees[idx],item=node.hostGraph.data.getRawDataItem(node.dataIndex),isItemDepth=null!=item.depth&&item.depth>=0;isItemDepth&&item.depth>maxNodeDepth&&(maxNodeDepth=item.depth),node.setLayout({depth:isItemDepth?item.depth:x},!0),"vertical"===orient?node.setLayout({dy:nodeWidth},!0):node.setLayout({dx:nodeWidth},!0);for(var edgeIdx=0;edgeIdx<node.outEdges.length;edgeIdx++){var edge=node.outEdges[edgeIdx];remainEdges[edges.indexOf(edge)]=0;var targetNode=edge.node2;0==--indegreeArr[nodes.indexOf(targetNode)]&&nextTargetNode.indexOf(targetNode)<0&&nextTargetNode.push(targetNode)}}++x,zeroIndegrees=nextTargetNode,nextTargetNode=[]}for(i=0;i<remainEdges.length;i++)if(1===remainEdges[i])throw new Error("Sankey is a DAG, the original data has cycle!");var maxDepth=maxNodeDepth>x-1?maxNodeDepth:x-1;nodeAlign&&"left"!==nodeAlign&&function(nodes,nodeAlign,orient,maxDepth){if("right"===nodeAlign){for(var nextSourceNode=[],remainNodes=nodes,nodeHeight=0;remainNodes.length;){for(var i=0;i<remainNodes.length;i++){var node=remainNodes[i];node.setLayout({skNodeHeight:nodeHeight},!0);for(var j=0;j<node.inEdges.length;j++){var edge=node.inEdges[j];nextSourceNode.indexOf(edge.node1)<0&&nextSourceNode.push(edge.node1)}}remainNodes=nextSourceNode,nextSourceNode=[],++nodeHeight}each$b(nodes,(function(node){isNodeDepth(node)||node.setLayout({depth:Math.max(0,maxDepth-node.getLayout().skNodeHeight)},!0)}))}else"justify"===nodeAlign&&function(nodes,maxDepth){each$b(nodes,(function(node){isNodeDepth(node)||node.outEdges.length||node.setLayout({depth:maxDepth},!0)}))}(nodes,maxDepth)}(nodes,nodeAlign,0,maxDepth);var kx="vertical"===orient?(height-nodeWidth)/maxDepth:(width-nodeWidth)/maxDepth;!function(nodes,kx,orient){each$b(nodes,(function(node){var nodeDepth=node.getLayout().depth*kx;"vertical"===orient?node.setLayout({y:nodeDepth},!0):node.setLayout({x:nodeDepth},!0)}))}(nodes,kx,orient)})(nodes,edges,nodeWidth,width,height,orient,nodeAlign),function(nodes,edges,height,width,nodeGap,iterations,orient){var nodesByBreadth=function(nodes,orient){var nodesByBreadth=[],keyAttr="vertical"===orient?"y":"x",groupResult=groupData(nodes,(function(node){return node.getLayout()[keyAttr]}));return groupResult.keys.sort((function(a,b){return a-b})),each$b(groupResult.keys,(function(key){nodesByBreadth.push(groupResult.buckets.get(key))})),nodesByBreadth}(nodes,orient);(function(nodesByBreadth,edges,height,width,nodeGap,orient){var minKy=1/0;each$b(nodesByBreadth,(function(nodes){var n=nodes.length,sum=0;each$b(nodes,(function(node){sum+=node.getLayout().value}));var ky="vertical"===orient?(width-(n-1)*nodeGap)/sum:(height-(n-1)*nodeGap)/sum;ky<minKy&&(minKy=ky)})),each$b(nodesByBreadth,(function(nodes){each$b(nodes,(function(node,i){var nodeDy=node.getLayout().value*minKy;"vertical"===orient?(node.setLayout({x:i},!0),node.setLayout({dx:nodeDy},!0)):(node.setLayout({y:i},!0),node.setLayout({dy:nodeDy},!0))}))})),each$b(edges,(function(edge){var edgeDy=+edge.getValue()*minKy;edge.setLayout({dy:edgeDy},!0)}))})(nodesByBreadth,edges,height,width,nodeGap,orient),resolveCollisions(nodesByBreadth,nodeGap,height,width,orient);for(var alpha=1;iterations>0;iterations--)relaxRightToLeft(nodesByBreadth,alpha*=.99,orient),resolveCollisions(nodesByBreadth,nodeGap,height,width,orient),relaxLeftToRight(nodesByBreadth,alpha,orient),resolveCollisions(nodesByBreadth,nodeGap,height,width,orient)}(nodes,edges,height,width,nodeGap,iterations,orient),function(nodes,orient){var keyAttr="vertical"===orient?"x":"y";each$b(nodes,(function(node){node.outEdges.sort((function(a,b){return a.node2.getLayout()[keyAttr]-b.node2.getLayout()[keyAttr]})),node.inEdges.sort((function(a,b){return a.node1.getLayout()[keyAttr]-b.node1.getLayout()[keyAttr]}))})),each$b(nodes,(function(node){var sy=0,ty=0;each$b(node.outEdges,(function(edge){edge.setLayout({sy:sy},!0),sy+=edge.getLayout().dy})),each$b(node.inEdges,(function(edge){edge.setLayout({ty:ty},!0),ty+=edge.getLayout().dy}))}))}(nodes,orient)}(nodes,edges,nodeWidth,nodeGap,width,height,0!==filter(nodes,(function(node){return 0===node.getLayout().value})).length?0:seriesModel.get("layoutIterations"),seriesModel.get("orient"),seriesModel.get("nodeAlign"))}))}function isNodeDepth(node){var item=node.hostGraph.data.getRawDataItem(node.dataIndex);return null!=item.depth&&item.depth>=0}function resolveCollisions(nodesByBreadth,nodeGap,height,width,orient){var keyAttr="vertical"===orient?"x":"y";each$b(nodesByBreadth,(function(nodes){var nodeX,node,dy;nodes.sort((function(a,b){return a.getLayout()[keyAttr]-b.getLayout()[keyAttr]}));for(var y0=0,n=nodes.length,nodeDyAttr="vertical"===orient?"dx":"dy",i=0;i<n;i++)(dy=y0-(node=nodes[i]).getLayout()[keyAttr])>0&&(nodeX=node.getLayout()[keyAttr]+dy,"vertical"===orient?node.setLayout({x:nodeX},!0):node.setLayout({y:nodeX},!0)),y0=node.getLayout()[keyAttr]+node.getLayout()[nodeDyAttr]+nodeGap;if((dy=y0-nodeGap-("vertical"===orient?width:height))>0){nodeX=node.getLayout()[keyAttr]-dy,"vertical"===orient?node.setLayout({x:nodeX},!0):node.setLayout({y:nodeX},!0),y0=nodeX;for(i=n-2;i>=0;--i)(dy=(node=nodes[i]).getLayout()[keyAttr]+node.getLayout()[nodeDyAttr]+nodeGap-y0)>0&&(nodeX=node.getLayout()[keyAttr]-dy,"vertical"===orient?node.setLayout({x:nodeX},!0):node.setLayout({y:nodeX},!0)),y0=node.getLayout()[keyAttr]}}))}function relaxRightToLeft(nodesByBreadth,alpha,orient){each$b(nodesByBreadth.slice().reverse(),(function(nodes){each$b(nodes,(function(node){if(node.outEdges.length){var y=sum(node.outEdges,weightedTarget,orient)/sum(node.outEdges,getEdgeValue);if(isNaN(y)){var len=node.outEdges.length;y=len?sum(node.outEdges,centerTarget,orient)/len:0}if("vertical"===orient){var nodeX=node.getLayout().x+(y-center(node,orient))*alpha;node.setLayout({x:nodeX},!0)}else{var nodeY=node.getLayout().y+(y-center(node,orient))*alpha;node.setLayout({y:nodeY},!0)}}}))}))}function weightedTarget(edge,orient){return center(edge.node2,orient)*edge.getValue()}function centerTarget(edge,orient){return center(edge.node2,orient)}function weightedSource(edge,orient){return center(edge.node1,orient)*edge.getValue()}function centerSource(edge,orient){return center(edge.node1,orient)}function center(node,orient){return"vertical"===orient?node.getLayout().x+node.getLayout().dx/2:node.getLayout().y+node.getLayout().dy/2}function getEdgeValue(edge){return edge.getValue()}function sum(array,cb,orient){for(var sum=0,len=array.length,i=-1;++i<len;){var value=+cb(array[i],orient);isNaN(value)||(sum+=value)}return sum}function relaxLeftToRight(nodesByBreadth,alpha,orient){each$b(nodesByBreadth,(function(nodes){each$b(nodes,(function(node){if(node.inEdges.length){var y=sum(node.inEdges,weightedSource,orient)/sum(node.inEdges,getEdgeValue);if(isNaN(y)){var len=node.inEdges.length;y=len?sum(node.inEdges,centerSource,orient)/len:0}if("vertical"===orient){var nodeX=node.getLayout().x+(y-center(node,orient))*alpha;node.setLayout({x:nodeX},!0)}else{var nodeY=node.getLayout().y+(y-center(node,orient))*alpha;node.setLayout({y:nodeY},!0)}}}))}))}function sankeyVisual(ecModel){ecModel.eachSeriesByType("sankey",(function(seriesModel){var graph=seriesModel.getGraph(),nodes=graph.nodes,edges=graph.edges;if(nodes.length){var minValue_1=1/0,maxValue_1=-1/0;each$b(nodes,(function(node){var nodeValue=node.getLayout().value;nodeValue<minValue_1&&(minValue_1=nodeValue),nodeValue>maxValue_1&&(maxValue_1=nodeValue)})),each$b(nodes,(function(node){var mapValueToColor=new VisualMapping$1({type:"color",mappingMethod:"linear",dataExtent:[minValue_1,maxValue_1],visual:seriesModel.get("color")}).mapValueToVisual(node.getLayout().value),customColor=node.getModel().get(["itemStyle","color"]);null!=customColor?(node.setVisual("color",customColor),node.setVisual("style",{fill:customColor})):(node.setVisual("color",mapValueToColor),node.setVisual("style",{fill:mapValueToColor}))}))}edges.length&&each$b(edges,(function(edge){var edgeStyle=edge.getModel().get("lineStyle");edge.setVisual("style",edgeStyle)}))}))}var WhiskerBoxCommonMixin=function(){function WhiskerBoxCommonMixin(){}return WhiskerBoxCommonMixin.prototype._hasEncodeRule=function(key){var encodeRules=this.getEncode();return encodeRules&&null!=encodeRules.get(key)},WhiskerBoxCommonMixin.prototype.getInitialData=function(option,ecModel){var ordinalMeta,addOrdinal,xAxisModel=ecModel.getComponent("xAxis",this.get("xAxisIndex")),yAxisModel=ecModel.getComponent("yAxis",this.get("yAxisIndex")),xAxisType=xAxisModel.get("type"),yAxisType=yAxisModel.get("type");"category"===xAxisType?(option.layout="horizontal",ordinalMeta=xAxisModel.getOrdinalMeta(),addOrdinal=!this._hasEncodeRule("x")):"category"===yAxisType?(option.layout="vertical",ordinalMeta=yAxisModel.getOrdinalMeta(),addOrdinal=!this._hasEncodeRule("y")):option.layout=option.layout||"horizontal";var coordDims=["x","y"],baseAxisDimIndex="horizontal"===option.layout?0:1,baseAxisDim=this._baseAxisDim=coordDims[baseAxisDimIndex],otherAxisDim=coordDims[1-baseAxisDimIndex],axisModels=[xAxisModel,yAxisModel],baseAxisType=axisModels[baseAxisDimIndex].get("type"),otherAxisType=axisModels[1-baseAxisDimIndex].get("type"),data=option.data;if(data&&addOrdinal){var newOptionData_1=[];each$b(data,(function(item,index){var newItem;isArray(item)?(newItem=item.slice(),item.unshift(index)):isArray(item.value)?((newItem=extend({},item)).value=newItem.value.slice(),item.value.unshift(index)):newItem=item,newOptionData_1.push(newItem)})),option.data=newOptionData_1}var defaultValueDimensions=this.defaultValueDimensions,coordDimensions=[{name:baseAxisDim,type:getDimensionTypeByAxis(baseAxisType),ordinalMeta:ordinalMeta,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:otherAxisDim,type:getDimensionTypeByAxis(otherAxisType),dimsDef:defaultValueDimensions.slice()}];return createSeriesDataSimply(this,{coordDimensions:coordDimensions,dimensionsCount:defaultValueDimensions.length+1,encodeDefaulter:curry$1(makeSeriesEncodeForAxisCoordSys,coordDimensions,this)})},WhiskerBoxCommonMixin.prototype.getBaseAxis=function(){var dim=this._baseAxisDim;return this.ecModel.getComponent(dim+"Axis",this.get(dim+"AxisIndex")).axis},WhiskerBoxCommonMixin}(),BoxplotSeriesModel=function(_super){function BoxplotSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=BoxplotSeriesModel.type,_this.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],_this.visualDrawType="stroke",_this}return __extends(BoxplotSeriesModel,_super),BoxplotSeriesModel.type="series.boxplot",BoxplotSeriesModel.dependencies=["xAxis","yAxis","grid"],BoxplotSeriesModel.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},BoxplotSeriesModel}(SeriesModel$1);mixin(BoxplotSeriesModel,WhiskerBoxCommonMixin,!0);var BoxplotSeriesModel$1=BoxplotSeriesModel,BoxplotView=function(_super){function BoxplotView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=BoxplotView.type,_this}return __extends(BoxplotView,_super),BoxplotView.prototype.render=function(seriesModel,ecModel,api){var data=seriesModel.getData(),group=this.group,oldData=this._data;this._data||group.removeAll();var constDim="horizontal"===seriesModel.get("layout")?1:0;data.diff(oldData).add((function(newIdx){if(data.hasValue(newIdx)){var symbolEl=createNormalBox(data.getItemLayout(newIdx),data,newIdx,constDim,!0);data.setItemGraphicEl(newIdx,symbolEl),group.add(symbolEl)}})).update((function(newIdx,oldIdx){var symbolEl=oldData.getItemGraphicEl(oldIdx);if(data.hasValue(newIdx)){var itemLayout=data.getItemLayout(newIdx);symbolEl?(saveOldStyle(symbolEl),updateNormalBoxData(itemLayout,symbolEl,data,newIdx)):symbolEl=createNormalBox(itemLayout,data,newIdx,constDim),group.add(symbolEl),data.setItemGraphicEl(newIdx,symbolEl)}else group.remove(symbolEl)})).remove((function(oldIdx){var el=oldData.getItemGraphicEl(oldIdx);el&&group.remove(el)})).execute(),this._data=data},BoxplotView.prototype.remove=function(ecModel){var group=this.group,data=this._data;this._data=null,data&&data.eachItemGraphicEl((function(el){el&&group.remove(el)}))},BoxplotView.type="boxplot",BoxplotView}(ChartView$1),BoxPathShape=function(){},BoxPath=function(_super){function BoxPath(opts){var _this=_super.call(this,opts)||this;return _this.type="boxplotBoxPath",_this}return __extends(BoxPath,_super),BoxPath.prototype.getDefaultShape=function(){return new BoxPathShape},BoxPath.prototype.buildPath=function(ctx,shape){var ends=shape.points,i=0;for(ctx.moveTo(ends[i][0],ends[i][1]),i++;i<4;i++)ctx.lineTo(ends[i][0],ends[i][1]);for(ctx.closePath();i<ends.length;i++)ctx.moveTo(ends[i][0],ends[i][1]),i++,ctx.lineTo(ends[i][0],ends[i][1])},BoxPath}(Path$1);function createNormalBox(itemLayout,data,dataIndex,constDim,isInit){var ends=itemLayout.ends,el=new BoxPath({shape:{points:isInit?transInit(ends,constDim,itemLayout):ends}});return updateNormalBoxData(itemLayout,el,data,dataIndex,isInit),el}function updateNormalBoxData(itemLayout,el,data,dataIndex,isInit){var seriesModel=data.hostModel;(0,graphic[isInit?"initProps":"updateProps"])(el,{shape:{points:itemLayout.ends}},seriesModel,dataIndex),el.useStyle(data.getItemVisual(dataIndex,"style")),el.style.strokeNoScale=!0,el.z2=100;var itemModel=data.getItemModel(dataIndex),emphasisModel=itemModel.getModel("emphasis");setStatesStylesFromModel(el,itemModel),toggleHoverEmphasis(el,emphasisModel.get("focus"),emphasisModel.get("blurScope"),emphasisModel.get("disabled"))}function transInit(points,dim,itemLayout){return map$1(points,(function(point){return(point=point.slice())[dim]=itemLayout.initBaseline,point}))}var BoxplotView$1=BoxplotView,each$5=each$b;function boxplotLayout(ecModel){var groupResult=function(ecModel){var result=[],axisList=[];return ecModel.eachSeriesByType("boxplot",(function(seriesModel){var baseAxis=seriesModel.getBaseAxis(),idx=indexOf(axisList,baseAxis);idx<0&&(idx=axisList.length,axisList[idx]=baseAxis,result[idx]={axis:baseAxis,seriesModels:[]}),result[idx].seriesModels.push(seriesModel)})),result}(ecModel);each$5(groupResult,(function(groupItem){var seriesModels=groupItem.seriesModels;seriesModels.length&&(!function(groupItem){var bandWidth,baseAxis=groupItem.axis,seriesModels=groupItem.seriesModels,seriesCount=seriesModels.length,boxWidthList=groupItem.boxWidthList=[],boxOffsetList=groupItem.boxOffsetList=[],boundList=[];if("category"===baseAxis.type)bandWidth=baseAxis.getBandWidth();else{var maxDataCount_1=0;each$5(seriesModels,(function(seriesModel){maxDataCount_1=Math.max(maxDataCount_1,seriesModel.getData().count())}));var extent=baseAxis.getExtent();bandWidth=Math.abs(extent[1]-extent[0])/maxDataCount_1}each$5(seriesModels,(function(seriesModel){var boxWidthBound=seriesModel.get("boxWidth");isArray(boxWidthBound)||(boxWidthBound=[boxWidthBound,boxWidthBound]),boundList.push([parsePercent(boxWidthBound[0],bandWidth)||0,parsePercent(boxWidthBound[1],bandWidth)||0])}));var availableWidth=.8*bandWidth-2,boxGap=availableWidth/seriesCount*.3,boxWidth=(availableWidth-boxGap*(seriesCount-1))/seriesCount,base=boxWidth/2-availableWidth/2;each$5(seriesModels,(function(seriesModel,idx){boxOffsetList.push(base),base+=boxGap+boxWidth,boxWidthList.push(Math.min(Math.max(boxWidth,boundList[idx][0]),boundList[idx][1]))}))}(groupItem),each$5(seriesModels,(function(seriesModel,idx){!function(seriesModel,offset,boxWidth){var coordSys=seriesModel.coordinateSystem,data=seriesModel.getData(),halfWidth=boxWidth/2,cDimIdx="horizontal"===seriesModel.get("layout")?0:1,vDimIdx=1-cDimIdx,coordDims=["x","y"],cDim=data.mapDimension(coordDims[cDimIdx]),vDims=data.mapDimensionsAll(coordDims[vDimIdx]);if(null==cDim||vDims.length<5)return;for(var dataIndex=0;dataIndex<data.count();dataIndex++){var axisDimVal=data.get(cDim,dataIndex),median=getPoint(axisDimVal,vDims[2],dataIndex),end1=getPoint(axisDimVal,vDims[0],dataIndex),end2=getPoint(axisDimVal,vDims[1],dataIndex),end4=getPoint(axisDimVal,vDims[3],dataIndex),end5=getPoint(axisDimVal,vDims[4],dataIndex),ends=[];addBodyEnd(ends,end2,!1),addBodyEnd(ends,end4,!0),ends.push(end1,end2,end5,end4),layEndLine(ends,end1),layEndLine(ends,end5),layEndLine(ends,median),data.setItemLayout(dataIndex,{initBaseline:median[vDimIdx],ends:ends})}function getPoint(axisDimVal,dim,dataIndex){var point,val=data.get(dim,dataIndex),p=[];return p[cDimIdx]=axisDimVal,p[vDimIdx]=val,isNaN(axisDimVal)||isNaN(val)?point=[NaN,NaN]:(point=coordSys.dataToPoint(p))[cDimIdx]+=offset,point}function addBodyEnd(ends,point,start){var point1=point.slice(),point2=point.slice();point1[cDimIdx]+=halfWidth,point2[cDimIdx]-=halfWidth,start?ends.push(point1,point2):ends.push(point2,point1)}function layEndLine(ends,endCenter){var from=endCenter.slice(),to=endCenter.slice();from[cDimIdx]-=halfWidth,to[cDimIdx]+=halfWidth,ends.push(from,to)}}(seriesModel,groupItem.boxOffsetList[idx],groupItem.boxWidthList[idx])})))}))}var boxplotTransform={type:"echarts:boxplot",transform:function(params){var upstream=params.upstream;if("arrayRows"!==upstream.sourceFormat){var errMsg="";"production"!==process.env.NODE_ENV&&(errMsg=makePrintable("source data is not applicable for this boxplot transform. Expect number[][].")),throwError(errMsg)}var result=function(rawData,opt){for(var boxData=[],outliers=[],boundIQR=(opt=opt||{}).boundIQR,useExtreme="none"===boundIQR||0===boundIQR,i=0;i<rawData.length;i++){var ascList=asc$1(rawData[i].slice()),Q1=quantile(ascList,.25),Q2=quantile(ascList,.5),Q3=quantile(ascList,.75),min=ascList[0],max=ascList[ascList.length-1],bound=(null==boundIQR?1.5:boundIQR)*(Q3-Q1),low=useExtreme?min:Math.max(min,Q1-bound),high=useExtreme?max:Math.min(max,Q3+bound),itemNameFormatter=opt.itemNameFormatter,itemName=isFunction(itemNameFormatter)?itemNameFormatter({value:i}):isString(itemNameFormatter)?itemNameFormatter.replace("{value}",i+""):i+"";boxData.push([itemName,low,Q1,Q2,Q3,high]);for(var j=0;j<ascList.length;j++){var dataItem=ascList[j];if(dataItem<low||dataItem>high){var outlier=[itemName,dataItem];outliers.push(outlier)}}}return{boxData:boxData,outliers:outliers}}(upstream.getRawData(),params.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:result.boxData},{data:result.outliers}]}};var HeatmapLayer=function(){function HeatmapLayer(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var canvas=platformApi.createCanvas();this.canvas=canvas}return HeatmapLayer.prototype.update=function(data,width,height,normalize,colorFunc,isInRange){var brush=this._getBrush(),gradientInRange=this._getGradient(colorFunc,"inRange"),gradientOutOfRange=this._getGradient(colorFunc,"outOfRange"),r=this.pointSize+this.blurSize,canvas=this.canvas,ctx=canvas.getContext("2d"),len=data.length;canvas.width=width,canvas.height=height;for(var i=0;i<len;++i){var p=data[i],x=p[0],y=p[1],alpha=normalize(p[2]);ctx.globalAlpha=alpha,ctx.drawImage(brush,x-r,y-r)}if(!canvas.width||!canvas.height)return canvas;for(var imageData=ctx.getImageData(0,0,canvas.width,canvas.height),pixels=imageData.data,offset=0,pixelLen=pixels.length,minOpacity=this.minOpacity,diffOpacity=this.maxOpacity-minOpacity;offset<pixelLen;){alpha=pixels[offset+3]/256;var gradientOffset=4*Math.floor(255*alpha);if(alpha>0){var gradient=isInRange(alpha)?gradientInRange:gradientOutOfRange;alpha>0&&(alpha=alpha*diffOpacity+minOpacity),pixels[offset++]=gradient[gradientOffset],pixels[offset++]=gradient[gradientOffset+1],pixels[offset++]=gradient[gradientOffset+2],pixels[offset++]=gradient[gradientOffset+3]*alpha*256}else offset+=4}return ctx.putImageData(imageData,0,0),canvas},HeatmapLayer.prototype._getBrush=function(){var brushCanvas=this._brushCanvas||(this._brushCanvas=platformApi.createCanvas()),r=this.pointSize+this.blurSize,d=2*r;brushCanvas.width=d,brushCanvas.height=d;var ctx=brushCanvas.getContext("2d");return ctx.clearRect(0,0,d,d),ctx.shadowOffsetX=d,ctx.shadowBlur=this.blurSize,ctx.shadowColor="#000",ctx.beginPath(),ctx.arc(-r,r,this.pointSize,0,2*Math.PI,!0),ctx.closePath(),ctx.fill(),brushCanvas},HeatmapLayer.prototype._getGradient=function(colorFunc,state){for(var gradientPixels=this._gradientPixels,pixelsSingleState=gradientPixels[state]||(gradientPixels[state]=new Uint8ClampedArray(1024)),color=[0,0,0,0],off=0,i=0;i<256;i++)colorFunc[state](i/255,!0,color),pixelsSingleState[off++]=color[0],pixelsSingleState[off++]=color[1],pixelsSingleState[off++]=color[2],pixelsSingleState[off++]=color[3];return pixelsSingleState},HeatmapLayer}(),HeatmapLayer$1=HeatmapLayer;function isGeoCoordSys(coordSys){var dimensions=coordSys.dimensions;return"lng"===dimensions[0]&&"lat"===dimensions[1]}var HeatmapView=function(_super){function HeatmapView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=HeatmapView.type,_this}return __extends(HeatmapView,_super),HeatmapView.prototype.render=function(seriesModel,ecModel,api){var visualMapOfThisSeries;if(ecModel.eachComponent("visualMap",(function(visualMap){visualMap.eachTargetSeries((function(targetSeries){targetSeries===seriesModel&&(visualMapOfThisSeries=visualMap)}))})),"production"!==process.env.NODE_ENV&&!visualMapOfThisSeries)throw new Error("Heatmap must use with visualMap");this._progressiveEls=null,this.group.removeAll();var coordSys=seriesModel.coordinateSystem;"cartesian2d"===coordSys.type||"calendar"===coordSys.type?this._renderOnCartesianAndCalendar(seriesModel,api,0,seriesModel.getData().count()):isGeoCoordSys(coordSys)&&this._renderOnGeo(coordSys,seriesModel,visualMapOfThisSeries,api)},HeatmapView.prototype.incrementalPrepareRender=function(seriesModel,ecModel,api){this.group.removeAll()},HeatmapView.prototype.incrementalRender=function(params,seriesModel,ecModel,api){var coordSys=seriesModel.coordinateSystem;coordSys&&(isGeoCoordSys(coordSys)?this.render(seriesModel,ecModel,api):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(seriesModel,api,params.start,params.end,!0)))},HeatmapView.prototype.eachRendered=function(cb){traverseElements(this._progressiveEls||this.group,cb)},HeatmapView.prototype._renderOnCartesianAndCalendar=function(seriesModel,api,start,end,incremental){var width,height,xAxisExtent,yAxisExtent,coordSys=seriesModel.coordinateSystem,isCartesian2d=isCoordinateSystemType(coordSys,"cartesian2d");if(isCartesian2d){var xAxis=coordSys.getAxis("x"),yAxis=coordSys.getAxis("y");if("production"!==process.env.NODE_ENV){if("category"!==xAxis.type||"category"!==yAxis.type)throw new Error("Heatmap on cartesian must have two category axes");if(!xAxis.onBand||!yAxis.onBand)throw new Error("Heatmap on cartesian must have two axes with boundaryGap true")}width=xAxis.getBandWidth()+.5,height=yAxis.getBandWidth()+.5,xAxisExtent=xAxis.scale.getExtent(),yAxisExtent=yAxis.scale.getExtent()}for(var group=this.group,data=seriesModel.getData(),emphasisStyle=seriesModel.getModel(["emphasis","itemStyle"]).getItemStyle(),blurStyle=seriesModel.getModel(["blur","itemStyle"]).getItemStyle(),selectStyle=seriesModel.getModel(["select","itemStyle"]).getItemStyle(),borderRadius=seriesModel.get(["itemStyle","borderRadius"]),labelStatesModels=getLabelStatesModels(seriesModel),emphasisModel=seriesModel.getModel("emphasis"),focus=emphasisModel.get("focus"),blurScope=emphasisModel.get("blurScope"),emphasisDisabled=emphasisModel.get("disabled"),dataDims=isCartesian2d?[data.mapDimension("x"),data.mapDimension("y"),data.mapDimension("value")]:[data.mapDimension("time"),data.mapDimension("value")],idx=start;idx<end;idx++){var rect=void 0,style=data.getItemVisual(idx,"style");if(isCartesian2d){var dataDimX=data.get(dataDims[0],idx),dataDimY=data.get(dataDims[1],idx);if(isNaN(data.get(dataDims[2],idx))||isNaN(dataDimX)||isNaN(dataDimY)||dataDimX<xAxisExtent[0]||dataDimX>xAxisExtent[1]||dataDimY<yAxisExtent[0]||dataDimY>yAxisExtent[1])continue;var point=coordSys.dataToPoint([dataDimX,dataDimY]);rect=new Rect$4({shape:{x:point[0]-width/2,y:point[1]-height/2,width:width,height:height},style:style})}else{if(isNaN(data.get(dataDims[1],idx)))continue;rect=new Rect$4({z2:1,shape:coordSys.dataToRect([data.get(dataDims[0],idx)]).contentShape,style:style})}if(data.hasItemOption){var itemModel=data.getItemModel(idx),emphasisModel_1=itemModel.getModel("emphasis");emphasisStyle=emphasisModel_1.getModel("itemStyle").getItemStyle(),blurStyle=itemModel.getModel(["blur","itemStyle"]).getItemStyle(),selectStyle=itemModel.getModel(["select","itemStyle"]).getItemStyle(),borderRadius=itemModel.get(["itemStyle","borderRadius"]),focus=emphasisModel_1.get("focus"),blurScope=emphasisModel_1.get("blurScope"),emphasisDisabled=emphasisModel_1.get("disabled"),labelStatesModels=getLabelStatesModels(itemModel)}rect.shape.r=borderRadius;var rawValue=seriesModel.getRawValue(idx),defaultText="-";rawValue&&null!=rawValue[2]&&(defaultText=rawValue[2]+""),setLabelStyle(rect,labelStatesModels,{labelFetcher:seriesModel,labelDataIndex:idx,defaultOpacity:style.opacity,defaultText:defaultText}),rect.ensureState("emphasis").style=emphasisStyle,rect.ensureState("blur").style=blurStyle,rect.ensureState("select").style=selectStyle,toggleHoverEmphasis(rect,focus,blurScope,emphasisDisabled),rect.incremental=incremental,incremental&&(rect.states.emphasis.hoverLayer=!0),group.add(rect),data.setItemGraphicEl(idx,rect),this._progressiveEls&&this._progressiveEls.push(rect)}},HeatmapView.prototype._renderOnGeo=function(geo,seriesModel,visualMapModel,api){var inRangeVisuals=visualMapModel.targetVisuals.inRange,outOfRangeVisuals=visualMapModel.targetVisuals.outOfRange,data=seriesModel.getData(),hmLayer=this._hmLayer||this._hmLayer||new HeatmapLayer$1;hmLayer.blurSize=seriesModel.get("blurSize"),hmLayer.pointSize=seriesModel.get("pointSize"),hmLayer.minOpacity=seriesModel.get("minOpacity"),hmLayer.maxOpacity=seriesModel.get("maxOpacity");var rect=geo.getViewRect().clone(),roamTransform=geo.getRoamTransform();rect.applyTransform(roamTransform);var x=Math.max(rect.x,0),y=Math.max(rect.y,0),x2=Math.min(rect.width+rect.x,api.getWidth()),y2=Math.min(rect.height+rect.y,api.getHeight()),width=x2-x,height=y2-y,dims=[data.mapDimension("lng"),data.mapDimension("lat"),data.mapDimension("value")],points=data.mapArray(dims,(function(lng,lat,value){var pt=geo.dataToPoint([lng,lat]);return pt[0]-=x,pt[1]-=y,pt.push(value),pt})),dataExtent=visualMapModel.getExtent(),isInRange="visualMap.continuous"===visualMapModel.type?function(dataExtent,range){var dataSpan=dataExtent[1]-dataExtent[0];return range=[(range[0]-dataExtent[0])/dataSpan,(range[1]-dataExtent[0])/dataSpan],function(val){return val>=range[0]&&val<=range[1]}}(dataExtent,visualMapModel.option.range):function(dataExtent,pieceList,selected){var dataSpan=dataExtent[1]-dataExtent[0],len=(pieceList=map$1(pieceList,(function(piece){return{interval:[(piece.interval[0]-dataExtent[0])/dataSpan,(piece.interval[1]-dataExtent[0])/dataSpan]}}))).length,lastIndex=0;return function(val){var i;for(i=lastIndex;i<len;i++)if((interval=pieceList[i].interval)[0]<=val&&val<=interval[1]){lastIndex=i;break}if(i===len)for(i=lastIndex-1;i>=0;i--){var interval;if((interval=pieceList[i].interval)[0]<=val&&val<=interval[1]){lastIndex=i;break}}return i>=0&&i<len&&selected[i]}}(dataExtent,visualMapModel.getPieceList(),visualMapModel.option.selected);hmLayer.update(points,width,height,inRangeVisuals.color.getNormalizer(),{inRange:inRangeVisuals.color.getColorMapper(),outOfRange:outOfRangeVisuals.color.getColorMapper()},isInRange);var img=new ZRImage$1({style:{width:width,height:height,x:x,y:y,image:hmLayer.canvas},silent:!0});this.group.add(img)},HeatmapView.type="heatmap",HeatmapView}(ChartView$1),HeatmapView$1=HeatmapView,HeatmapSeriesModel$1=function(_super){function HeatmapSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=HeatmapSeriesModel.type,_this}return __extends(HeatmapSeriesModel,_super),HeatmapSeriesModel.prototype.getInitialData=function(option,ecModel){return createSeriesData(null,this,{generateCoord:"value"})},HeatmapSeriesModel.prototype.preventIncremental=function(){var coordSysCreator=CoordinateSystem.get(this.get("coordinateSystem"));if(coordSysCreator&&coordSysCreator.dimensions)return"lng"===coordSysCreator.dimensions[0]&&"lat"===coordSysCreator.dimensions[1]},HeatmapSeriesModel.type="series.heatmap",HeatmapSeriesModel.dependencies=["grid","geo","calendar"],HeatmapSeriesModel.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},HeatmapSeriesModel}(SeriesModel$1);var BAR_BORDER_WIDTH_QUERY=["itemStyle","borderWidth"],LAYOUT_ATTRS=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],pathForLineWidth=new Circle$1;function getSymbolMeta(data,dataIndex,itemModel,opt){var layout=data.getItemLayout(dataIndex),symbolRepeat=itemModel.get("symbolRepeat"),symbolClip=itemModel.get("symbolClip"),symbolPosition=itemModel.get("symbolPosition")||"start",rotation=(itemModel.get("symbolRotate")||0)*Math.PI/180||0,symbolPatternSize=itemModel.get("symbolPatternSize")||2,isAnimationEnabled=itemModel.isAnimationEnabled(),symbolMeta={dataIndex:dataIndex,layout:layout,itemModel:itemModel,symbolType:data.getItemVisual(dataIndex,"symbol")||"circle",style:data.getItemVisual(dataIndex,"style"),symbolClip:symbolClip,symbolRepeat:symbolRepeat,symbolRepeatDirection:itemModel.get("symbolRepeatDirection"),symbolPatternSize:symbolPatternSize,rotation:rotation,animationModel:isAnimationEnabled?itemModel:null,hoverScale:isAnimationEnabled&&itemModel.get(["emphasis","scale"]),z2:itemModel.getShallow("z",!0)||0};!function(itemModel,symbolRepeat,layout,opt,outputSymbolMeta){var boundingLength,valueDim=opt.valueDim,symbolBoundingData=itemModel.get("symbolBoundingData"),valueAxis=opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis()),zeroPx=valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)),pxSignIdx=1-+(layout[valueDim.wh]<=0);if(isArray(symbolBoundingData)){var symbolBoundingExtent=[convertToCoordOnAxis(valueAxis,symbolBoundingData[0])-zeroPx,convertToCoordOnAxis(valueAxis,symbolBoundingData[1])-zeroPx];symbolBoundingExtent[1]<symbolBoundingExtent[0]&&symbolBoundingExtent.reverse(),boundingLength=symbolBoundingExtent[pxSignIdx]}else boundingLength=null!=symbolBoundingData?convertToCoordOnAxis(valueAxis,symbolBoundingData)-zeroPx:symbolRepeat?opt.coordSysExtent[valueDim.index][pxSignIdx]-zeroPx:layout[valueDim.wh];outputSymbolMeta.boundingLength=boundingLength,symbolRepeat&&(outputSymbolMeta.repeatCutLength=layout[valueDim.wh]);var isXAxis="x"===valueDim.xy,isInverse=valueAxis.inverse;outputSymbolMeta.pxSign=isXAxis&&!isInverse||!isXAxis&&isInverse?boundingLength>=0?1:-1:boundingLength>0?1:-1}(itemModel,symbolRepeat,layout,opt,symbolMeta),function(data,dataIndex,layout,symbolRepeat,symbolClip,boundingLength,pxSign,symbolPatternSize,opt,outputSymbolMeta){var parsedSymbolSize,valueDim=opt.valueDim,categoryDim=opt.categoryDim,categorySize=Math.abs(layout[categoryDim.wh]),symbolSize=data.getItemVisual(dataIndex,"symbolSize");parsedSymbolSize=isArray(symbolSize)?symbolSize.slice():null==symbolSize?["100%","100%"]:[symbolSize,symbolSize];parsedSymbolSize[categoryDim.index]=parsePercent(parsedSymbolSize[categoryDim.index],categorySize),parsedSymbolSize[valueDim.index]=parsePercent(parsedSymbolSize[valueDim.index],symbolRepeat?categorySize:Math.abs(boundingLength)),outputSymbolMeta.symbolSize=parsedSymbolSize;var symbolScale=outputSymbolMeta.symbolScale=[parsedSymbolSize[0]/symbolPatternSize,parsedSymbolSize[1]/symbolPatternSize];symbolScale[valueDim.index]*=(opt.isHorizontal?-1:1)*pxSign}(data,dataIndex,layout,symbolRepeat,0,symbolMeta.boundingLength,symbolMeta.pxSign,symbolPatternSize,opt,symbolMeta),function(itemModel,symbolScale,rotation,opt,outputSymbolMeta){var valueLineWidth=itemModel.get(BAR_BORDER_WIDTH_QUERY)||0;valueLineWidth&&(pathForLineWidth.attr({scaleX:symbolScale[0],scaleY:symbolScale[1],rotation:rotation}),pathForLineWidth.updateTransform(),valueLineWidth/=pathForLineWidth.getLineScale(),valueLineWidth*=symbolScale[opt.valueDim.index]);outputSymbolMeta.valueLineWidth=valueLineWidth||0}(itemModel,symbolMeta.symbolScale,rotation,opt,symbolMeta);var symbolSize=symbolMeta.symbolSize,symbolOffset=normalizeSymbolOffset(itemModel.get("symbolOffset"),symbolSize);return function(itemModel,symbolSize,layout,symbolRepeat,symbolClip,symbolOffset,symbolPosition,valueLineWidth,boundingLength,repeatCutLength,opt,outputSymbolMeta){var categoryDim=opt.categoryDim,valueDim=opt.valueDim,pxSign=outputSymbolMeta.pxSign,unitLength=Math.max(symbolSize[valueDim.index]+valueLineWidth,0),pathLen=unitLength;if(symbolRepeat){var absBoundingLength=Math.abs(boundingLength),symbolMargin=retrieve(itemModel.get("symbolMargin"),"15%")+"",hasEndGap=!1;symbolMargin.lastIndexOf("!")===symbolMargin.length-1&&(hasEndGap=!0,symbolMargin=symbolMargin.slice(0,symbolMargin.length-1));var symbolMarginNumeric=parsePercent(symbolMargin,symbolSize[valueDim.index]),uLenWithMargin=Math.max(unitLength+2*symbolMarginNumeric,0),endFix=hasEndGap?0:2*symbolMarginNumeric,repeatSpecified=isNumeric(symbolRepeat),repeatTimes=repeatSpecified?symbolRepeat:toIntTimes((absBoundingLength+endFix)/uLenWithMargin);uLenWithMargin=unitLength+2*(symbolMarginNumeric=(absBoundingLength-repeatTimes*unitLength)/2/(hasEndGap?repeatTimes:Math.max(repeatTimes-1,1))),endFix=hasEndGap?0:2*symbolMarginNumeric,repeatSpecified||"fixed"===symbolRepeat||(repeatTimes=repeatCutLength?toIntTimes((Math.abs(repeatCutLength)+endFix)/uLenWithMargin):0),pathLen=repeatTimes*uLenWithMargin-endFix,outputSymbolMeta.repeatTimes=repeatTimes,outputSymbolMeta.symbolMargin=symbolMarginNumeric}var sizeFix=pxSign*(pathLen/2),pathPosition=outputSymbolMeta.pathPosition=[];pathPosition[categoryDim.index]=layout[categoryDim.wh]/2,pathPosition[valueDim.index]="start"===symbolPosition?sizeFix:"end"===symbolPosition?boundingLength-sizeFix:boundingLength/2,symbolOffset&&(pathPosition[0]+=symbolOffset[0],pathPosition[1]+=symbolOffset[1]);var bundlePosition=outputSymbolMeta.bundlePosition=[];bundlePosition[categoryDim.index]=layout[categoryDim.xy],bundlePosition[valueDim.index]=layout[valueDim.xy];var barRectShape=outputSymbolMeta.barRectShape=extend({},layout);barRectShape[valueDim.wh]=pxSign*Math.max(Math.abs(layout[valueDim.wh]),Math.abs(pathPosition[valueDim.index]+sizeFix)),barRectShape[categoryDim.wh]=layout[categoryDim.wh];var clipShape=outputSymbolMeta.clipShape={};clipShape[categoryDim.xy]=-layout[categoryDim.xy],clipShape[categoryDim.wh]=opt.ecSize[categoryDim.wh],clipShape[valueDim.xy]=0,clipShape[valueDim.wh]=layout[valueDim.wh]}(itemModel,symbolSize,layout,symbolRepeat,0,symbolOffset,symbolPosition,symbolMeta.valueLineWidth,symbolMeta.boundingLength,symbolMeta.repeatCutLength,opt,symbolMeta),symbolMeta}function convertToCoordOnAxis(axis,value){return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)))}function createPath(symbolMeta){var symbolPatternSize=symbolMeta.symbolPatternSize,path=createSymbol$1(symbolMeta.symbolType,-symbolPatternSize/2,-symbolPatternSize/2,symbolPatternSize,symbolPatternSize);return path.attr({culling:!0}),"image"!==path.type&&path.setStyle({strokeNoScale:!0}),path}function createOrUpdateRepeatSymbols(bar,opt,symbolMeta,isUpdate){var bundle=bar.__pictorialBundle,symbolSize=symbolMeta.symbolSize,valueLineWidth=symbolMeta.valueLineWidth,pathPosition=symbolMeta.pathPosition,valueDim=opt.valueDim,repeatTimes=symbolMeta.repeatTimes||0,index=0,unit=symbolSize[opt.valueDim.index]+valueLineWidth+2*symbolMeta.symbolMargin;for(eachPath(bar,(function(path){path.__pictorialAnimationIndex=index,path.__pictorialRepeatTimes=repeatTimes,index<repeatTimes?updateAttr(path,null,makeTarget(index),symbolMeta,isUpdate):updateAttr(path,null,{scaleX:0,scaleY:0},symbolMeta,isUpdate,(function(){bundle.remove(path)})),index++}));index<repeatTimes;index++){var path=createPath(symbolMeta);path.__pictorialAnimationIndex=index,path.__pictorialRepeatTimes=repeatTimes,bundle.add(path);var target=makeTarget(index);updateAttr(path,{x:target.x,y:target.y,scaleX:0,scaleY:0},{scaleX:target.scaleX,scaleY:target.scaleY,rotation:target.rotation},symbolMeta,isUpdate)}function makeTarget(index){var position=pathPosition.slice(),pxSign=symbolMeta.pxSign,i=index;return("start"===symbolMeta.symbolRepeatDirection?pxSign>0:pxSign<0)&&(i=repeatTimes-1-index),position[valueDim.index]=unit*(i-repeatTimes/2+.5)+pathPosition[valueDim.index],{x:position[0],y:position[1],scaleX:symbolMeta.symbolScale[0],scaleY:symbolMeta.symbolScale[1],rotation:symbolMeta.rotation}}}function createOrUpdateSingleSymbol(bar,opt,symbolMeta,isUpdate){var bundle=bar.__pictorialBundle,mainPath=bar.__pictorialMainPath;mainPath?updateAttr(mainPath,null,{x:symbolMeta.pathPosition[0],y:symbolMeta.pathPosition[1],scaleX:symbolMeta.symbolScale[0],scaleY:symbolMeta.symbolScale[1],rotation:symbolMeta.rotation},symbolMeta,isUpdate):(mainPath=bar.__pictorialMainPath=createPath(symbolMeta),bundle.add(mainPath),updateAttr(mainPath,{x:symbolMeta.pathPosition[0],y:symbolMeta.pathPosition[1],scaleX:0,scaleY:0,rotation:symbolMeta.rotation},{scaleX:symbolMeta.symbolScale[0],scaleY:symbolMeta.symbolScale[1]},symbolMeta,isUpdate))}function createOrUpdateBarRect(bar,symbolMeta,isUpdate){var rectShape=extend({},symbolMeta.barRectShape),barRect=bar.__pictorialBarRect;barRect?updateAttr(barRect,null,{shape:rectShape},symbolMeta,isUpdate):((barRect=bar.__pictorialBarRect=new Rect$4({z2:2,shape:rectShape,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,bar.add(barRect))}function createOrUpdateClip(bar,opt,symbolMeta,isUpdate){if(symbolMeta.symbolClip){var clipPath=bar.__pictorialClipPath,clipShape=extend({},symbolMeta.clipShape),valueDim=opt.valueDim,animationModel=symbolMeta.animationModel,dataIndex=symbolMeta.dataIndex;if(clipPath)updateProps$1(clipPath,{shape:clipShape},animationModel,dataIndex);else{clipShape[valueDim.wh]=0,clipPath=new Rect$4({shape:clipShape}),bar.__pictorialBundle.setClipPath(clipPath),bar.__pictorialClipPath=clipPath;var target={};target[valueDim.wh]=symbolMeta.clipShape[valueDim.wh],graphic[isUpdate?"updateProps":"initProps"](clipPath,{shape:target},animationModel,dataIndex)}}}function getItemModel(data,dataIndex){var itemModel=data.getItemModel(dataIndex);return itemModel.getAnimationDelayParams=getAnimationDelayParams,itemModel.isAnimationEnabled=isAnimationEnabled,itemModel}function getAnimationDelayParams(path){return{index:path.__pictorialAnimationIndex,count:path.__pictorialRepeatTimes}}function isAnimationEnabled(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function createBar(data,opt,symbolMeta,isUpdate){var bar=new Group$4,bundle=new Group$4;return bar.add(bundle),bar.__pictorialBundle=bundle,bundle.x=symbolMeta.bundlePosition[0],bundle.y=symbolMeta.bundlePosition[1],symbolMeta.symbolRepeat?createOrUpdateRepeatSymbols(bar,opt,symbolMeta):createOrUpdateSingleSymbol(bar,0,symbolMeta),createOrUpdateBarRect(bar,symbolMeta,isUpdate),createOrUpdateClip(bar,opt,symbolMeta,isUpdate),bar.__pictorialShapeStr=getShapeStr(data,symbolMeta),bar.__pictorialSymbolMeta=symbolMeta,bar}function removeBar(data,dataIndex,animationModel,bar){var labelRect=bar.__pictorialBarRect;labelRect&&labelRect.removeTextContent();var paths=[];eachPath(bar,(function(path){paths.push(path)})),bar.__pictorialMainPath&&paths.push(bar.__pictorialMainPath),bar.__pictorialClipPath&&(animationModel=null),each$b(paths,(function(path){removeElement(path,{scaleX:0,scaleY:0},animationModel,dataIndex,(function(){bar.parent&&bar.parent.remove(bar)}))})),data.setItemGraphicEl(dataIndex,null)}function getShapeStr(data,symbolMeta){return[data.getItemVisual(symbolMeta.dataIndex,"symbol")||"none",!!symbolMeta.symbolRepeat,!!symbolMeta.symbolClip].join(":")}function eachPath(bar,cb,context){each$b(bar.__pictorialBundle.children(),(function(el){el!==bar.__pictorialBarRect&&cb.call(context,el)}))}function updateAttr(el,immediateAttrs,animationAttrs,symbolMeta,isUpdate,cb){immediateAttrs&&el.attr(immediateAttrs),symbolMeta.symbolClip&&!isUpdate?animationAttrs&&el.attr(animationAttrs):animationAttrs&&graphic[isUpdate?"updateProps":"initProps"](el,animationAttrs,symbolMeta.animationModel,symbolMeta.dataIndex,cb)}function updateCommon(bar,opt,symbolMeta){var dataIndex=symbolMeta.dataIndex,itemModel=symbolMeta.itemModel,emphasisModel=itemModel.getModel("emphasis"),emphasisStyle=emphasisModel.getModel("itemStyle").getItemStyle(),blurStyle=itemModel.getModel(["blur","itemStyle"]).getItemStyle(),selectStyle=itemModel.getModel(["select","itemStyle"]).getItemStyle(),cursorStyle=itemModel.getShallow("cursor"),focus=emphasisModel.get("focus"),blurScope=emphasisModel.get("blurScope"),hoverScale=emphasisModel.get("scale");eachPath(bar,(function(path){if(path instanceof ZRImage$1){var pathStyle=path.style;path.useStyle(extend({image:pathStyle.image,x:pathStyle.x,y:pathStyle.y,width:pathStyle.width,height:pathStyle.height},symbolMeta.style))}else path.useStyle(symbolMeta.style);var emphasisState=path.ensureState("emphasis");emphasisState.style=emphasisStyle,hoverScale&&(emphasisState.scaleX=1.1*path.scaleX,emphasisState.scaleY=1.1*path.scaleY),path.ensureState("blur").style=blurStyle,path.ensureState("select").style=selectStyle,cursorStyle&&(path.cursor=cursorStyle),path.z2=symbolMeta.z2}));var barPositionOutside=opt.valueDim.posDesc[+(symbolMeta.boundingLength>0)],barRect=bar.__pictorialBarRect;barRect.ignoreClip=!0,setLabelStyle(barRect,getLabelStatesModels(itemModel),{labelFetcher:opt.seriesModel,labelDataIndex:dataIndex,defaultText:getDefaultLabel(opt.seriesModel.getData(),dataIndex),inheritColor:symbolMeta.style.fill,defaultOpacity:symbolMeta.style.opacity,defaultOutsidePosition:barPositionOutside}),toggleHoverEmphasis(bar,focus,blurScope,emphasisModel.get("disabled"))}function toIntTimes(times){var roundedTimes=Math.round(times);return Math.abs(times-roundedTimes)<1e-4?roundedTimes:Math.ceil(times)}var PictorialBarView$1=function(_super){function PictorialBarView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=PictorialBarView.type,_this}return __extends(PictorialBarView,_super),PictorialBarView.prototype.render=function(seriesModel,ecModel,api){var group=this.group,data=seriesModel.getData(),oldData=this._data,cartesian=seriesModel.coordinateSystem,isHorizontal=cartesian.getBaseAxis().isHorizontal(),coordSysRect=cartesian.master.getRect(),opt={ecSize:{width:api.getWidth(),height:api.getHeight()},seriesModel:seriesModel,coordSys:cartesian,coordSysExtent:[[coordSysRect.x,coordSysRect.x+coordSysRect.width],[coordSysRect.y,coordSysRect.y+coordSysRect.height]],isHorizontal:isHorizontal,valueDim:LAYOUT_ATTRS[+isHorizontal],categoryDim:LAYOUT_ATTRS[1-+isHorizontal]};data.diff(oldData).add((function(dataIndex){if(data.hasValue(dataIndex)){var itemModel=getItemModel(data,dataIndex),symbolMeta=getSymbolMeta(data,dataIndex,itemModel,opt),bar=createBar(data,opt,symbolMeta);data.setItemGraphicEl(dataIndex,bar),group.add(bar),updateCommon(bar,opt,symbolMeta)}})).update((function(newIndex,oldIndex){var bar=oldData.getItemGraphicEl(oldIndex);if(data.hasValue(newIndex)){var itemModel=getItemModel(data,newIndex),symbolMeta=getSymbolMeta(data,newIndex,itemModel,opt),pictorialShapeStr=getShapeStr(data,symbolMeta);bar&&pictorialShapeStr!==bar.__pictorialShapeStr&&(group.remove(bar),data.setItemGraphicEl(newIndex,null),bar=null),bar?function(bar,opt,symbolMeta){var animationModel=symbolMeta.animationModel,dataIndex=symbolMeta.dataIndex,bundle=bar.__pictorialBundle;updateProps$1(bundle,{x:symbolMeta.bundlePosition[0],y:symbolMeta.bundlePosition[1]},animationModel,dataIndex),symbolMeta.symbolRepeat?createOrUpdateRepeatSymbols(bar,opt,symbolMeta,!0):createOrUpdateSingleSymbol(bar,opt,symbolMeta,!0);createOrUpdateBarRect(bar,symbolMeta,!0),createOrUpdateClip(bar,opt,symbolMeta,!0)}(bar,opt,symbolMeta):bar=createBar(data,opt,symbolMeta,!0),data.setItemGraphicEl(newIndex,bar),bar.__pictorialSymbolMeta=symbolMeta,group.add(bar),updateCommon(bar,opt,symbolMeta)}else group.remove(bar)})).remove((function(dataIndex){var bar=oldData.getItemGraphicEl(dataIndex);bar&&removeBar(oldData,dataIndex,bar.__pictorialSymbolMeta.animationModel,bar)})).execute();var clipPath=seriesModel.get("clip",!0)?createClipPath(seriesModel.coordinateSystem,!1,seriesModel):null;return clipPath?group.setClipPath(clipPath):group.removeClipPath(),this._data=data,this.group},PictorialBarView.prototype.remove=function(ecModel,api){var group=this.group,data=this._data;ecModel.get("animation")?data&&data.eachItemGraphicEl((function(bar){removeBar(data,getECData(bar).dataIndex,ecModel,bar)})):group.removeAll()},PictorialBarView.type="pictorialBar",PictorialBarView}(ChartView$1),PictorialBarSeriesModel$1=function(_super){function PictorialBarSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=PictorialBarSeriesModel.type,_this.hasSymbolVisual=!0,_this.defaultSymbol="roundRect",_this}return __extends(PictorialBarSeriesModel,_super),PictorialBarSeriesModel.prototype.getInitialData=function(option){return option.stack=null,_super.prototype.getInitialData.apply(this,arguments)},PictorialBarSeriesModel.type="series.pictorialBar",PictorialBarSeriesModel.dependencies=["grid"],PictorialBarSeriesModel.defaultOption=inheritDefaultOption(BaseBarSeriesModel$1.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),PictorialBarSeriesModel}(BaseBarSeriesModel$1);var ThemeRiverView=function(_super){function ThemeRiverView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ThemeRiverView.type,_this._layers=[],_this}return __extends(ThemeRiverView,_super),ThemeRiverView.prototype.render=function(seriesModel,ecModel,api){var data=seriesModel.getData(),self=this,group=this.group,layersSeries=seriesModel.getLayerSeries(),layoutInfo=data.getLayout("layoutInfo"),rect=layoutInfo.rect,boundaryGap=layoutInfo.boundaryGap;function keyGetter(item){return item.name}group.x=0,group.y=rect.y+boundaryGap[0];var dataDiffer=new DataDiffer$1(this._layersSeries||[],layersSeries,keyGetter,keyGetter),newLayersGroups=[];function process(status,idx,oldIdx){var oldLayersGroups=self._layers;if("remove"!==status){for(var style,polygon,points0=[],points1=[],indices=layersSeries[idx].indices,j=0;j<indices.length;j++){var layout=data.getItemLayout(indices[j]),x=layout.x,y0=layout.y0,y=layout.y;points0.push(x,y0),points1.push(x,y0+y),style=data.getItemVisual(indices[j],"style")}var textLayout=data.getItemLayout(indices[0]),margin=seriesModel.getModel("label").get("margin"),emphasisModel=seriesModel.getModel("emphasis");if("add"===status){var layerGroup=newLayersGroups[idx]=new Group$4;polygon=new ECPolygon({shape:{points:points0,stackedOnPoints:points1,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),layerGroup.add(polygon),group.add(layerGroup),seriesModel.isAnimationEnabled()&&polygon.setClipPath(function(rect,seriesModel,cb){var rectEl=new Rect$4({shape:{x:rect.x-10,y:rect.y-10,width:0,height:rect.height+20}});return initProps(rectEl,{shape:{x:rect.x-50,width:rect.width+100,height:rect.height+20}},seriesModel,cb),rectEl}(polygon.getBoundingRect(),seriesModel,(function(){polygon.removeClipPath()})))}else{layerGroup=oldLayersGroups[oldIdx];polygon=layerGroup.childAt(0),group.add(layerGroup),newLayersGroups[idx]=layerGroup,updateProps$1(polygon,{shape:{points:points0,stackedOnPoints:points1}},seriesModel),saveOldStyle(polygon)}setLabelStyle(polygon,getLabelStatesModels(seriesModel),{labelDataIndex:indices[j-1],defaultText:data.getName(indices[j-1]),inheritColor:style.fill},{normal:{verticalAlign:"middle"}}),polygon.setTextConfig({position:null,local:!0});var labelEl=polygon.getTextContent();labelEl&&(labelEl.x=textLayout.x-margin,labelEl.y=textLayout.y0+textLayout.y/2),polygon.useStyle(style),data.setItemGraphicEl(idx,polygon),setStatesStylesFromModel(polygon,seriesModel),toggleHoverEmphasis(polygon,emphasisModel.get("focus"),emphasisModel.get("blurScope"),emphasisModel.get("disabled"))}else group.remove(oldLayersGroups[idx])}dataDiffer.add(bind$1(process,this,"add")).update(bind$1(process,this,"update")).remove(bind$1(process,this,"remove")).execute(),this._layersSeries=layersSeries,this._layers=newLayersGroups},ThemeRiverView.type="themeRiver",ThemeRiverView}(ChartView$1);var ThemeRiverView$1=ThemeRiverView,ThemeRiverSeriesModel=function(_super){function ThemeRiverSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ThemeRiverSeriesModel.type,_this}return __extends(ThemeRiverSeriesModel,_super),ThemeRiverSeriesModel.prototype.init=function(option){_super.prototype.init.apply(this,arguments),this.legendVisualProvider=new LegendVisualProvider$1(bind$1(this.getData,this),bind$1(this.getRawData,this))},ThemeRiverSeriesModel.prototype.fixData=function(data){var rawDataLength=data.length,timeValueKeys={},groupResult=groupData(data,(function(item){return timeValueKeys.hasOwnProperty(item[0]+"")||(timeValueKeys[item[0]+""]=-1),item[2]})),layerData=[];groupResult.buckets.each((function(items,key){layerData.push({name:key,dataList:items})}));for(var layerNum=layerData.length,k=0;k<layerNum;++k){for(var name_1=layerData[k].name,j=0;j<layerData[k].dataList.length;++j){var timeValue=layerData[k].dataList[j][0]+"";timeValueKeys[timeValue]=k}for(var timeValue in timeValueKeys)timeValueKeys.hasOwnProperty(timeValue)&&timeValueKeys[timeValue]!==k&&(timeValueKeys[timeValue]=k,data[rawDataLength]=[timeValue,0,name_1],rawDataLength++)}return data},ThemeRiverSeriesModel.prototype.getInitialData=function(option,ecModel){for(var axisType=this.getReferringComponents("singleAxis",SINGLE_REFERRING).models[0].get("type"),filterData=filter(option.data,(function(dataItem){return void 0!==dataItem[2]})),data=this.fixData(filterData||[]),nameList=[],nameMap=this.nameMap=createHashMap(),count=0,i=0;i<data.length;++i)nameList.push(data[i][2]),nameMap.get(data[i][2])||(nameMap.set(data[i][2],count),count++);var dimensions=prepareSeriesDataSchema(data,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:getDimensionTypeByAxis(axisType)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,list=new SeriesData$1(dimensions,this);return list.initData(data),list},ThemeRiverSeriesModel.prototype.getLayerSeries=function(){for(var data=this.getData(),lenCount=data.count(),indexArr=[],i=0;i<lenCount;++i)indexArr[i]=i;var timeDim=data.mapDimension("single"),groupResult=groupData(indexArr,(function(index){return data.get("name",index)})),layerSeries=[];return groupResult.buckets.each((function(items,key){items.sort((function(index1,index2){return data.get(timeDim,index1)-data.get(timeDim,index2)})),layerSeries.push({name:key,indices:items})})),layerSeries},ThemeRiverSeriesModel.prototype.getAxisTooltipData=function(dim,value,baseAxis){isArray(dim)||(dim=dim?[dim]:[]);for(var nestestValue,data=this.getData(),layerSeries=this.getLayerSeries(),indices=[],layerNum=layerSeries.length,i=0;i<layerNum;++i){for(var minDist=Number.MAX_VALUE,nearestIdx=-1,pointNum=layerSeries[i].indices.length,j=0;j<pointNum;++j){var theValue=data.get(dim[0],layerSeries[i].indices[j]),dist=Math.abs(theValue-value);dist<=minDist&&(nestestValue=theValue,minDist=dist,nearestIdx=layerSeries[i].indices[j])}indices.push(nearestIdx)}return{dataIndices:indices,nestestValue:nestestValue}},ThemeRiverSeriesModel.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){var data=this.getData();return createTooltipMarkup("nameValue",{name:data.getName(dataIndex),value:data.get(data.mapDimension("value"),dataIndex)})},ThemeRiverSeriesModel.type="series.themeRiver",ThemeRiverSeriesModel.dependencies=["singleAxis"],ThemeRiverSeriesModel.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},ThemeRiverSeriesModel}(SeriesModel$1),ThemeRiverSeriesModel$1=ThemeRiverSeriesModel;function themeRiverLayout(ecModel,api){ecModel.eachSeriesByType("themeRiver",(function(seriesModel){var data=seriesModel.getData(),single=seriesModel.coordinateSystem,layoutInfo={},rect=single.getRect();layoutInfo.rect=rect;var boundaryGap=seriesModel.get("boundaryGap"),axis=single.getAxis();(layoutInfo.boundaryGap=boundaryGap,"horizontal"===axis.orient)?(boundaryGap[0]=parsePercent(boundaryGap[0],rect.height),boundaryGap[1]=parsePercent(boundaryGap[1],rect.height),doThemeRiverLayout(data,seriesModel,rect.height-boundaryGap[0]-boundaryGap[1])):(boundaryGap[0]=parsePercent(boundaryGap[0],rect.width),boundaryGap[1]=parsePercent(boundaryGap[1],rect.width),doThemeRiverLayout(data,seriesModel,rect.width-boundaryGap[0]-boundaryGap[1]));data.setLayout("layoutInfo",layoutInfo)}))}function doThemeRiverLayout(data,seriesModel,height){if(data.count())for(var baseY0,coordSys=seriesModel.coordinateSystem,layerSeries=seriesModel.getLayerSeries(),timeDim=data.mapDimension("single"),valueDim=data.mapDimension("value"),layerPoints=map$1(layerSeries,(function(singleLayer){return map$1(singleLayer.indices,(function(idx){var pt=coordSys.dataToPoint(data.get(timeDim,idx));return pt[1]=data.get(valueDim,idx),pt}))})),base=function(data){for(var layerNum=data.length,pointNum=data[0].length,sums=[],y0=[],max=0,i=0;i<pointNum;++i){for(var temp=0,j=0;j<layerNum;++j)temp+=data[j][i][1];temp>max&&(max=temp),sums.push(temp)}for(var k=0;k<pointNum;++k)y0[k]=(max-sums[k])/2;max=0;for(var l=0;l<pointNum;++l){var sum=sums[l]+y0[l];sum>max&&(max=sum)}return{y0:y0,max:max}}(layerPoints),baseLine=base.y0,ky=height/base.max,n=layerSeries.length,m=layerSeries[0].indices.length,j=0;j<m;++j){baseY0=baseLine[j]*ky,data.setItemLayout(layerSeries[0].indices[j],{layerIndex:0,x:layerPoints[0][j][0],y0:baseY0,y:layerPoints[0][j][1]*ky});for(var i=1;i<n;++i)baseY0+=layerPoints[i-1][j][1]*ky,data.setItemLayout(layerSeries[i].indices[j],{layerIndex:i,x:layerPoints[i][j][0],y0:baseY0,y:layerPoints[i][j][1]*ky})}}var SunburstPiece=function(_super){function SunburstPiece(node,seriesModel,ecModel,api){var _this=_super.call(this)||this;_this.z2=2,_this.textConfig={inside:!0},getECData(_this).seriesIndex=seriesModel.seriesIndex;var text=new ZRText$1({z2:4,silent:node.getModel().get(["label","silent"])});return _this.setTextContent(text),_this.updateData(!0,node,seriesModel,ecModel,api),_this}return __extends(SunburstPiece,_super),SunburstPiece.prototype.updateData=function(firstCreate,node,seriesModel,ecModel,api){this.node=node,node.piece=this,seriesModel=seriesModel||this._seriesModel,ecModel=ecModel||this._ecModel;var sector=this;getECData(sector).dataIndex=node.dataIndex;var itemModel=node.getModel(),emphasisModel=itemModel.getModel("emphasis"),layout=node.getLayout(),sectorShape=extend({},layout);sectorShape.label=null;var normalStyle=node.getVisual("style");normalStyle.lineJoin="bevel";var decal=node.getVisual("decal");decal&&(normalStyle.decal=createOrUpdatePatternFromDecal(decal,api));var cornerRadius=getSectorCornerRadius(itemModel.getModel("itemStyle"),sectorShape,!0);extend(sectorShape,cornerRadius),each$b(SPECIAL_STATES,(function(stateName){var state=sector.ensureState(stateName),itemStyleModel=itemModel.getModel([stateName,"itemStyle"]);state.style=itemStyleModel.getItemStyle();var cornerRadius=getSectorCornerRadius(itemStyleModel,sectorShape);cornerRadius&&(state.shape=cornerRadius)})),firstCreate?(sector.setShape(sectorShape),sector.shape.r=layout.r0,initProps(sector,{shape:{r:layout.r}},seriesModel,node.dataIndex)):(updateProps$1(sector,{shape:sectorShape},seriesModel),saveOldStyle(sector)),sector.useStyle(normalStyle),this._updateLabel(seriesModel);var cursorStyle=itemModel.getShallow("cursor");cursorStyle&&sector.attr("cursor",cursorStyle),this._seriesModel=seriesModel||this._seriesModel,this._ecModel=ecModel||this._ecModel;var focus=emphasisModel.get("focus");toggleHoverEmphasis(this,"relative"===focus?concatArray(node.getAncestorsIndices(),node.getDescendantIndices()):"ancestor"===focus?node.getAncestorsIndices():"descendant"===focus?node.getDescendantIndices():focus,emphasisModel.get("blurScope"),emphasisModel.get("disabled"))},SunburstPiece.prototype._updateLabel=function(seriesModel){var _this=this,itemModel=this.node.getModel(),normalLabelModel=itemModel.getModel("label"),layout=this.node.getLayout(),angle=layout.endAngle-layout.startAngle,midAngle=(layout.startAngle+layout.endAngle)/2,dx=Math.cos(midAngle),dy=Math.sin(midAngle),sector=this,label=sector.getTextContent(),dataIndex=this.node.dataIndex,labelMinAngle=normalLabelModel.get("minAngle")/180*Math.PI,isNormalShown=normalLabelModel.get("show")&&!(null!=labelMinAngle&&Math.abs(angle)<labelMinAngle);function getLabelAttr(model,name){var stateAttr=model.get(name);return null==stateAttr?normalLabelModel.get(name):stateAttr}label.ignore=!isNormalShown,each$b(DISPLAY_STATES,(function(stateName){var labelStateModel="normal"===stateName?itemModel.getModel("label"):itemModel.getModel([stateName,"label"]),isNormal="normal"===stateName,state=isNormal?label:label.ensureState(stateName),text=seriesModel.getFormattedLabel(dataIndex,stateName);isNormal&&(text=text||_this.node.name),state.style=createTextStyle(labelStateModel,{},null,"normal"!==stateName,!0),text&&(state.style.text=text);var isShown=labelStateModel.get("show");null==isShown||isNormal||(state.ignore=!isShown);var r,labelPosition=getLabelAttr(labelStateModel,"position"),sectorState=isNormal?sector:sector.states[stateName],labelColor=sectorState.style.fill;sectorState.textConfig={outsideFill:"inherit"===labelStateModel.get("color")?labelColor:null,inside:"outside"!==labelPosition};var labelPadding=getLabelAttr(labelStateModel,"distance")||0,textAlign=getLabelAttr(labelStateModel,"align"),rotateType=getLabelAttr(labelStateModel,"rotate"),flipStartAngle=.5*Math.PI,flipEndAngle=1.5*Math.PI,midAngleNormal=normalizeRadian("tangential"===rotateType?Math.PI/2-midAngle:midAngle),needsFlip=midAngleNormal>flipStartAngle&&!isRadianAroundZero(midAngleNormal-flipStartAngle)&&midAngleNormal<flipEndAngle;"outside"===labelPosition?(r=layout.r+labelPadding,textAlign=needsFlip?"right":"left"):textAlign&&"center"!==textAlign?"left"===textAlign?(r=layout.r0+labelPadding,textAlign=needsFlip?"right":"left"):"right"===textAlign&&(r=layout.r-labelPadding,textAlign=needsFlip?"left":"right"):(r=angle===2*Math.PI&&0===layout.r0?0:(layout.r+layout.r0)/2,textAlign="center"),state.style.align=textAlign,state.style.verticalAlign=getLabelAttr(labelStateModel,"verticalAlign")||"middle",state.x=r*dx+layout.cx,state.y=r*dy+layout.cy;var rotate=0;"radial"===rotateType?rotate=normalizeRadian(-midAngle)+(needsFlip?Math.PI:0):"tangential"===rotateType?rotate=normalizeRadian(Math.PI/2-midAngle)+(needsFlip?Math.PI:0):isNumber(rotateType)&&(rotate=rotateType*Math.PI/180),state.rotation=normalizeRadian(rotate)})),label.dirtyStyle()},SunburstPiece}(Sector$1),SunburstPiece$1=SunburstPiece;var SunburstView=function(_super){function SunburstView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=SunburstView.type,_this}return __extends(SunburstView,_super),SunburstView.prototype.render=function(seriesModel,ecModel,api,payload){var self=this;this.seriesModel=seriesModel,this.api=api,this.ecModel=ecModel;var data=seriesModel.getData(),virtualRoot=data.tree.root,newRoot=seriesModel.getViewRoot(),group=this.group,renderLabelForZeroData=seriesModel.get("renderLabelForZeroData"),newChildren=[];newRoot.eachNode((function(node){newChildren.push(node)}));var oldChildren=this._oldChildren||[];!function(newChildren,oldChildren){if(0===newChildren.length&&0===oldChildren.length)return;function getKey(node){return node.getId()}function processNode(newIdx,oldIdx){!function(newNode,oldNode){renderLabelForZeroData||!newNode||newNode.getValue()||(newNode=null);if(newNode!==virtualRoot&&oldNode!==virtualRoot)if(oldNode&&oldNode.piece)newNode?(oldNode.piece.updateData(!1,newNode,seriesModel,ecModel,api),data.setItemGraphicEl(newNode.dataIndex,oldNode.piece)):function(node){if(!node)return;node.piece&&(group.remove(node.piece),node.piece=null)}(oldNode);else if(newNode){var piece=new SunburstPiece$1(newNode,seriesModel,ecModel,api);group.add(piece),data.setItemGraphicEl(newNode.dataIndex,piece)}}(null==newIdx?null:newChildren[newIdx],null==oldIdx?null:oldChildren[oldIdx])}new DataDiffer$1(oldChildren,newChildren,getKey,getKey).add(processNode).update(processNode).remove(curry$1(processNode,null)).execute()}(newChildren,oldChildren),function(virtualRoot,viewRoot){viewRoot.depth>0?(self.virtualPiece?self.virtualPiece.updateData(!1,virtualRoot,seriesModel,ecModel,api):(self.virtualPiece=new SunburstPiece$1(virtualRoot,seriesModel,ecModel,api),group.add(self.virtualPiece)),viewRoot.piece.off("click"),self.virtualPiece.on("click",(function(e){self._rootToNode(viewRoot.parentNode)}))):self.virtualPiece&&(group.remove(self.virtualPiece),self.virtualPiece=null)}(virtualRoot,newRoot),this._initEvents(),this._oldChildren=newChildren},SunburstView.prototype._initEvents=function(){var _this=this;this.group.off("click"),this.group.on("click",(function(e){var targetFound=!1;_this.seriesModel.getViewRoot().eachNode((function(node){if(!targetFound&&node.piece&&node.piece===e.target){var nodeClick=node.getModel().get("nodeClick");if("rootToNode"===nodeClick)_this._rootToNode(node);else if("link"===nodeClick){var itemModel=node.getModel(),link=itemModel.get("link");if(link)windowOpen(link,itemModel.get("target",!0)||"_blank")}targetFound=!0}}))}))},SunburstView.prototype._rootToNode=function(node){node!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:node})},SunburstView.prototype.containPoint=function(point,seriesModel){var itemLayout=seriesModel.getData().getItemLayout(0);if(itemLayout){var dx=point[0]-itemLayout.cx,dy=point[1]-itemLayout.cy,radius=Math.sqrt(dx*dx+dy*dy);return radius<=itemLayout.r&&radius>=itemLayout.r0}},SunburstView.type="sunburst",SunburstView}(ChartView$1),SunburstView$1=SunburstView;function completeTreeValue(dataNode){var sum=0;each$b(dataNode.children,(function(child){completeTreeValue(child);var childValue=child.value;isArray(childValue)&&(childValue=childValue[0]),sum+=childValue}));var thisValue=dataNode.value;isArray(thisValue)&&(thisValue=thisValue[0]),(null==thisValue||isNaN(thisValue))&&(thisValue=sum),thisValue<0&&(thisValue=0),isArray(dataNode.value)?dataNode.value[0]=thisValue:dataNode.value=thisValue}var SunburstSeriesModel$1=function(_super){function SunburstSeriesModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=SunburstSeriesModel.type,_this.ignoreStyleOnData=!0,_this}return __extends(SunburstSeriesModel,_super),SunburstSeriesModel.prototype.getInitialData=function(option,ecModel){var root={name:option.name,children:option.data};completeTreeValue(root);var levelModels=this._levelModels=map$1(option.levels||[],(function(levelDefine){return new Model$1(levelDefine,this,ecModel)}),this),tree=Tree$1.createTree(root,this,(function(nodeData){nodeData.wrapMethod("getItemModel",(function(model,idx){var node=tree.getNodeByDataIndex(idx),levelModel=levelModels[node.depth];return levelModel&&(model.parentModel=levelModel),model}))}));return tree.data},SunburstSeriesModel.prototype.optionUpdated=function(){this.resetViewRoot()},SunburstSeriesModel.prototype.getDataParams=function(dataIndex){var params=_super.prototype.getDataParams.apply(this,arguments),node=this.getData().tree.getNodeByDataIndex(dataIndex);return params.treePathInfo=wrapTreePathInfo(node,this),params},SunburstSeriesModel.prototype.getLevelModel=function(node){return this._levelModels&&this._levelModels[node.depth]},SunburstSeriesModel.prototype.getViewRoot=function(){return this._viewRoot},SunburstSeriesModel.prototype.resetViewRoot=function(viewRoot){viewRoot?this._viewRoot=viewRoot:viewRoot=this._viewRoot;var root=this.getRawData().tree.root;viewRoot&&(viewRoot===root||root.contains(viewRoot))||(this._viewRoot=root)},SunburstSeriesModel.prototype.enableAriaDecal=function(){enableAriaDecalForTree(this)},SunburstSeriesModel.type="series.sunburst",SunburstSeriesModel.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},SunburstSeriesModel}(SeriesModel$1),RADIAN=Math.PI/180;function sunburstLayout(seriesType,ecModel,api){ecModel.eachSeriesByType(seriesType,(function(seriesModel){var center=seriesModel.get("center"),radius=seriesModel.get("radius");isArray(radius)||(radius=[0,radius]),isArray(center)||(center=[center,center]);var width=api.getWidth(),height=api.getHeight(),size=Math.min(width,height),cx=parsePercent(center[0],width),cy=parsePercent(center[1],height),r0=parsePercent(radius[0],size/2),r=parsePercent(radius[1],size/2),startAngle=-seriesModel.get("startAngle")*RADIAN,minAngle=seriesModel.get("minAngle")*RADIAN,virtualRoot=seriesModel.getData().tree.root,treeRoot=seriesModel.getViewRoot(),rootDepth=treeRoot.depth,sort=seriesModel.get("sort");null!=sort&&initChildren(treeRoot,sort);var validDataCount=0;each$b(treeRoot.children,(function(child){!isNaN(child.getValue())&&validDataCount++}));var sum=treeRoot.getValue(),unitRadian=Math.PI/(sum||validDataCount)*2,renderRollupNode=treeRoot.depth>0,levels=treeRoot.height-(renderRollupNode?-1:1),rPerLevel=(r-r0)/(levels||1),clockwise=seriesModel.get("clockwise"),stillShowZeroSum=seriesModel.get("stillShowZeroSum"),dir=clockwise?1:-1,_renderNode=function(node,startAngle){if(node){var endAngle=startAngle;if(node!==virtualRoot){var value=node.getValue(),angle=0===sum&&stillShowZeroSum?unitRadian:value*unitRadian;angle<minAngle&&(angle=minAngle),endAngle=startAngle+dir*angle;var depth=node.depth-rootDepth-(renderRollupNode?-1:1),rStart=r0+rPerLevel*depth,rEnd=r0+rPerLevel*(depth+1),levelModel=seriesModel.getLevelModel(node);if(levelModel){var r0_1=levelModel.get("r0",!0),r_1=levelModel.get("r",!0),radius_1=levelModel.get("radius",!0);null!=radius_1&&(r0_1=radius_1[0],r_1=radius_1[1]),null!=r0_1&&(rStart=parsePercent(r0_1,size/2)),null!=r_1&&(rEnd=parsePercent(r_1,size/2))}node.setLayout({angle:angle,startAngle:startAngle,endAngle:endAngle,clockwise:clockwise,cx:cx,cy:cy,r0:rStart,r:rEnd})}if(node.children&&node.children.length){var siblingAngle_1=0;each$b(node.children,(function(node){siblingAngle_1+=_renderNode(node,startAngle+siblingAngle_1)}))}return endAngle-startAngle}};if(renderRollupNode){var rStart=r0,rEnd=r0+rPerLevel,angle=2*Math.PI;virtualRoot.setLayout({angle:angle,startAngle:startAngle,endAngle:startAngle+angle,clockwise:clockwise,cx:cx,cy:cy,r0:rStart,r:rEnd})}_renderNode(treeRoot,startAngle)}))}function initChildren(node,sortOrder){var children=node.children||[];node.children=function(children,sortOrder){if(isFunction(sortOrder)){var sortTargets=map$1(children,(function(child,idx){var value=child.getValue();return{params:{depth:child.depth,height:child.height,dataIndex:child.dataIndex,getValue:function(){return value}},index:idx}}));return sortTargets.sort((function(a,b){return sortOrder(a.params,b.params)})),map$1(sortTargets,(function(target){return children[target.index]}))}var isAsc_1="asc"===sortOrder;return children.sort((function(a,b){var diff=(a.getValue()-b.getValue())*(isAsc_1?1:-1);return 0===diff?(a.dataIndex-b.dataIndex)*(isAsc_1?-1:1):diff}))}(children,sortOrder),children.length&&each$b(node.children,(function(child){initChildren(child,sortOrder)}))}function sunburstVisual(ecModel){var paletteScope={};ecModel.eachSeriesByType("sunburst",(function(seriesModel){var data=seriesModel.getData(),tree=data.tree;tree.eachNode((function(node){var style=node.getModel().getModel("itemStyle").getItemStyle();style.fill||(style.fill=function(node,seriesModel,treeHeight){for(var current=node;current&&current.depth>1;)current=current.parentNode;var color=seriesModel.getColorFromPalette(current.name||current.dataIndex+"",paletteScope);return node.depth>1&&isString(color)&&(color=lift(color,(node.depth-1)/(treeHeight-1)*.5)),color}(node,seriesModel,tree.root.height)),extend(data.ensureUniqueItemVisual(node.dataIndex,"style"),style)}))}))}var inner$8=makeInner(),clone$1=clone$3,bind=bind$1,BaseAxisPointer=function(){function BaseAxisPointer(){this._dragging=!1,this.animationThreshold=15}return BaseAxisPointer.prototype.render=function(axisModel,axisPointerModel,api,forceRender){var value=axisPointerModel.get("value"),status=axisPointerModel.get("status");if(this._axisModel=axisModel,this._axisPointerModel=axisPointerModel,this._api=api,forceRender||this._lastValue!==value||this._lastStatus!==status){this._lastValue=value,this._lastStatus=status;var group=this._group,handle=this._handle;if(!status||"hide"===status)return group&&group.hide(),void(handle&&handle.hide());group&&group.show(),handle&&handle.show();var elOption={};this.makeElOption(elOption,value,axisModel,axisPointerModel,api);var graphicKey=elOption.graphicKey;graphicKey!==this._lastGraphicKey&&this.clear(api),this._lastGraphicKey=graphicKey;var moveAnimation=this._moveAnimation=this.determineAnimation(axisModel,axisPointerModel);if(group){var doUpdateProps=curry$1(updateProps,axisPointerModel,moveAnimation);this.updatePointerEl(group,elOption,doUpdateProps),this.updateLabelEl(group,elOption,doUpdateProps,axisPointerModel)}else group=this._group=new Group$4,this.createPointerEl(group,elOption,axisModel,axisPointerModel),this.createLabelEl(group,elOption,axisModel,axisPointerModel),api.getZr().add(group);updateMandatoryProps(group,axisPointerModel,!0),this._renderHandle(value)}},BaseAxisPointer.prototype.remove=function(api){this.clear(api)},BaseAxisPointer.prototype.dispose=function(api){this.clear(api)},BaseAxisPointer.prototype.determineAnimation=function(axisModel,axisPointerModel){var animation=axisPointerModel.get("animation"),axis=axisModel.axis,isCategoryAxis="category"===axis.type,useSnap=axisPointerModel.get("snap");if(!useSnap&&!isCategoryAxis)return!1;if("auto"===animation||null==animation){var animationThreshold=this.animationThreshold;if(isCategoryAxis&&axis.getBandWidth()>animationThreshold)return!0;if(useSnap){var seriesDataCount=getAxisInfo$1(axisModel).seriesDataCount,axisExtent=axis.getExtent();return Math.abs(axisExtent[0]-axisExtent[1])/seriesDataCount>animationThreshold}return!1}return!0===animation},BaseAxisPointer.prototype.makeElOption=function(elOption,value,axisModel,axisPointerModel,api){},BaseAxisPointer.prototype.createPointerEl=function(group,elOption,axisModel,axisPointerModel){var pointerOption=elOption.pointer;if(pointerOption){var pointerEl=inner$8(group).pointerEl=new graphic[pointerOption.type](clone$1(elOption.pointer));group.add(pointerEl)}},BaseAxisPointer.prototype.createLabelEl=function(group,elOption,axisModel,axisPointerModel){if(elOption.label){var labelEl=inner$8(group).labelEl=new ZRText$1(clone$1(elOption.label));group.add(labelEl),updateLabelShowHide(labelEl,axisPointerModel)}},BaseAxisPointer.prototype.updatePointerEl=function(group,elOption,updateProps){var pointerEl=inner$8(group).pointerEl;pointerEl&&elOption.pointer&&(pointerEl.setStyle(elOption.pointer.style),updateProps(pointerEl,{shape:elOption.pointer.shape}))},BaseAxisPointer.prototype.updateLabelEl=function(group,elOption,updateProps,axisPointerModel){var labelEl=inner$8(group).labelEl;labelEl&&(labelEl.setStyle(elOption.label.style),updateProps(labelEl,{x:elOption.label.x,y:elOption.label.y}),updateLabelShowHide(labelEl,axisPointerModel))},BaseAxisPointer.prototype._renderHandle=function(value){if(!this._dragging&&this.updateHandleTransform){var isInit,axisPointerModel=this._axisPointerModel,zr=this._api.getZr(),handle=this._handle,handleModel=axisPointerModel.getModel("handle"),status=axisPointerModel.get("status");if(!handleModel.get("show")||!status||"hide"===status)return handle&&zr.remove(handle),void(this._handle=null);this._handle||(isInit=!0,handle=this._handle=createIcon(handleModel.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){stop(e.event)},onmousedown:bind(this._onHandleDragMove,this,0,0),drift:bind(this._onHandleDragMove,this),ondragend:bind(this._onHandleDragEnd,this)}),zr.add(handle)),updateMandatoryProps(handle,axisPointerModel,!1),handle.setStyle(handleModel.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var handleSize=handleModel.get("size");isArray(handleSize)||(handleSize=[handleSize,handleSize]),handle.scaleX=handleSize[0]/2,handle.scaleY=handleSize[1]/2,createOrUpdate(this,"_doDispatchAxisPointer",handleModel.get("throttle")||0,"fixRate"),this._moveHandleToValue(value,isInit)}},BaseAxisPointer.prototype._moveHandleToValue=function(value,isInit){updateProps(this._axisPointerModel,!isInit&&this._moveAnimation,this._handle,getHandleTransProps(this.getHandleTransform(value,this._axisModel,this._axisPointerModel)))},BaseAxisPointer.prototype._onHandleDragMove=function(dx,dy){var handle=this._handle;if(handle){this._dragging=!0;var trans=this.updateHandleTransform(getHandleTransProps(handle),[dx,dy],this._axisModel,this._axisPointerModel);this._payloadInfo=trans,handle.stopAnimation(),handle.attr(getHandleTransProps(trans)),inner$8(handle).lastProp=null,this._doDispatchAxisPointer()}},BaseAxisPointer.prototype._doDispatchAxisPointer=function(){if(this._handle){var payloadInfo=this._payloadInfo,axisModel=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:payloadInfo.cursorPoint[0],y:payloadInfo.cursorPoint[1],tooltipOption:payloadInfo.tooltipOption,axesInfo:[{axisDim:axisModel.axis.dim,axisIndex:axisModel.componentIndex}]})}},BaseAxisPointer.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var value=this._axisPointerModel.get("value");this._moveHandleToValue(value),this._api.dispatchAction({type:"hideTip"})}},BaseAxisPointer.prototype.clear=function(api){this._lastValue=null,this._lastStatus=null;var zr=api.getZr(),group=this._group,handle=this._handle;zr&&group&&(this._lastGraphicKey=null,group&&zr.remove(group),handle&&zr.remove(handle),this._group=null,this._handle=null,this._payloadInfo=null),clear$1(this,"_doDispatchAxisPointer")},BaseAxisPointer.prototype.doClear=function(){},BaseAxisPointer.prototype.buildLabel=function(xy,wh,xDimIndex){return{x:xy[xDimIndex=xDimIndex||0],y:xy[1-xDimIndex],width:wh[xDimIndex],height:wh[1-xDimIndex]}},BaseAxisPointer}();function updateProps(animationModel,moveAnimation,el,props){propsEqual(inner$8(el).lastProp,props)||(inner$8(el).lastProp=props,moveAnimation?updateProps$1(el,props,animationModel):(el.stopAnimation(),el.attr(props)))}function propsEqual(lastProps,newProps){if(isObject$3(lastProps)&&isObject$3(newProps)){var equals_1=!0;return each$b(newProps,(function(item,key){equals_1=equals_1&&propsEqual(lastProps[key],item)})),!!equals_1}return lastProps===newProps}function updateLabelShowHide(labelEl,axisPointerModel){labelEl[axisPointerModel.get(["label","show"])?"show":"hide"]()}function getHandleTransProps(trans){return{x:trans.x||0,y:trans.y||0,rotation:trans.rotation||0}}function updateMandatoryProps(group,axisPointerModel,silent){var z=axisPointerModel.get("z"),zlevel=axisPointerModel.get("zlevel");group&&group.traverse((function(el){"group"!==el.type&&(null!=z&&(el.z=z),null!=zlevel&&(el.zlevel=zlevel),el.silent=silent)}))}function buildLabelElOption(elOption,axisModel,axisPointerModel,api,labelPos){var text=getValueLabel(axisPointerModel.get("value"),axisModel.axis,axisModel.ecModel,axisPointerModel.get("seriesDataIndices"),{precision:axisPointerModel.get(["label","precision"]),formatter:axisPointerModel.get(["label","formatter"])}),labelModel=axisPointerModel.getModel("label"),paddings=normalizeCssArray(labelModel.get("padding")||0),font=labelModel.getFont(),textRect=getBoundingRect(text,font),position=labelPos.position,width=textRect.width+paddings[1]+paddings[3],height=textRect.height+paddings[0]+paddings[2],align=labelPos.align;"right"===align&&(position[0]-=width),"center"===align&&(position[0]-=width/2);var verticalAlign=labelPos.verticalAlign;"bottom"===verticalAlign&&(position[1]-=height),"middle"===verticalAlign&&(position[1]-=height/2),function(position,width,height,api){var viewWidth=api.getWidth(),viewHeight=api.getHeight();position[0]=Math.min(position[0]+width,viewWidth)-width,position[1]=Math.min(position[1]+height,viewHeight)-height,position[0]=Math.max(position[0],0),position[1]=Math.max(position[1],0)}(position,width,height,api);var bgColor=labelModel.get("backgroundColor");bgColor&&"auto"!==bgColor||(bgColor=axisModel.get(["axisLine","lineStyle","color"])),elOption.label={x:position[0],y:position[1],style:createTextStyle(labelModel,{text:text,font:font,fill:labelModel.getTextColor(),padding:paddings,backgroundColor:bgColor}),z2:10}}function getValueLabel(value,axis,ecModel,seriesDataIndices,opt){value=axis.scale.parse(value);var text=axis.scale.getLabel({value:value},{precision:opt.precision}),formatter=opt.formatter;if(formatter){var params_1={value:getAxisRawValue(axis,{value:value}),axisDimension:axis.dim,axisIndex:axis.index,seriesData:[]};each$b(seriesDataIndices,(function(idxItem){var series=ecModel.getSeriesByIndex(idxItem.seriesIndex),dataIndex=idxItem.dataIndexInside,dataParams=series&&series.getDataParams(dataIndex);dataParams&&params_1.seriesData.push(dataParams)})),isString(formatter)?text=formatter.replace("{value}",text):isFunction(formatter)&&(text=formatter(params_1))}return text}function getTransformedPosition(axis,value,layoutInfo){var transform=[1,0,0,1,0,0];return rotate(transform,transform,layoutInfo.rotation),translate(transform,transform,layoutInfo.position),applyTransform([axis.dataToCoord(value),(layoutInfo.labelOffset||0)+(layoutInfo.labelDirection||1)*(layoutInfo.labelMargin||0)],transform)}var CartesianAxisPointer=function(_super){function CartesianAxisPointer(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(CartesianAxisPointer,_super),CartesianAxisPointer.prototype.makeElOption=function(elOption,value,axisModel,axisPointerModel,api){var axis=axisModel.axis,grid=axis.grid,axisPointerType=axisPointerModel.get("type"),otherExtent=getCartesian(grid,axis).getOtherAxis(axis).getGlobalExtent(),pixelValue=axis.toGlobalCoord(axis.dataToCoord(value,!0));if(axisPointerType&&"none"!==axisPointerType){var elStyle=function(axisPointerModel){var style,axisPointerType=axisPointerModel.get("type"),styleModel=axisPointerModel.getModel(axisPointerType+"Style");return"line"===axisPointerType?(style=styleModel.getLineStyle()).fill=null:"shadow"===axisPointerType&&((style=styleModel.getAreaStyle()).stroke=null),style}(axisPointerModel),pointerOption=pointerShapeBuilder[axisPointerType](axis,pixelValue,otherExtent);pointerOption.style=elStyle,elOption.graphicKey=pointerOption.type,elOption.pointer=pointerOption}!function(value,elOption,layoutInfo,axisModel,axisPointerModel,api){var textLayout=AxisBuilder$1.innerTextLayout(layoutInfo.rotation,0,layoutInfo.labelDirection);layoutInfo.labelMargin=axisPointerModel.get(["label","margin"]),buildLabelElOption(elOption,axisModel,axisPointerModel,api,{position:getTransformedPosition(axisModel.axis,value,layoutInfo),align:textLayout.textAlign,verticalAlign:textLayout.textVerticalAlign})}(value,elOption,layout$1(grid.model,axisModel),axisModel,axisPointerModel,api)},CartesianAxisPointer.prototype.getHandleTransform=function(value,axisModel,axisPointerModel){var layoutInfo=layout$1(axisModel.axis.grid.model,axisModel,{labelInside:!1});layoutInfo.labelMargin=axisPointerModel.get(["handle","margin"]);var pos=getTransformedPosition(axisModel.axis,value,layoutInfo);return{x:pos[0],y:pos[1],rotation:layoutInfo.rotation+(layoutInfo.labelDirection<0?Math.PI:0)}},CartesianAxisPointer.prototype.updateHandleTransform=function(transform,delta,axisModel,axisPointerModel){var axis=axisModel.axis,grid=axis.grid,axisExtent=axis.getGlobalExtent(!0),otherExtent=getCartesian(grid,axis).getOtherAxis(axis).getGlobalExtent(),dimIndex="x"===axis.dim?0:1,currPosition=[transform.x,transform.y];currPosition[dimIndex]+=delta[dimIndex],currPosition[dimIndex]=Math.min(axisExtent[1],currPosition[dimIndex]),currPosition[dimIndex]=Math.max(axisExtent[0],currPosition[dimIndex]);var cursorOtherValue=(otherExtent[1]+otherExtent[0])/2,cursorPoint=[cursorOtherValue,cursorOtherValue];cursorPoint[dimIndex]=currPosition[dimIndex];return{x:currPosition[0],y:currPosition[1],rotation:transform.rotation,cursorPoint:cursorPoint,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][dimIndex]}},CartesianAxisPointer}(BaseAxisPointer);function getCartesian(grid,axis){var opt={};return opt[axis.dim+"AxisIndex"]=axis.index,grid.getCartesian(opt)}var pointerShapeBuilder={line:function(axis,pixelValue,otherExtent){var p1,p2,xDimIndex;return{type:"Line",subPixelOptimize:!0,shape:(p1=[pixelValue,otherExtent[0]],p2=[pixelValue,otherExtent[1]],xDimIndex=getAxisDimIndex(axis),{x1:p1[xDimIndex=xDimIndex||0],y1:p1[1-xDimIndex],x2:p2[xDimIndex],y2:p2[1-xDimIndex]})}},shadow:function(axis,pixelValue,otherExtent){var xy,wh,xDimIndex,bandWidth=Math.max(1,axis.getBandWidth()),span=otherExtent[1]-otherExtent[0];return{type:"Rect",shape:(xy=[pixelValue-bandWidth/2,otherExtent[0]],wh=[bandWidth,span],xDimIndex=getAxisDimIndex(axis),{x:xy[xDimIndex=xDimIndex||0],y:xy[1-xDimIndex],width:wh[xDimIndex],height:wh[1-xDimIndex]})}}};function getAxisDimIndex(axis){return"x"===axis.dim?0:1}var CartesianAxisPointer$1=CartesianAxisPointer,AxisPointerModel$1=function(_super){function AxisPointerModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=AxisPointerModel.type,_this}return __extends(AxisPointerModel,_super),AxisPointerModel.type="axisPointer",AxisPointerModel.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}},AxisPointerModel}(ComponentModel$1),inner$7=makeInner(),each$4=each$b;function register(key,api,handler){if(!env$1.node){var zr=api.getZr();inner$7(zr).records||(inner$7(zr).records={}),function(zr,api){if(inner$7(zr).initialized)return;function useHandler(eventType,cb){zr.on(eventType,(function(e){var dis=function(api){var pendings={showTip:[],hideTip:[]},_dispatchAction=function(payload){var pendingList=pendings[payload.type];pendingList?pendingList.push(payload):(payload.dispatchAction=_dispatchAction,api.dispatchAction(payload))};return{dispatchAction:_dispatchAction,pendings:pendings}}(api);each$4(inner$7(zr).records,(function(record){record&&cb(record,e,dis.dispatchAction)})),function(pendings,api){var actuallyPayload,showLen=pendings.showTip.length,hideLen=pendings.hideTip.length;showLen?actuallyPayload=pendings.showTip[showLen-1]:hideLen&&(actuallyPayload=pendings.hideTip[hideLen-1]);actuallyPayload&&(actuallyPayload.dispatchAction=null,api.dispatchAction(actuallyPayload))}(dis.pendings,api)}))}inner$7(zr).initialized=!0,useHandler("click",curry$1(doEnter,"click")),useHandler("mousemove",curry$1(doEnter,"mousemove")),useHandler("globalout",onLeave)}(zr,api),(inner$7(zr).records[key]||(inner$7(zr).records[key]={})).handler=handler}}function onLeave(record,e,dispatchAction){record.handler("leave",null,dispatchAction)}function doEnter(currTrigger,record,e,dispatchAction){record.handler(currTrigger,e,dispatchAction)}function unregister(key,api){if(!env$1.node){var zr=api.getZr();(inner$7(zr).records||{})[key]&&(inner$7(zr).records[key]=null)}}var AxisPointerView=function(_super){function AxisPointerView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=AxisPointerView.type,_this}return __extends(AxisPointerView,_super),AxisPointerView.prototype.render=function(globalAxisPointerModel,ecModel,api){var globalTooltipModel=ecModel.getComponent("tooltip"),triggerOn=globalAxisPointerModel.get("triggerOn")||globalTooltipModel&&globalTooltipModel.get("triggerOn")||"mousemove|click";register("axisPointer",api,(function(currTrigger,e,dispatchAction){"none"!==triggerOn&&("leave"===currTrigger||triggerOn.indexOf(currTrigger)>=0)&&dispatchAction({type:"updateAxisPointer",currTrigger:currTrigger,x:e&&e.offsetX,y:e&&e.offsetY})}))},AxisPointerView.prototype.remove=function(ecModel,api){unregister("axisPointer",api)},AxisPointerView.prototype.dispose=function(ecModel,api){unregister("axisPointer",api)},AxisPointerView.type="axisPointer",AxisPointerView}(ComponentView$1),AxisPointerView$1=AxisPointerView;function findPointFromSeries(finder,ecModel){var seriesModel,point=[],seriesIndex=finder.seriesIndex;if(null==seriesIndex||!(seriesModel=ecModel.getSeriesByIndex(seriesIndex)))return{point:[]};var data=seriesModel.getData(),dataIndex=queryDataIndex(data,finder);if(null==dataIndex||dataIndex<0||isArray(dataIndex))return{point:[]};var el=data.getItemGraphicEl(dataIndex),coordSys=seriesModel.coordinateSystem;if(seriesModel.getTooltipPosition)point=seriesModel.getTooltipPosition(dataIndex)||[];else if(coordSys&&coordSys.dataToPoint)if(finder.isStacked){var baseAxis=coordSys.getBaseAxis(),valueAxisDim=coordSys.getOtherAxis(baseAxis).dim,baseAxisDim=baseAxis.dim,baseDataOffset="x"===valueAxisDim||"radius"===valueAxisDim?1:0,baseDim=data.mapDimension(baseAxisDim),stackedData=[];stackedData[baseDataOffset]=data.get(baseDim,dataIndex),stackedData[1-baseDataOffset]=data.get(data.getCalculationInfo("stackResultDimension"),dataIndex),point=coordSys.dataToPoint(stackedData)||[]}else point=coordSys.dataToPoint(data.getValues(map$1(coordSys.dimensions,(function(dim){return data.mapDimension(dim)})),dataIndex))||[];else if(el){var rect=el.getBoundingRect().clone();rect.applyTransform(el.transform),point=[rect.x+rect.width/2,rect.y+rect.height/2]}return{point:point,el:el}}var inner$6=makeInner();function axisTrigger(payload,ecModel,api){var currTrigger=payload.currTrigger,point=[payload.x,payload.y],finder=payload,dispatchAction=payload.dispatchAction||bind$1(api.dispatchAction,api),coordSysAxesInfo=ecModel.getComponent("axisPointer").coordSysAxesInfo;if(coordSysAxesInfo){illegalPoint(point)&&(point=findPointFromSeries({seriesIndex:finder.seriesIndex,dataIndex:finder.dataIndex},ecModel).point);var isIllegalPoint=illegalPoint(point),inputAxesInfo=finder.axesInfo,axesInfo=coordSysAxesInfo.axesInfo,shouldHide="leave"===currTrigger||illegalPoint(point),outputPayload={},showValueMap={},dataByCoordSys={list:[],map:{}},updaters={showPointer:curry$1(showPointer,showValueMap),showTooltip:curry$1(showTooltip,dataByCoordSys)};each$b(coordSysAxesInfo.coordSysMap,(function(coordSys,coordSysKey){var coordSysContainsPoint=isIllegalPoint||coordSys.containPoint(point);each$b(coordSysAxesInfo.coordSysAxesInfo[coordSysKey],(function(axisInfo,key){var axis=axisInfo.axis,inputAxisInfo=function(inputAxesInfo,axisInfo){for(var i=0;i<(inputAxesInfo||[]).length;i++){var inputAxisInfo=inputAxesInfo[i];if(axisInfo.axis.dim===inputAxisInfo.axisDim&&axisInfo.axis.model.componentIndex===inputAxisInfo.axisIndex)return inputAxisInfo}}(inputAxesInfo,axisInfo);if(!shouldHide&&coordSysContainsPoint&&(!inputAxesInfo||inputAxisInfo)){var val=inputAxisInfo&&inputAxisInfo.value;null!=val||isIllegalPoint||(val=axis.pointToData(point)),null!=val&&processOnAxis(axisInfo,val,updaters,!1,outputPayload)}}))}));var linkTriggers={};return each$b(axesInfo,(function(tarAxisInfo,tarKey){var linkGroup=tarAxisInfo.linkGroup;linkGroup&&!showValueMap[tarKey]&&each$b(linkGroup.axesInfo,(function(srcAxisInfo,srcKey){var srcValItem=showValueMap[srcKey];if(srcAxisInfo!==tarAxisInfo&&srcValItem){var val=srcValItem.value;linkGroup.mapper&&(val=tarAxisInfo.axis.scale.parse(linkGroup.mapper(val,makeMapperParam(srcAxisInfo),makeMapperParam(tarAxisInfo)))),linkTriggers[tarAxisInfo.key]=val}}))})),each$b(linkTriggers,(function(val,tarKey){processOnAxis(axesInfo[tarKey],val,updaters,!0,outputPayload)})),function(showValueMap,axesInfo,outputPayload){var outputAxesInfo=outputPayload.axesInfo=[];each$b(axesInfo,(function(axisInfo,key){var option=axisInfo.axisPointerModel.option,valItem=showValueMap[key];valItem?(!axisInfo.useHandle&&(option.status="show"),option.value=valItem.value,option.seriesDataIndices=(valItem.payloadBatch||[]).slice()):!axisInfo.useHandle&&(option.status="hide"),"show"===option.status&&outputAxesInfo.push({axisDim:axisInfo.axis.dim,axisIndex:axisInfo.axis.model.componentIndex,value:option.value})}))}(showValueMap,axesInfo,outputPayload),function(dataByCoordSys,point,payload,dispatchAction){if(illegalPoint(point)||!dataByCoordSys.list.length)return void dispatchAction({type:"hideTip"});var sampleItem=((dataByCoordSys.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};dispatchAction({type:"showTip",escapeConnect:!0,x:point[0],y:point[1],tooltipOption:payload.tooltipOption,position:payload.position,dataIndexInside:sampleItem.dataIndexInside,dataIndex:sampleItem.dataIndex,seriesIndex:sampleItem.seriesIndex,dataByCoordSys:dataByCoordSys.list})}(dataByCoordSys,point,payload,dispatchAction),function(axesInfo,dispatchAction,api){var zr=api.getZr(),highDownKey="axisPointerLastHighlights",lastHighlights=inner$6(zr)[highDownKey]||{},newHighlights=inner$6(zr)[highDownKey]={};each$b(axesInfo,(function(axisInfo,key){var option=axisInfo.axisPointerModel.option;"show"===option.status&&axisInfo.triggerEmphasis&&each$b(option.seriesDataIndices,(function(batchItem){var key=batchItem.seriesIndex+" | "+batchItem.dataIndex;newHighlights[key]=batchItem}))}));var toHighlight=[],toDownplay=[];each$b(lastHighlights,(function(batchItem,key){!newHighlights[key]&&toDownplay.push(batchItem)})),each$b(newHighlights,(function(batchItem,key){!lastHighlights[key]&&toHighlight.push(batchItem)})),toDownplay.length&&api.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:toDownplay}),toHighlight.length&&api.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:toHighlight})}(axesInfo,0,api),outputPayload}}function processOnAxis(axisInfo,newValue,updaters,noSnap,outputFinder){var axis=axisInfo.axis;if(!axis.scale.isBlank()&&axis.containData(newValue))if(axisInfo.involveSeries){var payloadInfo=function(value,axisInfo){var axis=axisInfo.axis,dim=axis.dim,snapToValue=value,payloadBatch=[],minDist=Number.MAX_VALUE,minDiff=-1;return each$b(axisInfo.seriesModels,(function(series,idx){var seriesNestestValue,dataIndices,dataDim=series.getData().mapDimensionsAll(dim);if(series.getAxisTooltipData){var result=series.getAxisTooltipData(dataDim,value,axis);dataIndices=result.dataIndices,seriesNestestValue=result.nestestValue}else{if(!(dataIndices=series.getData().indicesOfNearest(dataDim[0],value,"category"===axis.type?.5:null)).length)return;seriesNestestValue=series.getData().get(dataDim[0],dataIndices[0])}if(null!=seriesNestestValue&&isFinite(seriesNestestValue)){var diff=value-seriesNestestValue,dist=Math.abs(diff);dist<=minDist&&((dist<minDist||diff>=0&&minDiff<0)&&(minDist=dist,minDiff=diff,snapToValue=seriesNestestValue,payloadBatch.length=0),each$b(dataIndices,(function(dataIndex){payloadBatch.push({seriesIndex:series.seriesIndex,dataIndexInside:dataIndex,dataIndex:series.getData().getRawIndex(dataIndex)})})))}})),{payloadBatch:payloadBatch,snapToValue:snapToValue}}(newValue,axisInfo),payloadBatch=payloadInfo.payloadBatch,snapToValue=payloadInfo.snapToValue;payloadBatch[0]&&null==outputFinder.seriesIndex&&extend(outputFinder,payloadBatch[0]),!noSnap&&axisInfo.snap&&axis.containData(snapToValue)&&null!=snapToValue&&(newValue=snapToValue),updaters.showPointer(axisInfo,newValue,payloadBatch),updaters.showTooltip(axisInfo,payloadInfo,snapToValue)}else updaters.showPointer(axisInfo,newValue)}function showPointer(showValueMap,axisInfo,value,payloadBatch){showValueMap[axisInfo.key]={value:value,payloadBatch:payloadBatch}}function showTooltip(dataByCoordSys,axisInfo,payloadInfo,value){var payloadBatch=payloadInfo.payloadBatch,axis=axisInfo.axis,axisModel=axis.model,axisPointerModel=axisInfo.axisPointerModel;if(axisInfo.triggerTooltip&&payloadBatch.length){var coordSysModel=axisInfo.coordSys.model,coordSysKey=makeKey(coordSysModel),coordSysItem=dataByCoordSys.map[coordSysKey];coordSysItem||(coordSysItem=dataByCoordSys.map[coordSysKey]={coordSysId:coordSysModel.id,coordSysIndex:coordSysModel.componentIndex,coordSysType:coordSysModel.type,coordSysMainType:coordSysModel.mainType,dataByAxis:[]},dataByCoordSys.list.push(coordSysItem)),coordSysItem.dataByAxis.push({axisDim:axis.dim,axisIndex:axisModel.componentIndex,axisType:axisModel.type,axisId:axisModel.id,value:value,valueLabelOpt:{precision:axisPointerModel.get(["label","precision"]),formatter:axisPointerModel.get(["label","formatter"])},seriesDataIndices:payloadBatch.slice()})}}function makeMapperParam(axisInfo){var axisModel=axisInfo.axis.model,item={},dim=item.axisDim=axisInfo.axis.dim;return item.axisIndex=item[dim+"AxisIndex"]=axisModel.componentIndex,item.axisName=item[dim+"AxisName"]=axisModel.name,item.axisId=item[dim+"AxisId"]=axisModel.id,item}function illegalPoint(point){return!point||null==point[0]||isNaN(point[0])||null==point[1]||isNaN(point[1])}function install$f(registers){AxisView$1.registerAxisPointerClass("CartesianAxisPointer",CartesianAxisPointer$1),registers.registerComponentModel(AxisPointerModel$1),registers.registerComponentView(AxisPointerView$1),registers.registerPreprocessor((function(option){if(option){(!option.axisPointer||0===option.axisPointer.length)&&(option.axisPointer={});var link=option.axisPointer.link;link&&!isArray(link)&&(option.axisPointer.link=[link])}})),registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC,(function(ecModel,api){ecModel.getComponent("axisPointer").coordSysAxesInfo=collect(ecModel,api)})),registers.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},axisTrigger)}function install$e(registers){use(install$v),use(install$f)}var DATA_ZOOM_AXIS_DIMENSIONS=["x","y","radius","angle","single"],SERIES_COORDS=["cartesian2d","polar","singleAxis"];function getAxisMainType(axisDim){return"production"!==process.env.NODE_ENV&&assert(axisDim),axisDim+"Axis"}function findEffectedDataZooms(ecModel,payload){var foundNewLink,axisRecords=createHashMap(),effectedModels=[],effectedModelMap=createHashMap();ecModel.eachComponent({mainType:"dataZoom",query:payload},(function(dataZoomModel){effectedModelMap.get(dataZoomModel.uid)||addToEffected(dataZoomModel)}));do{foundNewLink=!1,ecModel.eachComponent("dataZoom",processSingle)}while(foundNewLink);function processSingle(dataZoomModel){!effectedModelMap.get(dataZoomModel.uid)&&function(dataZoomModel){var isLink=!1;return dataZoomModel.eachTargetAxis((function(axisDim,axisIndex){var axisIdxArr=axisRecords.get(axisDim);axisIdxArr&&axisIdxArr[axisIndex]&&(isLink=!0)})),isLink}(dataZoomModel)&&(addToEffected(dataZoomModel),foundNewLink=!0)}function addToEffected(dataZoom){effectedModelMap.set(dataZoom.uid,!0),effectedModels.push(dataZoom),dataZoom.eachTargetAxis((function(axisDim,axisIndex){(axisRecords.get(axisDim)||axisRecords.set(axisDim,[]))[axisIndex]=!0}))}return effectedModels}function collectReferCoordSysModelInfo(dataZoomModel){var ecModel=dataZoomModel.ecModel,coordSysInfoWrap={infoList:[],infoMap:createHashMap()};return dataZoomModel.eachTargetAxis((function(axisDim,axisIndex){var axisModel=ecModel.getComponent(getAxisMainType(axisDim),axisIndex);if(axisModel){var coordSysModel=axisModel.getCoordSysModel();if(coordSysModel){var coordSysUid=coordSysModel.uid,coordSysInfo=coordSysInfoWrap.infoMap.get(coordSysUid);coordSysInfo||(coordSysInfo={model:coordSysModel,axisModels:[]},coordSysInfoWrap.infoList.push(coordSysInfo),coordSysInfoWrap.infoMap.set(coordSysUid,coordSysInfo)),coordSysInfo.axisModels.push(axisModel)}}})),coordSysInfoWrap}var DataZoomAxisInfo=function(){function DataZoomAxisInfo(){this.indexList=[],this.indexMap=[]}return DataZoomAxisInfo.prototype.add=function(axisCmptIdx){this.indexMap[axisCmptIdx]||(this.indexList.push(axisCmptIdx),this.indexMap[axisCmptIdx]=!0)},DataZoomAxisInfo}(),DataZoomModel=function(_super){function DataZoomModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=DataZoomModel.type,_this._autoThrottle=!0,_this._noTarget=!0,_this._rangePropMode=["percent","percent"],_this}return __extends(DataZoomModel,_super),DataZoomModel.prototype.init=function(option,parentModel,ecModel){var inputRawOption=retrieveRawOption(option);this.settledOption=inputRawOption,this.mergeDefaultAndTheme(option,ecModel),this._doInit(inputRawOption)},DataZoomModel.prototype.mergeOption=function(newOption){var inputRawOption=retrieveRawOption(newOption);merge(this.option,newOption,!0),merge(this.settledOption,inputRawOption,!0),this._doInit(inputRawOption)},DataZoomModel.prototype._doInit=function(inputRawOption){var thisOption=this.option;this._setDefaultThrottle(inputRawOption),this._updateRangeUse(inputRawOption);var settledOption=this.settledOption;each$b([["start","startValue"],["end","endValue"]],(function(names,index){"value"===this._rangePropMode[index]&&(thisOption[names[0]]=settledOption[names[0]]=null)}),this),this._resetTarget()},DataZoomModel.prototype._resetTarget=function(){var optionOrient=this.get("orient",!0),targetAxisIndexMap=this._targetAxisInfoMap=createHashMap();this._fillSpecifiedTargetAxis(targetAxisIndexMap)?this._orient=optionOrient||this._makeAutoOrientByTargetAxis():(this._orient=optionOrient||"horizontal",this._fillAutoTargetAxisByOrient(targetAxisIndexMap,this._orient)),this._noTarget=!0,targetAxisIndexMap.each((function(axisInfo){axisInfo.indexList.length&&(this._noTarget=!1)}),this)},DataZoomModel.prototype._fillSpecifiedTargetAxis=function(targetAxisIndexMap){var hasAxisSpecified=!1;return each$b(DATA_ZOOM_AXIS_DIMENSIONS,(function(axisDim){var refering=this.getReferringComponents(getAxisMainType(axisDim),MULTIPLE_REFERRING);if(refering.specified){hasAxisSpecified=!0;var axisInfo=new DataZoomAxisInfo;each$b(refering.models,(function(axisModel){axisInfo.add(axisModel.componentIndex)})),targetAxisIndexMap.set(axisDim,axisInfo)}}),this),hasAxisSpecified},DataZoomModel.prototype._fillAutoTargetAxisByOrient=function(targetAxisIndexMap,orient){var ecModel=this.ecModel,needAuto=!0;if(needAuto){var axisDim="vertical"===orient?"y":"x";setParallelAxis(ecModel.findComponents({mainType:axisDim+"Axis"}),axisDim)}needAuto&&setParallelAxis(ecModel.findComponents({mainType:"singleAxis",filter:function(axisModel){return axisModel.get("orient",!0)===orient}}),"single");function setParallelAxis(axisModels,axisDim){var axisModel=axisModels[0];if(axisModel){var axisInfo=new DataZoomAxisInfo;if(axisInfo.add(axisModel.componentIndex),targetAxisIndexMap.set(axisDim,axisInfo),needAuto=!1,"x"===axisDim||"y"===axisDim){var gridModel_1=axisModel.getReferringComponents("grid",SINGLE_REFERRING).models[0];gridModel_1&&each$b(axisModels,(function(axModel){axisModel.componentIndex!==axModel.componentIndex&&gridModel_1===axModel.getReferringComponents("grid",SINGLE_REFERRING).models[0]&&axisInfo.add(axModel.componentIndex)}))}}}needAuto&&each$b(DATA_ZOOM_AXIS_DIMENSIONS,(function(axisDim){if(needAuto){var axisModels=ecModel.findComponents({mainType:getAxisMainType(axisDim),filter:function(axisModel){return"category"===axisModel.get("type",!0)}});if(axisModels[0]){var axisInfo=new DataZoomAxisInfo;axisInfo.add(axisModels[0].componentIndex),targetAxisIndexMap.set(axisDim,axisInfo),needAuto=!1}}}),this)},DataZoomModel.prototype._makeAutoOrientByTargetAxis=function(){var dim;return this.eachTargetAxis((function(axisDim){!dim&&(dim=axisDim)}),this),"y"===dim?"vertical":"horizontal"},DataZoomModel.prototype._setDefaultThrottle=function(inputRawOption){if(inputRawOption.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var globalOption=this.ecModel.option;this.option.throttle=globalOption.animation&&globalOption.animationDurationUpdate>0?100:20}},DataZoomModel.prototype._updateRangeUse=function(inputRawOption){var rangePropMode=this._rangePropMode,rangeModeInOption=this.get("rangeMode");each$b([["start","startValue"],["end","endValue"]],(function(names,index){var percentSpecified=null!=inputRawOption[names[0]],valueSpecified=null!=inputRawOption[names[1]];percentSpecified&&!valueSpecified?rangePropMode[index]="percent":!percentSpecified&&valueSpecified?rangePropMode[index]="value":rangeModeInOption?rangePropMode[index]=rangeModeInOption[index]:percentSpecified&&(rangePropMode[index]="percent")}))},DataZoomModel.prototype.noTarget=function(){return this._noTarget},DataZoomModel.prototype.getFirstTargetAxisModel=function(){var firstAxisModel;return this.eachTargetAxis((function(axisDim,axisIndex){null==firstAxisModel&&(firstAxisModel=this.ecModel.getComponent(getAxisMainType(axisDim),axisIndex))}),this),firstAxisModel},DataZoomModel.prototype.eachTargetAxis=function(callback,context){this._targetAxisInfoMap.each((function(axisInfo,axisDim){each$b(axisInfo.indexList,(function(axisIndex){callback.call(context,axisDim,axisIndex)}))}))},DataZoomModel.prototype.getAxisProxy=function(axisDim,axisIndex){var axisModel=this.getAxisModel(axisDim,axisIndex);if(axisModel)return axisModel.__dzAxisProxy},DataZoomModel.prototype.getAxisModel=function(axisDim,axisIndex){"production"!==process.env.NODE_ENV&&assert(axisDim&&null!=axisIndex);var axisInfo=this._targetAxisInfoMap.get(axisDim);if(axisInfo&&axisInfo.indexMap[axisIndex])return this.ecModel.getComponent(getAxisMainType(axisDim),axisIndex)},DataZoomModel.prototype.setRawRange=function(opt){var thisOption=this.option,settledOption=this.settledOption;each$b([["start","startValue"],["end","endValue"]],(function(names){null==opt[names[0]]&&null==opt[names[1]]||(thisOption[names[0]]=settledOption[names[0]]=opt[names[0]],thisOption[names[1]]=settledOption[names[1]]=opt[names[1]])}),this),this._updateRangeUse(opt)},DataZoomModel.prototype.setCalculatedRange=function(opt){var option=this.option;each$b(["start","startValue","end","endValue"],(function(name){option[name]=opt[name]}))},DataZoomModel.prototype.getPercentRange=function(){var axisProxy=this.findRepresentativeAxisProxy();if(axisProxy)return axisProxy.getDataPercentWindow()},DataZoomModel.prototype.getValueRange=function(axisDim,axisIndex){if(null!=axisDim||null!=axisIndex)return this.getAxisProxy(axisDim,axisIndex).getDataValueWindow();var axisProxy=this.findRepresentativeAxisProxy();return axisProxy?axisProxy.getDataValueWindow():void 0},DataZoomModel.prototype.findRepresentativeAxisProxy=function(axisModel){if(axisModel)return axisModel.__dzAxisProxy;for(var firstProxy,axisDimList=this._targetAxisInfoMap.keys(),i=0;i<axisDimList.length;i++)for(var axisDim=axisDimList[i],axisInfo=this._targetAxisInfoMap.get(axisDim),j=0;j<axisInfo.indexList.length;j++){var proxy=this.getAxisProxy(axisDim,axisInfo.indexList[j]);if(proxy.hostedBy(this))return proxy;firstProxy||(firstProxy=proxy)}return firstProxy},DataZoomModel.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},DataZoomModel.prototype.getOrient=function(){return"production"!==process.env.NODE_ENV&&assert(this._orient),this._orient},DataZoomModel.type="dataZoom",DataZoomModel.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],DataZoomModel.defaultOption={z:4,filterMode:"filter",start:0,end:100},DataZoomModel}(ComponentModel$1);function retrieveRawOption(option){var ret={};return each$b(["start","end","startValue","endValue","throttle"],(function(name){option.hasOwnProperty(name)&&(ret[name]=option[name])})),ret}var DataZoomModel$1=DataZoomModel,SelectZoomModel=function(_super){function SelectDataZoomModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=SelectDataZoomModel.type,_this}return __extends(SelectDataZoomModel,_super),SelectDataZoomModel.type="dataZoom.select",SelectDataZoomModel}(DataZoomModel$1),DataZoomView$1=function(_super){function DataZoomView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=DataZoomView.type,_this}return __extends(DataZoomView,_super),DataZoomView.prototype.render=function(dataZoomModel,ecModel,api,payload){this.dataZoomModel=dataZoomModel,this.ecModel=ecModel,this.api=api},DataZoomView.type="dataZoom",DataZoomView}(ComponentView$1),SelectZoomView=function(_super){function SelectDataZoomView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=SelectDataZoomView.type,_this}return __extends(SelectDataZoomView,_super),SelectDataZoomView.type="dataZoom.select",SelectDataZoomView}(DataZoomView$1),each$3=each$b,asc=asc$1,AxisProxy=function(){function AxisProxy(dimName,axisIndex,dataZoomModel,ecModel){this._dimName=dimName,this._axisIndex=axisIndex,this.ecModel=ecModel,this._dataZoomModel=dataZoomModel}return AxisProxy.prototype.hostedBy=function(dataZoomModel){return this._dataZoomModel===dataZoomModel},AxisProxy.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},AxisProxy.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},AxisProxy.prototype.getTargetSeriesModels=function(){var seriesModels=[];return this.ecModel.eachSeries((function(seriesModel){if(function(seriesModel){var coordType=seriesModel.get("coordinateSystem");return indexOf(SERIES_COORDS,coordType)>=0}(seriesModel)){var axisMainType=getAxisMainType(this._dimName),axisModel=seriesModel.getReferringComponents(axisMainType,SINGLE_REFERRING).models[0];axisModel&&this._axisIndex===axisModel.componentIndex&&seriesModels.push(seriesModel)}}),this),seriesModels},AxisProxy.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},AxisProxy.prototype.getMinMaxSpan=function(){return clone$3(this._minMaxSpan)},AxisProxy.prototype.calculateDataWindow=function(opt){var hasPropModeValue,dataExtent=this._dataExtent,scale=this.getAxisModel().axis.scale,rangePropMode=this._dataZoomModel.getRangePropMode(),percentExtent=[0,100],percentWindow=[],valueWindow=[];each$3(["start","end"],(function(prop,idx){var boundPercent=opt[prop],boundValue=opt[prop+"Value"];"percent"===rangePropMode[idx]?(null==boundPercent&&(boundPercent=percentExtent[idx]),boundValue=scale.parse(linearMap(boundPercent,percentExtent,dataExtent))):(hasPropModeValue=!0,boundPercent=linearMap(boundValue=null==boundValue?dataExtent[idx]:scale.parse(boundValue),dataExtent,percentExtent)),valueWindow[idx]=null==boundValue||isNaN(boundValue)?dataExtent[idx]:boundValue,percentWindow[idx]=null==boundPercent||isNaN(boundPercent)?percentExtent[idx]:boundPercent})),asc(valueWindow),asc(percentWindow);var spans=this._minMaxSpan;function restrictSet(fromWindow,toWindow,fromExtent,toExtent,toValue){var suffix=toValue?"Span":"ValueSpan";sliderMove(0,fromWindow,fromExtent,"all",spans["min"+suffix],spans["max"+suffix]);for(var i=0;i<2;i++)toWindow[i]=linearMap(fromWindow[i],fromExtent,toExtent,!0),toValue&&(toWindow[i]=scale.parse(toWindow[i]))}return hasPropModeValue?restrictSet(valueWindow,percentWindow,dataExtent,percentExtent,!1):restrictSet(percentWindow,valueWindow,percentExtent,dataExtent,!0),{valueWindow:valueWindow,percentWindow:percentWindow}},AxisProxy.prototype.reset=function(dataZoomModel){if(dataZoomModel===this._dataZoomModel){var targetSeries=this.getTargetSeriesModels();this._dataExtent=function(axisProxy,axisDim,seriesModels){var dataExtent=[1/0,-1/0];each$3(seriesModels,(function(seriesModel){!function(dataExtent,data,axisDim){data&&each$b(getDataDimensionsOnAxis(data,axisDim),(function(dim){var seriesExtent=data.getApproximateExtent(dim);seriesExtent[0]<dataExtent[0]&&(dataExtent[0]=seriesExtent[0]),seriesExtent[1]>dataExtent[1]&&(dataExtent[1]=seriesExtent[1])}))}(dataExtent,seriesModel.getData(),axisDim)}));var axisModel=axisProxy.getAxisModel(),rawExtentResult=ensureScaleRawExtentInfo(axisModel.axis.scale,axisModel,dataExtent).calculate();return[rawExtentResult.min,rawExtentResult.max]}(this,this._dimName,targetSeries),this._updateMinMaxSpan();var dataWindow=this.calculateDataWindow(dataZoomModel.settledOption);this._valueWindow=dataWindow.valueWindow,this._percentWindow=dataWindow.percentWindow,this._setAxisModel()}},AxisProxy.prototype.filterData=function(dataZoomModel,api){if(dataZoomModel===this._dataZoomModel){var axisDim=this._dimName,seriesModels=this.getTargetSeriesModels(),filterMode=dataZoomModel.get("filterMode"),valueWindow=this._valueWindow;"none"!==filterMode&&each$3(seriesModels,(function(seriesModel){var seriesData=seriesModel.getData(),dataDims=seriesData.mapDimensionsAll(axisDim);if(dataDims.length){if("weakFilter"===filterMode){var store_1=seriesData.getStore(),dataDimIndices_1=map$1(dataDims,(function(dim){return seriesData.getDimensionIndex(dim)}),seriesData);seriesData.filterSelf((function(dataIndex){for(var leftOut,rightOut,hasValue,i=0;i<dataDims.length;i++){var value=store_1.get(dataDimIndices_1[i],dataIndex),thisHasValue=!isNaN(value),thisLeftOut=value<valueWindow[0],thisRightOut=value>valueWindow[1];if(thisHasValue&&!thisLeftOut&&!thisRightOut)return!0;thisHasValue&&(hasValue=!0),thisLeftOut&&(leftOut=!0),thisRightOut&&(rightOut=!0)}return hasValue&&leftOut&&rightOut}))}else each$3(dataDims,(function(dim){if("empty"===filterMode)seriesModel.setData(seriesData=seriesData.map(dim,(function(value){return function(value){return value>=valueWindow[0]&&value<=valueWindow[1]}(value)?value:NaN})));else{var range={};range[dim]=valueWindow,seriesData.selectRange(range)}}));each$3(dataDims,(function(dim){seriesData.setApproximateExtent(valueWindow,dim)}))}}))}},AxisProxy.prototype._updateMinMaxSpan=function(){var minMaxSpan=this._minMaxSpan={},dataZoomModel=this._dataZoomModel,dataExtent=this._dataExtent;each$3(["min","max"],(function(minMax){var percentSpan=dataZoomModel.get(minMax+"Span"),valueSpan=dataZoomModel.get(minMax+"ValueSpan");null!=valueSpan&&(valueSpan=this.getAxisModel().axis.scale.parse(valueSpan)),null!=valueSpan?percentSpan=linearMap(dataExtent[0]+valueSpan,dataExtent,[0,100],!0):null!=percentSpan&&(valueSpan=linearMap(percentSpan,[0,100],dataExtent,!0)-dataExtent[0]),minMaxSpan[minMax+"Span"]=percentSpan,minMaxSpan[minMax+"ValueSpan"]=valueSpan}),this)},AxisProxy.prototype._setAxisModel=function(){var axisModel=this.getAxisModel(),percentWindow=this._percentWindow,valueWindow=this._valueWindow;if(percentWindow){var precision=getPixelPrecision(valueWindow,[0,500]);precision=Math.min(precision,20);var rawExtentInfo=axisModel.axis.scale.rawExtentInfo;0!==percentWindow[0]&&rawExtentInfo.setDeterminedMinMax("min",+valueWindow[0].toFixed(precision)),100!==percentWindow[1]&&rawExtentInfo.setDeterminedMinMax("max",+valueWindow[1].toFixed(precision)),rawExtentInfo.freeze()}},AxisProxy}();var AxisProxy$1=AxisProxy,dataZoomProcessor$1={getTargetSeries:function(ecModel){function eachAxisModel(cb){ecModel.eachComponent("dataZoom",(function(dataZoomModel){dataZoomModel.eachTargetAxis((function(axisDim,axisIndex){var axisModel=ecModel.getComponent(getAxisMainType(axisDim),axisIndex);cb(axisDim,axisIndex,axisModel,dataZoomModel)}))}))}eachAxisModel((function(axisDim,axisIndex,axisModel,dataZoomModel){axisModel.__dzAxisProxy=null}));var proxyList=[];eachAxisModel((function(axisDim,axisIndex,axisModel,dataZoomModel){axisModel.__dzAxisProxy||(axisModel.__dzAxisProxy=new AxisProxy$1(axisDim,axisIndex,dataZoomModel,ecModel),proxyList.push(axisModel.__dzAxisProxy))}));var seriesModelMap=createHashMap();return each$b(proxyList,(function(axisProxy){each$b(axisProxy.getTargetSeriesModels(),(function(seriesModel){seriesModelMap.set(seriesModel.uid,seriesModel)}))})),seriesModelMap},overallReset:function(ecModel,api){ecModel.eachComponent("dataZoom",(function(dataZoomModel){dataZoomModel.eachTargetAxis((function(axisDim,axisIndex){dataZoomModel.getAxisProxy(axisDim,axisIndex).reset(dataZoomModel)})),dataZoomModel.eachTargetAxis((function(axisDim,axisIndex){dataZoomModel.getAxisProxy(axisDim,axisIndex).filterData(dataZoomModel,api)}))})),ecModel.eachComponent("dataZoom",(function(dataZoomModel){var axisProxy=dataZoomModel.findRepresentativeAxisProxy();if(axisProxy){var percentRange=axisProxy.getDataPercentWindow(),valueRange=axisProxy.getDataValueWindow();dataZoomModel.setCalculatedRange({start:percentRange[0],end:percentRange[1],startValue:valueRange[0],endValue:valueRange[1]})}}))}};var installed=!1;function installCommon(registers){installed||(installed=!0,registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER,dataZoomProcessor$1),function(registers){registers.registerAction("dataZoom",(function(payload,ecModel){each$b(findEffectedDataZooms(ecModel,payload),(function(dataZoomModel){dataZoomModel.setRawRange({start:payload.start,end:payload.end,startValue:payload.startValue,endValue:payload.endValue})}))}))}(registers),registers.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function install$d(registers){registers.registerComponentModel(SelectZoomModel),registers.registerComponentView(SelectZoomView),installCommon(registers)}var ToolboxFeature=function(){},features={};function registerFeature(name,ctor){features[name]=ctor}function getFeature(name){return features[name]}var ToolboxModel$1=function(_super){function ToolboxModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ToolboxModel.type,_this}return __extends(ToolboxModel,_super),ToolboxModel.prototype.optionUpdated=function(){_super.prototype.optionUpdated.apply(this,arguments);var ecModel=this.ecModel;each$b(this.option.feature,(function(featureOpt,featureName){var Feature=getFeature(featureName);Feature&&(Feature.getDefaultOption&&(Feature.defaultOption=Feature.getDefaultOption(ecModel)),merge(featureOpt,Feature.defaultOption))}))},ToolboxModel.type="toolbox",ToolboxModel.layoutMode={type:"box",ignoreSize:!0},ToolboxModel.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"}},ToolboxModel}(ComponentModel$1);function makeBackground(rect,componentModel){var padding=normalizeCssArray(componentModel.get("padding")),style=componentModel.getItemStyle(["color","opacity"]);return style.fill=componentModel.get("backgroundColor"),rect=new Rect$4({shape:{x:rect.x-padding[3],y:rect.y-padding[0],width:rect.width+padding[1]+padding[3],height:rect.height+padding[0]+padding[2],r:componentModel.get("borderRadius")},style:style,silent:!0,z2:-1})}var ToolboxView=function(_super){function ToolboxView(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ToolboxView,_super),ToolboxView.prototype.render=function(toolboxModel,ecModel,api,payload){var group=this.group;if(group.removeAll(),toolboxModel.get("show")){var itemSize=+toolboxModel.get("itemSize"),isVertical="vertical"===toolboxModel.get("orient"),featureOpts=toolboxModel.get("feature")||{},features=this._features||(this._features={}),featureNames=[];each$b(featureOpts,(function(opt,name){featureNames.push(name)})),new DataDiffer$1(this._featureNames||[],featureNames).add(processFeature).update(processFeature).remove(curry$1(processFeature,null)).execute(),this._featureNames=featureNames,function(group,componentModel,api){var boxLayoutParams=componentModel.getBoxLayoutParams(),padding=componentModel.get("padding"),viewportSize={width:api.getWidth(),height:api.getHeight()},rect=getLayoutRect(boxLayoutParams,viewportSize,padding);box(componentModel.get("orient"),group,componentModel.get("itemGap"),rect.width,rect.height),positionElement(group,boxLayoutParams,viewportSize,padding)}(group,toolboxModel,api),group.add(makeBackground(group.getBoundingRect(),toolboxModel)),isVertical||group.eachChild((function(icon){var titleText=icon.__title,emphasisState=icon.ensureState("emphasis"),emphasisTextConfig=emphasisState.textConfig||(emphasisState.textConfig={}),textContent=icon.getTextContent(),emphasisTextState=textContent&&textContent.ensureState("emphasis");if(emphasisTextState&&!isFunction(emphasisTextState)&&titleText){var emphasisTextStyle=emphasisTextState.style||(emphasisTextState.style={}),rect=getBoundingRect(titleText,ZRText$1.makeFont(emphasisTextStyle)),offsetX=icon.x+group.x,needPutOnTop=!1;icon.y+group.y+itemSize+rect.height>api.getHeight()&&(emphasisTextConfig.position="top",needPutOnTop=!0);var topOffset=needPutOnTop?-5-rect.height:itemSize+10;offsetX+rect.width/2>api.getWidth()?(emphasisTextConfig.position=["100%",topOffset],emphasisTextStyle.align="right"):offsetX-rect.width/2<0&&(emphasisTextConfig.position=[0,topOffset],emphasisTextStyle.align="left")}}))}function processFeature(newIndex,oldIndex){var feature,featureName=featureNames[newIndex],oldName=featureNames[oldIndex],featureOpt=featureOpts[featureName],featureModel=new Model$1(featureOpt,toolboxModel,toolboxModel.ecModel);if(payload&&null!=payload.newTitle&&payload.featureName===featureName&&(featureOpt.title=payload.newTitle),featureName&&!oldName){if(function(featureName){return 0===featureName.indexOf("my")}(featureName))feature={onclick:featureModel.option.onclick,featureName:featureName};else{var Feature=getFeature(featureName);if(!Feature)return;feature=new Feature}features[featureName]=feature}else if(!(feature=features[oldName]))return;feature.uid=getUID("toolbox-feature"),feature.model=featureModel,feature.ecModel=ecModel,feature.api=api;var isToolboxFeature=feature instanceof ToolboxFeature;featureName||!oldName?!featureModel.get("show")||isToolboxFeature&&feature.unusable?isToolboxFeature&&feature.remove&&feature.remove(ecModel,api):(!function(featureModel,feature,featureName){var iconsMap,titlesMap,iconStyleModel=featureModel.getModel("iconStyle"),iconStyleEmphasisModel=featureModel.getModel(["emphasis","iconStyle"]),icons=feature instanceof ToolboxFeature&&feature.getIcons?feature.getIcons():featureModel.get("icon"),titles=featureModel.get("title")||{};isString(icons)?(iconsMap={})[featureName]=icons:iconsMap=icons;isString(titles)?(titlesMap={})[featureName]=titles:titlesMap=titles;var iconPaths=featureModel.iconPaths={};each$b(iconsMap,(function(iconStr,iconName){var path=createIcon(iconStr,{},{x:-itemSize/2,y:-itemSize/2,width:itemSize,height:itemSize});path.setStyle(iconStyleModel.getItemStyle()),path.ensureState("emphasis").style=iconStyleEmphasisModel.getItemStyle();var textContent=new ZRText$1({style:{text:titlesMap[iconName],align:iconStyleEmphasisModel.get("textAlign"),borderRadius:iconStyleEmphasisModel.get("textBorderRadius"),padding:iconStyleEmphasisModel.get("textPadding"),fill:null,font:getFont({fontStyle:iconStyleEmphasisModel.get("textFontStyle"),fontFamily:iconStyleEmphasisModel.get("textFontFamily"),fontSize:iconStyleEmphasisModel.get("textFontSize"),fontWeight:iconStyleEmphasisModel.get("textFontWeight")},ecModel)},ignore:!0});path.setTextContent(textContent),setTooltipConfig({el:path,componentModel:toolboxModel,itemName:iconName,formatterParamsExtra:{title:titlesMap[iconName]}}),path.__title=titlesMap[iconName],path.on("mouseover",(function(){var hoverStyle=iconStyleEmphasisModel.getItemStyle(),defaultTextPosition=isVertical?null==toolboxModel.get("right")&&"right"!==toolboxModel.get("left")?"right":"left":null==toolboxModel.get("bottom")&&"bottom"!==toolboxModel.get("top")?"bottom":"top";textContent.setStyle({fill:iconStyleEmphasisModel.get("textFill")||hoverStyle.fill||hoverStyle.stroke||"#000",backgroundColor:iconStyleEmphasisModel.get("textBackgroundColor")}),path.setTextConfig({position:iconStyleEmphasisModel.get("textPosition")||defaultTextPosition}),textContent.ignore=!toolboxModel.get("showTitle"),api.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==featureModel.get(["iconStatus",iconName])&&api.leaveEmphasis(this),textContent.hide()})),("emphasis"===featureModel.get(["iconStatus",iconName])?enterEmphasis:leaveEmphasis)(path),group.add(path),path.on("click",bind$1(feature.onclick,feature,ecModel,api,iconName)),iconPaths[iconName]=path}))}(featureModel,feature,featureName),featureModel.setIconStatus=function(iconName,status){var option=this.option,iconPaths=this.iconPaths;option.iconStatus=option.iconStatus||{},option.iconStatus[iconName]=status,iconPaths[iconName]&&("emphasis"===status?enterEmphasis:leaveEmphasis)(iconPaths[iconName])},feature instanceof ToolboxFeature&&feature.render&&feature.render(featureModel,ecModel,api,payload)):isToolboxFeature&&feature.dispose&&feature.dispose(ecModel,api)}},ToolboxView.prototype.updateView=function(toolboxModel,ecModel,api,payload){each$b(this._features,(function(feature){feature instanceof ToolboxFeature&&feature.updateView&&feature.updateView(feature.model,ecModel,api,payload)}))},ToolboxView.prototype.remove=function(ecModel,api){each$b(this._features,(function(feature){feature instanceof ToolboxFeature&&feature.remove&&feature.remove(ecModel,api)})),this.group.removeAll()},ToolboxView.prototype.dispose=function(ecModel,api){each$b(this._features,(function(feature){feature instanceof ToolboxFeature&&feature.dispose&&feature.dispose(ecModel,api)}))},ToolboxView.type="toolbox",ToolboxView}(ComponentView$1);var ToolboxView$1=ToolboxView,SaveAsImage$1=function(_super){function SaveAsImage(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(SaveAsImage,_super),SaveAsImage.prototype.onclick=function(ecModel,api){var model=this.model,title=model.get("name")||ecModel.get("title.0.text")||"echarts",isSvg="svg"===api.getZr().painter.getType(),type=isSvg?"svg":model.get("type",!0)||"png",url=api.getConnectedDataURL({type:type,backgroundColor:model.get("backgroundColor",!0)||ecModel.get("backgroundColor")||"#fff",connectedBackgroundColor:model.get("connectedBackgroundColor"),excludeComponents:model.get("excludeComponents"),pixelRatio:model.get("pixelRatio")}),browser=env$1.browser;if("function"!=typeof MouseEvent||!browser.newEdge&&(browser.ie||browser.edge))if(window.navigator.msSaveOrOpenBlob||isSvg){var parts=url.split(","),base64Encoded=parts[0].indexOf("base64")>-1,bstr=isSvg?decodeURIComponent(parts[1]):parts[1];base64Encoded&&(bstr=window.atob(bstr));var filename=title+"."+type;if(window.navigator.msSaveOrOpenBlob){for(var n=bstr.length,u8arr=new Uint8Array(n);n--;)u8arr[n]=bstr.charCodeAt(n);var blob=new Blob([u8arr]);window.navigator.msSaveOrOpenBlob(blob,filename)}else{var frame=document.createElement("iframe");document.body.appendChild(frame);var cw=frame.contentWindow,doc=cw.document;doc.open("image/svg+xml","replace"),doc.write(bstr),doc.close(),cw.focus(),doc.execCommand("SaveAs",!0,filename),document.body.removeChild(frame)}}else{var lang=model.get("lang"),html='<body style="margin:0;"><img src="'+url+'" style="max-width:100%;" title="'+(lang&&lang[0]||"")+'" /></body>',tab=window.open();tab.document.write(html),tab.document.title=title}else{var $a=document.createElement("a");$a.download=title+"."+type,$a.target="_blank",$a.href=url;var evt=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});$a.dispatchEvent(evt)}},SaveAsImage.getDefaultOption=function(ecModel){return{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:ecModel.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:ecModel.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},SaveAsImage}(ToolboxFeature),radioTypes=[["line","bar"],["stack"]],MagicType=function(_super){function MagicType(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(MagicType,_super),MagicType.prototype.getIcons=function(){var model=this.model,availableIcons=model.get("icon"),icons={};return each$b(model.get("type"),(function(type){availableIcons[type]&&(icons[type]=availableIcons[type])})),icons},MagicType.getDefaultOption=function(ecModel){return{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:ecModel.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},MagicType.prototype.onclick=function(ecModel,api,type){var model=this.model,seriesIndex=model.get(["seriesIndex",type]);if(seriesOptGenreator[type]){var newTitle,newOption={series:[]};each$b(radioTypes,(function(radio){indexOf(radio,type)>=0&&each$b(radio,(function(item){model.setIconStatus(item,"normal")}))})),model.setIconStatus(type,"emphasis"),ecModel.eachComponent({mainType:"series",query:null==seriesIndex?null:{seriesIndex:seriesIndex}},(function(seriesModel){var seriesType=seriesModel.subType,seriesId=seriesModel.id,newSeriesOpt=seriesOptGenreator[type](seriesType,seriesId,seriesModel,model);newSeriesOpt&&(defaults(newSeriesOpt,seriesModel.option),newOption.series.push(newSeriesOpt));var coordSys=seriesModel.coordinateSystem;if(coordSys&&"cartesian2d"===coordSys.type&&("line"===type||"bar"===type)){var categoryAxis=coordSys.getAxesByScale("ordinal")[0];if(categoryAxis){var axisType=categoryAxis.dim+"Axis",axisIndex=seriesModel.getReferringComponents(axisType,SINGLE_REFERRING).models[0].componentIndex;newOption[axisType]=newOption[axisType]||[];for(var i=0;i<=axisIndex;i++)newOption[axisType][axisIndex]=newOption[axisType][axisIndex]||{};newOption[axisType][axisIndex].boundaryGap="bar"===type}}}));var currentType=type;"stack"===type&&(newTitle=merge({stack:model.option.title.tiled,tiled:model.option.title.stack},model.option.title),"emphasis"!==model.get(["iconStatus",type])&&(currentType="tiled")),api.dispatchAction({type:"changeMagicType",currentType:currentType,newOption:newOption,newTitle:newTitle,featureName:"magicType"})}},MagicType}(ToolboxFeature),seriesOptGenreator={line:function(seriesType,seriesId,seriesModel,model){if("bar"===seriesType)return merge({id:seriesId,type:"line",data:seriesModel.get("data"),stack:seriesModel.get("stack"),markPoint:seriesModel.get("markPoint"),markLine:seriesModel.get("markLine")},model.get(["option","line"])||{},!0)},bar:function(seriesType,seriesId,seriesModel,model){if("line"===seriesType)return merge({id:seriesId,type:"bar",data:seriesModel.get("data"),stack:seriesModel.get("stack"),markPoint:seriesModel.get("markPoint"),markLine:seriesModel.get("markLine")},model.get(["option","bar"])||{},!0)},stack:function(seriesType,seriesId,seriesModel,model){var isStack="__ec_magicType_stack__"===seriesModel.get("stack");if("line"===seriesType||"bar"===seriesType)return model.setIconStatus("stack",isStack?"normal":"emphasis"),merge({id:seriesId,stack:isStack?"":"__ec_magicType_stack__"},model.get(["option","stack"])||{},!0)}};registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(payload,ecModel){ecModel.mergeOption(payload.newOption)}));var MagicType$1=MagicType,BLOCK_SPLITER=new Array(60).join("-");function trim(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var itemSplitRegex=new RegExp("[\t]+","g");function parseContents(str,blockMetaList){var blocks=str.split(new RegExp("\n*"+BLOCK_SPLITER+"\n*","g")),newOption={series:[]};return each$b(blocks,(function(block,idx){if(function(block){if(block.slice(0,block.indexOf("\n")).indexOf("\t")>=0)return!0}(block)){var result=function(tsv){for(var tsvLines=tsv.split(/\n+/g),categories=[],series=map$1(trim(tsvLines.shift()).split(itemSplitRegex),(function(header){return{name:header,data:[]}})),i=0;i<tsvLines.length;i++){var items=trim(tsvLines[i]).split(itemSplitRegex);categories.push(items.shift());for(var j=0;j<items.length;j++)series[j]&&(series[j].data[i]=items[j])}return{series:series,categories:categories}}(block),blockMeta=blockMetaList[idx],axisKey=blockMeta.axisDim+"Axis";blockMeta&&(newOption[axisKey]=newOption[axisKey]||[],newOption[axisKey][blockMeta.axisIndex]={data:result.categories},newOption.series=newOption.series.concat(result.series))}else{result=function(str){for(var lines=str.split(/\n+/g),seriesName=trim(lines.shift()),data=[],i=0;i<lines.length;i++){var line=trim(lines[i]);if(line){var items=line.split(itemSplitRegex),name_1="",value=void 0,hasName=!1;isNaN(items[0])?(hasName=!0,name_1=items[0],items=items.slice(1),data[i]={name:name_1,value:[]},value=data[i].value):value=data[i]=[];for(var j=0;j<items.length;j++)value.push(+items[j]);1===value.length&&(hasName?data[i].value=value[0]:data[i]=value[0])}}return{name:seriesName,data:data}}(block);newOption.series.push(result)}})),newOption}var DataView$1=function(_super){function DataView(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DataView,_super),DataView.prototype.onclick=function(ecModel,api){setTimeout((function(){api.dispatchAction({type:"hideTip"})}));var container=api.getDom(),model=this.model;this._dom&&container.removeChild(this._dom);var root=document.createElement("div");root.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",root.style.backgroundColor=model.get("backgroundColor")||"#fff";var header=document.createElement("h4"),lang=model.get("lang")||[];header.innerHTML=lang[0]||model.get("title"),header.style.cssText="margin:10px 20px",header.style.color=model.get("textColor");var viewMain=document.createElement("div"),textarea=document.createElement("textarea");viewMain.style.cssText="overflow:auto";var optionToContent=model.get("optionToContent"),contentToOption=model.get("contentToOption"),result=function(ecModel){var series,groups,tables,result=function(ecModel){var seriesGroupByCategoryAxis={},otherSeries=[],meta=[];return ecModel.eachRawSeries((function(seriesModel){var coordSys=seriesModel.coordinateSystem;if(!coordSys||"cartesian2d"!==coordSys.type&&"polar"!==coordSys.type)otherSeries.push(seriesModel);else{var baseAxis=coordSys.getBaseAxis();if("category"===baseAxis.type){var key=baseAxis.dim+"_"+baseAxis.index;seriesGroupByCategoryAxis[key]||(seriesGroupByCategoryAxis[key]={categoryAxis:baseAxis,valueAxis:coordSys.getOtherAxis(baseAxis),series:[]},meta.push({axisDim:baseAxis.dim,axisIndex:baseAxis.index})),seriesGroupByCategoryAxis[key].series.push(seriesModel)}else otherSeries.push(seriesModel)}})),{seriesGroupByCategoryAxis:seriesGroupByCategoryAxis,other:otherSeries,meta:meta}}(ecModel);return{value:filter([(groups=result.seriesGroupByCategoryAxis,tables=[],each$b(groups,(function(group,key){var categoryAxis=group.categoryAxis,valueAxisDim=group.valueAxis.dim,headers=[" "].concat(map$1(group.series,(function(series){return series.name}))),columns=[categoryAxis.model.getCategories()];each$b(group.series,(function(series){var rawData=series.getRawData();columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim),(function(val){return val})))}));for(var lines=[headers.join("\t")],i=0;i<columns[0].length;i++){for(var items=[],j=0;j<columns.length;j++)items.push(columns[j][i]);lines.push(items.join("\t"))}tables.push(lines.join("\n"))})),tables.join("\n\n"+BLOCK_SPLITER+"\n\n")),(series=result.other,map$1(series,(function(series){var data=series.getRawData(),lines=[series.name],vals=[];return data.each(data.dimensions,(function(){for(var argLen=arguments.length,dataIndex=arguments[argLen-1],name=data.getName(dataIndex),i=0;i<argLen-1;i++)vals[i]=arguments[i];lines.push((name?name+"\t":"")+vals.join("\t"))})),lines.join("\n")})).join("\n\n"+BLOCK_SPLITER+"\n\n"))],(function(str){return!!str.replace(/[\n\t\s]/g,"")})).join("\n\n"+BLOCK_SPLITER+"\n\n"),meta:result.meta}}(ecModel);if(isFunction(optionToContent)){var htmlOrDom=optionToContent(api.getOption());isString(htmlOrDom)?viewMain.innerHTML=htmlOrDom:isDom(htmlOrDom)&&viewMain.appendChild(htmlOrDom)}else{textarea.readOnly=model.get("readOnly");var style=textarea.style;style.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",style.color=model.get("textColor"),style.borderColor=model.get("textareaBorderColor"),style.backgroundColor=model.get("textareaColor"),textarea.value=result.value,viewMain.appendChild(textarea)}var blockMetaList=result.meta,buttonContainer=document.createElement("div");buttonContainer.style.cssText="position:absolute;bottom:5px;left:0;right:0";var buttonStyle="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",closeButton=document.createElement("div"),refreshButton=document.createElement("div");buttonStyle+=";background-color:"+model.get("buttonColor"),buttonStyle+=";color:"+model.get("buttonTextColor");var self=this;function close(){container.removeChild(root),self._dom=null}addEventListener(closeButton,"click",close),addEventListener(refreshButton,"click",(function(){if(null==contentToOption&&null!=optionToContent||null!=contentToOption&&null==optionToContent)return"production"!==process.env.NODE_ENV&&warn("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."),void close();var newOption;try{newOption=isFunction(contentToOption)?contentToOption(viewMain,api.getOption()):parseContents(textarea.value,blockMetaList)}catch(e){throw close(),new Error("Data view format error "+e)}newOption&&api.dispatchAction({type:"changeDataView",newOption:newOption}),close()})),closeButton.innerHTML=lang[1],refreshButton.innerHTML=lang[2],refreshButton.style.cssText=closeButton.style.cssText=buttonStyle,!model.get("readOnly")&&buttonContainer.appendChild(refreshButton),buttonContainer.appendChild(closeButton),root.appendChild(header),root.appendChild(viewMain),root.appendChild(buttonContainer),viewMain.style.height=container.clientHeight-80+"px",container.appendChild(root),this._dom=root},DataView.prototype.remove=function(ecModel,api){this._dom&&api.getDom().removeChild(this._dom)},DataView.prototype.dispose=function(ecModel,api){this.remove(ecModel,api)},DataView.getDefaultOption=function(ecModel){return{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:ecModel.getLocaleModel().get(["toolbox","dataView","title"]),lang:ecModel.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},DataView}(ToolboxFeature);function tryMergeDataOption(newData,originalData){return map$1(newData,(function(newVal,idx){var original=originalData&&originalData[idx];if(isObject$3(original)&&!isArray(original)){isObject$3(newVal)&&!isArray(newVal)||(newVal={value:newVal});var shouldDeleteName=null!=original.name&&null==newVal.name;return newVal=defaults(newVal,original),shouldDeleteName&&delete newVal.name,newVal}return newVal}))}registerAction({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(payload,ecModel){var newSeriesOptList=[];each$b(payload.newOption.series,(function(seriesOpt){var seriesModel=ecModel.getSeriesByName(seriesOpt.name)[0];if(seriesModel){var originalData=seriesModel.get("data");newSeriesOptList.push({name:seriesOpt.name,data:tryMergeDataOption(seriesOpt.data,originalData)})}else newSeriesOptList.push(extend({type:"scatter"},seriesOpt))})),ecModel.mergeOption(defaults({series:newSeriesOptList},payload.newOption))}));var DataView$2=DataView$1,each$2=each$b,inner$5=makeInner();function getStoreSnapshots(ecModel){var store=inner$5(ecModel);return store.snapshots||(store.snapshots=[{}]),store.snapshots}var RestoreOption=function(_super){function RestoreOption(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(RestoreOption,_super),RestoreOption.prototype.onclick=function(ecModel,api){!function(ecModel){inner$5(ecModel).snapshots=null}(ecModel),api.dispatchAction({type:"restore",from:this.uid})},RestoreOption.getDefaultOption=function(ecModel){return{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:ecModel.getLocaleModel().get(["toolbox","restore","title"])}},RestoreOption}(ToolboxFeature);registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(payload,ecModel){ecModel.resetOption("recreate")}));var Restore=RestoreOption,INCLUDE_FINDER_MAIN_TYPES=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],BrushTargetManager=function(){function BrushTargetManager(finder,ecModel,opt){var _this=this;this._targetInfoList=[];var foundCpts=parseFinder(ecModel,finder);each$b(targetInfoBuilders,(function(builder,type){(!opt||!opt.include||indexOf(opt.include,type)>=0)&&builder(foundCpts,_this._targetInfoList)}))}return BrushTargetManager.prototype.setOutputRanges=function(areas,ecModel){return this.matchOutputRanges(areas,ecModel,(function(area,coordRange,coordSys){if((area.coordRanges||(area.coordRanges=[])).push(coordRange),!area.coordRange){area.coordRange=coordRange;var result=coordConvert[area.brushType](0,coordSys,coordRange);area.__rangeOffset={offset:diffProcessor[area.brushType](result.values,area.range,[1,1]),xyMinMax:result.xyMinMax}}})),areas},BrushTargetManager.prototype.matchOutputRanges=function(areas,ecModel,cb){each$b(areas,(function(area){var targetInfo=this.findTargetInfo(area,ecModel);targetInfo&&!0!==targetInfo&&each$b(targetInfo.coordSyses,(function(coordSys){var result=coordConvert[area.brushType](1,coordSys,area.range,!0);cb(area,result.values,coordSys,ecModel)}))}),this)},BrushTargetManager.prototype.setInputRanges=function(areas,ecModel){each$b(areas,(function(area){var xyMinMaxCurr,xyMinMaxOrigin,sizeCurr,sizeOrigin,scales,targetInfo=this.findTargetInfo(area,ecModel);if("production"!==process.env.NODE_ENV&&(assert(!targetInfo||!0===targetInfo||area.coordRange,"coordRange must be specified when coord index specified."),assert(!targetInfo||!0!==targetInfo||area.range,"range must be specified in global brush.")),area.range=area.range||[],targetInfo&&!0!==targetInfo){area.panelId=targetInfo.panelId;var result=coordConvert[area.brushType](0,targetInfo.coordSys,area.coordRange),rangeOffset=area.__rangeOffset;area.range=rangeOffset?diffProcessor[area.brushType](result.values,rangeOffset.offset,(xyMinMaxCurr=result.xyMinMax,xyMinMaxOrigin=rangeOffset.xyMinMax,sizeCurr=getSize(xyMinMaxCurr),sizeOrigin=getSize(xyMinMaxOrigin),scales=[sizeCurr[0]/sizeOrigin[0],sizeCurr[1]/sizeOrigin[1]],isNaN(scales[0])&&(scales[0]=1),isNaN(scales[1])&&(scales[1]=1),scales)):result.values}}),this)},BrushTargetManager.prototype.makePanelOpts=function(api,getDefaultBrushType){return map$1(this._targetInfoList,(function(targetInfo){var rect=targetInfo.getPanelRect();return{panelId:targetInfo.panelId,defaultBrushType:getDefaultBrushType?getDefaultBrushType(targetInfo):null,clipPath:makeRectPanelClipPath(rect),isTargetByCursor:makeRectIsTargetByCursor(rect,api,targetInfo.coordSysModel),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(rect)}}))},BrushTargetManager.prototype.controlSeries=function(area,seriesModel,ecModel){var targetInfo=this.findTargetInfo(area,ecModel);return!0===targetInfo||targetInfo&&indexOf(targetInfo.coordSyses,seriesModel.coordinateSystem)>=0},BrushTargetManager.prototype.findTargetInfo=function(area,ecModel){for(var targetInfoList=this._targetInfoList,foundCpts=parseFinder(ecModel,area),i=0;i<targetInfoList.length;i++){var targetInfo=targetInfoList[i],areaPanelId=area.panelId;if(areaPanelId){if(targetInfo.panelId===areaPanelId)return targetInfo}else for(var j=0;j<targetInfoMatchers.length;j++)if(targetInfoMatchers[j](foundCpts,targetInfo))return targetInfo}return!0},BrushTargetManager}();function formatMinMax(minMax){return minMax[0]>minMax[1]&&minMax.reverse(),minMax}function parseFinder(ecModel,finder){return parseFinder$1(ecModel,finder,{includeMainTypes:INCLUDE_FINDER_MAIN_TYPES})}var targetInfoBuilders={grid:function(foundCpts,targetInfoList){var xAxisModels=foundCpts.xAxisModels,yAxisModels=foundCpts.yAxisModels,gridModels=foundCpts.gridModels,gridModelMap=createHashMap(),xAxesHas={},yAxesHas={};(xAxisModels||yAxisModels||gridModels)&&(each$b(xAxisModels,(function(axisModel){var gridModel=axisModel.axis.grid.model;gridModelMap.set(gridModel.id,gridModel),xAxesHas[gridModel.id]=!0})),each$b(yAxisModels,(function(axisModel){var gridModel=axisModel.axis.grid.model;gridModelMap.set(gridModel.id,gridModel),yAxesHas[gridModel.id]=!0})),each$b(gridModels,(function(gridModel){gridModelMap.set(gridModel.id,gridModel),xAxesHas[gridModel.id]=!0,yAxesHas[gridModel.id]=!0})),gridModelMap.each((function(gridModel){var grid=gridModel.coordinateSystem,cartesians=[];each$b(grid.getCartesians(),(function(cartesian,index){(indexOf(xAxisModels,cartesian.getAxis("x").model)>=0||indexOf(yAxisModels,cartesian.getAxis("y").model)>=0)&&cartesians.push(cartesian)})),targetInfoList.push({panelId:"grid--"+gridModel.id,gridModel:gridModel,coordSysModel:gridModel,coordSys:cartesians[0],coordSyses:cartesians,getPanelRect:panelRectBuilders.grid,xAxisDeclared:xAxesHas[gridModel.id],yAxisDeclared:yAxesHas[gridModel.id]})})))},geo:function(foundCpts,targetInfoList){each$b(foundCpts.geoModels,(function(geoModel){var coordSys=geoModel.coordinateSystem;targetInfoList.push({panelId:"geo--"+geoModel.id,geoModel:geoModel,coordSysModel:geoModel,coordSys:coordSys,coordSyses:[coordSys],getPanelRect:panelRectBuilders.geo})}))}},targetInfoMatchers=[function(foundCpts,targetInfo){var xAxisModel=foundCpts.xAxisModel,yAxisModel=foundCpts.yAxisModel,gridModel=foundCpts.gridModel;return!gridModel&&xAxisModel&&(gridModel=xAxisModel.axis.grid.model),!gridModel&&yAxisModel&&(gridModel=yAxisModel.axis.grid.model),gridModel&&gridModel===targetInfo.gridModel},function(foundCpts,targetInfo){var geoModel=foundCpts.geoModel;return geoModel&&geoModel===targetInfo.geoModel}],panelRectBuilders={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var coordSys=this.coordSys,rect=coordSys.getBoundingRect().clone();return rect.applyTransform(getTransform$1(coordSys)),rect}},coordConvert={lineX:curry$1(axisConvert,0),lineY:curry$1(axisConvert,1),rect:function(to,coordSys,rangeOrCoordRange,clamp){var xminymin=to?coordSys.pointToData([rangeOrCoordRange[0][0],rangeOrCoordRange[1][0]],clamp):coordSys.dataToPoint([rangeOrCoordRange[0][0],rangeOrCoordRange[1][0]],clamp),xmaxymax=to?coordSys.pointToData([rangeOrCoordRange[0][1],rangeOrCoordRange[1][1]],clamp):coordSys.dataToPoint([rangeOrCoordRange[0][1],rangeOrCoordRange[1][1]],clamp),values=[formatMinMax([xminymin[0],xmaxymax[0]]),formatMinMax([xminymin[1],xmaxymax[1]])];return{values:values,xyMinMax:values}},polygon:function(to,coordSys,rangeOrCoordRange,clamp){var xyMinMax=[[1/0,-1/0],[1/0,-1/0]];return{values:map$1(rangeOrCoordRange,(function(item){var p=to?coordSys.pointToData(item,clamp):coordSys.dataToPoint(item,clamp);return xyMinMax[0][0]=Math.min(xyMinMax[0][0],p[0]),xyMinMax[1][0]=Math.min(xyMinMax[1][0],p[1]),xyMinMax[0][1]=Math.max(xyMinMax[0][1],p[0]),xyMinMax[1][1]=Math.max(xyMinMax[1][1],p[1]),p})),xyMinMax:xyMinMax}}};function axisConvert(axisNameIndex,to,coordSys,rangeOrCoordRange){"production"!==process.env.NODE_ENV&&assert("cartesian2d"===coordSys.type,"lineX/lineY brush is available only in cartesian2d.");var axis=coordSys.getAxis(["x","y"][axisNameIndex]),values=formatMinMax(map$1([0,1],(function(i){return to?axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]),!0):axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]))}))),xyMinMax=[];return xyMinMax[axisNameIndex]=values,xyMinMax[1-axisNameIndex]=[NaN,NaN],{values:values,xyMinMax:xyMinMax}}var diffProcessor={lineX:curry$1(axisDiffProcessor,0),lineY:curry$1(axisDiffProcessor,1),rect:function(values,refer,scales){return[[values[0][0]-scales[0]*refer[0][0],values[0][1]-scales[0]*refer[0][1]],[values[1][0]-scales[1]*refer[1][0],values[1][1]-scales[1]*refer[1][1]]]},polygon:function(values,refer,scales){return map$1(values,(function(item,idx){return[item[0]-scales[0]*refer[idx][0],item[1]-scales[1]*refer[idx][1]]}))}};function axisDiffProcessor(axisNameIndex,values,refer,scales){return[values[0]-scales[axisNameIndex]*refer[0],values[1]-scales[axisNameIndex]*refer[1]]}function getSize(xyMinMax){return xyMinMax?[xyMinMax[0][1]-xyMinMax[0][0],xyMinMax[1][1]-xyMinMax[1][0]]:[NaN,NaN]}var mainType,creator,BrushTargetManager$1=BrushTargetManager,each$1=each$b,DATA_ZOOM_ID_BASE="\0_ec_\0"+"toolbox-dataZoom_",DataZoomFeature=function(_super){function DataZoomFeature(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DataZoomFeature,_super),DataZoomFeature.prototype.render=function(featureModel,ecModel,api,payload){this._brushController||(this._brushController=new BrushController$1(api.getZr()),this._brushController.on("brush",bind$1(this._onBrush,this)).mount()),function(featureModel,ecModel,view,payload,api){var zoomActive=view._isZoomActive;payload&&"takeGlobalCursor"===payload.type&&(zoomActive="dataZoomSelect"===payload.key&&payload.dataZoomSelectActive);view._isZoomActive=zoomActive,featureModel.setIconStatus("zoom",zoomActive?"emphasis":"normal");var brushTargetManager=new BrushTargetManager$1(makeAxisFinder(featureModel),ecModel,{include:["grid"]}),panels=brushTargetManager.makePanelOpts(api,(function(targetInfo){return targetInfo.xAxisDeclared&&!targetInfo.yAxisDeclared?"lineX":!targetInfo.xAxisDeclared&&targetInfo.yAxisDeclared?"lineY":"rect"}));view._brushController.setPanels(panels).enableBrush(!(!zoomActive||!panels.length)&&{brushType:"auto",brushStyle:featureModel.getModel("brushStyle").getItemStyle()})}(featureModel,ecModel,this,payload,api),function(featureModel,ecModel){featureModel.setIconStatus("back",function(ecModel){return getStoreSnapshots(ecModel).length}(ecModel)>1?"emphasis":"normal")}(featureModel,ecModel)},DataZoomFeature.prototype.onclick=function(ecModel,api,type){handlers[type].call(this)},DataZoomFeature.prototype.remove=function(ecModel,api){this._brushController&&this._brushController.unmount()},DataZoomFeature.prototype.dispose=function(ecModel,api){this._brushController&&this._brushController.dispose()},DataZoomFeature.prototype._onBrush=function(eventParam){var areas=eventParam.areas;if(eventParam.isEnd&&areas.length){var snapshot={},ecModel=this.ecModel;this._brushController.updateCovers([]),new BrushTargetManager$1(makeAxisFinder(this.model),ecModel,{include:["grid"]}).matchOutputRanges(areas,ecModel,(function(area,coordRange,coordSys){if("cartesian2d"===coordSys.type){var brushType=area.brushType;"rect"===brushType?(setBatch("x",coordSys,coordRange[0]),setBatch("y",coordSys,coordRange[1])):setBatch({lineX:"x",lineY:"y"}[brushType],coordSys,coordRange)}})),function(ecModel,newSnapshot){var storedSnapshots=getStoreSnapshots(ecModel);each$2(newSnapshot,(function(batchItem,dataZoomId){for(var i=storedSnapshots.length-1;i>=0&&!storedSnapshots[i][dataZoomId];i--);if(i<0){var dataZoomModel=ecModel.queryComponents({mainType:"dataZoom",subType:"select",id:dataZoomId})[0];if(dataZoomModel){var percentRange=dataZoomModel.getPercentRange();storedSnapshots[0][dataZoomId]={dataZoomId:dataZoomId,start:percentRange[0],end:percentRange[1]}}}})),storedSnapshots.push(newSnapshot)}(ecModel,snapshot),this._dispatchZoomAction(snapshot)}function setBatch(dimName,coordSys,minMax){var axis=coordSys.getAxis(dimName),axisModel=axis.model,dataZoomModel=function(dimName,axisModel,ecModel){var found;return ecModel.eachComponent({mainType:"dataZoom",subType:"select"},(function(dzModel){dzModel.getAxisModel(dimName,axisModel.componentIndex)&&(found=dzModel)})),found}(dimName,axisModel,ecModel),minMaxSpan=dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();null==minMaxSpan.minValueSpan&&null==minMaxSpan.maxValueSpan||(minMax=sliderMove(0,minMax.slice(),axis.scale.getExtent(),0,minMaxSpan.minValueSpan,minMaxSpan.maxValueSpan)),dataZoomModel&&(snapshot[dataZoomModel.id]={dataZoomId:dataZoomModel.id,startValue:minMax[0],endValue:minMax[1]})}},DataZoomFeature.prototype._dispatchZoomAction=function(snapshot){var batch=[];each$1(snapshot,(function(batchItem,dataZoomId){batch.push(clone$3(batchItem))})),batch.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:batch})},DataZoomFeature.getDefaultOption=function(ecModel){return{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:ecModel.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},DataZoomFeature}(ToolboxFeature),handlers={zoom:function(){var nextActive=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:nextActive})},back:function(){this._dispatchZoomAction(function(ecModel){var storedSnapshots=getStoreSnapshots(ecModel),head=storedSnapshots[storedSnapshots.length-1];storedSnapshots.length>1&&storedSnapshots.pop();var snapshot={};return each$2(head,(function(batchItem,dataZoomId){for(var i=storedSnapshots.length-1;i>=0;i--)if(batchItem=storedSnapshots[i][dataZoomId]){snapshot[dataZoomId]=batchItem;break}})),snapshot}(this.ecModel))}};function makeAxisFinder(dzFeatureModel){var setting={xAxisIndex:dzFeatureModel.get("xAxisIndex",!0),yAxisIndex:dzFeatureModel.get("yAxisIndex",!0),xAxisId:dzFeatureModel.get("xAxisId",!0),yAxisId:dzFeatureModel.get("yAxisId",!0)};return null==setting.xAxisIndex&&null==setting.xAxisId&&(setting.xAxisIndex="all"),null==setting.yAxisIndex&&null==setting.yAxisId&&(setting.yAxisIndex="all"),setting}mainType="dataZoom",creator=function(ecModel){var toolboxModel=ecModel.getComponent("toolbox",0),featureDataZoomPath=["feature","dataZoom"];if(toolboxModel&&null!=toolboxModel.get(featureDataZoomPath)){var dzFeatureModel=toolboxModel.getModel(featureDataZoomPath),dzOptions=[],finderResult=parseFinder$1(ecModel,makeAxisFinder(dzFeatureModel));return each$1(finderResult.xAxisModels,(function(axisModel){return buildInternalOptions(axisModel,"xAxis","xAxisIndex")})),each$1(finderResult.yAxisModels,(function(axisModel){return buildInternalOptions(axisModel,"yAxis","yAxisIndex")})),dzOptions}function buildInternalOptions(axisModel,axisMainType,axisIndexPropName){var axisIndex=axisModel.componentIndex,newOpt={type:"select",$fromToolbox:!0,filterMode:dzFeatureModel.get("filterMode",!0)||"filter",id:DATA_ZOOM_ID_BASE+axisMainType+axisIndex};newOpt[axisIndexPropName]=axisIndex,dzOptions.push(newOpt)}},assert(null==internalOptionCreatorMap.get(mainType)&&creator),internalOptionCreatorMap.set(mainType,creator);var DataZoom=DataZoomFeature;function install$c(registers){registers.registerComponentModel(ToolboxModel$1),registers.registerComponentView(ToolboxView$1),registerFeature("saveAsImage",SaveAsImage$1),registerFeature("magicType",MagicType$1),registerFeature("dataView",DataView$2),registerFeature("dataZoom",DataZoom),registerFeature("restore",Restore),use(install$d)}var TooltipModel$1=function(_super){function TooltipModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=TooltipModel.type,_this}return __extends(TooltipModel,_super),TooltipModel.type="tooltip",TooltipModel.dependencies=["axisPointer"],TooltipModel.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}},TooltipModel}(ComponentModel$1);function shouldTooltipConfine(tooltipModel){var confineOption=tooltipModel.get("confine");return null!=confineOption?!!confineOption:"richText"===tooltipModel.get("renderMode")}function testStyle(styleProps){if(env$1.domSupported)for(var style=document.documentElement.style,i=0,len=styleProps.length;i<len;i++)if(styleProps[i]in style)return styleProps[i]}var TRANSFORM_VENDOR=testStyle(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function toCSSVendorPrefix(styleVendor,styleProp){if(!styleVendor)return styleProp;styleProp=toCamelCase(styleProp,!0);var idx=styleVendor.indexOf(styleProp);return(styleVendor=-1===idx?styleProp:"-"+styleVendor.slice(0,idx)+"-"+styleProp).toLowerCase()}var CSS_TRANSITION_VENDOR=toCSSVendorPrefix(testStyle(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),CSS_TRANSFORM_VENDOR=toCSSVendorPrefix(TRANSFORM_VENDOR,"transform"),gCssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(env$1.transform3dSupported?"will-change:transform;":"");function assembleTransform(x,y,toString){var x0=x.toFixed(0)+"px",y0=y.toFixed(0)+"px";if(!env$1.transformSupported)return toString?"top:"+y0+";left:"+x0+";":[["top",y0],["left",x0]];var is3d=env$1.transform3dSupported,translate="translate"+(is3d?"3d":"")+"("+x0+","+y0+(is3d?",0":"")+")";return toString?"top:0;left:0;"+CSS_TRANSFORM_VENDOR+":"+translate+";":[["top",0],["left",0],[TRANSFORM_VENDOR,translate]]}function assembleCssText(tooltipModel,enableTransition,onlyFade){var cssText=[],transitionDuration=tooltipModel.get("transitionDuration"),backgroundColor=tooltipModel.get("backgroundColor"),shadowBlur=tooltipModel.get("shadowBlur"),shadowColor=tooltipModel.get("shadowColor"),shadowOffsetX=tooltipModel.get("shadowOffsetX"),shadowOffsetY=tooltipModel.get("shadowOffsetY"),textStyleModel=tooltipModel.getModel("textStyle"),padding=getPaddingFromTooltipModel(tooltipModel,"html"),boxShadow=shadowOffsetX+"px "+shadowOffsetY+"px "+shadowBlur+"px "+shadowColor;return cssText.push("box-shadow:"+boxShadow),enableTransition&&transitionDuration&&cssText.push(function(duration,onlyFade){var transitionOption=" "+duration/2+"s cubic-bezier(0.23,1,0.32,1)",transitionText="opacity"+transitionOption+",visibility"+transitionOption;return onlyFade||(transitionOption=" "+duration+"s cubic-bezier(0.23,1,0.32,1)",transitionText+=env$1.transformSupported?","+CSS_TRANSFORM_VENDOR+transitionOption:",left"+transitionOption+",top"+transitionOption),CSS_TRANSITION_VENDOR+":"+transitionText}(transitionDuration,onlyFade)),backgroundColor&&cssText.push("background-color:"+backgroundColor),each$b(["width","color","radius"],(function(name){var borderName="border-"+name,camelCase=toCamelCase(borderName),val=tooltipModel.get(camelCase);null!=val&&cssText.push(borderName+":"+val+("color"===name?"":"px"))})),cssText.push(function(textStyleModel){var cssText=[],fontSize=textStyleModel.get("fontSize"),color=textStyleModel.getTextColor();color&&cssText.push("color:"+color),cssText.push("font:"+textStyleModel.getFont());var lineHeight=retrieve2(textStyleModel.get("lineHeight"),Math.round(3*fontSize/2));fontSize&&cssText.push("line-height:"+lineHeight+"px");var shadowColor=textStyleModel.get("textShadowColor"),shadowBlur=textStyleModel.get("textShadowBlur")||0,shadowOffsetX=textStyleModel.get("textShadowOffsetX")||0,shadowOffsetY=textStyleModel.get("textShadowOffsetY")||0;return shadowColor&&shadowBlur&&cssText.push("text-shadow:"+shadowOffsetX+"px "+shadowOffsetY+"px "+shadowBlur+"px "+shadowColor),each$b(["decoration","align"],(function(name){var val=textStyleModel.get(name);val&&cssText.push("text-"+name+":"+val)})),cssText.join(";")}(textStyleModel)),null!=padding&&cssText.push("padding:"+normalizeCssArray(padding).join("px ")+"px"),cssText.join(";")+";"}function makeStyleCoord$1(out,zr,container,zrX,zrY){var zrPainter=zr&&zr.painter;if(container){var zrViewportRoot=zrPainter&&zrPainter.getViewportRoot();zrViewportRoot&&function(out,elFrom,elTarget,inX,inY){transformCoordWithViewport(_calcOut$1,elFrom,inX,inY,!0)&&transformCoordWithViewport(out,elTarget,_calcOut$1[0],_calcOut$1[1])}(out,zrViewportRoot,container,zrX,zrY)}else{out[0]=zrX,out[1]=zrY;var viewportRootOffset=zrPainter&&zrPainter.getViewportRootOffset();viewportRootOffset&&(out[0]+=viewportRootOffset.offsetLeft,out[1]+=viewportRootOffset.offsetTop)}out[2]=out[0]/zr.getWidth(),out[3]=out[1]/zr.getHeight()}var TooltipHTMLContent=function(){function TooltipHTMLContent(api,opt){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,env$1.wxa)return null;var el=document.createElement("div");el.domBelongToZr=!0,this.el=el;var zr=this._zr=api.getZr(),appendTo=opt.appendTo,container=appendTo&&(isString(appendTo)?document.querySelector(appendTo):isDom(appendTo)?appendTo:isFunction(appendTo)&&appendTo(api.getDom()));makeStyleCoord$1(this._styleCoord,zr,container,api.getWidth()/2,api.getHeight()/2),(container||api.getDom()).appendChild(el),this._api=api,this._container=container;var self=this;el.onmouseenter=function(){self._enterable&&(clearTimeout(self._hideTimeout),self._show=!0),self._inContent=!0},el.onmousemove=function(e){if(e=e||window.event,!self._enterable){var handler=zr.handler;normalizeEvent(zr.painter.getViewportRoot(),e,!0),handler.dispatch("mousemove",e)}},el.onmouseleave=function(){self._inContent=!1,self._enterable&&self._show&&self.hideLater(self._hideDelay)}}return TooltipHTMLContent.prototype.update=function(tooltipModel){if(!this._container){var container=this._api.getDom(),position=function(el,style){var stl=el.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(el);return stl?style?stl[style]:stl:null}(container,"position"),domStyle=container.style;"absolute"!==domStyle.position&&"absolute"!==position&&(domStyle.position="relative")}var alwaysShowContent=tooltipModel.get("alwaysShowContent");alwaysShowContent&&this._moveIfResized(),this._alwaysShowContent=alwaysShowContent,this.el.className=tooltipModel.get("className")||""},TooltipHTMLContent.prototype.show=function(tooltipModel,nearPointColor){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var el=this.el,style=el.style,styleCoord=this._styleCoord;el.innerHTML?style.cssText=gCssText+assembleCssText(tooltipModel,!this._firstShow,this._longHide)+assembleTransform(styleCoord[0],styleCoord[1],!0)+"border-color:"+convertToColorString(nearPointColor)+";"+(tooltipModel.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):style.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},TooltipHTMLContent.prototype.setContent=function(content,markers,tooltipModel,borderColor,arrowPosition){var el=this.el;if(null!=content){var arrow="";if(isString(arrowPosition)&&"item"===tooltipModel.get("trigger")&&!shouldTooltipConfine(tooltipModel)&&(arrow=function(tooltipModel,borderColor,arrowPosition){if(!isString(arrowPosition)||"inside"===arrowPosition)return"";var backgroundColor=tooltipModel.get("backgroundColor"),borderWidth=tooltipModel.get("borderWidth");borderColor=convertToColorString(borderColor);var pos,rotateDeg,arrowPos="left"===(pos=arrowPosition)?"right":"right"===pos?"left":"top"===pos?"bottom":"top",arrowSize=Math.max(1.5*Math.round(borderWidth),6),positionStyle="",transformStyle=CSS_TRANSFORM_VENDOR+":";indexOf(["left","right"],arrowPos)>-1?(positionStyle+="top:50%",transformStyle+="translateY(-50%) rotate("+(rotateDeg="left"===arrowPos?-225:-45)+"deg)"):(positionStyle+="left:50%",transformStyle+="translateX(-50%) rotate("+(rotateDeg="top"===arrowPos?225:45)+"deg)");var rotateRadian=rotateDeg*Math.PI/180,arrowWH=arrowSize+borderWidth,rotatedWH=arrowWH*Math.abs(Math.cos(rotateRadian))+arrowWH*Math.abs(Math.sin(rotateRadian)),borderStyle=borderColor+" solid "+borderWidth+"px;";return'<div style="'+["position:absolute;width:"+arrowSize+"px;height:"+arrowSize+"px;z-index:-1;",(positionStyle+=";"+arrowPos+":-"+Math.round(100*((rotatedWH-Math.SQRT2*borderWidth)/2+Math.SQRT2*borderWidth-(rotatedWH-arrowWH)/2))/100+"px")+";"+transformStyle+";","border-bottom:"+borderStyle,"border-right:"+borderStyle,"background-color:"+backgroundColor+";"].join("")+'"></div>'}(tooltipModel,borderColor,arrowPosition)),isString(content))el.innerHTML=content+arrow;else if(content){el.innerHTML="",isArray(content)||(content=[content]);for(var i=0;i<content.length;i++)isDom(content[i])&&content[i].parentNode!==el&&el.appendChild(content[i]);if(arrow&&el.childNodes.length){var arrowEl=document.createElement("div");arrowEl.innerHTML=arrow,el.appendChild(arrowEl)}}}else el.innerHTML=""},TooltipHTMLContent.prototype.setEnterable=function(enterable){this._enterable=enterable},TooltipHTMLContent.prototype.getSize=function(){var el=this.el;return el?[el.offsetWidth,el.offsetHeight]:[0,0]},TooltipHTMLContent.prototype.moveTo=function(zrX,zrY){if(this.el){var styleCoord=this._styleCoord;if(makeStyleCoord$1(styleCoord,this._zr,this._container,zrX,zrY),null!=styleCoord[0]&&null!=styleCoord[1]){var style_1=this.el.style;each$b(assembleTransform(styleCoord[0],styleCoord[1]),(function(transform){style_1[transform[0]]=transform[1]}))}}},TooltipHTMLContent.prototype._moveIfResized=function(){var ratioX=this._styleCoord[2],ratioY=this._styleCoord[3];this.moveTo(ratioX*this._zr.getWidth(),ratioY*this._zr.getHeight())},TooltipHTMLContent.prototype.hide=function(){var _this=this,style=this.el.style;style.visibility="hidden",style.opacity="0",env$1.transform3dSupported&&(style.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return _this._longHide=!0}),500)},TooltipHTMLContent.prototype.hideLater=function(time){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(time?(this._hideDelay=time,this._show=!1,this._hideTimeout=setTimeout(bind$1(this.hide,this),time)):this.hide())},TooltipHTMLContent.prototype.isShow=function(){return this._show},TooltipHTMLContent.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var parentNode=this.el.parentNode;parentNode&&parentNode.removeChild(this.el),this.el=this._container=null},TooltipHTMLContent}(),TooltipHTMLContent$1=TooltipHTMLContent,TooltipRichContent=function(){function TooltipRichContent(api){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=api.getZr(),makeStyleCoord(this._styleCoord,this._zr,api.getWidth()/2,api.getHeight()/2)}return TooltipRichContent.prototype.update=function(tooltipModel){var alwaysShowContent=tooltipModel.get("alwaysShowContent");alwaysShowContent&&this._moveIfResized(),this._alwaysShowContent=alwaysShowContent},TooltipRichContent.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},TooltipRichContent.prototype.setContent=function(content,markupStyleCreator,tooltipModel,borderColor,arrowPosition){var _this=this;isObject$3(content)&&throwError("production"!==process.env.NODE_ENV?"Passing DOM nodes as content is not supported in richText tooltip!":""),this.el&&this._zr.remove(this.el);var textStyleModel=tooltipModel.getModel("textStyle");this.el=new ZRText$1({style:{rich:markupStyleCreator.richTextStyles,text:content,lineHeight:22,borderWidth:1,borderColor:borderColor,textShadowColor:textStyleModel.get("textShadowColor"),fill:tooltipModel.get(["textStyle","color"]),padding:getPaddingFromTooltipModel(tooltipModel,"richText"),verticalAlign:"top",align:"left"},z:tooltipModel.get("z")}),each$b(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(propName){_this.el.style[propName]=tooltipModel.get(propName)})),each$b(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(propName){_this.el.style[propName]=textStyleModel.get(propName)||0})),this._zr.add(this.el);var self=this;this.el.on("mouseover",(function(){self._enterable&&(clearTimeout(self._hideTimeout),self._show=!0),self._inContent=!0})),this.el.on("mouseout",(function(){self._enterable&&self._show&&self.hideLater(self._hideDelay),self._inContent=!1}))},TooltipRichContent.prototype.setEnterable=function(enterable){this._enterable=enterable},TooltipRichContent.prototype.getSize=function(){var el=this.el,bounding=this.el.getBoundingRect(),shadowOuterSize=calcShadowOuterSize(el.style);return[bounding.width+shadowOuterSize.left+shadowOuterSize.right,bounding.height+shadowOuterSize.top+shadowOuterSize.bottom]},TooltipRichContent.prototype.moveTo=function(x,y){var el=this.el;if(el){var styleCoord=this._styleCoord;makeStyleCoord(styleCoord,this._zr,x,y),x=styleCoord[0],y=styleCoord[1];var style=el.style,borderWidth=mathMaxWith0(style.borderWidth||0),shadowOuterSize=calcShadowOuterSize(style);el.x=x+borderWidth+shadowOuterSize.left,el.y=y+borderWidth+shadowOuterSize.top,el.markRedraw()}},TooltipRichContent.prototype._moveIfResized=function(){var ratioX=this._styleCoord[2],ratioY=this._styleCoord[3];this.moveTo(ratioX*this._zr.getWidth(),ratioY*this._zr.getHeight())},TooltipRichContent.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},TooltipRichContent.prototype.hideLater=function(time){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(time?(this._hideDelay=time,this._show=!1,this._hideTimeout=setTimeout(bind$1(this.hide,this),time)):this.hide())},TooltipRichContent.prototype.isShow=function(){return this._show},TooltipRichContent.prototype.dispose=function(){this._zr.remove(this.el)},TooltipRichContent}();function mathMaxWith0(val){return Math.max(0,val)}function calcShadowOuterSize(style){var shadowBlur=mathMaxWith0(style.shadowBlur||0),shadowOffsetX=mathMaxWith0(style.shadowOffsetX||0),shadowOffsetY=mathMaxWith0(style.shadowOffsetY||0);return{left:mathMaxWith0(shadowBlur-shadowOffsetX),right:mathMaxWith0(shadowBlur+shadowOffsetX),top:mathMaxWith0(shadowBlur-shadowOffsetY),bottom:mathMaxWith0(shadowBlur+shadowOffsetY)}}function makeStyleCoord(out,zr,zrX,zrY){out[0]=zrX,out[1]=zrY,out[2]=out[0]/zr.getWidth(),out[3]=out[1]/zr.getHeight()}var TooltipRichContent$1=TooltipRichContent,proxyRect=new Rect$4({shape:{x:-1,y:-1,width:2,height:2}}),TooltipView=function(_super){function TooltipView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=TooltipView.type,_this}return __extends(TooltipView,_super),TooltipView.prototype.init=function(ecModel,api){if(!env$1.node&&api.getDom()){var renderModeOption,tooltipModel=ecModel.getComponent("tooltip"),renderMode=this._renderMode="auto"===(renderModeOption=tooltipModel.get("renderMode"))?env$1.domSupported?"html":"richText":renderModeOption||"html";this._tooltipContent="richText"===renderMode?new TooltipRichContent$1(api):new TooltipHTMLContent$1(api,{appendTo:tooltipModel.get("appendToBody",!0)?"body":tooltipModel.get("appendTo",!0)})}},TooltipView.prototype.render=function(tooltipModel,ecModel,api){if(!env$1.node&&api.getDom()){this.group.removeAll(),this._tooltipModel=tooltipModel,this._ecModel=ecModel,this._api=api;var tooltipContent=this._tooltipContent;tooltipContent.update(tooltipModel),tooltipContent.setEnterable(tooltipModel.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&tooltipModel.get("transitionDuration")?createOrUpdate(this,"_updatePosition",50,"fixRate"):clear$1(this,"_updatePosition")}},TooltipView.prototype._initGlobalListener=function(){var triggerOn=this._tooltipModel.get("triggerOn");register("itemTooltip",this._api,bind$1((function(currTrigger,e,dispatchAction){"none"!==triggerOn&&(triggerOn.indexOf(currTrigger)>=0?this._tryShow(e,dispatchAction):"leave"===currTrigger&&this._hide(dispatchAction))}),this))},TooltipView.prototype._keepShow=function(){var tooltipModel=this._tooltipModel,ecModel=this._ecModel,api=this._api,triggerOn=tooltipModel.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==triggerOn&&"click"!==triggerOn){var self_1=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!api.isDisposed()&&self_1.manuallyShowTip(tooltipModel,ecModel,api,{x:self_1._lastX,y:self_1._lastY,dataByCoordSys:self_1._lastDataByCoordSys})}))}},TooltipView.prototype.manuallyShowTip=function(tooltipModel,ecModel,api,payload){if(payload.from!==this.uid&&!env$1.node&&api.getDom()){var dispatchAction=makeDispatchAction(payload,api);this._ticket="";var dataByCoordSys=payload.dataByCoordSys,cmptRef=function(payload,ecModel,api){var queryOptionMap=preParseFinder(payload).queryOptionMap,componentMainType=queryOptionMap.keys()[0];if(!componentMainType||"series"===componentMainType)return;var queryResult=queryReferringComponents(ecModel,componentMainType,queryOptionMap.get(componentMainType),{useDefault:!1,enableAll:!1,enableNone:!1}),model=queryResult.models[0];if(!model)return;var el,view=api.getViewOfComponentModel(model);if(view.group.traverse((function(subEl){var tooltipConfig=getECData(subEl).tooltipConfig;if(tooltipConfig&&tooltipConfig.name===payload.name)return el=subEl,!0})),el)return{componentMainType:componentMainType,componentIndex:model.componentIndex,el:el}}(payload,ecModel,api);if(cmptRef){var rect=cmptRef.el.getBoundingRect().clone();rect.applyTransform(cmptRef.el.transform),this._tryShow({offsetX:rect.x+rect.width/2,offsetY:rect.y+rect.height/2,target:cmptRef.el,position:payload.position,positionDefault:"bottom"},dispatchAction)}else if(payload.tooltip&&null!=payload.x&&null!=payload.y){var el=proxyRect;el.x=payload.x,el.y=payload.y,el.update(),getECData(el).tooltipConfig={name:null,option:payload.tooltip},this._tryShow({offsetX:payload.x,offsetY:payload.y,target:el},dispatchAction)}else if(dataByCoordSys)this._tryShow({offsetX:payload.x,offsetY:payload.y,position:payload.position,dataByCoordSys:dataByCoordSys,tooltipOption:payload.tooltipOption},dispatchAction);else if(null!=payload.seriesIndex){if(this._manuallyAxisShowTip(tooltipModel,ecModel,api,payload))return;var pointInfo=findPointFromSeries(payload,ecModel),cx=pointInfo.point[0],cy=pointInfo.point[1];null!=cx&&null!=cy&&this._tryShow({offsetX:cx,offsetY:cy,target:pointInfo.el,position:payload.position,positionDefault:"bottom"},dispatchAction)}else null!=payload.x&&null!=payload.y&&(api.dispatchAction({type:"updateAxisPointer",x:payload.x,y:payload.y}),this._tryShow({offsetX:payload.x,offsetY:payload.y,position:payload.position,target:api.getZr().findHover(payload.x,payload.y).target},dispatchAction))}},TooltipView.prototype.manuallyHideTip=function(tooltipModel,ecModel,api,payload){var tooltipContent=this._tooltipContent;this._tooltipModel&&tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,payload.from!==this.uid&&this._hide(makeDispatchAction(payload,api))},TooltipView.prototype._manuallyAxisShowTip=function(tooltipModel,ecModel,api,payload){var seriesIndex=payload.seriesIndex,dataIndex=payload.dataIndex,coordSysAxesInfo=ecModel.getComponent("axisPointer").coordSysAxesInfo;if(null!=seriesIndex&&null!=dataIndex&&null!=coordSysAxesInfo){var seriesModel=ecModel.getSeriesByIndex(seriesIndex);if(seriesModel)if("axis"===buildTooltipModel([seriesModel.getData().getItemModel(dataIndex),seriesModel,(seriesModel.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return api.dispatchAction({type:"updateAxisPointer",seriesIndex:seriesIndex,dataIndex:dataIndex,position:payload.position}),!0}},TooltipView.prototype._tryShow=function(e,dispatchAction){var el=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var dataByCoordSys=e.dataByCoordSys;if(dataByCoordSys&&dataByCoordSys.length)this._showAxisTooltip(dataByCoordSys,e);else if(el){var seriesDispatcher_1,cmptDispatcher_1;if("legend"===getECData(el).ssrType)return;this._lastDataByCoordSys=null,findEventDispatcher(el,(function(target){return null!=getECData(target).dataIndex?(seriesDispatcher_1=target,!0):null!=getECData(target).tooltipConfig?(cmptDispatcher_1=target,!0):void 0}),!0),seriesDispatcher_1?this._showSeriesItemTooltip(e,seriesDispatcher_1,dispatchAction):cmptDispatcher_1?this._showComponentItemTooltip(e,cmptDispatcher_1,dispatchAction):this._hide(dispatchAction)}else this._lastDataByCoordSys=null,this._hide(dispatchAction)}},TooltipView.prototype._showOrMove=function(tooltipModel,cb){var delay=tooltipModel.get("showDelay");cb=bind$1(cb,this),clearTimeout(this._showTimout),delay>0?this._showTimout=setTimeout(cb,delay):cb()},TooltipView.prototype._showAxisTooltip=function(dataByCoordSys,e){var ecModel=this._ecModel,globalTooltipModel=this._tooltipModel,point=[e.offsetX,e.offsetY],singleTooltipModel=buildTooltipModel([e.tooltipOption],globalTooltipModel),renderMode=this._renderMode,cbParamsList=[],articleMarkup=createTooltipMarkup("section",{blocks:[],noHeader:!0}),markupTextArrLegacy=[],markupStyleCreator=new TooltipMarkupStyleCreator;each$b(dataByCoordSys,(function(itemCoordSys){each$b(itemCoordSys.dataByAxis,(function(axisItem){var axisModel=ecModel.getComponent(axisItem.axisDim+"Axis",axisItem.axisIndex),axisValue=axisItem.value;if(axisModel&&null!=axisValue){var axisValueLabel=getValueLabel(axisValue,axisModel.axis,ecModel,axisItem.seriesDataIndices,axisItem.valueLabelOpt),axisSectionMarkup=createTooltipMarkup("section",{header:axisValueLabel,noHeader:!trim$1(axisValueLabel),sortBlocks:!0,blocks:[]});articleMarkup.blocks.push(axisSectionMarkup),each$b(axisItem.seriesDataIndices,(function(idxItem){var series=ecModel.getSeriesByIndex(idxItem.seriesIndex),dataIndex=idxItem.dataIndexInside,cbParams=series.getDataParams(dataIndex);if(!(cbParams.dataIndex<0)){cbParams.axisDim=axisItem.axisDim,cbParams.axisIndex=axisItem.axisIndex,cbParams.axisType=axisItem.axisType,cbParams.axisId=axisItem.axisId,cbParams.axisValue=getAxisRawValue(axisModel.axis,{value:axisValue}),cbParams.axisValueLabel=axisValueLabel,cbParams.marker=markupStyleCreator.makeTooltipMarker("item",convertToColorString(cbParams.color),renderMode);var seriesTooltipResult=normalizeTooltipFormatResult(series.formatTooltip(dataIndex,!0,null)),frag=seriesTooltipResult.frag;if(frag){var valueFormatter=buildTooltipModel([series],globalTooltipModel).get("valueFormatter");axisSectionMarkup.blocks.push(valueFormatter?extend({valueFormatter:valueFormatter},frag):frag)}seriesTooltipResult.text&&markupTextArrLegacy.push(seriesTooltipResult.text),cbParamsList.push(cbParams)}}))}}))})),articleMarkup.blocks.reverse(),markupTextArrLegacy.reverse();var positionExpr=e.position,orderMode=singleTooltipModel.get("order"),builtMarkupText=buildTooltipMarkup(articleMarkup,markupStyleCreator,renderMode,orderMode,ecModel.get("useUTC"),singleTooltipModel.get("textStyle"));builtMarkupText&&markupTextArrLegacy.unshift(builtMarkupText);var blockBreak="richText"===renderMode?"\n\n":"<br/>",allMarkupText=markupTextArrLegacy.join(blockBreak);this._showOrMove(singleTooltipModel,(function(){this._updateContentNotChangedOnAxis(dataByCoordSys,cbParamsList)?this._updatePosition(singleTooltipModel,positionExpr,point[0],point[1],this._tooltipContent,cbParamsList):this._showTooltipContent(singleTooltipModel,allMarkupText,cbParamsList,Math.random()+"",point[0],point[1],positionExpr,null,markupStyleCreator)}))},TooltipView.prototype._showSeriesItemTooltip=function(e,dispatcher,dispatchAction){var ecModel=this._ecModel,ecData=getECData(dispatcher),seriesIndex=ecData.seriesIndex,seriesModel=ecModel.getSeriesByIndex(seriesIndex),dataModel=ecData.dataModel||seriesModel,dataIndex=ecData.dataIndex,dataType=ecData.dataType,data=dataModel.getData(dataType),renderMode=this._renderMode,positionDefault=e.positionDefault,tooltipModel=buildTooltipModel([data.getItemModel(dataIndex),dataModel,seriesModel&&(seriesModel.coordinateSystem||{}).model],this._tooltipModel,positionDefault?{position:positionDefault}:null),tooltipTrigger=tooltipModel.get("trigger");if(null==tooltipTrigger||"item"===tooltipTrigger){var params=dataModel.getDataParams(dataIndex,dataType),markupStyleCreator=new TooltipMarkupStyleCreator;params.marker=markupStyleCreator.makeTooltipMarker("item",convertToColorString(params.color),renderMode);var seriesTooltipResult=normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex,!1,dataType)),orderMode=tooltipModel.get("order"),valueFormatter=tooltipModel.get("valueFormatter"),frag=seriesTooltipResult.frag,markupText=frag?buildTooltipMarkup(valueFormatter?extend({valueFormatter:valueFormatter},frag):frag,markupStyleCreator,renderMode,orderMode,ecModel.get("useUTC"),tooltipModel.get("textStyle")):seriesTooltipResult.text,asyncTicket="item_"+dataModel.name+"_"+dataIndex;this._showOrMove(tooltipModel,(function(){this._showTooltipContent(tooltipModel,markupText,params,asyncTicket,e.offsetX,e.offsetY,e.position,e.target,markupStyleCreator)})),dispatchAction({type:"showTip",dataIndexInside:dataIndex,dataIndex:data.getRawIndex(dataIndex),seriesIndex:seriesIndex,from:this.uid})}},TooltipView.prototype._showComponentItemTooltip=function(e,el,dispatchAction){var isHTMLRenderMode="html"===this._renderMode,ecData=getECData(el),tooltipOpt=ecData.tooltipConfig.option||{},encodeHTMLContent=tooltipOpt.encodeHTMLContent;if(isString(tooltipOpt)){tooltipOpt={content:tooltipOpt,formatter:tooltipOpt},encodeHTMLContent=!0}encodeHTMLContent&&isHTMLRenderMode&&tooltipOpt.content&&((tooltipOpt=clone$3(tooltipOpt)).content=encodeHTML(tooltipOpt.content));var tooltipModelCascade=[tooltipOpt],cmpt=this._ecModel.getComponent(ecData.componentMainType,ecData.componentIndex);cmpt&&tooltipModelCascade.push(cmpt),tooltipModelCascade.push({formatter:tooltipOpt.content});var positionDefault=e.positionDefault,subTooltipModel=buildTooltipModel(tooltipModelCascade,this._tooltipModel,positionDefault?{position:positionDefault}:null),defaultHtml=subTooltipModel.get("content"),asyncTicket=Math.random()+"",markupStyleCreator=new TooltipMarkupStyleCreator;this._showOrMove(subTooltipModel,(function(){var formatterParams=clone$3(subTooltipModel.get("formatterParams")||{});this._showTooltipContent(subTooltipModel,defaultHtml,formatterParams,asyncTicket,e.offsetX,e.offsetY,e.position,el,markupStyleCreator)})),dispatchAction({type:"showTip",from:this.uid})},TooltipView.prototype._showTooltipContent=function(tooltipModel,defaultHtml,params,asyncTicket,x,y,positionExpr,el,markupStyleCreator){if(this._ticket="",tooltipModel.get("showContent")&&tooltipModel.get("show")){var tooltipContent=this._tooltipContent;tooltipContent.setEnterable(tooltipModel.get("enterable"));var formatter=tooltipModel.get("formatter");positionExpr=positionExpr||tooltipModel.get("position");var html=defaultHtml,nearPointColor=this._getNearestPoint([x,y],params,tooltipModel.get("trigger"),tooltipModel.get("borderColor")).color;if(formatter)if(isString(formatter)){var useUTC=tooltipModel.ecModel.get("useUTC"),params0=isArray(params)?params[0]:params;html=formatter,params0&&params0.axisType&&params0.axisType.indexOf("time")>=0&&(html=format(params0.axisValue,html,useUTC)),html=formatTpl(html,params,!0)}else if(isFunction(formatter)){var callback=bind$1((function(cbTicket,html){cbTicket===this._ticket&&(tooltipContent.setContent(html,markupStyleCreator,tooltipModel,nearPointColor,positionExpr),this._updatePosition(tooltipModel,positionExpr,x,y,tooltipContent,params,el))}),this);this._ticket=asyncTicket,html=formatter(params,asyncTicket,callback)}else html=formatter;tooltipContent.setContent(html,markupStyleCreator,tooltipModel,nearPointColor,positionExpr),tooltipContent.show(tooltipModel,nearPointColor),this._updatePosition(tooltipModel,positionExpr,x,y,tooltipContent,params,el)}},TooltipView.prototype._getNearestPoint=function(point,tooltipDataParams,trigger,borderColor){return"axis"===trigger||isArray(tooltipDataParams)?{color:borderColor||("html"===this._renderMode?"#fff":"none")}:isArray(tooltipDataParams)?void 0:{color:borderColor||tooltipDataParams.color||tooltipDataParams.borderColor}},TooltipView.prototype._updatePosition=function(tooltipModel,positionExpr,x,y,content,params,el){var viewWidth=this._api.getWidth(),viewHeight=this._api.getHeight();positionExpr=positionExpr||tooltipModel.get("position");var contentSize=content.getSize(),align=tooltipModel.get("align"),vAlign=tooltipModel.get("verticalAlign"),rect=el&&el.getBoundingRect().clone();if(el&&rect.applyTransform(el.transform),isFunction(positionExpr)&&(positionExpr=positionExpr([x,y],params,content.el,rect,{viewSize:[viewWidth,viewHeight],contentSize:contentSize.slice()})),isArray(positionExpr))x=parsePercent(positionExpr[0],viewWidth),y=parsePercent(positionExpr[1],viewHeight);else if(isObject$3(positionExpr)){var boxLayoutPosition=positionExpr;boxLayoutPosition.width=contentSize[0],boxLayoutPosition.height=contentSize[1];var layoutRect=getLayoutRect(boxLayoutPosition,{width:viewWidth,height:viewHeight});x=layoutRect.x,y=layoutRect.y,align=null,vAlign=null}else if(isString(positionExpr)&&el){var pos=function(position,rect,contentSize,borderWidth){var domWidth=contentSize[0],domHeight=contentSize[1],offset=Math.ceil(Math.SQRT2*borderWidth)+8,x=0,y=0,rectWidth=rect.width,rectHeight=rect.height;switch(position){case"inside":x=rect.x+rectWidth/2-domWidth/2,y=rect.y+rectHeight/2-domHeight/2;break;case"top":x=rect.x+rectWidth/2-domWidth/2,y=rect.y-domHeight-offset;break;case"bottom":x=rect.x+rectWidth/2-domWidth/2,y=rect.y+rectHeight+offset;break;case"left":x=rect.x-domWidth-offset,y=rect.y+rectHeight/2-domHeight/2;break;case"right":x=rect.x+rectWidth+offset,y=rect.y+rectHeight/2-domHeight/2}return[x,y]}(positionExpr,rect,contentSize,tooltipModel.get("borderWidth"));x=pos[0],y=pos[1]}else{pos=function(x,y,content,viewWidth,viewHeight,gapH,gapV){var size=content.getSize(),width=size[0],height=size[1];null!=gapH&&(x+width+gapH+2>viewWidth?x-=width+gapH:x+=gapH);null!=gapV&&(y+height+gapV>viewHeight?y-=height+gapV:y+=gapV);return[x,y]}(x,y,content,viewWidth,viewHeight,align?null:20,vAlign?null:20);x=pos[0],y=pos[1]}if(align&&(x-=isCenterAlign(align)?contentSize[0]/2:"right"===align?contentSize[0]:0),vAlign&&(y-=isCenterAlign(vAlign)?contentSize[1]/2:"bottom"===vAlign?contentSize[1]:0),shouldTooltipConfine(tooltipModel)){pos=function(x,y,content,viewWidth,viewHeight){var size=content.getSize(),width=size[0],height=size[1];return x=Math.min(x+width,viewWidth)-width,y=Math.min(y+height,viewHeight)-height,x=Math.max(x,0),y=Math.max(y,0),[x,y]}(x,y,content,viewWidth,viewHeight);x=pos[0],y=pos[1]}content.moveTo(x,y)},TooltipView.prototype._updateContentNotChangedOnAxis=function(dataByCoordSys,cbParamsList){var lastCoordSys=this._lastDataByCoordSys,lastCbParamsList=this._cbParamsList,contentNotChanged=!!lastCoordSys&&lastCoordSys.length===dataByCoordSys.length;return contentNotChanged&&each$b(lastCoordSys,(function(lastItemCoordSys,indexCoordSys){var lastDataByAxis=lastItemCoordSys.dataByAxis||[],thisDataByAxis=(dataByCoordSys[indexCoordSys]||{}).dataByAxis||[];(contentNotChanged=contentNotChanged&&lastDataByAxis.length===thisDataByAxis.length)&&each$b(lastDataByAxis,(function(lastItem,indexAxis){var thisItem=thisDataByAxis[indexAxis]||{},lastIndices=lastItem.seriesDataIndices||[],newIndices=thisItem.seriesDataIndices||[];(contentNotChanged=contentNotChanged&&lastItem.value===thisItem.value&&lastItem.axisType===thisItem.axisType&&lastItem.axisId===thisItem.axisId&&lastIndices.length===newIndices.length)&&each$b(lastIndices,(function(lastIdxItem,j){var newIdxItem=newIndices[j];contentNotChanged=contentNotChanged&&lastIdxItem.seriesIndex===newIdxItem.seriesIndex&&lastIdxItem.dataIndex===newIdxItem.dataIndex})),lastCbParamsList&&each$b(lastItem.seriesDataIndices,(function(idxItem){var seriesIdx=idxItem.seriesIndex,cbParams=cbParamsList[seriesIdx],lastCbParams=lastCbParamsList[seriesIdx];cbParams&&lastCbParams&&lastCbParams.data!==cbParams.data&&(contentNotChanged=!1)}))}))})),this._lastDataByCoordSys=dataByCoordSys,this._cbParamsList=cbParamsList,!!contentNotChanged},TooltipView.prototype._hide=function(dispatchAction){this._lastDataByCoordSys=null,dispatchAction({type:"hideTip",from:this.uid})},TooltipView.prototype.dispose=function(ecModel,api){!env$1.node&&api.getDom()&&(clear$1(this,"_updatePosition"),this._tooltipContent.dispose(),unregister("itemTooltip",api))},TooltipView.type="tooltip",TooltipView}(ComponentView$1);function buildTooltipModel(modelCascade,globalTooltipModel,defaultTooltipOption){var resultModel,ecModel=globalTooltipModel.ecModel;defaultTooltipOption?(resultModel=new Model$1(defaultTooltipOption,ecModel,ecModel),resultModel=new Model$1(globalTooltipModel.option,resultModel,ecModel)):resultModel=globalTooltipModel;for(var i=modelCascade.length-1;i>=0;i--){var tooltipOpt=modelCascade[i];tooltipOpt&&(tooltipOpt instanceof Model$1&&(tooltipOpt=tooltipOpt.get("tooltip",!0)),isString(tooltipOpt)&&(tooltipOpt={formatter:tooltipOpt}),tooltipOpt&&(resultModel=new Model$1(tooltipOpt,resultModel,ecModel)))}return resultModel}function makeDispatchAction(payload,api){return payload.dispatchAction||bind$1(api.dispatchAction,api)}function isCenterAlign(align){return"center"===align||"middle"===align}var TooltipView$1=TooltipView;function install$b(registers){use(install$f),registers.registerComponentModel(TooltipModel$1),registers.registerComponentView(TooltipView$1),registers.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},noop$1),registers.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},noop$1)}var TitleModel=function(_super){function TitleModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=TitleModel.type,_this.layoutMode={type:"box",ignoreSize:!0},_this}return __extends(TitleModel,_super),TitleModel.type="title",TitleModel.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"}},TitleModel}(ComponentModel$1),TitleView=function(_super){function TitleView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=TitleView.type,_this}return __extends(TitleView,_super),TitleView.prototype.render=function(titleModel,ecModel,api){if(this.group.removeAll(),titleModel.get("show")){var group=this.group,textStyleModel=titleModel.getModel("textStyle"),subtextStyleModel=titleModel.getModel("subtextStyle"),textAlign=titleModel.get("textAlign"),textVerticalAlign=retrieve2(titleModel.get("textBaseline"),titleModel.get("textVerticalAlign")),textEl=new ZRText$1({style:createTextStyle(textStyleModel,{text:titleModel.get("text"),fill:textStyleModel.getTextColor()},{disableBox:!0}),z2:10}),textRect=textEl.getBoundingRect(),subText=titleModel.get("subtext"),subTextEl=new ZRText$1({style:createTextStyle(subtextStyleModel,{text:subText,fill:subtextStyleModel.getTextColor(),y:textRect.height+titleModel.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),link=titleModel.get("link"),sublink=titleModel.get("sublink"),triggerEvent=titleModel.get("triggerEvent",!0);textEl.silent=!link&&!triggerEvent,subTextEl.silent=!sublink&&!triggerEvent,link&&textEl.on("click",(function(){windowOpen(link,"_"+titleModel.get("target"))})),sublink&&subTextEl.on("click",(function(){windowOpen(sublink,"_"+titleModel.get("subtarget"))})),getECData(textEl).eventData=getECData(subTextEl).eventData=triggerEvent?{componentType:"title",componentIndex:titleModel.componentIndex}:null,group.add(textEl),subText&&group.add(subTextEl);var groupRect=group.getBoundingRect(),layoutOption=titleModel.getBoxLayoutParams();layoutOption.width=groupRect.width,layoutOption.height=groupRect.height;var layoutRect=getLayoutRect(layoutOption,{width:api.getWidth(),height:api.getHeight()},titleModel.get("padding"));textAlign||("middle"===(textAlign=titleModel.get("left")||titleModel.get("right"))&&(textAlign="center"),"right"===textAlign?layoutRect.x+=layoutRect.width:"center"===textAlign&&(layoutRect.x+=layoutRect.width/2)),textVerticalAlign||("center"===(textVerticalAlign=titleModel.get("top")||titleModel.get("bottom"))&&(textVerticalAlign="middle"),"bottom"===textVerticalAlign?layoutRect.y+=layoutRect.height:"middle"===textVerticalAlign&&(layoutRect.y+=layoutRect.height/2),textVerticalAlign=textVerticalAlign||"top"),group.x=layoutRect.x,group.y=layoutRect.y,group.markRedraw();var alignStyle={align:textAlign,verticalAlign:textVerticalAlign};textEl.setStyle(alignStyle),subTextEl.setStyle(alignStyle),groupRect=group.getBoundingRect();var padding=layoutRect.margin,style=titleModel.getItemStyle(["color","opacity"]);style.fill=titleModel.get("backgroundColor");var rect=new Rect$4({shape:{x:groupRect.x-padding[3],y:groupRect.y-padding[0],width:groupRect.width+padding[1]+padding[3],height:groupRect.height+padding[0]+padding[2],r:titleModel.get("borderRadius")},style:style,subPixelOptimize:!0,silent:!0});group.add(rect)}},TitleView.type="title",TitleView}(ComponentView$1);function install$a(registers){registers.registerComponentModel(TitleModel),registers.registerComponentView(TitleView)}function checkMarkerInSeries(seriesOpts,markerType){if(!seriesOpts)return!1;for(var seriesOptArr=isArray(seriesOpts)?seriesOpts:[seriesOpts],idx=0;idx<seriesOptArr.length;idx++)if(seriesOptArr[idx]&&seriesOptArr[idx][markerType])return!0;return!1}function fillLabel(opt){defaultEmphasis(opt,"label",["show"])}var inner$4=makeInner(),MarkerModel=function(_super){function MarkerModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=MarkerModel.type,_this.createdBySelf=!1,_this}return __extends(MarkerModel,_super),MarkerModel.prototype.init=function(option,parentModel,ecModel){if("production"!==process.env.NODE_ENV&&"marker"===this.type)throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(option,ecModel),this._mergeOption(option,ecModel,!1,!0)},MarkerModel.prototype.isAnimationEnabled=function(){if(env$1.node)return!1;var hostSeries=this.__hostSeries;return this.getShallow("animation")&&hostSeries&&hostSeries.isAnimationEnabled()},MarkerModel.prototype.mergeOption=function(newOpt,ecModel){this._mergeOption(newOpt,ecModel,!1,!1)},MarkerModel.prototype._mergeOption=function(newOpt,ecModel,createdBySelf,isInit){var componentType=this.mainType;createdBySelf||ecModel.eachSeries((function(seriesModel){var markerOpt=seriesModel.get(this.mainType,!0),markerModel=inner$4(seriesModel)[componentType];markerOpt&&markerOpt.data?(markerModel?markerModel._mergeOption(markerOpt,ecModel,!0):(isInit&&fillLabel(markerOpt),each$b(markerOpt.data,(function(item){item instanceof Array?(fillLabel(item[0]),fillLabel(item[1])):fillLabel(item)})),extend(markerModel=this.createMarkerModelFromSeries(markerOpt,this,ecModel),{mainType:this.mainType,seriesIndex:seriesModel.seriesIndex,name:seriesModel.name,createdBySelf:!0}),markerModel.__hostSeries=seriesModel),inner$4(seriesModel)[componentType]=markerModel):inner$4(seriesModel)[componentType]=null}),this)},MarkerModel.prototype.formatTooltip=function(dataIndex,multipleSeries,dataType){var data=this.getData(),value=this.getRawValue(dataIndex),itemName=data.getName(dataIndex);return createTooltipMarkup("section",{header:this.name,blocks:[createTooltipMarkup("nameValue",{name:itemName,value:value,noName:!itemName,noValue:null==value})]})},MarkerModel.prototype.getData=function(){return this._data},MarkerModel.prototype.setData=function(data){this._data=data},MarkerModel.prototype.getDataParams=function(dataIndex,dataType){var params=DataFormatMixin.prototype.getDataParams.call(this,dataIndex,dataType),hostSeries=this.__hostSeries;return hostSeries&&(params.seriesId=hostSeries.id,params.seriesName=hostSeries.name,params.seriesType=hostSeries.subType),params},MarkerModel.getMarkerModelFromSeries=function(seriesModel,componentType){return inner$4(seriesModel)[componentType]},MarkerModel.type="marker",MarkerModel.dependencies=["series","grid","polar","geo"],MarkerModel}(ComponentModel$1);mixin(MarkerModel,DataFormatMixin.prototype);var MarkerModel$1=MarkerModel,MarkPointModel$1=function(_super){function MarkPointModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=MarkPointModel.type,_this}return __extends(MarkPointModel,_super),MarkPointModel.prototype.createMarkerModelFromSeries=function(markerOpt,masterMarkerModel,ecModel){return new MarkPointModel(markerOpt,masterMarkerModel,ecModel)},MarkPointModel.type="markPoint",MarkPointModel.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},MarkPointModel}(MarkerModel$1);function hasXOrY(item){return!(isNaN(parseFloat(item.x))&&isNaN(parseFloat(item.y)))}function markerTypeCalculatorWithExtent(markerType,data,otherDataDim,targetDataDim,otherCoordIndex,targetCoordIndex){var coordArr=[],calcDataDim=isDimensionStacked(data,targetDataDim)?data.getCalculationInfo("stackResultDimension"):targetDataDim,value=numCalculate(data,calcDataDim,markerType),dataIndex=data.indicesOfNearest(calcDataDim,value)[0];coordArr[otherCoordIndex]=data.get(otherDataDim,dataIndex),coordArr[targetCoordIndex]=data.get(calcDataDim,dataIndex);var coordArrValue=data.get(targetDataDim,dataIndex),precision=getPrecision(data.get(targetDataDim,dataIndex));return(precision=Math.min(precision,20))>=0&&(coordArr[targetCoordIndex]=+coordArr[targetCoordIndex].toFixed(precision)),[coordArr,coordArrValue]}var markerTypeCalculator={min:curry$1(markerTypeCalculatorWithExtent,"min"),max:curry$1(markerTypeCalculatorWithExtent,"max"),average:curry$1(markerTypeCalculatorWithExtent,"average"),median:curry$1(markerTypeCalculatorWithExtent,"median")};function dataTransform(seriesModel,item){if(item){var data=seriesModel.getData(),coordSys=seriesModel.coordinateSystem,dims=coordSys&&coordSys.dimensions;if(!function(item){return!isNaN(parseFloat(item.x))&&!isNaN(parseFloat(item.y))}(item)&&!isArray(item.coord)&&isArray(dims)){var axisInfo=getAxisInfo(item,data,coordSys,seriesModel);if((item=clone$3(item)).type&&markerTypeCalculator[item.type]&&axisInfo.baseAxis&&axisInfo.valueAxis){var otherCoordIndex=indexOf(dims,axisInfo.baseAxis.dim),targetCoordIndex=indexOf(dims,axisInfo.valueAxis.dim),coordInfo=markerTypeCalculator[item.type](data,axisInfo.baseDataDim,axisInfo.valueDataDim,otherCoordIndex,targetCoordIndex);item.coord=coordInfo[0],item.value=coordInfo[1]}else item.coord=[null!=item.xAxis?item.xAxis:item.radiusAxis,null!=item.yAxis?item.yAxis:item.angleAxis]}if(null!=item.coord&&isArray(dims))for(var coord=item.coord,i=0;i<2;i++)markerTypeCalculator[coord[i]]&&(coord[i]=numCalculate(data,data.mapDimension(dims[i]),coord[i]));else item.coord=[];return item}}function getAxisInfo(item,data,coordSys,seriesModel){var ret={};return null!=item.valueIndex||null!=item.valueDim?(ret.valueDataDim=null!=item.valueIndex?data.getDimension(item.valueIndex):item.valueDim,ret.valueAxis=coordSys.getAxis(function(seriesModel,dataDim){var dimItem=seriesModel.getData().getDimensionInfo(dataDim);return dimItem&&dimItem.coordDim}(seriesModel,ret.valueDataDim)),ret.baseAxis=coordSys.getOtherAxis(ret.valueAxis),ret.baseDataDim=data.mapDimension(ret.baseAxis.dim)):(ret.baseAxis=seriesModel.getBaseAxis(),ret.valueAxis=coordSys.getOtherAxis(ret.baseAxis),ret.baseDataDim=data.mapDimension(ret.baseAxis.dim),ret.valueDataDim=data.mapDimension(ret.valueAxis.dim)),ret}function dataFilter(coordSys,item){return!(coordSys&&coordSys.containData&&item.coord&&!hasXOrY(item))||coordSys.containData(item.coord)}function createMarkerDimValueGetter(inCoordSys,dims){return inCoordSys?function(item,dimName,dataIndex,dimIndex){return parseDataValue(dimIndex<2?item.coord&&item.coord[dimIndex]:item.value,dims[dimIndex])}:function(item,dimName,dataIndex,dimIndex){return parseDataValue(item.value,dims[dimIndex])}}function numCalculate(data,valueDataDim,type){if("average"===type){var sum_1=0,count_1=0;return data.each(valueDataDim,(function(val,idx){isNaN(val)||(sum_1+=val,count_1++)})),sum_1/count_1}return"median"===type?data.getMedian(valueDataDim):data.getDataExtent(valueDataDim)["max"===type?1:0]}var inner$3=makeInner(),MarkerView$1=function(_super){function MarkerView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=MarkerView.type,_this}return __extends(MarkerView,_super),MarkerView.prototype.init=function(){this.markerGroupMap=createHashMap()},MarkerView.prototype.render=function(markerModel,ecModel,api){var _this=this,markerGroupMap=this.markerGroupMap;markerGroupMap.each((function(item){inner$3(item).keep=!1})),ecModel.eachSeries((function(seriesModel){var markerModel=MarkerModel$1.getMarkerModelFromSeries(seriesModel,_this.type);markerModel&&_this.renderSeries(seriesModel,markerModel,ecModel,api)})),markerGroupMap.each((function(item){!inner$3(item).keep&&_this.group.remove(item.group)}))},MarkerView.prototype.markKeep=function(drawGroup){inner$3(drawGroup).keep=!0},MarkerView.prototype.toggleBlurSeries=function(seriesModelList,isBlur){var _this=this;each$b(seriesModelList,(function(seriesModel){var markerModel=MarkerModel$1.getMarkerModelFromSeries(seriesModel,_this.type);markerModel&&markerModel.getData().eachItemGraphicEl((function(el){el&&(isBlur?enterBlur(el):leaveBlur(el))}))}))},MarkerView.type="marker",MarkerView}(ComponentView$1);function updateMarkerLayout(mpData,seriesModel,api){var coordSys=seriesModel.coordinateSystem;mpData.each((function(idx){var point,itemModel=mpData.getItemModel(idx),xPx=parsePercent(itemModel.get("x"),api.getWidth()),yPx=parsePercent(itemModel.get("y"),api.getHeight());if(isNaN(xPx)||isNaN(yPx)){if(seriesModel.getMarkerPosition)point=seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions,idx));else if(coordSys){var x=mpData.get(coordSys.dimensions[0],idx),y=mpData.get(coordSys.dimensions[1],idx);point=coordSys.dataToPoint([x,y])}}else point=[xPx,yPx];isNaN(xPx)||(point[0]=xPx),isNaN(yPx)||(point[1]=yPx),mpData.setItemLayout(idx,point)}))}var MarkPointView=function(_super){function MarkPointView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=MarkPointView.type,_this}return __extends(MarkPointView,_super),MarkPointView.prototype.updateTransform=function(markPointModel,ecModel,api){ecModel.eachSeries((function(seriesModel){var mpModel=MarkerModel$1.getMarkerModelFromSeries(seriesModel,"markPoint");mpModel&&(updateMarkerLayout(mpModel.getData(),seriesModel,api),this.markerGroupMap.get(seriesModel.id).updateLayout())}),this)},MarkPointView.prototype.renderSeries=function(seriesModel,mpModel,ecModel,api){var coordSys=seriesModel.coordinateSystem,seriesId=seriesModel.id,seriesData=seriesModel.getData(),symbolDrawMap=this.markerGroupMap,symbolDraw=symbolDrawMap.get(seriesId)||symbolDrawMap.set(seriesId,new SymbolDraw$1),mpData=function(coordSys,seriesModel,mpModel){var coordDimsInfos;coordDimsInfos=coordSys?map$1(coordSys&&coordSys.dimensions,(function(coordDim){return extend(extend({},seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim))||{}),{name:coordDim,ordinalMeta:null})})):[{name:"value",type:"float"}];var mpData=new SeriesData$1(coordDimsInfos,mpModel),dataOpt=map$1(mpModel.get("data"),curry$1(dataTransform,seriesModel));coordSys&&(dataOpt=filter(dataOpt,curry$1(dataFilter,coordSys)));var dimValueGetter=createMarkerDimValueGetter(!!coordSys,coordDimsInfos);return mpData.initData(dataOpt,null,dimValueGetter),mpData}(coordSys,seriesModel,mpModel);mpModel.setData(mpData),updateMarkerLayout(mpModel.getData(),seriesModel,api),mpData.each((function(idx){var itemModel=mpData.getItemModel(idx),symbol=itemModel.getShallow("symbol"),symbolSize=itemModel.getShallow("symbolSize"),symbolRotate=itemModel.getShallow("symbolRotate"),symbolOffset=itemModel.getShallow("symbolOffset"),symbolKeepAspect=itemModel.getShallow("symbolKeepAspect");if(isFunction(symbol)||isFunction(symbolSize)||isFunction(symbolRotate)||isFunction(symbolOffset)){var rawIdx=mpModel.getRawValue(idx),dataParams=mpModel.getDataParams(idx);isFunction(symbol)&&(symbol=symbol(rawIdx,dataParams)),isFunction(symbolSize)&&(symbolSize=symbolSize(rawIdx,dataParams)),isFunction(symbolRotate)&&(symbolRotate=symbolRotate(rawIdx,dataParams)),isFunction(symbolOffset)&&(symbolOffset=symbolOffset(rawIdx,dataParams))}var style=itemModel.getModel("itemStyle").getItemStyle(),color=getVisualFromData(seriesData,"color");style.fill||(style.fill=color),mpData.setItemVisual(idx,{symbol:symbol,symbolSize:symbolSize,symbolRotate:symbolRotate,symbolOffset:symbolOffset,symbolKeepAspect:symbolKeepAspect,style:style})})),symbolDraw.updateData(mpData),this.group.add(symbolDraw.group),mpData.eachItemGraphicEl((function(el){el.traverse((function(child){getECData(child).dataModel=mpModel}))})),this.markKeep(symbolDraw),symbolDraw.group.silent=mpModel.get("silent")||seriesModel.get("silent")},MarkPointView.type="markPoint",MarkPointView}(MarkerView$1);var MarkPointView$1=MarkPointView;var MarkLineModel$1=function(_super){function MarkLineModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=MarkLineModel.type,_this}return __extends(MarkLineModel,_super),MarkLineModel.prototype.createMarkerModelFromSeries=function(markerOpt,masterMarkerModel,ecModel){return new MarkLineModel(markerOpt,masterMarkerModel,ecModel)},MarkLineModel.type="markLine",MarkLineModel.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},MarkLineModel}(MarkerModel$1),inner$2=makeInner(),markLineTransform=function(seriesModel,coordSys,mlModel,item){var itemArray,data=seriesModel.getData();if(isArray(item))itemArray=item;else{var mlType=item.type;if("min"===mlType||"max"===mlType||"average"===mlType||"median"===mlType||null!=item.xAxis||null!=item.yAxis){var valueAxis=void 0,value=void 0;if(null!=item.yAxis||null!=item.xAxis)valueAxis=coordSys.getAxis(null!=item.yAxis?"y":"x"),value=retrieve(item.yAxis,item.xAxis);else{var axisInfo=getAxisInfo(item,data,coordSys,seriesModel);valueAxis=axisInfo.valueAxis,value=numCalculate(data,getStackedDimension(data,axisInfo.valueDataDim),mlType)}var valueIndex="x"===valueAxis.dim?0:1,baseIndex=1-valueIndex,mlFrom=clone$3(item),mlTo={coord:[]};mlFrom.type=null,mlFrom.coord=[],mlFrom.coord[baseIndex]=-1/0,mlTo.coord[baseIndex]=1/0;var precision=mlModel.get("precision");precision>=0&&isNumber(value)&&(value=+value.toFixed(Math.min(precision,20))),mlFrom.coord[valueIndex]=mlTo.coord[valueIndex]=value,itemArray=[mlFrom,mlTo,{type:mlType,valueIndex:item.valueIndex,value:value}]}else"production"!==process.env.NODE_ENV&&logError("Invalid markLine data."),itemArray=[]}var normalizedItem=[dataTransform(seriesModel,itemArray[0]),dataTransform(seriesModel,itemArray[1]),extend({},itemArray[2])];return normalizedItem[2].type=normalizedItem[2].type||null,merge(normalizedItem[2],normalizedItem[0]),merge(normalizedItem[2],normalizedItem[1]),normalizedItem};function isInfinity$1(val){return!isNaN(val)&&!isFinite(val)}function ifMarkLineHasOnlyDim(dimIndex,fromCoord,toCoord,coordSys){var otherDimIndex=1-dimIndex,dimName=coordSys.dimensions[dimIndex];return isInfinity$1(fromCoord[otherDimIndex])&&isInfinity$1(toCoord[otherDimIndex])&&fromCoord[dimIndex]===toCoord[dimIndex]&&coordSys.getAxis(dimName).containData(fromCoord[dimIndex])}function markLineFilter(coordSys,item){if("cartesian2d"===coordSys.type){var fromCoord=item[0].coord,toCoord=item[1].coord;if(fromCoord&&toCoord&&(ifMarkLineHasOnlyDim(1,fromCoord,toCoord,coordSys)||ifMarkLineHasOnlyDim(0,fromCoord,toCoord,coordSys)))return!0}return dataFilter(coordSys,item[0])&&dataFilter(coordSys,item[1])}function updateSingleMarkerEndLayout(data,idx,isFrom,seriesModel,api){var point,coordSys=seriesModel.coordinateSystem,itemModel=data.getItemModel(idx),xPx=parsePercent(itemModel.get("x"),api.getWidth()),yPx=parsePercent(itemModel.get("y"),api.getHeight());if(isNaN(xPx)||isNaN(yPx)){if(seriesModel.getMarkerPosition)point=seriesModel.getMarkerPosition(data.getValues(data.dimensions,idx));else{var dims=coordSys.dimensions,x=data.get(dims[0],idx),y=data.get(dims[1],idx);point=coordSys.dataToPoint([x,y])}if(isCoordinateSystemType(coordSys,"cartesian2d")){var xAxis=coordSys.getAxis("x"),yAxis=coordSys.getAxis("y");dims=coordSys.dimensions;isInfinity$1(data.get(dims[0],idx))?point[0]=xAxis.toGlobalCoord(xAxis.getExtent()[isFrom?0:1]):isInfinity$1(data.get(dims[1],idx))&&(point[1]=yAxis.toGlobalCoord(yAxis.getExtent()[isFrom?0:1]))}isNaN(xPx)||(point[0]=xPx),isNaN(yPx)||(point[1]=yPx)}else point=[xPx,yPx];data.setItemLayout(idx,point)}var MarkLineView=function(_super){function MarkLineView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=MarkLineView.type,_this}return __extends(MarkLineView,_super),MarkLineView.prototype.updateTransform=function(markLineModel,ecModel,api){ecModel.eachSeries((function(seriesModel){var mlModel=MarkerModel$1.getMarkerModelFromSeries(seriesModel,"markLine");if(mlModel){var mlData_1=mlModel.getData(),fromData_1=inner$2(mlModel).from,toData_1=inner$2(mlModel).to;fromData_1.each((function(idx){updateSingleMarkerEndLayout(fromData_1,idx,!0,seriesModel,api),updateSingleMarkerEndLayout(toData_1,idx,!1,seriesModel,api)})),mlData_1.each((function(idx){mlData_1.setItemLayout(idx,[fromData_1.getItemLayout(idx),toData_1.getItemLayout(idx)])})),this.markerGroupMap.get(seriesModel.id).updateLayout()}}),this)},MarkLineView.prototype.renderSeries=function(seriesModel,mlModel,ecModel,api){var coordSys=seriesModel.coordinateSystem,seriesId=seriesModel.id,seriesData=seriesModel.getData(),lineDrawMap=this.markerGroupMap,lineDraw=lineDrawMap.get(seriesId)||lineDrawMap.set(seriesId,new LineDraw$1);this.group.add(lineDraw.group);var mlData=function(coordSys,seriesModel,mlModel){var coordDimsInfos;coordDimsInfos=coordSys?map$1(coordSys&&coordSys.dimensions,(function(coordDim){return extend(extend({},seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim))||{}),{name:coordDim,ordinalMeta:null})})):[{name:"value",type:"float"}];var fromData=new SeriesData$1(coordDimsInfos,mlModel),toData=new SeriesData$1(coordDimsInfos,mlModel),lineData=new SeriesData$1([],mlModel),optData=map$1(mlModel.get("data"),curry$1(markLineTransform,seriesModel,coordSys,mlModel));coordSys&&(optData=filter(optData,curry$1(markLineFilter,coordSys)));var dimValueGetter=createMarkerDimValueGetter(!!coordSys,coordDimsInfos);return fromData.initData(map$1(optData,(function(item){return item[0]})),null,dimValueGetter),toData.initData(map$1(optData,(function(item){return item[1]})),null,dimValueGetter),lineData.initData(map$1(optData,(function(item){return item[2]}))),lineData.hasItemOption=!0,{from:fromData,to:toData,line:lineData}}(coordSys,seriesModel,mlModel),fromData=mlData.from,toData=mlData.to,lineData=mlData.line;inner$2(mlModel).from=fromData,inner$2(mlModel).to=toData,mlModel.setData(lineData);var symbolType=mlModel.get("symbol"),symbolSize=mlModel.get("symbolSize"),symbolRotate=mlModel.get("symbolRotate"),symbolOffset=mlModel.get("symbolOffset");function updateDataVisualAndLayout(data,idx,isFrom){var itemModel=data.getItemModel(idx);updateSingleMarkerEndLayout(data,idx,isFrom,seriesModel,api);var style=itemModel.getModel("itemStyle").getItemStyle();null==style.fill&&(style.fill=getVisualFromData(seriesData,"color")),data.setItemVisual(idx,{symbolKeepAspect:itemModel.get("symbolKeepAspect"),symbolOffset:retrieve2(itemModel.get("symbolOffset",!0),symbolOffset[isFrom?0:1]),symbolRotate:retrieve2(itemModel.get("symbolRotate",!0),symbolRotate[isFrom?0:1]),symbolSize:retrieve2(itemModel.get("symbolSize"),symbolSize[isFrom?0:1]),symbol:retrieve2(itemModel.get("symbol",!0),symbolType[isFrom?0:1]),style:style})}isArray(symbolType)||(symbolType=[symbolType,symbolType]),isArray(symbolSize)||(symbolSize=[symbolSize,symbolSize]),isArray(symbolRotate)||(symbolRotate=[symbolRotate,symbolRotate]),isArray(symbolOffset)||(symbolOffset=[symbolOffset,symbolOffset]),mlData.from.each((function(idx){updateDataVisualAndLayout(fromData,idx,!0),updateDataVisualAndLayout(toData,idx,!1)})),lineData.each((function(idx){var lineStyle=lineData.getItemModel(idx).getModel("lineStyle").getLineStyle();lineData.setItemLayout(idx,[fromData.getItemLayout(idx),toData.getItemLayout(idx)]),null==lineStyle.stroke&&(lineStyle.stroke=fromData.getItemVisual(idx,"style").fill),lineData.setItemVisual(idx,{fromSymbolKeepAspect:fromData.getItemVisual(idx,"symbolKeepAspect"),fromSymbolOffset:fromData.getItemVisual(idx,"symbolOffset"),fromSymbolRotate:fromData.getItemVisual(idx,"symbolRotate"),fromSymbolSize:fromData.getItemVisual(idx,"symbolSize"),fromSymbol:fromData.getItemVisual(idx,"symbol"),toSymbolKeepAspect:toData.getItemVisual(idx,"symbolKeepAspect"),toSymbolOffset:toData.getItemVisual(idx,"symbolOffset"),toSymbolRotate:toData.getItemVisual(idx,"symbolRotate"),toSymbolSize:toData.getItemVisual(idx,"symbolSize"),toSymbol:toData.getItemVisual(idx,"symbol"),style:lineStyle})})),lineDraw.updateData(lineData),mlData.line.eachItemGraphicEl((function(el){getECData(el).dataModel=mlModel,el.traverse((function(child){getECData(child).dataModel=mlModel}))})),this.markKeep(lineDraw),lineDraw.group.silent=mlModel.get("silent")||seriesModel.get("silent")},MarkLineView.type="markLine",MarkLineView}(MarkerView$1);var MarkLineView$1=MarkLineView;var MarkAreaModel$1=function(_super){function MarkAreaModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=MarkAreaModel.type,_this}return __extends(MarkAreaModel,_super),MarkAreaModel.prototype.createMarkerModelFromSeries=function(markerOpt,masterMarkerModel,ecModel){return new MarkAreaModel(markerOpt,masterMarkerModel,ecModel)},MarkAreaModel.type="markArea",MarkAreaModel.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},MarkAreaModel}(MarkerModel$1),inner$1=makeInner(),markAreaTransform=function(seriesModel,coordSys,maModel,item){var item0=item[0],item1=item[1];if(item0&&item1){var lt=dataTransform(seriesModel,item0),rb=dataTransform(seriesModel,item1),ltCoord=lt.coord,rbCoord=rb.coord;ltCoord[0]=retrieve(ltCoord[0],-1/0),ltCoord[1]=retrieve(ltCoord[1],-1/0),rbCoord[0]=retrieve(rbCoord[0],1/0),rbCoord[1]=retrieve(rbCoord[1],1/0);var result=function(targetAndSources,overwrite){for(var result=targetAndSources[0],i=1,len=targetAndSources.length;i<len;i++)result=merge(result,targetAndSources[i],overwrite);return result}([{},lt,rb]);return result.coord=[lt.coord,rb.coord],result.x0=lt.x,result.y0=lt.y,result.x1=rb.x,result.y1=rb.y,result}};function isInfinity(val){return!isNaN(val)&&!isFinite(val)}function ifMarkAreaHasOnlyDim(dimIndex,fromCoord,toCoord,coordSys){var otherDimIndex=1-dimIndex;return isInfinity(fromCoord[otherDimIndex])&&isInfinity(toCoord[otherDimIndex])}function markAreaFilter(coordSys,item){var fromCoord=item.coord[0],toCoord=item.coord[1],item0={coord:fromCoord,x:item.x0,y:item.y0},item1={coord:toCoord,x:item.x1,y:item.y1};return isCoordinateSystemType(coordSys,"cartesian2d")?!(!fromCoord||!toCoord||!ifMarkAreaHasOnlyDim(1,fromCoord,toCoord)&&!ifMarkAreaHasOnlyDim(0,fromCoord,toCoord))||function(coordSys,item1,item2){return!(coordSys&&coordSys.containZone&&item1.coord&&item2.coord&&!hasXOrY(item1)&&!hasXOrY(item2))||coordSys.containZone(item1.coord,item2.coord)}(coordSys,item0,item1):dataFilter(coordSys,item0)||dataFilter(coordSys,item1)}function getSingleMarkerEndPoint(data,idx,dims,seriesModel,api){var point,coordSys=seriesModel.coordinateSystem,itemModel=data.getItemModel(idx),xPx=parsePercent(itemModel.get(dims[0]),api.getWidth()),yPx=parsePercent(itemModel.get(dims[1]),api.getHeight());if(isNaN(xPx)||isNaN(yPx)){if(seriesModel.getMarkerPosition){var pointValue0=data.getValues(["x0","y0"],idx),pointValue1=data.getValues(["x1","y1"],idx),clampPointValue0=coordSys.clampData(pointValue0),clampPointValue1=coordSys.clampData(pointValue1),pointValue=[];"x0"===dims[0]?pointValue[0]=clampPointValue0[0]>clampPointValue1[0]?pointValue1[0]:pointValue0[0]:pointValue[0]=clampPointValue0[0]>clampPointValue1[0]?pointValue0[0]:pointValue1[0],"y0"===dims[1]?pointValue[1]=clampPointValue0[1]>clampPointValue1[1]?pointValue1[1]:pointValue0[1]:pointValue[1]=clampPointValue0[1]>clampPointValue1[1]?pointValue0[1]:pointValue1[1],point=seriesModel.getMarkerPosition(pointValue,dims,!0)}else{var pt=[x=data.get(dims[0],idx),y=data.get(dims[1],idx)];coordSys.clampData&&coordSys.clampData(pt,pt),point=coordSys.dataToPoint(pt,!0)}if(isCoordinateSystemType(coordSys,"cartesian2d")){var xAxis=coordSys.getAxis("x"),yAxis=coordSys.getAxis("y"),x=data.get(dims[0],idx),y=data.get(dims[1],idx);isInfinity(x)?point[0]=xAxis.toGlobalCoord(xAxis.getExtent()["x0"===dims[0]?0:1]):isInfinity(y)&&(point[1]=yAxis.toGlobalCoord(yAxis.getExtent()["y0"===dims[1]?0:1]))}isNaN(xPx)||(point[0]=xPx),isNaN(yPx)||(point[1]=yPx)}else point=[xPx,yPx];return point}var dimPermutations=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],MarkAreaView=function(_super){function MarkAreaView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=MarkAreaView.type,_this}return __extends(MarkAreaView,_super),MarkAreaView.prototype.updateTransform=function(markAreaModel,ecModel,api){ecModel.eachSeries((function(seriesModel){var maModel=MarkerModel$1.getMarkerModelFromSeries(seriesModel,"markArea");if(maModel){var areaData_1=maModel.getData();areaData_1.each((function(idx){var points=map$1(dimPermutations,(function(dim){return getSingleMarkerEndPoint(areaData_1,idx,dim,seriesModel,api)}));areaData_1.setItemLayout(idx,points),areaData_1.getItemGraphicEl(idx).setShape("points",points)}))}}),this)},MarkAreaView.prototype.renderSeries=function(seriesModel,maModel,ecModel,api){var coordSys=seriesModel.coordinateSystem,seriesId=seriesModel.id,seriesData=seriesModel.getData(),areaGroupMap=this.markerGroupMap,polygonGroup=areaGroupMap.get(seriesId)||areaGroupMap.set(seriesId,{group:new Group$4});this.group.add(polygonGroup.group),this.markKeep(polygonGroup);var areaData=function(coordSys,seriesModel,maModel){var areaData,dataDims,dims=["x0","y0","x1","y1"];if(coordSys){var coordDimsInfos_1=map$1(coordSys&&coordSys.dimensions,(function(coordDim){var data=seriesModel.getData();return extend(extend({},data.getDimensionInfo(data.mapDimension(coordDim))||{}),{name:coordDim,ordinalMeta:null})}));dataDims=map$1(dims,(function(dim,idx){return{name:dim,type:coordDimsInfos_1[idx%2].type}})),areaData=new SeriesData$1(dataDims,maModel)}else areaData=new SeriesData$1(dataDims=[{name:"value",type:"float"}],maModel);var optData=map$1(maModel.get("data"),curry$1(markAreaTransform,seriesModel,coordSys,maModel));coordSys&&(optData=filter(optData,curry$1(markAreaFilter,coordSys)));var dimValueGetter=coordSys?function(item,dimName,dataIndex,dimIndex){return parseDataValue(item.coord[Math.floor(dimIndex/2)][dimIndex%2],dataDims[dimIndex])}:function(item,dimName,dataIndex,dimIndex){return parseDataValue(item.value,dataDims[dimIndex])};return areaData.initData(optData,null,dimValueGetter),areaData.hasItemOption=!0,areaData}(coordSys,seriesModel,maModel);maModel.setData(areaData),areaData.each((function(idx){var points=map$1(dimPermutations,(function(dim){return getSingleMarkerEndPoint(areaData,idx,dim,seriesModel,api)})),xAxisScale=coordSys.getAxis("x").scale,yAxisScale=coordSys.getAxis("y").scale,xAxisExtent=xAxisScale.getExtent(),yAxisExtent=yAxisScale.getExtent(),xPointExtent=[xAxisScale.parse(areaData.get("x0",idx)),xAxisScale.parse(areaData.get("x1",idx))],yPointExtent=[yAxisScale.parse(areaData.get("y0",idx)),yAxisScale.parse(areaData.get("y1",idx))];asc$1(xPointExtent),asc$1(yPointExtent);var allClipped=!!(xAxisExtent[0]>xPointExtent[1]||xAxisExtent[1]<xPointExtent[0]||yAxisExtent[0]>yPointExtent[1]||yAxisExtent[1]<yPointExtent[0]);areaData.setItemLayout(idx,{points:points,allClipped:allClipped});var style=areaData.getItemModel(idx).getModel("itemStyle").getItemStyle(),color=getVisualFromData(seriesData,"color");style.fill||(style.fill=color,isString(style.fill)&&(style.fill=modifyAlpha(style.fill,.4))),style.stroke||(style.stroke=color),areaData.setItemVisual(idx,"style",style)})),areaData.diff(inner$1(polygonGroup).data).add((function(idx){var layout=areaData.getItemLayout(idx);if(!layout.allClipped){var polygon=new Polygon$1({shape:{points:layout.points}});areaData.setItemGraphicEl(idx,polygon),polygonGroup.group.add(polygon)}})).update((function(newIdx,oldIdx){var polygon=inner$1(polygonGroup).data.getItemGraphicEl(oldIdx),layout=areaData.getItemLayout(newIdx);layout.allClipped?polygon&&polygonGroup.group.remove(polygon):(polygon?updateProps$1(polygon,{shape:{points:layout.points}},maModel,newIdx):polygon=new Polygon$1({shape:{points:layout.points}}),areaData.setItemGraphicEl(newIdx,polygon),polygonGroup.group.add(polygon))})).remove((function(idx){var polygon=inner$1(polygonGroup).data.getItemGraphicEl(idx);polygonGroup.group.remove(polygon)})).execute(),areaData.eachItemGraphicEl((function(polygon,idx){var itemModel=areaData.getItemModel(idx),style=areaData.getItemVisual(idx,"style");polygon.useStyle(areaData.getItemVisual(idx,"style")),setLabelStyle(polygon,getLabelStatesModels(itemModel),{labelFetcher:maModel,labelDataIndex:idx,defaultText:areaData.getName(idx)||"",inheritColor:isString(style.fill)?modifyAlpha(style.fill,1):"#000"}),setStatesStylesFromModel(polygon,itemModel),toggleHoverEmphasis(polygon,null,null,itemModel.get(["emphasis","disabled"])),getECData(polygon).dataModel=maModel})),inner$1(polygonGroup).data=areaData,polygonGroup.group.silent=maModel.get("silent")||seriesModel.get("silent")},MarkAreaView.type="markArea",MarkAreaView}(MarkerView$1);var MarkAreaView$1=MarkAreaView;var LegendModel=function(_super){function LegendModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=LegendModel.type,_this.layoutMode={type:"box",ignoreSize:!0},_this}return __extends(LegendModel,_super),LegendModel.prototype.init=function(option,parentModel,ecModel){this.mergeDefaultAndTheme(option,ecModel),option.selected=option.selected||{},this._updateSelector(option)},LegendModel.prototype.mergeOption=function(option,ecModel){_super.prototype.mergeOption.call(this,option,ecModel),this._updateSelector(option)},LegendModel.prototype._updateSelector=function(option){var selector=option.selector,ecModel=this.ecModel;!0===selector&&(selector=option.selector=["all","inverse"]),isArray(selector)&&each$b(selector,(function(item,index){isString(item)&&(item={type:item}),selector[index]=merge(item,function(ecModel,type){return"all"===type?{type:"all",title:ecModel.getLocaleModel().get(["legend","selector","all"])}:"inverse"===type?{type:"inverse",title:ecModel.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(ecModel,item.type))}))},LegendModel.prototype.optionUpdated=function(){this._updateData(this.ecModel);var legendData=this._data;if(legendData[0]&&"single"===this.get("selectedMode")){for(var hasSelected=!1,i=0;i<legendData.length;i++){var name_1=legendData[i].get("name");if(this.isSelected(name_1)){this.select(name_1),hasSelected=!0;break}}!hasSelected&&this.select(legendData[0].get("name"))}},LegendModel.prototype._updateData=function(ecModel){var potentialData=[],availableNames=[];ecModel.eachRawSeries((function(seriesModel){var isPotential,seriesName=seriesModel.name;if(availableNames.push(seriesName),seriesModel.legendVisualProvider){var names=seriesModel.legendVisualProvider.getAllNames();ecModel.isSeriesFiltered(seriesModel)||(availableNames=availableNames.concat(names)),names.length?potentialData=potentialData.concat(names):isPotential=!0}else isPotential=!0;isPotential&&isNameSpecified(seriesModel)&&potentialData.push(seriesModel.name)})),this._availableNames=availableNames;var rawData=this.get("data")||potentialData,legendNameMap=createHashMap(),legendData=map$1(rawData,(function(dataItem){return(isString(dataItem)||isNumber(dataItem))&&(dataItem={name:dataItem}),legendNameMap.get(dataItem.name)?null:(legendNameMap.set(dataItem.name,!0),new Model$1(dataItem,this,this.ecModel))}),this);this._data=filter(legendData,(function(item){return!!item}))},LegendModel.prototype.getData=function(){return this._data},LegendModel.prototype.select=function(name){var selected=this.option.selected;"single"===this.get("selectedMode")&&each$b(this._data,(function(dataItem){selected[dataItem.get("name")]=!1}));selected[name]=!0},LegendModel.prototype.unSelect=function(name){"single"!==this.get("selectedMode")&&(this.option.selected[name]=!1)},LegendModel.prototype.toggleSelected=function(name){var selected=this.option.selected;selected.hasOwnProperty(name)||(selected[name]=!0),this[selected[name]?"unSelect":"select"](name)},LegendModel.prototype.allSelect=function(){var data=this._data,selected=this.option.selected;each$b(data,(function(dataItem){selected[dataItem.get("name",!0)]=!0}))},LegendModel.prototype.inverseSelect=function(){var data=this._data,selected=this.option.selected;each$b(data,(function(dataItem){var name=dataItem.get("name",!0);selected.hasOwnProperty(name)||(selected[name]=!0),selected[name]=!selected[name]}))},LegendModel.prototype.isSelected=function(name){var selected=this.option.selected;return!(selected.hasOwnProperty(name)&&!selected[name])&&indexOf(this._availableNames,name)>=0},LegendModel.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},LegendModel.type="legend.plain",LegendModel.dependencies=["series"],LegendModel.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},LegendModel}(ComponentModel$1),LegendModel$1=LegendModel,curry=curry$1,each=each$b,Group$1=Group$4,LegendView=function(_super){function LegendView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=LegendView.type,_this.newlineDisabled=!1,_this}return __extends(LegendView,_super),LegendView.prototype.init=function(){this.group.add(this._contentGroup=new Group$1),this.group.add(this._selectorGroup=new Group$1),this._isFirstRender=!0},LegendView.prototype.getContentGroup=function(){return this._contentGroup},LegendView.prototype.getSelectorGroup=function(){return this._selectorGroup},LegendView.prototype.render=function(legendModel,ecModel,api){var isFirstRender=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),legendModel.get("show",!0)){var itemAlign=legendModel.get("align"),orient=legendModel.get("orient");itemAlign&&"auto"!==itemAlign||(itemAlign="right"===legendModel.get("left")&&"vertical"===orient?"right":"left");var selector=legendModel.get("selector",!0),selectorPosition=legendModel.get("selectorPosition",!0);!selector||selectorPosition&&"auto"!==selectorPosition||(selectorPosition="horizontal"===orient?"end":"start"),this.renderInner(itemAlign,legendModel,ecModel,api,selector,orient,selectorPosition);var positionInfo=legendModel.getBoxLayoutParams(),viewportSize={width:api.getWidth(),height:api.getHeight()},padding=legendModel.get("padding"),maxSize=getLayoutRect(positionInfo,viewportSize,padding),mainRect=this.layoutInner(legendModel,itemAlign,maxSize,isFirstRender,selector,selectorPosition),layoutRect=getLayoutRect(defaults({width:mainRect.width,height:mainRect.height},positionInfo),viewportSize,padding);this.group.x=layoutRect.x-mainRect.x,this.group.y=layoutRect.y-mainRect.y,this.group.markRedraw(),this.group.add(this._backgroundEl=makeBackground(mainRect,legendModel))}},LegendView.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},LegendView.prototype.renderInner=function(itemAlign,legendModel,ecModel,api,selector,orient,selectorPosition){var contentGroup=this.getContentGroup(),legendDrawnMap=createHashMap(),selectMode=legendModel.get("selectedMode"),excludeSeriesId=[];ecModel.eachRawSeries((function(seriesModel){!seriesModel.get("legendHoverLink")&&excludeSeriesId.push(seriesModel.id)})),each(legendModel.getData(),(function(legendItemModel,dataIndex){var name=legendItemModel.get("name");if(!this.newlineDisabled&&(""===name||"\n"===name)){var g=new Group$1;return g.newline=!0,void contentGroup.add(g)}var seriesModel=ecModel.getSeriesByName(name)[0];if(!legendDrawnMap.get(name)){if(seriesModel){var data=seriesModel.getData(),lineVisualStyle=data.getVisual("legendLineStyle")||{},legendIcon=data.getVisual("legendIcon"),style=data.getVisual("style"),itemGroup=this._createItem(seriesModel,name,dataIndex,legendItemModel,legendModel,itemAlign,lineVisualStyle,style,legendIcon,selectMode,api);itemGroup.on("click",curry(dispatchSelectAction,name,null,api,excludeSeriesId)).on("mouseover",curry(dispatchHighlightAction,seriesModel.name,null,api,excludeSeriesId)).on("mouseout",curry(dispatchDownplayAction,seriesModel.name,null,api,excludeSeriesId)),ecModel.ssr&&itemGroup.eachChild((function(child){var ecData=getECData(child);ecData.seriesIndex=seriesModel.seriesIndex,ecData.dataIndex=dataIndex,ecData.ssrType="legend"})),legendDrawnMap.set(name,!0)}else ecModel.eachRawSeries((function(seriesModel){if(!legendDrawnMap.get(name)&&seriesModel.legendVisualProvider){var provider=seriesModel.legendVisualProvider;if(!provider.containName(name))return;var idx=provider.indexOfName(name),style=provider.getItemVisual(idx,"style"),legendIcon=provider.getItemVisual(idx,"legendIcon"),colorArr=parse$1(style.fill);colorArr&&0===colorArr[3]&&(colorArr[3]=.2,style=extend(extend({},style),{fill:stringify$1(colorArr,"rgba")}));var itemGroup=this._createItem(seriesModel,name,dataIndex,legendItemModel,legendModel,itemAlign,{},style,legendIcon,selectMode,api);itemGroup.on("click",curry(dispatchSelectAction,null,name,api,excludeSeriesId)).on("mouseover",curry(dispatchHighlightAction,null,name,api,excludeSeriesId)).on("mouseout",curry(dispatchDownplayAction,null,name,api,excludeSeriesId)),ecModel.ssr&&itemGroup.eachChild((function(child){var ecData=getECData(child);ecData.seriesIndex=seriesModel.seriesIndex,ecData.dataIndex=dataIndex,ecData.ssrType="legend"})),legendDrawnMap.set(name,!0)}}),this);"production"!==process.env.NODE_ENV&&(legendDrawnMap.get(name)||console.warn(name+" series not exists. Legend data should be same with series name or data name."))}}),this),selector&&this._createSelector(selector,legendModel,api,orient,selectorPosition)},LegendView.prototype._createSelector=function(selector,legendModel,api,orient,selectorPosition){var selectorGroup=this.getSelectorGroup();each(selector,(function(selectorItem){var type=selectorItem.type,labelText=new ZRText$1({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){api.dispatchAction({type:"all"===type?"legendAllSelect":"legendInverseSelect",legendId:legendModel.id})}});selectorGroup.add(labelText),setLabelStyle(labelText,{normal:legendModel.getModel("selectorLabel"),emphasis:legendModel.getModel(["emphasis","selectorLabel"])},{defaultText:selectorItem.title}),enableHoverEmphasis(labelText)}))},LegendView.prototype._createItem=function(seriesModel,name,dataIndex,legendItemModel,legendModel,itemAlign,lineVisualStyle,itemVisualStyle,legendIcon,selectMode,api){var drawType=seriesModel.visualDrawType,itemWidth=legendModel.get("itemWidth"),itemHeight=legendModel.get("itemHeight"),isSelected=legendModel.isSelected(name),iconRotate=legendItemModel.get("symbolRotate"),symbolKeepAspect=legendItemModel.get("symbolKeepAspect"),legendIconType=legendItemModel.get("icon"),style=function(iconType,legendItemModel,lineVisualStyle,itemVisualStyle,drawType,isSelected,api){function handleCommonProps(style,visualStyle){"auto"===style.lineWidth&&(style.lineWidth=visualStyle.lineWidth>0?2:0),each(style,(function(propVal,propName){"inherit"===style[propName]&&(style[propName]=visualStyle[propName])}))}var itemStyleModel=legendItemModel.getModel("itemStyle"),itemStyle=itemStyleModel.getItemStyle(),iconBrushType=0===iconType.lastIndexOf("empty",0)?"fill":"stroke",decalStyle=itemStyleModel.getShallow("decal");itemStyle.decal=decalStyle&&"inherit"!==decalStyle?createOrUpdatePatternFromDecal(decalStyle,api):itemVisualStyle.decal,"inherit"===itemStyle.fill&&(itemStyle.fill=itemVisualStyle[drawType]);"inherit"===itemStyle.stroke&&(itemStyle.stroke=itemVisualStyle[iconBrushType]);"inherit"===itemStyle.opacity&&(itemStyle.opacity=("fill"===drawType?itemVisualStyle:lineVisualStyle).opacity);handleCommonProps(itemStyle,itemVisualStyle);var legendLineModel=legendItemModel.getModel("lineStyle"),lineStyle=legendLineModel.getLineStyle();if(handleCommonProps(lineStyle,lineVisualStyle),"auto"===itemStyle.fill&&(itemStyle.fill=itemVisualStyle.fill),"auto"===itemStyle.stroke&&(itemStyle.stroke=itemVisualStyle.fill),"auto"===lineStyle.stroke&&(lineStyle.stroke=itemVisualStyle.fill),!isSelected){var borderWidth=legendItemModel.get("inactiveBorderWidth"),visualHasBorder=itemStyle[iconBrushType];itemStyle.lineWidth="auto"===borderWidth?itemVisualStyle.lineWidth>0&&visualHasBorder?2:0:itemStyle.lineWidth,itemStyle.fill=legendItemModel.get("inactiveColor"),itemStyle.stroke=legendItemModel.get("inactiveBorderColor"),lineStyle.stroke=legendLineModel.get("inactiveColor"),lineStyle.lineWidth=legendLineModel.get("inactiveWidth")}return{itemStyle:itemStyle,lineStyle:lineStyle}}(legendIcon=legendIconType||legendIcon||"roundRect",legendItemModel,lineVisualStyle,itemVisualStyle,drawType,isSelected,api),itemGroup=new Group$1,textStyleModel=legendItemModel.getModel("textStyle");if(!isFunction(seriesModel.getLegendIcon)||legendIconType&&"inherit"!==legendIconType){var rotate="inherit"===legendIconType&&seriesModel.getData().getVisual("symbol")?"inherit"===iconRotate?seriesModel.getData().getVisual("symbolRotate"):iconRotate:0;itemGroup.add(function(opt){var symboType=opt.icon||"roundRect",icon=createSymbol$1(symboType,0,0,opt.itemWidth,opt.itemHeight,opt.itemStyle.fill,opt.symbolKeepAspect);icon.setStyle(opt.itemStyle),icon.rotation=(opt.iconRotate||0)*Math.PI/180,icon.setOrigin([opt.itemWidth/2,opt.itemHeight/2]),symboType.indexOf("empty")>-1&&(icon.style.stroke=icon.style.fill,icon.style.fill="#fff",icon.style.lineWidth=2);return icon}({itemWidth:itemWidth,itemHeight:itemHeight,icon:legendIcon,iconRotate:rotate,itemStyle:style.itemStyle,lineStyle:style.lineStyle,symbolKeepAspect:symbolKeepAspect}))}else itemGroup.add(seriesModel.getLegendIcon({itemWidth:itemWidth,itemHeight:itemHeight,icon:legendIcon,iconRotate:iconRotate,itemStyle:style.itemStyle,lineStyle:style.lineStyle,symbolKeepAspect:symbolKeepAspect}));var textX="left"===itemAlign?itemWidth+5:-5,textAlign=itemAlign,formatter=legendModel.get("formatter"),content=name;isString(formatter)&&formatter?content=formatter.replace("{name}",null!=name?name:""):isFunction(formatter)&&(content=formatter(name));var textColor=isSelected?textStyleModel.getTextColor():legendItemModel.get("inactiveColor");itemGroup.add(new ZRText$1({style:createTextStyle(textStyleModel,{text:content,x:textX,y:itemHeight/2,fill:textColor,align:textAlign,verticalAlign:"middle"},{inheritColor:textColor})}));var hitRect=new Rect$4({shape:itemGroup.getBoundingRect(),style:{fill:"transparent"}}),tooltipModel=legendItemModel.getModel("tooltip");return tooltipModel.get("show")&&setTooltipConfig({el:hitRect,componentModel:legendModel,itemName:name,itemTooltipOption:tooltipModel.option}),itemGroup.add(hitRect),itemGroup.eachChild((function(child){child.silent=!0})),hitRect.silent=!selectMode,this.getContentGroup().add(itemGroup),enableHoverEmphasis(itemGroup),itemGroup.__legendDataIndex=dataIndex,itemGroup},LegendView.prototype.layoutInner=function(legendModel,itemAlign,maxSize,isFirstRender,selector,selectorPosition){var contentGroup=this.getContentGroup(),selectorGroup=this.getSelectorGroup();box(legendModel.get("orient"),contentGroup,legendModel.get("itemGap"),maxSize.width,maxSize.height);var contentRect=contentGroup.getBoundingRect(),contentPos=[-contentRect.x,-contentRect.y];if(selectorGroup.markRedraw(),contentGroup.markRedraw(),selector){box("horizontal",selectorGroup,legendModel.get("selectorItemGap",!0));var selectorRect=selectorGroup.getBoundingRect(),selectorPos=[-selectorRect.x,-selectorRect.y],selectorButtonGap=legendModel.get("selectorButtonGap",!0),orientIdx=legendModel.getOrient().index,wh=0===orientIdx?"width":"height",hw=0===orientIdx?"height":"width",yx=0===orientIdx?"y":"x";"end"===selectorPosition?selectorPos[orientIdx]+=contentRect[wh]+selectorButtonGap:contentPos[orientIdx]+=selectorRect[wh]+selectorButtonGap,selectorPos[1-orientIdx]+=contentRect[hw]/2-selectorRect[hw]/2,selectorGroup.x=selectorPos[0],selectorGroup.y=selectorPos[1],contentGroup.x=contentPos[0],contentGroup.y=contentPos[1];var mainRect={x:0,y:0};return mainRect[wh]=contentRect[wh]+selectorButtonGap+selectorRect[wh],mainRect[hw]=Math.max(contentRect[hw],selectorRect[hw]),mainRect[yx]=Math.min(0,selectorRect[yx]+selectorPos[1-orientIdx]),mainRect}return contentGroup.x=contentPos[0],contentGroup.y=contentPos[1],this.group.getBoundingRect()},LegendView.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},LegendView.type="legend.plain",LegendView}(ComponentView$1);function dispatchSelectAction(seriesName,dataName,api,excludeSeriesId){dispatchDownplayAction(seriesName,dataName,api,excludeSeriesId),api.dispatchAction({type:"legendToggleSelect",name:null!=seriesName?seriesName:dataName}),dispatchHighlightAction(seriesName,dataName,api,excludeSeriesId)}function isUseHoverLayer(api){for(var emphasisState,list=api.getZr().storage.getDisplayList(),i=0,len=list.length;i<len&&!(emphasisState=list[i].states.emphasis);)i++;return emphasisState&&emphasisState.hoverLayer}function dispatchHighlightAction(seriesName,dataName,api,excludeSeriesId){isUseHoverLayer(api)||api.dispatchAction({type:"highlight",seriesName:seriesName,name:dataName,excludeSeriesId:excludeSeriesId})}function dispatchDownplayAction(seriesName,dataName,api,excludeSeriesId){isUseHoverLayer(api)||api.dispatchAction({type:"downplay",seriesName:seriesName,name:dataName,excludeSeriesId:excludeSeriesId})}var LegendView$1=LegendView;function legendFilter(ecModel){var legendModels=ecModel.findComponents({mainType:"legend"});legendModels&&legendModels.length&&ecModel.filterSeries((function(series){for(var i=0;i<legendModels.length;i++)if(!legendModels[i].isSelected(series.name))return!1;return!0}))}function legendSelectActionHandler(methodName,payload,ecModel){var isAllSelect="allSelect"===methodName||"inverseSelect"===methodName,selectedMap={},actionLegendIndices=[];ecModel.eachComponent({mainType:"legend",query:payload},(function(legendModel){isAllSelect?legendModel[methodName]():legendModel[methodName](payload.name),makeSelectedMap(legendModel,selectedMap),actionLegendIndices.push(legendModel.componentIndex)}));var allSelectedMap={};return ecModel.eachComponent("legend",(function(legendModel){each$b(selectedMap,(function(isSelected,name){legendModel[isSelected?"select":"unSelect"](name)})),makeSelectedMap(legendModel,allSelectedMap)})),isAllSelect?{selected:allSelectedMap,legendIndex:actionLegendIndices}:{name:payload.name,selected:allSelectedMap}}function makeSelectedMap(legendModel,out){var selectedMap=out||{};return each$b(legendModel.getData(),(function(model){var name=model.get("name");if("\n"!==name&&""!==name){var isItemSelected=legendModel.isSelected(name);hasOwn(selectedMap,name)?selectedMap[name]=selectedMap[name]&&isItemSelected:selectedMap[name]=isItemSelected}})),selectedMap}function install$6(registers){registers.registerComponentModel(LegendModel$1),registers.registerComponentView(LegendView$1),registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER,legendFilter),registers.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(registers){registers.registerAction("legendToggleSelect","legendselectchanged",curry$1(legendSelectActionHandler,"toggleSelected")),registers.registerAction("legendAllSelect","legendselectall",curry$1(legendSelectActionHandler,"allSelect")),registers.registerAction("legendInverseSelect","legendinverseselect",curry$1(legendSelectActionHandler,"inverseSelect")),registers.registerAction("legendSelect","legendselected",curry$1(legendSelectActionHandler,"select")),registers.registerAction("legendUnSelect","legendunselected",curry$1(legendSelectActionHandler,"unSelect"))}(registers)}function mergeAndNormalizeLayoutParams(legendModel,target,raw){var ignoreSize=[1,1];ignoreSize[legendModel.getOrient().index]=0,mergeLayoutParam(target,raw,{type:"box",ignoreSize:!!ignoreSize})}var ScrollableLegendModel$1=function(_super){function ScrollableLegendModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ScrollableLegendModel.type,_this}return __extends(ScrollableLegendModel,_super),ScrollableLegendModel.prototype.setScrollDataIndex=function(scrollDataIndex){this.option.scrollDataIndex=scrollDataIndex},ScrollableLegendModel.prototype.init=function(option,parentModel,ecModel){var inputPositionParams=getLayoutParams(option);_super.prototype.init.call(this,option,parentModel,ecModel),mergeAndNormalizeLayoutParams(this,option,inputPositionParams)},ScrollableLegendModel.prototype.mergeOption=function(option,ecModel){_super.prototype.mergeOption.call(this,option,ecModel),mergeAndNormalizeLayoutParams(this,this.option,option)},ScrollableLegendModel.type="legend.scroll",ScrollableLegendModel.defaultOption=inheritDefaultOption(LegendModel$1.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),ScrollableLegendModel}(LegendModel$1),Group=Group$4,WH=["width","height"],XY=["x","y"],ScrollableLegendView=function(_super){function ScrollableLegendView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=ScrollableLegendView.type,_this.newlineDisabled=!0,_this._currentIndex=0,_this}return __extends(ScrollableLegendView,_super),ScrollableLegendView.prototype.init=function(){_super.prototype.init.call(this),this.group.add(this._containerGroup=new Group),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Group)},ScrollableLegendView.prototype.resetInner=function(){_super.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},ScrollableLegendView.prototype.renderInner=function(itemAlign,legendModel,ecModel,api,selector,orient,selectorPosition){var self=this;_super.prototype.renderInner.call(this,itemAlign,legendModel,ecModel,api,selector,orient,selectorPosition);var controllerGroup=this._controllerGroup,pageIconSize=legendModel.get("pageIconSize",!0),pageIconSizeArr=isArray(pageIconSize)?pageIconSize:[pageIconSize,pageIconSize];createPageButton("pagePrev",0);var pageTextStyleModel=legendModel.getModel("pageTextStyle");function createPageButton(name,iconIdx){var pageDataIndexName=name+"DataIndex",icon=createIcon(legendModel.get("pageIcons",!0)[legendModel.getOrient().name][iconIdx],{onclick:bind$1(self._pageGo,self,pageDataIndexName,legendModel,api)},{x:-pageIconSizeArr[0]/2,y:-pageIconSizeArr[1]/2,width:pageIconSizeArr[0],height:pageIconSizeArr[1]});icon.name=name,controllerGroup.add(icon)}controllerGroup.add(new ZRText$1({name:"pageText",style:{text:"xx/xx",fill:pageTextStyleModel.getTextColor(),font:pageTextStyleModel.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),createPageButton("pageNext",1)},ScrollableLegendView.prototype.layoutInner=function(legendModel,itemAlign,maxSize,isFirstRender,selector,selectorPosition){var selectorGroup=this.getSelectorGroup(),orientIdx=legendModel.getOrient().index,wh=WH[orientIdx],xy=XY[orientIdx],hw=WH[1-orientIdx],yx=XY[1-orientIdx];selector&&box("horizontal",selectorGroup,legendModel.get("selectorItemGap",!0));var selectorButtonGap=legendModel.get("selectorButtonGap",!0),selectorRect=selectorGroup.getBoundingRect(),selectorPos=[-selectorRect.x,-selectorRect.y],processMaxSize=clone$3(maxSize);selector&&(processMaxSize[wh]=maxSize[wh]-selectorRect[wh]-selectorButtonGap);var mainRect=this._layoutContentAndController(legendModel,isFirstRender,processMaxSize,orientIdx,wh,hw,yx,xy);if(selector){if("end"===selectorPosition)selectorPos[orientIdx]+=mainRect[wh]+selectorButtonGap;else{var offset=selectorRect[wh]+selectorButtonGap;selectorPos[orientIdx]-=offset,mainRect[xy]-=offset}mainRect[wh]+=selectorRect[wh]+selectorButtonGap,selectorPos[1-orientIdx]+=mainRect[yx]+mainRect[hw]/2-selectorRect[hw]/2,mainRect[hw]=Math.max(mainRect[hw],selectorRect[hw]),mainRect[yx]=Math.min(mainRect[yx],selectorRect[yx]+selectorPos[1-orientIdx]),selectorGroup.x=selectorPos[0],selectorGroup.y=selectorPos[1],selectorGroup.markRedraw()}return mainRect},ScrollableLegendView.prototype._layoutContentAndController=function(legendModel,isFirstRender,maxSize,orientIdx,wh,hw,yx,xy){var contentGroup=this.getContentGroup(),containerGroup=this._containerGroup,controllerGroup=this._controllerGroup;box(legendModel.get("orient"),contentGroup,legendModel.get("itemGap"),orientIdx?maxSize.width:null,orientIdx?null:maxSize.height),box("horizontal",controllerGroup,legendModel.get("pageButtonItemGap",!0));var contentRect=contentGroup.getBoundingRect(),controllerRect=controllerGroup.getBoundingRect(),showController=this._showController=contentRect[wh]>maxSize[wh],contentPos=[-contentRect.x,-contentRect.y];isFirstRender||(contentPos[orientIdx]=contentGroup[xy]);var containerPos=[0,0],controllerPos=[-controllerRect.x,-controllerRect.y],pageButtonGap=retrieve2(legendModel.get("pageButtonGap",!0),legendModel.get("itemGap",!0));showController&&("end"===legendModel.get("pageButtonPosition",!0)?controllerPos[orientIdx]+=maxSize[wh]-controllerRect[wh]:containerPos[orientIdx]+=controllerRect[wh]+pageButtonGap);controllerPos[1-orientIdx]+=contentRect[hw]/2-controllerRect[hw]/2,contentGroup.setPosition(contentPos),containerGroup.setPosition(containerPos),controllerGroup.setPosition(controllerPos);var mainRect={x:0,y:0};if(mainRect[wh]=showController?maxSize[wh]:contentRect[wh],mainRect[hw]=Math.max(contentRect[hw],controllerRect[hw]),mainRect[yx]=Math.min(0,controllerRect[yx]+controllerPos[1-orientIdx]),containerGroup.__rectSize=maxSize[wh],showController){var clipShape={x:0,y:0};clipShape[wh]=Math.max(maxSize[wh]-controllerRect[wh]-pageButtonGap,0),clipShape[hw]=mainRect[hw],containerGroup.setClipPath(new Rect$4({shape:clipShape})),containerGroup.__rectSize=clipShape[wh]}else controllerGroup.eachChild((function(child){child.attr({invisible:!0,silent:!0})}));var pageInfo=this._getPageInfo(legendModel);return null!=pageInfo.pageIndex&&updateProps$1(contentGroup,{x:pageInfo.contentPosition[0],y:pageInfo.contentPosition[1]},showController?legendModel:null),this._updatePageInfoView(legendModel,pageInfo),mainRect},ScrollableLegendView.prototype._pageGo=function(to,legendModel,api){var scrollDataIndex=this._getPageInfo(legendModel)[to];null!=scrollDataIndex&&api.dispatchAction({type:"legendScroll",scrollDataIndex:scrollDataIndex,legendId:legendModel.id})},ScrollableLegendView.prototype._updatePageInfoView=function(legendModel,pageInfo){var controllerGroup=this._controllerGroup;each$b(["pagePrev","pageNext"],(function(name){var canJump=null!=pageInfo[name+"DataIndex"],icon=controllerGroup.childOfName(name);icon&&(icon.setStyle("fill",canJump?legendModel.get("pageIconColor",!0):legendModel.get("pageIconInactiveColor",!0)),icon.cursor=canJump?"pointer":"default")}));var pageText=controllerGroup.childOfName("pageText"),pageFormatter=legendModel.get("pageFormatter"),pageIndex=pageInfo.pageIndex,current=null!=pageIndex?pageIndex+1:0,total=pageInfo.pageCount;pageText&&pageFormatter&&pageText.setStyle("text",isString(pageFormatter)?pageFormatter.replace("{current}",null==current?"":current+"").replace("{total}",null==total?"":total+""):pageFormatter({current:current,total:total}))},ScrollableLegendView.prototype._getPageInfo=function(legendModel){var scrollDataIndex=legendModel.get("scrollDataIndex",!0),contentGroup=this.getContentGroup(),containerRectSize=this._containerGroup.__rectSize,orientIdx=legendModel.getOrient().index,wh=WH[orientIdx],xy=XY[orientIdx],targetItemIndex=this._findTargetItemIndex(scrollDataIndex),children=contentGroup.children(),targetItem=children[targetItemIndex],itemCount=children.length,pCount=itemCount?1:0,result={contentPosition:[contentGroup.x,contentGroup.y],pageCount:pCount,pageIndex:pCount-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!targetItem)return result;var targetItemInfo=getItemInfo(targetItem);result.contentPosition[orientIdx]=-targetItemInfo.s;for(var i=targetItemIndex+1,winStartItemInfo=targetItemInfo,winEndItemInfo=targetItemInfo,currItemInfo=null;i<=itemCount;++i)(!(currItemInfo=getItemInfo(children[i]))&&winEndItemInfo.e>winStartItemInfo.s+containerRectSize||currItemInfo&&!intersect(currItemInfo,winStartItemInfo.s))&&(winStartItemInfo=winEndItemInfo.i>winStartItemInfo.i?winEndItemInfo:currItemInfo)&&(null==result.pageNextDataIndex&&(result.pageNextDataIndex=winStartItemInfo.i),++result.pageCount),winEndItemInfo=currItemInfo;for(i=targetItemIndex-1,winStartItemInfo=targetItemInfo,winEndItemInfo=targetItemInfo,currItemInfo=null;i>=-1;--i)(currItemInfo=getItemInfo(children[i]))&&intersect(winEndItemInfo,currItemInfo.s)||!(winStartItemInfo.i<winEndItemInfo.i)||(winEndItemInfo=winStartItemInfo,null==result.pagePrevDataIndex&&(result.pagePrevDataIndex=winStartItemInfo.i),++result.pageCount,++result.pageIndex),winStartItemInfo=currItemInfo;return result;function getItemInfo(el){if(el){var itemRect=el.getBoundingRect(),start=itemRect[xy]+el[xy];return{s:start,e:start+itemRect[wh],i:el.__legendDataIndex}}}function intersect(itemInfo,winStart){return itemInfo.e>=winStart&&itemInfo.s<=winStart+containerRectSize}},ScrollableLegendView.prototype._findTargetItemIndex=function(targetDataIndex){return this._showController?(this.getContentGroup().eachChild((function(child,idx){var legendDataIdx=child.__legendDataIndex;null==defaultIndex&&null!=legendDataIdx&&(defaultIndex=idx),legendDataIdx===targetDataIndex&&(index=idx)})),null!=index?index:defaultIndex):0;var index,defaultIndex},ScrollableLegendView.type="legend.scroll",ScrollableLegendView}(LegendView$1),ScrollableLegendView$1=ScrollableLegendView;function install$5(registers){use(install$6),registers.registerComponentModel(ScrollableLegendModel$1),registers.registerComponentView(ScrollableLegendView$1),function(registers){registers.registerAction("legendScroll","legendscroll",(function(payload,ecModel){var scrollDataIndex=payload.scrollDataIndex;null!=scrollDataIndex&&ecModel.eachComponent({mainType:"legend",subType:"scroll",query:payload},(function(legendModel){legendModel.setScrollDataIndex(scrollDataIndex)}))}))}(registers)}function install$4(registers){use(install$6),use(install$5)}var InsideZoomModel$1=function(_super){function InsideZoomModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=InsideZoomModel.type,_this}return __extends(InsideZoomModel,_super),InsideZoomModel.type="dataZoom.inside",InsideZoomModel.defaultOption=inheritDefaultOption(DataZoomModel$1.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),InsideZoomModel}(DataZoomModel$1),inner=makeInner();function disposeCoordSysRecord(coordSysRecordMap,coordSysRecord){if(coordSysRecord){coordSysRecordMap.removeKey(coordSysRecord.model.uid);var controller=coordSysRecord.controller;controller&&controller.dispose()}}function dispatchAction(api,batch){api.isDisposed()||api.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:batch})}function containsPoint(coordSysModel,e,x,y){return coordSysModel.coordinateSystem.containPoint([x,y])}function installDataZoomRoamProcessor(registers){registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER,(function(ecModel,api){var apiInner=inner(api),coordSysRecordMap=apiInner.coordSysRecordMap||(apiInner.coordSysRecordMap=createHashMap());coordSysRecordMap.each((function(coordSysRecord){coordSysRecord.dataZoomInfoMap=null})),ecModel.eachComponent({mainType:"dataZoom",subType:"inside"},(function(dataZoomModel){each$b(collectReferCoordSysModelInfo(dataZoomModel).infoList,(function(dzCoordSysInfo){var coordSysUid=dzCoordSysInfo.model.uid,coordSysRecord=coordSysRecordMap.get(coordSysUid)||coordSysRecordMap.set(coordSysUid,function(api,coordSysModel){var coordSysRecord={model:coordSysModel,containsPoint:curry$1(containsPoint,coordSysModel),dispatchAction:curry$1(dispatchAction,api),dataZoomInfoMap:null,controller:null},controller=coordSysRecord.controller=new RoamController$1(api.getZr());return each$b(["pan","zoom","scrollMove"],(function(eventName){controller.on(eventName,(function(event){var batch=[];coordSysRecord.dataZoomInfoMap.each((function(dzInfo){if(event.isAvailableBehavior(dzInfo.model.option)){var method=(dzInfo.getRange||{})[eventName],range=method&&method(dzInfo.dzReferCoordSysInfo,coordSysRecord.model.mainType,coordSysRecord.controller,event);!dzInfo.model.get("disabled",!0)&&range&&batch.push({dataZoomId:dzInfo.model.id,start:range[0],end:range[1]})}})),batch.length&&coordSysRecord.dispatchAction(batch)}))})),coordSysRecord}(api,dzCoordSysInfo.model));(coordSysRecord.dataZoomInfoMap||(coordSysRecord.dataZoomInfoMap=createHashMap())).set(dataZoomModel.uid,{dzReferCoordSysInfo:dzCoordSysInfo,model:dataZoomModel,getRange:null})}))})),coordSysRecordMap.each((function(coordSysRecord){var firstDzInfo,controller=coordSysRecord.controller,dataZoomInfoMap=coordSysRecord.dataZoomInfoMap;if(dataZoomInfoMap){var firstDzKey=dataZoomInfoMap.keys()[0];null!=firstDzKey&&(firstDzInfo=dataZoomInfoMap.get(firstDzKey))}if(firstDzInfo){var controllerParams=function(dataZoomInfoMap){var controlType,typePriority={type_true:2,type_move:1,type_false:0,type_undefined:-1},preventDefaultMouseMove=!0;return dataZoomInfoMap.each((function(dataZoomInfo){var dataZoomModel=dataZoomInfo.model,oneType=!dataZoomModel.get("disabled",!0)&&(!dataZoomModel.get("zoomLock",!0)||"move");typePriority["type_"+oneType]>typePriority["type_"+controlType]&&(controlType=oneType),preventDefaultMouseMove=preventDefaultMouseMove&&dataZoomModel.get("preventDefaultMouseMove",!0)})),{controlType:controlType,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!preventDefaultMouseMove}}}(dataZoomInfoMap);controller.enable(controllerParams.controlType,controllerParams.opt),controller.setPointerChecker(coordSysRecord.containsPoint),createOrUpdate(coordSysRecord,"dispatchAction",firstDzInfo.model.get("throttle",!0),"fixRate")}else disposeCoordSysRecord(coordSysRecordMap,coordSysRecord)}))}))}var InsideZoomView=function(_super){function InsideZoomView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type="dataZoom.inside",_this}return __extends(InsideZoomView,_super),InsideZoomView.prototype.render=function(dataZoomModel,ecModel,api){_super.prototype.render.apply(this,arguments),dataZoomModel.noTarget()?this._clear():(this.range=dataZoomModel.getPercentRange(),function(api,dataZoomModel,getRange){inner(api).coordSysRecordMap.each((function(coordSysRecord){var dzInfo=coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);dzInfo&&(dzInfo.getRange=getRange)}))}(api,dataZoomModel,{pan:bind$1(getRangeHandlers.pan,this),zoom:bind$1(getRangeHandlers.zoom,this),scrollMove:bind$1(getRangeHandlers.scrollMove,this)}))},InsideZoomView.prototype.dispose=function(){this._clear(),_super.prototype.dispose.apply(this,arguments)},InsideZoomView.prototype._clear=function(){!function(api,dataZoomModel){for(var coordSysRecordMap=inner(api).coordSysRecordMap,coordSysKeyArr=coordSysRecordMap.keys(),i=0;i<coordSysKeyArr.length;i++){var coordSysKey=coordSysKeyArr[i],coordSysRecord=coordSysRecordMap.get(coordSysKey),dataZoomInfoMap=coordSysRecord.dataZoomInfoMap;if(dataZoomInfoMap){var dzUid=dataZoomModel.uid;dataZoomInfoMap.get(dzUid)&&(dataZoomInfoMap.removeKey(dzUid),dataZoomInfoMap.keys().length||disposeCoordSysRecord(coordSysRecordMap,coordSysRecord))}}}(this.api,this.dataZoomModel),this.range=null},InsideZoomView.type="dataZoom.inside",InsideZoomView}(DataZoomView$1),getRangeHandlers={zoom:function(coordSysInfo,coordSysMainType,controller,e){var lastRange=this.range,range=lastRange.slice(),axisModel=coordSysInfo.axisModels[0];if(axisModel){var directionInfo=getDirectionInfo[coordSysMainType](null,[e.originX,e.originY],axisModel,controller,coordSysInfo),percentPoint=(directionInfo.signal>0?directionInfo.pixelStart+directionInfo.pixelLength-directionInfo.pixel:directionInfo.pixel-directionInfo.pixelStart)/directionInfo.pixelLength*(range[1]-range[0])+range[0],scale=Math.max(1/e.scale,0);range[0]=(range[0]-percentPoint)*scale+percentPoint,range[1]=(range[1]-percentPoint)*scale+percentPoint;var minMaxSpan=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return sliderMove(0,range,[0,100],0,minMaxSpan.minSpan,minMaxSpan.maxSpan),this.range=range,lastRange[0]!==range[0]||lastRange[1]!==range[1]?range:void 0}},pan:makeMover((function(range,axisModel,coordSysInfo,coordSysMainType,controller,e){var directionInfo=getDirectionInfo[coordSysMainType]([e.oldX,e.oldY],[e.newX,e.newY],axisModel,controller,coordSysInfo);return directionInfo.signal*(range[1]-range[0])*directionInfo.pixel/directionInfo.pixelLength})),scrollMove:makeMover((function(range,axisModel,coordSysInfo,coordSysMainType,controller,e){return getDirectionInfo[coordSysMainType]([0,0],[e.scrollDelta,e.scrollDelta],axisModel,controller,coordSysInfo).signal*(range[1]-range[0])*e.scrollDelta}))};function makeMover(getPercentDelta){return function(coordSysInfo,coordSysMainType,controller,e){var lastRange=this.range,range=lastRange.slice(),axisModel=coordSysInfo.axisModels[0];if(axisModel)return sliderMove(getPercentDelta(range,axisModel,coordSysInfo,coordSysMainType,controller,e),range,[0,100],"all"),this.range=range,lastRange[0]!==range[0]||lastRange[1]!==range[1]?range:void 0}}var getDirectionInfo={grid:function(oldPoint,newPoint,axisModel,controller,coordSysInfo){var axis=axisModel.axis,ret={},rect=coordSysInfo.model.coordinateSystem.getRect();return oldPoint=oldPoint||[0,0],"x"===axis.dim?(ret.pixel=newPoint[0]-oldPoint[0],ret.pixelLength=rect.width,ret.pixelStart=rect.x,ret.signal=axis.inverse?1:-1):(ret.pixel=newPoint[1]-oldPoint[1],ret.pixelLength=rect.height,ret.pixelStart=rect.y,ret.signal=axis.inverse?-1:1),ret},polar:function(oldPoint,newPoint,axisModel,controller,coordSysInfo){var axis=axisModel.axis,ret={},polar=coordSysInfo.model.coordinateSystem,radiusExtent=polar.getRadiusAxis().getExtent(),angleExtent=polar.getAngleAxis().getExtent();return oldPoint=oldPoint?polar.pointToCoord(oldPoint):[0,0],newPoint=polar.pointToCoord(newPoint),"radiusAxis"===axisModel.mainType?(ret.pixel=newPoint[0]-oldPoint[0],ret.pixelLength=radiusExtent[1]-radiusExtent[0],ret.pixelStart=radiusExtent[0],ret.signal=axis.inverse?1:-1):(ret.pixel=newPoint[1]-oldPoint[1],ret.pixelLength=angleExtent[1]-angleExtent[0],ret.pixelStart=angleExtent[0],ret.signal=axis.inverse?-1:1),ret},singleAxis:function(oldPoint,newPoint,axisModel,controller,coordSysInfo){var axis=axisModel.axis,rect=coordSysInfo.model.coordinateSystem.getRect(),ret={};return oldPoint=oldPoint||[0,0],"horizontal"===axis.orient?(ret.pixel=newPoint[0]-oldPoint[0],ret.pixelLength=rect.width,ret.pixelStart=rect.x,ret.signal=axis.inverse?1:-1):(ret.pixel=newPoint[1]-oldPoint[1],ret.pixelLength=rect.height,ret.pixelStart=rect.y,ret.signal=axis.inverse?-1:1),ret}},InsideZoomView$1=InsideZoomView;function install$3(registers){installCommon(registers),registers.registerComponentModel(InsideZoomModel$1),registers.registerComponentView(InsideZoomView$1),installDataZoomRoamProcessor(registers)}var SliderZoomModel$1=function(_super){function SliderZoomModel(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=SliderZoomModel.type,_this}return __extends(SliderZoomModel,_super),SliderZoomModel.type="dataZoom.slider",SliderZoomModel.layoutMode="box",SliderZoomModel.defaultOption=inheritDefaultOption(DataZoomModel$1.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),SliderZoomModel}(DataZoomModel$1),Rect$1=Rect$4,SHOW_DATA_SHADOW_SERIES_TYPE=["line","bar","candlestick","scatter"],REALTIME_ANIMATION_CONFIG={easing:"cubicOut",duration:100,delay:0},SliderZoomView=function(_super){function SliderZoomView(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.type=SliderZoomView.type,_this._displayables={},_this}return __extends(SliderZoomView,_super),SliderZoomView.prototype.init=function(ecModel,api){this.api=api,this._onBrush=bind$1(this._onBrush,this),this._onBrushEnd=bind$1(this._onBrushEnd,this)},SliderZoomView.prototype.render=function(dataZoomModel,ecModel,api,payload){if(_super.prototype.render.apply(this,arguments),createOrUpdate(this,"_dispatchZoomAction",dataZoomModel.get("throttle"),"fixRate"),this._orient=dataZoomModel.getOrient(),!1!==dataZoomModel.get("show")){if(dataZoomModel.noTarget())return this._clear(),void this.group.removeAll();payload&&"dataZoom"===payload.type&&payload.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},SliderZoomView.prototype.dispose=function(){this._clear(),_super.prototype.dispose.apply(this,arguments)},SliderZoomView.prototype._clear=function(){clear$1(this,"_dispatchZoomAction");var zr=this.api.getZr();zr.off("mousemove",this._onBrush),zr.off("mouseup",this._onBrushEnd)},SliderZoomView.prototype._buildView=function(){var thisGroup=this.group;thisGroup.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var barGroup=this._displayables.sliderGroup=new Group$4;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),thisGroup.add(barGroup),this._positionGroup()},SliderZoomView.prototype._resetLocation=function(){var dataZoomModel=this.dataZoomModel,api=this.api,moveHandleSize=dataZoomModel.get("brushSelect")?7:0,coordRect=this._findCoordRect(),ecSize={width:api.getWidth(),height:api.getHeight()},positionInfo="horizontal"===this._orient?{right:ecSize.width-coordRect.x-coordRect.width,top:ecSize.height-30-7-moveHandleSize,width:coordRect.width,height:30}:{right:7,top:coordRect.y,width:30,height:coordRect.height},layoutParams=getLayoutParams(dataZoomModel.option);each$b(["right","top","width","height"],(function(name){"ph"===layoutParams[name]&&(layoutParams[name]=positionInfo[name])}));var layoutRect=getLayoutRect(layoutParams,ecSize);this._location={x:layoutRect.x,y:layoutRect.y},this._size=[layoutRect.width,layoutRect.height],"vertical"===this._orient&&this._size.reverse()},SliderZoomView.prototype._positionGroup=function(){var thisGroup=this.group,location=this._location,orient=this._orient,targetAxisModel=this.dataZoomModel.getFirstTargetAxisModel(),inverse=targetAxisModel&&targetAxisModel.get("inverse"),sliderGroup=this._displayables.sliderGroup,otherAxisInverse=(this._dataShadowInfo||{}).otherAxisInverse;sliderGroup.attr("horizontal"!==orient||inverse?"horizontal"===orient&&inverse?{scaleY:otherAxisInverse?1:-1,scaleX:-1}:"vertical"!==orient||inverse?{scaleY:otherAxisInverse?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:otherAxisInverse?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:otherAxisInverse?1:-1,scaleX:1});var rect=thisGroup.getBoundingRect([sliderGroup]);thisGroup.x=location.x-rect.x,thisGroup.y=location.y-rect.y,thisGroup.markRedraw()},SliderZoomView.prototype._getViewExtent=function(){return[0,this._size[0]]},SliderZoomView.prototype._renderBackground=function(){var dataZoomModel=this.dataZoomModel,size=this._size,barGroup=this._displayables.sliderGroup,brushSelect=dataZoomModel.get("brushSelect");barGroup.add(new Rect$1({silent:!0,shape:{x:0,y:0,width:size[0],height:size[1]},style:{fill:dataZoomModel.get("backgroundColor")},z2:-40}));var clickPanel=new Rect$1({shape:{x:0,y:0,width:size[0],height:size[1]},style:{fill:"transparent"},z2:0,onclick:bind$1(this._onClickPanel,this)}),zr=this.api.getZr();brushSelect?(clickPanel.on("mousedown",this._onBrushStart,this),clickPanel.cursor="crosshair",zr.on("mousemove",this._onBrush),zr.on("mouseup",this._onBrushEnd)):(zr.off("mousemove",this._onBrush),zr.off("mouseup",this._onBrushEnd)),barGroup.add(clickPanel)},SliderZoomView.prototype._renderDataShadow=function(){var info=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],info){var size=this._size,oldSize=this._shadowSize||[],seriesModel=info.series,data=seriesModel.getRawData(),candlestickDim=seriesModel.getShadowDim&&seriesModel.getShadowDim(),otherDim=candlestickDim&&data.getDimensionInfo(candlestickDim)?seriesModel.getShadowDim():info.otherDim;if(null!=otherDim){var polygonPts=this._shadowPolygonPts,polylinePts=this._shadowPolylinePts;if(data!==this._shadowData||otherDim!==this._shadowDim||size[0]!==oldSize[0]||size[1]!==oldSize[1]){var otherDataExtent_1=data.getDataExtent(otherDim),otherOffset=.3*(otherDataExtent_1[1]-otherDataExtent_1[0]);otherDataExtent_1=[otherDataExtent_1[0]-otherOffset,otherDataExtent_1[1]+otherOffset];var lastIsEmpty_1,otherShadowExtent_1=[0,size[1]],thisShadowExtent=[0,size[0]],areaPoints_1=[[size[0],0],[0,0]],linePoints_1=[],step_1=thisShadowExtent[1]/(data.count()-1),thisCoord_1=0,stride_1=Math.round(data.count()/size[0]);data.each([otherDim],(function(value,index){if(stride_1>0&&index%stride_1)thisCoord_1+=step_1;else{var isEmpty=null==value||isNaN(value)||""===value,otherCoord=isEmpty?0:linearMap(value,otherDataExtent_1,otherShadowExtent_1,!0);isEmpty&&!lastIsEmpty_1&&index?(areaPoints_1.push([areaPoints_1[areaPoints_1.length-1][0],0]),linePoints_1.push([linePoints_1[linePoints_1.length-1][0],0])):!isEmpty&&lastIsEmpty_1&&(areaPoints_1.push([thisCoord_1,0]),linePoints_1.push([thisCoord_1,0])),areaPoints_1.push([thisCoord_1,otherCoord]),linePoints_1.push([thisCoord_1,otherCoord]),thisCoord_1+=step_1,lastIsEmpty_1=isEmpty}})),polygonPts=this._shadowPolygonPts=areaPoints_1,polylinePts=this._shadowPolylinePts=linePoints_1}this._shadowData=data,this._shadowDim=otherDim,this._shadowSize=[size[0],size[1]];for(var dataZoomModel=this.dataZoomModel,i=0;i<3;i++){var group=createDataShadowGroup(1===i);this._displayables.sliderGroup.add(group),this._displayables.dataShadowSegs.push(group)}}}function createDataShadowGroup(isSelectedArea){var model=dataZoomModel.getModel(isSelectedArea?"selectedDataBackground":"dataBackground"),group=new Group$4,polygon=new Polygon$1({shape:{points:polygonPts},segmentIgnoreThreshold:1,style:model.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),polyline=new Polyline$1({shape:{points:polylinePts},segmentIgnoreThreshold:1,style:model.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return group.add(polygon),group.add(polyline),group}},SliderZoomView.prototype._prepareDataShadowInfo=function(){var dataZoomModel=this.dataZoomModel,showDataShadow=dataZoomModel.get("showDataShadow");if(!1!==showDataShadow){var result,ecModel=this.ecModel;return dataZoomModel.eachTargetAxis((function(axisDim,axisIndex){each$b(dataZoomModel.getAxisProxy(axisDim,axisIndex).getTargetSeriesModels(),(function(seriesModel){if(!(result||!0!==showDataShadow&&indexOf(SHOW_DATA_SHADOW_SERIES_TYPE,seriesModel.get("type"))<0)){var otherAxisInverse,thisAxis=ecModel.getComponent(getAxisMainType(axisDim),axisIndex).axis,otherDim=function(thisDim){var map={x:"y",y:"x",radius:"angle",angle:"radius"};return map[thisDim]}(axisDim),coordSys=seriesModel.coordinateSystem;null!=otherDim&&coordSys.getOtherAxis&&(otherAxisInverse=coordSys.getOtherAxis(thisAxis).inverse),otherDim=seriesModel.getData().mapDimension(otherDim),result={thisAxis:thisAxis,series:seriesModel,thisDim:axisDim,otherDim:otherDim,otherAxisInverse:otherAxisInverse}}}),this)}),this),result}},SliderZoomView.prototype._renderHandle=function(){var thisGroup=this.group,displayables=this._displayables,handles=displayables.handles=[null,null],handleLabels=displayables.handleLabels=[null,null],sliderGroup=this._displayables.sliderGroup,size=this._size,dataZoomModel=this.dataZoomModel,api=this.api,borderRadius=dataZoomModel.get("borderRadius")||0,brushSelect=dataZoomModel.get("brushSelect"),filler=displayables.filler=new Rect$1({silent:brushSelect,style:{fill:dataZoomModel.get("fillerColor")},textConfig:{position:"inside"}});sliderGroup.add(filler),sliderGroup.add(new Rect$1({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:size[0],height:size[1],r:borderRadius},style:{stroke:dataZoomModel.get("dataBackgroundColor")||dataZoomModel.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),each$b([0,1],(function(handleIndex){var iconStr=dataZoomModel.get("handleIcon");!symbolBuildProxies[iconStr]&&iconStr.indexOf("path://")<0&&iconStr.indexOf("image://")<0&&(iconStr="path://"+iconStr,"production"!==process.env.NODE_ENV&&deprecateLog("handleIcon now needs 'path://' prefix when using a path string"));var path=createSymbol$1(iconStr,-1,0,2,2,null,!0);path.attr({cursor:getCursor(this._orient),draggable:!0,drift:bind$1(this._onDragMove,this,handleIndex),ondragend:bind$1(this._onDragEnd,this),onmouseover:bind$1(this._showDataInfo,this,!0),onmouseout:bind$1(this._showDataInfo,this,!1),z2:5});var bRect=path.getBoundingRect(),handleSize=dataZoomModel.get("handleSize");this._handleHeight=parsePercent(handleSize,this._size[1]),this._handleWidth=bRect.width/bRect.height*this._handleHeight,path.setStyle(dataZoomModel.getModel("handleStyle").getItemStyle()),path.style.strokeNoScale=!0,path.rectHover=!0,path.ensureState("emphasis").style=dataZoomModel.getModel(["emphasis","handleStyle"]).getItemStyle(),enableHoverEmphasis(path);var handleColor=dataZoomModel.get("handleColor");null!=handleColor&&(path.style.fill=handleColor),sliderGroup.add(handles[handleIndex]=path);var textStyleModel=dataZoomModel.getModel("textStyle"),handleLabelShow=(dataZoomModel.get("handleLabel")||{}).show||!1;thisGroup.add(handleLabels[handleIndex]=new ZRText$1({silent:!0,invisible:!handleLabelShow,style:createTextStyle(textStyleModel,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:textStyleModel.getTextColor(),font:textStyleModel.getFont()}),z2:10}))}),this);var actualMoveZone=filler;if(brushSelect){var moveHandleHeight=parsePercent(dataZoomModel.get("moveHandleSize"),size[1]),moveHandle_1=displayables.moveHandle=new Rect$4({style:dataZoomModel.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:size[1]-.5,height:moveHandleHeight}}),iconSize=.8*moveHandleHeight,moveHandleIcon=displayables.moveHandleIcon=createSymbol$1(dataZoomModel.get("moveHandleIcon"),-iconSize/2,-iconSize/2,iconSize,iconSize,"#fff",!0);moveHandleIcon.silent=!0,moveHandleIcon.y=size[1]+moveHandleHeight/2-.5,moveHandle_1.ensureState("emphasis").style=dataZoomModel.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var moveZoneExpandSize=Math.min(size[1]/2,Math.max(moveHandleHeight,10));(actualMoveZone=displayables.moveZone=new Rect$4({invisible:!0,shape:{y:size[1]-moveZoneExpandSize,height:moveHandleHeight+moveZoneExpandSize}})).on("mouseover",(function(){api.enterEmphasis(moveHandle_1)})).on("mouseout",(function(){api.leaveEmphasis(moveHandle_1)})),sliderGroup.add(moveHandle_1),sliderGroup.add(moveHandleIcon),sliderGroup.add(actualMoveZone)}actualMoveZone.attr({draggable:!0,cursor:getCursor(this._orient),drift:bind$1(this._onDragMove,this,"all"),ondragstart:bind$1(this._showDataInfo,this,!0),ondragend:bind$1(this._onDragEnd,this),onmouseover:bind$1(this._showDataInfo,this,!0),onmouseout:bind$1(this._showDataInfo,this,!1)})},SliderZoomView.prototype._resetInterval=function(){var range=this._range=this.dataZoomModel.getPercentRange(),viewExtent=this._getViewExtent();this._handleEnds=[linearMap(range[0],[0,100],viewExtent,!0),linearMap(range[1],[0,100],viewExtent,!0)]},SliderZoomView.prototype._updateInterval=function(handleIndex,delta){var dataZoomModel=this.dataZoomModel,handleEnds=this._handleEnds,viewExtend=this._getViewExtent(),minMaxSpan=dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(),percentExtent=[0,100];sliderMove(delta,handleEnds,viewExtend,dataZoomModel.get("zoomLock")?"all":handleIndex,null!=minMaxSpan.minSpan?linearMap(minMaxSpan.minSpan,percentExtent,viewExtend,!0):null,null!=minMaxSpan.maxSpan?linearMap(minMaxSpan.maxSpan,percentExtent,viewExtend,!0):null);var lastRange=this._range,range=this._range=asc$1([linearMap(handleEnds[0],viewExtend,percentExtent,!0),linearMap(handleEnds[1],viewExtend,percentExtent,!0)]);return!lastRange||lastRange[0]!==range[0]||lastRange[1]!==range[1]},SliderZoomView.prototype._updateView=function(nonRealtime){var displaybles=this._displayables,handleEnds=this._handleEnds,handleInterval=asc$1(handleEnds.slice()),size=this._size;each$b([0,1],(function(handleIndex){var handle=displaybles.handles[handleIndex],handleHeight=this._handleHeight;handle.attr({scaleX:handleHeight/2,scaleY:handleHeight/2,x:handleEnds[handleIndex]+(handleIndex?-1:1),y:size[1]/2-handleHeight/2})}),this),displaybles.filler.setShape({x:handleInterval[0],y:0,width:handleInterval[1]-handleInterval[0],height:size[1]});var viewExtent={x:handleInterval[0],width:handleInterval[1]-handleInterval[0]};displaybles.moveHandle&&(displaybles.moveHandle.setShape(viewExtent),displaybles.moveZone.setShape(viewExtent),displaybles.moveZone.getBoundingRect(),displaybles.moveHandleIcon&&displaybles.moveHandleIcon.attr("x",viewExtent.x+viewExtent.width/2));for(var dataShadowSegs=displaybles.dataShadowSegs,segIntervals=[0,handleInterval[0],handleInterval[1],size[0]],i=0;i<dataShadowSegs.length;i++){var segGroup=dataShadowSegs[i],clipPath=segGroup.getClipPath();clipPath||(clipPath=new Rect$4,segGroup.setClipPath(clipPath)),clipPath.setShape({x:segIntervals[i],y:0,width:segIntervals[i+1]-segIntervals[i],height:size[1]})}this._updateDataInfo(nonRealtime)},SliderZoomView.prototype._updateDataInfo=function(nonRealtime){var dataZoomModel=this.dataZoomModel,displaybles=this._displayables,handleLabels=displaybles.handleLabels,orient=this._orient,labelTexts=["",""];if(dataZoomModel.get("showDetail")){var axisProxy=dataZoomModel.findRepresentativeAxisProxy();if(axisProxy){var axis=axisProxy.getAxisModel().axis,range=this._range,dataInterval=nonRealtime?axisProxy.calculateDataWindow({start:range[0],end:range[1]}).valueWindow:axisProxy.getDataValueWindow();labelTexts=[this._formatLabel(dataInterval[0],axis),this._formatLabel(dataInterval[1],axis)]}}var orderedHandleEnds=asc$1(this._handleEnds.slice());function setLabel(handleIndex){var barTransform=getTransform$1(displaybles.handles[handleIndex].parent,this.group),direction=transformDirection(0===handleIndex?"right":"left",barTransform),offset=this._handleWidth/2+5,textPoint=applyTransform([orderedHandleEnds[handleIndex]+(0===handleIndex?-offset:offset),this._size[1]/2],barTransform);handleLabels[handleIndex].setStyle({x:textPoint[0],y:textPoint[1],verticalAlign:"horizontal"===orient?"middle":direction,align:"horizontal"===orient?direction:"center",text:labelTexts[handleIndex]})}setLabel.call(this,0),setLabel.call(this,1)},SliderZoomView.prototype._formatLabel=function(value,axis){var dataZoomModel=this.dataZoomModel,labelFormatter=dataZoomModel.get("labelFormatter"),labelPrecision=dataZoomModel.get("labelPrecision");null!=labelPrecision&&"auto"!==labelPrecision||(labelPrecision=axis.getPixelPrecision());var valueStr=null==value||isNaN(value)?"":"category"===axis.type||"time"===axis.type?axis.scale.getLabel({value:Math.round(value)}):value.toFixed(Math.min(labelPrecision,20));return isFunction(labelFormatter)?labelFormatter(value,valueStr):isString(labelFormatter)?labelFormatter.replace("{value}",valueStr):valueStr},SliderZoomView.prototype._showDataInfo=function(isEmphasis){var normalShow=(this.dataZoomModel.get("handleLabel")||{}).show||!1,emphasisShow=this.dataZoomModel.getModel(["emphasis","handleLabel"]).get("show")||!1,toShow=isEmphasis||this._dragging?emphasisShow:normalShow,displayables=this._displayables,handleLabels=displayables.handleLabels;handleLabels[0].attr("invisible",!toShow),handleLabels[1].attr("invisible",!toShow),displayables.moveHandle&&this.api[toShow?"enterEmphasis":"leaveEmphasis"](displayables.moveHandle,1)},SliderZoomView.prototype._onDragMove=function(handleIndex,dx,dy,event){this._dragging=!0,stop(event.event);var vertex=applyTransform([dx,dy],this._displayables.sliderGroup.getLocalTransform(),!0),changed=this._updateInterval(handleIndex,vertex[0]),realtime=this.dataZoomModel.get("realtime");this._updateView(!realtime),changed&&realtime&&this._dispatchZoomAction(!0)},SliderZoomView.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},SliderZoomView.prototype._onClickPanel=function(e){var size=this._size,localPoint=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(localPoint[0]<0||localPoint[0]>size[0]||localPoint[1]<0||localPoint[1]>size[1])){var handleEnds=this._handleEnds,center=(handleEnds[0]+handleEnds[1])/2,changed=this._updateInterval("all",localPoint[0]-center);this._updateView(),changed&&this._dispatchZoomAction(!1)}},SliderZoomView.prototype._onBrushStart=function(e){var x=e.offsetX,y=e.offsetY;this._brushStart=new Point$1(x,y),this._brushing=!0,this._brushStartTime=+new Date},SliderZoomView.prototype._onBrushEnd=function(e){if(this._brushing){var brushRect=this._displayables.brushRect;if(this._brushing=!1,brushRect){brushRect.attr("ignore",!0);var brushShape=brushRect.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(brushShape.width)<5)){var viewExtend=this._getViewExtent(),percentExtent=[0,100];this._range=asc$1([linearMap(brushShape.x,viewExtend,percentExtent,!0),linearMap(brushShape.x+brushShape.width,viewExtend,percentExtent,!0)]),this._handleEnds=[brushShape.x,brushShape.x+brushShape.width],this._updateView(),this._dispatchZoomAction(!1)}}}},SliderZoomView.prototype._onBrush=function(e){this._brushing&&(stop(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},SliderZoomView.prototype._updateBrushRect=function(mouseX,mouseY){var displayables=this._displayables,dataZoomModel=this.dataZoomModel,brushRect=displayables.brushRect;brushRect||(brushRect=displayables.brushRect=new Rect$1({silent:!0,style:dataZoomModel.getModel("brushStyle").getItemStyle()}),displayables.sliderGroup.add(brushRect)),brushRect.attr("ignore",!1);var brushStart=this._brushStart,sliderGroup=this._displayables.sliderGroup,endPoint=sliderGroup.transformCoordToLocal(mouseX,mouseY),startPoint=sliderGroup.transformCoordToLocal(brushStart.x,brushStart.y),size=this._size;endPoint[0]=Math.max(Math.min(size[0],endPoint[0]),0),brushRect.setShape({x:startPoint[0],y:0,width:endPoint[0]-startPoint[0],height:size[1]})},SliderZoomView.prototype._dispatchZoomAction=function(realtime){var range=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:realtime?REALTIME_ANIMATION_CONFIG:null,start:range[0],end:range[1]})},SliderZoomView.prototype._findCoordRect=function(){var rect,coordSysInfoList=collectReferCoordSysModelInfo(this.dataZoomModel).infoList;if(!rect&&coordSysInfoList.length){var coordSys=coordSysInfoList[0].model.coordinateSystem;rect=coordSys.getRect&&coordSys.getRect()}if(!rect){var width=this.api.getWidth(),height=this.api.getHeight();rect={x:.2*width,y:.2*height,width:.6*width,height:.6*height}}return rect},SliderZoomView.type="dataZoom.slider",SliderZoomView}(DataZoomView$1);function getCursor(orient){return"vertical"===orient?"ns-resize":"ew-resize"}var SliderZoomView$1=SliderZoomView;function install$2(registers){registers.registerComponentModel(SliderZoomModel$1),registers.registerComponentView(SliderZoomView$1),installCommon(registers)}function install$1(registers){use(install$3),use(install$2)}var CMD=PathProxy$1.CMD;function aroundEqual(a,b){return Math.abs(a-b)<1e-5}function pathToBezierCurves(path){var currentSubpath,x1,y1,x2,y2,data=path.data,len=path.len(),bezierArrayGroups=[],xi=0,yi=0,x0=0,y0=0;function createNewSubpath(x,y){currentSubpath&&currentSubpath.length>2&&bezierArrayGroups.push(currentSubpath),currentSubpath=[x,y]}function addLine(x0,y0,x1,y1){aroundEqual(x0,x1)&&aroundEqual(y0,y1)||currentSubpath.push(x0,y0,x1,y1,x1,y1)}function addArc(startAngle,endAngle,cx,cy,rx,ry){var delta=Math.abs(endAngle-startAngle),len=4*Math.tan(delta/4)/3,dir=endAngle<startAngle?-1:1,c1=Math.cos(startAngle),s1=Math.sin(startAngle),c2=Math.cos(endAngle),s2=Math.sin(endAngle),x1=c1*rx+cx,y1=s1*ry+cy,x4=c2*rx+cx,y4=s2*ry+cy,hx=rx*len*dir,hy=ry*len*dir;currentSubpath.push(x1-hx*s1,y1+hy*c1,x4+hx*s2,y4-hy*c2,x4,y4)}for(var i=0;i<len;){var cmd=data[i++],isFirst=1===i;switch(isFirst&&(x0=xi=data[i],y0=yi=data[i+1],cmd!==CMD.L&&cmd!==CMD.C&&cmd!==CMD.Q||(currentSubpath=[x0,y0])),cmd){case CMD.M:xi=x0=data[i++],yi=y0=data[i++],createNewSubpath(x0,y0);break;case CMD.L:addLine(xi,yi,x1=data[i++],y1=data[i++]),xi=x1,yi=y1;break;case CMD.C:currentSubpath.push(data[i++],data[i++],data[i++],data[i++],xi=data[i++],yi=data[i++]);break;case CMD.Q:x1=data[i++],y1=data[i++],x2=data[i++],y2=data[i++],currentSubpath.push(xi+2/3*(x1-xi),yi+2/3*(y1-yi),x2+2/3*(x1-x2),y2+2/3*(y1-y2),x2,y2),xi=x2,yi=y2;break;case CMD.A:var cx=data[i++],cy=data[i++],rx=data[i++],ry=data[i++],startAngle=data[i++],endAngle=data[i++]+startAngle;i+=1;var anticlockwise=!data[i++];x1=Math.cos(startAngle)*rx+cx,y1=Math.sin(startAngle)*ry+cy,isFirst?createNewSubpath(x0=x1,y0=y1):addLine(xi,yi,x1,y1),xi=Math.cos(endAngle)*rx+cx,yi=Math.sin(endAngle)*ry+cy;for(var step=(anticlockwise?-1:1)*Math.PI/2,angle=startAngle;anticlockwise?angle>endAngle:angle<endAngle;angle+=step){addArc(angle,anticlockwise?Math.max(angle+step,endAngle):Math.min(angle+step,endAngle),cx,cy,rx,ry)}break;case CMD.R:x0=xi=data[i++],y0=yi=data[i++],x1=x0+data[i++],y1=y0+data[i++],createNewSubpath(x1,y0),addLine(x1,y0,x1,y1),addLine(x1,y1,x0,y1),addLine(x0,y1,x0,y0),addLine(x0,y0,x1,y0);break;case CMD.Z:currentSubpath&&addLine(xi,yi,x0,y0),xi=x0,yi=y0}}return currentSubpath&&currentSubpath.length>2&&bezierArrayGroups.push(currentSubpath),bezierArrayGroups}function adpativeBezier(x0,y0,x1,y1,x2,y2,x3,y3,out,scale){if(aroundEqual(x0,x1)&&aroundEqual(y0,y1)&&aroundEqual(x2,x3)&&aroundEqual(y2,y3))out.push(x3,y3);else{var PIXEL_DISTANCE=2/scale,PIXEL_DISTANCE_SQR=PIXEL_DISTANCE*PIXEL_DISTANCE,dx=x3-x0,dy=y3-y0,d=Math.sqrt(dx*dx+dy*dy);dx/=d,dy/=d;var dx1=x1-x0,dy1=y1-y0,dx2=x2-x3,dy2=y2-y3,cp1LenSqr=dx1*dx1+dy1*dy1,cp2LenSqr=dx2*dx2+dy2*dy2;if(cp1LenSqr<PIXEL_DISTANCE_SQR&&cp2LenSqr<PIXEL_DISTANCE_SQR)out.push(x3,y3);else{var projLen1=dx*dx1+dy*dy1,projLen2=-dx*dx2-dy*dy2;if(cp1LenSqr-projLen1*projLen1<PIXEL_DISTANCE_SQR&&projLen1>=0&&cp2LenSqr-projLen2*projLen2<PIXEL_DISTANCE_SQR&&projLen2>=0)out.push(x3,y3);else{var tmpSegX=[],tmpSegY=[];cubicSubdivide(x0,x1,x2,x3,.5,tmpSegX),cubicSubdivide(y0,y1,y2,y3,.5,tmpSegY),adpativeBezier(tmpSegX[0],tmpSegY[0],tmpSegX[1],tmpSegY[1],tmpSegX[2],tmpSegY[2],tmpSegX[3],tmpSegY[3],out,scale),adpativeBezier(tmpSegX[4],tmpSegY[4],tmpSegX[5],tmpSegY[5],tmpSegX[6],tmpSegY[6],tmpSegX[7],tmpSegY[7],out,scale)}}}}function getDividingGrids(dimSize,rowDim,count){var rowSize=dimSize[rowDim],columnSize=dimSize[1-rowDim],ratio=Math.abs(rowSize/columnSize),rowCount=Math.ceil(Math.sqrt(ratio*count)),columnCount=Math.floor(count/rowCount);0===columnCount&&(columnCount=1,rowCount=count);for(var grids=[],i=0;i<rowCount;i++)grids.push(columnCount);var remained=count-rowCount*columnCount;if(remained>0)for(i=0;i<remained;i++)grids[i%rowCount]+=1;return grids}function divideSector(sectorShape,count,outShapes){for(var r0=sectorShape.r0,r=sectorShape.r,startAngle=sectorShape.startAngle,endAngle=sectorShape.endAngle,angle=Math.abs(endAngle-startAngle),arcLen=angle*r,deltaR=r-r0,isAngleRow=arcLen>Math.abs(deltaR),grids=getDividingGrids([arcLen,deltaR],isAngleRow?0:1,count),rowSize=(isAngleRow?angle:deltaR)/grids.length,row=0;row<grids.length;row++)for(var columnSize=(isAngleRow?deltaR:angle)/grids[row],column=0;column<grids[row];column++){var newShape={};isAngleRow?(newShape.startAngle=startAngle+rowSize*row,newShape.endAngle=startAngle+rowSize*(row+1),newShape.r0=r0+columnSize*column,newShape.r=r0+columnSize*(column+1)):(newShape.startAngle=startAngle+columnSize*column,newShape.endAngle=startAngle+columnSize*(column+1),newShape.r0=r0+rowSize*row,newShape.r=r0+rowSize*(row+1)),newShape.clockwise=sectorShape.clockwise,newShape.cx=sectorShape.cx,newShape.cy=sectorShape.cy,outShapes.push(newShape)}}function crossProduct2d(x1,y1,x2,y2){return x1*y2-x2*y1}function lineLineIntersect(a1x,a1y,a2x,a2y,b1x,b1y,b2x,b2y){var mx=a2x-a1x,my=a2y-a1y,nx=b2x-b1x,ny=b2y-b1y,nmCrossProduct=crossProduct2d(nx,ny,mx,my);if(Math.abs(nmCrossProduct)<1e-6)return null;var p=crossProduct2d(a1x-b1x,a1y-b1y,nx,ny)/nmCrossProduct;return p<0||p>1?null:new Point$1(p*mx+a1x,p*my+a1y)}function projPtOnLine(pt,lineA,lineB){var dir=new Point$1;Point$1.sub(dir,lineB,lineA),dir.normalize();var dir2=new Point$1;return Point$1.sub(dir2,pt,lineA),dir2.dot(dir)}function addToPoly(poly,pt){var last=poly[poly.length-1];last&&last[0]===pt[0]&&last[1]===pt[1]||poly.push(pt)}function binaryDividePolygon(polygonShape){var points=polygonShape.points,min=[],max=[];fromPoints(points,min,max);var boundingRect=new BoundingRect$1(min[0],min[1],max[0]-min[0],max[1]-min[1]),width=boundingRect.width,height=boundingRect.height,x=boundingRect.x,y=boundingRect.y,pt0=new Point$1,pt1=new Point$1;return width>height?(pt0.x=pt1.x=x+width/2,pt0.y=y,pt1.y=y+height):(pt0.y=pt1.y=y+height/2,pt0.x=x,pt1.x=x+width),function(points,lineA,lineB){for(var len=points.length,intersections=[],i=0;i<len;i++){var p0=points[i],p1=points[(i+1)%len],intersectionPt=lineLineIntersect(p0[0],p0[1],p1[0],p1[1],lineA.x,lineA.y,lineB.x,lineB.y);intersectionPt&&intersections.push({projPt:projPtOnLine(intersectionPt,lineA,lineB),pt:intersectionPt,idx:i})}if(intersections.length<2)return[{points:points},{points:points}];intersections.sort((function(a,b){return a.projPt-b.projPt}));var splitPt0=intersections[0],splitPt1=intersections[intersections.length-1];if(splitPt1.idx<splitPt0.idx){var tmp=splitPt0;splitPt0=splitPt1,splitPt1=tmp}var splitPt0Arr=[splitPt0.pt.x,splitPt0.pt.y],splitPt1Arr=[splitPt1.pt.x,splitPt1.pt.y],newPolyA=[splitPt0Arr],newPolyB=[splitPt1Arr];for(i=splitPt0.idx+1;i<=splitPt1.idx;i++)addToPoly(newPolyA,points[i].slice());for(addToPoly(newPolyA,splitPt1Arr),addToPoly(newPolyA,splitPt0Arr),i=splitPt1.idx+1;i<=splitPt0.idx+len;i++)addToPoly(newPolyB,points[i%len].slice());return addToPoly(newPolyB,splitPt0Arr),addToPoly(newPolyB,splitPt1Arr),[{points:newPolyA},{points:newPolyB}]}(points,pt0,pt1)}function binaryDivideRecursive(divider,shape,count,out){if(1===count)out.push(shape);else{var mid=Math.floor(count/2),sub=divider(shape);binaryDivideRecursive(divider,sub[0],mid,out),binaryDivideRecursive(divider,sub[1],count-mid,out)}return out}function copyPathProps(source,target){target.setStyle(source.style),target.z=source.z,target.z2=source.z2,target.zlevel=source.zlevel}function split(path,count){var OutShapeCtor,outShapes=[],shape=path.shape;switch(path.type){case"rect":!function(rectShape,count,outShapes){for(var width=rectShape.width,height=rectShape.height,isHorizontalRow=width>height,grids=getDividingGrids([width,height],isHorizontalRow?0:1,count),rowSizeDim=isHorizontalRow?"width":"height",columnSizeDim=isHorizontalRow?"height":"width",rowDim=isHorizontalRow?"x":"y",columnDim=isHorizontalRow?"y":"x",rowSize=rectShape[rowSizeDim]/grids.length,row=0;row<grids.length;row++)for(var columnSize=rectShape[columnSizeDim]/grids[row],column=0;column<grids[row];column++){var newShape={};newShape[rowDim]=row*rowSize,newShape[columnDim]=column*columnSize,newShape[rowSizeDim]=rowSize,newShape[columnSizeDim]=columnSize,newShape.x+=rectShape.x,newShape.y+=rectShape.y,outShapes.push(newShape)}}(shape,count,outShapes),OutShapeCtor=Rect$4;break;case"sector":divideSector(shape,count,outShapes),OutShapeCtor=Sector$1;break;case"circle":divideSector({r0:0,r:shape.r,startAngle:0,endAngle:2*Math.PI,cx:shape.cx,cy:shape.cy},count,outShapes),OutShapeCtor=Sector$1;break;default:var m=path.getComputedTransform(),scale=m?Math.sqrt(Math.max(m[0]*m[0]+m[1]*m[1],m[2]*m[2]+m[3]*m[3])):1,polygons=map$1(function(path,scale){var bezierArrayGroups=pathToBezierCurves(path),polygons=[];scale=scale||1;for(var i=0;i<bezierArrayGroups.length;i++){var beziers=bezierArrayGroups[i],polygon=[],x0=beziers[0],y0=beziers[1];polygon.push(x0,y0);for(var k=2;k<beziers.length;){var x1=beziers[k++],y1=beziers[k++],x2=beziers[k++],y2=beziers[k++],x3=beziers[k++],y3=beziers[k++];adpativeBezier(x0,y0,x1,y1,x2,y2,x3,y3,polygon,scale),x0=x3,y0=y3}polygons.push(polygon)}return polygons}(path.getUpdatedPathProxy(),scale),(function(poly){return function(points){for(var out=[],i=0;i<points.length;)out.push([points[i++],points[i++]]);return out}(poly)})),polygonCount=polygons.length;if(0===polygonCount)binaryDivideRecursive(binaryDividePolygon,{points:polygons[0]},count,outShapes);else if(polygonCount===count)for(var i=0;i<polygonCount;i++)outShapes.push({points:polygons[i]});else{var totalArea_1=0,items=map$1(polygons,(function(poly){var min=[],max=[];fromPoints(poly,min,max);var area=(max[1]-min[1])*(max[0]-min[0]);return totalArea_1+=area,{poly:poly,area:area}}));items.sort((function(a,b){return b.area-a.area}));var left=count;for(i=0;i<polygonCount;i++){var item=items[i];if(left<=0)break;var selfCount=i===polygonCount-1?left:Math.ceil(item.area/totalArea_1*count);selfCount<0||(binaryDivideRecursive(binaryDividePolygon,{points:item.poly},selfCount,outShapes),left-=selfCount)}}OutShapeCtor=Polygon$1}if(!OutShapeCtor)return function(path,count){for(var paths=[],i=0;i<count;i++)paths.push(clonePath(path));return paths}(path,count);var out=[];for(i=0;i<outShapes.length;i++){var subPath=new OutShapeCtor;subPath.setShape(outShapes[i]),copyPathProps(path,subPath),out.push(subPath)}return out}function alignSubpath(subpath1,subpath2){var len1=subpath1.length,len2=subpath2.length;if(len1===len2)return[subpath1,subpath2];for(var tmpSegX=[],tmpSegY=[],shorterPath=len1<len2?subpath1:subpath2,shorterLen=Math.min(len1,len2),diff=Math.abs(len2-len1)/6,shorterBezierCount=(shorterLen-2)/6,eachCurveSubDivCount=Math.ceil(diff/shorterBezierCount)+1,newSubpath=[shorterPath[0],shorterPath[1]],remained=diff,i=2;i<shorterLen;){var x0=shorterPath[i-2],y0=shorterPath[i-1],x1=shorterPath[i++],y1=shorterPath[i++],x2=shorterPath[i++],y2=shorterPath[i++],x3=shorterPath[i++],y3=shorterPath[i++];if(remained<=0)newSubpath.push(x1,y1,x2,y2,x3,y3);else{for(var actualSubDivCount=Math.min(remained,eachCurveSubDivCount-1)+1,k=1;k<=actualSubDivCount;k++){var p=k/actualSubDivCount;cubicSubdivide(x0,x1,x2,x3,p,tmpSegX),cubicSubdivide(y0,y1,y2,y3,p,tmpSegY),x0=tmpSegX[3],y0=tmpSegY[3],newSubpath.push(tmpSegX[1],tmpSegY[1],tmpSegX[2],tmpSegY[2],x0,y0),x1=tmpSegX[5],y1=tmpSegY[5],x2=tmpSegX[6],y2=tmpSegY[6]}remained-=actualSubDivCount-1}}return shorterPath===subpath1?[newSubpath,subpath2]:[subpath1,newSubpath]}function createSubpath(lastSubpathSubpath,otherSubpath){for(var len=lastSubpathSubpath.length,lastX=lastSubpathSubpath[len-2],lastY=lastSubpathSubpath[len-1],newSubpath=[],i=0;i<otherSubpath.length;)newSubpath[i++]=lastX,newSubpath[i++]=lastY;return newSubpath}function centroid(array){for(var signedArea=0,cx=0,cy=0,len=array.length,i=0,j=len-2;i<len;j=i,i+=2){var x0=array[j],y0=array[j+1],x1=array[i],y1=array[i+1],a=x0*y1-x1*y0;signedArea+=a,cx+=(x0+x1)*a,cy+=(y0+y1)*a}return 0===signedArea?[array[0]||0,array[1]||0]:[cx/signedArea/3,cy/signedArea/3,signedArea]}function findBestRingOffset(fromSubBeziers,toSubBeziers,fromCp,toCp){for(var bezierCount=(fromSubBeziers.length-2)/6,bestScore=1/0,bestOffset=0,len=fromSubBeziers.length,len2=len-2,offset=0;offset<bezierCount;offset++){for(var cursorOffset=6*offset,score=0,k=0;k<len;k+=2){var idx=0===k?cursorOffset:(cursorOffset+k-2)%len2+2,x0=fromSubBeziers[idx]-fromCp[0],y0=fromSubBeziers[idx+1]-fromCp[1],dx=toSubBeziers[k]-toCp[0]-x0,dy=toSubBeziers[k+1]-toCp[1]-y0;score+=dx*dx+dy*dy}score<bestScore&&(bestScore=score,bestOffset=offset)}return bestOffset}function reverse(array){for(var newArr=[],len=array.length,i=0;i<len;i+=2)newArr[i]=array[len-i-2],newArr[i+1]=array[len-i-1];return newArr}function isCombineMorphing(path){return path.__isCombineMorphing}function saveAndModifyMethod(obj,methodName,modifiers){var savedMethodName="__mOriginal_"+methodName,originalMethod=obj[savedMethodName]||obj[methodName];obj[savedMethodName]||(obj[savedMethodName]=obj[methodName]);var replace=modifiers.replace,after=modifiers.after,before=modifiers.before;obj[methodName]=function(){var res,args=arguments;return before&&before.apply(this,args),res=replace?replace.apply(this,args):originalMethod.apply(this,args),after&&after.apply(this,args),res}}function restoreMethod(obj,methodName){var savedMethodName="__mOriginal_"+methodName;obj[savedMethodName]&&(obj[methodName]=obj[savedMethodName],obj[savedMethodName]=null)}function applyTransformOnBeziers(bezierCurves,mm){for(var i=0;i<bezierCurves.length;i++)for(var subBeziers=bezierCurves[i],k=0;k<subBeziers.length;){var x=subBeziers[k],y=subBeziers[k+1];subBeziers[k++]=mm[0]*x+mm[2]*y+mm[4],subBeziers[k++]=mm[1]*x+mm[3]*y+mm[5]}}function prepareMorphPath(fromPath,toPath){var fromPathProxy=fromPath.getUpdatedPathProxy(),toPathProxy=toPath.getUpdatedPathProxy(),_a=function(array1,array2){for(var _a,lastSubpath1,lastSubpath2,newArray1=[],newArray2=[],i=0;i<Math.max(array1.length,array2.length);i++){var subpath1=array1[i],subpath2=array2[i],newSubpath1=void 0,newSubpath2=void 0;subpath1?subpath2?(lastSubpath1=newSubpath1=(_a=alignSubpath(subpath1,subpath2))[0],lastSubpath2=newSubpath2=_a[1]):(newSubpath2=createSubpath(lastSubpath2||subpath1,subpath1),newSubpath1=subpath1):(newSubpath1=createSubpath(lastSubpath1||subpath2,subpath2),newSubpath2=subpath2),newArray1.push(newSubpath1),newArray2.push(newSubpath2)}return[newArray1,newArray2]}(pathToBezierCurves(fromPathProxy),pathToBezierCurves(toPathProxy)),fromBezierCurves=_a[0],toBezierCurves=_a[1],fromPathTransform=fromPath.getComputedTransform(),toPathTransform=toPath.getComputedTransform();fromPathTransform&&applyTransformOnBeziers(fromBezierCurves,fromPathTransform),toPathTransform&&applyTransformOnBeziers(toBezierCurves,toPathTransform),saveAndModifyMethod(toPath,"updateTransform",{replace:function(){this.transform=null}}),toPath.transform=null;var morphingData=function(fromArr,toArr,searchAngleIteration,searchAngleRange){for(var fromNeedsReverse,result=[],i=0;i<fromArr.length;i++){var fromSubpathBezier=fromArr[i],toSubpathBezier=toArr[i],fromCp=centroid(fromSubpathBezier),toCp=centroid(toSubpathBezier);null==fromNeedsReverse&&(fromNeedsReverse=fromCp[2]<0!=toCp[2]<0);var newFromSubpathBezier=[],newToSubpathBezier=[],bestAngle=0,bestScore=1/0,tmpArr=[],len=fromSubpathBezier.length;fromNeedsReverse&&(fromSubpathBezier=reverse(fromSubpathBezier));for(var offset=6*findBestRingOffset(fromSubpathBezier,toSubpathBezier,fromCp,toCp),len2=len-2,k=0;k<len2;k+=2){var idx=(offset+k)%len2+2;newFromSubpathBezier[k+2]=fromSubpathBezier[idx]-fromCp[0],newFromSubpathBezier[k+3]=fromSubpathBezier[idx+1]-fromCp[1]}if(newFromSubpathBezier[0]=fromSubpathBezier[offset]-fromCp[0],newFromSubpathBezier[1]=fromSubpathBezier[offset+1]-fromCp[1],searchAngleIteration>0)for(var step=searchAngleRange/searchAngleIteration,angle=-searchAngleRange/2;angle<=searchAngleRange/2;angle+=step){var sa=Math.sin(angle),ca=Math.cos(angle),score=0;for(k=0;k<fromSubpathBezier.length;k+=2){var x0=newFromSubpathBezier[k],y0=newFromSubpathBezier[k+1],x1=toSubpathBezier[k]-toCp[0],y1=toSubpathBezier[k+1]-toCp[1],newX1=x1*ca-y1*sa,newY1=x1*sa+y1*ca;tmpArr[k]=newX1,tmpArr[k+1]=newY1;var dx=newX1-x0,dy=newY1-y0;score+=dx*dx+dy*dy}if(score<bestScore){bestScore=score,bestAngle=angle;for(var m=0;m<tmpArr.length;m++)newToSubpathBezier[m]=tmpArr[m]}}else for(var i_1=0;i_1<len;i_1+=2)newToSubpathBezier[i_1]=toSubpathBezier[i_1]-toCp[0],newToSubpathBezier[i_1+1]=toSubpathBezier[i_1+1]-toCp[1];result.push({from:newFromSubpathBezier,to:newToSubpathBezier,fromCp:fromCp,toCp:toCp,rotation:-bestAngle})}return result}(fromBezierCurves,toBezierCurves,10,Math.PI),tmpArr=[];saveAndModifyMethod(toPath,"buildPath",{replace:function(path){for(var t=toPath.__morphT,onet=1-t,newCp=[],i=0;i<morphingData.length;i++){var item=morphingData[i],from=item.from,to=item.to,angle=item.rotation*t,fromCp=item.fromCp,toCp=item.toCp,sa=Math.sin(angle),ca=Math.cos(angle);lerp$1(newCp,fromCp,toCp,t);for(var m=0;m<from.length;m+=2){var x0_1=from[m],y0_1=from[m+1],x=x0_1*onet+(x1=to[m])*t,y=y0_1*onet+(y1=to[m+1])*t;tmpArr[m]=x*ca-y*sa+newCp[0],tmpArr[m+1]=x*sa+y*ca+newCp[1]}var x0=tmpArr[0],y0=tmpArr[1];path.moveTo(x0,y0);for(m=2;m<from.length;){var x1=tmpArr[m++],y1=tmpArr[m++],x2=tmpArr[m++],y2=tmpArr[m++],x3=tmpArr[m++],y3=tmpArr[m++];x0===x1&&y0===y1&&x2===x3&&y2===y3?path.lineTo(x3,y3):path.bezierCurveTo(x1,y1,x2,y2,x3,y3),x0=x3,y0=y3}}}})}function morphPath(fromPath,toPath,animationOpts){if(!fromPath||!toPath)return toPath;var oldDone=animationOpts.done,oldDuring=animationOpts.during;return prepareMorphPath(fromPath,toPath),toPath.__morphT=0,toPath.animateTo({__morphT:1},defaults({during:function(p){toPath.dirtyShape(),oldDuring&&oldDuring(p)},done:function(){restoreMethod(toPath,"buildPath"),restoreMethod(toPath,"updateTransform"),toPath.__morphT=-1,toPath.createPathProxy(),toPath.dirtyShape(),oldDone&&oldDone()}},animationOpts)),toPath}function hilbert(x,y,minX,minY,maxX,maxY){x=maxX===minX?0:Math.round(32767*(x-minX)/(maxX-minX)),y=maxY===minY?0:Math.round(32767*(y-minY)/(maxY-minY));for(var tmp,d=0,s=32768;s>0;s/=2){var rx=0,ry=0;(x&s)>0&&(rx=1),(y&s)>0&&(ry=1),d+=s*s*(3*rx^ry),0===ry&&(1===rx&&(x=s-1-x,y=s-1-y),tmp=x,x=y,y=tmp)}return d}function sortPaths(pathList){var xMin=1/0,yMin=1/0,xMax=-1/0,yMax=-1/0,cps=map$1(pathList,(function(path){var rect=path.getBoundingRect(),m=path.getComputedTransform(),x=rect.x+rect.width/2+(m?m[4]:0),y=rect.y+rect.height/2+(m?m[5]:0);return xMin=Math.min(x,xMin),yMin=Math.min(y,yMin),xMax=Math.max(x,xMax),yMax=Math.max(y,yMax),[x,y]}));return map$1(cps,(function(cp,idx){return{cp:cp,z:hilbert(cp[0],cp[1],xMin,yMin,xMax,yMax),path:pathList[idx]}})).sort((function(a,b){return a.z-b.z})).map((function(item){return item.path}))}function defaultDividePath(param){return split(param.path,param.count)}function isMultiple(elements){return isArray(elements[0])}function prepareMorphBatches(one,many){for(var batches=[],batchCount=one.length,i=0;i<batchCount;i++)batches.push({one:one[i],many:[]});for(i=0;i<many.length;i++){var len=many[i].length,k=void 0;for(k=0;k<len;k++)batches[k%batchCount].many.push(many[i][k])}var off=0;for(i=batchCount-1;i>=0;i--)if(!batches[i].many.length){var moveFrom=batches[off].many;if(moveFrom.length<=1){if(!off)return batches;off=0}len=moveFrom.length;var mid=Math.ceil(len/2);batches[i].many=moveFrom.slice(mid,len),batches[off].many=moveFrom.slice(0,mid),off++}return batches}var pathDividers={clone:function(params){for(var ret=[],approxOpacity=1-Math.pow(1-params.path.style.opacity,1/params.count),i=0;i<params.count;i++){var cloned=clonePath(params.path);cloned.setStyle("opacity",approxOpacity),ret.push(cloned)}return ret},split:null};function applyMorphAnimation(from,to,divideShape,seriesModel,dataIndex,animateOtherProps){if(from.length&&to.length){var updateAnimationCfg=getAnimationConfig("update",seriesModel,dataIndex);if(updateAnimationCfg&&updateAnimationCfg.duration>0){var many,one,animationDelay=seriesModel.getModel("universalTransition").get("delay"),animationCfg=Object.assign({setToFinal:!0},updateAnimationCfg);isMultiple(from)&&(many=from,one=to),isMultiple(to)&&(many=to,one=from);for(var fromIsMany=many?many===from:from.length>to.length,morphBatches=many?prepareMorphBatches(one,many):prepareMorphBatches(fromIsMany?to:from,[fromIsMany?from:to]),animateCount=0,i=0;i<morphBatches.length;i++)animateCount+=morphBatches[i].many.length;var animateIndex=0;for(i=0;i<morphBatches.length;i++)morphOneBatch(morphBatches[i],fromIsMany,animateIndex,animateCount),animateIndex+=morphBatches[i].many.length}}function morphOneBatch(batch,fromIsMany,animateIndex,animateCount,forceManyOne){var batchMany=batch.many,batchOne=batch.one;if(1!==batchMany.length||forceManyOne)for(var separateAnimationCfg=defaults({dividePath:pathDividers[divideShape],individualDelay:animationDelay&&function(idx,count,fromPath,toPath){return animationDelay(idx+animateIndex,animateCount)}},animationCfg),_a=fromIsMany?function(fromList,toPath,animationOpts){var fromPathList=[];!function addFromPath(fromList){for(var i=0;i<fromList.length;i++){var from=fromList[i];isCombineMorphing(from)?addFromPath(from.childrenRef()):from instanceof Path$1&&fromPathList.push(from)}}(fromList);var separateCount=fromPathList.length;if(!separateCount)return{fromIndividuals:[],toIndividuals:[],count:0};var toSubPathList=(animationOpts.dividePath||defaultDividePath)({path:toPath,count:separateCount});if(toSubPathList.length!==separateCount)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0};fromPathList=sortPaths(fromPathList),toSubPathList=sortPaths(toSubPathList);for(var oldDone=animationOpts.done,oldDuring=animationOpts.during,individualDelay=animationOpts.individualDelay,identityTransform=new Transformable$1,i=0;i<separateCount;i++){var from=fromPathList[i],to=toSubPathList[i];to.parent=toPath,to.copyTransform(identityTransform),individualDelay||prepareMorphPath(from,to)}function addToSubPathListToZr(zr){for(var i=0;i<toSubPathList.length;i++)toSubPathList[i].addSelfToZr(zr)}function restoreToPath(){toPath.__isCombineMorphing=!1,toPath.__morphT=-1,toPath.childrenRef=null,restoreMethod(toPath,"addSelfToZr"),restoreMethod(toPath,"removeSelfFromZr")}toPath.__isCombineMorphing=!0,toPath.childrenRef=function(){return toSubPathList},saveAndModifyMethod(toPath,"addSelfToZr",{after:function(zr){addToSubPathListToZr(zr)}}),saveAndModifyMethod(toPath,"removeSelfFromZr",{after:function(zr){for(var i=0;i<toSubPathList.length;i++)toSubPathList[i].removeSelfFromZr(zr)}});var toLen=toSubPathList.length;if(individualDelay){var animating_1=toLen,eachDone=function(){0==--animating_1&&(restoreToPath(),oldDone&&oldDone())};for(i=0;i<toLen;i++){var indivdualAnimationOpts=individualDelay?defaults({delay:(animationOpts.delay||0)+individualDelay(i,toLen,fromPathList[i],toSubPathList[i]),done:eachDone},animationOpts):animationOpts;morphPath(fromPathList[i],toSubPathList[i],indivdualAnimationOpts)}}else toPath.__morphT=0,toPath.animateTo({__morphT:1},defaults({during:function(p){for(var i=0;i<toLen;i++){var child=toSubPathList[i];child.__morphT=toPath.__morphT,child.dirtyShape()}oldDuring&&oldDuring(p)},done:function(){restoreToPath();for(var i=0;i<fromList.length;i++)restoreMethod(fromList[i],"updateTransform");oldDone&&oldDone()}},animationOpts));return toPath.__zr&&addToSubPathListToZr(toPath.__zr),{fromIndividuals:fromPathList,toIndividuals:toSubPathList,count:toLen}}(batchMany,batchOne,separateAnimationCfg):function(fromPath,toPathList,animationOpts){var toLen=toPathList.length,fromPathList=[],dividePath=animationOpts.dividePath||defaultDividePath;if(isCombineMorphing(fromPath)){!function addFromPath(fromList){for(var i=0;i<fromList.length;i++){var from=fromList[i];isCombineMorphing(from)?addFromPath(from.childrenRef()):from instanceof Path$1&&fromPathList.push(from)}}(fromPath.childrenRef());var fromLen=fromPathList.length;if(fromLen<toLen)for(var k=0,i=fromLen;i<toLen;i++)fromPathList.push(clonePath(fromPathList[k++%fromLen]));fromPathList.length=toLen}else{fromPathList=dividePath({path:fromPath,count:toLen});var fromPathTransform=fromPath.getComputedTransform();for(i=0;i<fromPathList.length;i++)fromPathList[i].setLocalTransform(fromPathTransform);if(fromPathList.length!==toLen)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0}}fromPathList=sortPaths(fromPathList),toPathList=sortPaths(toPathList);var individualDelay=animationOpts.individualDelay;for(i=0;i<toLen;i++){var indivdualAnimationOpts=individualDelay?defaults({delay:(animationOpts.delay||0)+individualDelay(i,toLen,fromPathList[i],toPathList[i])},animationOpts):animationOpts;morphPath(fromPathList[i],toPathList[i],indivdualAnimationOpts)}return{fromIndividuals:fromPathList,toIndividuals:toPathList,count:toPathList.length}}(batchOne,batchMany,separateAnimationCfg),fromIndividuals=_a.fromIndividuals,toIndividuals=_a.toIndividuals,count=fromIndividuals.length,k=0;k<count;k++){individualAnimationCfg=animationDelay?defaults({delay:animationDelay(k,count)},animationCfg):animationCfg;animateOtherProps(fromIndividuals[k],toIndividuals[k],fromIsMany?batchMany[k]:batch.one,fromIsMany?batch.one:batchMany[k],individualAnimationCfg)}else{var individualAnimationCfg,batchFrom=fromIsMany?batchMany[0]:batchOne,batchTo=fromIsMany?batchOne:batchMany[0];if(isCombineMorphing(batchFrom))morphOneBatch({many:[batchFrom],one:batchTo},!0,animateIndex,animateCount,!0);else morphPath(batchFrom,batchTo,individualAnimationCfg=animationDelay?defaults({delay:animationDelay(animateIndex,animateCount)},animationCfg):animationCfg),animateOtherProps(batchFrom,batchTo,batchFrom,batchTo,individualAnimationCfg)}}}function getPathList(elements){if(!elements)return[];if(isArray(elements)){for(var pathList_1=[],i=0;i<elements.length;i++)pathList_1.push(getPathList(elements[i]));return pathList_1}var pathList=[];return elements.traverse((function(el){el instanceof Path$1&&!el.disableMorphing&&!el.invisible&&!el.ignore&&pathList.push(el)})),pathList}var getUniversalTransitionGlobalStore=makeInner();function getGroupId(data,dataIndex,dataGroupId,isChild){var groupIdDim=function(data,visualDimension){for(var dimensions=data.dimensions,i=0;i<dimensions.length;i++){var dimInfo=data.getDimensionInfo(dimensions[i]);if(dimInfo&&0===dimInfo.otherDims[visualDimension])return dimensions[i]}}(data,isChild?"itemChildGroupId":"itemGroupId");if(groupIdDim){var groupId=function(data,dataIndex,dimension){var dimInfo=data.getDimensionInfo(dimension),dimOrdinalMeta=dimInfo&&dimInfo.ordinalMeta;if(dimInfo){var value=data.get(dimInfo.name,dataIndex);return dimOrdinalMeta&&dimOrdinalMeta.categories[value]||value+""}}(data,dataIndex,groupIdDim);return groupId}var rawDataItem=data.getRawDataItem(dataIndex),property=isChild?"childGroupId":"groupId";return rawDataItem&&rawDataItem[property]?rawDataItem[property]+"":isChild?void 0:dataGroupId||data.getId(dataIndex)}function flattenDataDiffItems(list){var items=[];return each$b(list,(function(seriesInfo){var data=seriesInfo.data,dataGroupId=seriesInfo.dataGroupId;if(data.count()>1e4)"production"!==process.env.NODE_ENV&&warn("Universal transition is disabled on large data > 10k.");else for(var indices=data.getIndices(),dataIndex=0;dataIndex<indices.length;dataIndex++)items.push({data:data,groupId:getGroupId(data,dataIndex,dataGroupId,!1),childGroupId:getGroupId(data,dataIndex,dataGroupId,!0),divide:seriesInfo.divide,dataIndex:dataIndex})})),items}function fadeInElement(newEl,newSeries,newIndex){newEl.traverse((function(el){el instanceof Path$1&&initProps(el,{style:{opacity:0}},newSeries,{dataIndex:newIndex,isFrom:!0})}))}function removeEl(el){if(el.parent){var computedTransform=el.getComputedTransform();el.setLocalTransform(computedTransform),el.parent.remove(el)}}function stopAnimation(el){el.stopAnimation(),el.isGroup&&el.traverse((function(child){child.stopAnimation()}))}function animateElementStyles(el,dataIndex,seriesModel){var animationConfig=getAnimationConfig("update",seriesModel,dataIndex);animationConfig&&el.traverse((function(child){if(child instanceof Displayable$1){var oldStyle=function(el){return transitionStore(el).oldStyle}(child);oldStyle&&child.animateFrom({style:oldStyle},animationConfig)}}))}function transitionBetween(oldList,newList,api){var oldDiffItems=flattenDataDiffItems(oldList),newDiffItems=flattenDataDiffItems(newList);function updateMorphingPathProps(from,to,rawFrom,rawTo,animationCfg){(rawFrom||from)&&to.animateFrom({style:rawFrom&&rawFrom!==from?extend(extend({},rawFrom.style),from.style):from.style},animationCfg)}var hasMorphAnimation=!1,direction=0,oldGroupIds=createHashMap(),oldChildGroupIds=createHashMap();oldDiffItems.forEach((function(item){item.groupId&&oldGroupIds.set(item.groupId,!0),item.childGroupId&&oldChildGroupIds.set(item.childGroupId,!0)}));for(var i=0;i<newDiffItems.length;i++){var newGroupId=newDiffItems[i].groupId;if(oldChildGroupIds.get(newGroupId)){direction=1;break}var newChildGroupId=newDiffItems[i].childGroupId;if(newChildGroupId&&oldGroupIds.get(newChildGroupId)){direction=2;break}}function createKeyGetter(isOld,onlyGetId){return function(diffItem){var data=diffItem.data,dataIndex=diffItem.dataIndex;return onlyGetId?data.getId(dataIndex):isOld?1===direction?diffItem.childGroupId:diffItem.groupId:2===direction?diffItem.childGroupId:diffItem.groupId}}var useId=function(oldDiffItems,newDiffItems){var len=oldDiffItems.length;if(len!==newDiffItems.length)return!1;for(var i=0;i<len;i++){var oldItem=oldDiffItems[i],newItem=newDiffItems[i];if(oldItem.data.getId(oldItem.dataIndex)!==newItem.data.getId(newItem.dataIndex))return!1}return!0}(oldDiffItems,newDiffItems),isElementStillInChart={};if(!useId)for(i=0;i<newDiffItems.length;i++){var newItem=newDiffItems[i],el=newItem.data.getItemGraphicEl(newItem.dataIndex);el&&(isElementStillInChart[el.id]=!0)}function updateOneToOne(newIndex,oldIndex){var oldItem=oldDiffItems[oldIndex],newItem=newDiffItems[newIndex],newSeries=newItem.data.hostModel,oldEl=oldItem.data.getItemGraphicEl(oldItem.dataIndex),newEl=newItem.data.getItemGraphicEl(newItem.dataIndex);oldEl!==newEl?oldEl&&isElementStillInChart[oldEl.id]||newEl&&(stopAnimation(newEl),oldEl?(stopAnimation(oldEl),removeEl(oldEl),hasMorphAnimation=!0,applyMorphAnimation(getPathList(oldEl),getPathList(newEl),newItem.divide,newSeries,newIndex,updateMorphingPathProps)):fadeInElement(newEl,newSeries,newIndex)):newEl&&animateElementStyles(newEl,newItem.dataIndex,newSeries)}new DataDiffer$1(oldDiffItems,newDiffItems,createKeyGetter(!0,useId),createKeyGetter(!1,useId),null,"multiple").update(updateOneToOne).updateManyToOne((function(newIndex,oldIndices){var newItem=newDiffItems[newIndex],newData=newItem.data,newSeries=newData.hostModel,newEl=newData.getItemGraphicEl(newItem.dataIndex),oldElsList=filter(map$1(oldIndices,(function(idx){return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex)})),(function(oldEl){return oldEl&&oldEl!==newEl&&!isElementStillInChart[oldEl.id]}));newEl&&(stopAnimation(newEl),oldElsList.length?(each$b(oldElsList,(function(oldEl){stopAnimation(oldEl),removeEl(oldEl)})),hasMorphAnimation=!0,applyMorphAnimation(getPathList(oldElsList),getPathList(newEl),newItem.divide,newSeries,newIndex,updateMorphingPathProps)):fadeInElement(newEl,newSeries,newItem.dataIndex))})).updateOneToMany((function(newIndices,oldIndex){var oldItem=oldDiffItems[oldIndex],oldEl=oldItem.data.getItemGraphicEl(oldItem.dataIndex);if(!oldEl||!isElementStillInChart[oldEl.id]){var newElsList=filter(map$1(newIndices,(function(idx){return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex)})),(function(el){return el&&el!==oldEl})),newSeris=newDiffItems[newIndices[0]].data.hostModel;newElsList.length&&(each$b(newElsList,(function(newEl){return stopAnimation(newEl)})),oldEl?(stopAnimation(oldEl),removeEl(oldEl),hasMorphAnimation=!0,applyMorphAnimation(getPathList(oldEl),getPathList(newElsList),oldItem.divide,newSeris,newIndices[0],updateMorphingPathProps)):each$b(newElsList,(function(newEl){return fadeInElement(newEl,newSeris,newIndices[0])})))}})).updateManyToMany((function(newIndices,oldIndices){new DataDiffer$1(oldIndices,newIndices,(function(rawIdx){return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex)}),(function(rawIdx){return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex)})).update((function(newIndex,oldIndex){updateOneToOne(newIndices[newIndex],oldIndices[oldIndex])})).execute()})).execute(),hasMorphAnimation&&each$b(newList,(function(_a){var seriesModel=_a.data.hostModel,view=seriesModel&&api.getViewOfSeriesModel(seriesModel),animationCfg=getAnimationConfig("update",seriesModel,0);view&&seriesModel.isAnimationEnabled()&&animationCfg&&animationCfg.duration>0&&view.group.traverse((function(el){el instanceof Path$1&&!el.animators.length&&el.animateFrom({style:{opacity:0}},animationCfg)}))}))}function getSeriesTransitionKey(series){var seriesKey=series.getModel("universalTransition").get("seriesKey");return seriesKey||series.id}function convertArraySeriesKeyToString(seriesKey){return isArray(seriesKey)?seriesKey.sort().join(","):seriesKey}function getDivideShapeFromData(data){if(data.hostModel)return data.hostModel.getModel("universalTransition").get("divideShape")}function querySeries(series,finder){for(var i=0;i<series.length;i++){if(null!=finder.seriesIndex&&finder.seriesIndex===series[i].seriesIndex||null!=finder.seriesId&&finder.seriesId===series[i].id)return i}}function createDom(id,painter,dpr){var newDom=platformApi.createCanvas(),width=painter.getWidth(),height=painter.getHeight(),newDomStyle=newDom.style;return newDomStyle&&(newDomStyle.position="absolute",newDomStyle.left="0",newDomStyle.top="0",newDomStyle.width=width+"px",newDomStyle.height=height+"px",newDom.setAttribute("data-zr-dom-id",id)),newDom.width=width*dpr,newDom.height=height*dpr,newDom}var Layer=function(_super){function Layer(id,painter,dpr){var dom,_this=_super.call(this)||this;_this.motionBlur=!1,_this.lastFrameAlpha=.7,_this.dpr=1,_this.virtual=!1,_this.config={},_this.incremental=!1,_this.zlevel=0,_this.maxRepaintRectCount=5,_this.__dirty=!0,_this.__firstTimePaint=!0,_this.__used=!1,_this.__drawIndex=0,_this.__startIndex=0,_this.__endIndex=0,_this.__prevStartIndex=null,_this.__prevEndIndex=null,dpr=dpr||devicePixelRatio,"string"==typeof id?dom=createDom(id,painter,dpr):isObject$3(id)&&(id=(dom=id).id),_this.id=id,_this.dom=dom;var domStyle=dom.style;return domStyle&&(disableUserSelect(dom),dom.onselectstart=function(){return!1},domStyle.padding="0",domStyle.margin="0",domStyle.borderWidth="0"),_this.painter=painter,_this.dpr=dpr,_this}return __extends(Layer,_super),Layer.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},Layer.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},Layer.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},Layer.prototype.setUnpainted=function(){this.__firstTimePaint=!0},Layer.prototype.createBackBuffer=function(){var dpr=this.dpr;this.domBack=createDom("back-"+this.id,this.painter,dpr),this.ctxBack=this.domBack.getContext("2d"),1!==dpr&&this.ctxBack.scale(dpr,dpr)},Layer.prototype.createRepaintRects=function(displayList,prevList,viewWidth,viewHeight){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var hasIntersections,mergedRepaintRects=[],maxRepaintRectCount=this.maxRepaintRectCount,full=!1,pendingRect=new BoundingRect$1(0,0,0,0);function addRectToMergePool(rect){if(rect.isFinite()&&!rect.isZero())if(0===mergedRepaintRects.length){(boundingRect=new BoundingRect$1(0,0,0,0)).copy(rect),mergedRepaintRects.push(boundingRect)}else{for(var boundingRect,isMerged=!1,minDeltaArea=1/0,bestRectToMergeIdx=0,i=0;i<mergedRepaintRects.length;++i){var mergedRect=mergedRepaintRects[i];if(mergedRect.intersect(rect)){var pendingRect_1=new BoundingRect$1(0,0,0,0);pendingRect_1.copy(mergedRect),pendingRect_1.union(rect),mergedRepaintRects[i]=pendingRect_1,isMerged=!0;break}if(full){pendingRect.copy(rect),pendingRect.union(mergedRect);var aArea=rect.width*rect.height,bArea=mergedRect.width*mergedRect.height,deltaArea=pendingRect.width*pendingRect.height-aArea-bArea;deltaArea<minDeltaArea&&(minDeltaArea=deltaArea,bestRectToMergeIdx=i)}}if(full&&(mergedRepaintRects[bestRectToMergeIdx].union(rect),isMerged=!0),!isMerged)(boundingRect=new BoundingRect$1(0,0,0,0)).copy(rect),mergedRepaintRects.push(boundingRect);full||(full=mergedRepaintRects.length>=maxRepaintRectCount)}}for(var i=this.__startIndex;i<this.__endIndex;++i){if(el=displayList[i]){var shouldPaint=el.shouldBePainted(viewWidth,viewHeight,!0,!0);(prevRect=el.__isRendered&&(1&el.__dirty||!shouldPaint)?el.getPrevPaintRect():null)&&addRectToMergePool(prevRect);var curRect=shouldPaint&&(1&el.__dirty||!el.__isRendered)?el.getPaintRect():null;curRect&&addRectToMergePool(curRect)}}for(i=this.__prevStartIndex;i<this.__prevEndIndex;++i){var el,prevRect;shouldPaint=(el=prevList[i])&&el.shouldBePainted(viewWidth,viewHeight,!0,!0);if(el&&(!shouldPaint||!el.__zr)&&el.__isRendered)(prevRect=el.getPrevPaintRect())&&addRectToMergePool(prevRect)}do{hasIntersections=!1;for(i=0;i<mergedRepaintRects.length;)if(mergedRepaintRects[i].isZero())mergedRepaintRects.splice(i,1);else{for(var j=i+1;j<mergedRepaintRects.length;)mergedRepaintRects[i].intersect(mergedRepaintRects[j])?(hasIntersections=!0,mergedRepaintRects[i].union(mergedRepaintRects[j]),mergedRepaintRects.splice(j,1)):j++;i++}}while(hasIntersections);return this._paintRects=mergedRepaintRects,mergedRepaintRects},Layer.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},Layer.prototype.resize=function(width,height){var dpr=this.dpr,dom=this.dom,domStyle=dom.style,domBack=this.domBack;domStyle&&(domStyle.width=width+"px",domStyle.height=height+"px"),dom.width=width*dpr,dom.height=height*dpr,domBack&&(domBack.width=width*dpr,domBack.height=height*dpr,1!==dpr&&this.ctxBack.scale(dpr,dpr))},Layer.prototype.clear=function(clearAll,clearColor,repaintRects){var dom=this.dom,ctx=this.ctx,width=dom.width,height=dom.height;clearColor=clearColor||this.clearColor;var haveMotionBLur=this.motionBlur&&!clearAll,lastFrameAlpha=this.lastFrameAlpha,dpr=this.dpr,self=this;haveMotionBLur&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(dom,0,0,width/dpr,height/dpr));var domBack=this.domBack;function doClear(x,y,width,height){if(ctx.clearRect(x,y,width,height),clearColor&&"transparent"!==clearColor){var clearColorGradientOrPattern=void 0;if(isGradientObject(clearColor))clearColorGradientOrPattern=(clearColor.global||clearColor.__width===width&&clearColor.__height===height)&&clearColor.__canvasGradient||getCanvasGradient(ctx,clearColor,{x:0,y:0,width:width,height:height}),clearColor.__canvasGradient=clearColorGradientOrPattern,clearColor.__width=width,clearColor.__height=height;else null!=clearColor.image&&(clearColor.scaleX=clearColor.scaleX||dpr,clearColor.scaleY=clearColor.scaleY||dpr,clearColorGradientOrPattern=createCanvasPattern(ctx,clearColor,{dirty:function(){self.setUnpainted(),self.painter.refresh()}}));ctx.save(),ctx.fillStyle=clearColorGradientOrPattern||clearColor,ctx.fillRect(x,y,width,height),ctx.restore()}haveMotionBLur&&(ctx.save(),ctx.globalAlpha=lastFrameAlpha,ctx.drawImage(domBack,x,y,width,height),ctx.restore())}!repaintRects||haveMotionBLur?doClear(0,0,width,height):repaintRects.length&&each$b(repaintRects,(function(rect){doClear(rect.x*dpr,rect.y*dpr,rect.width*dpr,rect.height*dpr)}))},Layer}(Eventful$1),Layer$1=Layer;var CanvasPainter=function(){function CanvasPainter(root,storage,opts,id){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var singleCanvas=!root.nodeName||"CANVAS"===root.nodeName.toUpperCase();this._opts=opts=extend({},opts||{}),this.dpr=opts.devicePixelRatio||devicePixelRatio,this._singleCanvas=singleCanvas,this.root=root,root.style&&(disableUserSelect(root),root.innerHTML=""),this.storage=storage;var zlevelList=this._zlevelList;this._prevDisplayList=[];var layers=this._layers;if(singleCanvas){var rootCanvas=root,width=rootCanvas.width,height=rootCanvas.height;null!=opts.width&&(width=opts.width),null!=opts.height&&(height=opts.height),this.dpr=opts.devicePixelRatio||1,rootCanvas.width=width*this.dpr,rootCanvas.height=height*this.dpr,this._width=width,this._height=height;var mainLayer=new Layer$1(rootCanvas,this,this.dpr);mainLayer.__builtin__=!0,mainLayer.initContext(),layers[314159]=mainLayer,mainLayer.zlevel=314159,zlevelList.push(314159),this._domRoot=root}else{this._width=getSize$1(root,0,opts),this._height=getSize$1(root,1,opts);var domRoot=this._domRoot=function(width,height){var domRoot=document.createElement("div");return domRoot.style.cssText=["position:relative","width:"+width+"px","height:"+height+"px","padding:0","margin:0","border-width:0"].join(";")+";",domRoot}(this._width,this._height);root.appendChild(domRoot)}}return CanvasPainter.prototype.getType=function(){return"canvas"},CanvasPainter.prototype.isSingleCanvas=function(){return this._singleCanvas},CanvasPainter.prototype.getViewportRoot=function(){return this._domRoot},CanvasPainter.prototype.getViewportRootOffset=function(){var viewportRoot=this.getViewportRoot();if(viewportRoot)return{offsetLeft:viewportRoot.offsetLeft||0,offsetTop:viewportRoot.offsetTop||0}},CanvasPainter.prototype.refresh=function(paintAll){var list=this.storage.getDisplayList(!0),prevList=this._prevDisplayList,zlevelList=this._zlevelList;this._redrawId=Math.random(),this._paintList(list,prevList,paintAll,this._redrawId);for(var i=0;i<zlevelList.length;i++){var z=zlevelList[i],layer=this._layers[z];if(!layer.__builtin__&&layer.refresh){var clearColor=0===i?this._backgroundColor:null;layer.refresh(clearColor)}}return this._opts.useDirtyRect&&(this._prevDisplayList=list.slice()),this},CanvasPainter.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},CanvasPainter.prototype._paintHoverList=function(list){var len=list.length,hoverLayer=this._hoverlayer;if(hoverLayer&&hoverLayer.clear(),len){for(var ctx,scope={inHover:!0,viewWidth:this._width,viewHeight:this._height},i=0;i<len;i++){var el=list[i];el.__inHover&&(hoverLayer||(hoverLayer=this._hoverlayer=this.getLayer(1e5)),ctx||(ctx=hoverLayer.ctx).save(),brush(ctx,el,scope,i===len-1))}ctx&&ctx.restore()}},CanvasPainter.prototype.getHoverLayer=function(){return this.getLayer(1e5)},CanvasPainter.prototype.paintOne=function(ctx,el){brushSingle(ctx,el)},CanvasPainter.prototype._paintList=function(list,prevList,paintAll,redrawId){if(this._redrawId===redrawId){paintAll=paintAll||!1,this._updateLayerStatus(list);var _a=this._doPaintList(list,prevList,paintAll),finished=_a.finished,needsRefreshHover=_a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),needsRefreshHover&&this._paintHoverList(list),finished)this.eachLayer((function(layer){layer.afterBrush&&layer.afterBrush()}));else{var self_1=this;requestAnimationFrame$3((function(){self_1._paintList(list,prevList,paintAll,redrawId)}))}}},CanvasPainter.prototype._compositeManually=function(){var ctx=this.getLayer(314159).ctx,width=this._domRoot.width,height=this._domRoot.height;ctx.clearRect(0,0,width,height),this.eachBuiltinLayer((function(layer){layer.virtual&&ctx.drawImage(layer.dom,0,0,width,height)}))},CanvasPainter.prototype._doPaintList=function(list,prevList,paintAll){for(var _this=this,layerList=[],useDirtyRect=this._opts.useDirtyRect,zi=0;zi<this._zlevelList.length;zi++){var zlevel=this._zlevelList[zi],layer=this._layers[zlevel];layer.__builtin__&&layer!==this._hoverlayer&&(layer.__dirty||paintAll)&&layerList.push(layer)}for(var finished=!0,needsRefreshHover=!1,_loop_1=function(k){var i,layer=layerList[k],ctx=layer.ctx,repaintRects=useDirtyRect&&layer.createRepaintRects(list,prevList,this_1._width,this_1._height),start=paintAll?layer.__startIndex:layer.__drawIndex,useTimer=!paintAll&&layer.incremental&&Date.now,startTime=useTimer&&Date.now(),clearColor=layer.zlevel===this_1._zlevelList[0]?this_1._backgroundColor:null;if(layer.__startIndex===layer.__endIndex)layer.clear(!1,clearColor,repaintRects);else if(start===layer.__startIndex){var firstEl=list[start];firstEl.incremental&&firstEl.notClear&&!paintAll||layer.clear(!1,clearColor,repaintRects)}-1===start&&(console.error("For some unknown reason. drawIndex is -1"),start=layer.__startIndex);var repaint=function(repaintRect){var scope={inHover:!1,allClipped:!1,prevEl:null,viewWidth:_this._width,viewHeight:_this._height};for(i=start;i<layer.__endIndex;i++){var el=list[i];if(el.__inHover&&(needsRefreshHover=!0),_this._doPaintEl(el,layer,useDirtyRect,repaintRect,scope,i===layer.__endIndex-1),useTimer)if(Date.now()-startTime>15)break}scope.prevElClipPaths&&ctx.restore()};if(repaintRects)if(0===repaintRects.length)i=layer.__endIndex;else for(var dpr=this_1.dpr,r=0;r<repaintRects.length;++r){var rect=repaintRects[r];ctx.save(),ctx.beginPath(),ctx.rect(rect.x*dpr,rect.y*dpr,rect.width*dpr,rect.height*dpr),ctx.clip(),repaint(rect),ctx.restore()}else ctx.save(),repaint(),ctx.restore();layer.__drawIndex=i,layer.__drawIndex<layer.__endIndex&&(finished=!1)},this_1=this,k=0;k<layerList.length;k++)_loop_1(k);return env$1.wxa&&each$b(this._layers,(function(layer){layer&&layer.ctx&&layer.ctx.draw&&layer.ctx.draw()})),{finished:finished,needsRefreshHover:needsRefreshHover}},CanvasPainter.prototype._doPaintEl=function(el,currentLayer,useDirtyRect,repaintRect,scope,isLast){var ctx=currentLayer.ctx;if(useDirtyRect){var paintRect=el.getPaintRect();(!repaintRect||paintRect&&paintRect.intersect(repaintRect))&&(brush(ctx,el,scope,isLast),el.setPrevPaintRect(paintRect))}else brush(ctx,el,scope,isLast)},CanvasPainter.prototype.getLayer=function(zlevel,virtual){this._singleCanvas&&!this._needsManuallyCompositing&&(zlevel=314159);var layer=this._layers[zlevel];return layer||((layer=new Layer$1("zr_"+zlevel,this,this.dpr)).zlevel=zlevel,layer.__builtin__=!0,this._layerConfig[zlevel]?merge(layer,this._layerConfig[zlevel],!0):this._layerConfig[zlevel-.01]&&merge(layer,this._layerConfig[zlevel-.01],!0),virtual&&(layer.virtual=virtual),this.insertLayer(zlevel,layer),layer.initContext()),layer},CanvasPainter.prototype.insertLayer=function(zlevel,layer){var layersMap=this._layers,zlevelList=this._zlevelList,len=zlevelList.length,domRoot=this._domRoot,prevLayer=null,i=-1;if(layersMap[zlevel])"production"!==process.env.NODE_ENV&&logError("ZLevel "+zlevel+" has been used already");else if(function(layer){return!!layer&&(!!layer.__builtin__||"function"==typeof layer.resize&&"function"==typeof layer.refresh)}(layer)){if(len>0&&zlevel>zlevelList[0]){for(i=0;i<len-1&&!(zlevelList[i]<zlevel&&zlevelList[i+1]>zlevel);i++);prevLayer=layersMap[zlevelList[i]]}if(zlevelList.splice(i+1,0,zlevel),layersMap[zlevel]=layer,!layer.virtual)if(prevLayer){var prevDom=prevLayer.dom;prevDom.nextSibling?domRoot.insertBefore(layer.dom,prevDom.nextSibling):domRoot.appendChild(layer.dom)}else domRoot.firstChild?domRoot.insertBefore(layer.dom,domRoot.firstChild):domRoot.appendChild(layer.dom);layer.painter||(layer.painter=this)}else"production"!==process.env.NODE_ENV&&logError("Layer of zlevel "+zlevel+" is not valid")},CanvasPainter.prototype.eachLayer=function(cb,context){for(var zlevelList=this._zlevelList,i=0;i<zlevelList.length;i++){var z=zlevelList[i];cb.call(context,this._layers[z],z)}},CanvasPainter.prototype.eachBuiltinLayer=function(cb,context){for(var zlevelList=this._zlevelList,i=0;i<zlevelList.length;i++){var z=zlevelList[i],layer=this._layers[z];layer.__builtin__&&cb.call(context,layer,z)}},CanvasPainter.prototype.eachOtherLayer=function(cb,context){for(var zlevelList=this._zlevelList,i=0;i<zlevelList.length;i++){var z=zlevelList[i],layer=this._layers[z];layer.__builtin__||cb.call(context,layer,z)}},CanvasPainter.prototype.getLayers=function(){return this._layers},CanvasPainter.prototype._updateLayerStatus=function(list){function updatePrevLayer(idx){prevLayer&&(prevLayer.__endIndex!==idx&&(prevLayer.__dirty=!0),prevLayer.__endIndex=idx)}if(this.eachBuiltinLayer((function(layer,z){layer.__dirty=layer.__used=!1})),this._singleCanvas)for(var i_1=1;i_1<list.length;i_1++){if((el=list[i_1]).zlevel!==list[i_1-1].zlevel||el.incremental){this._needsManuallyCompositing=!0;break}}var prevZlevel,i,prevLayer=null,incrementalLayerCount=0;for(i=0;i<list.length;i++){var el,zlevel=(el=list[i]).zlevel,layer=void 0;prevZlevel!==zlevel&&(prevZlevel=zlevel,incrementalLayerCount=0),el.incremental?((layer=this.getLayer(zlevel+.001,this._needsManuallyCompositing)).incremental=!0,incrementalLayerCount=1):layer=this.getLayer(zlevel+(incrementalLayerCount>0?.01:0),this._needsManuallyCompositing),layer.__builtin__||logError("ZLevel "+zlevel+" has been used by unkown layer "+layer.id),layer!==prevLayer&&(layer.__used=!0,layer.__startIndex!==i&&(layer.__dirty=!0),layer.__startIndex=i,layer.incremental?layer.__drawIndex=-1:layer.__drawIndex=i,updatePrevLayer(i),prevLayer=layer),1&el.__dirty&&!el.__inHover&&(layer.__dirty=!0,layer.incremental&&layer.__drawIndex<0&&(layer.__drawIndex=i))}updatePrevLayer(i),this.eachBuiltinLayer((function(layer,z){!layer.__used&&layer.getElementCount()>0&&(layer.__dirty=!0,layer.__startIndex=layer.__endIndex=layer.__drawIndex=0),layer.__dirty&&layer.__drawIndex<0&&(layer.__drawIndex=layer.__startIndex)}))},CanvasPainter.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},CanvasPainter.prototype._clearLayer=function(layer){layer.clear()},CanvasPainter.prototype.setBackgroundColor=function(backgroundColor){this._backgroundColor=backgroundColor,each$b(this._layers,(function(layer){layer.setUnpainted()}))},CanvasPainter.prototype.configLayer=function(zlevel,config){if(config){var layerConfig=this._layerConfig;layerConfig[zlevel]?merge(layerConfig[zlevel],config,!0):layerConfig[zlevel]=config;for(var i=0;i<this._zlevelList.length;i++){var _zlevel=this._zlevelList[i];if(_zlevel===zlevel||_zlevel===zlevel+.01)merge(this._layers[_zlevel],layerConfig[zlevel],!0)}}},CanvasPainter.prototype.delLayer=function(zlevel){var layers=this._layers,zlevelList=this._zlevelList,layer=layers[zlevel];layer&&(layer.dom.parentNode.removeChild(layer.dom),delete layers[zlevel],zlevelList.splice(indexOf(zlevelList,zlevel),1))},CanvasPainter.prototype.resize=function(width,height){if(this._domRoot.style){var domRoot=this._domRoot;domRoot.style.display="none";var opts=this._opts,root=this.root;if(null!=width&&(opts.width=width),null!=height&&(opts.height=height),width=getSize$1(root,0,opts),height=getSize$1(root,1,opts),domRoot.style.display="",this._width!==width||height!==this._height){for(var id in domRoot.style.width=width+"px",domRoot.style.height=height+"px",this._layers)this._layers.hasOwnProperty(id)&&this._layers[id].resize(width,height);this.refresh(!0)}this._width=width,this._height=height}else{if(null==width||null==height)return;this._width=width,this._height=height,this.getLayer(314159).resize(width,height)}return this},CanvasPainter.prototype.clearLayer=function(zlevel){var layer=this._layers[zlevel];layer&&layer.clear()},CanvasPainter.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},CanvasPainter.prototype.getRenderedCanvas=function(opts){if(opts=opts||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var imageLayer=new Layer$1("image",this,opts.pixelRatio||this.dpr);imageLayer.initContext(),imageLayer.clear(!1,opts.backgroundColor||this._backgroundColor);var ctx=imageLayer.ctx;if(opts.pixelRatio<=this.dpr){this.refresh();var width_1=imageLayer.dom.width,height_1=imageLayer.dom.height;this.eachLayer((function(layer){layer.__builtin__?ctx.drawImage(layer.dom,0,0,width_1,height_1):layer.renderToCanvas&&(ctx.save(),layer.renderToCanvas(ctx),ctx.restore())}))}else for(var scope={inHover:!1,viewWidth:this._width,viewHeight:this._height},displayList=this.storage.getDisplayList(!0),i=0,len=displayList.length;i<len;i++){var el=displayList[i];brush(ctx,el,scope,i===len-1)}return imageLayer.dom},CanvasPainter.prototype.getWidth=function(){return this._width},CanvasPainter.prototype.getHeight=function(){return this._height},CanvasPainter}(),CanvasPainter$1=CanvasPainter;function install(registers){registers.registerPainter("canvas",CanvasPainter$1)}var CHART_PREFIX$4="".concat("acud-pro","-chart");use([install$y,install$u,install$x,install$w,function(registers){use(install$t),registers.registerChartView(RadarView$3),registers.registerSeriesModel(RadarSeriesModel$1),registers.registerLayout(radarLayout),registers.registerProcessor(dataFilter$1("radar")),registers.registerPreprocessor(radarBackwardCompat)},function(registers){registers.registerChartView(GraphView$1),registers.registerSeriesModel(GraphSeriesModel$1),registers.registerProcessor(categoryFilter),registers.registerVisual(categoryVisual),registers.registerVisual(graphEdgeVisual),registers.registerLayout(graphSimpleLayout),registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT,graphCircularLayout),registers.registerLayout(graphForceLayout),registers.registerCoordinateSystem("graphView",{dimensions:View$1.dimensions,create:createViewCoordSys}),registers.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},noop$1),registers.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},noop$1),registers.registerAction(actionInfo$1,(function(payload,ecModel,api){ecModel.eachComponent({mainType:"series",query:payload},(function(seriesModel){var res=updateCenterAndZoom(seriesModel.coordinateSystem,payload,void 0,api);seriesModel.setCenter&&seriesModel.setCenter(res.center),seriesModel.setZoom&&seriesModel.setZoom(res.zoom)}))}))},function(registers){registers.registerChartView(GaugeView$1),registers.registerSeriesModel(GaugeSeriesModel$1)},function(registers){registers.registerSeriesModel(BoxplotSeriesModel$1),registers.registerChartView(BoxplotView$1),registers.registerLayout(boxplotLayout),registers.registerTransform(boxplotTransform)},function(registers){use(install$n),registers.registerChartView(ParallelView$3),registers.registerSeriesModel(ParallelSeriesModel$1),registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH,parallelVisual$1)},function(registers){registers.registerChartView(SankeyView$1),registers.registerSeriesModel(SankeySeriesModel$1),registers.registerLayout(sankeyLayout),registers.registerVisual(sankeyVisual),registers.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(payload,ecModel){ecModel.eachComponent({mainType:"series",subType:"sankey",query:payload},(function(seriesModel){seriesModel.setNodePosition(payload.dataIndex,[payload.localX,payload.localY])}))}))},function(registers){registers.registerChartView(PictorialBarView$1),registers.registerSeriesModel(PictorialBarSeriesModel$1),registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT,curry$1(layout$2,"pictorialBar")),registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,createProgressiveLayout("pictorialBar"))},function(registers){registers.registerChartView(ThemeRiverView$1),registers.registerSeriesModel(ThemeRiverSeriesModel$1),registers.registerLayout(themeRiverLayout),registers.registerProcessor(dataFilter$1("themeRiver"))},function(registers){registers.registerChartView(SunburstView$1),registers.registerSeriesModel(SunburstSeriesModel$1),registers.registerLayout(curry$1(sunburstLayout,"sunburst")),registers.registerProcessor(curry$1(dataFilter$1,"sunburst")),registers.registerVisual(sunburstVisual),function(registers){registers.registerAction({type:"sunburstRootToNode",update:"updateView"},(function(payload,ecModel){ecModel.eachComponent({mainType:"series",subType:"sunburst",query:payload},(function(model,index){var targetInfo=retrieveTargetInfo(payload,["sunburstRootToNode"],model);if(targetInfo){var originViewRoot=model.getViewRoot();originViewRoot&&(payload.direction=aboveViewRoot(originViewRoot,targetInfo.node)?"rollUp":"drillDown"),model.resetViewRoot(targetInfo.node)}}))})),registers.registerAction({type:"sunburstHighlight",update:"none"},(function(payload,ecModel,api){payload=extend({},payload),ecModel.eachComponent({mainType:"series",subType:"sunburst",query:payload},(function(model){var targetInfo=retrieveTargetInfo(payload,["sunburstHighlight"],model);targetInfo&&(payload.dataIndex=targetInfo.node.dataIndex)})),"production"!==process.env.NODE_ENV&&deprecateReplaceLog("sunburstHighlight","highlight"),api.dispatchAction(extend(payload,{type:"highlight"}))})),registers.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(payload,ecModel,api){payload=extend({},payload),"production"!==process.env.NODE_ENV&&deprecateReplaceLog("sunburstUnhighlight","downplay"),api.dispatchAction(extend(payload,{type:"downplay"}))}))}(registers)},function(registers){registers.registerChartView(HeatmapView$1),registers.registerSeriesModel(HeatmapSeriesModel$1)},function(registers){registers.registerSeriesModel(TreemapSeriesModel$1),registers.registerChartView(TreemapView$1),registers.registerVisual(treemapVisual),registers.registerLayout(treemapLayout),function(registers){for(var i=0;i<actionTypes.length;i++)registers.registerAction({type:actionTypes[i],update:"updateView"},noop$1);registers.registerAction({type:"treemapRootToNode",update:"updateView"},(function(payload,ecModel){ecModel.eachComponent({mainType:"series",subType:"treemap",query:payload},(function(model,index){var targetInfo=retrieveTargetInfo(payload,["treemapZoomToNode","treemapRootToNode"],model);if(targetInfo){var originViewRoot=model.getViewRoot();originViewRoot&&(payload.direction=aboveViewRoot(originViewRoot,targetInfo.node)?"rollUp":"drillDown"),model.resetViewRoot(targetInfo.node)}}))}))}(registers)},function(registers){registers.registerChartView(TreeView$1),registers.registerSeriesModel(TreeSeriesModel$1),registers.registerLayout(treeLayout),registers.registerVisual(treeVisual),function(registers){registers.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(payload,ecModel){ecModel.eachComponent({mainType:"series",subType:"tree",query:payload},(function(seriesModel){var dataIndex=payload.dataIndex,node=seriesModel.getData().tree.getNodeByDataIndex(dataIndex);node.isExpand=!node.isExpand}))})),registers.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(payload,ecModel,api){ecModel.eachComponent({mainType:"series",subType:"tree",query:payload},(function(seriesModel){var res=updateCenterAndZoom(seriesModel.coordinateSystem,payload,void 0,api);seriesModel.setCenter&&seriesModel.setCenter(res.center),seriesModel.setZoom&&seriesModel.setZoom(res.zoom)}))}))}(registers)},install$b,install$a,install$4,install$c,install$e,install,install$1,function(registers){registers.registerUpdateLifecycle("series:beforeupdate",(function(ecModel,api,params){var labelManager=getLabelManager(api).labelManager;labelManager||(labelManager=getLabelManager(api).labelManager=new LabelManager$1),labelManager.clearLabels()})),registers.registerUpdateLifecycle("series:layoutlabels",(function(ecModel,api,params){var labelManager=getLabelManager(api).labelManager;params.updatedSeries.forEach((function(series){labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series))})),labelManager.updateLayoutConfig(api),labelManager.layout(api),labelManager.processLabelsOverall()}))},function(registers){registers.registerUpdateLifecycle("series:beforeupdate",(function(ecMOdel,api,params){each$b(normalizeToArray(params.seriesTransition),(function(transOpt){each$b(normalizeToArray(transOpt.to),(function(finder){for(var series=params.updatedSeries,i=0;i<series.length;i++)(null!=finder.seriesIndex&&finder.seriesIndex===series[i].seriesIndex||null!=finder.seriesId&&finder.seriesId===series[i].id)&&(series[i].__universalTransitionEnabled=!0)}))}))})),registers.registerUpdateLifecycle("series:transition",(function(ecModel,api,params){var globalStore=getUniversalTransitionGlobalStore(api);if(globalStore.oldSeries&&params.updatedSeries&&params.optionChanged){var transitionOpt=params.seriesTransition;if(transitionOpt)each$b(normalizeToArray(transitionOpt),(function(opt){!function(transitionOpt,globalStore,params,api){var from=[],to=[];each$b(normalizeToArray(transitionOpt.from),(function(finder){var idx=querySeries(globalStore.oldSeries,finder);idx>=0&&from.push({dataGroupId:globalStore.oldDataGroupIds[idx],data:globalStore.oldData[idx],divide:getDivideShapeFromData(globalStore.oldData[idx]),groupIdDim:finder.dimension})})),each$b(normalizeToArray(transitionOpt.to),(function(finder){var idx=querySeries(params.updatedSeries,finder);if(idx>=0){var data=params.updatedSeries[idx].getData();to.push({dataGroupId:globalStore.oldDataGroupIds[idx],data:data,divide:getDivideShapeFromData(data),groupIdDim:finder.dimension})}})),from.length>0&&to.length>0&&transitionBetween(from,to,api)}(opt,globalStore,params,api)}));else{var updateBatches_1=function(globalStore,params){var updateBatches=createHashMap(),oldDataMap=createHashMap(),oldDataMapForSplit=createHashMap();function checkTransitionSeriesKeyDuplicated(transitionKeyStr){updateBatches.get(transitionKeyStr)&&warn("Duplicated seriesKey in universalTransition "+transitionKeyStr)}return each$b(globalStore.oldSeries,(function(series,idx){var oldDataGroupId=globalStore.oldDataGroupIds[idx],oldData=globalStore.oldData[idx],transitionKey=getSeriesTransitionKey(series),transitionKeyStr=convertArraySeriesKeyToString(transitionKey);oldDataMap.set(transitionKeyStr,{dataGroupId:oldDataGroupId,data:oldData}),isArray(transitionKey)&&each$b(transitionKey,(function(key){oldDataMapForSplit.set(key,{key:transitionKeyStr,dataGroupId:oldDataGroupId,data:oldData})}))})),each$b(params.updatedSeries,(function(series){if(series.isUniversalTransitionEnabled()&&series.isAnimationEnabled()){var newDataGroupId=series.get("dataGroupId"),newData=series.getData(),transitionKey=getSeriesTransitionKey(series),transitionKeyStr=convertArraySeriesKeyToString(transitionKey),oldData=oldDataMap.get(transitionKeyStr);if(oldData)"production"!==process.env.NODE_ENV&&checkTransitionSeriesKeyDuplicated(transitionKeyStr),updateBatches.set(transitionKeyStr,{oldSeries:[{dataGroupId:oldData.dataGroupId,divide:getDivideShapeFromData(oldData.data),data:oldData.data}],newSeries:[{dataGroupId:newDataGroupId,divide:getDivideShapeFromData(newData),data:newData}]});else if(isArray(transitionKey)){"production"!==process.env.NODE_ENV&&checkTransitionSeriesKeyDuplicated(transitionKeyStr);var oldSeries_1=[];each$b(transitionKey,(function(key){var oldData=oldDataMap.get(key);oldData.data&&oldSeries_1.push({dataGroupId:oldData.dataGroupId,divide:getDivideShapeFromData(oldData.data),data:oldData.data})})),oldSeries_1.length&&updateBatches.set(transitionKeyStr,{oldSeries:oldSeries_1,newSeries:[{dataGroupId:newDataGroupId,data:newData,divide:getDivideShapeFromData(newData)}]})}else{var oldData_1=oldDataMapForSplit.get(transitionKey);if(oldData_1){var batch=updateBatches.get(oldData_1.key);batch||(batch={oldSeries:[{dataGroupId:oldData_1.dataGroupId,data:oldData_1.data,divide:getDivideShapeFromData(oldData_1.data)}],newSeries:[]},updateBatches.set(oldData_1.key,batch)),batch.newSeries.push({dataGroupId:newDataGroupId,data:newData,divide:getDivideShapeFromData(newData)})}}}})),updateBatches}(globalStore,params);each$b(updateBatches_1.keys(),(function(key){var batch=updateBatches_1.get(key);transitionBetween(batch.oldSeries,batch.newSeries,api)}))}each$b(params.updatedSeries,(function(series){series.__universalTransitionEnabled&&(series.__universalTransitionEnabled=!1)}))}for(var allSeries=ecModel.getSeries(),savedSeries=globalStore.oldSeries=[],savedDataGroupIds=globalStore.oldDataGroupIds=[],savedData=globalStore.oldData=[],i=0;i<allSeries.length;i++){var data=allSeries[i].getData();data.count()<1e4&&(savedSeries.push(allSeries[i]),savedDataGroupIds.push(allSeries[i].get("dataGroupId")),savedData.push(data))}}))}]);var lineEmptySvg=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"62.358",height:"55"},React.createElement("g",{fill:"none","fill-rule":"evenodd"},React.createElement("path",{d:"M-4.517-9.687h72v72h-72z"}),React.createElement("path",{d:"M-4.517-9.687h72v72h-72z"}),React.createElement("path",{stroke:"#F2F2F4","stroke-dasharray":"1.905","stroke-linecap":"round","stroke-linejoin":"round",d:"M20.058.5v54M42.915.5v54"}),React.createElement("path",{fill:"#E8E9EB","fill-rule":"nonzero",d:"M18.32 6.87a2.85 2.85 0 0 1 4.326.246l.101.143L44.73 40.04l17.278 3.184a.43.43 0 0 1 .344.499l-.877 4.803a.43.43 0 0 1-.5.344l-18.459-3.4a2.86 2.86 0 0 1-1.75-1.076l-.104-.144-20.678-30.84L4.236 29.824a.43.43 0 0 1-.607.011L.13 26.446a.43.43 0 0 1-.01-.604z"}),React.createElement("path",{fill:"#D4D6D9","fill-rule":"nonzero",d:"m58.756 19.468 3.404 3.47c.153.155.164.4.027.57L45.037 44.69a2.85 2.85 0 0 1-3.122.598l-.158-.073-21.534-10.778L4.289 51.526a.43.43 0 0 1-.607.02L.136 48.21a.43.43 0 0 1-.02-.605l17.392-18.65a2.85 2.85 0 0 1 3.203-.68l.156.073 21.611 10.815 15.637-19.661a.43.43 0 0 1 .641-.033"})))},ChartLineEmpty=function(props){var width=props.width,height=props.height;return React.createElement(Icon,__assign({},{width:width,height:height},{component:lineEmptySvg}))},CHART_COLOR=["#528EFF","#57D9D4","#8F5CFF","#FFC27D","#F25788","#0099E6","#FF908C","#7BD964","#4D4DFF","#FFE030","#A8CAFF","#00BFBF","#B8BBFF","#FF9326","#FFADC5","#69D2FF","#FF6966","#30BF13","#9497FF","#FAD000"],CHART_PREFIX$3="".concat("acud-pro","-chart");use([install$y,install$b,install$a,install$4,install$c,install$e,install,install$1,function(registers){registers.registerComponentModel(MarkLineModel$1),registers.registerComponentView(MarkLineView$1),registers.registerPreprocessor((function(opt){checkMarkerInSeries(opt.series,"markLine")&&(opt.markLine=opt.markLine||{})}))},function(registers){registers.registerComponentModel(MarkAreaModel$1),registers.registerComponentView(MarkAreaView$1),registers.registerPreprocessor((function(opt){checkMarkerInSeries(opt.series,"markArea")&&(opt.markArea=opt.markArea||{})}))},function(registers){registers.registerComponentModel(MarkPointModel$1),registers.registerComponentView(MarkPointView$1),registers.registerPreprocessor((function(opt){checkMarkerInSeries(opt.series,"markPoint")&&(opt.markPoint=opt.markPoint||{})}))}]);var DEFAULT_OPTION$3={title:{},tooltip:{trigger:"axis",enterable:!0,confine:!0},legend:{icon:"roundRect",itemWidth:12,itemHeight:2},xAxis:{triggerEvent:!0,type:"category"},yAxis:{type:"value"},grid:{left:10,containLabel:!0,right:10,top:60}},DEFAULT_OPTION_SERIES$3={type:"line",showSymbol:!1,smooth:!0,emphasis:{focus:"series"},itemStyle:{}},ChartLine=React.forwardRef((function(props,ref){var containerWidth=props.containerWidth,containerHeight=props.containerHeight,chartWidth=props.chartWidth,chartHeight=props.chartHeight,option=props.option,_a=props.customLegend,customLegend=void 0!==_a&&_a,_b=props.emptyData,emptyData=void 0!==_b&&_b,chartRef=React.useRef(null),chartInsRef=React.useRef(null),_c=__read(React.useState(),2),mergedOption=_c[0],setMergedOption=_c[1],_d=__read(React.useState({}),2),legendSelected=_d[0],setLegendSelected=_d[1],_e=__read(React.useState({}),2),colorMap=_e[0],setColorMap=_e[1],colSpan=React.useMemo((function(){if(!1===customLegend||!0===customLegend)return 24;var colNum=null==customLegend?void 0:customLegend.colNum;return"number"!=typeof colNum?24:Math.round(24/colNum)}),[customLegend]);React.useEffect((function(){var _a,_b,_c,_d;if(option){var mergedOption={};if(option){if("time"===(null===(_a=null==option?void 0:option.xAxis)||void 0===_a?void 0:_a.type)){var isShortTime=null===(_c=null===(_b=option.xAxis)||void 0===_b?void 0:_b.axisLabel)||void 0===_c?void 0:_c.isShortTime;option.xAxis.axisLabel=_.merge({},function(isShortTime){void 0===isShortTime&&(isShortTime=!1);var dateFormat=isShortTime?"{MM}-{dd}":"{yyyy}-{MM}-{dd}",timeFormat=isShortTime?"{HH}:{mm}":"{HH}:{mm}:{ss}";return{hideOverlap:!0,formatter:{year:dateFormat,month:dateFormat,day:dateFormat,hour:timeFormat,minute:timeFormat,second:timeFormat}}}(isShortTime),(null===(_d=option.xAxis)||void 0===_d?void 0:_d.axisLabel)||{})}_.merge(mergedOption,DEFAULT_OPTION$3,option),mergedOption.series=mergedOption.series.map((function(s){return _.merge({},DEFAULT_OPTION_SERIES$3,s)}))}if(!1!==customLegend){for(var series=mergedOption.series,legendSelectedTemp={},colorMapTemp_1={},i=0,len=series.length;i<len;i++){var element=series[i];legendSelectedTemp[element.name]=!0,colorMapTemp_1[element.name]=CHART_COLOR[i%CHART_COLOR.length]}setLegendSelected(legendSelectedTemp),setColorMap(colorMapTemp_1),mergedOption.legend.show=!1,mergedOption.selected=legendSelectedTemp,mergedOption.series=mergedOption.series.map((function(s){return s.itemStyle||(s.itemStyle={}),s.itemStyle.color=colorMapTemp_1[s.name],s}))}setMergedOption(mergedOption)}}),[option,customLegend]),React.useEffect((function(){if(chartInsRef.current)void 0===chartWidth&&void 0===chartHeight||chartInsRef.current.resize({width:chartWidth,height:chartHeight});else{var opt={locale:"ZH"};chartWidth&&(opt.width=chartWidth),chartHeight&&(opt.height=chartHeight);var chart=init$1(chartRef.current,null,opt);if(chartInsRef.current=chart,void 0===chartWidth&&void 0===chartHeight){var resizeObserver_1=new ResizeObserver((function(){chartInsRef.current.resize()}));return resizeObserver_1.observe(chartRef.current),function(){resizeObserver_1.disconnect()}}}}),[chartWidth,chartHeight]),React.useEffect((function(){var _a;if(mergedOption){var fOption=__assign({},mergedOption);legendSelected&&(fOption.legend.selected=legendSelected),null===(_a=null==chartInsRef?void 0:chartInsRef.current)||void 0===_a||_a.setOption(fOption,!0)}}),[mergedOption,legendSelected]);var containerStyle=React.useMemo((function(){var cStyle=null;return containerWidth?(cStyle={width:containerWidth},containerHeight&&(cStyle.height=containerHeight)):containerHeight&&(cStyle={height:containerHeight}),cStyle}),[containerWidth,containerHeight]),emptyCom=React.useMemo((function(){if(emptyData){if(!0===emptyData)return React.createElement("div",{className:"".concat(CHART_PREFIX$3,"-empty-box")},React.createElement(acud.Empty,{image:React.createElement(ChartLineEmpty,{width:72,height:72})}));var icon=emptyData.icon,extra=emptyData.extra;return React.createElement("div",{className:"".concat(CHART_PREFIX$3,"-empty-box")},React.createElement(acud.Empty,{image:icon||React.createElement(ChartLineEmpty,{width:72,height:72}),description:extra||"暂无数据"}))}return null}),[emptyData]);return React.useImperativeHandle(ref,(function(){return{getChartInstance:function(){return chartInsRef.current}}})),React.createElement("div",{className:"".concat(CHART_PREFIX$3,"-box")},React.createElement("div",{ref:chartRef,className:"".concat(CHART_PREFIX$3,"-box-content"),style:containerStyle}),emptyCom,customLegend&&React.createElement(acud.Row,{align:"top",justify:"start",className:"".concat(CHART_PREFIX$3,"-legend-container")},Object.entries(legendSelected).map((function(_a){var _b,_c=__read(_a,2),legendItem=_c[0],value=_c[1];return React.createElement(acud.Col,{span:colSpan,className:"".concat(CHART_PREFIX$3,"-legend-item"),onClick:function(){return function(legendItem,value){var legendSelectedTemp=__assign({},legendSelected);legendSelectedTemp[legendItem]=!value,setLegendSelected(legendSelectedTemp)}(legendItem,value)},key:legendItem},React.createElement("div",{className:"".concat(CHART_PREFIX$3,"-legend-tag"),style:{backgroundColor:colorMap[legendItem]}}),React.createElement("div",{className:classNames("".concat(CHART_PREFIX$3,"-legend-name"),(_b={},_b["".concat(CHART_PREFIX$3,"-legend-name-disabled")]=!1===value,_b))},legendItem))}))))}));ChartLine.displayName="ChartLine";var pieEmptySvg=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"54"},React.createElement("g",{fill:"none","fill-rule":"evenodd"},React.createElement("path",{d:"M-10-8h72v72h-72z"}),React.createElement("path",{fill:"#E8E9EB",d:"M52 28c0 14.36-11.64 26-26 26S0 42.36 0 28 11.64 2 26 2v26Z"}),React.createElement("path",{fill:"#D4D6D9",d:"M28 0c14.36 0 26 11.64 26 26H28Z"}),React.createElement("path",{d:"M-10-8h72v72h-72z"})))},ChartPieEmpty=function(props){var width=props.width,height=props.height;return React.createElement(Icon,__assign({},{width:width,height:height},{component:pieEmptySvg}))},CHART_PREFIX$2="".concat("acud-pro","-chart");use([install$w,install$b,install$a,install$4,install$c,install$e,install,install$1]);var DEFAULT_OPTION$2={legend:{icon:"roundRect",itemWidth:12,itemHeight:2}},DEFAULT_OPTION_SERIES$2={type:"pie",itemStyle:{}},CHART_PREFIX$1="".concat("acud-pro","-chart");use([install$u,install$b,install$a,install$4,install$c,install$e,install,install$1]);var DEFAULT_OPTION$1={title:{},tooltip:{trigger:"axis",enterable:!0,confine:!0},legend:{icon:"roundRect",itemWidth:12,itemHeight:2},xAxis:{triggerEvent:!0,type:"category"},yAxis:{type:"value"},grid:{left:10,containLabel:!0,right:10,top:60}},DEFAULT_OPTION_SERIES$1={type:"scatter",showSymbol:!1,smooth:!0,emphasis:{focus:"series"},symbolSize:5,itemStyle:{}},ChartScatter=React.forwardRef((function(props,ref){var containerWidth=props.containerWidth,containerHeight=props.containerHeight,chartWidth=props.chartWidth,chartHeight=props.chartHeight,option=props.option,_a=props.customLegend,customLegend=void 0!==_a&&_a,_b=props.emptyData,emptyData=void 0!==_b&&_b,chartRef=React.useRef(null),chartInsRef=React.useRef(null),_c=__read(React.useState(),2),mergedOption=_c[0],setMergedOption=_c[1],_d=__read(React.useState({}),2),legendSelected=_d[0],setLegendSelected=_d[1],_e=__read(React.useState({}),2),colorMap=_e[0],setColorMap=_e[1],colSpan=React.useMemo((function(){if(!1===customLegend||!0===customLegend)return 24;var colNum=null==customLegend?void 0:customLegend.colNum;return"number"!=typeof colNum?24:Math.round(24/colNum)}),[customLegend]);React.useEffect((function(){if(option){var mergedOption={};if(option&&(_.merge(mergedOption,DEFAULT_OPTION$1,option),mergedOption.series=mergedOption.series.map((function(s){return _.merge({},DEFAULT_OPTION_SERIES$1,s)}))),!1!==customLegend){for(var series=mergedOption.series,legendSelectedTemp={},colorMapTemp_1={},i=0,len=series.length;i<len;i++){var element=series[i];legendSelectedTemp[element.name]=!0,colorMapTemp_1[element.name]=CHART_COLOR[i%CHART_COLOR.length]}setLegendSelected(legendSelectedTemp),setColorMap(colorMapTemp_1),mergedOption.legend.show=!1,mergedOption.selected=legendSelectedTemp,mergedOption.series=mergedOption.series.map((function(s){return s.itemStyle||(s.itemStyle={}),s.itemStyle.color=colorMapTemp_1[s.name],s}))}setMergedOption(mergedOption)}}),[option,customLegend]),React.useEffect((function(){if(chartInsRef.current)void 0===chartWidth&&void 0===chartHeight||chartInsRef.current.resize({width:chartWidth,height:chartHeight});else{var opt={locale:"ZH"};chartWidth&&(opt.width=chartWidth),chartHeight&&(opt.height=chartHeight);var chart=init$1(chartRef.current,null,opt);if(chartInsRef.current=chart,void 0===chartWidth&&void 0===chartHeight){var resizeObserver_1=new ResizeObserver((function(){chartInsRef.current.resize()}));return resizeObserver_1.observe(chartRef.current),function(){resizeObserver_1.disconnect()}}}}),[chartWidth,chartHeight]),React.useEffect((function(){var _a;if(mergedOption){var fOption=__assign({},mergedOption);legendSelected&&(fOption.legend.selected=legendSelected),null===(_a=null==chartInsRef?void 0:chartInsRef.current)||void 0===_a||_a.setOption(fOption,!0)}}),[mergedOption,legendSelected]);var containerStyle=React.useMemo((function(){var cStyle=null;return containerWidth?(cStyle={width:containerWidth},containerHeight&&(cStyle.height=containerHeight)):containerHeight&&(cStyle={height:containerHeight}),cStyle}),[containerWidth,containerHeight]),emptyCom=React.useMemo((function(){if(emptyData){if(!0===emptyData)return React.createElement("div",{className:"".concat(CHART_PREFIX$1,"-empty-box")},React.createElement(acud.Empty,{image:React.createElement(ChartLineEmpty,{width:72,height:72})}));var icon=emptyData.icon,extra=emptyData.extra;return React.createElement("div",{className:"".concat(CHART_PREFIX$1,"-empty-box")},React.createElement(acud.Empty,{image:icon||React.createElement(ChartLineEmpty,{width:72,height:72}),description:extra||"暂无数据"}))}return null}),[emptyData]);return React.useImperativeHandle(ref,(function(){return{getChartInstance:function(){return chartInsRef.current}}})),React.createElement("div",{className:"".concat(CHART_PREFIX$1,"-box")},React.createElement("div",{ref:chartRef,className:"".concat(CHART_PREFIX$1,"-box-content"),style:containerStyle}),emptyCom,customLegend&&React.createElement(acud.Row,{align:"top",justify:"start",className:"".concat(CHART_PREFIX$1,"-legend-container")},Object.entries(legendSelected).map((function(_a){var _b,_c=__read(_a,2),legendItem=_c[0],value=_c[1];return React.createElement(acud.Col,{span:colSpan,className:"".concat(CHART_PREFIX$1,"-legend-item"),onClick:function(){return function(legendItem,value){var legendSelectedTemp=__assign({},legendSelected);legendSelectedTemp[legendItem]=!value,setLegendSelected(legendSelectedTemp)}(legendItem,value)},key:legendItem},React.createElement("div",{className:"".concat(CHART_PREFIX$1,"-legend-tag"),style:{backgroundColor:colorMap[legendItem]}}),React.createElement("div",{className:classNames("".concat(CHART_PREFIX$1,"-legend-name"),(_b={},_b["".concat(CHART_PREFIX$1,"-legend-name-disabled")]=!1===value,_b))},legendItem))}))))}));ChartScatter.displayName="ChartScatter";var barEmptySvg=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"50",height:"50"},React.createElement("g",{fill:"none","fill-rule":"evenodd"},React.createElement("path",{d:"M-11-11h72v72h-72z"}),React.createElement("path",{fill:"#D4D6D9",stroke:"#D4D6D9","stroke-linejoin":"round","stroke-width":"2",d:"M1 1h8v48H1z"}),React.createElement("path",{fill:"#E8E9EB",stroke:"#E8E9EB","stroke-linejoin":"round","stroke-width":"2",d:"M21 15h8v34h-8zm20 16h8v18h-8z"}),React.createElement("path",{d:"M-11-11h72v72h-72z"})))},ChartBarEmpty=function(props){var width=props.width,height=props.height;return React.createElement(Icon,__assign({},{width:width,height:height},{component:barEmptySvg}))},CHART_PREFIX="".concat("acud-pro","-chart");use([install$x,install$b,install$a,install$4,install$c,install$e,install,install$1]);var DEFAULT_OPTION={title:{},tooltip:{trigger:"axis",enterable:!0,confine:!0},legend:{icon:"roundRect",itemWidth:12,itemHeight:2},xAxis:{triggerEvent:!0,type:"category"},yAxis:{type:"value"},grid:{left:10,containLabel:!0,right:10,top:60}},DEFAULT_OPTION_SERIES={type:"bar",showSymbol:!1,smooth:!0,emphasis:{focus:"series"},itemStyle:{borderRadius:[2,2,0,0]}},ChartBar=React.forwardRef((function(props,ref){var containerWidth=props.containerWidth,containerHeight=props.containerHeight,chartWidth=props.chartWidth,chartHeight=props.chartHeight,option=props.option,_a=props.customLegend,customLegend=void 0!==_a&&_a,_b=props.emptyData,emptyData=void 0!==_b&&_b,chartRef=React.useRef(null),chartInsRef=React.useRef(null),_c=__read(React.useState(),2),mergedOption=_c[0],setMergedOption=_c[1],_d=__read(React.useState({}),2),legendSelected=_d[0],setLegendSelected=_d[1],_e=__read(React.useState({}),2),colorMap=_e[0],setColorMap=_e[1],colSpan=React.useMemo((function(){if(!1===customLegend||!0===customLegend)return 24;var colNum=null==customLegend?void 0:customLegend.colNum;return"number"!=typeof colNum?24:Math.round(24/colNum)}),[customLegend]);React.useEffect((function(){if(option){var mergedOption={};if(option&&(_.merge(mergedOption,DEFAULT_OPTION,option),mergedOption.series=mergedOption.series.map((function(s){return _.merge({},DEFAULT_OPTION_SERIES,s)}))),!1!==customLegend){for(var series=mergedOption.series,legendSelectedTemp={},colorMapTemp_1={},i=0,len=series.length;i<len;i++){var element=series[i];legendSelectedTemp[element.name]=!0,colorMapTemp_1[element.name]=CHART_COLOR[i%CHART_COLOR.length]}setLegendSelected(legendSelectedTemp),setColorMap(colorMapTemp_1),mergedOption.legend.show=!1,mergedOption.selected=legendSelectedTemp,mergedOption.series=mergedOption.series.map((function(s){return s.itemStyle||(s.itemStyle={}),s.itemStyle.color=colorMapTemp_1[s.name],s}))}setMergedOption(mergedOption)}}),[option,customLegend]),React.useEffect((function(){if(chartInsRef.current)void 0===chartWidth&&void 0===chartHeight||chartInsRef.current.resize({width:chartWidth,height:chartHeight});else{var opt={locale:"ZH"};chartWidth&&(opt.width=chartWidth),chartHeight&&(opt.height=chartHeight);var chart=init$1(chartRef.current,null,opt);if(chartInsRef.current=chart,void 0===chartWidth&&void 0===chartHeight){var resizeObserver_1=new ResizeObserver((function(){chartInsRef.current.resize()}));return resizeObserver_1.observe(chartRef.current),function(){resizeObserver_1.disconnect()}}}}),[chartWidth,chartHeight]),React.useEffect((function(){var _a;if(mergedOption){var fOption=__assign({},mergedOption);legendSelected&&(fOption.legend.selected=legendSelected),null===(_a=null==chartInsRef?void 0:chartInsRef.current)||void 0===_a||_a.setOption(fOption,!0)}}),[mergedOption,legendSelected]);var containerStyle=React.useMemo((function(){var cStyle=null;return containerWidth?(cStyle={width:containerWidth},containerHeight&&(cStyle.height=containerHeight)):containerHeight&&(cStyle={height:containerHeight}),cStyle}),[containerWidth,containerHeight]),emptyCom=React.useMemo((function(){if(emptyData){if(!0===emptyData)return React.createElement("div",{className:"".concat(CHART_PREFIX,"-empty-box")},React.createElement(acud.Empty,{image:React.createElement(ChartBarEmpty,{width:72,height:72})}));var icon=emptyData.icon,extra=emptyData.extra;return React.createElement("div",{className:"".concat(CHART_PREFIX,"-empty-box")},React.createElement(acud.Empty,{image:icon||React.createElement(ChartBarEmpty,{width:72,height:72}),description:extra||"暂无数据"}))}return null}),[emptyData]);return React.useImperativeHandle(ref,(function(){return{getChartInstance:function(){return chartInsRef.current}}})),React.createElement("div",{className:"".concat(CHART_PREFIX,"-box")},React.createElement("div",{ref:chartRef,className:"".concat(CHART_PREFIX,"-box-content"),style:containerStyle}),emptyCom,customLegend&&React.createElement(acud.Row,{align:"top",justify:"start",className:"".concat(CHART_PREFIX,"-legend-container")},Object.entries(legendSelected).map((function(_a){var _b,_c=__read(_a,2),legendItem=_c[0],value=_c[1];return React.createElement(acud.Col,{span:colSpan,className:"".concat(CHART_PREFIX,"-legend-item"),onClick:function(){return function(legendItem,value){var legendSelectedTemp=__assign({},legendSelected);legendSelectedTemp[legendItem]=!value,setLegendSelected(legendSelectedTemp)}(legendItem,value)},key:legendItem},React.createElement("div",{className:"".concat(CHART_PREFIX,"-legend-tag"),style:{backgroundColor:colorMap[legendItem]}}),React.createElement("div",{className:classNames("".concat(CHART_PREFIX,"-legend-name"),(_b={},_b["".concat(CHART_PREFIX,"-legend-name-disabled")]=!1===value,_b))},legendItem))}))))}));ChartBar.displayName="ChartBar";var FormPro=function(props){var _a=props.className,className=void 0===_a?"":_a;return React.createElement("div",{className:"acud-pro-form-pro-container ".concat(className)},props.children)};FormPro.FormCard=function(props){var title=props.title,id=props.id;return React.createElement("div",{className:"acud-pro-form-pro-card",id:id},title&&React.createElement("h2",{className:"acud-pro-form-pro-card-title"},title),props.children)},FormPro.FormAction=function(props){var handleOk=props.handleOk,handleCancel=props.handleCancel;return React.createElement("div",{className:"acud-pro-form-pro-action-box"},React.createElement(acud.Button,{type:"primary",size:"large",onClick:handleOk},"确定"),React.createElement(acud.Button,{size:"large",onClick:handleCancel},"取消"))};var CLS_PREFIX$2="".concat("du","-dialog"),createDialog=function(options,dialogOptionText){return function(WrappedComponent){var _a,_b=options.dialogType,dialogType=void 0===_b?"common":_b,_c=options.className,className=void 0===_c?"":_c,customizePrefixCls=options.prefixCls,title=options.title,width=options.width,maskClosable=options.maskClosable,foot=options.foot,okText=options.okText,cancelText=options.cancelText,sure=dialogOptionText.sure,cancel=dialogOptionText.cancel,submitting=dialogOptionText.submitting,payload=options.payload,message=options.message,_d=options.cancelWithSuccess,cancelWithSuccess=void 0!==_d&&_d,_e=options.mask,mask=void 0===_e||_e,acudProps=options.acudProps,customCancelHandler=options.customCancelHandler;return _a=function(_super){function Dialog(props){var _this=_super.call(this,props)||this;return _this.showDialog=function(){_this.setState({open:!0})},_this.handleCancel=function(){_this.setState({open:!1});var _a=_this.props,onCancel=_a.onCancel,onSuccess=_a.onSuccess;onCancel&&onCancel(),cancelWithSuccess&&onSuccess&&onSuccess()},_this.saveRef=function(form){_this.formRef=form},_this.handleOk=function(){_this.setState({confirmLoading:!0});var submitFunc=null;_this.formRef&&_this.formRef.doSubmit?submitFunc=_this.formRef.doSubmit:_this.formRef&&_this.formRef.getWrappedInstance()&&_this.formRef.getWrappedInstance().doSubmit?submitFunc=_this.formRef.getWrappedInstance().doSubmit:_this.commonFormRef&&_this.commonFormRef.current&&_this.commonFormRef.current.doSubmit&&(submitFunc=_this.commonFormRef.current.doSubmit),submitFunc?submitFunc().then((function(){return _this.setState({confirmLoading:!1})})).catch((function(){return _this.setState({confirmLoading:!1})})):_this.handleCancel()},_this.handleFormSuccess=function(result){var onSuccess=_this.props.onSuccess;onSuccess&&onSuccess(result),_this.handleCancel()},_this.handleConfirmLoading=function(loadingText){_this.setState({confirmLoading:!0,loadingText:loadingText})},_this.handleCancelConfirmLoading=function(){_this.setState({confirmLoading:!1})},_this.handleNewCancel=function(){_.isFunction(customCancelHandler)?customCancelHandler().then((function(){return _this.handleCancel()})):_this.handleCancel()},_this.commonFormRef=React.createRef(),_this.el=document.createElement("div"),_this.state={confirmLoading:!1,open:!!props.open,loadingText:submitting},_this}return __extends(Dialog,_super),Dialog.getDerivedStateFromProps=function(nextProps){return"open"in nextProps?{open:nextProps.open}:null},Dialog.prototype.componentDidMount=function(){document.body.appendChild(this.el)},Dialog.prototype.componentWillUnmount=function(){document.body.removeChild(this.el)},Dialog.prototype.render=function(){var _a=this.state,open=_a.open,confirmLoading=_a.confirmLoading,loadingText=_a.loadingText,defaultPrefixCls=this.context.prefixCls,prefixCls=customizePrefixCls||(defaultPrefixCls?defaultPrefixCls+"-create-dialog":"")||CLS_PREFIX$2,footerConfig=null;!1!==foot&&(footerConfig="plain"===dialogType?[React.createElement(acud.Button,{key:"ok",type:"primary",onClick:this.handleCancel},sure)]:[React.createElement(acud.Button,{key:"cancel",onClick:this.handleNewCancel},cancelText||cancel),React.createElement(acud.Button,{key:"ok",type:"primary",disabled:confirmLoading,loading:confirmLoading,onClick:this.handleOk},confirmLoading?loadingText||submitting:okText||sure)]);var main=null;WrappedComponent?main=React.createElement(WrappedComponent,{wrappedComponentRef:this.saveRef,ref:this.commonFormRef,payload:payload,onSuccess:this.handleFormSuccess,onCancel:this.handleNewCancel,onConfirmLoading:this.handleConfirmLoading,onCancelConfirmLoading:this.handleCancelConfirmLoading}):message&&(main=message);var dialogClass=classNames(className,prefixCls),dialogComp=React.createElement(acud.Modal,__assign({className:dialogClass,visible:open,title:title,width:width,footer:footerConfig,onCancel:this.handleNewCancel,centered:!0,destroyOnClose:!0,maskClosable:!1!==maskClosable,mask:mask},acudProps),main||null);return reactDom.createPortal(dialogComp,this.el)},Dialog}(React.Component),_a.contextType=ConfigContext,_a}},CLS_PREFIX$1="".concat("du","-drawer"),createDrawer=function(options,dialogOptionText){return function(WrappedComponent){var _a,_b=options.className,className=void 0===_b?"":_b,customizePrefixCls=options.prefixCls,title=options.title,width=options.width,maskClosable=options.maskClosable,foot=options.foot,okText=options.okText,cancelText=options.cancelText,_c=options.mask,mask=void 0===_c||_c,sure=dialogOptionText.sure,cancel=dialogOptionText.cancel,submitting=dialogOptionText.submitting,payload=options.payload,_d=options.cancelWithSuccess,cancelWithSuccess=void 0!==_d&&_d,acudProps=options.acudProps,customCancelHandler=options.customCancelHandler;return(_a=function(_super){function DuDrawer(props){var _this=_super.call(this,props)||this;return _this.showDrawer=function(){_this.setState({open:!0})},_this.handleCancel=function(){_this.setState({open:!1});var _a=_this.props,onCancel=_a.onCancel,onSuccess=_a.onSuccess;onCancel&&onCancel(),cancelWithSuccess&&onSuccess&&onSuccess()},_this.saveRef=function(form){_this.formRef=form},_this.handleOk=function(){_this.setState({confirmLoading:!0});var submitFunc=null;_this.formRef&&_this.formRef.doSubmit?submitFunc=_this.formRef.doSubmit:_this.formRef&&_this.formRef.getWrappedInstance()&&_this.formRef.getWrappedInstance().doSubmit?submitFunc=_this.formRef.getWrappedInstance().doSubmit:_this.commonFormRef&&_this.commonFormRef.current&&_this.commonFormRef.current.doSubmit&&(submitFunc=_this.commonFormRef.current.doSubmit),submitFunc?submitFunc().then((function(){return _this.setState({confirmLoading:!1})})).catch((function(){return _this.setState({confirmLoading:!1})})):_this.handleCancel()},_this.handleFormSuccess=function(result){var onSuccess=_this.props.onSuccess;onSuccess&&onSuccess(result),_this.handleCancel()},_this.handleCancelConfirmLoading=function(){_this.setState({confirmLoading:!1})},_this.handleNewCancel=function(){_.isFunction(customCancelHandler)?customCancelHandler().then((function(){return _this.handleCancel()})):_this.handleCancel()},_this.commonFormRef=React.createRef(),_this.el=document.createElement("div"),_this.state={confirmLoading:!1,open:!!props.open},_this}return __extends(DuDrawer,_super),DuDrawer.getDerivedStateFromProps=function(nextProps){return"open"in nextProps?{open:nextProps.open}:null},DuDrawer.prototype.componentDidMount=function(){document.body.appendChild(this.el)},DuDrawer.prototype.componentWillUnmount=function(){document.body.removeChild(this.el)},DuDrawer.prototype.render=function(){var _a=this.state,open=_a.open,confirmLoading=_a.confirmLoading,defaultPrefixCls=this.context.prefixCls,prefixCls=customizePrefixCls||(defaultPrefixCls?defaultPrefixCls+"-create-drawer":"")||CLS_PREFIX$1,footerContent=null;!1!==foot&&(footerContent=React.createElement("div",{className:"".concat(prefixCls,"-footer")},React.createElement(acud.Button,{key:"cancel",onClick:this.handleNewCancel},cancelText||cancel),React.createElement(acud.Button,{key:"ok",type:"primary",disabled:confirmLoading,loading:confirmLoading,onClick:this.handleOk},confirmLoading?submitting:okText||sure)));var main=null;WrappedComponent&&(main=React.createElement(WrappedComponent,{wrappedComponentRef:this.saveRef,ref:this.commonFormRef,payload:payload,onSuccess:this.handleFormSuccess,onCancel:this.handleNewCancel,onCancelConfirmLoading:this.handleCancelConfirmLoading}));var drawerClass=classNames(className,prefixCls),drawerComp=React.createElement(acud.Drawer,__assign({className:drawerClass,title:title,width:width,onClose:this.handleNewCancel,visible:open,destroyOnClose:!0,maskClosable:!1!==maskClosable,mask:mask},acudProps),main,footerContent);return reactDom.createPortal(drawerComp,this.el)},DuDrawer}(React.Component)).contextType=ConfigContext,_a}},CLS_PREFIX="".concat("du","-errorboundary"),ErrorBoundary=function(_super){function ErrorBoundary(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.state={hasError:!1},_this.showSentryReportDialog=function(){Sentry__namespace.showReportDialog()},_this}return __extends(ErrorBoundary,_super),ErrorBoundary.prototype.componentDidUpdate=function(prevProps){prevProps.pathname!==this.props.pathname&&this.setState({hasError:!1})},ErrorBoundary.prototype.componentDidCatch=function(error,errorInfo){this.setState({hasError:!0}),Sentry__namespace.withScope((function(scope){Object.keys(errorInfo).forEach((function(key){scope.setExtra(key,errorInfo[key])})),Sentry__namespace.captureException(error)}))},ErrorBoundary.prototype.render=function(){var errorPage=this.props.errorPage;return this.state.hasError?React.createElement("div",{className:CLS_PREFIX},errorPage||React.createElement("div",null,React.createElement("a",{onClick:this.showSentryReportDialog},React.createElement(acud.Loading,{tip:"出错了，请重新刷新页面或者报告管理员..."})))):this.props.children},ErrorBoundary}(React.Component),index$9=Object.freeze({__proto__:null,withClassName:function(extraClassName){return function(BaseComponent){var WrappedComponent=function(_a){var _b=_a.className,className=void 0===_b?"":_b,props=__rest(_a,["className"]);return React.createElement(BaseComponent,__assign({},props,{className:classNames(className,extraClassName)}))};return WrappedComponent.displayName=function(BaseComponent,hocName){return"".concat(hocName,"(").concat("string"==typeof(Component=BaseComponent)?Component:Component?Component.displayName||Component.name||"Component":void 0,")");var Component}(BaseComponent,"withClassName"),WrappedComponent}}});function isBrowser(){return"undefined"!=typeof window}var index$8=Object.freeze({__proto__:null,getQueryString:function(name,search){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)","i"),res=search.substr(1).match(reg);return null!==res?decodeURIComponent(res[2]):""},isAbsolutePath:function(path){return/^https?:\/\//.test(path)},isBrowser:isBrowser,isScrollBottom:function(){var scrollTop=window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body&&document.body.scrollTop||0,clientHeight=document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0;return Math.max(document.documentElement?document.documentElement.scrollHeight:0,document.body?document.body.scrollHeight:0,0)-scrollTop-clientHeight<10}});function getCookie(name,cookieText){void 0===cookieText&&(cookieText=""),isBrowser()&&(cookieText=document.cookie);var reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"),arr=cookieText.match(reg);return arr?decodeURIComponent(arr[2]):""}var index$7=Object.freeze({__proto__:null,getCookie:getCookie,removeCookie:function(name){var value=getCookie(name);if(value){var exp=new Date;exp.setTime(exp.getTime()-1e4),document.cookie=name+"="+value+"; expires="+exp.toUTCString()+"; path=/"}},setCookie:function(name,value){document.cookie=name+"="+escape(value)+"; path=/"}}),NAME="[big.js] ",INVALID=NAME+"Invalid ",INVALID_DP=INVALID+"decimal places",INVALID_RM=INVALID+"rounding mode",DIV_BY_ZERO=NAME+"Division by zero",P={},NUMERIC=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function round(x,sd,rm,more){var xc=x.c;if(undefined===rm&&(rm=Big.RM),0!==rm&&1!==rm&&2!==rm&&3!==rm)throw Error(INVALID_RM);if(sd<1)more=3===rm&&(more||!!xc[0])||0===sd&&(1===rm&&xc[0]>=5||2===rm&&(xc[0]>5||5===xc[0]&&(more||undefined!==xc[1]))),xc.length=1,more?(x.e=x.e-sd+1,xc[0]=1):xc[0]=x.e=0;else if(sd<xc.length){if(more=1===rm&&xc[sd]>=5||2===rm&&(xc[sd]>5||5===xc[sd]&&(more||undefined!==xc[sd+1]||1&xc[sd-1]))||3===rm&&(more||!!xc[0]),xc.length=sd--,more)for(;++xc[sd]>9;)xc[sd]=0,sd--||(++x.e,xc.unshift(1));for(sd=xc.length;!xc[--sd];)xc.pop()}return x}function stringify(x,doExponential,isNonzero){var e=x.e,s=x.c.join(""),n=s.length;if(doExponential)s=s.charAt(0)+(n>1?"."+s.slice(1):"")+(e<0?"e":"e+")+e;else if(e<0){for(;++e;)s="0"+s;s="0."+s}else if(e>0)if(++e>n)for(e-=n;e--;)s+="0";else e<n&&(s=s.slice(0,e)+"."+s.slice(e));else n>1&&(s=s.charAt(0)+"."+s.slice(1));return x.s<0&&isNonzero?"-"+s:s}P.abs=function(){var x=new this.constructor(this);return x.s=1,x},P.cmp=function(y){var isneg,x=this,xc=x.c,yc=(y=new x.constructor(y)).c,i=x.s,j=y.s,k=x.e,l=y.e;if(!xc[0]||!yc[0])return xc[0]?i:yc[0]?-j:0;if(i!=j)return i;if(isneg=i<0,k!=l)return k>l^isneg?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=-1;++i<j;)if(xc[i]!=yc[i])return xc[i]>yc[i]^isneg?1:-1;return k==l?0:k>l^isneg?1:-1},P.div=function(y){var x=this,Big=x.constructor,a=x.c,b=(y=new Big(y)).c,k=x.s==y.s?1:-1,dp=Big.DP;if(dp!==~~dp||dp<0||dp>1e6)throw Error(INVALID_DP);if(!b[0])throw Error(DIV_BY_ZERO);if(!a[0])return y.s=k,y.c=[y.e=0],y;var bl,bt,n,cmp,ri,bz=b.slice(),ai=bl=b.length,al=a.length,r=a.slice(0,bl),rl=r.length,q=y,qc=q.c=[],qi=0,p=dp+(q.e=x.e-y.e)+1;for(q.s=k,k=p<0?0:p,bz.unshift(0);rl++<bl;)r.push(0);do{for(n=0;n<10;n++){if(bl!=(rl=r.length))cmp=bl>rl?1:-1;else for(ri=-1,cmp=0;++ri<bl;)if(b[ri]!=r[ri]){cmp=b[ri]>r[ri]?1:-1;break}if(!(cmp<0))break;for(bt=rl==bl?b:bz;rl;){if(r[--rl]<bt[rl]){for(ri=rl;ri&&!r[--ri];)r[ri]=9;--r[ri],r[rl]+=10}r[rl]-=bt[rl]}for(;!r[0];)r.shift()}qc[qi++]=cmp?n:++n,r[0]&&cmp?r[rl]=a[ai]||0:r=[a[ai]]}while((ai++<al||undefined!==r[0])&&k--);return qc[0]||1==qi||(qc.shift(),q.e--,p--),qi>p&&round(q,p,Big.RM,undefined!==r[0]),q},P.eq=function(y){return 0===this.cmp(y)},P.gt=function(y){return this.cmp(y)>0},P.gte=function(y){return this.cmp(y)>-1},P.lt=function(y){return this.cmp(y)<0},P.lte=function(y){return this.cmp(y)<1},P.minus=P.sub=function(y){var i,j,t,xlty,x=this,Big=x.constructor,a=x.s,b=(y=new Big(y)).s;if(a!=b)return y.s=-b,x.plus(y);var xc=x.c.slice(),xe=x.e,yc=y.c,ye=y.e;if(!xc[0]||!yc[0])return yc[0]?y.s=-b:xc[0]?y=new Big(x):y.s=1,y;if(a=xe-ye){for((xlty=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;)t.push(0);t.reverse()}else for(j=((xlty=xc.length<yc.length)?xc:yc).length,a=b=0;b<j;b++)if(xc[b]!=yc[b]){xlty=xc[b]<yc[b];break}if(xlty&&(t=xc,xc=yc,yc=t,y.s=-y.s),(b=(j=yc.length)-(i=xc.length))>0)for(;b--;)xc[i++]=0;for(b=i;j>a;){if(xc[--j]<yc[j]){for(i=j;i&&!xc[--i];)xc[i]=9;--xc[i],xc[j]+=10}xc[j]-=yc[j]}for(;0===xc[--b];)xc.pop();for(;0===xc[0];)xc.shift(),--ye;return xc[0]||(y.s=1,xc=[ye=0]),y.c=xc,y.e=ye,y},P.mod=function(y){var ygtx,x=this,Big=x.constructor,a=x.s,b=(y=new Big(y)).s;if(!y.c[0])throw Error(DIV_BY_ZERO);return x.s=y.s=1,ygtx=1==y.cmp(x),x.s=a,y.s=b,ygtx?new Big(x):(a=Big.DP,b=Big.RM,Big.DP=Big.RM=0,x=x.div(y),Big.DP=a,Big.RM=b,this.minus(x.times(y)))},P.plus=P.add=function(y){var e,k,t,x=this,Big=x.constructor;if(y=new Big(y),x.s!=y.s)return y.s=-y.s,x.minus(y);var xe=x.e,xc=x.c,ye=y.e,yc=y.c;if(!xc[0]||!yc[0])return yc[0]||(xc[0]?y=new Big(x):y.s=x.s),y;if(xc=xc.slice(),e=xe-ye){for(e>0?(ye=xe,t=yc):(e=-e,t=xc),t.reverse();e--;)t.push(0);t.reverse()}for(xc.length-yc.length<0&&(t=yc,yc=xc,xc=t),e=yc.length,k=0;e;xc[e]%=10)k=(xc[--e]=xc[e]+yc[e]+k)/10|0;for(k&&(xc.unshift(k),++ye),e=xc.length;0===xc[--e];)xc.pop();return y.c=xc,y.e=ye,y},P.pow=function(n){var x=this,one=new x.constructor("1"),y=one,isneg=n<0;if(n!==~~n||n<-1e6||n>1e6)throw Error(INVALID+"exponent");for(isneg&&(n=-n);1&n&&(y=y.times(x)),n>>=1;)x=x.times(x);return isneg?one.div(y):y},P.prec=function(sd,rm){if(sd!==~~sd||sd<1||sd>1e6)throw Error(INVALID+"precision");return round(new this.constructor(this),sd,rm)},P.round=function(dp,rm){if(undefined===dp)dp=0;else if(dp!==~~dp||dp<-1e6||dp>1e6)throw Error(INVALID_DP);return round(new this.constructor(this),dp+this.e+1,rm)},P.sqrt=function(){var r,c,t,x=this,Big=x.constructor,s=x.s,e=x.e,half=new Big("0.5");if(!x.c[0])return new Big(x);if(s<0)throw Error(NAME+"No square root");0===(s=Math.sqrt(x+""))||s===1/0?((c=x.c.join("")).length+e&1||(c+="0"),e=((e+1)/2|0)-(e<0||1&e),r=new Big(((s=Math.sqrt(c))==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+e)):r=new Big(s+""),e=r.e+(Big.DP+=4);do{t=r,r=half.times(t.plus(x.div(t)))}while(t.c.slice(0,e).join("")!==r.c.slice(0,e).join(""));return round(r,(Big.DP-=4)+r.e+1,Big.RM)},P.times=P.mul=function(y){var c,x=this,Big=x.constructor,xc=x.c,yc=(y=new Big(y)).c,a=xc.length,b=yc.length,i=x.e,j=y.e;if(y.s=x.s==y.s?1:-1,!xc[0]||!yc[0])return y.c=[y.e=0],y;for(y.e=i+j,a<b&&(c=xc,xc=yc,yc=c,j=a,a=b,b=j),c=new Array(j=a+b);j--;)c[j]=0;for(i=b;i--;){for(b=0,j=a+i;j>i;)b=c[j]+yc[i]*xc[j-i-1]+b,c[j--]=b%10,b=b/10|0;c[j]=b}for(b?++y.e:c.shift(),i=c.length;!c[--i];)c.pop();return y.c=c,y},P.toExponential=function(dp,rm){var x=this,n=x.c[0];if(undefined!==dp){if(dp!==~~dp||dp<0||dp>1e6)throw Error(INVALID_DP);for(x=round(new x.constructor(x),++dp,rm);x.c.length<dp;)x.c.push(0)}return stringify(x,!0,!!n)},P.toFixed=function(dp,rm){var x=this,n=x.c[0];if(undefined!==dp){if(dp!==~~dp||dp<0||dp>1e6)throw Error(INVALID_DP);for(dp=dp+(x=round(new x.constructor(x),dp+x.e+1,rm)).e+1;x.c.length<dp;)x.c.push(0)}return stringify(x,!1,!!n)},P.toJSON=P.toString=function(){var x=this,Big=x.constructor;return stringify(x,x.e<=Big.NE||x.e>=Big.PE,!!x.c[0])},P.toNumber=function(){var n=Number(stringify(this,!0,!0));if(!0===this.constructor.strict&&!this.eq(n.toString()))throw Error(NAME+"Imprecise conversion");return n},P.toPrecision=function(sd,rm){var x=this,Big=x.constructor,n=x.c[0];if(undefined!==sd){if(sd!==~~sd||sd<1||sd>1e6)throw Error(INVALID+"precision");for(x=round(new Big(x),sd,rm);x.c.length<sd;)x.c.push(0)}return stringify(x,sd<=x.e||x.e<=Big.NE||x.e>=Big.PE,!!n)},P.valueOf=function(){var x=this,Big=x.constructor;if(!0===Big.strict)throw Error(NAME+"valueOf disallowed");return stringify(x,x.e<=Big.NE||x.e>=Big.PE,!0)};var Big=function _Big_(){function Big(n){var x=this;if(!(x instanceof Big))return undefined===n?_Big_():new Big(n);if(n instanceof Big)x.s=n.s,x.e=n.e,x.c=n.c.slice();else{if("string"!=typeof n){if(!0===Big.strict)throw TypeError(INVALID+"number");n=0===n&&1/n<0?"-0":String(n)}!function(x,n){var e,i,nl;if(!NUMERIC.test(n))throw Error(INVALID+"number");x.s="-"==n.charAt(0)?(n=n.slice(1),-1):1,(e=n.indexOf("."))>-1&&(n=n.replace(".",""));(i=n.search(/e/i))>0?(e<0&&(e=i),e+=+n.slice(i+1),n=n.substring(0,i)):e<0&&(e=n.length);for(nl=n.length,i=0;i<nl&&"0"==n.charAt(i);)++i;if(i==nl)x.c=[x.e=0];else{for(;nl>0&&"0"==n.charAt(--nl););for(x.e=e-i-1,x.c=[],e=0;i<=nl;)x.c[e++]=+n.charAt(i++)}}(x,n)}x.constructor=Big}return Big.prototype=P,Big.DP=20,Big.RM=1,Big.NE=-7,Big.PE=21,Big.strict=false,Big}();function getLimitedValue(valueInfo){var value=valueInfo.value,min=valueInfo.min,max=valueInfo.max;if(isNaN(value))return null;var val=Number(value);return val>=max?{limitedValue:max,relation:"more"}:val<=min?{limitedValue:min,relation:"less"}:{limitedValue:val,relation:"equal"}}function add$1(num1,num2){var addData=new Big(num1).plus(num2);return parseFloat(addData)}function subtract$1(num1,num2){var subData=new Big(num1).minus(num2);return parseFloat(subData)}var index$6=Object.freeze({__proto__:null,add:add$1,divide:function(num1,num2){var div1=new Big(num1),div2=new Big(num2),divData=div1.div(div2);return parseFloat(divData)},getLimitedValue:getLimitedValue,getMaxMinValue:function(data,key){var min,max;if(!data.length)return{max:max,min:min};max=key?data[0][key]:data[0],min=key?data[0][key]:data[0];for(var i=1,len=data.length;i<len;i++){var currentData=data[i],value=key?currentData[key]:currentData;value>max&&(max=value),value<min&&(min=value)}return{max:max,min:min}},multiply:function(num1,num2){var mulData=new Big(num1).times(num2);return parseFloat(mulData)},subtract:subtract$1}),humanize$1={exports:{}};!function(module,exports){(function(){var root=this,previousHumanize=root.humanize,humanize={};module.exports&&(exports=module.exports=humanize),exports.humanize=humanize,humanize.noConflict=function(){return root.humanize=previousHumanize,this},humanize.pad=function(str,count,padChar,type){if(str+="",padChar?padChar.length>1&&(padChar=padChar.charAt(0)):padChar=" ","right"===(type=void 0===type?"left":"right"))for(;str.length<count;)str+=padChar;else for(;str.length<count;)str=padChar+str;return str},humanize.time=function(){return(new Date).getTime()/1e3};var dayTableCommon=[0,0,31,59,90,120,151,181,212,243,273,304,334],dayTableLeap=[0,0,31,60,91,121,152,182,213,244,274,305,335];humanize.date=function(format,timestamp){var jsdate=void 0===timestamp?new Date:timestamp instanceof Date?new Date(timestamp):new Date(1e3*timestamp),formatChr=/\\?([a-z])/gi,formatChrCb=function(t,s){return f[t]?f[t]():s},shortDayTxt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthTxt=["January","February","March","April","May","June","July","August","September","October","November","December"],f={d:function(){return humanize.pad(f.j(),2,"0")},D:function(){return f.l().slice(0,3)},j:function(){return jsdate.getDate()},l:function(){return shortDayTxt[f.w()]},N:function(){return f.w()||7},S:function(){var j=f.j();return j>4&&j<21?"th":{1:"st",2:"nd",3:"rd"}[j%10]||"th"},w:function(){return jsdate.getDay()},z:function(){return(f.L()?dayTableLeap[f.n()]:dayTableCommon[f.n()])+f.j()-1},W:function(){var midWeekDaysFromJan4=f.z()-f.N()+1.5;return humanize.pad(1+Math.floor(Math.abs(midWeekDaysFromJan4)/7)+(midWeekDaysFromJan4%7>3.5?1:0),2,"0")},F:function(){return monthTxt[jsdate.getMonth()]},m:function(){return humanize.pad(f.n(),2,"0")},M:function(){return f.F().slice(0,3)},n:function(){return jsdate.getMonth()+1},t:function(){return new Date(f.Y(),f.n(),0).getDate()},L:function(){return 1===new Date(f.Y(),1,29).getMonth()?1:0},o:function(){var n=f.n(),W=f.W();return f.Y()+(12===n&&W<9?-1:1===n&&W>9)},Y:function(){return jsdate.getFullYear()},y:function(){return String(f.Y()).slice(-2)},a:function(){return jsdate.getHours()>11?"pm":"am"},A:function(){return f.a().toUpperCase()},B:function(){var unixTime=jsdate.getTime()/1e3,secondsPassedToday=unixTime%86400+3600;secondsPassedToday<0&&(secondsPassedToday+=86400);var beats=secondsPassedToday/86.4%1e3;return unixTime<0?Math.ceil(beats):Math.floor(beats)},g:function(){return f.G()%12||12},G:function(){return jsdate.getHours()},h:function(){return humanize.pad(f.g(),2,"0")},H:function(){return humanize.pad(f.G(),2,"0")},i:function(){return humanize.pad(jsdate.getMinutes(),2,"0")},s:function(){return humanize.pad(jsdate.getSeconds(),2,"0")},u:function(){return humanize.pad(1e3*jsdate.getMilliseconds(),6,"0")},O:function(){var tzo=jsdate.getTimezoneOffset(),tzoNum=Math.abs(tzo);return(tzo>0?"-":"+")+humanize.pad(100*Math.floor(tzoNum/60)+tzoNum%60,4,"0")},P:function(){var O=f.O();return O.substr(0,3)+":"+O.substr(3,2)},Z:function(){return 60*-jsdate.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(formatChr,formatChrCb)},r:function(){return"D, d M Y H:i:s O".replace(formatChr,formatChrCb)},U:function(){return jsdate.getTime()/1e3||0}};return format.replace(formatChr,formatChrCb)},humanize.numberFormat=function(number,decimals,decPoint,thousandsSep){decimals=isNaN(decimals)?2:Math.abs(decimals),decPoint=void 0===decPoint?".":decPoint,thousandsSep=void 0===thousandsSep?",":thousandsSep;var sign=number<0?"-":"";number=Math.abs(+number||0);var intPart=parseInt(number.toFixed(decimals),10)+"",j=intPart.length>3?intPart.length%3:0;return sign+(j?intPart.substr(0,j)+thousandsSep:"")+intPart.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+thousandsSep)+(decimals?decPoint+Math.abs(number-intPart).toFixed(decimals).slice(2):"")},humanize.naturalDay=function(timestamp,format){timestamp=void 0===timestamp?humanize.time():timestamp,format=void 0===format?"Y-m-d":format;var d=new Date,today=new Date(d.getFullYear(),d.getMonth(),d.getDate()).getTime()/1e3;return timestamp<today&&timestamp>=today-86400?"yesterday":timestamp>=today&&timestamp<today+86400?"today":timestamp>=today+86400&&timestamp<today+172800?"tomorrow":humanize.date(format,timestamp)},humanize.relativeTime=function(timestamp){timestamp=void 0===timestamp?humanize.time():timestamp;var currTime=humanize.time(),timeDiff=currTime-timestamp;if(timeDiff<2&&timeDiff>-2)return(timeDiff>=0?"just ":"")+"now";if(timeDiff<60&&timeDiff>-60)return timeDiff>=0?Math.floor(timeDiff)+" seconds ago":"in "+Math.floor(-timeDiff)+" seconds";if(timeDiff<120&&timeDiff>-120)return timeDiff>=0?"about a minute ago":"in about a minute";if(timeDiff<3600&&timeDiff>-3600)return timeDiff>=0?Math.floor(timeDiff/60)+" minutes ago":"in "+Math.floor(-timeDiff/60)+" minutes";if(timeDiff<7200&&timeDiff>-7200)return timeDiff>=0?"about an hour ago":"in about an hour";if(timeDiff<86400&&timeDiff>-86400)return timeDiff>=0?Math.floor(timeDiff/3600)+" hours ago":"in "+Math.floor(-timeDiff/3600)+" hours";if(timeDiff<172800&&timeDiff>-172800)return timeDiff>=0?"1 day ago":"in 1 day";if(timeDiff<2505600&&timeDiff>-2505600)return timeDiff>=0?Math.floor(timeDiff/86400)+" days ago":"in "+Math.floor(-timeDiff/86400)+" days";if(timeDiff<5184e3&&timeDiff>-5184e3)return timeDiff>=0?"about a month ago":"in about a month";var currTimeYears=parseInt(humanize.date("Y",currTime),10),timestampYears=parseInt(humanize.date("Y",timestamp),10),monthDiff=12*currTimeYears+parseInt(humanize.date("n",currTime),10)-(12*timestampYears+parseInt(humanize.date("n",timestamp),10));if(monthDiff<12&&monthDiff>-12)return monthDiff>=0?monthDiff+" months ago":"in "+-monthDiff+" months";var yearDiff=currTimeYears-timestampYears;return yearDiff<2&&yearDiff>-2?yearDiff>=0?"a year ago":"in a year":yearDiff>=0?yearDiff+" years ago":"in "+-yearDiff+" years"},humanize.ordinal=function(number){number=parseInt(number,10);var sign=(number=isNaN(number)?0:number)<0?"-":"",tens=(number=Math.abs(number))%100;return sign+number+(tens>4&&tens<21?"th":{1:"st",2:"nd",3:"rd"}[number%10]||"th")},humanize.filesize=function(filesize,kilo,decimals,decPoint,thousandsSep,suffixSep){return filesize<=0?"0 bytes":(filesize<(kilo=void 0===kilo?1024:kilo)&&void 0===decimals&&(decimals=0),void 0===suffixSep&&(suffixSep=" "),humanize.intword(filesize,["bytes","KB","MB","GB","TB","PB"],kilo,decimals,decPoint,thousandsSep,suffixSep))},humanize.intword=function(number,units,kilo,decimals,decPoint,thousandsSep,suffixSep){var humanized,unit;unit=(units=units||["","K","M","B","T"]).length-1,kilo=kilo||1e3,decimals=isNaN(decimals)?2:Math.abs(decimals),decPoint=decPoint||".",thousandsSep=thousandsSep||",",suffixSep=suffixSep||"";for(var i=0;i<units.length;i++)if(number<Math.pow(kilo,i+1)){unit=i;break}humanized=number/Math.pow(kilo,unit);var suffix=units[unit]?suffixSep+units[unit]:"";return humanize.numberFormat(humanized,decimals,decPoint,thousandsSep)+suffix},humanize.linebreaks=function(str){return"<p>"+(str=(str=(str=(str=(str=str.replace(/^([\n|\r]*)/,"")).replace(/([\n|\r]*)$/,"")).replace(/(\r\n|\n|\r)/g,"\n")).replace(/(\n{2,})/g,"</p><p>")).replace(/\n/g,"<br />"))+"</p>"},humanize.nl2br=function(str){return str.replace(/(\r\n|\n|\r)/g,"<br />")},humanize.truncatechars=function(string,length){return string.length<=length?string:string.substr(0,length)+"…"},humanize.truncatewords=function(string,numWords){var words=string.split(" ");return words.length<numWords?string:words.slice(0,numWords).join(" ")+"…"}}).call(commonjsGlobal)}(humanize$1,humanize$1.exports);var humanize=getDefaultExportFromCjs(humanize$1.exports);var index$5=Object.freeze({__proto__:null,filesize:function(size,options){if(options){var kilo=options.kilo,decimals=options.decimals,decPoint=options.decPoint,thousandsSep=options.thousandsSep,suffixSep=options.suffixSep;return humanize.filesize(size,kilo,decimals,decPoint,thousandsSep,suffixSep)}return humanize.filesize(size)},getSuffixByName:function(name){return name.slice(name.lastIndexOf(".")+1)}}),valueIndex=Symbol("valueIndex"),textIndex=Symbol("textIndex"),aliasIndex=Symbol("aliasIndex"),Enum=function(){function class_1(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this[valueIndex]={},this[textIndex]={},this[aliasIndex]={};for(var i=0,len=args.length;i<len;i++){var item=args[i];null!==item.value&&void 0!==item.value||(item.value=i),this.addItem(item)}}return class_1.prototype.addItem=function(item){this[item.alias]=item.value,this[item.value]=item.alias,this[valueIndex][item.value]=item,this[textIndex][item.text]=item,this[aliasIndex][item.alias]=item},class_1.prototype.fromValue=function(value){return this[valueIndex][value]||{}},class_1.prototype.fromAlias=function(alias){return this[aliasIndex][alias]||{}},class_1.prototype.fromText=function(text){return this[textIndex][text]||{}},class_1.prototype.getTextFromValue=function(value){return this.fromValue(value).text},class_1.prototype.getTextFromAlias=function(alias){return this.fromAlias(alias).text},class_1.prototype.getValueFromAlias=function(alias){return this.fromAlias(alias).value},class_1.prototype.getValueFromText=function(text){return this.fromText(text).value},class_1.prototype.getAliasFromValue=function(value){return this.fromValue(value).alias},class_1.prototype.getAliasFromText=function(text){return this.fromText(text).alias},class_1.prototype.toJson=function(){var json={};return _.forEach(this[valueIndex],(function(item,value){json[value]=item.text})),json},class_1.prototype.toArray=function(){return _.map(this[valueIndex],(function(item){return __assign(__assign({},item),{label:item.text})}))},class_1}(),rc$1=tmp__namespace,Route=rc$1.Route,isV5="Redirect"in rc$1,isV6="Navigate"in rc$1,codeMessage={400:"400：发出的请求有错误，服务器没有进行新建或修改数据的操作。",401:"401：用户没有权限（令牌、用户名、密码错误）。",403:"403：用户得到授权，但是访问是被禁止的。",404:"404：发出的请求针对的是不存在的记录，服务器没有进行操作。",406:"406：请求的格式不可得。",410:"410：请求的资源被永久删除，且不会再得到的。",422:"422：当创建一个对象时，发生一个验证错误。",500:"500：服务器发生错误，请检查服务器。",502:"502：网关错误。",503:"503：服务不可用，服务器暂时过载或维护。",504:"504：网关超时。"};axios.defaults.withCredentials=!0,axios.defaults.headers.common.Accept="application/json",axios.defaults.headers.common["Content-Type"]="application/json; charset=UTF-8",axios.defaults.timeout=12e5;var Ajax=function(){function Ajax(){}return Ajax.prototype.setHeaders=function(headers){axios.defaults.headers.common=__assign(__assign({},axios.defaults.headers.common),headers)},Ajax.prototype.beforeSend=function(options){return options},Ajax.prototype.beforeSuccess=function(data,options){if(options||!options)return data},Ajax.prototype.request=function(url,options){var _this=this,opts="function"==typeof this.beforeSend&&this.beforeSend(options)||options;return axios(__assign({url:url},opts)).then((function(response){var status=response.status,statusText=response.statusText;if(status>400||status<200){var error=new Error("API ".concat(url," status is ").concat(status," (").concat(statusText,")"));return Promise.reject(error)}return response.data})).then((function(data){return"function"==typeof _this.beforeSuccess?_this.beforeSuccess(data,options):data})).catch((function(error){if(error&&error.message&&isBrowser()&&(!options||options&&!options.silent)){var errorCode=_.get(error,"response.status"),errorMessage=errorCode&&codeMessage[errorCode]?codeMessage[errorCode]:error.message;acud.toast.error({message:errorMessage,duration:5})}return Promise.reject(error)}))},Ajax.prototype.post=function(url,data,options){var opts=__assign({method:"post",data:data},options);return this.request(url,opts)},Ajax.prototype.get=function(url,data,options){var opts=__assign({method:"get",params:data},options);return this.request(url,opts)},Ajax.prototype.put=function(url,data,options){var opts=__assign({method:"put",data:data},options);return this.request(url,opts)},Ajax.prototype.delete=function(url,data,options){var opts=__assign({method:"delete",data:data},options);return this.request(url,opts)},Ajax}(),request=new(function(_super){function Request(){var _this=_super.call(this)||this;return Request.instance?Request.instance:(Request.instance=_this,_this)}return __extends(Request,_super),Request.prototype.failHandler=function(response,options){return response.message?(response.message.redirect&&(window.location.href=response.message.redirect),options&&options.silent,response.message):{}},Request.prototype.beforeSuccess=function(response,options){return response.success?response.page||response.result:Promise.reject(this.failHandler(response,options))},Request}(Ajax));function useInterval$1(callback,time){var fn=React.useRef(callback);React.useEffect((function(){fn.current=callback}),[callback]),React.useEffect((function(){if(!(time<0)){var tick=setInterval((function(){return fn.current&&fn.current()}),time);return function(){return clearInterval(tick)}}}),[time])}var useFetch=function(action,params,$onRequest,$onResponse,$onError,abort){var _a=__read(React.useState(!1),2),loading=_a[0],setLoading=_a[1],_b=__read(React.useState(!1),2),loaded=_b[0],setLoaded=_b[1],_c=__read(React.useState(),2),error=_c[0],setError=_c[1],_d=__read(React.useState(),2),data=_d[0],setData=_d[1],_e=__read(React.useState(),2),latestPayload=_e[0],setLatestPayload=_e[1],originalParams=useOriginalDeepCopy(params),hooksRef=React.useRef(null);hooksRef.current={params:params,$onRequest:$onRequest,$onResponse:$onResponse,$onError:$onError};var useCustomDispatch=function(action){var actionString=action.toString();return/dispatch\(/.test(actionString)&&!/actionCreator/.test(actionString)?reactRedux.useDispatch:function(){}}(action),dispatch=useCustomDispatch(),runFetch=React.useCallback((function(fetchParams){return __awaiter(void 0,void 0,void 0,(function(){var _a,_b,needLoading,extra,_c,params,$onRequest,requestPayload,result,_d,$onResponse_1,resultData,ex_1,$onError_1;return __generator(this,(function(_e){switch(_e.label){case 0:"boolean"==typeof fetchParams&&(fetchParams={needLoading:fetchParams}),_b=(_a=fetchParams||{}).needLoading,needLoading=void 0===_b||_b,extra=_a.extra,_c=hooksRef.current,params=_c.params,$onRequest=_c.$onRequest,_e.label=1;case 1:return _e.trys.push([1,6,,7]),abort?[2]:(needLoading&&setLoading(!0),setLoaded(!1),setError(null),requestPayload=_.isFunction($onRequest)&&$onRequest(params,extra)||params,setLatestPayload(requestPayload),dispatch?[4,dispatch(action(requestPayload))]:[3,3]);case 2:return _d=_e.sent(),[3,5];case 3:return[4,action(requestPayload)];case 4:_d=_e.sent(),_e.label=5;case 5:return result=_d,$onResponse_1=hooksRef.current.$onResponse,resultData=_.isFunction($onResponse_1)&&$onResponse_1(result,requestPayload)||result,setData(resultData),setLoading(!1),setLoaded(!0),[2,result];case 6:return ex_1=_e.sent(),$onError_1=hooksRef.current.$onError,_.isFunction($onError_1)&&$onError_1(ex_1),setLoading(!1),setLoaded(!0),setError(ex_1),[3,7];case 7:return[2]}}))}))}),[action,abort,dispatch]);return React.useEffect((function(){runFetch()}),[runFetch,originalParams]),{loading:loading,loaded:loaded,data:data,error:error,reload:runFetch,latestPayload:latestPayload}},getErrorMsg=function(error){return error?getGlobalError(error)||"获取记录失败":""},DEFAULT_PAGESIZE_OPTIONS$1=["10","20","50","100"];function createPayload(payload,fields,extra){var requestPayload=fields?{}:_.extend({},payload);return _.each(fields,(function(key){if(_.isArray(key)){var _a=__read(key,2),a=_a[0],b=_a[1];requestPayload[b]=payload[a]}else _.isString(key)&&(requestPayload[key]=payload[key])})),_.extend(requestPayload,extra)}function createParams(payload,fields,extra){var params=[];return _.each(fields,(function(key){params.push(payload[key])})),_.each(extra,(function(value){params.push(value)})),params.join("/")}var ajaxAction=function(listPage,config,payload,actions){var apiAction=config.apiAction,$payloadFields=config.$payloadFields,$extraPayload=config.$extraPayload,confirmText=config.confirmText,confirmTitle=config.confirmTitle,confirmType=config.confirmType,_a=config.okText,okText=void 0===_a?"确认":_a,cancelText=config.cancelText,$toastMessage=config.$toastMessage,$onRequest=config.$onRequest,$onResponse=config.$onResponse,$onError=config.$onError,sendRequest=function(){var requestPayload=createPayload(payload,$payloadFields,$extraPayload);return _.isFunction($onRequest)&&$onRequest.call(listPage,requestPayload),function(api,payload,actions){return void 0===payload&&(payload={}),actions?actions[api](payload):request.post(api,payload)}(apiAction,requestPayload,actions).then((function(response){return $toastMessage&&message("success",$toastMessage),_.isFunction($onResponse)&&$onResponse.call(listPage,response,requestPayload),listPage.loadList?listPage.loadList():Promise.resolve()})).catch((function(error){_.isFunction($onError)&&$onError.call(listPage,error,requestPayload),error.global?message("error",error.global):message("error","请求失败，请检查")}))};return confirmText?new Promise((function(resolve,reject){listPage.confirm({type:confirmType||"error",title:confirmTitle?_.template(confirmTitle)(payload):"确认?",content:_.template(confirmText)(payload),okText:okText,cancelText:cancelText,onOk:function(){return resolve(!0)},onCancel:function(){return reject()}})})).then(sendRequest).catch((function(){})):sendRequest()};function useMethodsNative(reducers,initialState){var _useState=React.useState(initialState),state=_useState[0],setState=_useState[1],boundMethods=function(reducers,setState){var methodsRef=React.useRef(void 0);return methodsRef.current||(methodsRef.current=Object.keys(reducers).reduce((function(methods,key){var _Object$assign,fn=reducers[key];return Object.assign(methods,((_Object$assign={})[key]=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return setState((function(s){return fn.apply(void 0,[s].concat(args))}))},_Object$assign)),methods}),{})),methodsRef.current}(reducers,setState);return[state,boundMethods,setState]}var reducers={on:function(){return!0},off:function(){return!1},toggle:function(value){return!value}};function useBoolean(initialValue){return void 0===initialValue&&(initialValue=!1),useMethodsNative(reducers,initialValue)}var useDialog=function(){var _a=__read(function(initialValue){void 0===initialValue&&(initialValue=!1);var _useBoolean=useBoolean(initialValue),value=_useBoolean[0],_useBoolean$=_useBoolean[1];return[value,_useBoolean$.on,_useBoolean$.off,_useBoolean$.toggle]}(!1),3),dialogOpen=_a[0],showDialog=_a[1],hideDialog=_a[2],_b=__read(React.useState(),2),dialogOptions=_b[0],setDialogOptions=_b[1],locale=__read(useLocale("useDialog"),1)[0],dialogOptionText={sure:null==locale?void 0:locale.sure,cancel:null==locale?void 0:locale.cancel,submitting:null==locale?void 0:locale.submitting},Dialog=React.useMemo((function(){if(dialogOptions){var _a=dialogOptions.type,type=void 0===_a?"dialog":_a;if("dialog"===type)return createDialog(dialogOptions,dialogOptionText)(dialogOptions.wrappedComponent);if("drawer"===type)return createDrawer(dialogOptions,dialogOptionText)(dialogOptions.wrappedComponent)}return null}),[dialogOptions]),handleDialogCancel=React.useCallback((function(){hideDialog(),setDialogOptions(null)}),[hideDialog]);return React.useEffect((function(){Dialog&&showDialog()}),[Dialog,showDialog]),{Dialog:Dialog,dialogOpen:dialogOpen,showDialog:showDialog,hideDialog:hideDialog,dialogOptions:dialogOptions,setDialogOptions:setDialogOptions,handleDialogCancel:handleDialogCancel}},useConfirm=function(){var _a=__read(React.useState(void 0),2),confirmOptions=_a[0],setConfirmOptions=_a[1],handleConfirmCancel=React.useCallback((function(){setConfirmOptions(void 0)}),[setConfirmOptions]),handleConfirmOk=React.useCallback((function(onOk){onOk&&onOk(),setConfirmOptions(void 0)}),[]);return{Confirm:React.useMemo((function(){if(confirmOptions){var onOk_1=confirmOptions.onOk;return React.createElement(acud.DialogBox,__assign({},confirmOptions,{visible:!0,onOk:function(){return handleConfirmOk(onOk_1)},onCancel:handleConfirmCancel}))}return null}),[handleConfirmOk,handleConfirmCancel,confirmOptions]),confirmOptions:confirmOptions,setConfirmOptions:setConfirmOptions,handleConfirmCancel:handleConfirmCancel}},useAction=function(props,allFunctions,getSelectedItems){var history=props.history,actions=props.actions,_a=useConfirm(),Confirm=_a.Confirm,setConfirmOptions=_a.setConfirmOptions,_b=useDialog(),Dialog=_b.Dialog,dialogOpen=_b.dialogOpen,dialogOptions=_b.dialogOptions,setDialogOptions=_b.setDialogOptions,handleDialogCancel=_b.handleDialogCancel,handleRedirect=React.useCallback((function(url){history?history.push(url):window.location.href=url}),[history]),dialogActionType=React.useCallback((function(config,payload){void 0===payload&&(payload={});var body=config.dialog.body,dialogConfig=null;switch(body.type){case"alert":!function(config,payload){console.log(config,payload)}(config.dialog,payload);break;case"plain":dialogConfig=function(dialogOption,payload){var className=dialogOption.className,width=dialogOption.width,title=dialogOption.title,maskClosable=dialogOption.maskClosable,body=dialogOption.body,foot=dialogOption.foot,cancelWithSuccess=dialogOption.cancelWithSuccess,okText=dialogOption.okText,$title=_.template(title)(payload),$payloadFields=body.$payloadFields,$extraPayload=body.$extraPayload,content=body.content,dialogInfo={dialogType:"plain",className:className,title:$title,width:width,maskClosable:maskClosable,cancelWithSuccess:cancelWithSuccess,foot:foot,okText:okText,payload:payload=createPayload(payload,$payloadFields,$extraPayload)};return"function"==typeof content?dialogInfo.wrappedComponent=content:dialogInfo.message=_.template(content)(payload),dialogInfo}(config.dialog,payload);break;case"common":dialogConfig=function(dialogOption,payload){var className=dialogOption.className,width=dialogOption.width,title=dialogOption.title,maskClosable=dialogOption.maskClosable,body=dialogOption.body,foot=dialogOption.foot,mask=dialogOption.mask,cancelWithSuccess=dialogOption.cancelWithSuccess,okText=dialogOption.okText,cancelText=dialogOption.cancelText,_a=dialogOption.fromTable,fromTable=void 0!==_a&&_a,$title=_.template(title)(payload),$payloadFields=body.$payloadFields,$extraPayload=body.$extraPayload,content=body.content,$onBeforeDialogOpen=body.$onBeforeDialogOpen;return payload=createPayload(payload,$payloadFields,$extraPayload),{dialogType:"common",className:className,title:$title,width:width,maskClosable:maskClosable,foot:foot,okText:okText,cancelText:cancelText,cancelWithSuccess:cancelWithSuccess,payload:payload="function"==typeof $onBeforeDialogOpen&&$onBeforeDialogOpen(payload)||payload,wrappedComponent:content,fromTable:fromTable,mask:mask}}(config.dialog,payload);break;default:throw new Error("Unsupported dialog type = "+body.type)}dialogConfig&&setDialogOptions(__assign(__assign({},dialogConfig),{type:"dialog"}))}),[setDialogOptions]),drawerActionType=React.useCallback((function(config,payload){void 0===payload&&(payload={});var drawerConfig=function(drawerOption,payload){var className=drawerOption.className,width=drawerOption.width,title=drawerOption.title,maskClosable=drawerOption.maskClosable,body=drawerOption.body,foot=drawerOption.foot,mask=drawerOption.mask,cancelWithSuccess=drawerOption.cancelWithSuccess,okText=drawerOption.okText,cancelText=drawerOption.cancelText,_a=drawerOption.fromTable,fromTable=void 0!==_a&&_a,$title=_.template(title)(payload),$payloadFields=body.$payloadFields,$extraPayload=body.$extraPayload,content=body.content,$onBeforeOpen=body.$onBeforeOpen;return payload=createPayload(payload,$payloadFields,$extraPayload),{className:className,title:$title,width:width,maskClosable:maskClosable,foot:foot,okText:okText,cancelText:cancelText,cancelWithSuccess:cancelWithSuccess,payload:payload="function"==typeof $onBeforeOpen&&$onBeforeOpen(payload)||payload,wrappedComponent:content,fromTable:fromTable,mask:mask}}(config.drawer,payload);setDialogOptions(__assign(__assign({},drawerConfig),{type:"drawer"}))}),[setDialogOptions]),handleCustomAction=React.useCallback((function(functionName,payload){if(void 0===payload&&(payload={}),"loadList"===functionName)allFunctions.loadList();else if("checkAll"===functionName)allFunctions.checkAll(payload.checked);else if(allFunctions){var excuteFunction=allFunctions[functionName];excuteFunction&&excuteFunction(payload)}}),[allFunctions]),handleAction=React.useCallback((function(config,payload){void 0===payload&&(payload={}),config.select&&getSelectedItems&&(config.$extraPayload=getSelectedItems());var mergePayload=_.extend({},payload,config.$extraPayload);switch(config.actionType){case"link":var params=createParams(payload,config.$payloadFields,config.$extraPayload);handleRedirect(config.link+(params?"/".concat(params):""));break;case"dialog":dialogActionType(config,mergePayload);break;case"drawer":drawerActionType(config,mergePayload);break;case"ajax":ajaxAction({loadList:allFunctions.loadList,confirm:setConfirmOptions},config.ajax,mergePayload,actions);break;case"custom":handleCustomAction(config.action,mergePayload)}}),[allFunctions,actions,setConfirmOptions,dialogActionType,handleCustomAction,drawerActionType,getSelectedItems,handleRedirect]),handleDialogSuccess=React.useCallback((function(result){allFunctions.onDialogSuccess&&allFunctions.onDialogSuccess(result),_.get(dialogOptions,"fromTable",!1)?allFunctions.loadList():allFunctions.loadFirstPage()}),[allFunctions,dialogOptions]);return{handleAction:handleAction,confirmProps:{Confirm:Confirm,setConfirmOptions:setConfirmOptions},dialogProps:{Dialog:Dialog,dialogOpen:dialogOpen,dialogOptions:dialogOptions,onDialogCancel:handleDialogCancel,onDialogSuccess:handleDialogSuccess}}},util={};Object.defineProperty(util,"__esModule",{value:!0});var getColumnKey_1=util.getColumnKey=function(column,defaultKey){if("key"in column&&void 0!==column.key&&null!==column.key)return column.key;if(column.dataIndex)return Array.isArray(column.dataIndex)?column.dataIndex.join("."):column.dataIndex;return defaultKey},getColumnPos_1=util.getColumnPos=function(index,pos){return pos?"".concat(pos,"-").concat(index):"".concat(index)};util.renderColumnTitle=function(title,props){if("function"==typeof title)return title(props);return title};var DIALOG_TYPES=["dialog","drawer"],useForm=function(ref,props,options){var actions=props.actions,onSuccess=props.onSuccess,type=options.type,controls=options.controls,_a=options.actionConfig,actionConfig=void 0===_a?{}:_a,_b=options.customFunctions,customFunctions=void 0===_b?{}:_b,_c=options.formItemOption,formItemOption=void 0===_c?{}:_c,_d=options.stepConfig,stepConfig=void 0===_d?{}:_d,fetchDataAction=actionConfig.fetchDataAction,fetchOptionsAction=actionConfig.fetchOptionsAction,submitAction=actionConfig.submitAction,form=__read(acud.Form.useForm(),1)[0],_f=function(actions,fetchOptionsAction,fetchDataAction){var _a=__read(React.useState({}),2),optionsData=_a[0],setOptionsData=_a[1],originalFetchOptionsAction=useOriginalCopy$1(fetchOptionsAction,(function(savedValue,value){return JSON.stringify(savedValue)===JSON.stringify(value)})),_b=fetchDataAction||{},formData=_b.formData,fetchFormAction=_b.fetchFormAction,fetchFormPayload=_b.fetchFormPayload,$onFetchFormRequest=_b.$onFetchFormRequest,$onFetchFormResponse=_b.$onFetchFormResponse,_c=useFetch(fetchFormAction?actions[fetchFormAction]:"",fetchFormPayload,$onFetchFormRequest,$onFetchFormResponse,(function(){}),!fetchFormAction).data,data=void 0===_c?{}:_c,fetchData=__assign(__assign({},formData),data||{}),fetchOption=React.useCallback((function(optionsAction){return __awaiter(void 0,void 0,void 0,(function(){var name,_a,payload,action,fetchKey,$onFetchOptionsResponse,res,result,fetchOptionResult,optionData,_b;return __generator(this,(function(_c){switch(_c.label){case 0:return name=optionsAction.name,_a=optionsAction.payload,payload=void 0===_a?{}:_a,action=optionsAction.action,fetchKey=optionsAction.fetchKey,$onFetchOptionsResponse=optionsAction.$onFetchOptionsResponse,[4,actions[action](payload)];case 1:return res=_c.sent(),result=_.isArray(res)?res:res.result,fetchOptionResult=_.isFunction($onFetchOptionsResponse)&&$onFetchOptionsResponse(result)||result,optionData=_.map(fetchOptionResult,(function(item){return fetchKey?{value:item[fetchKey[0]],label:item[fetchKey[1]]}:item})),[2,(_b={},_b[name]=optionData,_b)]}}))}))}),[actions]);return React.useEffect((function(){var promiseAll=_.map(originalFetchOptionsAction,(function(optionsAction){return fetchOption(optionsAction)}));Promise.all(promiseAll).then((function(res){var result=_.assign.apply(_,__spreadArray([{}],__read(res),!1));setOptionsData(result)}))}),[originalFetchOptionsAction,fetchOption]),{fetchData:fetchData,optionsData:optionsData}}(actions,fetchOptionsAction,fetchDataAction),fetchData=_f.fetchData,optionsData=_f.optionsData,_g=__read(React.useState(fetchData),2),formData=_g[0],setFormData=_g[1],_h=function(form,actions,submitAction,fetchData,customFunctions,onSuccess){var _a=submitAction||{},submitFormAction=_a.submitFormAction,payload=_a.payload,$onSubmitRequest=_a.$onSubmitRequest,$onSubmitResponse=_a.$onSubmitResponse,$onSubmitError=_a.$onSubmitError,$toastSuccessMessage=_a.$toastSuccessMessage,$toastSuccessMessageFn=_a.$toastSuccessMessageFn,$toastErrorMessage=_a.$toastErrorMessage,$toastErrorMessageFn=_a.$toastErrorMessageFn,hooksRef=React.useRef(null);hooksRef.current={$onSubmitRequest:$onSubmitRequest,$onSubmitResponse:$onSubmitResponse,$onSubmitError:$onSubmitError};var _b=__read(React.useState(!1),2),isSubmiting=_b[0],setSubmiting=_b[1],actualSubmit=React.useCallback((function(values){return __awaiter(void 0,void 0,void 0,(function(){var params,formPayload,data,error_1,errorMsg;return __generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),isSubmiting?[2,Promise.reject()]:(setSubmiting(!0),params=__assign(__assign({},createPayload(fetchData,payload)),values),formPayload=_.isFunction(hooksRef.current.$onSubmitRequest)&&hooksRef.current.$onSubmitRequest(params)||params,[4,actions[submitFormAction](formPayload)]);case 1:return data=_a.sent(),_.isFunction(hooksRef.current.$onSubmitResponse)&&hooksRef.current.$onSubmitResponse(data),"function"==typeof $toastSuccessMessageFn?$toastSuccessMessageFn(data):message("success",$toastSuccessMessage||"提交成功"),setSubmiting(!1),onSuccess&&onSuccess(data),[3,3];case 2:return error_1=_a.sent(),setSubmiting(!1),_.isFunction(hooksRef.current.$onSubmitError)&&hooksRef.current.$onSubmitError(error_1),"function"==typeof $toastErrorMessageFn?$toastErrorMessageFn(error_1):(errorMsg=getGlobalError(error_1)||$toastErrorMessage)&&message("error",errorMsg),[3,3];case 3:return[2]}}))}))}),[isSubmiting,fetchData,actions,onSuccess,submitFormAction,payload,$toastSuccessMessage,$toastErrorMessage]),doSubmit=React.useCallback((function(values){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(_a){switch(_a.label){case 0:return customFunctions.doSubmit?[2,customFunctions.doSubmit(values)]:_.isEmpty(values)?[4,form.validateFields()]:[3,2];case 1:values=_a.sent(),_a.label=2;case 2:return[2,actualSubmit(values)]}}))}))}),[actualSubmit,customFunctions,form]);return{isSubmiting:isSubmiting,setSubmiting:setSubmiting,doSubmit:doSubmit,actualSubmit:actualSubmit}}(form,actions,submitAction,fetchData,customFunctions,onSuccess),isSubmiting=_h.isSubmiting,setSubmiting=_h.setSubmiting,doSubmit=_h.doSubmit,actualSubmit=_h.actualSubmit;React.useImperativeHandle(ref,(function(){return{doSubmit:"step"===type?doStepSubmit:doSubmit}}));var formItemOptionMerge=__assign(__assign(__assign({},defaultOptions$1),formItemOption),{isSubmiting:isSubmiting}),controlsConfig=controls(props,optionsData,customFunctions,formData),defaultValues=React.useMemo((function(){return _.assign.apply(_,__spreadArray([{}],__read(_.map(controlsConfig,(function(control){var _a;if("step"===type){var controls_1=control.controls,values=_.map(controls_1,(function(item){var _a,_b=item,defaultValue=_b.defaultValue,name=_b.name;if(isValue(defaultValue)&&name)return(_a={})[name]=defaultValue,_a}));return _.assign.apply(_,__spreadArray([{}],__read(values),!1))}var _b=control,defaultValue=_b.defaultValue,name=_b.name;if(isValue(defaultValue)&&name)return(_a={})[name]=defaultValue,_a}))),!1))}),[controlsConfig,type]),_j=function(form,steps,stepConfig,onSubmit,formData,setFormData,setSubmiting){void 0===stepConfig&&(stepConfig={});var _a=__read(React.useState(0),2),stepIndex=_a[0],setStepIndex=_a[1],handlePrevStep=React.useCallback((function(){return __awaiter(void 0,void 0,void 0,(function(){var prevClick,isSavedRealTime,_a;return __generator(this,(function(_b){switch(_b.label){case 0:return prevClick=stepConfig.prevClick,isSavedRealTime=stepConfig.isSavedRealTime,setSubmiting(!0),(_a=_.isFunction(prevClick))?[4,prevClick()]:[3,2];case 1:_a=!1===_b.sent(),_b.label=2;case 2:return!_a&&(isSavedRealTime&&setFormData((function(prevFormData){return __assign(__assign({},prevFormData),form.getFieldsValue())})),setStepIndex(stepIndex-1)),setSubmiting(!1),[2]}}))}))}),[stepIndex,form,setFormData,setSubmiting,stepConfig]),buttonConfig=React.useCallback((function(){var stepLength=steps.length,isFirst=stepIndex<=0,isLast=stepIndex>=stepLength-1,prevText=stepConfig.prevText,nextText=stepConfig.nextText,endText=stepConfig.endText;return{type:"button",config:[{skin:"default",text:prevText||"上一步",config:{disabled:isFirst},events:{onClick:function(){return handlePrevStep()}}},{type:"submit",skin:"primary",text:isLast?endText||"确定":nextText||"下一步"}]}}),[steps,stepConfig,stepIndex,handlePrevStep]),doSubmit=React.useCallback((function(values){return __awaiter(void 0,void 0,void 0,(function(){var nextClick,stepLength,formDataMerge,_a;return __generator(this,(function(_b){switch(_b.label){case 0:return nextClick=stepConfig.nextClick,stepLength=steps.length,setSubmiting(!0),formDataMerge=__assign(__assign({},formData),values),(_a=_.isFunction(nextClick))?[4,nextClick(formDataMerge)]:[3,2];case 1:_a=!1===_b.sent(),_b.label=2;case 2:return _a?setSubmiting(!1):stepIndex+1>=stepLength?(setSubmiting(!1),onSubmit(formDataMerge)):(setStepIndex(stepIndex+1),setFormData((function(prevFormData){return __assign(__assign({},prevFormData),values)})),setSubmiting(!1)),[2]}}))}))}),[steps,stepConfig,onSubmit,stepIndex,formData,setFormData,setSubmiting]);return{stepIndex:stepIndex,buttonConfig:buttonConfig,doStepSubmit:doSubmit}}(form,controlsConfig,stepConfig,actualSubmit,formData,setFormData,setSubmiting),stepIndex=_j.stepIndex,stepButtonConfig=_j.buttonConfig,doStepSubmit=_j.doStepSubmit,originalFetchData=useOriginalCopy$1(fetchData);return React.useEffect((function(){setFormData((function(prevFormData){return __assign(__assign({},prevFormData),originalFetchData)}))}),[originalFetchData]),{form:form,formRef:{current:form},formProps:{controlsConfig:controlsConfig,optionsData:optionsData,formData:__assign(__assign({},defaultValues),formData),doSubmit:"step"===type?doStepSubmit:doSubmit,isSubmiting:isSubmiting,setSubmiting:setSubmiting,type:type,stepIndex:stepIndex,stepButtonConfig:stepButtonConfig,formItemOptionMerge:formItemOptionMerge,form:form}}},controls$2=function(props,_,customFunctions){var _a,_b=props||{},_c=_b.fileList,fileList=void 0===_c?[]:_c,typeOptions=_b.typeOptions,_d=_b.uploagConfig,uploagConfig=void 0===_d?{}:_d,_e=_b.extraMsg,extraMsg=void 0===_e?"":_e,config=__assign(__assign({name:"file",accept:".xls,.xlsx",multiple:!1,maxCount:1},uploagConfig),{fileList:fileList,beforeUpload:function(file){return __awaiter(void 0,void 0,void 0,(function(){var name;return __generator(this,(function(_a){return name=file.name,(null==uploagConfig?void 0:uploagConfig.beforeUpload)?null==uploagConfig||uploagConfig.beforeUpload(file,(function(){customFunctions.setFileInfo(file,name)})):customFunctions.setFileInfo(file,name),[2]}))}))},onRemove:function(file){(null==uploagConfig?void 0:uploagConfig.onRemove)?null==uploagConfig||uploagConfig.onRemove(file,(function(){customFunctions.setFileInfo(null,null)})):customFunctions.setFileInfo(null,null)}});return[{type:"radio",name:"type",label:"导入模式",defaultValue:(null===(_a=null==typeOptions?void 0:typeOptions[0])||void 0===_a?void 0:_a.value)||"new",config:{options:typeOptions||[{label:"新增数据",value:"new"},{label:"更新数据",value:"update"}]},rules:[{required:!0,message:"请选择导入模式"}]},__assign({type:"custom",name:"upload",label:"文件",content:React.createElement(acud.Upload,__assign({},config),React.createElement(acud.Button,{icon:React.createElement(Icon.OutlinedButtonUpload,null),style:{pointerEvents:"none"},type:"primary"},"上传文件")),rules:[{required:!0,message:"请选择上传文件"},{validator:function(_,value,callback){var _a;"uploading"!==(null===(_a=null==value?void 0:value.file)||void 0===_a?void 0:_a.status)&&callback(React.createElement("div",null,"请选择上传文件",extraMsg&&React.createElement("div",{style:{color:"#84868C"}},extraMsg))),callback()}}]},extraMsg?{extra:extraMsg}:{})]},UploadForm$1=React.forwardRef((function(props,ref){var payload=props.payload,_a=__read(React.useState([]),2),fileList=_a[0],setFileList=_a[1],actionConfig=React.useMemo((function(){return{submitAction:{submitFormAction:"upload",$onSubmitRequest:function(formDataInfo){return __assign({},formDataInfo)},$onSubmitResponse:function(res){if(!1===res.success)throw acud.toast.error({message:res.data.err||"上传失败",duration:5}),Error(res.data.err||"上传失败")}}}}),[]),setFileInfo=React.useCallback((function(file,name){form&&(name?(null==form||form.setFieldsValue({upload:file}),setFileList([{name:name}])):(null==form||form.setFieldsValue({upload:void 0}),setFileList([])))}),[]),customFunctions=React.useMemo((function(){return{setFileInfo:setFileInfo}}),[setFileInfo]),options=React.useMemo((function(){return{controls:controls$2,formItemOption:{noStyle:!0},actionConfig:actionConfig,customFunctions:customFunctions}}),[actionConfig,customFunctions]),_b=useForm(ref,__assign(__assign({},payload),{fileList:fileList}),options),form=_b.form,formProps=_b.formProps;return React.createElement(HooksForm,__assign({},payload.alterMsg?{description:React.createElement(acud.Alert,{message:null==payload?void 0:payload.alterMsg,type:"info"})}:{},formProps,{form:form}))}));function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,p){return o.__proto__=p,o},_setPrototypeOf(o,p)}function _construct(Parent,args,Class){return _construct=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&_setPrototypeOf(instance,Class.prototype),instance},_construct.apply(null,arguments)}function _wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(Class){if(null===Class||(fn=Class,-1===Function.toString.call(fn).indexOf("[native code]")))return Class;var fn;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,Class)},_wrapNativeSuper(Class)}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}var canUseDOM="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function isWindow(element){var elementString=Object.prototype.toString.call(element);return"[object Window]"===elementString||"[object global]"===elementString}function isNode(node){return"nodeType"in node}function getWindow(target){var _target$ownerDocument,_target$ownerDocument2;return target?isWindow(target)?target:isNode(target)&&null!=(_target$ownerDocument=null==(_target$ownerDocument2=target.ownerDocument)?void 0:_target$ownerDocument2.defaultView)?_target$ownerDocument:window:window}function isDocument(node){return node instanceof getWindow(node).Document}function isHTMLElement(node){return!isWindow(node)&&node instanceof getWindow(node).HTMLElement}function isSVGElement(node){return node instanceof getWindow(node).SVGElement}function getOwnerDocument(target){return target?isWindow(target)?target.document:isNode(target)?isDocument(target)?target:isHTMLElement(target)||isSVGElement(target)?target.ownerDocument:document:document:document}var useIsomorphicLayoutEffect=canUseDOM?React.useLayoutEffect:React.useEffect;function useEvent(handler){var handlerRef=React.useRef(handler);return useIsomorphicLayoutEffect((function(){handlerRef.current=handler})),React.useCallback((function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return null==handlerRef.current?void 0:handlerRef.current.apply(handlerRef,args)}),[])}function useLatestValue(value,dependencies){void 0===dependencies&&(dependencies=[value]);var valueRef=React.useRef(value);return useIsomorphicLayoutEffect((function(){valueRef.current!==value&&(valueRef.current=value)}),dependencies),valueRef}function useLazyMemo(callback,dependencies){var valueRef=React.useRef();return React.useMemo((function(){var newValue=callback(valueRef.current);return valueRef.current=newValue,newValue}),[].concat(dependencies))}function useNodeRef(onChange){var onChangeHandler=useEvent(onChange),node=React.useRef(null),setNodeRef=React.useCallback((function(element){element!==node.current&&(null==onChangeHandler||onChangeHandler(element,node.current)),node.current=element}),[]);return[node,setNodeRef]}function usePrevious(value){var ref=React.useRef();return React.useEffect((function(){ref.current=value}),[value]),ref.current}var ids={};function useUniqueId(prefix,value){return React.useMemo((function(){if(value)return value;var id=null==ids[prefix]?0:ids[prefix]+1;return ids[prefix]=id,prefix+"-"+id}),[prefix,value])}function createAdjustmentFn(modifier){return function(object){for(var _len=arguments.length,adjustments=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)adjustments[_key-1]=arguments[_key];return adjustments.reduce((function(accumulator,adjustment){for(var _i=0,_entries=Object.entries(adjustment);_i<_entries.length;_i++){var _entries$_i=_entries[_i],key=_entries$_i[0],valueAdjustment=_entries$_i[1],value=accumulator[key];null!=value&&(accumulator[key]=value+modifier*valueAdjustment)}return accumulator}),_extends({},object))}}var add=createAdjustmentFn(1),subtract=createAdjustmentFn(-1);function isKeyboardEvent(event){if(!event)return!1;var KeyboardEvent=getWindow(event.target).KeyboardEvent;return KeyboardEvent&&event instanceof KeyboardEvent}function getEventCoordinates(event){if(function(event){if(!event)return!1;var TouchEvent=getWindow(event.target).TouchEvent;return TouchEvent&&event instanceof TouchEvent}(event)){if(event.touches&&event.touches.length){var _event$touches$=event.touches[0];return{x:_event$touches$.clientX,y:_event$touches$.clientY}}if(event.changedTouches&&event.changedTouches.length){var _event$changedTouches=event.changedTouches[0];return{x:_event$changedTouches.clientX,y:_event$changedTouches.clientY}}}return function(event){return"clientX"in event&&"clientY"in event}(event)?{x:event.clientX,y:event.clientY}:null}var CSS=Object.freeze({Translate:{toString:function(transform){if(transform){var x=transform.x,y=transform.y;return"translate3d("+(x?Math.round(x):0)+"px, "+(y?Math.round(y):0)+"px, 0)"}}},Scale:{toString:function(transform){if(transform)return"scaleX("+transform.scaleX+") scaleY("+transform.scaleY+")"}},Transform:{toString:function(transform){if(transform)return[CSS.Translate.toString(transform),CSS.Scale.toString(transform)].join(" ")}},Transition:{toString:function(_ref){return _ref.property+" "+_ref.duration+"ms "+_ref.easing}}}),SELECTOR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function findFirstFocusableNode(element){return element.matches(SELECTOR)?element:element.querySelector(SELECTOR)}var hiddenStyles={display:"none"};function HiddenText(_ref){var id=_ref.id,value=_ref.value;return React.createElement("div",{id:id,style:hiddenStyles},value)}function LiveRegion(_ref){var id=_ref.id,announcement=_ref.announcement,_ref$ariaLiveType=_ref.ariaLiveType,ariaLiveType=void 0===_ref$ariaLiveType?"assertive":_ref$ariaLiveType;return React.createElement("div",{id:id,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":ariaLiveType,"aria-atomic":!0},announcement)}var _x,_y,_excluded=["transform"],_excluded2=["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"];function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _createForOfIteratorHelperLoose(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var DndMonitorContext=React.createContext(null);var Action,defaultScreenReaderInstructions={draggable:"\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  "},defaultAnnouncements={onDragStart:function(_ref){return"Picked up draggable item "+_ref.active.id+"."},onDragOver:function(_ref2){var active=_ref2.active,over=_ref2.over;return over?"Draggable item "+active.id+" was moved over droppable area "+over.id+".":"Draggable item "+active.id+" is no longer over a droppable area."},onDragEnd:function(_ref3){var active=_ref3.active,over=_ref3.over;return over?"Draggable item "+active.id+" was dropped over droppable area "+over.id:"Draggable item "+active.id+" was dropped."},onDragCancel:function(_ref4){return"Dragging was cancelled. Draggable item "+_ref4.active.id+" was dropped."}};function Accessibility(_ref){var listener,registerListener,_ref$announcements=_ref.announcements,announcements=void 0===_ref$announcements?defaultAnnouncements:_ref$announcements,container=_ref.container,hiddenTextDescribedById=_ref.hiddenTextDescribedById,_ref$screenReaderInst=_ref.screenReaderInstructions,screenReaderInstructions=void 0===_ref$screenReaderInst?defaultScreenReaderInstructions:_ref$screenReaderInst,_useAnnouncement=function(){var _useState=React.useState(""),announcement=_useState[0],setAnnouncement=_useState[1];return{announce:React.useCallback((function(value){null!=value&&setAnnouncement(value)}),[]),announcement:announcement}}(),announce=_useAnnouncement.announce,announcement=_useAnnouncement.announcement,liveRegionId=useUniqueId("DndLiveRegion"),_useState2=React.useState(!1),mounted=_useState2[0],setMounted=_useState2[1];if(React.useEffect((function(){setMounted(!0)}),[]),listener=React.useMemo((function(){return{onDragStart:function(_ref2){var active=_ref2.active;announce(announcements.onDragStart({active:active}))},onDragMove:function(_ref3){var active=_ref3.active,over=_ref3.over;announcements.onDragMove&&announce(announcements.onDragMove({active:active,over:over}))},onDragOver:function(_ref4){var active=_ref4.active,over=_ref4.over;announce(announcements.onDragOver({active:active,over:over}))},onDragEnd:function(_ref5){var active=_ref5.active,over=_ref5.over;announce(announcements.onDragEnd({active:active,over:over}))},onDragCancel:function(_ref6){var active=_ref6.active,over=_ref6.over;announce(announcements.onDragCancel({active:active,over:over}))}}}),[announce,announcements]),registerListener=React.useContext(DndMonitorContext),React.useEffect((function(){if(!registerListener)throw new Error("useDndMonitor must be used within a children of <DndContext>");return registerListener(listener)}),[listener,registerListener]),!mounted)return null;var markup=React.createElement(React.Fragment,null,React.createElement(HiddenText,{id:hiddenTextDescribedById,value:screenReaderInstructions.draggable}),React.createElement(LiveRegion,{id:liveRegionId,announcement:announcement}));return container?reactDom.createPortal(markup,container):markup}function noop(){}function useSensor(sensor,options){return React.useMemo((function(){return{sensor:sensor,options:null!=options?options:{}}}),[sensor,options])}function useSensors(){for(var _len=arguments.length,sensors=new Array(_len),_key=0;_key<_len;_key++)sensors[_key]=arguments[_key];return React.useMemo((function(){return[].concat(sensors).filter((function(sensor){return null!=sensor}))}),[].concat(sensors))}!function(Action){Action.DragStart="dragStart",Action.DragMove="dragMove",Action.DragEnd="dragEnd",Action.DragCancel="dragCancel",Action.DragOver="dragOver",Action.RegisterDroppable="registerDroppable",Action.SetDroppableDisabled="setDroppableDisabled",Action.UnregisterDroppable="unregisterDroppable"}(Action||(Action={}));var defaultCoordinates=Object.freeze({x:0,y:0});function distanceBetween(p1,p2){return Math.sqrt(Math.pow(p1.x-p2.x,2)+Math.pow(p1.y-p2.y,2))}function sortCollisionsAsc(_ref,_ref2){return _ref.data.value-_ref2.data.value}function sortCollisionsDesc(_ref3,_ref4){var a=_ref3.data.value;return _ref4.data.value-a}function cornersOfRectangle(_ref5){var left=_ref5.left,top=_ref5.top,height=_ref5.height,width=_ref5.width;return[{x:left,y:top},{x:left+width,y:top},{x:left,y:top+height},{x:left+width,y:top+height}]}function getFirstCollision(collisions,property){if(!collisions||0===collisions.length)return null;var firstCollision=collisions[0];return property?firstCollision[property]:firstCollision}function centerOfRectangle(rect,left,top){return void 0===left&&(left=rect.left),void 0===top&&(top=rect.top),{x:left+.5*rect.width,y:top+.5*rect.height}}var closestCenter=function(_ref){for(var _step,collisionRect=_ref.collisionRect,droppableRects=_ref.droppableRects,droppableContainers=_ref.droppableContainers,centerRect=centerOfRectangle(collisionRect,collisionRect.left,collisionRect.top),collisions=[],_iterator=_createForOfIteratorHelperLoose(droppableContainers);!(_step=_iterator()).done;){var droppableContainer=_step.value,id=droppableContainer.id,rect=droppableRects.get(id);if(rect){var distBetween=distanceBetween(centerOfRectangle(rect),centerRect);collisions.push({id:id,data:{droppableContainer:droppableContainer,value:distBetween}})}}return collisions.sort(sortCollisionsAsc)};function getIntersectionRatio(entry,target){var top=Math.max(target.top,entry.top),left=Math.max(target.left,entry.left),right=Math.min(target.left+target.width,entry.left+entry.width),bottom=Math.min(target.top+target.height,entry.top+entry.height),width=right-left,height=bottom-top;if(left<right&&top<bottom){var targetArea=target.width*target.height,entryArea=entry.width*entry.height,intersectionArea=width*height;return Number((intersectionArea/(targetArea+entryArea-intersectionArea)).toFixed(4))}return 0}var rectIntersection=function(_ref){for(var _step3,collisionRect=_ref.collisionRect,droppableRects=_ref.droppableRects,collisions=[],_iterator3=_createForOfIteratorHelperLoose(_ref.droppableContainers);!(_step3=_iterator3()).done;){var droppableContainer=_step3.value,id=droppableContainer.id,rect=droppableRects.get(id);if(rect){var intersectionRatio=getIntersectionRatio(rect,collisionRect);intersectionRatio>0&&collisions.push({id:id,data:{droppableContainer:droppableContainer,value:intersectionRatio}})}}return collisions.sort(sortCollisionsDesc)};function getRectDelta(rect1,rect2){return rect1&&rect2?{x:rect1.left-rect2.left,y:rect1.top-rect2.top}:defaultCoordinates}function createRectAdjustmentFn(modifier){return function(rect){for(var _len=arguments.length,adjustments=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)adjustments[_key-1]=arguments[_key];return adjustments.reduce((function(acc,adjustment){return _extends({},acc,{top:acc.top+modifier*adjustment.y,bottom:acc.bottom+modifier*adjustment.y,left:acc.left+modifier*adjustment.x,right:acc.right+modifier*adjustment.x})}),_extends({},rect))}}var getAdjustedRect=createRectAdjustmentFn(1);var Direction,defaultOptions={ignoreTransform:!1};function getClientRect(element,options){void 0===options&&(options=defaultOptions);var rect=element.getBoundingClientRect();if(options.ignoreTransform){var _getWindow$getCompute=getWindow(element).getComputedStyle(element),transform=_getWindow$getCompute.transform,transformOrigin=_getWindow$getCompute.transformOrigin;transform&&(rect=function(rect,transform,transformOrigin){var parsedTransform=function(transform){if(transform.startsWith("matrix3d(")){var transformArray=transform.slice(9,-1).split(/, /);return{x:+transformArray[12],y:+transformArray[13],scaleX:+transformArray[0],scaleY:+transformArray[5]}}if(transform.startsWith("matrix(")){var _transformArray=transform.slice(7,-1).split(/, /);return{x:+_transformArray[4],y:+_transformArray[5],scaleX:+_transformArray[0],scaleY:+_transformArray[3]}}return null}(transform);if(!parsedTransform)return rect;var scaleX=parsedTransform.scaleX,scaleY=parsedTransform.scaleY,translateX=parsedTransform.x,translateY=parsedTransform.y,x=rect.left-translateX-(1-scaleX)*parseFloat(transformOrigin),y=rect.top-translateY-(1-scaleY)*parseFloat(transformOrigin.slice(transformOrigin.indexOf(" ")+1)),w=scaleX?rect.width/scaleX:rect.width,h=scaleY?rect.height/scaleY:rect.height;return{width:w,height:h,top:y,right:x+w,bottom:y+h,left:x}}(rect,transform,transformOrigin))}var _rect=rect;return{top:_rect.top,left:_rect.left,width:_rect.width,height:_rect.height,bottom:_rect.bottom,right:_rect.right}}function getTransformAgnosticClientRect(element){return getClientRect(element,{ignoreTransform:!0})}function getScrollableAncestors(element,limit){var scrollParents=[];return element?function findScrollableAncestors(node){if(null!=limit&&scrollParents.length>=limit)return scrollParents;if(!node)return scrollParents;if(isDocument(node)&&null!=node.scrollingElement&&!scrollParents.includes(node.scrollingElement))return scrollParents.push(node.scrollingElement),scrollParents;if(!isHTMLElement(node)||isSVGElement(node))return scrollParents;if(scrollParents.includes(node))return scrollParents;var computedStyle=getWindow(element).getComputedStyle(node);return node!==element&&function(element,computedStyle){void 0===computedStyle&&(computedStyle=getWindow(element).getComputedStyle(element));var overflowRegex=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((function(property){var value=computedStyle[property];return"string"==typeof value&&overflowRegex.test(value)}))}(node,computedStyle)&&scrollParents.push(node),function(node,computedStyle){return void 0===computedStyle&&(computedStyle=getWindow(node).getComputedStyle(node)),"fixed"===computedStyle.position}(node,computedStyle)?scrollParents:findScrollableAncestors(node.parentNode)}(element):scrollParents}function getFirstScrollableAncestor(node){var firstScrollableAncestor=getScrollableAncestors(node,1)[0];return null!=firstScrollableAncestor?firstScrollableAncestor:null}function getScrollableElement(element){return canUseDOM&&element?isWindow(element)?element:isNode(element)?isDocument(element)||element===getOwnerDocument(element).scrollingElement?window:isHTMLElement(element)?element:null:null:null}function getScrollXCoordinate(element){return isWindow(element)?element.scrollX:element.scrollLeft}function getScrollYCoordinate(element){return isWindow(element)?element.scrollY:element.scrollTop}function getScrollCoordinates(element){return{x:getScrollXCoordinate(element),y:getScrollYCoordinate(element)}}function isDocumentScrollingElement(element){return!(!canUseDOM||!element)&&element===document.scrollingElement}function getScrollPosition(scrollingContainer){var minScroll={x:0,y:0},dimensions=isDocumentScrollingElement(scrollingContainer)?{height:window.innerHeight,width:window.innerWidth}:{height:scrollingContainer.clientHeight,width:scrollingContainer.clientWidth},maxScroll={x:scrollingContainer.scrollWidth-dimensions.width,y:scrollingContainer.scrollHeight-dimensions.height};return{isTop:scrollingContainer.scrollTop<=minScroll.y,isLeft:scrollingContainer.scrollLeft<=minScroll.x,isBottom:scrollingContainer.scrollTop>=maxScroll.y,isRight:scrollingContainer.scrollLeft>=maxScroll.x,maxScroll:maxScroll,minScroll:minScroll}}!function(Direction){Direction[Direction.Forward=1]="Forward",Direction[Direction.Backward=-1]="Backward"}(Direction||(Direction={}));var defaultThreshold={x:.2,y:.2};function getScrollDirectionAndSpeed(scrollContainer,scrollContainerRect,_ref,acceleration,thresholdPercentage){var top=_ref.top,left=_ref.left,right=_ref.right,bottom=_ref.bottom;void 0===acceleration&&(acceleration=10),void 0===thresholdPercentage&&(thresholdPercentage=defaultThreshold);var _getScrollPosition=getScrollPosition(scrollContainer),isTop=_getScrollPosition.isTop,isBottom=_getScrollPosition.isBottom,isLeft=_getScrollPosition.isLeft,isRight=_getScrollPosition.isRight,direction={x:0,y:0},speed={x:0,y:0},threshold_height=scrollContainerRect.height*thresholdPercentage.y,threshold_width=scrollContainerRect.width*thresholdPercentage.x;return!isTop&&top<=scrollContainerRect.top+threshold_height?(direction.y=Direction.Backward,speed.y=acceleration*Math.abs((scrollContainerRect.top+threshold_height-top)/threshold_height)):!isBottom&&bottom>=scrollContainerRect.bottom-threshold_height&&(direction.y=Direction.Forward,speed.y=acceleration*Math.abs((scrollContainerRect.bottom-threshold_height-bottom)/threshold_height)),!isRight&&right>=scrollContainerRect.right-threshold_width?(direction.x=Direction.Forward,speed.x=acceleration*Math.abs((scrollContainerRect.right-threshold_width-right)/threshold_width)):!isLeft&&left<=scrollContainerRect.left+threshold_width&&(direction.x=Direction.Backward,speed.x=acceleration*Math.abs((scrollContainerRect.left+threshold_width-left)/threshold_width)),{direction:direction,speed:speed}}function getScrollElementRect(element){if(element===document.scrollingElement){var _window=window,innerWidth=_window.innerWidth,innerHeight=_window.innerHeight;return{top:0,left:0,right:innerWidth,bottom:innerHeight,width:innerWidth,height:innerHeight}}var _element$getBoundingC=element.getBoundingClientRect();return{top:_element$getBoundingC.top,left:_element$getBoundingC.left,right:_element$getBoundingC.right,bottom:_element$getBoundingC.bottom,width:element.clientWidth,height:element.clientHeight}}function getScrollOffsets(scrollableAncestors){return scrollableAncestors.reduce((function(acc,node){return add(acc,getScrollCoordinates(node))}),defaultCoordinates)}var EventName,KeyboardCode,properties=[["x",["left","right"],function(scrollableAncestors){return scrollableAncestors.reduce((function(acc,node){return acc+getScrollXCoordinate(node)}),0)}],["y",["top","bottom"],function(scrollableAncestors){return scrollableAncestors.reduce((function(acc,node){return acc+getScrollYCoordinate(node)}),0)}]],Rect=function(rect,element){var _this=this;this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;var scrollableAncestors=getScrollableAncestors(element),scrollOffsets=getScrollOffsets(scrollableAncestors);this.rect=_extends({},rect),this.width=rect.width,this.height=rect.height;for(var _loop2=function(){for(var _step5,_properties$_i=_properties[_i],axis=_properties$_i[0],keys=_properties$_i[1],getScrollOffset=_properties$_i[2],_loop3=function(){var key=_step5.value;Object.defineProperty(_this,key,{get:function(){var currentOffsets=getScrollOffset(scrollableAncestors),scrollOffsetsDeltla=scrollOffsets[axis]-currentOffsets;return _this.rect[key]+scrollOffsetsDeltla},enumerable:!0})},_iterator5=_createForOfIteratorHelperLoose(keys);!(_step5=_iterator5()).done;)_loop3()},_i=0,_properties=properties;_i<_properties.length;_i++)_loop2();Object.defineProperty(this,"rect",{enumerable:!1})},Listeners=function(){function Listeners(target){var _this2=this;this.target=void 0,this.listeners=[],this.removeAll=function(){_this2.listeners.forEach((function(listener){var _this$target3,_this$target;return null==(_this$target=_this2.target)?void 0:(_this$target3=_this$target).removeEventListener.apply(_this$target3,listener)}))},this.target=target}return Listeners.prototype.add=function(eventName,handler,options){var _this$target2;null==(_this$target2=this.target)||_this$target2.addEventListener(eventName,handler,options),this.listeners.push([eventName,handler,options])},Listeners}();function hasExceededDistance(delta,measurement){var dx=Math.abs(delta.x),dy=Math.abs(delta.y);return"number"==typeof measurement?Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2))>measurement:"x"in measurement&&"y"in measurement?dx>measurement.x&&dy>measurement.y:"x"in measurement?dx>measurement.x:"y"in measurement&&dy>measurement.y}function preventDefault(event){event.preventDefault()}function stopPropagation(event){event.stopPropagation()}!function(EventName){EventName.Click="click",EventName.DragStart="dragstart",EventName.Keydown="keydown",EventName.ContextMenu="contextmenu",EventName.Resize="resize",EventName.SelectionChange="selectionchange",EventName.VisibilityChange="visibilitychange"}(EventName||(EventName={})),function(KeyboardCode){KeyboardCode.Space="Space",KeyboardCode.Down="ArrowDown",KeyboardCode.Right="ArrowRight",KeyboardCode.Left="ArrowLeft",KeyboardCode.Up="ArrowUp",KeyboardCode.Esc="Escape",KeyboardCode.Enter="Enter",KeyboardCode.Tab="Tab"}(KeyboardCode||(KeyboardCode={}));var defaultKeyboardCodes={start:[KeyboardCode.Space,KeyboardCode.Enter],cancel:[KeyboardCode.Esc],end:[KeyboardCode.Space,KeyboardCode.Enter,KeyboardCode.Tab]},defaultKeyboardCoordinateGetter=function(event,_ref){var currentCoordinates=_ref.currentCoordinates;switch(event.code){case KeyboardCode.Right:return _extends({},currentCoordinates,{x:currentCoordinates.x+25});case KeyboardCode.Left:return _extends({},currentCoordinates,{x:currentCoordinates.x-25});case KeyboardCode.Down:return _extends({},currentCoordinates,{y:currentCoordinates.y+25});case KeyboardCode.Up:return _extends({},currentCoordinates,{y:currentCoordinates.y-25})}},KeyboardSensor=function(){function KeyboardSensor(props){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=props;var target=props.event.target;this.props=props,this.listeners=new Listeners(getOwnerDocument(target)),this.windowListeners=new Listeners(getWindow(target)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}var _proto2=KeyboardSensor.prototype;return _proto2.attach=function(){var _this3=this;this.handleStart(),this.windowListeners.add(EventName.Resize,this.handleCancel),this.windowListeners.add(EventName.VisibilityChange,this.handleCancel),setTimeout((function(){return _this3.listeners.add(EventName.Keydown,_this3.handleKeyDown)}))},_proto2.handleStart=function(){var _this$props=this.props,activeNode=_this$props.activeNode,onStart=_this$props.onStart,node=activeNode.node.current;node&&function(element,measure){if(void 0===measure&&(measure=getClientRect),element){var _measure=measure(element),top=_measure.top,left=_measure.left,bottom=_measure.bottom,right=_measure.right;getFirstScrollableAncestor(element)&&(bottom<=0||right<=0||top>=window.innerHeight||left>=window.innerWidth)&&element.scrollIntoView({block:"center",inline:"center"})}}(node),onStart(defaultCoordinates)},_proto2.handleKeyDown=function(event){if(isKeyboardEvent(event)){var _this$props2=this.props,active=_this$props2.active,context=_this$props2.context,options=_this$props2.options,_options$keyboardCode=options.keyboardCodes,keyboardCodes=void 0===_options$keyboardCode?defaultKeyboardCodes:_options$keyboardCode,_options$coordinateGe=options.coordinateGetter,coordinateGetter=void 0===_options$coordinateGe?defaultKeyboardCoordinateGetter:_options$coordinateGe,_options$scrollBehavi=options.scrollBehavior,scrollBehavior=void 0===_options$scrollBehavi?"smooth":_options$scrollBehavi,code=event.code;if(keyboardCodes.end.includes(code))return void this.handleEnd(event);if(keyboardCodes.cancel.includes(code))return void this.handleCancel(event);var collisionRect=context.current.collisionRect,currentCoordinates=collisionRect?{x:collisionRect.left,y:collisionRect.top}:defaultCoordinates;this.referenceCoordinates||(this.referenceCoordinates=currentCoordinates);var newCoordinates=coordinateGetter(event,{active:active,context:context.current,currentCoordinates:currentCoordinates});if(newCoordinates){for(var _step6,coordinatesDelta=subtract(newCoordinates,currentCoordinates),scrollDelta={x:0,y:0},_iterator6=_createForOfIteratorHelperLoose(context.current.scrollableAncestors);!(_step6=_iterator6()).done;){var scrollContainer=_step6.value,direction=event.code,_getScrollPosition2=getScrollPosition(scrollContainer),isTop=_getScrollPosition2.isTop,isRight=_getScrollPosition2.isRight,isLeft=_getScrollPosition2.isLeft,isBottom=_getScrollPosition2.isBottom,maxScroll=_getScrollPosition2.maxScroll,minScroll=_getScrollPosition2.minScroll,scrollElementRect=getScrollElementRect(scrollContainer),clampedCoordinates={x:Math.min(direction===KeyboardCode.Right?scrollElementRect.right-scrollElementRect.width/2:scrollElementRect.right,Math.max(direction===KeyboardCode.Right?scrollElementRect.left:scrollElementRect.left+scrollElementRect.width/2,newCoordinates.x)),y:Math.min(direction===KeyboardCode.Down?scrollElementRect.bottom-scrollElementRect.height/2:scrollElementRect.bottom,Math.max(direction===KeyboardCode.Down?scrollElementRect.top:scrollElementRect.top+scrollElementRect.height/2,newCoordinates.y))},canScrollX=direction===KeyboardCode.Right&&!isRight||direction===KeyboardCode.Left&&!isLeft,canScrollY=direction===KeyboardCode.Down&&!isBottom||direction===KeyboardCode.Up&&!isTop;if(canScrollX&&clampedCoordinates.x!==newCoordinates.x){var newScrollCoordinates=scrollContainer.scrollLeft+coordinatesDelta.x,canScrollToNewCoordinates=direction===KeyboardCode.Right&&newScrollCoordinates<=maxScroll.x||direction===KeyboardCode.Left&&newScrollCoordinates>=minScroll.x;if(canScrollToNewCoordinates&&!coordinatesDelta.y)return void scrollContainer.scrollTo({left:newScrollCoordinates,behavior:scrollBehavior});scrollDelta.x=canScrollToNewCoordinates?scrollContainer.scrollLeft-newScrollCoordinates:direction===KeyboardCode.Right?scrollContainer.scrollLeft-maxScroll.x:scrollContainer.scrollLeft-minScroll.x,scrollDelta.x&&scrollContainer.scrollBy({left:-scrollDelta.x,behavior:scrollBehavior});break}if(canScrollY&&clampedCoordinates.y!==newCoordinates.y){var _newScrollCoordinates=scrollContainer.scrollTop+coordinatesDelta.y,_canScrollToNewCoordinates=direction===KeyboardCode.Down&&_newScrollCoordinates<=maxScroll.y||direction===KeyboardCode.Up&&_newScrollCoordinates>=minScroll.y;if(_canScrollToNewCoordinates&&!coordinatesDelta.x)return void scrollContainer.scrollTo({top:_newScrollCoordinates,behavior:scrollBehavior});scrollDelta.y=_canScrollToNewCoordinates?scrollContainer.scrollTop-_newScrollCoordinates:direction===KeyboardCode.Down?scrollContainer.scrollTop-maxScroll.y:scrollContainer.scrollTop-minScroll.y,scrollDelta.y&&scrollContainer.scrollBy({top:-scrollDelta.y,behavior:scrollBehavior});break}}this.handleMove(event,add(subtract(newCoordinates,this.referenceCoordinates),scrollDelta))}}},_proto2.handleMove=function(event,coordinates){var onMove=this.props.onMove;event.preventDefault(),onMove(coordinates)},_proto2.handleEnd=function(event){var onEnd=this.props.onEnd;event.preventDefault(),this.detach(),onEnd()},_proto2.handleCancel=function(event){var onCancel=this.props.onCancel;event.preventDefault(),this.detach(),onCancel()},_proto2.detach=function(){this.listeners.removeAll(),this.windowListeners.removeAll()},KeyboardSensor}();function isDistanceConstraint(constraint){return Boolean(constraint&&"distance"in constraint)}function isDelayConstraint(constraint){return Boolean(constraint&&"delay"in constraint)}KeyboardSensor.activators=[{eventName:"onKeyDown",handler:function(event,_ref,_ref2){var _ref$keyboardCodes=_ref.keyboardCodes,keyboardCodes=void 0===_ref$keyboardCodes?defaultKeyboardCodes:_ref$keyboardCodes,onActivation=_ref.onActivation,active=_ref2.active,code=event.nativeEvent.code;if(keyboardCodes.start.includes(code)){var activator=active.activatorNode.current;return(!activator||event.target===activator)&&(event.preventDefault(),null==onActivation||onActivation({event:event.nativeEvent}),!0)}return!1}}];var MouseButton,AutoScrollActivator,TraversalOrder,AbstractPointerSensor=function(){function AbstractPointerSensor(props,events,listenerTarget){var _getEventCoordinates;void 0===listenerTarget&&(listenerTarget=function(target){return target instanceof getWindow(target).EventTarget?target:getOwnerDocument(target)}(props.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=props,this.events=events;var event=props.event,target=event.target;this.props=props,this.events=events,this.document=getOwnerDocument(target),this.documentListeners=new Listeners(this.document),this.listeners=new Listeners(listenerTarget),this.windowListeners=new Listeners(getWindow(target)),this.initialCoordinates=null!=(_getEventCoordinates=getEventCoordinates(event))?_getEventCoordinates:defaultCoordinates,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}var _proto3=AbstractPointerSensor.prototype;return _proto3.attach=function(){var events=this.events,_this$props$options=this.props.options,activationConstraint=_this$props$options.activationConstraint,bypassActivationConstraint=_this$props$options.bypassActivationConstraint;if(this.listeners.add(events.move.name,this.handleMove,{passive:!1}),this.listeners.add(events.end.name,this.handleEnd),events.cancel&&this.listeners.add(events.cancel.name,this.handleCancel),this.windowListeners.add(EventName.Resize,this.handleCancel),this.windowListeners.add(EventName.DragStart,preventDefault),this.windowListeners.add(EventName.VisibilityChange,this.handleCancel),this.windowListeners.add(EventName.ContextMenu,preventDefault),this.documentListeners.add(EventName.Keydown,this.handleKeydown),activationConstraint){if(null!=bypassActivationConstraint&&bypassActivationConstraint({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(isDelayConstraint(activationConstraint))return this.timeoutId=setTimeout(this.handleStart,activationConstraint.delay),void this.handlePending(activationConstraint);if(isDistanceConstraint(activationConstraint))return void this.handlePending(activationConstraint)}this.handleStart()},_proto3.detach=function(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)},_proto3.handlePending=function(constraint,offset){var _this$props3=this.props,active=_this$props3.active;(0,_this$props3.onPending)(active,constraint,this.initialCoordinates,offset)},_proto3.handleStart=function(){var initialCoordinates=this.initialCoordinates,onStart=this.props.onStart;initialCoordinates&&(this.activated=!0,this.documentListeners.add(EventName.Click,stopPropagation,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(EventName.SelectionChange,this.removeTextSelection),onStart(initialCoordinates))},_proto3.handleMove=function(event){var _getEventCoordinates2,activated=this.activated,initialCoordinates=this.initialCoordinates,props=this.props,onMove=props.onMove,activationConstraint=props.options.activationConstraint;if(initialCoordinates){var coordinates=null!=(_getEventCoordinates2=getEventCoordinates(event))?_getEventCoordinates2:defaultCoordinates,delta=subtract(initialCoordinates,coordinates);if(!activated&&activationConstraint){if(isDistanceConstraint(activationConstraint)){if(null!=activationConstraint.tolerance&&hasExceededDistance(delta,activationConstraint.tolerance))return this.handleCancel();if(hasExceededDistance(delta,activationConstraint.distance))return this.handleStart()}return isDelayConstraint(activationConstraint)&&hasExceededDistance(delta,activationConstraint.tolerance)?this.handleCancel():void this.handlePending(activationConstraint,delta)}event.cancelable&&event.preventDefault(),onMove(coordinates)}},_proto3.handleEnd=function(){var _this$props4=this.props,onAbort=_this$props4.onAbort,onEnd=_this$props4.onEnd;this.detach(),this.activated||onAbort(this.props.active),onEnd()},_proto3.handleCancel=function(){var _this$props5=this.props,onAbort=_this$props5.onAbort,onCancel=_this$props5.onCancel;this.detach(),this.activated||onAbort(this.props.active),onCancel()},_proto3.handleKeydown=function(event){event.code===KeyboardCode.Esc&&this.handleCancel()},_proto3.removeTextSelection=function(){var _this$document$getSel;null==(_this$document$getSel=this.document.getSelection())||_this$document$getSel.removeAllRanges()},AbstractPointerSensor}(),events={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},PointerSensor=function(_AbstractPointerSenso){function PointerSensor(props){var listenerTarget=getOwnerDocument(props.event.target);return _AbstractPointerSenso.call(this,props,events,listenerTarget)||this}return _inheritsLoose(PointerSensor,_AbstractPointerSenso),PointerSensor}(AbstractPointerSensor);function useAutoScroller(_ref){var intervalRef,acceleration=_ref.acceleration,_ref$activator=_ref.activator,activator=void 0===_ref$activator?AutoScrollActivator.Pointer:_ref$activator,canScroll=_ref.canScroll,draggingRect=_ref.draggingRect,enabled=_ref.enabled,_ref$interval=_ref.interval,interval=void 0===_ref$interval?5:_ref$interval,_ref$order=_ref.order,order=void 0===_ref$order?TraversalOrder.TreeOrder:_ref$order,pointerCoordinates=_ref.pointerCoordinates,scrollableAncestors=_ref.scrollableAncestors,scrollableAncestorRects=_ref.scrollableAncestorRects,delta=_ref.delta,threshold=_ref.threshold,scrollIntent=function(_ref2){var delta=_ref2.delta,disabled=_ref2.disabled,previousDelta=usePrevious(delta);return useLazyMemo((function(previousIntent){var _x2,_y2;if(disabled||!previousDelta||!previousIntent)return defaultScrollIntent;var direction={x:Math.sign(delta.x-previousDelta.x),y:Math.sign(delta.y-previousDelta.y)};return{x:(_x2={},_x2[Direction.Backward]=previousIntent.x[Direction.Backward]||-1===direction.x,_x2[Direction.Forward]=previousIntent.x[Direction.Forward]||1===direction.x,_x2),y:(_y2={},_y2[Direction.Backward]=previousIntent.y[Direction.Backward]||-1===direction.y,_y2[Direction.Forward]=previousIntent.y[Direction.Forward]||1===direction.y,_y2)}}),[disabled,delta,previousDelta])}({delta:delta,disabled:!enabled}),_useInterval=(intervalRef=React.useRef(null),[React.useCallback((function(listener,duration){intervalRef.current=setInterval(listener,duration)}),[]),React.useCallback((function(){null!==intervalRef.current&&(clearInterval(intervalRef.current),intervalRef.current=null)}),[])]),setAutoScrollInterval=_useInterval[0],clearAutoScrollInterval=_useInterval[1],scrollSpeed=React.useRef({x:0,y:0}),scrollDirection=React.useRef({x:0,y:0}),rect=React.useMemo((function(){switch(activator){case AutoScrollActivator.Pointer:return pointerCoordinates?{top:pointerCoordinates.y,bottom:pointerCoordinates.y,left:pointerCoordinates.x,right:pointerCoordinates.x}:null;case AutoScrollActivator.DraggableRect:return draggingRect}}),[activator,draggingRect,pointerCoordinates]),scrollContainerRef=React.useRef(null),autoScroll=React.useCallback((function(){var scrollContainer=scrollContainerRef.current;if(scrollContainer){var scrollLeft=scrollSpeed.current.x*scrollDirection.current.x,scrollTop=scrollSpeed.current.y*scrollDirection.current.y;scrollContainer.scrollBy(scrollLeft,scrollTop)}}),[]),sortedScrollableAncestors=React.useMemo((function(){return order===TraversalOrder.TreeOrder?[].concat(scrollableAncestors).reverse():scrollableAncestors}),[order,scrollableAncestors]);React.useEffect((function(){if(enabled&&scrollableAncestors.length&&rect){for(var _step7,_iterator7=_createForOfIteratorHelperLoose(sortedScrollableAncestors);!(_step7=_iterator7()).done;){var scrollContainer=_step7.value;if(!1!==(null==canScroll?void 0:canScroll(scrollContainer))){var index=scrollableAncestors.indexOf(scrollContainer),scrollContainerRect=scrollableAncestorRects[index];if(scrollContainerRect){for(var _getScrollDirectionAn=getScrollDirectionAndSpeed(scrollContainer,scrollContainerRect,rect,acceleration,threshold),direction=_getScrollDirectionAn.direction,speed=_getScrollDirectionAn.speed,_i2=0,_arr=["x","y"];_i2<_arr.length;_i2++){var axis=_arr[_i2];scrollIntent[axis][direction[axis]]||(speed[axis]=0,direction[axis]=0)}if(speed.x>0||speed.y>0)return clearAutoScrollInterval(),scrollContainerRef.current=scrollContainer,setAutoScrollInterval(autoScroll,interval),scrollSpeed.current=speed,void(scrollDirection.current=direction)}}}scrollSpeed.current={x:0,y:0},scrollDirection.current={x:0,y:0},clearAutoScrollInterval()}else clearAutoScrollInterval()}),[acceleration,autoScroll,canScroll,clearAutoScrollInterval,enabled,interval,JSON.stringify(rect),JSON.stringify(scrollIntent),setAutoScrollInterval,scrollableAncestors,sortedScrollableAncestors,scrollableAncestorRects,JSON.stringify(threshold)])}PointerSensor.activators=[{eventName:"onPointerDown",handler:function(_ref,_ref2){var event=_ref.nativeEvent,onActivation=_ref2.onActivation;return!(!event.isPrimary||0!==event.button)&&(null==onActivation||onActivation({event:event}),!0)}}],function(MouseButton){MouseButton[MouseButton.RightClick=2]="RightClick"}(MouseButton||(MouseButton={})),function(AutoScrollActivator){AutoScrollActivator[AutoScrollActivator.Pointer=0]="Pointer",AutoScrollActivator[AutoScrollActivator.DraggableRect=1]="DraggableRect"}(AutoScrollActivator||(AutoScrollActivator={})),function(TraversalOrder){TraversalOrder[TraversalOrder.TreeOrder=0]="TreeOrder",TraversalOrder[TraversalOrder.ReversedTreeOrder=1]="ReversedTreeOrder"}(TraversalOrder||(TraversalOrder={}));var MeasuringStrategy,MeasuringFrequency,defaultScrollIntent={x:(_x={},_x[Direction.Backward]=!1,_x[Direction.Forward]=!1,_x),y:(_y={},_y[Direction.Backward]=!1,_y[Direction.Forward]=!1,_y)};!function(MeasuringStrategy){MeasuringStrategy[MeasuringStrategy.Always=0]="Always",MeasuringStrategy[MeasuringStrategy.BeforeDragging=1]="BeforeDragging",MeasuringStrategy[MeasuringStrategy.WhileDragging=2]="WhileDragging"}(MeasuringStrategy||(MeasuringStrategy={})),function(MeasuringFrequency){MeasuringFrequency.Optimized="optimized"}(MeasuringFrequency||(MeasuringFrequency={}));var defaultValue=new Map;function useInitialValue(value,computeFn){return useLazyMemo((function(previousValue){return value?previousValue||("function"==typeof computeFn?computeFn(value):value):null}),[computeFn,value])}function useResizeObserver(_ref){var callback=_ref.callback,disabled=_ref.disabled,handleResize=useEvent(callback),resizeObserver=React.useMemo((function(){if(!disabled&&"undefined"!=typeof window&&void 0!==window.ResizeObserver)return new(0,window.ResizeObserver)(handleResize)}),[disabled]);return React.useEffect((function(){return function(){return null==resizeObserver?void 0:resizeObserver.disconnect()}}),[resizeObserver]),resizeObserver}function defaultMeasure(element){return new Rect(getClientRect(element),element)}function useRect(element,measure,fallbackRect){void 0===measure&&(measure=defaultMeasure);var _useState4=React.useState(null),rect=_useState4[0],setRect=_useState4[1];function measureRect(){setRect((function(currentRect){if(!element)return null;var _ref;if(!1===element.isConnected)return null!=(_ref=null!=currentRect?currentRect:fallbackRect)?_ref:null;var newRect=measure(element);return JSON.stringify(currentRect)===JSON.stringify(newRect)?currentRect:newRect}))}var mutationObserver=function(_ref){var callback=_ref.callback,disabled=_ref.disabled,handleMutations=useEvent(callback),mutationObserver=React.useMemo((function(){if(!disabled&&"undefined"!=typeof window&&void 0!==window.MutationObserver)return new(0,window.MutationObserver)(handleMutations)}),[handleMutations,disabled]);return React.useEffect((function(){return function(){return null==mutationObserver?void 0:mutationObserver.disconnect()}}),[mutationObserver]),mutationObserver}({callback:function(records){if(element)for(var _step9,_iterator9=_createForOfIteratorHelperLoose(records);!(_step9=_iterator9()).done;){var record=_step9.value,type=record.type,target=record.target;if("childList"===type&&target instanceof HTMLElement&&target.contains(element)){measureRect();break}}}}),resizeObserver=useResizeObserver({callback:measureRect});return useIsomorphicLayoutEffect((function(){measureRect(),element?(null==resizeObserver||resizeObserver.observe(element),null==mutationObserver||mutationObserver.observe(document.body,{childList:!0,subtree:!0})):(null==resizeObserver||resizeObserver.disconnect(),null==mutationObserver||mutationObserver.disconnect())}),[element]),rect}var defaultValue$1=[];function useScrollOffsetsDelta(scrollOffsets,dependencies){void 0===dependencies&&(dependencies=[]);var initialScrollOffsets=React.useRef(null);return React.useEffect((function(){initialScrollOffsets.current=null}),dependencies),React.useEffect((function(){var hasScrollOffsets=scrollOffsets!==defaultCoordinates;hasScrollOffsets&&!initialScrollOffsets.current&&(initialScrollOffsets.current=scrollOffsets),!hasScrollOffsets&&initialScrollOffsets.current&&(initialScrollOffsets.current=null)}),[scrollOffsets]),initialScrollOffsets.current?subtract(scrollOffsets,initialScrollOffsets.current):defaultCoordinates}function useWindowRect(element){return React.useMemo((function(){return element?function(element){var width=element.innerWidth,height=element.innerHeight;return{top:0,left:0,right:width,bottom:height,width:width,height:height}}(element):null}),[element])}var defaultValue$2=[];function useDragOverlayMeasuring(_ref){var measure=_ref.measure,_useState7=React.useState(null),rect=_useState7[0],setRect=_useState7[1],handleResize=React.useCallback((function(entries){for(var _step11,_loop4=function(){var target=_step11.value.target;if(isHTMLElement(target))return setRect((function(rect){var newRect=measure(target);return rect?_extends({},rect,{width:newRect.width,height:newRect.height}):newRect})),1},_iterator11=_createForOfIteratorHelperLoose(entries);!(_step11=_iterator11()).done&&!_loop4(););}),[measure]),resizeObserver=useResizeObserver({callback:handleResize}),_useNodeRef=useNodeRef(React.useCallback((function(element){var node=function(node){if(!node)return null;if(node.children.length>1)return node;var firstChild=node.children[0];return isHTMLElement(firstChild)?firstChild:node}(element);null==resizeObserver||resizeObserver.disconnect(),node&&(null==resizeObserver||resizeObserver.observe(node)),setRect(node?measure(node):null)}),[measure,resizeObserver])),nodeRef=_useNodeRef[0],setRef=_useNodeRef[1];return React.useMemo((function(){return{nodeRef:nodeRef,rect:rect,setRef:setRef}}),[rect,nodeRef,setRef])}var defaultSensors=[{sensor:PointerSensor,options:{}},{sensor:KeyboardSensor,options:{}}],defaultData={current:{}},defaultMeasuringConfiguration={draggable:{measure:getTransformAgnosticClientRect},droppable:{measure:getTransformAgnosticClientRect,strategy:MeasuringStrategy.WhileDragging,frequency:MeasuringFrequency.Optimized},dragOverlay:{measure:getClientRect}},DroppableContainersMap=function(_Map){function DroppableContainersMap(){return _Map.apply(this,arguments)||this}_inheritsLoose(DroppableContainersMap,_Map);var _proto4=DroppableContainersMap.prototype;return _proto4.get=function(id){var _super$get;return null!=id&&null!=(_super$get=_Map.prototype.get.call(this,id))?_super$get:void 0},_proto4.toArray=function(){return Array.from(this.values())},_proto4.getEnabled=function(){return this.toArray().filter((function(_ref){return!_ref.disabled}))},_proto4.getNodeFor=function(id){var _this$get$node$curren,_this$get;return null!=(_this$get$node$curren=null==(_this$get=this.get(id))?void 0:_this$get.node.current)?_this$get$node$curren:void 0},DroppableContainersMap}(_wrapNativeSuper(Map)),defaultPublicContext={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new DroppableContainersMap,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:noop},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:defaultMeasuringConfiguration,measureDroppableContainers:noop,windowRect:null,measuringScheduled:!1},defaultInternalContext={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:noop,draggableNodes:new Map,over:null,measureDroppableContainers:noop},InternalContext=React.createContext(defaultInternalContext),PublicContext=React.createContext(defaultPublicContext);function getInitialState(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new DroppableContainersMap}}}function reducer(state,action){switch(action.type){case Action.DragStart:return _extends({},state,{draggable:_extends({},state.draggable,{initialCoordinates:action.initialCoordinates,active:action.active})});case Action.DragMove:return null==state.draggable.active?state:_extends({},state,{draggable:_extends({},state.draggable,{translate:{x:action.coordinates.x-state.draggable.initialCoordinates.x,y:action.coordinates.y-state.draggable.initialCoordinates.y}})});case Action.DragEnd:case Action.DragCancel:return _extends({},state,{draggable:_extends({},state.draggable,{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case Action.RegisterDroppable:var element=action.element,id=element.id,containers=new DroppableContainersMap(state.droppable.containers);return containers.set(id,element),_extends({},state,{droppable:_extends({},state.droppable,{containers:containers})});case Action.SetDroppableDisabled:var _id=action.id,_key2=action.key,disabled=action.disabled,_element=state.droppable.containers.get(_id);if(!_element||_key2!==_element.key)return state;var _containers=new DroppableContainersMap(state.droppable.containers);return _containers.set(_id,_extends({},_element,{disabled:disabled})),_extends({},state,{droppable:_extends({},state.droppable,{containers:_containers})});case Action.UnregisterDroppable:var _id2=action.id,_key3=action.key,_element2=state.droppable.containers.get(_id2);if(!_element2||_key3!==_element2.key)return state;var _containers2=new DroppableContainersMap(state.droppable.containers);return _containers2.delete(_id2),_extends({},state,{droppable:_extends({},state.droppable,{containers:_containers2})});default:return state}}function RestoreFocus(_ref){var disabled=_ref.disabled,_useContext=React.useContext(InternalContext),active=_useContext.active,activatorEvent=_useContext.activatorEvent,draggableNodes=_useContext.draggableNodes,previousActivatorEvent=usePrevious(activatorEvent),previousActiveId=usePrevious(null==active?void 0:active.id);return React.useEffect((function(){if(!disabled&&!activatorEvent&&previousActivatorEvent&&null!=previousActiveId){if(!isKeyboardEvent(previousActivatorEvent))return;if(document.activeElement===previousActivatorEvent.target)return;var draggableNode=draggableNodes.get(previousActiveId);if(!draggableNode)return;var activatorNode=draggableNode.activatorNode,node=draggableNode.node;if(!activatorNode.current&&!node.current)return;requestAnimationFrame((function(){for(var _i3=0,_arr2=[activatorNode.current,node.current];_i3<_arr2.length;_i3++){var element=_arr2[_i3];if(element){var focusableNode=findFirstFocusableNode(element);if(focusableNode){focusableNode.focus();break}}}}))}}),[activatorEvent,disabled,draggableNodes,previousActiveId,previousActivatorEvent]),null}var Status,ActiveDraggableContext=React.createContext(_extends({},defaultCoordinates,{scaleX:1,scaleY:1}));!function(Status){Status[Status.Uninitialized=0]="Uninitialized",Status[Status.Initializing=1]="Initializing",Status[Status.Initialized=2]="Initialized"}(Status||(Status={}));var DndContext=React.memo((function(_ref){var _sensorContext$curren,_dragOverlay$nodeRef$,_dragOverlay$rect,_over$rect,listeners,registerListener,config,id=_ref.id,accessibility=_ref.accessibility,_ref$autoScroll=_ref.autoScroll,autoScroll=void 0===_ref$autoScroll||_ref$autoScroll,children=_ref.children,_ref$sensors=_ref.sensors,sensors=void 0===_ref$sensors?defaultSensors:_ref$sensors,_ref$collisionDetecti=_ref.collisionDetection,collisionDetection=void 0===_ref$collisionDetecti?rectIntersection:_ref$collisionDetecti,measuring=_ref.measuring,modifiers=_ref.modifiers,props=_objectWithoutPropertiesLoose(_ref,_excluded2),store=React.useReducer(reducer,void 0,getInitialState),state=store[0],dispatch=store[1],_useDndMonitorProvide=(listeners=React.useState((function(){return new Set}))[0],registerListener=React.useCallback((function(listener){return listeners.add(listener),function(){return listeners.delete(listener)}}),[listeners]),[React.useCallback((function(_ref){var type=_ref.type,event=_ref.event;listeners.forEach((function(listener){var _listener$type;return null==(_listener$type=listener[type])?void 0:_listener$type.call(listener,event)}))}),[listeners]),registerListener]),dispatchMonitorEvent=_useDndMonitorProvide[0],registerMonitorListener=_useDndMonitorProvide[1],_useState8=React.useState(Status.Uninitialized),status=_useState8[0],setStatus=_useState8[1],isInitialized=status===Status.Initialized,_state$draggable=state.draggable,activeId=_state$draggable.active,draggableNodes=_state$draggable.nodes,translate=_state$draggable.translate,droppableContainers=state.droppable.containers,node=null!=activeId?draggableNodes.get(activeId):null,activeRects=React.useRef({initial:null,translated:null}),active=React.useMemo((function(){var _node$data;return null!=activeId?{id:activeId,data:null!=(_node$data=null==node?void 0:node.data)?_node$data:defaultData,rect:activeRects}:null}),[activeId,node]),activeRef=React.useRef(null),_useState9=React.useState(null),activeSensor=_useState9[0],setActiveSensor=_useState9[1],_useState10=React.useState(null),activatorEvent=_useState10[0],setActivatorEvent=_useState10[1],latestProps=useLatestValue(props,Object.values(props)),draggableDescribedById=useUniqueId("DndDescribedBy",id),enabledDroppableContainers=React.useMemo((function(){return droppableContainers.getEnabled()}),[droppableContainers]),measuringConfiguration=(config=measuring,React.useMemo((function(){return{draggable:_extends({},defaultMeasuringConfiguration.draggable,null==config?void 0:config.draggable),droppable:_extends({},defaultMeasuringConfiguration.droppable,null==config?void 0:config.droppable),dragOverlay:_extends({},defaultMeasuringConfiguration.dragOverlay,null==config?void 0:config.dragOverlay)}}),[null==config?void 0:config.draggable,null==config?void 0:config.droppable,null==config?void 0:config.dragOverlay])),_useDroppableMeasurin=function(containers,_ref){var dragging=_ref.dragging,dependencies=_ref.dependencies,config=_ref.config,_useState3=React.useState(null),queue=_useState3[0],setQueue=_useState3[1],frequency=config.frequency,measure=config.measure,strategy=config.strategy,containersRef=React.useRef(containers),disabled=function(){switch(strategy){case MeasuringStrategy.Always:return!1;case MeasuringStrategy.BeforeDragging:return dragging;default:return!dragging}}(),disabledRef=useLatestValue(disabled),measureDroppableContainers=React.useCallback((function(ids){void 0===ids&&(ids=[]),disabledRef.current||setQueue((function(value){return null===value?ids:value.concat(ids.filter((function(id){return!value.includes(id)})))}))}),[disabledRef]),timeoutId=React.useRef(null),droppableRects=useLazyMemo((function(previousValue){if(disabled&&!dragging)return defaultValue;if(!previousValue||previousValue===defaultValue||containersRef.current!==containers||null!=queue){for(var _step8,map=new Map,_iterator8=_createForOfIteratorHelperLoose(containers);!(_step8=_iterator8()).done;){var container=_step8.value;if(container)if(queue&&queue.length>0&&!queue.includes(container.id)&&container.rect.current)map.set(container.id,container.rect.current);else{var node=container.node.current,rect=node?new Rect(measure(node),node):null;container.rect.current=rect,rect&&map.set(container.id,rect)}}return map}return previousValue}),[containers,queue,dragging,disabled,measure]);return React.useEffect((function(){containersRef.current=containers}),[containers]),React.useEffect((function(){disabled||measureDroppableContainers()}),[dragging,disabled]),React.useEffect((function(){queue&&queue.length>0&&setQueue(null)}),[JSON.stringify(queue)]),React.useEffect((function(){disabled||"number"!=typeof frequency||null!==timeoutId.current||(timeoutId.current=setTimeout((function(){measureDroppableContainers(),timeoutId.current=null}),frequency))}),[frequency,disabled,measureDroppableContainers].concat(dependencies)),{droppableRects:droppableRects,measureDroppableContainers:measureDroppableContainers,measuringScheduled:null!=queue}}(enabledDroppableContainers,{dragging:isInitialized,dependencies:[translate.x,translate.y],config:measuringConfiguration.droppable}),droppableRects=_useDroppableMeasurin.droppableRects,measureDroppableContainers=_useDroppableMeasurin.measureDroppableContainers,measuringScheduled=_useDroppableMeasurin.measuringScheduled,activeNode=function(draggableNodes,id){var draggableNode=null!=id?draggableNodes.get(id):void 0,node=draggableNode?draggableNode.node.current:null;return useLazyMemo((function(cachedNode){var _ref;return null==id?null:null!=(_ref=null!=node?node:cachedNode)?_ref:null}),[node,id])}(draggableNodes,activeId),activationCoordinates=React.useMemo((function(){return activatorEvent?getEventCoordinates(activatorEvent):null}),[activatorEvent]),autoScrollOptions=function(){var activeSensorDisablesAutoscroll=!1===(null==activeSensor?void 0:activeSensor.autoScrollEnabled),autoScrollGloballyDisabled="object"==typeof autoScroll?!1===autoScroll.enabled:!1===autoScroll,enabled=isInitialized&&!activeSensorDisablesAutoscroll&&!autoScrollGloballyDisabled;if("object"==typeof autoScroll)return _extends({},autoScroll,{enabled:enabled});return{enabled:enabled}}(),initialActiveNodeRect=function(node,measure){return useInitialValue(node,measure)}(activeNode,measuringConfiguration.draggable.measure);!function(_ref){var activeNode=_ref.activeNode,measure=_ref.measure,initialRect=_ref.initialRect,_ref$config=_ref.config,config=void 0===_ref$config||_ref$config,initialized=React.useRef(!1),_ref7="boolean"==typeof config?{x:config,y:config}:config,x=_ref7.x,y=_ref7.y;useIsomorphicLayoutEffect((function(){if((x||y)&&activeNode){if(!initialized.current&&initialRect){var node=null==activeNode?void 0:activeNode.node.current;if(node&&!1!==node.isConnected){var rectDelta=getRectDelta(measure(node),initialRect);if(x||(rectDelta.x=0),y||(rectDelta.y=0),initialized.current=!0,Math.abs(rectDelta.x)>0||Math.abs(rectDelta.y)>0){var firstScrollableAncestor=getFirstScrollableAncestor(node);firstScrollableAncestor&&firstScrollableAncestor.scrollBy({top:rectDelta.y,left:rectDelta.x})}}}}else initialized.current=!1}),[activeNode,x,y,initialRect,measure])}({activeNode:null!=activeId?draggableNodes.get(activeId):null,config:autoScrollOptions.layoutShiftCompensation,initialRect:initialActiveNodeRect,measure:measuringConfiguration.draggable.measure});var rect,activeNodeRect=useRect(activeNode,measuringConfiguration.draggable.measure,initialActiveNodeRect),containerNodeRect=useRect(activeNode?activeNode.parentElement:null),sensorContext=React.useRef({activatorEvent:null,active:null,activeNode:activeNode,collisionRect:null,collisions:null,droppableRects:droppableRects,draggableNodes:draggableNodes,draggingNode:null,draggingNodeRect:null,droppableContainers:droppableContainers,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),overNode=droppableContainers.getNodeFor(null==(_sensorContext$curren=sensorContext.current.over)?void 0:_sensorContext$curren.id),dragOverlay=useDragOverlayMeasuring({measure:measuringConfiguration.dragOverlay.measure}),draggingNode=null!=(_dragOverlay$nodeRef$=dragOverlay.nodeRef.current)?_dragOverlay$nodeRef$:activeNode,draggingNodeRect=isInitialized?null!=(_dragOverlay$rect=dragOverlay.rect)?_dragOverlay$rect:activeNodeRect:null,usesDragOverlay=Boolean(dragOverlay.nodeRef.current&&dragOverlay.rect),nodeRectDelta=getRectDelta(rect=usesDragOverlay?null:activeNodeRect,useInitialValue(rect)),windowRect=useWindowRect(draggingNode?getWindow(draggingNode):null),scrollableAncestors=function(node){var previousNode=React.useRef(node),ancestors=useLazyMemo((function(previousValue){return node?previousValue&&previousValue!==defaultValue$1&&node&&previousNode.current&&node.parentNode===previousNode.current.parentNode?previousValue:getScrollableAncestors(node):defaultValue$1}),[node]);return React.useEffect((function(){previousNode.current=node}),[node]),ancestors}(isInitialized?null!=overNode?overNode:activeNode:null),scrollableAncestorRects=function(elements,measure){void 0===measure&&(measure=getClientRect);var firstElement=elements[0],windowRect=useWindowRect(firstElement?getWindow(firstElement):null),_useState6=React.useState(defaultValue$2),rects=_useState6[0],setRects=_useState6[1];function measureRects(){setRects((function(){return elements.length?elements.map((function(element){return isDocumentScrollingElement(element)?windowRect:new Rect(measure(element),element)})):defaultValue$2}))}var resizeObserver=useResizeObserver({callback:measureRects});return useIsomorphicLayoutEffect((function(){null==resizeObserver||resizeObserver.disconnect(),measureRects(),elements.forEach((function(element){return null==resizeObserver?void 0:resizeObserver.observe(element)}))}),[elements]),rects}(scrollableAncestors),modifiedTranslate=function(modifiers,_ref){var transform=_ref.transform,args=_objectWithoutPropertiesLoose(_ref,_excluded);return null!=modifiers&&modifiers.length?modifiers.reduce((function(accumulator,modifier){return modifier(_extends({transform:accumulator},args))}),transform):transform}(modifiers,{transform:{x:translate.x-nodeRectDelta.x,y:translate.y-nodeRectDelta.y,scaleX:1,scaleY:1},activatorEvent:activatorEvent,active:active,activeNodeRect:activeNodeRect,containerNodeRect:containerNodeRect,draggingNodeRect:draggingNodeRect,over:sensorContext.current.over,overlayNodeRect:dragOverlay.rect,scrollableAncestors:scrollableAncestors,scrollableAncestorRects:scrollableAncestorRects,windowRect:windowRect}),pointerCoordinates=activationCoordinates?add(activationCoordinates,translate):null,scrollOffsets=function(elements){var _useState5=React.useState(null),scrollCoordinates=_useState5[0],setScrollCoordinates=_useState5[1],prevElements=React.useRef(elements),handleScroll=React.useCallback((function(event){var scrollingElement=getScrollableElement(event.target);scrollingElement&&setScrollCoordinates((function(scrollCoordinates){return scrollCoordinates?(scrollCoordinates.set(scrollingElement,getScrollCoordinates(scrollingElement)),new Map(scrollCoordinates)):null}))}),[]);return React.useEffect((function(){var previousElements=prevElements.current;if(elements!==previousElements){cleanup(previousElements);var entries=elements.map((function(element){var scrollableElement=getScrollableElement(element);return scrollableElement?(scrollableElement.addEventListener("scroll",handleScroll,{passive:!0}),[scrollableElement,getScrollCoordinates(scrollableElement)]):null})).filter((function(entry){return null!=entry}));setScrollCoordinates(entries.length?new Map(entries):null),prevElements.current=elements}return function(){cleanup(elements),cleanup(previousElements)};function cleanup(elements){elements.forEach((function(element){var scrollableElement=getScrollableElement(element);null==scrollableElement||scrollableElement.removeEventListener("scroll",handleScroll)}))}}),[handleScroll,elements]),React.useMemo((function(){return elements.length?scrollCoordinates?Array.from(scrollCoordinates.values()).reduce((function(acc,coordinates){return add(acc,coordinates)}),defaultCoordinates):getScrollOffsets(elements):defaultCoordinates}),[elements,scrollCoordinates])}(scrollableAncestors),scrollAdjustment=useScrollOffsetsDelta(scrollOffsets),activeNodeScrollDelta=useScrollOffsetsDelta(scrollOffsets,[activeNodeRect]),scrollAdjustedTranslate=add(modifiedTranslate,scrollAdjustment),collisionRect=draggingNodeRect?getAdjustedRect(draggingNodeRect,modifiedTranslate):null,collisions=active&&collisionRect?collisionDetection({active:active,collisionRect:collisionRect,droppableRects:droppableRects,droppableContainers:enabledDroppableContainers,pointerCoordinates:pointerCoordinates}):null,overId=getFirstCollision(collisions,"id"),_useState11=React.useState(null),over=_useState11[0],setOver=_useState11[1],transform=function(transform,rect1,rect2){return _extends({},transform,{scaleX:rect1&&rect2?rect1.width/rect2.width:1,scaleY:rect1&&rect2?rect1.height/rect2.height:1})}(usesDragOverlay?modifiedTranslate:add(modifiedTranslate,activeNodeScrollDelta),null!=(_over$rect=null==over?void 0:over.rect)?_over$rect:null,activeNodeRect),activeSensorRef=React.useRef(null),instantiateSensor=React.useCallback((function(event,_ref2){var Sensor=_ref2.sensor,options=_ref2.options;if(null!=activeRef.current){var activeNode=draggableNodes.get(activeRef.current);if(activeNode){var activatorEvent=event.nativeEvent,sensorInstance=new Sensor({active:activeRef.current,activeNode:activeNode,event:activatorEvent,options:options,context:sensorContext,onAbort:function(id){if(draggableNodes.get(id)){var onDragAbort=latestProps.current.onDragAbort,event={id:id};null==onDragAbort||onDragAbort(event),dispatchMonitorEvent({type:"onDragAbort",event:event})}},onPending:function(id,constraint,initialCoordinates,offset){if(draggableNodes.get(id)){var onDragPending=latestProps.current.onDragPending,event={id:id,constraint:constraint,initialCoordinates:initialCoordinates,offset:offset};null==onDragPending||onDragPending(event),dispatchMonitorEvent({type:"onDragPending",event:event})}},onStart:function(initialCoordinates){var id=activeRef.current;if(null!=id){var draggableNode=draggableNodes.get(id);if(draggableNode){var onDragStart=latestProps.current.onDragStart,event={activatorEvent:activatorEvent,active:{id:id,data:draggableNode.data,rect:activeRects}};reactDom.unstable_batchedUpdates((function(){null==onDragStart||onDragStart(event),setStatus(Status.Initializing),dispatch({type:Action.DragStart,initialCoordinates:initialCoordinates,active:id}),dispatchMonitorEvent({type:"onDragStart",event:event}),setActiveSensor(activeSensorRef.current),setActivatorEvent(activatorEvent)}))}}},onMove:function(coordinates){dispatch({type:Action.DragMove,coordinates:coordinates})},onEnd:createHandler(Action.DragEnd),onCancel:createHandler(Action.DragCancel)});activeSensorRef.current=sensorInstance}}function createHandler(type){return function(){var fn,_handler=(fn=_regeneratorRuntime().mark((function _callee(){var _sensorContext$curren2,active,collisions,over,scrollAdjustedTranslate,event,cancelDrop;return _regeneratorRuntime().wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_sensorContext$curren2=sensorContext.current,active=_sensorContext$curren2.active,collisions=_sensorContext$curren2.collisions,over=_sensorContext$curren2.over,scrollAdjustedTranslate=_sensorContext$curren2.scrollAdjustedTranslate,event=null,!active||!scrollAdjustedTranslate){_context.next=10;break}if(cancelDrop=latestProps.current.cancelDrop,event={activatorEvent:activatorEvent,active:active,collisions:collisions,delta:scrollAdjustedTranslate,over:over},type!==Action.DragEnd||"function"!=typeof cancelDrop){_context.next=10;break}return _context.next=8,Promise.resolve(cancelDrop(event));case 8:_context.sent&&(type=Action.DragCancel);case 10:activeRef.current=null,reactDom.unstable_batchedUpdates((function(){dispatch({type:type}),setStatus(Status.Uninitialized),setOver(null),setActiveSensor(null),setActivatorEvent(null),activeSensorRef.current=null;var eventName=type===Action.DragEnd?"onDragEnd":"onDragCancel";if(event){var _handler2=latestProps.current[eventName];null==_handler2||_handler2(event),dispatchMonitorEvent({type:eventName,event:event})}}));case 12:case"end":return _context.stop()}}),_callee)})),function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))});return function(){return _handler.apply(this,arguments)}}()}}),[draggableNodes]),bindActivatorToSensorInstantiator=React.useCallback((function(handler,sensor){return function(event,active){var nativeEvent=event.nativeEvent,activeDraggableNode=draggableNodes.get(active);if(null===activeRef.current&&activeDraggableNode&&!nativeEvent.dndKit&&!nativeEvent.defaultPrevented){var activationContext={active:activeDraggableNode};!0===handler(event,sensor.options,activationContext)&&(nativeEvent.dndKit={capturedBy:sensor.sensor},activeRef.current=active,instantiateSensor(event,sensor))}}}),[draggableNodes,instantiateSensor]),activators=function(sensors,getSyntheticHandler){return React.useMemo((function(){return sensors.reduce((function(accumulator,sensor){var sensorActivators=sensor.sensor.activators.map((function(activator){return{eventName:activator.eventName,handler:getSyntheticHandler(activator.handler,sensor)}}));return[].concat(accumulator,sensorActivators)}),[])}),[sensors,getSyntheticHandler])}(sensors,bindActivatorToSensorInstantiator);!function(sensors){React.useEffect((function(){if(canUseDOM){var teardownFns=sensors.map((function(_ref){var sensor=_ref.sensor;return null==sensor.setup?void 0:sensor.setup()}));return function(){for(var _step10,_iterator10=_createForOfIteratorHelperLoose(teardownFns);!(_step10=_iterator10()).done;){var teardown=_step10.value;null==teardown||teardown()}}}}),sensors.map((function(_ref2){return _ref2.sensor})))}(sensors),useIsomorphicLayoutEffect((function(){activeNodeRect&&status===Status.Initializing&&setStatus(Status.Initialized)}),[activeNodeRect,status]),React.useEffect((function(){var onDragMove=latestProps.current.onDragMove,_sensorContext$curren3=sensorContext.current,active=_sensorContext$curren3.active,activatorEvent=_sensorContext$curren3.activatorEvent,collisions=_sensorContext$curren3.collisions,over=_sensorContext$curren3.over;if(active&&activatorEvent){var event={active:active,activatorEvent:activatorEvent,collisions:collisions,delta:{x:scrollAdjustedTranslate.x,y:scrollAdjustedTranslate.y},over:over};reactDom.unstable_batchedUpdates((function(){null==onDragMove||onDragMove(event),dispatchMonitorEvent({type:"onDragMove",event:event})}))}}),[scrollAdjustedTranslate.x,scrollAdjustedTranslate.y]),React.useEffect((function(){var _sensorContext$curren4=sensorContext.current,active=_sensorContext$curren4.active,activatorEvent=_sensorContext$curren4.activatorEvent,collisions=_sensorContext$curren4.collisions,droppableContainers=_sensorContext$curren4.droppableContainers,scrollAdjustedTranslate=_sensorContext$curren4.scrollAdjustedTranslate;if(active&&null!=activeRef.current&&activatorEvent&&scrollAdjustedTranslate){var onDragOver=latestProps.current.onDragOver,overContainer=droppableContainers.get(overId),over=overContainer&&overContainer.rect.current?{id:overContainer.id,rect:overContainer.rect.current,data:overContainer.data,disabled:overContainer.disabled}:null,event={active:active,activatorEvent:activatorEvent,collisions:collisions,delta:{x:scrollAdjustedTranslate.x,y:scrollAdjustedTranslate.y},over:over};reactDom.unstable_batchedUpdates((function(){setOver(over),null==onDragOver||onDragOver(event),dispatchMonitorEvent({type:"onDragOver",event:event})}))}}),[overId]),useIsomorphicLayoutEffect((function(){sensorContext.current={activatorEvent:activatorEvent,active:active,activeNode:activeNode,collisionRect:collisionRect,collisions:collisions,droppableRects:droppableRects,draggableNodes:draggableNodes,draggingNode:draggingNode,draggingNodeRect:draggingNodeRect,droppableContainers:droppableContainers,over:over,scrollableAncestors:scrollableAncestors,scrollAdjustedTranslate:scrollAdjustedTranslate},activeRects.current={initial:draggingNodeRect,translated:collisionRect}}),[active,activeNode,collisions,collisionRect,draggableNodes,draggingNode,draggingNodeRect,droppableRects,droppableContainers,over,scrollableAncestors,scrollAdjustedTranslate]),useAutoScroller(_extends({},autoScrollOptions,{delta:translate,draggingRect:collisionRect,pointerCoordinates:pointerCoordinates,scrollableAncestors:scrollableAncestors,scrollableAncestorRects:scrollableAncestorRects}));var publicContext=React.useMemo((function(){return{active:active,activeNode:activeNode,activeNodeRect:activeNodeRect,activatorEvent:activatorEvent,collisions:collisions,containerNodeRect:containerNodeRect,dragOverlay:dragOverlay,draggableNodes:draggableNodes,droppableContainers:droppableContainers,droppableRects:droppableRects,over:over,measureDroppableContainers:measureDroppableContainers,scrollableAncestors:scrollableAncestors,scrollableAncestorRects:scrollableAncestorRects,measuringConfiguration:measuringConfiguration,measuringScheduled:measuringScheduled,windowRect:windowRect}}),[active,activeNode,activeNodeRect,activatorEvent,collisions,containerNodeRect,dragOverlay,draggableNodes,droppableContainers,droppableRects,over,measureDroppableContainers,scrollableAncestors,scrollableAncestorRects,measuringConfiguration,measuringScheduled,windowRect]),internalContext=React.useMemo((function(){return{activatorEvent:activatorEvent,activators:activators,active:active,activeNodeRect:activeNodeRect,ariaDescribedById:{draggable:draggableDescribedById},dispatch:dispatch,draggableNodes:draggableNodes,over:over,measureDroppableContainers:measureDroppableContainers}}),[activatorEvent,activators,active,activeNodeRect,dispatch,draggableDescribedById,draggableNodes,over,measureDroppableContainers]);return React.createElement(DndMonitorContext.Provider,{value:registerMonitorListener},React.createElement(InternalContext.Provider,{value:internalContext},React.createElement(PublicContext.Provider,{value:publicContext},React.createElement(ActiveDraggableContext.Provider,{value:transform},children)),React.createElement(RestoreFocus,{disabled:!1===(null==accessibility?void 0:accessibility.restoreFocus)})),React.createElement(Accessibility,_extends({},accessibility,{hiddenTextDescribedById:draggableDescribedById})))})),NullContext=React.createContext(null);function useDraggable(_ref){var id=_ref.id,data=_ref.data,_ref$disabled=_ref.disabled,disabled=void 0!==_ref$disabled&&_ref$disabled,attributes=_ref.attributes,key=useUniqueId("Draggable"),_useContext2=React.useContext(InternalContext),activators=_useContext2.activators,activatorEvent=_useContext2.activatorEvent,active=_useContext2.active,activeNodeRect=_useContext2.activeNodeRect,ariaDescribedById=_useContext2.ariaDescribedById,draggableNodes=_useContext2.draggableNodes,over=_useContext2.over,_ref8=null!=attributes?attributes:{},_ref8$role=_ref8.role,role=void 0===_ref8$role?"button":_ref8$role,_ref8$roleDescription=_ref8.roleDescription,roleDescription=void 0===_ref8$roleDescription?"draggable":_ref8$roleDescription,_ref8$tabIndex=_ref8.tabIndex,tabIndex=void 0===_ref8$tabIndex?0:_ref8$tabIndex,isDragging=(null==active?void 0:active.id)===id,transform=React.useContext(isDragging?ActiveDraggableContext:NullContext),_useNodeRef2=useNodeRef(),node=_useNodeRef2[0],setNodeRef=_useNodeRef2[1],_useNodeRef3=useNodeRef(),activatorNode=_useNodeRef3[0],setActivatorNodeRef=_useNodeRef3[1],listeners=function(listeners,id){return React.useMemo((function(){return listeners.reduce((function(acc,_ref){var eventName=_ref.eventName,handler=_ref.handler;return acc[eventName]=function(event){handler(event,id)},acc}),{})}),[listeners,id])}(activators,id),dataRef=useLatestValue(data);return useIsomorphicLayoutEffect((function(){return draggableNodes.set(id,{id:id,key:key,node:node,activatorNode:activatorNode,data:dataRef}),function(){var node=draggableNodes.get(id);node&&node.key===key&&draggableNodes.delete(id)}}),[draggableNodes,id]),{active:active,activatorEvent:activatorEvent,activeNodeRect:activeNodeRect,attributes:React.useMemo((function(){return{role:role,tabIndex:tabIndex,"aria-disabled":disabled,"aria-pressed":!(!isDragging||"button"!==role)||void 0,"aria-roledescription":roleDescription,"aria-describedby":ariaDescribedById.draggable}}),[disabled,role,tabIndex,isDragging,roleDescription,ariaDescribedById.draggable]),isDragging:isDragging,listeners:disabled?void 0:listeners,node:node,over:over,setNodeRef:setNodeRef,setActivatorNodeRef:setActivatorNodeRef,transform:transform}}var defaultResizeObserverConfig={timeout:25};function arrayMove(array,from,to){var newArray=array.slice();return newArray.splice(to<0?newArray.length+to:to,0,newArray.splice(from,1)[0]),newArray}function getSortedRects(items,rects){return items.reduce((function(accumulator,id,index){var rect=rects.get(id);return rect&&(accumulator[index]=rect),accumulator}),Array(items.length))}function isValidIndex(index){return null!==index&&index>=0}var rectSortingStrategy=function(_ref){var rects=_ref.rects,activeIndex=_ref.activeIndex,overIndex=_ref.overIndex,index=_ref.index,newRects=arrayMove(rects,overIndex,activeIndex),oldRect=rects[index],newRect=newRects[index];return newRect&&oldRect?{x:newRect.left-oldRect.left,y:newRect.top-oldRect.top,scaleX:newRect.width/oldRect.width,scaleY:newRect.height/oldRect.height}:null},defaultScale$1={scaleX:1,scaleY:1},verticalListSortingStrategy=function(_ref){var _rects$activeIndex,activeIndex=_ref.activeIndex,fallbackActiveRect=_ref.activeNodeRect,index=_ref.index,rects=_ref.rects,overIndex=_ref.overIndex,activeNodeRect=null!=(_rects$activeIndex=rects[activeIndex])?_rects$activeIndex:fallbackActiveRect;if(!activeNodeRect)return null;if(index===activeIndex){var overIndexRect=rects[overIndex];return overIndexRect?_extends({x:0,y:activeIndex<overIndex?overIndexRect.top+overIndexRect.height-(activeNodeRect.top+activeNodeRect.height):overIndexRect.top-activeNodeRect.top},defaultScale$1):null}var itemGap=function(clientRects,index,activeIndex){var currentRect=clientRects[index],previousRect=clientRects[index-1],nextRect=clientRects[index+1];if(!currentRect)return 0;if(activeIndex<index)return previousRect?currentRect.top-(previousRect.top+previousRect.height):nextRect?nextRect.top-(currentRect.top+currentRect.height):0;return nextRect?nextRect.top-(currentRect.top+currentRect.height):previousRect?currentRect.top-(previousRect.top+previousRect.height):0}(rects,index,activeIndex);return _extends(index>activeIndex&&index<=overIndex?{x:0,y:-activeNodeRect.height-itemGap}:index<activeIndex&&index>=overIndex?{x:0,y:activeNodeRect.height+itemGap}:{x:0,y:0},defaultScale$1)};var Context=React.createContext({activeIndex:-1,containerId:"Sortable",disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:rectSortingStrategy,disabled:{draggable:!1,droppable:!1}});function SortableContext(_ref){var children=_ref.children,id=_ref.id,userDefinedItems=_ref.items,_ref$strategy=_ref.strategy,strategy=void 0===_ref$strategy?rectSortingStrategy:_ref$strategy,_ref$disabled=_ref.disabled,disabledProp=void 0!==_ref$disabled&&_ref$disabled,_useDndContext=React.useContext(PublicContext),active=_useDndContext.active,dragOverlay=_useDndContext.dragOverlay,droppableRects=_useDndContext.droppableRects,over=_useDndContext.over,measureDroppableContainers=_useDndContext.measureDroppableContainers,containerId=useUniqueId("Sortable",id),useDragOverlay=Boolean(null!==dragOverlay.rect),items=React.useMemo((function(){return userDefinedItems.map((function(item){return"object"==typeof item&&"id"in item?item.id:item}))}),[userDefinedItems]),isDragging=null!=active,activeIndex=active?items.indexOf(active.id):-1,overIndex=over?items.indexOf(over.id):-1,previousItemsRef=React.useRef(items),itemsHaveChanged=!function(a,b){if(a===b)return!0;if(a.length!==b.length)return!1;for(var i=0;i<a.length;i++)if(a[i]!==b[i])return!1;return!0}(items,previousItemsRef.current),disableTransforms=-1!==overIndex&&-1===activeIndex||itemsHaveChanged,disabled=function(disabled){return"boolean"==typeof disabled?{draggable:disabled,droppable:disabled}:disabled}(disabledProp);useIsomorphicLayoutEffect((function(){itemsHaveChanged&&isDragging&&measureDroppableContainers(items)}),[itemsHaveChanged,items,isDragging,measureDroppableContainers]),React.useEffect((function(){previousItemsRef.current=items}),[items]);var contextValue=React.useMemo((function(){return{activeIndex:activeIndex,containerId:containerId,disabled:disabled,disableTransforms:disableTransforms,items:items,overIndex:overIndex,useDragOverlay:useDragOverlay,sortedRects:getSortedRects(items,droppableRects),strategy:strategy}}),[activeIndex,containerId,disabled.draggable,disabled.droppable,disableTransforms,items,overIndex,droppableRects,useDragOverlay,strategy]);return React.createElement(Context.Provider,{value:contextValue},children)}var defaultNewIndexGetter=function(_ref){var id=_ref.id;return arrayMove(_ref.items,_ref.activeIndex,_ref.overIndex).indexOf(id)},defaultAnimateLayoutChanges=function(_ref2){var containerId=_ref2.containerId,isSorting=_ref2.isSorting,wasDragging=_ref2.wasDragging,index=_ref2.index,items=_ref2.items,newIndex=_ref2.newIndex,previousItems=_ref2.previousItems,previousContainerId=_ref2.previousContainerId;return!(!_ref2.transition||!wasDragging)&&((previousItems===items||index!==newIndex)&&(!!isSorting||newIndex!==index&&containerId===previousContainerId))},defaultTransition={duration:200,easing:"ease"},disabledTransition=CSS.Transition.toString({property:"transform",duration:0,easing:"linear"}),defaultAttributes={roleDescription:"sortable"};function useSortable(_ref){var _ref$animateLayoutCha=_ref.animateLayoutChanges,animateLayoutChanges=void 0===_ref$animateLayoutCha?defaultAnimateLayoutChanges:_ref$animateLayoutCha,userDefinedAttributes=_ref.attributes,localDisabled=_ref.disabled,customData=_ref.data,_ref$getNewIndex=_ref.getNewIndex,getNewIndex=void 0===_ref$getNewIndex?defaultNewIndexGetter:_ref$getNewIndex,id=_ref.id,localStrategy=_ref.strategy,resizeObserverConfig=_ref.resizeObserverConfig,_ref$transition=_ref.transition,transition=void 0===_ref$transition?defaultTransition:_ref$transition,_useContext=React.useContext(Context),items=_useContext.items,containerId=_useContext.containerId,activeIndex=_useContext.activeIndex,globalDisabled=_useContext.disabled,disableTransforms=_useContext.disableTransforms,sortedRects=_useContext.sortedRects,overIndex=_useContext.overIndex,useDragOverlay=_useContext.useDragOverlay,globalStrategy=_useContext.strategy,disabled=function(localDisabled,globalDisabled){var _localDisabled$dragga,_localDisabled$droppa;if("boolean"==typeof localDisabled)return{draggable:localDisabled,droppable:!1};return{draggable:null!=(_localDisabled$dragga=null==localDisabled?void 0:localDisabled.draggable)?_localDisabled$dragga:globalDisabled.draggable,droppable:null!=(_localDisabled$droppa=null==localDisabled?void 0:localDisabled.droppable)?_localDisabled$droppa:globalDisabled.droppable}}(localDisabled,globalDisabled),index=items.indexOf(id),data=React.useMemo((function(){return _extends({sortable:{containerId:containerId,index:index,items:items}},customData)}),[containerId,customData,index,items]),itemsAfterCurrentSortable=React.useMemo((function(){return items.slice(items.indexOf(id))}),[items,id]),_useDroppable=function(_ref){var data=_ref.data,_ref$disabled2=_ref.disabled,disabled=void 0!==_ref$disabled2&&_ref$disabled2,id=_ref.id,resizeObserverConfig=_ref.resizeObserverConfig,key=useUniqueId("Droppable"),_useContext3=React.useContext(InternalContext),active=_useContext3.active,dispatch=_useContext3.dispatch,over=_useContext3.over,measureDroppableContainers=_useContext3.measureDroppableContainers,previous=React.useRef({disabled:disabled}),resizeObserverConnected=React.useRef(!1),rect=React.useRef(null),callbackId=React.useRef(null),_defaultResizeObserve=_extends({},defaultResizeObserverConfig,resizeObserverConfig),resizeObserverDisabled=_defaultResizeObserve.disabled,updateMeasurementsFor=_defaultResizeObserve.updateMeasurementsFor,resizeObserverTimeout=_defaultResizeObserve.timeout,ids=useLatestValue(null!=updateMeasurementsFor?updateMeasurementsFor:id),resizeObserver=useResizeObserver({callback:React.useCallback((function(){resizeObserverConnected.current?(null!=callbackId.current&&clearTimeout(callbackId.current),callbackId.current=setTimeout((function(){measureDroppableContainers(Array.isArray(ids.current)?ids.current:[ids.current]),callbackId.current=null}),resizeObserverTimeout)):resizeObserverConnected.current=!0}),[resizeObserverTimeout]),disabled:resizeObserverDisabled||!active}),_useNodeRef4=useNodeRef(React.useCallback((function(newElement,previousElement){resizeObserver&&(previousElement&&(resizeObserver.unobserve(previousElement),resizeObserverConnected.current=!1),newElement&&resizeObserver.observe(newElement))}),[resizeObserver])),nodeRef=_useNodeRef4[0],setNodeRef=_useNodeRef4[1],dataRef=useLatestValue(data);return React.useEffect((function(){resizeObserver&&nodeRef.current&&(resizeObserver.disconnect(),resizeObserverConnected.current=!1,resizeObserver.observe(nodeRef.current))}),[nodeRef,resizeObserver]),React.useEffect((function(){return dispatch({type:Action.RegisterDroppable,element:{id:id,key:key,disabled:disabled,node:nodeRef,rect:rect,data:dataRef}}),function(){return dispatch({type:Action.UnregisterDroppable,key:key,id:id})}}),[id]),React.useEffect((function(){disabled!==previous.current.disabled&&(dispatch({type:Action.SetDroppableDisabled,id:id,key:key,disabled:disabled}),previous.current.disabled=disabled)}),[id,key,disabled,dispatch]),{active:active,rect:rect,isOver:(null==over?void 0:over.id)===id,node:nodeRef,over:over,setNodeRef:setNodeRef}}({id:id,data:data,disabled:disabled.droppable,resizeObserverConfig:_extends({updateMeasurementsFor:itemsAfterCurrentSortable},resizeObserverConfig)}),rect=_useDroppable.rect,node=_useDroppable.node,isOver=_useDroppable.isOver,setDroppableNodeRef=_useDroppable.setNodeRef,_useDraggable=useDraggable({id:id,data:data,attributes:_extends({},defaultAttributes,userDefinedAttributes),disabled:disabled.draggable}),active=_useDraggable.active,activatorEvent=_useDraggable.activatorEvent,activeNodeRect=_useDraggable.activeNodeRect,attributes=_useDraggable.attributes,setDraggableNodeRef=_useDraggable.setNodeRef,listeners=_useDraggable.listeners,isDragging=_useDraggable.isDragging,over=_useDraggable.over,setActivatorNodeRef=_useDraggable.setActivatorNodeRef,transform=_useDraggable.transform,setNodeRef=function(){for(var _len=arguments.length,refs=new Array(_len),_key=0;_key<_len;_key++)refs[_key]=arguments[_key];return React.useMemo((function(){return function(node){refs.forEach((function(ref){return ref(node)}))}}),refs)}(setDroppableNodeRef,setDraggableNodeRef),isSorting=Boolean(active),displaceItem=isSorting&&!disableTransforms&&isValidIndex(activeIndex)&&isValidIndex(overIndex),shouldDisplaceDragSource=!useDragOverlay&&isDragging,dragSourceDisplacement=shouldDisplaceDragSource&&displaceItem?transform:null,finalTransform=displaceItem?null!=dragSourceDisplacement?dragSourceDisplacement:(null!=localStrategy?localStrategy:globalStrategy)({rects:sortedRects,activeNodeRect:activeNodeRect,activeIndex:activeIndex,overIndex:overIndex,index:index}):null,newIndex=isValidIndex(activeIndex)&&isValidIndex(overIndex)?getNewIndex({id:id,items:items,activeIndex:activeIndex,overIndex:overIndex}):index,activeId=null==active?void 0:active.id,previous=React.useRef({activeId:activeId,items:items,newIndex:newIndex,containerId:containerId}),itemsHaveChanged=items!==previous.current.items,shouldAnimateLayoutChanges=animateLayoutChanges({active:active,containerId:containerId,isDragging:isDragging,isSorting:isSorting,id:id,index:index,items:items,newIndex:previous.current.newIndex,previousItems:previous.current.items,previousContainerId:previous.current.containerId,transition:transition,wasDragging:null!=previous.current.activeId}),derivedTransform=function(_ref){var disabled=_ref.disabled,index=_ref.index,node=_ref.node,rect=_ref.rect,_useState=React.useState(null),derivedTransform=_useState[0],setDerivedtransform=_useState[1],previousIndex=React.useRef(index);return useIsomorphicLayoutEffect((function(){if(!disabled&&index!==previousIndex.current&&node.current){var initial=rect.current;if(initial){var current=getClientRect(node.current,{ignoreTransform:!0}),delta={x:initial.left-current.left,y:initial.top-current.top,scaleX:initial.width/current.width,scaleY:initial.height/current.height};(delta.x||delta.y)&&setDerivedtransform(delta)}}index!==previousIndex.current&&(previousIndex.current=index)}),[disabled,index,node,rect]),React.useEffect((function(){derivedTransform&&setDerivedtransform(null)}),[derivedTransform]),derivedTransform}({disabled:!shouldAnimateLayoutChanges,index:index,node:node,rect:rect});return React.useEffect((function(){isSorting&&previous.current.newIndex!==newIndex&&(previous.current.newIndex=newIndex),containerId!==previous.current.containerId&&(previous.current.containerId=containerId),items!==previous.current.items&&(previous.current.items=items)}),[isSorting,newIndex,containerId,items]),React.useEffect((function(){if(activeId!==previous.current.activeId){if(null==activeId||null!=previous.current.activeId){var timeoutId=setTimeout((function(){previous.current.activeId=activeId}),50);return function(){return clearTimeout(timeoutId)}}previous.current.activeId=activeId}}),[activeId]),{active:active,activeIndex:activeIndex,attributes:attributes,data:data,rect:rect,index:index,newIndex:newIndex,items:items,isOver:isOver,isSorting:isSorting,isDragging:isDragging,listeners:listeners,node:node,overIndex:overIndex,over:over,setNodeRef:setNodeRef,setActivatorNodeRef:setActivatorNodeRef,setDroppableNodeRef:setDroppableNodeRef,setDraggableNodeRef:setDraggableNodeRef,transform:null!=derivedTransform?derivedTransform:finalTransform,transition:function(){if(derivedTransform||itemsHaveChanged&&previous.current.newIndex===index)return disabledTransition;if(shouldDisplaceDragSource&&!isKeyboardEvent(activatorEvent)||!transition)return;if(isSorting||shouldAnimateLayoutChanges)return CSS.Transition.toString(_extends({},transition,{property:"transform"}));return}()}}function hasSortableData(entry){if(!entry)return!1;var data=entry.data.current;return!!(data&&"sortable"in data&&"object"==typeof data.sortable&&"containerId"in data.sortable&&"items"in data.sortable&&"index"in data.sortable)}var directions=[KeyboardCode.Down,KeyboardCode.Right,KeyboardCode.Up,KeyboardCode.Left],sortableKeyboardCoordinates=function(event,_ref){var _ref$context=_ref.context,active=_ref$context.active,collisionRect=_ref$context.collisionRect,droppableRects=_ref$context.droppableRects,droppableContainers=_ref$context.droppableContainers,over=_ref$context.over,scrollableAncestors=_ref$context.scrollableAncestors;if(directions.includes(event.code)){if(event.preventDefault(),!active||!collisionRect)return;var filteredContainers=[];droppableContainers.getEnabled().forEach((function(entry){if(entry&&(null==entry||!entry.disabled)){var rect=droppableRects.get(entry.id);if(rect)switch(event.code){case KeyboardCode.Down:collisionRect.top<rect.top&&filteredContainers.push(entry);break;case KeyboardCode.Up:collisionRect.top>rect.top&&filteredContainers.push(entry);break;case KeyboardCode.Left:collisionRect.left>rect.left&&filteredContainers.push(entry);break;case KeyboardCode.Right:collisionRect.left<rect.left&&filteredContainers.push(entry)}}}));var collisions=function(_ref){for(var _step2,collisionRect=_ref.collisionRect,droppableRects=_ref.droppableRects,droppableContainers=_ref.droppableContainers,corners=cornersOfRectangle(collisionRect),collisions=[],_loop=function(){var droppableContainer=_step2.value,id=droppableContainer.id,rect=droppableRects.get(id);if(rect){var rectCorners=cornersOfRectangle(rect),distances=corners.reduce((function(accumulator,corner,index){return accumulator+distanceBetween(rectCorners[index],corner)}),0),effectiveDistance=Number((distances/4).toFixed(4));collisions.push({id:id,data:{droppableContainer:droppableContainer,value:effectiveDistance}})}},_iterator2=_createForOfIteratorHelperLoose(droppableContainers);!(_step2=_iterator2()).done;)_loop();return collisions.sort(sortCollisionsAsc)}({active:active,collisionRect:collisionRect,droppableRects:droppableRects,droppableContainers:filteredContainers,pointerCoordinates:null}),closestId=getFirstCollision(collisions,"id");if(closestId===(null==over?void 0:over.id)&&collisions.length>1&&(closestId=collisions[1].id),null!=closestId){var activeDroppable=droppableContainers.get(active.id),newDroppable=droppableContainers.get(closestId),newRect=newDroppable?droppableRects.get(newDroppable.id):null,newNode=null==newDroppable?void 0:newDroppable.node.current;if(newNode&&newRect&&activeDroppable&&newDroppable){var hasDifferentScrollAncestors=getScrollableAncestors(newNode).some((function(element,index){return scrollableAncestors[index]!==element})),hasSameContainer=isSameContainer(activeDroppable,newDroppable),isAfterActive=function(a,b){if(!hasSortableData(a)||!hasSortableData(b))return!1;if(!isSameContainer(a,b))return!1;return a.data.current.sortable.index<b.data.current.sortable.index}(activeDroppable,newDroppable),offset=hasDifferentScrollAncestors||!hasSameContainer?{x:0,y:0}:{x:isAfterActive?collisionRect.width-newRect.width:0,y:isAfterActive?collisionRect.height-newRect.height:0},rectCoordinates={x:newRect.left,y:newRect.top};return offset.x&&offset.y?rectCoordinates:subtract(rectCoordinates,offset)}}}};function isSameContainer(a,b){return!(!hasSortableData(a)||!hasSortableData(b))&&a.data.current.sortable.containerId===b.data.current.sortable.containerId}function SortTableItem(_a){var id=_a.id,children=_a.children,dragHandle=_a.dragHandle,_b=useSortable({id:id}),attributes=_b.attributes,listeners=_b.listeners,setNodeRef=_b.setNodeRef,transform=_b.transform,transition=_b.transition,style={transform:CSS.Transform.toString(transform),transition:transition};return React.createElement("div",__assign({ref:setNodeRef,style:style},attributes),dragHandle&&React.createElement("span",__assign({className:"drag-handle"},listeners),dragHandle),children)}var Panel$1=acud.Collapse.Panel,CheckboxGroup$1=acud.Checkbox.Group,controls$1=function(props,_$1,customFunctions){var _a,_b=props||{},isGroup=_b.isGroup,_c=_b.cloumnGroupInfo,cloumnGroupInfo=void 0===_c?{}:_c,selectedCloumnInfo=_b.selectedCloumnInfo,groupNames=_.filter(_.keys(cloumnGroupInfo),(function(n){return"all"!==n}));return[{type:"custom",name:"attributes",label:"导出字段",content:isGroup?React.createElement(acud.Collapse,{defaultActiveKey:groupNames},groupNames.map((function(groupName){var _a,_b,_c,_d;return React.createElement(Panel$1,{key:groupName,header:React.createElement(acud.Checkbox,{indeterminate:null===(_a=null==selectedCloumnInfo?void 0:selectedCloumnInfo[groupName])||void 0===_a?void 0:_a.indeterminate,checked:null===(_b=null==selectedCloumnInfo?void 0:selectedCloumnInfo[groupName])||void 0===_b?void 0:_b.checkAll,onChange:customFunctions.onCheckAllChange(groupName)},groupName)},React.createElement(acud.Checkbox,{className:"attributes-checkall",indeterminate:null===(_c=null==selectedCloumnInfo?void 0:selectedCloumnInfo[groupName])||void 0===_c?void 0:_c.indeterminate,checked:null===(_d=null==selectedCloumnInfo?void 0:selectedCloumnInfo[groupName])||void 0===_d?void 0:_d.checkAll,onChange:customFunctions.onCheckAllChange(groupName)},groupName),React.createElement("div",{className:"attributes-list"},React.createElement(DndContext,{sensors:useSensors(useSensor(PointerSensor),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),collisionDetection:closestCenter,onDragEnd:function(event){var active=event.active,over=event.over;if(active.id!==over.id){var oldIndex=cloumnGroupInfo[groupName].findIndex((function(item){return item.value===active.id})),newIndex=cloumnGroupInfo[groupName].findIndex((function(item){return item.value===over.id})),newItems=arrayMove(cloumnGroupInfo[groupName],oldIndex,newIndex);customFunctions.onReorder(groupName,newItems)}}},React.createElement(SortableContext,{items:cloumnGroupInfo[groupName].map((function(item){return item.value})),strategy:verticalListSortingStrategy},cloumnGroupInfo[groupName].map((function(option){var _a,_b,isChecked=null===(_b=null===(_a=null==selectedCloumnInfo?void 0:selectedCloumnInfo[groupName])||void 0===_a?void 0:_a.checkedList)||void 0===_b?void 0:_b.includes(option.value);return React.createElement(SortTableItem,{key:option.value,id:option.value,dragHandle:React.createElement(React.Fragment,null,"≡")},React.createElement("div",{className:"draggable-item"},React.createElement(acud.Checkbox,{value:option.value,checked:isChecked,onChange:function(e){var _a,checked=e.target.checked,currentList=(null===(_a=null==selectedCloumnInfo?void 0:selectedCloumnInfo[groupName])||void 0===_a?void 0:_a.checkedList)||[],newList=checked?__spreadArray(__spreadArray([],__read(currentList),!1),[option.value],!1):currentList.filter((function(v){return v!==option.value}));customFunctions.onChange(groupName)(newList)},disabled:option.disabled},option.label)))}))))))}))):React.createElement(CheckboxGroup$1,{options:cloumnGroupInfo.all,value:null===(_a=null==selectedCloumnInfo?void 0:selectedCloumnInfo.all)||void 0===_a?void 0:_a.checkedList,onChange:customFunctions.onChange("all")})}]},AttributesForm$1=React.forwardRef((function(props,ref){var payload=props.payload,onSuccess=props.onSuccess,_a=payload.cloumnKeys,cloumnKeys=void 0===_a?[]:_a,setCloumnKeys=payload.setCloumnKeys,_b=__read(React.useState({}),2),selectedCloumnInfo=_b[0],setSelectedCloumnInfo=_b[1],isGroup=React.useMemo((function(){return cloumnKeys.some((function(item){return!!item.groupName}))}),[cloumnKeys]),defaultCloumnGroupInfo=React.useMemo((function(){var info={all:{checkAll:!1,indeterminate:!1,checkedList:[]}};return cloumnKeys.reduce((function(res,item,index){return isGroup&&item.groupName&&(res[item.groupName]=__spreadArray(__spreadArray([],__read(res[item.groupName]||[]),!1),[__assign(__assign({},item),{label:item.title,value:item.key,disabled:item.isUniq})],!1),info[item.groupName]||(info[item.groupName]={checkAll:!1,indeterminate:!1,checkedList:[]})),res.all=__spreadArray(__spreadArray([],__read(res.all||[]),!1),[__assign(__assign({},item),{label:item.title,value:item.key})],!1),index===cloumnKeys.length-1&&setSelectedCloumnInfo(_.reduce(Object.keys(info),(function(obj,itemKey){var checkedList=_.reduce(res[itemKey]||[],(function(rCheck,itemCheck){return(itemCheck.isUniq||itemCheck.show)&&rCheck.push(itemCheck.value),rCheck}),[]);return obj[itemKey]={checkAll:checkedList.length===res[itemKey].length,indeterminate:checkedList.length&&checkedList.length<res[itemKey].length,checkedList:checkedList},obj}),{})),res}),{})}),[isGroup,cloumnKeys]),_c=__read(React.useState(defaultCloumnGroupInfo),2),cloumnGroupInfo=_c[0],setCloumnGroupInfo=_c[1],onCheckAllChange=React.useCallback((function(groupName){return function(e){setSelectedCloumnInfo((function(info){var _a;return __assign(__assign({},info),((_a={})[groupName]={checkAll:e.target.checked,indeterminate:!1,checkedList:_.reduce(cloumnGroupInfo[groupName]||[],(function(res,item){return(e.target.checked||!e.target.checked&&item.isUniq)&&res.push(item.value),res}),[])},_a))}))}}),[setSelectedCloumnInfo,cloumnGroupInfo]),onChange=React.useCallback((function(groupName){return function(list){setSelectedCloumnInfo((function(info){var _a;return __assign(__assign({},info),((_a={})[groupName]={checkAll:list.length===cloumnGroupInfo[groupName].length,indeterminate:!!list.length&&list.length<cloumnGroupInfo[groupName].length,checkedList:list},_a))}))}}),[setSelectedCloumnInfo,cloumnGroupInfo]),actionConfig=React.useMemo((function(){return{submitAction:{submitFormAction:"attributes",$onSubmitRequest:function(){var showCloumns=_.reduce(Object.keys(selectedCloumnInfo),(function(obj,itemKey){return"all"!==itemKey&&(obj=__spreadArray(__spreadArray([],__read(obj),!1),__read(selectedCloumnInfo[itemKey].checkedList),!1)),obj}),[]),keys=_.reduce(Object.keys(cloumnGroupInfo),(function(obj,itemKey){return"all"!==itemKey&&(obj=__spreadArray(__spreadArray([],__read(obj),!1),__read(cloumnGroupInfo[itemKey]),!1)),obj}),[]).map((function(cloumn){return __assign(__assign({},cloumn),{show:showCloumns.includes(cloumn.dataIndex)||showCloumns.includes(cloumn.key)})}));throw setCloumnKeys(keys),null==onSuccess||onSuccess(),new Error("")}}}}),[setCloumnKeys,selectedCloumnInfo,onSuccess,cloumnGroupInfo]),customFunctions=React.useMemo((function(){return{onChange:onChange,onCheckAllChange:onCheckAllChange,setCloumnKeys:setCloumnKeys,onReorder:function(groupName,newOrder){setCloumnGroupInfo((function(prev){var _a;return __assign(__assign({},prev),((_a={})[groupName]=newOrder,_a))}))}}}),[onChange,onCheckAllChange,setCloumnKeys]),options=React.useMemo((function(){return{controls:controls$1,formItemOption:{noStyle:!0},actionConfig:actionConfig,customFunctions:customFunctions}}),[actionConfig,customFunctions]),_d=useForm(ref,__assign(__assign({},payload),{isGroup:isGroup,cloumnGroupInfo:cloumnGroupInfo,selectedCloumnInfo:selectedCloumnInfo}),options),form=_d.form,formProps=_d.formProps;return React.createElement(HooksForm,__assign({className:"acud-attribute-form"},formProps,{form:form}))})),XLSX={version:"0.18.5"},current_ansi=1252,VALID_ANSI=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],set_ansi=function(cp){-1!=VALID_ANSI.indexOf(cp)&&(current_ansi=cp)};var set_cp=function(cp){set_ansi(cp)};function reset_cp(){set_cp(1200),set_ansi(1252)}var _getchar=function(x){return String.fromCharCode(x)},_getansi=function(x){return String.fromCharCode(x)},Base64_map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Base64_encode(input){for(var o="",c1=0,c2=0,c3=0,e1=0,e2=0,e3=0,e4=0,i=0;i<input.length;)e1=(c1=input.charCodeAt(i++))>>2,e2=(3&c1)<<4|(c2=input.charCodeAt(i++))>>4,e3=(15&c2)<<2|(c3=input.charCodeAt(i++))>>6,e4=63&c3,isNaN(c2)?e3=e4=64:isNaN(c3)&&(e4=64),o+=Base64_map.charAt(e1)+Base64_map.charAt(e2)+Base64_map.charAt(e3)+Base64_map.charAt(e4);return o}function Base64_decode(input){var o="",c1=0,c2=0,c3=0,e2=0,e3=0,e4=0;input=input.replace(/[^\w\+\/\=]/g,"");for(var i=0;i<input.length;)c1=Base64_map.indexOf(input.charAt(i++))<<2|(e2=Base64_map.indexOf(input.charAt(i++)))>>4,o+=String.fromCharCode(c1),c2=(15&e2)<<4|(e3=Base64_map.indexOf(input.charAt(i++)))>>2,64!==e3&&(o+=String.fromCharCode(c2)),c3=(3&e3)<<6|(e4=Base64_map.indexOf(input.charAt(i++))),64!==e4&&(o+=String.fromCharCode(c3));return o}var has_buf=function(){return"undefined"!=typeof Buffer&&"undefined"!=typeof process&&void 0!==process.versions&&!!process.versions.node}(),Buffer_from=function(){if("undefined"!=typeof Buffer){var nbfs=!Buffer.from;if(!nbfs)try{Buffer.from("foo","utf8")}catch(e){nbfs=!0}return nbfs?function(buf,enc){return enc?new Buffer(buf,enc):new Buffer(buf)}:Buffer.from.bind(Buffer)}return function(){}}();function new_raw_buf(len){return has_buf?Buffer.alloc?Buffer.alloc(len):new Buffer(len):"undefined"!=typeof Uint8Array?new Uint8Array(len):new Array(len)}function new_unsafe_buf(len){return has_buf?Buffer.allocUnsafe?Buffer.allocUnsafe(len):new Buffer(len):"undefined"!=typeof Uint8Array?new Uint8Array(len):new Array(len)}var s2a=function(s){return has_buf?Buffer_from(s,"binary"):s.split("").map((function(x){return 255&x.charCodeAt(0)}))};function s2ab(s){if("undefined"==typeof ArrayBuffer)return s2a(s);for(var buf=new ArrayBuffer(s.length),view=new Uint8Array(buf),i=0;i!=s.length;++i)view[i]=255&s.charCodeAt(i);return buf}function a2s(data){if(Array.isArray(data))return data.map((function(c){return String.fromCharCode(c)})).join("");for(var o=[],i=0;i<data.length;++i)o[i]=String.fromCharCode(data[i]);return o.join("")}var bconcat=has_buf?function(bufs){return Buffer.concat(bufs.map((function(buf){return Buffer.isBuffer(buf)?buf:Buffer_from(buf)})))}:function(bufs){if("undefined"!=typeof Uint8Array){var i=0,maxlen=0;for(i=0;i<bufs.length;++i)maxlen+=bufs[i].length;var o=new Uint8Array(maxlen),len=0;for(i=0,maxlen=0;i<bufs.length;maxlen+=len,++i)if(len=bufs[i].length,bufs[i]instanceof Uint8Array)o.set(bufs[i],maxlen);else{if("string"==typeof bufs[i])throw"wtf";o.set(new Uint8Array(bufs[i]),maxlen)}return o}return[].concat.apply([],bufs.map((function(buf){return Array.isArray(buf)?buf:[].slice.call(buf)})))};var chr0=/\u0000/g,chr1=/[\u0001-\u0006]/g;function _strrev(x){for(var o="",i=x.length-1;i>=0;)o+=x.charAt(i--);return o}function pad0(v,d){var t=""+v;return t.length>=d?t:fill("0",d-t.length)+t}function pad_(v,d){var t=""+v;return t.length>=d?t:fill(" ",d-t.length)+t}function rpad_(v,d){var t=""+v;return t.length>=d?t:t+fill(" ",d-t.length)}var p2_32=Math.pow(2,32);function pad0r(v,d){return v>p2_32||v<-p2_32?function(v,d){var t=""+Math.round(v);return t.length>=d?t:fill("0",d-t.length)+t}(v,d):function(v,d){var t=""+v;return t.length>=d?t:fill("0",d-t.length)+t}(Math.round(v),d)}function SSF_isgeneral(s,i){return i=i||0,s.length>=7+i&&103==(32|s.charCodeAt(i))&&101==(32|s.charCodeAt(i+1))&&110==(32|s.charCodeAt(i+2))&&101==(32|s.charCodeAt(i+3))&&114==(32|s.charCodeAt(i+4))&&97==(32|s.charCodeAt(i+5))&&108==(32|s.charCodeAt(i+6))}var days=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],months=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];var table_fmt={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},SSF_default_map={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},SSF_default_str={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function SSF_frac(x,D,mixed){for(var sgn=x<0?-1:1,B=x*sgn,P_2=0,P_1=1,P=0,Q_2=1,Q_1=0,Q=0,A=Math.floor(B);Q_1<D&&(P=(A=Math.floor(B))*P_1+P_2,Q=A*Q_1+Q_2,!(B-A<5e-8));)B=1/(B-A),P_2=P_1,P_1=P,Q_2=Q_1,Q_1=Q;if(Q>D&&(Q_1>D?(Q=Q_2,P=P_2):(Q=Q_1,P=P_1)),!mixed)return[0,sgn*P,Q];var q=Math.floor(sgn*P/Q);return[q,sgn*P-q*Q,Q]}function SSF_parse_date_code(v,opts,b2){if(v>2958465||v<0)return null;var date=0|v,time=Math.floor(86400*(v-date)),dow=0,dout=[],out={D:date,T:time,u:86400*(v-date)-time,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(out.u)<1e-6&&(out.u=0),opts&&opts.date1904&&(date+=1462),out.u>.9999&&(out.u=0,86400==++time&&(out.T=time=0,++date,++out.D)),60===date)dout=b2?[1317,10,29]:[1900,2,29],dow=3;else if(0===date)dout=b2?[1317,8,29]:[1900,1,0],dow=6;else{date>60&&--date;var d=new Date(1900,0,1);d.setDate(d.getDate()+date-1),dout=[d.getFullYear(),d.getMonth()+1,d.getDate()],dow=d.getDay(),date<60&&(dow=(dow+6)%7),b2&&(dow=function(date,o){o[0]-=581;var dow=date.getDay();date<60&&(dow=(dow+6)%7);return dow}(d,dout))}return out.y=dout[0],out.m=dout[1],out.d=dout[2],out.S=time%60,time=Math.floor(time/60),out.M=time%60,time=Math.floor(time/60),out.H=time,out.q=dow,out}var SSFbasedate=new Date(1899,11,31,0,0,0),SSFdnthresh=SSFbasedate.getTime(),SSFbase1904=new Date(1900,2,1,0,0,0);function datenum_local(v,date1904){var epoch=v.getTime();return date1904?epoch-=1262304e5:v>=SSFbase1904&&(epoch+=864e5),(epoch-(SSFdnthresh+6e4*(v.getTimezoneOffset()-SSFbasedate.getTimezoneOffset())))/864e5}function SSF_strip_decimal(o){return-1==o.indexOf(".")?o:o.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function SSF_general_num(v){var o,V=Math.floor(Math.log(Math.abs(v))*Math.LOG10E);return o=V>=-4&&V<=-1?v.toPrecision(10+V):Math.abs(V)<=9?function(v){var w=v<0?12:11,o=SSF_strip_decimal(v.toFixed(12));return o.length<=w||(o=v.toPrecision(10)).length<=w?o:v.toExponential(5)}(v):10===V?v.toFixed(10).substr(0,12):function(v){var o=SSF_strip_decimal(v.toFixed(11));return o.length>(v<0?12:11)||"0"===o||"-0"===o?v.toPrecision(6):o}(v),SSF_strip_decimal(function(o){return-1==o.indexOf("E")?o:o.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}(o.toUpperCase()))}function SSF_general(v,opts){switch(typeof v){case"string":return v;case"boolean":return v?"TRUE":"FALSE";case"number":return(0|v)===v?v.toString(10):SSF_general_num(v);case"undefined":return"";case"object":if(null==v)return"";if(v instanceof Date)return SSF_format(14,datenum_local(v,opts&&opts.date1904),opts)}throw new Error("unsupported value in General format: "+v)}function SSF_write_date(type,fmt,val,ss0){var out,o="",ss=0,tt=0,y=val.y,outl=0;switch(type){case 98:y=val.y+543;case 121:switch(fmt.length){case 1:case 2:out=y%100,outl=2;break;default:out=y%1e4,outl=4}break;case 109:switch(fmt.length){case 1:case 2:out=val.m,outl=fmt.length;break;case 3:return months[val.m-1][1];case 5:return months[val.m-1][0];default:return months[val.m-1][2]}break;case 100:switch(fmt.length){case 1:case 2:out=val.d,outl=fmt.length;break;case 3:return days[val.q][0];default:return days[val.q][1]}break;case 104:switch(fmt.length){case 1:case 2:out=1+(val.H+11)%12,outl=fmt.length;break;default:throw"bad hour format: "+fmt}break;case 72:switch(fmt.length){case 1:case 2:out=val.H,outl=fmt.length;break;default:throw"bad hour format: "+fmt}break;case 77:switch(fmt.length){case 1:case 2:out=val.M,outl=fmt.length;break;default:throw"bad minute format: "+fmt}break;case 115:if("s"!=fmt&&"ss"!=fmt&&".0"!=fmt&&".00"!=fmt&&".000"!=fmt)throw"bad second format: "+fmt;return 0!==val.u||"s"!=fmt&&"ss"!=fmt?(tt=ss0>=2?3===ss0?1e3:100:1===ss0?10:1,(ss=Math.round(tt*(val.S+val.u)))>=60*tt&&(ss=0),"s"===fmt?0===ss?"0":""+ss/tt:(o=pad0(ss,2+ss0),"ss"===fmt?o.substr(0,2):"."+o.substr(2,fmt.length-1))):pad0(val.S,fmt.length);case 90:switch(fmt){case"[h]":case"[hh]":out=24*val.D+val.H;break;case"[m]":case"[mm]":out=60*(24*val.D+val.H)+val.M;break;case"[s]":case"[ss]":out=60*(60*(24*val.D+val.H)+val.M)+Math.round(val.S+val.u);break;default:throw"bad abstime format: "+fmt}outl=3===fmt.length?1:2;break;case 101:out=y,outl=1}return outl>0?pad0(out,outl):""}function commaify(s){if(s.length<=3)return s;for(var j=s.length%3,o=s.substr(0,j);j!=s.length;j+=3)o+=(o.length>0?",":"")+s.substr(j,3);return o}var pct1=/%/g;function write_num_exp(fmt,val){var o,idx=fmt.indexOf("E")-fmt.indexOf(".")-1;if(fmt.match(/^#+0.0E\+0$/)){if(0==val)return"0.0E+0";if(val<0)return"-"+write_num_exp(fmt,-val);var period=fmt.indexOf(".");-1===period&&(period=fmt.indexOf("E"));var ee=Math.floor(Math.log(val)*Math.LOG10E)%period;if(ee<0&&(ee+=period),-1===(o=(val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period)).indexOf("e")){var fakee=Math.floor(Math.log(val)*Math.LOG10E);for(-1===o.indexOf(".")?o=o.charAt(0)+"."+o.substr(1)+"E+"+(fakee-o.length+ee):o+="E+"+(fakee-ee);"0."===o.substr(0,2);)o=(o=o.charAt(0)+o.substr(2,period)+"."+o.substr(2+period)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");o=o.replace(/\+-/,"-")}o=o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function($$,$1,$2,$3){return $1+$2+$3.substr(0,(period+ee)%period)+"."+$3.substr(ee)+"E"}))}else o=val.toExponential(idx);return fmt.match(/E\+00$/)&&o.match(/e[+-]\d$/)&&(o=o.substr(0,o.length-1)+"0"+o.charAt(o.length-1)),fmt.match(/E\-/)&&o.match(/e\+/)&&(o=o.replace(/e\+/,"e")),o.replace("e","E")}var frac1=/# (\?+)( ?)\/( ?)(\d+)/;var dec1=/^#*0*\.([0#]+)/,closeparen=/\).*[0#]/,phone=/\(###\) ###\\?-####/;function hashq(str){for(var cc,o="",i=0;i!=str.length;++i)switch(cc=str.charCodeAt(i)){case 35:break;case 63:o+=" ";break;case 48:o+="0";break;default:o+=String.fromCharCode(cc)}return o}function rnd(val,d){var dd=Math.pow(10,d);return""+Math.round(val*dd)/dd}function dec(val,d){var _frac=val-Math.floor(val),dd=Math.pow(10,d);return d<(""+Math.round(_frac*dd)).length?0:Math.round(_frac*dd)}function write_num_flt(type,fmt,val){if(40===type.charCodeAt(0)&&!fmt.match(closeparen)){var ffmt=fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return val>=0?write_num_flt("n",ffmt,val):"("+write_num_flt("n",ffmt,-val)+")"}if(44===fmt.charCodeAt(fmt.length-1))return function(type,fmt,val){for(var idx=fmt.length-1;44===fmt.charCodeAt(idx-1);)--idx;return write_num(type,fmt.substr(0,idx),val/Math.pow(10,3*(fmt.length-idx)))}(type,fmt,val);if(-1!==fmt.indexOf("%"))return function(type,fmt,val){var sfmt=fmt.replace(pct1,""),mul=fmt.length-sfmt.length;return write_num(type,sfmt,val*Math.pow(10,2*mul))+fill("%",mul)}(type,fmt,val);if(-1!==fmt.indexOf("E"))return write_num_exp(fmt,val);if(36===fmt.charCodeAt(0))return"$"+write_num_flt(type,fmt.substr(" "==fmt.charAt(1)?2:1),val);var o,r,ri,ff,aval=Math.abs(val),sign=val<0?"-":"";if(fmt.match(/^00+$/))return sign+pad0r(aval,fmt.length);if(fmt.match(/^[#?]+$/))return"0"===(o=pad0r(val,0))&&(o=""),o.length>fmt.length?o:hashq(fmt.substr(0,fmt.length-o.length))+o;if(r=fmt.match(frac1))return function(r,aval,sign){var den=parseInt(r[4],10),rr=Math.round(aval*den),base=Math.floor(rr/den),myn=rr-base*den,myd=den;return sign+(0===base?"":""+base)+" "+(0===myn?fill(" ",r[1].length+1+r[4].length):pad_(myn,r[1].length)+r[2]+"/"+r[3]+pad0(myd,r[4].length))}(r,aval,sign);if(fmt.match(/^#+0+$/))return sign+pad0r(aval,fmt.length-fmt.indexOf("0"));if(r=fmt.match(dec1))return o=rnd(val,r[1].length).replace(/^([^\.]+)$/,"$1."+hashq(r[1])).replace(/\.$/,"."+hashq(r[1])).replace(/\.(\d*)$/,(function($$,$1){return"."+$1+fill("0",hashq(r[1]).length-$1.length)})),-1!==fmt.indexOf("0.")?o:o.replace(/^0\./,".");if(fmt=fmt.replace(/^#+([0.])/,"$1"),r=fmt.match(/^(0*)\.(#*)$/))return sign+rnd(aval,r[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");if(r=fmt.match(/^#{1,3},##0(\.?)$/))return sign+commaify(pad0r(aval,0));if(r=fmt.match(/^#,##0\.([#0]*0)$/))return val<0?"-"+write_num_flt(type,fmt,-val):commaify(""+(Math.floor(val)+function(val,d){return d<(""+Math.round((val-Math.floor(val))*Math.pow(10,d))).length?1:0}(val,r[1].length)))+"."+pad0(dec(val,r[1].length),r[1].length);if(r=fmt.match(/^#,#*,#0/))return write_num_flt(type,fmt.replace(/^#,#*,/,""),val);if(r=fmt.match(/^([0#]+)(\\?-([0#]+))+$/))return o=_strrev(write_num_flt(type,fmt.replace(/[\\-]/g,""),val)),ri=0,_strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,(function(x){return ri<o.length?o.charAt(ri++):"0"===x?"0":""})));if(fmt.match(phone))return"("+(o=write_num_flt(type,"##########",val)).substr(0,3)+") "+o.substr(3,3)+"-"+o.substr(6);var oa="";if(r=fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return ri=Math.min(r[4].length,7),ff=SSF_frac(aval,Math.pow(10,ri)-1,!1),o=""+sign," "==(oa=write_num("n",r[1],ff[1])).charAt(oa.length-1)&&(oa=oa.substr(0,oa.length-1)+"0"),o+=oa+r[2]+"/"+r[3],(oa=rpad_(ff[2],ri)).length<r[4].length&&(oa=hashq(r[4].substr(r[4].length-oa.length))+oa),o+=oa;if(r=fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return ri=Math.min(Math.max(r[1].length,r[4].length),7),sign+((ff=SSF_frac(aval,Math.pow(10,ri)-1,!0))[0]||(ff[1]?"":"0"))+" "+(ff[1]?pad_(ff[1],ri)+r[2]+"/"+r[3]+rpad_(ff[2],ri):fill(" ",2*ri+1+r[2].length+r[3].length));if(r=fmt.match(/^[#0?]+$/))return o=pad0r(val,0),fmt.length<=o.length?o:hashq(fmt.substr(0,fmt.length-o.length))+o;if(r=fmt.match(/^([#0?]+)\.([#0]+)$/)){o=""+val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,"$1"),ri=o.indexOf(".");var lres=fmt.indexOf(".")-ri,rres=fmt.length-o.length-lres;return hashq(fmt.substr(0,lres)+o+fmt.substr(fmt.length-rres))}if(r=fmt.match(/^00,000\.([#0]*0)$/))return ri=dec(val,r[1].length),val<0?"-"+write_num_flt(type,fmt,-val):commaify(function(val){return val<2147483647&&val>-2147483648?""+(val>=0?0|val:val-1|0):""+Math.floor(val)}(val)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function($$){return"00,"+($$.length<3?pad0(0,3-$$.length):"")+$$}))+"."+pad0(ri,r[1].length);switch(fmt){case"###,##0.00":return write_num_flt(type,"#,##0.00",val);case"###,###":case"##,###":case"#,###":var x=commaify(pad0r(aval,0));return"0"!==x?sign+x:"";case"###,###.00":return write_num_flt(type,"###,##0.00",val).replace(/^0\./,".");case"#,###.00":return write_num_flt(type,"#,##0.00",val).replace(/^0\./,".")}throw new Error("unsupported format |"+fmt+"|")}function write_num_exp2(fmt,val){var o,idx=fmt.indexOf("E")-fmt.indexOf(".")-1;if(fmt.match(/^#+0.0E\+0$/)){if(0==val)return"0.0E+0";if(val<0)return"-"+write_num_exp2(fmt,-val);var period=fmt.indexOf(".");-1===period&&(period=fmt.indexOf("E"));var ee=Math.floor(Math.log(val)*Math.LOG10E)%period;if(ee<0&&(ee+=period),!(o=(val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period)).match(/[Ee]/)){var fakee=Math.floor(Math.log(val)*Math.LOG10E);-1===o.indexOf(".")?o=o.charAt(0)+"."+o.substr(1)+"E+"+(fakee-o.length+ee):o+="E+"+(fakee-ee),o=o.replace(/\+-/,"-")}o=o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function($$,$1,$2,$3){return $1+$2+$3.substr(0,(period+ee)%period)+"."+$3.substr(ee)+"E"}))}else o=val.toExponential(idx);return fmt.match(/E\+00$/)&&o.match(/e[+-]\d$/)&&(o=o.substr(0,o.length-1)+"0"+o.charAt(o.length-1)),fmt.match(/E\-/)&&o.match(/e\+/)&&(o=o.replace(/e\+/,"e")),o.replace("e","E")}function write_num_int(type,fmt,val){if(40===type.charCodeAt(0)&&!fmt.match(closeparen)){var ffmt=fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return val>=0?write_num_int("n",ffmt,val):"("+write_num_int("n",ffmt,-val)+")"}if(44===fmt.charCodeAt(fmt.length-1))return function(type,fmt,val){for(var idx=fmt.length-1;44===fmt.charCodeAt(idx-1);)--idx;return write_num(type,fmt.substr(0,idx),val/Math.pow(10,3*(fmt.length-idx)))}(type,fmt,val);if(-1!==fmt.indexOf("%"))return function(type,fmt,val){var sfmt=fmt.replace(pct1,""),mul=fmt.length-sfmt.length;return write_num(type,sfmt,val*Math.pow(10,2*mul))+fill("%",mul)}(type,fmt,val);if(-1!==fmt.indexOf("E"))return write_num_exp2(fmt,val);if(36===fmt.charCodeAt(0))return"$"+write_num_int(type,fmt.substr(" "==fmt.charAt(1)?2:1),val);var o,r,ri,ff,aval=Math.abs(val),sign=val<0?"-":"";if(fmt.match(/^00+$/))return sign+pad0(aval,fmt.length);if(fmt.match(/^[#?]+$/))return o=""+val,0===val&&(o=""),o.length>fmt.length?o:hashq(fmt.substr(0,fmt.length-o.length))+o;if(r=fmt.match(frac1))return function(r,aval,sign){return sign+(0===aval?"":""+aval)+fill(" ",r[1].length+2+r[4].length)}(r,aval,sign);if(fmt.match(/^#+0+$/))return sign+pad0(aval,fmt.length-fmt.indexOf("0"));if(r=fmt.match(dec1))return o=(o=(""+val).replace(/^([^\.]+)$/,"$1."+hashq(r[1])).replace(/\.$/,"."+hashq(r[1]))).replace(/\.(\d*)$/,(function($$,$1){return"."+$1+fill("0",hashq(r[1]).length-$1.length)})),-1!==fmt.indexOf("0.")?o:o.replace(/^0\./,".");if(fmt=fmt.replace(/^#+([0.])/,"$1"),r=fmt.match(/^(0*)\.(#*)$/))return sign+(""+aval).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");if(r=fmt.match(/^#{1,3},##0(\.?)$/))return sign+commaify(""+aval);if(r=fmt.match(/^#,##0\.([#0]*0)$/))return val<0?"-"+write_num_int(type,fmt,-val):commaify(""+val)+"."+fill("0",r[1].length);if(r=fmt.match(/^#,#*,#0/))return write_num_int(type,fmt.replace(/^#,#*,/,""),val);if(r=fmt.match(/^([0#]+)(\\?-([0#]+))+$/))return o=_strrev(write_num_int(type,fmt.replace(/[\\-]/g,""),val)),ri=0,_strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,(function(x){return ri<o.length?o.charAt(ri++):"0"===x?"0":""})));if(fmt.match(phone))return"("+(o=write_num_int(type,"##########",val)).substr(0,3)+") "+o.substr(3,3)+"-"+o.substr(6);var oa="";if(r=fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return ri=Math.min(r[4].length,7),ff=SSF_frac(aval,Math.pow(10,ri)-1,!1),o=""+sign," "==(oa=write_num("n",r[1],ff[1])).charAt(oa.length-1)&&(oa=oa.substr(0,oa.length-1)+"0"),o+=oa+r[2]+"/"+r[3],(oa=rpad_(ff[2],ri)).length<r[4].length&&(oa=hashq(r[4].substr(r[4].length-oa.length))+oa),o+=oa;if(r=fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return ri=Math.min(Math.max(r[1].length,r[4].length),7),sign+((ff=SSF_frac(aval,Math.pow(10,ri)-1,!0))[0]||(ff[1]?"":"0"))+" "+(ff[1]?pad_(ff[1],ri)+r[2]+"/"+r[3]+rpad_(ff[2],ri):fill(" ",2*ri+1+r[2].length+r[3].length));if(r=fmt.match(/^[#0?]+$/))return o=""+val,fmt.length<=o.length?o:hashq(fmt.substr(0,fmt.length-o.length))+o;if(r=fmt.match(/^([#0]+)\.([#0]+)$/)){o=""+val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,"$1"),ri=o.indexOf(".");var lres=fmt.indexOf(".")-ri,rres=fmt.length-o.length-lres;return hashq(fmt.substr(0,lres)+o+fmt.substr(fmt.length-rres))}if(r=fmt.match(/^00,000\.([#0]*0)$/))return val<0?"-"+write_num_int(type,fmt,-val):commaify(""+val).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function($$){return"00,"+($$.length<3?pad0(0,3-$$.length):"")+$$}))+"."+pad0(0,r[1].length);switch(fmt){case"###,###":case"##,###":case"#,###":var x=commaify(""+aval);return"0"!==x?sign+x:"";default:if(fmt.match(/\.[0#?]*$/))return write_num_int(type,fmt.slice(0,fmt.lastIndexOf(".")),val)+hashq(fmt.slice(fmt.lastIndexOf(".")))}throw new Error("unsupported format |"+fmt+"|")}function write_num(type,fmt,val){return(0|val)===val?write_num_int(type,fmt,val):write_num_flt(type,fmt,val)}var SSF_abstime=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function fmt_is_date(fmt){for(var i=0,c="",o="";i<fmt.length;)switch(c=fmt.charAt(i)){case"G":SSF_isgeneral(fmt,i)&&(i+=6),i++;break;case'"':for(;34!==fmt.charCodeAt(++i)&&i<fmt.length;);++i;break;case"\\":case"_":i+=2;break;case"@":++i;break;case"B":case"b":if("1"===fmt.charAt(i+1)||"2"===fmt.charAt(i+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if("A/P"===fmt.substr(i,3).toUpperCase())return!0;if("AM/PM"===fmt.substr(i,5).toUpperCase())return!0;if("上午/下午"===fmt.substr(i,5).toUpperCase())return!0;++i;break;case"[":for(o=c;"]"!==fmt.charAt(i++)&&i<fmt.length;)o+=fmt.charAt(i);if(o.match(SSF_abstime))return!0;break;case".":case"0":case"#":for(;i<fmt.length&&("0#?.,E+-%".indexOf(c=fmt.charAt(++i))>-1||"\\"==c&&"-"==fmt.charAt(i+1)&&"0#".indexOf(fmt.charAt(i+2))>-1););break;case"?":for(;fmt.charAt(++i)===c;);break;case"*":++i," "!=fmt.charAt(i)&&"*"!=fmt.charAt(i)||++i;break;case"(":case")":++i;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;i<fmt.length&&"0123456789".indexOf(fmt.charAt(++i))>-1;);break;default:++i}return!1}var cfregex2=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function chkcond(v,rr){if(null==rr)return!1;var thresh=parseFloat(rr[2]);switch(rr[1]){case"=":if(v==thresh)return!0;break;case">":if(v>thresh)return!0;break;case"<":if(v<thresh)return!0;break;case"<>":if(v!=thresh)return!0;break;case">=":if(v>=thresh)return!0;break;case"<=":if(v<=thresh)return!0}return!1}function choose_fmt(f,v){var fmt=function(fmt){for(var out=[],in_str=!1,i=0,j=0;i<fmt.length;++i)switch(fmt.charCodeAt(i)){case 34:in_str=!in_str;break;case 95:case 42:case 92:++i;break;case 59:out[out.length]=fmt.substr(j,i-j),j=i+1}if(out[out.length]=fmt.substr(j),!0===in_str)throw new Error("Format |"+fmt+"| unterminated string ");return out}(f),l=fmt.length,lat=fmt[l-1].indexOf("@");if(l<4&&lat>-1&&--l,fmt.length>4)throw new Error("cannot find right format for |"+fmt.join("|")+"|");if("number"!=typeof v)return[4,4===fmt.length||lat>-1?fmt[fmt.length-1]:"@"];switch(fmt.length){case 1:fmt=lat>-1?["General","General","General",fmt[0]]:[fmt[0],fmt[0],fmt[0],"@"];break;case 2:fmt=lat>-1?[fmt[0],fmt[0],fmt[0],fmt[1]]:[fmt[0],fmt[1],fmt[0],"@"];break;case 3:fmt=lat>-1?[fmt[0],fmt[1],fmt[0],fmt[2]]:[fmt[0],fmt[1],fmt[2],"@"]}var ff=v>0?fmt[0]:v<0?fmt[1]:fmt[2];if(-1===fmt[0].indexOf("[")&&-1===fmt[1].indexOf("["))return[l,ff];if(null!=fmt[0].match(/\[[=<>]/)||null!=fmt[1].match(/\[[=<>]/)){var m1=fmt[0].match(cfregex2),m2=fmt[1].match(cfregex2);return chkcond(v,m1)?[l,fmt[0]]:chkcond(v,m2)?[l,fmt[1]]:[l,fmt[null!=m1&&null!=m2?2:1]]}return[l,ff]}function SSF_format(fmt,v,o){null==o&&(o={});var sfmt="";switch(typeof fmt){case"string":sfmt="m/d/yy"==fmt&&o.dateNF?o.dateNF:fmt;break;case"number":null==(sfmt=14==fmt&&o.dateNF?o.dateNF:(null!=o.table?o.table:table_fmt)[fmt])&&(sfmt=o.table&&o.table[SSF_default_map[fmt]]||table_fmt[SSF_default_map[fmt]]),null==sfmt&&(sfmt=SSF_default_str[fmt]||"General")}if(SSF_isgeneral(sfmt,0))return SSF_general(v,o);v instanceof Date&&(v=datenum_local(v,o.date1904));var f=choose_fmt(sfmt,v);if(SSF_isgeneral(f[1]))return SSF_general(v,o);if(!0===v)v="TRUE";else if(!1===v)v="FALSE";else if(""===v||null==v)return"";return function(fmt,v,opts,flen){for(var dt,j,cc,out=[],o="",i=0,c="",lst="t",hr="H";i<fmt.length;)switch(c=fmt.charAt(i)){case"G":if(!SSF_isgeneral(fmt,i))throw new Error("unrecognized character "+c+" in "+fmt);out[out.length]={t:"G",v:"General"},i+=7;break;case'"':for(o="";34!==(cc=fmt.charCodeAt(++i))&&i<fmt.length;)o+=String.fromCharCode(cc);out[out.length]={t:"t",v:o},++i;break;case"\\":var w=fmt.charAt(++i),t="("===w||")"===w?w:"t";out[out.length]={t:t,v:w},++i;break;case"_":out[out.length]={t:"t",v:" "},i+=2;break;case"@":out[out.length]={t:"T",v:v},++i;break;case"B":case"b":if("1"===fmt.charAt(i+1)||"2"===fmt.charAt(i+1)){if(null==dt&&null==(dt=SSF_parse_date_code(v,opts,"2"===fmt.charAt(i+1))))return"";out[out.length]={t:"X",v:fmt.substr(i,2)},lst=c,i+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":c=c.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(v<0)return"";if(null==dt&&null==(dt=SSF_parse_date_code(v,opts)))return"";for(o=c;++i<fmt.length&&fmt.charAt(i).toLowerCase()===c;)o+=c;"m"===c&&"h"===lst.toLowerCase()&&(c="M"),"h"===c&&(c=hr),out[out.length]={t:c,v:o},lst=c;break;case"A":case"a":case"上":var q={t:c,v:c};if(null==dt&&(dt=SSF_parse_date_code(v,opts)),"A/P"===fmt.substr(i,3).toUpperCase()?(null!=dt&&(q.v=dt.H>=12?"P":"A"),q.t="T",hr="h",i+=3):"AM/PM"===fmt.substr(i,5).toUpperCase()?(null!=dt&&(q.v=dt.H>=12?"PM":"AM"),q.t="T",i+=5,hr="h"):"上午/下午"===fmt.substr(i,5).toUpperCase()?(null!=dt&&(q.v=dt.H>=12?"下午":"上午"),q.t="T",i+=5,hr="h"):(q.t="t",++i),null==dt&&"T"===q.t)return"";out[out.length]=q,lst=c;break;case"[":for(o=c;"]"!==fmt.charAt(i++)&&i<fmt.length;)o+=fmt.charAt(i);if("]"!==o.slice(-1))throw'unterminated "[" block: |'+o+"|";if(o.match(SSF_abstime)){if(null==dt&&null==(dt=SSF_parse_date_code(v,opts)))return"";out[out.length]={t:"Z",v:o.toLowerCase()},lst=o.charAt(1)}else o.indexOf("$")>-1&&(o=(o.match(/\$([^-\[\]]*)/)||[])[1]||"$",fmt_is_date(fmt)||(out[out.length]={t:"t",v:o}));break;case".":if(null!=dt){for(o=c;++i<fmt.length&&"0"===(c=fmt.charAt(i));)o+=c;out[out.length]={t:"s",v:o};break}case"0":case"#":for(o=c;++i<fmt.length&&"0#?.,E+-%".indexOf(c=fmt.charAt(i))>-1;)o+=c;out[out.length]={t:"n",v:o};break;case"?":for(o=c;fmt.charAt(++i)===c;)o+=c;out[out.length]={t:c,v:o},lst=c;break;case"*":++i," "!=fmt.charAt(i)&&"*"!=fmt.charAt(i)||++i;break;case"(":case")":out[out.length]={t:1===flen?"t":c,v:c},++i;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(o=c;i<fmt.length&&"0123456789".indexOf(fmt.charAt(++i))>-1;)o+=fmt.charAt(i);out[out.length]={t:"D",v:o};break;case" ":out[out.length]={t:c,v:c},++i;break;case"$":out[out.length]={t:"t",v:"$"},++i;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c))throw new Error("unrecognized character "+c+" in "+fmt);out[out.length]={t:"t",v:c},++i}var ssm,bt=0,ss0=0;for(i=out.length-1,lst="t";i>=0;--i)switch(out[i].t){case"h":case"H":out[i].t=hr,lst="h",bt<1&&(bt=1);break;case"s":(ssm=out[i].v.match(/\.0+$/))&&(ss0=Math.max(ss0,ssm[0].length-1)),bt<3&&(bt=3);case"d":case"y":case"M":case"e":lst=out[i].t;break;case"m":"s"===lst&&(out[i].t="M",bt<2&&(bt=2));break;case"X":break;case"Z":bt<1&&out[i].v.match(/[Hh]/)&&(bt=1),bt<2&&out[i].v.match(/[Mm]/)&&(bt=2),bt<3&&out[i].v.match(/[Ss]/)&&(bt=3)}switch(bt){case 0:break;case 1:dt.u>=.5&&(dt.u=0,++dt.S),dt.S>=60&&(dt.S=0,++dt.M),dt.M>=60&&(dt.M=0,++dt.H);break;case 2:dt.u>=.5&&(dt.u=0,++dt.S),dt.S>=60&&(dt.S=0,++dt.M)}var jj,nstr="";for(i=0;i<out.length;++i)switch(out[i].t){case"t":case"T":case" ":case"D":break;case"X":out[i].v="",out[i].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":out[i].v=SSF_write_date(out[i].t.charCodeAt(0),out[i].v,dt,ss0),out[i].t="t";break;case"n":case"?":for(jj=i+1;null!=out[jj]&&("?"===(c=out[jj].t)||"D"===c||(" "===c||"t"===c)&&null!=out[jj+1]&&("?"===out[jj+1].t||"t"===out[jj+1].t&&"/"===out[jj+1].v)||"("===out[i].t&&(" "===c||"n"===c||")"===c)||"t"===c&&("/"===out[jj].v||" "===out[jj].v&&null!=out[jj+1]&&"?"==out[jj+1].t));)out[i].v+=out[jj].v,out[jj]={v:"",t:";"},++jj;nstr+=out[i].v,i=jj-1;break;case"G":out[i].t="t",out[i].v=SSF_general(v,opts)}var myv,ostr,vv="";if(nstr.length>0){40==nstr.charCodeAt(0)?(myv=v<0&&45===nstr.charCodeAt(0)?-v:v,ostr=write_num("n",nstr,myv)):(ostr=write_num("n",nstr,myv=v<0&&flen>1?-v:v),myv<0&&out[0]&&"t"==out[0].t&&(ostr=ostr.substr(1),out[0].v="-"+out[0].v)),jj=ostr.length-1;var decpt=out.length;for(i=0;i<out.length;++i)if(null!=out[i]&&"t"!=out[i].t&&out[i].v.indexOf(".")>-1){decpt=i;break}var lasti=out.length;if(decpt===out.length&&-1===ostr.indexOf("E")){for(i=out.length-1;i>=0;--i)null!=out[i]&&-1!=="n?".indexOf(out[i].t)&&(jj>=out[i].v.length-1?(jj-=out[i].v.length,out[i].v=ostr.substr(jj+1,out[i].v.length)):jj<0?out[i].v="":(out[i].v=ostr.substr(0,jj+1),jj=-1),out[i].t="t",lasti=i);jj>=0&&lasti<out.length&&(out[lasti].v=ostr.substr(0,jj+1)+out[lasti].v)}else if(decpt!==out.length&&-1===ostr.indexOf("E")){for(jj=ostr.indexOf(".")-1,i=decpt;i>=0;--i)if(null!=out[i]&&-1!=="n?".indexOf(out[i].t)){for(j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")-1:out[i].v.length-1,vv=out[i].v.substr(j+1);j>=0;--j)jj>=0&&("0"===out[i].v.charAt(j)||"#"===out[i].v.charAt(j))&&(vv=ostr.charAt(jj--)+vv);out[i].v=vv,out[i].t="t",lasti=i}for(jj>=0&&lasti<out.length&&(out[lasti].v=ostr.substr(0,jj+1)+out[lasti].v),jj=ostr.indexOf(".")+1,i=decpt;i<out.length;++i)if(null!=out[i]&&(-1!=="n?(".indexOf(out[i].t)||i===decpt)){for(j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")+1:0,vv=out[i].v.substr(0,j);j<out[i].v.length;++j)jj<ostr.length&&(vv+=ostr.charAt(jj++));out[i].v=vv,out[i].t="t",lasti=i}}}for(i=0;i<out.length;++i)null!=out[i]&&"n?".indexOf(out[i].t)>-1&&(myv=flen>1&&v<0&&i>0&&"-"===out[i-1].v?-v:v,out[i].v=write_num(out[i].t,out[i].v,myv),out[i].t="t");var retval="";for(i=0;i!==out.length;++i)null!=out[i]&&(retval+=out[i].v);return retval}(f[1],v,o,f[0])}function SSF_load(fmt,idx){if("number"!=typeof idx){idx=+idx||-1;for(var i=0;i<392;++i)if(null!=table_fmt[i]){if(table_fmt[i]==fmt){idx=i;break}}else idx<0&&(idx=i);idx<0&&(idx=391)}return table_fmt[idx]=fmt,idx}function SSF_load_table(tbl){for(var i=0;392!=i;++i)void 0!==tbl[i]&&SSF_load(tbl[i],i)}function make_ssf(){var t;t||(t={}),t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',table_fmt=t}var dateNFregex=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;var CRC32=function(){var CRC32={};CRC32.version="1.2.0";var T0=function(){for(var c=0,table=new Array(256),n=0;256!=n;++n)c=1&(c=1&(c=1&(c=1&(c=1&(c=1&(c=1&(c=1&(c=n)?-306674912^c>>>1:c>>>1)?-306674912^c>>>1:c>>>1)?-306674912^c>>>1:c>>>1)?-306674912^c>>>1:c>>>1)?-306674912^c>>>1:c>>>1)?-306674912^c>>>1:c>>>1)?-306674912^c>>>1:c>>>1)?-306674912^c>>>1:c>>>1,table[n]=c;return"undefined"!=typeof Int32Array?new Int32Array(table):table}();var TT=function(T){var c=0,v=0,n=0,table="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)table[n]=T[n];for(n=0;256!=n;++n)for(v=T[n],c=256+n;c<4096;c+=256)v=table[c]=v>>>8^T[255&v];var out=[];for(n=1;16!=n;++n)out[n-1]="undefined"!=typeof Int32Array?table.subarray(256*n,256*n+256):table.slice(256*n,256*n+256);return out}(T0),T1=TT[0],T2=TT[1],T3=TT[2],T4=TT[3],T5=TT[4],T6=TT[5],T7=TT[6],T8=TT[7],T9=TT[8],Ta=TT[9],Tb=TT[10],Tc=TT[11],Td=TT[12],Te=TT[13],Tf=TT[14];return CRC32.table=T0,CRC32.bstr=function(bstr,seed){for(var C=~seed,i=0,L=bstr.length;i<L;)C=C>>>8^T0[255&(C^bstr.charCodeAt(i++))];return~C},CRC32.buf=function(B,seed){for(var C=~seed,L=B.length-15,i=0;i<L;)C=Tf[B[i++]^255&C]^Te[B[i++]^C>>8&255]^Td[B[i++]^C>>16&255]^Tc[B[i++]^C>>>24]^Tb[B[i++]]^Ta[B[i++]]^T9[B[i++]]^T8[B[i++]]^T7[B[i++]]^T6[B[i++]]^T5[B[i++]]^T4[B[i++]]^T3[B[i++]]^T2[B[i++]]^T1[B[i++]]^T0[B[i++]];for(L+=15;i<L;)C=C>>>8^T0[255&(C^B[i++])];return~C},CRC32.str=function(str,seed){for(var C=~seed,i=0,L=str.length,c=0,d=0;i<L;)(c=str.charCodeAt(i++))<128?C=C>>>8^T0[255&(C^c)]:c<2048?C=(C=C>>>8^T0[255&(C^(192|c>>6&31))])>>>8^T0[255&(C^(128|63&c))]:c>=55296&&c<57344?(c=64+(1023&c),d=1023&str.charCodeAt(i++),C=(C=(C=(C=C>>>8^T0[255&(C^(240|c>>8&7))])>>>8^T0[255&(C^(128|c>>2&63))])>>>8^T0[255&(C^(128|d>>6&15|(3&c)<<4))])>>>8^T0[255&(C^(128|63&d))]):C=(C=(C=C>>>8^T0[255&(C^(224|c>>12&15))])>>>8^T0[255&(C^(128|c>>6&63))])>>>8^T0[255&(C^(128|63&c))];return~C},CRC32}(),CFB=function(){var fs,exports={};function dirname(p){if("/"==p.charAt(p.length-1))return-1===p.slice(0,-1).indexOf("/")?p:dirname(p.slice(0,-1));var c=p.lastIndexOf("/");return-1===c?p:p.slice(0,c+1)}function filename(p){if("/"==p.charAt(p.length-1))return filename(p.slice(0,-1));var c=p.lastIndexOf("/");return-1===c?p:p.slice(c+1)}function write_dos_date(buf,date){"string"==typeof date&&(date=new Date(date));var hms=date.getHours();hms=(hms=hms<<6|date.getMinutes())<<5|date.getSeconds()>>>1,buf.write_shift(2,hms);var ymd=date.getFullYear()-1980;ymd=(ymd=ymd<<4|date.getMonth()+1)<<5|date.getDate(),buf.write_shift(2,ymd)}function parse_extra_field(blob){prep_blob(blob,0);for(var o={},flags=0;blob.l<=blob.length-4;){var type=blob.read_shift(2),sz=blob.read_shift(2),tgt=blob.l+sz,p={};if(21589===type)1&(flags=blob.read_shift(1))&&(p.mtime=blob.read_shift(4)),sz>5&&(2&flags&&(p.atime=blob.read_shift(4)),4&flags&&(p.ctime=blob.read_shift(4))),p.mtime&&(p.mt=new Date(1e3*p.mtime));blob.l=tgt,o[type]=p}return o}function get_fs(){return fs||(fs={})}function parse(file,options){if(80==file[0]&&75==file[1])return parse_zip(file,options);if(109==(32|file[0])&&105==(32|file[1]))return function(file,options){if("mime-version:"!=a2s(file.slice(0,13)).toLowerCase())throw new Error("Unsupported MAD header");var root=options&&options.root||"",data=(has_buf&&Buffer.isBuffer(file)?file.toString("binary"):a2s(file)).split("\r\n"),di=0,row="";for(di=0;di<data.length;++di)if(row=data[di],/^Content-Location:/i.test(row)&&(row=row.slice(row.indexOf("file")),root||(root=row.slice(0,row.lastIndexOf("/")+1)),row.slice(0,root.length)!=root))for(;root.length>0&&(root=(root=root.slice(0,root.length-1)).slice(0,root.lastIndexOf("/")+1),row.slice(0,root.length)!=root););var mboundary=(data[1]||"").match(/boundary="(.*?)"/);if(!mboundary)throw new Error("MAD cannot find boundary");var boundary="--"+(mboundary[1]||""),FileIndex=[],FullPaths=[],o={FileIndex:FileIndex,FullPaths:FullPaths};init_cfb(o);var start_di,fcnt=0;for(di=0;di<data.length;++di){var line=data[di];line!==boundary&&line!==boundary+"--"||(fcnt++&&parse_mime(o,data.slice(start_di,di),root),start_di=di)}return o}(file,options);if(file.length<512)throw new Error("CFB file size "+file.length+" < 512");var mver,nmfs,difat_sec_cnt,dir_start,minifat_start,difat_start,ssz=512,fat_addrs=[],blob=file.slice(0,512);prep_blob(blob,0);var mv=function(blob){if(80==blob[blob.l]&&75==blob[blob.l+1])return[0,0];blob.chk(HEADER_SIGNATURE,"Header Signature: "),blob.l+=16;var mver=blob.read_shift(2,"u");return[blob.read_shift(2,"u"),mver]}(blob);switch(mver=mv[0]){case 3:ssz=512;break;case 4:ssz=4096;break;case 0:if(0==mv[1])return parse_zip(file,options);default:throw new Error("Major Version: Expected 3 or 4 saw "+mver)}512!==ssz&&prep_blob(blob=file.slice(0,ssz),28);var header=file.slice(0,ssz);!function(blob,mver){var shift=9;switch(blob.l+=2,shift=blob.read_shift(2)){case 9:if(3!=mver)throw new Error("Sector Shift: Expected 9 saw "+shift);break;case 12:if(4!=mver)throw new Error("Sector Shift: Expected 12 saw "+shift);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+shift)}blob.chk("0600","Mini Sector Shift: "),blob.chk("000000000000","Reserved: ")}(blob,mver);var dir_cnt=blob.read_shift(4,"i");if(3===mver&&0!==dir_cnt)throw new Error("# Directory Sectors: Expected 0 saw "+dir_cnt);blob.l+=4,dir_start=blob.read_shift(4,"i"),blob.l+=4,blob.chk("00100000","Mini Stream Cutoff Size: "),minifat_start=blob.read_shift(4,"i"),nmfs=blob.read_shift(4,"i"),difat_start=blob.read_shift(4,"i"),difat_sec_cnt=blob.read_shift(4,"i");for(var q=-1,j=0;j<109&&!((q=blob.read_shift(4,"i"))<0);++j)fat_addrs[j]=q;var sectors=function(file,ssz){for(var nsectors=Math.ceil(file.length/ssz)-1,sectors=[],i=1;i<nsectors;++i)sectors[i-1]=file.slice(i*ssz,(i+1)*ssz);return sectors[nsectors-1]=file.slice(nsectors*ssz),sectors}(file,ssz);sleuth_fat(difat_start,difat_sec_cnt,sectors,ssz,fat_addrs);var sector_list=function(sectors,dir_start,fat_addrs,ssz){var sl=sectors.length,sector_list=[],chkd=[],buf=[],buf_chain=[],modulus=ssz-1,i=0,j=0,k=0,jj=0;for(i=0;i<sl;++i)if(buf=[],(k=i+dir_start)>=sl&&(k-=sl),!chkd[k]){buf_chain=[];var seen=[];for(j=k;j>=0;){seen[j]=!0,chkd[j]=!0,buf[buf.length]=j,buf_chain.push(sectors[j]);var addr=fat_addrs[Math.floor(4*j/ssz)];if(ssz<4+(jj=4*j&modulus))throw new Error("FAT boundary crossed: "+j+" 4 "+ssz);if(!sectors[addr])break;if(seen[j=__readInt32LE(sectors[addr],jj)])break}sector_list[k]={nodes:buf,data:__toBuffer([buf_chain])}}return sector_list}(sectors,dir_start,fat_addrs,ssz);sector_list[dir_start].name="!Directory",nmfs>0&&minifat_start!==ENDOFCHAIN&&(sector_list[minifat_start].name="!MiniFAT"),sector_list[fat_addrs[0]].name="!FAT",sector_list.fat_addrs=fat_addrs,sector_list.ssz=ssz;var Paths=[],FileIndex=[],FullPaths=[];!function(dir_start,sector_list,sectors,Paths,nmfs,files,FileIndex,mini){for(var name,minifat_store=0,pl=Paths.length?2:0,sector=sector_list[dir_start].data,i=0,namelen=0;i<sector.length;i+=128){var blob=sector.slice(i,i+128);prep_blob(blob,64),namelen=blob.read_shift(2),name=__utf16le(blob,0,namelen-pl),Paths.push(name);var o={name:name,type:blob.read_shift(1),color:blob.read_shift(1),L:blob.read_shift(4,"i"),R:blob.read_shift(4,"i"),C:blob.read_shift(4,"i"),clsid:blob.read_shift(16),state:blob.read_shift(4,"i"),start:0,size:0};0!==blob.read_shift(2)+blob.read_shift(2)+blob.read_shift(2)+blob.read_shift(2)&&(o.ct=read_date(blob,blob.l-8)),0!==blob.read_shift(2)+blob.read_shift(2)+blob.read_shift(2)+blob.read_shift(2)&&(o.mt=read_date(blob,blob.l-8)),o.start=blob.read_shift(4,"i"),o.size=blob.read_shift(4,"i"),o.size<0&&o.start<0&&(o.size=o.type=0,o.start=ENDOFCHAIN,o.name=""),5===o.type?(minifat_store=o.start,nmfs>0&&minifat_store!==ENDOFCHAIN&&(sector_list[minifat_store].name="!StreamData")):o.size>=4096?(o.storage="fat",void 0===sector_list[o.start]&&(sector_list[o.start]=get_sector_list(sectors,o.start,sector_list.fat_addrs,sector_list.ssz)),sector_list[o.start].name=o.name,o.content=sector_list[o.start].data.slice(0,o.size)):(o.storage="minifat",o.size<0?o.size=0:minifat_store!==ENDOFCHAIN&&o.start!==ENDOFCHAIN&&sector_list[minifat_store]&&(o.content=get_mfat_entry(o,sector_list[minifat_store].data,(sector_list[mini]||{}).data))),o.content&&prep_blob(o.content,0),files[name]=o,FileIndex.push(o)}}(dir_start,sector_list,sectors,Paths,nmfs,{},FileIndex,minifat_start),function(FI,FP,Paths){for(var i=0,L=0,R=0,C=0,j=0,pl=Paths.length,dad=[],q=[];i<pl;++i)dad[i]=q[i]=i,FP[i]=Paths[i];for(;j<q.length;++j)L=FI[i=q[j]].L,R=FI[i].R,C=FI[i].C,dad[i]===i&&(-1!==L&&dad[L]!==L&&(dad[i]=dad[L]),-1!==R&&dad[R]!==R&&(dad[i]=dad[R])),-1!==C&&(dad[C]=i),-1!==L&&i!=dad[i]&&(dad[L]=dad[i],q.lastIndexOf(L)<j&&q.push(L)),-1!==R&&i!=dad[i]&&(dad[R]=dad[i],q.lastIndexOf(R)<j&&q.push(R));for(i=1;i<pl;++i)dad[i]===i&&(-1!==R&&dad[R]!==R?dad[i]=dad[R]:-1!==L&&dad[L]!==L&&(dad[i]=dad[L]));for(i=1;i<pl;++i)if(0!==FI[i].type){if((j=i)!=dad[j])do{j=dad[j],FP[i]=FP[j]+"/"+FP[i]}while(0!==j&&-1!==dad[j]&&j!=dad[j]);dad[i]=-1}for(FP[0]+="/",i=1;i<pl;++i)2!==FI[i].type&&(FP[i]+="/")}(FileIndex,FullPaths,Paths),Paths.shift();var o={FileIndex:FileIndex,FullPaths:FullPaths};return options&&options.raw&&(o.raw={header:header,sectors:sectors}),o}function get_mfat_entry(entry,payload,mini){for(var start=entry.start,size=entry.size,o=[],idx=start;mini&&size>0&&idx>=0;)o.push(payload.slice(idx*MSSZ,idx*MSSZ+MSSZ)),size-=MSSZ,idx=__readInt32LE(mini,4*idx);return 0===o.length?new_buf(0):bconcat(o).slice(0,entry.size)}function sleuth_fat(idx,cnt,sectors,ssz,fat_addrs){var q=ENDOFCHAIN;if(idx===ENDOFCHAIN){if(0!==cnt)throw new Error("DIFAT chain shorter than expected")}else if(-1!==idx){var sector=sectors[idx],m=(ssz>>>2)-1;if(!sector)return;for(var i=0;i<m&&(q=__readInt32LE(sector,4*i))!==ENDOFCHAIN;++i)fat_addrs.push(q);sleuth_fat(__readInt32LE(sector,ssz-4),cnt-1,sectors,ssz,fat_addrs)}}function get_sector_list(sectors,start,fat_addrs,ssz,chkd){var buf=[],buf_chain=[];chkd||(chkd=[]);var modulus=ssz-1,j=0,jj=0;for(j=start;j>=0;){chkd[j]=!0,buf[buf.length]=j,buf_chain.push(sectors[j]);var addr=fat_addrs[Math.floor(4*j/ssz)];if(ssz<4+(jj=4*j&modulus))throw new Error("FAT boundary crossed: "+j+" 4 "+ssz);if(!sectors[addr])break;j=__readInt32LE(sectors[addr],jj)}return{nodes:buf,data:__toBuffer([buf_chain])}}function read_date(blob,offset){return new Date(1e3*(__readUInt32LE(blob,offset+4)/1e7*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7-11644473600))}function init_cfb(cfb,opts){var o=opts||{},root=o.root||"Root Entry";if(cfb.FullPaths||(cfb.FullPaths=[]),cfb.FileIndex||(cfb.FileIndex=[]),cfb.FullPaths.length!==cfb.FileIndex.length)throw new Error("inconsistent CFB structure");0===cfb.FullPaths.length&&(cfb.FullPaths[0]=root+"/",cfb.FileIndex[0]={name:root,type:5}),o.CLSID&&(cfb.FileIndex[0].clsid=o.CLSID),function(cfb){var nm="Sh33tJ5";if(CFB.find(cfb,"/"+nm))return;var p=new_buf(4);p[0]=55,p[1]=p[3]=50,p[2]=54,cfb.FileIndex.push({name:nm,type:2,content:p,size:4,L:69,R:69,C:69}),cfb.FullPaths.push(cfb.FullPaths[0]+nm),rebuild_cfb(cfb)}(cfb)}function rebuild_cfb(cfb,f){init_cfb(cfb);for(var gc=!1,s=!1,i=cfb.FullPaths.length-1;i>=0;--i){var _file=cfb.FileIndex[i];switch(_file.type){case 0:s?gc=!0:(cfb.FileIndex.pop(),cfb.FullPaths.pop());break;case 1:case 2:case 5:s=!0,isNaN(_file.R*_file.L*_file.C)&&(gc=!0),_file.R>-1&&_file.L>-1&&_file.R==_file.L&&(gc=!0);break;default:gc=!0}}if(gc||f){var now=new Date(1987,1,19),j=0,fullPaths=Object.create?Object.create(null):{},data=[];for(i=0;i<cfb.FullPaths.length;++i)fullPaths[cfb.FullPaths[i]]=!0,0!==cfb.FileIndex[i].type&&data.push([cfb.FullPaths[i],cfb.FileIndex[i]]);for(i=0;i<data.length;++i){var dad=dirname(data[i][0]);(s=fullPaths[dad])||(data.push([dad,{name:filename(dad).replace("/",""),type:1,clsid:HEADER_CLSID,ct:now,mt:now,content:null}]),fullPaths[dad]=!0)}for(data.sort((function(x,y){return function(l,r){for(var L=l.split("/"),R=r.split("/"),i=0,c=0,Z=Math.min(L.length,R.length);i<Z;++i){if(c=L[i].length-R[i].length)return c;if(L[i]!=R[i])return L[i]<R[i]?-1:1}return L.length-R.length}(x[0],y[0])})),cfb.FullPaths=[],cfb.FileIndex=[],i=0;i<data.length;++i)cfb.FullPaths[i]=data[i][0],cfb.FileIndex[i]=data[i][1];for(i=0;i<data.length;++i){var elt=cfb.FileIndex[i],nm=cfb.FullPaths[i];if(elt.name=filename(nm).replace("/",""),elt.L=elt.R=elt.C=-(elt.color=1),elt.size=elt.content?elt.content.length:0,elt.start=0,elt.clsid=elt.clsid||HEADER_CLSID,0===i)elt.C=data.length>1?1:-1,elt.size=0,elt.type=5;else if("/"==nm.slice(-1)){for(j=i+1;j<data.length&&dirname(cfb.FullPaths[j])!=nm;++j);for(elt.C=j>=data.length?-1:j,j=i+1;j<data.length&&dirname(cfb.FullPaths[j])!=dirname(nm);++j);elt.R=j>=data.length?-1:j,elt.type=1}else dirname(cfb.FullPaths[i+1]||"")==dirname(nm)&&(elt.R=i+1),elt.type=2}}}function _write(cfb,options){var _opts=options||{};if("mad"==_opts.fileType)return function(cfb,options){for(var opts=options||{},boundary=opts.boundary||"SheetJS",out=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+(boundary="------="+boundary).slice(2)+'"',"","",""],root=cfb.FullPaths[0],fp=root,fi=cfb.FileIndex[0],i=1;i<cfb.FullPaths.length;++i)if(fp=cfb.FullPaths[i].slice(root.length),(fi=cfb.FileIndex[i]).size&&fi.content&&"Sh33tJ5"!=fp){fp=fp.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,(function(c){return"_x"+c.charCodeAt(0).toString(16)+"_"})).replace(/[\u0080-\uFFFF]/g,(function(u){return"_u"+u.charCodeAt(0).toString(16)+"_"}));for(var ca=fi.content,cstr=has_buf&&Buffer.isBuffer(ca)?ca.toString("binary"):a2s(ca),dispcnt=0,L=Math.min(1024,cstr.length),cc=0,csl=0;csl<=L;++csl)(cc=cstr.charCodeAt(csl))>=32&&cc<128&&++dispcnt;var qp=dispcnt>=4*L/5;out.push(boundary),out.push("Content-Location: "+(opts.root||"file:///C:/SheetJS/")+fp),out.push("Content-Transfer-Encoding: "+(qp?"quoted-printable":"base64")),out.push("Content-Type: "+get_content_type(fi,fp)),out.push(""),out.push(qp?write_quoted_printable(cstr):write_base64_76(cstr))}return out.push(boundary+"--\r\n"),out.join("\r\n")}(cfb,_opts);if(rebuild_cfb(cfb),"zip"===_opts.fileType)return function(cfb,options){var _opts=options||{},out=[],cdirs=[],o=new_buf(1),method=_opts.compression?8:0,flags=0,i=0,j=0,start_cd=0,fcnt=0,root=cfb.FullPaths[0],fp=root,fi=cfb.FileIndex[0],crcs=[],sz_cd=0;for(i=1;i<cfb.FullPaths.length;++i)if(fp=cfb.FullPaths[i].slice(root.length),(fi=cfb.FileIndex[i]).size&&fi.content&&"Sh33tJ5"!=fp){var start=start_cd,namebuf=new_buf(fp.length);for(j=0;j<fp.length;++j)namebuf.write_shift(1,127&fp.charCodeAt(j));namebuf=namebuf.slice(0,namebuf.l),crcs[fcnt]=CRC32.buf(fi.content,0);var outbuf=fi.content;8==method&&(outbuf=_deflateRawSync(outbuf)),(o=new_buf(30)).write_shift(4,67324752),o.write_shift(2,20),o.write_shift(2,flags),o.write_shift(2,method),fi.mt?write_dos_date(o,fi.mt):o.write_shift(4,0),o.write_shift(-4,crcs[fcnt]),o.write_shift(4,outbuf.length),o.write_shift(4,fi.content.length),o.write_shift(2,namebuf.length),o.write_shift(2,0),start_cd+=o.length,out.push(o),start_cd+=namebuf.length,out.push(namebuf),start_cd+=outbuf.length,out.push(outbuf),(o=new_buf(46)).write_shift(4,33639248),o.write_shift(2,0),o.write_shift(2,20),o.write_shift(2,flags),o.write_shift(2,method),o.write_shift(4,0),o.write_shift(-4,crcs[fcnt]),o.write_shift(4,outbuf.length),o.write_shift(4,fi.content.length),o.write_shift(2,namebuf.length),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(4,0),o.write_shift(4,start),sz_cd+=o.l,cdirs.push(o),sz_cd+=namebuf.length,cdirs.push(namebuf),++fcnt}return o=new_buf(22),o.write_shift(4,101010256),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,fcnt),o.write_shift(2,fcnt),o.write_shift(4,sz_cd),o.write_shift(4,start_cd),o.write_shift(2,0),bconcat([bconcat(out),bconcat(cdirs),o])}(cfb,_opts);var L=function(cfb){for(var mini_size=0,fat_size=0,i=0;i<cfb.FileIndex.length;++i){var file=cfb.FileIndex[i];if(file.content){var flen=file.content.length;flen>0&&(flen<4096?mini_size+=flen+63>>6:fat_size+=flen+511>>9)}}for(var dir_cnt=cfb.FullPaths.length+3>>2,mfat_cnt=mini_size+127>>7,fat_base=(mini_size+7>>3)+fat_size+dir_cnt+mfat_cnt,fat_cnt=fat_base+127>>7,difat_cnt=fat_cnt<=109?0:Math.ceil((fat_cnt-109)/127);fat_base+fat_cnt+difat_cnt+127>>7>fat_cnt;)difat_cnt=++fat_cnt<=109?0:Math.ceil((fat_cnt-109)/127);var L=[1,difat_cnt,fat_cnt,mfat_cnt,dir_cnt,fat_size,mini_size,0];return cfb.FileIndex[0].size=mini_size<<6,L[7]=(cfb.FileIndex[0].start=L[0]+L[1]+L[2]+L[3]+L[4]+L[5])+(L[6]+7>>3),L}(cfb),o=new_buf(L[7]<<9),i=0,T=0;for(i=0;i<8;++i)o.write_shift(1,HEADER_SIG[i]);for(i=0;i<8;++i)o.write_shift(2,0);for(o.write_shift(2,62),o.write_shift(2,3),o.write_shift(2,65534),o.write_shift(2,9),o.write_shift(2,6),i=0;i<3;++i)o.write_shift(2,0);for(o.write_shift(4,0),o.write_shift(4,L[2]),o.write_shift(4,L[0]+L[1]+L[2]+L[3]-1),o.write_shift(4,0),o.write_shift(4,4096),o.write_shift(4,L[3]?L[0]+L[1]+L[2]-1:ENDOFCHAIN),o.write_shift(4,L[3]),o.write_shift(-4,L[1]?L[0]-1:ENDOFCHAIN),o.write_shift(4,L[1]),i=0;i<109;++i)o.write_shift(-4,i<L[2]?L[1]+i:-1);if(L[1])for(T=0;T<L[1];++T){for(;i<236+127*T;++i)o.write_shift(-4,i<L[2]?L[1]+i:-1);o.write_shift(-4,T===L[1]-1?ENDOFCHAIN:T+1)}var chainit=function(w){for(T+=w;i<T-1;++i)o.write_shift(-4,i+1);w&&(++i,o.write_shift(-4,ENDOFCHAIN))};for(T=i=0,T+=L[1];i<T;++i)o.write_shift(-4,consts.DIFSECT);for(T+=L[2];i<T;++i)o.write_shift(-4,consts.FATSECT);chainit(L[3]),chainit(L[4]);for(var j=0,flen=0,file=cfb.FileIndex[0];j<cfb.FileIndex.length;++j)(file=cfb.FileIndex[j]).content&&((flen=file.content.length)<4096||(file.start=T,chainit(flen+511>>9)));for(chainit(L[6]+7>>3);511&o.l;)o.write_shift(-4,consts.ENDOFCHAIN);for(T=i=0,j=0;j<cfb.FileIndex.length;++j)(file=cfb.FileIndex[j]).content&&(!(flen=file.content.length)||flen>=4096||(file.start=T,chainit(flen+63>>6)));for(;511&o.l;)o.write_shift(-4,consts.ENDOFCHAIN);for(i=0;i<L[4]<<2;++i){var nm=cfb.FullPaths[i];if(nm&&0!==nm.length){file=cfb.FileIndex[i],0===i&&(file.start=file.size?file.start-1:ENDOFCHAIN);var _nm=0===i&&_opts.root||file.name;if(flen=2*(_nm.length+1),o.write_shift(64,_nm,"utf16le"),o.write_shift(2,flen),o.write_shift(1,file.type),o.write_shift(1,file.color),o.write_shift(-4,file.L),o.write_shift(-4,file.R),o.write_shift(-4,file.C),file.clsid)o.write_shift(16,file.clsid,"hex");else for(j=0;j<4;++j)o.write_shift(4,0);o.write_shift(4,file.state||0),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(4,file.start),o.write_shift(4,file.size),o.write_shift(4,0)}else{for(j=0;j<17;++j)o.write_shift(4,0);for(j=0;j<3;++j)o.write_shift(4,-1);for(j=0;j<12;++j)o.write_shift(4,0)}}for(i=1;i<cfb.FileIndex.length;++i)if((file=cfb.FileIndex[i]).size>=4096)if(o.l=file.start+1<<9,has_buf&&Buffer.isBuffer(file.content))file.content.copy(o,o.l,0,file.size),o.l+=file.size+511&-512;else{for(j=0;j<file.size;++j)o.write_shift(1,file.content[j]);for(;511&j;++j)o.write_shift(1,0)}for(i=1;i<cfb.FileIndex.length;++i)if((file=cfb.FileIndex[i]).size>0&&file.size<4096)if(has_buf&&Buffer.isBuffer(file.content))file.content.copy(o,o.l,0,file.size),o.l+=file.size+63&-64;else{for(j=0;j<file.size;++j)o.write_shift(1,file.content[j]);for(;63&j;++j)o.write_shift(1,0)}if(has_buf)o.l=o.length;else for(;o.l<o.length;)o.write_shift(1,0);return o}exports.version="1.2.1";var _zlib,MSSZ=64,ENDOFCHAIN=-2,HEADER_SIGNATURE="d0cf11e0a1b11ae1",HEADER_SIG=[208,207,17,224,161,177,26,225],HEADER_CLSID="00000000000000000000000000000000",consts={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:ENDOFCHAIN,FREESECT:-1,HEADER_SIGNATURE:HEADER_SIGNATURE,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:HEADER_CLSID,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function a2s(o){for(var out=new Array(o.length),i=0;i<o.length;++i)out[i]=String.fromCharCode(o[i]);return out.join("")}function _deflateRawSync(payload){return _zlib?_zlib.deflateRawSync(payload):_deflate(payload)}var CLEN_ORDER=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],LEN_LN=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],DST_LN=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];for(var n,t,use_typed_arrays="undefined"!=typeof Uint8Array,bitswap8=use_typed_arrays?new Uint8Array(256):[],q=0;q<256;++q)bitswap8[q]=(t=void 0,255&((t=139536&((n=q)<<1|n<<11)|558144&(n<<5|n<<15))>>16|t>>8|t));function bit_swap_n(n,b){var rev=bitswap8[255&n];return b<=8?rev>>>8-b:(rev=rev<<8|bitswap8[n>>8&255],b<=16?rev>>>16-b:(rev=rev<<8|bitswap8[n>>16&255])>>>24-b)}function read_bits_2(buf,bl){var w=7&bl,h=bl>>>3;return(buf[h]|(w<=6?0:buf[h+1]<<8))>>>w&3}function read_bits_3(buf,bl){var w=7&bl,h=bl>>>3;return(buf[h]|(w<=5?0:buf[h+1]<<8))>>>w&7}function read_bits_5(buf,bl){var w=7&bl,h=bl>>>3;return(buf[h]|(w<=3?0:buf[h+1]<<8))>>>w&31}function read_bits_7(buf,bl){var w=7&bl,h=bl>>>3;return(buf[h]|(w<=1?0:buf[h+1]<<8))>>>w&127}function read_bits_n(buf,bl,n){var w=7&bl,h=bl>>>3,f=(1<<n)-1,v=buf[h]>>>w;return n<8-w?v&f:(v|=buf[h+1]<<8-w,n<16-w?v&f:(v|=buf[h+2]<<16-w,n<24-w?v&f:(v|=buf[h+3]<<24-w)&f))}function write_bits_3(buf,bl,v){var w=7&bl,h=bl>>>3;return w<=5?buf[h]|=(7&v)<<w:(buf[h]|=v<<w&255,buf[h+1]=(7&v)>>8-w),bl+3}function write_bits_1(buf,bl,v){return v=(1&v)<<(7&bl),buf[bl>>>3]|=v,bl+1}function write_bits_8(buf,bl,v){var h=bl>>>3;return v<<=7&bl,buf[h]|=255&v,v>>>=8,buf[h+1]=v,bl+8}function write_bits_16(buf,bl,v){var h=bl>>>3;return v<<=7&bl,buf[h]|=255&v,v>>>=8,buf[h+1]=255&v,buf[h+2]=v>>>8,bl+16}function realloc(b,sz){var L=b.length,M=2*L>sz?2*L:sz+5,i=0;if(L>=sz)return b;if(has_buf){var o=new_unsafe_buf(M);if(b.copy)b.copy(o);else for(;i<b.length;++i)o[i]=b[i];return o}if(use_typed_arrays){var a=new Uint8Array(M);if(a.set)a.set(b);else for(;i<L;++i)a[i]=b[i];return a}return b.length=M,b}function zero_fill_array(n){for(var o=new Array(n),i=0;i<n;++i)o[i]=0;return o}function build_tree(clens,cmap,MAX){var maxlen=1,w=0,i=0,j=0,ccode=0,L=clens.length,bl_count=use_typed_arrays?new Uint16Array(32):zero_fill_array(32);for(i=0;i<32;++i)bl_count[i]=0;for(i=L;i<MAX;++i)clens[i]=0;L=clens.length;var ctree=use_typed_arrays?new Uint16Array(L):zero_fill_array(L);for(i=0;i<L;++i)bl_count[w=clens[i]]++,maxlen<w&&(maxlen=w),ctree[i]=0;for(bl_count[0]=0,i=1;i<=maxlen;++i)bl_count[i+16]=ccode=ccode+bl_count[i-1]<<1;for(i=0;i<L;++i)0!=(ccode=clens[i])&&(ctree[i]=bl_count[ccode+16]++);var cleni=0;for(i=0;i<L;++i)if(0!=(cleni=clens[i]))for(ccode=bit_swap_n(ctree[i],maxlen)>>maxlen-cleni,j=(1<<maxlen+4-cleni)-1;j>=0;--j)cmap[ccode|j<<cleni]=15&cleni|i<<4;return maxlen}var fix_lmap=use_typed_arrays?new Uint16Array(512):zero_fill_array(512),fix_dmap=use_typed_arrays?new Uint16Array(32):zero_fill_array(32);if(!use_typed_arrays){for(var i=0;i<512;++i)fix_lmap[i]=0;for(i=0;i<32;++i)fix_dmap[i]=0}!function(){for(var dlens=[],i=0;i<32;i++)dlens.push(5);build_tree(dlens,fix_dmap,32);var clens=[];for(i=0;i<=143;i++)clens.push(8);for(;i<=255;i++)clens.push(9);for(;i<=279;i++)clens.push(7);for(;i<=287;i++)clens.push(8);build_tree(clens,fix_lmap,288)}();var _deflateRaw=function(){for(var DST_LN_RE=use_typed_arrays?new Uint8Array(32768):[],j=0,k=0;j<DST_LN.length-1;++j)for(;k<DST_LN[j+1];++k)DST_LN_RE[k]=j;for(;k<32768;++k)DST_LN_RE[k]=29;var LEN_LN_RE=use_typed_arrays?new Uint8Array(259):[];for(j=0,k=0;j<LEN_LN.length-1;++j)for(;k<LEN_LN[j+1];++k)LEN_LN_RE[k]=j;return function(data,out){return data.length<8?function(data,out){for(var boff=0;boff<data.length;){var L=Math.min(65535,data.length-boff),h=boff+L==data.length;for(out.write_shift(1,+h),out.write_shift(2,L),out.write_shift(2,65535&~L);L-- >0;)out[out.l++]=data[boff++]}return out.l}(data,out):function(data,out){for(var bl=0,boff=0,addrs=use_typed_arrays?new Uint16Array(32768):[];boff<data.length;){var L=Math.min(65535,data.length-boff);if(L<10){for(7&(bl=write_bits_3(out,bl,+!(boff+L!=data.length)))&&(bl+=8-(7&bl)),out.l=bl/8|0,out.write_shift(2,L),out.write_shift(2,65535&~L);L-- >0;)out[out.l++]=data[boff++];bl=8*out.l}else{bl=write_bits_3(out,bl,+!(boff+L!=data.length)+2);for(var hash=0;L-- >0;){var d=data[boff],match=-1,mlen=0;if((match=addrs[hash=32767&(hash<<5^d)])&&((match|=-32768&boff)>boff&&(match-=32768),match<boff))for(;data[match+mlen]==data[boff+mlen]&&mlen<250;)++mlen;if(mlen>2){(d=LEN_LN_RE[mlen])<=22?bl=write_bits_8(out,bl,bitswap8[d+1]>>1)-1:(write_bits_8(out,bl,3),write_bits_8(out,bl+=5,bitswap8[d-23]>>5),bl+=3);var len_eb=d<8?0:d-4>>2;len_eb>0&&(write_bits_16(out,bl,mlen-LEN_LN[d]),bl+=len_eb),d=DST_LN_RE[boff-match],bl=write_bits_8(out,bl,bitswap8[d]>>3),bl-=3;var dst_eb=d<4?0:d-2>>1;dst_eb>0&&(write_bits_16(out,bl,boff-match-DST_LN[d]),bl+=dst_eb);for(var q=0;q<mlen;++q)addrs[hash]=32767&boff,hash=32767&(hash<<5^data[boff]),++boff;L-=mlen-1}else d<=143?d+=48:bl=write_bits_1(out,bl,1),bl=write_bits_8(out,bl,bitswap8[d]),addrs[hash]=32767&boff,++boff}bl=write_bits_8(out,bl,0)-1}}return out.l=(bl+7)/8|0,out.l}(data,out)}}();function _deflate(data){var buf=new_buf(50+Math.floor(1.1*data.length)),off=_deflateRaw(data,buf);return buf.slice(0,off)}var dyn_lmap=use_typed_arrays?new Uint16Array(32768):zero_fill_array(32768),dyn_dmap=use_typed_arrays?new Uint16Array(32768):zero_fill_array(32768),dyn_cmap=use_typed_arrays?new Uint16Array(128):zero_fill_array(128),dyn_len_1=1,dyn_len_2=1;function dyn(data,boff){var _HLIT=read_bits_5(data,boff)+257,_HDIST=read_bits_5(data,boff+=5)+1,_HCLEN=function(buf,bl){var w=7&bl,h=bl>>>3;return(buf[h]|(w<=4?0:buf[h+1]<<8))>>>w&15}(data,boff+=5)+4;boff+=4;for(var w=0,clens=use_typed_arrays?new Uint8Array(19):zero_fill_array(19),ctree=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],maxlen=1,bl_count=use_typed_arrays?new Uint8Array(8):zero_fill_array(8),next_code=use_typed_arrays?new Uint8Array(8):zero_fill_array(8),L=clens.length,i=0;i<_HCLEN;++i)clens[CLEN_ORDER[i]]=w=read_bits_3(data,boff),maxlen<w&&(maxlen=w),bl_count[w]++,boff+=3;var ccode=0;for(bl_count[0]=0,i=1;i<=maxlen;++i)next_code[i]=ccode=ccode+bl_count[i-1]<<1;for(i=0;i<L;++i)0!=(ccode=clens[i])&&(ctree[i]=next_code[ccode]++);var cleni=0;for(i=0;i<L;++i)if(0!=(cleni=clens[i])){ccode=bitswap8[ctree[i]]>>8-cleni;for(var j=(1<<7-cleni)-1;j>=0;--j)dyn_cmap[ccode|j<<cleni]=7&cleni|i<<3}var hcodes=[];for(maxlen=1;hcodes.length<_HLIT+_HDIST;)switch(boff+=7&(ccode=dyn_cmap[read_bits_7(data,boff)]),ccode>>>=3){case 16:for(w=3+read_bits_2(data,boff),boff+=2,ccode=hcodes[hcodes.length-1];w-- >0;)hcodes.push(ccode);break;case 17:for(w=3+read_bits_3(data,boff),boff+=3;w-- >0;)hcodes.push(0);break;case 18:for(w=11+read_bits_7(data,boff),boff+=7;w-- >0;)hcodes.push(0);break;default:hcodes.push(ccode),maxlen<ccode&&(maxlen=ccode)}var h1=hcodes.slice(0,_HLIT),h2=hcodes.slice(_HLIT);for(i=_HLIT;i<286;++i)h1[i]=0;for(i=_HDIST;i<30;++i)h2[i]=0;return dyn_len_1=build_tree(h1,dyn_lmap,286),dyn_len_2=build_tree(h2,dyn_dmap,30),boff}function _inflate(payload,usz){var out=function(data,usz){if(3==data[0]&&!(3&data[1]))return[new_raw_buf(usz),2];for(var boff=0,header=0,outbuf=new_unsafe_buf(usz||1<<18),woff=0,OL=outbuf.length>>>0,max_len_1=0,max_len_2=0;!(1&header);)if(header=read_bits_3(data,boff),boff+=3,header>>>1!=0)for(header>>1==1?(max_len_1=9,max_len_2=5):(boff=dyn(data,boff),max_len_1=dyn_len_1,max_len_2=dyn_len_2);;){!usz&&OL<woff+32767&&(OL=(outbuf=realloc(outbuf,woff+32767)).length);var bits=read_bits_n(data,boff,max_len_1),code=header>>>1==1?fix_lmap[bits]:dyn_lmap[bits];if(boff+=15&code,(code>>>=4)>>>8&255){if(256==code)break;var len_eb=(code-=257)<8?0:code-4>>2;len_eb>5&&(len_eb=0);var tgt=woff+LEN_LN[code];len_eb>0&&(tgt+=read_bits_n(data,boff,len_eb),boff+=len_eb),bits=read_bits_n(data,boff,max_len_2),boff+=15&(code=header>>>1==1?fix_dmap[bits]:dyn_dmap[bits]);var dst_eb=(code>>>=4)<4?0:code-2>>1,dst=DST_LN[code];for(dst_eb>0&&(dst+=read_bits_n(data,boff,dst_eb),boff+=dst_eb),!usz&&OL<tgt&&(OL=(outbuf=realloc(outbuf,tgt+100)).length);woff<tgt;)outbuf[woff]=outbuf[woff-dst],++woff}else outbuf[woff++]=code}else{7&boff&&(boff+=8-(7&boff));var sz=data[boff>>>3]|data[1+(boff>>>3)]<<8;if(boff+=32,sz>0)for(!usz&&OL<woff+sz&&(OL=(outbuf=realloc(outbuf,woff+sz)).length);sz-- >0;)outbuf[woff++]=data[boff>>>3],boff+=8}return usz?[outbuf,boff+7>>>3]:[outbuf.slice(0,woff),boff+7>>>3]}(payload.slice(payload.l||0),usz);return payload.l+=out[1],out[0]}function warn_or_throw(wrn,msg){if(!wrn)throw new Error(msg);"undefined"!=typeof console&&console.error(msg)}function parse_zip(file,options){var blob=file;prep_blob(blob,0);var o={FileIndex:[],FullPaths:[]};init_cfb(o,{root:options.root});for(var i=blob.length-4;(80!=blob[i]||75!=blob[i+1]||5!=blob[i+2]||6!=blob[i+3])&&i>=0;)--i;blob.l=i+4,blob.l+=4;var fcnt=blob.read_shift(2);blob.l+=6;var start_cd=blob.read_shift(4);for(blob.l=start_cd,i=0;i<fcnt;++i){blob.l+=20;var csz=blob.read_shift(4),usz=blob.read_shift(4),namelen=blob.read_shift(2),efsz=blob.read_shift(2),fcsz=blob.read_shift(2);blob.l+=8;var offset=blob.read_shift(4),EF=parse_extra_field(blob.slice(blob.l+namelen,blob.l+namelen+efsz));blob.l+=namelen+efsz+fcsz;var L=blob.l;blob.l=offset+4,parse_local_file(blob,csz,usz,o,EF),blob.l=L}return o}function parse_local_file(blob,csz,usz,o,EF){blob.l+=2;var flags=blob.read_shift(2),meth=blob.read_shift(2),date=function(buf){var hms=65535&buf.read_shift(2),ymd=65535&buf.read_shift(2),val=new Date,d=31&ymd,m=15&(ymd>>>=5);ymd>>>=4,val.setMilliseconds(0),val.setFullYear(ymd+1980),val.setMonth(m-1),val.setDate(d);var S=31&hms,M=63&(hms>>>=5);return hms>>>=6,val.setHours(hms),val.setMinutes(M),val.setSeconds(S<<1),val}(blob);if(8257&flags)throw new Error("Unsupported ZIP encryption");blob.read_shift(4);for(var _csz=blob.read_shift(4),_usz=blob.read_shift(4),namelen=blob.read_shift(2),efsz=blob.read_shift(2),name="",i=0;i<namelen;++i)name+=String.fromCharCode(blob[blob.l++]);if(efsz){var ef=parse_extra_field(blob.slice(blob.l,blob.l+efsz));(ef[21589]||{}).mt&&(date=ef[21589].mt),((EF||{})[21589]||{}).mt&&(date=EF[21589].mt)}blob.l+=efsz;var data=blob.slice(blob.l,blob.l+_csz);switch(meth){case 8:data=function(payload,usz){if(!_zlib)return _inflate(payload,usz);var InflRaw=new(0,_zlib.InflateRaw),out=InflRaw._processChunk(payload.slice(payload.l),InflRaw._finishFlushFlag);return payload.l+=InflRaw.bytesRead,out}(blob,_usz);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+meth)}var wrn=!1;8&flags&&(134695760==blob.read_shift(4)&&(blob.read_shift(4),wrn=!0),_csz=blob.read_shift(4),_usz=blob.read_shift(4)),_csz!=csz&&warn_or_throw(wrn,"Bad compressed size: "+csz+" != "+_csz),_usz!=usz&&warn_or_throw(wrn,"Bad uncompressed size: "+usz+" != "+_usz),cfb_add(o,name,data,{unsafe:!0,mt:date})}var ContentTypeMap={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function get_content_type(fi,fp){if(fi.ctype)return fi.ctype;var ext=fi.name||"",m=ext.match(/\.([^\.]+)$/);return m&&ContentTypeMap[m[1]]||fp&&(m=(ext=fp).match(/[\.\\]([^\.\\])+$/))&&ContentTypeMap[m[1]]?ContentTypeMap[m[1]]:"application/octet-stream"}function write_base64_76(bstr){for(var data=Base64_encode(bstr),o=[],i=0;i<data.length;i+=76)o.push(data.slice(i,i+76));return o.join("\r\n")+"\r\n"}function write_quoted_printable(text){var encoded=text.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,(function(c){var w=c.charCodeAt(0).toString(16).toUpperCase();return"="+(1==w.length?"0"+w:w)}));"\n"==(encoded=encoded.replace(/ $/gm,"=20").replace(/\t$/gm,"=09")).charAt(0)&&(encoded="=0D"+encoded.slice(1));for(var o=[],split=(encoded=encoded.replace(/\r(?!\n)/gm,"=0D").replace(/\n\n/gm,"\n=0A").replace(/([^\r\n])\n/gm,"$1=0A")).split("\r\n"),si=0;si<split.length;++si){var str=split[si];if(0!=str.length)for(var i=0;i<str.length;){var end=76,tmp=str.slice(i,i+end);"="==tmp.charAt(end-1)?end--:"="==tmp.charAt(end-2)?end-=2:"="==tmp.charAt(end-3)&&(end-=3),tmp=str.slice(i,i+end),(i+=end)<str.length&&(tmp+="="),o.push(tmp)}else o.push("")}return o.join("\r\n")}function parse_mime(cfb,data,root){for(var fdata,fname="",cte="",ctype="",di=0;di<10;++di){var line=data[di];if(!line||line.match(/^\s*$/))break;var m=line.match(/^(.*?):\s*([^\s].*)$/);if(m)switch(m[1].toLowerCase()){case"content-location":fname=m[2].trim();break;case"content-type":ctype=m[2].trim();break;case"content-transfer-encoding":cte=m[2].trim()}}switch(++di,cte.toLowerCase()){case"base64":fdata=s2a(Base64_decode(data.slice(di).join("")));break;case"quoted-printable":fdata=function(data){for(var o=[],di=0;di<data.length;++di){for(var line=data[di];di<=data.length&&"="==line.charAt(line.length-1);)line=line.slice(0,line.length-1)+data[++di];o.push(line)}for(var oi=0;oi<o.length;++oi)o[oi]=o[oi].replace(/[=][0-9A-Fa-f]{2}/g,(function($$){return String.fromCharCode(parseInt($$.slice(1),16))}));return s2a(o.join("\r\n"))}(data.slice(di));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+cte)}var file=cfb_add(cfb,fname.slice(root.length),fdata,{unsafe:!0});ctype&&(file.ctype=ctype)}function cfb_add(cfb,name,content,opts){var unsafe=opts&&opts.unsafe;unsafe||init_cfb(cfb);var file=!unsafe&&CFB.find(cfb,name);if(!file){var fpath=cfb.FullPaths[0];name.slice(0,fpath.length)==fpath?fpath=name:("/"!=fpath.slice(-1)&&(fpath+="/"),fpath=(fpath+name).replace("//","/")),file={name:filename(name),type:2},cfb.FileIndex.push(file),cfb.FullPaths.push(fpath),unsafe||CFB.utils.cfb_gc(cfb)}return file.content=content,file.size=content?content.length:0,opts&&(opts.CLSID&&(file.clsid=opts.CLSID),opts.mt&&(file.mt=opts.mt),opts.ct&&(file.ct=opts.ct)),file}return exports.find=function(cfb,path){var UCFullPaths=cfb.FullPaths.map((function(x){return x.toUpperCase()})),UCPaths=UCFullPaths.map((function(x){var y=x.split("/");return y[y.length-("/"==x.slice(-1)?2:1)]})),k=!1;47===path.charCodeAt(0)?(k=!0,path=UCFullPaths[0].slice(0,-1)+path):k=-1!==path.indexOf("/");var UCPath=path.toUpperCase(),w=!0===k?UCFullPaths.indexOf(UCPath):UCPaths.indexOf(UCPath);if(-1!==w)return cfb.FileIndex[w];var m=!UCPath.match(chr1);for(UCPath=UCPath.replace(chr0,""),m&&(UCPath=UCPath.replace(chr1,"!")),w=0;w<UCFullPaths.length;++w){if((m?UCFullPaths[w].replace(chr1,"!"):UCFullPaths[w]).replace(chr0,"")==UCPath)return cfb.FileIndex[w];if((m?UCPaths[w].replace(chr1,"!"):UCPaths[w]).replace(chr0,"")==UCPath)return cfb.FileIndex[w]}return null},exports.read=function(blob,options){var type=options&&options.type;switch(type||has_buf&&Buffer.isBuffer(blob)&&(type="buffer"),type||"base64"){case"file":return function(filename,options){return get_fs(),parse(fs.readFileSync(filename),options)}(blob,options);case"base64":return parse(s2a(Base64_decode(blob)),options);case"binary":return parse(s2a(blob),options)}return parse(blob,options)},exports.parse=parse,exports.write=function(cfb,options){var o=_write(cfb,options);switch(options&&options.type||"buffer"){case"file":return get_fs(),fs.writeFileSync(options.filename,o),o;case"binary":return"string"==typeof o?o:a2s(o);case"base64":return Base64_encode("string"==typeof o?o:a2s(o));case"buffer":if(has_buf)return Buffer.isBuffer(o)?o:Buffer_from(o);case"array":return"string"==typeof o?s2a(o):o}return o},exports.writeFile=function(cfb,filename,options){get_fs();var o=_write(cfb,options);fs.writeFileSync(filename,o)},exports.utils={cfb_new:function(opts){var o={};return init_cfb(o,opts),o},cfb_add:cfb_add,cfb_del:function(cfb,name){init_cfb(cfb);var file=CFB.find(cfb,name);if(file)for(var j=0;j<cfb.FileIndex.length;++j)if(cfb.FileIndex[j]==file)return cfb.FileIndex.splice(j,1),cfb.FullPaths.splice(j,1),!0;return!1},cfb_mov:function(cfb,old_name,new_name){init_cfb(cfb);var file=CFB.find(cfb,old_name);if(file)for(var j=0;j<cfb.FileIndex.length;++j)if(cfb.FileIndex[j]==file)return cfb.FileIndex[j].name=filename(new_name),cfb.FullPaths[j]=new_name,!0;return!1},cfb_gc:function(cfb){rebuild_cfb(cfb,!0)},ReadShift:ReadShift,CheckField:CheckField,prep_blob:prep_blob,bconcat:bconcat,use_zlib:function(zlib){try{var InflRaw=new(0,zlib.InflateRaw);if(InflRaw._processChunk(new Uint8Array([3,0]),InflRaw._finishFlushFlag),!InflRaw.bytesRead)throw new Error("zlib does not expose bytesRead");_zlib=zlib}catch(e){console.error("cannot use native zlib: "+(e.message||e))}},_deflateRaw:_deflate,_inflateRaw:_inflate,consts:consts},exports}();function blobify(data){return"string"==typeof data?s2ab(data):Array.isArray(data)?function(data){if("undefined"==typeof Uint8Array)throw new Error("Unsupported");return new Uint8Array(data)}(data):data}function write_dl(fname,payload,enc){if("undefined"!=typeof Deno){if(enc&&"string"==typeof payload)switch(enc){case"utf8":payload=new TextEncoder(enc).encode(payload);break;case"binary":payload=s2ab(payload);break;default:throw new Error("Unsupported encoding "+enc)}return Deno.writeFileSync(fname,payload)}var data="utf8"==enc?utf8write(payload):payload;if("undefined"!=typeof IE_SaveFile)return IE_SaveFile(data,fname);if("undefined"!=typeof Blob){var blob=new Blob([blobify(data)],{type:"application/octet-stream"});if("undefined"!=typeof navigator&&navigator.msSaveBlob)return navigator.msSaveBlob(blob,fname);if("undefined"!=typeof saveAs)return saveAs(blob,fname);if("undefined"!=typeof URL&&"undefined"!=typeof document&&document.createElement&&URL.createObjectURL){var url=URL.createObjectURL(blob);if("object"==typeof chrome&&"function"==typeof(chrome.downloads||{}).download)return URL.revokeObjectURL&&"undefined"!=typeof setTimeout&&setTimeout((function(){URL.revokeObjectURL(url)}),6e4),chrome.downloads.download({url:url,filename:fname,saveAs:!0});var a=document.createElement("a");if(null!=a.download)return a.download=fname,a.href=url,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL&&"undefined"!=typeof setTimeout&&setTimeout((function(){URL.revokeObjectURL(url)}),6e4),url}}if("undefined"!=typeof $&&"undefined"!=typeof File&&"undefined"!=typeof Folder)try{var out=File(fname);return out.open("w"),out.encoding="binary",Array.isArray(payload)&&(payload=a2s(payload)),out.write(payload),out.close(),payload}catch(e){if(!e.message||!e.message.match(/onstruct/))throw e}throw new Error("cannot save file "+fname)}function keys(o){for(var ks=Object.keys(o),o2=[],i=0;i<ks.length;++i)Object.prototype.hasOwnProperty.call(o,ks[i])&&o2.push(ks[i]);return o2}function evert_key(obj,key){for(var o=[],K=keys(obj),i=0;i!==K.length;++i)null==o[obj[K[i]][key]]&&(o[obj[K[i]][key]]=K[i]);return o}function evert(obj){for(var o=[],K=keys(obj),i=0;i!==K.length;++i)o[obj[K[i]]]=K[i];return o}function evert_num(obj){for(var o=[],K=keys(obj),i=0;i!==K.length;++i)o[obj[K[i]]]=parseInt(K[i],10);return o}var basedate=new Date(1899,11,30,0,0,0);function datenum(v,date1904){var epoch=v.getTime();return date1904&&(epoch-=1263168e5),(epoch-(basedate.getTime()+6e4*(v.getTimezoneOffset()-basedate.getTimezoneOffset())))/864e5}var refdate=new Date,dnthresh=basedate.getTime()+6e4*(refdate.getTimezoneOffset()-basedate.getTimezoneOffset()),refoffset=refdate.getTimezoneOffset();function numdate(v){var out=new Date;return out.setTime(24*v*60*60*1e3+dnthresh),out.getTimezoneOffset()!==refoffset&&out.setTime(out.getTime()+6e4*(out.getTimezoneOffset()-refoffset)),out}var good_pd_date_1=new Date("2017-02-19T19:06:09.000Z"),good_pd_date=isNaN(good_pd_date_1.getFullYear())?new Date("2/19/17"):good_pd_date_1,good_pd=2017==good_pd_date.getFullYear();function parseDate(str,fixdate){var d=new Date(str);if(good_pd)return fixdate>0?d.setTime(d.getTime()+60*d.getTimezoneOffset()*1e3):fixdate<0&&d.setTime(d.getTime()-60*d.getTimezoneOffset()*1e3),d;if(str instanceof Date)return str;if(1917==good_pd_date.getFullYear()&&!isNaN(d.getFullYear())){var s=d.getFullYear();return str.indexOf(""+s)>-1||d.setFullYear(d.getFullYear()+100),d}var n=str.match(/\d+/g)||["2017","2","19","0","0","0"],out=new Date(+n[0],+n[1]-1,+n[2],+n[3]||0,+n[4]||0,+n[5]||0);return str.indexOf("Z")>-1&&(out=new Date(out.getTime()-60*out.getTimezoneOffset()*1e3)),out}function cc2str(arr,debomit){if(has_buf&&Buffer.isBuffer(arr)){if(debomit){if(255==arr[0]&&254==arr[1])return utf8write(arr.slice(2).toString("utf16le"));if(254==arr[1]&&255==arr[2])return utf8write(function(data){for(var o=[],i=0;i<data.length>>1;++i)o[i]=String.fromCharCode(data.charCodeAt(2*i+1)+(data.charCodeAt(2*i)<<8));return o.join("")}(arr.slice(2).toString("binary")))}return arr.toString("binary")}if("undefined"!=typeof TextDecoder)try{if(debomit){if(255==arr[0]&&254==arr[1])return utf8write(new TextDecoder("utf-16le").decode(arr.slice(2)));if(254==arr[0]&&255==arr[1])return utf8write(new TextDecoder("utf-16be").decode(arr.slice(2)))}var rev={"€":"","‚":"","ƒ":"","„":"","…":"","†":"","‡":"","ˆ":"","‰":"","Š":"","‹":"","Œ":"","Ž":"","‘":"","’":"","“":"","”":"","•":"","–":"","—":"","˜":"","™":"","š":"","›":"","œ":"","ž":"","Ÿ":""};return Array.isArray(arr)&&(arr=new Uint8Array(arr)),new TextDecoder("latin1").decode(arr).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,(function(c){return rev[c]||c}))}catch(e){}for(var o=[],i=0;i!=arr.length;++i)o.push(String.fromCharCode(arr[i]));return o.join("")}function dup(o){if("undefined"!=typeof JSON&&!Array.isArray(o))return JSON.parse(JSON.stringify(o));if("object"!=typeof o||null==o)return o;if(o instanceof Date)return new Date(o.getTime());var out={};for(var k in o)Object.prototype.hasOwnProperty.call(o,k)&&(out[k]=dup(o[k]));return out}function fill(c,l){for(var o="";o.length<l;)o+=c;return o}function fuzzynum(s){var v=Number(s);if(!isNaN(v))return isFinite(v)?v:NaN;if(!/\d/.test(s))return v;var wt=1,ss=s.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,(function(){return wt*=100,""}));return isNaN(v=Number(ss))?(ss=ss.replace(/[(](.*)[)]/,(function($$,$1){return wt=-wt,$1})),isNaN(v=Number(ss))?v:v/wt):v/wt}var lower_months=["january","february","march","april","may","june","july","august","september","october","november","december"];function fuzzydate(s){var o=new Date(s),n=new Date(NaN),y=o.getYear(),m=o.getMonth(),d=o.getDate();if(isNaN(d))return n;var lower=s.toLowerCase();if(lower.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if((lower=lower.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,"")).length>3&&-1==lower_months.indexOf(lower))return n}else if(lower.match(/[a-z]/))return n;return y<0||y>8099?n:(m>0||d>1)&&101!=y?o:s.match(/[^-0-9:,\/\\]/)?n:o}function zip_add_file(zip,path,content){if(zip.FullPaths){var res;if("string"==typeof content)return res=has_buf?Buffer_from(content):function(content){for(var out=[],widx=0,L=content.length+250,o=new_raw_buf(content.length+255),ridx=0;ridx<content.length;++ridx){var c=content.charCodeAt(ridx);if(c<128)o[widx++]=c;else if(c<2048)o[widx++]=192|c>>6&31,o[widx++]=128|63&c;else if(c>=55296&&c<57344){c=64+(1023&c);var d=1023&content.charCodeAt(++ridx);o[widx++]=240|c>>8&7,o[widx++]=128|c>>2&63,o[widx++]=128|d>>6&15|(3&c)<<4,o[widx++]=128|63&d}else o[widx++]=224|c>>12&15,o[widx++]=128|c>>6&63,o[widx++]=128|63&c;widx>L&&(out.push(o.slice(0,widx)),widx=0,o=new_raw_buf(65535),L=65530)}return out.push(o.slice(0,widx)),bconcat(out)}(content),CFB.utils.cfb_add(zip,path,res);CFB.utils.cfb_add(zip,path,content)}else zip.file(path,content)}function zip_new(){return CFB.utils.cfb_new()}var XML_HEADER='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n',rencoding=evert({"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"}),decregex=/[&<>'"]/g,charegex=/[\u0000-\u0008\u000b-\u001f]/g;function escapexml(text){return(text+"").replace(decregex,(function(y){return rencoding[y]})).replace(charegex,(function(s){return"_x"+("000"+s.charCodeAt(0).toString(16)).slice(-4)+"_"}))}function escapexmltag(text){return escapexml(text).replace(/ /g,"_x0020_")}var htmlcharegex=/[\u0000-\u001f]/g;function utf8reada(orig){for(var out="",i=0,c=0,d=0,e=0,f=0,w=0;i<orig.length;)(c=orig.charCodeAt(i++))<128?out+=String.fromCharCode(c):(d=orig.charCodeAt(i++),c>191&&c<224?(f=(31&c)<<6,f|=63&d,out+=String.fromCharCode(f)):(e=orig.charCodeAt(i++),c<240?out+=String.fromCharCode((15&c)<<12|(63&d)<<6|63&e):(w=((7&c)<<18|(63&d)<<12|(63&e)<<6|63&(f=orig.charCodeAt(i++)))-65536,out+=String.fromCharCode(55296+(w>>>10&1023)),out+=String.fromCharCode(56320+(1023&w)))));return out}function utf8readb(data){var w,i,c,out=new_raw_buf(2*data.length),j=1,k=0,ww=0;for(i=0;i<data.length;i+=j)j=1,(c=data.charCodeAt(i))<128?w=c:c<224?(w=64*(31&c)+(63&data.charCodeAt(i+1)),j=2):c<240?(w=4096*(15&c)+64*(63&data.charCodeAt(i+1))+(63&data.charCodeAt(i+2)),j=3):(j=4,w=262144*(7&c)+4096*(63&data.charCodeAt(i+1))+64*(63&data.charCodeAt(i+2))+(63&data.charCodeAt(i+3)),ww=55296+((w-=65536)>>>10&1023),w=56320+(1023&w)),0!==ww&&(out[k++]=255&ww,out[k++]=ww>>>8,ww=0),out[k++]=w%256,out[k++]=w>>>8;return out.slice(0,k).toString("ucs2")}function utf8readc(data){return Buffer_from(data,"binary").toString("utf8")}var utf8corpus="foo bar bazâð£",utf8read=has_buf&&(utf8readc(utf8corpus)==utf8reada(utf8corpus)&&utf8readc||utf8readb(utf8corpus)==utf8reada(utf8corpus)&&utf8readb)||utf8reada,utf8write=has_buf?function(data){return Buffer_from(data,"utf8").toString("binary")}:function(orig){for(var out=[],i=0,c=0,d=0;i<orig.length;)switch(c=orig.charCodeAt(i++),!0){case c<128:out.push(String.fromCharCode(c));break;case c<2048:out.push(String.fromCharCode(192+(c>>6))),out.push(String.fromCharCode(128+(63&c)));break;case c>=55296&&c<57344:c-=55296,d=orig.charCodeAt(i++)-56320+(c<<10),out.push(String.fromCharCode(240+(d>>18&7))),out.push(String.fromCharCode(144+(d>>12&63))),out.push(String.fromCharCode(128+(d>>6&63))),out.push(String.fromCharCode(128+(63&d)));break;default:out.push(String.fromCharCode(224+(c>>12))),out.push(String.fromCharCode(128+(c>>6&63))),out.push(String.fromCharCode(128+(63&c)))}return out.join("")},htmldecode=function(){var entities=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map((function(x){return[new RegExp("&"+x[0]+";","ig"),x[1]]}));return function(str){for(var o=str.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),i=0;i<entities.length;++i)o=o.replace(entities[i][0],entities[i][1]);return o}}(),wtregex=/(^\s|\s$|\n)/;function writetag(f,g){return"<"+f+(g.match(wtregex)?' xml:space="preserve"':"")+">"+g+"</"+f+">"}function wxt_helper(h){return keys(h).map((function(k){return" "+k+'="'+h[k]+'"'})).join("")}function writextag(f,g,h){return"<"+f+(null!=h?wxt_helper(h):"")+(null!=g?(g.match(wtregex)?' xml:space="preserve"':"")+">"+g+"</"+f:"/")+">"}function write_w3cdtf(d,t){try{return d.toISOString().replace(/\.\d*/,"")}catch(e){if(t)throw e}return""}var XMLNS_CORE_PROPS="http://schemas.openxmlformats.org/package/2006/metadata/core-properties",XMLNS_CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",XMLNS_EXT_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",XMLNS_CT="http://schemas.openxmlformats.org/package/2006/content-types",XMLNS_RELS="http://schemas.openxmlformats.org/package/2006/relationships",XMLNS_TCMNT="http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",XMLNS_dc="http://purl.org/dc/elements/1.1/",XMLNS_dcterms="http://purl.org/dc/terms/",XMLNS_dcmitype="http://purl.org/dc/dcmitype/",XMLNS_r="http://schemas.openxmlformats.org/officeDocument/2006/relationships",XMLNS_vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",XMLNS_xsi="http://www.w3.org/2001/XMLSchema-instance",XMLNS_xsd="http://www.w3.org/2001/XMLSchema",XMLNS_main=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],XLMLNS_o="urn:schemas-microsoft-com:office:office",XLMLNS_x="urn:schemas-microsoft-com:office:excel",XLMLNS_ss="urn:schemas-microsoft-com:office:spreadsheet",XLMLNS_dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",XLMLNS_mv="http://macVmlSchemaUri",XLMLNS_v="urn:schemas-microsoft-com:vml",XLMLNS_html="http://www.w3.org/TR/REC-html40";var ___toBuffer=function(bufs){for(var x=[],i=0;i<bufs[0].length;++i)if(bufs[0][i])for(var j=0,L=bufs[0][i].length;j<L;j+=10240)x.push.apply(x,bufs[0][i].slice(j,j+10240));return x},__toBuffer=has_buf?function(bufs){return bufs[0].length>0&&Buffer.isBuffer(bufs[0][0])?Buffer.concat(bufs[0].map((function(x){return Buffer.isBuffer(x)?x:Buffer_from(x)}))):___toBuffer(bufs)}:___toBuffer,___utf16le=function(b,s,e){for(var ss=[],i=s;i<e;i+=2)ss.push(String.fromCharCode(__readUInt16LE(b,i)));return ss.join("").replace(chr0,"")},__utf16le=has_buf?function(b,s,e){return Buffer.isBuffer(b)?b.toString("utf16le",s,e).replace(chr0,""):___utf16le(b,s,e)}:___utf16le,___hexlify=function(b,s,l){for(var ss=[],i=s;i<s+l;++i)ss.push(("0"+b[i].toString(16)).slice(-2));return ss.join("")},__hexlify=has_buf?function(b,s,l){return Buffer.isBuffer(b)?b.toString("hex",s,s+l):___hexlify(b,s,l)}:___hexlify,___utf8=function(b,s,e){for(var ss=[],i=s;i<e;i++)ss.push(String.fromCharCode(__readUInt8(b,i)));return ss.join("")},__utf8=has_buf?function(b,s,e){return Buffer.isBuffer(b)?b.toString("utf8",s,e):___utf8(b,s,e)}:___utf8,___lpstr=function(b,i){var len=__readUInt32LE(b,i);return len>0?__utf8(b,i+4,i+4+len-1):""},__lpstr=___lpstr,___cpstr=function(b,i){var len=__readUInt32LE(b,i);return len>0?__utf8(b,i+4,i+4+len-1):""},__cpstr=___cpstr,___lpwstr=function(b,i){var len=2*__readUInt32LE(b,i);return len>0?__utf8(b,i+4,i+4+len-1):""},__lpwstr=___lpwstr,___lpp4=function(b,i){var len=__readUInt32LE(b,i);return len>0?__utf16le(b,i+4,i+4+len):""},__lpp4=___lpp4,___8lpp4=function(b,i){var len=__readUInt32LE(b,i);return len>0?__utf8(b,i+4,i+4+len):""},__8lpp4=___8lpp4,___double=function(b,idx){return function(b,idx){for(var s=1-2*(b[idx+7]>>>7),e=((127&b[idx+7])<<4)+(b[idx+6]>>>4&15),m=15&b[idx+6],i=5;i>=0;--i)m=256*m+b[idx+i];return 2047==e?0==m?s*(1/0):NaN:(0==e?e=-1022:(e-=1023,m+=Math.pow(2,52)),s*Math.pow(2,e-52)*m)}(b,idx)},__double=___double,is_buf=function(a){return Array.isArray(a)||"undefined"!=typeof Uint8Array&&a instanceof Uint8Array};has_buf&&(__lpstr=function(b,i){if(!Buffer.isBuffer(b))return ___lpstr(b,i);var len=b.readUInt32LE(i);return len>0?b.toString("utf8",i+4,i+4+len-1):""},__cpstr=function(b,i){if(!Buffer.isBuffer(b))return ___cpstr(b,i);var len=b.readUInt32LE(i);return len>0?b.toString("utf8",i+4,i+4+len-1):""},__lpwstr=function(b,i){if(!Buffer.isBuffer(b))return ___lpwstr(b,i);var len=2*b.readUInt32LE(i);return b.toString("utf16le",i+4,i+4+len-1)},__lpp4=function(b,i){if(!Buffer.isBuffer(b))return ___lpp4(b,i);var len=b.readUInt32LE(i);return b.toString("utf16le",i+4,i+4+len)},__8lpp4=function(b,i){if(!Buffer.isBuffer(b))return ___8lpp4(b,i);var len=b.readUInt32LE(i);return b.toString("utf8",i+4,i+4+len)},__double=function(b,i){return Buffer.isBuffer(b)?b.readDoubleLE(i):___double(b,i)},is_buf=function(a){return Buffer.isBuffer(a)||Array.isArray(a)||"undefined"!=typeof Uint8Array&&a instanceof Uint8Array});var __readUInt8=function(b,idx){return b[idx]},__readUInt16LE=function(b,idx){return 256*b[idx+1]+b[idx]},__readInt16LE=function(b,idx){var u=256*b[idx+1]+b[idx];return u<32768?u:-1*(65535-u+1)},__readUInt32LE=function(b,idx){return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]},__readInt32LE=function(b,idx){return b[idx+3]<<24|b[idx+2]<<16|b[idx+1]<<8|b[idx]},__readInt32BE=function(b,idx){return b[idx]<<24|b[idx+1]<<16|b[idx+2]<<8|b[idx+3]};function ReadShift(size,t){var oI,oR,w,vv,i,loc,o="",oo=[];switch(t){case"dbcs":if(loc=this.l,has_buf&&Buffer.isBuffer(this))o=this.slice(this.l,this.l+2*size).toString("utf16le");else for(i=0;i<size;++i)o+=String.fromCharCode(__readUInt16LE(this,loc)),loc+=2;size*=2;break;case"utf8":o=__utf8(this,this.l,this.l+size);break;case"utf16le":size*=2,o=__utf16le(this,this.l,this.l+size);break;case"wstr":return ReadShift.call(this,size,"dbcs");case"lpstr-ansi":o=__lpstr(this,this.l),size=4+__readUInt32LE(this,this.l);break;case"lpstr-cp":o=__cpstr(this,this.l),size=4+__readUInt32LE(this,this.l);break;case"lpwstr":o=__lpwstr(this,this.l),size=4+2*__readUInt32LE(this,this.l);break;case"lpp4":size=4+__readUInt32LE(this,this.l),o=__lpp4(this,this.l),2&size&&(size+=2);break;case"8lpp4":size=4+__readUInt32LE(this,this.l),o=__8lpp4(this,this.l),3&size&&(size+=4-(3&size));break;case"cstr":for(size=0,o="";0!==(w=__readUInt8(this,this.l+size++));)oo.push(_getchar(w));o=oo.join("");break;case"_wstr":for(size=0,o="";0!==(w=__readUInt16LE(this,this.l+size));)oo.push(_getchar(w)),size+=2;size+=2,o=oo.join("");break;case"dbcs-cont":for(o="",loc=this.l,i=0;i<size;++i){if(this.lens&&-1!==this.lens.indexOf(loc))return w=__readUInt8(this,loc),this.l=loc+1,vv=ReadShift.call(this,size-i,w?"dbcs-cont":"sbcs-cont"),oo.join("")+vv;oo.push(_getchar(__readUInt16LE(this,loc))),loc+=2}o=oo.join(""),size*=2;break;case"cpstr":case"sbcs-cont":for(o="",loc=this.l,i=0;i!=size;++i){if(this.lens&&-1!==this.lens.indexOf(loc))return w=__readUInt8(this,loc),this.l=loc+1,vv=ReadShift.call(this,size-i,w?"dbcs-cont":"sbcs-cont"),oo.join("")+vv;oo.push(_getchar(__readUInt8(this,loc))),loc+=1}o=oo.join("");break;default:switch(size){case 1:return oI=__readUInt8(this,this.l),this.l++,oI;case 2:return oI=("i"===t?__readInt16LE:__readUInt16LE)(this,this.l),this.l+=2,oI;case 4:case-4:return"i"!==t&&128&this[this.l+3]?(oR=__readUInt32LE(this,this.l),this.l+=4,oR):(oI=(size>0?__readInt32LE:__readInt32BE)(this,this.l),this.l+=4,oI);case 8:case-8:if("f"===t)return oR=8==size?__double(this,this.l):__double([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,oR;size=8;case 16:o=__hexlify(this,this.l,size)}}return this.l+=size,o}var __writeUInt32LE=function(b,val,idx){b[idx]=255&val,b[idx+1]=val>>>8&255,b[idx+2]=val>>>16&255,b[idx+3]=val>>>24&255},__writeInt32LE=function(b,val,idx){b[idx]=255&val,b[idx+1]=val>>8&255,b[idx+2]=val>>16&255,b[idx+3]=val>>24&255},__writeUInt16LE=function(b,val,idx){b[idx]=255&val,b[idx+1]=val>>>8&255};function WriteShift(t,val,f){var size=0,i=0;if("dbcs"===f){for(i=0;i!=val.length;++i)__writeUInt16LE(this,val.charCodeAt(i),this.l+2*i);size=2*val.length}else if("sbcs"===f){for(val=val.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=val.length;++i)this[this.l+i]=255&val.charCodeAt(i);size=val.length}else{if("hex"===f){for(;i<t;++i)this[this.l++]=parseInt(val.slice(2*i,2*i+2),16)||0;return this}if("utf16le"===f){var end=Math.min(this.l+t,this.length);for(i=0;i<Math.min(val.length,t);++i){var cc=val.charCodeAt(i);this[this.l++]=255&cc,this[this.l++]=cc>>8}for(;this.l<end;)this[this.l++]=0;return this}switch(t){case 1:size=1,this[this.l]=255&val;break;case 2:size=2,this[this.l]=255&val,val>>>=8,this[this.l+1]=255&val;break;case 3:size=3,this[this.l]=255&val,val>>>=8,this[this.l+1]=255&val,val>>>=8,this[this.l+2]=255&val;break;case 4:size=4,__writeUInt32LE(this,val,this.l);break;case 8:if(size=8,"f"===f){!function(b,v,idx){var bs=(v<0||1/v==-1/0?1:0)<<7,e=0,m=0,av=bs?-v:v;isFinite(av)?0==av?e=m=0:(e=Math.floor(Math.log(av)/Math.LN2),m=av*Math.pow(2,52-e),e<=-1023&&(!isFinite(m)||m<Math.pow(2,52))?e=-1022:(m-=Math.pow(2,52),e+=1023)):(e=2047,m=isNaN(v)?26985:0);for(var i=0;i<=5;++i,m/=256)b[idx+i]=255&m;b[idx+6]=(15&e)<<4|15&m,b[idx+7]=e>>4|bs}(this,val,this.l);break}case 16:break;case-4:size=4,__writeInt32LE(this,val,this.l)}}return this.l+=size,this}function CheckField(hexstr,fld){var m=__hexlify(this,this.l,hexstr.length>>1);if(m!==hexstr)throw new Error(fld+"Expected "+hexstr+" saw "+m);this.l+=hexstr.length>>1}function prep_blob(blob,pos){blob.l=pos,blob.read_shift=ReadShift,blob.chk=CheckField,blob.write_shift=WriteShift}function parsenoop(blob,length){blob.l+=length}function new_buf(sz){var o=new_raw_buf(sz);return prep_blob(o,0),o}function buf_array(){var bufs=[],blksz=has_buf?256:2048,newblk=function(sz){var o=new_buf(sz);return prep_blob(o,0),o},curbuf=newblk(blksz),endbuf=function(){curbuf&&(curbuf.length>curbuf.l&&((curbuf=curbuf.slice(0,curbuf.l)).l=curbuf.length),curbuf.length>0&&bufs.push(curbuf),curbuf=null)},next=function(sz){return curbuf&&sz<curbuf.length-curbuf.l?curbuf:(endbuf(),curbuf=newblk(Math.max(sz+1,blksz)))};return{next:next,push:function(buf){endbuf(),null==(curbuf=buf).l&&(curbuf.l=curbuf.length),next(blksz)},end:function(){return endbuf(),bconcat(bufs)},_bufs:bufs}}function write_record(ba,type,payload,length){var l,t=+type;if(!isNaN(t)){length||(length=XLSBRecordEnum[t].p||(payload||[]).length||0),l=1+(t>=128?1:0)+1,length>=128&&++l,length>=16384&&++l,length>=2097152&&++l;var o=ba.next(l);t<=127?o.write_shift(1,t):(o.write_shift(1,128+(127&t)),o.write_shift(1,t>>7));for(var i=0;4!=i;++i){if(!(length>=128)){o.write_shift(1,length);break}o.write_shift(1,128+(127&length)),length>>=7}length>0&&is_buf(payload)&&ba.push(payload)}}function shift_cell_xls(cell,tgt,opts){var out=dup(cell);if(tgt.s?(out.cRel&&(out.c+=tgt.s.c),out.rRel&&(out.r+=tgt.s.r)):(out.cRel&&(out.c+=tgt.c),out.rRel&&(out.r+=tgt.r)),!opts||opts.biff<12){for(;out.c>=256;)out.c-=256;for(;out.r>=65536;)out.r-=65536}return out}function shift_range_xls(cell,range,opts){var out=dup(cell);return out.s=shift_cell_xls(out.s,range.s,opts),out.e=shift_cell_xls(out.e,range.s,opts),out}function encode_cell_xls(c,biff){if(c.cRel&&c.c<0)for(c=dup(c);c.c<0;)c.c+=biff>8?16384:256;if(c.rRel&&c.r<0)for(c=dup(c);c.r<0;)c.r+=biff>8?1048576:biff>5?65536:16384;var s=encode_cell(c);return c.cRel||null==c.cRel||(s=s.replace(/^([A-Z])/,"$$$1")),c.rRel||null==c.rRel||(s=function(cstr){return cstr.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}(s)),s}function encode_range_xls(r,opts){return 0!=r.s.r||r.s.rRel||r.e.r!=(opts.biff>=12?1048575:opts.biff>=8?65536:16384)||r.e.rRel?0!=r.s.c||r.s.cRel||r.e.c!=(opts.biff>=12?16383:255)||r.e.cRel?encode_cell_xls(r.s,opts.biff)+":"+encode_cell_xls(r.e,opts.biff):(r.s.rRel?"":"$")+encode_row(r.s.r)+":"+(r.e.rRel?"":"$")+encode_row(r.e.r):(r.s.cRel?"":"$")+encode_col(r.s.c)+":"+(r.e.cRel?"":"$")+encode_col(r.e.c)}function decode_row(rowstr){return parseInt(rowstr.replace(/\$(\d+)$/,"$1"),10)-1}function encode_row(row){return""+(row+1)}function decode_col(colstr){for(var c=colstr.replace(/^\$([A-Z])/,"$1"),d=0,i=0;i!==c.length;++i)d=26*d+c.charCodeAt(i)-64;return d-1}function encode_col(col){if(col<0)throw new Error("invalid column "+col);var s="";for(++col;col;col=Math.floor((col-1)/26))s=String.fromCharCode((col-1)%26+65)+s;return s}function decode_cell(cstr){for(var R=0,C=0,i=0;i<cstr.length;++i){var cc=cstr.charCodeAt(i);cc>=48&&cc<=57?R=10*R+(cc-48):cc>=65&&cc<=90&&(C=26*C+(cc-64))}return{c:C-1,r:R-1}}function encode_cell(cell){for(var col=cell.c+1,s="";col;col=(col-1)/26|0)s=String.fromCharCode((col-1)%26+65)+s;return s+(cell.r+1)}function decode_range(range){var idx=range.indexOf(":");return-1==idx?{s:decode_cell(range),e:decode_cell(range)}:{s:decode_cell(range.slice(0,idx)),e:decode_cell(range.slice(idx+1))}}function encode_range(cs,ce){return void 0===ce||"number"==typeof ce?encode_range(cs.s,cs.e):("string"!=typeof cs&&(cs=encode_cell(cs)),"string"!=typeof ce&&(ce=encode_cell(ce)),cs==ce?cs:cs+":"+ce)}function safe_decode_range(range){var o={s:{c:0,r:0},e:{c:0,r:0}},idx=0,i=0,cc=0,len=range.length;for(idx=0;i<len&&!((cc=range.charCodeAt(i)-64)<1||cc>26);++i)idx=26*idx+cc;for(o.s.c=--idx,idx=0;i<len&&!((cc=range.charCodeAt(i)-48)<0||cc>9);++i)idx=10*idx+cc;if(o.s.r=--idx,i===len||10!=cc)return o.e.c=o.s.c,o.e.r=o.s.r,o;for(++i,idx=0;i!=len&&!((cc=range.charCodeAt(i)-64)<1||cc>26);++i)idx=26*idx+cc;for(o.e.c=--idx,idx=0;i!=len&&!((cc=range.charCodeAt(i)-48)<0||cc>9);++i)idx=10*idx+cc;return o.e.r=--idx,o}function safe_format_cell(cell,v){var q="d"==cell.t&&v instanceof Date;if(null!=cell.z)try{return cell.w=SSF_format(cell.z,q?datenum(v):v)}catch(e){}try{return cell.w=SSF_format((cell.XF||{}).numFmtId||(q?14:0),q?datenum(v):v)}catch(e){return""+v}}function format_cell(cell,v,o){return null==cell||null==cell.t||"z"==cell.t?"":void 0!==cell.w?cell.w:("d"==cell.t&&!cell.z&&o&&o.dateNF&&(cell.z=o.dateNF),"e"==cell.t?BErr[cell.v]||cell.v:safe_format_cell(cell,null==v?cell.v:v))}function sheet_to_workbook(sheet,opts){var n=opts&&opts.sheet?opts.sheet:"Sheet1",sheets={};return sheets[n]=sheet,{SheetNames:[n],Sheets:sheets}}function sheet_add_aoa(_ws,data,opts){var o=opts||{},dense=_ws?Array.isArray(_ws):o.dense,ws=_ws||(dense?[]:{}),_R=0,_C=0;if(ws&&null!=o.origin){if("number"==typeof o.origin)_R=o.origin;else{var _origin="string"==typeof o.origin?decode_cell(o.origin):o.origin;_R=_origin.r,_C=_origin.c}ws["!ref"]||(ws["!ref"]="A1:A1")}var range={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(ws["!ref"]){var _range=safe_decode_range(ws["!ref"]);range.s.c=_range.s.c,range.s.r=_range.s.r,range.e.c=Math.max(range.e.c,_range.e.c),range.e.r=Math.max(range.e.r,_range.e.r),-1==_R&&(range.e.r=_R=_range.e.r+1)}for(var R=0;R!=data.length;++R)if(data[R]){if(!Array.isArray(data[R]))throw new Error("aoa_to_sheet expects an array of arrays");for(var C=0;C!=data[R].length;++C)if(void 0!==data[R][C]){var cell={v:data[R][C]},__R=_R+R,__C=_C+C;if(range.s.r>__R&&(range.s.r=__R),range.s.c>__C&&(range.s.c=__C),range.e.r<__R&&(range.e.r=__R),range.e.c<__C&&(range.e.c=__C),!data[R][C]||"object"!=typeof data[R][C]||Array.isArray(data[R][C])||data[R][C]instanceof Date)if(Array.isArray(cell.v)&&(cell.f=data[R][C][1],cell.v=cell.v[0]),null===cell.v)if(cell.f)cell.t="n";else if(o.nullError)cell.t="e",cell.v=0;else{if(!o.sheetStubs)continue;cell.t="z"}else"number"==typeof cell.v?cell.t="n":"boolean"==typeof cell.v?cell.t="b":cell.v instanceof Date?(cell.z=o.dateNF||table_fmt[14],o.cellDates?(cell.t="d",cell.w=SSF_format(cell.z,datenum(cell.v))):(cell.t="n",cell.v=datenum(cell.v),cell.w=SSF_format(cell.z,cell.v))):cell.t="s";else cell=data[R][C];if(dense)ws[__R]||(ws[__R]=[]),ws[__R][__C]&&ws[__R][__C].z&&(cell.z=ws[__R][__C].z),ws[__R][__C]=cell;else{var cell_ref=encode_cell({c:__C,r:__R});ws[cell_ref]&&ws[cell_ref].z&&(cell.z=ws[cell_ref].z),ws[cell_ref]=cell}}}return range.s.c<1e7&&(ws["!ref"]=encode_range(range)),ws}function aoa_to_sheet(data,opts){return sheet_add_aoa(null,data,opts)}function write_UInt32LE(x,o){return o||(o=new_buf(4)),o.write_shift(4,x),o}function parse_XLWideString(data){var cchCharacters=data.read_shift(4);return 0===cchCharacters?"":data.read_shift(cchCharacters,"dbcs")}function write_XLWideString(data,o){var _null=!1;return null==o&&(_null=!0,o=new_buf(4+2*data.length)),o.write_shift(4,data.length),data.length>0&&o.write_shift(0,data,"dbcs"),_null?o.slice(0,o.l):o}function parse_StrRun(data){return{ich:data.read_shift(2),ifnt:data.read_shift(2)}}function parse_RichStr(data,length){var start=data.l,flags=data.read_shift(1),str=parse_XLWideString(data),rgsStrRun=[],z={t:str,h:str};if(1&flags){for(var dwSizeStrRun=data.read_shift(4),i=0;i!=dwSizeStrRun;++i)rgsStrRun.push(parse_StrRun(data));z.r=rgsStrRun}else z.r=[{ich:0,ifnt:0}];return data.l=start+length,z}var parse_BrtCommentText=parse_RichStr;function write_BrtCommentText(str,o){var _null=!1;return null==o&&(_null=!0,o=new_buf(23+4*str.t.length)),o.write_shift(1,1),write_XLWideString(str.t,o),o.write_shift(4,1),function(run,o){o||(o=new_buf(4)),o.write_shift(2,run.ich||0),o.write_shift(2,run.ifnt||0)}({ich:0,ifnt:0},o),_null?o.slice(0,o.l):o}function parse_XLSBCell(data){var col=data.read_shift(4),iStyleRef=data.read_shift(2);return iStyleRef+=data.read_shift(1)<<16,data.l++,{c:col,iStyleRef:iStyleRef}}function write_XLSBCell(cell,o){return null==o&&(o=new_buf(8)),o.write_shift(-4,cell.c),o.write_shift(3,cell.iStyleRef||cell.s),o.write_shift(1,0),o}function parse_XLSBShortCell(data){var iStyleRef=data.read_shift(2);return iStyleRef+=data.read_shift(1)<<16,data.l++,{c:-1,iStyleRef:iStyleRef}}function write_XLSBShortCell(cell,o){return null==o&&(o=new_buf(4)),o.write_shift(3,cell.iStyleRef||cell.s),o.write_shift(1,0),o}var parse_XLSBCodeName=parse_XLWideString,write_XLSBCodeName=write_XLWideString;function parse_XLNullableWideString(data){var cchCharacters=data.read_shift(4);return 0===cchCharacters||4294967295===cchCharacters?"":data.read_shift(cchCharacters,"dbcs")}function write_XLNullableWideString(data,o){var _null=!1;return null==o&&(_null=!0,o=new_buf(127)),o.write_shift(4,data.length>0?data.length:4294967295),data.length>0&&o.write_shift(0,data,"dbcs"),_null?o.slice(0,o.l):o}var parse_XLNameWideString=parse_XLWideString,parse_RelID=parse_XLNullableWideString,write_RelID=write_XLNullableWideString;function parse_RkNumber(data){var b=data.slice(data.l,data.l+4),fX100=1&b[0],fInt=2&b[0];data.l+=4;var RK=0===fInt?__double([0,0,0,0,252&b[0],b[1],b[2],b[3]],0):__readInt32LE(b,0)>>2;return fX100?RK/100:RK}function write_RkNumber(data,o){null==o&&(o=new_buf(4));var fX100=0,fInt=0,d100=100*data;if(data==(0|data)&&data>=-(1<<29)&&data<1<<29?fInt=1:d100==(0|d100)&&d100>=-(1<<29)&&d100<1<<29&&(fInt=1,fX100=1),!fInt)throw new Error("unsupported RkNumber "+data);o.write_shift(-4,((fX100?d100:data)<<2)+(fX100+2))}function parse_RfX(data){var cell={s:{},e:{}};return cell.s.r=data.read_shift(4),cell.e.r=data.read_shift(4),cell.s.c=data.read_shift(4),cell.e.c=data.read_shift(4),cell}var parse_UncheckedRfX=parse_RfX,write_UncheckedRfX=function(r,o){return o||(o=new_buf(16)),o.write_shift(4,r.s.r),o.write_shift(4,r.e.r),o.write_shift(4,r.s.c),o.write_shift(4,r.e.c),o};function parse_Xnum(data){if(data.length-data.l<8)throw"XLS Xnum Buffer underflow";return data.read_shift(8,"f")}function write_Xnum(data,o){return(o||new_buf(8)).write_shift(8,data,"f")}function write_BrtColor(color,o){if(o||(o=new_buf(8)),!color||color.auto)return o.write_shift(4,0),o.write_shift(4,0),o;null!=color.index?(o.write_shift(1,2),o.write_shift(1,color.index)):null!=color.theme?(o.write_shift(1,6),o.write_shift(1,color.theme)):(o.write_shift(1,5),o.write_shift(1,0));var nTS=color.tint||0;if(nTS>0?nTS*=32767:nTS<0&&(nTS*=32768),o.write_shift(2,nTS),color.rgb&&null==color.theme){var rgb=color.rgb||"FFFFFF";"number"==typeof rgb&&(rgb=("000000"+rgb.toString(16)).slice(-6)),o.write_shift(1,parseInt(rgb.slice(0,2),16)),o.write_shift(1,parseInt(rgb.slice(2,4),16)),o.write_shift(1,parseInt(rgb.slice(4,6),16)),o.write_shift(1,255)}else o.write_shift(2,0),o.write_shift(1,0),o.write_shift(1,0);return o}var DocSummaryPIDDSI={1:{n:"CodePage",t:2},2:{n:"Category",t:80},3:{n:"PresentationFormat",t:80},4:{n:"ByteCount",t:3},5:{n:"LineCount",t:3},6:{n:"ParagraphCount",t:3},7:{n:"SlideCount",t:3},8:{n:"NoteCount",t:3},9:{n:"HiddenCount",t:3},10:{n:"MultimediaClipCount",t:3},11:{n:"ScaleCrop",t:11},12:{n:"HeadingPairs",t:4108},13:{n:"TitlesOfParts",t:4126},14:{n:"Manager",t:80},15:{n:"Company",t:80},16:{n:"LinksUpToDate",t:11},17:{n:"CharacterCount",t:3},19:{n:"SharedDoc",t:11},22:{n:"HyperlinksChanged",t:11},23:{n:"AppVersion",t:3,p:"version"},24:{n:"DigSig",t:65},26:{n:"ContentType",t:80},27:{n:"ContentStatus",t:80},28:{n:"Language",t:80},29:{n:"Version",t:80},255:{},2147483648:{n:"Locale",t:19},2147483651:{n:"Behavior",t:19},1919054434:{}},SummaryPIDSI={1:{n:"CodePage",t:2},2:{n:"Title",t:80},3:{n:"Subject",t:80},4:{n:"Author",t:80},5:{n:"Keywords",t:80},6:{n:"Comments",t:80},7:{n:"Template",t:80},8:{n:"LastAuthor",t:80},9:{n:"RevNumber",t:80},10:{n:"EditTime",t:64},11:{n:"LastPrinted",t:64},12:{n:"CreatedDate",t:64},13:{n:"ModifiedDate",t:64},14:{n:"PageCount",t:3},15:{n:"WordCount",t:3},16:{n:"CharCount",t:3},17:{n:"Thumbnail",t:71},18:{n:"Application",t:80},19:{n:"DocSecurity",t:3},255:{},2147483648:{n:"Locale",t:19},2147483651:{n:"Behavior",t:19},1919054434:{}};function rgbify(arr){return arr.map((function(x){return[x>>16&255,x>>8&255,255&x]}))}var XLSIcv=dup(rgbify([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),BErr={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},ct2type={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},CT_LIST={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function write_ct(ct,opts){var v,type2ct=function(obj){for(var o=[],K=keys(obj),i=0;i!==K.length;++i)null==o[obj[K[i]]]&&(o[obj[K[i]]]=[]),o[obj[K[i]]].push(K[i]);return o}(ct2type),o=[];o[o.length]=XML_HEADER,o[o.length]=writextag("Types",null,{xmlns:XMLNS_CT,"xmlns:xsd":XMLNS_xsd,"xmlns:xsi":XMLNS_xsi}),o=o.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map((function(x){return writextag("Default",null,{Extension:x[0],ContentType:x[1]})})));var f1=function(w){ct[w]&&ct[w].length>0&&(v=ct[w][0],o[o.length]=writextag("Override",null,{PartName:("/"==v[0]?"":"/")+v,ContentType:CT_LIST[w][opts.bookType]||CT_LIST[w].xlsx}))},f2=function(w){(ct[w]||[]).forEach((function(v){o[o.length]=writextag("Override",null,{PartName:("/"==v[0]?"":"/")+v,ContentType:CT_LIST[w][opts.bookType]||CT_LIST[w].xlsx})}))},f3=function(t){(ct[t]||[]).forEach((function(v){o[o.length]=writextag("Override",null,{PartName:("/"==v[0]?"":"/")+v,ContentType:type2ct[t][0]})}))};return f1("workbooks"),f2("sheets"),f2("charts"),f3("themes"),["strs","styles"].forEach(f1),["coreprops","extprops","custprops"].forEach(f3),f3("vba"),f3("comments"),f3("threadedcomments"),f3("drawings"),f2("metadata"),f3("people"),o.length>2&&(o[o.length]="</Types>",o[1]=o[1].replace("/>",">")),o.join("")}var RELS={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function get_rels_path(file){var n=file.lastIndexOf("/");return file.slice(0,n+1)+"_rels/"+file.slice(n+1)+".rels"}function write_rels(rels){var o=[XML_HEADER,writextag("Relationships",null,{xmlns:XMLNS_RELS})];return keys(rels["!id"]).forEach((function(rid){o[o.length]=writextag("Relationship",null,rels["!id"][rid])})),o.length>2&&(o[o.length]="</Relationships>",o[1]=o[1].replace("/>",">")),o.join("")}function add_rels(rels,rId,f,type,relobj,targetmode){if(relobj||(relobj={}),rels["!id"]||(rels["!id"]={}),rels["!idx"]||(rels["!idx"]=1),rId<0)for(rId=rels["!idx"];rels["!id"]["rId"+rId];++rId);if(rels["!idx"]=rId+1,relobj.Id="rId"+rId,relobj.Type=type,relobj.Target=f,targetmode?relobj.TargetMode=targetmode:[RELS.HLINK,RELS.XPATH,RELS.XMISS].indexOf(relobj.Type)>-1&&(relobj.TargetMode="External"),rels["!id"][relobj.Id])throw new Error("Cannot rewrite rId "+rId);return rels["!id"][relobj.Id]=relobj,rels[("/"+relobj.Target).replace("//","/")]=relobj,rId}function write_rdf_type(file,res,tag){return['  <rdf:Description rdf:about="'+file+'">\n','    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(tag||"odf")+"#"+res+'"/>\n',"  </rdf:Description>\n"].join("")}function write_rdf_has(base,file){return['  <rdf:Description rdf:about="'+base+'">\n','    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+file+'"/>\n',"  </rdf:Description>\n"].join("")}function write_meta_ods(){return'<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+XLSX.version+"</meta:generator></office:meta></office:document-meta>"}var CORE_PROPS=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];function cp_doit(f,g,h,o,p){null==p[f]&&null!=g&&""!==g&&(p[f]=g,g=escapexml(g),o[o.length]=h?writextag(f,g,h):writetag(f,g))}function write_core_props(cp,_opts){var opts=_opts||{},o=[XML_HEADER,writextag("cp:coreProperties",null,{"xmlns:cp":XMLNS_CORE_PROPS,"xmlns:dc":XMLNS_dc,"xmlns:dcterms":XMLNS_dcterms,"xmlns:dcmitype":XMLNS_dcmitype,"xmlns:xsi":XMLNS_xsi})],p={};if(!cp&&!opts.Props)return o.join("");cp&&(null!=cp.CreatedDate&&cp_doit("dcterms:created","string"==typeof cp.CreatedDate?cp.CreatedDate:write_w3cdtf(cp.CreatedDate,opts.WTF),{"xsi:type":"dcterms:W3CDTF"},o,p),null!=cp.ModifiedDate&&cp_doit("dcterms:modified","string"==typeof cp.ModifiedDate?cp.ModifiedDate:write_w3cdtf(cp.ModifiedDate,opts.WTF),{"xsi:type":"dcterms:W3CDTF"},o,p));for(var i=0;i!=CORE_PROPS.length;++i){var f=CORE_PROPS[i],v=opts.Props&&null!=opts.Props[f[1]]?opts.Props[f[1]]:cp?cp[f[1]]:null;!0===v?v="1":!1===v?v="0":"number"==typeof v&&(v=String(v)),null!=v&&cp_doit(f[0],v,null,o,p)}return o.length>2&&(o[o.length]="</cp:coreProperties>",o[1]=o[1].replace("/>",">")),o.join("")}var EXT_PROPS=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],PseudoPropsPairs=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function write_ext_props(cp){var o=[],W=writextag;return cp||(cp={}),cp.Application="SheetJS",o[o.length]=XML_HEADER,o[o.length]=writextag("Properties",null,{xmlns:XMLNS_EXT_PROPS,"xmlns:vt":XMLNS_vt}),EXT_PROPS.forEach((function(f){if(void 0!==cp[f[1]]){var v;switch(f[2]){case"string":v=escapexml(String(cp[f[1]]));break;case"bool":v=cp[f[1]]?"true":"false"}void 0!==v&&(o[o.length]=W(f[0],v))}})),o[o.length]=W("HeadingPairs",W("vt:vector",W("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+W("vt:variant",W("vt:i4",String(cp.Worksheets))),{size:2,baseType:"variant"})),o[o.length]=W("TitlesOfParts",W("vt:vector",cp.SheetNames.map((function(s){return"<vt:lpstr>"+escapexml(s)+"</vt:lpstr>"})).join(""),{size:cp.Worksheets,baseType:"lpstr"})),o.length>2&&(o[o.length]="</Properties>",o[1]=o[1].replace("/>",">")),o.join("")}function write_cust_props(cp){var o=[XML_HEADER,writextag("Properties",null,{xmlns:XMLNS_CUST_PROPS,"xmlns:vt":XMLNS_vt})];if(!cp)return o.join("");var pid=1;return keys(cp).forEach((function(k){++pid,o[o.length]=writextag("property",function(s,xlsx){switch(typeof s){case"string":var o=writextag("vt:lpwstr",escapexml(s));return xlsx&&(o=o.replace(/&quot;/g,"_x0022_")),o;case"number":return writextag((0|s)==s?"vt:i4":"vt:r8",escapexml(String(s)));case"boolean":return writextag("vt:bool",s?"true":"false")}if(s instanceof Date)return writextag("vt:filetime",write_w3cdtf(s));throw new Error("Unable to serialize "+s)}(cp[k],!0),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:pid,name:escapexml(k)})})),o.length>2&&(o[o.length]="</Properties>",o[1]=o[1].replace("/>",">")),o.join("")}var XLMLDocPropsMap={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function write_TypedPropertyValue(type,value){var o=new_buf(4),p=new_buf(4);switch(o.write_shift(4,80==type?31:type),type){case 3:p.write_shift(-4,value);break;case 5:(p=new_buf(8)).write_shift(8,value,"f");break;case 11:p.write_shift(4,value?1:0);break;case 64:p=function(time){var t=("string"==typeof time?new Date(Date.parse(time)):time).getTime()/1e3+11644473600,l=t%Math.pow(2,32),h=(t-l)/Math.pow(2,32);h*=1e7;var w=(l*=1e7)/Math.pow(2,32)|0;w>0&&(l%=Math.pow(2,32),h+=w);var o=new_buf(8);return o.write_shift(4,l),o.write_shift(4,h),o}(value);break;case 31:case 80:for((p=new_buf(4+2*(value.length+1)+(value.length%2?0:2))).write_shift(4,value.length+1),p.write_shift(0,value,"dbcs");p.l!=p.length;)p.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+type+" "+value)}return bconcat([o,p])}var XLSPSSkip=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function guess_property_type(val){switch(typeof val){case"boolean":return 11;case"number":return(0|val)==val?3:5;case"string":return 31;case"object":if(val instanceof Date)return 64}return-1}function write_PropertySet(entries,RE,PIDSI){var hdr=new_buf(8),piao=[],prop=[],sz=8,i=0,pr=new_buf(8),pio=new_buf(8);if(pr.write_shift(4,2),pr.write_shift(4,1200),pio.write_shift(4,1),prop.push(pr),piao.push(pio),sz+=8+pr.length,!RE){(pio=new_buf(8)).write_shift(4,0),piao.unshift(pio);var bufs=[new_buf(4)];for(bufs[0].write_shift(4,entries.length),i=0;i<entries.length;++i){var value=entries[i][0];for((pr=new_buf(8+2*(value.length+1)+(value.length%2?0:2))).write_shift(4,i+2),pr.write_shift(4,value.length+1),pr.write_shift(0,value,"dbcs");pr.l!=pr.length;)pr.write_shift(1,0);bufs.push(pr)}pr=bconcat(bufs),prop.unshift(pr),sz+=8+pr.length}for(i=0;i<entries.length;++i)if((!RE||RE[entries[i][0]])&&!(XLSPSSkip.indexOf(entries[i][0])>-1||PseudoPropsPairs.indexOf(entries[i][0])>-1)&&null!=entries[i][1]){var val=entries[i][1],idx=0;if(RE){var pinfo=PIDSI[idx=+RE[entries[i][0]]];if("version"==pinfo.p&&"string"==typeof val){var arr=val.split(".");val=(+arr[0]<<16)+(+arr[1]||0)}pr=write_TypedPropertyValue(pinfo.t,val)}else{var T=guess_property_type(val);-1==T&&(T=31,val=String(val)),pr=write_TypedPropertyValue(T,val)}prop.push(pr),(pio=new_buf(8)).write_shift(4,RE?idx:2+i),piao.push(pio),sz+=8+pr.length}var w=8*(prop.length+1);for(i=0;i<prop.length;++i)piao[i].write_shift(4,w),w+=prop[i].length;return hdr.write_shift(4,sz),hdr.write_shift(4,prop.length),bconcat([hdr].concat(piao).concat(prop))}function write_PropertySetStream(entries,clsid,RE,PIDSI,entries2,clsid2){var hdr=new_buf(entries2?68:48),bufs=[hdr];hdr.write_shift(2,65534),hdr.write_shift(2,0),hdr.write_shift(4,842412599),hdr.write_shift(16,CFB.utils.consts.HEADER_CLSID,"hex"),hdr.write_shift(4,entries2?2:1),hdr.write_shift(16,clsid,"hex"),hdr.write_shift(4,entries2?68:48);var ps0=write_PropertySet(entries,RE,PIDSI);if(bufs.push(ps0),entries2){var ps1=write_PropertySet(entries2,null,null);hdr.write_shift(16,clsid2,"hex"),hdr.write_shift(4,68+ps0.length),bufs.push(ps1)}return bconcat(bufs)}function writebool(v,o){return o||(o=new_buf(2)),o.write_shift(2,+!!v),o}function parseuint16(blob){return blob.read_shift(2,"u")}function writeuint16(v,o){return o||(o=new_buf(2)),o.write_shift(2,v),o}function write_Bes(v,t,o){return o||(o=new_buf(2)),o.write_shift(1,"e"==t?+v:+!!v),o.write_shift(1,"e"==t?1:0),o}function parse_ShortXLUnicodeString(blob,length,opts){var cch=blob.read_shift(opts&&opts.biff>=12?2:1),encoding="sbcs-cont";(opts&&opts.biff,opts&&8!=opts.biff)?12==opts.biff&&(encoding="wstr"):blob.read_shift(1)&&(encoding="dbcs-cont");return opts.biff>=2&&opts.biff<=5&&(encoding="cpstr"),cch?blob.read_shift(cch,encoding):""}function write_XLUnicodeRichExtendedString(xlstr){var str=xlstr.t||"",hdr=new_buf(3);hdr.write_shift(2,str.length),hdr.write_shift(1,1);var otext=new_buf(2*str.length);return otext.write_shift(2*str.length,str,"utf16le"),bconcat([hdr,otext])}function write_XLUnicodeString(str,opts,o){return o||(o=new_buf(3+2*str.length)),o.write_shift(2,str.length),o.write_shift(1,1),o.write_shift(31,str,"utf16le"),o}function write_HyperlinkString(str,o){o||(o=new_buf(6+2*str.length)),o.write_shift(4,1+str.length);for(var i=0;i<str.length;++i)o.write_shift(2,str.charCodeAt(i));return o.write_shift(2,0),o}function write_Hyperlink(hl){var out=new_buf(512),i=0,Target=hl.Target;"file://"==Target.slice(0,7)&&(Target=Target.slice(7));var hashidx=Target.indexOf("#"),F=hashidx>-1?31:23;switch(Target.charAt(0)){case"#":F=28;break;case".":F&=-3}out.write_shift(4,2),out.write_shift(4,F);var data=[8,6815827,6619237,4849780,83];for(i=0;i<data.length;++i)out.write_shift(4,data[i]);if(28==F)write_HyperlinkString(Target=Target.slice(1),out);else if(2&F){for(data="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),i=0;i<data.length;++i)out.write_shift(1,parseInt(data[i],16));var Pretarget=hashidx>-1?Target.slice(0,hashidx):Target;for(out.write_shift(4,2*(Pretarget.length+1)),i=0;i<Pretarget.length;++i)out.write_shift(2,Pretarget.charCodeAt(i));out.write_shift(2,0),8&F&&write_HyperlinkString(hashidx>-1?Target.slice(hashidx+1):"",out)}else{for(data="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),i=0;i<data.length;++i)out.write_shift(1,parseInt(data[i],16));for(var P=0;"../"==Target.slice(3*P,3*P+3)||"..\\"==Target.slice(3*P,3*P+3);)++P;for(out.write_shift(2,P),out.write_shift(4,Target.length-3*P+1),i=0;i<Target.length-3*P;++i)out.write_shift(1,255&Target.charCodeAt(i+3*P));for(out.write_shift(1,0),out.write_shift(2,65535),out.write_shift(2,57005),i=0;i<6;++i)out.write_shift(4,0)}return out.slice(0,out.l)}function write_XLSCell(R,C,ixfe,o){return o||(o=new_buf(6)),o.write_shift(2,R),o.write_shift(2,C),o.write_shift(2,ixfe||0),o}function parse_XTI(blob,length,opts){var w=opts.biff>8?4:2;return[blob.read_shift(w),blob.read_shift(w,"i"),blob.read_shift(w,"i")]}function parse_Ref8U(blob){var rwFirst=blob.read_shift(2),rwLast=blob.read_shift(2);return{s:{c:blob.read_shift(2),r:rwFirst},e:{c:blob.read_shift(2),r:rwLast}}}function write_Ref8U(r,o){return o||(o=new_buf(8)),o.write_shift(2,r.s.r),o.write_shift(2,r.e.r),o.write_shift(2,r.s.c),o.write_shift(2,r.e.c),o}function write_BOF(wb,t,o){var h=1536,w=16;switch(o.bookType){case"biff8":case"xla":break;case"biff5":h=1280,w=8;break;case"biff4":h=4,w=6;break;case"biff3":h=3,w=6;break;case"biff2":h=2,w=4;break;default:throw new Error("unsupported BIFF version")}var out=new_buf(w);return out.write_shift(2,h),out.write_shift(2,t),w>4&&out.write_shift(2,29282),w>6&&out.write_shift(2,1997),w>8&&(out.write_shift(2,49161),out.write_shift(2,1),out.write_shift(2,1798),out.write_shift(2,0)),out}function write_BoundSheet8(data,opts){var w=!opts||opts.biff>=8?2:1,o=new_buf(8+w*data.name.length);o.write_shift(4,data.pos),o.write_shift(1,data.hs||0),o.write_shift(1,data.dt),o.write_shift(1,data.name.length),opts.biff>=8&&o.write_shift(1,1),o.write_shift(w*data.name.length,data.name,opts.biff<8?"sbcs":"utf16le");var out=o.slice(0,o.l);return out.l=o.l,out}function write_Format(i,f,opts,o){var b5=opts&&5==opts.biff;o||(o=new_buf(b5?3+f.length:5+2*f.length)),o.write_shift(2,i),o.write_shift(b5?1:2,f.length),b5||o.write_shift(1,1),o.write_shift((b5?1:2)*f.length,f,b5?"sbcs":"utf16le");var out=o.length>o.l?o.slice(0,o.l):o;return null==out.l&&(out.l=out.length),out}function write_XF(data,ixfeP,opts,o){var b5=opts&&5==opts.biff;o||(o=new_buf(b5?16:20)),o.write_shift(2,0),data.style?(o.write_shift(2,data.numFmtId||0),o.write_shift(2,65524)):(o.write_shift(2,data.numFmtId||0),o.write_shift(2,ixfeP<<4));var f=0;return data.numFmtId>0&&b5&&(f|=1024),o.write_shift(4,f),o.write_shift(4,0),b5||o.write_shift(4,0),o.write_shift(2,0),o}function write_HLink(hl){var O=new_buf(24),ref=decode_cell(hl[0]);O.write_shift(2,ref.r),O.write_shift(2,ref.r),O.write_shift(2,ref.c),O.write_shift(2,ref.c);for(var clsid="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),i=0;i<16;++i)O.write_shift(1,parseInt(clsid[i],16));return bconcat([O,write_Hyperlink(hl[1])])}function write_HLinkTooltip(hl){var TT=hl[1].Tooltip,O=new_buf(10+2*(TT.length+1));O.write_shift(2,2048);var ref=decode_cell(hl[0]);O.write_shift(2,ref.r),O.write_shift(2,ref.r),O.write_shift(2,ref.c),O.write_shift(2,ref.c);for(var i=0;i<TT.length;++i)O.write_shift(2,TT.charCodeAt(i));return O.write_shift(2,0),O}var DBF=function(){var dbf_codepage_map={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},dbf_reverse_map=evert({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function dbf_to_sheet(buf,opts){var o=opts||{};o.dateNF||(o.dateNF="yyyymmdd");var ws=aoa_to_sheet(function(buf,opts){var out=[],d=new_raw_buf(1);switch(opts.type){case"base64":d=s2a(Base64_decode(buf));break;case"binary":d=s2a(buf);break;case"buffer":case"array":d=buf}prep_blob(d,0);var ft=d.read_shift(1),memo=!!(136&ft),vfp=!1,l7=!1;switch(ft){case 2:case 3:case 131:case 139:case 245:break;case 48:case 49:vfp=!0,memo=!0;break;case 140:l7=!0;break;default:throw new Error("DBF Unsupported Version: "+ft.toString(16))}var nrow=0,fpos=521;2==ft&&(nrow=d.read_shift(2)),d.l+=3,2!=ft&&(nrow=d.read_shift(4)),nrow>1048576&&(nrow=1e6),2!=ft&&(fpos=d.read_shift(2));var rlen=d.read_shift(2),current_cp=opts.codepage||1252;2!=ft&&(d.l+=16,d.read_shift(1),0!==d[d.l]&&(current_cp=dbf_codepage_map[d[d.l]]),d.l+=1,d.l+=2),l7&&(d.l+=36);for(var fields=[],field={},hend=Math.min(d.length,2==ft?521:fpos-10-(vfp?264:0)),ww=l7?32:11;d.l<hend&&13!=d[d.l];)switch((field={}).name=(void 0).utils.decode(current_cp,d.slice(d.l,d.l+ww)).replace(/[\u0000\r\n].*$/g,""),d.l+=ww,field.type=String.fromCharCode(d.read_shift(1)),2==ft||l7||(field.offset=d.read_shift(4)),field.len=d.read_shift(1),2==ft&&(field.offset=d.read_shift(2)),field.dec=d.read_shift(1),field.name.length&&fields.push(field),2!=ft&&(d.l+=l7?13:14),field.type){case"B":vfp&&8==field.len||!opts.WTF||console.log("Skipping "+field.name+":"+field.type);break;case"G":case"P":opts.WTF&&console.log("Skipping "+field.name+":"+field.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+field.type)}if(13!==d[d.l]&&(d.l=fpos-1),13!==d.read_shift(1))throw new Error("DBF Terminator not found "+d.l+" "+d[d.l]);d.l=fpos;var R=0,C=0;for(out[0]=[],C=0;C!=fields.length;++C)out[0][C]=fields[C].name;for(;nrow-- >0;)if(42!==d[d.l])for(++d.l,out[++R]=[],C=0,C=0;C!=fields.length;++C){var dd=d.slice(d.l,d.l+fields[C].len);d.l+=fields[C].len,prep_blob(dd,0);var s=(void 0).utils.decode(current_cp,dd);switch(fields[C].type){case"C":s.trim().length&&(out[R][C]=s.replace(/\s+$/,""));break;case"D":8===s.length?out[R][C]=new Date(+s.slice(0,4),+s.slice(4,6)-1,+s.slice(6,8)):out[R][C]=s;break;case"F":out[R][C]=parseFloat(s.trim());break;case"+":case"I":out[R][C]=l7?2147483648^dd.read_shift(-4,"i"):dd.read_shift(4,"i");break;case"L":switch(s.trim().toUpperCase()){case"Y":case"T":out[R][C]=!0;break;case"N":case"F":out[R][C]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+s+"|")}break;case"M":if(!memo)throw new Error("DBF Unexpected MEMO for type "+ft.toString(16));out[R][C]="##MEMO##"+(l7?parseInt(s.trim(),10):dd.read_shift(4));break;case"N":(s=s.replace(/\u0000/g,"").trim())&&"."!=s&&(out[R][C]=+s||0);break;case"@":out[R][C]=new Date(dd.read_shift(-8,"f")-621356832e5);break;case"T":out[R][C]=new Date(864e5*(dd.read_shift(4)-2440588)+dd.read_shift(4));break;case"Y":out[R][C]=dd.read_shift(4,"i")/1e4+dd.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":out[R][C]=-dd.read_shift(-8,"f");break;case"B":if(vfp&&8==fields[C].len){out[R][C]=dd.read_shift(8,"f");break}case"G":case"P":dd.l+=fields[C].len;break;case"0":if("_NullFlags"===fields[C].name)break;default:throw new Error("DBF Unsupported data type "+fields[C].type)}}else d.l+=rlen;if(2!=ft&&d.l<d.length&&26!=d[d.l++])throw new Error("DBF EOF Marker missing "+(d.l-1)+" of "+d.length+" "+d[d.l-1].toString(16));return opts&&opts.sheetRows&&(out=out.slice(0,opts.sheetRows)),opts.DBF=fields,out}(buf,o),o);return ws["!cols"]=o.DBF.map((function(field){return{wch:field.len,DBF:field}})),delete o.DBF,ws}var _RLEN={B:8,C:250,L:1,D:8,"?":0,"":0};return{to_workbook:function(buf,opts){try{return sheet_to_workbook(dbf_to_sheet(buf,opts),opts)}catch(e){if(opts&&opts.WTF)throw e}return{SheetNames:[],Sheets:{}}},to_sheet:dbf_to_sheet,from_sheet:function(ws,opts){var o=opts||{};if(+o.codepage>=0&&set_cp(+o.codepage),"string"==o.type)throw new Error("Cannot write DBF to JS string");var ba=buf_array(),aoa=sheet_to_json(ws,{header:1,raw:!0,cellDates:!0}),headers=aoa[0],data=aoa.slice(1),cols=ws["!cols"]||[],i=0,j=0,hcnt=0,rlen=1;for(i=0;i<headers.length;++i)if(((cols[i]||{}).DBF||{}).name)headers[i]=cols[i].DBF.name,++hcnt;else if(null!=headers[i]){if(++hcnt,"number"==typeof headers[i]&&(headers[i]=headers[i].toString(10)),"string"!=typeof headers[i])throw new Error("DBF Invalid column name "+headers[i]+" |"+typeof headers[i]+"|");if(headers.indexOf(headers[i])!==i)for(j=0;j<1024;++j)if(-1==headers.indexOf(headers[i]+"_"+j)){headers[i]+="_"+j;break}}var range=safe_decode_range(ws["!ref"]),coltypes=[],colwidths=[],coldecimals=[];for(i=0;i<=range.e.c-range.s.c;++i){var guess="",_guess="",maxlen=0,col=[];for(j=0;j<data.length;++j)null!=data[j][i]&&col.push(data[j][i]);if(0!=col.length&&null!=headers[i]){for(j=0;j<col.length;++j){switch(typeof col[j]){case"number":_guess="B";break;case"string":default:_guess="C";break;case"boolean":_guess="L";break;case"object":_guess=col[j]instanceof Date?"D":"C"}maxlen=Math.max(maxlen,String(col[j]).length),guess=guess&&guess!=_guess?"C":_guess}maxlen>250&&(maxlen=250),"C"==(_guess=((cols[i]||{}).DBF||{}).type)&&cols[i].DBF.len>maxlen&&(maxlen=cols[i].DBF.len),"B"==guess&&"N"==_guess&&(guess="N",coldecimals[i]=cols[i].DBF.dec,maxlen=cols[i].DBF.len),colwidths[i]="C"==guess||"N"==_guess?maxlen:_RLEN[guess]||0,rlen+=colwidths[i],coltypes[i]=guess}else coltypes[i]="?"}var h=ba.next(32);for(h.write_shift(4,318902576),h.write_shift(4,data.length),h.write_shift(2,296+32*hcnt),h.write_shift(2,rlen),i=0;i<4;++i)h.write_shift(4,0);for(h.write_shift(4,(+dbf_reverse_map[current_ansi]||3)<<8),i=0,j=0;i<headers.length;++i)if(null!=headers[i]){var hf=ba.next(32),_f=(headers[i].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);hf.write_shift(1,_f,"sbcs"),hf.write_shift(1,"?"==coltypes[i]?"C":coltypes[i],"sbcs"),hf.write_shift(4,j),hf.write_shift(1,colwidths[i]||_RLEN[coltypes[i]]||0),hf.write_shift(1,coldecimals[i]||0),hf.write_shift(1,2),hf.write_shift(4,0),hf.write_shift(1,0),hf.write_shift(4,0),hf.write_shift(4,0),j+=colwidths[i]||_RLEN[coltypes[i]]||0}var hb=ba.next(264);for(hb.write_shift(4,13),i=0;i<65;++i)hb.write_shift(4,0);for(i=0;i<data.length;++i){var rout=ba.next(rlen);for(rout.write_shift(1,0),j=0;j<headers.length;++j)if(null!=headers[j])switch(coltypes[j]){case"L":rout.write_shift(1,null==data[i][j]?63:data[i][j]?84:70);break;case"B":rout.write_shift(8,data[i][j]||0,"f");break;case"N":var _n="0";for("number"==typeof data[i][j]&&(_n=data[i][j].toFixed(coldecimals[j]||0)),hcnt=0;hcnt<colwidths[j]-_n.length;++hcnt)rout.write_shift(1,32);rout.write_shift(1,_n,"sbcs");break;case"D":data[i][j]?(rout.write_shift(4,("0000"+data[i][j].getFullYear()).slice(-4),"sbcs"),rout.write_shift(2,("00"+(data[i][j].getMonth()+1)).slice(-2),"sbcs"),rout.write_shift(2,("00"+data[i][j].getDate()).slice(-2),"sbcs")):rout.write_shift(8,"00000000","sbcs");break;case"C":var _s=String(null!=data[i][j]?data[i][j]:"").slice(0,colwidths[j]);for(rout.write_shift(1,_s,"sbcs"),hcnt=0;hcnt<colwidths[j]-_s.length;++hcnt)rout.write_shift(1,32)}}return ba.next(1).write_shift(1,26),ba.end()}}}(),SYLK=function(){var sylk_escapes={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},sylk_char_regex=new RegExp("N("+keys(sylk_escapes).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),sylk_char_fn=function(_,$1){var o=sylk_escapes[$1];return"number"==typeof o?_getansi(o):o},decode_sylk_char=function($$,$1,$2){var newcc=$1.charCodeAt(0)-32<<4|$2.charCodeAt(0)-48;return 59==newcc?$$:_getansi(newcc)};function sylk_to_aoa_str(str,opts){var j,records=str.split(/[\n\r]+/),R=-1,C=-1,ri=0,rj=0,arr=[],formats=[],next_cell_format=null,sht={},rowinfo=[],colinfo=[],cw=[],Mval=0;for(+opts.codepage>=0&&set_cp(+opts.codepage);ri!==records.length;++ri){Mval=0;var val,rstr=records[ri].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,decode_sylk_char).replace(sylk_char_regex,sylk_char_fn),record=rstr.replace(/;;/g,"\0").split(";").map((function(x){return x.replace(/\u0000/g,";")})),RT=record[0];if(rstr.length>0)switch(RT){case"ID":case"E":case"B":case"O":case"W":break;case"P":"P"==record[1].charAt(0)&&formats.push(rstr.slice(3).replace(/;;/g,";"));break;case"C":var C_seen_K=!1,C_seen_X=!1,C_seen_S=!1,C_seen_E=!1,_R=-1,_C=-1;for(rj=1;rj<record.length;++rj)switch(record[rj].charAt(0)){case"A":case"G":break;case"X":C=parseInt(record[rj].slice(1))-1,C_seen_X=!0;break;case"Y":for(R=parseInt(record[rj].slice(1))-1,C_seen_X||(C=0),j=arr.length;j<=R;++j)arr[j]=[];break;case"K":'"'===(val=record[rj].slice(1)).charAt(0)?val=val.slice(1,val.length-1):"TRUE"===val?val=!0:"FALSE"===val?val=!1:isNaN(fuzzynum(val))?isNaN(fuzzydate(val).getDate())||(val=parseDate(val)):(val=fuzzynum(val),null!==next_cell_format&&fmt_is_date(next_cell_format)&&(val=numdate(val))),C_seen_K=!0;break;case"E":C_seen_E=!0;var formula=rc_to_a1(record[rj].slice(1),{r:R,c:C});arr[R][C]=[arr[R][C],formula];break;case"S":C_seen_S=!0,arr[R][C]=[arr[R][C],"S5S"];break;case"R":_R=parseInt(record[rj].slice(1))-1;break;case"C":_C=parseInt(record[rj].slice(1))-1;break;default:if(opts&&opts.WTF)throw new Error("SYLK bad record "+rstr)}if(C_seen_K&&(arr[R][C]&&2==arr[R][C].length?arr[R][C][0]=val:arr[R][C]=val,next_cell_format=null),C_seen_S){if(C_seen_E)throw new Error("SYLK shared formula cannot have own formula");var shrbase=_R>-1&&arr[_R][_C];if(!shrbase||!shrbase[1])throw new Error("SYLK shared formula cannot find base");arr[R][C][1]=shift_formula_str(shrbase[1],{r:R-_R,c:C-_C})}break;case"F":var F_seen=0;for(rj=1;rj<record.length;++rj)switch(record[rj].charAt(0)){case"X":C=parseInt(record[rj].slice(1))-1,++F_seen;break;case"Y":for(R=parseInt(record[rj].slice(1))-1,j=arr.length;j<=R;++j)arr[j]=[];break;case"M":Mval=parseInt(record[rj].slice(1))/20;break;case"F":case"G":case"S":case"D":case"N":break;case"P":next_cell_format=formats[parseInt(record[rj].slice(1))];break;case"W":for(cw=record[rj].slice(1).split(" "),j=parseInt(cw[0],10);j<=parseInt(cw[1],10);++j)Mval=parseInt(cw[2],10),colinfo[j-1]=0===Mval?{hidden:!0}:{wch:Mval},process_col(colinfo[j-1]);break;case"C":colinfo[C=parseInt(record[rj].slice(1))-1]||(colinfo[C]={});break;case"R":rowinfo[R=parseInt(record[rj].slice(1))-1]||(rowinfo[R]={}),Mval>0?(rowinfo[R].hpt=Mval,rowinfo[R].hpx=pt2px(Mval)):0===Mval&&(rowinfo[R].hidden=!0);break;default:if(opts&&opts.WTF)throw new Error("SYLK bad record "+rstr)}F_seen<1&&(next_cell_format=null);break;default:if(opts&&opts.WTF)throw new Error("SYLK bad record "+rstr)}}return rowinfo.length>0&&(sht["!rows"]=rowinfo),colinfo.length>0&&(sht["!cols"]=colinfo),opts&&opts.sheetRows&&(arr=arr.slice(0,opts.sheetRows)),[arr,sht]}function sylk_to_sheet(d,opts){var aoasht=function(d,opts){switch(opts.type){case"base64":return sylk_to_aoa_str(Base64_decode(d),opts);case"binary":return sylk_to_aoa_str(d,opts);case"buffer":return sylk_to_aoa_str(has_buf&&Buffer.isBuffer(d)?d.toString("binary"):a2s(d),opts);case"array":return sylk_to_aoa_str(cc2str(d),opts)}throw new Error("Unrecognized type "+opts.type)}(d,opts),aoa=aoasht[0],ws=aoasht[1],o=aoa_to_sheet(aoa,opts);return keys(ws).forEach((function(k){o[k]=ws[k]})),o}function write_ws_cell_sylk(cell,ws,R,C){var o="C;Y"+(R+1)+";X"+(C+1)+";K";switch(cell.t){case"n":o+=cell.v||0,cell.f&&!cell.F&&(o+=";E"+a1_to_rc(cell.f,{r:R,c:C}));break;case"b":o+=cell.v?"TRUE":"FALSE";break;case"e":o+=cell.w||cell.v;break;case"d":o+='"'+(cell.w||cell.v)+'"';break;case"s":o+='"'+cell.v.replace(/"/g,"").replace(/;/g,";;")+'"'}return o}return sylk_escapes["|"]=254,{to_workbook:function(d,opts){return sheet_to_workbook(sylk_to_sheet(d,opts),opts)},to_sheet:sylk_to_sheet,from_sheet:function(ws,opts){var cell,preamble=["ID;PWXL;N;E"],o=[],r=safe_decode_range(ws["!ref"]),dense=Array.isArray(ws),RS="\r\n";preamble.push("P;PGeneral"),preamble.push("F;P0;DG0G8;M255"),ws["!cols"]&&function(out,cols){cols.forEach((function(col,i){var rec="F;W"+(i+1)+" "+(i+1)+" ";col.hidden?rec+="0":("number"!=typeof col.width||col.wpx||(col.wpx=width2px(col.width)),"number"!=typeof col.wpx||col.wch||(col.wch=px2char(col.wpx)),"number"==typeof col.wch&&(rec+=Math.round(col.wch)))," "!=rec.charAt(rec.length-1)&&out.push(rec)}))}(preamble,ws["!cols"]),ws["!rows"]&&function(out,rows){rows.forEach((function(row,i){var rec="F;";row.hidden?rec+="M0;":row.hpt?rec+="M"+20*row.hpt+";":row.hpx&&(rec+="M"+20*px2pt(row.hpx)+";"),rec.length>2&&out.push(rec+"R"+(i+1))}))}(preamble,ws["!rows"]),preamble.push("B;Y"+(r.e.r-r.s.r+1)+";X"+(r.e.c-r.s.c+1)+";D"+[r.s.c,r.s.r,r.e.c,r.e.r].join(" "));for(var R=r.s.r;R<=r.e.r;++R)for(var C=r.s.c;C<=r.e.c;++C){var coord=encode_cell({r:R,c:C});(cell=dense?(ws[R]||[])[C]:ws[coord])&&(null!=cell.v||cell.f&&!cell.F)&&o.push(write_ws_cell_sylk(cell,0,R,C))}return preamble.join(RS)+RS+o.join(RS)+RS+"E"+RS}}}(),DIF=function(){function dif_to_aoa_str(str,opts){for(var records=str.split("\n"),R=-1,C=-1,ri=0,arr=[];ri!==records.length;++ri)if("BOT"!==records[ri].trim()){if(!(R<0)){for(var metadata=records[ri].trim().split(","),type=metadata[0],value=metadata[1],data=records[++ri]||"";1&(data.match(/["]/g)||[]).length&&ri<records.length-1;)data+="\n"+records[++ri];switch(data=data.trim(),+type){case-1:if("BOT"===data){arr[++R]=[],C=0;continue}if("EOD"!==data)throw new Error("Unrecognized DIF special command "+data);break;case 0:"TRUE"===data?arr[R][C]=!0:"FALSE"===data?arr[R][C]=!1:isNaN(fuzzynum(value))?isNaN(fuzzydate(value).getDate())?arr[R][C]=value:arr[R][C]=parseDate(value):arr[R][C]=fuzzynum(value),++C;break;case 1:(data=(data=data.slice(1,data.length-1)).replace(/""/g,'"'))&&data.match(/^=".*"$/)&&(data=data.slice(2,-1)),arr[R][C++]=""!==data?data:null}if("EOD"===data)break}}else arr[++R]=[],C=0;return opts&&opts.sheetRows&&(arr=arr.slice(0,opts.sheetRows)),arr}function dif_to_sheet(str,opts){return aoa_to_sheet(function(d,opts){switch(opts.type){case"base64":return dif_to_aoa_str(Base64_decode(d),opts);case"binary":return dif_to_aoa_str(d,opts);case"buffer":return dif_to_aoa_str(has_buf&&Buffer.isBuffer(d)?d.toString("binary"):a2s(d),opts);case"array":return dif_to_aoa_str(cc2str(d),opts)}throw new Error("Unrecognized type "+opts.type)}(str,opts),opts)}return{to_workbook:function(str,opts){return sheet_to_workbook(dif_to_sheet(str,opts),opts)},to_sheet:dif_to_sheet,from_sheet:function(){var push_field=function(o,topic,v,n,s){o.push(topic),o.push(v+","+n),o.push('"'+s.replace(/"/g,'""')+'"')},push_value=function(o,type,v,s){o.push(type+","+v),o.push(1==type?'"'+s.replace(/"/g,'""')+'"':s)};return function(ws){var cell,o=[],r=safe_decode_range(ws["!ref"]),dense=Array.isArray(ws);push_field(o,"TABLE",0,1,"sheetjs"),push_field(o,"VECTORS",0,r.e.r-r.s.r+1,""),push_field(o,"TUPLES",0,r.e.c-r.s.c+1,""),push_field(o,"DATA",0,0,"");for(var R=r.s.r;R<=r.e.r;++R){push_value(o,-1,0,"BOT");for(var C=r.s.c;C<=r.e.c;++C){var coord=encode_cell({r:R,c:C});if(cell=dense?(ws[R]||[])[C]:ws[coord])switch(cell.t){case"n":var val=cell.w;val||null==cell.v||(val=cell.v),null==val?cell.f&&!cell.F?push_value(o,1,0,"="+cell.f):push_value(o,1,0,""):push_value(o,0,val,"V");break;case"b":push_value(o,0,cell.v?1:0,cell.v?"TRUE":"FALSE");break;case"s":push_value(o,1,0,isNaN(cell.v)?cell.v:'="'+cell.v+'"');break;case"d":cell.w||(cell.w=SSF_format(cell.z||table_fmt[14],datenum(parseDate(cell.v)))),push_value(o,0,cell.w,"V");break;default:push_value(o,1,0,"")}else push_value(o,1,0,"")}}push_value(o,-1,0,"EOD");return o.join("\r\n")}}()}}(),ETH=function(){function encode(s){return s.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function eth_to_sheet(d,opts){return aoa_to_sheet(function(str,opts){for(var records=str.split("\n"),R=-1,C=-1,ri=0,arr=[];ri!==records.length;++ri){var record=records[ri].trim().split(":");if("cell"===record[0]){var addr=decode_cell(record[1]);if(arr.length<=addr.r)for(R=arr.length;R<=addr.r;++R)arr[R]||(arr[R]=[]);switch(R=addr.r,C=addr.c,record[2]){case"t":arr[R][C]=record[3].replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n");break;case"v":arr[R][C]=+record[3];break;case"vtf":var _f=record[record.length-1];case"vtc":"nl"===record[3]?arr[R][C]=!!+record[4]:arr[R][C]=+record[4],"vtf"==record[2]&&(arr[R][C]=[arr[R][C],_f])}}}return opts&&opts.sheetRows&&(arr=arr.slice(0,opts.sheetRows)),arr}(d,opts),opts)}var header=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join("\n"),sep=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join("\n")+"\n",meta=["# SocialCalc Spreadsheet Control Save","part:sheet"].join("\n"),end="--SocialCalcSpreadsheetControlSave--";function sheet_to_eth_data(ws){if(!ws||!ws["!ref"])return"";for(var cell,o=[],oo=[],coord="",r=decode_range(ws["!ref"]),dense=Array.isArray(ws),R=r.s.r;R<=r.e.r;++R)for(var C=r.s.c;C<=r.e.c;++C)if(coord=encode_cell({r:R,c:C}),(cell=dense?(ws[R]||[])[C]:ws[coord])&&null!=cell.v&&"z"!==cell.t){switch(oo=["cell",coord,"t"],cell.t){case"s":case"str":oo.push(encode(cell.v));break;case"n":cell.f?(oo[2]="vtf",oo[3]="n",oo[4]=cell.v,oo[5]=encode(cell.f)):(oo[2]="v",oo[3]=cell.v);break;case"b":oo[2]="vt"+(cell.f?"f":"c"),oo[3]="nl",oo[4]=cell.v?"1":"0",oo[5]=encode(cell.f||(cell.v?"TRUE":"FALSE"));break;case"d":var t=datenum(parseDate(cell.v));oo[2]="vtc",oo[3]="nd",oo[4]=""+t,oo[5]=cell.w||SSF_format(cell.z||table_fmt[14],t);break;case"e":continue}o.push(oo.join(":"))}return o.push("sheet:c:"+(r.e.c-r.s.c+1)+":r:"+(r.e.r-r.s.r+1)+":tvf:1"),o.push("valueformat:1:text-wiki"),o.join("\n")}return{to_workbook:function(d,opts){return sheet_to_workbook(eth_to_sheet(d,opts),opts)},to_sheet:eth_to_sheet,from_sheet:function(ws){return[header,sep,meta,sep,sheet_to_eth_data(ws),end].join("\n")}}}(),PRN=function(){function set_text_arr(data,arr,R,C,o){o.raw?arr[R][C]=data:""===data||("TRUE"===data?arr[R][C]=!0:"FALSE"===data?arr[R][C]=!1:isNaN(fuzzynum(data))?isNaN(fuzzydate(data).getDate())?arr[R][C]=data:arr[R][C]=parseDate(data):arr[R][C]=fuzzynum(data))}var guess_seps={44:",",9:"\t",59:";",124:"|"},guess_sep_weights={44:3,9:2,59:1,124:0};function guess_sep(str){for(var cnt={},instr=!1,end=0,cc=0;end<str.length;++end)34==(cc=str.charCodeAt(end))?instr=!instr:!instr&&cc in guess_seps&&(cnt[cc]=(cnt[cc]||0)+1);for(end in cc=[],cnt)Object.prototype.hasOwnProperty.call(cnt,end)&&cc.push([cnt[end],end]);if(!cc.length)for(end in cnt=guess_sep_weights)Object.prototype.hasOwnProperty.call(cnt,end)&&cc.push([cnt[end],end]);return cc.sort((function(a,b){return a[0]-b[0]||guess_sep_weights[a[1]]-guess_sep_weights[b[1]]})),guess_seps[cc.pop()[1]]||44}function dsv_to_sheet_str(str,opts){var o=opts||{},sep="",ws=o.dense?[]:{},range={s:{c:0,r:0},e:{c:0,r:0}};"sep="==str.slice(0,4)?13==str.charCodeAt(5)&&10==str.charCodeAt(6)?(sep=str.charAt(4),str=str.slice(7)):13==str.charCodeAt(5)||10==str.charCodeAt(5)?(sep=str.charAt(4),str=str.slice(6)):sep=guess_sep(str.slice(0,1024)):sep=o&&o.FS?o.FS:guess_sep(str.slice(0,1024));var R=0,C=0,v=0,start=0,end=0,sepcc=sep.charCodeAt(0),instr=!1,cc=0,startcc=str.charCodeAt(0);str=str.replace(/\r\n/gm,"\n");var dateNF,fmt,_re=null!=o.dateNF?(dateNF=o.dateNF,fmt=(fmt="number"==typeof dateNF?table_fmt[dateNF]:dateNF).replace(dateNFregex,"(\\d+)"),new RegExp("^"+fmt+"$")):null;function finish_cell(){var s=str.slice(start,end),cell={};if('"'==s.charAt(0)&&'"'==s.charAt(s.length-1)&&(s=s.slice(1,-1).replace(/""/g,'"')),0===s.length)cell.t="z";else if(o.raw)cell.t="s",cell.v=s;else if(0===s.trim().length)cell.t="s",cell.v=s;else if(61==s.charCodeAt(0))34==s.charCodeAt(1)&&34==s.charCodeAt(s.length-1)?(cell.t="s",cell.v=s.slice(2,-1).replace(/""/g,'"')):1!=s.length?(cell.t="n",cell.f=s.slice(1)):(cell.t="s",cell.v=s);else if("TRUE"==s)cell.t="b",cell.v=!0;else if("FALSE"==s)cell.t="b",cell.v=!1;else if(isNaN(v=fuzzynum(s)))if(!isNaN(fuzzydate(s).getDate())||_re&&s.match(_re)){cell.z=o.dateNF||table_fmt[14];var k=0;_re&&s.match(_re)&&(s=function(str,dateNF,match){var Y=-1,m=-1,d=-1,H=-1,M=-1,S=-1;(dateNF.match(dateNFregex)||[]).forEach((function(n,i){var v=parseInt(match[i+1],10);switch(n.toLowerCase().charAt(0)){case"y":Y=v;break;case"d":d=v;break;case"h":H=v;break;case"s":S=v;break;case"m":H>=0?M=v:m=v}})),S>=0&&-1==M&&m>=0&&(M=m,m=-1);var datestr=(""+(Y>=0?Y:(new Date).getFullYear())).slice(-4)+"-"+("00"+(m>=1?m:1)).slice(-2)+"-"+("00"+(d>=1?d:1)).slice(-2);7==datestr.length&&(datestr="0"+datestr),8==datestr.length&&(datestr="20"+datestr);var timestr=("00"+(H>=0?H:0)).slice(-2)+":"+("00"+(M>=0?M:0)).slice(-2)+":"+("00"+(S>=0?S:0)).slice(-2);return-1==H&&-1==M&&-1==S?datestr:-1==Y&&-1==m&&-1==d?timestr:datestr+"T"+timestr}(0,o.dateNF,s.match(_re)||[]),k=1),o.cellDates?(cell.t="d",cell.v=parseDate(s,k)):(cell.t="n",cell.v=datenum(parseDate(s,k))),!1!==o.cellText&&(cell.w=SSF_format(cell.z,cell.v instanceof Date?datenum(cell.v):cell.v)),o.cellNF||delete cell.z}else cell.t="s",cell.v=s;else cell.t="n",!1!==o.cellText&&(cell.w=s),cell.v=v;if("z"==cell.t||(o.dense?(ws[R]||(ws[R]=[]),ws[R][C]=cell):ws[encode_cell({c:C,r:R})]=cell),start=end+1,startcc=str.charCodeAt(start),range.e.c<C&&(range.e.c=C),range.e.r<R&&(range.e.r=R),cc==sepcc)++C;else if(C=0,++R,o.sheetRows&&o.sheetRows<=R)return!0}outer:for(;end<str.length;++end)switch(cc=str.charCodeAt(end)){case 34:34===startcc&&(instr=!instr);break;case sepcc:case 10:case 13:if(!instr&&finish_cell())break outer}return end-start>0&&finish_cell(),ws["!ref"]=encode_range(range),ws}function prn_to_sheet_str(str,opts){return opts&&opts.PRN?opts.FS||"sep="==str.slice(0,4)||str.indexOf("\t")>=0||str.indexOf(",")>=0||str.indexOf(";")>=0?dsv_to_sheet_str(str,opts):aoa_to_sheet(function(f,opts){var o=opts||{},arr=[];if(!f||0===f.length)return arr;for(var lines=f.split(/[\r\n]/),L=lines.length-1;L>=0&&0===lines[L].length;)--L;for(var start=10,idx=0,R=0;R<=L;++R)-1==(idx=lines[R].indexOf(" "))?idx=lines[R].length:idx++,start=Math.max(start,idx);for(R=0;R<=L;++R){arr[R]=[];var C=0;for(set_text_arr(lines[R].slice(0,start).trim(),arr,R,C,o),C=1;C<=(lines[R].length-start)/10+1;++C)set_text_arr(lines[R].slice(start+10*(C-1),start+10*C).trim(),arr,R,C,o)}return o.sheetRows&&(arr=arr.slice(0,o.sheetRows)),arr}(str,opts),opts):dsv_to_sheet_str(str,opts)}function prn_to_sheet(d,opts){var str="",bytes="string"==opts.type?[0,0,0,0]:function(f,o){var x="";switch((o||{}).type||"base64"){case"buffer":case"array":return[f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7]];case"base64":x=Base64_decode(f.slice(0,12));break;case"binary":x=f;break;default:throw new Error("Unrecognized type "+(o&&o.type||"undefined"))}return[x.charCodeAt(0),x.charCodeAt(1),x.charCodeAt(2),x.charCodeAt(3),x.charCodeAt(4),x.charCodeAt(5),x.charCodeAt(6),x.charCodeAt(7)]}(d,opts);switch(opts.type){case"base64":str=Base64_decode(d);break;case"binary":case"string":str=d;break;case"buffer":65001==opts.codepage?str=d.toString("utf8"):(opts.codepage,str=has_buf&&Buffer.isBuffer(d)?d.toString("binary"):a2s(d));break;case"array":str=cc2str(d);break;default:throw new Error("Unrecognized type "+opts.type)}return 239==bytes[0]&&187==bytes[1]&&191==bytes[2]?str=utf8read(str.slice(3)):"string"!=opts.type&&"buffer"!=opts.type&&65001==opts.codepage?str=utf8read(str):opts.type,"socialcalc:version:"==str.slice(0,19)?ETH.to_sheet("string"==opts.type?str:utf8read(str),opts):prn_to_sheet_str(str,opts)}return{to_workbook:function(d,opts){return sheet_to_workbook(prn_to_sheet(d,opts),opts)},to_sheet:prn_to_sheet,from_sheet:function(ws){for(var cell,o=[],r=safe_decode_range(ws["!ref"]),dense=Array.isArray(ws),R=r.s.r;R<=r.e.r;++R){for(var oo=[],C=r.s.c;C<=r.e.c;++C){var coord=encode_cell({r:R,c:C});if((cell=dense?(ws[R]||[])[C]:ws[coord])&&null!=cell.v){for(var w=(cell.w||(format_cell(cell),cell.w)||"").slice(0,10);w.length<10;)w+=" ";oo.push(w+(0===C?" ":""))}else oo.push("          ")}o.push(oo.join(""))}return o.join("\n")}}}(),WK_=function(){function lotushopper(data,cb,opts){if(data){prep_blob(data,data.l||0);for(var Enum=opts.Enum||WK1Enum;data.l<data.length;){var RT=data.read_shift(2),R=Enum[RT]||Enum[65535],length=data.read_shift(2),tgt=data.l+length,d=R.f&&R.f(data,length,opts);if(data.l=tgt,cb(d,R,RT))return}}}function lotus_to_workbook_buf(d,opts){if(!d)return d;var o=opts||{},s=o.dense?[]:{},n="Sheet1",next_n="",sidx=0,sheets={},snames=[],realnames=[],refguess={s:{r:0,c:0},e:{r:0,c:0}},sheetRows=o.sheetRows||0;if(0==d[2]&&(8==d[3]||9==d[3])&&d.length>=16&&5==d[14]&&108===d[15])throw new Error("Unsupported Works 3 for Mac file");if(2==d[2])o.Enum=WK1Enum,lotushopper(d,(function(val,R,RT){switch(RT){case 0:o.vers=val,val>=4096&&(o.qpro=!0);break;case 6:refguess=val;break;case 204:val&&(next_n=val);break;case 222:next_n=val;break;case 15:case 51:o.qpro||(val[1].v=val[1].v.slice(1));case 13:case 14:case 16:14==RT&&!(112&~val[2])&&(15&val[2])>1&&(15&val[2])<15&&(val[1].z=o.dateNF||table_fmt[14],o.cellDates&&(val[1].t="d",val[1].v=numdate(val[1].v))),o.qpro&&val[3]>sidx&&(s["!ref"]=encode_range(refguess),sheets[n]=s,snames.push(n),s=o.dense?[]:{},refguess={s:{r:0,c:0},e:{r:0,c:0}},sidx=val[3],n=next_n||"Sheet"+(sidx+1),next_n="");var tmpcell=o.dense?(s[val[0].r]||[])[val[0].c]:s[encode_cell(val[0])];if(tmpcell){tmpcell.t=val[1].t,tmpcell.v=val[1].v,null!=val[1].z&&(tmpcell.z=val[1].z),null!=val[1].f&&(tmpcell.f=val[1].f);break}o.dense?(s[val[0].r]||(s[val[0].r]=[]),s[val[0].r][val[0].c]=val[1]):s[encode_cell(val[0])]=val[1]}}),o);else{if(26!=d[2]&&14!=d[2])throw new Error("Unrecognized LOTUS BOF "+d[2]);o.Enum=WK3Enum,14==d[2]&&(o.qpro=!0,d.l=0),lotushopper(d,(function(val,R,RT){switch(RT){case 204:n=val;break;case 22:val[1].v=val[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(val[3]>sidx&&(s["!ref"]=encode_range(refguess),sheets[n]=s,snames.push(n),s=o.dense?[]:{},refguess={s:{r:0,c:0},e:{r:0,c:0}},sidx=val[3],n="Sheet"+(sidx+1)),sheetRows>0&&val[0].r>=sheetRows)break;o.dense?(s[val[0].r]||(s[val[0].r]=[]),s[val[0].r][val[0].c]=val[1]):s[encode_cell(val[0])]=val[1],refguess.e.c<val[0].c&&(refguess.e.c=val[0].c),refguess.e.r<val[0].r&&(refguess.e.r=val[0].r);break;case 27:val[14e3]&&(realnames[val[14e3][0]]=val[14e3][1]);break;case 1537:realnames[val[0]]=val[1],val[0]==sidx&&(n=val[1])}}),o)}if(s["!ref"]=encode_range(refguess),sheets[next_n||n]=s,snames.push(next_n||n),!realnames.length)return{SheetNames:snames,Sheets:sheets};for(var osheets={},rnames=[],i=0;i<realnames.length;++i)sheets[snames[i]]?(rnames.push(realnames[i]||snames[i]),osheets[realnames[i]]=sheets[realnames[i]]||sheets[snames[i]]):(rnames.push(realnames[i]),osheets[realnames[i]]={"!ref":"A1"});return{SheetNames:rnames,Sheets:osheets}}function parse_cell(blob,length,opts){var o=[{c:0,r:0},{t:"n",v:0},0,0];return opts.qpro&&20768!=opts.vers?(o[0].c=blob.read_shift(1),o[3]=blob.read_shift(1),o[0].r=blob.read_shift(2),blob.l+=2):(o[2]=blob.read_shift(1),o[0].c=blob.read_shift(2),o[0].r=blob.read_shift(2)),o}function parse_LABEL(blob,length,opts){var tgt=blob.l+length,o=parse_cell(blob,0,opts);if(o[1].t="s",20768==opts.vers){blob.l++;var len=blob.read_shift(1);return o[1].v=blob.read_shift(len,"utf8"),o}return opts.qpro&&blob.l++,o[1].v=blob.read_shift(tgt-blob.l,"cstr"),o}function write_LABEL(R,C,s){var o=new_buf(7+s.length);o.write_shift(1,255),o.write_shift(2,C),o.write_shift(2,R),o.write_shift(1,39);for(var i=0;i<o.length;++i){var cc=s.charCodeAt(i);o.write_shift(1,cc>=128?95:cc)}return o.write_shift(1,0),o}function write_INTEGER(R,C,v){var o=new_buf(7);return o.write_shift(1,255),o.write_shift(2,C),o.write_shift(2,R),o.write_shift(2,v,"i"),o}function write_NUMBER(R,C,v){var o=new_buf(13);return o.write_shift(1,255),o.write_shift(2,C),o.write_shift(2,R),o.write_shift(8,v,"f"),o}function wk1_parse_rc(B,V,col){var rel=32768&V;return V=(rel?B:0)+((V&=-32769)>=8192?V-16384:V),(rel?"":"$")+(col?encode_col(V):encode_row(V))}var FuncTab={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},BinOpTab=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function parse_cell_3(blob){var o=[{c:0,r:0},{t:"n",v:0},0];return o[0].r=blob.read_shift(2),o[3]=blob[blob.l++],o[0].c=blob[blob.l++],o}function write_LABEL_16(R,C,wsidx,s){var o=new_buf(6+s.length);o.write_shift(2,R),o.write_shift(1,wsidx),o.write_shift(1,C),o.write_shift(1,39);for(var i=0;i<s.length;++i){var cc=s.charCodeAt(i);o.write_shift(1,cc>=128?95:cc)}return o.write_shift(1,0),o}function parse_NUMBER_17(blob,length){var o=parse_cell_3(blob),v1=blob.read_shift(4),v2=blob.read_shift(4),e=blob.read_shift(2);if(65535==e)return 0===v1&&3221225472===v2?(o[1].t="e",o[1].v=15):0===v1&&3489660928===v2?(o[1].t="e",o[1].v=42):o[1].v=0,o;var s=32768&e;return e=(32767&e)-16446,o[1].v=(1-2*s)*(v2*Math.pow(2,e+32)+v1*Math.pow(2,e)),o}function write_NUMBER_17(R,C,wsidx,v){var o=new_buf(14);if(o.write_shift(2,R),o.write_shift(1,wsidx),o.write_shift(1,C),0==v)return o.write_shift(4,0),o.write_shift(4,0),o.write_shift(2,65535),o;var v1,s=0,e=0,v2=0;return v<0&&(s=1,v=-v),e=0|Math.log2(v),2147483648&(v2=(v/=Math.pow(2,e-31))>>>0)||(++e,v2=(v/=2)>>>0),v-=v2,v2|=2147483648,v2>>>=0,v1=(v*=Math.pow(2,32))>>>0,o.write_shift(4,v1),o.write_shift(4,v2),e+=16383+(s?32768:0),o.write_shift(2,e),o}function parse_NUMBER_27(blob,length){var o=parse_cell_3(blob),v1=blob.read_shift(8,"f");return o[1].v=v1,o}function parse_SHEETNAMECS(blob,length){return 0==blob[blob.l+length-1]?blob.read_shift(length,"cstr"):""}function write_XFORMAT_SHEETNAME(name,wsidx){var out=new_buf(5+name.length);out.write_shift(2,14e3),out.write_shift(2,wsidx);for(var i=0;i<name.length;++i){var cc=name.charCodeAt(i);out[out.l++]=cc>127?95:cc}return out[out.l++]=0,out}var WK1Enum={0:{n:"BOF",f:parseuint16},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:function(blob,length,opts){var o={s:{c:0,r:0},e:{c:0,r:0}};return 8==length&&opts.qpro?(o.s.c=blob.read_shift(1),blob.l++,o.s.r=blob.read_shift(2),o.e.c=blob.read_shift(1),blob.l++,o.e.r=blob.read_shift(2),o):(o.s.c=blob.read_shift(2),o.s.r=blob.read_shift(2),12==length&&opts.qpro&&(blob.l+=2),o.e.c=blob.read_shift(2),o.e.r=blob.read_shift(2),12==length&&opts.qpro&&(blob.l+=2),65535==o.s.c&&(o.s.c=o.e.c=o.s.r=o.e.r=0),o)}},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:function(blob,length,opts){var o=parse_cell(blob,0,opts);return o[1].v=blob.read_shift(2,"i"),o}},14:{n:"NUMBER",f:function(blob,length,opts){var o=parse_cell(blob,0,opts);return o[1].v=blob.read_shift(8,"f"),o}},15:{n:"LABEL",f:parse_LABEL},16:{n:"FORMULA",f:function(blob,length,opts){var tgt=blob.l+length,o=parse_cell(blob,0,opts);if(o[1].v=blob.read_shift(8,"f"),opts.qpro)blob.l=tgt;else{var flen=blob.read_shift(2);!function(blob,o){prep_blob(blob,0);var out=[],argc=0,R="",C="",argL="",argR="";for(;blob.l<blob.length;){var cc=blob[blob.l++];switch(cc){case 0:out.push(blob.read_shift(8,"f"));break;case 1:C=wk1_parse_rc(o[0].c,blob.read_shift(2),!0),R=wk1_parse_rc(o[0].r,blob.read_shift(2),!1),out.push(C+R);break;case 2:var c=wk1_parse_rc(o[0].c,blob.read_shift(2),!0),r=wk1_parse_rc(o[0].r,blob.read_shift(2),!1);C=wk1_parse_rc(o[0].c,blob.read_shift(2),!0),R=wk1_parse_rc(o[0].r,blob.read_shift(2),!1),out.push(c+r+":"+C+R);break;case 3:if(blob.l<blob.length)return void console.error("WK1 premature formula end");break;case 4:out.push("("+out.pop()+")");break;case 5:out.push(blob.read_shift(2));break;case 6:for(var Z="";cc=blob[blob.l++];)Z+=String.fromCharCode(cc);out.push('"'+Z.replace(/"/g,'""')+'"');break;case 8:out.push("-"+out.pop());break;case 23:out.push("+"+out.pop());break;case 22:out.push("NOT("+out.pop()+")");break;case 20:case 21:argR=out.pop(),argL=out.pop(),out.push(["AND","OR"][cc-20]+"("+argL+","+argR+")");break;default:if(cc<32&&BinOpTab[cc])argR=out.pop(),argL=out.pop(),out.push(argL+BinOpTab[cc]+argR);else{if(!FuncTab[cc])return cc<=7?console.error("WK1 invalid opcode "+cc.toString(16)):cc<=24?console.error("WK1 unsupported op "+cc.toString(16)):cc<=30?console.error("WK1 invalid opcode "+cc.toString(16)):cc<=115?console.error("WK1 unsupported function opcode "+cc.toString(16)):console.error("WK1 unrecognized opcode "+cc.toString(16));if(69==(argc=FuncTab[cc][1])&&(argc=blob[blob.l++]),argc>out.length)return void console.error("WK1 bad formula parse 0x"+cc.toString(16)+":|"+out.join("|")+"|");var args=out.slice(-argc);out.length-=argc,out.push(FuncTab[cc][0]+"("+args.join(",")+")")}}}1==out.length?o[1].f=""+out[0]:console.error("WK1 bad formula parse |"+out.join("|")+"|")}(blob.slice(blob.l,blob.l+flen),o),blob.l+=flen}return o}},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:parse_LABEL},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:parse_SHEETNAMECS},222:{n:"SHEETNAMELP",f:function(blob,length){var len=blob[blob.l++];len>length-1&&(len=length-1);for(var o="";o.length<len;)o+=String.fromCharCode(blob[blob.l++]);return o}},65535:{n:""}},WK3Enum={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:function(blob,length){var o=parse_cell_3(blob);return o[1].t="s",o[1].v=blob.read_shift(length-4,"cstr"),o}},23:{n:"NUMBER17",f:parse_NUMBER_17},24:{n:"NUMBER18",f:function(blob,length){var o=parse_cell_3(blob);o[1].v=blob.read_shift(2);var v=o[1].v>>1;if(1&o[1].v)switch(7&v){case 0:v=5e3*(v>>3);break;case 1:v=500*(v>>3);break;case 2:v=(v>>3)/20;break;case 3:v=(v>>3)/200;break;case 4:v=(v>>3)/2e3;break;case 5:v=(v>>3)/2e4;break;case 6:v=(v>>3)/16;break;case 7:v=(v>>3)/64}return o[1].v=v,o}},25:{n:"FORMULA19",f:function(blob,length){var o=parse_NUMBER_17(blob);return blob.l+=length-14,o}},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:function(blob,length){for(var o={},tgt=blob.l+length;blob.l<tgt;){var dt=blob.read_shift(2);if(14e3==dt){for(o[dt]=[0,""],o[dt][0]=blob.read_shift(2);blob[blob.l];)o[dt][1]+=String.fromCharCode(blob[blob.l]),blob.l++;blob.l++}}return o}},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:function(blob,length){var o=parse_cell_3(blob),v1=blob.read_shift(4);return o[1].v=v1>>6,o}},38:{n:"??"},39:{n:"NUMBER27",f:parse_NUMBER_27},40:{n:"FORMULA28",f:function(blob,length){var o=parse_NUMBER_27(blob);return blob.l+=length-10,o}},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:parse_SHEETNAMECS},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:function(blob,length,opts){if(opts.qpro&&!(length<21)){var id=blob.read_shift(1);return blob.l+=17,blob.l+=1,blob.l+=2,[id,blob.read_shift(length-21,"cstr")]}}},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:function(ws,opts){var o=opts||{};if(+o.codepage>=0&&set_cp(+o.codepage),"string"==o.type)throw new Error("Cannot write WK1 to JS string");var ba=buf_array(),range=safe_decode_range(ws["!ref"]),dense=Array.isArray(ws),cols=[];write_biff_rec(ba,0,function(v){var out=new_buf(2);return out.write_shift(2,v),out}(1030)),write_biff_rec(ba,6,function(range){var out=new_buf(8);return out.write_shift(2,range.s.c),out.write_shift(2,range.s.r),out.write_shift(2,range.e.c),out.write_shift(2,range.e.r),out}(range));for(var max_R=Math.min(range.e.r,8191),R=range.s.r;R<=max_R;++R)for(var rr=encode_row(R),C=range.s.c;C<=range.e.c;++C){R===range.s.r&&(cols[C]=encode_col(C));var ref=cols[C]+rr,cell=dense?(ws[R]||[])[C]:ws[ref];if(cell&&"z"!=cell.t)if("n"==cell.t)(0|cell.v)==cell.v&&cell.v>=-32768&&cell.v<=32767?write_biff_rec(ba,13,write_INTEGER(R,C,cell.v)):write_biff_rec(ba,14,write_NUMBER(R,C,cell.v));else write_biff_rec(ba,15,write_LABEL(R,C,format_cell(cell).slice(0,239)))}return write_biff_rec(ba,1),ba.end()},book_to_wk3:function(wb,opts){var o=opts||{};if(+o.codepage>=0&&set_cp(+o.codepage),"string"==o.type)throw new Error("Cannot write WK3 to JS string");var ba=buf_array();write_biff_rec(ba,0,function(wb){var out=new_buf(26);out.write_shift(2,4096),out.write_shift(2,4),out.write_shift(4,0);for(var rows=0,cols=0,wscnt=0,i=0;i<wb.SheetNames.length;++i){var name=wb.SheetNames[i],ws=wb.Sheets[name];if(ws&&ws["!ref"]){++wscnt;var range=decode_range(ws["!ref"]);rows<range.e.r&&(rows=range.e.r),cols<range.e.c&&(cols=range.e.c)}}rows>8191&&(rows=8191);return out.write_shift(2,rows),out.write_shift(1,wscnt),out.write_shift(1,cols),out.write_shift(2,0),out.write_shift(2,0),out.write_shift(1,1),out.write_shift(1,2),out.write_shift(4,0),out.write_shift(4,0),out}(wb));for(var i=0,cnt=0;i<wb.SheetNames.length;++i)(wb.Sheets[wb.SheetNames[i]]||{})["!ref"]&&write_biff_rec(ba,27,write_XFORMAT_SHEETNAME(wb.SheetNames[i],cnt++));var wsidx=0;for(i=0;i<wb.SheetNames.length;++i){var ws=wb.Sheets[wb.SheetNames[i]];if(ws&&ws["!ref"]){for(var range=safe_decode_range(ws["!ref"]),dense=Array.isArray(ws),cols=[],max_R=Math.min(range.e.r,8191),R=range.s.r;R<=max_R;++R)for(var rr=encode_row(R),C=range.s.c;C<=range.e.c;++C){R===range.s.r&&(cols[C]=encode_col(C));var ref=cols[C]+rr,cell=dense?(ws[R]||[])[C]:ws[ref];if(cell&&"z"!=cell.t)if("n"==cell.t)write_biff_rec(ba,23,write_NUMBER_17(R,C,wsidx,cell.v));else write_biff_rec(ba,22,write_LABEL_16(R,C,wsidx,format_cell(cell).slice(0,239)))}++wsidx}}return write_biff_rec(ba,1),ba.end()},to_workbook:function(d,opts){switch(opts.type){case"base64":return lotus_to_workbook_buf(s2a(Base64_decode(d)),opts);case"binary":return lotus_to_workbook_buf(s2a(d),opts);case"buffer":case"array":return lotus_to_workbook_buf(d,opts)}throw"Unsupported type "+opts.type}}}(),straywsregex=/^\s|\s$|[\t\n\r]/;function write_sst_xml(sst,opts){if(!opts.bookSST)return"";var o=[XML_HEADER];o[o.length]=writextag("sst",null,{xmlns:XMLNS_main[0],count:sst.Count,uniqueCount:sst.Unique});for(var i=0;i!=sst.length;++i)if(null!=sst[i]){var s=sst[i],sitag="<si>";s.r?sitag+=s.r:(sitag+="<t",s.t||(s.t=""),s.t.match(straywsregex)&&(sitag+=' xml:space="preserve"'),sitag+=">"+escapexml(s.t)+"</t>"),sitag+="</si>",o[o.length]=sitag}return o.length>2&&(o[o.length]="</sst>",o[1]=o[1].replace("/>",">")),o.join("")}var write_BrtSSTItem=function(str,o){var _null=!1;return null==o&&(_null=!0,o=new_buf(15+4*str.t.length)),o.write_shift(1,0),write_XLWideString(str.t,o),_null?o.slice(0,o.l):o};function write_sst_bin(sst){var ba=buf_array();write_record(ba,159,function(sst,o){return o||(o=new_buf(8)),o.write_shift(4,sst.Count),o.write_shift(4,sst.Unique),o}(sst));for(var i=0;i<sst.length;++i)write_record(ba,19,write_BrtSSTItem(sst[i]));return write_record(ba,160),ba.end()}function crypto_CreatePasswordVerifier_Method1(Password){var PasswordArray,i,Verifier=0,PasswordDecoded=function(str){for(var o=[],oo=str.split(""),i=0;i<oo.length;++i)o[i]=oo[i].charCodeAt(0);return o}(Password),len=PasswordDecoded.length+1;for((PasswordArray=new_raw_buf(len))[0]=PasswordDecoded.length,i=1;i!=len;++i)PasswordArray[i]=PasswordDecoded[i-1];for(i=len-1;i>=0;--i)Verifier=((16384&Verifier?1:0)|Verifier<<1&32767)^PasswordArray[i];return 52811^Verifier}var RTF=function(){function rtf_to_sheet(d,opts){switch(opts.type){case"base64":return rtf_to_sheet_str(Base64_decode(d),opts);case"binary":return rtf_to_sheet_str(d,opts);case"buffer":return rtf_to_sheet_str(has_buf&&Buffer.isBuffer(d)?d.toString("binary"):a2s(d),opts);case"array":return rtf_to_sheet_str(cc2str(d),opts)}throw new Error("Unrecognized type "+opts.type)}function rtf_to_sheet_str(str,opts){var ws=(opts||{}).dense?[]:{},rows=str.match(/\\trowd.*?\\row\b/g);if(!rows.length)throw new Error("RTF missing table");var range={s:{c:0,r:0},e:{c:0,r:rows.length-1}};return rows.forEach((function(rowtf,R){Array.isArray(ws)&&(ws[R]=[]);for(var res,rtfre=/\\\w+\b/g,last_index=0,C=-1;res=rtfre.exec(rowtf);){if("\\cell"===res[0]){var data=rowtf.slice(last_index,rtfre.lastIndex-res[0].length);if(" "==data[0]&&(data=data.slice(1)),++C,data.length){var cell={v:data,t:"s"};Array.isArray(ws)?ws[R][C]=cell:ws[encode_cell({r:R,c:C})]=cell}}last_index=rtfre.lastIndex}C>range.e.c&&(range.e.c=C)})),ws["!ref"]=encode_range(range),ws}return{to_workbook:function(d,opts){return sheet_to_workbook(rtf_to_sheet(d,opts),opts)},to_sheet:rtf_to_sheet,from_sheet:function(ws){for(var cell,o=["{\\rtf1\\ansi"],r=safe_decode_range(ws["!ref"]),dense=Array.isArray(ws),R=r.s.r;R<=r.e.r;++R){o.push("\\trowd\\trautofit1");for(var C=r.s.c;C<=r.e.c;++C)o.push("\\cellx"+(C+1));for(o.push("\\pard\\intbl"),C=r.s.c;C<=r.e.c;++C){var coord=encode_cell({r:R,c:C});(cell=dense?(ws[R]||[])[C]:ws[coord])&&(null!=cell.v||cell.f&&!cell.F)&&(o.push(" "+(cell.w||(format_cell(cell),cell.w))),o.push("\\cell"))}o.push("\\pard\\intbl\\row")}return o.join("")+"}"}}}();function rgb2Hex(rgb){for(var i=0,o=1;3!=i;++i)o=256*o+(rgb[i]>255?255:rgb[i]<0?0:rgb[i]);return o.toString(16).toUpperCase().slice(1)}var MDW=6;function width2px(width){return Math.floor((width+Math.round(128/MDW)/256)*MDW)}function px2char(px){return Math.floor((px-5)/MDW*100+.5)/100}function char2width(chr){return Math.round((chr*MDW+5)/MDW*256)/256}function process_col(coll){coll.width?(coll.wpx=width2px(coll.width),coll.wch=px2char(coll.wpx),coll.MDW=MDW):coll.wpx?(coll.wch=px2char(coll.wpx),coll.width=char2width(coll.wch),coll.MDW=MDW):"number"==typeof coll.wch&&(coll.width=char2width(coll.wch),coll.wpx=width2px(coll.width),coll.MDW=MDW),coll.customWidth&&delete coll.customWidth}var PPI=96;function px2pt(px){return 96*px/PPI}function pt2px(pt){return pt*PPI/96}function write_sty_xml(wb,opts){var w,o=[XML_HEADER,writextag("styleSheet",null,{xmlns:XMLNS_main[0],"xmlns:vt":XMLNS_vt})];return wb.SSF&&null!=(w=function(NF){var o=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach((function(r){for(var i=r[0];i<=r[1];++i)null!=NF[i]&&(o[o.length]=writextag("numFmt",null,{numFmtId:i,formatCode:escapexml(NF[i])}))})),1===o.length?"":(o[o.length]="</numFmts>",o[0]=writextag("numFmts",null,{count:o.length-2}).replace("/>",">"),o.join(""))}(wb.SSF))&&(o[o.length]=w),o[o.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',o[o.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',o[o.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',o[o.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(w=function(cellXfs){var o=[];return o[o.length]=writextag("cellXfs",null),cellXfs.forEach((function(c){o[o.length]=writextag("xf",null,c)})),o[o.length]="</cellXfs>",2===o.length?"":(o[0]=writextag("cellXfs",null,{count:o.length-2}).replace("/>",">"),o.join(""))}(opts.cellXfs))&&(o[o.length]=w),o[o.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',o[o.length]='<dxfs count="0"/>',o[o.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',o.length>2&&(o[o.length]="</styleSheet>",o[1]=o[1].replace("/>",">")),o.join("")}function write_BrtFmt(i,f,o){o||(o=new_buf(6+4*f.length)),o.write_shift(2,i),write_XLWideString(f,o);var out=o.length>o.l?o.slice(0,o.l):o;return null==o.l&&(o.l=o.length),out}function write_BrtFont(font,o){o||(o=new_buf(153)),o.write_shift(2,20*font.sz),function(font,o){o||(o=new_buf(2));var grbit=(font.italic?2:0)|(font.strike?8:0)|(font.outline?16:0)|(font.shadow?32:0)|(font.condense?64:0)|(font.extend?128:0);o.write_shift(1,grbit),o.write_shift(1,0)}(font,o),o.write_shift(2,font.bold?700:400);var sss=0;"superscript"==font.vertAlign?sss=1:"subscript"==font.vertAlign&&(sss=2),o.write_shift(2,sss),o.write_shift(1,font.underline||0),o.write_shift(1,font.family||0),o.write_shift(1,font.charset||0),o.write_shift(1,0),write_BrtColor(font.color,o);var scheme=0;return"major"==font.scheme&&(scheme=1),"minor"==font.scheme&&(scheme=2),o.write_shift(1,scheme),write_XLWideString(font.name,o),o.length>o.l?o.slice(0,o.l):o}var rev_XLSBFillPTNames,XLSBFillPTNames=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],parse_BrtFill=parsenoop;function write_BrtFill(fill,o){o||(o=new_buf(84)),rev_XLSBFillPTNames||(rev_XLSBFillPTNames=evert(XLSBFillPTNames));var fls=rev_XLSBFillPTNames[fill.patternType];null==fls&&(fls=40),o.write_shift(4,fls);var j=0;if(40!=fls)for(write_BrtColor({auto:1},o),write_BrtColor({auto:1},o);j<12;++j)o.write_shift(4,0);else{for(;j<4;++j)o.write_shift(4,0);for(;j<12;++j)o.write_shift(4,0)}return o.length>o.l?o.slice(0,o.l):o}function write_BrtXF(data,ixfeP,o){o||(o=new_buf(16)),o.write_shift(2,ixfeP||0),o.write_shift(2,data.numFmtId||0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(1,0),o.write_shift(1,0);return o.write_shift(1,0),o.write_shift(1,0),o.write_shift(1,0),o.write_shift(1,0),o}function write_Blxf(data,o){return o||(o=new_buf(10)),o.write_shift(1,0),o.write_shift(1,0),o.write_shift(4,0),o.write_shift(4,0),o}var parse_BrtBorder=parsenoop;function write_BORDERS_bin(ba){var o;write_record(ba,613,write_UInt32LE(1)),write_record(ba,46,(o||(o=new_buf(51)),o.write_shift(1,0),write_Blxf(0,o),write_Blxf(0,o),write_Blxf(0,o),write_Blxf(0,o),write_Blxf(0,o),o.length>o.l?o.slice(0,o.l):o)),write_record(ba,614)}function write_STYLES_bin(ba){write_record(ba,619,write_UInt32LE(1)),write_record(ba,48,function(style,o){return o||(o=new_buf(52)),o.write_shift(4,style.xfId),o.write_shift(2,1),o.write_shift(1,+style.builtinId),o.write_shift(1,0),write_XLNullableWideString(style.name||"",o),o.length>o.l?o.slice(0,o.l):o}({xfId:0,builtinId:0,name:"Normal"})),write_record(ba,620)}function write_TABLESTYLES_bin(ba){write_record(ba,508,function(cnt,defTableStyle,defPivotStyle){var o=new_buf(2052);return o.write_shift(4,cnt),write_XLNullableWideString(defTableStyle,o),write_XLNullableWideString(defPivotStyle,o),o.length>o.l?o.slice(0,o.l):o}(0,"TableStyleMedium9","PivotStyleMedium4")),write_record(ba,509)}function write_sty_bin(wb,opts){var ba=buf_array();return write_record(ba,278),function(ba,NF){if(NF){var cnt=0;[[5,8],[23,26],[41,44],[50,392]].forEach((function(r){for(var i=r[0];i<=r[1];++i)null!=NF[i]&&++cnt})),0!=cnt&&(write_record(ba,615,write_UInt32LE(cnt)),[[5,8],[23,26],[41,44],[50,392]].forEach((function(r){for(var i=r[0];i<=r[1];++i)null!=NF[i]&&write_record(ba,44,write_BrtFmt(i,NF[i]))})),write_record(ba,616))}}(ba,wb.SSF),function(ba){write_record(ba,611,write_UInt32LE(1)),write_record(ba,43,write_BrtFont({sz:12,color:{theme:1},name:"Calibri",family:2,scheme:"minor"})),write_record(ba,612)}(ba),function(ba){write_record(ba,603,write_UInt32LE(2)),write_record(ba,45,write_BrtFill({patternType:"none"})),write_record(ba,45,write_BrtFill({patternType:"gray125"})),write_record(ba,604)}(ba),write_BORDERS_bin(ba),function(ba){write_record(ba,626,write_UInt32LE(1)),write_record(ba,47,write_BrtXF({numFmtId:0,fontId:0,fillId:0,borderId:0},65535)),write_record(ba,627)}(ba),function(ba,data){write_record(ba,617,write_UInt32LE(data.length)),data.forEach((function(c){write_record(ba,47,write_BrtXF(c,0))})),write_record(ba,618)}(ba,opts.cellXfs),write_STYLES_bin(ba),function(ba){write_record(ba,505,write_UInt32LE(0)),write_record(ba,506)}(ba),write_TABLESTYLES_bin(ba),write_record(ba,279),ba.end()}function write_theme(Themes,opts){if(opts&&opts.themeXLSX)return opts.themeXLSX;if(Themes&&"string"==typeof Themes.raw)return Themes.raw;var o=[XML_HEADER];return o[o.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',o[o.length]="<a:themeElements>",o[o.length]='<a:clrScheme name="Office">',o[o.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',o[o.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',o[o.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',o[o.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',o[o.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',o[o.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',o[o.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',o[o.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',o[o.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',o[o.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',o[o.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',o[o.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',o[o.length]="</a:clrScheme>",o[o.length]='<a:fontScheme name="Office">',o[o.length]="<a:majorFont>",o[o.length]='<a:latin typeface="Cambria"/>',o[o.length]='<a:ea typeface=""/>',o[o.length]='<a:cs typeface=""/>',o[o.length]='<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>',o[o.length]='<a:font script="Hang" typeface="맑은 고딕"/>',o[o.length]='<a:font script="Hans" typeface="宋体"/>',o[o.length]='<a:font script="Hant" typeface="新細明體"/>',o[o.length]='<a:font script="Arab" typeface="Times New Roman"/>',o[o.length]='<a:font script="Hebr" typeface="Times New Roman"/>',o[o.length]='<a:font script="Thai" typeface="Tahoma"/>',o[o.length]='<a:font script="Ethi" typeface="Nyala"/>',o[o.length]='<a:font script="Beng" typeface="Vrinda"/>',o[o.length]='<a:font script="Gujr" typeface="Shruti"/>',o[o.length]='<a:font script="Khmr" typeface="MoolBoran"/>',o[o.length]='<a:font script="Knda" typeface="Tunga"/>',o[o.length]='<a:font script="Guru" typeface="Raavi"/>',o[o.length]='<a:font script="Cans" typeface="Euphemia"/>',o[o.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',o[o.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',o[o.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',o[o.length]='<a:font script="Thaa" typeface="MV Boli"/>',o[o.length]='<a:font script="Deva" typeface="Mangal"/>',o[o.length]='<a:font script="Telu" typeface="Gautami"/>',o[o.length]='<a:font script="Taml" typeface="Latha"/>',o[o.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',o[o.length]='<a:font script="Orya" typeface="Kalinga"/>',o[o.length]='<a:font script="Mlym" typeface="Kartika"/>',o[o.length]='<a:font script="Laoo" typeface="DokChampa"/>',o[o.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',o[o.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',o[o.length]='<a:font script="Viet" typeface="Times New Roman"/>',o[o.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',o[o.length]='<a:font script="Geor" typeface="Sylfaen"/>',o[o.length]="</a:majorFont>",o[o.length]="<a:minorFont>",o[o.length]='<a:latin typeface="Calibri"/>',o[o.length]='<a:ea typeface=""/>',o[o.length]='<a:cs typeface=""/>',o[o.length]='<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>',o[o.length]='<a:font script="Hang" typeface="맑은 고딕"/>',o[o.length]='<a:font script="Hans" typeface="宋体"/>',o[o.length]='<a:font script="Hant" typeface="新細明體"/>',o[o.length]='<a:font script="Arab" typeface="Arial"/>',o[o.length]='<a:font script="Hebr" typeface="Arial"/>',o[o.length]='<a:font script="Thai" typeface="Tahoma"/>',o[o.length]='<a:font script="Ethi" typeface="Nyala"/>',o[o.length]='<a:font script="Beng" typeface="Vrinda"/>',o[o.length]='<a:font script="Gujr" typeface="Shruti"/>',o[o.length]='<a:font script="Khmr" typeface="DaunPenh"/>',o[o.length]='<a:font script="Knda" typeface="Tunga"/>',o[o.length]='<a:font script="Guru" typeface="Raavi"/>',o[o.length]='<a:font script="Cans" typeface="Euphemia"/>',o[o.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',o[o.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',o[o.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',o[o.length]='<a:font script="Thaa" typeface="MV Boli"/>',o[o.length]='<a:font script="Deva" typeface="Mangal"/>',o[o.length]='<a:font script="Telu" typeface="Gautami"/>',o[o.length]='<a:font script="Taml" typeface="Latha"/>',o[o.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',o[o.length]='<a:font script="Orya" typeface="Kalinga"/>',o[o.length]='<a:font script="Mlym" typeface="Kartika"/>',o[o.length]='<a:font script="Laoo" typeface="DokChampa"/>',o[o.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',o[o.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',o[o.length]='<a:font script="Viet" typeface="Arial"/>',o[o.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',o[o.length]='<a:font script="Geor" typeface="Sylfaen"/>',o[o.length]="</a:minorFont>",o[o.length]="</a:fontScheme>",o[o.length]='<a:fmtScheme name="Office">',o[o.length]="<a:fillStyleLst>",o[o.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',o[o.length]='<a:gradFill rotWithShape="1">',o[o.length]="<a:gsLst>",o[o.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',o[o.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',o[o.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',o[o.length]="</a:gsLst>",o[o.length]='<a:lin ang="16200000" scaled="1"/>',o[o.length]="</a:gradFill>",o[o.length]='<a:gradFill rotWithShape="1">',o[o.length]="<a:gsLst>",o[o.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',o[o.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',o[o.length]="</a:gsLst>",o[o.length]='<a:lin ang="16200000" scaled="0"/>',o[o.length]="</a:gradFill>",o[o.length]="</a:fillStyleLst>",o[o.length]="<a:lnStyleLst>",o[o.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',o[o.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',o[o.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',o[o.length]="</a:lnStyleLst>",o[o.length]="<a:effectStyleLst>",o[o.length]="<a:effectStyle>",o[o.length]="<a:effectLst>",o[o.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',o[o.length]="</a:effectLst>",o[o.length]="</a:effectStyle>",o[o.length]="<a:effectStyle>",o[o.length]="<a:effectLst>",o[o.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',o[o.length]="</a:effectLst>",o[o.length]="</a:effectStyle>",o[o.length]="<a:effectStyle>",o[o.length]="<a:effectLst>",o[o.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',o[o.length]="</a:effectLst>",o[o.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',o[o.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',o[o.length]="</a:effectStyle>",o[o.length]="</a:effectStyleLst>",o[o.length]="<a:bgFillStyleLst>",o[o.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',o[o.length]='<a:gradFill rotWithShape="1">',o[o.length]="<a:gsLst>",o[o.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',o[o.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',o[o.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',o[o.length]="</a:gsLst>",o[o.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',o[o.length]="</a:gradFill>",o[o.length]='<a:gradFill rotWithShape="1">',o[o.length]="<a:gsLst>",o[o.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',o[o.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',o[o.length]="</a:gsLst>",o[o.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',o[o.length]="</a:gradFill>",o[o.length]="</a:bgFillStyleLst>",o[o.length]="</a:fmtScheme>",o[o.length]="</a:themeElements>",o[o.length]="<a:objectDefaults>",o[o.length]="<a:spDef>",o[o.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',o[o.length]="</a:spDef>",o[o.length]="<a:lnDef>",o[o.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',o[o.length]="</a:lnDef>",o[o.length]="</a:objectDefaults>",o[o.length]="<a:extraClrSchemeLst/>",o[o.length]="</a:theme>",o.join("")}function write_xlmeta_bin(){var data,o,ba=buf_array();return write_record(ba,332),write_record(ba,334,write_UInt32LE(1)),write_record(ba,335,((o=new_buf(12+2*(data={name:"XLDAPR",version:12e4,flags:3496657072}).name.length)).write_shift(4,data.flags),o.write_shift(4,data.version),write_XLWideString(data.name,o),o.slice(0,o.l))),write_record(ba,336),write_record(ba,339,function(cnt,name){var o=new_buf(8+2*name.length);return o.write_shift(4,cnt),write_XLWideString(name,o),o.slice(0,o.l)}(1,"XLDAPR")),write_record(ba,52),write_record(ba,35,write_UInt32LE(514)),write_record(ba,4096,write_UInt32LE(0)),write_record(ba,4097,writeuint16(1)),write_record(ba,36),write_record(ba,53),write_record(ba,340),write_record(ba,337,function(cnt,cm){var o=new_buf(8);return o.write_shift(4,cnt),o.write_shift(4,cm?1:0),o}(1,!0)),write_record(ba,51,function(mdb){var o=new_buf(4+8*mdb.length);o.write_shift(4,mdb.length);for(var i=0;i<mdb.length;++i)o.write_shift(4,mdb[i][0]),o.write_shift(4,mdb[i][1]);return o}([[1,0]])),write_record(ba,338),write_record(ba,333),ba.end()}function write_xlmeta_xml(){var o=[XML_HEADER];return o.push('<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">\n  <metadataTypes count="1">\n    <metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>\n  </metadataTypes>\n  <futureMetadata name="XLDAPR" count="1">\n    <bk>\n      <extLst>\n        <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}">\n          <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/>\n        </ext>\n      </extLst>\n    </bk>\n  </futureMetadata>\n  <cellMetadata count="1">\n    <bk>\n      <rc t="1" v="0"/>\n    </bk>\n  </cellMetadata>\n</metadata>'),o.join("")}var _shapeid=1024;function write_comments_vml(rId,comments){for(var csize=[21600,21600],bbox=["m0,0l0",csize[1],csize[0],csize[1],csize[0],"0xe"].join(","),o=[writextag("xml",null,{"xmlns:v":XLMLNS_v,"xmlns:o":XLMLNS_o,"xmlns:x":XLMLNS_x,"xmlns:mv":XLMLNS_mv}).replace(/\/>/,">"),writextag("o:shapelayout",writextag("o:idmap",null,{"v:ext":"edit",data:rId}),{"v:ext":"edit"}),writextag("v:shapetype",[writextag("v:stroke",null,{joinstyle:"miter"}),writextag("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:csize.join(","),path:bbox})];_shapeid<1e3*rId;)_shapeid+=1e3;return comments.forEach((function(x){var c=decode_cell(x[0]),fillopts={color2:"#BEFF82",type:"gradient"};"gradient"==fillopts.type&&(fillopts.angle="-180");var fillparm="gradient"==fillopts.type?writextag("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,fillxml=writextag("v:fill",fillparm,fillopts);++_shapeid,o=o.concat(["<v:shape"+wxt_helper({id:"_x0000_s"+_shapeid,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(x[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",fillxml,writextag("v:shadow",null,{on:"t",obscured:"t"}),writextag("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",writetag("x:Anchor",[c.c+1,0,c.r+1,0,c.c+3,20,c.r+5,20].join(",")),writetag("x:AutoFill","False"),writetag("x:Row",String(c.r)),writetag("x:Column",String(c.c)),x[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])})),o.push("</xml>"),o.join("")}function write_comments_xml(data){var o=[XML_HEADER,writextag("comments",null,{xmlns:XMLNS_main[0]})],iauthor=[];return o.push("<authors>"),data.forEach((function(x){x[1].forEach((function(w){var a=escapexml(w.a);-1==iauthor.indexOf(a)&&(iauthor.push(a),o.push("<author>"+a+"</author>")),w.T&&w.ID&&-1==iauthor.indexOf("tc="+w.ID)&&(iauthor.push("tc="+w.ID),o.push("<author>tc="+w.ID+"</author>"))}))})),0==iauthor.length&&(iauthor.push("SheetJ5"),o.push("<author>SheetJ5</author>")),o.push("</authors>"),o.push("<commentList>"),data.forEach((function(d){var lastauthor=0,ts=[];if(d[1][0]&&d[1][0].T&&d[1][0].ID?lastauthor=iauthor.indexOf("tc="+d[1][0].ID):d[1].forEach((function(c){c.a&&(lastauthor=iauthor.indexOf(escapexml(c.a))),ts.push(c.t||"")})),o.push('<comment ref="'+d[0]+'" authorId="'+lastauthor+'"><text>'),ts.length<=1)o.push(writetag("t",escapexml(ts[0]||"")));else{for(var t="Comment:\n    "+ts[0]+"\n",i=1;i<ts.length;++i)t+="Reply:\n    "+ts[i]+"\n";o.push(writetag("t",escapexml(t)))}o.push("</text></comment>")})),o.push("</commentList>"),o.length>2&&(o[o.length]="</comments>",o[1]=o[1].replace("/>",">")),o.join("")}function write_tcmnt_xml(comments,people,opts){var o=[XML_HEADER,writextag("ThreadedComments",null,{xmlns:XMLNS_TCMNT}).replace(/[\/]>/,">")];return comments.forEach((function(carr){var rootid="";(carr[1]||[]).forEach((function(c,idx){if(c.T){c.a&&-1==people.indexOf(c.a)&&people.push(c.a);var tcopts={ref:carr[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+opts.tcid++).slice(-12)+"}"};0==idx?rootid=tcopts.id:tcopts.parentId=rootid,c.ID=tcopts.id,c.a&&(tcopts.personId="{54EE7950-7262-4200-6969-"+("000000000000"+people.indexOf(c.a)).slice(-12)+"}"),o.push(writextag("threadedComment",writetag("text",c.t||""),tcopts))}else delete c.ID}))})),o.push("</ThreadedComments>"),o.join("")}var parse_BrtCommentAuthor=parse_XLWideString;function write_comments_bin(data){var ba=buf_array(),iauthor=[];return write_record(ba,628),write_record(ba,630),data.forEach((function(comment){comment[1].forEach((function(c){iauthor.indexOf(c.a)>-1||(iauthor.push(c.a.slice(0,54)),write_record(ba,632,function(data){return write_XLWideString(data.slice(0,54))}(c.a)))}))})),write_record(ba,631),write_record(ba,633),data.forEach((function(comment){comment[1].forEach((function(c){c.iauthor=iauthor.indexOf(c.a);var range={s:decode_cell(comment[0]),e:decode_cell(comment[0])};write_record(ba,635,function(data,o){return null==o&&(o=new_buf(36)),o.write_shift(4,data[1].iauthor),write_UncheckedRfX(data[0],o),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(4,0),o}([range,c])),c.t&&c.t.length>0&&write_record(ba,637,write_BrtCommentText(c)),write_record(ba,636),delete c.iauthor}))})),write_record(ba,634),write_record(ba,629),ba.end()}var VBAFMTS=["xlsb","xlsm","xlam","biff8","xla"],rc_to_a1=function(){var rcregex=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,rcbase={r:0,c:0};function rcfunc($$,$1,$2,$3){var cRel=!1,rRel=!1;0==$2.length?rRel=!0:"["==$2.charAt(0)&&(rRel=!0,$2=$2.slice(1,-1)),0==$3.length?cRel=!0:"["==$3.charAt(0)&&(cRel=!0,$3=$3.slice(1,-1));var R=$2.length>0?0|parseInt($2,10):0,C=$3.length>0?0|parseInt($3,10):0;return cRel?C+=rcbase.c:--C,rRel?R+=rcbase.r:--R,$1+(cRel?"":"$")+encode_col(C)+(rRel?"":"$")+encode_row(R)}return function(fstr,base){return rcbase=base,fstr.replace(rcregex,rcfunc)}}(),crefregex=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,a1_to_rc=function(){return function(fstr,base){return fstr.replace(crefregex,(function($0,$1,$2,$3,$4,$5){var c=decode_col($3)-($2?0:base.c),r=decode_row($5)-($4?0:base.r);return $1+"R"+(0==r?"":$4?r+1:"["+r+"]")+"C"+(0==c?"":$2?c+1:"["+c+"]")}))}}();function shift_formula_str(f,delta){return f.replace(crefregex,(function($0,$1,$2,$3,$4,$5){return $1+("$"==$2?$2+$3:encode_col(decode_col($3)+delta.c))+("$"==$4?$4+$5:encode_row(decode_row($5)+delta.r))}))}function parseread1(blob){blob.l+=1}function parse_ColRelU(blob,length){var c=blob.read_shift(1==length?1:2);return[16383&c,c>>14&1,c>>15&1]}function parse_RgceArea(blob,length,opts){var w=2;if(opts){if(opts.biff>=2&&opts.biff<=5)return parse_RgceArea_BIFF2(blob);12==opts.biff&&(w=4)}var r=blob.read_shift(w),R=blob.read_shift(w),c=parse_ColRelU(blob,2),C=parse_ColRelU(blob,2);return{s:{r:r,c:c[0],cRel:c[1],rRel:c[2]},e:{r:R,c:C[0],cRel:C[1],rRel:C[2]}}}function parse_RgceArea_BIFF2(blob){var r=parse_ColRelU(blob,2),R=parse_ColRelU(blob,2),c=blob.read_shift(1),C=blob.read_shift(1);return{s:{r:r[0],c:c,cRel:r[1],rRel:r[2]},e:{r:R[0],c:C,cRel:R[1],rRel:R[2]}}}function parse_RgceLoc(blob,length,opts){if(opts&&opts.biff>=2&&opts.biff<=5)return function(blob){var r=parse_ColRelU(blob,2),c=blob.read_shift(1);return{r:r[0],c:c,cRel:r[1],rRel:r[2]}}(blob);var r=blob.read_shift(opts&&12==opts.biff?4:2),c=parse_ColRelU(blob,2);return{r:r,c:c[0],cRel:c[1],rRel:c[2]}}function parse_RgceElfLoc(blob){var r=blob.read_shift(2),c=blob.read_shift(2);return{r:r,c:255&c,fQuoted:!!(16384&c),cRel:c>>15,rRel:c>>15}}function parse_PtgAttrBaxcel(blob){var bitSemi=1&blob[blob.l+1];return blob.l+=4,[bitSemi,1]}function parse_PtgAttrSpaceType(blob){return[blob.read_shift(1),blob.read_shift(1)]}function parse_SerAr(blob,biff){var val=[blob.read_shift(1)];if(12==biff)switch(val[0]){case 2:val[0]=4;break;case 4:val[0]=16;break;case 0:val[0]=1;break;case 1:val[0]=2}switch(val[0]){case 4:val[1]=function(blob,length){return 1===blob.read_shift(length)}(blob,1)?"TRUE":"FALSE",12!=biff&&(blob.l+=7);break;case 37:case 16:val[1]=BErr[blob[blob.l]],blob.l+=12==biff?4:8;break;case 0:blob.l+=8;break;case 1:val[1]=parse_Xnum(blob);break;case 2:val[1]=function(blob,length,opts){if(opts.biff>5)return function(blob,length,opts){var cch=blob.read_shift(opts&&2==opts.biff?1:2);return 0===cch?(blob.l++,""):function(blob,cch,opts){if(opts){if(opts.biff>=2&&opts.biff<=5)return blob.read_shift(cch,"cpstr");if(opts.biff>=12)return blob.read_shift(cch,"dbcs-cont")}return 0===blob.read_shift(1)?blob.read_shift(cch,"sbcs-cont"):blob.read_shift(cch,"dbcs-cont")}(blob,cch,opts)}(blob,0,opts);var cch=blob.read_shift(1);return 0===cch?(blob.l++,""):blob.read_shift(cch,opts.biff<=4||!blob.lens?"cpstr":"sbcs-cont")}(blob,0,{biff:biff>0&&biff<8?2:biff});break;default:throw new Error("Bad SerAr: "+val[0])}return val}function parse_PtgExtraMem(blob,cce,opts){for(var count=blob.read_shift(12==opts.biff?4:2),out=[],i=0;i!=count;++i)out.push((12==opts.biff?parse_UncheckedRfX:parse_Ref8U)(blob));return out}function parse_PtgExtraArray(blob,length,opts){var rows=0,cols=0;12==opts.biff?(rows=blob.read_shift(4),cols=blob.read_shift(4)):(cols=1+blob.read_shift(1),rows=1+blob.read_shift(2)),opts.biff>=2&&opts.biff<8&&(--rows,0==--cols&&(cols=256));for(var i=0,o=[];i!=rows&&(o[i]=[]);++i)for(var j=0;j!=cols;++j)o[i][j]=parse_SerAr(blob,opts.biff);return o}function parse_PtgElfLoc(blob,length,opts){return blob.l+=2,[parse_RgceElfLoc(blob)]}function parse_PtgElfNoop(blob){return blob.l+=6,[]}function parse_PtgElfLel(blob){return blob.l+=2,[parseuint16(blob),1&blob.read_shift(2)]}var PtgListRT=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];var PtgTypes={1:{n:"PtgExp",f:function(blob,length,opts){return blob.l++,opts&&12==opts.biff?[blob.read_shift(4,"i"),0]:[blob.read_shift(2),blob.read_shift(opts&&2==opts.biff?1:2)]}},2:{n:"PtgTbl",f:parsenoop},3:{n:"PtgAdd",f:parseread1},4:{n:"PtgSub",f:parseread1},5:{n:"PtgMul",f:parseread1},6:{n:"PtgDiv",f:parseread1},7:{n:"PtgPower",f:parseread1},8:{n:"PtgConcat",f:parseread1},9:{n:"PtgLt",f:parseread1},10:{n:"PtgLe",f:parseread1},11:{n:"PtgEq",f:parseread1},12:{n:"PtgGe",f:parseread1},13:{n:"PtgGt",f:parseread1},14:{n:"PtgNe",f:parseread1},15:{n:"PtgIsect",f:parseread1},16:{n:"PtgUnion",f:parseread1},17:{n:"PtgRange",f:parseread1},18:{n:"PtgUplus",f:parseread1},19:{n:"PtgUminus",f:parseread1},20:{n:"PtgPercent",f:parseread1},21:{n:"PtgParen",f:parseread1},22:{n:"PtgMissArg",f:parseread1},23:{n:"PtgStr",f:function(blob,length,opts){return blob.l++,parse_ShortXLUnicodeString(blob,0,opts)}},26:{n:"PtgSheet",f:function(blob,length,opts){return blob.l+=5,blob.l+=2,blob.l+=2==opts.biff?1:4,["PTGSHEET"]}},27:{n:"PtgEndSheet",f:function(blob,length,opts){return blob.l+=2==opts.biff?4:5,["PTGENDSHEET"]}},28:{n:"PtgErr",f:function(blob){return blob.l++,BErr[blob.read_shift(1)]}},29:{n:"PtgBool",f:function(blob){return blob.l++,0!==blob.read_shift(1)}},30:{n:"PtgInt",f:function(blob){return blob.l++,blob.read_shift(2)}},31:{n:"PtgNum",f:function(blob){return blob.l++,parse_Xnum(blob)}},32:{n:"PtgArray",f:function(blob,length,opts){var type=(96&blob[blob.l++])>>5;return blob.l+=2==opts.biff?6:12==opts.biff?14:7,[type]}},33:{n:"PtgFunc",f:function(blob,length,opts){var type=(96&blob[blob.l])>>5;blob.l+=1;var iftab=blob.read_shift(opts&&opts.biff<=3?1:2);return[FtabArgc[iftab],Ftab[iftab],type]}},34:{n:"PtgFuncVar",f:function(blob,length,opts){var type=blob[blob.l++],cparams=blob.read_shift(1),tab=opts&&opts.biff<=3?[88==type?-1:0,blob.read_shift(1)]:function(blob){return[blob[blob.l+1]>>7,32767&blob.read_shift(2)]}(blob);return[cparams,(0===tab[0]?Ftab:Cetab)[tab[1]]]}},35:{n:"PtgName",f:function(blob,length,opts){var type=blob.read_shift(1)>>>5&3,w=!opts||opts.biff>=8?4:2,nameindex=blob.read_shift(w);switch(opts.biff){case 2:blob.l+=5;break;case 3:case 4:blob.l+=8;break;case 5:blob.l+=12}return[type,0,nameindex]}},36:{n:"PtgRef",f:function(blob,length,opts){var type=(96&blob[blob.l])>>5;return blob.l+=1,[type,parse_RgceLoc(blob,0,opts)]}},37:{n:"PtgArea",f:function(blob,length,opts){return[(96&blob[blob.l++])>>5,parse_RgceArea(blob,opts.biff>=2&&opts.biff,opts)]}},38:{n:"PtgMemArea",f:function(blob,length,opts){var type=blob.read_shift(1)>>>5&3;return blob.l+=opts&&2==opts.biff?3:4,[type,blob.read_shift(opts&&2==opts.biff?1:2)]}},39:{n:"PtgMemErr",f:parsenoop},40:{n:"PtgMemNoMem",f:parsenoop},41:{n:"PtgMemFunc",f:function(blob,length,opts){return[blob.read_shift(1)>>>5&3,blob.read_shift(opts&&2==opts.biff?1:2)]}},42:{n:"PtgRefErr",f:function(blob,length,opts){var type=blob.read_shift(1)>>>5&3;return blob.l+=4,opts.biff<8&&blob.l--,12==opts.biff&&(blob.l+=2),[type]}},43:{n:"PtgAreaErr",f:function(blob,length,opts){var type=(96&blob[blob.l++])>>5;return blob.l+=opts&&opts.biff>8?12:opts.biff<8?6:8,[type]}},44:{n:"PtgRefN",f:function(blob,length,opts){var type=(96&blob[blob.l])>>5;blob.l+=1;var loc=function(blob,length,opts){var biff=opts&&opts.biff?opts.biff:8;if(biff>=2&&biff<=5)return function(blob){var rl=blob.read_shift(2),c=blob.read_shift(1),rRel=(32768&rl)>>15,cRel=(16384&rl)>>14;return rl&=16383,1==rRel&&rl>=8192&&(rl-=16384),1==cRel&&c>=128&&(c-=256),{r:rl,c:c,cRel:cRel,rRel:rRel}}(blob);var r=blob.read_shift(biff>=12?4:2),cl=blob.read_shift(2),cRel=(16384&cl)>>14,rRel=(32768&cl)>>15;if(cl&=16383,1==rRel)for(;r>524287;)r-=1048576;if(1==cRel)for(;cl>8191;)cl-=16384;return{r:r,c:cl,cRel:cRel,rRel:rRel}}(blob,0,opts);return[type,loc]}},45:{n:"PtgAreaN",f:function(blob,length,opts){var type=(96&blob[blob.l++])>>5,area=function(blob,length,opts){if(opts.biff<8)return parse_RgceArea_BIFF2(blob);var r=blob.read_shift(12==opts.biff?4:2),R=blob.read_shift(12==opts.biff?4:2),c=parse_ColRelU(blob,2),C=parse_ColRelU(blob,2);return{s:{r:r,c:c[0],cRel:c[1],rRel:c[2]},e:{r:R,c:C[0],cRel:C[1],rRel:C[2]}}}(blob,0,opts);return[type,area]}},46:{n:"PtgMemAreaN",f:function(blob){return[blob.read_shift(1)>>>5&3,blob.read_shift(2)]}},47:{n:"PtgMemNoMemN",f:function(blob){return[blob.read_shift(1)>>>5&3,blob.read_shift(2)]}},57:{n:"PtgNameX",f:function(blob,length,opts){return 5==opts.biff?function(blob){var type=blob.read_shift(1)>>>5&3,ixti=blob.read_shift(2,"i");blob.l+=8;var nameindex=blob.read_shift(2);return blob.l+=12,[type,ixti,nameindex]}(blob):[blob.read_shift(1)>>>5&3,blob.read_shift(2),blob.read_shift(4)]}},58:{n:"PtgRef3d",f:function(blob,length,opts){var type=(96&blob[blob.l])>>5;blob.l+=1;var ixti=blob.read_shift(2);return opts&&5==opts.biff&&(blob.l+=12),[type,ixti,parse_RgceLoc(blob,0,opts)]}},59:{n:"PtgArea3d",f:function(blob,length,opts){var type=(96&blob[blob.l++])>>5,ixti=blob.read_shift(2,"i");if(opts)switch(opts.biff){case 5:blob.l+=12;break;case 12:0}return[type,ixti,parse_RgceArea(blob,0,opts)]}},60:{n:"PtgRefErr3d",f:function(blob,length,opts){var type=(96&blob[blob.l++])>>5,ixti=blob.read_shift(2),w=4;if(opts)switch(opts.biff){case 5:w=15;break;case 12:w=6}return blob.l+=w,[type,ixti]}},61:{n:"PtgAreaErr3d",f:function(blob,length,opts){var type=(96&blob[blob.l++])>>5,ixti=blob.read_shift(2),w=8;if(opts)switch(opts.biff){case 5:blob.l+=12,w=6;break;case 12:w=12}return blob.l+=w,[type,ixti]}},255:{}},PtgDupes={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},Ptg18={1:{n:"PtgElfLel",f:parse_PtgElfLel},2:{n:"PtgElfRw",f:parse_PtgElfLoc},3:{n:"PtgElfCol",f:parse_PtgElfLoc},6:{n:"PtgElfRwV",f:parse_PtgElfLoc},7:{n:"PtgElfColV",f:parse_PtgElfLoc},10:{n:"PtgElfRadical",f:parse_PtgElfLoc},11:{n:"PtgElfRadicalS",f:parse_PtgElfNoop},13:{n:"PtgElfColS",f:parse_PtgElfNoop},15:{n:"PtgElfColSV",f:parse_PtgElfNoop},16:{n:"PtgElfRadicalLel",f:parse_PtgElfLel},25:{n:"PtgList",f:function(blob){blob.l+=2;var ixti=blob.read_shift(2),flags=blob.read_shift(2),idx=blob.read_shift(4),c=blob.read_shift(2),C=blob.read_shift(2);return{ixti:ixti,coltype:3&flags,rt:PtgListRT[flags>>2&31],idx:idx,c:c,C:C}}},29:{n:"PtgSxName",f:function(blob){return blob.l+=2,[blob.read_shift(4)]}},255:{}},Ptg19={0:{n:"PtgAttrNoop",f:function(blob){return blob.l+=4,[0,0]}},1:{n:"PtgAttrSemi",f:function(blob,length,opts){var bitSemi=255&blob[blob.l+1]?1:0;return blob.l+=opts&&2==opts.biff?3:4,[bitSemi]}},2:{n:"PtgAttrIf",f:function(blob,length,opts){var bitIf=255&blob[blob.l+1]?1:0;return blob.l+=2,[bitIf,blob.read_shift(opts&&2==opts.biff?1:2)]}},4:{n:"PtgAttrChoose",f:function(blob,length,opts){blob.l+=2;for(var offset=blob.read_shift(opts&&2==opts.biff?1:2),o=[],i=0;i<=offset;++i)o.push(blob.read_shift(opts&&2==opts.biff?1:2));return o}},8:{n:"PtgAttrGoto",f:function(blob,length,opts){var bitGoto=255&blob[blob.l+1]?1:0;return blob.l+=2,[bitGoto,blob.read_shift(opts&&2==opts.biff?1:2)]}},16:{n:"PtgAttrSum",f:function(blob,length,opts){blob.l+=opts&&2==opts.biff?3:4}},32:{n:"PtgAttrBaxcel",f:parse_PtgAttrBaxcel},33:{n:"PtgAttrBaxcel",f:parse_PtgAttrBaxcel},64:{n:"PtgAttrSpace",f:function(blob){return blob.read_shift(2),parse_PtgAttrSpaceType(blob)}},65:{n:"PtgAttrSpaceSemi",f:function(blob){return blob.read_shift(2),parse_PtgAttrSpaceType(blob)}},128:{n:"PtgAttrIfError",f:function(blob){var bitIf=255&blob[blob.l+1]?1:0;return blob.l+=2,[bitIf,blob.read_shift(2)]}},255:{}};function stringify_array(f){for(var o=[],i=0;i<f.length;++i){for(var x=f[i],r=[],j=0;j<x.length;++j){var y=x[j];if(y)if(2===y[0])r.push('"'+y[1].replace(/"/g,'""')+'"');else r.push(y[1]);else r.push("")}o.push(r.join(","))}return o.join(";")}var PtgBinOp={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function get_ixti_raw(supbooks,ixti,opts){if(!supbooks)return"SH33TJSERR0";if(opts.biff>8&&(!supbooks.XTI||!supbooks.XTI[ixti]))return supbooks.SheetNames[ixti];if(!supbooks.XTI)return"SH33TJSERR6";var XTI=supbooks.XTI[ixti];if(opts.biff<8)return ixti>1e4&&(ixti-=65536),ixti<0&&(ixti=-ixti),0==ixti?"":supbooks.XTI[ixti-1];if(!XTI)return"SH33TJSERR1";var o="";if(opts.biff>8)switch(supbooks[XTI[0]][0]){case 357:return o=-1==XTI[1]?"#REF":supbooks.SheetNames[XTI[1]],XTI[1]==XTI[2]?o:o+":"+supbooks.SheetNames[XTI[2]];case 358:return null!=opts.SID?supbooks.SheetNames[opts.SID]:"SH33TJSSAME"+supbooks[XTI[0]][0];default:return"SH33TJSSRC"+supbooks[XTI[0]][0]}switch(supbooks[XTI[0]][0][0]){case 1025:return o=-1==XTI[1]?"#REF":supbooks.SheetNames[XTI[1]]||"SH33TJSERR3",XTI[1]==XTI[2]?o:o+":"+supbooks.SheetNames[XTI[2]];case 14849:return supbooks[XTI[0]].slice(1).map((function(name){return name.Name})).join(";;");default:return supbooks[XTI[0]][0][3]?(o=-1==XTI[1]?"#REF":supbooks[XTI[0]][0][3][XTI[1]]||"SH33TJSERR4",XTI[1]==XTI[2]?o:o+":"+supbooks[XTI[0]][0][3][XTI[2]]):"SH33TJSERR2"}}function get_ixti(supbooks,ixti,opts){var ixtiraw=get_ixti_raw(supbooks,ixti,opts);return"#REF"==ixtiraw?ixtiraw:function(sname,opts){if(!(sname||opts&&opts.biff<=5&&opts.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(sname)?"'"+sname+"'":sname}(ixtiraw,opts)}function stringify_formula(formula,range,cell,supbooks,opts){var e1,e2,c,r,biff=opts&&opts.biff||8,_range={s:{c:0,r:0},e:{c:0,r:0}},stack=[],ixti=0,nameidx=0,sname="";if(!formula[0]||!formula[0][0])return"";for(var last_sp=-1,sp="",ff=0,fflen=formula[0].length;ff<fflen;++ff){var f=formula[0][ff];switch(f[0]){case"PtgUminus":stack.push("-"+stack.pop());break;case"PtgUplus":stack.push("+"+stack.pop());break;case"PtgPercent":stack.push(stack.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(e1=stack.pop(),e2=stack.pop(),last_sp>=0){switch(formula[0][last_sp][1][0]){case 0:sp=fill(" ",formula[0][last_sp][1][1]);break;case 1:sp=fill("\r",formula[0][last_sp][1][1]);break;default:if(sp="",opts.WTF)throw new Error("Unexpected PtgAttrSpaceType "+formula[0][last_sp][1][0])}e2+=sp,last_sp=-1}stack.push(e2+PtgBinOp[f[0]]+e1);break;case"PtgIsect":e1=stack.pop(),e2=stack.pop(),stack.push(e2+" "+e1);break;case"PtgUnion":e1=stack.pop(),e2=stack.pop(),stack.push(e2+","+e1);break;case"PtgRange":e1=stack.pop(),e2=stack.pop(),stack.push(e2+":"+e1);break;case"PtgAttrChoose":case"PtgAttrGoto":case"PtgAttrIf":case"PtgAttrIfError":case"PtgAttrBaxcel":case"PtgAttrSemi":case"PtgMemArea":case"PtgTbl":case"PtgMemErr":case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":case"PtgMemFunc":case"PtgMemNoMem":break;case"PtgRef":c=shift_cell_xls(f[1][1],_range,opts),stack.push(encode_cell_xls(c,biff));break;case"PtgRefN":c=cell?shift_cell_xls(f[1][1],cell,opts):f[1][1],stack.push(encode_cell_xls(c,biff));break;case"PtgRef3d":ixti=f[1][1],c=shift_cell_xls(f[1][2],_range,opts),sname=get_ixti(supbooks,ixti,opts),stack.push(sname+"!"+encode_cell_xls(c,biff));break;case"PtgFunc":case"PtgFuncVar":var argc=f[1][0],func=f[1][1];argc||(argc=0);var args=0==(argc&=127)?[]:stack.slice(-argc);stack.length-=argc,"User"===func&&(func=args.shift()),stack.push(func+"("+args.join(",")+")");break;case"PtgBool":stack.push(f[1]?"TRUE":"FALSE");break;case"PtgInt":case"PtgErr":stack.push(f[1]);break;case"PtgNum":stack.push(String(f[1]));break;case"PtgStr":stack.push('"'+f[1].replace(/"/g,'""')+'"');break;case"PtgAreaN":r=shift_range_xls(f[1][1],cell?{s:cell}:_range,opts),stack.push(encode_range_xls(r,opts));break;case"PtgArea":r=shift_range_xls(f[1][1],_range,opts),stack.push(encode_range_xls(r,opts));break;case"PtgArea3d":ixti=f[1][1],r=f[1][2],sname=get_ixti(supbooks,ixti,opts),stack.push(sname+"!"+encode_range_xls(r,opts));break;case"PtgAttrSum":stack.push("SUM("+stack.pop()+")");break;case"PtgName":nameidx=f[1][2];var lbl=(supbooks.names||[])[nameidx-1]||(supbooks[0]||[])[nameidx],name=lbl?lbl.Name:"SH33TJSNAME"+String(nameidx);name&&"_xlfn."==name.slice(0,6)&&!opts.xlfn&&(name=name.slice(6)),stack.push(name);break;case"PtgNameX":var externbook,bookidx=f[1][1];if(nameidx=f[1][2],!(opts.biff<=5)){var o="";if(14849==((supbooks[bookidx]||[])[0]||[])[0]||(1025==((supbooks[bookidx]||[])[0]||[])[0]?supbooks[bookidx][nameidx]&&supbooks[bookidx][nameidx].itab>0&&(o=supbooks.SheetNames[supbooks[bookidx][nameidx].itab-1]+"!"):o=supbooks.SheetNames[nameidx-1]+"!"),supbooks[bookidx]&&supbooks[bookidx][nameidx])o+=supbooks[bookidx][nameidx].Name;else if(supbooks[0]&&supbooks[0][nameidx])o+=supbooks[0][nameidx].Name;else{var ixtidata=(get_ixti_raw(supbooks,bookidx,opts)||"").split(";;");ixtidata[nameidx-1]?o=ixtidata[nameidx-1]:o+="SH33TJSERRX"}stack.push(o);break}bookidx<0&&(bookidx=-bookidx),supbooks[bookidx]&&(externbook=supbooks[bookidx][nameidx]),externbook||(externbook={Name:"SH33TJSERRY"}),stack.push(externbook.Name);break;case"PtgParen":var lp="(",rp=")";if(last_sp>=0){switch(sp="",formula[0][last_sp][1][0]){case 2:lp=fill(" ",formula[0][last_sp][1][1])+lp;break;case 3:lp=fill("\r",formula[0][last_sp][1][1])+lp;break;case 4:rp=fill(" ",formula[0][last_sp][1][1])+rp;break;case 5:rp=fill("\r",formula[0][last_sp][1][1])+rp;break;default:if(opts.WTF)throw new Error("Unexpected PtgAttrSpaceType "+formula[0][last_sp][1][0])}last_sp=-1}stack.push(lp+stack.pop()+rp);break;case"PtgRefErr":case"PtgRefErr3d":case"PtgAreaErr":case"PtgAreaErr3d":stack.push("#REF!");break;case"PtgExp":c={c:f[1][1],r:f[1][0]};var q={c:cell.c,r:cell.r};if(supbooks.sharedf[encode_cell(c)]){var parsedf=supbooks.sharedf[encode_cell(c)];stack.push(stringify_formula(parsedf,_range,q,supbooks,opts))}else{var fnd=!1;for(e1=0;e1!=supbooks.arrayf.length;++e1)if(e2=supbooks.arrayf[e1],!(c.c<e2[0].s.c||c.c>e2[0].e.c||c.r<e2[0].s.r||c.r>e2[0].e.r)){stack.push(stringify_formula(e2[1],_range,q,supbooks,opts)),fnd=!0;break}fnd||stack.push(f[1])}break;case"PtgArray":stack.push("{"+stringify_array(f[1])+"}");break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":last_sp=ff;break;case"PtgMissArg":stack.push("");break;case"PtgList":stack.push("Table"+f[1].idx+"[#"+f[1].rt+"]");break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");default:throw new Error("Unrecognized Formula Token: "+String(f))}if(3!=opts.biff&&last_sp>=0&&-1==["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"].indexOf(formula[0][ff][0])){var _left=!0;switch((f=formula[0][last_sp])[1][0]){case 4:_left=!1;case 0:sp=fill(" ",f[1][1]);break;case 5:_left=!1;case 1:sp=fill("\r",f[1][1]);break;default:if(sp="",opts.WTF)throw new Error("Unexpected PtgAttrSpaceType "+f[1][0])}stack.push((_left?sp:"")+stack.pop()+(_left?"":sp)),last_sp=-1}}if(stack.length>1&&opts.WTF)throw new Error("bad formula stack");return stack[0]}function write_Formula(cell,R,C,opts,os){var o1=write_XLSCell(R,C,os),o2=function(value){if(null==value){var o=new_buf(8);return o.write_shift(1,3),o.write_shift(1,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,65535),o}return write_Xnum("number"==typeof value?value:0)}(cell.v),o3=new_buf(6);o3.write_shift(2,33),o3.write_shift(4,0);for(var bf=new_buf(cell.bf.length),i=0;i<cell.bf.length;++i)bf[i]=cell.bf[i];return bconcat([o1,o2,o3,bf])}function parse_XLSBParsedFormula(data,length,opts){var cce=data.read_shift(4),rgce=function(blob,length,opts){for(var R,id,target=blob.l+length,ptgs=[];target!=blob.l;)length=target-blob.l,id=blob[blob.l],R=PtgTypes[id]||PtgTypes[PtgDupes[id]],24!==id&&25!==id||(R=(24===id?Ptg18:Ptg19)[blob[blob.l+1]]),R&&R.f?ptgs.push([R.n,R.f(blob,length,opts)]):parsenoop(blob,length);return ptgs}(data,cce,opts),cb=data.read_shift(4),rgcb=cb>0?function(blob,length,rgce,opts){if(opts.biff<8)return parsenoop(blob,length);for(var target=blob.l+length,o=[],i=0;i!==rgce.length;++i)switch(rgce[i][0]){case"PtgArray":rgce[i][1]=parse_PtgExtraArray(blob,0,opts),o.push(rgce[i][1]);break;case"PtgMemArea":rgce[i][2]=parse_PtgExtraMem(blob,rgce[i][1],opts),o.push(rgce[i][2]);break;case"PtgExp":opts&&12==opts.biff&&(rgce[i][1][1]=blob.read_shift(4),o.push(rgce[i][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+rgce[i][0]}return 0!=(length=target-blob.l)&&o.push(parsenoop(blob,length)),o}(data,cb,rgce,opts):null;return[rgce,rgcb]}var parse_XLSBArrayParsedFormula=parse_XLSBParsedFormula,parse_XLSBCellParsedFormula=parse_XLSBParsedFormula,parse_XLSBNameParsedFormula=parse_XLSBParsedFormula,parse_XLSBSharedParsedFormula=parse_XLSBParsedFormula,Cetab={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},Ftab={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},FtabArgc={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};var browser_has_Map="undefined"!=typeof Map;function get_sst_id(sst,str,rev){var i=0,len=sst.length;if(rev){if(browser_has_Map?rev.has(str):Object.prototype.hasOwnProperty.call(rev,str))for(var revarr=browser_has_Map?rev.get(str):rev[str];i<revarr.length;++i)if(sst[revarr[i]].t===str)return sst.Count++,revarr[i]}else for(;i<len;++i)if(sst[i].t===str)return sst.Count++,i;return sst[len]={t:str},sst.Count++,sst.Unique++,rev&&(browser_has_Map?(rev.has(str)||rev.set(str,[]),rev.get(str).push(len)):(Object.prototype.hasOwnProperty.call(rev,str)||(rev[str]=[]),rev[str].push(len))),len}function col_obj_w(C,col){var p={min:C+1,max:C+1},wch=-1;return col.MDW&&(MDW=col.MDW),null!=col.width?p.customWidth=1:null!=col.wpx?wch=px2char(col.wpx):null!=col.wch&&(wch=col.wch),wch>-1?(p.width=char2width(wch),p.customWidth=1):null!=col.width&&(p.width=col.width),col.hidden&&(p.hidden=!0),null!=col.level&&(p.outlineLevel=p.level=col.level),p}function default_margins(margins,mode){if(margins){var defs=[.7,.7,.75,.75,.3,.3];"xlml"==mode&&(defs=[1,1,1,1,.5,.5]),null==margins.left&&(margins.left=defs[0]),null==margins.right&&(margins.right=defs[1]),null==margins.top&&(margins.top=defs[2]),null==margins.bottom&&(margins.bottom=defs[3]),null==margins.header&&(margins.header=defs[4]),null==margins.footer&&(margins.footer=defs[5])}}function get_cell_style(styles,cell,opts){var z=opts.revssf[null!=cell.z?cell.z:"General"],i=60,len=styles.length;if(null==z&&opts.ssf)for(;i<392;++i)if(null==opts.ssf[i]){SSF_load(cell.z,i),opts.ssf[i]=cell.z,opts.revssf[cell.z]=z=i;break}for(i=0;i!=len;++i)if(styles[i].numFmtId===z)return i;return styles[len]={numFmtId:z,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},len}function check_ws(ws,sname,i){if(ws&&ws["!ref"]){var range=safe_decode_range(ws["!ref"]);if(range.e.c<range.s.c||range.e.r<range.s.r)throw new Error("Bad range ("+i+"): "+ws["!ref"])}}var sheetprot_deffalse=["objects","scenarios","selectLockedCells","selectUnlockedCells"],sheetprot_deftrue=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function write_ws_xml_cell(cell,ref,ws,opts){if(cell.c&&ws["!comments"].push([ref,cell.c]),void 0===cell.v&&"string"!=typeof cell.f||"z"===cell.t&&!cell.f)return"";var vv="",oldt=cell.t,oldv=cell.v;if("z"!==cell.t)switch(cell.t){case"b":vv=cell.v?"1":"0";break;case"n":vv=""+cell.v;break;case"e":vv=BErr[cell.v];break;case"d":opts&&opts.cellDates?vv=parseDate(cell.v,-1).toISOString():((cell=dup(cell)).t="n",vv=""+(cell.v=datenum(parseDate(cell.v)))),void 0===cell.z&&(cell.z=table_fmt[14]);break;default:vv=cell.v}var v=writetag("v",escapexml(vv)),o={r:ref},os=get_cell_style(opts.cellXfs,cell,opts);switch(0!==os&&(o.s=os),cell.t){case"n":case"z":break;case"d":o.t="d";break;case"b":o.t="b";break;case"e":o.t="e";break;default:if(null==cell.v){delete cell.t;break}if(cell.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(opts&&opts.bookSST){v=writetag("v",""+get_sst_id(opts.Strings,cell.v,opts.revStrings)),o.t="s";break}o.t="str"}if(cell.t!=oldt&&(cell.t=oldt,cell.v=oldv),"string"==typeof cell.f&&cell.f){var ff=cell.F&&cell.F.slice(0,ref.length)==ref?{t:"array",ref:cell.F}:null;v=writextag("f",escapexml(cell.f),ff)+(null!=cell.v?v:"")}return cell.l&&ws["!links"].push([ref,cell.l]),cell.D&&(o.cm=1),writextag("c",v,o)}function write_ws_xml(idx,opts,wb,rels){var sidx,o=[XML_HEADER,writextag("worksheet",null,{xmlns:XMLNS_main[0],"xmlns:r":XMLNS_r})],s=wb.SheetNames[idx],rdata="",ws=wb.Sheets[s];null==ws&&(ws={});var ref=ws["!ref"]||"A1",range=safe_decode_range(ref);if(range.e.c>16383||range.e.r>1048575){if(opts.WTF)throw new Error("Range "+ref+" exceeds format limit A1:XFD1048576");range.e.c=Math.min(range.e.c,16383),range.e.r=Math.min(range.e.c,1048575),ref=encode_range(range)}rels||(rels={}),ws["!comments"]=[];var _drawing=[];!function(ws,wb,idx,opts,o){var needed=!1,props={},payload=null;if("xlsx"!==opts.bookType&&wb.vbaraw){var cname=wb.SheetNames[idx];try{wb.Workbook&&(cname=wb.Workbook.Sheets[idx].CodeName||cname)}catch(e){}needed=!0,props.codeName=utf8write(escapexml(cname))}if(ws&&ws["!outline"]){var outlineprops={summaryBelow:1,summaryRight:1};ws["!outline"].above&&(outlineprops.summaryBelow=0),ws["!outline"].left&&(outlineprops.summaryRight=0),payload=(payload||"")+writextag("outlinePr",null,outlineprops)}(needed||payload)&&(o[o.length]=writextag("sheetPr",payload,props))}(ws,wb,idx,opts,o),o[o.length]=writextag("dimension",null,{ref:ref}),o[o.length]=function(ws,opts,idx,wb){var sview={workbookViewId:"0"};return(((wb||{}).Workbook||{}).Views||[])[0]&&(sview.rightToLeft=wb.Workbook.Views[0].RTL?"1":"0"),writextag("sheetViews",writextag("sheetView",null,sview),{})}(0,0,0,wb),opts.sheetFormat&&(o[o.length]=writextag("sheetFormatPr",null,{defaultRowHeight:opts.sheetFormat.defaultRowHeight||"16",baseColWidth:opts.sheetFormat.baseColWidth||"10",outlineLevelRow:opts.sheetFormat.outlineLevelRow||"7"})),null!=ws["!cols"]&&ws["!cols"].length>0&&(o[o.length]=function(ws,cols){for(var col,o=["<cols>"],i=0;i!=cols.length;++i)(col=cols[i])&&(o[o.length]=writextag("col",null,col_obj_w(i,col)));return o[o.length]="</cols>",o.join("")}(0,ws["!cols"])),o[sidx=o.length]="<sheetData/>",ws["!links"]=[],null!=ws["!ref"]&&(rdata=function(ws,opts){var ref,row,o=[],r=[],range=safe_decode_range(ws["!ref"]),cell="",rr="",cols=[],R=0,C=0,rows=ws["!rows"],dense=Array.isArray(ws),params={r:rr},height=-1;for(C=range.s.c;C<=range.e.c;++C)cols[C]=encode_col(C);for(R=range.s.r;R<=range.e.r;++R){for(r=[],rr=encode_row(R),C=range.s.c;C<=range.e.c;++C){ref=cols[C]+rr;var _cell=dense?(ws[R]||[])[C]:ws[ref];void 0!==_cell&&null!=(cell=write_ws_xml_cell(_cell,ref,ws,opts))&&r.push(cell)}(r.length>0||rows&&rows[R])&&(params={r:rr},rows&&rows[R]&&((row=rows[R]).hidden&&(params.hidden=1),height=-1,row.hpx?height=px2pt(row.hpx):row.hpt&&(height=row.hpt),height>-1&&(params.ht=height,params.customHeight=1),row.level&&(params.outlineLevel=row.level)),o[o.length]=writextag("row",r.join(""),params))}if(rows)for(;R<rows.length;++R)rows&&rows[R]&&(params={r:R+1},(row=rows[R]).hidden&&(params.hidden=1),height=-1,row.hpx?height=px2pt(row.hpx):row.hpt&&(height=row.hpt),height>-1&&(params.ht=height,params.customHeight=1),row.level&&(params.outlineLevel=row.level),o[o.length]=writextag("row","",params));return o.join("")}(ws,opts),rdata.length>0&&(o[o.length]=rdata)),o.length>sidx+1&&(o[o.length]="</sheetData>",o[sidx]=o[sidx].replace("/>",">")),ws["!protect"]&&(o[o.length]=function(sp){var o={sheet:1};return sheetprot_deffalse.forEach((function(n){null!=sp[n]&&sp[n]&&(o[n]="1")})),sheetprot_deftrue.forEach((function(n){null==sp[n]||sp[n]||(o[n]="0")})),sp.password&&(o.password=crypto_CreatePasswordVerifier_Method1(sp.password).toString(16).toUpperCase()),writextag("sheetProtection",null,o)}(ws["!protect"])),null!=ws["!autofilter"]&&(o[o.length]=function(data,ws,wb,idx){var ref="string"==typeof data.ref?data.ref:encode_range(data.ref);wb.Workbook||(wb.Workbook={Sheets:[]}),wb.Workbook.Names||(wb.Workbook.Names=[]);var names=wb.Workbook.Names,range=decode_range(ref);range.s.r==range.e.r&&(range.e.r=decode_range(ws["!ref"]).e.r,ref=encode_range(range));for(var i=0;i<names.length;++i){var name=names[i];if("_xlnm._FilterDatabase"==name.Name&&name.Sheet==idx){name.Ref="'"+wb.SheetNames[idx]+"'!"+ref;break}}return i==names.length&&names.push({Name:"_xlnm._FilterDatabase",Sheet:idx,Ref:"'"+wb.SheetNames[idx]+"'!"+ref}),writextag("autoFilter",null,{ref:ref})}(ws["!autofilter"],ws,wb,idx)),null!=ws["!merges"]&&ws["!merges"].length>0&&(o[o.length]=function(merges){if(0===merges.length)return"";for(var o='<mergeCells count="'+merges.length+'">',i=0;i!=merges.length;++i)o+='<mergeCell ref="'+encode_range(merges[i])+'"/>';return o+"</mergeCells>"}(ws["!merges"]));var rel,margin,relc=-1,rId=-1;return ws["!links"].length>0&&(o[o.length]="<hyperlinks>",ws["!links"].forEach((function(l){l[1].Target&&(rel={ref:l[0]},"#"!=l[1].Target.charAt(0)&&(rId=add_rels(rels,-1,escapexml(l[1].Target).replace(/#.*$/,""),RELS.HLINK),rel["r:id"]="rId"+rId),(relc=l[1].Target.indexOf("#"))>-1&&(rel.location=escapexml(l[1].Target.slice(relc+1))),l[1].Tooltip&&(rel.tooltip=escapexml(l[1].Tooltip)),o[o.length]=writextag("hyperlink",null,rel))})),o[o.length]="</hyperlinks>"),delete ws["!links"],null!=ws["!margins"]&&(o[o.length]=(default_margins(margin=ws["!margins"]),writextag("pageMargins",null,margin))),opts&&!opts.ignoreEC&&null!=opts.ignoreEC||(o[o.length]=writetag("ignoredErrors",writextag("ignoredError",null,{numberStoredAsText:1,sqref:ref}))),_drawing.length>0&&(rId=add_rels(rels,-1,"../drawings/drawing"+(idx+1)+".xml",RELS.DRAW),o[o.length]=writextag("drawing",null,{"r:id":"rId"+rId}),ws["!drawing"]=_drawing),ws["!comments"].length>0&&(rId=add_rels(rels,-1,"../drawings/vmlDrawing"+(idx+1)+".vml",RELS.VML),o[o.length]=writextag("legacyDrawing",null,{"r:id":"rId"+rId}),ws["!legacy"]=rId),o.length>1&&(o[o.length]="</worksheet>",o[1]=o[1].replace("/>",">")),o.join("")}function write_row_header(ba,ws,range,R){var o=function(R,range,ws){var o=new_buf(145),row=(ws["!rows"]||[])[R]||{};o.write_shift(4,R),o.write_shift(4,0);var miyRw=320;row.hpx?miyRw=20*px2pt(row.hpx):row.hpt&&(miyRw=20*row.hpt),o.write_shift(2,miyRw),o.write_shift(1,0);var flags=0;row.level&&(flags|=row.level),row.hidden&&(flags|=16),(row.hpx||row.hpt)&&(flags|=32),o.write_shift(1,flags),o.write_shift(1,0);var ncolspan=0,lcs=o.l;o.l+=4;for(var caddr={r:R,c:0},i=0;i<16;++i)if(!(range.s.c>i+1<<10||range.e.c<i<<10)){for(var first=-1,last=-1,j=i<<10;j<i+1<<10;++j)caddr.c=j,(Array.isArray(ws)?(ws[caddr.r]||[])[caddr.c]:ws[encode_cell(caddr)])&&(first<0&&(first=j),last=j);first<0||(++ncolspan,o.write_shift(4,first),o.write_shift(4,last))}var l=o.l;return o.l=lcs,o.write_shift(4,ncolspan),o.l=l,o.length>o.l?o.slice(0,o.l):o}(R,range,ws);(o.length>17||(ws["!rows"]||[])[R])&&write_record(ba,0,o)}var parse_BrtWsDim=parse_UncheckedRfX,write_BrtWsDim=write_UncheckedRfX;var parse_BrtMergeCell=parse_UncheckedRfX,write_BrtMergeCell=write_UncheckedRfX;var BrtMarginKeys=["left","right","top","bottom","header","footer"];function write_ws_bin_cell(ba,cell,R,C,opts,ws,last_seen){if(void 0===cell.v)return!1;var vv="";switch(cell.t){case"b":vv=cell.v?"1":"0";break;case"d":(cell=dup(cell)).z=cell.z||table_fmt[14],cell.v=datenum(parseDate(cell.v)),cell.t="n";break;case"n":case"e":vv=""+cell.v;break;default:vv=cell.v}var o={r:R,c:C};switch(o.s=get_cell_style(opts.cellXfs,cell,opts),cell.l&&ws["!links"].push([encode_cell(o),cell.l]),cell.c&&ws["!comments"].push([encode_cell(o),cell.c]),cell.t){case"s":case"str":return opts.bookSST?(vv=get_sst_id(opts.Strings,cell.v,opts.revStrings),o.t="s",o.v=vv,last_seen?write_record(ba,18,function(cell,ncell,o){return null==o&&(o=new_buf(8)),write_XLSBShortCell(ncell,o),o.write_shift(4,ncell.v),o}(0,o)):write_record(ba,7,function(cell,ncell,o){return null==o&&(o=new_buf(12)),write_XLSBCell(ncell,o),o.write_shift(4,ncell.v),o}(0,o))):(o.t="str",last_seen?write_record(ba,17,function(cell,ncell,o){return null==o&&(o=new_buf(8+4*cell.v.length)),write_XLSBShortCell(ncell,o),write_XLWideString(cell.v,o),o.length>o.l?o.slice(0,o.l):o}(cell,o)):write_record(ba,6,function(cell,ncell,o){return null==o&&(o=new_buf(12+4*cell.v.length)),write_XLSBCell(ncell,o),write_XLWideString(cell.v,o),o.length>o.l?o.slice(0,o.l):o}(cell,o))),!0;case"n":return cell.v==(0|cell.v)&&cell.v>-1e3&&cell.v<1e3?last_seen?write_record(ba,13,function(cell,ncell,o){return null==o&&(o=new_buf(8)),write_XLSBShortCell(ncell,o),write_RkNumber(cell.v,o),o}(cell,o)):write_record(ba,2,function(cell,ncell,o){return null==o&&(o=new_buf(12)),write_XLSBCell(ncell,o),write_RkNumber(cell.v,o),o}(cell,o)):last_seen?write_record(ba,16,function(cell,ncell,o){return null==o&&(o=new_buf(12)),write_XLSBShortCell(ncell,o),write_Xnum(cell.v,o),o}(cell,o)):write_record(ba,5,function(cell,ncell,o){return null==o&&(o=new_buf(16)),write_XLSBCell(ncell,o),write_Xnum(cell.v,o),o}(cell,o)),!0;case"b":return o.t="b",last_seen?write_record(ba,15,function(cell,ncell,o){return null==o&&(o=new_buf(5)),write_XLSBShortCell(ncell,o),o.write_shift(1,cell.v?1:0),o}(cell,o)):write_record(ba,4,function(cell,ncell,o){return null==o&&(o=new_buf(9)),write_XLSBCell(ncell,o),o.write_shift(1,cell.v?1:0),o}(cell,o)),!0;case"e":return o.t="e",last_seen?write_record(ba,14,function(cell,ncell,o){return null==o&&(o=new_buf(8)),write_XLSBShortCell(ncell,o),o.write_shift(1,cell.v),o.write_shift(2,0),o.write_shift(1,0),o}(cell,o)):write_record(ba,3,function(cell,ncell,o){return null==o&&(o=new_buf(9)),write_XLSBCell(ncell,o),o.write_shift(1,cell.v),o}(cell,o)),!0}return last_seen?write_record(ba,12,function(cell,ncell,o){return null==o&&(o=new_buf(4)),write_XLSBShortCell(ncell,o)}(0,o)):write_record(ba,1,function(cell,ncell,o){return null==o&&(o=new_buf(8)),write_XLSBCell(ncell,o)}(0,o)),!0}function write_MERGECELLS(ba,ws){var cnt,o;ws&&ws["!merges"]&&(write_record(ba,177,(cnt=ws["!merges"].length,null==o&&(o=new_buf(4)),o.write_shift(4,cnt),o)),ws["!merges"].forEach((function(m){write_record(ba,176,write_BrtMergeCell(m))})),write_record(ba,178))}function write_COLINFOS(ba,ws){ws&&ws["!cols"]&&(write_record(ba,390),ws["!cols"].forEach((function(m,i){m&&write_record(ba,60,function(C,col,o){null==o&&(o=new_buf(18));var p=col_obj_w(C,col);o.write_shift(-4,C),o.write_shift(-4,C),o.write_shift(4,256*(p.width||10)),o.write_shift(4,0);var flags=0;return col.hidden&&(flags|=1),"number"==typeof p.width&&(flags|=2),col.level&&(flags|=col.level<<8),o.write_shift(2,flags),o}(i,m))})),write_record(ba,391))}function write_IGNOREECS(ba,ws){var ref,o;ws&&ws["!ref"]&&(write_record(ba,648),write_record(ba,649,(ref=safe_decode_range(ws["!ref"]),(o=new_buf(24)).write_shift(4,4),o.write_shift(4,1),write_UncheckedRfX(ref,o),o)),write_record(ba,650))}function write_HLINKS(ba,ws,rels){ws["!links"].forEach((function(l){if(l[1].Target){var rId=add_rels(rels,-1,l[1].Target.replace(/#.*$/,""),RELS.HLINK);write_record(ba,494,function(l,rId){var o=new_buf(50+4*(l[1].Target.length+(l[1].Tooltip||"").length));write_UncheckedRfX({s:decode_cell(l[0]),e:decode_cell(l[0])},o),write_RelID("rId"+rId,o);var locidx=l[1].Target.indexOf("#");return write_XLWideString((-1==locidx?"":l[1].Target.slice(locidx+1))||"",o),write_XLWideString(l[1].Tooltip||"",o),write_XLWideString("",o),o.slice(0,o.l)}(l,rId))}})),delete ws["!links"]}function write_WSVIEWS2(ba,ws,Workbook){write_record(ba,133),write_record(ba,137,function(ws,Workbook,o){null==o&&(o=new_buf(30));var f=924;return(((Workbook||{}).Views||[])[0]||{}).RTL&&(f|=32),o.write_shift(2,f),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(1,0),o.write_shift(1,0),o.write_shift(2,0),o.write_shift(2,100),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(4,0),o}(0,Workbook)),write_record(ba,138),write_record(ba,134)}function write_SHEETPROTECT(ba,ws){var sp,o;ws["!protect"]&&write_record(ba,535,(sp=ws["!protect"],null==o&&(o=new_buf(66)),o.write_shift(2,sp.password?crypto_CreatePasswordVerifier_Method1(sp.password):0),o.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach((function(n){n[1]?o.write_shift(4,null==sp[n[0]]||sp[n[0]]?0:1):o.write_shift(4,null!=sp[n[0]]&&sp[n[0]]?0:1)})),o))}function write_ws_bin(idx,opts,wb,rels){var ba=buf_array(),s=wb.SheetNames[idx],ws=wb.Sheets[s]||{},c=s;try{wb&&wb.Workbook&&(c=wb.Workbook.Sheets[idx].CodeName||c)}catch(e){}var margins,o,r=safe_decode_range(ws["!ref"]||"A1");if(r.e.c>16383||r.e.r>1048575){if(opts.WTF)throw new Error("Range "+(ws["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");r.e.c=Math.min(r.e.c,16383),r.e.r=Math.min(r.e.c,1048575)}return ws["!links"]=[],ws["!comments"]=[],write_record(ba,129),(wb.vbaraw||ws["!outline"])&&write_record(ba,147,function(str,outl,o){null==o&&(o=new_buf(84+4*str.length));var f=192;outl&&(outl.above&&(f&=-65),outl.left&&(f&=-129)),o.write_shift(1,f);for(var i=1;i<3;++i)o.write_shift(1,0);return write_BrtColor({auto:1},o),o.write_shift(-4,-1),o.write_shift(-4,-1),write_XLSBCodeName(str,o),o.slice(0,o.l)}(c,ws["!outline"])),write_record(ba,148,write_BrtWsDim(r)),write_WSVIEWS2(ba,0,wb.Workbook),write_COLINFOS(ba,ws),function(ba,ws,idx,opts){var ref,range=safe_decode_range(ws["!ref"]||"A1"),rr="",cols=[];write_record(ba,145);var dense=Array.isArray(ws),cap=range.e.r;ws["!rows"]&&(cap=Math.max(range.e.r,ws["!rows"].length-1));for(var R=range.s.r;R<=cap;++R){rr=encode_row(R),write_row_header(ba,ws,range,R);var last_seen=!1;if(R<=range.e.r)for(var C=range.s.c;C<=range.e.c;++C){R===range.s.r&&(cols[C]=encode_col(C)),ref=cols[C]+rr;var cell=dense?(ws[R]||[])[C]:ws[ref];last_seen=!!cell&&write_ws_bin_cell(ba,cell,R,C,opts,ws,last_seen)}}write_record(ba,146)}(ba,ws,0,opts),write_SHEETPROTECT(ba,ws),function(ba,ws,wb,idx){if(ws["!autofilter"]){var data=ws["!autofilter"],ref="string"==typeof data.ref?data.ref:encode_range(data.ref);wb.Workbook||(wb.Workbook={Sheets:[]}),wb.Workbook.Names||(wb.Workbook.Names=[]);var names=wb.Workbook.Names,range=decode_range(ref);range.s.r==range.e.r&&(range.e.r=decode_range(ws["!ref"]).e.r,ref=encode_range(range));for(var i=0;i<names.length;++i){var name=names[i];if("_xlnm._FilterDatabase"==name.Name&&name.Sheet==idx){name.Ref="'"+wb.SheetNames[idx]+"'!"+ref;break}}i==names.length&&names.push({Name:"_xlnm._FilterDatabase",Sheet:idx,Ref:"'"+wb.SheetNames[idx]+"'!"+ref}),write_record(ba,161,write_UncheckedRfX(safe_decode_range(ref))),write_record(ba,162)}}(ba,ws,wb,idx),write_MERGECELLS(ba,ws),write_HLINKS(ba,ws,rels),ws["!margins"]&&write_record(ba,476,(margins=ws["!margins"],null==o&&(o=new_buf(48)),default_margins(margins),BrtMarginKeys.forEach((function(k){write_Xnum(margins[k],o)})),o)),opts&&!opts.ignoreEC&&null!=opts.ignoreEC||write_IGNOREECS(ba,ws),function(ba,ws,idx,rels){if(ws["!comments"].length>0){var rId=add_rels(rels,-1,"../drawings/vmlDrawing"+(idx+1)+".vml",RELS.VML);write_record(ba,551,write_RelID("rId"+rId)),ws["!legacy"]=rId}}(ba,ws,idx,rels),write_record(ba,130),ba.end()}var WBPropsDef=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]];var badchars="][*?/\\".split("");function check_ws_name(n,safe){if(n.length>31){if(safe)return!1;throw new Error("Sheet names cannot exceed 31 chars")}var _good=!0;return badchars.forEach((function(c){if(-1!=n.indexOf(c)){if(!safe)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");_good=!1}})),_good}function check_wb(wb){if(!wb||!wb.SheetNames||!wb.Sheets)throw new Error("Invalid Workbook");if(!wb.SheetNames.length)throw new Error("Workbook is empty");var N,S,codes,Sheets=wb.Workbook&&wb.Workbook.Sheets||[];N=wb.SheetNames,S=Sheets,codes=!!wb.vbaraw,N.forEach((function(n,i){check_ws_name(n);for(var j=0;j<i;++j)if(n==N[j])throw new Error("Duplicate Sheet Name: "+n);if(codes){var cn=S&&S[i]&&S[i].CodeName||n;if(95==cn.charCodeAt(0)&&cn.length>22)throw new Error("Bad Code Name: Worksheet"+cn)}}));for(var i=0;i<wb.SheetNames.length;++i)check_ws(wb.Sheets[wb.SheetNames[i]],wb.SheetNames[i],i)}function write_wb_xml(wb){var o=[XML_HEADER];o[o.length]=writextag("workbook",null,{xmlns:XMLNS_main[0],"xmlns:r":XMLNS_r});var write_names=wb.Workbook&&(wb.Workbook.Names||[]).length>0,workbookPr={codeName:"ThisWorkbook"};wb.Workbook&&wb.Workbook.WBProps&&(WBPropsDef.forEach((function(x){null!=wb.Workbook.WBProps[x[0]]&&wb.Workbook.WBProps[x[0]]!=x[1]&&(workbookPr[x[0]]=wb.Workbook.WBProps[x[0]])})),wb.Workbook.WBProps.CodeName&&(workbookPr.codeName=wb.Workbook.WBProps.CodeName,delete workbookPr.CodeName)),o[o.length]=writextag("workbookPr",null,workbookPr);var sheets=wb.Workbook&&wb.Workbook.Sheets||[],i=0;if(sheets&&sheets[0]&&sheets[0].Hidden){for(o[o.length]="<bookViews>",i=0;i!=wb.SheetNames.length&&sheets[i]&&sheets[i].Hidden;++i);i==wb.SheetNames.length&&(i=0),o[o.length]='<workbookView firstSheet="'+i+'" activeTab="'+i+'"/>',o[o.length]="</bookViews>"}for(o[o.length]="<sheets>",i=0;i!=wb.SheetNames.length;++i){var sht={name:escapexml(wb.SheetNames[i].slice(0,31))};if(sht.sheetId=""+(i+1),sht["r:id"]="rId"+(i+1),sheets[i])switch(sheets[i].Hidden){case 1:sht.state="hidden";break;case 2:sht.state="veryHidden"}o[o.length]=writextag("sheet",null,sht)}return o[o.length]="</sheets>",write_names&&(o[o.length]="<definedNames>",wb.Workbook&&wb.Workbook.Names&&wb.Workbook.Names.forEach((function(n){var d={name:n.Name};n.Comment&&(d.comment=n.Comment),null!=n.Sheet&&(d.localSheetId=""+n.Sheet),n.Hidden&&(d.hidden="1"),n.Ref&&(o[o.length]=writextag("definedName",escapexml(n.Ref),d))})),o[o.length]="</definedNames>"),o.length>2&&(o[o.length]="</workbook>",o[1]=o[1].replace("/>",">")),o.join("")}function write_BOOKVIEWS(ba,wb){if(wb.Workbook&&wb.Workbook.Sheets){for(var idx,o,sheets=wb.Workbook.Sheets,i=0,vistab=-1,hidden=-1;i<sheets.length;++i)!sheets[i]||!sheets[i].Hidden&&-1==vistab?vistab=i:1==sheets[i].Hidden&&-1==hidden&&(hidden=i);if(!(hidden>vistab))write_record(ba,135),write_record(ba,158,(idx=vistab,o||(o=new_buf(29)),o.write_shift(-4,0),o.write_shift(-4,460),o.write_shift(4,28800),o.write_shift(4,17600),o.write_shift(4,500),o.write_shift(4,idx),o.write_shift(4,idx),o.write_shift(1,120),o.length>o.l?o.slice(0,o.l):o)),write_record(ba,136)}}function write_wb_bin(wb,opts){var ba=buf_array();return write_record(ba,131),write_record(ba,128,function(data,o){o||(o=new_buf(127));for(var i=0;4!=i;++i)o.write_shift(4,0);return write_XLWideString("SheetJS",o),write_XLWideString(XLSX.version,o),write_XLWideString(XLSX.version,o),write_XLWideString("7262",o),o.length>o.l?o.slice(0,o.l):o}()),write_record(ba,153,function(data,o){o||(o=new_buf(72));var flags=0;return data&&data.filterPrivacy&&(flags|=8),o.write_shift(4,flags),o.write_shift(4,0),write_XLSBCodeName(data&&data.CodeName||"ThisWorkbook",o),o.slice(0,o.l)}(wb.Workbook&&wb.Workbook.WBProps||null)),write_BOOKVIEWS(ba,wb),function(ba,wb){write_record(ba,143);for(var idx=0;idx!=wb.SheetNames.length;++idx){write_record(ba,156,(data={Hidden:wb.Workbook&&wb.Workbook.Sheets&&wb.Workbook.Sheets[idx]&&wb.Workbook.Sheets[idx].Hidden||0,iTabID:idx+1,strRelID:"rId"+(idx+1),name:wb.SheetNames[idx]},(o=void 0)||(o=new_buf(127)),o.write_shift(4,data.Hidden),o.write_shift(4,data.iTabID),write_RelID(data.strRelID,o),write_XLWideString(data.name.slice(0,31),o),o.length>o.l?o.slice(0,o.l):o))}var data,o;write_record(ba,144)}(ba,wb),write_record(ba,132),ba.end()}function write_ws(data,name,opts,wb,rels){return(".bin"===name.slice(-4)?write_ws_bin:write_ws_xml)(data,opts,wb,rels)}function write_cmnt(data,name,opts){return(".bin"===name.slice(-4)?write_comments_bin:write_comments_xml)(data)}function write_props_xlml(wb,opts){var o=[];return wb.Props&&o.push(function(Props,opts){var o=[];return keys(XLMLDocPropsMap).map((function(m){for(var i=0;i<CORE_PROPS.length;++i)if(CORE_PROPS[i][1]==m)return CORE_PROPS[i];for(i=0;i<EXT_PROPS.length;++i)if(EXT_PROPS[i][1]==m)return EXT_PROPS[i];throw m})).forEach((function(p){if(null!=Props[p[1]]){var m=opts&&opts.Props&&null!=opts.Props[p[1]]?opts.Props[p[1]]:Props[p[1]];"date"===p[2]&&(m=new Date(m).toISOString().replace(/\.\d*Z/,"Z")),"number"==typeof m?m=String(m):!0===m||!1===m?m=m?"1":"0":m instanceof Date&&(m=new Date(m).toISOString().replace(/\.\d*Z/,"")),o.push(writetag(XLMLDocPropsMap[p[1]]||p[1],m))}})),writextag("DocumentProperties",o.join(""),{xmlns:XLMLNS_o})}(wb.Props,opts)),wb.Custprops&&o.push(function(Props,Custprops){var BLACKLIST=["Worksheets","SheetNames"],T="CustomDocumentProperties",o=[];return Props&&keys(Props).forEach((function(k){if(Object.prototype.hasOwnProperty.call(Props,k)){for(var i=0;i<CORE_PROPS.length;++i)if(k==CORE_PROPS[i][1])return;for(i=0;i<EXT_PROPS.length;++i)if(k==EXT_PROPS[i][1])return;for(i=0;i<BLACKLIST.length;++i)if(k==BLACKLIST[i])return;var m=Props[k],t="string";"number"==typeof m?(t="float",m=String(m)):!0===m||!1===m?(t="boolean",m=m?"1":"0"):m=String(m),o.push(writextag(escapexmltag(k),m,{"dt:dt":t}))}})),Custprops&&keys(Custprops).forEach((function(k){if(Object.prototype.hasOwnProperty.call(Custprops,k)&&(!Props||!Object.prototype.hasOwnProperty.call(Props,k))){var m=Custprops[k],t="string";"number"==typeof m?(t="float",m=String(m)):!0===m||!1===m?(t="boolean",m=m?"1":"0"):m instanceof Date?(t="dateTime.tz",m=m.toISOString()):m=String(m),o.push(writextag(escapexmltag(k),m,{"dt:dt":t}))}})),"<"+T+' xmlns="'+XLMLNS_o+'">'+o.join("")+"</"+T+">"}(wb.Props,wb.Custprops)),o.join("")}function write_name_xlml(n){return writextag("NamedRange",null,{"ss:Name":n.Name,"ss:RefersTo":"="+a1_to_rc(n.Ref,{r:0,c:0})})}function write_ws_xlml_cell(cell,ref,ws,opts,idx,wb,addr){if(!cell||null==cell.v&&null==cell.f)return"";var attr={};if(cell.f&&(attr["ss:Formula"]="="+escapexml(a1_to_rc(cell.f,addr))),cell.F&&cell.F.slice(0,ref.length)==ref){var end=decode_cell(cell.F.slice(ref.length+1));attr["ss:ArrayRange"]="RC:R"+(end.r==addr.r?"":"["+(end.r-addr.r)+"]")+"C"+(end.c==addr.c?"":"["+(end.c-addr.c)+"]")}if(cell.l&&cell.l.Target&&(attr["ss:HRef"]=escapexml(cell.l.Target),cell.l.Tooltip&&(attr["x:HRefScreenTip"]=escapexml(cell.l.Tooltip))),ws["!merges"])for(var marr=ws["!merges"],mi=0;mi!=marr.length;++mi)marr[mi].s.c==addr.c&&marr[mi].s.r==addr.r&&(marr[mi].e.c>marr[mi].s.c&&(attr["ss:MergeAcross"]=marr[mi].e.c-marr[mi].s.c),marr[mi].e.r>marr[mi].s.r&&(attr["ss:MergeDown"]=marr[mi].e.r-marr[mi].s.r));var t="",p="";switch(cell.t){case"z":if(!opts.sheetStubs)return"";break;case"n":t="Number",p=String(cell.v);break;case"b":t="Boolean",p=cell.v?"1":"0";break;case"e":t="Error",p=BErr[cell.v];break;case"d":t="DateTime",p=new Date(cell.v).toISOString(),null==cell.z&&(cell.z=cell.z||table_fmt[14]);break;case"s":t="String",p=((cell.v||"")+"").replace(decregex,(function(y){return rencoding[y]})).replace(htmlcharegex,(function(s){return"&#x"+s.charCodeAt(0).toString(16).toUpperCase()+";"}))}var os=get_cell_style(opts.cellXfs,cell,opts);attr["ss:StyleID"]="s"+(21+os),attr["ss:Index"]=addr.c+1;var _v=null!=cell.v?p:"",m="z"==cell.t?"":'<Data ss:Type="'+t+'">'+_v+"</Data>";return(cell.c||[]).length>0&&(m+=cell.c.map((function(c){var d=writextag("ss:Data",(c.t||"").replace(/(\r\n|[\r\n])/g,"&#10;"),{xmlns:"http://www.w3.org/TR/REC-html40"});return writextag("Comment",d,{"ss:Author":c.a})})).join("")),writextag("Cell",m,attr)}function write_ws_xlml_row(R,row){var o='<Row ss:Index="'+(R+1)+'"';return row&&(row.hpt&&!row.hpx&&(row.hpx=pt2px(row.hpt)),row.hpx&&(o+=' ss:AutoFitHeight="0" ss:Height="'+row.hpx+'"'),row.hidden&&(o+=' ss:Hidden="1"')),o+">"}function write_ws_xlml(idx,opts,wb){var o=[],s=wb.SheetNames[idx],ws=wb.Sheets[s],t=ws?function(ws,opts,idx,wb){if(!ws)return"";if(!((wb||{}).Workbook||{}).Names)return"";for(var names=wb.Workbook.Names,out=[],i=0;i<names.length;++i){var n=names[i];n.Sheet==idx&&(n.Name.match(/^_xlfn\./)||out.push(write_name_xlml(n)))}return out.join("")}(ws,0,idx,wb):"";return t.length>0&&o.push("<Names>"+t+"</Names>"),t=ws?function(ws,opts){if(!ws["!ref"])return"";var range=safe_decode_range(ws["!ref"]),marr=ws["!merges"]||[],mi=0,o=[];ws["!cols"]&&ws["!cols"].forEach((function(n,i){process_col(n);var w=!!n.width,p=col_obj_w(i,n),k={"ss:Index":i+1};w&&(k["ss:Width"]=width2px(p.width)),n.hidden&&(k["ss:Hidden"]="1"),o.push(writextag("Column",null,k))}));for(var dense=Array.isArray(ws),R=range.s.r;R<=range.e.r;++R){for(var row=[write_ws_xlml_row(R,(ws["!rows"]||[])[R])],C=range.s.c;C<=range.e.c;++C){var skip=!1;for(mi=0;mi!=marr.length;++mi)if(!(marr[mi].s.c>C||marr[mi].s.r>R||marr[mi].e.c<C||marr[mi].e.r<R)){marr[mi].s.c==C&&marr[mi].s.r==R||(skip=!0);break}if(!skip){var addr={r:R,c:C},ref=encode_cell(addr),cell=dense?(ws[R]||[])[C]:ws[ref];row.push(write_ws_xlml_cell(cell,ref,ws,opts,0,0,addr))}}row.push("</Row>"),row.length>2&&o.push(row.join(""))}return o.join("")}(ws,opts):"",t.length>0&&o.push("<Table>"+t+"</Table>"),o.push(function(ws,opts,idx,wb){if(!ws)return"";var o=[];if(ws["!margins"]&&(o.push("<PageSetup>"),ws["!margins"].header&&o.push(writextag("Header",null,{"x:Margin":ws["!margins"].header})),ws["!margins"].footer&&o.push(writextag("Footer",null,{"x:Margin":ws["!margins"].footer})),o.push(writextag("PageMargins",null,{"x:Bottom":ws["!margins"].bottom||"0.75","x:Left":ws["!margins"].left||"0.7","x:Right":ws["!margins"].right||"0.7","x:Top":ws["!margins"].top||"0.75"})),o.push("</PageSetup>")),wb&&wb.Workbook&&wb.Workbook.Sheets&&wb.Workbook.Sheets[idx])if(wb.Workbook.Sheets[idx].Hidden)o.push(writextag("Visible",1==wb.Workbook.Sheets[idx].Hidden?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i<idx&&(!wb.Workbook.Sheets[i]||wb.Workbook.Sheets[i].Hidden);++i);i==idx&&o.push("<Selected/>")}return((((wb||{}).Workbook||{}).Views||[])[0]||{}).RTL&&o.push("<DisplayRightToLeft/>"),ws["!protect"]&&(o.push(writetag("ProtectContents","True")),ws["!protect"].objects&&o.push(writetag("ProtectObjects","True")),ws["!protect"].scenarios&&o.push(writetag("ProtectScenarios","True")),null==ws["!protect"].selectLockedCells||ws["!protect"].selectLockedCells?null==ws["!protect"].selectUnlockedCells||ws["!protect"].selectUnlockedCells||o.push(writetag("EnableSelection","UnlockedCells")):o.push(writetag("EnableSelection","NoSelection")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach((function(x){ws["!protect"][x[0]]&&o.push("<"+x[1]+"/>")}))),0==o.length?"":writextag("WorksheetOptions",o.join(""),{xmlns:XLMLNS_x})}(ws,0,idx,wb)),o.join("")}function write_xlml(wb,opts){opts||(opts={}),wb.SSF||(wb.SSF=dup(table_fmt)),wb.SSF&&(make_ssf(),SSF_load_table(wb.SSF),opts.revssf=evert_num(wb.SSF),opts.revssf[wb.SSF[65535]]=0,opts.ssf=wb.SSF,opts.cellXfs=[],get_cell_style(opts.cellXfs,{},{revssf:{General:0}}));var d=[];d.push(write_props_xlml(wb,opts)),d.push(""),d.push(""),d.push("");for(var i=0;i<wb.SheetNames.length;++i)d.push(writextag("Worksheet",write_ws_xlml(i,opts,wb),{"ss:Name":escapexml(wb.SheetNames[i])}));return d[2]=function(wb,opts){var styles=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return opts.cellXfs.forEach((function(xf,id){var payload=[];payload.push(writextag("NumberFormat",null,{"ss:Format":escapexml(table_fmt[xf.numFmtId])}));var o={"ss:ID":"s"+(21+id)};styles.push(writextag("Style",payload.join(""),o))})),writextag("Styles",styles.join(""))}(0,opts),d[3]=function(wb){if(!((wb||{}).Workbook||{}).Names)return"";for(var names=wb.Workbook.Names,out=[],i=0;i<names.length;++i){var n=names[i];null==n.Sheet&&(n.Name.match(/^_xlfn\./)||out.push(write_name_xlml(n)))}return writextag("Names",out.join(""))}(wb),XML_HEADER+writextag("Workbook",d.join(""),{xmlns:XLMLNS_ss,"xmlns:o":XLMLNS_o,"xmlns:x":XLMLNS_x,"xmlns:ss":XLMLNS_ss,"xmlns:dt":XLMLNS_dt,"xmlns:html":XLMLNS_html})}var PSCLSID_SI="e0859ff2f94f6810ab9108002b27b3d9",PSCLSID_DSI="02d5cdd59c2e1b10939708002b2cf9ae",PSCLSID_UDI="05d5cdd59c2e1b10939708002b2cf9ae";function write_xlscfb(wb,opts){var o=opts||{},cfb=CFB.utils.cfb_new({root:"R"}),wbpath="/Workbook";switch(o.bookType||"xls"){case"xls":o.bookType="biff8";case"xla":o.bookType||(o.bookType="xla");case"biff8":wbpath="/Workbook",o.biff=8;break;case"biff5":wbpath="/Book",o.biff=5;break;default:throw new Error("invalid type "+o.bookType+" for XLS CFB")}return CFB.utils.cfb_add(cfb,wbpath,write_biff_buf(wb,o)),8==o.biff&&(wb.Props||wb.Custprops)&&function(wb,cfb){var Keys,DSEntries=[],SEntries=[],CEntries=[],i=0,DocSummaryRE=evert_key(DocSummaryPIDDSI,"n"),SummaryRE=evert_key(SummaryPIDSI,"n");if(wb.Props)for(Keys=keys(wb.Props),i=0;i<Keys.length;++i)(Object.prototype.hasOwnProperty.call(DocSummaryRE,Keys[i])?DSEntries:Object.prototype.hasOwnProperty.call(SummaryRE,Keys[i])?SEntries:CEntries).push([Keys[i],wb.Props[Keys[i]]]);if(wb.Custprops)for(Keys=keys(wb.Custprops),i=0;i<Keys.length;++i)Object.prototype.hasOwnProperty.call(wb.Props||{},Keys[i])||(Object.prototype.hasOwnProperty.call(DocSummaryRE,Keys[i])?DSEntries:Object.prototype.hasOwnProperty.call(SummaryRE,Keys[i])?SEntries:CEntries).push([Keys[i],wb.Custprops[Keys[i]]]);var CEntries2=[];for(i=0;i<CEntries.length;++i)XLSPSSkip.indexOf(CEntries[i][0])>-1||PseudoPropsPairs.indexOf(CEntries[i][0])>-1||null!=CEntries[i][1]&&CEntries2.push(CEntries[i]);SEntries.length&&CFB.utils.cfb_add(cfb,"/SummaryInformation",write_PropertySetStream(SEntries,PSCLSID_SI,SummaryRE,SummaryPIDSI)),(DSEntries.length||CEntries2.length)&&CFB.utils.cfb_add(cfb,"/DocumentSummaryInformation",write_PropertySetStream(DSEntries,PSCLSID_DSI,DocSummaryRE,DocSummaryPIDDSI,CEntries2.length?CEntries2:null,PSCLSID_UDI))}(wb,cfb),8==o.biff&&wb.vbaraw&&function(cfb,vba){vba.FullPaths.forEach((function(p,i){if(0!=i){var newpath=p.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");"/"!==newpath.slice(-1)&&CFB.utils.cfb_add(cfb,newpath,vba.FileIndex[i].content)}}))}(cfb,CFB.read(wb.vbaraw,{type:"string"==typeof wb.vbaraw?"binary":"buffer"})),cfb}var XLSBRecordEnum={0:{f:function(data,length){var z={},tgt=data.l+length;z.r=data.read_shift(4),data.l+=4;var miyRw=data.read_shift(2);data.l+=1;var flags=data.read_shift(1);return data.l=tgt,7&flags&&(z.level=7&flags),16&flags&&(z.hidden=!0),32&flags&&(z.hpt=miyRw/20),z}},1:{f:function(data){return[parse_XLSBCell(data)]}},2:{f:function(data){return[parse_XLSBCell(data),parse_RkNumber(data),"n"]}},3:{f:function(data){return[parse_XLSBCell(data),data.read_shift(1),"e"]}},4:{f:function(data){return[parse_XLSBCell(data),data.read_shift(1),"b"]}},5:{f:function(data){return[parse_XLSBCell(data),parse_Xnum(data),"n"]}},6:{f:function(data){return[parse_XLSBCell(data),parse_XLWideString(data),"str"]}},7:{f:function(data){return[parse_XLSBCell(data),data.read_shift(4),"s"]}},8:{f:function(data,length,opts){var end=data.l+length,cell=parse_XLSBCell(data);cell.r=opts["!row"];var o=[cell,parse_XLWideString(data),"str"];if(opts.cellFormula){data.l+=2;var formula=parse_XLSBCellParsedFormula(data,end-data.l,opts);o[3]=stringify_formula(formula,0,cell,opts.supbooks,opts)}else data.l=end;return o}},9:{f:function(data,length,opts){var end=data.l+length,cell=parse_XLSBCell(data);cell.r=opts["!row"];var o=[cell,parse_Xnum(data),"n"];if(opts.cellFormula){data.l+=2;var formula=parse_XLSBCellParsedFormula(data,end-data.l,opts);o[3]=stringify_formula(formula,0,cell,opts.supbooks,opts)}else data.l=end;return o}},10:{f:function(data,length,opts){var end=data.l+length,cell=parse_XLSBCell(data);cell.r=opts["!row"];var o=[cell,data.read_shift(1),"b"];if(opts.cellFormula){data.l+=2;var formula=parse_XLSBCellParsedFormula(data,end-data.l,opts);o[3]=stringify_formula(formula,0,cell,opts.supbooks,opts)}else data.l=end;return o}},11:{f:function(data,length,opts){var end=data.l+length,cell=parse_XLSBCell(data);cell.r=opts["!row"];var o=[cell,data.read_shift(1),"e"];if(opts.cellFormula){data.l+=2;var formula=parse_XLSBCellParsedFormula(data,end-data.l,opts);o[3]=stringify_formula(formula,0,cell,opts.supbooks,opts)}else data.l=end;return o}},12:{f:function(data){return[parse_XLSBShortCell(data)]}},13:{f:function(data){return[parse_XLSBShortCell(data),parse_RkNumber(data),"n"]}},14:{f:function(data){return[parse_XLSBShortCell(data),data.read_shift(1),"e"]}},15:{f:function(data){return[parse_XLSBShortCell(data),data.read_shift(1),"b"]}},16:{f:function(data){return[parse_XLSBShortCell(data),parse_Xnum(data),"n"]}},17:{f:function(data){return[parse_XLSBShortCell(data),parse_XLWideString(data),"str"]}},18:{f:function(data){return[parse_XLSBShortCell(data),data.read_shift(4),"s"]}},19:{f:parse_RichStr},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:function(data,length,opts){var end=data.l+length;data.l+=4,data.l+=1;var itab=data.read_shift(4),name=parse_XLNameWideString(data),formula=parse_XLSBNameParsedFormula(data,0,opts),comment=parse_XLNullableWideString(data);data.l=end;var out={Name:name,Ptg:formula};return itab<268435455&&(out.Sheet=itab),comment&&(out.Comment=comment),out}},40:{},42:{},43:{f:function(data,length,opts){var out={};out.sz=data.read_shift(2)/20;var grbit=function(data){var d=data.read_shift(1);return data.l++,{fBold:1&d,fItalic:2&d,fUnderline:4&d,fStrikeout:8&d,fOutline:16&d,fShadow:32&d,fCondense:64&d,fExtend:128&d}}(data);switch(grbit.fItalic&&(out.italic=1),grbit.fCondense&&(out.condense=1),grbit.fExtend&&(out.extend=1),grbit.fShadow&&(out.shadow=1),grbit.fOutline&&(out.outline=1),grbit.fStrikeout&&(out.strike=1),700===data.read_shift(2)&&(out.bold=1),data.read_shift(2)){case 1:out.vertAlign="superscript";break;case 2:out.vertAlign="subscript"}var underline=data.read_shift(1);0!=underline&&(out.underline=underline);var family=data.read_shift(1);family>0&&(out.family=family);var bCharSet=data.read_shift(1);switch(bCharSet>0&&(out.charset=bCharSet),data.l++,out.color=function(data){var out={},xColorType=data.read_shift(1)>>>1,index=data.read_shift(1),nTS=data.read_shift(2,"i"),bR=data.read_shift(1),bG=data.read_shift(1),bB=data.read_shift(1);switch(data.l++,xColorType){case 0:out.auto=1;break;case 1:out.index=index;var icv=XLSIcv[index];icv&&(out.rgb=rgb2Hex(icv));break;case 2:out.rgb=rgb2Hex([bR,bG,bB]);break;case 3:out.theme=index}return 0!=nTS&&(out.tint=nTS>0?nTS/32767:nTS/32768),out}(data),data.read_shift(1)){case 1:out.scheme="major";break;case 2:out.scheme="minor"}return out.name=parse_XLWideString(data),out}},44:{f:function(data,length){return[data.read_shift(2),parse_XLWideString(data)]}},45:{f:parse_BrtFill},46:{f:parse_BrtBorder},47:{f:function(data,length){var tgt=data.l+length,ixfeParent=data.read_shift(2),ifmt=data.read_shift(2);return data.l=tgt,{ixfe:ixfeParent,numFmtId:ifmt}}},48:{},49:{f:function(data){return data.read_shift(4,"i")}},50:{},51:{f:function(data){for(var out=[],cnt=data.read_shift(4);cnt-- >0;)out.push([data.read_shift(4),data.read_shift(4)]);return out}},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:function(blob,length,opts){if(!opts.cellStyles)return parsenoop(blob,length);var w=opts&&opts.biff>=12?4:2,colFirst=blob.read_shift(w),colLast=blob.read_shift(w),coldx=blob.read_shift(w),ixfe=blob.read_shift(w),flags=blob.read_shift(2);2==w&&(blob.l+=2);var o={s:colFirst,e:colLast,w:coldx,ixfe:ixfe,flags:flags};return(opts.biff>=5||!opts.biff)&&(o.level=flags>>8&7),o}},62:{f:function(data){return[parse_XLSBCell(data),parse_RichStr(data),"is"]}},63:{f:function(data){var out={};out.i=data.read_shift(4);var cell={};cell.r=data.read_shift(4),cell.c=data.read_shift(4),out.r=encode_cell(cell);var flags=data.read_shift(1);return 2&flags&&(out.l="1"),8&flags&&(out.a="1"),out}},64:{f:function(){}},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:parsenoop,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:function(data){var f=data.read_shift(2);return data.l+=28,{RTL:32&f}}},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:function(data,length){var z={},f=data[data.l];return++data.l,z.above=!(64&f),z.left=!(128&f),data.l+=18,z.name=parse_XLSBCodeName(data),z}},148:{f:parse_BrtWsDim,p:16},151:{f:function(){}},152:{},153:{f:function(data,length){var o={},flags=data.read_shift(4);o.defaultThemeVersion=data.read_shift(4);var strName=length>8?parse_XLWideString(data):"";return strName.length>0&&(o.CodeName=strName),o.autoCompressPictures=!!(65536&flags),o.backupFile=!!(64&flags),o.checkCompatibility=!!(4096&flags),o.date1904=!!(1&flags),o.filterPrivacy=!!(8&flags),o.hidePivotFieldList=!!(1024&flags),o.promptedSolutions=!!(16&flags),o.publishItems=!!(2048&flags),o.refreshAllConnections=!!(262144&flags),o.saveExternalLinkValues=!!(128&flags),o.showBorderUnselectedTables=!!(4&flags),o.showInkAnnotation=!!(32&flags),o.showObjects=["all","placeholders","none"][flags>>13&3],o.showPivotChartFilter=!!(32768&flags),o.updateLinks=["userSet","never","always"][flags>>8&3],o}},154:{},155:{},156:{f:function(data,length){var z={};return z.Hidden=data.read_shift(4),z.iTabID=data.read_shift(4),z.strRelID=parse_RelID(data),z.name=parse_XLWideString(data),z}},157:{},158:{},159:{T:1,f:function(data){return[data.read_shift(4),data.read_shift(4)]}},160:{T:-1},161:{T:1,f:parse_UncheckedRfX},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:parse_BrtMergeCell},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:function(data,length){return{flags:data.read_shift(4),version:data.read_shift(4),name:parse_XLWideString(data)}}},336:{T:-1},337:{f:function(data){return data.l+=4,0!=data.read_shift(4)},T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:parse_RelID},357:{},358:{},359:{},360:{T:1},361:{},362:{f:function(blob,length,opts){if(opts.biff<8)return function(blob,length,opts){3==blob[blob.l+1]&&blob[blob.l]++;var o=parse_ShortXLUnicodeString(blob,0,opts);return 3==o.charCodeAt(0)?o.slice(1):o}(blob,0,opts);for(var o=[],target=blob.l+length,len=blob.read_shift(opts.biff>8?4:2);0!=len--;)o.push(parse_XTI(blob,opts.biff,opts));if(blob.l!=target)throw new Error("Bad ExternSheet: "+blob.l+" != "+target);return o}},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:function(data,length,opts){var end=data.l+length,rfx=parse_RfX(data),fAlwaysCalc=data.read_shift(1),o=[rfx];if(o[2]=fAlwaysCalc,opts.cellFormula){var formula=parse_XLSBArrayParsedFormula(data,end-data.l,opts);o[1]=formula}else data.l=end;return o}},427:{f:function(data,length,opts){var end=data.l+length,o=[parse_UncheckedRfX(data)];if(opts.cellFormula){var formula=parse_XLSBSharedParsedFormula(data,end-data.l,opts);o[1]=formula,data.l=end}else data.l=end;return o}},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:function(data){var margins={};return BrtMarginKeys.forEach((function(k){margins[k]=parse_Xnum(data)})),margins}},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:function(){}},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:function(data,length){var end=data.l+length,rfx=parse_UncheckedRfX(data),relId=parse_XLNullableWideString(data),loc=parse_XLWideString(data),tooltip=parse_XLWideString(data),display=parse_XLWideString(data);data.l=end;var o={rfx:rfx,relId:relId,loc:loc,display:display};return tooltip&&(o.Tooltip=tooltip),o}},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:parse_RelID},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:parse_BrtCommentAuthor},633:{T:1},634:{T:-1},635:{T:1,f:function(data){var out={};out.iauthor=data.read_shift(4);var rfx=parse_UncheckedRfX(data);return out.rfx=rfx.s,out.ref=encode_cell(rfx.s),data.l+=16,out}},636:{T:-1},637:{f:parse_BrtCommentText},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:function(data,length){return data.l+=10,{name:parse_XLWideString(data)}}},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:function(){}},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function write_biff_rec(ba,type,payload,length){var t=type;if(!isNaN(t)){var len=length||(payload||[]).length||0,o=ba.next(4);o.write_shift(2,t),o.write_shift(2,len),len>0&&is_buf(payload)&&ba.push(payload)}}function write_BIFF2Cell(out,r,c){return out||(out=new_buf(7)),out.write_shift(2,r),out.write_shift(2,c),out.write_shift(2,0),out.write_shift(1,0),out}function write_ws_biff2_cell(ba,cell,R,C){if(null!=cell.v)switch(cell.t){case"d":case"n":var v="d"==cell.t?datenum(parseDate(cell.v)):cell.v;return void(v==(0|v)&&v>=0&&v<65536?write_biff_rec(ba,2,function(r,c,val){var out=new_buf(9);return write_BIFF2Cell(out,r,c),out.write_shift(2,val),out}(R,C,v)):write_biff_rec(ba,3,function(r,c,val){var out=new_buf(15);return write_BIFF2Cell(out,r,c),out.write_shift(8,val,"f"),out}(R,C,v)));case"b":case"e":return void write_biff_rec(ba,5,function(r,c,val,t){var out=new_buf(9);return write_BIFF2Cell(out,r,c),write_Bes(val,t||"b",out),out}(R,C,cell.v,cell.t));case"s":case"str":return void write_biff_rec(ba,4,function(r,c,val){var out=new_buf(8+2*val.length);return write_BIFF2Cell(out,r,c),out.write_shift(1,val.length),out.write_shift(val.length,val,"sbcs"),out.l<out.length?out.slice(0,out.l):out}(R,C,(cell.v||"").slice(0,255)))}write_biff_rec(ba,1,write_BIFF2Cell(null,R,C))}function write_biff2_buf(wb,opts){for(var o=opts||{},ba=buf_array(),idx=0,i=0;i<wb.SheetNames.length;++i)wb.SheetNames[i]==o.sheet&&(idx=i);if(0==idx&&o.sheet&&wb.SheetNames[0]!=o.sheet)throw new Error("Sheet not found: "+o.sheet);return write_biff_rec(ba,4==o.biff?1033:3==o.biff?521:9,write_BOF(0,16,o)),function(ba,ws,idx,opts){var ref,dense=Array.isArray(ws),range=safe_decode_range(ws["!ref"]||"A1"),rr="",cols=[];if(range.e.c>255||range.e.r>16383){if(opts.WTF)throw new Error("Range "+(ws["!ref"]||"A1")+" exceeds format limit A1:IV16384");range.e.c=Math.min(range.e.c,255),range.e.r=Math.min(range.e.c,16383),ref=encode_range(range)}for(var R=range.s.r;R<=range.e.r;++R){rr=encode_row(R);for(var C=range.s.c;C<=range.e.c;++C){R===range.s.r&&(cols[C]=encode_col(C)),ref=cols[C]+rr;var cell=dense?(ws[R]||[])[C]:ws[ref];cell&&write_ws_biff2_cell(ba,cell,R,C)}}}(ba,wb.Sheets[wb.SheetNames[idx]],0,o),write_biff_rec(ba,10),ba.end()}function write_FONTS_biff8(ba,data,opts){write_biff_rec(ba,49,function(data,opts){var name=data.name||"Arial",b5=opts&&5==opts.biff,o=new_buf(b5?15+name.length:16+2*name.length);return o.write_shift(2,20*(data.sz||12)),o.write_shift(4,0),o.write_shift(2,400),o.write_shift(4,0),o.write_shift(2,0),o.write_shift(1,name.length),b5||o.write_shift(1,1),o.write_shift((b5?1:2)*name.length,name,b5?"sbcs":"utf16le"),o}({sz:12,color:{theme:1},name:"Arial",family:2,scheme:"minor"},opts))}function write_ws_cols_biff8(ba,cols){if(cols){var cnt=0;cols.forEach((function(col,idx){++cnt<=256&&col&&write_biff_rec(ba,125,function(col,idx){var o=new_buf(12);o.write_shift(2,idx),o.write_shift(2,idx),o.write_shift(2,256*col.width),o.write_shift(2,0);var f=0;return col.hidden&&(f|=1),o.write_shift(1,f),f=col.level||0,o.write_shift(1,f),o.write_shift(2,0),o}(col_obj_w(idx,col),idx))}))}}function write_ws_biff8_cell(ba,cell,R,C,opts){var os=16+get_cell_style(opts.cellXfs,cell,opts);if(null!=cell.v||cell.bf)if(cell.bf)write_biff_rec(ba,6,write_Formula(cell,R,C,0,os));else switch(cell.t){case"d":case"n":write_biff_rec(ba,515,function(R,C,v,os){var o=new_buf(14);return write_XLSCell(R,C,os,o),write_Xnum(v,o),o}(R,C,"d"==cell.t?datenum(parseDate(cell.v)):cell.v,os));break;case"b":case"e":write_biff_rec(ba,517,function(R,C,v,os,opts,t){var o=new_buf(8);return write_XLSCell(R,C,os,o),write_Bes(v,t,o),o}(R,C,cell.v,os,0,cell.t));break;case"s":case"str":if(opts.bookSST)write_biff_rec(ba,253,function(R,C,v,os){var o=new_buf(10);return write_XLSCell(R,C,os,o),o.write_shift(4,v),o}(R,C,get_sst_id(opts.Strings,cell.v,opts.revStrings),os));else write_biff_rec(ba,516,function(R,C,v,os,opts){var b8=!opts||8==opts.biff,o=new_buf(+b8+8+(1+b8)*v.length);return write_XLSCell(R,C,os,o),o.write_shift(2,v.length),b8&&o.write_shift(1,1),o.write_shift((1+b8)*v.length,v,b8?"utf16le":"sbcs"),o}(R,C,(cell.v||"").slice(0,255),os,opts));break;default:write_biff_rec(ba,513,write_XLSCell(R,C,os))}else write_biff_rec(ba,513,write_XLSCell(R,C,os))}function write_ws_biff8(idx,opts,wb){var ref,guts,o,ba=buf_array(),s=wb.SheetNames[idx],ws=wb.Sheets[s]||{},_WB=(wb||{}).Workbook||{},_sheet=(_WB.Sheets||[])[idx]||{},dense=Array.isArray(ws),b8=8==opts.biff,rr="",cols=[],range=safe_decode_range(ws["!ref"]||"A1"),MAX_ROWS=b8?65536:16384;if(range.e.c>255||range.e.r>=MAX_ROWS){if(opts.WTF)throw new Error("Range "+(ws["!ref"]||"A1")+" exceeds format limit A1:IV16384");range.e.c=Math.min(range.e.c,255),range.e.r=Math.min(range.e.c,MAX_ROWS-1)}write_biff_rec(ba,2057,write_BOF(0,16,opts)),write_biff_rec(ba,13,writeuint16(1)),write_biff_rec(ba,12,writeuint16(100)),write_biff_rec(ba,15,writebool(!0)),write_biff_rec(ba,17,writebool(!1)),write_biff_rec(ba,16,write_Xnum(.001)),write_biff_rec(ba,95,writebool(!0)),write_biff_rec(ba,42,writebool(!1)),write_biff_rec(ba,43,writebool(!1)),write_biff_rec(ba,130,writeuint16(1)),write_biff_rec(ba,128,(guts=[0,0],(o=new_buf(8)).write_shift(4,0),o.write_shift(2,guts[0]?guts[0]+1:0),o.write_shift(2,guts[1]?guts[1]+1:0),o)),write_biff_rec(ba,131,writebool(!1)),write_biff_rec(ba,132,writebool(!1)),b8&&write_ws_cols_biff8(ba,ws["!cols"]),write_biff_rec(ba,512,function(range,opts){var w=8!=opts.biff&&opts.biff?2:4,o=new_buf(2*w+6);return o.write_shift(w,range.s.r),o.write_shift(w,range.e.r+1),o.write_shift(2,range.s.c),o.write_shift(2,range.e.c+1),o.write_shift(2,0),o}(range,opts)),b8&&(ws["!links"]=[]);for(var R=range.s.r;R<=range.e.r;++R){rr=encode_row(R);for(var C=range.s.c;C<=range.e.c;++C){R===range.s.r&&(cols[C]=encode_col(C)),ref=cols[C]+rr;var cell=dense?(ws[R]||[])[C]:ws[ref];cell&&(write_ws_biff8_cell(ba,cell,R,C,opts),b8&&cell.l&&ws["!links"].push([ref,cell.l]))}}var cname=_sheet.CodeName||_sheet.name||s;return b8&&write_biff_rec(ba,574,function(view){var o=new_buf(18),f=1718;return view&&view.RTL&&(f|=64),o.write_shift(2,f),o.write_shift(4,0),o.write_shift(4,64),o.write_shift(4,0),o.write_shift(4,0),o}((_WB.Views||[])[0])),b8&&(ws["!merges"]||[]).length&&write_biff_rec(ba,229,function(merges){var o=new_buf(2+8*merges.length);o.write_shift(2,merges.length);for(var i=0;i<merges.length;++i)write_Ref8U(merges[i],o);return o}(ws["!merges"])),b8&&function(ba,ws){for(var R=0;R<ws["!links"].length;++R){var HL=ws["!links"][R];write_biff_rec(ba,440,write_HLink(HL)),HL[1].Tooltip&&write_biff_rec(ba,2048,write_HLinkTooltip(HL))}delete ws["!links"]}(ba,ws),write_biff_rec(ba,442,write_XLUnicodeString(cname)),b8&&function(ba,ws){var o=new_buf(19);o.write_shift(4,2151),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(2,3),o.write_shift(1,1),o.write_shift(4,0),write_biff_rec(ba,2151,o),(o=new_buf(39)).write_shift(4,2152),o.write_shift(4,0),o.write_shift(4,0),o.write_shift(2,3),o.write_shift(1,0),o.write_shift(4,0),o.write_shift(2,1),o.write_shift(4,4),o.write_shift(2,0),write_Ref8U(safe_decode_range(ws["!ref"]||"A1"),o),o.write_shift(4,4),write_biff_rec(ba,2152,o)}(ba,ws),write_biff_rec(ba,10),ba.end()}function write_biff8_global(wb,bufs,opts){var o,A=buf_array(),_WB=(wb||{}).Workbook||{},_sheets=_WB.Sheets||[],_wb=_WB.WBProps||{},b8=8==opts.biff,b5=5==opts.biff;(write_biff_rec(A,2057,write_BOF(0,5,opts)),"xla"==opts.bookType&&write_biff_rec(A,135),write_biff_rec(A,225,b8?writeuint16(1200):null),write_biff_rec(A,193,function(n,o){o||(o=new_buf(n));for(var j=0;j<n;++j)o.write_shift(1,0);return o}(2)),b5&&write_biff_rec(A,191),b5&&write_biff_rec(A,192),write_biff_rec(A,226),write_biff_rec(A,92,function(s,opts){var b8=!opts||8==opts.biff,o=new_buf(b8?112:54);for(o.write_shift(8==opts.biff?2:1,7),b8&&o.write_shift(1,0),o.write_shift(4,859007059),o.write_shift(4,5458548|(b8?0:536870912));o.l<o.length;)o.write_shift(1,b8?0:32);return o}(0,opts)),write_biff_rec(A,66,writeuint16(b8?1200:1252)),b8&&write_biff_rec(A,353,writeuint16(0)),b8&&write_biff_rec(A,448),write_biff_rec(A,317,function(n){for(var out=new_buf(2*n),i=0;i<n;++i)out.write_shift(2,i+1);return out}(wb.SheetNames.length)),b8&&wb.vbaraw&&write_biff_rec(A,211),b8&&wb.vbaraw)&&write_biff_rec(A,442,write_XLUnicodeString(_wb.CodeName||"ThisWorkbook"));write_biff_rec(A,156,writeuint16(17)),write_biff_rec(A,25,writebool(!1)),write_biff_rec(A,18,writebool(!1)),write_biff_rec(A,19,writeuint16(0)),b8&&write_biff_rec(A,431,writebool(!1)),b8&&write_biff_rec(A,444,writeuint16(0)),write_biff_rec(A,61,((o=new_buf(18)).write_shift(2,0),o.write_shift(2,0),o.write_shift(2,29280),o.write_shift(2,17600),o.write_shift(2,56),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,1),o.write_shift(2,500),o)),write_biff_rec(A,64,writebool(!1)),write_biff_rec(A,141,writeuint16(0)),write_biff_rec(A,34,writebool("true"==function(wb){return wb.Workbook&&wb.Workbook.WBProps&&function(value){switch(value){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}(wb.Workbook.WBProps.date1904)?"true":"false"}(wb))),write_biff_rec(A,14,writebool(!0)),b8&&write_biff_rec(A,439,writebool(!1)),write_biff_rec(A,218,writeuint16(0)),write_FONTS_biff8(A,0,opts),function(ba,NF,opts){NF&&[[5,8],[23,26],[41,44],[50,392]].forEach((function(r){for(var i=r[0];i<=r[1];++i)null!=NF[i]&&write_biff_rec(ba,1054,write_Format(i,NF[i],opts))}))}(A,wb.SSF,opts),function(ba,opts){for(var i=0;i<16;++i)write_biff_rec(ba,224,write_XF({numFmtId:0,style:!0},0,opts));opts.cellXfs.forEach((function(c){write_biff_rec(ba,224,write_XF(c,0,opts))}))}(A,opts),b8&&write_biff_rec(A,352,writebool(!1));var a=A.end(),C=buf_array();b8&&write_biff_rec(C,140,function(o){return o||(o=new_buf(4)),o.write_shift(2,1),o.write_shift(2,1),o}()),b8&&opts.Strings&&function(ba,type,payload,length){var len=length||(payload||[]).length||0;if(len<=8224)return write_biff_rec(ba,type,payload,len);var t=type;if(!isNaN(t)){for(var parts=payload.parts||[],sidx=0,i=0,w=0;w+(parts[sidx]||8224)<=8224;)w+=parts[sidx]||8224,sidx++;var o=ba.next(4);for(o.write_shift(2,t),o.write_shift(2,w),ba.push(payload.slice(i,i+w)),i+=w;i<len;){for((o=ba.next(4)).write_shift(2,60),w=0;w+(parts[sidx]||8224)<=8224;)w+=parts[sidx]||8224,sidx++;o.write_shift(2,w),ba.push(payload.slice(i,i+w)),i+=w}}}(C,252,function(sst){var header=new_buf(8);header.write_shift(4,sst.Count),header.write_shift(4,sst.Unique);for(var strs=[],j=0;j<sst.length;++j)strs[j]=write_XLUnicodeRichExtendedString(sst[j]);var o=bconcat([header].concat(strs));return o.parts=[header.length].concat(strs.map((function(str){return str.length}))),o}(opts.Strings)),write_biff_rec(C,10);var c=C.end(),B=buf_array(),blen=0,j=0;for(j=0;j<wb.SheetNames.length;++j)blen+=(b8?12:11)+(b8?2:1)*wb.SheetNames[j].length;var start=a.length+blen+c.length;for(j=0;j<wb.SheetNames.length;++j){write_biff_rec(B,133,write_BoundSheet8({pos:start,hs:(_sheets[j]||{}).Hidden||0,dt:0,name:wb.SheetNames[j]},opts)),start+=bufs[j].length}var b=B.end();if(blen!=b.length)throw new Error("BS8 "+blen+" != "+b.length);var out=[];return a.length&&out.push(a),b.length&&out.push(b),c.length&&out.push(c),bconcat(out)}function write_biff_buf(wb,opts){for(var i=0;i<=wb.SheetNames.length;++i){var ws=wb.Sheets[wb.SheetNames[i]];if(ws&&ws["!ref"])decode_range(ws["!ref"]).e.c>255&&"undefined"!=typeof console&&console.error&&console.error("Worksheet '"+wb.SheetNames[i]+"' extends beyond column IV (255).  Data may be lost.")}var o=opts||{};switch(o.biff||2){case 8:case 5:return function(wb,opts){var o=opts||{},bufs=[];wb&&!wb.SSF&&(wb.SSF=dup(table_fmt)),wb&&wb.SSF&&(make_ssf(),SSF_load_table(wb.SSF),o.revssf=evert_num(wb.SSF),o.revssf[wb.SSF[65535]]=0,o.ssf=wb.SSF),o.Strings=[],o.Strings.Count=0,o.Strings.Unique=0,fix_write_opts(o),o.cellXfs=[],get_cell_style(o.cellXfs,{},{revssf:{General:0}}),wb.Props||(wb.Props={});for(var i=0;i<wb.SheetNames.length;++i)bufs[bufs.length]=write_ws_biff8(i,o,wb);return bufs.unshift(write_biff8_global(wb,bufs,o)),bconcat(bufs)}(wb,opts);case 4:case 3:case 2:return write_biff2_buf(wb,opts)}throw new Error("invalid type "+o.bookType+" for BIFF")}function make_html_row(ws,r,R,o){for(var M=ws["!merges"]||[],oo=[],C=r.s.c;C<=r.e.c;++C){for(var RS=0,CS=0,j=0;j<M.length;++j)if(!(M[j].s.r>R||M[j].s.c>C||M[j].e.r<R||M[j].e.c<C)){if(M[j].s.r<R||M[j].s.c<C){RS=-1;break}RS=M[j].e.r-M[j].s.r+1,CS=M[j].e.c-M[j].s.c+1;break}if(!(RS<0)){var coord=encode_cell({r:R,c:C}),cell=o.dense?(ws[R]||[])[C]:ws[coord],w=cell&&null!=cell.v&&(cell.h||((cell.w||(format_cell(cell),cell.w)||"")+"").replace(decregex,(function(y){return rencoding[y]})).replace(/\n/g,"<br/>").replace(htmlcharegex,(function(s){return"&#x"+("000"+s.charCodeAt(0).toString(16)).slice(-4)+";"})))||"",sp={};RS>1&&(sp.rowspan=RS),CS>1&&(sp.colspan=CS),o.editable?w='<span contenteditable="true">'+w+"</span>":cell&&(sp["data-t"]=cell&&cell.t||"z",null!=cell.v&&(sp["data-v"]=cell.v),null!=cell.z&&(sp["data-z"]=cell.z),cell.l&&"#"!=(cell.l.Target||"#").charAt(0)&&(w='<a href="'+cell.l.Target+'">'+w+"</a>")),sp.id=(o.id||"sjs")+"-"+coord,oo.push(writextag("td",w,sp))}}return"<tr>"+oo.join("")+"</tr>"}function sheet_to_html(ws,opts){var o=opts||{},header=null!=o.header?o.header:'<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',footer=null!=o.footer?o.footer:"</body></html>",out=[header],r=decode_range(ws["!ref"]);o.dense=Array.isArray(ws),out.push(function(ws,R,o){return[].join("")+"<table"+(o&&o.id?' id="'+o.id+'"':"")+">"}(0,0,o));for(var R=r.s.r;R<=r.e.r;++R)out.push(make_html_row(ws,r,R,o));return out.push("</table>"+footer),out.join("")}function sheet_add_dom(ws,table,_opts){var opts=_opts||{},or_R=0,or_C=0;if(null!=opts.origin)if("number"==typeof opts.origin)or_R=opts.origin;else{var _origin="string"==typeof opts.origin?decode_cell(opts.origin):opts.origin;or_R=_origin.r,or_C=_origin.c}var rows=table.getElementsByTagName("tr"),sheetRows=Math.min(opts.sheetRows||1e7,rows.length),range={s:{r:0,c:0},e:{r:or_R,c:or_C}};if(ws["!ref"]){var _range=decode_range(ws["!ref"]);range.s.r=Math.min(range.s.r,_range.s.r),range.s.c=Math.min(range.s.c,_range.s.c),range.e.r=Math.max(range.e.r,_range.e.r),range.e.c=Math.max(range.e.c,_range.e.c),-1==or_R&&(range.e.r=or_R=_range.e.r+1)}var merges=[],midx=0,rowinfo=ws["!rows"]||(ws["!rows"]=[]),_R=0,R=0,_C=0,C=0,RS=0,CS=0;for(ws["!cols"]||(ws["!cols"]=[]);_R<rows.length&&R<sheetRows;++_R){var row=rows[_R];if(is_dom_element_hidden(row)){if(opts.display)continue;rowinfo[R]={hidden:!0}}var elts=row.children;for(_C=C=0;_C<elts.length;++_C){var elt=elts[_C];if(!opts.display||!is_dom_element_hidden(elt)){var v=elt.hasAttribute("data-v")?elt.getAttribute("data-v"):elt.hasAttribute("v")?elt.getAttribute("v"):htmldecode(elt.innerHTML),z=elt.getAttribute("data-z")||elt.getAttribute("z");for(midx=0;midx<merges.length;++midx){var m=merges[midx];m.s.c==C+or_C&&m.s.r<R+or_R&&R+or_R<=m.e.r&&(C=m.e.c+1-or_C,midx=-1)}CS=+elt.getAttribute("colspan")||1,((RS=+elt.getAttribute("rowspan")||1)>1||CS>1)&&merges.push({s:{r:R+or_R,c:C+or_C},e:{r:R+or_R+(RS||1)-1,c:C+or_C+(CS||1)-1}});var o={t:"s",v:v},_t=elt.getAttribute("data-t")||elt.getAttribute("t")||"";null!=v&&(0==v.length?o.t=_t||"z":opts.raw||0==v.trim().length||"s"==_t||("TRUE"===v?o={t:"b",v:!0}:"FALSE"===v?o={t:"b",v:!1}:isNaN(fuzzynum(v))?isNaN(fuzzydate(v).getDate())||(o={t:"d",v:parseDate(v)},opts.cellDates||(o={t:"n",v:datenum(o.v)}),o.z=opts.dateNF||table_fmt[14]):o={t:"n",v:fuzzynum(v)})),void 0===o.z&&null!=z&&(o.z=z);var l="",Aelts=elt.getElementsByTagName("A");if(Aelts&&Aelts.length)for(var Aelti=0;Aelti<Aelts.length&&(!Aelts[Aelti].hasAttribute("href")||"#"==(l=Aelts[Aelti].getAttribute("href")).charAt(0));++Aelti);l&&"#"!=l.charAt(0)&&(o.l={Target:l}),opts.dense?(ws[R+or_R]||(ws[R+or_R]=[]),ws[R+or_R][C+or_C]=o):ws[encode_cell({c:C+or_C,r:R+or_R})]=o,range.e.c<C+or_C&&(range.e.c=C+or_C),C+=CS}}++R}return merges.length&&(ws["!merges"]=(ws["!merges"]||[]).concat(merges)),range.e.r=Math.max(range.e.r,R-1+or_R),ws["!ref"]=encode_range(range),R>=sheetRows&&(ws["!fullref"]=encode_range((range.e.r=rows.length-_R+R-1+or_R,range))),ws}function parse_dom_table(table,_opts){return sheet_add_dom((_opts||{}).dense?[]:{},table,_opts)}function is_dom_element_hidden(element){var display="",get_computed_style=function(element){return element.ownerDocument.defaultView&&"function"==typeof element.ownerDocument.defaultView.getComputedStyle?element.ownerDocument.defaultView.getComputedStyle:"function"==typeof getComputedStyle?getComputedStyle:null}(element);return get_computed_style&&(display=get_computed_style(element).getPropertyValue("display")),display||(display=element.style&&element.style.display),"none"===display}var write_styles_ods=function(){var master_styles=["<office:master-styles>",'<style:master-page style:name="mp1" style:page-layout-name="mp1">',"<style:header/>",'<style:header-left style:display="false"/>',"<style:footer/>",'<style:footer-left style:display="false"/>',"</style:master-page>","</office:master-styles>"].join(""),payload="<office:document-styles "+wxt_helper({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+">"+master_styles+"</office:document-styles>";return function(){return XML_HEADER+payload}}(),write_content_ods=function(){var null_cell_xml="          <table:table-cell />\n",write_ws=function(ws,wb,i){var o=[];o.push('      <table:table table:name="'+escapexml(wb.SheetNames[i])+'" table:style-name="ta1">\n');var R=0,C=0,range=decode_range(ws["!ref"]||"A1"),marr=ws["!merges"]||[],mi=0,dense=Array.isArray(ws);if(ws["!cols"])for(C=0;C<=range.e.c;++C)o.push("        <table:table-column"+(ws["!cols"][C]?' table:style-name="co'+ws["!cols"][C].ods+'"':"")+"></table:table-column>\n");var H="",ROWS=ws["!rows"]||[];for(R=0;R<range.s.r;++R)H=ROWS[R]?' table:style-name="ro'+ROWS[R].ods+'"':"",o.push("        <table:table-row"+H+"></table:table-row>\n");for(;R<=range.e.r;++R){for(H=ROWS[R]?' table:style-name="ro'+ROWS[R].ods+'"':"",o.push("        <table:table-row"+H+">\n"),C=0;C<range.s.c;++C)o.push(null_cell_xml);for(;C<=range.e.c;++C){var skip=!1,ct={},textp="";for(mi=0;mi!=marr.length;++mi)if(!(marr[mi].s.c>C||marr[mi].s.r>R||marr[mi].e.c<C||marr[mi].e.r<R)){marr[mi].s.c==C&&marr[mi].s.r==R||(skip=!0),ct["table:number-columns-spanned"]=marr[mi].e.c-marr[mi].s.c+1,ct["table:number-rows-spanned"]=marr[mi].e.r-marr[mi].s.r+1;break}if(skip)o.push("          <table:covered-table-cell/>\n");else{var ref=encode_cell({r:R,c:C}),cell=dense?(ws[R]||[])[C]:ws[ref];if(cell&&cell.f&&(ct["table:formula"]=escapexml(("of:="+cell.f.replace(crefregex,"$1[.$2$3$4$5]").replace(/\]:\[/g,":")).replace(/;/g,"|").replace(/,/g,";")),cell.F&&cell.F.slice(0,ref.length)==ref)){var _Fref=decode_range(cell.F);ct["table:number-matrix-columns-spanned"]=_Fref.e.c-_Fref.s.c+1,ct["table:number-matrix-rows-spanned"]=_Fref.e.r-_Fref.s.r+1}if(cell){switch(cell.t){case"b":textp=cell.v?"TRUE":"FALSE",ct["office:value-type"]="boolean",ct["office:boolean-value"]=cell.v?"true":"false";break;case"n":textp=cell.w||String(cell.v||0),ct["office:value-type"]="float",ct["office:value"]=cell.v||0;break;case"s":case"str":textp=null==cell.v?"":cell.v,ct["office:value-type"]="string";break;case"d":textp=cell.w||parseDate(cell.v).toISOString(),ct["office:value-type"]="date",ct["office:date-value"]=parseDate(cell.v).toISOString(),ct["table:style-name"]="ce1";break;default:o.push(null_cell_xml);continue}var text_p=escapexml(textp).replace(/  +/g,(function($$){return'<text:s text:c="'+$$.length+'"/>'})).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>");if(cell.l&&cell.l.Target){var _tgt=cell.l.Target;"#"==(_tgt="#"==_tgt.charAt(0)?"#"+_tgt.slice(1).replace(/\./,"!"):_tgt).charAt(0)||_tgt.match(/^\w+:/)||(_tgt="../"+_tgt),text_p=writextag("text:a",text_p,{"xlink:href":_tgt.replace(/&/g,"&amp;")})}o.push("          "+writextag("table:table-cell",writextag("text:p",text_p,{}),ct)+"\n")}else o.push(null_cell_xml)}}o.push("        </table:table-row>\n")}return o.push("      </table:table>\n"),o.join("")};return function(wb,opts){var o=[XML_HEADER],attr=wxt_helper({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),fods=wxt_helper({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});"fods"==opts.bookType?(o.push("<office:document"+attr+fods+">\n"),o.push(write_meta_ods().replace(/office:document-meta/g,"office:meta"))):o.push("<office:document-content"+attr+">\n"),function(o,wb){o.push(" <office:automatic-styles>\n"),o.push('  <number:date-style style:name="N37" number:automatic-order="true">\n'),o.push('   <number:month number:style="long"/>\n'),o.push("   <number:text>/</number:text>\n"),o.push('   <number:day number:style="long"/>\n'),o.push("   <number:text>/</number:text>\n"),o.push("   <number:year/>\n"),o.push("  </number:date-style>\n");var cidx=0;wb.SheetNames.map((function(n){return wb.Sheets[n]})).forEach((function(ws){if(ws&&ws["!cols"])for(var C=0;C<ws["!cols"].length;++C)if(ws["!cols"][C]){var colobj=ws["!cols"][C];if(null==colobj.width&&null==colobj.wpx&&null==colobj.wch)continue;process_col(colobj),colobj.ods=cidx;var w=ws["!cols"][C].wpx+"px";o.push('  <style:style style:name="co'+cidx+'" style:family="table-column">\n'),o.push('   <style:table-column-properties fo:break-before="auto" style:column-width="'+w+'"/>\n'),o.push("  </style:style>\n"),++cidx}}));var ridx=0;wb.SheetNames.map((function(n){return wb.Sheets[n]})).forEach((function(ws){if(ws&&ws["!rows"])for(var R=0;R<ws["!rows"].length;++R)if(ws["!rows"][R]){ws["!rows"][R].ods=ridx;var h=ws["!rows"][R].hpx+"px";o.push('  <style:style style:name="ro'+ridx+'" style:family="table-row">\n'),o.push('   <style:table-row-properties fo:break-before="auto" style:row-height="'+h+'"/>\n'),o.push("  </style:style>\n"),++ridx}})),o.push('  <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">\n'),o.push('   <style:table-properties table:display="true" style:writing-mode="lr-tb"/>\n'),o.push("  </style:style>\n"),o.push('  <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>\n'),o.push(" </office:automatic-styles>\n")}(o,wb),o.push("  <office:body>\n"),o.push("    <office:spreadsheet>\n");for(var i=0;i!=wb.SheetNames.length;++i)o.push(write_ws(wb.Sheets[wb.SheetNames[i]],wb,i));return o.push("    </office:spreadsheet>\n"),o.push("  </office:body>\n"),"fods"==opts.bookType?o.push("</office:document>"):o.push("</office:document-content>"),o.join("")}}();function write_ods(wb,opts){if("fods"==opts.bookType)return write_content_ods(wb,opts);var zip=zip_new(),f="",manifest=[],rdf=[];return zip_add_file(zip,f="mimetype","application/vnd.oasis.opendocument.spreadsheet"),zip_add_file(zip,f="content.xml",write_content_ods(wb,opts)),manifest.push([f,"text/xml"]),rdf.push([f,"ContentFile"]),zip_add_file(zip,f="styles.xml",write_styles_ods(wb,opts)),manifest.push([f,"text/xml"]),rdf.push([f,"StylesFile"]),zip_add_file(zip,f="meta.xml",XML_HEADER+write_meta_ods()),manifest.push([f,"text/xml"]),rdf.push([f,"MetadataFile"]),zip_add_file(zip,f="manifest.rdf",function(rdf){var o=[XML_HEADER];o.push('<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n');for(var i=0;i!=rdf.length;++i)o.push(write_rdf_type(rdf[i][0],rdf[i][1])),o.push(write_rdf_has("",rdf[i][0]));return o.push(write_rdf_type("","Document","pkg")),o.push("</rdf:RDF>"),o.join("")}(rdf)),manifest.push([f,"application/rdf+xml"]),zip_add_file(zip,f="META-INF/manifest.xml",function(manifest){var o=[XML_HEADER];o.push('<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">\n'),o.push('  <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n');for(var i=0;i<manifest.length;++i)o.push('  <manifest:file-entry manifest:full-path="'+manifest[i][0]+'" manifest:media-type="'+manifest[i][1]+'"/>\n');return o.push("</manifest:manifest>"),o.join("")}(manifest)),zip}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function u8_to_dataview(array){return new DataView(array.buffer,array.byteOffset,array.byteLength)}function stru8(str){return"undefined"!=typeof TextEncoder?(new TextEncoder).encode(str):s2a(utf8write(str))}function u8concat(u8a){var len=u8a.reduce((function(acc,x){return acc+x.length}),0),out=new Uint8Array(len),off=0;return u8a.forEach((function(u8){out.set(u8,off),off+=u8.length})),out}function parse_varint49(buf,ptr){var l=ptr?ptr[0]:0,usz=127&buf[l];varint:if(buf[l++]>=128){if(usz|=(127&buf[l])<<7,buf[l++]<128)break varint;if(usz|=(127&buf[l])<<14,buf[l++]<128)break varint;if(usz|=(127&buf[l])<<21,buf[l++]<128)break varint;if(usz+=(127&buf[l])*Math.pow(2,28),++l,buf[l++]<128)break varint;if(usz+=(127&buf[l])*Math.pow(2,35),++l,buf[l++]<128)break varint;if(usz+=(127&buf[l])*Math.pow(2,42),++l,buf[l++]<128)break varint}return ptr&&(ptr[0]=l),usz}function write_varint49(v){var usz=new Uint8Array(7);usz[0]=127&v;var L=1;sz:if(v>127){if(usz[L-1]|=128,usz[L]=v>>7&127,++L,v<=16383)break sz;if(usz[L-1]|=128,usz[L]=v>>14&127,++L,v<=2097151)break sz;if(usz[L-1]|=128,usz[L]=v>>21&127,++L,v<=268435455)break sz;if(usz[L-1]|=128,usz[L]=v/256>>>21&127,++L,v<=34359738367)break sz;if(usz[L-1]|=128,usz[L]=v/65536>>>21&127,++L,v<=4398046511103)break sz;usz[L-1]|=128,usz[L]=v/16777216>>>21&127,++L}return usz.slice(0,L)}function varint_to_i32(buf){var l=0,i32=127&buf[l];varint:if(buf[l++]>=128){if(i32|=(127&buf[l])<<7,buf[l++]<128)break varint;if(i32|=(127&buf[l])<<14,buf[l++]<128)break varint;if(i32|=(127&buf[l])<<21,buf[l++]<128)break varint;i32|=(127&buf[l])<<28}return i32}function parse_shallow(buf){for(var out=[],ptr=[0];ptr[0]<buf.length;){var res,off=ptr[0],num=parse_varint49(buf,ptr),type=7&num,len=0;if(0==(num=Math.floor(num/8)))break;switch(type){case 0:for(var l=ptr[0];buf[ptr[0]++]>=128;);res=buf.slice(l,ptr[0]);break;case 5:len=4,res=buf.slice(ptr[0],ptr[0]+len),ptr[0]+=len;break;case 1:len=8,res=buf.slice(ptr[0],ptr[0]+len),ptr[0]+=len;break;case 2:len=parse_varint49(buf,ptr),res=buf.slice(ptr[0],ptr[0]+len),ptr[0]+=len;break;default:throw new Error("PB Type ".concat(type," for Field ").concat(num," at offset ").concat(off))}var v={data:res,type:type};null==out[num]?out[num]=[v]:out[num].push(v)}return out}function write_shallow(proto){var out=[];return proto.forEach((function(field,idx){field.forEach((function(item){item.data&&(out.push(write_varint49(8*idx+item.type)),2==item.type&&out.push(write_varint49(item.data.length)),out.push(item.data))}))})),u8concat(out)}function parse_iwa_file(buf){for(var _a,out=[],ptr=[0];ptr[0]<buf.length;){var len=parse_varint49(buf,ptr),ai=parse_shallow(buf.slice(ptr[0],ptr[0]+len));ptr[0]+=len;var res={id:varint_to_i32(ai[1][0].data),messages:[]};ai[2].forEach((function(b){var mi=parse_shallow(b.data),fl=varint_to_i32(mi[3][0].data);res.messages.push({meta:mi,data:buf.slice(ptr[0],ptr[0]+fl)}),ptr[0]+=fl})),(null==(_a=ai[3])?void 0:_a[0])&&(res.merge=varint_to_i32(ai[3][0].data)>>>0>0),out.push(res)}return out}function write_iwa_file(ias){var bufs=[];return ias.forEach((function(ia){var ai=[];ai[1]=[{data:write_varint49(ia.id),type:0}],ai[2]=[],null!=ia.merge&&(ai[3]=[{data:write_varint49(+!!ia.merge),type:0}]);var midata=[];ia.messages.forEach((function(mi){midata.push(mi.data),mi.meta[3]=[{type:0,data:write_varint49(mi.data.length)}],ai[2].push({data:write_shallow(mi.meta),type:2})}));var aipayload=write_shallow(ai);bufs.push(write_varint49(aipayload.length)),bufs.push(aipayload),midata.forEach((function(mid){return bufs.push(mid)}))})),u8concat(bufs)}function parse_snappy_chunk(type,buf){if(0!=type)throw new Error("Unexpected Snappy chunk type ".concat(type));for(var ptr=[0],usz=parse_varint49(buf,ptr),chunks=[];ptr[0]<buf.length;){var tag=3&buf[ptr[0]];if(0!=tag){var offset=0,length=0;if(1==tag?(length=4+(buf[ptr[0]]>>2&7),offset=(224&buf[ptr[0]++])<<3,offset|=buf[ptr[0]++]):(length=1+(buf[ptr[0]++]>>2),2==tag?(offset=buf[ptr[0]]|buf[ptr[0]+1]<<8,ptr[0]+=2):(offset=(buf[ptr[0]]|buf[ptr[0]+1]<<8|buf[ptr[0]+2]<<16|buf[ptr[0]+3]<<24)>>>0,ptr[0]+=4)),chunks=[u8concat(chunks)],0==offset)throw new Error("Invalid offset 0");if(offset>chunks[0].length)throw new Error("Invalid offset beyond length");if(length>=offset)for(chunks.push(chunks[0].slice(-offset)),length-=offset;length>=chunks[chunks.length-1].length;)chunks.push(chunks[chunks.length-1]),length-=chunks[chunks.length-1].length;chunks.push(chunks[0].slice(-offset,-offset+length))}else{var len=buf[ptr[0]++]>>2;if(len<60)++len;else{var c=len-59;len=buf[ptr[0]],c>1&&(len|=buf[ptr[0]+1]<<8),c>2&&(len|=buf[ptr[0]+2]<<16),c>3&&(len|=buf[ptr[0]+3]<<24),len>>>=0,len++,ptr[0]+=c}chunks.push(buf.slice(ptr[0],ptr[0]+len)),ptr[0]+=len}}var o=u8concat(chunks);if(o.length!=usz)throw new Error("Unexpected length: ".concat(o.length," != ").concat(usz));return o}function decompress_iwa_file(buf){for(var out=[],l=0;l<buf.length;){var t=buf[l++],len=buf[l]|buf[l+1]<<8|buf[l+2]<<16;l+=3,out.push(parse_snappy_chunk(t,buf.slice(l,l+len))),l+=len}if(l!==buf.length)throw new Error("data is not a valid framed stream!");return u8concat(out)}function compress_iwa_file(buf){for(var out=[],l=0;l<buf.length;){var c=Math.min(buf.length-l,268435455),frame=new Uint8Array(4);out.push(frame);var usz=write_varint49(c),L=usz.length;out.push(usz),c<=60?(L++,out.push(new Uint8Array([c-1<<2]))):c<=256?(L+=2,out.push(new Uint8Array([240,c-1&255]))):c<=65536?(L+=3,out.push(new Uint8Array([244,c-1&255,c-1>>8&255]))):c<=16777216?(L+=4,out.push(new Uint8Array([248,c-1&255,c-1>>8&255,c-1>>16&255]))):c<=4294967296&&(L+=5,out.push(new Uint8Array([252,c-1&255,c-1>>8&255,c-1>>16&255,c-1>>>24&255]))),out.push(buf.slice(l,l+c)),L+=c,frame[0]=0,frame[1]=255&L,frame[2]=L>>8&255,frame[3]=L>>16&255,l+=c}return u8concat(out)}function write_new_storage(cell,sst){var out=new Uint8Array(32),dv=u8_to_dataview(out),l=12,flags=0;switch(out[0]=5,cell.t){case"n":out[1]=2,function(buf,offset,value){var exp=Math.floor(0==value?0:Math.LOG10E*Math.log(Math.abs(value)))+6176-20,mantissa=value/Math.pow(10,exp-6176);buf[offset+15]|=exp>>7,buf[offset+14]|=(127&exp)<<1;for(var i=0;mantissa>=1;++i,mantissa/=256)buf[offset+i]=255&mantissa;buf[offset+15]|=value>=0?0:128}(out,l,cell.v),flags|=1,l+=16;break;case"b":out[1]=6,dv.setFloat64(l,cell.v?1:0,!0),flags|=2,l+=8;break;case"s":if(-1==sst.indexOf(cell.v))throw new Error("Value ".concat(cell.v," missing from SST!"));out[1]=3,dv.setUint32(l,sst.indexOf(cell.v),!0),flags|=8,l+=4;break;default:throw"unsupported cell type "+cell.t}return dv.setUint32(8,flags,!0),out.slice(0,l)}function write_old_storage(cell,sst){var out=new Uint8Array(32),dv=u8_to_dataview(out),l=12,flags=0;switch(out[0]=3,cell.t){case"n":out[2]=2,dv.setFloat64(l,cell.v,!0),flags|=32,l+=8;break;case"b":out[2]=6,dv.setFloat64(l,cell.v?1:0,!0),flags|=32,l+=8;break;case"s":if(-1==sst.indexOf(cell.v))throw new Error("Value ".concat(cell.v," missing from SST!"));out[2]=3,dv.setUint32(l,sst.indexOf(cell.v),!0),flags|=16,l+=4;break;default:throw"unsupported cell type "+cell.t}return dv.setUint32(4,flags,!0),out.slice(0,l)}function parse_TSP_Reference(buf){return parse_varint49(parse_shallow(buf)[1][0].data)}function write_tile_row(tri,data,SST){var _a,_b,_c,_d;if(!(null==(_a=tri[6])?void 0:_a[0])||!(null==(_b=tri[7])?void 0:_b[0]))throw"Mutation only works on post-BNC storages!";if((null==(_d=null==(_c=tri[8])?void 0:_c[0])?void 0:_d.data)&&varint_to_i32(tri[8][0].data)>0||!1)throw"Math only works with normal offsets";for(var cnt=0,dv=u8_to_dataview(tri[7][0].data),last_offset=0,cell_storage=[],_dv=u8_to_dataview(tri[4][0].data),_last_offset=0,_cell_storage=[],C=0;C<data.length;++C)if(null!=data[C]){var celload,_celload;switch(dv.setUint16(2*C,last_offset,!0),_dv.setUint16(2*C,_last_offset,!0),typeof data[C]){case"string":celload=write_new_storage({t:"s",v:data[C]},SST),_celload=write_old_storage({t:"s",v:data[C]},SST);break;case"number":celload=write_new_storage({t:"n",v:data[C]},SST),_celload=write_old_storage({t:"n",v:data[C]},SST);break;case"boolean":celload=write_new_storage({t:"b",v:data[C]},SST),_celload=write_old_storage({t:"b",v:data[C]},SST);break;default:throw new Error("Unsupported value "+data[C])}cell_storage.push(celload),last_offset+=celload.length,_cell_storage.push(_celload),_last_offset+=_celload.length,++cnt}else dv.setUint16(2*C,65535,!0),_dv.setUint16(2*C,65535);for(tri[2][0].data=write_varint49(cnt);C<tri[7][0].data.length/2;++C)dv.setUint16(2*C,65535,!0),_dv.setUint16(2*C,65535,!0);return tri[6][0].data=u8concat(cell_storage),tri[3][0].data=u8concat(_cell_storage),cnt}function fix_write_opts(opts){!function(defaults){return function(opts){for(var i=0;i!=defaults.length;++i){var d=defaults[i];void 0===opts[d[0]]&&(opts[d[0]]=d[1]),"n"===d[2]&&(opts[d[0]]=Number(opts[d[0]]))}}}([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(opts)}function write_zip(wb,opts){return"ods"==opts.bookType?write_ods(wb,opts):"numbers"==opts.bookType?function(wb,opts){if(!opts||!opts.numbers)throw new Error("Must pass a `numbers` option -- check the README");var ws=wb.Sheets[wb.SheetNames[0]];wb.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var range=decode_range(ws["!ref"]);range.s.r=range.s.c=0;var trunc=!1;range.e.c>9&&(trunc=!0,range.e.c=9),range.e.r>49&&(trunc=!0,range.e.r=49),trunc&&console.error("The Numbers writer is currently limited to ".concat(encode_range(range)));var data=sheet_to_json(ws,{range:range,header:1}),SST=["~Sh33tJ5~"];data.forEach((function(row){return row.forEach((function(cell){"string"==typeof cell&&SST.push(cell)}))}));var dependents={},indices=[],cfb=CFB.read(opts.numbers,{type:"base64"});cfb.FileIndex.map((function(fi,idx){return[fi,cfb.FullPaths[idx]]})).forEach((function(row){var fi=row[0],fp=row[1];2==fi.type&&fi.name.match(/\.iwa/)&&parse_iwa_file(decompress_iwa_file(fi.content)).forEach((function(packet2){indices.push(packet2.id),dependents[packet2.id]={deps:[],location:fp,type:varint_to_i32(packet2.messages[0].meta[1][0].data)}}))})),indices.sort((function(x2,y2){return x2-y2}));var indices_varint=indices.filter((function(x2){return x2>1})).map((function(x2){return[x2,write_varint49(x2)]}));cfb.FileIndex.map((function(fi,idx){return[fi,cfb.FullPaths[idx]]})).forEach((function(row){var fi=row[0];row[1],fi.name.match(/\.iwa/)&&parse_iwa_file(decompress_iwa_file(fi.content)).forEach((function(ia){ia.messages.forEach((function(m){indices_varint.forEach((function(ivi){ia.messages.some((function(mess){return 11006!=varint_to_i32(mess.meta[1][0].data)&&function(body,search){outer:for(var L=0;L<=body.length-search.length;++L){for(var j=0;j<search.length;++j)if(body[L+j]!=search[j])continue outer;return!0}return!1}(mess.data,ivi[1])}))&&dependents[ivi[0]].deps.push(ia.id)}))}))}))}));for(var docroot,entry=CFB.find(cfb,dependents[1].location),x=parse_iwa_file(decompress_iwa_file(entry.content)),xi=0;xi<x.length;++xi){var packet=x[xi];1==packet.id&&(docroot=packet)}var sheetrootref=parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[1][0].data);for(x=parse_iwa_file(decompress_iwa_file((entry=CFB.find(cfb,dependents[sheetrootref].location)).content)),xi=0;xi<x.length;++xi)(packet=x[xi]).id==sheetrootref&&(docroot=packet);for(sheetrootref=parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[2][0].data),x=parse_iwa_file(decompress_iwa_file((entry=CFB.find(cfb,dependents[sheetrootref].location)).content)),xi=0;xi<x.length;++xi)(packet=x[xi]).id==sheetrootref&&(docroot=packet);for(sheetrootref=parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[2][0].data),x=parse_iwa_file(decompress_iwa_file((entry=CFB.find(cfb,dependents[sheetrootref].location)).content)),xi=0;xi<x.length;++xi)(packet=x[xi]).id==sheetrootref&&(docroot=packet);var pb=parse_shallow(docroot.messages[0].data);pb[6][0].data=write_varint49(range.e.r+1),pb[7][0].data=write_varint49(range.e.c+1);for(var cruidsref=parse_TSP_Reference(pb[46][0].data),oldbucket=CFB.find(cfb,dependents[cruidsref].location),_x=parse_iwa_file(decompress_iwa_file(oldbucket.content)),j=0;j<_x.length&&_x[j].id!=cruidsref;++j);if(_x[j].id!=cruidsref)throw"Bad ColumnRowUIDMapArchive";var cruids=parse_shallow(_x[j].messages[0].data);cruids[1]=[],cruids[2]=[],cruids[3]=[];for(var C=0;C<=range.e.c;++C){var uuid=[];uuid[1]=uuid[2]=[{type:0,data:write_varint49(C+420690)}],cruids[1].push({type:2,data:write_shallow(uuid)}),cruids[2].push({type:0,data:write_varint49(C)}),cruids[3].push({type:0,data:write_varint49(C)})}cruids[4]=[],cruids[5]=[],cruids[6]=[];for(var R=0;R<=range.e.r;++R)(uuid=[])[1]=uuid[2]=[{type:0,data:write_varint49(R+726270)}],cruids[4].push({type:2,data:write_shallow(uuid)}),cruids[5].push({type:0,data:write_varint49(R)}),cruids[6].push({type:0,data:write_varint49(R)});_x[j].messages[0].data=write_shallow(cruids),oldbucket.content=compress_iwa_file(write_iwa_file(_x)),oldbucket.size=oldbucket.content.length,delete pb[46];var store=parse_shallow(pb[4][0].data);store[7][0].data=write_varint49(range.e.r+1);var row_header_ref=parse_TSP_Reference(parse_shallow(store[1][0].data)[2][0].data);if((_x=parse_iwa_file(decompress_iwa_file((oldbucket=CFB.find(cfb,dependents[row_header_ref].location)).content)))[0].id!=row_header_ref)throw"Bad HeaderStorageBucket";var base_bucket=parse_shallow(_x[0].messages[0].data);for(R=0;R<data.length;++R){var _bucket=parse_shallow(base_bucket[2][0].data);_bucket[1][0].data=write_varint49(R),_bucket[4][0].data=write_varint49(data[R].length),base_bucket[2][R]={type:base_bucket[2][0].type,data:write_shallow(_bucket)}}_x[0].messages[0].data=write_shallow(base_bucket),oldbucket.content=compress_iwa_file(write_iwa_file(_x)),oldbucket.size=oldbucket.content.length;var col_header_ref=parse_TSP_Reference(store[2][0].data);if((_x=parse_iwa_file(decompress_iwa_file((oldbucket=CFB.find(cfb,dependents[col_header_ref].location)).content)))[0].id!=col_header_ref)throw"Bad HeaderStorageBucket";for(base_bucket=parse_shallow(_x[0].messages[0].data),C=0;C<=range.e.c;++C)(_bucket=parse_shallow(base_bucket[2][0].data))[1][0].data=write_varint49(C),_bucket[4][0].data=write_varint49(range.e.r+1),base_bucket[2][C]={type:base_bucket[2][0].type,data:write_shallow(_bucket)};_x[0].messages[0].data=write_shallow(base_bucket),oldbucket.content=compress_iwa_file(write_iwa_file(_x)),oldbucket.size=oldbucket.content.length;var sstref=parse_TSP_Reference(store[4][0].data);!function(){for(var sstroot,sentry=CFB.find(cfb,dependents[sstref].location),sx=parse_iwa_file(decompress_iwa_file(sentry.content)),sxi=0;sxi<sx.length;++sxi){var packet2=sx[sxi];packet2.id==sstref&&(sstroot=packet2)}var sstdata=parse_shallow(sstroot.messages[0].data);sstdata[3]=[];var newsst=[];SST.forEach((function(str,i){newsst[1]=[{type:0,data:write_varint49(i)}],newsst[2]=[{type:0,data:write_varint49(1)}],newsst[3]=[{type:2,data:stru8(str)}],sstdata[3].push({type:2,data:write_shallow(newsst)})})),sstroot.messages[0].data=write_shallow(sstdata);var raw32=compress_iwa_file(write_iwa_file(sx));sentry.content=raw32,sentry.size=sentry.content.length}();var tile=parse_shallow(store[3][0].data),t=tile[1][0];delete tile[2];var tl=parse_shallow(t.data),tileref=parse_TSP_Reference(tl[2][0].data);!function(){for(var tileroot,tentry=CFB.find(cfb,dependents[tileref].location),tx=parse_iwa_file(decompress_iwa_file(tentry.content)),sxi=0;sxi<tx.length;++sxi){var packet2=tx[sxi];packet2.id==tileref&&(tileroot=packet2)}var tiledata=parse_shallow(tileroot.messages[0].data);delete tiledata[6],delete tile[7];var rowload=new Uint8Array(tiledata[5][0].data);tiledata[5]=[];for(var cnt=0,R2=0;R2<=range.e.r;++R2){var tilerow=parse_shallow(rowload);cnt+=write_tile_row(tilerow,data[R2],SST),tilerow[1][0].data=write_varint49(R2),tiledata[5].push({data:write_shallow(tilerow),type:2})}tiledata[1]=[{type:0,data:write_varint49(range.e.c+1)}],tiledata[2]=[{type:0,data:write_varint49(range.e.r+1)}],tiledata[3]=[{type:0,data:write_varint49(cnt)}],tiledata[4]=[{type:0,data:write_varint49(range.e.r+1)}],tileroot.messages[0].data=write_shallow(tiledata);var raw32=compress_iwa_file(write_iwa_file(tx));tentry.content=raw32,tentry.size=tentry.content.length}(),t.data=write_shallow(tl),store[3][0].data=write_shallow(tile),pb[4][0].data=write_shallow(store),docroot.messages[0].data=write_shallow(pb);var raw3=compress_iwa_file(write_iwa_file(x));return entry.content=raw3,entry.size=entry.content.length,cfb}(wb,opts):"xlsb"==opts.bookType?function(wb,opts){_shapeid=1024,wb&&!wb.SSF&&(wb.SSF=dup(table_fmt));wb&&wb.SSF&&(make_ssf(),SSF_load_table(wb.SSF),opts.revssf=evert_num(wb.SSF),opts.revssf[wb.SSF[65535]]=0,opts.ssf=wb.SSF);opts.rels={},opts.wbrels={},opts.Strings=[],opts.Strings.Count=0,opts.Strings.Unique=0,browser_has_Map?opts.revStrings=new Map:(opts.revStrings={},opts.revStrings.foo=[],delete opts.revStrings.foo);var wbext="xlsb"==opts.bookType?"bin":"xml",vbafmt=VBAFMTS.indexOf(opts.bookType)>-1,ct={workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""};fix_write_opts(opts=opts||{});var zip=zip_new(),f="",rId=0;opts.cellXfs=[],get_cell_style(opts.cellXfs,{},{revssf:{General:0}}),wb.Props||(wb.Props={});if(zip_add_file(zip,f="docProps/core.xml",write_core_props(wb.Props,opts)),ct.coreprops.push(f),add_rels(opts.rels,2,f,RELS.CORE_PROPS),f="docProps/app.xml",wb.Props&&wb.Props.SheetNames);else if(wb.Workbook&&wb.Workbook.Sheets){for(var _sn=[],_i=0;_i<wb.SheetNames.length;++_i)2!=(wb.Workbook.Sheets[_i]||{}).Hidden&&_sn.push(wb.SheetNames[_i]);wb.Props.SheetNames=_sn}else wb.Props.SheetNames=wb.SheetNames;wb.Props.Worksheets=wb.Props.SheetNames.length,zip_add_file(zip,f,write_ext_props(wb.Props)),ct.extprops.push(f),add_rels(opts.rels,3,f,RELS.EXT_PROPS),wb.Custprops!==wb.Props&&keys(wb.Custprops||{}).length>0&&(zip_add_file(zip,f="docProps/custom.xml",write_cust_props(wb.Custprops)),ct.custprops.push(f),add_rels(opts.rels,4,f,RELS.CUST_PROPS));for(rId=1;rId<=wb.SheetNames.length;++rId){var wsrels={"!id":{}},ws=wb.Sheets[wb.SheetNames[rId-1]];(ws||{})["!type"];if(zip_add_file(zip,f="xl/worksheets/sheet"+rId+"."+wbext,write_ws(rId-1,f,opts,wb,wsrels)),ct.sheets.push(f),add_rels(opts.wbrels,-1,"worksheets/sheet"+rId+"."+wbext,RELS.WS[0]),ws){var comments=ws["!comments"],need_vml=!1,cf="";comments&&comments.length>0&&(zip_add_file(zip,cf="xl/comments"+rId+"."+wbext,write_cmnt(comments,cf)),ct.comments.push(cf),add_rels(wsrels,-1,"../comments"+rId+"."+wbext,RELS.CMNT),need_vml=!0),ws["!legacy"]&&need_vml&&zip_add_file(zip,"xl/drawings/vmlDrawing"+rId+".vml",write_comments_vml(rId,ws["!comments"])),delete ws["!comments"],delete ws["!legacy"]}wsrels["!id"].rId1&&zip_add_file(zip,get_rels_path(f),write_rels(wsrels))}null!=opts.Strings&&opts.Strings.length>0&&(zip_add_file(zip,f="xl/sharedStrings."+wbext,function(data,name,opts){return(".bin"===name.slice(-4)?write_sst_bin:write_sst_xml)(data,opts)}(opts.Strings,f,opts)),ct.strs.push(f),add_rels(opts.wbrels,-1,"sharedStrings."+wbext,RELS.SST));zip_add_file(zip,f="xl/workbook."+wbext,function(wb,name){return(".bin"===name.slice(-4)?write_wb_bin:write_wb_xml)(wb)}(wb,f)),ct.workbooks.push(f),add_rels(opts.rels,1,f,RELS.WB),zip_add_file(zip,f="xl/theme/theme1.xml",write_theme(wb.Themes,opts)),ct.themes.push(f),add_rels(opts.wbrels,-1,"theme/theme1.xml",RELS.THEME),zip_add_file(zip,f="xl/styles."+wbext,function(data,name,opts){return(".bin"===name.slice(-4)?write_sty_bin:write_sty_xml)(data,opts)}(wb,f,opts)),ct.styles.push(f),add_rels(opts.wbrels,-1,"styles."+wbext,RELS.STY),wb.vbaraw&&vbafmt&&(zip_add_file(zip,f="xl/vbaProject.bin",wb.vbaraw),ct.vba.push(f),add_rels(opts.wbrels,-1,"vbaProject.bin",RELS.VBA));return zip_add_file(zip,f="xl/metadata."+wbext,function(name){return(".bin"===name.slice(-4)?write_xlmeta_bin:write_xlmeta_xml)()}(f)),ct.metadata.push(f),add_rels(opts.wbrels,-1,"metadata."+wbext,RELS.XLMETA),zip_add_file(zip,"[Content_Types].xml",write_ct(ct,opts)),zip_add_file(zip,"_rels/.rels",write_rels(opts.rels)),zip_add_file(zip,"xl/_rels/workbook."+wbext+".rels",write_rels(opts.wbrels)),delete opts.revssf,delete opts.ssf,zip}(wb,opts):function(wb,opts){_shapeid=1024,wb&&!wb.SSF&&(wb.SSF=dup(table_fmt));wb&&wb.SSF&&(make_ssf(),SSF_load_table(wb.SSF),opts.revssf=evert_num(wb.SSF),opts.revssf[wb.SSF[65535]]=0,opts.ssf=wb.SSF);opts.rels={},opts.wbrels={},opts.Strings=[],opts.Strings.Count=0,opts.Strings.Unique=0,browser_has_Map?opts.revStrings=new Map:(opts.revStrings={},opts.revStrings.foo=[],delete opts.revStrings.foo);var wbext="xml",vbafmt=VBAFMTS.indexOf(opts.bookType)>-1,ct={workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""};fix_write_opts(opts=opts||{});var zip=zip_new(),f="",rId=0;opts.cellXfs=[],get_cell_style(opts.cellXfs,{},{revssf:{General:0}}),wb.Props||(wb.Props={});if(zip_add_file(zip,f="docProps/core.xml",write_core_props(wb.Props,opts)),ct.coreprops.push(f),add_rels(opts.rels,2,f,RELS.CORE_PROPS),f="docProps/app.xml",wb.Props&&wb.Props.SheetNames);else if(wb.Workbook&&wb.Workbook.Sheets){for(var _sn=[],_i=0;_i<wb.SheetNames.length;++_i)2!=(wb.Workbook.Sheets[_i]||{}).Hidden&&_sn.push(wb.SheetNames[_i]);wb.Props.SheetNames=_sn}else wb.Props.SheetNames=wb.SheetNames;wb.Props.Worksheets=wb.Props.SheetNames.length,zip_add_file(zip,f,write_ext_props(wb.Props)),ct.extprops.push(f),add_rels(opts.rels,3,f,RELS.EXT_PROPS),wb.Custprops!==wb.Props&&keys(wb.Custprops||{}).length>0&&(zip_add_file(zip,f="docProps/custom.xml",write_cust_props(wb.Custprops)),ct.custprops.push(f),add_rels(opts.rels,4,f,RELS.CUST_PROPS));var people=["SheetJ5"];for(opts.tcid=0,rId=1;rId<=wb.SheetNames.length;++rId){var wsrels={"!id":{}},ws=wb.Sheets[wb.SheetNames[rId-1]];(ws||{})["!type"];if(zip_add_file(zip,f="xl/worksheets/sheet"+rId+"."+wbext,write_ws_xml(rId-1,opts,wb,wsrels)),ct.sheets.push(f),add_rels(opts.wbrels,-1,"worksheets/sheet"+rId+"."+wbext,RELS.WS[0]),ws){var comments=ws["!comments"],need_vml=!1,cf="";if(comments&&comments.length>0){var needtc=!1;comments.forEach((function(carr){carr[1].forEach((function(c){1==c.T&&(needtc=!0)}))})),needtc&&(zip_add_file(zip,cf="xl/threadedComments/threadedComment"+rId+"."+wbext,write_tcmnt_xml(comments,people,opts)),ct.threadedcomments.push(cf),add_rels(wsrels,-1,"../threadedComments/threadedComment"+rId+"."+wbext,RELS.TCMNT)),zip_add_file(zip,cf="xl/comments"+rId+"."+wbext,write_comments_xml(comments)),ct.comments.push(cf),add_rels(wsrels,-1,"../comments"+rId+"."+wbext,RELS.CMNT),need_vml=!0}ws["!legacy"]&&need_vml&&zip_add_file(zip,"xl/drawings/vmlDrawing"+rId+".vml",write_comments_vml(rId,ws["!comments"])),delete ws["!comments"],delete ws["!legacy"]}wsrels["!id"].rId1&&zip_add_file(zip,get_rels_path(f),write_rels(wsrels))}null!=opts.Strings&&opts.Strings.length>0&&(zip_add_file(zip,f="xl/sharedStrings."+wbext,write_sst_xml(opts.Strings,opts)),ct.strs.push(f),add_rels(opts.wbrels,-1,"sharedStrings."+wbext,RELS.SST));zip_add_file(zip,f="xl/workbook."+wbext,write_wb_xml(wb)),ct.workbooks.push(f),add_rels(opts.rels,1,f,RELS.WB),zip_add_file(zip,f="xl/theme/theme1.xml",write_theme(wb.Themes,opts)),ct.themes.push(f),add_rels(opts.wbrels,-1,"theme/theme1.xml",RELS.THEME),zip_add_file(zip,f="xl/styles."+wbext,write_sty_xml(wb,opts)),ct.styles.push(f),add_rels(opts.wbrels,-1,"styles."+wbext,RELS.STY),wb.vbaraw&&vbafmt&&(zip_add_file(zip,f="xl/vbaProject.bin",wb.vbaraw),ct.vba.push(f),add_rels(opts.wbrels,-1,"vbaProject.bin",RELS.VBA));zip_add_file(zip,f="xl/metadata."+wbext,write_xlmeta_xml()),ct.metadata.push(f),add_rels(opts.wbrels,-1,"metadata."+wbext,RELS.XLMETA),people.length>1&&(zip_add_file(zip,f="xl/persons/person.xml",function(people){var o=[XML_HEADER,writextag("personList",null,{xmlns:XMLNS_TCMNT,"xmlns:x":XMLNS_main[0]}).replace(/[\/]>/,">")];return people.forEach((function(person,idx){o.push(writextag("person",null,{displayName:person,id:"{54EE7950-7262-4200-6969-"+("000000000000"+idx).slice(-12)+"}",userId:person,providerId:"None"}))})),o.push("</personList>"),o.join("")}(people)),ct.people.push(f),add_rels(opts.wbrels,-1,"persons/person.xml",RELS.PEOPLE));return zip_add_file(zip,"[Content_Types].xml",write_ct(ct,opts)),zip_add_file(zip,"_rels/.rels",write_rels(opts.rels)),zip_add_file(zip,"xl/_rels/workbook."+wbext+".rels",write_rels(opts.wbrels)),delete opts.revssf,delete opts.ssf,zip}(wb,opts)}function write_cfb_ctr(cfb,o){switch(o.type){case"base64":case"binary":break;case"buffer":case"array":o.type="";break;case"file":return write_dl(o.file,CFB.write(cfb,{type:has_buf?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+o.bookType+"' files");default:throw new Error("Unrecognized type "+o.type)}return CFB.write(cfb,o)}function write_zip_type(wb,opts){var o=dup(opts||{});return function(z,o){var oopts={},ftype=has_buf?"nodebuffer":"undefined"!=typeof Uint8Array?"array":"string";o.compression&&(oopts.compression="DEFLATE");if(o.password)oopts.type=ftype;else switch(o.type){case"base64":oopts.type="base64";break;case"binary":oopts.type="string";break;case"string":throw new Error("'string' output type invalid for '"+o.bookType+"' files");case"buffer":case"file":oopts.type=ftype;break;default:throw new Error("Unrecognized type "+o.type)}var out=z.FullPaths?CFB.write(z,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[oopts.type]||oopts.type,compression:!!o.compression}):z.generate(oopts);if("undefined"!=typeof Deno&&"string"==typeof out){if("binary"==o.type||"base64"==o.type)return out;out=new Uint8Array(s2ab(out))}return o.password&&"undefined"!=typeof encrypt_agile?write_cfb_ctr(encrypt_agile(out,o.password),o):"file"===o.type?write_dl(o.file,out):"string"==o.type?utf8read(out):out}(write_zip(wb,o),o)}function write_string_type(out,opts,bom){bom||(bom="");var o=bom+out;switch(opts.type){case"base64":return Base64_encode(utf8write(o));case"binary":return utf8write(o);case"string":return out;case"file":return write_dl(opts.file,o,"utf8");case"buffer":return has_buf?Buffer_from(o,"utf8"):"undefined"!=typeof TextEncoder?(new TextEncoder).encode(o):write_string_type(o,{type:"binary"}).split("").map((function(c){return c.charCodeAt(0)}))}throw new Error("Unrecognized type "+opts.type)}function write_binary_type(out,opts){switch(opts.type){case"string":case"base64":case"binary":for(var bstr="",i=0;i<out.length;++i)bstr+=String.fromCharCode(out[i]);return"base64"==opts.type?Base64_encode(bstr):"string"==opts.type?utf8read(bstr):bstr;case"file":return write_dl(opts.file,out);case"buffer":return out;default:throw new Error("Unrecognized type "+opts.type)}}function writeSync(wb,opts){reset_cp(),check_wb(wb);var o=dup(opts||{});if(o.cellStyles&&(o.cellNF=!0,o.sheetStubs=!0),"array"==o.type){o.type="binary";var out=writeSync(wb,o);return o.type="array",s2ab(out)}var idx=0;if(o.sheet&&(idx="number"==typeof o.sheet?o.sheet:wb.SheetNames.indexOf(o.sheet),!wb.SheetNames[idx]))throw new Error("Sheet not found: "+o.sheet+" : "+typeof o.sheet);switch(o.bookType||"xlsb"){case"xml":case"xlml":return write_string_type(write_xlml(wb,o),o);case"slk":case"sylk":return write_string_type(SYLK.from_sheet(wb.Sheets[wb.SheetNames[idx]],o),o);case"htm":case"html":return write_string_type(sheet_to_html(wb.Sheets[wb.SheetNames[idx]],o),o);case"txt":return function(out,opts){switch(opts.type){case"base64":return Base64_encode(out);case"binary":case"string":return out;case"file":return write_dl(opts.file,out,"binary");case"buffer":return has_buf?Buffer_from(out,"binary"):out.split("").map((function(c){return c.charCodeAt(0)}))}throw new Error("Unrecognized type "+opts.type)}(sheet_to_txt(wb.Sheets[wb.SheetNames[idx]],o),o);case"csv":return write_string_type(sheet_to_csv(wb.Sheets[wb.SheetNames[idx]],o),o,"\ufeff");case"dif":return write_string_type(DIF.from_sheet(wb.Sheets[wb.SheetNames[idx]],o),o);case"dbf":return write_binary_type(DBF.from_sheet(wb.Sheets[wb.SheetNames[idx]],o),o);case"prn":return write_string_type(PRN.from_sheet(wb.Sheets[wb.SheetNames[idx]],o),o);case"rtf":return write_string_type(RTF.from_sheet(wb.Sheets[wb.SheetNames[idx]],o),o);case"eth":return write_string_type(ETH.from_sheet(wb.Sheets[wb.SheetNames[idx]],o),o);case"fods":return write_string_type(write_ods(wb,o),o);case"wk1":return write_binary_type(WK_.sheet_to_wk1(wb.Sheets[wb.SheetNames[idx]],o),o);case"wk3":return write_binary_type(WK_.book_to_wk3(wb,o),o);case"biff2":o.biff||(o.biff=2);case"biff3":o.biff||(o.biff=3);case"biff4":return o.biff||(o.biff=4),write_binary_type(write_biff_buf(wb,o),o);case"biff5":o.biff||(o.biff=5);case"biff8":case"xla":case"xls":return o.biff||(o.biff=8),function(wb,opts){var o=opts||{};return write_cfb_ctr(write_xlscfb(wb,o),o)}(wb,o);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return write_zip_type(wb,o);default:throw new Error("Unrecognized bookType |"+o.bookType+"|")}}function make_json_row(sheet,r,R,cols,header,hdr,dense,o){var rr=encode_row(R),defval=o.defval,raw=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),isempty=!0,row=1===header?[]:{};if(1!==header)if(Object.defineProperty)try{Object.defineProperty(row,"__rowNum__",{value:R,enumerable:!1})}catch(e){row.__rowNum__=R}else row.__rowNum__=R;if(!dense||sheet[R])for(var C=r.s.c;C<=r.e.c;++C){var val=dense?sheet[R][C]:sheet[cols[C]+rr];if(void 0!==val&&void 0!==val.t){var v=val.v;switch(val.t){case"z":if(null==v)break;continue;case"e":v=0==v?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+val.t)}if(null!=hdr[C]){if(null==v)if("e"==val.t&&null===v)row[hdr[C]]=null;else if(void 0!==defval)row[hdr[C]]=defval;else{if(!raw||null!==v)continue;row[hdr[C]]=null}else row[hdr[C]]=raw&&("n"!==val.t||"n"===val.t&&!1!==o.rawNumbers)?v:format_cell(val,v,o);null!=v&&(isempty=!1)}}else{if(void 0===defval)continue;null!=hdr[C]&&(row[hdr[C]]=defval)}}return{row:row,isempty:isempty}}function sheet_to_json(sheet,opts){if(null==sheet||null==sheet["!ref"])return[];var val={t:"n",v:0},header=0,offset=1,hdr=[],v=0,vv="",r={s:{r:0,c:0},e:{r:0,c:0}},o=opts||{},range=null!=o.range?o.range:sheet["!ref"];switch(1===o.header?header=1:"A"===o.header?header=2:Array.isArray(o.header)?header=3:null==o.header&&(header=0),typeof range){case"string":r=safe_decode_range(range);break;case"number":(r=safe_decode_range(sheet["!ref"])).s.r=range;break;default:r=range}header>0&&(offset=0);var rr=encode_row(r.s.r),cols=[],out=[],outi=0,counter=0,dense=Array.isArray(sheet),R=r.s.r,C=0,header_cnt={};dense&&!sheet[R]&&(sheet[R]=[]);var colinfo=o.skipHidden&&sheet["!cols"]||[],rowinfo=o.skipHidden&&sheet["!rows"]||[];for(C=r.s.c;C<=r.e.c;++C)if(!(colinfo[C]||{}).hidden)switch(cols[C]=encode_col(C),val=dense?sheet[R][C]:sheet[cols[C]+rr],header){case 1:hdr[C]=C-r.s.c;break;case 2:hdr[C]=cols[C];break;case 3:hdr[C]=o.header[C-r.s.c];break;default:if(null==val&&(val={w:"__EMPTY",t:"s"}),vv=v=format_cell(val,null,o),counter=header_cnt[v]||0){do{vv=v+"_"+counter++}while(header_cnt[vv]);header_cnt[v]=counter,header_cnt[vv]=1}else header_cnt[v]=1;hdr[C]=vv}for(R=r.s.r+offset;R<=r.e.r;++R)if(!(rowinfo[R]||{}).hidden){var row=make_json_row(sheet,r,R,cols,header,hdr,dense,o);(!1===row.isempty||(1===header?!1!==o.blankrows:o.blankrows))&&(out[outi++]=row.row)}return out.length=outi,out}var qreg=/"/g;function make_csv_row(sheet,r,R,cols,fs,rs,FS,o){for(var isempty=!0,row=[],txt="",rr=encode_row(R),C=r.s.c;C<=r.e.c;++C)if(cols[C]){var val=o.dense?(sheet[R]||[])[C]:sheet[cols[C]+rr];if(null==val)txt="";else if(null!=val.v){isempty=!1,txt=""+(o.rawNumbers&&"n"==val.t?val.v:format_cell(val,null,o));for(var i=0,cc=0;i!==txt.length;++i)if((cc=txt.charCodeAt(i))===fs||cc===rs||34===cc||o.forceQuotes){txt='"'+txt.replace(qreg,'""')+'"';break}"ID"==txt&&(txt='"ID"')}else null==val.f||val.F?txt="":(isempty=!1,(txt="="+val.f).indexOf(",")>=0&&(txt='"'+txt.replace(qreg,'""')+'"'));row.push(txt)}return!1===o.blankrows&&isempty?null:row.join(FS)}function sheet_to_csv(sheet,opts){var out=[],o=null==opts?{}:opts;if(null==sheet||null==sheet["!ref"])return"";var r=safe_decode_range(sheet["!ref"]),FS=void 0!==o.FS?o.FS:",",fs=FS.charCodeAt(0),RS=void 0!==o.RS?o.RS:"\n",rs=RS.charCodeAt(0),endregex=new RegExp(("|"==FS?"\\|":FS)+"+$"),row="",cols=[];o.dense=Array.isArray(sheet);for(var colinfo=o.skipHidden&&sheet["!cols"]||[],rowinfo=o.skipHidden&&sheet["!rows"]||[],C=r.s.c;C<=r.e.c;++C)(colinfo[C]||{}).hidden||(cols[C]=encode_col(C));for(var w=0,R=r.s.r;R<=r.e.r;++R)(rowinfo[R]||{}).hidden||null!=(row=make_csv_row(sheet,r,R,cols,fs,rs,FS,o))&&(o.strip&&(row=row.replace(endregex,"")),(row||!1!==o.blankrows)&&out.push((w++?RS:"")+row));return delete o.dense,out.join("")}function sheet_to_txt(sheet,opts){return opts||(opts={}),opts.FS="\t",opts.RS="\n",sheet_to_csv(sheet,opts)}function sheet_add_json(_ws,js,opts){var cell,o=opts||{},offset=+!o.skipHeader,ws=_ws||{},_R=0,_C=0;if(ws&&null!=o.origin)if("number"==typeof o.origin)_R=o.origin;else{var _origin="string"==typeof o.origin?decode_cell(o.origin):o.origin;_R=_origin.r,_C=_origin.c}var range={s:{c:0,r:0},e:{c:_C,r:_R+js.length-1+offset}};if(ws["!ref"]){var _range=safe_decode_range(ws["!ref"]);range.e.c=Math.max(range.e.c,_range.e.c),range.e.r=Math.max(range.e.r,_range.e.r),-1==_R&&(_R=_range.e.r+1,range.e.r=_R+js.length-1+offset)}else-1==_R&&(_R=0,range.e.r=js.length-1+offset);var hdr=o.header||[],C=0;js.forEach((function(JS,R){keys(JS).forEach((function(k){-1==(C=hdr.indexOf(k))&&(hdr[C=hdr.length]=k);var v=JS[k],t="z",z="",ref=encode_cell({c:_C+C,r:_R+R+offset});cell=ws_get_cell_stub(ws,ref),!v||"object"!=typeof v||v instanceof Date?("number"==typeof v?t="n":"boolean"==typeof v?t="b":"string"==typeof v?t="s":v instanceof Date?(t="d",o.cellDates||(t="n",v=datenum(v)),z=o.dateNF||table_fmt[14]):null===v&&o.nullError&&(t="e",v=0),cell?(cell.t=t,cell.v=v,delete cell.w,delete cell.R,z&&(cell.z=z)):ws[ref]=cell={t:t,v:v},z&&(cell.z=z)):ws[ref]=v}))})),range.e.c=Math.max(range.e.c,_C+hdr.length-1);var __R=encode_row(_R);if(offset)for(C=0;C<hdr.length;++C)ws[encode_col(C+_C)+__R]={t:"s",v:hdr[C]};return ws["!ref"]=encode_range(range),ws}function ws_get_cell_stub(ws,R,C){if("string"==typeof R){if(Array.isArray(ws)){var RC=decode_cell(R);return ws[RC.r]||(ws[RC.r]=[]),ws[RC.r][RC.c]||(ws[RC.r][RC.c]={t:"z"})}return ws[R]||(ws[R]={t:"z"})}return ws_get_cell_stub(ws,encode_cell("number"!=typeof R?R:{r:R,c:C||0}))}function cell_set_hyperlink(cell,target,tooltip){return target?(cell.l={Target:target},tooltip&&(cell.l.Tooltip=tooltip)):delete cell.l,cell}var utils={encode_col:encode_col,encode_row:encode_row,encode_cell:encode_cell,encode_range:encode_range,decode_col:decode_col,decode_row:decode_row,split_cell:function(cstr){return cstr.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")},decode_cell:decode_cell,decode_range:decode_range,format_cell:format_cell,sheet_add_aoa:sheet_add_aoa,sheet_add_json:sheet_add_json,sheet_add_dom:sheet_add_dom,aoa_to_sheet:aoa_to_sheet,json_to_sheet:function(js,opts){return sheet_add_json(null,js,opts)},table_to_sheet:parse_dom_table,table_to_book:function(table,opts){return sheet_to_workbook(parse_dom_table(table,opts),opts)},sheet_to_csv:sheet_to_csv,sheet_to_txt:sheet_to_txt,sheet_to_json:sheet_to_json,sheet_to_html:sheet_to_html,sheet_to_formulae:function(sheet){var x,y="",val="";if(null==sheet||null==sheet["!ref"])return[];var C,r=safe_decode_range(sheet["!ref"]),rr="",cols=[],cmds=[],dense=Array.isArray(sheet);for(C=r.s.c;C<=r.e.c;++C)cols[C]=encode_col(C);for(var R=r.s.r;R<=r.e.r;++R)for(rr=encode_row(R),C=r.s.c;C<=r.e.c;++C)if(y=cols[C]+rr,val="",void 0!==(x=dense?(sheet[R]||[])[C]:sheet[y])){if(null!=x.F){if(y=x.F,!x.f)continue;val=x.f,-1==y.indexOf(":")&&(y=y+":"+y)}if(null!=x.f)val=x.f;else{if("z"==x.t)continue;if("n"==x.t&&null!=x.v)val=""+x.v;else if("b"==x.t)val=x.v?"TRUE":"FALSE";else if(void 0!==x.w)val="'"+x.w;else{if(void 0===x.v)continue;val="s"==x.t?"'"+x.v:""+x.v}}cmds[cmds.length]=y+"="+val}return cmds},sheet_to_row_object_array:sheet_to_json,sheet_get_cell:ws_get_cell_stub,book_new:function(){return{SheetNames:[],Sheets:{}}},book_append_sheet:function(wb,ws,name,roll){var i=1;if(!name)for(;i<=65535&&-1!=wb.SheetNames.indexOf(name="Sheet"+i);++i,name=void 0);if(!name||wb.SheetNames.length>=65535)throw new Error("Too many worksheets");if(roll&&wb.SheetNames.indexOf(name)>=0){var m=name.match(/(^.*?)(\d+)$/);i=m&&+m[2]||0;var root=m&&m[1]||name;for(++i;i<=65535&&-1!=wb.SheetNames.indexOf(name=root+i);++i);}if(check_ws_name(name),wb.SheetNames.indexOf(name)>=0)throw new Error("Worksheet with name |"+name+"| already exists!");return wb.SheetNames.push(name),wb.Sheets[name]=ws,name},book_set_sheet_visibility:function(wb,sh,vis){wb.Workbook||(wb.Workbook={}),wb.Workbook.Sheets||(wb.Workbook.Sheets=[]);var idx=function(wb,sh){if("number"==typeof sh){if(sh>=0&&wb.SheetNames.length>sh)return sh;throw new Error("Cannot find sheet # "+sh)}if("string"==typeof sh){var idx=wb.SheetNames.indexOf(sh);if(idx>-1)return idx;throw new Error("Cannot find sheet name |"+sh+"|")}throw new Error("Cannot find sheet |"+sh+"|")}(wb,sh);switch(wb.Workbook.Sheets[idx]||(wb.Workbook.Sheets[idx]={}),vis){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+vis)}wb.Workbook.Sheets[idx].Hidden=vis},cell_set_number_format:function(cell,fmt){return cell.z=fmt,cell},cell_set_hyperlink:cell_set_hyperlink,cell_set_internal_link:function(cell,range,tooltip){return cell_set_hyperlink(cell,"#"+range,tooltip)},cell_add_comment:function(cell,text,author){cell.c||(cell.c=[]),cell.c.push({t:text,a:author||"SheetJS"})},sheet_set_array_formula:function(ws,range,formula,dynamic){for(var rng="string"!=typeof range?range:safe_decode_range(range),rngstr="string"==typeof range?range:encode_range(range),R=rng.s.r;R<=rng.e.r;++R)for(var C=rng.s.c;C<=rng.e.c;++C){var cell=ws_get_cell_stub(ws,R,C);cell.t="n",cell.F=rngstr,delete cell.v,R==rng.s.r&&C==rng.s.c&&(cell.f=formula,dynamic&&(cell.D=!0))}return ws},consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}},FileSaver_min={exports:{}};!function(module){!function(){function b(a,b){return void 0===b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\ufeff",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error("could not download file")},d.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof commonjsGlobal&&commonjsGlobal.global===commonjsGlobal?commonjsGlobal:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout((function(){i.revokeObjectURL(j.href)}),4e4),setTimeout((function(){e(j)}),0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout((function(){e(i)}))}}:function(b,d,e,g){if((g=g||open("","_blank"))&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout((function(){l.revokeObjectURL(m)}),4e4)}});f.saveAs=g.saveAs=g,module.exports=g}()}(FileSaver_min);var FileSaver_minExports=FileSaver_min.exports,Panel=acud.Collapse.Panel,CheckboxGroup=acud.Checkbox.Group,controls=function(props,_$1,customFunctions){var _a=props||{},actions=_a.actions,_b=_a.attributeInfo,attributeInfo=void 0===_b?{}:_b,attributeOptions=_a.attributeOptions,isGroup=_a.isGroup,groupAttributeInfo=_a.groupAttributeInfo,selectMode=_a.selectMode,canExportAll=!!(null==actions?void 0:actions.exportAll),indeterminate=attributeInfo.indeterminate,checkAll=attributeInfo.checkAll,checkedList=attributeInfo.checkedList,keyList=_.keys(groupAttributeInfo);return __spreadArray([{type:"radio",name:"type",label:"导出方式",defaultValue:canExportAll?"all":"show",config:{options:__spreadArray(__spreadArray([],__read(canExportAll?[{label:"全量导出",value:"all"}]:[]),!1),[{label:"none"===selectMode?"当前显示数据":"已选中数据",value:"show"}],!1)},rules:[{required:!0,message:"请选择导导出模式"}]},{type:"radio",name:"way",label:"导出字段",defaultValue:"all",config:{options:[{label:"全部导出",value:"all"},{label:"自定义导出",value:"custom"}]},rules:[{required:!0,message:"请选择导导出模式"}],onDisplay:[{name:"type",content:[{exp:"===",value:"show"}]}]}],__read(isGroup?[{type:"custom",name:"attributes",label:"导出字段",content:React.createElement(acud.Collapse,{defaultActiveKey:keyList},keyList.map((function(key){var info=groupAttributeInfo[key];return React.createElement(Panel,{key:key,header:React.createElement(acud.Checkbox,{indeterminate:info.indeterminate,checked:info.checkAll,onChange:function(e){return customFunctions.onCheckAllChangeGruop(key,e.target.checked)}},key)},React.createElement(acud.Checkbox,{className:"attributes-checkall",indeterminate:info.indeterminate,checked:info.checkAll,onChange:function(e){return customFunctions.onCheckAllChangeGruop(key,e.target.checked)}},key),React.createElement(CheckboxGroup,{options:info.options,value:info.checkedList,onChange:function(list){return customFunctions.onChangeGroup(key,list)}}))}))),rules:[{validator:customFunctions.checkAttributes}],onDisplay:[{name:"way",content:[{exp:"===",value:"custom"}]}]}]:[{type:"custom",name:"attributes",label:"导出字段",content:React.createElement("div",{className:"download-form-attributes"},React.createElement(acud.Checkbox,{indeterminate:indeterminate,onChange:customFunctions.onCheckAllChangeAttributes,checked:checkAll,style:{marginRight:16}},"全选"),React.createElement(CheckboxGroup,{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:4},options:attributeOptions,value:checkedList,onChange:customFunctions.onChangeAttributes})),rules:[{validator:customFunctions.checkAttributes}],onDisplay:[{name:"way",content:[{exp:"===",value:"custom"}]}]}]),!1)},DownloadForm=React.forwardRef((function(props,ref){var _a,_b,_c,payload=props.payload,actions=payload.actions,tableInfo=payload.options,dataSource=payload.dataSource,selectMode=payload.selectMode,fileName=payload.fileName,reload=payload.reload,hideDialog=payload.hideDialog,attributeOptions=((null===(_a=null==tableInfo?void 0:tableInfo.tableConfig)||void 0===_a?void 0:_a.columns)||[]).map((function(item){return{label:item.title,value:item.dataIndex}})),_d=__read(React.useState({indeterminate:!1,checkAll:!0,checkedList:attributeOptions.map((function(a){return a.value}))}),2),attributeInfo=_d[0],setAttributeInfo=_d[1],onCheckAllChangeAttributes=React.useCallback((function(e){setAttributeInfo({indeterminate:!1,checkAll:e.target.checked,checkedList:e.target.checked?attributeOptions.map((function(a){return a.value})):[]})}),[attributeOptions]),onChangeAttributes=React.useCallback((function(list){setAttributeInfo({indeterminate:!!list.length&&list.length<attributeOptions.length,checkAll:list.length===attributeOptions.length,checkedList:list})}),[attributeOptions]),isGroup=((null===(_b=null==tableInfo?void 0:tableInfo.tableConfig)||void 0===_b?void 0:_b.columns)||[]).some((function(item){return!!item.groupName})),groupAttributeMap=((null===(_c=null==tableInfo?void 0:tableInfo.tableConfig)||void 0===_c?void 0:_c.columns)||[]).reduce((function(map,item){return item.groupName?(map[item.groupName]||(map[item.groupName]={indeterminate:!1,checkAll:!0,checkedList:[],options:[]}),map[item.groupName].options=_.sortBy(__spreadArray(__spreadArray([],__read(map[item.groupName].options),!1),[__assign({label:item.title,value:item.dataIndex},item)],!1),["sortIndex"]),map[item.groupName].checkedList.push(item.dataIndex),map):map}),{}),_e=__read(React.useState(groupAttributeMap),2),groupAttributeInfo=_e[0],setGroupAttributeInfo=_e[1],onCheckAllChangeGruop=React.useCallback((function(key,checked){var groupMap=_.cloneDeep(groupAttributeInfo);groupMap[key].checkAll=checked,groupMap[key].checkedList=checked?groupMap[key].options.map((function(opt){return opt.value})):[],groupMap[key].indeterminate=!1,setGroupAttributeInfo(groupMap)}),[groupAttributeInfo]),onChangeGroup=React.useCallback((function(key,list){var groupMap=_.cloneDeep(groupAttributeInfo);groupMap[key].checkAll=list.length===groupMap[key].options.length,groupMap[key].checkedList=list,groupMap[key].indeterminate=!!list.length&&list.length<groupMap[key].options.length,setGroupAttributeInfo(groupMap)}),[groupAttributeInfo]),downloadExcel=function(data,fileName,headers){if(headers){var wb=utils.book_new(),headerKey_1="",header_1=[],headerGroup_1=headers.reduce((function(acc,curr){return 0===acc.length?(acc.push(curr.groupName),headerKey_1=curr.groupName):headerKey_1===curr.groupName?acc.push(""):headerKey_1!==curr.groupName&&(acc.push(curr.groupName),headerKey_1=curr.groupName),header_1.push(curr.label),acc}),[]),tableData=__spreadArray([headerGroup_1,header_1],__read(data.map((function(item){return header_1.map((function(h){return(null==item?void 0:item[h])||""}))}))),!1);(ws=utils.aoa_to_sheet(tableData))["!merges"]=headerGroup_1.reduce((function(merges,groupName,colIndex){if(groupName&&""!==groupName){for(var endCol=colIndex;endCol+1<headerGroup_1.length&&""===headerGroup_1[endCol+1];)endCol++;endCol>colIndex&&merges.push({s:{r:0,c:colIndex},e:{r:0,c:endCol}})}return merges}),[]),utils.book_append_sheet(wb,ws,"Sheet1"),function(wb,filename,opts){var o=opts||{};o.type="file",o.file=filename,function(o){if(!o.bookType){var ext=o.file.slice(o.file.lastIndexOf(".")).toLowerCase();ext.match(/^\.[a-z]+$/)&&(o.bookType=ext.slice(1)),o.bookType={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"}[o.bookType]||o.bookType}}(o),writeSync(wb,o)}(wb,"".concat(fileName,".xlsx"))}else{var ws=utils.json_to_sheet(data);wb=utils.book_new();utils.book_append_sheet(wb,ws,"Sheet1");var excelBuffer=writeSync(wb,{bookType:"xlsx",type:"array"}),blob=new Blob([excelBuffer],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});FileSaver_minExports.saveAs(blob,"".concat(fileName,".xlsx"))}},actionConfig=React.useMemo((function(){return{submitAction:{submitFormAction:"downloadNetwork",$onSubmitRequest:function(_a){var type=_a.type,way=_a.way,attributes=_a.attributes;return __awaiter(this,void 0,void 0,(function(){var headers,data;return __generator(this,(function(_b){switch(_b.label){case 0:return headers=[],"show"!==type?[3,4]:"all"!==way?[3,1]:(headers=isGroup?Object.entries(groupAttributeInfo).flatMap((function(_a){var _b=__read(_a,2),groupName=_b[0];return _b[1].options.map((function(opt){return{label:opt.label,key:opt.value,groupName:groupName}}))})):attributeOptions.map((function(opt){return{label:opt.label,key:opt.value,groupName:""}})),[3,3]);case 1:return"custom"!==way?[3,3]:[4,form.validateFields()];case 2:_b.sent(),headers=isGroup?Object.entries(groupAttributeInfo).flatMap((function(_a){var _b=__read(_a,2),groupName=_b[0],group=_b[1];return group.options.filter((function(opt){return group.checkedList.includes(opt.value)})).map((function(opt){return{label:opt.label,key:opt.value,groupName:groupName}}))})):attributeOptions.filter((function(a){return attributeInfo.checkedList.includes(a.value)})).map((function(opt){return{label:opt.label,key:opt.value,groupName:""}})),_b.label=3;case 3:throw data=dataSource.map((function(item){return headers.reduce((function(obj,header){return obj[header.label]=item[header.key],obj}),{})})),isGroup?downloadExcel(data,fileName,headers):downloadExcel(data,fileName),hideDialog(),new Error("");case 4:if("all"===type)throw actions.exportAll&&actions.exportAll(),new Error("");_b.label=5;case 5:return[2,{type:type,way:way,attributes:attributes}]}}))}))},$onSubmitResponse:function(res){if("application/json"===res.type)throw acud.toast.error({message:"导出失败",duration:5}),Error("导出失败");!function(info,fileName){__awaiter(void 0,void 0,void 0,(function(){var link,blob;return __generator(this,(function(_a){return link=document.createElement("a"),blob=new Blob([info],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),link.style.display="none",link.href=URL.createObjectURL(blob),link.download="".concat(fileName,".xlsx"),document.body.appendChild(link),link.click(),document.body.removeChild(link),[2]}))}))}(res,fileName),reload(),hideDialog()},$onSubmitError:function(err){console.log(err,"err")},$toastSuccessMessage:"导出成功"}}}),[ref,reload,hideDialog,fileName,attributeInfo,attributeOptions,dataSource,isGroup,actions,groupAttributeInfo]),handleAttributesValidate=React.useCallback(_.debounce((function(_$1,callback){if(form){var type=form.getFieldValue("type"),way=form.getFieldValue("way");if(isGroup){var checkedList=_.values(groupAttributeInfo).reduce((function(acc,group){return acc.concat(group.checkedList)}),[]);if("custom"===way&&0===checkedList.length)return callback("自定义导出, 请至少选择一个导出项"),void acud.toast.error({message:"自定义导出, 请至少选择一个导出项",duration:5})}else if("show"===type&&"custom"===way&&0===attributeInfo.checkedList.length)return callback("自定义导出, 请至少选择一个导出项"),void acud.toast.error({message:"自定义导出, 请至少选择一个导出项",duration:5})}callback()}),500),[attributeInfo,isGroup,groupAttributeInfo]),checkAttributes=React.useCallback((function(_,value,callback){handleAttributesValidate(value,callback)}),[handleAttributesValidate]),customFunctions=React.useMemo((function(){return{checkAttributes:checkAttributes,onCheckAllChangeAttributes:onCheckAllChangeAttributes,onChangeAttributes:onChangeAttributes,onCheckAllChangeGruop:onCheckAllChangeGruop,onChangeGroup:onChangeGroup}}),[checkAttributes,onCheckAllChangeAttributes,onChangeAttributes,onCheckAllChangeGruop,onChangeGroup]),options=React.useMemo((function(){return{controls:controls,formItemOption:{noStyle:!0},actionConfig:actionConfig,customFunctions:customFunctions}}),[actionConfig,customFunctions]),_f=useForm(ref,{actions:actions,attributeInfo:attributeInfo,attributeOptions:attributeOptions,isGroup:isGroup,groupAttributeInfo:groupAttributeInfo,selectMode:selectMode},options),form=_f.form,formProps=_f.formProps;return React.createElement(HooksForm,__assign({className:"acud-download-form"},formProps,{form:form}))})),DEFAULT_PAGESIZE_OPTIONS=["10","20","50","100"],DEFAULT_PAGE_PARAMS=["pageNo","pageSize"],DEFAULT_QUERY_PARAMS=__spreadArray(__spreadArray([],__read(DEFAULT_PAGE_PARAMS),!1),["orderBy","order"],!1),rc=tmp__namespace,TABLE_ORDER_MAP=new Enum({alias:"ascend",value:"asc"},{alias:"descend",value:"desc"}),tableData=[],USER_TYPINGS_INCREASE="increase",USER_TYPINGS_DECREASE="decrease";function useLatest(value){var ref=React.useRef(value);return ref.current=value,ref}function useUnmount(fn){var fnRef=useLatest(fn);React.useEffect((function(){return function(){fnRef.current()}}),[])}var raf=null;var caf=null;function createElement(tagName,props){void 0===props&&(props={});var elem=document.createElement(tagName);return Object.keys(props).forEach((function(key){elem[key]=props[key]})),elem}function getComputedStyle$1(elem,prop,pseudo){return(window.getComputedStyle(elem,pseudo||null)||{display:"none"})[prop]}function getRenderInfo(elem){if(!document.documentElement.contains(elem))return{detached:!0,rendered:!1};for(var current=elem;current!==document;){if("none"===getComputedStyle$1(current,"display"))return{detached:!1,rendered:!1};current=current.parentNode}return{detached:!1,rendered:!0}}var total=0,style=null;function addListener(elem,callback){if(elem.__resize_mutation_handler__||(elem.__resize_mutation_handler__=handleMutation.bind(elem)),!elem.__resize_listeners__)if(elem.__resize_listeners__=[],window.ResizeObserver){var offsetWidth=elem.offsetWidth,offsetHeight=elem.offsetHeight,ro=new ResizeObserver((function(){(elem.__resize_observer_triggered__||(elem.__resize_observer_triggered__=!0,elem.offsetWidth!==offsetWidth||elem.offsetHeight!==offsetHeight))&&runCallbacks(elem)})),ref=getRenderInfo(elem),detached=ref.detached,rendered=ref.rendered;elem.__resize_observer_triggered__=!1===detached&&!1===rendered,elem.__resize_observer__=ro,ro.observe(elem)}else if(elem.attachEvent&&elem.addEventListener)elem.__resize_legacy_resize_handler__=function(){runCallbacks(elem)},elem.attachEvent("onresize",elem.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",elem.__resize_mutation_handler__);else if(total||(style=function(styleText){var style=document.createElement("style");return style.styleSheet?style.styleSheet.cssText=styleText:style.appendChild(document.createTextNode(styleText)),(document.querySelector("head")||document.body).appendChild(style),style}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(elem){var position=getComputedStyle$1(elem,"position");position&&"static"!==position||(elem.style.position="relative");elem.__resize_old_position__=position,elem.__resize_last__={};var triggers=createElement("div",{className:"resize-triggers"}),expand=createElement("div",{className:"resize-expand-trigger"}),expandChild=createElement("div"),contract=createElement("div",{className:"resize-contract-trigger"});expand.appendChild(expandChild),triggers.appendChild(expand),triggers.appendChild(contract),elem.appendChild(triggers),elem.__resize_triggers__={triggers:triggers,expand:expand,expandChild:expandChild,contract:contract},resetTriggers(elem),elem.addEventListener("scroll",handleScroll,!0),elem.__resize_last__={width:elem.offsetWidth,height:elem.offsetHeight}}(elem),elem.__resize_rendered__=getRenderInfo(elem).rendered,window.MutationObserver){var mo=new MutationObserver(elem.__resize_mutation_handler__);mo.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),elem.__resize_mutation_observer__=mo}elem.__resize_listeners__.push(callback),total++}function handleMutation(){var ref=getRenderInfo(this),rendered=ref.rendered,detached=ref.detached;rendered!==this.__resize_rendered__&&(!detached&&this.__resize_triggers__&&(resetTriggers(this),this.addEventListener("scroll",handleScroll,!0)),this.__resize_rendered__=rendered,runCallbacks(this))}function handleScroll(){var id,callback,this$1$1=this;resetTriggers(this),this.__resize_raf__&&(id=this.__resize_raf__,caf||(caf=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(id){clearTimeout(id)}).bind(window)),caf(id)),this.__resize_raf__=(callback=function(){var elem,ref,width,height,offsetWidth,offsetHeight,updated=(ref=(elem=this$1$1).__resize_last__,width=ref.width,height=ref.height,offsetWidth=elem.offsetWidth,offsetHeight=elem.offsetHeight,offsetWidth!==width||offsetHeight!==height?{width:offsetWidth,height:offsetHeight}:null);updated&&(this$1$1.__resize_last__=updated,runCallbacks(this$1$1))},raf||(raf=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(callback){return setTimeout(callback,16)}).bind(window)),raf(callback))}function runCallbacks(elem){elem&&elem.__resize_listeners__&&elem.__resize_listeners__.forEach((function(callback){callback.call(elem,elem)}))}function resetTriggers(elem){var ref=elem.__resize_triggers__,expand=ref.expand,expandChild=ref.expandChild,contract=ref.contract,csw=contract.scrollWidth,csh=contract.scrollHeight,eow=expand.offsetWidth,eoh=expand.offsetHeight,esw=expand.scrollWidth,esh=expand.scrollHeight;contract.scrollLeft=csw,contract.scrollTop=csh,expandChild.style.width=eow+1+"px",expandChild.style.height=eoh+1+"px",expand.scrollLeft=esw,expand.scrollTop=esh}var DEFAULT_CONSTRAINTS={video:!0,audio:!0},adapterGetUserMedia=function(constraints){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices.getUserMedia(constraints);var getUserMedia=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;if(getUserMedia)return new Promise((function(resolve,reject){getUserMedia.call(navigator,constraints,resolve,reject)}));var error=new Error("getUserMedia is not implemented in this browser");return error.code="ERR_METHOD_NOT_IMPLEMENTED",Promise.reject(error)};exports.Ajax=Ajax,exports.BulkArea=BulkArea,exports.CHART_COLOR=CHART_COLOR,exports.CHART_DATA_ZOOM={type:"slider",height:8,handleSize:"100%",moveHandleSize:0,backgroundColor:"#F2F2F3",borderRadius:0,borderColor:"#F2F2F3",fillerColor:"#D3E0FC",handleIcon:"image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAACNJREFUGJVjVMn49J+BCMBEjCIMhben82Jlk28iVRQyUt3XAJ4OCAdE/x0HAAAAAElFTkSuQmCC",dataBackground:{areaStyle:{opacity:0},lineStyle:{opacity:0}},selectedDataBackground:{areaStyle:{opacity:0},lineStyle:{opacity:0}},emphasis:{handleStyle:{shadowColor:"#2468F2",shadowBlur:8}}},exports.Chart=function(props){var containerWidth=props.containerWidth,containerHeight=props.containerHeight,chartWidth=props.chartWidth,chartHeight=props.chartHeight,option=props.option,chartRef=React.useRef(null),chartInsRef=React.useRef(null);React.useEffect((function(){if(chartInsRef.current)void 0===chartWidth&&void 0===chartHeight||chartInsRef.current.resize({width:chartWidth,height:chartHeight});else{var opt={locale:"ZH"};chartWidth&&(opt.width=chartWidth),chartHeight&&(opt.height=chartHeight);var chart=init$1(chartRef.current,null,opt);if(chartInsRef.current=chart,void 0===chartWidth&&void 0===chartHeight){var resizeObserver_1=new ResizeObserver((function(){chartInsRef.current.resize()}));return resizeObserver_1.observe(chartRef.current),function(){resizeObserver_1.disconnect()}}}}),[chartWidth,chartHeight]);var containerStyle=React.useMemo((function(){var cStyle=null;return containerWidth?(cStyle={width:containerWidth},containerHeight&&(cStyle.height=containerHeight)):containerHeight&&(cStyle={height:containerHeight}),cStyle}),[containerWidth,containerHeight]);return React.useEffect((function(){var _a;null===(_a=null==chartInsRef?void 0:chartInsRef.current)||void 0===_a||_a.setOption(option,!0)}),[option]),React.createElement("div",{className:"".concat(CHART_PREFIX$4,"-box")},React.createElement("div",{ref:chartRef,className:"".concat(CHART_PREFIX$4,"-box-content"),style:containerStyle}))},exports.ChartBar=ChartBar,exports.ChartLine=ChartLine,exports.ChartPie=function(props){var containerWidth=props.containerWidth,containerHeight=props.containerHeight,chartWidth=props.chartWidth,chartHeight=props.chartHeight,option=props.option,_a=props.customLegend,customLegend=void 0!==_a&&_a,_b=props.emptyData,emptyData=void 0!==_b&&_b,chartRef=React.useRef(null),chartInsRef=React.useRef(null),_c=__read(React.useState(),2),mergedOption=_c[0],setMergedOption=_c[1],_d=__read(React.useState({}),2),legendSelected=_d[0],setLegendSelected=_d[1],_e=__read(React.useState({}),2),colorMap=_e[0],setColorMap=_e[1],colSpan=React.useMemo((function(){if(!1===customLegend||!0===customLegend)return 24;var colNum=null==customLegend?void 0:customLegend.colNum;return"number"!=typeof colNum?24:Math.round(24/colNum)}),[customLegend]);React.useEffect((function(){if(option){var mergedOption={};if(option&&(_.merge(mergedOption,DEFAULT_OPTION$2,option),mergedOption.series=mergedOption.series.map((function(s){return _.merge({},DEFAULT_OPTION_SERIES$2,s)}))),!1!==customLegend){for(var legendSelectedTemp={},colorMapTemp={},seriesData=mergedOption.series[0].data,i=0,len=seriesData.length;i<len;i++){var element=seriesData[i];legendSelectedTemp[element.name]=!0,element.itemStyle=element.itemStyle||{},element.itemStyle.color=CHART_COLOR[i%CHART_COLOR.length],colorMapTemp[element.name]=CHART_COLOR[i%CHART_COLOR.length]}setLegendSelected(legendSelectedTemp),setColorMap(colorMapTemp),mergedOption.legend.show=!1,mergedOption.selected=legendSelectedTemp}setMergedOption(mergedOption)}}),[option,customLegend]),React.useEffect((function(){if(chartInsRef.current)void 0===chartWidth&&void 0===chartHeight||chartInsRef.current.resize({width:chartWidth,height:chartHeight});else{var opt={locale:"ZH"};chartWidth&&(opt.width=chartWidth),chartHeight&&(opt.height=chartHeight);var chart=init$1(chartRef.current,null,opt);if(chartInsRef.current=chart,void 0===chartWidth&&void 0===chartHeight){var resizeObserver_1=new ResizeObserver((function(){chartInsRef.current.resize()}));return resizeObserver_1.observe(chartRef.current),function(){resizeObserver_1.disconnect()}}}}),[chartWidth,chartHeight]),React.useEffect((function(){var _a;if(mergedOption){var fOption=__assign({},mergedOption);legendSelected&&(fOption.legend.selected=legendSelected),null===(_a=null==chartInsRef?void 0:chartInsRef.current)||void 0===_a||_a.setOption(fOption,!0)}}),[mergedOption,legendSelected]);var containerStyle=React.useMemo((function(){var cStyle=null;return containerWidth?(cStyle={width:containerWidth},containerHeight&&(cStyle.height=containerHeight)):containerHeight&&(cStyle={height:containerHeight}),cStyle}),[containerWidth,containerHeight]),emptyCom=React.useMemo((function(){if(emptyData){if(!0===emptyData)return React.createElement("div",{className:"".concat(CHART_PREFIX$2,"-empty-box")},React.createElement(acud.Empty,{image:React.createElement(ChartPieEmpty,{width:72,height:72})}));var icon=emptyData.icon,extra=emptyData.extra;return React.createElement("div",{className:"".concat(CHART_PREFIX$2,"-empty-box")},React.createElement(acud.Empty,{image:icon||React.createElement(ChartPieEmpty,{width:72,height:72}),description:extra||"暂无数据"}))}return null}),[emptyData]);return React.createElement("div",{className:"".concat(CHART_PREFIX$2,"-box")},emptyCom,React.createElement("div",{ref:chartRef,className:"".concat(CHART_PREFIX$2,"-box-content"),style:containerStyle}),customLegend&&React.createElement(acud.Row,{align:"top",justify:"start",className:"".concat(CHART_PREFIX$2,"-legend-container")},Object.entries(legendSelected).map((function(_a){var _b,_c=__read(_a,2),legendItem=_c[0],value=_c[1];return React.createElement(acud.Col,{span:colSpan,className:"".concat(CHART_PREFIX$2,"-legend-item"),onClick:function(){return function(legendItem,value){var legendSelectedTemp=__assign({},legendSelected);legendSelectedTemp[legendItem]=!value,setLegendSelected(legendSelectedTemp)}(legendItem,value)},key:legendItem},React.createElement("div",{className:"".concat(CHART_PREFIX$2,"-legend-tag"),style:{backgroundColor:colorMap[legendItem]}}),React.createElement("div",{className:classNames("".concat(CHART_PREFIX$2,"-legend-name"),(_b={},_b["".concat(CHART_PREFIX$2,"-legend-name-disabled")]=!1===value,_b))},legendItem))}))))},exports.ChartScatter=ChartScatter,exports.ConfigProvider=function(props){var children=props.children,_a=props.prefixCls,prefixCls=void 0===_a?"acud-pro":_a,locale=props.locale,childNode=children,config={prefixCls:prefixCls,table:props.table,form:props.form};return locale&&(childNode=React.createElement(LocaleContext.Provider,{value:__assign(__assign({},locale),{exist:!0})},children)),React.createElement(ConfigContext.Provider,{value:config},childNode)},exports.DuFormItem=DuFormItem,exports.EmptyStatus=EmptyStatus,exports.Enum=Enum,exports.ErrorBoundary=ErrorBoundary,exports.FileUpload=FileUpload,exports.FilterArea=FilterArea,exports.FormPro=FormPro,exports.GridViews=GridViews,exports.HooksForm=HooksForm,exports.HooksList=function(props){var className=props.className,title=props.title,withToolbar=props.withToolbar,bulkPosition=props.bulkPosition,filterPosition=props.filterPosition,bulkProps=props.bulkProps,filterProps=props.filterProps,tableType=props.tableType,tableProps=props.tableProps,tableComp=props.tableComp,paginationProps=props.paginationProps,dialogProps=props.dialogProps,confirmProps=props.confirmProps,_a=props.customRender,customRender=void 0===_a?{}:_a,listPageCls=classNames(className,CLS_PREFIX$6),Dialog=dialogProps.Dialog,dialogOpen=dialogProps.dialogOpen,onDialogCancel=dialogProps.onDialogCancel,onDialogSuccess=dialogProps.onDialogSuccess,Confirm=confirmProps.Confirm,originTableProps=useOriginalCopy$1(tableProps),TableArea=React.useMemo((function(){if("custom"===tableType){var TableComp=tableComp;return React.createElement(TableComp,__assign({},originTableProps))}return"card"===tableType?React.createElement(Cards,__assign({},originTableProps)):"table"===tableType?React.createElement(acud.Table,__assign({},originTableProps)):null}),[tableType,tableComp,originTableProps]);return React.createElement("div",{className:listPageCls},customRender.title,title&&React.createElement("h2",null,title),withToolbar&&React.createElement("div",{className:"".concat(CLS_PREFIX$6,"-toolbar")},React.createElement("div",{style:{overflow:"hidden"}},React.createElement("div",{className:"".concat(CLS_PREFIX$6,"-toolbar-left")},React.createElement(BulkArea,__assign({},bulkProps,{position:"left"})),("left"===filterPosition||"tb"===filterPosition)&&React.createElement(FilterArea,__assign({},filterProps,{position:"left"}))),React.createElement("div",{className:"".concat(CLS_PREFIX$6,"-toolbar-right")},"right"===filterPosition&&React.createElement(FilterArea,__assign({},filterProps,{position:"right"})),"left"!==bulkPosition&&React.createElement(BulkArea,__assign({},bulkProps,{position:"right"})))),!filterPosition&&React.createElement(FilterArea,__assign({},filterProps))),customRender.toolbar,TableArea,React.createElement(acud.Pagination,__assign({className:"".concat(CLS_PREFIX$6,"-pagination")},paginationProps)),Confirm,Dialog&&React.createElement(Dialog,{open:dialogOpen,onCancel:onDialogCancel,onSuccess:onDialogSuccess}))},exports.HooksTable=function(props){var className=props.className,customizePrefixCls=props.prefixCls,title=props.title,_a=props.customRender,customRender=void 0===_a?{}:_a,toolbarProps=props.toolbarProps,tableProps=props.tableProps,TableComp=props.tableComp,card=props.card,emptyConfig=props.emptyConfig,filterData=props.filterData,dialogProps=props.dialogProps,httpStatusCode=props.httpStatusCode,handleCommand=props.handleCommand,handleTableCommand=props.handleTableCommand,handleFilterChange=props.handleFilterChange,setColumnsConfig=props.setColumnsConfig,_b=__read(React.useState(0),2),containerWidth=_b[0],setContainerWidth=_b[1],containerRef=React.useRef(null),locale=__read(useLocale("HooksTable"),1)[0],defaultPrefixCls=React.useContext(ConfigContext).prefixCls,prefixCls=customizePrefixCls||defaultPrefixCls||"acud-pro",_d=emptyConfig||{},emptyDefaultConfig=_d.default,emptyCreateConfig=_d.create,emptySearchConfig=_d.search,tablePrefixCls="".concat(prefixCls,"-hooks-table"),tableCls=classNames(tablePrefixCls,className),_e=toolbarProps,withToolbar=_e.withToolbar,_f=_e.bulkProps,_g=void 0===_f?{}:_f,bulkComp=_g.bulkComp,bulkConfig=_g.bulkConfig,_h=__read(React.useState(null==toolbarProps?void 0:toolbarProps.columns),2),currentColumns=_h[0],setCurrentColumns=_h[1];React.useEffect((function(){!_.isEqual(currentColumns,null==toolbarProps?void 0:toolbarProps.columns)&&(null==toolbarProps?void 0:toolbarProps.columns)&&setColumns(toolbarProps.columns)}),[null==toolbarProps?void 0:toolbarProps.columns]),React.useEffect((function(){var _a,resizeObserver=null;if(!(null===(_a=null==toolbarProps?void 0:toolbarProps.controlsConfig)||void 0===_a?void 0:_a.colsNum)){if(!containerRef.current)return;resizeObserver=new ResizeObserver((function(entries){var e_1,_a;try{for(var entries_1=__values(entries),entries_1_1=entries_1.next();!entries_1_1.done;entries_1_1=entries_1.next()){var width=entries_1_1.value.contentRect.width;setContainerWidth(width)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{entries_1_1&&!entries_1_1.done&&(_a=entries_1.return)&&_a.call(entries_1)}finally{if(e_1)throw e_1.error}}})),resizeObserver.observe(containerRef.current)}return function(){null==resizeObserver||resizeObserver.disconnect()}}),[toolbarProps]);var setColumns=React.useCallback((function(columns){var filteredColumns=columns.filter((function(column){return!column.hidden}));setCurrentColumns(filteredColumns)}),[]),withFilterData=React.useMemo((function(){return!_.isEmpty(filterData)&&_.some(filterData,(function(filterDataItem){return!_.isEmpty(filterDataItem)}))}),[filterData]),emptyProps=React.useMemo((function(){if(httpStatusCode)return{status:EMPTY_STATUS_MAP[String(httpStatusCode)]||"NO_DATA"};var statusEmptyProps=_.extend({status:"NO_DATA",children:React.createElement(React.Fragment,null)},emptyDefaultConfig);if(withFilterData)_.extend(statusEmptyProps,emptySearchConfig);else if(withToolbar)if(emptyCreateConfig)_.extend(statusEmptyProps,emptyCreateConfig);else if(!bulkComp&&bulkConfig){var createConfig=_.find(bulkConfig,(function(_a){var id=_a.id;return/^create/.test(id)})),_a=createConfig||{},text=_a.text,disabled=_a.disabled,restCreateConfig_1=__rest(_a,["text","disabled"]),reg=new RegExp((null==locale?void 0:locale.create)+"|"+(null==locale?void 0:locale.new));statusEmptyProps.description=text?(null==locale?void 0:locale.no)+text.replace(reg,(function($1){return"".concat($1).concat(null==locale?void 0:locale.any)})):null==locale?void 0:locale.noData,statusEmptyProps.children=text&&React.createElement(acud.Link,{disabled:disabled,onClick:function(){return null==handleCommand?void 0:handleCommand({config:restCreateConfig_1})}},text)}return statusEmptyProps}),[httpStatusCode,withFilterData,withToolbar,bulkComp,bulkConfig,handleCommand,locale,emptyDefaultConfig,emptyCreateConfig,emptySearchConfig]),tableContent=React.useMemo((function(){return TableComp?React.createElement(TableComp,__assign({},tableProps,{columns:currentColumns,handleCommand:handleCommand,handleTableCommand:handleTableCommand})):card?React.createElement(Card,__assign({prefixCls:prefixCls,locale:{emptyText:React.createElement(EmptyStatus,__assign({},emptyProps))}},tableProps,{columns:currentColumns,card:card,handleCommand:handleCommand,handleTableCommand:handleTableCommand})):React.createElement(acud.Table,__assign({locale:{emptyText:React.createElement(EmptyStatus,__assign({},emptyProps))}},tableProps,{columns:currentColumns}))}),[prefixCls,TableComp,card,emptyProps,handleCommand,handleTableCommand,tableProps,currentColumns]),selectedProps=React.useMemo((function(){var total=_.get(tableProps,"pagination.total");return{selectedRowKeys:_.get(tableProps,"rowSelection.selectedRowKeys"),total:total}}),[tableProps]);return React.createElement("div",{className:tableCls,ref:containerRef},customRender.title,title&&React.createElement("h2",null,title),React.createElement(ToolBar,__assign({prefixCls:prefixCls},toolbarProps,{selectedProps:selectedProps,handleCommand:handleCommand,setColumnsConfig:setColumnsConfig,setColumns:setColumns,handleFilterChange:handleFilterChange,containerWidth:containerWidth})),customRender.toolbar,tableContent,React.createElement(Dialog,__assign({tablePrefixCls:tablePrefixCls},dialogProps)))},exports.Loading=PageLoading,exports.OverviewStats=function(_a){var title=_a.title,items=_a.items,className=_a.className;return React.createElement("div",{className:"overview-stats-root".concat(className?" "+className:"")},title&&React.createElement("div",{className:"overview-stats-title"},title),React.createElement("div",{className:"overview-stats-list"},items.map((function(item){return React.createElement("div",{key:item.label,className:"overview-stats-item",onClick:function(){return function(item){item.link?window.open(item.link,"_blank","noopener,noreferrer"):item.onClick&&item.onClick()}(item)}},React.createElement("div",{className:"overview-stats-header"},React.createElement("span",{className:"overview-stats-icon"},item.icon),React.createElement("span",{className:"overview-stats-label"},item.label)),React.createElement("div",{className:"overview-stats-value-unit"},item.loading?React.createElement(acud.Loading,null):React.createElement(React.Fragment,null,React.createElement("span",{className:"overview-stats-value"},item.value),item.unit&&React.createElement("span",{className:"overview-stats-unit"},item.unit))))}))))},exports.PageContainer=PageContainer,exports.SideBar=SideBar,exports.Status=Status$1,exports.bizUtil=index$b,exports.browserUtil=index$8,exports.cookieUtil=index$7,exports.createDialog=createDialog,exports.createDrawer=createDrawer,exports.fileUtil=index$5,exports.hocs=index$9,exports.mathUtil=index$6,exports.renderRoutes=function(routes){return isV5||isV6?isV6?function(routes){return _.map(routes,(function(route){var redirectTo=route.redirectTo;return redirectTo?React.createElement(rc$1.Navigate,{to:redirectTo,replace:!0}):React.createElement(rc$1.Route,__assign({},route))}))}(routes):function(routes){return _.map(routes,(function(route){var path=route.path,_a=route.component,component=void 0===_a?null:_a,exact=route.exact,strict=route.strict,redirectTo=route.redirectTo;if(redirectTo)return React.createElement(rc$1.Redirect,{key:path,path:path,to:redirectTo});var config={path:path,exact:exact,strict:strict,component:component};return React.createElement(Route,__assign({key:path},config))}))}(routes):null},exports.request=request,exports.timeUtil=timeUtil,exports.useAction=useAction,exports.useActions=function(actions,deps){var dispatch=reactRedux.useDispatch();return React.useMemo((function(){return Array.isArray(actions)?actions.map((function(a){return redux.bindActionCreators(a,dispatch)})):redux.bindActionCreators(actions,dispatch)}),deps?__spreadArray([dispatch],__read(deps),!1):[dispatch])},exports.useBoolean=function(initialValue){void 0===initialValue&&(initialValue=!1);var _a=__read(useBoolean(initialValue),2),value=_a[0],_b=_a[1];return[value,_b.on,_b.off,_b.toggle]},exports.useConfirm=useConfirm,exports.useDebounce=function(value,options){var _a=__read(React.useState(value),2),debounced=_a[0],setDebounced=_a[1],run=function(fn,options){var _a,fnRef=useLatest(fn),wait=null!==(_a=null==options?void 0:options.wait)&&void 0!==_a?_a:1e3,debounced=React.useMemo((function(){return _.debounce((function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return fnRef.current.apply(fnRef,__spreadArray([],__read(args),!1))}),wait,options)}),[]);return useUnmount((function(){debounced.cancel()})),{run:debounced,cancel:debounced.cancel,flush:debounced.flush}}((function(){setDebounced(value)}),options).run;return React.useEffect((function(){run()}),[value]),debounced},exports.useDeepCompareEffect=function(effect,deps){var originalDeps=useOriginalDeepCopy(deps);React.useEffect(effect,originalDeps)},exports.useDialog=useDialog,exports.useFetch=useFetch,exports.useFetchPolling=function(action,params,$onRequest,$onResponse,$onError,abort,interval){var stopRef=React.useRef(!1),resultRef=React.useRef({}),result=useFetch(action,params,$onRequest,(function(res){_.isFunction($onResponse)&&$onResponse(res),stopRef.current||setTimeout(resultRef.current.reload,interval||0)}),$onError,abort);return resultRef.current=result,React.useEffect((function(){return function(){stopRef.current=!0}}),[]),result},exports.useForm=useForm,exports.useFormRef=function(ref){var formRef=React.useRef(null),doSubmit=function(){return __awaiter(void 0,void 0,void 0,(function(){var handleSubmit;return __generator(this,(function(_b){switch(_b.label){case 0:return handleSubmit=(formRef.current||{}).doSubmit,handleSubmit?[4,handleSubmit()]:[3,2];case 1:_b.sent(),_b.label=2;case 2:return[2]}}))}))};return React.useImperativeHandle(ref,(function(){return{doSubmit:doSubmit}})),{formRef:formRef}},exports.useInterval=function(callback,interval,abort){var savedCallback=React.useRef(callback);React.useEffect((function(){savedCallback.current=callback}),[callback]),React.useEffect((function(){if(_.isNumber(interval)&&!abort){var id_1=setInterval((function(){return savedCallback.current()}),interval);return function(){return clearInterval(id_1)}}}),[interval,abort])},exports.useLatest=useLatest,exports.useList=function(configOptions,props,customFunctions){void 0===customFunctions&&(customFunctions={});var callbackRef=React.useRef({}),handleTableCommand=React.useCallback((function(type,payload){var _a=callbackRef.current,options=_a.options,handleAction=_a.handleAction,commandConfig=_.get(options,"commands[".concat(type,"]"));commandConfig&&("dialog"===commandConfig.actionType&&commandConfig.dialog&&(commandConfig.dialog.fromTable=!0),"drawer"===commandConfig.actionType&&commandConfig.drawer&&(commandConfig.drawer.fromTable=!0),handleAction(commandConfig,payload))}),[]),getSelectedItems=React.useCallback((function(){var _a=callbackRef.current,rowKey=_a.rowKey,selectedRowKeys=_a.selectedRowKeys,dataSource=_a.dataSource,selectedItems=rowKey?_.map(selectedRowKeys,(function(key){var _a;return _.find(dataSource,((_a={})[rowKey]=key,_a))})):_.filter(dataSource,(function(__,i){return _.includes(selectedRowKeys,i)}));return{selectedRowKeys:selectedRowKeys,selectedItems:selectedItems}}),[]),defaultOptions=configOptions(props,handleTableCommand,customFunctions),_a=__read(React.useState(defaultOptions),2),options=_a[0],setOptions=_a[1],originalProps=useOriginalCopy$1(props),allFunctions=React.useMemo((function(){return __assign({loadList:function(){return callbackRef.current.loadList()},loadFirstPage:function(){return callbackRef.current.loadFirstPage()},checkAll:function(checked){return callbackRef.current.checkAll(checked)}},customFunctions)}),[customFunctions]),_b=useAction(props,allFunctions,getSelectedItems),handleAction=_b.handleAction,dialogProps=_b.dialogProps,confirmProps=_b.confirmProps,_c=function(options,actions,handleTableCommand,handleAction,customFunctions){var fetchListAction=options.fetchListAction,rowKey=options.rowKey,filterConfig=options.filterConfig,tableConfig=options.tableConfig,editComp=options.editComp,defaultPageSize=options.pageSize,pageSizeOptions=options.pageSizeOptions,_a=options.select,select=void 0===_a?"multi":_a,interval=options.interval,optionsEmptyText=options.emptyText,$onRequest=options.$onRequest,$onResponse=options.$onResponse,$onError=options.$onError,_b=options.requestAbort,requestAbort=void 0!==_b&&_b,tableComp=options.tableComp,card=options.card,defaultFilterData={};filterConfig&&_.isArray(filterConfig.controls)&&_.each(filterConfig.controls,(function(control){control.name&&!_.isNil(control.value)&&(defaultFilterData[control.name]=control.value)}));var _c=__read(React.useState(1),2),pageNo=_c[0],setPageNo=_c[1],_d=__read(React.useState(defaultPageSize||10),2),pageSize=_d[0],setPageSize=_d[1],_e=__read(React.useState(defaultFilterData),2),filterData=_e[0],setFilterData=_e[1],_f=__read(React.useState("desc"),2),order=_f[0],setOrder=_f[1],_g=__read(React.useState(""),2),orderBy=_g[0],setOrderBy=_g[1],_h=__read(React.useState([]),2),selectedRowKeys=_h[0],setSelectedRowKeys=_h[1],_j=__read(React.useState([]),2),requestCache=_j[0],setRequestCache=_j[1],_k=__read(React.useState(requestAbort),2),listRequestAbort=_k[0],setListRequestAbort=_k[1],_l=__read(React.useState(0),2),totalCount=_l[0],setTotalCount=_l[1],_m=__read(React.useState([]),2),dataSource=_m[0],setDataSource=_m[1],locales=__read(useLocale("useList"),1)[0],listParams=React.useMemo((function(){var params=__assign(__assign({},filterData),{pageNo:pageNo,pageSize:pageSize});return orderBy&&(params.order=order,params.orderBy=orderBy),_.each(params,(function(value,key){(""===value||null===value||_.isArray(value)&&0===value.length)&&delete params[key]})),params}),[pageNo,pageSize,filterData,order,orderBy]),$onListResponse=React.useCallback((function(page,requestParams){var responsePage=_.isFunction($onResponse)&&$onResponse(page,listParams)||page;return setDataSource(responsePage.result),setTotalCount(responsePage.totalCount),setRequestCache((function(prevRequestCache){return __spreadArray(__spreadArray([],__read(prevRequestCache),!1),[{request:requestParams,response:responsePage}],!1)})),responsePage.totalCount>0&&responsePage.pageNo>1&&!responsePage.result.length&&setPageNo(pageNo-1),responsePage}),[$onResponse,listParams,pageNo]),$onListError=React.useCallback((function(err){_.isFunction($onError)&&$onError(err);var errorMsg=getErrorMsg(err);errorMsg&&message("error",errorMsg)}),[$onError]),_p=useFetch(actions[fetchListAction],listParams,$onRequest,$onListResponse,$onListError,listRequestAbort),loading=_p.loading,error=_p.error,reload=_p.reload,latestPayload=_p.latestPayload;useInterval$1((function(){return reload(!1)}),interval||-1);var activeListRequest=React.useCallback((function(){return listRequestAbort&&setListRequestAbort(!1)}),[listRequestAbort]),clearRowKeysAndActive=React.useCallback((function(){activeListRequest(),setSelectedRowKeys([])}),[activeListRequest]),loadList=React.useCallback((function(){setSelectedRowKeys([]),setListRequestAbort(!0),setTimeout((function(){return setListRequestAbort(!1)}),0)}),[]),loadFirstPage=React.useCallback((function(){clearRowKeysAndActive(),1!==pageNo?setPageNo(1):loadList()}),[clearRowKeysAndActive,pageNo,loadList]),handleFilterDataChange=React.useCallback((function(itemChanged){var _a;setListRequestAbort(!0),setFilterData(__assign(__assign({},filterData),((_a={})[itemChanged.name]=itemChanged.value,_a)))}),[filterData]),handleFilter=React.useCallback((function(newfilterData){_.each(newfilterData,(function(value,key){_.isString(value)&&(newfilterData[key]=_.trim(value))}));var mergeFilterData=__assign(__assign({},filterData),newfilterData);1===pageNo&&_.isEqual(filterData,mergeFilterData)?loadList():(setPageNo(1),setFilterData(mergeFilterData),clearRowKeysAndActive())}),[pageNo,filterData,loadList,clearRowKeysAndActive]),handlePageSizeChange=React.useCallback((function(__,currentPageSize){clearRowKeysAndActive(),setPageNo(1),setPageSize(currentPageSize)}),[clearRowKeysAndActive]),handlePageChange=React.useCallback((function(currentPageNo){clearRowKeysAndActive(),setPageNo(currentPageNo)}),[clearRowKeysAndActive]),handleTableChange=React.useCallback((function(__,filters,sorter){if(clearRowKeysAndActive(),setPageNo(1),!_.isEmpty(sorter)){var newOrderBy=sorter.order?sorter.field:"",newOrder=sorter.order?"ascend"===sorter.order?"asc":"desc":"";setOrderBy(newOrderBy),setOrder(newOrder)}_.isEmpty(filters)||setFilterData(__assign(__assign({},filterData),filters))}),[clearRowKeysAndActive,filterData]),handleSelectChange=React.useCallback((function(newSelectedRowKeys){setSelectedRowKeys(newSelectedRowKeys),customFunctions.handleSelectChange&&customFunctions.handleSelectChange(newSelectedRowKeys)}),[customFunctions]),checkAll=React.useCallback((function(checked){var newSelectedRowKeys=checked?rowKey?_.map(dataSource,rowKey):_.keys(dataSource):[];setSelectedRowKeys(newSelectedRowKeys)}),[dataSource,rowKey]);React.useEffect((function(){if(requestCache.length){var lastRequestCache=requestCache[requestCache.length-1];if(!_.isEqual(lastRequestCache.request,latestPayload)){var lastMatchRequest=_.findLast(requestCache,(function(cache){return _.isEqual(cache.request,latestPayload)}));lastMatchRequest&&(setDataSource(lastMatchRequest.response.result),setTotalCount(lastMatchRequest.response.totalCount))}}}),[latestPayload,requestCache]),React.useEffect((function(){requestAbort||activeListRequest()}),[fetchListAction]);var emptyText=loading?null==locales?void 0:locales.loadingData:getErrorMsg(error)||optionsEmptyText||(null==locales?void 0:locales.noData),tableProps={rowKey:rowKey||function(__,index){return index},dataSource:dataSource,locale:{emptyText:emptyText},loading:loading};"none"!==select&&(tableProps.rowSelection={selectedRowKeys:selectedRowKeys,onChange:handleSelectChange,type:"single"===select?"radio":"checkbox"});var tableType="";return tableComp?(tableType="custom",_.extend(tableProps,{handleAction:handleAction,handleTableCommand:handleTableCommand})):card?(tableType="card",_.extend(tableProps,{card:card,onHandleAction:handleAction,onHandleTableCommand:handleTableCommand})):tableConfig&&(tableType="table",_.extend(tableProps,tableConfig,{pagination:!1,onChange:handleTableChange}),editComp&&(tableProps.components={body:editComp}),"none"!==select&&tableConfig.getCheckboxProps&&(tableProps.rowSelection.getCheckboxProps=tableConfig.getCheckboxProps)),{mainListProps:{tableType:tableType,tableProps:tableProps,tableComp:tableComp,paginationProps:{total:totalCount,current:pageNo,pageSize:pageSize,defaultPageSize:pageSize,pageSizeOptions:pageSizeOptions||DEFAULT_PAGESIZE_OPTIONS$1,showSizeChanger:!0,showTotal:function(){return"".concat(null==locales?void 0:locales.total).concat(totalCount).concat(null==locales?void 0:locales.stripData)},onShowSizeChange:handlePageSizeChange,onChange:handlePageChange}},tableData:{loading:loading,error:error,checkedAll:dataSource.length===selectedRowKeys.length&&selectedRowKeys.length>0,pageNo:pageNo,pageSize:pageSize,dataSource:dataSource,totalCount:totalCount,order:order,orderBy:orderBy,listParams:listParams,filterData:filterData,selectedRowKeys:selectedRowKeys},setStates:{setPageNo:setPageNo,setPageSize:setPageSize,setTotalCount:setTotalCount,setDataSource:setDataSource,setOrder:setOrder,setOrderBy:setOrderBy,setFilterData:setFilterData,setSelectedRowKeys:setSelectedRowKeys},mainApi:{checkAll:checkAll,loadList:loadList,loadFirstPage:loadFirstPage,handleFilterDataChange:handleFilterDataChange,handleFilter:handleFilter}}}(options,props.actions,handleTableCommand,handleAction,customFunctions),mainListProps=_c.mainListProps,tableData=_c.tableData,setStates=_c.setStates,mainApi=_c.mainApi,loading=tableData.loading,checkedAll=tableData.checkedAll,dataSource=tableData.dataSource,selectedRowKeys=tableData.selectedRowKeys,filterData=tableData.filterData,checkAll=mainApi.checkAll,loadList=mainApi.loadList,loadFirstPage=mainApi.loadFirstPage,toolbarProps=function(options,selectedRowKeys,checkedAll,loading,handleAction,handleFilter,handleFilterDataChange,customFunctions){var bulkPosition=options.bulkPosition,bulkConfig=options.bulkConfig,filterConfig=options.filterConfig,bulkComp=options.bulkComp,filterComp=options.filterComp,customFilterProps=options.filterProps,columns=options.tableConfig.columns,handleFilterItemChange=React.useCallback((function(itemChanged){customFunctions.handleFilterItemChange&&customFunctions.handleFilterItemChange(itemChanged)}),[customFunctions]),handleFilterChange=React.useCallback((function(itemChanged){handleFilterDataChange(itemChanged)}),[handleFilterDataChange]);return{toolbarProps:{bulkPosition:bulkPosition,withToolbar:bulkConfig||bulkComp||filterConfig||filterComp,filterPosition:filterConfig&&filterConfig.position,bulkProps:{selectedRowKeys:selectedRowKeys,checkedAll:checkedAll,loading:loading,bulkComp:bulkComp,bulkConfig:bulkConfig,onHandleAction:handleAction},filterProps:{loading:loading,filterComp:filterComp,filterProps:customFilterProps,filterConfig:filterConfig,columns:columns,onHandleFilter:handleFilter,onItemChange:handleFilterItemChange,onFilterDataChange:handleFilterChange}}}}(options,selectedRowKeys,checkedAll,loading,handleAction,mainApi.handleFilter,mainApi.handleFilterDataChange,customFunctions).toolbarProps;callbackRef.current={options:options,handleAction:handleAction,selectedRowKeys:selectedRowKeys,dataSource:dataSource,rowKey:options.rowKey,loadList:loadList,loadFirstPage:loadFirstPage,checkAll:checkAll};var originalTableData=useOriginalCopy$1(tableData);React.useEffect((function(){var newOptions=configOptions(props,handleTableCommand,customFunctions),filterControls=_.get(newOptions,"filterConfig.controls");_.isArray(filterControls)&&filterControls.length&&_.each(filterControls,(function(filterControl){var filterDataValue=filterData[filterControl.name];if(!_.isNil(filterDataValue))if(filterControl.options){var optionValues=_.map(filterControl.options,"value");_.isArray(filterDataValue)?_.difference(filterDataValue,optionValues).length&&(filterControl.value=[]):_.includes(optionValues,filterDataValue)||(filterControl.value="")}else filterControl.value=filterDataValue})),setOptions(newOptions)}),[originalProps,originalTableData]);var className=options.className,title=options.title,listProps=__assign(__assign({className:className,title:title,confirmProps:confirmProps,dialogProps:dialogProps},toolbarProps),mainListProps);return __assign(__assign(__assign(__assign(__assign({options:options,setOptions:setOptions},tableData),{tableData:tableData}),setStates),mainApi),{handleAction:handleAction,handleTableCommand:handleTableCommand,listProps:listProps})},exports.useMemoizedFn=function(fn){var fnRef=React.useRef(fn);fnRef.current=React.useMemo((function(){return fn}),[fn]);var memoizedFn=React.useRef();return memoizedFn.current||(memoizedFn.current=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return fnRef.current.apply(this,args)}),memoizedFn.current},exports.useMount=function(fn){React.useEffect((function(){null==fn||fn()}),[])},exports.useOriginalCopy=function(value,equals){void 0===equals&&(equals=shallowEquals);var cache=React.useRef(value),equalsRef=React.useRef(equals);return React.useEffect((function(){equalsRef.current=equals}),[equals]),React.useEffect((function(){equalsRef.current(cache.current,value)||(cache.current=value)}),[value]),equals(cache.current,value)?cache.current:value},exports.usePrevious=usePrevious$1,exports.useResize=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var _a=__read(React.useState({width:0,height:0}),2),size=_a[0],setSize=_a[1],resizeRef=React.useRef(null),element=React.useMemo((function(){return args.length?React.isValidElement(args[0])?args[0]:args[0].current?args[0].current:null:null}),[args]),setNewSize=React.useCallback((function(newSize){_.isEqual(newSize,resizeRef.current)||(resizeRef.current=newSize,setSize(resizeRef.current))}),[resizeRef,setSize]),getElementSize=React.useCallback((function(){var _a=element,width=_a.offsetWidth,height=_a.offsetHeight;setNewSize({width:width,height:height})}),[element,setNewSize]),getWindowSize=React.useCallback((function(){var currentSize={width:window.outerWidth,height:window.outerHeight};setNewSize(currentSize)}),[setNewSize]);return React.useEffect((function(){return element?(getElementSize(),addListener(element,getElementSize)):(getWindowSize(),window.addEventListener("resize",getWindowSize)),function(){element?function(elem,callback){var listeners=elem.__resize_listeners__;if(listeners){if(callback&&listeners.splice(listeners.indexOf(callback),1),!listeners.length||!callback){if(elem.detachEvent&&elem.removeEventListener)return elem.detachEvent("onresize",elem.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",elem.__resize_mutation_handler__);elem.__resize_observer__?(elem.__resize_observer__.unobserve(elem),elem.__resize_observer__.disconnect(),elem.__resize_observer__=null):(elem.__resize_mutation_observer__&&(elem.__resize_mutation_observer__.disconnect(),elem.__resize_mutation_observer__=null),elem.removeEventListener("scroll",handleScroll),elem.removeChild(elem.__resize_triggers__.triggers),elem.__resize_triggers__=null),elem.__resize_listeners__=null}! --total&&style&&style.parentNode.removeChild(style)}}(element,getElementSize):window.removeEventListener("resize",getWindowSize)}}),[element,getElementSize,getWindowSize]),size},exports.useStepper=function(props){var min=props.min,max=props.max,_a=props.step,step=void 0===_a?1:_a,defaultValue=props.defaultValue,onChange=props.onChange,initValue="value"in props?props.value:defaultValue,_b=__read(React.useState(initValue),2),value=_b[0],setValue=_b[1],_c=__read(React.useState(!0),2),abort=_c[0],setAbort=_c[1],userTypingRef=React.useRef(""),timerRef=React.useRef(null),_d=React.useMemo((function(){var disabledDecrease=!1,disabledIncrease=!1;if(value||0===value){var valueInfo=getLimitedValue({value:value,min:min,max:max}),relation=valueInfo&&valueInfo.relation;disabledDecrease=!relation||"less"===relation,disabledIncrease=!relation||"more"===relation}return{disabledDecrease:disabledDecrease,disabledIncrease:disabledIncrease}}),[min,max,value]),disabledDecrease=_d.disabledDecrease,disabledIncrease=_d.disabledIncrease,onIncrease=React.useCallback((function(){return setValue((function(pre){return void 0===pre&&(pre=0),step&&!disabledIncrease?(timerRef.current&&clearTimeout(timerRef.current),timerRef.current=window.setTimeout((function(){userTypingRef.current=USER_TYPINGS_INCREASE,setAbort(!1)}),500),add$1(pre,step)):pre}))}),[step,disabledIncrease]),onDecrease=React.useCallback((function(){return setValue((function(pre){return void 0===pre&&(pre=0),step&&!disabledDecrease?(timerRef.current&&clearTimeout(timerRef.current),timerRef.current=window.setTimeout((function(){userTypingRef.current=USER_TYPINGS_DECREASE,setAbort(!1)}),500),subtract$1(pre,step)):pre}))}),[step,disabledDecrease]),onStepStop=React.useCallback((function(){timerRef.current&&clearTimeout(timerRef.current),userTypingRef.current="",setAbort(!0)}),[]);return useInterval$1(React.useCallback((function(){userTypingRef.current===USER_TYPINGS_INCREASE&&onIncrease(),userTypingRef.current===USER_TYPINGS_DECREASE&&onDecrease()}),[onDecrease,onIncrease]),abort?-1:200),React.useEffect((function(){(disabledDecrease||disabledIncrease)&&(timerRef.current&&clearTimeout(timerRef.current),setAbort(!0))}),[disabledDecrease,disabledIncrease]),React.useEffect((function(){onChange&&onChange(value)}),[value,onChange]),{value:value,disabledDecrease:disabledDecrease,disabledIncrease:disabledIncrease,onIncrease:onIncrease,onDecrease:onDecrease,onStepStop:onStepStop,onValueChange:function(inputValue){return setValue(inputValue)}}},exports.useTable=function(getOptions,props,customFunctions){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r,_s,_t,_u,_v,_w;void 0===customFunctions&&(customFunctions={});var actions=props.actions,propsHistory=props.history,propsSearch=props.search,hooksHistory=null===(_a=rc.useHistory)||void 0===_a?void 0:_a.call(rc),navigate=null===(_b=rc.useNavigate)||void 0===_b?void 0:_b.call(rc),hooksLocation=null===(_c=rc.useLocation)||void 0===_c?void 0:_c.call(rc),history=propsHistory||hooksHistory||navigate,location=(null==history?void 0:history.location)||hooksLocation,search=propsSearch||function(location){var _a,hash=location.hash,search=location.search;return null===(_a=hash||search)||void 0===_a?void 0:_a.split("?")[1]}(location),_x=function(search){var searchParamsInstance=new URLSearchParams(search);return{searchParamsInstance:searchParamsInstance,getSearchParam:function(paramName){var e_1,_a;if(paramName){var paramValues=searchParamsInstance.getAll(paramName);return paramValues.length<=1?paramValues[0]:paramValues}var searchParamKeys=__spreadArray([],__read(new Set(searchParamsInstance.keys())),!1),searchParams={};try{for(var searchParamKeys_1=__values(searchParamKeys),searchParamKeys_1_1=searchParamKeys_1.next();!searchParamKeys_1_1.done;searchParamKeys_1_1=searchParamKeys_1.next()){var key=searchParamKeys_1_1.value,value=searchParamsInstance.getAll(key);searchParams[key]=value.length<=1?value[0]:value}}catch(e_1_1){e_1={error:e_1_1}}finally{try{searchParamKeys_1_1&&!searchParamKeys_1_1.done&&(_a=searchParamKeys_1.return)&&_a.call(searchParamKeys_1)}finally{if(e_1)throw e_1.error}}return searchParams}}}(search),getSearchParam=_x.getSearchParam,searchParamsInstance=_x.searchParamsInstance,_y=(null===(_d=React.useContext(ConfigContext))||void 0===_d?void 0:_d.table)||{},tableQueryParamKeys=_y.queryParamKeys,fetchActionErrorToast=_y.fetchActionErrorToast,_z=__read(React.useState([]),2),cloumnKeys=_z[0],setCloumnKeys=_z[1],callbackRef=React.useRef({tableActions:{getSearchParam:getSearchParam}}),_0=__read(React.useState({selectedRowKeys:[],selectedItems:[]}),2),selectedRow=_0[0],setSelectedRow=_0[1],_1=function(props){var _a,actions=props.actions,history=props.history,selectedRow=props.selectedRow,tableActions=props.tableActions,selectedRowKeys=selectedRow.selectedRowKeys,selectedItems=selectedRow.selectedItems,_b=__read(React.useState({}),2),dialogProps=_b[0],setDialogProps=_b[1],locale=__read(useLocale("useTable"),1)[0],ajaxActionErrorToast=((null===(_a=React.useContext(ConfigContext))||void 0===_a?void 0:_a.table)||{}).ajaxActionErrorToast,handleDialogClose=React.useCallback((function(){setDialogProps((function(prevDialogProps){return __assign(__assign({},prevDialogProps),{visible:!1})}))}),[]),handleDialogConfirmLoading=React.useCallback((function(confirmLoadingText){setDialogProps((function(prevDialogProps){return __assign(__assign({},prevDialogProps),{confirmLoading:!0,confirmLoadingText:confirmLoadingText})}))}),[]),handleDialogCancelConfirmLoading=React.useCallback((function(){setDialogProps((function(prevDialogProps){return __assign(__assign({},prevDialogProps),{confirmLoading:!1})}))}),[]),handleDialogAlertCommand=React.useCallback((function(_a){var config=_a.config,payload=_a.payload,title=config.title,content=config.body.content,dialogProps=__rest(config,["title","body"]);setDialogProps(__assign(__assign({type:"info",title:title,onConfirmLoading:handleDialogConfirmLoading,onCancelConfirmLoading:handleDialogCancelConfirmLoading},dialogProps),{dialogType:"dialog-box",content:content,payload:payload,handleDialogClose:handleDialogClose}))}),[handleDialogClose,handleDialogConfirmLoading,handleDialogCancelConfirmLoading]),handleDialogOtherCommand=React.useCallback((function(_a){var config=_a.config,_b=_a.payload,payload=void 0===_b?{}:_b,actionType=_a.actionType,title=config.title,body=config.body,dialogProps=__rest(config,["title","body"]),type=body.type,content=body.content,$payloadFields=body.$payloadFields,$extraPayload=body.$extraPayload,$onBeforeOpen=body.$onBeforeOpen;payload=createPayload(payload,$payloadFields,$extraPayload),payload="function"==typeof $onBeforeOpen&&$onBeforeOpen(payload)||payload,setDialogProps(__assign(__assign({title:title,onConfirmLoading:handleDialogConfirmLoading,onCancelConfirmLoading:handleDialogCancelConfirmLoading,onSuccess:null==tableActions?void 0:tableActions.loadList},dialogProps),{dialogType:"drawer"===actionType?actionType:"modal",dialogSubType:type,content:content,payload:payload,handleDialogClose:handleDialogClose}))}),[tableActions,handleDialogClose,handleDialogConfirmLoading,handleDialogCancelConfirmLoading]),handleAjaxCommand=React.useCallback((function(_a){var config=_a.config,_b=_a.payload,payload=void 0===_b?{}:_b,apiAction=config.apiAction,$payloadFields=config.$payloadFields,$extraPayload=config.$extraPayload,confirmText=config.confirmText,_c=config.confirmTitle,confirmTitle=void 0===_c?(null==locale?void 0:locale.confirm)+"?":_c,_d=config.errorToast,errorToast=void 0===_d?null==ajaxActionErrorToast||ajaxActionErrorToast:_d,$toastMessage=config.$toastMessage,$onRequest=config.$onRequest,$onResponse=config.$onResponse,$onError=config.$onError,dialogProps=__rest(config,["apiAction","$payloadFields","$extraPayload","confirmText","confirmTitle","errorToast","$toastMessage","$onRequest","$onResponse","$onError"]),requestPayload=createPayload(payload,$payloadFields,$extraPayload);_.isFunction($onRequest)&&$onRequest(requestPayload);var withoutComfirm=_.isEmpty(confirmText),send=function(){var action=_.isString(apiAction)?_.get(actions,apiAction):apiAction;return!withoutComfirm&&action&&handleDialogConfirmLoading(),action(requestPayload).then((function(response){var _a;return $toastMessage&&acud.toast.success({message:$toastMessage,duration:5}),_.isFunction($onResponse)&&$onResponse(response,requestPayload),!withoutComfirm&&setDialogProps((function(prevDialogProps){return __assign(__assign({},prevDialogProps),{confirmLoading:!1,visible:!1})})),(null===(_a=null==tableActions?void 0:tableActions.loadList)||void 0===_a?void 0:_a.call(tableActions))||Promise.resolve()})).catch((function(error){_.isFunction($onError)&&$onError(error,requestPayload),errorToast&&acud.toast.error({message:error.global||(null==locale?void 0:locale.requestFailedPleaseCheck),duration:5}),handleDialogCancelConfirmLoading()}))};if(withoutComfirm)return send();var title=_.isString(confirmTitle)?_.template(confirmTitle)(payload):confirmTitle,content=_.isString(confirmText)?_.template(confirmText)(payload):confirmText;setDialogProps(__assign(__assign({type:"warning",title:title,content:content,onOk:send},dialogProps),{dialogType:"dialog-box",handleDialogClose:handleDialogClose}))}),[actions,tableActions,locale,ajaxActionErrorToast,handleDialogClose,handleDialogConfirmLoading,handleDialogCancelConfirmLoading]),handleCustomCommand=React.useCallback((function(_a){var _b,_c,_d,actionName=_a.actionName,_e=_a.payload,payload=void 0===_e?{}:_e;"loadList"===actionName?null===(_b=tableActions.loadList)||void 0===_b||_b.call(tableActions):"checkAll"===actionName?null===(_c=tableActions.checkAll)||void 0===_c||_c.call(tableActions,payload.checked):_.isEmpty(tableActions)||null===(_d=tableActions[actionName])||void 0===_d||_d.call(tableActions,payload)}),[tableActions]),handleCommand=React.useCallback((function(_a){var _b,config=_a.config,payload=_a.payload,actionType=config.actionType;config.select&&(config.$extraPayload={selectedItems:selectedItems,selectedRowKeys:selectedRowKeys});var mergePayload=_.extend({},payload,config.$extraPayload);if("link"===actionType){var params=createParams(payload,config.$payloadFields,config.$extraPayload),_c=__read(null===(_b=config.link)||void 0===_b?void 0:_b.split("?"),2),path=_c[0],search=_c[1],link=path+(params?"/".concat(params):"")+(search?"?".concat(search):"");history&&(history.push?history.push(link):history(link))}else if(DIALOG_TYPES.includes(actionType)){var actionConfig=config[actionType],title=actionConfig.title,body=actionConfig.body,type=body.type,content=body.content,$title=_.isString(title)?_.template(title)(payload):title,$content=_.isString(content)?_.template(content)(payload):content;actionConfig.title=$title,actionConfig.body.content=$content,"dialog"===actionType&&"alert"===type?handleDialogAlertCommand({config:actionConfig,payload:mergePayload}):("drawer"===actionType||["plain","common"].includes(type))&&handleDialogOtherCommand({config:actionConfig,payload:mergePayload,actionType:actionType})}else"ajax"===actionType?handleAjaxCommand({config:config.ajax,payload:mergePayload,tableActions:tableActions}):"custom"===actionType&&handleCustomCommand({actionName:config.action,payload:mergePayload,tableActions:tableActions})}),[history,tableActions,selectedItems,selectedRowKeys,handleDialogAlertCommand,handleDialogOtherCommand,handleAjaxCommand,handleCustomCommand]);return{dialogProps:dialogProps,handleCommand:handleCommand}}(__assign({actions:actions,history:history,selectedRow:selectedRow},callbackRef.current)),dialogProps=_1.dialogProps,handleCommand=_1.handleCommand,locale=__read(useLocale("useTable"),1)[0],handleTableCommand=React.useCallback((function(type,payload){var tableOptions=callbackRef.current.tableOptions,commandConfig=_.get(tableOptions,"commands[".concat(type,"]"));commandConfig&&handleCommand({config:commandConfig,payload:payload})}),[handleCommand]),options=getOptions(props,handleTableCommand,__assign(__assign({},callbackRef.current.tableActions),customFunctions)),isMore20=(null===(_f=null===(_e=null==options?void 0:options.tableConfig)||void 0===_e?void 0:_e.columns)||void 0===_f?void 0:_f.length)>20&&(null===(_g=null==options?void 0:options.tableConfig)||void 0===_g?void 0:_g.isControlColumn),tableOptions=__assign(__assign({},options),{commands:__assign(__assign(__assign(__assign({},(null==options?void 0:options.commands)||{}),(null===(_h=null==options?void 0:options.commands)||void 0===_h?void 0:_h.UPLOAD)?{UPLOAD:__assign(__assign({skin:"enhance"},null===(_j=null==options?void 0:options.commands)||void 0===_j?void 0:_j.UPLOAD),{dialog:__assign(__assign({title:"批量导入",width:540,foot:!0,maskClosable:!1,destroyOnClose:!0},(null===(_l=null===(_k=null==options?void 0:options.commands)||void 0===_k?void 0:_k.UPLOAD)||void 0===_l?void 0:_l.dialog)||{}),{body:__assign({type:"common",$payloadFields:["actions","alterMsg","typeOptions","uploagConfig","extraMsg"],content:UploadForm$1},(null===(_p=null===(_o=null===(_m=null==options?void 0:options.commands)||void 0===_m?void 0:_m.UPLOAD)||void 0===_o?void 0:_o.dialog)||void 0===_p?void 0:_p.body)||{})})})}:{}),(null===(_q=null==options?void 0:options.commands)||void 0===_q?void 0:_q.EXPORT)?{EXPORT:__assign(__assign({skin:"enhance"},null===(_r=null==options?void 0:options.commands)||void 0===_r?void 0:_r.EXPORT),{dialog:__assign(__assign({title:"导出数据",width:580,foot:!0,maskClosable:!1,destroyOnClose:!0},(null===(_t=null===(_s=null==options?void 0:options.commands)||void 0===_s?void 0:_s.EXPORT)||void 0===_t?void 0:_t.dialog)||{}),{body:{type:"common",$payloadFields:["actions","fileName"],$extraPayload:{selectMode:null==options?void 0:options.select,dataSource:"none"===(null==options?void 0:options.select)?tableData:(null==selectedRow?void 0:selectedRow.selectedItems)||[],options:options},content:DownloadForm}})})}:{}),isMore20?{ATTRIBUTES:{actionType:"drawer",drawer:{title:"列表显示属性配置",width:400,foot:!0,maskClosable:!1,destroyOnClose:!0,body:{content:AttributesForm$1,$payloadFields:["cloumnKeys","setCloumnKeys"]}}}}:{})}),className=tableOptions.className,title=tableOptions.title,fetchListAction=tableOptions.fetchListAction,$onRequest=tableOptions.$onRequest,$onResponse=tableOptions.$onResponse,$onError=tableOptions.$onError,_3=tableOptions.errorToast,errorToast=void 0===_3?null==fetchActionErrorToast||fetchActionErrorToast:_3,abort=tableOptions.abort,interval=tableOptions.interval,_4=tableOptions.queryParamKeys,defaultQueryParamKeys=void 0===_4?null!=tableQueryParamKeys&&tableQueryParamKeys:_4,$onQueryParamsChange=tableOptions.$onQueryParamsChange,controlsConfig=tableOptions.controlsConfig,bulkConfig=tableOptions.bulkConfig,bulkComp=tableOptions.bulkComp,defaultFilterConfig=tableOptions.filterConfig,multiFilterConfig=tableOptions.multiFilterConfig,filterComp=tableOptions.filterComp,rowKey=tableOptions.rowKey,_5=tableOptions.select,select=void 0===_5?"multi":_5,defaultPageNo=tableOptions.pageNo,defaultPageSize=tableOptions.pageSize,pageSizeOptions=tableOptions.pageSizeOptions,tableConfig=tableOptions.tableConfig,tableComp=tableOptions.tableComp,card=tableOptions.card,emptyConfig=tableOptions.emptyConfig,setColumnsConfig=tableOptions.setColumnsConfig,queryParamKeys=React.useMemo((function(){return defaultQueryParamKeys?!0===defaultQueryParamKeys?DEFAULT_QUERY_PARAMS:defaultQueryParamKeys:[]}),[defaultQueryParamKeys]),getQueryParamValue=React.useCallback((function(paramName){var searchParams=getSearchParam();return queryParamKeys.includes(paramName)?null==searchParams?void 0:searchParams[paramName]:void 0}),[queryParamKeys,getSearchParam]),getCustomQueryParamsValue=React.useCallback((function(){var searchParams=getSearchParam();return _.omit(_.pick(searchParams,queryParamKeys),DEFAULT_PAGE_PARAMS)}),[queryParamKeys,getSearchParam]),_6=React.useMemo((function(){var defaultFilterData={},cloumnsKeyList=isMore20&&0!==cloumnKeys.length?__spreadArray([],__read(cloumnKeys),!1):__spreadArray([],__read((null==tableConfig?void 0:tableConfig.columns)||[]),!1),cloumnShowKeys=_.reduce(cloumnsKeyList,(function(res,item,index){return(isMore20&&(item.show||item.isUniq)||!isMore20)&&(res[item.dataIndex]=index+1,res[item.key]=index+1),res}),{}),columns=_.reduce(null==tableConfig?void 0:tableConfig.columns,(function(res,column,columnIndex){var dataIndex=column.dataIndex,filters=column.filters,filterDropdown=column.filterDropdown,filteredValue=column.filteredValue,defaultFilteredValue=column.defaultFilteredValue,sorter=column.sorter,sortOrder=column.sortOrder,defaultSortOrder=column.defaultSortOrder,defaultKey=getColumnPos_1(columnIndex),columnKey=getColumnKey_1(column,defaultKey);if(column.sortIndex=cloumnShowKeys[columnKey]||0,filters||filterDropdown){var queryParamValue=getQueryParamValue(columnKey);if("filteredValue"in column||"defaultFilteredValue"in column)defaultFilterData[columnKey]=null!=filteredValue?filteredValue:defaultFilteredValue;else if(queryParamValue){var paramValue=_.isString(queryParamValue)?[queryParamValue]:queryParamValue;defaultFilterData[columnKey]=paramValue,column.defaultFilteredValue=paramValue}}if(sorter){var orderParamValue=getQueryParamValue("order"),orderByParamValue=getQueryParamValue("orderBy");if("sortOrder"in column||"defaultSortOrder"in column){var order=null!=sortOrder?sortOrder:defaultSortOrder;defaultFilterData.order=TABLE_ORDER_MAP[order],defaultFilterData.orderBy=dataIndex}else orderByParamValue===dataIndex&&orderParamValue&&(defaultFilterData.order=orderParamValue,defaultFilterData.orderBy=dataIndex,column.defaultSortOrder=TABLE_ORDER_MAP[orderParamValue])}return isMore20&&!cloumnShowKeys[columnKey]||res.push(column),res}),[]);isMore20&&(columns=_.sortBy(columns,"sortIndex"));var controls=_.map(null==defaultFilterConfig?void 0:defaultFilterConfig.controls,(function(control){var _a,_b,name=control.name,controlProps=control.controlProps;if(!name)return control;var _c=controlProps||{},value=_c.value,checked=_c.checked,defaultValue=_c.defaultValue,defaultChecked=_c.defaultChecked,queryParamValue=getQueryParamValue(name);return"value"in controlProps||"defaultValue"in controlProps||"checked"in controlProps||"defaultChecked"in controlProps?defaultFilterData[name]=null!==(_b=null!==(_a=null!=value?value:checked)&&void 0!==_a?_a:defaultValue)&&void 0!==_b?_b:defaultChecked:queryParamValue&&(defaultFilterData[name]=queryParamValue,control.controlProps||(control.controlProps={}),control.controlProps.defaultValue=queryParamValue,control.controlProps.defaultChecked="true"===queryParamValue),control}));return{columns:columns,cloumnsKeyList:cloumnsKeyList,filterConfig:__assign(__assign({},defaultFilterConfig),{controls:controls}),defaultFilterData:defaultFilterData}}),[null==tableConfig?void 0:tableConfig.columns,defaultFilterConfig,getQueryParamValue,cloumnKeys,isMore20]),columns=_6.columns,cloumnsKeyList=_6.cloumnsKeyList,filterConfig=_6.filterConfig,defaultFilterData=_6.defaultFilterData,action=React.useMemo((function(){return _.isString(fetchListAction)?_.get(actions,fetchListAction):fetchListAction}),[fetchListAction,actions]),defaultListParams=__assign(__assign({pageNo:Number(getQueryParamValue("pageNo")||defaultPageNo||1),pageSize:Number(getQueryParamValue("pageSize")||defaultPageSize||10)},getCustomQueryParamsValue()),defaultFilterData),_7=function(request){var action=request.action,defaultListParams=request.defaultListParams,$onRequest=request.$onRequest,$onResponse=request.$onResponse,$onError=request.$onError,errorToast=request.errorToast,abort=request.abort,interval=request.interval,locale=__read(useLocale("useTable"),1)[0],_b=__read(React.useState(defaultListParams),2),listParams=_b[0],setListParams=_b[1],params=React.useMemo((function(){var actualParams={};return _.each(listParams,(function(value,key){""===value||null===value||_.isArray(value)&&0===value.length||(actualParams[key]=value)})),actualParams}),[listParams]),$onFetchRequest=React.useCallback((function(params,extra){var requestParams=__assign({},params);return _.isFunction($onRequest)&&$onRequest(requestParams,extra)||requestParams}),[$onRequest]),$onFetchResponse=React.useCallback((function(response){var responsePage=_.isFunction($onResponse)&&$onResponse(response,listParams)||response,totalCount=responsePage.totalCount,pageNo=responsePage.pageNo,result=responsePage.result;return totalCount>0&&pageNo>1&&!result.length&&setListParams((function(prevListParams){return __assign(__assign({},prevListParams),{pageNo:pageNo-1})})),responsePage}),[$onResponse,listParams]),$onFetchError=React.useCallback((function(err){_.isFunction($onError)&&$onError(err);var errorMsg=getErrorMessage(err,null==locale?void 0:locale.failedToGetRecords);errorMsg&&errorToast&&acud.toast.error({message:errorMsg,duration:5})}),[errorToast,null==locale?void 0:locale.failedToGetRecords,$onError]),fetchResult=useFetch(action,params,$onFetchRequest,$onFetchResponse,$onFetchError,abort),reloadParams={needLoading:!1,extra:{isPolling:!0}};return useInterval$1((function(){return fetchResult.reload(reloadParams)}),interval||-1),__assign({listParams:listParams,setListParams:setListParams},fetchResult)}({action:action,defaultListParams:defaultListParams,errorToast:errorToast,$onRequest:$onRequest,$onResponse:$onResponse,$onError:$onError,abort:abort,interval:interval}),loading=_7.loading,data=_7.data,reload=_7.reload,listParams=_7.listParams,setListParams=_7.setListParams,_8=__read(React.useState(defaultFilterData),2),filterData=_8[0],setFilterData=_8[1],_9=data||{},dataSource=_9.result,totalCount=_9.totalCount,httpStatusCode=_9.httpStatusCode;tableData=dataSource;var pageNo=(null==data?void 0:data.pageNo)||(null==listParams?void 0:listParams.pageNo),pageSize=(null==data?void 0:data.pageSize)||(null==listParams?void 0:listParams.pageSize),loadList=React.useCallback((function(){setSelectedRow({selectedRowKeys:[],selectedItems:[]}),reload()}),[reload]),handleQueryParamsChange=React.useCallback((function(){var searchParamsString=searchParamsInstance.toString();if($onQueryParamsChange){var searchParams=getSearchParam();return $onQueryParamsChange(searchParams,searchParamsString)}var url=function(location,searchParamsString){var pathname=location.pathname,hash=location.hash,search="?".concat(searchParamsString);return hash&&(search=hash.indexOf("?")>-1?hash.replace(/\?.*/,(function(){return search})):hash+search),pathname+search}(location,searchParamsString);history.push?history.push(url):history(url)}),[history,location,searchParamsInstance,getSearchParam,$onQueryParamsChange]),updateQueryParams=React.useCallback((function(queryParams){_.isEmpty(queryParamKeys)||(_.forIn(queryParams,(function(paramValue,paramKey){if(queryParamKeys.includes(paramKey))switch(!0){case _.isNumber(paramValue):case _.isString(paramValue):searchParamsInstance.set(paramKey,"".concat(paramValue));break;case _.isArray(paramValue):searchParamsInstance.delete(paramKey),paramValue.map((function(paramValueItem){searchParamsInstance.append(paramKey,paramValueItem)}));break;case _.isNil(paramValue):searchParamsInstance.delete(paramKey)}})),handleQueryParamsChange())}),[queryParamKeys,searchParamsInstance,handleQueryParamsChange]),updateListParams=React.useCallback((function(params){var multiply=null==params?void 0:params.multiply;!0===multiply&&(null==params||delete params.multiply);var validParams=__assign({},params),unValidKeys=[];!0===multiply&&(validParams=_.reduce(params,(function(acc,item){return item.searchParam&&item.value?acc[item.searchParam]=item.value:unValidKeys.push(item.searchParam),acc}),{})),setSelectedRow({selectedRowKeys:[],selectedItems:[]}),setListParams((function(prevParams){var validPrevParams=__assign({},prevParams);!0===multiply&&(validPrevParams=_.reduce(prevParams,(function(acc,value,key){return unValidKeys.includes(key)||(acc[key]=value),acc}),{}));var newParams=__assign(__assign({},validPrevParams),validParams);return updateQueryParams(__assign({},newParams)),newParams}))}),[setListParams,updateQueryParams]),updateFilterData=React.useCallback((function(params){setFilterData((function(prevFilterData){return __assign(__assign({},prevFilterData),params)}))}),[]),loadFirstPage=React.useCallback((function(){1!==pageNo?updateListParams({pageNo:1}):loadList()}),[pageNo,updateListParams,loadList]),handleTableChange=React.useCallback((function(pagination,filters,sorter){var nextCurrent=pagination.current,nextPageSize=pagination.pageSize,isPaginationChange=nextCurrent!==pageNo||nextPageSize!==pageSize,order=sorter.order,field=sorter.field,filterData=__assign(__assign({},order?{order:TABLE_ORDER_MAP[order],orderBy:field}:{}),filters),params=_.assign(isPaginationChange?{pageNo:nextCurrent,pageSize:nextPageSize}:{pageNo:1},filterData);updateListParams(params),updateFilterData(filterData)}),[pageNo,pageSize,updateListParams,updateFilterData]),handlePageNoChange=React.useCallback((function(pageNo){updateListParams({pageNo:pageNo})}),[updateListParams]),handlePageSizeChange=React.useCallback((function(_pageNo,pageSize){updateListParams({pageSize:pageSize})}),[updateListParams]),handleFilterChange=React.useCallback((function(params){var newParams=__assign({pageNo:1},params);updateListParams(newParams),updateFilterData(params),_.every(newParams,(function(value,key){return _.isEqual(value,listParams[key])}))&&reload()}),[listParams,updateListParams,updateFilterData,reload]),handleSelectedRowKeysSet=React.useCallback((function(selectedRowKeys){var selectedItems=_.map(selectedRowKeys,(function(key){var _a;return rowKey?_.find(dataSource,((_a={})[rowKey]=key,_a)):_.get(dataSource,key)}));setSelectedRow({selectedRowKeys:selectedRowKeys,selectedItems:selectedItems})}),[dataSource,rowKey]),handleSelectChange=React.useCallback((function(selectedRowKeys){var _a;handleSelectedRowKeysSet(selectedRowKeys),null===(_a=null==customFunctions?void 0:customFunctions.handleSelectChange)||void 0===_a||_a.call(customFunctions,selectedRowKeys)}),[handleSelectedRowKeysSet,customFunctions]),tableActions=React.useMemo((function(){return __assign({loadList:loadList,loadFirstPage:loadFirstPage,setListParams:setListParams,handleFilterChange:handleFilterChange},customFunctions)}),[loadList,loadFirstPage,setListParams,handleFilterChange,customFunctions]);Object.assign(callbackRef.current.tableActions,tableActions),callbackRef.current.tableOptions=tableOptions;var selectedRowKeys=selectedRow.selectedRowKeys;return React.useEffect((function(){if(!_.isEmpty(queryParamKeys)){var needReload_1=!1;_.forIn(defaultListParams,(function(paramValue,paramKey){if(!_.isEqual(paramValue,listParams[paramKey]))return needReload_1=!0,!1})),needReload_1||_.forIn(listParams,(function(paramValue,paramKey){if(!_.isEqual(paramValue,defaultListParams[paramKey]))return needReload_1=!0,!1})),needReload_1&&setListParams(defaultListParams)}}),[search]),{key:search,className:className,title:title,toolbarProps:{withToolbar:Boolean((null===(_u=null==multiFilterConfig?void 0:multiFilterConfig.controls)||void 0===_u?void 0:_u.length)||(null===(_v=null==controlsConfig?void 0:controlsConfig.controls)||void 0===_v?void 0:_v.length)||bulkConfig||bulkComp||(null===(_w=null==filterConfig?void 0:filterConfig.controls)||void 0===_w?void 0:_w.length)||filterComp||isMore20),controlsConfig:controlsConfig,multiFilterConfig:multiFilterConfig,bulkProps:{bulkComp:bulkComp,bulkConfig:bulkConfig},filterProps:{filterComp:filterComp,filterConfig:filterConfig,cloumnsKeyList:cloumnsKeyList,isMore20:isMore20,setCloumnKeys:setCloumnKeys,handleTableCommand:handleTableCommand},onSearch:updateListParams,onReload:loadList,columns:columns},setColumnsConfig:setColumnsConfig,tableProps:__assign(__assign(__assign(__assign({rowKey:rowKey||function(__,index){return index},loading:loading,dataSource:dataSource},"none"!==select?{rowSelection:{selectedRowKeys:selectedRowKeys,type:"single"===select?"radio":"checkbox",getCheckboxProps:_.get(tableConfig,"getCheckboxProps"),onChange:handleSelectChange}}:{}),{pagination:__assign({current:pageNo,pageSize:pageSize,pageSizeOptions:pageSizeOptions||DEFAULT_PAGESIZE_OPTIONS,total:totalCount,showSizeChanger:!0,showQuickJumper:!0,showTotal:function(){return"".concat(null==locale?void 0:locale.total).concat(totalCount).concat(null==locale?void 0:locale.stripData)}},card?{onChange:handlePageNoChange,onShowSizeChange:handlePageSizeChange}:{}),onChange:handleTableChange}),tableConfig),{columns:columns}),tableComp:tableComp,card:card,emptyConfig:emptyConfig,dialogProps:dialogProps,tableActions:tableActions,filterData:filterData,listParams:listParams,httpStatusCode:httpStatusCode,setListParams:setListParams,setSelectedRowKeys:handleSelectedRowKeysSet,updateListParams:updateListParams,handleCommand:handleCommand,handleTableCommand:handleTableCommand,handleFilterChange:handleFilterChange}},exports.useThrottle=function(value,options){var _a=__read(React.useState(value),2),throttled=_a[0],setThrottled=_a[1],run=function(fn,options){var _a,fnRef=useLatest(fn),wait=null!==(_a=null==options?void 0:options.wait)&&void 0!==_a?_a:1e3,throttled=React.useMemo((function(){return _.throttle((function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return fnRef.current.apply(fnRef,__spreadArray([],__read(args),!1))}),wait,options)}),[]);return useUnmount((function(){throttled.cancel()})),{run:throttled,cancel:throttled.cancel,flush:throttled.flush}}((function(){setThrottled(value)}),options).run;return React.useEffect((function(){run()}),[value]),throttled},exports.useTimeout=function(callback,ms){void 0===ms&&(ms=0);var timeout=React.useRef(),savedCallback=React.useRef(callback),clear=React.useCallback((function(){timeout.current&&clearTimeout(timeout.current)}),[]),set=React.useCallback((function(){clear(),timeout.current=setTimeout((function(){return savedCallback.current()}),ms)}),[clear,ms]);return React.useEffect((function(){savedCallback.current=callback}),[callback]),React.useEffect((function(){return ms>=0&&set(),clear}),[ms,set,clear]),{set:set,clear:clear}},exports.useToggle=function(defaultValue,reverseValue){void 0===defaultValue&&(defaultValue=!1);var _a=__read(React.useState(defaultValue),2),state=_a[0],setState=_a[1];return[state,React.useMemo((function(){var reverseValueOrigin=void 0===reverseValue?!defaultValue:reverseValue;return{toggle:function(){return setState((function(value){return value===defaultValue?reverseValueOrigin:defaultValue}))}}}),[])]},exports.useUnmount=useUnmount,exports.useUpdate=function(){var setTick=__read(React.useState(0),2)[1];return React.useCallback((function(){setTick((function(tick){return tick+1}))}),[])},exports.useUpdateEffect=function(effect,deps){var isInitialMount=React.useRef(!0);React.useEffect(isInitialMount.current?function(){isInitialMount.current=!1}:effect,deps)},exports.useUserMedia=function(constraints,onSuccess,onError){var _a=__read(React.useState(!1),2),recording=_a[0],setRecording=_a[1],originalConstraints=useOriginalCopy$1(constraints),streamRef=React.useRef(null),handleSuccess=React.useCallback((function(stream){streamRef.current=stream,setRecording(!0),onSuccess&&onSuccess(stream)}),[onSuccess]),stop=React.useCallback((function(){streamRef.current&&(streamRef.current.getTracks().forEach((function(track){return track.stop()})),setRecording(!1),streamRef.current=null)}),[]),start=React.useCallback((function(){return __awaiter(void 0,void 0,void 0,(function(){var stream,error_1;return __generator(this,(function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),stop(),[4,adapterGetUserMedia(originalConstraints||DEFAULT_CONSTRAINTS)];case 1:return stream=_a.sent(),handleSuccess(stream),[3,3];case 2:return error_1=_a.sent(),onError&&onError(error_1),[3,3];case 3:return[2]}}))}))}),[stop,originalConstraints,handleSuccess,onError]);return React.useEffect((function(){return stop}),[stop]),{stream:streamRef.current,recording:recording,start:start,stop:stop}};
//# sourceMappingURL=index.cjs.js.map
