diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md new file mode 100644 index 000000000..542a10eb9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.md @@ -0,0 +1,27 @@ +--- +name: Bug Report +about: Report a issue to TX-LCN, please use this template. + + +--- + +- [ ] I have searched the [issues](https://github.com/codingapi/tx-lcn/issues) of this repository and believe that this is not a duplicate. + +### 1. Bug Description + + +### 2. Environment: +- JDK version: +- OS: +- TX-LCN version: +- Others: + +### 3. Exception Stacktrace + +``` +Paste your Exception Stacktrace here! +``` + +### 4. Tour Idea + + diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md new file mode 100644 index 000000000..7ebc5c5d1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md @@ -0,0 +1,16 @@ +--- +name: Feature Request +about: Suggest an idea for TX-LCN + +--- + +## Why you need it? + Is your feature request related to a problem? Please describe in details + + +## How it could be? +A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it. + + +## Other related information +Add any other context or screenshots about the feature request here. diff --git a/README.md b/README.md index 79bc3e680..7d69a8160 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,19 @@ -# tx-lcn分布式事务框架 (5.0.1.RELEASE) +# Distributed Transaction Framework - LCN (5.0.2.RELEASE) +[![Maven](https://img.shields.io/badge/endpoint.svg?url=https://bbs.txlcn.org/maven-central)](https://bbs.txlcn.org/maven-list) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/codingapi/tx-lcn/blob/master/LICENSE) [![Gitter](https://badges.gitter.im/codingapi/tx-lcn.svg)](https://gitter.im/codingapi/tx-lcn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -[![BBS](https://bbs.txlcn.org/style/Archlinux/txlcn-bbs.svg)](https://bbs.txlcn.org) -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?label=license)](https://github.com/codingapi/tx-lcn/blob/master/LICENSE) - - -## 项目介绍 - -5.0完全拥抱springboot体系,基于JDK1.8,不仅仅支持LCN事务模式,同时引入了TCC,TXC模式,把分布式事务协调的模式抽象出来,让各种模式可以嵌套使用。 - -事务模式说明:TCC是用户自己实现提交回滚业务,LCN是框架代理JDBC Connection实现提交回滚业务, TXC是框架分析业务SQL提前提交,在需要回滚时生成逆向回滚。 - -TCC忽略不说。LCN与TXC两种框架实现的事务模式到底那个更优越呢? - -理论上,在并发量大,资源相对紧张时,TXC要优于LCN,但从目前测试上来说,结果却非如此,LCN还是稍优于TXC。同时TXC还限制了业务SQL形式,未做到完全逆向 -后续版本将会着重优化TXC,包括性能上和SQL的完全逆向上。 - - -版本较4.x主要特点: -1. 基于springboot 研发 -2. 抽离LCN封装业务,提出业务接口层与通讯层,可支持自定义分布式事务模式与通讯模式。 -3. 支持LCN TXC TCC 三种事务模式,且可混合支持。 -4. 性能较优秀,去掉了线程等待机制,提高吞吐量。 - - - -## 模块划分 - -1. txlcn-tc:*TXLCN分布式事务客户端* -2. txlcn-common:*公共模块* -3. txlcn-logger:*日志模块。(默认提供日志持久化到MySQL的支持)* -4. txlcn-tm:*TXLCN事务管理器* -5. txlcn-txmsg:*事务消息扩展接口* -6. txlcn-txmsg-netty:*事务消息接口的Netty实现* -7. txlcn-tracing:*分布式事务追踪工具* - -## 官网文档 - -官网文档 见docs分支 - -https://txlcn.org - - -技术交流群:554855843(已满) 970071379(未满) +## Modules +1. txlcn-tc: *Distributed Transaction Client* +2. txlcn-common: *Commons* +3. txlcn-logger: *Provide persistent logs to MySQL* +4. txlcn-tm: *Distributed Transaction Manager* +5. txlcn-txmsg: *Distributed Transaction Message Extensions API* +6. txlcn-txmsg-netty: *Distributed Transaction Message Extensions Implementation* +7. txlcn-tracing: *Distributed Transaction Tracing* + +## The Authority +Website: [https://txlcn.org](https://txlcn.org/en-us/) +Statistics: [Leave your company messages](https://github.com/codingapi/tx-lcn/issues/7) +QQ:554855843 (Hot) 970071379(Normal) diff --git a/README_zh_CN.md b/README_zh_CN.md new file mode 100644 index 000000000..5c42f5035 --- /dev/null +++ b/README_zh_CN.md @@ -0,0 +1,46 @@ +# TX-LCN分布式事务框架 (5.0.2.RELEASE) + +[![Maven](https://img.shields.io/badge/endpoint.svg?url=https://bbs.txlcn.org/maven-central)](https://bbs.txlcn.org/maven-list) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/codingapi/tx-lcn/blob/master/LICENSE) +[![Gitter](https://badges.gitter.im/codingapi/tx-lcn.svg)](https://gitter.im/codingapi/tx-lcn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + + +## 项目介绍 + +5.0完全拥抱springboot体系,基于JDK1.8,不仅仅支持LCN事务模式,同时引入了TCC,TXC模式,把分布式事务协调的模式抽象出来,让各种模式可以嵌套使用。 + +事务模式说明:TCC是用户自己实现提交回滚业务,LCN是框架代理JDBC Connection实现提交回滚业务, TXC是框架分析业务SQL提前提交,在需要回滚时生成逆向回滚。 + +TCC忽略不说。LCN与TXC两种框架实现的事务模式到底那个更优越呢? + +理论上,在并发量大,资源相对紧张时,TXC要优于LCN,但从目前测试上来说,结果却非如此,LCN还是稍优于TXC。同时TXC还限制了业务SQL形式,未做到完全逆向 +后续版本将会着重优化TXC,包括性能上和SQL的完全逆向上。 + + +版本较4.x主要特点: +1. 基于SpringBoot研发 +2. 抽离LCN封装业务,提出业务接口层与通讯层,可支持自定义分布式事务模式与通讯模式。 +3. 支持LCN TXC TCC 三种事务模式,且可混合支持。 +4. 性能较优秀,去掉了线程等待机制,提高吞吐量。 + + + +## 模块划分 + +1. txlcn-tc:*TXLCN分布式事务客户端* +2. txlcn-common:*公共模块* +3. txlcn-logger:*日志模块。(默认提供日志持久化到MySQL的支持)* +4. txlcn-tm:*TXLCN事务管理器* +5. txlcn-txmsg:*事务消息扩展接口* +6. txlcn-txmsg-netty:*事务消息接口的Netty实现* +7. txlcn-tracing:*分布式事务追踪工具* + +## 官网文档 + +官网文档 见docs分支 + +https://txlcn.org + + +技术交流群:554855843(已满) 970071379(未满) + diff --git a/pom.xml b/pom.xml index a63f18e13..efafe26d0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.codingapi.txlcn tx-lcn - 5.0.1.RELEASE + 5.0.2.RELEASE pom @@ -43,7 +43,7 @@ 2.10.3 1.6 - 5.0.1.RELEASE + 5.0.2.RELEASE 1.18.0 Finchley.SR2 @@ -51,7 +51,7 @@ 1.2.34 19.0 4.0.38 - 1.1.3 + 1.6.0 4.0.0 3.4.2 @@ -59,8 +59,8 @@ 1.3 1.4.197 3.1.0 - 1.2.10 - 1.3.2 + + 2.6.5 8.18.0 2.3.0 @@ -112,15 +112,16 @@ - com.dyuproject.protostuff + io.protostuff protostuff-core - com.dyuproject.protostuff + io.protostuff protostuff-runtime + com.esotericsoftware kryo-shaded @@ -138,12 +139,6 @@ - - com.codingapi.txlcn - txlcn-tc - ${codingapi.txlcn.version} - - com.codingapi.txlcn txlcn-txmsg-netty @@ -174,18 +169,6 @@ ${codingapi.txlcn.version} - - com.github.pagehelper - pagehelper-spring-boot-starter - ${txlcn-com.github.pagehelper.version} - - - - org.mybatis.spring.boot - mybatis-spring-boot-starter - ${txlcn-org.mybatis.spring.boot.version} - - com.h2database h2 @@ -235,13 +218,13 @@ - com.dyuproject.protostuff + io.protostuff protostuff-core ${txlcn-protostuff.version} - com.dyuproject.protostuff + io.protostuff protostuff-runtime ${txlcn-protostuff.version} @@ -282,6 +265,13 @@ ${txlcn-org.springframework.cloud.commons.version} + + com.netflix.hystrix + hystrix-core + 1.5.18 + + + diff --git a/run.txmanager.bat b/run.txmanager.bat index 9487d3265..d1776415e 100644 --- a/run.txmanager.bat +++ b/run.txmanager.bat @@ -1,4 +1,4 @@ @echo off -start java -jar -Xms256m -Xmx512m txlcn-tm/target/txlcn-tm-5.0.1.RELEASE.jar +start java -jar -Xms256m -Xmx512m txlcn-tm/target/txlcn-tm-5.0.2.RELEASE.jar diff --git a/tm.docker.build.md b/tm.docker.build.md new file mode 100644 index 000000000..f777e81b2 --- /dev/null +++ b/tm.docker.build.md @@ -0,0 +1,64 @@ +### 构建镜像到本地 +``` +# 当前路径 tx-lcn/txlcn-tm +mvn clean package -DskipTests docker:build +``` + +#### 运行说明 +- 可以不用构建,在有docker环境的机器上直接运行下面命令 + +1 、 命令行传参数运行 + +``` +docker run -p 7970:7970 -p 8070:8070 --restart always --name tm -e spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tx_manager -e spring.datasource.username=root -e spring.datasource.password=root -e spring.redis.host=127.0.0.1 -e spring.redis.port=6379 -e spring.redis.password= -e tx-lcn.manager.admin-key=123456 -d codingapi/txlcn-tm +``` +- 说明 +- -p 端口映射 宿主机器端口:容器内端口 +- --name : 容器别名 +- --restart always : 容器伴随docker服务启动(如果docker是开机启动,那么这个容器就是开机启动的) +- -d : 放入后台运行 +- -e 相当于 java -jar tm.jar 后面的参数, +- spring.datasource.url 这个配置里面如果有特殊符号 命令行不支持,建议使用第二种方式 + +2 、 增加外部配置文件运行. 需要在宿主机器上有文件 /opt/data/lcntm/application-dev.properties +``` +spring.application.name=tx-manager +server.port=7970 +spring.datasource.driver-class-name=com.mysql.jdbc.Driver +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tx-manager?characterEncoding=UTF-8 +spring.datasource.username=root +spring.datasource.password=root +#mybatis.configuration.map-underscore-to-camel-case=true +#mybatis.configuration.use-generated-keys=true +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.hibernate.ddl-auto=none +#tx-lcn.logger.enabled=true +# TxManager Host Ip +tx-lcn.manager.host=127.0.0.1 +# TxClient连接请求端口 +tx-lcn.manager.port=8070 +tx-lcn.manager.admin-key=123456 + +# 心跳检测时间(ms) +#tx-lcn.manager.heart-time=15000 +# 分布式事务执行总时间 +#tx-lcn.manager.dtx-time=30000 +#参数延迟删除时间单位ms +#tx-lcn.message.netty.attr-delay-time=10000 +#tx-lcn.manager.concurrent-level=128 +# 开启日志 +#tx-lcn.logger.enabled=true +#logging.level.com.codingapi=debug +#redisIp +spring.redis.host=127.0.0.1 +#redis\u7AEF\u53E3 +spring.redis.port=6379 +#redis\u5BC6\u7801 +#spring.redis.password= +``` +执行命令 +``` +docker run -p 7970:7970 -p 8070:8070 --restart always --name tm -v /opt/data/lcntm:/opt/data/lcntm -e spring.profiles.active=dev -e spring.config.additional-location=/opt/data/lcntm/application-dev.properties -d codingapi/txlcn.tm +``` +- 说明 +- -v : 文件挂载 diff --git a/txlcn-common/pom.xml b/txlcn-common/pom.xml index 850158037..595e9b56e 100644 --- a/txlcn-common/pom.xml +++ b/txlcn-common/pom.xml @@ -5,7 +5,7 @@ tx-lcn com.codingapi.txlcn - 5.0.1.RELEASE + 5.0.2.RELEASE 4.0.0 diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/SerializerException.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/SerializerException.java index c03e8a6b1..a8805ab45 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/SerializerException.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/SerializerException.java @@ -15,11 +15,13 @@ */ package com.codingapi.txlcn.common.exception; +import java.io.IOException; + /** * @author lorne 2018/12/2 * */ -public class SerializerException extends Exception { +public class SerializerException extends IOException { public SerializerException() { @@ -38,9 +40,7 @@ public SerializerException(Throwable cause) { super(cause); } - protected SerializerException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } + } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/TransactionClearException.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/TransactionClearException.java index 6f30fdf13..086e5383f 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/TransactionClearException.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/TransactionClearException.java @@ -25,6 +25,21 @@ */ @NoArgsConstructor public class TransactionClearException extends Exception { + + private static final int NEED_COMPENSATION = 1; + + private int code; + + public static TransactionClearException needCompensation() { + TransactionClearException clearException = new TransactionClearException("need compensation"); + clearException.code = NEED_COMPENSATION; + return clearException; + } + + public boolean isNeedCompensation() { + return this.code == NEED_COMPENSATION; + } + public TransactionClearException(String message) { super(message); } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/TxcLogicException.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/TxcLogicException.java index f47667066..af701788b 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/TxcLogicException.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/exception/TxcLogicException.java @@ -22,6 +22,17 @@ * @author ujued */ public class TxcLogicException extends Exception { + + private Object attachment; + + public Object getAttachment() { + return attachment; + } + + public void setAttachment(Object attachment) { + this.attachment = attachment; + } + public TxcLogicException() { } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/ApplicationInformation.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/ApplicationInformation.java index 033f437da..7dbf59ffb 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/ApplicationInformation.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/ApplicationInformation.java @@ -15,6 +15,7 @@ */ package com.codingapi.txlcn.common.util; +import com.sun.org.apache.regexp.internal.RE; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.util.StringUtils; @@ -54,8 +55,13 @@ public static String[] splitAddress(String hostAndPort) { throw new IllegalStateException("non exists port"); } String[] result = hostAndPort.split(":"); + if (StringUtils.isEmpty(result[0])) { + result[0] = "0.0.0.0"; + return result; + } if (result[0].charAt(0) == '/') { result[0] = result[0].substring(1); + return result; } return result; } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Maps.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Maps.java index 1764dad53..b256b5dc8 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Maps.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Maps.java @@ -77,6 +77,7 @@ public static Map of(K key1, V value1, K key2, V value2, K key3, V return map; } + static class ImmutableMap implements Map { private K key1; @@ -227,7 +228,21 @@ public Collection values() { @Override public Set> entrySet() { - throw new UnsupportedOperationException("not support entey set."); + int size = size(); + Set> entries = new HashSet<>(maxSize); + if (Objects.nonNull(key1)) { + entries.add(new SimpleEntry<>(this, key1)); + } + if (Objects.nonNull(key2)) { + entries.add(new SimpleEntry<>(this, key2)); + } + if (Objects.nonNull(key3)) { + entries.add(new SimpleEntry<>(this, key3)); + } + if (Objects.nonNull(key4)) { + entries.add(new SimpleEntry<>(this, key4)); + } + return entries; } private int keyIndex(K o) { @@ -261,5 +276,34 @@ private V getValueByKeyIndex(int index) { } return null; } + + static class SimpleEntry implements Map.Entry { + + private ImmutableMap map; + + private K key; + + public SimpleEntry(ImmutableMap map, K key) { + this.map = map; + this.key = key; + } + + @Override + public K getKey() { + return key; + } + + @Override + public V getValue() { + return map.get(key); + } + + @Override + public V setValue(V value) { + V old = getValue(); + map.put(key, value); + return old; + } + } } } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/SpringUtils.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/SpringUtils.java new file mode 100644 index 000000000..9af900c2c --- /dev/null +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/SpringUtils.java @@ -0,0 +1,32 @@ +package com.codingapi.txlcn.common.util; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.lang.NonNull; + +import java.util.Optional; + +/** + * Description: + * Date: 19-2-14 上午11:37 + * + * @author ujued + */ +public class SpringUtils implements ApplicationContextAware { + + private static ApplicationContext applicationContext; + + @Override + public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException { + SpringUtils.applicationContext = applicationContext; + } + + public static T getBean(Class type) { + try { + return Optional.ofNullable(applicationContext).orElseThrow(() -> new IllegalStateException("non in spring application context.")).getBean(type); + } catch (Exception e) { + return null; + } + } +} diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Transactions.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Transactions.java index 2f08249a1..b3bf8c81e 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Transactions.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/Transactions.java @@ -17,6 +17,8 @@ import org.springframework.util.DigestUtils; +import java.util.Optional; + /** * Description: 事务相关工具类 * Date: 2018/12/17 @@ -69,4 +71,13 @@ public static String unitId(String methodSignature) { public static void setApplicationIdWhenRunning(String applicationIdWhenRunning) { Transactions.APPLICATION_ID_WHEN_RUNNING = applicationIdWhenRunning; } + + /** + * 获取应用标识。(OnRunning) + * + * @return ApplicationId + */ + public static String getApplicationId() { + return Optional.ofNullable(APPLICATION_ID_WHEN_RUNNING).orElse("unsuitable call this"); + } } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/DefaultIdGen.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/DefaultIdGen.java index f586cee4b..abd46e1d8 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/DefaultIdGen.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/DefaultIdGen.java @@ -49,7 +49,7 @@ public synchronized String nextId() { long seqWithMachine = (machineId << machineOffset & Long.MAX_VALUE) | seq; - return String.valueOf(curTime - START_TIME) + seqWithMachine; + return Long.toHexString((curTime - START_TIME) ^ 9527) + Long.toHexString(seqWithMachine ^ 9527); } private long tilNextMillis() { diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/IdGen.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/IdGen.java index 01dfd81cb..65588fc46 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/IdGen.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/IdGen.java @@ -22,5 +22,10 @@ * @author ujued */ public interface IdGen { + /** + * get next id + * + * @return string type id + */ String nextId(); } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/IdGenInit.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/IdGenInit.java index 7b1239bc8..58170015d 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/IdGenInit.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/IdGenInit.java @@ -11,13 +11,25 @@ @Slf4j public abstract class IdGenInit { - public static void applySnowFlakeIdGen(int machineLen, int machineId) { + /** + * 原版雪花算法,生成一个long类型的ID + * + * @param machineLen 机器位长度 + * @param machineId 机器ID + */ + public static void applySnowFlakeIdGen(int machineLen, long machineId) { SnowFlakeGenerator.Factory factory = new SnowFlakeGenerator.Factory(machineLen, 0); SnowFlakeGenerator snowFlakeGenerator = factory.create(0, machineId); RandomUtils.init(() -> String.valueOf(snowFlakeGenerator.nextId())); } - public static void applyDefaultIdGen(int seqLen, int machineId) { + /** + * 默认ID生成。和雪花组成一样,加长了机器位,生成了更长的ID + * + * @param seqLen 序列位长度 + * @param machineId 机器ID + */ + public static void applyDefaultIdGen(int seqLen, long machineId) { RandomUtils.init(new DefaultIdGen(seqLen, machineId)); } } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/ModIdProvider.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/ModIdProvider.java new file mode 100644 index 000000000..928163cd5 --- /dev/null +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/ModIdProvider.java @@ -0,0 +1,16 @@ +package com.codingapi.txlcn.common.util.id; + +/** + * Description: + * Date: 19-2-14 下午4:41 + * + * @author ujued + */ +public interface ModIdProvider { + /** + * get mod id + * + * @return id + */ + String modId(); +} diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/SnowFlakeGenerator.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/SnowFlakeGenerator.java index e4aded1f8..925e0cb6d 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/SnowFlakeGenerator.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/id/SnowFlakeGenerator.java @@ -15,9 +15,6 @@ */ package com.codingapi.txlcn.common.util.id; -import java.time.LocalDateTime; -import java.time.ZoneOffset; - /** * Description: * Date: 19-1-30 下午8:10 @@ -159,10 +156,5 @@ private long tilNextMillis() { } return timestamp; } - - public static void main(String[] args) { - LocalDateTime localDateTime = LocalDateTime.of(2019, 1, 1, 0, 0, 0, 0); - System.out.println(localDateTime.toEpochSecond(ZoneOffset.ofHours(8))); - System.out.println(System.currentTimeMillis() / 1000); - } + } diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/DateDelegate.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/DateDelegate.java new file mode 100644 index 000000000..d38f5dc1e --- /dev/null +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/DateDelegate.java @@ -0,0 +1,39 @@ +package com.codingapi.txlcn.common.util.serializer; + + + +import io.protostuff.Input; +import io.protostuff.Output; +import io.protostuff.Pipe; +import io.protostuff.WireFormat; +import io.protostuff.runtime.Delegate; + +import java.io.IOException; +import java.sql.Date; + +public class DateDelegate implements Delegate { + + @Override + public WireFormat.FieldType getFieldType() { + return WireFormat.FieldType.FIXED64; + } + + public Date readFrom(Input input) throws IOException { + return new Date(input.readFixed64()); + } + + public void writeTo(Output output, int number, Date value, + boolean repeated) throws IOException { + output.writeFixed64(number, value.getTime(), repeated); + } + + public void transfer(Pipe pipe, Input input, Output output, int number, + boolean repeated) throws IOException { + output.writeFixed64(number, input.readFixed64(), repeated); + } + + @Override + public Class typeClass() { + return Date.class; + } +} diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/ProtostuffSerializer.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/ProtostuffSerializer.java index 8ecb74c20..b565bea2d 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/ProtostuffSerializer.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/ProtostuffSerializer.java @@ -16,23 +16,28 @@ package com.codingapi.txlcn.common.util.serializer; import com.codingapi.txlcn.common.exception.SerializerException; -import com.dyuproject.protostuff.LinkedBuffer; -import com.dyuproject.protostuff.ProtostuffIOUtil; -import com.dyuproject.protostuff.Schema; + +import io.protostuff.LinkedBuffer; +import io.protostuff.ProtostuffIOUtil; +import io.protostuff.Schema; import org.objenesis.Objenesis; import org.objenesis.ObjenesisStd; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.OutputStream; /** * @author lorne 2017/11/11 */ - @SuppressWarnings("unchecked") - class ProtostuffSerializer implements ISerializer { +@SuppressWarnings("unchecked") +class ProtostuffSerializer implements ISerializer { private static final SchemaCache SCHEMA_CACHE = SchemaCache.getInstance(); private static final Objenesis OBJENESIS = new ObjenesisStd(true); + private static Schema getSchema(Class cls) { return (Schema) SCHEMA_CACHE.get(cls); } @@ -42,7 +47,7 @@ private static Schema getSchema(Class cls) { public byte[] serialize(Object obj) throws SerializerException { Class cls = obj.getClass(); LinkedBuffer buffer = LinkedBuffer.allocate(LinkedBuffer.DEFAULT_BUFFER_SIZE); - try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()){ + try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { Schema schema = getSchema(cls); ProtostuffIOUtil.writeTo(outputStream, obj, schema, buffer); return outputStream.toByteArray(); @@ -63,7 +68,7 @@ public void serialize(Object obj, OutputStream outputStream) throws SerializerEx ProtostuffIOUtil.writeTo(outputStream, obj, schema, buffer); } catch (Exception e) { throw new SerializerException(e.getMessage(), e); - }finally { + } finally { buffer.clear(); } } @@ -85,7 +90,7 @@ public T deSerialize(byte[] param, Class cls) throws SerializerException @Override public T deSerialize(InputStream inputStream, Class cls) throws SerializerException { T object; - try{ + try { object = OBJENESIS.newInstance(cls); Schema schema = getSchema(cls); ProtostuffIOUtil.mergeFrom(inputStream, object, schema); diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/SchemaCache.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/SchemaCache.java index 67bf7dfd3..e84dee23b 100644 --- a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/SchemaCache.java +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/SchemaCache.java @@ -15,11 +15,23 @@ */ package com.codingapi.txlcn.common.util.serializer; -import com.dyuproject.protostuff.Schema; -import com.dyuproject.protostuff.runtime.RuntimeSchema; + +import com.codingapi.txlcn.common.util.serializer.jdk.ListMultimapDelegate; +import com.codingapi.txlcn.common.util.serializer.jdk.MultimapDelegate; +import com.codingapi.txlcn.common.util.serializer.jdk.MultisetDelegate; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Multimap; +import com.google.common.collect.Multiset; +import io.protostuff.Schema; +import io.protostuff.runtime.DefaultIdStrategy; +import io.protostuff.runtime.Delegate; +import io.protostuff.runtime.RuntimeEnv; +import io.protostuff.runtime.RuntimeSchema; +import java.sql.Date; +import java.sql.Timestamp; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -32,6 +44,35 @@ private static class SchemaCacheHolder { private static SchemaCache cache = new SchemaCache(); } + private final static DefaultIdStrategy idStrategy = ((DefaultIdStrategy) RuntimeEnv.ID_STRATEGY); + + //java.sql + private final static Delegate TIMESTAMP_DELEGATE = new TimestampDelegate(); + private final static Delegate DATE_DELEGATE = new DateDelegate(); + + //google gauva + private final static Delegate LISTMULTIMAP_DELEGATE = new ListMultimapDelegate(); + private final static Delegate MULTIMAP_DELEGATE = new MultimapDelegate(); + private final static Delegate MULTISET_DELEGATE = new MultisetDelegate(); + + static { + idStrategy.registerDelegate(TIMESTAMP_DELEGATE); + idStrategy.registerDelegate(DATE_DELEGATE); + idStrategy.registerDelegate(LISTMULTIMAP_DELEGATE); + idStrategy.registerDelegate(MULTIMAP_DELEGATE); + idStrategy.registerDelegate(MULTISET_DELEGATE); + } + + /** + * 注册 Delegate + * @param delegate delegate + */ + public void registerDelegate(Delegate delegate){ + if(delegate!=null){ + idStrategy.registerDelegate(delegate); + } + } + public static SchemaCache getInstance() { return SchemaCacheHolder.cache; } @@ -42,8 +83,7 @@ public static SchemaCache getInstance() { private Schema get(final Class cls, Cache, Schema> cache) { try { - return cache.get(cls, () -> RuntimeSchema.createFrom(cls)); - + return cache.get(cls, () -> RuntimeSchema.createFrom(cls,idStrategy)); } catch (ExecutionException e) { e.printStackTrace(); return null; diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/TimestampDelegate.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/TimestampDelegate.java new file mode 100644 index 000000000..90b6df320 --- /dev/null +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/TimestampDelegate.java @@ -0,0 +1,59 @@ +/* + * Copyright 2017-2019 CodingApi . + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.codingapi.txlcn.common.util.serializer; + + +import io.protostuff.Input; +import io.protostuff.Output; +import io.protostuff.Pipe; +import io.protostuff.WireFormat; +import io.protostuff.runtime.Delegate; + +import java.io.IOException; +import java.sql.Timestamp; + + +/** + * protostuff timestamp Delegate + * + * @author jiujie + * + */ +public class TimestampDelegate implements Delegate { + + public WireFormat.FieldType getFieldType() { + return WireFormat.FieldType.FIXED64; + } + + public Class typeClass() { + return Timestamp.class; + } + + public Timestamp readFrom(Input input) throws IOException { + return new Timestamp(input.readFixed64()); + } + + public void writeTo(Output output, int number, Timestamp value, + boolean repeated) throws IOException { + output.writeFixed64(number, value.getTime(), repeated); + } + + public void transfer(Pipe pipe, Input input, Output output, int number, + boolean repeated) throws IOException { + output.writeFixed64(number, input.readFixed64(), repeated); + } + +} \ No newline at end of file diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/JavaSerializer.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/JavaSerializer.java new file mode 100644 index 000000000..2204163bb --- /dev/null +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/JavaSerializer.java @@ -0,0 +1,69 @@ +/* + * Copyright 2017-2019 CodingApi . + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.codingapi.txlcn.common.util.serializer.jdk; + +import com.codingapi.txlcn.common.exception.SerializerException; +import com.codingapi.txlcn.common.util.serializer.ISerializer; + +import java.io.*; + +/** + * JavaSerializer. + * + * @author lorne + */ +@SuppressWarnings("unchecked") +public class JavaSerializer implements ISerializer { + + @Override + public byte[] serialize(final Object obj) throws SerializerException { + try (ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream(); ObjectOutput objectOutput = new ObjectOutputStream(arrayOutputStream)) { + objectOutput.writeObject(obj); + objectOutput.flush(); + return arrayOutputStream.toByteArray(); + } catch (IOException e) { + throw new SerializerException("java serialize error " + e.getMessage()); + } + } + + @Override + public T deSerialize(final byte[] param, final Class clazz) throws SerializerException { + try (ByteArrayInputStream arrayInputStream = new ByteArrayInputStream(param); ObjectInput input = new ObjectInputStream(arrayInputStream)) { + return (T) input.readObject(); + } catch (IOException | ClassNotFoundException e) { + throw new SerializerException("java deSerialize error " + e.getMessage()); + } + } + + @Override + public void serialize(Object obj, OutputStream outputStream) throws SerializerException { + try (ObjectOutput objectOutput = new ObjectOutputStream(outputStream)) { + objectOutput.writeObject(obj); + objectOutput.flush(); + } catch (IOException e) { + throw new SerializerException("java serialize error " + e.getMessage()); + } + } + + @Override + public T deSerialize(InputStream inputStream, Class clazz) throws SerializerException { + try (ObjectInput input = new ObjectInputStream(inputStream)) { + return (T) input.readObject(); + } catch (IOException | ClassNotFoundException e) { + throw new SerializerException("java deSerialize error " + e.getMessage()); + } + } +} \ No newline at end of file diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/ListMultimapDelegate.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/ListMultimapDelegate.java new file mode 100644 index 000000000..5c799df15 --- /dev/null +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/ListMultimapDelegate.java @@ -0,0 +1,57 @@ +/* + * Copyright 2017-2019 CodingApi . + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.codingapi.txlcn.common.util.serializer.jdk; + +import com.google.common.collect.ListMultimap; +import io.protostuff.*; +import io.protostuff.runtime.Delegate; + +import java.io.IOException; + +/** + * JavaSerializer. ListMultimapDelegate + * + * @author lorne + */ +public class ListMultimapDelegate implements Delegate { + + private JavaSerializer javaSerializer = new JavaSerializer(); + + @Override + public WireFormat.FieldType getFieldType() { + return WireFormat.FieldType.BYTES; + } + + public ListMultimap readFrom(Input input) throws IOException { + return javaSerializer.deSerialize(input.readBytes().toByteArray(),typeClass()); + } + + public void writeTo(Output output, int number, ListMultimap value, + boolean repeated) throws IOException { + byte[] bytes = javaSerializer.serialize(value); + output.writeBytes(number, ByteString.copyFrom(bytes), repeated); + } + + public void transfer(Pipe pipe, Input input, Output output, int number, + boolean repeated) throws IOException { + output.writeBytes(number, input.readBytes(), repeated); + } + + @Override + public Class typeClass() { + return ListMultimap.class; + } +} diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/MultimapDelegate.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/MultimapDelegate.java new file mode 100644 index 000000000..d0c42ac59 --- /dev/null +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/MultimapDelegate.java @@ -0,0 +1,58 @@ +/* + * Copyright 2017-2019 CodingApi . + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.codingapi.txlcn.common.util.serializer.jdk; + +import com.google.common.collect.Multimap; +import io.protostuff.*; +import io.protostuff.runtime.Delegate; + +import java.io.IOException; + +/** + * JavaSerializer. MultimapDelegate + * + * @author lorne + */ +public class MultimapDelegate implements Delegate { + + private JavaSerializer javaSerializer = new JavaSerializer(); + + @Override + public WireFormat.FieldType getFieldType() { + return WireFormat.FieldType.BYTES; + } + + public Multimap readFrom(Input input) throws IOException { + return javaSerializer.deSerialize(input.readBytes().toByteArray(),typeClass()); + } + + public void writeTo(Output output, int number, Multimap value, + boolean repeated) throws IOException { + + byte[] bytes = javaSerializer.serialize(value); + output.writeBytes(number, ByteString.copyFrom(bytes), repeated); + } + + public void transfer(Pipe pipe, Input input, Output output, int number, + boolean repeated) throws IOException { + output.writeBytes(number, input.readBytes(), repeated); + } + + @Override + public Class typeClass() { + return Multimap.class; + } +} diff --git a/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/MultisetDelegate.java b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/MultisetDelegate.java new file mode 100644 index 000000000..4f770d6a2 --- /dev/null +++ b/txlcn-common/src/main/java/com/codingapi/txlcn/common/util/serializer/jdk/MultisetDelegate.java @@ -0,0 +1,58 @@ +/* + * Copyright 2017-2019 CodingApi . + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.codingapi.txlcn.common.util.serializer.jdk; + +import com.google.common.collect.Multiset; +import io.protostuff.*; +import io.protostuff.runtime.Delegate; + +import java.io.IOException; + + +/** + * JavaSerializer. MultisetDelegate + * + * @author lorne + */ +public class MultisetDelegate implements Delegate { + + private JavaSerializer javaSerializer = new JavaSerializer(); + + @Override + public WireFormat.FieldType getFieldType() { + return WireFormat.FieldType.BYTES; + } + + public Multiset readFrom(Input input) throws IOException { + return javaSerializer.deSerialize(input.readBytes().toByteArray(),typeClass()); + } + + public void writeTo(Output output, int number, Multiset value, + boolean repeated) throws IOException { + byte[] bytes = javaSerializer.serialize(value); + output.writeBytes(number, ByteString.copyFrom(bytes), repeated); + } + + public void transfer(Pipe pipe, Input input, Output output, int number, + boolean repeated) throws IOException { + output.writeBytes(number, input.readBytes(), repeated); + } + + @Override + public Class typeClass() { + return Multiset.class; + } +} diff --git a/txlcn-common/src/test/java/com/codingapi/txlcn/common/util/id/IdTest.java b/txlcn-common/src/test/java/com/codingapi/txlcn/common/util/id/IdTest.java new file mode 100644 index 000000000..fa8aec0fb --- /dev/null +++ b/txlcn-common/src/test/java/com/codingapi/txlcn/common/util/id/IdTest.java @@ -0,0 +1,24 @@ +package com.codingapi.txlcn.common.util.id; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** + * Description: + * Date: 19-2-22 下午3:35 + * + * @author ujued + */ +@RunWith(JUnit4.class) +public class IdTest { + + @Test + public void testDefaultIdGen() { + IdGenInit.applyDefaultIdGen(12, 1); + + for (int i = 0; i < 10; i++) { + System.out.println(RandomUtils.randomKey()); + } + } +} diff --git a/txlcn-logger/pom.xml b/txlcn-logger/pom.xml index abc479cde..0fc2b90ae 100644 --- a/txlcn-logger/pom.xml +++ b/txlcn-logger/pom.xml @@ -5,7 +5,7 @@ tx-lcn com.codingapi.txlcn - 5.0.1.RELEASE + 5.0.2.RELEASE 4.0.0 diff --git a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/AbstractTxLogger.java b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/AbstractTxLogger.java index acb780458..103972c0d 100644 --- a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/AbstractTxLogger.java +++ b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/AbstractTxLogger.java @@ -15,13 +15,17 @@ */ package com.codingapi.txlcn.logger; +import com.codingapi.txlcn.common.util.SpringUtils; import com.codingapi.txlcn.common.util.Transactions; +import com.codingapi.txlcn.logger.db.LogDbProperties; import com.codingapi.txlcn.logger.db.TxLog; -import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.util.StringUtils; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -31,17 +35,42 @@ * * @author ujued */ -@Slf4j public abstract class AbstractTxLogger implements TxLogger { - private ExecutorService loggerSaveService; + private final ExecutorService loggerSaveService; - public AbstractTxLogger() { + private final Logger LOG; + + private LogDbProperties logDbProperties; + + public AbstractTxLogger(Class className) { this.loggerSaveService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); + this.LOG = LoggerFactory.getLogger(className); } @Override public void trace(String groupId, String unitId, String tag, String content, Object... args) { + if (Objects.isNull(logDbProperties)) { + logDbProperties = SpringUtils.getBean(LogDbProperties.class); + } + if (logDbProperties.isEnabled() && !logDbProperties.isOnlyError()) { + saveTxLog(groupId, unitId, tag, content, args); + } + LOG.debug(content + " @group(" + groupId + ")", args); + } + + @Override + public void error(String groupId, String unitId, String tag, String content, Object... args) { + if (Objects.isNull(logDbProperties)) { + logDbProperties = SpringUtils.getBean(LogDbProperties.class); + } + if (logDbProperties.isEnabled() && logDbProperties.isOnlyError()) { + saveTxLog(groupId, unitId, tag, content, args); + } + LOG.error(content + " @group(" + groupId + ")", args); + } + + private void saveTxLog(String groupId, String unitId, String tag, String content, Object... args) { TxLog txLog = new TxLog(); txLog.setContent(content); txLog.setArgs(args); @@ -50,9 +79,8 @@ public void trace(String groupId, String unitId, String tag, String content, Obj txLog.setUnitId(StringUtils.isEmpty(unitId) ? "" : unitId); txLog.setAppName(Transactions.APPLICATION_ID_WHEN_RUNNING); txLog.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS").format(new Date())); - log.debug("{}: " + content, tag, args); - this.loggerSaveService.execute(() -> saveTrace(txLog)); + this.loggerSaveService.execute(() -> saveLog(txLog)); } - public abstract void saveTrace(TxLog txLog); + public abstract void saveLog(TxLog txLog); } diff --git a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/DefaultTxLogger.java b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/DefaultTxLogger.java index 28ea61820..54f1991e7 100644 --- a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/DefaultTxLogger.java +++ b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/DefaultTxLogger.java @@ -15,10 +15,13 @@ */ package com.codingapi.txlcn.logger; +import com.codingapi.txlcn.common.util.SpringUtils; import com.codingapi.txlcn.logger.db.TxLog; import com.codingapi.txlcn.logger.helper.TxLcnLogDbHelper; import lombok.extern.slf4j.Slf4j; +import java.util.Objects; + /** * Description: * Company: CodingApi @@ -29,15 +32,28 @@ @Slf4j public class DefaultTxLogger extends AbstractTxLogger { - private final TxLcnLogDbHelper txLcnLogDbHelper; + private TxLcnLogDbHelper txLcnLogDbHelper; - public DefaultTxLogger(TxLcnLogDbHelper txLcnLogDbHelper) { - this.txLcnLogDbHelper = txLcnLogDbHelper; + private boolean needAware = true; + + public DefaultTxLogger(Class className) { + super(className); } + public void setTxLcnLogDbHelper(TxLcnLogDbHelper txLcnLogDbHelper) { + this.txLcnLogDbHelper = txLcnLogDbHelper; + } @Override - public void saveTrace(TxLog txLog) { - txLcnLogDbHelper.insert(txLog); + public void saveLog(TxLog txLog) { + if (needAware && Objects.isNull(txLcnLogDbHelper)) { + txLcnLogDbHelper = SpringUtils.getBean(TxLcnLogDbHelper.class); + needAware = false; + } + if (Objects.nonNull(txLcnLogDbHelper)) { + txLcnLogDbHelper.insert(txLog); + return; + } + log.warn("tx-logger db configure fail."); } } diff --git a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/Slf4jTxLogger.java b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/Slf4jTxLogger.java deleted file mode 100644 index 57d6513ea..000000000 --- a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/Slf4jTxLogger.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2017-2019 CodingApi . - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.codingapi.txlcn.logger; - -import lombok.extern.slf4j.Slf4j; - -/** - * 不开启日志输出的时候 空操作 - * - * @author meetzy - */ -@Slf4j -public class Slf4jTxLogger implements TxLogger { - - @Override - public void trace(String groupId, String unitId, String tag, String content, Object... args) { - log.debug("{}: " + content, tag, args); - } - - @Override - public void info(String groupId, String unitId, String tag, String content, Object... args) { - log.debug("{}: " + content, tag, args); - } - - @Override - public void error(String groupId, String unitId, String tag, String content, Object... args) { - log.error("{}: " + content, tag, args); - } -} diff --git a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/TxLogger.java b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/TxLogger.java index c0b4c744f..bd6373147 100644 --- a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/TxLogger.java +++ b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/TxLogger.java @@ -26,6 +26,10 @@ */ public interface TxLogger { + static TxLogger newLogger(Class type) { + return new DefaultTxLogger(type); + } + /** * trace log * @@ -33,45 +37,37 @@ public interface TxLogger { * @param unitId unitId * @param tag tag * @param content content - * @param args args + * @param args args */ void trace(String groupId, String unitId, String tag, String content, Object... args); /** - * 事务消息 + * 事务日志 * * @param groupId groupId * @param unitId unitId * @param content content * @param args args */ - default void transactionInfo(String groupId, String unitId, String content, Object... args) { - info(groupId, unitId, Transactions.TAG_TRANSACTION, content, args); - } - - default void taskInfo(String groupId, String unitId, String content, Object... args) { - info(groupId, unitId, Transactions.TAG_TASK, content, args); + default void txTrace(String groupId, String unitId, String content, Object... args) { + trace(groupId, unitId, Transactions.TAG_TRANSACTION, content, args); } /** - * info log. todo + * 任务日志 * * @param groupId groupId * @param unitId unitId - * @param tag tag * @param content content - * @param args args + * @param args args */ - default void info(String groupId, String unitId, String tag, String content, Object... args) { - trace(groupId, unitId, tag, content, args); + default void taskTrace(String groupId, String unitId, String content, Object... args) { + trace(groupId, unitId, Transactions.TAG_TASK, content, args); } - default void error(String groupId, String unitId, String tag, String content, Object... args) { - trace(groupId, unitId, tag, content, args); - } + void error(String groupId, String unitId, String tag, String content, Object... args); default void error(String tag, String content, Object... args) { - error("", "", tag, content, args); + error("non", "non", tag, content, args); } - } diff --git a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/TxLoggerConfiguration.java b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/TxLoggerConfiguration.java index 7421c7430..f908867f7 100644 --- a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/TxLoggerConfiguration.java +++ b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/TxLoggerConfiguration.java @@ -15,6 +15,7 @@ */ package com.codingapi.txlcn.logger; +import com.codingapi.txlcn.common.util.SpringUtils; import com.codingapi.txlcn.logger.db.LogDbHelper; import com.codingapi.txlcn.logger.db.LogDbProperties; import com.codingapi.txlcn.logger.exception.TxLoggerException; @@ -41,28 +42,20 @@ public class TxLoggerConfiguration { @ConditionalOnProperty(name = "tx-lcn.logger.enabled", havingValue = "true") class LoggerEnabledTrueConfig { - @Bean - @ConditionalOnMissingBean - public TxLogger txLogger(TxLcnLogDbHelper txlcnLogDbHelper) { - return new DefaultTxLogger(txlcnLogDbHelper); - } - @Bean public LogDbHelper logDbHelper(LogDbProperties logDbProperties) throws TxLoggerException { return new LogDbHelper(logDbProperties); } } - @Bean - @ConditionalOnMissingBean - public TxLogger txLogger() { - return new Slf4jTxLogger(); - } - @Bean @ConditionalOnMissingBean public TxLcnLogDbHelper txLcnLoggerHelper() { return new MysqlLoggerHelper(); } + @Bean + public SpringUtils springUtils() { + return new SpringUtils(); + } } diff --git a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/db/LogDbProperties.java b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/db/LogDbProperties.java index 38d7a24a9..9dd9adfdb 100644 --- a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/db/LogDbProperties.java +++ b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/db/LogDbProperties.java @@ -38,6 +38,8 @@ public class LogDbProperties extends HikariConfig { private boolean enabled = false; + private boolean onlyError = true; + public LogDbProperties(@Autowired(required = false) DataSourceProperties dataSourceProperties) { if (Objects.isNull(dataSourceProperties) || Objects.isNull(dataSourceProperties.getDriverClassName()) || diff --git a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/helper/MysqlLoggerHelper.java b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/helper/MysqlLoggerHelper.java index 594d27abd..fec02e72b 100644 --- a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/helper/MysqlLoggerHelper.java +++ b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/helper/MysqlLoggerHelper.java @@ -59,12 +59,12 @@ public void init() { if (logDbProperties.isEnabled()) { String sql = "CREATE TABLE IF NOT EXISTS `t_logger` (\n" + " `id` bigint(20) NOT NULL AUTO_INCREMENT,\n" + - " `group_id` varchar(50) NOT NULL ,\n" + - "\t`unit_id` varchar(50) NOT NULL ,\n" + - "\t`tag` varchar(50) NOT NULL ,\n" + - "\t`content` varchar(1024) NOT NULL ,\n" + + " `group_id` varchar(64) NOT NULL ,\n" + + " `unit_id` varchar(32) NOT NULL ,\n" + + " `tag` varchar(50) NOT NULL ,\n" + + " `content` varchar(1024) NOT NULL ,\n" + " `create_time` varchar(30) NOT NULL,\n" + - " `app_name` varchar(50) NOT NULL,\n" + + " `app_name` varchar(128) NOT NULL,\n" + " PRIMARY KEY (`id`) USING BTREE\n" + ") "; dbHelper.update(sql); diff --git a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/model/Field.java b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/model/Field.java index 555e67749..7048d2c6b 100644 --- a/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/model/Field.java +++ b/txlcn-logger/src/main/java/com/codingapi/txlcn/logger/model/Field.java @@ -22,5 +22,9 @@ * @author ujued */ public interface Field { + /** + * common is ok + * @return bool + */ boolean ok(); } diff --git a/txlcn-tc/pom.xml b/txlcn-tc/pom.xml index a3f0a0533..c47032c7a 100644 --- a/txlcn-tc/pom.xml +++ b/txlcn-tc/pom.xml @@ -5,7 +5,7 @@ com.codingapi.txlcn tx-lcn - 5.0.1.RELEASE + 5.0.2.RELEASE txlcn-tc diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/TCAutoConfiguration.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/TCAutoConfiguration.java index 8a51f4217..be02cd499 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/TCAutoConfiguration.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/TCAutoConfiguration.java @@ -16,13 +16,18 @@ package com.codingapi.txlcn.tc; import com.codingapi.txlcn.common.runner.TxLcnApplicationRunner; +import com.codingapi.txlcn.common.util.ApplicationInformation; +import com.codingapi.txlcn.common.util.id.ModIdProvider; import com.codingapi.txlcn.logger.TxLoggerConfiguration; -import com.codingapi.txlcn.tc.config.DependenciesImportSelector; import com.codingapi.txlcn.tc.config.EnableDistributedTransaction; import com.codingapi.txlcn.tracing.TracingAutoConfiguration; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.*; +import org.springframework.core.env.ConfigurableEnvironment; /** * Description: @@ -50,4 +55,11 @@ public class TCAutoConfiguration { public ApplicationRunner txLcnApplicationRunner(ApplicationContext applicationContext) { return new TxLcnApplicationRunner(applicationContext); } + + @Bean + @ConditionalOnMissingBean + public ModIdProvider modIdProvider(ConfigurableEnvironment environment, + @Autowired(required = false) ServerProperties serverProperties) { + return () -> ApplicationInformation.modId(environment, serverProperties); + } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/aspect/weave/DTXLogicWeaver.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/aspect/weave/DTXLogicWeaver.java index a889780cb..2d8511162 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/aspect/weave/DTXLogicWeaver.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/aspect/weave/DTXLogicWeaver.java @@ -60,6 +60,7 @@ public Object runTransaction(DTXInfo dtxInfo, BusinessCallback business) throws log.debug("<---- TxLcn start ---->"); DTXLocalContext dtxLocalContext = DTXLocalContext.getOrNew(); TxContext txContext; + // ---------- 保证每个模块在一个DTX下只会有一个TxContext ---------- // if (globalContext.hasTxContext()) { // 有事务上下文的获取父上下文 txContext = globalContext.txContext(); @@ -94,8 +95,9 @@ public Object runTransaction(DTXInfo dtxInfo, BusinessCallback business) throws try { return transactionServiceExecutor.transactionRunning(info); } finally { + // 线程执行业务完毕清理本地数据 if (dtxLocalContext.isDestroy()) { - // 获取事务上下文通知事务执行完毕 + // 通知事务执行完毕 synchronized (txContext.getLock()) { txContext.getLock().notifyAll(); } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/EnableDistributedTransaction.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/EnableDistributedTransaction.java index 2336c529d..757891e6f 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/EnableDistributedTransaction.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/EnableDistributedTransaction.java @@ -25,7 +25,7 @@ * Date: 1/19/19 * * @author ujued - * @since 5.0.1.RELEASE + * @since 5.0.2.RELEASE */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/TxClientConfig.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/TxClientConfig.java index 26b0e17d5..6dcd5089a 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/TxClientConfig.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/TxClientConfig.java @@ -76,9 +76,9 @@ public TxClientConfig() { private long tmRpcTimeout; - private int machineId; + private long machineId; - private void setMachineId(int machineId) { + private void setMachineId(long machineId) { this.machineId = machineId; } @@ -98,7 +98,7 @@ public void applyDtxTime(long dtxTime) { setDtxTime(dtxTime); } - public void applyMachineId(int machineId) { + public void applyMachineId(long machineId) { setMachineId(machineId); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXLocalContext.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXLocalContext.java index 730a70015..748092d56 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXLocalContext.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXLocalContext.java @@ -24,6 +24,8 @@ /** * 分布式事务远程调用控制对象 + * !!!不推荐用户业务使用,API变更性大,使用不当有可能造成事务流程出错 !!! + *

* Created by lorne on 2017/6/5. */ @Data @@ -90,6 +92,7 @@ public class DTXLocalContext { * * @see TccTransactionCleanService#clear(java.lang.String, int, java.lang.String, java.lang.String) */ + @Deprecated private boolean justNow; //////// private /////////////////////// @@ -171,11 +174,11 @@ public static void makeNeverAppeared() { /** * 事务状态 - * + * @param userDtxState state * @return 1 commit 0 rollback */ - public static int transactionState() { + public static int transactionState(int userDtxState) { DTXLocalContext dtxLocalContext = Objects.requireNonNull(currentLocal.get(), "DTX can't be null."); - return dtxLocalContext.userTransactionState == -1 ? dtxLocalContext.sysTransactionState : dtxLocalContext.userTransactionState; + return userDtxState == 1 ? dtxLocalContext.sysTransactionState : userDtxState; } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXLocalControl.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXLocalControl.java index 98a7e67f1..f280df30f 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXLocalControl.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXLocalControl.java @@ -50,6 +50,7 @@ default Object doBusinessCode(TxTransactionInfo info) throws Throwable { * * @param info info * @param throwable throwable + * @throws TransactionException TransactionException */ default void onBusinessCodeError(TxTransactionInfo info, Throwable throwable) throws TransactionException { diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXServiceExecutor.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXServiceExecutor.java index bbfd699b0..9d668753a 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXServiceExecutor.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/DTXServiceExecutor.java @@ -36,18 +36,17 @@ @Slf4j public class DTXServiceExecutor { - private final TCGlobalContext globalContext; + private static final TxLogger txLogger = TxLogger.newLogger(DTXServiceExecutor.class); - private final TxLogger txLogger; + private final TCGlobalContext globalContext; private final TxLcnBeanHelper txLcnBeanHelper; private final DTXPropagationResolver propagationResolver; @Autowired - public DTXServiceExecutor(TxLogger txLogger, TxLcnBeanHelper txLcnBeanHelper, - TCGlobalContext globalContext, DTXPropagationResolver propagationResolver) { - this.txLogger = txLogger; + public DTXServiceExecutor(TxLcnBeanHelper txLcnBeanHelper, TCGlobalContext globalContext, + DTXPropagationResolver propagationResolver) { this.txLcnBeanHelper = txLcnBeanHelper; this.globalContext = globalContext; this.propagationResolver = propagationResolver; @@ -85,14 +84,14 @@ public Object transactionRunning(TxTransactionInfo info) throws Throwable { dtxLocalControl.preBusinessCode(info); // 4.2 业务执行前 - txLogger.transactionInfo( + txLogger.txTrace( info.getGroupId(), info.getUnitId(), "pre business code, unit type: {}", transactionType); // 4.3 执行业务 Object result = dtxLocalControl.doBusinessCode(info); // 4.4 业务执行成功 - txLogger.transactionInfo(info.getGroupId(), info.getUnitId(), "business success"); + txLogger.txTrace(info.getGroupId(), info.getUnitId(), "business success"); dtxLocalControl.onBusinessCodeSuccess(info, result); return result; } catch (TransactionException e) { diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/TransactionCleanService.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/TransactionCleanService.java index 7f0165328..78f0e2d49 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/TransactionCleanService.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/TransactionCleanService.java @@ -28,9 +28,9 @@ public interface TransactionCleanService { /** * 事务清理业务 * - * @param groupId groupId + * @param groupId groupId * @param state 事务状态 1 提交 0 回滚 - * @param unitId unitId + * @param unitId unitId * @param unitType 事务类型 * @throws TransactionClearException TransactionClearException */ diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/checking/DefaultDTXExceptionHandler.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/checking/DefaultDTXExceptionHandler.java index 561e2f6cb..3150570a2 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/checking/DefaultDTXExceptionHandler.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/checking/DefaultDTXExceptionHandler.java @@ -16,9 +16,8 @@ package com.codingapi.txlcn.tc.core.checking; import com.codingapi.txlcn.common.exception.*; -import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; -import com.codingapi.txlcn.tc.txmsg.TxMangerReporter; +import com.codingapi.txlcn.tc.txmsg.TMReporter; import com.codingapi.txlcn.tc.core.template.TransactionCleanTemplate; import com.codingapi.txlcn.txmsg.params.TxExceptionParams; import lombok.extern.slf4j.Slf4j; @@ -38,18 +37,16 @@ @Slf4j public class DefaultDTXExceptionHandler implements DTXExceptionHandler { - private final TransactionCleanTemplate transactionCleanTemplate; + private static final TxLogger txLogger = TxLogger.newLogger(DefaultDTXExceptionHandler.class); - private final TxMangerReporter txMangerReporter; + private final TransactionCleanTemplate transactionCleanTemplate; - private final TxLogger txLogger; + private final TMReporter tmReporter; @Autowired - public DefaultDTXExceptionHandler(TransactionCleanTemplate transactionCleanTemplate, - TxMangerReporter txMangerReporter, TxLogger txLogger) { + public DefaultDTXExceptionHandler(TransactionCleanTemplate transactionCleanTemplate, TMReporter tmReporter) { this.transactionCleanTemplate = transactionCleanTemplate; - this.txMangerReporter = txMangerReporter; - this.txLogger = txLogger; + this.tmReporter = tmReporter; } @Override @@ -71,8 +68,7 @@ public void handleJoinGroupBusinessException(Object params, Throwable ex) throws try { transactionCleanTemplate.clean(groupId, unitId, unitType, 0); } catch (TransactionClearException e) { - log.error("{} > clean transaction error.", unitType); - txLogger.error(this.getClass().getSimpleName(), "clean transaction fail."); + txLogger.error(groupId, unitId, "join group", "clean [{}]transaction fail.", unitType); } throw new TransactionException(ex); } @@ -102,7 +98,7 @@ public void handleNotifyGroupBusinessException(Object params, Throwable ex) { try { transactionCleanTemplate.clean(groupId, unitId, transactionType, state); } catch (TransactionClearException e) { - log.error("{} > clean transaction error.", transactionType); + txLogger.error(groupId, unitId, "notify group", "{} > clean transaction error.", transactionType); } } @@ -130,12 +126,12 @@ public void handleNotifyGroupMessageException(Object params, Throwable ex) { String unitId = (String) paramList.get(2); String transactionType = (String) paramList.get(3); try { - transactionCleanTemplate.compensationClean(groupId, unitId, transactionType, state); + transactionCleanTemplate.cleanWithoutAspectLog(groupId, unitId, transactionType, state); } catch (TransactionClearException e) { - log.error("{} > compensationClean transaction error.", transactionType); + txLogger.error(groupId, unitId, "notify group", "{} > cleanWithoutAspectLog transaction error.", transactionType); } // 上报Manager,上报直到成功. - txMangerReporter.reportTransactionState(groupId, null, TxExceptionParams.NOTIFY_GROUP_ERROR, state); + tmReporter.reportTransactionState(groupId, null, TxExceptionParams.NOTIFY_GROUP_ERROR, state); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/checking/SimpleDTXChecking.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/checking/SimpleDTXChecking.java index b5260f440..70c200a4d 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/checking/SimpleDTXChecking.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/checking/SimpleDTXChecking.java @@ -25,7 +25,7 @@ import com.codingapi.txlcn.tc.core.context.TxContext; import com.codingapi.txlcn.tc.corelog.aspect.AspectLogger; import com.codingapi.txlcn.tc.txmsg.ReliableMessenger; -import com.codingapi.txlcn.tc.txmsg.TxMangerReporter; +import com.codingapi.txlcn.tc.txmsg.TMReporter; import com.codingapi.txlcn.tc.core.template.TransactionCleanTemplate; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.DisposableBean; @@ -51,28 +51,26 @@ public class SimpleDTXChecking implements DTXChecking, DisposableBean { private static final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors()); + private static final TxLogger txLogger = TxLogger.newLogger(SimpleDTXChecking.class); + private TransactionCleanTemplate transactionCleanTemplate; private final ReliableMessenger reliableMessenger; private final TxClientConfig clientConfig; - private final TxLogger txLogger; - private final AspectLogger aspectLogger; - private final TxMangerReporter txMangerReporter; + private final TMReporter tmReporter; private final TCGlobalContext globalContext; @Autowired - public SimpleDTXChecking(TxClientConfig clientConfig, AspectLogger aspectLogger, TxLogger txLogger, - TxMangerReporter txMangerReporter, TCGlobalContext globalContext, - ReliableMessenger reliableMessenger) { + public SimpleDTXChecking(TxClientConfig clientConfig, AspectLogger aspectLogger, TMReporter tmReporter, + TCGlobalContext globalContext, ReliableMessenger reliableMessenger) { this.clientConfig = clientConfig; this.aspectLogger = aspectLogger; - this.txLogger = txLogger; - this.txMangerReporter = txMangerReporter; + this.tmReporter = tmReporter; this.globalContext = globalContext; this.reliableMessenger = reliableMessenger; } @@ -83,19 +81,18 @@ public void setTransactionCleanTemplate(TransactionCleanTemplate transactionClea @Override public void startDelayCheckingAsync(String groupId, String unitId, String transactionType) { - txLogger.taskInfo(groupId, unitId, "start delay checking task"); + txLogger.taskTrace(groupId, unitId, "start delay checking task"); ScheduledFuture scheduledFuture = scheduledExecutorService.schedule(() -> { try { TxContext txContext = globalContext.txContext(groupId); if (Objects.nonNull(txContext)) { synchronized (txContext.getLock()) { - txLogger.info(groupId, unitId, Transactions.TAG_TASK, - "checking waiting for business code finish."); + txLogger.taskTrace(groupId, unitId, "checking waiting for business code finish."); txContext.getLock().wait(); } } int state = reliableMessenger.askTransactionState(groupId, unitId); - txLogger.taskInfo(groupId, unitId, "ask transaction state {}", state); + txLogger.taskTrace(groupId, unitId, "ask transaction state {}", state); if (state == -1) { txLogger.error(this.getClass().getSimpleName(), "delay clean transaction error."); onAskTransactionStateException(groupId, unitId, transactionType); @@ -117,7 +114,7 @@ public void startDelayCheckingAsync(String groupId, String unitId, String transa public void stopDelayChecking(String groupId, String unitId) { ScheduledFuture scheduledFuture = delayTasks.get(groupId + unitId); if (Objects.nonNull(scheduledFuture)) { - txLogger.taskInfo(groupId, unitId, "cancel {}:{} checking.", groupId, unitId); + txLogger.taskTrace(groupId, unitId, "cancel {}:{} checking.", groupId, unitId); scheduledFuture.cancel(true); } } @@ -125,13 +122,13 @@ public void stopDelayChecking(String groupId, String unitId) { private void onAskTransactionStateException(String groupId, String unitId, String transactionType) { try { // 通知TxManager事务补偿 - txMangerReporter.reportTransactionState(groupId, unitId, TxExceptionParams.ASK_ERROR, 0); + tmReporter.reportTransactionState(groupId, unitId, TxExceptionParams.ASK_ERROR, 0); log.warn("{} > has compensation info!", transactionType); // 事务回滚, 保留适当的补偿信息 - transactionCleanTemplate.compensationClean(groupId, unitId, transactionType, 0); + transactionCleanTemplate.cleanWithoutAspectLog(groupId, unitId, transactionType, 0); } catch (TransactionClearException e) { - log.error("{} > clean transaction error.", transactionType); + txLogger.error(groupId, unitId, Transactions.TAG_TASK, "{} > clean transaction error.", transactionType); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/context/DefaultGlobalContext.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/context/DefaultGlobalContext.java index 04490faec..37b1f3d87 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/context/DefaultGlobalContext.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/context/DefaultGlobalContext.java @@ -193,6 +193,16 @@ public boolean isDTXTimeout() { return (System.currentTimeMillis() - txContext().getCreateTime()) >= clientConfig.getDtxTime(); } + @Override + public int dtxState(String groupId) { + return this.attachmentCache.containsKey(groupId, "rollback-only") ? 0 : 1; + } + + @Override + public void setRollbackOnly(String groupId) { + this.attachmentCache.attach(groupId, "rollback-only", true); + } + /** * 清理事务时调用 * diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/context/TCGlobalContext.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/context/TCGlobalContext.java index 4d78b055e..b848bf43a 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/context/TCGlobalContext.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/context/TCGlobalContext.java @@ -33,34 +33,131 @@ */ public interface TCGlobalContext { + /** + * set lcn connection + * + * @param groupId groupId + * @param connectionProxy connectionProxy + */ void setLcnConnection(String groupId, LcnConnectionProxy connectionProxy); + /** + * get lcn proxy + * + * @param groupId groupId + * @return connection proxy + * @throws TCGlobalContextException TCGlobalContextException + */ LcnConnectionProxy getLcnConnection(String groupId) throws TCGlobalContextException; - + /** + * get tcc info + * + * @param unitId unitId + * @param supplier supplier + * @return tcc info + * @throws TransactionException TransactionException + */ TccTransactionInfo tccTransactionInfo(String unitId, Supplier supplier) throws TransactionException; + /** + * txc type lock + * + * @param groupId groupId + * @param unitId unitId + * @param lockIdSet lockIdSet + */ void addTxcLockId(String groupId, String unitId, Set lockIdSet); + /** + * find txc lock set + * + * @param groupId groupId + * @param unitId unitId + * @return set + * @throws TCGlobalContextException TCGlobalContextException + */ Set findTxcLockSet(String groupId, String unitId) throws TCGlobalContextException; + /** + * table struct info + * + * @param table table + * @param structSupplier structSupplier + * @return table info + * @throws SQLException SQLException + */ TableStruct tableStruct(String table, Supplier structSupplier) throws SQLException; + /** + * clean group + * + * @param groupId groupId + */ void clearGroup(String groupId); + /** + * start tx + * + * @return tx context info + */ TxContext startTx(); + /** + * get tx context info by groupId + * + * @param groupId groupId + * @return tx context info + */ TxContext txContext(String groupId); + /** + * get context info + * + * @return info + */ TxContext txContext(); + /** + * del tx info + */ void destroyTx(); + /** + * del tx info + * + * @param groupId groupId + */ void destroyTx(String groupId); + /** + * has tx context + * + * @return bool + */ boolean hasTxContext(); + /** + * is time out + * + * @return bool + */ boolean isDTXTimeout(); + + /** + * 判断某个事务是否不允许提交 + * + * @param groupId groupId + * @return result + */ + int dtxState(String groupId); + + /** + * 设置某个事务组不允许提交 + * + * @param groupId groupId + */ + void setRollbackOnly(String groupId); } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionCleanTemplate.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionCleanTemplate.java index 15d6766a1..4a90d3575 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionCleanTemplate.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionCleanTemplate.java @@ -15,14 +15,12 @@ */ package com.codingapi.txlcn.tc.core.template; -import com.codingapi.txlcn.tc.corelog.aspect.AspectLogger; -import com.codingapi.txlcn.tc.support.TxLcnBeanHelper; -import com.codingapi.txlcn.tc.core.checking.DTXChecking; import com.codingapi.txlcn.common.exception.TransactionClearException; -import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; +import com.codingapi.txlcn.tc.core.checking.DTXChecking; import com.codingapi.txlcn.tc.core.context.TCGlobalContext; -import lombok.extern.slf4j.Slf4j; +import com.codingapi.txlcn.tc.corelog.aspect.AspectLogger; +import com.codingapi.txlcn.tc.support.TxLcnBeanHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -33,7 +31,6 @@ * @author ujued */ @Component -@Slf4j public class TransactionCleanTemplate { private final TxLcnBeanHelper transactionBeanHelper; @@ -42,19 +39,16 @@ public class TransactionCleanTemplate { private final AspectLogger aspectLogger; - private final TxLogger txLogger; + private static final TxLogger txLogger = TxLogger.newLogger(TransactionCleanTemplate.class); private final TCGlobalContext globalContext; @Autowired - public TransactionCleanTemplate(TxLcnBeanHelper transactionBeanHelper, - DTXChecking dtxChecking, - AspectLogger aspectLogger, - TxLogger txLogger, TCGlobalContext globalContext) { + public TransactionCleanTemplate(TxLcnBeanHelper transactionBeanHelper, DTXChecking dtxChecking, + AspectLogger aspectLogger, TCGlobalContext globalContext) { this.transactionBeanHelper = transactionBeanHelper; this.dtxChecking = dtxChecking; this.aspectLogger = aspectLogger; - this.txLogger = txLogger; this.globalContext = globalContext; } @@ -68,19 +62,18 @@ public TransactionCleanTemplate(TxLcnBeanHelper transactionBeanHelper, * @throws TransactionClearException TransactionClearException */ public void clean(String groupId, String unitId, String unitType, int state) throws TransactionClearException { - txLogger.transactionInfo(groupId, unitId, "clean transaction"); + txLogger.txTrace(groupId, unitId, "clean transaction"); try { - transactionBeanHelper.loadTransactionCleanService(unitType).clear( - groupId, state, unitId, unitType - ); - } finally { - globalContext.clearGroup(groupId); - - dtxChecking.stopDelayChecking(groupId, unitId); - + cleanWithoutAspectLog(groupId, unitId, unitType, state); + aspectLogger.clearLog(groupId, unitId); + } catch (TransactionClearException e) { + if (!e.isNeedCompensation()) { + aspectLogger.clearLog(groupId, unitId); + } + } catch (Throwable throwable) { aspectLogger.clearLog(groupId, unitId); } - txLogger.transactionInfo(groupId, unitId, "clean transaction over"); + txLogger.txTrace(groupId, unitId, "clean transaction over"); } /** @@ -92,8 +85,7 @@ public void clean(String groupId, String unitId, String unitType, int state) thr * @param state transactionState * @throws TransactionClearException TransactionClearException */ - public void compensationClean(String groupId, String unitId, String unitType, int state) throws TransactionClearException { - txLogger.transactionInfo(groupId, unitId, "clean compensation transaction"); + public void cleanWithoutAspectLog(String groupId, String unitId, String unitType, int state) throws TransactionClearException { try { transactionBeanHelper.loadTransactionCleanService(unitType).clear( groupId, state, unitId, unitType @@ -103,6 +95,5 @@ public void compensationClean(String groupId, String unitId, String unitType, in dtxChecking.stopDelayChecking(groupId, unitId); } - } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionControlTemplate.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionControlTemplate.java index 67ea363e1..3e8cbb3f5 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionControlTemplate.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionControlTemplate.java @@ -15,7 +15,9 @@ */ package com.codingapi.txlcn.tc.core.template; -import com.codingapi.txlcn.common.exception.*; +import com.codingapi.txlcn.common.exception.LcnBusinessException; +import com.codingapi.txlcn.common.exception.TransactionClearException; +import com.codingapi.txlcn.common.exception.TransactionException; import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; import com.codingapi.txlcn.tc.aspect.TransactionInfo; @@ -26,7 +28,6 @@ import com.codingapi.txlcn.tc.corelog.aspect.AspectLogger; import com.codingapi.txlcn.tc.txmsg.ReliableMessenger; import com.codingapi.txlcn.txmsg.exception.RpcException; -import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -39,9 +40,10 @@ * @author ujued */ @Component -@Slf4j public class TransactionControlTemplate { + private static final TxLogger txLogger = TxLogger.newLogger(TransactionControlTemplate.class); + private final AspectLogger aspectLogger; private final DTXChecking dtxChecking; @@ -50,14 +52,12 @@ public class TransactionControlTemplate { private final TransactionCleanTemplate transactionCleanTemplate; - private final TxLogger txLogger; - private final ReliableMessenger reliableMessenger; private final TCGlobalContext globalContext; @Autowired - public TransactionControlTemplate(AspectLogger aspectLogger, DTXChecking dtxChecking, TxLogger txLogger, + public TransactionControlTemplate(AspectLogger aspectLogger, DTXChecking dtxChecking, DTXExceptionHandler dtxExceptionHandler, TransactionCleanTemplate transactionCleanTemplate, ReliableMessenger reliableMessenger, TCGlobalContext globalContext) { @@ -65,7 +65,6 @@ public TransactionControlTemplate(AspectLogger aspectLogger, DTXChecking dtxChec this.dtxChecking = dtxChecking; this.dtxExceptionHandler = dtxExceptionHandler; this.transactionCleanTemplate = transactionCleanTemplate; - this.txLogger = txLogger; this.reliableMessenger = reliableMessenger; this.globalContext = globalContext; } @@ -75,7 +74,7 @@ public TransactionControlTemplate(AspectLogger aspectLogger, DTXChecking dtxChec * * @param groupId groupId * @param unitId unitId - * @param transactionInfo transactionInfo + * @param transactionInfo txTrace * @param transactionType transactionType * @throws TransactionException 创建group失败时抛出 */ @@ -84,8 +83,8 @@ public void createGroup(String groupId, String unitId, TransactionInfo transacti //创建事务组 try { // 日志 - txLogger.transactionInfo(groupId, unitId, - "create group > {} > groupId: {xid}, unitId: {uid}", transactionType); + txLogger.txTrace(groupId, unitId, + "create group > transaction type: {}", transactionType); // 创建事务组消息 reliableMessenger.createGroup(groupId); // 缓存发起方切面信息 @@ -97,7 +96,7 @@ public void createGroup(String groupId, String unitId, TransactionInfo transacti // 创建事务组业务失败 dtxExceptionHandler.handleCreateGroupBusinessException(groupId, e.getCause()); } - txLogger.transactionInfo(groupId, unitId, "create group over"); + txLogger.txTrace(groupId, unitId, "create group over"); } /** @@ -106,17 +105,17 @@ public void createGroup(String groupId, String unitId, TransactionInfo transacti * @param groupId groupId * @param unitId unitId * @param transactionType transactionType - * @param transactionInfo transactionInfo + * @param transactionInfo txTrace * @throws TransactionException 加入事务组失败时抛出 */ public void joinGroup(String groupId, String unitId, String transactionType, TransactionInfo transactionInfo) throws TransactionException { try { - txLogger.transactionInfo(groupId, unitId, "join group > {} > groupId: {xid}, unitId: {uid}", transactionType); + txLogger.txTrace(groupId, unitId, "join group > transaction type: {}", transactionType); - reliableMessenger.joinGroup(groupId, unitId, transactionType, DTXLocalContext.transactionState()); + reliableMessenger.joinGroup(groupId, unitId, transactionType, DTXLocalContext.transactionState(globalContext.dtxState(groupId))); - txLogger.transactionInfo(groupId, unitId, "{xid} join group message over."); + txLogger.txTrace(groupId, unitId, "join group message over."); // 异步检测 dtxChecking.startDelayCheckingAsync(groupId, unitId, transactionType); @@ -128,7 +127,7 @@ public void joinGroup(String groupId, String unitId, String transactionType, Tra } catch (LcnBusinessException e) { dtxExceptionHandler.handleJoinGroupBusinessException(Arrays.asList(groupId, unitId, transactionType), e); } - txLogger.transactionInfo(groupId, unitId, "join logic group over"); + txLogger.txTrace(groupId, unitId, "join group logic over"); } /** @@ -141,16 +140,14 @@ public void joinGroup(String groupId, String unitId, String transactionType, Tra */ public void notifyGroup(String groupId, String unitId, String transactionType, int state) { try { - txLogger.transactionInfo( - groupId, unitId, "notify group > {} > groupId: {xid}, unitId: {uid}, state: {}.", transactionType, state); + txLogger.txTrace( + groupId, unitId, "notify group > transaction type: {}, state: {}.", transactionType, state); if (globalContext.isDTXTimeout()) { throw new LcnBusinessException("dtx timeout."); } - reliableMessenger.notifyGroup(groupId, state); + state = reliableMessenger.notifyGroup(groupId, state); transactionCleanTemplate.clean(groupId, unitId, transactionType, state); - log.debug("{} > close transaction group.", transactionType); } catch (TransactionClearException e) { - log.error("clear exception", e); txLogger.trace(groupId, unitId, Transactions.TE, "clean transaction fail."); } catch (RpcException e) { dtxExceptionHandler.handleNotifyGroupMessageException(Arrays.asList(groupId, state, unitId, transactionType), e); @@ -158,6 +155,6 @@ public void notifyGroup(String groupId, String unitId, String transactionType, i // 关闭事务组失败 dtxExceptionHandler.handleNotifyGroupBusinessException(Arrays.asList(groupId, state, unitId, transactionType), e.getCause()); } - txLogger.transactionInfo(groupId, unitId, "notify group exception state {}.", state); + txLogger.txTrace(groupId, unitId, "notify group exception state {}.", state); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/lcn/control/LcnStartingTransaction.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/lcn/control/LcnStartingTransaction.java index ba9d130fe..fafc0c4fa 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/lcn/control/LcnStartingTransaction.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/lcn/control/LcnStartingTransaction.java @@ -19,6 +19,7 @@ import com.codingapi.txlcn.tc.core.DTXLocalContext; import com.codingapi.txlcn.tc.core.TxTransactionInfo; import com.codingapi.txlcn.tc.core.DTXLocalControl; +import com.codingapi.txlcn.tc.core.context.TCGlobalContext; import com.codingapi.txlcn.tc.core.template.TransactionControlTemplate; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -33,10 +34,13 @@ public class LcnStartingTransaction implements DTXLocalControl { private final TransactionControlTemplate transactionControlTemplate; + private final TCGlobalContext globalContext; + @Autowired - public LcnStartingTransaction(TransactionControlTemplate transactionControlTemplate) { + public LcnStartingTransaction(TransactionControlTemplate transactionControlTemplate, TCGlobalContext globalContext) { this.transactionControlTemplate = transactionControlTemplate; + this.globalContext = globalContext; } @Override @@ -63,6 +67,7 @@ public void onBusinessCodeSuccess(TxTransactionInfo info, Object result) { public void postBusinessCode(TxTransactionInfo info) { // RPC close DTX group transactionControlTemplate.notifyGroup( - info.getGroupId(), info.getUnitId(), info.getTransactionType(), DTXLocalContext.transactionState()); + info.getGroupId(), info.getUnitId(), info.getTransactionType(), + DTXLocalContext.transactionState(globalContext.dtxState(info.getGroupId()))); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/tcc/control/TccStartingTransaction.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/tcc/control/TccStartingTransaction.java index c3dddaf97..b01cb67d5 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/tcc/control/TccStartingTransaction.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/tcc/control/TccStartingTransaction.java @@ -39,13 +39,13 @@ public class TccStartingTransaction implements DTXLocalControl { private final TransactionControlTemplate transactionControlTemplate; - private final TCGlobalContext context; + private final TCGlobalContext globalContext; @Autowired public TccStartingTransaction(TransactionControlTemplate transactionControlTemplate, - TCGlobalContext context) { + TCGlobalContext globalContext) { this.transactionControlTemplate = transactionControlTemplate; - this.context = context; + this.globalContext = globalContext; } static TccTransactionInfo prepareTccInfo(TxTransactionInfo info) throws TransactionException { @@ -81,7 +81,7 @@ static TccTransactionInfo prepareTccInfo(TxTransactionInfo info) throws Transact public void preBusinessCode(TxTransactionInfo info) throws TransactionException { // cache tcc info try { - context.tccTransactionInfo(info.getUnitId(), () -> prepareTccInfo(info)) + globalContext.tccTransactionInfo(info.getUnitId(), () -> prepareTccInfo(info)) .setMethodParameter(info.getTransactionInfo().getArgumentValues()); } catch (Throwable throwable) { throw new TransactionException(throwable); @@ -110,6 +110,7 @@ public void onBusinessCodeSuccess(TxTransactionInfo info, Object result) { @Override public void postBusinessCode(TxTransactionInfo info) { transactionControlTemplate.notifyGroup( - info.getGroupId(), info.getUnitId(), info.getTransactionType(), DTXLocalContext.transactionState()); + info.getGroupId(), info.getUnitId(), info.getTransactionType(), + DTXLocalContext.transactionState(globalContext.dtxState(info.getGroupId()))); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/tcc/control/TccTransactionCleanService.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/tcc/control/TccTransactionCleanService.java index 81dd1aedf..0b8f012d3 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/tcc/control/TccTransactionCleanService.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/tcc/control/TccTransactionCleanService.java @@ -16,11 +16,14 @@ package com.codingapi.txlcn.tc.core.transaction.tcc.control; import com.codingapi.txlcn.common.exception.TransactionClearException; +import com.codingapi.txlcn.common.util.Maps; import com.codingapi.txlcn.tc.core.DTXLocalContext; import com.codingapi.txlcn.tc.core.TccTransactionInfo; import com.codingapi.txlcn.tc.core.TransactionCleanService; import com.codingapi.txlcn.tc.core.context.TCGlobalContext; -import com.codingapi.txlcn.tc.txmsg.TxMangerReporter; +import com.codingapi.txlcn.tc.txmsg.TMReporter; +import com.codingapi.txlcn.tracing.TracingConstants; +import com.codingapi.txlcn.tracing.TracingContext; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -41,28 +44,32 @@ public class TccTransactionCleanService implements TransactionCleanService { private final ApplicationContext applicationContext; - private final TxMangerReporter txMangerReporter; + private final TMReporter tmReporter; private final TCGlobalContext globalContext; @Autowired public TccTransactionCleanService(ApplicationContext applicationContext, - TxMangerReporter txMangerReporter, TCGlobalContext globalContext) { + TMReporter tmReporter, TCGlobalContext globalContext) { this.applicationContext = applicationContext; - this.txMangerReporter = txMangerReporter; + this.tmReporter = tmReporter; this.globalContext = globalContext; } @Override public void clear(String groupId, int state, String unitId, String unitType) throws TransactionClearException { Method exeMethod; + boolean shouldDestroy = !TracingContext.tracing().hasGroup(); try { TccTransactionInfo tccInfo = globalContext.tccTransactionInfo(unitId, null); Object object = applicationContext.getBean(tccInfo.getExecuteClass()); - // 用户的 confirm or cancel method 可以用到这个 + // 将要移除。 if (Objects.isNull(DTXLocalContext.cur())) { DTXLocalContext.getOrNew().setJustNow(true); } + if (shouldDestroy) { + TracingContext.init(Maps.of(TracingConstants.GROUP_ID, groupId, TracingConstants.APP_MAP, "{}")); + } DTXLocalContext.getOrNew().setGroupId(groupId); DTXLocalContext.cur().setUnitId(unitId); exeMethod = tccInfo.getExecuteClass().getMethod( @@ -73,7 +80,7 @@ public void clear(String groupId, int state, String unitId, String unitType) thr log.debug("User confirm/cancel logic over."); } catch (Throwable e) { log.error("Tcc clean error.", e); - txMangerReporter.reportTccCleanException(groupId, unitId, state); + tmReporter.reportTccCleanException(groupId, unitId, state); } } catch (Throwable e) { throw new TransactionClearException(e.getMessage()); @@ -81,6 +88,9 @@ public void clear(String groupId, int state, String unitId, String unitType) thr if (DTXLocalContext.cur().isJustNow()) { DTXLocalContext.makeNeverAppeared(); } + if (shouldDestroy) { + TracingContext.tracing().destroy(); + } } } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/analy/TxcServiceImpl.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/analy/TxcServiceImpl.java index 637ddff8c..462d233ac 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/analy/TxcServiceImpl.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/analy/TxcServiceImpl.java @@ -273,8 +273,8 @@ public void cleanTxc(String groupId, String unitId) throws TxcLogicException { @Override public void undo(String groupId, String unitId) throws TxcLogicException { DTXLocalContext.makeUnProxy(); + List statementInfoList = new ArrayList<>(); try { - List statementInfoList = new ArrayList<>(); List undoLogDOList = txcLogHelper.getUndoLogByGroupAndUnitId(groupId, unitId); for (UndoLogDO undoLogDO : undoLogDOList) { @@ -295,7 +295,9 @@ public void undo(String groupId, String unitId) throws TxcLogicException { } txcSqlExecutor.applyUndoLog(statementInfoList); } catch (SQLException e) { - throw new TxcLogicException(e); + TxcLogicException exception = new TxcLogicException(e); + exception.setAttachment(statementInfoList); + throw exception; } finally { DTXLocalContext.undoProxyStatus(); } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcRunningTransaction.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcRunningTransaction.java index fb233f310..d5100bd7d 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcRunningTransaction.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcRunningTransaction.java @@ -17,7 +17,6 @@ import com.codingapi.txlcn.common.exception.TransactionClearException; import com.codingapi.txlcn.common.exception.TransactionException; -import com.codingapi.txlcn.common.exception.TxClientException; import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; import com.codingapi.txlcn.tc.core.DTXLocalContext; @@ -43,14 +42,13 @@ public class TxcRunningTransaction implements DTXLocalControl { private final TransactionControlTemplate transactionControlTemplate; - private final TxLogger txLogger; + private static final TxLogger txLogger = TxLogger.newLogger(TxcRunningTransaction.class); @Autowired public TxcRunningTransaction(TransactionCleanTemplate transactionCleanTemplate, - TransactionControlTemplate transactionControlTemplate, TxLogger txLogger) { + TransactionControlTemplate transactionControlTemplate) { this.transactionCleanTemplate = transactionCleanTemplate; this.transactionControlTemplate = transactionControlTemplate; - this.txLogger = txLogger; } @Override diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcStartingTransaction.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcStartingTransaction.java index ffc362d5a..b6dbd06fe 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcStartingTransaction.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcStartingTransaction.java @@ -19,6 +19,7 @@ import com.codingapi.txlcn.tc.core.DTXLocalContext; import com.codingapi.txlcn.tc.core.DTXLocalControl; import com.codingapi.txlcn.tc.core.TxTransactionInfo; +import com.codingapi.txlcn.tc.core.context.TCGlobalContext; import com.codingapi.txlcn.tc.core.template.TransactionControlTemplate; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -36,9 +37,12 @@ public class TxcStartingTransaction implements DTXLocalControl { private final TransactionControlTemplate transactionControlTemplate; + private final TCGlobalContext globalContext; + @Autowired - public TxcStartingTransaction(TransactionControlTemplate transactionControlTemplate) { + public TxcStartingTransaction(TransactionControlTemplate transactionControlTemplate, TCGlobalContext globalContext) { this.transactionControlTemplate = transactionControlTemplate; + this.globalContext = globalContext; } @Override @@ -70,7 +74,7 @@ public void onBusinessCodeSuccess(TxTransactionInfo info, Object result) { @Override public void postBusinessCode(TxTransactionInfo info) { - int state = DTXLocalContext.transactionState(); + int state = DTXLocalContext.transactionState(globalContext.dtxState(info.getGroupId())); // 关闭事务组 transactionControlTemplate.notifyGroup(info.getGroupId(), info.getUnitId(), info.getTransactionType(), state); diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcTransactionCleanService.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcTransactionCleanService.java index 23a94d5ec..031af5134 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcTransactionCleanService.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/transaction/txc/control/TxcTransactionCleanService.java @@ -19,10 +19,14 @@ import com.codingapi.txlcn.tc.core.TransactionCleanService; import com.codingapi.txlcn.common.exception.TransactionClearException; import com.codingapi.txlcn.common.exception.TxcLogicException; +import com.codingapi.txlcn.tc.core.transaction.txc.analy.def.bean.StatementInfo; +import com.codingapi.txlcn.tc.txmsg.TMReporter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.List; + /** * Description: * Date: 2018/12/13 @@ -35,23 +39,39 @@ public class TxcTransactionCleanService implements TransactionCleanService { private final TxcService txcService; + private final TMReporter tmReporter; + @Autowired - public TxcTransactionCleanService(TxcService txcService) { + public TxcTransactionCleanService(TxcService txcService, TMReporter tmReporter) { this.txcService = txcService; + this.tmReporter = tmReporter; } @Override public void clear(String groupId, int state, String unitId, String unitType) throws TransactionClearException { + boolean rethrowTxcException = false; try { // 若需要回滚读undo_log,进行回滚 if (state == 0) { txcService.undo(groupId, unitId); } + } catch (TxcLogicException e) { + @SuppressWarnings("unchecked") + List statementInfoList = (List) e.getAttachment(); + tmReporter.reportTxcUndoException(groupId, unitId, statementInfoList); + rethrowTxcException = true; + log.debug("need compensation !"); + } + try { // 清理TXC txcService.cleanTxc(groupId, unitId); } catch (TxcLogicException e) { throw new TransactionClearException(e); } + + if (rethrowTxcException) { + throw TransactionClearException.needCompensation(); + } } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/H2DbHelper.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/H2DbHelper.java index c9668f2da..9d3fa1afb 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/H2DbHelper.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/H2DbHelper.java @@ -46,11 +46,10 @@ public class H2DbHelper implements DisposableBean { public H2DbHelper(H2DbProperties h2DbProperties) { HikariConfig hikariConfig = new HikariConfig(); hikariConfig.setDriverClassName(org.h2.Driver.class.getName()); - log.info("Init H2 DATABASE at {}", h2DbProperties.getFilePath()); hikariConfig.setJdbcUrl(String.format("jdbc:h2:%s", h2DbProperties.getFilePath())); hikariDataSource = new HikariDataSource(hikariConfig); queryRunner = new QueryRunner(hikariDataSource); - log.info("Init H2 DATABASE finished."); + log.info("Init H2 DATABASE at {}", h2DbProperties.getFilePath()); } public QueryRunner queryRunner() { diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/aspect/AspectLogHelper.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/aspect/AspectLogHelper.java index 73143d603..888b46b25 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/aspect/AspectLogHelper.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/aspect/AspectLogHelper.java @@ -52,8 +52,8 @@ public void init() { "(" + "ID BIGINT NOT NULL AUTO_INCREMENT, " + "UNIT_ID VARCHAR(32) NOT NULL," + - "GROUP_ID VARCHAR(32) NOT NULL," + - "METHOD_STR VARCHAR(300) NOT NULL ," + + "GROUP_ID VARCHAR(64) NOT NULL," + + "METHOD_STR VARCHAR(512) NOT NULL ," + "BYTES BLOB NOT NULL," + "GROUP_ID_HASH BIGINT NOT NULL," + "UNIT_ID_HASH BIGINT NOT NULL," + diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/aspect/AsyncH2DBAspectLogger.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/aspect/AsyncH2DBAspectLogger.java index 46ac89e43..25968a2c5 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/aspect/AsyncH2DBAspectLogger.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/aspect/AsyncH2DBAspectLogger.java @@ -61,7 +61,6 @@ public AsyncH2DBAspectLogger(AspectLogHelper txLogHelper) { public void trace(String groupId, String unitId, TransactionInfo transactionInfo) { executorService.submit(() -> { long t1 = System.currentTimeMillis(); - log.debug("event-save-start->{}", groupId); byte[] bytes; try { bytes = SerializerContext.getInstance().serialize(transactionInfo); @@ -80,7 +79,7 @@ public void trace(String groupId, String unitId, TransactionInfo transactionInfo boolean res = txLogHelper.save(txLog); long t2 = System.currentTimeMillis(); - log.debug("event-save-over ok:{} ->{},time:{}", res, groupId, (t2 - t1)); + log.debug("async save aspect log. result: {} groupId: {}, used time: {}ms", res, groupId, (t2 - t1)); }); } @@ -88,10 +87,9 @@ public void trace(String groupId, String unitId, TransactionInfo transactionInfo public void clearLog(String groupId, String unitId) { executorService.submit(() -> { long t1 = System.currentTimeMillis(); - log.debug("event-clear-start->{}", groupId); boolean res = txLogHelper.delete(groupId.hashCode(), unitId.hashCode()); long t2 = System.currentTimeMillis(); - log.debug("event-clear-over ok:{} ->{},time:{}", res, groupId, (t2 - t1)); + log.debug("async clear aspect log. result:{}, groupId: {}, used time: {}ms", res, groupId, (t2 - t1)); }); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/txc/TxcLogHelper.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/txc/TxcLogHelper.java index a63818c24..815f340ec 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/txc/TxcLogHelper.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/corelog/txc/TxcLogHelper.java @@ -51,7 +51,7 @@ public void init() { h2DbHelper.update("CREATE TABLE IF NOT EXISTS TXC_UNDO_LOG (" + "ID BIGINT NOT NULL AUTO_INCREMENT, " + "UNIT_ID VARCHAR(32) NOT NULL," + - "GROUP_ID VARCHAR(32) NOT NULL," + + "GROUP_ID VARCHAR(64) NOT NULL," + "SQL_TYPE INT NOT NULL," + "ROLLBACK_INFO BLOB NOT NULL," + "CREATE_TIME CHAR(23) NOT NULL, " + diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/DTXAspectSupport.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/DTXAspectSupport.java index 10c8b16e4..8637760bb 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/DTXAspectSupport.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/DTXAspectSupport.java @@ -18,18 +18,19 @@ import com.codingapi.txlcn.tc.core.DTXLocalContext; /** - * Description: + * Description: 将会在未来版本废弃。推荐使用 {@link DTXUserControls} * Date: 19-1-16 下午4:21 * * @author ujued + * @see DTXUserControls */ - -public class DTXAspectSupport { +@Deprecated +public class DTXAspectSupport { /** * 回滚分布式事务 */ public static void setRollbackOnly() { - DTXLocalContext.cur().setUserTransactionState(0); + DTXUserControls.rollbackCurrentGroup(); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/DTXUserControls.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/DTXUserControls.java new file mode 100644 index 000000000..c82526455 --- /dev/null +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/DTXUserControls.java @@ -0,0 +1,40 @@ +package com.codingapi.txlcn.tc.support; + +import com.codingapi.txlcn.tc.core.context.TCGlobalContext; +import com.codingapi.txlcn.tracing.TracingContext; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +import java.util.Objects; + +/** + * Description: + * Date: 19-2-21 上午10:57 + * + * @author ujued + */ +@Component +public class DTXUserControls implements ApplicationContextAware { + + private static ApplicationContext applicationContext; + + private static TCGlobalContext globalContext; + + public static void rollbackGroup(String groupId) { + if (Objects.isNull(globalContext)) { + globalContext = applicationContext.getBean(TCGlobalContext.class); + } + globalContext.setRollbackOnly(groupId); + } + + public static void rollbackCurrentGroup() { + rollbackGroup(TracingContext.tracing().groupId()); + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + DTXUserControls.applicationContext = applicationContext; + } +} diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/listener/RpcEnvStatusListener.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/listener/RpcEnvStatusListener.java index 0a6994d67..db2a17ddc 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/listener/RpcEnvStatusListener.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/listener/RpcEnvStatusListener.java @@ -22,9 +22,22 @@ * @author ujued */ public interface RpcEnvStatusListener { + /** + * on connect + * @param remoteKey remoteKey + */ void onConnected(String remoteKey); - + + /** + * on init + * + * @param remoteKey remoteKey + */ void onInitialized(String remoteKey); - + + /** + * on connect fail + * @param remoteKey remoteKey + */ void onConnectFail(String remoteKey); } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/listener/TransactionListener.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/listener/TransactionListener.java index fb917038a..b6eb8dc9b 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/listener/TransactionListener.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/support/listener/TransactionListener.java @@ -24,10 +24,27 @@ * @author ujued */ public interface TransactionListener { - + + /** + * tx begin + * + * @param txTransactionInfo txTransactionInfo + */ void onTransactionBegin(TxTransactionInfo txTransactionInfo); - + + /** + * tx error + * + * @param txTransactionInfo txTransactionInfo + */ void onTransactionError(TxTransactionInfo txTransactionInfo); - + + /** + * tx clean + * + * @param groupId groupId + * @param unitId unitId + * @param transactionState transactionState + */ void onTransactionClean(String groupId, String unitId, int transactionState); } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/LoopMessenger.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/LoopMessenger.java index 1b6809fa1..6d595e48e 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/LoopMessenger.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/LoopMessenger.java @@ -66,7 +66,7 @@ public void releaseLocks(Set lockIdList) throws RpcException { } @Override - public void notifyGroup(String groupId, int transactionState) throws RpcException, LcnBusinessException { + public int notifyGroup(String groupId, int transactionState) throws RpcException, LcnBusinessException { NotifyGroupParams notifyGroupParams = new NotifyGroupParams(); notifyGroupParams.setGroupId(groupId); notifyGroupParams.setState(transactionState); @@ -76,6 +76,7 @@ public void notifyGroup(String groupId, int transactionState) throws RpcExceptio if (!MessageUtils.statusOk(messageDto)) { throw new LcnBusinessException(messageDto.loadBean(Throwable.class)); } + return messageDto.loadBean(Integer.class); } @Override diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/MessageCreator.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/MessageCreator.java index c48130c37..469049a5d 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/MessageCreator.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/MessageCreator.java @@ -71,7 +71,7 @@ public static MessageDto notifyGroup(NotifyGroupParams notifyGroupParams) { /** * 申请锁消息 - * + * @param groupId groupId * @param locks locks * @param lockType lockType * @return message @@ -166,14 +166,15 @@ public static MessageDto writeTxException(TxExceptionParams txExceptionParams) { /** * 初始化客户端请求 * - * @param appName appName + * @param appName appName + * @param labelName labelName * @return MessageDto */ - public static MessageDto initClient(String appName) { + public static MessageDto initClient(String appName, String labelName) { InitClientParams initClientParams = new InitClientParams(); initClientParams.setAppName(appName); + initClientParams.setLabelName(labelName); MessageDto messageDto = new MessageDto(); - messageDto.setGroupId(MessageConstants.ACTION_INIT_GROUPID); messageDto.setData(initClientParams); messageDto.setAction(MessageConstants.ACTION_INIT_CLIENT); return messageDto; diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/ReliableMessenger.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/ReliableMessenger.java index 5157867a8..dde70c087 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/ReliableMessenger.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/ReliableMessenger.java @@ -53,10 +53,11 @@ public interface ReliableMessenger { * * @param groupId groupId * @param transactionState 分布式事务状态 + * @return dtx state * @throws RpcException Non TM * @throws LcnBusinessException TM Business Err */ - void notifyGroup(String groupId, int transactionState) throws RpcException, LcnBusinessException; + int notifyGroup(String groupId, int transactionState) throws RpcException, LcnBusinessException; /** * 加入事务组 diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TCSideRpcInitCallBack.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TCSideRpcInitCallBack.java index 9eb372331..d8851658a 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TCSideRpcInitCallBack.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TCSideRpcInitCallBack.java @@ -15,8 +15,10 @@ */ package com.codingapi.txlcn.tc.txmsg; -import com.codingapi.txlcn.common.util.ApplicationInformation; import com.codingapi.txlcn.common.util.id.IdGenInit; +import com.codingapi.txlcn.common.util.id.ModIdProvider; +import com.codingapi.txlcn.tc.config.TxClientConfig; +import com.codingapi.txlcn.tc.support.listener.RpcEnvStatusListener; import com.codingapi.txlcn.txmsg.RpcClient; import com.codingapi.txlcn.txmsg.dto.MessageDto; import com.codingapi.txlcn.txmsg.dto.RpcCmd; @@ -24,14 +26,12 @@ import com.codingapi.txlcn.txmsg.listener.ClientInitCallBack; import com.codingapi.txlcn.txmsg.listener.HeartbeatListener; import com.codingapi.txlcn.txmsg.params.InitClientParams; -import com.codingapi.txlcn.tc.config.TxClientConfig; -import com.codingapi.txlcn.tc.support.listener.RpcEnvStatusListener; import com.codingapi.txlcn.txmsg.util.MessageUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; import java.util.List; @@ -51,19 +51,22 @@ public class TCSideRpcInitCallBack implements ClientInitCallBack, HeartbeatListe private final TxClientConfig txClientConfig; - private final String modId; - private final List rpcEnvStatusListeners; + private final ModIdProvider modIdProvider; + + private final String applicationName; + @Autowired public TCSideRpcInitCallBack(RpcClient rpcClient, TxClientConfig txClientConfig, ConfigurableEnvironment environment, - @Autowired(required = false) ServerProperties serverProperties, - List rpcEnvStatusListeners) { + List rpcEnvStatusListeners, ModIdProvider modIdProvider) { this.rpcClient = rpcClient; this.txClientConfig = txClientConfig; - this.modId = ApplicationInformation.modId(environment, serverProperties); this.rpcEnvStatusListeners = rpcEnvStatusListeners; + this.modIdProvider = modIdProvider; + String appName = environment.getProperty("spring.application.name"); + this.applicationName = StringUtils.hasText(appName) ? appName : "application"; } @Override @@ -72,7 +75,8 @@ public void connected(String remoteKey) { new Thread(() -> { try { log.info("Send init message to TM[{}]", remoteKey); - MessageDto msg = rpcClient.request(remoteKey, MessageCreator.initClient(modId), 5000); + MessageDto msg = rpcClient.request( + remoteKey, MessageCreator.initClient(applicationName, modIdProvider.modId()), 5000); if (MessageUtils.statusOk(msg)) { //每一次建立连接时将会获取最新的时间 InitClientParams resParams = msg.loadBean(InitClientParams.class); diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TxMangerReporter.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TMReporter.java similarity index 76% rename from txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TxMangerReporter.java rename to txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TMReporter.java index 5e0ff6606..5bc0a77f2 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TxMangerReporter.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TMReporter.java @@ -15,14 +15,15 @@ */ package com.codingapi.txlcn.tc.txmsg; -import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; +import com.codingapi.txlcn.tc.core.transaction.txc.analy.def.bean.StatementInfo; import com.codingapi.txlcn.txmsg.exception.RpcException; import com.codingapi.txlcn.txmsg.params.TxExceptionParams; -import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.List; + /** * Description: 客户端上报Manager * Date: 2018/12/29 @@ -30,19 +31,17 @@ * @author ujued */ @Component -@Slf4j -public class TxMangerReporter { +public class TMReporter { private final ReliableMessenger reliableMessenger; - private final TxLogger txLogger; + private static final TxLogger txLogger = TxLogger.newLogger(TMReporter.class); private static final String REPORT_ERROR_MESSAGE = "report transaction transactionState error"; @Autowired - public TxMangerReporter(ReliableMessenger reliableMessenger, TxLogger txLogger) { + public TMReporter(ReliableMessenger reliableMessenger) { this.reliableMessenger = reliableMessenger; - this.txLogger = txLogger; } /** @@ -82,7 +81,17 @@ private void report(TxExceptionParams exceptionParams) { try { reliableMessenger.request(MessageCreator.writeTxException(exceptionParams)); } catch (RpcException e) { - txLogger.trace(exceptionParams.getGroupId(), exceptionParams.getUnitId(), Transactions.TE, REPORT_ERROR_MESSAGE); + txLogger.trace(exceptionParams.getGroupId(), exceptionParams.getUnitId(), "TM report", REPORT_ERROR_MESSAGE); } } + + public void reportTxcUndoException(String groupId, String unitId, List statementInfoList) { + TxExceptionParams exceptionParams = new TxExceptionParams(); + exceptionParams.setGroupId(groupId); + exceptionParams.setUnitId(unitId); + exceptionParams.setRegistrar(TxExceptionParams.TXC_UNDO_ERROR); + exceptionParams.setTransactionState(0); + exceptionParams.setRemark(statementInfoList.toString()); + report(exceptionParams); + } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TMSearcher.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TMSearcher.java index 7c10ea8b0..1041a4449 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TMSearcher.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/TMSearcher.java @@ -17,6 +17,7 @@ import com.codingapi.txlcn.common.util.ApplicationInformation; import com.codingapi.txlcn.common.util.Transactions; +import com.codingapi.txlcn.common.util.id.ModIdProvider; import com.codingapi.txlcn.txmsg.RpcClientInitializer; import com.codingapi.txlcn.txmsg.dto.TxManagerHost; import com.codingapi.txlcn.txmsg.exception.RpcException; @@ -53,10 +54,9 @@ public class TMSearcher { @Autowired public TMSearcher(RpcClientInitializer rpcClientInitializer, TxClientConfig clientConfig, - ReliableMessenger reliableMessenger, ConfigurableEnvironment environment, - @Autowired(required = false) ServerProperties serverProperties) { + ReliableMessenger reliableMessenger, ModIdProvider modIdProvider) { // 1. util class init - Transactions.setApplicationIdWhenRunning(ApplicationInformation.modId(environment, serverProperties)); + Transactions.setApplicationIdWhenRunning(modIdProvider.modId()); // 2. TMSearcher init RPC_CLIENT_INITIALIZER = rpcClientInitializer; @@ -78,6 +78,7 @@ public static void search() { return; } clusterCountLatch = new CountDownLatch(cluster.size() - knownTMClusterSize); + log.debug("wait connect size is {}", cluster.size() - knownTMClusterSize); RPC_CLIENT_INITIALIZER.init(TxManagerHost.parserList(new ArrayList<>(cluster)), true); clusterCountLatch.await(10, TimeUnit.SECONDS); echoTMClusterSuccessful(); @@ -88,13 +89,14 @@ public static void search() { /** * 搜索到一个 + * @return is searched one */ public static boolean searchedOne() { if (Objects.nonNull(clusterCountLatch)) { if (clusterCountLatch.getCount() == 0) { - clusterCountLatch.countDown(); return false; } + clusterCountLatch.countDown(); return true; } return false; diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/DefaultNotifiedUnitService.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/DefaultNotifiedUnitService.java index 11cbaedcd..513400080 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/DefaultNotifiedUnitService.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/DefaultNotifiedUnitService.java @@ -17,7 +17,6 @@ import com.codingapi.txlcn.common.exception.TransactionClearException; import com.codingapi.txlcn.common.exception.TxClientException; -import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; import com.codingapi.txlcn.txmsg.params.NotifyUnitParams; import com.codingapi.txlcn.tc.txmsg.RpcExecuteService; @@ -37,16 +36,14 @@ */ public class DefaultNotifiedUnitService implements RpcExecuteService { - private final TransactionCleanTemplate transactionCleanTemplate; + private static final TxLogger txLogger = TxLogger.newLogger(DefaultNotifiedUnitService.class); - private final TxLogger txLogger; + private final TransactionCleanTemplate transactionCleanTemplate; private TCGlobalContext globalContext; - public DefaultNotifiedUnitService(TransactionCleanTemplate transactionCleanTemplate, - TxLogger txLogger, TCGlobalContext globalContext) { + public DefaultNotifiedUnitService(TransactionCleanTemplate transactionCleanTemplate, TCGlobalContext globalContext) { this.transactionCleanTemplate = transactionCleanTemplate; - this.txLogger = txLogger; this.globalContext = globalContext; } @@ -58,7 +55,7 @@ public Serializable execute(TransactionCmd transactionCmd) throws TxClientExcept TxContext txContext = globalContext.txContext(transactionCmd.getGroupId()); if (Objects.nonNull(txContext)) { synchronized (txContext.getLock()) { - txLogger.transactionInfo(transactionCmd.getGroupId(), notifyUnitParams.getUnitId(), + txLogger.txTrace(transactionCmd.getGroupId(), notifyUnitParams.getUnitId(), "clean transaction cmd waiting for business code finish."); txContext.getLock().wait(); } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/DeleteAspectLogService.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/DeleteAspectLogService.java new file mode 100644 index 000000000..3b18f045d --- /dev/null +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/DeleteAspectLogService.java @@ -0,0 +1,33 @@ +package com.codingapi.txlcn.tc.txmsg.transaction; + +import com.codingapi.txlcn.common.exception.TxClientException; +import com.codingapi.txlcn.tc.corelog.aspect.AspectLogHelper; +import com.codingapi.txlcn.tc.txmsg.RpcExecuteService; +import com.codingapi.txlcn.tc.txmsg.TransactionCmd; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.Serializable; + +/** + * Description: + * Date: 19-2-12 上午10:56 + * + * @author ujued + */ +@Component("rpc_delete-aspect-log") +public class DeleteAspectLogService implements RpcExecuteService { + + private final AspectLogHelper aspectLogHelper; + + @Autowired + public DeleteAspectLogService(AspectLogHelper aspectLogHelper) { + this.aspectLogHelper = aspectLogHelper; + } + + @Override + public Serializable execute(TransactionCmd transactionCmd) throws TxClientException { + aspectLogHelper.delete(transactionCmd.getGroupId()); + return null; + } +} diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/LcnNotifiedUnitService.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/LcnNotifiedUnitService.java index 4f481ac1c..a52b4c83e 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/LcnNotifiedUnitService.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/LcnNotifiedUnitService.java @@ -33,8 +33,7 @@ public class LcnNotifiedUnitService extends DefaultNotifiedUnitService { @Autowired - public LcnNotifiedUnitService(TransactionCleanTemplate transactionCleanTemplate, - TCGlobalContext context, TxLogger txLogger) { - super(transactionCleanTemplate, txLogger, context); + public LcnNotifiedUnitService(TransactionCleanTemplate transactionCleanTemplate, TCGlobalContext context) { + super(transactionCleanTemplate, context); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/TccNotifiedUnitService.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/TccNotifiedUnitService.java index 7591578e8..0a50b7aba 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/TccNotifiedUnitService.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/TccNotifiedUnitService.java @@ -33,8 +33,7 @@ public class TccNotifiedUnitService extends DefaultNotifiedUnitService { @Autowired - public TccNotifiedUnitService(TransactionCleanTemplate transactionCleanTemplate, - TCGlobalContext context, TxLogger txLogger) { - super(transactionCleanTemplate, txLogger, context); + public TccNotifiedUnitService(TransactionCleanTemplate transactionCleanTemplate, TCGlobalContext context) { + super(transactionCleanTemplate, context); } } diff --git a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/TxcNotifiedUnitService.java b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/TxcNotifiedUnitService.java index 5c3b1a267..b51526085 100644 --- a/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/TxcNotifiedUnitService.java +++ b/txlcn-tc/src/main/java/com/codingapi/txlcn/tc/txmsg/transaction/TxcNotifiedUnitService.java @@ -15,7 +15,6 @@ */ package com.codingapi.txlcn.tc.txmsg.transaction; -import com.codingapi.txlcn.logger.TxLogger; import com.codingapi.txlcn.tc.core.context.TCGlobalContext; import com.codingapi.txlcn.tc.core.template.TransactionCleanTemplate; import org.springframework.beans.factory.annotation.Autowired; @@ -31,8 +30,7 @@ public class TxcNotifiedUnitService extends DefaultNotifiedUnitService { @Autowired - public TxcNotifiedUnitService(TransactionCleanTemplate transactionCleanTemplate, - TCGlobalContext context, TxLogger txLogger) { - super(transactionCleanTemplate, txLogger, context); + public TxcNotifiedUnitService(TransactionCleanTemplate transactionCleanTemplate, TCGlobalContext context) { + super(transactionCleanTemplate, context); } } diff --git a/txlcn-tc/src/main/resources/banner.txt b/txlcn-tc/src/main/resources/banner.txt index f7831994f..c178d6e08 100644 --- a/txlcn-tc/src/main/resources/banner.txt +++ b/txlcn-tc/src/main/resources/banner.txt @@ -7,4 +7,4 @@ ${AnsiColor.BRIGHT_GREEN} | | / /^\ \ | |___| \__/\| |\ | \_/ \/ \/ \_____/\____/\_| \_/ - TX-LCN TxClient version:5.0.1.RELEASE + TC version:5.0.2.RELEASE diff --git a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/MiniConfiguration.java b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/MiniConfiguration.java index fc0cf9f4b..3d655ae88 100644 --- a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/MiniConfiguration.java +++ b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/MiniConfiguration.java @@ -17,6 +17,7 @@ import com.codingapi.txlcn.tc.config.EnableDistributedTransaction; import com.zaxxer.hikari.HikariDataSource; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import javax.sql.DataSource; diff --git a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/RunTest.java b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/RunTest.java new file mode 100644 index 000000000..e625bb036 --- /dev/null +++ b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/RunTest.java @@ -0,0 +1,22 @@ +package com.codingapi.txlcn.tc; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * Description: + * Date: 19-2-20 下午4:24 + * + * @author ujued + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {MiniConfiguration.class, TCAutoConfiguration.class}) +public class RunTest { + + @Test + public void testTxc() throws InterruptedException { + Thread.sleep(10000); + } +} diff --git a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/Test.java b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/Test.java new file mode 100644 index 000000000..4cd6cc490 --- /dev/null +++ b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/Test.java @@ -0,0 +1,17 @@ +package com.codingapi.txlcn.tc; + +import com.codingapi.txlcn.tc.core.transaction.txc.analy.util.SqlUtils; + +public class Test { + public static void main(String[] args) { + + TestBean testBean = new TestBean(); + System.out.println(testBean.getTime()); + System.out.println(testBean.getTimestamp()); + byte[] bytes = SqlUtils.objectToBlob(testBean); + TestBean testBean2 = SqlUtils.blobToObject(bytes,TestBean.class); + System.out.println("-----"); + System.out.println(testBean2.getTime()); + System.out.println(testBean2.getTimestamp()); + } +} diff --git a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/TestBean.java b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/TestBean.java new file mode 100644 index 000000000..b0f9492ed --- /dev/null +++ b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/TestBean.java @@ -0,0 +1,33 @@ +package com.codingapi.txlcn.tc; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; + +public class TestBean implements Serializable { + + private Date time; + + private Timestamp timestamp; + + public TestBean() { + this.time = new Date(); + this.timestamp = new Timestamp(System.currentTimeMillis()); + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + public Timestamp getTimestamp() { + return timestamp; + } + + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } +} diff --git a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/coprelog/AspectLogTest.java b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/coprelog/AspectLogTest.java new file mode 100644 index 000000000..a0a8b94ac --- /dev/null +++ b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/coprelog/AspectLogTest.java @@ -0,0 +1,37 @@ +package com.codingapi.txlcn.tc.coprelog; + +import com.codingapi.txlcn.common.util.id.RandomUtils; +import com.codingapi.txlcn.tc.MiniConfiguration; +import com.codingapi.txlcn.tc.aspect.TransactionInfo; +import com.codingapi.txlcn.tc.corelog.aspect.AspectLogger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * Description: + * Date: 19-2-12 上午10:06 + * + * @author ujued + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = MiniConfiguration.class) +public class AspectLogTest { + + @Autowired + private AspectLogger aspectLogger; + + @Test + public void testTrace() throws InterruptedException { + TransactionInfo transactionInfo = new TransactionInfo(); + transactionInfo.setMethod("method"); + transactionInfo.setMethodStr("method str"); + transactionInfo.setParameterTypes(new Class[]{String.class, Integer.class}); + transactionInfo.setTargetClazz(String.class); + transactionInfo.setArgumentValues(new Object[]{"1", 2}); + aspectLogger.trace(RandomUtils.randomKey(), RandomUtils.randomKey(), transactionInfo); + Thread.sleep(1000); + } +} diff --git a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/coprelog/TxcLogTest.java b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/coprelog/TxcLogTest.java new file mode 100644 index 000000000..10b0c9afc --- /dev/null +++ b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/coprelog/TxcLogTest.java @@ -0,0 +1,17 @@ +package com.codingapi.txlcn.tc.coprelog; + +import com.codingapi.txlcn.tc.MiniConfiguration; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * Description: + * Date: 19-2-12 上午10:06 + * + * @author ujued + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = MiniConfiguration.class) +public class TxcLogTest { +} diff --git a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/TxcTest.java b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/txc/TxcTest.java similarity index 93% rename from txlcn-tc/src/test/java/com/codingapi/txlcn/tc/TxcTest.java rename to txlcn-tc/src/test/java/com/codingapi/txlcn/tc/txc/TxcTest.java index 466bed878..ae737c009 100644 --- a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/TxcTest.java +++ b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/txc/TxcTest.java @@ -13,8 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.codingapi.txlcn.tc; +package com.codingapi.txlcn.tc.txc; +import com.codingapi.txlcn.tc.MiniConfiguration; +import com.codingapi.txlcn.tc.TCAutoConfiguration; import org.apache.commons.dbutils.QueryRunner; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/RpcTest.java b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/txmsg/RpcTest.java similarity index 97% rename from txlcn-tc/src/test/java/com/codingapi/txlcn/tc/RpcTest.java rename to txlcn-tc/src/test/java/com/codingapi/txlcn/tc/txmsg/RpcTest.java index 76e1f5b8b..aa1d6190e 100644 --- a/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/RpcTest.java +++ b/txlcn-tc/src/test/java/com/codingapi/txlcn/tc/txmsg/RpcTest.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.codingapi.txlcn.tc; +package com.codingapi.txlcn.tc.txmsg; import com.codingapi.txlcn.common.lock.DTXLocks; +import com.codingapi.txlcn.tc.MiniConfiguration; import com.codingapi.txlcn.txmsg.dto.MessageDto; import com.codingapi.txlcn.txmsg.exception.RpcException; import com.codingapi.txlcn.tc.txmsg.ReliableMessenger; @@ -93,9 +94,6 @@ public void testCluster() throws RpcException { messenger.request(new MessageDto()); } - @Test - public void testTxc() { - } } diff --git a/txlcn-tm/pom.xml b/txlcn-tm/pom.xml index b2d773ce4..15fc0ddff 100644 --- a/txlcn-tm/pom.xml +++ b/txlcn-tm/pom.xml @@ -6,11 +6,11 @@ com.codingapi.txlcn tx-lcn - 5.0.1.RELEASE + 5.0.2.RELEASE txlcn-tm - 5.0.1.RELEASE + 5.0.2.RELEASE jar @@ -30,7 +30,6 @@ txlcn-txmsg-netty - org.springframework.boot spring-boot-starter-web @@ -46,19 +45,14 @@ spring-boot-starter-mail - - org.mybatis.spring.boot - mybatis-spring-boot-starter - - mysql mysql-connector-java - com.github.pagehelper - pagehelper-spring-boot-starter + org.springframework.boot + spring-boot-starter-data-jpa @@ -107,10 +101,30 @@ + - org.springframework.boot - spring-boot-maven-plugin + com.spotify + docker-maven-plugin + 1.0.0 + + codingapi/txlcn-tm + ${project.basedir}/src/main/docker + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + + 5.0.2 + + + docker-hub + https://index.docker.io/v1/ + + - \ No newline at end of file + diff --git a/txlcn-tm/src/main/docker/Dockerfile b/txlcn-tm/src/main/docker/Dockerfile new file mode 100644 index 000000000..10107d51a --- /dev/null +++ b/txlcn-tm/src/main/docker/Dockerfile @@ -0,0 +1,5 @@ +FROM frolvlad/alpine-oraclejdk8:slim +RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone +COPY txlcn-tm-5.0.2.RELEASE.jar tm.jar +EXPOSE 7970 8070 +ENTRYPOINT ["java", "-jar", "/tm.jar"] diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/TMAutoConfiguration.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/TMAutoConfiguration.java index c41f0dc10..9de510945 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/TMAutoConfiguration.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/TMAutoConfiguration.java @@ -16,6 +16,8 @@ package com.codingapi.txlcn.tm; import com.codingapi.txlcn.common.runner.TxLcnApplicationRunner; +import com.codingapi.txlcn.common.util.ApplicationInformation; +import com.codingapi.txlcn.common.util.id.ModIdProvider; import com.codingapi.txlcn.logger.TxLoggerConfiguration; import com.codingapi.txlcn.txmsg.MessageConfiguration; import com.codingapi.txlcn.tm.config.TxManagerConfig; @@ -23,11 +25,16 @@ import com.codingapi.txlcn.tm.core.storage.FastStorageProvider; import com.codingapi.txlcn.tm.core.storage.redis.RedisStorage; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.web.client.RestTemplate; @@ -44,7 +51,10 @@ * @author ujued */ @Configuration +@ComponentScan @Import({TxLoggerConfiguration.class, MessageConfiguration.class}) +@EnableJpaRepositories("com.codingapi.txlcn.tm.support.db.jpa") +@EntityScan("com.codingapi.txlcn.tm.support.db.domain") public class TMAutoConfiguration { @Bean(destroyMethod = "shutdown") @@ -84,4 +94,10 @@ public FastStorage fastStorage(FastStorageProvider fastStorageProvider) { public TxLcnApplicationRunner txLcnApplicationRunner(ApplicationContext applicationContext) { return new TxLcnApplicationRunner(applicationContext); } + + @Bean + @ConditionalOnMissingBean + public ModIdProvider modIdProvider(ConfigurableEnvironment environment, ServerProperties serverProperties) { + return () -> ApplicationInformation.modId(environment, serverProperties); + } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/cluster/TMAutoCluster.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/cluster/TMAutoCluster.java index ac1884a26..96dd43b29 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/cluster/TMAutoCluster.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/cluster/TMAutoCluster.java @@ -27,11 +27,13 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; import org.springframework.web.client.ResourceAccessException; import org.springframework.web.client.RestTemplate; import java.net.ConnectException; import java.util.List; +import java.util.stream.Collectors; /** * Description: @@ -66,7 +68,10 @@ public TMAutoCluster(FastStorage fastStorage, RestTemplate restTemplate, TxManag public void init() throws Exception { // 1. 通知 TC 建立连接 - List tmList = fastStorage.findTMProperties(); + List tmList = fastStorage.findTMProperties().stream() + .filter(tmProperties -> + !tmProperties.getHost().equals(txManagerConfig.getHost()) || !tmProperties.getTransactionPort().equals(txManagerConfig.getPort())) + .collect(Collectors.toList()); for (TMProperties properties : tmList) { NotifyConnectParams notifyConnectParams = new NotifyConnectParams(); notifyConnectParams.setHost(txManagerConfig.getHost()); @@ -94,11 +99,18 @@ public void init() throws Exception { } // 2. 保存TM 到快速存储 - TMProperties tmProperties = new TMProperties(); - tmProperties.setHttpPort(ApplicationInformation.serverPort(serverProperties)); - tmProperties.setHost(txManagerConfig.getHost()); - tmProperties.setTransactionPort(txManagerConfig.getPort()); - fastStorage.saveTMProperties(tmProperties); + if (StringUtils.hasText(txManagerConfig.getHost())) { + TMProperties tmProperties = new TMProperties(); + tmProperties.setHttpPort(ApplicationInformation.serverPort(serverProperties)); + tmProperties.setHost(txManagerConfig.getHost()); + tmProperties.setTransactionPort(txManagerConfig.getPort()); + fastStorage.saveTMProperties(tmProperties); + } + } + + @Override + public void destroy() throws Exception { + fastStorage.removeTMProperties(txManagerConfig.getHost(), txManagerConfig.getPort()); } @Override diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/config/EnableTransactionManagerServer.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/config/EnableTransactionManagerServer.java new file mode 100644 index 000000000..cb0d9caba --- /dev/null +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/config/EnableTransactionManagerServer.java @@ -0,0 +1,19 @@ +package com.codingapi.txlcn.tm.config; + +import com.codingapi.txlcn.tm.TMAutoConfiguration; +import org.springframework.context.annotation.Import; + +import java.lang.annotation.*; + +/** + * Description: + * Date: 19-2-15 下午5:25 + * + * @author ujued + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Documented +@Import(value = {TMAutoConfiguration.class}) +public @interface EnableTransactionManagerServer { +} diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/config/TxManagerConfig.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/config/TxManagerConfig.java index b965a075a..ff8de5b13 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/config/TxManagerConfig.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/config/TxManagerConfig.java @@ -41,8 +41,6 @@ public class TxManagerConfig { public TxManagerConfig(ServerProperties serverProperties) { this.port = Objects.requireNonNull(serverProperties.getPort(), "TM http port not configured?") + PORT_CHANGE_VALUE; - this.adminKey = "codingapi"; - this.exUrl = "/provider/email-to/ujued@qq.com"; } /** @@ -73,12 +71,12 @@ public TxManagerConfig(ServerProperties serverProperties) { /** * 分布式事务超时时间(ms) */ - private long dtxTime = 36 * 1000; + private long dtxTime = 8 * 1000; /** * 后台密码 */ - private String adminKey; + private String adminKey = "codingapi"; /** * 是否允许异常回调 @@ -88,13 +86,23 @@ public TxManagerConfig(ServerProperties serverProperties) { /** * 异常回调地址 */ - private String exUrl; + private String exUrl = "/provider/email-to/ujued@qq.com"; /** * ID序列长度 */ private int seqLen = 12; + private long machineId; + + private void setMachineId(long machineId) { + this.machineId = machineId; + } + + public void applyMachineId(long machineId) { + setMachineId(machineId); + } + public long getDtxLockTime() { return dtxLockTime == -1 ? dtxTime : dtxLockTime; } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/DTXContext.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/DTXContext.java index fc49eea75..631730086 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/DTXContext.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/DTXContext.java @@ -47,7 +47,7 @@ public interface DTXContext { void resetTransactionState(int state) throws TransactionException; /** - * 获取该事务组事务单元列表 + * 获取该事务组事务单元列表。从FastStorage获取。 * * @return list * @throws TransactionException TransactionException diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/DefaultDTXContext.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/DefaultDTXContext.java index c28e31650..88fdc1cbd 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/DefaultDTXContext.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/DefaultDTXContext.java @@ -45,7 +45,8 @@ public void join(TransactionUnit transactionUnit) throws TransactionException { try { fastStorage.saveTransactionUnitToGroup(groupId, transactionUnit); } catch (FastStorageException e) { - throw new TransactionException("attempts to join the non-existent transaction group."); + throw new TransactionException("attempts to join the non-existent transaction group. [" + + transactionUnit.getUnitId() + '@' + transactionUnit.getModId() + ']'); } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/SimpleTransactionManager.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/SimpleTransactionManager.java index 1f899306b..7fe4ae2cb 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/SimpleTransactionManager.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/SimpleTransactionManager.java @@ -44,23 +44,22 @@ @Component public class SimpleTransactionManager implements TransactionManager { + private static final TxLogger txLogger = TxLogger.newLogger(SimpleTransactionManager.class); + private final RpcExceptionHandler rpcExceptionHandler; private final RpcClient rpcClient; - private final TxLogger txLogger; - private final TxExceptionService exceptionService; private final DTXContextRegistry dtxContextRegistry; @Autowired - public SimpleTransactionManager(RpcExceptionHandler rpcExceptionHandler, RpcClient rpcClient, TxLogger txLogger, + public SimpleTransactionManager(RpcExceptionHandler rpcExceptionHandler, RpcClient rpcClient, TxExceptionService exceptionService, DTXContextRegistry dtxContextRegistry) { this.rpcExceptionHandler = rpcExceptionHandler; this.exceptionService = exceptionService; this.rpcClient = rpcClient; - this.txLogger = txLogger; this.dtxContextRegistry = dtxContextRegistry; } @@ -75,7 +74,6 @@ public void begin(String groupId) throws TransactionException { @Override public void join(DTXContext dtxContext, String unitId, String unitType, String modId, int userState) throws TransactionException { - log.debug("unit:{} joined group:{}", unitId, dtxContext.getGroupId()); //手动回滚时设置状态为回滚状态 0 if (userState == 0) { dtxContext.resetTransactionState(0); @@ -118,14 +116,15 @@ public int transactionStateFromFastStorage(String groupId) { } private void notifyTransaction(DTXContext dtxContext, int transactionState) throws TransactionException { - for (TransactionUnit transUnit : dtxContext.transactionUnits()) { + List transactionUnits = dtxContext.transactionUnits(); + log.debug("group[{}]'s transaction units: {}", dtxContext.getGroupId(), transactionUnits); + for (TransactionUnit transUnit : transactionUnits) { NotifyUnitParams notifyUnitParams = new NotifyUnitParams(); notifyUnitParams.setGroupId(dtxContext.getGroupId()); notifyUnitParams.setUnitId(transUnit.getUnitId()); notifyUnitParams.setUnitType(transUnit.getUnitType()); notifyUnitParams.setState(transactionState); - txLogger.info(dtxContext.getGroupId(), - notifyUnitParams.getUnitId(), Transactions.TAG_TRANSACTION, "notify %s's unit: %s", + txLogger.txTrace(dtxContext.getGroupId(), notifyUnitParams.getUnitId(), "notify {}'s unit: {}", transUnit.getModId(), transUnit.getUnitId()); try { List modChannelKeys = rpcClient.remoteKeys(transUnit.getModId()); @@ -145,7 +144,7 @@ private void notifyTransaction(DTXContext dtxContext, int transactionState) thro List params = Arrays.asList(notifyUnitParams, transUnit.getModId()); rpcExceptionHandler.handleNotifyUnitMessageException(params, e); } finally { - txLogger.transactionInfo(dtxContext.getGroupId(), notifyUnitParams.getUnitId(), "notify unit over"); + txLogger.txTrace(dtxContext.getGroupId(), notifyUnitParams.getUnitId(), "notify unit over"); } } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/FastStorage.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/FastStorage.java index c978febcf..28c2fa077 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/FastStorage.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/FastStorage.java @@ -31,6 +31,7 @@ public interface FastStorage { /*-----------------------DTX group------------------------------*/ + /** * init DTX group. * note: group info should clean by self 10 seconds after DTX time. @@ -175,11 +176,12 @@ public interface FastStorage { /** * 申请或刷新一个MachineID * - * @param machineId * @param machineMaxSize 限制大小 - * @param timeout 超时删除 + * @param timeout 超时删除 * @return MachineID * @throws FastStorageException FastStorageException */ - int acquireOrRefreshMachineId(int machineId, long machineMaxSize, long timeout) throws FastStorageException; + long acquireMachineId(long machineMaxSize, long timeout) throws FastStorageException; + + void refreshMachines(long timeout, long... machines); } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/redis/RedisStorage.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/redis/RedisStorage.java index f668ca21c..17f70dc38 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/redis/RedisStorage.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/core/storage/redis/RedisStorage.java @@ -147,6 +147,8 @@ public void acquireLocks(String contextId, Set locks, LockValue lockValu redisTemplate.opsForValue().multiSet(lockIds); } + // 锁超时时间设置 + lockIds.forEach((k, v) -> redisTemplate.expire(k, managerConfig.getDtxTime(), TimeUnit.MILLISECONDS)); } @Override @@ -229,33 +231,44 @@ private void releaseGlobalXLock() { } @Override - public int acquireOrRefreshMachineId(int machineId, long machineMaxSize, long timeout) throws FastStorageException { + public long acquireMachineId(long machineMaxSize, long timeout) throws FastStorageException { try { acquireGlobalXLock(); - if (machineId < 0) { - stringRedisTemplate.opsForValue().setIfAbsent(REDIS_MACHINE_ID_MAP_PREFIX + "cur_id", "-1"); - for (int i = 0; i < machineMaxSize; i++) { - int curId = Math.toIntExact( - Objects.requireNonNull( - stringRedisTemplate.opsForValue().increment(REDIS_MACHINE_ID_MAP_PREFIX + "cur_id", 1))); - if (curId > machineMaxSize) { - stringRedisTemplate.opsForValue().set(REDIS_MACHINE_ID_MAP_PREFIX + "cur_id", "0"); - curId = 0; - } - if (Optional - .ofNullable(stringRedisTemplate.hasKey(REDIS_MACHINE_ID_MAP_PREFIX + curId)) - .orElse(true)) { - continue; - } - stringRedisTemplate.opsForValue().set(REDIS_MACHINE_ID_MAP_PREFIX + curId, "", timeout, TimeUnit.MILLISECONDS); - return curId; + stringRedisTemplate.opsForValue().setIfAbsent(REDIS_MACHINE_ID_MAP_PREFIX + "cur_id", "-1"); + for (int i = 0; i < machineMaxSize; i++) { + long curId = Objects.requireNonNull( + stringRedisTemplate.opsForValue().increment(REDIS_MACHINE_ID_MAP_PREFIX + "cur_id", 1)); + if (curId > machineMaxSize) { + stringRedisTemplate.opsForValue().set(REDIS_MACHINE_ID_MAP_PREFIX + "cur_id", "0"); + curId = 0; } - throw new FastStorageException("non can used machine id", FastStorageException.EX_CODE_NON_MACHINE_ID); + if (Optional + .ofNullable(stringRedisTemplate.hasKey(REDIS_MACHINE_ID_MAP_PREFIX + curId)) + .orElse(true)) { + continue; + } + stringRedisTemplate.opsForValue().set(REDIS_MACHINE_ID_MAP_PREFIX + curId, "", timeout, TimeUnit.MILLISECONDS); + return curId; } - stringRedisTemplate.opsForValue().set(REDIS_MACHINE_ID_MAP_PREFIX + machineId, "", timeout, TimeUnit.MILLISECONDS); - return -1; + throw new FastStorageException("non can used machine id", FastStorageException.EX_CODE_NON_MACHINE_ID); } finally { releaseGlobalXLock(); } } + + @Override + public void refreshMachines(long timeout, long... machines) { + try { + stringRedisTemplate.setEnableTransactionSupport(true); + stringRedisTemplate.multi(); + for (long mac : machines) { + stringRedisTemplate.opsForValue().set(REDIS_MACHINE_ID_MAP_PREFIX + mac, "", timeout, TimeUnit.MILLISECONDS); + } + stringRedisTemplate.exec(); + } catch (Throwable e) { + stringRedisTemplate.discard(); + } finally { + stringRedisTemplate.setEnableTransactionSupport(false); + } + } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/TxLcnManagerBanner.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/TxLcnManagerBanner.java index 1fd12f439..b76d51b7f 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/TxLcnManagerBanner.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/TxLcnManagerBanner.java @@ -32,7 +32,7 @@ */ public class TxLcnManagerBanner implements Banner { - public static final String VERSION = "5.0.1.RELEASE"; + public static final String VERSION = "5.0.2.RELEASE"; private static final String BANNER = " _______ __ _ _____ _ _ \n" + @@ -42,7 +42,7 @@ public class TxLcnManagerBanner implements Banner { " | | / /^\\ \\ | |___| \\__/\\| |\\ | \n" + " \\_/ \\/ \\/ \\_____/\\____/\\_| \\_/ \n"; - private static final String SERVER_INFO = " Tx-Manager-%s HTTP port:%s DTX port:%s"; + private static final String SERVER_INFO = " TM-%s HTTP port:%s DTX port:%s"; @Override public void printBanner(Environment environment, Class sourceClass, PrintStream printStream) { diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/domain/TxException.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/domain/TxException.java index 4b59c14e8..ab530df07 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/domain/TxException.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/domain/TxException.java @@ -15,10 +15,12 @@ */ package com.codingapi.txlcn.tm.support.db.domain; +import com.codingapi.txlcn.txmsg.params.TxExceptionParams; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import javax.persistence.*; import java.util.Date; /** @@ -30,23 +32,30 @@ @AllArgsConstructor @NoArgsConstructor @Data +@Entity +@Table(name = "t_tx_exception") public class TxException { - + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) private Long id; /** * 事务组ID */ + @Column(length = 60) private String groupId; /** * 事务单元ID */ + @Column(length = 60) private String unitId; /** * 资源管理服务地址 */ + @Column(length = 100) private String modId; /** @@ -55,7 +64,8 @@ public class TxException { private Integer transactionState; /** - * 上报方 -1 未知 0 Manager 通知事务失败, 1 client询问事务状态失败2 事务发起方关闭事务组失败 + * 上报方 + * @see TxExceptionParams */ private short registrar; @@ -68,4 +78,9 @@ public class TxException { * 发生时间 */ private Date createTime; + + /** + * 备注 + */ + private String remark; } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/jpa/TxExceptionRepository.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/jpa/TxExceptionRepository.java new file mode 100644 index 000000000..07042b44e --- /dev/null +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/jpa/TxExceptionRepository.java @@ -0,0 +1,44 @@ +package com.codingapi.txlcn.tm.support.db.jpa; + +import com.codingapi.txlcn.tm.support.db.domain.TxException; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author meetzy 2019-02-14 12:09 + */ +@Repository +public interface TxExceptionRepository extends JpaRepository , JpaSpecificationExecutor { + + /** + * find TxException by groupId and unitId + * @param groupId groupId + * @param unitId unitId + * @return TxException + */ + TxException findByGroupIdAndUnitId(String groupId, String unitId); + + /** + * update exSate + * @param id id + * @param state state + */ + @Query(value = "update t_tx_exception set ex_state=?2 where id=?1",nativeQuery = true) + @Modifying + void changeExState(Long id, short state); + + /** + * find status + * @param page page need one + * @param groupId groupId + * @return list get(0) + */ + @Query(value = "select transaction_state from t_tx_exception where group_id=?1",nativeQuery = true) + List getTransactionStateByGroupId(String groupId,Pageable page); +} diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/mybatis/TxExceptionMapper.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/mybatis/TxExceptionMapper.java deleted file mode 100644 index 8dc0a5d7d..000000000 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/mybatis/TxExceptionMapper.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2017-2019 CodingApi . - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.codingapi.txlcn.tm.support.db.mybatis; - -import com.codingapi.txlcn.tm.support.db.domain.TxException; -import org.apache.ibatis.annotations.*; - -import java.util.List; - -/** - * Description: - * Date: 2018/12/18 - * - * @author ujued - */ -@Mapper -public interface TxExceptionMapper { - - @Insert("insert into t_tx_exception(group_id, unit_id, mod_id, transaction_state, registrar, ex_state, create_time) " + - "values(#{groupId}, #{unitId}, #{modId}, #{transactionState}, #{registrar}, #{exState}, #{createTime})") - void save(TxException txException); - - @Select("select * from t_tx_exception where group_id=#{groupId} and unit_id=#{unitId}") - TxException getByGroupAndUnitId(@Param("groupId") String groupId, @Param("unitId") String unitId); - - @Select("select * from t_tx_exception") - List findAll(); - - @Update("update t_tx_exception set ex_state=#{transactionState} where id=#{id}") - void changeExState(@Param("id") Long id, @Param("transactionState") short state); - - @Select("select transaction_state from t_tx_exception where group_id=#{groupId} limit 1") - Integer getTransactionStateByGroupId(String groupId); - - @Select("select * from t_tx_exception where ex_state=#{exState} and registrar=#{registrar}") - List findByExStateAndRegistrar(@Param("exState") Integer exState, @Param("registrar") Integer registrar); - - @Select("select * from t_tx_exception where ex_state=#{exState}") - List findByExState(Integer exState); - - @Select("select * from t_tx_exception") - List findByRegistrar(Integer registrar); - - @DeleteProvider(type = TxExceptionMapperProvider.class, method = "deleteByIdList") - void deleteByIdList(List ids); -} diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/mybatis/TxExceptionMapperProvider.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/mybatis/TxExceptionMapperProvider.java deleted file mode 100644 index 87c92218c..000000000 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/db/mybatis/TxExceptionMapperProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2017-2019 CodingApi . - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.codingapi.txlcn.tm.support.db.mybatis; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Description: - * Date: 19-1-17 上午10:59 - * - * @author ujued - */ -public class TxExceptionMapperProvider { - - @SuppressWarnings("unchecked") - public String deleteByIdList(Map params) { - return "delete from t_tx_exception where id in (" + - ((List) params.get("list")) - .stream() - .map(Object::toString) - .collect(Collectors.joining(", ")) + - ')'; - } -} diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/AdminController.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/AdminController.java index 0c6433b90..4f6ca87fa 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/AdminController.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/AdminController.java @@ -150,6 +150,24 @@ public boolean deleteLogs(@RequestBody DeleteLogsReq deleteLogsReq) throws TxMan return true; } + /** + * 删除异常事务信息 + * + * @param groupId groupId + * @param unitId unitId + * @param modId modId + * @return result always true if non exception + * @throws TxManagerException TxManagerException + */ + @DeleteMapping("/transaction-info") + public boolean deleteTransactionInfo( + @RequestParam("groupId") String groupId, + @RequestParam("unitId") String unitId, + @RequestParam("modId") String modId) throws TxManagerException { + txExceptionService.deleteTransactionInfo(groupId, unitId, modId); + return true; + } + /** * 获取TxManager信息 * diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/ao/WriteTxExceptionDTO.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/ao/WriteTxExceptionDTO.java index 7defb2502..bce032f58 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/ao/WriteTxExceptionDTO.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/ao/WriteTxExceptionDTO.java @@ -34,6 +34,7 @@ public class WriteTxExceptionDTO { private String modId; private Integer transactionState; private Short registrar; + private String remark; public WriteTxExceptionDTO(String groupId, String unitId, String modId, Integer transactionState) { this.groupId = groupId; diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/SAuthLogic.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/SAuthLogic.java index feb9caa0a..d41fec5dd 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/SAuthLogic.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/SAuthLogic.java @@ -27,14 +27,32 @@ * @author ujued */ public interface SAuthLogic { - + + /** + * ignore path + * + * @return list + */ default List ignoreUrls() { return Collections.emptyList(); } - + + /** + * is ignore + * + * @param request request + * @return bool + * @throws SAuthHandleException SAuthHandleException + */ default boolean isIgnored(HttpServletRequest request) throws SAuthHandleException { return false; } - + + /** + * verify token + * + * @param token token + * @return bool + */ boolean verify(String token); } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/token/TokenStorage.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/token/TokenStorage.java index cdb3d1165..24dfe84ce 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/token/TokenStorage.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/auth/sauth/token/TokenStorage.java @@ -22,12 +22,31 @@ * @author ujued */ public interface TokenStorage { - + + /** + * has token + * + * @param token token + * @return bool + */ boolean exist(String token); - + + /** + * add token + * + * @param token token + */ void add(String token); - + + /** + * remove token + * + * @param token token + */ void remove(String token); - + + /** + * del all + */ void clear(); } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ExceptionInfo.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ExceptionInfo.java index 61118a568..ba41a5621 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ExceptionInfo.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ExceptionInfo.java @@ -53,7 +53,7 @@ public class ExceptionInfo { /** * 异常情况。-1 【未知】 0 【TxManager通知事务】, 1 【TxClient查询事务状态】 2 【事务发起方通知事务组】 */ - private int registrar; + private short registrar; /** * 异常状态 0 待处理 1已处理 @@ -65,6 +65,11 @@ public class ExceptionInfo { */ private Date createTime; + /** + * 备注 + */ + private String remark; + /** * 事务信息 */ diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ListAppMods.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ListAppMods.java index 9bf9cf778..bf06684d0 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ListAppMods.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/restapi/vo/ListAppMods.java @@ -32,8 +32,8 @@ public class ListAppMods { @Data public static class AppMod { + private String modName; private String modId; - private int machineId; private String registerTime; } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/AdminService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/AdminService.java index b0655e7e8..710cbd5ee 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/AdminService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/AdminService.java @@ -82,4 +82,5 @@ public interface AdminService { * @return AppMods */ ListAppMods listAppMods(Integer page, Integer limit); + } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/ManagerService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/ManagerService.java index 15881316f..0c174ff42 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/ManagerService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/ManagerService.java @@ -28,9 +28,28 @@ */ public interface ManagerService { + /** + * refresh connect + * + * @param notifyConnectParams notifyConnectParams + * @return bool + * @throws RpcException RpcException + */ boolean refresh(NotifyConnectParams notifyConnectParams) throws RpcException; - int machineIdSync() throws TxManagerException; + /** + * machine id + * + * @return int + * @throws TxManagerException TxManagerException + */ + long machineIdSync() throws TxManagerException; - void refreshMachineId(int machineId) throws TxManagerException; + /** + * refresh machine id + * + * @param machineId machineId + * @throws TxManagerException TxManagerException + */ + void refreshMachines(long... machineId) throws TxManagerException; } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/TxExceptionService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/TxExceptionService.java index 7605426fd..81a7fec49 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/TxExceptionService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/TxExceptionService.java @@ -77,4 +77,14 @@ public interface TxExceptionService { * @throws TxManagerException ex */ void deleteExceptions(List ids) throws TxManagerException; + + /** + * 删除异常事务信息 + * + * @param groupId groupId + * @param unitId unitId + * @param modId modId + * @throws TxManagerException TxManagerException + */ + void deleteTransactionInfo(String groupId, String unitId, String modId) throws TxManagerException; } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/AdminServiceImpl.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/AdminServiceImpl.java index c75fa30c3..5628b762e 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/AdminServiceImpl.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/AdminServiceImpl.java @@ -23,7 +23,6 @@ import com.codingapi.txlcn.logger.helper.TxLcnLogDbHelper; import com.codingapi.txlcn.logger.model.*; import com.codingapi.txlcn.tm.config.TxManagerConfig; -import com.codingapi.txlcn.tm.core.storage.FastStorage; import com.codingapi.txlcn.tm.support.TxLcnManagerBanner; import com.codingapi.txlcn.tm.support.restapi.auth.DefaultTokenStorage; import com.codingapi.txlcn.tm.support.restapi.vo.*; @@ -61,19 +60,16 @@ public class AdminServiceImpl implements AdminService { private final RpcClient rpcClient; - private final FastStorage fastStorage; - @Autowired public AdminServiceImpl(TxManagerConfig managerConfig, DefaultTokenStorage defaultTokenStorage, TxLcnLogDbHelper txLoggerHelper, - RpcClient rpcClient, LogDbProperties logDbProperties, FastStorage fastStorage) { + RpcClient rpcClient, LogDbProperties logDbProperties) { this.managerConfig = managerConfig; this.defaultTokenStorage = defaultTokenStorage; this.txLoggerHelper = txLoggerHelper; this.rpcClient = rpcClient; this.logDbProperties = logDbProperties; - this.fastStorage = fastStorage; } @Override @@ -177,7 +173,8 @@ public ListAppMods listAppMods(Integer page, Integer limit) { } AppInfo appInfo = apps.get(i); ListAppMods.AppMod appMod = new ListAppMods.AppMod(); - PropertyMapper.get().from(appInfo::getName).to(appMod::setModId); + PropertyMapper.get().from(appInfo::getAppName).to(appMod::setModName); + PropertyMapper.get().from(appInfo::getLabelName).to(appMod::setModId); PropertyMapper.get().from(appInfo::getCreateTime).to(t -> appMod.setRegisterTime(dateFormat.format(t))); appMods.add(appMod); } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/ManagerServiceImpl.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/ManagerServiceImpl.java index b6c701424..16c52553a 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/ManagerServiceImpl.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/ManagerServiceImpl.java @@ -67,12 +67,12 @@ public boolean refresh(NotifyConnectParams notifyConnectParams) throws RpcExcept } @Override - public int machineIdSync() throws TxManagerException { + public long machineIdSync() throws TxManagerException { long machineMaxSize = ~(-1L << (64 - 1 - managerConfig.getSeqLen())) - 1; long timeout = managerConfig.getHeartTime() + 2000; - int id = 0; + long id; try { - id = fastStorage.acquireOrRefreshMachineId(-1, machineMaxSize, timeout); + id = fastStorage.acquireMachineId(machineMaxSize, timeout); } catch (FastStorageException e) { throw new TxManagerException(e); } @@ -81,13 +81,8 @@ public int machineIdSync() throws TxManagerException { } @Override - public void refreshMachineId(int machineId) throws TxManagerException { - try { - long machineMaxSize = ~(-1L << (64 - 1 - managerConfig.getSeqLen())) - 1; - long timeout = managerConfig.getHeartTime() + 2000; - fastStorage.acquireOrRefreshMachineId(machineId, machineMaxSize, timeout); - } catch (FastStorageException e) { - throw new TxManagerException(e); - } + public void refreshMachines(long... machineId) throws TxManagerException { + long timeout = managerConfig.getHeartTime() + 2000; + fastStorage.refreshMachines(timeout, machineId); } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/TxExceptionServiceImpl.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/TxExceptionServiceImpl.java index c677a57dd..f54a2319a 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/TxExceptionServiceImpl.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/support/service/impl/TxExceptionServiceImpl.java @@ -18,25 +18,28 @@ import com.alibaba.fastjson.JSONObject; import com.codingapi.txlcn.common.exception.TransactionStateException; import com.codingapi.txlcn.common.exception.TxManagerException; -import com.codingapi.txlcn.tm.txmsg.MessageCreator; import com.codingapi.txlcn.tm.support.db.domain.TxException; -import com.codingapi.txlcn.tm.support.db.mybatis.TxExceptionMapper; +import com.codingapi.txlcn.tm.support.db.jpa.TxExceptionRepository; +import com.codingapi.txlcn.tm.support.restapi.ao.WriteTxExceptionDTO; import com.codingapi.txlcn.tm.support.restapi.vo.ExceptionInfo; import com.codingapi.txlcn.tm.support.restapi.vo.ExceptionList; import com.codingapi.txlcn.tm.support.service.TxExceptionService; -import com.codingapi.txlcn.tm.support.restapi.ao.WriteTxExceptionDTO; import com.codingapi.txlcn.tm.support.txex.TxExceptionListener; +import com.codingapi.txlcn.tm.txmsg.MessageCreator; import com.codingapi.txlcn.txmsg.RpcClient; import com.codingapi.txlcn.txmsg.dto.MessageDto; import com.codingapi.txlcn.txmsg.exception.RpcException; import com.codingapi.txlcn.txmsg.util.MessageUtils; -import com.github.pagehelper.Page; -import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import javax.persistence.criteria.Predicate; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -51,21 +54,22 @@ @Service @Slf4j public class TxExceptionServiceImpl implements TxExceptionService { - - private final TxExceptionMapper txExceptionMapper; - + private final RpcClient rpcClient; - + private final TxExceptionListener txExceptionListener; - + + private final TxExceptionRepository txExceptionRepository; + @Autowired - public TxExceptionServiceImpl(TxExceptionMapper txExceptionMapper, RpcClient rpcClient, - TxExceptionListener txExceptionListener) { - this.txExceptionMapper = txExceptionMapper; + public TxExceptionServiceImpl(RpcClient rpcClient, + TxExceptionListener txExceptionListener, + TxExceptionRepository txExceptionRepository) { this.rpcClient = rpcClient; this.txExceptionListener = txExceptionListener; + this.txExceptionRepository = txExceptionRepository; } - + @Override public void writeTxException(WriteTxExceptionDTO writeTxExceptionReq) { log.info("write tx_exception. {}", writeTxExceptionReq); @@ -77,21 +81,23 @@ public void writeTxException(WriteTxExceptionDTO writeTxExceptionReq) { txException.setRegistrar(writeTxExceptionReq.getRegistrar()); txException.setModId(writeTxExceptionReq.getModId()); txException.setExState((short) 0); - txExceptionMapper.save(txException); + txException.setRemark(writeTxExceptionReq.getRemark()); + txExceptionRepository.save(txException); txExceptionListener.onException(txException); } - + @Override public int transactionState(String groupId) { log.debug("transactionState > groupId: {}", groupId); - Integer state = txExceptionMapper.getTransactionStateByGroupId(groupId); - if (Objects.isNull(state)) { + List lists = txExceptionRepository.getTransactionStateByGroupId(groupId,PageRequest.of(0, 1)); + if (lists.size()<=0) { return -1; } - return state; + return lists.get(0); } - + @Override + @Transactional public ExceptionList exceptionList(Integer page, Integer limit, Integer exState, String keyword, Integer registrar) { if (Objects.isNull(page) || page <= 0) { page = 1; @@ -99,22 +105,29 @@ public ExceptionList exceptionList(Integer page, Integer limit, Integer exState, if (Objects.isNull(limit) || limit < 1) { limit = 10; } - Page pageInfo = PageHelper.startPage(page, limit, true); - List txExceptions; - if ((Objects.nonNull(exState) && exState != -2) && (Objects.nonNull(registrar) && registrar != -2)) { - txExceptions = txExceptionMapper.findByExStateAndRegistrar(exState, registrar); - } else if (Objects.nonNull(exState) && exState != -2) { - txExceptions = txExceptionMapper.findByExState(exState); - } else if (Objects.nonNull(registrar) && registrar != -2) { - txExceptions = txExceptionMapper.findByRegistrar(registrar); - } else { - txExceptions = txExceptionMapper.findAll(); - } + // 组装条件参数 + Specification specification = (Specification) (root, cq, cb) -> { + List predicatesList = new ArrayList<>(); + if ((Objects.nonNull(exState) && exState != -2) && (Objects.nonNull(registrar) && registrar != -2)) { + predicatesList.add(cb.equal(root.get("exState"), exState)); + predicatesList.add(cb.equal(root.get("registrar"), registrar)); + } else if (Objects.nonNull(exState) && exState != -2) { + predicatesList.add(cb.equal(root.get("exState"), exState)); + } else if (Objects.nonNull(registrar) && registrar != -2) { + predicatesList.add(cb.equal(root.get("registrar"), registrar)); + } + Predicate[] predicates = new Predicate[predicatesList.size()]; + return cb.and(predicatesList.toArray(predicates)); + }; + + Page pageTxExceptions = txExceptionRepository.findAll(specification, PageRequest.of(page-1, limit)); + List txExceptions = pageTxExceptions.getContent(); + List exceptionInfoList = new ArrayList<>(txExceptions.size()); for (TxException txException : txExceptions) { ExceptionInfo exceptionInfo = new ExceptionInfo(); BeanUtils.copyProperties(txException, exceptionInfo); - + // 如果状态为解决,决定查下模块的日志来最终判断异常状态 if (txException.getExState() != 1) { try { @@ -123,7 +136,7 @@ public ExceptionList exceptionList(Integer page, Integer limit, Integer exState, } catch (TransactionStateException e) { if (e.getCode() == TransactionStateException.NON_ASPECT) { // 不存在异常日志,正常 - txExceptionMapper.changeExState(txException.getId(), (short) 1); + txExceptionRepository.changeExState(txException.getId(), (short) 1); exceptionInfo.setExState((short) 1); } } @@ -131,14 +144,14 @@ public ExceptionList exceptionList(Integer page, Integer limit, Integer exState, exceptionInfoList.add(exceptionInfo); } ExceptionList exceptionList = new ExceptionList(); - exceptionList.setTotal(pageInfo.getTotal()); + exceptionList.setTotal(pageTxExceptions.getTotalElements()); exceptionList.setExceptions(exceptionInfoList); return exceptionList; } - + @Override public JSONObject getTransactionInfo(String groupId, String unitId) throws TransactionStateException { - TxException exception = txExceptionMapper.getByGroupAndUnitId(groupId, unitId); + TxException exception = txExceptionRepository.findByGroupIdAndUnitId(groupId, unitId); if (Objects.isNull(exception)) { throw new TransactionStateException("non exists aspect log", TransactionStateException.NON_ASPECT); } @@ -158,9 +171,29 @@ public JSONObject getTransactionInfo(String groupId, String unitId) throws Trans throw new TransactionStateException(e, TransactionStateException.RPC_ERR); } } - + @Override - public void deleteExceptions(List ids) throws TxManagerException { - txExceptionMapper.deleteByIdList(ids); + public void deleteExceptions(List ids) { + for (Long id : ids) { + txExceptionRepository.deleteById(id); + } + } + + @Override + public void deleteTransactionInfo(String groupId, String unitId, String modId) throws TxManagerException { + List remoteKeys = rpcClient.remoteKeys(modId); + if (remoteKeys.isEmpty()) { + throw new TxManagerException("不存在的模块"); + } + try { + for (String remoteKey : remoteKeys) { + MessageDto messageDto = rpcClient.request(remoteKey, MessageCreator.deleteAspectLog(groupId, unitId), 5000); + if (MessageUtils.statusOk(messageDto)) { + return; + } + } + } catch (RpcException e) { + throw new TxManagerException(e.getMessage()); + } } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/EnsureIdGenEngine.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/EnsureIdGenEngine.java index a899c0dd8..c4beaee17 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/EnsureIdGenEngine.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/EnsureIdGenEngine.java @@ -1,9 +1,9 @@ package com.codingapi.txlcn.tm.txmsg; import com.codingapi.txlcn.common.runner.TxLcnInitializer; -import com.codingapi.txlcn.common.util.ApplicationInformation; import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.common.util.id.IdGenInit; +import com.codingapi.txlcn.common.util.id.ModIdProvider; import com.codingapi.txlcn.logger.TxLogger; import com.codingapi.txlcn.tm.config.TxManagerConfig; import com.codingapi.txlcn.tm.support.service.ManagerService; @@ -11,8 +11,6 @@ import com.codingapi.txlcn.txmsg.listener.HeartbeatListener; import com.codingapi.txlcn.txmsg.listener.RpcConnectionListener; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.stereotype.Component; /** @@ -28,20 +26,15 @@ public class EnsureIdGenEngine implements RpcConnectionListener, HeartbeatListen private final ManagerService managerService; - private final TxLogger txLogger; + private final TxLogger txLogger = TxLogger.newLogger(EnsureIdGenEngine.class); - private final ConfigurableEnvironment environment; - - private final ServerProperties serverProperties; + private final ModIdProvider modIdProvider; @Autowired - public EnsureIdGenEngine(ManagerService managerService, TxManagerConfig managerConfig, TxLogger txLogger, - ConfigurableEnvironment environment, ServerProperties serverProperties) { + public EnsureIdGenEngine(ManagerService managerService, TxManagerConfig managerConfig, ModIdProvider modIdProvider) { this.managerService = managerService; this.managerConfig = managerConfig; - this.txLogger = txLogger; - this.environment = environment; - this.serverProperties = serverProperties; + this.modIdProvider = modIdProvider; } @Override @@ -55,18 +48,19 @@ public void disconnect(String remoteKey, String appName) { @Override public void init() throws Exception { - IdGenInit.applyDefaultIdGen(managerConfig.getSeqLen(), managerService.machineIdSync()); + managerConfig.applyMachineId(managerService.machineIdSync()); + IdGenInit.applyDefaultIdGen(managerConfig.getSeqLen(), managerConfig.getMachineId()); - Transactions.setApplicationIdWhenRunning(ApplicationInformation.modId(environment, serverProperties)); + Transactions.setApplicationIdWhenRunning(modIdProvider.modId()); } @Override public void onTmReceivedHeart(RpcCmd cmd) { try { - int machineId = cmd.getMsg().loadBean(Integer.class); - managerService.refreshMachineId(machineId); + Long machineId = cmd.getMsg().loadBean(Long.class); + managerService.refreshMachines(machineId, managerConfig.getMachineId()); } catch (Exception e) { - txLogger.error("onTmReceivedHeart", e.getMessage()); + e.printStackTrace(); } } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/MessageCreator.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/MessageCreator.java index d47504c5f..f3fb75cb2 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/MessageCreator.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/MessageCreator.java @@ -17,6 +17,7 @@ import com.codingapi.txlcn.txmsg.MessageConstants; import com.codingapi.txlcn.txmsg.dto.MessageDto; +import com.codingapi.txlcn.txmsg.params.DeleteAspectLogParams; import com.codingapi.txlcn.txmsg.params.GetAspectLogParams; import com.codingapi.txlcn.txmsg.params.NotifyConnectParams; import com.codingapi.txlcn.txmsg.params.NotifyUnitParams; @@ -100,6 +101,13 @@ public static MessageDto serverException(String action) { return messageDto; } + /** + * 获取切面日志 + * + * @param groupId groupId + * @param unitId unitId + * @return aspect log + */ public static MessageDto getAspectLog(String groupId, String unitId) { GetAspectLogParams getAspectLogParams = new GetAspectLogParams(); getAspectLogParams.setGroupId(groupId); @@ -111,4 +119,23 @@ public static MessageDto getAspectLog(String groupId, String unitId) { messageDto.setData(getAspectLogParams); return messageDto; } + + /** + * 删除切面日志 + * + * @param groupId groupId + * @param unitId unitId + * @return result + */ + public static MessageDto deleteAspectLog(String groupId, String unitId) { + DeleteAspectLogParams deleteAspectLogParams = new DeleteAspectLogParams(); + deleteAspectLogParams.setGroupId(groupId); + deleteAspectLogParams.setUnitId(unitId); + + MessageDto messageDto = new MessageDto(); + messageDto.setData(deleteAspectLogParams); + messageDto.setAction(MessageConstants.ACTION_DELETE_ASPECT_LOG); + messageDto.setGroupId(groupId); + return messageDto; + } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/TMRpcServer.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/TMRpcServer.java index 400525e35..f129940b1 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/TMRpcServer.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/TMRpcServer.java @@ -61,6 +61,7 @@ public void init() { ManagerProperties managerProperties = new ManagerProperties(); managerProperties.setCheckTime(txManagerConfig.getHeartTime()); managerProperties.setRpcPort(txManagerConfig.getPort()); + managerProperties.setRpcHost(txManagerConfig.getHost()); rpcServerInitializer.init(managerProperties); } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/CleanInvalidTMExecuteService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/CleanInvalidTMExecuteService.java index ec10a9b2d..4faffeb0c 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/CleanInvalidTMExecuteService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/CleanInvalidTMExecuteService.java @@ -44,12 +44,11 @@ public class CleanInvalidTMExecuteService implements RpcExecuteService { private final FastStorage fastStorage; - private final TxLogger txLogger; + private static final TxLogger txLogger = TxLogger.newLogger(CleanInvalidTMExecuteService.class); @Autowired - public CleanInvalidTMExecuteService(FastStorage fastStorage, TxLogger txLogger) { + public CleanInvalidTMExecuteService(FastStorage fastStorage) { this.fastStorage = fastStorage; - this.txLogger = txLogger; } @Override diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/CreateGroupExecuteService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/CreateGroupExecuteService.java index 1b9b08f31..4252338d3 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/CreateGroupExecuteService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/CreateGroupExecuteService.java @@ -17,7 +17,6 @@ import com.codingapi.txlcn.common.exception.TransactionException; import com.codingapi.txlcn.common.exception.TxManagerException; -import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; import com.codingapi.txlcn.tm.core.TransactionManager; import com.codingapi.txlcn.tm.txmsg.RpcExecuteService; @@ -36,13 +35,12 @@ @Service("rpc_create-group") public class CreateGroupExecuteService implements RpcExecuteService { - private final TxLogger txLogger; + private static final TxLogger txLogger = TxLogger.newLogger(CreateGroupExecuteService.class); private final TransactionManager transactionManager; @Autowired - public CreateGroupExecuteService(TxLogger txLogger, TransactionManager transactionManager) { - this.txLogger = txLogger; + public CreateGroupExecuteService(TransactionManager transactionManager) { this.transactionManager = transactionManager; } @@ -53,7 +51,7 @@ public Serializable execute(TransactionCmd transactionCmd) throws TxManagerExcep } catch (TransactionException e) { throw new TxManagerException(e); } - txLogger.transactionInfo(transactionCmd.getGroupId(), null, "create group"); + txLogger.txTrace(transactionCmd.getGroupId(), null, "created group"); return null; } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/InitClientService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/InitClientService.java index 66e067f39..fd21331d2 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/InitClientService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/InitClientService.java @@ -16,18 +16,17 @@ package com.codingapi.txlcn.tm.txmsg.transaction; import com.codingapi.txlcn.common.exception.TxManagerException; -import com.codingapi.txlcn.common.util.ApplicationInformation; +import com.codingapi.txlcn.common.util.id.ModIdProvider; import com.codingapi.txlcn.tm.config.TxManagerConfig; import com.codingapi.txlcn.tm.support.service.ManagerService; import com.codingapi.txlcn.tm.txmsg.RpcExecuteService; import com.codingapi.txlcn.tm.txmsg.TransactionCmd; import com.codingapi.txlcn.txmsg.RpcClient; import com.codingapi.txlcn.txmsg.RpcConfig; +import com.codingapi.txlcn.txmsg.exception.RpcException; import com.codingapi.txlcn.txmsg.params.InitClientParams; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.stereotype.Service; import java.io.Serializable; @@ -47,32 +46,32 @@ public class InitClientService implements RpcExecuteService { private final TxManagerConfig txManagerConfig; - private final ConfigurableEnvironment environment; - - private final ServerProperties serverProperties; - private final RpcConfig rpcConfig; private final ManagerService managerService; + private final ModIdProvider modIdProvider; + @Autowired - public InitClientService(RpcClient rpcClient, TxManagerConfig txManagerConfig, ConfigurableEnvironment environment, - @Autowired(required = false) ServerProperties serverProperties, RpcConfig rpcConfig, - ManagerService managerService) { + public InitClientService(RpcClient rpcClient, TxManagerConfig txManagerConfig, RpcConfig rpcConfig, + ManagerService managerService, ModIdProvider modIdProvider) { this.rpcClient = rpcClient; this.txManagerConfig = txManagerConfig; - this.environment = environment; - this.serverProperties = serverProperties; this.rpcConfig = rpcConfig; this.managerService = managerService; + this.modIdProvider = modIdProvider; } @Override public Serializable execute(TransactionCmd transactionCmd) throws TxManagerException { - log.info("init client - >{}", transactionCmd); InitClientParams initClientParams = transactionCmd.getMsg().loadBean(InitClientParams.class); - rpcClient.bindAppName(transactionCmd.getRemoteKey(), initClientParams.getAppName()); + log.info("Registered TC: {}", initClientParams.getLabelName()); + try { + rpcClient.bindAppName(transactionCmd.getRemoteKey(), initClientParams.getAppName(), initClientParams.getLabelName()); + } catch (RpcException e) { + throw new TxManagerException(e); + } // Machine len and id initClientParams.setSeqLen(txManagerConfig.getSeqLen()); initClientParams.setMachineId(managerService.machineIdSync()); @@ -80,7 +79,7 @@ public Serializable execute(TransactionCmd transactionCmd) throws TxManagerExcep initClientParams.setDtxTime(txManagerConfig.getDtxTime()); initClientParams.setTmRpcTimeout(rpcConfig.getWaitTime()); // TM Name - initClientParams.setAppName(ApplicationInformation.modId(environment, serverProperties)); + initClientParams.setAppName(modIdProvider.modId()); return initClientParams; } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/JoinGroupExecuteService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/JoinGroupExecuteService.java index e391ecf16..0ff861731 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/JoinGroupExecuteService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/JoinGroupExecuteService.java @@ -17,16 +17,14 @@ import com.codingapi.txlcn.common.exception.TransactionException; import com.codingapi.txlcn.common.exception.TxManagerException; -import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; -import com.codingapi.txlcn.txmsg.RpcClient; import com.codingapi.txlcn.tm.core.DTXContext; import com.codingapi.txlcn.tm.core.DTXContextRegistry; import com.codingapi.txlcn.tm.core.TransactionManager; import com.codingapi.txlcn.tm.txmsg.RpcExecuteService; import com.codingapi.txlcn.tm.txmsg.TransactionCmd; +import com.codingapi.txlcn.txmsg.RpcClient; import com.codingapi.txlcn.txmsg.params.JoinGroupParams; -import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,22 +37,20 @@ * @author ujued */ @Service("rpc_join-group") -@Slf4j public class JoinGroupExecuteService implements RpcExecuteService { + private static final TxLogger txLogger = TxLogger.newLogger(JoinGroupExecuteService.class); + private final TransactionManager transactionManager; private final DTXContextRegistry dtxContextRegistry; - private final TxLogger txLogger; - private final RpcClient rpcClient; @Autowired - public JoinGroupExecuteService(TxLogger txLogger, TransactionManager transactionManager, + public JoinGroupExecuteService(TransactionManager transactionManager, DTXContextRegistry dtxContextRegistry, RpcClient rpcClient) { - this.txLogger = txLogger; this.transactionManager = transactionManager; this.dtxContextRegistry = dtxContextRegistry; this.rpcClient = rpcClient; @@ -66,10 +62,12 @@ public Serializable execute(TransactionCmd transactionCmd) throws TxManagerExcep try { DTXContext dtxContext = dtxContextRegistry.get(transactionCmd.getGroupId()); JoinGroupParams joinGroupParams = transactionCmd.getMsg().loadBean(JoinGroupParams.class); - txLogger.transactionInfo(transactionCmd.getGroupId(), joinGroupParams.getUnitId(), "start join group"); + txLogger.txTrace(transactionCmd.getGroupId(), joinGroupParams.getUnitId(), "unit:{} try join group:{}", + joinGroupParams.getUnitId(), transactionCmd.getGroupId()); transactionManager.join(dtxContext, joinGroupParams.getUnitId(), joinGroupParams.getUnitType(), rpcClient.getAppName(transactionCmd.getRemoteKey()), joinGroupParams.getTransactionState()); - txLogger.transactionInfo(transactionCmd.getGroupId(), joinGroupParams.getUnitId(), "over join group"); + txLogger.txTrace(transactionCmd.getGroupId(), joinGroupParams.getUnitId(), "unit:{} joined.", + joinGroupParams.getUnitId()); } catch (TransactionException e) { txLogger.error(this.getClass().getSimpleName(), e.getMessage()); throw new TxManagerException(e.getLocalizedMessage()); diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/NotifyGroupExecuteService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/NotifyGroupExecuteService.java index 5091f8ed0..a640ea5ab 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/NotifyGroupExecuteService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/NotifyGroupExecuteService.java @@ -15,11 +15,8 @@ */ package com.codingapi.txlcn.tm.txmsg.transaction; -import com.alibaba.fastjson.JSON; import com.codingapi.txlcn.common.exception.TransactionException; import com.codingapi.txlcn.common.exception.TxManagerException; -import com.codingapi.txlcn.common.exception.UserRollbackException; -import com.codingapi.txlcn.common.util.Transactions; import com.codingapi.txlcn.logger.TxLogger; import com.codingapi.txlcn.tm.core.DTXContext; import com.codingapi.txlcn.tm.core.DTXContextRegistry; @@ -27,7 +24,6 @@ import com.codingapi.txlcn.tm.txmsg.RpcExecuteService; import com.codingapi.txlcn.tm.txmsg.TransactionCmd; import com.codingapi.txlcn.txmsg.params.NotifyGroupParams; -import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -40,19 +36,16 @@ * @author ujued */ @Service("rpc_notify-group") -@Slf4j public class NotifyGroupExecuteService implements RpcExecuteService { - private final TxLogger txLogger; + private static final TxLogger txLogger = TxLogger.newLogger(NotifyGroupExecuteService.class); private final TransactionManager transactionManager; private final DTXContextRegistry dtxContextRegistry; @Autowired - public NotifyGroupExecuteService(TxLogger txLogger, TransactionManager transactionManager, - DTXContextRegistry dtxContextRegistry) { - this.txLogger = txLogger; + public NotifyGroupExecuteService(TransactionManager transactionManager, DTXContextRegistry dtxContextRegistry) { this.transactionManager = transactionManager; this.dtxContextRegistry = dtxContextRegistry; } @@ -63,36 +56,32 @@ public Serializable execute(TransactionCmd transactionCmd) throws TxManagerExcep DTXContext dtxContext = dtxContextRegistry.get(transactionCmd.getGroupId()); // 解析参数 NotifyGroupParams notifyGroupParams = transactionCmd.getMsg().loadBean(NotifyGroupParams.class); - log.debug("notify group params: {}", JSON.toJSONString(notifyGroupParams)); - int commitState = notifyGroupParams.getState(); // 获取事务状态(当手动回滚时会先设置状态) int transactionState = transactionManager.transactionStateFromFastStorage(transactionCmd.getGroupId()); - boolean hasThrow = false; if (transactionState == 0) { commitState = 0; - hasThrow = true; } // 系统日志 - txLogger.transactionInfo( - transactionCmd.getGroupId(), "", "notify group state: %d", notifyGroupParams.getState()); + txLogger.txTrace( + transactionCmd.getGroupId(), "", "notify group state: {}", notifyGroupParams.getState()); if (commitState == 1) { transactionManager.commit(dtxContext); } else if (commitState == 0) { transactionManager.rollback(dtxContext); } - if (hasThrow) { - throw new UserRollbackException("user mandatory rollback"); + if (transactionState == 0) { + txLogger.txTrace(transactionCmd.getGroupId(), "", "mandatory rollback for user."); } + return commitState; } catch (TransactionException e) { throw new TxManagerException(e); } finally { transactionManager.close(transactionCmd.getGroupId()); // 系统日志 - txLogger.transactionInfo(transactionCmd.getGroupId(), "", "notify group over"); + txLogger.txTrace(transactionCmd.getGroupId(), "", "notify group successfully."); } - return null; } } diff --git a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/WriteTxExceptionExecuteService.java b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/WriteTxExceptionExecuteService.java index 95da3194b..1703a816e 100644 --- a/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/WriteTxExceptionExecuteService.java +++ b/txlcn-tm/src/main/java/com/codingapi/txlcn/tm/txmsg/transaction/WriteTxExceptionExecuteService.java @@ -68,6 +68,7 @@ public Serializable execute(TransactionCmd transactionCmd) throws TxManagerExcep writeTxExceptionReq.setGroupId(txExceptionParams.getGroupId()); writeTxExceptionReq.setUnitId(txExceptionParams.getUnitId()); writeTxExceptionReq.setRegistrar(Objects.isNull(txExceptionParams.getRegistrar()) ? -1 : txExceptionParams.getRegistrar()); + writeTxExceptionReq.setRemark(txExceptionParams.getRemark()); compensationService.writeTxException(writeTxExceptionReq); } catch (Exception e) { throw new TxManagerException(e); diff --git a/txlcn-tm/src/main/resources/application-meetzy.properties b/txlcn-tm/src/main/resources/application-meetzy.properties new file mode 100644 index 000000000..98ca9e0bc --- /dev/null +++ b/txlcn-tm/src/main/resources/application-meetzy.properties @@ -0,0 +1,13 @@ +spring.datasource.password=meet1314 + + + +tx-lcn.message.netty.attr-delay-time=10000 + +tx-lcn.logger.enabled=false +#tx-lcn.logger.driver-class-name=com.mysql.jdbc.Driver +#tx-lcn.logger.jdbc-url=jdbc:mysql://127.0.0.1:3306/tx_logger?characterEncoding=UTF-8 +#tx-lcn.logger.username=root +#tx-lcn.logger.password=123456 + +tx-lcn.manager.admin-key=123456 diff --git a/txlcn-tm/src/main/resources/application-second.properties b/txlcn-tm/src/main/resources/application-second.properties index 8ed806bef..3c6a944b4 100644 --- a/txlcn-tm/src/main/resources/application-second.properties +++ b/txlcn-tm/src/main/resources/application-second.properties @@ -4,6 +4,8 @@ server.port=7971 #tx-lcn.logger.enabled=true logging.level.com.codingapi.txlcn=DEBUG +spring.datasource.password=123456 + tx-lcn.message.netty.attr-delay-time=10000 diff --git a/txlcn-tm/src/main/resources/application-ujued.properties b/txlcn-tm/src/main/resources/application-ujued.properties index 9671ab2ef..8abfa6aaf 100644 --- a/txlcn-tm/src/main/resources/application-ujued.properties +++ b/txlcn-tm/src/main/resources/application-ujued.properties @@ -1,6 +1,6 @@ #tx-lcn.logger.enabled=true -#logging.level.com.codingapi.txlcn=DEBUG +logging.level.com.codingapi.txlcn=DEBUG spring.datasource.password=123456 @@ -15,4 +15,3 @@ tx-lcn.logger.enabled=false #tx-lcn.logger.password=123456 tx-lcn.manager.admin-key=123456 - diff --git a/txlcn-tm/src/main/resources/application.properties b/txlcn-tm/src/main/resources/application.properties index 7188555f3..9d9c2d536 100644 --- a/txlcn-tm/src/main/resources/application.properties +++ b/txlcn-tm/src/main/resources/application.properties @@ -1,33 +1,8 @@ -spring.application.name=tx-manager +spring.application.name=TransactionManager server.port=7970 - spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tx-manager?characterEncoding=UTF-8 spring.datasource.username=root spring.datasource.password=root - -mybatis.configuration.map-underscore-to-camel-case=true -mybatis.configuration.use-generated-keys=true - -#tx-lcn.logger.enabled=true -# TxManager Host Ip -#tx-lcn.manager.host=127.0.0.1 -# TxClient连接请求端口 -#tx-lcn.manager.port=8070 -# 心跳检测时间(ms) -#tx-lcn.manager.heart-time=15000 -# 分布式事务执行总时间 -#tx-lcn.manager.dtx-time=30000 -#参数延迟删除时间单位ms -#tx-lcn.message.netty.attr-delay-time=10000 -#tx-lcn.manager.concurrent-level=128 -# 开启日志 -#tx-lcn.logger.enabled=true -#logging.level.com.codingapi=debug -#redisIp -#spring.redis.host=127.0.0.1 -#redis\u7AEF\u53E3 -#spring.redis.port=6379 -#redis\u5BC6\u7801 -#spring.redis.password= - +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.hibernate.ddl-auto=update \ No newline at end of file diff --git a/txlcn-tm/src/main/resources/static/admin/index.html b/txlcn-tm/src/main/resources/static/admin/index.html index feffeb657..d9300212c 100644 --- a/txlcn-tm/src/main/resources/static/admin/index.html +++ b/txlcn-tm/src/main/resources/static/admin/index.html @@ -6,7 +6,10 @@ TxManager系统后台 - + +
diff --git a/txlcn-tm/src/main/resources/static/admin/js/index.js b/txlcn-tm/src/main/resources/static/admin/js/index.js index 308e57896..c7328e57f 100644 --- a/txlcn-tm/src/main/resources/static/admin/js/index.js +++ b/txlcn-tm/src/main/resources/static/admin/js/index.js @@ -1,26 +1,26 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=310)}([function(t,e){t.exports=window.React},function(t,e,n){var r,i,o;t.exports=n(481)()},function(t,e,n){var r=n(10),i=n(20),o=n(33),a=n(27),s=n(46),u="prototype",c=function(t,e,n){var u=t&c.F,l=t&c.G,f=t&c.S,h=t&c.P,p=t&c.B,d=l?r:f?r[e]||(r[e]={}):(r[e]||{}).prototype,v=l?i:i[e]||(i[e]={}),g=v.prototype||(v.prototype={}),y,m,b,x;for(y in l&&(n=e),n)b=((m=!u&&d&&void 0!==d[y])?d:n)[y],x=p&&m?s(b,r):h&&"function"==typeof b?s(Function.call,b):b,d&&a(d,y,b,t&c.U),v[y]!=b&&o(v,y,x),h&&g[y]!=b&&(g[y]=b)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){var r,i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e0)for(n in _r)m(i=e[r=_r[n]])||(t[r]=i);return t}function x(t){b(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===wr&&(wr=!0,e.updateOffset(this),wr=!1)}function _(t){return t instanceof x||null!=t&&null!=t._isAMomentObject}function w(t){return 0>t?Math.ceil(t)||0:Math.floor(t)}function O(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=w(e)),n}function j(t,e,n){var r,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),a=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&O(t[r])!==O(e[r]))&&a++;return a+o}function S(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function E(t,n){var r=!0;return h(function(){var i,a,s,u;if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),r){for(i=[],s=0;s0?"future":"past"];return C(n)?n(e):n.replace(/%s/i,e)}function F(t,e){var n=t.toLowerCase();Ar[n]=Ar[n+"s"]=Ar[e]=t}function z(t){return"string"==typeof t?Ar[t]||Ar[t.toLowerCase()]:void 0}function B(t){var e,n,r={};for(n in t)f(t,n)&&((e=z(n))&&(r[e]=t[n]));return r}function Y(t,e){Ir[t]=e}function V(t){var e,n=[];for(e in t)n.push({unit:e,priority:Ir[e]});return n.sort(function(t,e){return t.priority-e.priority}),n}function W(t,n){return function(r){return null!=r?(G(this,t,r),e.updateOffset(this,n),this):H(this,t)}}function H(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function G(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function U(t){return C(this[t=z(t)])?this[t]():this}function q(t,e){var n,r;if("object"==(void 0===t?"undefined":o(t)))for(n=V(t=B(t)),r=0;r=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function X(t,e,n,r){var i=r;"string"==typeof r&&(i=function t(){return this[r]()}),t&&(Rr[t]=i),e&&(Rr[e[0]]=function(){return K(i.apply(this,arguments),e[1],e[2])}),n&&(Rr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function Z(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function $(t){var e,n,r=t.match(Lr);for(e=0,n=r.length;n>e;e++)r[e]=Rr[r[e]]?Rr[r[e]]:Z(r[e]);return function(e){var i,o="";for(i=0;n>i;i++)o+=r[i]instanceof Function?r[i].call(e,t):r[i];return o}}function Q(t,e){return t.isValid()?(e=J(e,t.localeData()),Dr[e]=Dr[e]||$(e),Dr[e](t)):t.localeData().invalidDate()}function J(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(Nr.lastIndex=0;r>=0&&Nr.test(t);)t=t.replace(Nr,n),Nr.lastIndex=0,r-=1;return t}function tt(t,e,n){ei[t]=C(e)?e:function(t){return t&&n?n:e}}function et(t,e){return f(ei,t)?ei[t](e._strict,e._locale):new RegExp(nt(t))}function nt(t){return rt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function rt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function it(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),u(e)&&(r=function t(n,r){r[e]=O(n)}),n=0;nr;++r)o=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(i=pi.call(this._shortMonthsParse,a))?i:null:-1!==(i=pi.call(this._longMonthsParse,a))?i:null:"MMM"===e?-1!==(i=pi.call(this._shortMonthsParse,a))?i:-1!==(i=pi.call(this._longMonthsParse,a))?i:null:-1!==(i=pi.call(this._longMonthsParse,a))?i:-1!==(i=pi.call(this._shortMonthsParse,a))?i:null}function ft(t,e,n){var r,i,o;if(this._monthsParseExact)return lt.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;12>r;r++){if(i=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function ht(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=O(e);else if(!u(e=t.localeData().monthsParse(e)))return t;return n=Math.min(t.date(),st(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function pt(t){return null!=t?(ht(this,t),e.updateOffset(this,!0),this):H(this,"Month")}function dt(){return st(this.year(),this.month())}function vt(t){return this._monthsParseExact?(f(this,"_monthsRegex")||yt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(f(this,"_monthsShortRegex")||(this._monthsShortRegex=yi),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function gt(t){return this._monthsParseExact?(f(this,"_monthsRegex")||yt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(f(this,"_monthsRegex")||(this._monthsRegex=mi),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function yt(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],o=[];for(e=0;12>e;e++)n=p([2e3,e]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(t),i.sort(t),o.sort(t),e=0;12>e;e++)r[e]=rt(r[e]),i[e]=rt(i[e]);for(e=0;24>e;e++)o[e]=rt(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function mt(t){return bt(t)?366:365}function bt(t){return 0==t%4&&0!=t%100||0==t%400}function xt(){return bt(this.year())}function _t(t,e,n,r,i,o,a){var s=new Date(t,e,n,r,i,o,a);return 100>t&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function wt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function Ot(t,e,n){var r=7+e-n,i;return-((7+wt(t,0,r).getUTCDay()-e)%7)+r-1}function jt(t,e,n,r,i){var o,a,s,u,c=1+7*(e-1)+(7+n-r)%7+Ot(t,r,i);return 0>=c?a=mt(o=t-1)+c:c>mt(t)?(o=t+1,a=c-mt(t)):(o=t,a=c),{year:o,dayOfYear:a}}function St(t,e,n){var r,i,o=Ot(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>a?r=a+Et(i=t.year()-1,e,n):a>Et(t.year(),e,n)?(r=a-Et(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function Et(t,e,n){var r=Ot(t,e,n),i=Ot(t+1,e,n);return(mt(t)-r+i)/7}function Mt(t){return St(t,this._week.dow,this._week.doy).week}function Ct(){return this._week.dow}function Pt(){return this._week.doy}function kt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Tt(t){var e=St(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function At(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function It(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Lt(t,e){return t?i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function Nt(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Dt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Rt(t,e,n){var r,i,o,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;7>r;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(i=pi.call(this._weekdaysParse,a))?i:null:"ddd"===e?-1!==(i=pi.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=pi.call(this._minWeekdaysParse,a))?i:null:"dddd"===e?-1!==(i=pi.call(this._weekdaysParse,a))?i:-1!==(i=pi.call(this._shortWeekdaysParse,a))?i:-1!==(i=pi.call(this._minWeekdaysParse,a))?i:null:"ddd"===e?-1!==(i=pi.call(this._shortWeekdaysParse,a))?i:-1!==(i=pi.call(this._weekdaysParse,a))?i:-1!==(i=pi.call(this._minWeekdaysParse,a))?i:null:-1!==(i=pi.call(this._minWeekdaysParse,a))?i:-1!==(i=pi.call(this._weekdaysParse,a))?i:-1!==(i=pi.call(this._shortWeekdaysParse,a))?i:null}function Ft(t,e,n){var r,i,o;if(this._weekdaysParseExact)return Rt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function zt(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=At(t,this.localeData()),this.add(t-e,"d")):e}function Bt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Yt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=It(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Vt(t){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Gt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(f(this,"_weekdaysRegex")||(this._weekdaysRegex=ji),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Wt(t){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Gt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(f(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Si),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ht(t){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Gt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(f(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ei),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Gt(){function t(t,e){return e.length-t.length}var e,n,r,i,o,a=[],s=[],u=[],c=[];for(e=0;7>e;e++)n=p([2e3,1]).day(e),r=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),o=this.weekdays(n,""),a.push(r),s.push(i),u.push(o),c.push(r),c.push(i),c.push(o);for(a.sort(t),s.sort(t),u.sort(t),c.sort(t),e=0;7>e;e++)s[e]=rt(s[e]),u[e]=rt(u[e]),c[e]=rt(c[e]);this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Ut(){return this.hours()%12||12}function qt(){return this.hours()||24}function Kt(t,e){X(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Xt(t,e){return e._meridiemParse}function Zt(t){return"p"===(t+"").toLowerCase().charAt(0)}function $t(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Qt(t){return t?t.toLowerCase().replace("_","-"):t}function Jt(t){for(var e,n,r,i,o=0;o0;){if(r=te(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&j(i,n,!0)>=e-1)break;e--}o++}return null}function te(e){var r=null;if(!ki[e]&&void 0!==t&&t&&t.exports)try{r=Ai._abbr,n(677)("./"+e),ee(r)}catch(t){}return ki[e]}function ee(t,e){var n;return t&&((n=m(e)?ie(t):ne(t,e))&&(Ai=n)),Ai._abbr}function ne(t,e){if(null!==e){var n=Pi;if(e.abbr=t,null!=ki[t])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ki[t]._config;else if(null!=e.parentLocale){if(null==ki[e.parentLocale])return Ti[e.parentLocale]||(Ti[e.parentLocale]=[]),Ti[e.parentLocale].push({name:t,config:e}),null;n=ki[e.parentLocale]._config}return ki[t]=new T(k(n,e)),Ti[t]&&Ti[t].forEach(function(t){ne(t.name,t.config)}),ee(t),ki[t]}return delete ki[t],null}function re(t,e){if(null!=e){var n,r=Pi;null!=ki[t]&&(r=ki[t]._config),(n=new T(e=k(r,e))).parentLocale=ki[t],ki[t]=n,ee(t)}else null!=ki[t]&&(null!=ki[t].parentLocale?ki[t]=ki[t].parentLocale:null!=ki[t]&&delete ki[t]);return ki[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Ai;if(!i(t)){if(e=te(t))return e;t=[t]}return Jt(t)}function oe(){return Sr(ki)}function ae(t){var e,n=t._a;return n&&-2===v(t).overflow&&(e=n[ii]<0||n[ii]>11?ii:n[oi]<1||n[oi]>st(n[ri],n[ii])?oi:n[ai]<0||n[ai]>24||24===n[ai]&&(0!==n[si]||0!==n[ui]||0!==n[ci])?ai:n[si]<0||n[si]>59?si:n[ui]<0||n[ui]>59?ui:n[ci]<0||n[ci]>999?ci:-1,v(t)._overflowDayOfYear&&(ri>e||e>oi)&&(e=oi),v(t)._overflowWeeks&&-1===e&&(e=li),v(t)._overflowWeekday&&-1===e&&(e=fi),v(t).overflow=e),t}function se(t){var e,n,r,i,o,a,s=t._i,u=Ii.exec(s)||Li.exec(s);if(u){for(v(t).iso=!0,e=0,n=Di.length;n>e;e++)if(Di[e][1].exec(u[1])){i=Di[e][0],r=!1!==Di[e][2];break}if(null==i)return void(t._isValid=!1);if(u[3]){for(e=0,n=Ri.length;n>e;e++)if(Ri[e][1].exec(u[3])){o=(u[2]||" ")+Ri[e][0];break}if(null==o)return void(t._isValid=!1)}if(!r&&null!=o)return void(t._isValid=!1);if(u[4]){if(!Ni.exec(u[4]))return void(t._isValid=!1);a="Z"}t._f=i+(o||"")+(a||""),pe(t)}else t._isValid=!1}function ue(t){var n=Fi.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(se(t),void(!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t))))}function ce(t,e,n){return null!=t?t:null!=e?e:n}function le(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function fe(t){var e,n,r,i,o=[];if(!t._d){for(r=le(t),t._w&&null==t._a[oi]&&null==t._a[ii]&&he(t),t._dayOfYear&&(i=ce(t._a[ri],r[ri]),t._dayOfYear>mt(i)&&(v(t)._overflowDayOfYear=!0),n=wt(i,0,t._dayOfYear),t._a[ii]=n.getUTCMonth(),t._a[oi]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=r[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ai]&&0===t._a[si]&&0===t._a[ui]&&0===t._a[ci]&&(t._nextDay=!0,t._a[ai]=0),t._d=(t._useUTC?wt:_t).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ai]=24)}}function he(t){var e,n,r,i,o,a,s,u,c=t._w;null!=c.GG||null!=c.W||null!=c.E?(i=1,o=4,e=ce(c.GG,t._a[ri],St(_e(),1,4).year),n=ce(c.W,1),(1>(r=ce(c.E,1))||r>7)&&(s=!0)):(i=t._locale._week.dow,o=t._locale._week.doy,u=St(_e(),i,o),e=ce(c.gg,t._a[ri],u.year),n=ce(c.w,u.week),null!=c.d?(0>(r=c.d)||r>6)&&(s=!0):null!=c.e?(r=c.e+i,(c.e<0||c.e>6)&&(s=!0)):r=i),1>n||n>Et(e,i,o)?v(t)._overflowWeeks=!0:null!=s?v(t)._overflowWeekday=!0:(a=jt(e,n,r,i,o),t._a[ri]=a.year,t._dayOfYear=a.dayOfYear)}function pe(t){if(t._f!==e.ISO_8601){t._a=[],v(t).empty=!0;var n,r,i,o,a,s=""+t._i,u=s.length,c=0;for(i=J(t._f,t._locale).match(Lr)||[],n=0;n0&&v(t).unusedInput.push(a),s=s.slice(s.indexOf(r)+r.length),c+=r.length),Rr[o]?(r?v(t).empty=!1:v(t).unusedTokens.push(o),at(o,r,t)):t._strict&&!r&&v(t).unusedTokens.push(o);v(t).charsLeftOver=u-c,s.length>0&&v(t).unusedInput.push(s),t._a[ai]<=12&&!0===v(t).bigHour&&t._a[ai]>0&&(v(t).bigHour=void 0),v(t).parsedDateParts=t._a.slice(0),v(t).meridiem=t._meridiem,t._a[ai]=de(t._locale,t._a[ai],t._meridiem),fe(t),ae(t)}else se(t)}function de(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((r=t.isPM(n))&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function ve(t){var e,n,r,i,o;if(0===t._f.length)return v(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;io)&&(r=o,n=e));h(t,n||e)}function ge(t){if(!t._d){var e=B(t._i);t._a=l([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),fe(t)}}function ye(t){var e=new x(ae(me(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function me(t){var e=t._i,n=t._f;return t._locale=t._locale||ie(t._l),null===e||void 0===n&&""===e?y({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new x(ae(e)):(c(e)?t._d=e:i(n)?ve(t):n?pe(t):be(t),g(t)||(t._d=null),t))}function be(t){var n=t._i;void 0===n?t._d=new Date(e.now()):c(n)?t._d=new Date(n.valueOf()):"string"==typeof n?ue(t):i(n)?(t._a=l(n.slice(0),function(t){return parseInt(t,10)}),fe(t)):"object"==(void 0===n?"undefined":o(n))?ge(t):u(n)?t._d=new Date(n):e.createFromInputFallback(t)}function xe(t,e,n,r,o){var u={};return(!0===n||!1===n)&&(r=n,n=void 0),(a(t)&&s(t)||i(t)&&0===t.length)&&(t=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=n,u._i=t,u._f=e,u._strict=r,ye(u)}function _e(t,e,n,r){return xe(t,e,n,r,!1)}function we(t,e){var n,r;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return _e();for(n=e[0],r=1;rt?-1*Math.round(-1*t):Math.round(t)}function Ce(t,e){X(t,0,0,function(){var t=this.utcOffset(),n="+";return 0>t&&(t=-t,n="-"),n+K(~~(t/60),2)+e+K(~~t%60,2)})}function Pe(t,e){var n,r,i,o=(e||"").match(t);return null===o?null:0===(i=60*(r=((n=o[o.length-1]||[])+"").match(Vi)||["-",0,0])[1]+O(r[2]))?0:"+"===r[0]?i:-i}function ke(t,n){var r,i;return n._isUTC?(r=n.clone(),i=(_(t)||c(t)?t.valueOf():_e(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+i),e.updateOffset(r,!1),r):_e(t).local()}function Te(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ae(t,n){var r,i=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Pe(Qr,t)))return this}else Math.abs(t)<16&&(t*=60);return!this._isUTC&&n&&(r=Te(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!n||this._changeInProgress?Ke(this,We(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Te(this)}function Ie(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Le(t){return this.utcOffset(0,t)}function Ne(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Te(this),"m")),this}function De(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var t=Pe($r,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this}function Re(t){return!!this.isValid()&&(t=t?_e(t).utcOffset():0,0==(this.utcOffset()-t)%60)}function Fe(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ze(){var t,e;return m(this._isDSTShifted)?(b(t={},this),(t=me(t))._a?(e=t._isUTC?p(t._a):_e(t._a),this._isDSTShifted=this.isValid()&&j(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted):this._isDSTShifted}function Be(){return!!this.isValid()&&!this._isUTC}function Ye(){return!!this.isValid()&&this._isUTC}function Ve(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function We(t,e){var n,r,i,a=t,s=null;return Ee(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:u(t)?(a={},e?a[e]=t:a.milliseconds=t):(s=Wi.exec(t))?(n="-"===s[1]?-1:1,a={y:0,d:O(s[oi])*n,h:O(s[ai])*n,m:O(s[si])*n,s:O(s[ui])*n,ms:O(Me(1e3*s[ci]))*n}):(s=Hi.exec(t))?(n="-"===s[1]?-1:1,a={y:He(s[2],n),M:He(s[3],n),w:He(s[4],n),d:He(s[5],n),h:He(s[6],n),m:He(s[7],n),s:He(s[8],n)}):null==a?a={}:"object"==(void 0===a?"undefined":o(a))&&("from"in a||"to"in a)&&(i=Ue(_e(a.from),_e(a.to)),(a={}).ms=i.milliseconds,a.M=i.months),r=new Se(a),Ee(t)&&f(t,"_locale")&&(r._locale=t._locale),r}function He(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ge(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Ue(t,e){var n;return t.isValid()&&e.isValid()?(e=ke(e,t),t.isBefore(e)?n=Ge(t,e):((n=Ge(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function qe(t,e){return function(n,r){var i,o;return null===r||isNaN(+r)||(M(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),Ke(this,i=We(n="string"==typeof n?+n:n,r),t),this}}function Ke(t,n,r,i){var o=n._milliseconds,a=Me(n._days),s=Me(n._months);t.isValid()&&(i=null==i||i,o&&t._d.setTime(t._d.valueOf()+o*r),a&&G(t,"Date",H(t,"Date")+a*r),s&&ht(t,H(t,"Month")+s*r),i&&e.updateOffset(t,a||s))}function Xe(t,e){var n=t.diff(e,"days",!0);return-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse"}function Ze(t,n){var r=t||_e(),i=ke(r,this).startOf("day"),o=e.calendarFormat(this,i)||"sameElse",a=n&&(C(n[o])?n[o].call(this,r):n[o]);return this.format(a||this.localeData().calendar(o,this,_e(r)))}function $e(){return new x(this)}function Qe(t,e){var n=_(t)?t:_e(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=z(m(e)?"millisecond":e))?this.valueOf()>n.valueOf():n.valueOf()e-o?r=(e-o)/(o-(n=t.clone().add(i-1,"months"))):r=(e-o)/((n=t.clone().add(i+1,"months"))-o),-(i+r)||0}function sn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function un(){var t=this.clone().utc();return 0(o=Et(t,r,i))&&(e=o),Nn.call(this,t,e,n,r,i))}function Nn(t,e,n,r,i){var o=jt(t,e,n,r,i),a=wt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Dn(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Rn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Fn(t,e){e[ci]=O(1e3*("0."+t))}function zn(){return this._isUTC?"UTC":""}function Bn(){return this._isUTC?"Coordinated Universal Time":""}function Yn(t){return _e(1e3*t)}function Vn(){return _e.apply(null,arguments).parseZone()}function Wn(t){return t}function Hn(t,e,n,r){var i=ie(),o=p().set(r,e);return i[n](o,t)}function Gn(t,e,n){var r,i;if(u(t)&&(e=t,t=void 0),t=t||"",null!=e)return Hn(t,e,n,"month");for(i=[],r=0;12>r;r++)i[r]=Hn(t,r,n,"month");return i}function Un(t,e,n,r){var i,o,a,s;if("boolean"==typeof t?(u(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,u(e)&&(n=e,e=void 0),e=e||""),i=ie(),o=t?i._week.dow:0,null!=n)return Hn(e,(n+o)%7,r,"day");for(s=[],a=0;7>a;a++)s[a]=Hn(e,(a+o)%7,r,"day");return s}function qn(t,e){return Gn(t,e,"months")}function Kn(t,e){return Gn(t,e,"monthsShort")}function Xn(t,e,n){return Un(t,e,n,"weekdays")}function Zn(t,e,n){return Un(t,e,n,"weekdaysShort")}function $n(t,e,n){return Un(t,e,n,"weekdaysMin")}function Qn(){var t=this._data;return this._milliseconds=eo(this._milliseconds),this._days=eo(this._days),this._months=eo(this._months),t.milliseconds=eo(t.milliseconds),t.seconds=eo(t.seconds),t.minutes=eo(t.minutes),t.hours=eo(t.hours),t.months=eo(t.months),t.years=eo(t.years),this}function Jn(t,e,n,r){var i=We(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function tr(t,e){return Jn(this,t,e,1)}function er(t,e){return Jn(this,t,e,-1)}function nr(t){return 0>t?Math.floor(t):Math.ceil(t)}function rr(){var t,e,n,r,i,o=this._milliseconds,a=this._days,s=this._months,u=this._data;return o>=0&&a>=0&&s>=0||0>=o&&0>=a&&0>=s||(o+=864e5*nr(or(s)+a),a=0,s=0),u.milliseconds=o%1e3,t=w(o/1e3),u.seconds=t%60,e=w(t/60),u.minutes=e%60,n=w(e/60),u.hours=n%24,s+=i=w(ir(a+=w(n/24))),a-=nr(or(i)),r=w(s/12),s%=12,u.days=a,u.months=s,u.years=r,this}function ir(t){return 4800*t/146097}function or(t){return 146097*t/4800}function ar(t){var e,n,r=this._milliseconds;if("month"===(t=z(t))||"year"===t)return e=this._days+r/864e5,n=this._months+ir(e),"month"===t?n:n/12;switch(e=this._days+Math.round(or(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function sr(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*O(this._months/12)}function ur(t){return function(){return this.as(t)}}function cr(t){return this[(t=z(t))+"s"]()}function lr(t){return function(){return this._data[t]}}function fr(){return w(this.days()/7)}function hr(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function pr(t,e,n){var r=We(t).abs(),i=mo(r.as("s")),o=mo(r.as("m")),a=mo(r.as("h")),s=mo(r.as("d")),u=mo(r.as("M")),c=mo(r.as("y")),l=i=o&&["m"]||o=a&&["h"]||a=s&&["d"]||s=u&&["M"]||u=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,hr.apply(null,l)}function dr(t){return void 0===t?mo:"function"==typeof t&&(mo=t,!0)}function vr(t,e){return void 0!==bo[t]&&(void 0===e?bo[t]:(bo[t]=e,!0))}function gr(t){var e=this.localeData(),n=pr(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function yr(){var t,e,n,r,i,o,a,s,u=xo(this._milliseconds)/1e3,c=xo(this._days),l=xo(this._months),f=w(u/60),h=w(f/60);return u%=60,f%=60,e=t=w(l/12),n=l%=12,r=c,i=h,o=f,a=u,(s=this.asSeconds())?(0>s?"-":"")+"P"+(e?e+"Y":"")+(n?n+"M":"")+(r?r+"D":"")+(i||o||a?"T":"")+(i?i+"H":"")+(o?o+"M":"")+(a?a+"S":""):"P0D"}var mr,br,xr,_r,wr,Or,jr,Sr,Er,Mr,Cr,Pr,kr,Tr,Ar,Ir,Lr,Nr,Dr,Rr,Fr,zr,Br,Yr,Vr,Wr,Hr,Gr,Ur,qr,Kr,Xr,Zr,$r,Qr,Jr,ti,ei,ni,ri,ii,oi,ai,si,ui,ci,li,fi,hi,pi,di,vi,gi,yi,mi,bi,xi,_i,wi,Oi,ji,Si,Ei,Mi,Ci,Pi,ki,Ti,Ai,Ii,Li,Ni,Di,Ri,Fi,zi,Bi,Yi,Vi,Wi,Hi,Gi,Ui,qi,Ki,Xi,Zi,$i,Qi,Ji,to,eo,no,ro,io,oo,ao,so,uo,co,lo,fo,ho,po,vo,go,yo,mo,bo,xo,_o;for(br=Array.prototype.some?Array.prototype.some:function(t){var e,n=Object(this),r=n.length>>>0;for(e=0;r>e;e++)if(e in n&&t.call(this,n[e],e,n))return!0;return!1},xr=br,_r=e.momentProperties=[],wr=!1,Or={},e.suppressDeprecationWarnings=!1,e.deprecationHandler=null,jr=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)f(t,e)&&n.push(e);return n},Sr=jr,Er={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Mr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Cr="Invalid date",Pr="%d",kr=/\d{1,2}/,Tr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ar={},Ir={},Lr=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Nr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Dr={},Rr={},Fr=/\d/,zr=/\d\d/,Br=/\d{3}/,Yr=/\d{4}/,Vr=/[+-]?\d{6}/,Wr=/\d\d?/,Hr=/\d\d\d\d?/,Gr=/\d\d\d\d\d\d?/,Ur=/\d{1,3}/,qr=/\d{1,4}/,Kr=/[+-]?\d{1,6}/,Xr=/\d+/,Zr=/[+-]?\d+/,$r=/Z|[+-]\d\d:?\d\d/gi,Qr=/Z|[+-]\d\d(?::?\d\d)?/gi,Jr=/[+-]?\d+(\.\d{1,3})?/,ti=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ei={},ni={},ri=0,ii=1,oi=2,ai=3,si=4,ui=5,ci=6,li=7,fi=8,hi=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=t?""+t:"+"+t}),X(0,["YY",2],0,function(){return this.year()%100}),X(0,["YYYY",4],0,"year"),X(0,["YYYYY",5],0,"year"),X(0,["YYYYYY",6,!0],0,"year"),F("year","y"),Y("year",1),tt("Y",Zr),tt("YY",Wr,zr),tt("YYYY",qr,Yr),tt("YYYYY",Kr,Vr),tt("YYYYYY",Kr,Vr),it(["YYYYY","YYYYYY"],ri),it("YYYY",function(t,n){n[ri]=2===t.length?e.parseTwoDigitYear(t):O(t)}),it("YY",function(t,n){n[ri]=e.parseTwoDigitYear(t)}),it("Y",function(t,e){e[ri]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return O(t)+(O(t)>68?1900:2e3)},bi=W("FullYear",!0),X("w",["ww",2],"wo","week"),X("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),Y("week",5),Y("isoWeek",5),tt("w",Wr),tt("ww",Wr,zr),tt("W",Wr),tt("WW",Wr,zr),ot(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=O(t)}),xi={dow:0,doy:6},X("d",0,"do","day"),X("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),X("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),X("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),X("e",0,0,"weekday"),X("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),tt("d",Wr),tt("e",Wr),tt("E",Wr),tt("dd",function(t,e){return e.weekdaysMinRegex(t)}),tt("ddd",function(t,e){return e.weekdaysShortRegex(t)}),tt("dddd",function(t,e){return e.weekdaysRegex(t)}),ot(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:v(n).invalidWeekday=t}),ot(["d","e","E"],function(t,e,n,r){e[r]=O(t)}),_i="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wi="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Oi="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ji=ti,Si=ti,Ei=ti,X("H",["HH",2],0,"hour"),X("h",["hh",2],0,Ut),X("k",["kk",2],0,qt),X("hmm",0,0,function(){return""+Ut.apply(this)+K(this.minutes(),2)}),X("hmmss",0,0,function(){return""+Ut.apply(this)+K(this.minutes(),2)+K(this.seconds(),2)}),X("Hmm",0,0,function(){return""+this.hours()+K(this.minutes(),2)}),X("Hmmss",0,0,function(){return""+this.hours()+K(this.minutes(),2)+K(this.seconds(),2)}),Kt("a",!0),Kt("A",!1),F("hour","h"),Y("hour",13),tt("a",Xt),tt("A",Xt),tt("H",Wr),tt("h",Wr),tt("HH",Wr,zr),tt("hh",Wr,zr),tt("hmm",Hr),tt("hmmss",Gr),tt("Hmm",Hr),tt("Hmmss",Gr),it(["H","HH"],ai),it(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),it(["h","hh"],function(t,e,n){e[ai]=O(t),v(n).bigHour=!0}),it("hmm",function(t,e,n){var r=t.length-2;e[ai]=O(t.substr(0,r)),e[si]=O(t.substr(r)),v(n).bigHour=!0}),it("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[ai]=O(t.substr(0,r)),e[si]=O(t.substr(r,2)),e[ui]=O(t.substr(i)),v(n).bigHour=!0}),it("Hmm",function(t,e){var n=t.length-2;e[ai]=O(t.substr(0,n)),e[si]=O(t.substr(n))}),it("Hmmss",function(t,e){var n=t.length-4,r=t.length-2;e[ai]=O(t.substr(0,n)),e[si]=O(t.substr(n,2)),e[ui]=O(t.substr(r))}),Mi=/[ap]\.?m?\.?/i,Ci=W("Hours",!0),Pi={calendar:Er,longDateFormat:Mr,invalidDate:Cr,ordinal:Pr,ordinalParse:kr,relativeTime:Tr,months:vi,monthsShort:gi,week:xi,weekdays:_i,weekdaysMin:Oi,weekdaysShort:wi,meridiemParse:Mi},ki={},Ti={},Ii=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Li=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ni=/Z|[+-]\d\d(?::?\d\d)?/,Di=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Ri=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Fi=/^\/?Date\((\-?\d+)/i,e.createFromInputFallback=E("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){},zi=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_e.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:y()}),Bi=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_e.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:y()}),Yi=function t(){return Date.now?Date.now():+new Date},Ce("Z",":"),Ce("ZZ",""),tt("Z",Qr),tt("ZZ",Qr),it(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Pe(Qr,t)}),Vi=/([\+\-]|\d\d)/gi,e.updateOffset=function(){},Wi=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Hi=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/,We.fn=Se.prototype,Gi=qe(1,"add"),Ui=qe(-1,"subtract"),e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",qi=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)}),X(0,["gg",2],0,function(){return this.weekYear()%100}),X(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Pn("gggg","weekYear"),Pn("ggggg","weekYear"),Pn("GGGG","isoWeekYear"),Pn("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),tt("G",Zr),tt("g",Zr),tt("GG",Wr,zr),tt("gg",Wr,zr),tt("GGGG",qr,Yr),tt("gggg",qr,Yr),tt("GGGGG",Kr,Vr),tt("ggggg",Kr,Vr),ot(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=O(t)}),ot(["gg","GG"],function(t,n,r,i){n[i]=e.parseTwoDigitYear(t)}),X("Q",0,"Qo","quarter"),F("quarter","Q"),Y("quarter",7),tt("Q",Fr),it("Q",function(t,e){e[ii]=3*(O(t)-1)}),X("D",["DD",2],"Do","date"),F("date","D"),Y("date",9),tt("D",Wr),tt("DD",Wr,zr),tt("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),it(["D","DD"],oi),it("Do",function(t,e){e[oi]=O(t.match(Wr)[0],10)}),Ki=W("Date",!0),X("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),Y("dayOfYear",4),tt("DDD",Ur),tt("DDDD",Br),it(["DDD","DDDD"],function(t,e,n){n._dayOfYear=O(t)}),X("m",["mm",2],0,"minute"),F("minute","m"),Y("minute",14),tt("m",Wr),tt("mm",Wr,zr),it(["m","mm"],si),Xi=W("Minutes",!1),X("s",["ss",2],0,"second"),F("second","s"),Y("second",15),tt("s",Wr),tt("ss",Wr,zr),it(["s","ss"],ui),Zi=W("Seconds",!1),X("S",0,0,function(){return~~(this.millisecond()/100)}),X(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),X(0,["SSS",3],0,"millisecond"),X(0,["SSSS",4],0,function(){return 10*this.millisecond()}),X(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),X(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),X(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),X(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),X(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),Y("millisecond",16),tt("S",Ur,Fr),tt("SS",Ur,zr),tt("SSS",Ur,Br),$i="SSSS";$i.length<=9;$i+="S")tt($i,Xr);for($i="S";$i.length<=9;$i+="S")it($i,Fn);return Qi=W("Milliseconds",!1),X("z",0,0,"zoneAbbr"),X("zz",0,0,"zoneName"),(Ji=x.prototype).add=Gi,Ji.calendar=Ze,Ji.clone=$e,Ji.diff=on,Ji.endOf=mn,Ji.format=ln,Ji.from=fn,Ji.fromNow=hn,Ji.to=pn,Ji.toNow=dn,Ji.get=U,Ji.invalidAt=Mn,Ji.isAfter=Qe,Ji.isBefore=Je,Ji.isBetween=tn,Ji.isSame=en,Ji.isSameOrAfter=nn,Ji.isSameOrBefore=rn,Ji.isValid=Sn,Ji.lang=qi,Ji.locale=vn,Ji.localeData=gn,Ji.max=Bi,Ji.min=zi,Ji.parsingFlags=En,Ji.set=q,Ji.startOf=yn,Ji.subtract=Ui,Ji.toArray=wn,Ji.toObject=On,Ji.toDate=_n,Ji.toISOString=un,Ji.inspect=cn,Ji.toJSON=jn,Ji.toString=sn,Ji.unix=xn,Ji.valueOf=bn,Ji.creationData=Cn,Ji.year=bi,Ji.isLeapYear=xt,Ji.weekYear=kn,Ji.isoWeekYear=Tn,Ji.quarter=Ji.quarters=Dn,Ji.month=pt,Ji.daysInMonth=dt,Ji.week=Ji.weeks=kt,Ji.isoWeek=Ji.isoWeeks=Tt,Ji.weeksInYear=In,Ji.isoWeeksInYear=An,Ji.date=Ki,Ji.day=Ji.days=zt,Ji.weekday=Bt,Ji.isoWeekday=Yt,Ji.dayOfYear=Rn,Ji.hour=Ji.hours=Ci,Ji.minute=Ji.minutes=Xi,Ji.second=Ji.seconds=Zi,Ji.millisecond=Ji.milliseconds=Qi,Ji.utcOffset=Ae,Ji.utc=Le,Ji.local=Ne,Ji.parseZone=De,Ji.hasAlignedHourOffset=Re,Ji.isDST=Fe,Ji.isLocal=Be,Ji.isUtcOffset=Ye,Ji.isUtc=Ve,Ji.isUTC=Ve,Ji.zoneAbbr=zn,Ji.zoneName=Bn,Ji.dates=E("dates accessor is deprecated. Use date instead.",Ki),Ji.months=E("months accessor is deprecated. Use month instead",pt),Ji.years=E("years accessor is deprecated. Use year instead",bi),Ji.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ie),Ji.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ze),(to=T.prototype).calendar=A,to.longDateFormat=I,to.invalidDate=L,to.ordinal=N,to.preparse=Wn,to.postformat=Wn,to.relativeTime=D,to.pastFuture=R,to.set=P,to.months=ut,to.monthsShort=ct,to.monthsParse=ft,to.monthsRegex=gt,to.monthsShortRegex=vt,to.week=Mt,to.firstDayOfYear=Pt,to.firstDayOfWeek=Ct,to.weekdays=Lt,to.weekdaysMin=Dt,to.weekdaysShort=Nt,to.weekdaysParse=Ft,to.weekdaysRegex=Vt,to.weekdaysShortRegex=Wt,to.weekdaysMinRegex=Ht,to.isPM=Zt,to.meridiem=$t,ee("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function t(e){var n=e%10,r;return e+(1===O(e%100/10)?"th":1===n?"st":2===n?"nd":3===n?"rd":"th")}}),e.lang=E("moment.lang is deprecated. Use moment.locale instead.",ee),e.langData=E("moment.langData is deprecated. Use moment.localeData instead.",ie),eo=Math.abs,no=ur("ms"),ro=ur("s"),io=ur("m"),oo=ur("h"),ao=ur("d"),so=ur("w"),uo=ur("M"),co=ur("y"),lo=lr("milliseconds"),fo=lr("seconds"),ho=lr("minutes"),po=lr("hours"),vo=lr("days"),go=lr("months"),yo=lr("years"),mo=Math.round,bo={s:45,m:45,h:22,d:26,M:11},xo=Math.abs,(_o=Se.prototype).abs=Qn,_o.add=tr,_o.subtract=er,_o.as=ar,_o.asMilliseconds=no,_o.asSeconds=ro,_o.asMinutes=io,_o.asHours=oo,_o.asDays=ao,_o.asWeeks=so,_o.asMonths=uo,_o.asYears=co,_o.valueOf=sr,_o._bubble=rr,_o.get=cr,_o.milliseconds=lo,_o.seconds=fo,_o.minutes=ho,_o.hours=po,_o.days=vo,_o.weeks=fr,_o.months=go,_o.years=yo,_o.humanize=gr,_o.toISOString=yr,_o.toString=yr,_o.toJSON=yr,_o.locale=vn,_o.localeData=gn,_o.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",yr),_o.lang=qi,X("X",0,0,"unix"),X("x",0,0,"valueOf"),tt("x",Zr),tt("X",Jr),it("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),it("x",function(t,e,n){n._d=new Date(O(t))}),e.version="2.17.0",r(_e),e.fn=Ji,e.min=Oe,e.max=je,e.now=Yi,e.utc=p,e.unix=Yn,e.months=qn,e.isDate=c,e.locale=ee,e.invalid=y,e.duration=We,e.isMoment=_,e.weekdays=Xn,e.parseZone=Vn,e.localeData=ie,e.isDuration=Ee,e.monthsShort=Kn,e.weekdaysMin=$n,e.defineLocale=ne,e.updateLocale=re,e.locales=oe,e.weekdaysShort=Zn,e.normalizeUnits=z,e.relativeTimeRounding=dr,e.relativeTimeThreshold=vr,e.calendarFormat=Xe,e.prototype=Ji,e.defineLocale("zh-cn",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u5468\u65e5_\u5468\u4e00_\u5468\u4e8c_\u5468\u4e09_\u5468\u56db_\u5468\u4e94_\u5468\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"Ah\u70b9mm\u5206",LTS:"Ah\u70b9m\u5206s\u79d2",L:"YYYY-MM-DD",LL:"YYYY\u5e74MMMD\u65e5",LLL:"YYYY\u5e74MMMD\u65e5Ah\u70b9mm\u5206",LLLL:"YYYY\u5e74MMMD\u65e5ddddAh\u70b9mm\u5206",l:"YYYY-MM-DD",ll:"YYYY\u5e74MMMD\u65e5",lll:"YYYY\u5e74MMMD\u65e5Ah\u70b9mm\u5206",llll:"YYYY\u5e74MMMD\u65e5ddddAh\u70b9mm\u5206"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function t(e,n){return 12===e&&(e=0),"\u51cc\u6668"===n||"\u65e9\u4e0a"===n||"\u4e0a\u5348"===n?e:"\u4e0b\u5348"===n||"\u665a\u4e0a"===n?e+12:e>=11?e:e+12},meridiem:function t(e,n){var r=100*e+n;return 600>r?"\u51cc\u6668":900>r?"\u65e9\u4e0a":1130>r?"\u4e0a\u5348":1230>r?"\u4e2d\u5348":1800>r?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:function t(){return 0===this.minutes()?"[\u4eca\u5929]Ah[\u70b9\u6574]":"[\u4eca\u5929]LT"},nextDay:function t(){return 0===this.minutes()?"[\u660e\u5929]Ah[\u70b9\u6574]":"[\u660e\u5929]LT"},lastDay:function t(){return 0===this.minutes()?"[\u6628\u5929]Ah[\u70b9\u6574]":"[\u6628\u5929]LT"},nextWeek:function t(){var n,r;return n=e().startOf("week"),r=this.diff(n,"days")>=7?"[\u4e0b]":"[\u672c]",0===this.minutes()?r+"dddAh\u70b9\u6574":r+"dddAh\u70b9mm"},lastWeek:function t(){var n,r;return n=e().startOf("week"),r=this.unix()=11?e:e+12:"\u4e0b\u5348"===n||"\u665a\u4e0a"===n?e+12:void 0},meridiem:function t(e,n){var r=100*e+n;return 600>r?"\u51cc\u6668":900>r?"\u65e9\u4e0a":1130>r?"\u4e0a\u5348":1230>r?"\u4e2d\u5348":1800>r?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:"[\u4e0b]ddddLT",lastDay:"[\u6628\u5929]LT",lastWeek:"[\u4e0a]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function t(e,n){switch(n){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5167",past:"%s\u524d",s:"\u5e7e\u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}}),e.defineLocale("zh-tw",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"Ah\u9edemm\u5206",LTS:"Ah\u9edem\u5206s\u79d2",L:"YYYY\u5e74MMMD\u65e5",LL:"YYYY\u5e74MMMD\u65e5",LLL:"YYYY\u5e74MMMD\u65e5Ah\u9edemm\u5206",LLLL:"YYYY\u5e74MMMD\u65e5ddddAh\u9edemm\u5206",l:"YYYY\u5e74MMMD\u65e5",ll:"YYYY\u5e74MMMD\u65e5",lll:"YYYY\u5e74MMMD\u65e5Ah\u9edemm\u5206",llll:"YYYY\u5e74MMMD\u65e5ddddAh\u9edemm\u5206"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function t(e,n){return 12===e&&(e=0),"\u51cc\u6668"===n||"\u65e9\u4e0a"===n||"\u4e0a\u5348"===n?e:"\u4e2d\u5348"===n?e>=11?e:e+12:"\u4e0b\u5348"===n||"\u665a\u4e0a"===n?e+12:void 0},meridiem:function t(e,n){var r=100*e+n;return 600>r?"\u51cc\u6668":900>r?"\u65e9\u4e0a":1130>r?"\u4e0a\u5348":1230>r?"\u4e2d\u5348":1800>r?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:"[\u4e0b]ddddLT",lastDay:"[\u6628\u5929]LT",lastWeek:"[\u4e0a]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function t(e,n){switch(n){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5167",past:"%s\u524d",s:"\u5e7e\u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}}),e.defineLocale("ja",{months:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u65e5\u66dc\u65e5_\u6708\u66dc\u65e5_\u706b\u66dc\u65e5_\u6c34\u66dc\u65e5_\u6728\u66dc\u65e5_\u91d1\u66dc\u65e5_\u571f\u66dc\u65e5".split("_"),weekdaysShort:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),weekdaysMin:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),longDateFormat:{LT:"Ah\u6642m\u5206",LTS:"Ah\u6642m\u5206s\u79d2",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5Ah\u6642m\u5206",LLLL:"YYYY\u5e74M\u6708D\u65e5Ah\u6642m\u5206 dddd"},meridiemParse:/\u5348\u524d|\u5348\u5f8c/i,isPM:function t(e){return"\u5348\u5f8c"===e},meridiem:function t(e){return 12>e?"\u5348\u524d":"\u5348\u5f8c"},calendar:{sameDay:"[\u4eca\u65e5] LT",nextDay:"[\u660e\u65e5] LT",nextWeek:"[\u6765\u9031]dddd LT",lastDay:"[\u6628\u65e5] LT",lastWeek:"[\u524d\u9031]dddd LT",sameElse:"L"},ordinalParse:/\d{1,2}\u65e5/,ordinal:function t(e,n){switch(n){case"d":case"D":case"DDD":return e+"\u65e5";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u6570\u79d2",m:"1\u5206",mm:"%d\u5206",h:"1\u6642\u9593",hh:"%d\u6642\u9593",d:"1\u65e5",dd:"%d\u65e5",M:"1\u30f6\u6708",MM:"%d\u30f6\u6708",y:"1\u5e74",yy:"%d\u5e74"}}),e.locale("en"),e},"object"==o(e)&&void 0!==t?t.exports=s():void 0===(i="function"==typeof(r=s)?r.call(e,n,e,t):r)||(t.exports=i)}).call(this,n(676)(t))},function(t,e,n){n(173),n(173),t.exports=n(614)},function(t,e,n){"use strict";var r,i=O(n(498)),o,a=O(n(232)),s,u=O(n(499)),c,l=O(n(500)),f,h=O(n(501)),p,d=O(n(502)),v,g=O(n(504)),y,m=O(n(505)),b,x=O(n(506)),_,w=O(n(507));function O(t){return t&&t.__esModule?t:{default:t}}t.exports={focus:i.default,func:a.default,keyCode:u.default,pickAttrs:l.default,scrollbar:h.default,support:d.default,log:g.default,pickOthers:m.default,obj:x.default,children:w.default}},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(11);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(488));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default,t.exports=e.default},function(t,e){t.exports=window.ReactDOM},function(t,e,n){n(171),n(171),t.exports=n(257)},function(t,e,n){var r=n(131)("wks"),i=n(61),o=n(10).Symbol,a="function"==typeof o,s;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(42),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";n(278),Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(660));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default},function(t,e,n){var r=n(9),i=n(198),o=n(53),a=Object.defineProperty;e.f=n(19)?Object.defineProperty:function t(e,n,s){if(r(e),n=o(n,!0),r(s),i)try{return a(e,n,s)}catch(t){}if("get"in s||"set"in s)throw TypeError("Accessors not supported!");return"value"in s&&(e[n]=s.value),e}},function(t,e,n){t.exports=!n(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n=t.exports={version:"2.6.1"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";e.__esModule=!0;var r,i=u(n(533)),o,a=u(n(545)),s="function"==typeof a.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};function u(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof a.default&&"symbol"===s(i.default)?function(t){return void 0===t?"undefined":s(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":s(t)}},function(t,e,n){!function e(r,i){t.exports=i(n(0))}(this,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=520)}([function(t,e,n){var r=n(157),i=n(25),o=r.mix({},r,{assign:r.mix,merge:r.deepMix,cloneDeep:r.clone,isFinite:isFinite,isNaN:isNaN,snapEqual:r.isNumberEqual,remove:r.pull,inArray:r.contains,toAllPadding:function t(e){var n=0,r=0,i=0,a=0;return o.isNumber(e)||o.isString(e)?n=r=i=a=e:o.isArray(e)?(n=e[0],i=o.isNil(e[1])?e[0]:e[1],a=o.isNil(e[2])?e[0]:e[2],r=o.isNil(e[3])?i:e[3]):o.isObject(e)&&(n=e.top||0,i=e.right||0,a=e.bottom||0,r=e.left||0),[n,i,a,r]},getClipByRange:function t(e){var n=e.tl,r=e.br,o;return new i.Rect({attrs:{x:n.x,y:n.y,width:r.x-n.x,height:r.y-n.y}})}});o.Array={groupToMap:r.groupToMap,group:r.group,merge:r.merge,values:r.valuesOfKey,getRange:r.getRange,firstValue:r.firstValue,remove:r.pull},t.exports=o},function(t,e,n){var r=n(140),i={};r.merge(i,r,{mixin:function t(e,n){var r=e.CFG?"CFG":"ATTRS";if(e&&n){e._mixins=n,e[r]=e[r]||{};var o={};i.each(n,function(t){i.augment(e,t);var n=t[r];n&&i.merge(o,n)}),e[r]=i.merge(o,e[r])}}}),t.exports=i},function(t,e,n){var r=n(38),i=n(4),o=function t(e,n){if(e){var o=void 0;if(i(e))for(var a=0,s=e.length;a0){var u=i.strokeOpacity;r.isNil(u)||1===u||(e.globalAlpha=u),e.stroke()}this.afterPath(e)},afterPath:function t(){},isHitBox:function t(){return!0},isHit:function t(e,n){var r=this,i=[e,n,1];if(this.invert(i),this.isHitBox()){var o=this.getBBox();if(o&&!a.box(o.minX,o.maxX,o.minY,o.maxY,i[0],i[1]))return!1}var s=this._attrs.clip;return s?(s.invert(i,this.get("canvas")),!!s.isPointInPath(i[0],i[1])&&this.isPointInPath(i[0],i[1])):this.isPointInPath(i[0],i[1])},calculateBox:function t(){return null},getHitLineWidth:function t(){var e=this._attrs,n=e.lineAppendWidth||0,r;return(e.lineWidth||0)+n},clearTotalMatrix:function t(){this._cfg.totalMatrix=null,this._cfg.region=null},clearBBox:function t(){this._cfg.box=null,this._cfg.region=null},getBBox:function t(){var e=this._cfg.box;return e||((e=this.calculateBox())&&(e.x=e.minX,e.y=e.minY,e.width=e.maxX-e.minX,e.height=e.maxY-e.minY),this._cfg.box=e),e},clone:function t(){var e=this,t=null,n=this._attrs,i={};return r.each(n,function(t,e){u[e]&&r.isArray(n[e])?i[e]=c(n[e]):i[e]=n[e]}),t=new this.constructor({attrs:i}),t._cfg.zIndex=this._cfg.zIndex,t}}),t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(61),a=n(217),s=n(113),u=n(0),c=n(5),l=n(284),f=n(9),h=n(290),p=n(288),d=n(289),v=n(303),g=["color","shape","size"],y="_origin";function m(t){return(u.isString(t)||u.isPlainObject(t))&&(t=[t]),u.each(t,function(e,n){u.isObject(e)||(t[n]={type:e})}),t}var b=function(t){r(n,t);var e=n.prototype;function n(e){var n;return(n=t.call(this,e)||this).viewTheme=n.get("viewTheme"),u.assign(i(i(n)),h,p,d),n.get("container")&&n._initContainer(),n._initOptions(),n}return e.getDefaultCfg=function t(){return{_id:null,type:"base",coord:null,attrs:{},view:null,data:[],scales:{},container:null,labelContainer:null,shapeContainer:null,attrOptions:{},styleOptions:null,selectedOptions:null,activedOptions:null,hasDefaultAdjust:!1,adjusts:null,shapeType:null,generatePoints:!1,sortable:!1,labelCfg:null,shareTooltip:!0,tooltipCfg:null,animate:!0,animateCfg:null,visible:!0}},e._initOptions=function t(){var e=this.get("adjusts");e&&(e=m(e),this.set("adjusts",e))},e._createScale=function t(e,n){var r=this.get("scales"),i=r[e];return i||(i=this.get("view").createScale(e,n),r[e]=i),i},e._setAttrOptions=function t(e,n){var r;this.get("attrOptions")[e]=n},e._createAttrOption=function t(e,n,r,i){var o={};o.field=n,r?u.isFunction(r)?o.callback=r:o.values=r:"color"!==e&&(o.values=i),this._setAttrOptions(e,o)},e.position=function t(e){return this._setAttrOptions("position",{field:e}),this},e.color=function t(e,n){var r=this.viewTheme||c;return this._createAttrOption("color",e,n,r.colors),this},e.size=function t(e,n){var r=this.viewTheme||c;return this._createAttrOption("size",e,n,r.sizes),this},e.shape=function t(e,n){var r=this.viewTheme||c,i=this.get("type"),o=r.shapes[i]||[];return this._createAttrOption("shape",e,n,o),this},e.opacity=function t(e,n){var r=this.viewTheme||c;return this._createAttrOption("opacity",e,n,r.opacities),this},e.style=function t(e,n){var r=this.get("styleOptions"),i;return r||(r={},this.set("styleOptions",r)),u.isObject(e)&&(n=e,e=null),e&&(i=v(e)),r.fields=i,r.style=n,this},e.label=function t(e,n,r){var i=this,o=this.get("labelCfg"),a;return o||(o={},this.set("labelCfg",o)),e&&(a=v(e)),o.fields=a,u.isFunction(n)?(r||(r={}),o.callback=n):u.isObject(n)&&(r=n),o.globalCfg=r,this},e.tooltip=function t(e,n){var r=this.get("tooltipCfg"),i;(r||(r={}),!1===e)?this.set("tooltipCfg",!1):(e&&(i=v(e)),r.fields=i,r.cfg=n);return this.set("tooltipCfg",r),this},e.animate=function t(e){return this.set("animateCfg",e),this},e.active=function t(e,n){return!1===e?this.set("allowActive",!1):u.isObject(e)?(this.set("allowActive",!0),this.set("activedOptions",e)):(this.set("allowActive",!0),this.set("activedOptions",n)),this},e.adjust=function t(e){return this.get("hasDefaultAdjust")||(e&&(e=m(e)),this.set("adjusts",e)),this},e.select=function t(e,n){return!1===e?this.set("allowSelect",!1):u.isObject(e)?(this.set("allowSelect",!0),this.set("selectedOptions",e)):(this.set("allowSelect",!0),this.set("selectedOptions",n)),this},e.hasAdjust=function t(e){var n=this,r=this.get("adjusts");if(!e)return!1;var i=!1;return u.each(r,function(t){if(t.type===e)return i=!0,!1}),i},e.hasStack=function t(){var e=this.get("isStacked");return u.isNil(e)&&(e=this.hasAdjust("stack"),this.set("isStacked",e)),e},e.isInCircle=function t(){var e=this.get("coord");return e&&e.isPolar},e._initContainer=function t(){var e=this,n=this.get("shapeContainer");if(!n){var r=this.get("container"),i=this.get("view"),o=i&&i.get("_id");n=r.addGroup({viewId:o,visible:this.get("visible")}),this.set("shapeContainer",n)}},e.init=function t(){var e=this;if(e._initContainer(),e._initAttrs(),e.get("tooltipCfg")&&e.get("tooltipCfg").fields){var n=e.get("tooltipCfg").fields;u.each(n,function(t){e._createScale(t)})}var r=e._processData();e.get("adjusts")&&e._adjust(r),e.set("dataArray",r)},e._initAttrs=function t(){var e=this,n=this.get("attrs"),r=this.get("attrOptions"),i=this.get("coord"),a=this.viewTheme||c,s=!1;for(var l in r)if(r.hasOwnProperty(l)){var f=r[l],h=u.upperFirst(l),p=v(f.field);"position"===l&&(f.coord=i,1===p.length&&"theta"===i.type&&(p.unshift("1"),s=!0));for(var d=[],g=0;g1){var b=d[1];b.change({nice:!1,min:0,max:Math.max.apply(null,b.values)})}f.scales=d;var x=new o[h](f);n[l]=x}},e._processData=function t(){for(var e=this,n=this.get("data"),r=[],i=this._groupData(n),o=0;oa&&(a=f)}(on.max)&&n.change({min:o,max:a})},e._adjust=function t(e){var n=this,r=n.get("adjusts"),i=this.viewTheme||c,o=n.getYScale(),s=n.getXScale(),l=s.field,f=o?o.field:null;u.each(r,function(t){var r=u.mix({xField:l,yField:f},t),c=u.upperFirst(t.type),h;if("Dodge"===c){var p=[];if(s.isCategory||s.isIdentity)p.push("x");else{if(o)throw new Error("dodge is not support linear attribute, please use category attribute!");p.push("y")}r.adjustNames=p,r.dodgeRatio=i.widthRatio.column}else if("Stack"===c){var d=n.get("coord");if(!o){r.height=d.getHeight();var v=n.getDefaultValue("size")||3;r.size=v}!d.isTransposed&&u.isNil(r.reverseOrder)&&(r.reverseOrder=!0)}new a[c](r).processAdjust(e),"Stack"===c&&o&&n._updateStackRange(f,o,e)})},e.setCoord=function t(e){this.set("coord",e);var n=this.getAttr("position"),r;this.get("shapeContainer").setMatrix(e.matrix),n&&(n.coord=e)},e.paint=function t(){var e=this,n=this.get("dataArray"),r=[],i=this.getShapeFactory();i.setCoord(this.get("coord")),this.set("shapeFactory",i);var o=this.get("shapeContainer");this._beforeMapping(n);for(var a=0;a=0?n:r<=0?r:0},e._normalizeValues=function t(e,n){var r=[];if(u.isArray(e))for(var i=0;i1)for(var p=0;p0)u.each(r,function(t){n+="-"+e[t]});else{var i=this.get("type"),o=this.getXScale(),a=this.getYScale(),s=o.field||"x",c=a.field||"y",l=e[c],f;f=o.isIdentity?o.value:e[s],n+="interval"===i||"schema"===i?"-"+f:"line"===i||"area"===i||"path"===i?"-"+i:"-"+f+"-"+l;var h=this._getGroupScales();u.isEmpty(h)||u.each(h,function(t){var r=t.field;"identity"!==t.type&&(n+="-"+e[r])})}return n},e.getDrawCfg=function t(e){var n=this,r={origin:e,x:e.x,y:e.y,color:e.color,size:e.size,shape:e.shape,isInCircle:this.isInCircle(),opacity:e.opacity},i=this.get("styleOptions");return i&&i.style&&(r.style=this.getCallbackCfg(i.fields,i.style,e._origin)),this.get("generatePoints")&&(r.points=e.points,r.nextPoints=e.nextPoints),this.get("animate")&&(r._id=this._getShapeId(e._origin)),r},e.appendShapeInfo=function t(e,n){e&&(e.setSilent("index",n),e.setSilent("coord",this.get("coord")),this.get("animate")&&this.get("animateCfg")&&e.setSilent("animateCfg",this.get("animateCfg")))},e._applyViewThemeShapeStyle=function t(e,n,r){var i=this,o=this.viewTheme||c,a=r.name;n?n&&(n.indexOf("hollow")>-1||n.indexOf("liquid")>-1)&&(a="hollow"+u.upperFirst(a)):r.defaultShapeType.indexOf("hollow")>-1&&(a="hollow"+u.upperFirst(a));var s=o.shape[a]||{};e.style=u.mix({},s,e.style)},e.drawPoint=function t(e,n,r,i){var o=this,a=e.shape,s=this.getDrawCfg(e);this._applyViewThemeShapeStyle(s,a,r);var u=r.drawShape(a,s,n);this.appendShapeInfo(u,i)},e.getAttr=function t(e){return this.get("attrs")[e]},e.getXScale=function t(){return this.getAttr("position").scales[0]},e.getYScale=function t(){return this.getAttr("position").scales[1]},e.getShapes=function t(){var e=[],n,r=this.get("shapeContainer").get("children");return u.each(r,function(t){t.get("origin")&&e.push(t)}),e},e.getAttrsForLegend=function t(){var e=this.get("attrs"),n=[];return u.each(e,function(t){-1!==g.indexOf(t.type)&&n.push(t)}),n},e.getFieldsForLegend=function t(){var e=[],n=this.get("attrOptions");return u.each(g,function(t){var r=n[t];r&&r.field&&u.isString(r.field)&&(e=e.concat(r.field.split("*")))}),u.uniq(e)},e.changeVisible=function t(e,n){var r;this.set("visible",e);var i=this.get("shapeContainer");i&&i.set("visible",e);var o=this.get("labelContainer"),a;(o&&o.set("visible",e),!n&&i)&&i.get("canvas").draw()},e.reset=function t(){this.set("attrOptions",{}),this.clearInner()},e.clearInner=function t(){this.clearActivedShapes(),this.clearSelected();var e=this.get("shapeContainer");e&&e.clear();var n=this.get("labelContainer");n&&n.remove(),this.set("attrs",{}),this.set("groupScales",null),this.set("labelContainer",null),this.set("xDistance",null),this.set("isStacked",null)},e.clear=function t(){this.clearInner(),this.set("scales",{})},e.destroy=function e(){this.clear();var n=this.get("shapeContainer");n&&n.remove(),this.offEvents(),t.prototype.destroy.call(this)},e.bindEvents=function t(){this.get("view")&&(this._bindActiveAction(),this._bindSelectedAction())},e.offEvents=function t(){this.get("view")&&(this._offActiveAction(),this._offSelectedAction())},n}(s);t.exports=b},function(t,e,n){var r=n(0),i=n(24),o=r.PathUtil,a={},s={_coord:null,draw:function t(e,n){return this.drawShape?this.drawShape(e,n):null},setCoord:function t(e){this._coord=e},parsePath:function t(e,n){var r=this._coord;return e=o.parsePathString(e),e=r.isPolar&&!1!==n?i.convertPolarPath(r,e):i.convertNormalPath(r,e)},parsePoint:function t(e){var n;return this._coord.convertPoint(e)},parsePoints:function t(e){var n=this._coord,i=[];return r.each(e,function(t){i.push(n.convertPoint(t))}),i}},u={defaultShapeType:null,setCoord:function t(e){this._coord=e},getShape:function t(e){var n=this;r.isArray(e)&&(e=e[0]);var i=this[e]||this[this.defaultShapeType];return i._coord=this._coord,i},getShapePoints:function t(e,n){var r=this.getShape(e),i,o;return(r.getPoints||r.getShapePoints||this.getDefaultPoints)(n)},getDefaultPoints:function t(){return[]},getMarkerCfg:function t(e,n){var r=this.getShape(e);if(!r.getMarkerCfg){var i=this.defaultShapeType;r=this.getShape(i)}return r.getMarkerCfg(n)},getSelectedCfg:function t(){return{}},drawShape:function t(e,n,r){var i,o=this.getShape(e).draw(n,r);return o&&(o.setSilent("origin",n.origin),o._id=n.yIndex?n._id+n.yIndex:n._id,o.name=this.name),o}};a.registerFactory=function(t,e){var n=r.upperFirst(t),i=r.assign({},u,e);return a[n]=i,i.name=t,i},a.registerShape=function(t,e,n){var i=r.upperFirst(t),o=a[i],u=r.assign({},s,n);return o[e]=u,u},a.getShapeFactory=function(t){var e=this,n;return t=t||"point",this[r.upperFirst(t)]},t.exports=a},function(t,e){function n(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}var r=function t(e,r,i,o){return r&&n(e,r),i&&n(e,i),o&&n(e,o),e};t.exports=r},function(t,e,n){var r=n(15),i=function t(e){return r(e,"Number")};t.exports=i},function(t,e,n){"use strict";var r=n(83);n.d(e,"f",function(){return r.h}),n.d(e,"e",function(){return r.g}),n.d(e,"d",function(){return r.f});var i=n(421);n.d(e,"c",function(){return i.b}),n.d(e,"b",function(){return i.a});var o=n(420);n.d(e,"a",function(){return o.a})},function(t,e,n){var r=n(15),i=function t(e){return r(e,"Function")};t.exports=i},function(t,e,n){var r=n(15),i=function t(e){return r(e,"String")};t.exports=i},function(t,e){var n={}.toString,r=function t(e,r){return n.call(e)==="[object "+r+"]"};t.exports=r},function(t,e,n){"use strict";n.d(e,"c",function(){return I}),e.b=L;var r=n(485),i=n(486),o=n(474),a=n(468),s=n(207),u=n(473),c=n(478),l=n(481),f=n(488),h=n(465),p=n(480),d=n(479),v=n(487),g=n(472),y=n(471),m=n(464),b=n(209),x=n(482),_=n(466),w=n(489),O=n(475),j=n(483),S=n(477),E=n(463),M=n(476),C=n(484),P=n(467),k=n(469),T=n(92),A=n(470),I=[null];function L(t,e){this._groups=t,this._parents=e}function N(){return new L([[document.documentElement]],I)}L.prototype=N.prototype={constructor:L,select:r.a,selectAll:i.a,filter:o.a,data:a.a,enter:s.a,exit:u.a,merge:c.a,order:l.a,sort:f.a,call:h.a,nodes:p.a,node:d.a,size:v.a,empty:g.a,each:y.a,attr:m.a,style:b.b,property:x.a,classed:_.a,text:w.a,html:O.a,raise:j.a,lower:S.a,append:E.a,insert:M.a,remove:C.a,clone:P.a,datum:k.a,on:T.c,dispatch:A.a},e.a=N},function(t,e,n){"use strict";n.d(e,"d",function(){return u}),n.d(e,"a",function(){return c}),n.d(e,"b",function(){return h}),n.d(e,"c",function(){return p}),e.g=d,e.e=v,e.f=g;var r=n(423),i=n(96),o=n.i(r.a)("start","end","interrupt"),a=[],s=0,u=1,c=2,l=3,f=4,h=5,p=6;function d(t,e){var n=g(t,e);if(n.state>s)throw new Error("too late; already scheduled");return n}function v(t,e){var n=g(t,e);if(n.state>c)throw new Error("too late; already started");return n}function g(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function y(t,e,r){var o=t.__transition,a;function s(t){r.state=u,r.timer.restart(d,r.delay,r.time),r.delay<=t&&d(t-r.delay)}function d(s){var h,y,m,b;if(r.state!==u)return g();for(h in o)if((b=o[h]).name===r.name){if(b.state===l)return n.i(i.timeout)(d);b.state===f?(b.state=p,b.timer.stop(),b.on.call("interrupt",t,t.__data__,b.index,b.group),delete o[h]):+h=s[l]?1:0,p=f>Math.PI?1:0,d=n.convertPoint(u),v=a(n,d);if(v>=.5)if(f===2*Math.PI){var g={x:(u.x+s.x)/2,y:(u.y+s.y)/2},y=n.convertPoint(g);c.push(["A",v,v,0,p,h,y.x,y.y]),c.push(["A",v,v,0,p,h,d.x,d.y])}else c.push(["A",v,v,0,p,h,d.x,d.y]);return c}function c(t){r.each(t,function(e,n){var r;if("a"===e[0].toLowerCase()){var i=t[n-1],o=t[n+1];o&&"a"===o[0].toLowerCase()?i&&"l"===i[0].toLowerCase()&&(i[0]="M"):i&&"a"===i[0].toLowerCase()&&o&&"l"===o[0].toLowerCase()&&(o[0]="M")}})}var l={getLinePath:function t(e,n){return o(e,n)},getSplinePath:function t(e,n,o){var a=[],s=e[0],u=null;if(e.length<=2)return l.getLinePath(e,n);r.each(e,function(t){u&&u.x===t.x&&u.y===t.y||(a.push(t.x),a.push(t.y),u=t)}),o=o||[[0,0],[1,1]];var c=i.catmullRom2bezier(a,n,o);return c.unshift(["M",s.x,s.y]),c},getPointRadius:function t(e,n){var r;return a(e,n)},getPointAngle:function t(e,n){var r=e.getCenter(),i;return Math.atan2(n.y-r.y,n.x-r.x)},convertNormalPath:function t(e,n){var i=[];return r.each(n,function(t){var n;switch(t[0].toLowerCase()){case"m":case"l":case"c":i.push(s(t,e));break;case"z":default:i.push(t)}}),i},convertPolarPath:function t(e,n){var i=[],o,a,l,f;return r.each(n,function(t,r){var c;switch(t[0].toLowerCase()){case"m":case"c":case"q":i.push(s(t,e));break;case"l":o=n[r-1],a=t,l=e.isTransposed,(f=l?o[o.length-2]===a[1]:o[o.length-1]===a[2])?i=i.concat(u(o,a,e)):i.push(s(t,e));break;case"z":default:i.push(t)}}),c(i),i}};t.exports=l},function(t,e,n){var r=n(35);t.exports=r},function(t,e,n){var r=n(10),i=n(2),o=n(38),a=n(6),s=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),r(this,t),this.init()}return t._initDefaultCfg=function t(){this.type="base",this.formatter=null,this.range=[0,1],this.ticks=null,this.values=[]},t.init=function t(){},t.getTicks=function t(){var e=this,n=e.ticks,r=[];return i(n,function(t){var n;n=o(t)?t:{text:e.getText(t),tickValue:t,value:e.scale(t)},r.push(n)}),r},t.getText=function t(e,n){var r=this.formatter;return e=r?r(e,n):e,!a(e)&&e.toString||(e=""),e.toString()},t.rangeMin=function t(){return this.range[0]},t.rangeMax=function t(){var e=this.range;return e[e.length-1]},t.invert=function t(e){return e},t.translate=function t(e){return e},t.scale=function t(e){return e},t.clone=function t(){var e=this,n=e.constructor,r={};return i(e,function(t,n){r[n]=e[n]}),new n(r)},t.change=function t(e){return this.ticks=null,r(this,e),this.init(),this},e}();t.exports=s},function(t,e,n){"use strict";e.b=w,e.a=O,e.c=j;var r=n(21),i=n(499),o=n(500),a=n(501),s=n(502),u=n(503),c=n(504),l=n(505),f=n(506),h=n(507),p=n(508),d=n(509),v=n(510),g=n(511),y=n(512),m=n(513),b=n(514),x=n(59),_=0;function w(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function O(t){return n.i(r.selection)().transition(t)}function j(){return++_}var S=r.selection.prototype;w.prototype=O.prototype={constructor:w,select:p.a,selectAll:d.a,filter:c.a,merge:l.a,selection:v.a,transition:b.a,call:S.call,nodes:S.nodes,node:S.node,size:S.size,empty:S.empty,each:S.each,on:f.a,attr:i.a,attrTween:o.a,style:g.a,styleTween:y.a,text:m.a,remove:h.a,tween:x.a,delay:a.a,duration:s.a,ease:u.a}},function(t,e,n){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,i=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},o=!0;t.exports=n(518)(i,!0)},function(t,e,n){t.exports={Axis:n(230),Component:n(62),Guide:n(238),Label:n(242),Legend:n(248),Tooltip:n(253)}},function(t,e,n){"use strict";e.b=a,e.c=s,e.a=u;var r=n(200);function i(t,e){return function(n){return t+n*e}}function o(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function a(t,e){var o=e-t;return o?i(t,o>180||o<-180?o-360*Math.round(o/360):o):n.i(r.a)(isNaN(t)?e:t)}function s(t){return 1==(t=+t)?u:function(e,i){return i-e?o(e,i,t):n.i(r.a)(isNaN(e)?i:e)}}function u(t,e){var o=e-t;return o?i(t,o):n.i(r.a)(isNaN(t)?e:t)}},function(t,e,n){var r=n(10),i=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),r(this,t)}return t._initDefaultCfg=function t(){this.adjustNames=["x","y"]},t.processAdjust=function t(){},e}();t.exports=i},function(t,e,n){var r=n(14),i=n(4),o=n(6),a=n(10),s=n(2);function u(t,e){return r(e)?e:t.invert(t.scale(e))}var c=function(){function t(t){var e=this;this.type="base",this.name=null,this.method=null,this.values=[],this.scales=[],this.linear=null;var n=null,r=this.callback;if(t.callback){var i=t.callback;n=function t(){for(var n=arguments.length,a=new Array(n),s=0;s1&&(n=(e[1].value-e[0].value)/2);for(var r=[],i=0;i0){var o=t.value-a[n-1].value;o/=e.get("subTickCount")+1;for(var u=1;u<=r;u++){var c={text:"",value:n?a[n-1].value+u*o:u*o},l=e.getTickPoint(c.value),f=void 0;f=s&&s.length?s.length:parseInt(.6*i.length,10),e._addTickItem(u-1,l,f,"sub")}}})}},n._addTickLine=function t(e,n){var r=this,i=o.mix({},n),a=[];o.each(e,function(t){a.push(["M",t.x1,t.y1]),a.push(["L",t.x2,t.y2])}),delete i.length,i.path=a;var s,u=this.get("group").addShape("path",{attrs:i});u.name="axis-ticks",u._id=this.get("_id")+"-ticks",u.set("coord",this.get("coord")),this.get("appendInfo")&&u.setSilent("appendInfo",this.get("appendInfo"))},n._renderTicks=function t(){var e=this,n=this.get("tickItems"),r=this.get("subTickItems");if(!o.isEmpty(n)){var i=this.get("tickLine");this._addTickLine(n,i)}if(!o.isEmpty(r)){var a=this.get("subTickLine")||this.get("tickLine");this._addTickLine(r,a)}},n._renderGrid=function t(){var e=this.get("grid");if(e){e.coord=this.get("coord"),e.appendInfo=this.get("appendInfo");var n=this.get("group");this.set("gridGroup",n.addGroup(a,e))}},n._renderLabels=function t(){var e=this,n=this.get("labelRenderer"),r=this.get("labelItems");n&&(n.set("items",r),n._dryDraw())},n.paint=function t(){var e=this,n=this.get("tickLine"),r=!0;n&&n.hasOwnProperty("alignWithLabel")&&(r=n.alignWithLabel),this._renderLine();var i=this.get("type"),o;("cat"===i||"timeCat"===i)&&!1===r?this._processCatTicks():this._processTicks(),this._renderTicks(),this._renderGrid(),this._renderLabels();var a=this.get("label");a&&a.autoRotate&&this.autoRotateLabels(),a&&a.autoHide&&this.autoHideLabels()},n.parseTick=function t(e,n,r){return{text:e,value:n/(r-1)}},n.getTextAnchor=function t(e){var n,r;return r=Math.abs(e[1]/e[0])>=1?"center":e[0]>0?"start":"end"},n.getMaxLabelWidth=function t(e){var n=e.getLabels(),r=0;return o.each(n,function(t){var e,n=t.getBBox().width;r1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}r.each(t,function(e,n){isNaN(e)||(t[n]=+e)}),e[n]=t}),e):void 0}}},function(t,e,n){var r=n(6);function i(t){return r(t)?"":t.toString()}t.exports=i},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function t(e){var r=void 0===e?"undefined":n(e);return null!==e&&"object"===r||"function"===r};t.exports=r},function(t,e,n){var r=n(80),i=n(15),o=function t(e){if(!r(e)||!i(e,"Object"))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n};t.exports=o},function(t,e,n){"use strict";e.b=a,e.c=s,e.a=u;var r=n(193);function i(t,e){return function(n){return t+n*e}}function o(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function a(t,e){var o=e-t;return o?i(t,o>180||o<-180?o-360*Math.round(o/360):o):n.i(r.a)(isNaN(t)?e:t)}function s(t){return 1==(t=+t)?u:function(e,i){return i-e?o(e,i,t):n.i(r.a)(isNaN(e)?i:e)}}function u(t,e){var o=e-t;return o?i(t,o):n.i(r.a)(isNaN(t)?e:t)}},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0,i=this.matrix,o=[e,n,r];return c.transformMat3(o,o,i),o}},{key:"invertMatrix",value:function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.matrix,o=u.invert([],i),a=[e,n,r];return c.transformMat3(a,a,o),a}},{key:"convert",value:function t(e){var n=this.convertPoint(e),r=n.x,i=n.y,o=this.applyMatrix(r,i,1);return{x:o[0],y:o[1]}}},{key:"invert",value:function t(e){var n=this.invertMatrix(e.x,e.y,1);return this.invertPoint({x:n[0],y:n[1]})}},{key:"rotate",value:function t(e){var n=this.matrix,r=this.center;return u.translate(n,n,[-r.x,-r.y]),u.rotate(n,n,e),u.translate(n,n,[r.x,r.y]),this}},{key:"reflect",value:function t(e){switch(e){case"x":this._swapDim("x");break;case"y":this._swapDim("y");break;default:this._swapDim("y")}return this}},{key:"scale",value:function t(e,n){var r=this.matrix,i=this.center;return u.translate(r,r,[-i.x,-i.y]),u.scale(r,r,[e,n]),u.translate(r,r,[i.x,i.y]),this}},{key:"translate",value:function t(e,n){var r=this.matrix;return u.translate(r,r,[e,n]),this}},{key:"transpose",value:function t(){return this.isTransposed=!this.isTransposed,this}}]),t}();t.exports=l},function(t,e,n){var r=n(5),i=n(0),o=i.assign,a=i.isNil,s=i.isArray,u=i.cloneDeep,c=i.wrapBehavior,l=i.getWrapBehavior,f=function(){var t=e.prototype;function e(t){var e=this.getDefaultCfg();o(this,e,t),this.init()}return t.getDefaultCfg=function t(){return{chart:null,group:null,showTitle:!0,autoSetAxis:!0,padding:10,eachView:null,fields:[],colTitle:{offsetY:-15,style:{fontSize:14,textAlign:"center",fill:"#666",fontFamily:r.fontFamily}},rowTitle:{offsetX:15,style:{fontSize:14,textAlign:"center",rotate:90,fill:"#666",fontFamily:r.fontFamily}}}},t.init=function t(){if(!this.chart)throw new Error("Facets Error: please specify the chart!");this._bindEvent(),this.initContainer(),this.chart.get("data")&&this.initViews()},t.initContainer=function t(){var e,n,r=this.chart.get("frontPlot").addGroup();this.group=r},t.initViews=function t(){for(var e=this.chart,n=e.get("data"),r=this.eachView,i=this.generateFacets(n),o=0;on&&(i=2*Math.PI-t+e,o=t-n):(i=t-e,o=n-t),i>o?n:e}function a(t,e,n,i){var a=0;return n-e>=2*Math.PI&&(a=2*Math.PI),e=r.mod(e,2*Math.PI),n=r.mod(n,2*Math.PI)+a,t=r.mod(t,2*Math.PI),i?e>=n?t>n&&tn?t:o(t,e,n):e<=n?ee||tt.x&&(v=t.x),gt.y&&(y=t.y),m0&&f>0?c=Math.PI/2-p:l<0&&f<0?c=-Math.PI/2-p:l>=0&&f<0?c=-p-Math.PI/2:l<=0&&f>0&&(c=Math.PI/2-p);var d=h(s);if(d){u&&(a?(i+=Math.sin(Math.abs(p))*u,o=o+Math.cos(Math.abs(p))*u-.5*t.lineWidth):(i-=Math.sin(Math.abs(p))*u,o=o-Math.cos(Math.abs(p))*u+.5*t.lineWidth)),t.save(),t.beginPath(),t.translate(i,o),t.rotate(c);for(var v=0;v1&&(o*=Math.sqrt(y),a*=Math.sqrt(y));var m=o*o*(g*g)+a*a*(p*p),b=Math.sqrt((o*o*(a*a)-m)/m);n===i&&(b*=-1),isNaN(b)&&(b=0);var x=b*o*g/a,_=b*-a*p/o,w=(c+f)/2+Math.cos(u)*x-Math.sin(u)*_,O=(l+h)/2+Math.sin(u)*x+Math.cos(u)*_,j=v([1,0],[(p-x)/o,(g-_)/a]),S=[(p-x)/o,(g-_)/a],E=[(-1*p-x)/o,(-1*g-_)/a],M=v(S,E);return d(S,E)<=-1&&(M=Math.PI),d(S,E)>=1&&(M=0),0===i&&M>0&&(M-=2*Math.PI),1===i&&M<0&&(M+=2*Math.PI),[t,w,O,o,a,j,M,u,i]}var y=function t(e,n,r){this.preSegment=n,this.isLast=r,this.init(e,n)};r.augment(y,{init:function t(e,n){var i=e[0];n=n||{endPoint:{x:0,y:0}};var o=l.indexOf(i)>=0,a=o?i.toUpperCase():i,s=e,u,c,p,d,v=n.endPoint,y=s[1],m=s[2];switch(a){default:break;case"M":d=o?f(y,m,v):{x:y,y:m},this.command="M",this.params=[v,d],this.subStart=d,this.endPoint=d;break;case"L":d=o?f(y,m,v):{x:y,y:m},this.command="L",this.params=[v,d],this.subStart=n.subStart,this.endPoint=d,this.endTangent=function(){return[d.x-v.x,d.y-v.y]},this.startTangent=function(){return[v.x-d.x,v.y-d.y]};break;case"H":d=o?f(y,0,v):{x:y,y:v.y},this.command="L",this.params=[v,d],this.subStart=n.subStart,this.endPoint=d,this.endTangent=function(){return[d.x-v.x,d.y-v.y]},this.startTangent=function(){return[v.x-d.x,v.y-d.y]};break;case"V":d=o?f(0,y,v):{x:v.x,y:y},this.command="L",this.params=[v,d],this.subStart=n.subStart,this.endPoint=d,this.endTangent=function(){return[d.x-v.x,d.y-v.y]},this.startTangent=function(){return[v.x-d.x,v.y-d.y]};break;case"Q":o?(u=f(y,m,v),c=f(s[3],s[4],v)):(u={x:y,y:m},c={x:s[3],y:s[4]}),this.command="Q",this.params=[v,u,c],this.subStart=n.subStart,this.endPoint=c,this.endTangent=function(){return[c.x-u.x,c.y-u.y]},this.startTangent=function(){return[v.x-u.x,v.y-u.y]};break;case"T":c=o?f(y,m,v):{x:y,y:m},"Q"===n.command?(u=h(n.params[1],v),this.command="Q",this.params=[v,u,c],this.subStart=n.subStart,this.endPoint=c,this.endTangent=function(){return[c.x-u.x,c.y-u.y]},this.startTangent=function(){return[v.x-u.x,v.y-u.y]}):(this.command="TL",this.params=[v,c],this.subStart=n.subStart,this.endPoint=c,this.endTangent=function(){return[c.x-v.x,c.y-v.y]},this.startTangent=function(){return[v.x-c.x,v.y-c.y]});break;case"C":o?(u=f(y,m,v),c=f(s[3],s[4],v),p=f(s[5],s[6],v)):(u={x:y,y:m},c={x:s[3],y:s[4]},p={x:s[5],y:s[6]}),this.command="C",this.params=[v,u,c,p],this.subStart=n.subStart,this.endPoint=p,this.endTangent=function(){return[p.x-c.x,p.y-c.y]},this.startTangent=function(){return[v.x-u.x,v.y-u.y]};break;case"S":o?(c=f(y,m,v),p=f(s[3],s[4],v)):(c={x:y,y:m},p={x:s[3],y:s[4]}),"C"===n.command?(u=h(n.params[2],v),this.command="C",this.params=[v,u,c,p],this.subStart=n.subStart,this.endPoint=p,this.endTangent=function(){return[p.x-c.x,p.y-c.y]},this.startTangent=function(){return[v.x-u.x,v.y-u.y]}):(this.command="SQ",this.params=[v,c,p],this.subStart=n.subStart,this.endPoint=p,this.endTangent=function(){return[p.x-c.x,p.y-c.y]},this.startTangent=function(){return[v.x-c.x,v.y-c.y]});break;case"A":var b=y,x=m,_=s[3],w=s[4],O=s[5];d=o?f(s[6],s[7],v):{x:s[6],y:s[7]},this.command="A";var j=g(v,d,w,O,b,x,_);this.params=j;var S=n.subStart;this.subStart=S,this.endPoint=d;var E=j[5]%(2*Math.PI);r.isNumberEqual(E,2*Math.PI)&&(E=0);var M=j[6]%(2*Math.PI);r.isNumberEqual(M,2*Math.PI)&&(M=0);var C=.001;this.startTangent=function(){0===O&&(C*=-1);var t=j[3]*Math.cos(E-C)+j[1],e=j[4]*Math.sin(E-C)+j[2];return[t-S.x,e-S.y]},this.endTangent=function(){var t=j[6];t-2*Math.PI<1e-4&&(t=0);var e=j[3]*Math.cos(E+t+C)+j[1],n=j[4]*Math.sin(E+t-C)+j[2];return[v.x-e,v.y-n]};break;case"Z":this.command="Z",this.params=[v,n.subStart],this.subStart=n.subStart,this.endPoint=n.subStart}},isInside:function t(e,n,r){var o=this,a=this.command,s=this.params,l=this.box;if(l&&!i.box(l.minX,l.maxX,l.minY,l.maxY,e,n))return!1;switch(a){default:break;case"M":return!1;case"TL":case"L":case"Z":return i.line(s[0].x,s[0].y,s[1].x,s[1].y,r,e,n);case"SQ":case"Q":return i.quadraticline(s[0].x,s[0].y,s[1].x,s[1].y,s[2].x,s[2].y,r,e,n);case"C":return i.cubicline(s[0].x,s[0].y,s[1].x,s[1].y,s[2].x,s[2].y,s[3].x,s[3].y,r,e,n);case"A":var f=s,h=f[1],p=f[2],d=f[3],v=f[4],g=f[5],y=f[6],m=f[7],b=f[8],x=d>v?d:v,_=d>v?1:d/v,w=d>v?v/d:1;f=[e,n,1];var O=[1,0,0,0,1,0,0,0,1];return c.translate(O,O,[-h,-p]),c.rotate(O,O,-m),c.scale(O,O,[1/_,1/w]),u.transformMat3(f,f,O),i.arcline(0,0,x,g,g+y,1-b,r,f[0],f[1])}return!1},draw:function t(e){var n=this.command,r=this.params,i,o,a;switch(n){default:break;case"M":e.moveTo(r[1].x,r[1].y);break;case"TL":case"L":e.lineTo(r[1].x,r[1].y);break;case"SQ":case"Q":i=r[1],o=r[2],e.quadraticCurveTo(i.x,i.y,o.x,o.y);break;case"C":i=r[1],o=r[2],a=r[3],e.bezierCurveTo(i.x,i.y,o.x,o.y,a.x,a.y);break;case"A":var s=r,u,c,l=s[1],f=s[2],h=s[3],p=s[4],d=s[5],v=s[6],g=s[7],y=s[8],m=h>p?h:p,b=h>p?1:h/p,x=h>p?p/h:1;e.translate(l,f),e.rotate(g),e.scale(b,x),e.arc(0,0,m,d,d+v,1-y),e.scale(1/b,1/x),e.rotate(-g),e.translate(-l,-f);break;case"Z":e.closePath()}},getBBox:function t(e){var n=e/2,r=this.params,i,u,c,l;switch(this.command){default:case"M":case"Z":break;case"TL":case"L":this.box={minX:Math.min(r[0].x,r[1].x)-n,maxX:Math.max(r[0].x,r[1].x)+n,minY:Math.min(r[0].y,r[1].y)-n,maxY:Math.max(r[0].y,r[1].y)+n};break;case"SQ":case"Q":for(c=0,l=(u=a.extrema(r[0].x,r[1].x,r[2].x)).length;cj&&(j=M)}var C=s.yExtrema(m,d,v),P=1/0,k=-1/0,T=[x,_];for(c=2*-Math.PI;c<=2*Math.PI;c+=Math.PI){var A=C+c;1===b?xk&&(k=I)}this.box={minX:O-n,maxX:j+n,minY:P-n,maxY:k+n}}}}),t.exports=y},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(6),o=n(2),a=n(26),s=n(331),u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function e(){t.prototype._initDefaultCfg.call(this);var n=this;this.type="linear",this.isLinear=!0,this.nice=!1,this.min=null,this.minLimit=null,this.max=null,this.maxLimit=null,this.tickCount=null,this.tickInterval=null,this.minTickInterval=null,this.snapArray=null},n.init=function t(){var e=this;if(this.ticks){var n=this.ticks,r=this.translate(n[0]),o=this.translate(n[n.length-1]);(i(this.min)||this.min>r)&&(this.min=r),(i(this.max)||this.max=e.min&&t<=e.max&&r.push(t)}),r.length||(r.push(e.min),r.push(e.max)),e.ticks=r}},n.scale=function t(e){if(i(e))return NaN;var n=this.max,r=this.min;if(n===r)return 0;var o=(e-r)/(n-r),a=this.rangeMin(),s;return a+o*(this.rangeMax()-a)},n.invert=function t(e){var n=(e-this.rangeMin())/(this.rangeMax()-this.rangeMin());return this.min+n*(this.max-this.min)},e}(a);a.Linear=u,t.exports=u},function(t,e,n){var r=n(20),i=Array.prototype.indexOf,o=function t(e,n){return!!r(e)&&i.call(e,n)>-1};t.exports=o},function(t,e){var n=function t(e){for(var n=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:1e-5;return Math.abs(e-n)1&&void 0!==arguments[1]?arguments[1]:[],r={};return i.Util.each(e,function(t,e){-1===i.Util.indexOf(n,e)&&(r[e]=t)}),r},length:a})},function(t,e,n){"use strict";e.a=function(t,e){return e-=t=+t,function(n){return t+e*n}}},function(t,e,n){"use strict";e.a=function(t,e){return e-=t=+t,function(n){return t+e*n}}},function(t,e,n){"use strict";var r=n(90),i=n(91);function o(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===i.b&&e.documentElement.namespaceURI===i.b?e.createElement(t):e.createElementNS(n,t)}}function a(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}e.a=function(t){var e=n.i(r.a)(t);return(e.local?a:o)(e)}},function(t,e,n){"use strict";e.a=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}},function(t,e,n){"use strict";e.b=a;var r=n(17);function i(t,e){var i,o;return function(){var a=n.i(r.e)(this,t),s=a.tween;if(s!==i)for(var u=0,c=(o=i=s).length;u1&&(e=parseInt(e,10),n=parseInt(n,10)),r.attr("text",this._formatItemValue(e)+""),i.attr("text",this._formatItemValue(n)+"")},n._onMouseLeave=function t(){var e=this.get("group").findById("hoverPointer");e&&e.destroy();var n=this.get("group").findById("hoverText");n&&n.destroy(),this.get("canvas").draw()},n._onMouseMove=function t(e){var n=this.get("height"),r=this.get("width"),i=this.get("items"),o,a=this.get("canvas").get("el").getBoundingClientRect(),s=this.get("group").getBBox(),u;if("vertical"===this.get("layout")){var c=5;"color-legend"===this.get("type")&&(c=30);var l=this.get("titleGap"),f=this.get("titleShape");f&&(l+=f.getBBox().maxY-f.getBBox().minY);var h=e.clientY||e.event.clientY;h=h-a.y-this.get("group").attr("matrix")[7]+s.y-c+l,u=i[0].value+(1-h/n)*(i[i.length-1].value-i[0].value)}else{var p=e.clientX||e.event.clientX;p=p-a.x-this.get("group").attr("matrix")[6],u=i[0].value+p/r*(i[i.length-1].value-i[0].value)}u=u.toFixed(2),this.activate(u),this.emit("mousehover",{value:u})},n.activate=function t(e){if(e){var n=this.get("group").findById("hoverPointer"),r=this.get("group").findById("hoverText"),o=this.get("items");if(!(eo[o.length-1].value)){var a=this.get("height"),s=this.get("width"),u=this.get("titleShape"),c=this.get("titleGap"),l=[],f=(e-o[0].value)/(o[o.length-1].value-o[0].value),h;if("vertical"===this.get("layout")){var p=0,d=0;"color-legend"===this.get("type")&&(p=c,u&&(p+=u.getBBox().height)),this.get("slidable")&&("color-legend"===this.get("type")?p-=13:(p=c-15,u&&(p+=u.getBBox().height)),d+=10),l=[[d,(f=(1-f)*a)+p],[d-10,f+p-5],[d-10,f+p+5]],h=i.mix({},{x:s+this.get("textOffset")/2+d,y:f+p,text:this._formatItemValue(e)+""},this.get("textStyle"),{textAlign:"start"})}else{var v=0,g=0;"color-legend"===this.get("type")&&(v=c,u&&(v+=u.getBBox().height)),this.get("slidable")&&("color-legend"===this.get("type")?v-=7:(v=c,u||(v-=7)),g+=10),l=[[(f*=s)+g,v],[f+g-5,v-10],[f+g+5,v-10]],h=i.mix({},{x:f-5,y:a+this.get("textOffset")+v,text:this._formatItemValue(e)+""},this.get("textStyle"))}var y=i.mix(h,this.get("hoverTextStyle"));r?r.attr(y):(r=this.get("group").addShape("text",{attrs:y})).set("id","hoverText"),n?n.attr(i.mix({points:l},this.get("pointerStyle"))):(n=this.get("group").addShape("Polygon",{attrs:i.mix({points:l},this.get("pointerStyle"))})).set("id","hoverPointer"),this.get("canvas").draw()}}},n.deactivate=function t(){var e=this.get("group").findById("hoverPointer");e&&e.destroy();var n=this.get("group").findById("hoverText");n&&n.destroy(),this.get("canvas").draw()},e}(o);t.exports=h},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(62),o=n(3),a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return o.mix({},n,{x:0,y:0,items:null,titleContent:null,showTitle:!0,plotRange:null,offset:10,timeStamp:0,inPlot:!0,crosshairs:null})},n.isContentChange=function t(e,n){var r=this.get("titleContent"),i=this.get("items"),a=!(e===r&&i.length===n.length);return a||o.each(n,function(t,e){var n=i[e];for(var r in t)if(t.hasOwnProperty(r)&&!o.isObject(t[r])&&t[r]!==n[r]){a=!0;break}if(a)return!1}),a},n.setContent=function t(e,n){var r=(new Date).valueOf();return this.set("items",n),this.set("titleContent",e),this.set("timeStamp",r),this.render(),this},n.setPosition=function t(e,n){this.set("x",e),this.set("y",n)},n.render=function t(){},n.clear=function t(){},n.show=function t(){this.set("visible",!0)},n.hide=function t(){this.set("visible",!1)},n.destroy=function t(){},e}(i);t.exports=a},function(t,e,n){var r=n(144),i=n(25),o=n(112),a=n(114),s=n(5),u=n(9),c=n(0),l={version:s.version,Animate:o,Chart:a,Global:s,Scale:r,Shape:u,Util:c,G:i,DomUtil:c.DomUtil,MatrixUtil:c.MatrixUtil,PathUtil:c.PathUtil,track:function(){console.warn("G2 tracks nothing ;-)")}};"undefined"!=typeof window&&(window.G2?console.warn("There are multiple versions of G2. Version "+l.version+"'s reference is 'window.G2_3'"):window.G2=l),t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=n(25).Group,a,s=n(29).Label,u=n(5),c=n(0),l=["line","point","path"],f="_origin";function h(t){var e=0;return c.each(t,function(t){e+=t}),e/t.length}function p(t,e){for(var n=-1,r=0,i=0,o,a=t.length-1,s,u=0;++n0&&n.lineToLabel(t)})},n.lineToLabel=function t(){},n.getLabelPoint=function t(e,n,r){var i=this,o=this.get("coord"),a=e.text.length;function s(t,n){return c.isArray(t)&&(t=1===e.text.length?t.length<=2?t[t.length-1]:h(t):t[n]),t}var u={text:e.text[r]};if(n&&"polygon"===this.get("geomType")){var l=p(n.x,n.y);u.x=l[0],u.y=l[1]}else u.x=s(n.x,r),u.y=s(n.y,r);if(n&&n.nextPoints&&("funnel"===n.shape||"pyramid"===n.shape)){var f=-1/0;n.nextPoints.forEach(function(t){(t=o.convert(t)).x>f&&(f=t.x)}),u.x=(u.x+f)/2}"pyramid"===n.shape&&!n.nextPoints&&n.points&&n.points.forEach(function(t){t=o.convert(t),(c.isArray(t.x)&&-1===n.x.indexOf(t.x)||c.isNumber(t.x)&&n.x!==t.x)&&(u.x=(u.x+t.x)/2)}),e.position&&this.setLabelPosition(u,n,r,e.position);var d=this.getLabelOffset(e,r,a);return e.offsetX&&(d.x+=e.offsetX),e.offsetY&&(d.y+=e.offsetY),this.transLabelPoint(u),u.start={x:u.x,y:u.y},u.x+=d.x,u.y+=d.y,u.color=n.color,u},n.setLabelPosition=function t(){},n.transLabelPoint=function t(e){var n=this,r,i=this.get("coord").applyMatrix(e.x,e.y,1);e.x=i[0],e.y=i[1]},n.getOffsetVector=function t(e){var n=this,r=e.offset||0,i=this.get("coord"),o;return o=i.isTransposed?i.applyMatrix(r,0):i.applyMatrix(0,r)},n.getDefaultOffset=function t(e){var n=this,r=0,i=this.get("coord"),o=this.getOffsetVector(e);return r=i.isTransposed?o[0]:o[1]},n.getLabelOffset=function t(e,n,r){var i=this,o=this.getDefaultOffset(e),a,s=this.get("coord").isTransposed,u=s?"x":"y",c=s?1:-1,l={x:0,y:0};return l[u]=n>0||1===r?o*c:o*c*-1,l},n.getLabelAlign=function t(e,n,r){var i=this,o="center",a;if(this.get("coord").isTransposed){var s=this.getDefaultOffset(e);o=s<0?"right":0===s?"center":"left",r>1&&0===n&&("right"===o?o="left":"left"===o&&(o="right"))}return o},n._getLabelValue=function t(e,n){c.isArray(n)||(n=[n]);var r=[];return c.each(n,function(t){var n=e[t.field];if(c.isArray(n)){var i=[];c.each(n,function(e){i.push(t.getText(e))}),n=i}else n=t.getText(n);(c.isNil(n)||""===n)&&r.push(null),r.push(n)}),r},n._getLabelCfgs=function t(e){var n=this,r=this.get("labelCfg"),i=r.scales,o=this.get("label"),a=[];r.globalCfg&&r.globalCfg.type&&n.set("type",r.globalCfg.type),c.each(e,function(t,e){var s={},u=t._origin,l=n._getLabelValue(u,i);if(r.callback){var f=i.map(function(t){return u[t.field]});s=r.callback.apply(null,f)}if(s||0===s){if(c.isString(s)||c.isNumber(s)?s={text:s}:(s.text=s.content||l[0],delete s.content),s=c.mix({},o,r.globalCfg||{},s),t.point=u,s.htmlTemplate&&(s.useHtml=!0,s.text=s.htmlTemplate.call(null,s.text,t,e),delete s.htmlTemplate),s.formatter&&(s.text=s.formatter.call(null,s.text,t,e),delete s.formatter),s.label){var h=s.label;delete s.label,s=c.mix(s,h)}if(s.textStyle){delete s.textStyle.offset;var p=s.textStyle;c.isFunction(p)&&(s.textStyle=p.call(null,s.text,t,e))}s.labelLine&&(s.labelLine=c.mix({},o.labelLine,s.labelLine)),s.textStyle=c.mix({},o.textStyle,s.textStyle),delete s.items,a.push(s)}else a.push(null)}),this.set("labelItemCfgs",a)},n.showLabels=function t(e,n){var r=this,i=this.get("labelRenderer"),o=this.getLabelsItems(e,n);n=[].concat(n);var a=this.get("type");o=this.adjustItems(o,n),this.drawLines(o),i.set("items",o.filter(function(t,e){return!!t||(n.splice(e,1),!1)})),a&&(i.set("shapes",n),i.set("type",a),i.set("points",e)),i.set("canvas",this.get("canvas")),i.draw()},n.destroy=function e(){this.get("labelRenderer").destroy(),t.prototype.destroy.call(this)},e}(o);t.exports=d},function(t,e,n){var r=n(5),i=n(0);function o(t,e){var n=t.length;i.isString(t[0])&&(t=t.map(function(t){return e.translate(t)}));for(var r=t[1]-t[0],o=2;oa&&(r=a)}return r}var a={getDefaultSize:function t(){var e=this.get("defaultSize"),n=this.get("viewTheme")||r;if(!e){var i=this.get("coord"),a=this.getXScale(),s=a.values,u=this.get("dataArray"),c;if(a.isLinear&&s.length>1){s.sort();var l=o(s,a);c=(a.max-a.min)/l,s.length>c&&(c=s.length)}else c=s.length;var f=a.range,h=1/c,p=1,d;if(this.isInCircle()?p=i.isTransposed&&c>1?n.widthRatio.multiplePie:n.widthRatio.rose:(a.isLinear&&(h*=f[1]-f[0]),p=n.widthRatio.column),h*=p,this.hasAdjust("dodge"))h/=this._getDodgeCount(u);e=h,this.set("defaultSize",e)}return e},_getDodgeCount:function t(e){var n=this.get("adjusts"),r,o=e.length;if(i.each(n,function(t){"dodge"===t.type&&(r=t.dodgeBy)}),r){var a=i.Array.merge(e),s;o=i.Array.values(a,r).length}return o},getDimWidth:function t(e){var n=this.get("coord"),r=n.convertPoint({x:0,y:0}),i=n.convertPoint({x:"x"===e?1:0,y:"x"===e?0:1}),o=0;return r&&i&&(o=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2))),o},_getWidth:function t(){var e=this.get("coord"),n;return n=this.isInCircle()&&!e.isTransposed?(e.endAngle-e.startAngle)*e.radius:this.getDimWidth("x")},_toNormalizedSize:function t(e){var n;return e/this._getWidth()},_toCoordSize:function t(e){var n;return this._getWidth()*e},getNormalizedSize:function t(e){var n=this.getAttrValue("size",e);return n=i.isNil(n)?this.getDefaultSize():this._toNormalizedSize(n)},getSize:function t(e){var n=this.getAttrValue("size",e);if(i.isNil(n)){var r=this.getDefaultSize();n=this._toCoordSize(r)}return n}};t.exports=a},function(t,e,n){var r=n(1),i=n(7),o=n(36),a=n(47),s=function t(e){t.superclass.constructor.call(this,e)};s.Symbols={circle:function t(e,n,r){return[["M",e,n],["m",-r,0],["a",r,r,0,1,0,2*r,0],["a",r,r,0,1,0,2*-r,0]]},square:function t(e,n,r){return[["M",e-r,n-r],["L",e+r,n-r],["L",e+r,n+r],["L",e-r,n+r],["Z"]]},diamond:function t(e,n,r){return[["M",e-r,n],["L",e,n-r],["L",e+r,n],["L",e,n+r],["Z"]]},triangle:function t(e,n,r){var i=r*Math.sin(1/3*Math.PI);return[["M",e-r,n+i],["L",e,n-i],["L",e+r,n+i],["z"]]},"triangle-down":function t(e,n,r){var i=r*Math.sin(1/3*Math.PI);return[["M",e-r,n-i],["L",e+r,n-i],["L",e,n+i],["Z"]]}},s.ATTRS={path:null,lineWidth:1},r.extend(s,i),r.augment(s,{type:"marker",canFill:!0,canStroke:!0,getDefaultAttrs:function t(){return{x:0,y:0,lineWidth:1}},calculateBox:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.radius,o,a=this.getHitLineWidth()/2+i;return{minX:n-a,minY:r-a,maxX:n+a,maxY:r+a}},_getPath:function t(){var e=this._attrs,n=e.x,i=e.y,o=e.radius||e.r,a=e.symbol||"circle",u;return(u=r.isFunction(a)?a:s.Symbols[a])(n,i,o)},createPath:function t(e){var n=this._cfg.segments;if(!n||this._cfg.hasUpdate){var r=o.parsePath(this._getPath()),i;e.beginPath(),n=[];for(var s=0;s=0&&m=0&&c<=1&&u.push(c);else{var h=a*a-4*o*s;r.isNumberEqual(h,0)?u.push(-a/(2*o)):h>0&&(l=(-a-(f=Math.sqrt(h)))/(2*o),(c=(-a+f)/(2*o))>=0&&c<=1&&u.push(c),l>=0&&l<=1&&u.push(l))}return u}function c(t,e,n,r,i){var o,a;return t*(t*(-3*e+9*n-9*r+3*i)+6*e-12*n+6*r)-3*e+3*n}function l(t,e,n,i,o,a,s,u,l){r.isNil(l)&&(l=1);for(var f=(l=l>1?1:l<0?0:l)/2,h=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],v=0,g=0;g2&&(r.push([e].concat(o.splice(0,2))),s="l",e="m"===e?"l":"L"),"o"===s&&1===o.length&&r.push([e,o[0]]),"r"===s)r.push([e].concat(o));else for(;o.length>=n[s]&&(r.push([e].concat(o.splice(0,n[s]))),n[s]););}),r},u=function t(e,n){for(var r=[],i=0,o=e.length;o-2*!n>i;i+=2){var a=[{x:+e[i-2],y:+e[i-1]},{x:+e[i],y:+e[i+1]},{x:+e[i+2],y:+e[i+3]},{x:+e[i+4],y:+e[i+5]}];n?i?o-4===i?a[3]={x:+e[0],y:+e[1]}:o-2===i&&(a[2]={x:+e[0],y:+e[1]},a[3]={x:+e[2],y:+e[3]}):a[0]={x:+e[o-2],y:+e[o-1]}:o-4===i?a[3]=a[2]:i||(a[0]={x:+e[i],y:+e[i+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r},c=function t(e,n,r,i,o){var a=[];if(null===o&&null===i&&(i=r),e=+e,n=+n,r=+r,i=+i,null!==o){var s=Math.PI/180,u=e+r*Math.cos(-i*s),c=e+r*Math.cos(-o*s),l,f;a=[["M",u,n+r*Math.sin(-i*s)],["A",r,r,0,+(o-i>180),0,c,n+r*Math.sin(-o*s)]]}else a=[["M",e,n],["m",0,-i],["a",r,i,0,1,1,0,2*i],["a",r,i,0,1,1,0,-2*i],["z"]];return a},l=function t(e){if(!(e=s(e))||!e.length)return[["M",0,0]];var n=[],r=0,i=0,o=0,a=0,l=0,f,h;"M"===e[0][0]&&(o=r=+e[0][1],a=i=+e[0][2],l++,n[0]=["M",r,i]);for(var p=3===e.length&&"M"===e[0][0]&&"R"===e[1][0].toUpperCase()&&"Z"===e[2][0].toUpperCase(),d,v,g=l,y=e.length;g1&&(r*=w=Math.sqrt(w),i*=w);var O=r*r,j=i*i,S=(a===s?-1:1)*Math.sqrt(Math.abs((O*j-O*_*_-j*x*x)/(O*_*_+j*x*x)));y=S*r*_/i+(e+u)/2,m=S*-i*x/r+(n+c)/2,v=Math.asin(((n-m)/i).toFixed(9)),g=Math.asin(((c-m)/i).toFixed(9)),v=eg&&(v-=2*Math.PI),!s&&g>v&&(g-=2*Math.PI)}var E=g-v;if(Math.abs(E)>f){var M=g,C=u,P=c;g=v+f*(s&&g>v?1:-1),p=t(u=y+r*Math.cos(g),c=m+i*Math.sin(g),r,i,o,0,s,C,P,[g,M,y,m])}E=g-v;var k=Math.cos(v),T=Math.sin(v),A=Math.cos(g),I=Math.sin(g),L=Math.tan(E/4),N=4/3*r*L,D=4/3*i*L,R=[e,n],F=[e+N*T,n-D*k],z=[u+N*I,c-D*A],B=[u,c];if(F[0]=2*R[0]-F[0],F[1]=2*R[1]-F[1],l)return[F,z,B].concat(p);for(var Y=[],V=0,W=(p=[F,z,B].concat(p).join().split(",")).length;V7){e[n].shift();for(var o=e[n];o.length;)s[n]="A",i&&(u[n]="A"),e.splice(n++,0,["C"].concat(o.splice(0,6)));e.splice(n,1),v=Math.max(r.length,i&&i.length||0)}},m=function t(e,n,o,a,s){e&&n&&"M"===e[s][0]&&"M"!==n[s][0]&&(n.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=e[s][1],o.y=e[s][2],v=Math.max(r.length,i&&i.length||0))};v=Math.max(r.length,i&&i.length||0);for(var b=0;b1?1:c<0?0:c)/2,f=12,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,v=0;v0&&d<1&&c.push(d)}else{var g=h*h-4*p*f,y=Math.sqrt(g);if(!(g<0)){var m=(-h+y)/(2*f);m>0&&m<1&&c.push(m);var b=(-h-y)/(2*f);b>0&&b<1&&c.push(b)}}for(var x=c.length,_=x,w;x--;)w=1-(d=c[x]),l[0][x]=w*w*w*e+3*w*w*d*r+3*w*d*d*o+d*d*d*s,l[1][x]=w*w*w*n+3*w*w*d*i+3*w*d*d*a+d*d*d*u;return l[0][_]=e,l[1][_]=n,l[0][_+1]=s,l[1][_+1]=u,l[0].length=l[1].length=_+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}},x=function t(e,n,r,i,o,a,s,u){if(!(Math.max(e,r)Math.max(o,s)||Math.max(n,i)Math.max(a,u))){var c,l,f=(e-r)*(a-u)-(n-i)*(o-s);if(f){var h=((e*i-n*r)*(o-s)-(e-r)*(o*u-a*s))/f,p=((e*i-n*r)*(a-u)-(n-i)*(o*u-a*s))/f,d=+h.toFixed(2),v=+p.toFixed(2);if(!(d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(o,s).toFixed(2)||d>+Math.max(o,s).toFixed(2)||v<+Math.min(n,i).toFixed(2)||v>+Math.max(n,i).toFixed(2)||v<+Math.min(a,u).toFixed(2)||v>+Math.max(a,u).toFixed(2)))return{x:h,y:p}}}},_=function t(e,n,r){return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height},w=function t(e,n,r,i,o){if(o)return[["M",+e+ +o,n],["l",r-2*o,0],["a",o,o,0,0,1,o,o],["l",0,i-2*o],["a",o,o,0,0,1,-o,o],["l",2*o-r,0],["a",o,o,0,0,1,-o,-o],["l",0,2*o-i],["a",o,o,0,0,1,o,-o],["z"]];var a=[["M",e,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return a.parsePathArray=g,a},O=function t(e,n,r,i){return null===e&&(e=n=r=i=0),null===n&&(n=e.y,r=e.width,i=e.height,e=e.x),{x:e,y:n,width:r,w:r,height:i,h:i,x2:e+r,y2:n+i,cx:e+r/2,cy:n+i/2,r1:Math.min(r,i)/2,r2:Math.max(r,i)/2,r0:Math.sqrt(r*r+i*i)/2,path:w(e,n,r,i),vb:[e,n,r,i].join(" ")}},j=function t(e,n){return e=O(e),n=O(n),_(n,e.x,e.y)||_(n,e.x2,e.y)||_(n,e.x,e.y2)||_(n,e.x2,e.y2)||_(e,n.x,n.y)||_(e,n.x2,n.y)||_(e,n.x,n.y2)||_(e,n.x2,n.y2)||(e.xn.x||n.xe.x)&&(e.yn.y||n.ye.y)},S=function t(e,n,i,o,a,s,u,c){r.isArray(e)||(e=[e,n,i,o,a,s,u,c]);var l=b.apply(null,e);return O(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},E=function t(e,n,r,i,o,a,s,u,c){var l=1-c,f=Math.pow(l,3),h=Math.pow(l,2),p=c*c,d=p*c,v,g,y=e+2*c*(r-e)+p*(o-2*r+e),m=n+2*c*(i-n)+p*(a-2*i+n),b=r+2*c*(o-r)+p*(s-2*o+r),x=i+2*c*(a-i)+p*(u-2*a+i),_,w,O,j,S;return{x:f*e+3*h*c*r+3*l*c*c*o+d*s,y:f*n+3*h*c*i+3*l*c*c*a+d*u,m:{x:y,y:m},n:{x:b,y:x},start:{x:l*e+c*r,y:l*n+c*i},end:{x:l*o+c*s,y:l*a+c*u},alpha:90-180*Math.atan2(y-b,m-x)/Math.PI}},M=function t(e,n,r){var i=S(e),o=S(n);if(!j(i,o))return r?0:[];for(var a,s,u=~~(m.apply(0,e)/8),c=~~(m.apply(0,n)/8),l=[],f=[],h={},p=r?0:[],d=0;d=0&&A<=1&&I>=0&&I<=1&&(r?p++:p.push({x:T.x,y:T.y,t1:A,t2:I}))}}return p},C=function t(e,n,r){var i,o,a,s,u,c,l,f,h,p;e=d(e),n=d(n);for(var v=r?0:[],g=0,y=e.length;g=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])})}var A=function t(e,n,r){if(1===r)return[[].concat(e)];var i=[];if("L"===n[0]||"C"===n[0]||"Q"===n[0])i=i.concat(T(e,n,r));else{var o=[].concat(e);"M"===o[0]&&(o[0]="L");for(var a=0;a<=r-1;a++)i.push(o)}return i},I=function t(e,n){if(1===e.length)return e;var r=e.length-1,i=n.length-1,o=r/i,a=[];if(1===e.length&&"M"===e[0][0]){for(var s=0;s=0;h--)s=a[h].index,"add"===a[h].type?e.splice(s,0,[].concat(e[s])):e.splice(s,1)}var p=o-(i=e.length);if(i0)){e[i]=n[i];break}r=F(r,e[i-1],1)}e[i]=["Q"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"T":e[i]=["T"].concat(r[0]);break;case"C":if(r.length<3){if(!(i>0)){e[i]=n[i];break}r=F(r,e[i-1],2)}e[i]=["C"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(r.length<2){if(!(i>0)){e[i]=n[i];break}r=F(r,e[i-1],1)}e[i]=["S"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;default:e[i]=n[i]}return e};t.exports={parsePathString:s,parsePathArray:g,pathTocurve:d,pathToAbsolute:l,catmullRomToBezier:u,rectPath:w,fillPath:I,fillPathByDiff:R,formatPath:B,intersection:P}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=a,e.toRadian=u,e.equals=c;var r=e.EPSILON=1e-6,i=e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,o=e.RANDOM=Math.random;function a(t){e.ARRAY_TYPE=i=t}var s=Math.PI/180;function u(t){return t*s}function c(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))}},function(t,e,n){var r=n(6),i=n(4),o=n(2);t.exports=function t(e,n){for(var a=[],s={},u=0;ur?r:e};t.exports=n},function(t,e,n){var r=n(328);r.translate=function(t,e,n){var i=new Array(9);return r.fromTranslation(i,n),r.multiply(t,i,e)},r.rotate=function(t,e,n){var i=new Array(9);return r.fromRotation(i,n),r.multiply(t,i,e)},r.scale=function(t,e,n){var i=new Array(9);return r.fromScaling(i,n),r.multiply(t,i,e)},t.exports=r},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function t(e){return"object"===(void 0===e?"undefined":n(e))&&null!==e};t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={Chart:"deleteChart",Coord:"deleteCoord",Geom:"deleteGeom",Axis:"deleteAxis",Tooltip:"deleteTooltip",Legend:"deleteLegend",Label:"deleteLabel",View:"deleteView",Guide:"deleteGuide",GuideLine:"deleteTypedGuide",GuideImage:"deleteTypedGuide",GuideText:"deleteTypedGuide",GuideRegion:"deleteTypedGuide",GuideHtml:"deleteTypedGuide",GuideArc:"deleteTypedGuide",GuideRegionFilter:"deleteTypedGuide",GuideDataMarker:"deleteTypedGuide",GuideDataRegion:"deleteTypedGuide",Facet:"deleteFacet"},i={merge:function t(e,n,r,i){this.mergeDelete(e,n,r),this.mergeUpdate(e,i)},mergeDelete:function t(e,n,i){var o=this;Object.keys(n).forEach(function(t){var n=r[i[t].name],a=e;i[t].viewId&&(a=e.views[i[t].viewId]),o[n]&&o[n](a,t,i[t].parentInfo.id)})},deleteAxis:function t(e,n){e&&delete e.axises[n]},deleteTooltip:function t(e){e&&delete e.tooltip},deleteCoord:function t(e){e&&delete e.coord},deleteLegend:function t(e,n){e&&delete e.legends[n]},deleteGuide:function t(e){e&&delete e.guide},deleteGeom:function t(e,n){e&&e.geoms&&delete e.geoms[n]},deleteLabel:function t(e,n,r){e&&e.geoms&&e.geoms[r]&&delete e.geoms[r].label},deleteFacet:function t(e){e&&delete e.facet},deleteTypedGuide:function t(e,n){e&&e.guide&&delete e.guide.elements[n]},deleteView:function t(e,n){e&&delete e.views[n]},mergeUpdate:function t(e,n){this.mergeChart(e,n),this.mergeAxises(e,n),this.mergeCoord(e,n),this.mergeGeoms(e.geoms,n),this.mergeLegends(e.legends,n),this.mergeTooltip(e,n),this.mergeViews(e.views,n),this.mergeGuide(e.guide,n)},mergeChart:function t(e,n){e.chart&&e.chart.updateProps&&(e.chart.props=e.chart.updateProps),n&&delete e.chart.g2Instance},mergeAxises:function t(e,n){var r=e.axises;if(null!=!r)for(var i in r)r[i]&&r[i].updateProps&&(r[i].props=r[i].updateProps),n&&delete r[i].g2Instance},mergeTooltip:function t(e,n){e.tooltip&&(n&&delete e.tooltip.g2Instance,e.tooltip.updateProps&&(e.tooltip.props=e.tooltip.updateProps))},mergeCoord:function t(e,n){e.coord&&(n&&delete e.coord.g2Instance,e.coord.updateProps&&(e.coord.props=e.coord.updateProps))},mergeLegends:function t(e,n){if(e)for(var r in e)if(e[r]){var i=e[r];n&&delete i.g2Instance,i.updateProps&&(i.props=i.updateProps)}},mergeGeoms:function t(e,n){if(null!=e)for(var r in e)e[r]&&(n&&(delete e[r].g2Instance,e[r].label&&e[r].label.g2Instance&&(e[r].label.updateProps&&(e[r].label.props=e[r].label.updateProps),delete e[r].label.g2Instance)),e[r].updateProps&&(e[r].props=e[r].updateProps))},mergeGuide:function t(e,n){if(null!=e){var r=e.elements;for(var i in r)r[i]&&(n&&delete r[i].g2Instance,r[i].updateProps&&(r[i].props=r[i].updateProps))}},mergeView:function t(e,n){e&&(n&&e.g2Instance&&delete e.g2Instance,e.updateProps&&(e.props=e.updateProps),this.mergeCoord(e,n),this.mergeAxises(e,n),this.mergeGeoms(e.geoms,n),this.mergeGuide(e.guide,n))},mergeViews:function t(e,n){if(null!=e)for(var r in e)e[r]&&this.mergeView(e[r],n)}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Prop=e.Util=void 0;var r,i=s(n(54)),o,a=s(n(418));function s(t){return t&&t.__esModule?t:{default:t}}e.Util=i.default,e.Prop=a.default},function(t,e,n){"use strict";e.c=i,n.d(e,"e",function(){return o}),n.d(e,"d",function(){return a}),e.h=b,e.b=w,e.g=O,e.a=j,e.f=C;var r=n(84);function i(){}var o=.7,a=1/o,s="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l=/^#([0-9a-f]{3})$/,f=/^#([0-9a-f]{6})$/,h=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),p=new RegExp("^rgb\\("+[c,c,c]+"\\)$"),d=new RegExp("^rgba\\("+[s,s,s,u]+"\\)$"),v=new RegExp("^rgba\\("+[c,c,c,u]+"\\)$"),g=new RegExp("^hsl\\("+[u,c,c]+"\\)$"),y=new RegExp("^hsla\\("+[u,c,c,u]+"\\)$"),m={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function b(t){var e;return t=(t+"").trim().toLowerCase(),(e=l.exec(t))?new j((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=f.exec(t))?x(parseInt(e[1],16)):(e=h.exec(t))?new j(e[1],e[2],e[3],1):(e=p.exec(t))?new j(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=d.exec(t))?_(e[1],e[2],e[3],e[4]):(e=v.exec(t))?_(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=g.exec(t))?E(e[1],e[2]/100,e[3]/100,1):(e=y.exec(t))?E(e[1],e[2]/100,e[3]/100,e[4]):m.hasOwnProperty(t)?x(m[t]):"transparent"===t?new j(NaN,NaN,NaN,0):null}function x(t){return new j(t>>16&255,t>>8&255,255&t,1)}function _(t,e,n,r){return r<=0&&(t=e=n=NaN),new j(t,e,n,r)}function w(t){return t instanceof i||(t=b(t)),t?new j((t=t.rgb()).r,t.g,t.b,t.opacity):new j}function O(t,e,n,r){return 1===arguments.length?w(t):new j(t,e,n,null==r?1:r)}function j(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function S(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function E(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new P(t,e,n,r)}function M(t){if(t instanceof P)return new P(t.h,t.s,t.l,t.opacity);if(t instanceof i||(t=b(t)),!t)return new P;if(t instanceof P)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,u=a-o,c=(a+o)/2;return u?(s=e===a?(n-r)/u+6*(n0&&c<1?0:s,new P(s,u,c,t.opacity)}function C(t,e,n,r){return 1===arguments.length?M(t):new P(t,e,n,null==r?1:r)}function P(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function k(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}n.i(r.a)(i,b,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),n.i(r.a)(j,O,n.i(r.b)(i,{brighter:function(t){return t=null==t?a:Math.pow(a,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?o:Math.pow(o,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+S(this.r)+S(this.g)+S(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),n.i(r.a)(P,C,n.i(r.b)(i,{brighter:function(t){return t=null==t?a:Math.pow(a,t),new P(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?o:Math.pow(o,t),new P(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new j(k(t>=240?t-240:t+120,i,r),k(t,i,r),k(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}))},function(t,e,n){"use strict";function r(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}e.b=r,e.a=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t}},function(t,e,n){"use strict";function r(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}e.b=r,e.a=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[i],a=t[i+1],s=i>0?t[i-1]:2*o-a,u=i=1?(n=1,e-1):Math.floor(n*e),o=t[i],a=t[i+1],s=i>0?t[i-1]:2*o-a,u=i=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r.a.hasOwnProperty(e)?{space:r.a[e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return r});var r="http://www.w3.org/1999/xhtml";e.a={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),e.b=f;var r={},i=null,o;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(r={mouseenter:"mouseover",mouseleave:"mouseout"}));function a(t,e,n){return t=s(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function s(t,e,n){return function(r){var o=i;i=r;try{t.call(this,this.__data__,e,n)}finally{i=o}}}function u(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function c(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n=0&&t._call.call(null,e),t=t._next;--r}function b(){l=(c=h.now())+f,r=i=0;try{m()}finally{r=0,_(),l=0}}function x(){var t=h.now(),e=t-c;e>a&&(f-=e,c=t)}function _(){for(var t,e=s,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:s=n);u=t,w(r)}function w(t){var e;r||(i&&(i=clearTimeout(i)),t-l>24?(t<1/0&&(i=setTimeout(b,t-h.now()-f)),o&&(o=clearInterval(o))):(o||(c=h.now(),o=setInterval(x,a)),r=1,p(b)))}g.prototype=y.prototype={constructor:g,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?d():+n)+(null==e?0:+e),this._next||u===this||(u?u._next=this:s=this,u=this),this._call=t,this._time=n,w()},stop:function(){this._call&&(this._call=null,this._time=1/0,w())}}},function(t,e,n){var r; +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=310)}([function(t,e){t.exports=window.React},function(t,e,n){var r,i,o;t.exports=n(481)()},function(t,e,n){var r=n(10),i=n(20),o=n(35),a=n(27),s=n(46),u="prototype",c=function(t,e,n){var u=t&c.F,l=t&c.G,f=t&c.S,h=t&c.P,p=t&c.B,d=l?r:f?r[e]||(r[e]={}):(r[e]||{}).prototype,v=l?i:i[e]||(i[e]={}),g=v.prototype||(v.prototype={}),y,m,b,x;for(y in l&&(n=e),n)b=((m=!u&&d&&void 0!==d[y])?d:n)[y],x=p&&m?s(b,r):h&&"function"==typeof b?s(Function.call,b):b,d&&a(d,y,b,t&c.U),v[y]!=b&&o(v,y,x),h&&g[y]!=b&&(g[y]=b)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){var r,i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e0)for(n in _r)m(i=e[r=_r[n]])||(t[r]=i);return t}function x(t){b(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===wr&&(wr=!0,e.updateOffset(this),wr=!1)}function _(t){return t instanceof x||null!=t&&null!=t._isAMomentObject}function w(t){return 0>t?Math.ceil(t)||0:Math.floor(t)}function O(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=w(e)),n}function j(t,e,n){var r,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),a=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&O(t[r])!==O(e[r]))&&a++;return a+o}function S(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function E(t,n){var r=!0;return h(function(){var i,a,s,u;if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),r){for(i=[],s=0;s0?"future":"past"];return C(n)?n(e):n.replace(/%s/i,e)}function F(t,e){var n=t.toLowerCase();Ar[n]=Ar[n+"s"]=Ar[e]=t}function z(t){return"string"==typeof t?Ar[t]||Ar[t.toLowerCase()]:void 0}function B(t){var e,n,r={};for(n in t)f(t,n)&&((e=z(n))&&(r[e]=t[n]));return r}function Y(t,e){Ir[t]=e}function V(t){var e,n=[];for(e in t)n.push({unit:e,priority:Ir[e]});return n.sort(function(t,e){return t.priority-e.priority}),n}function W(t,n){return function(r){return null!=r?(G(this,t,r),e.updateOffset(this,n),this):H(this,t)}}function H(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function G(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function q(t){return C(this[t=z(t)])?this[t]():this}function U(t,e){var n,r;if("object"==(void 0===t?"undefined":o(t)))for(n=V(t=B(t)),r=0;r=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function X(t,e,n,r){var i=r;"string"==typeof r&&(i=function t(){return this[r]()}),t&&(Rr[t]=i),e&&(Rr[e[0]]=function(){return K(i.apply(this,arguments),e[1],e[2])}),n&&(Rr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function Z(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function $(t){var e,n,r=t.match(Lr);for(e=0,n=r.length;n>e;e++)r[e]=Rr[r[e]]?Rr[r[e]]:Z(r[e]);return function(e){var i,o="";for(i=0;n>i;i++)o+=r[i]instanceof Function?r[i].call(e,t):r[i];return o}}function Q(t,e){return t.isValid()?(e=J(e,t.localeData()),Dr[e]=Dr[e]||$(e),Dr[e](t)):t.localeData().invalidDate()}function J(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(Nr.lastIndex=0;r>=0&&Nr.test(t);)t=t.replace(Nr,n),Nr.lastIndex=0,r-=1;return t}function tt(t,e,n){ei[t]=C(e)?e:function(t){return t&&n?n:e}}function et(t,e){return f(ei,t)?ei[t](e._strict,e._locale):new RegExp(nt(t))}function nt(t){return rt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function rt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function it(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),u(e)&&(r=function t(n,r){r[e]=O(n)}),n=0;nr;++r)o=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(i=pi.call(this._shortMonthsParse,a))?i:null:-1!==(i=pi.call(this._longMonthsParse,a))?i:null:"MMM"===e?-1!==(i=pi.call(this._shortMonthsParse,a))?i:-1!==(i=pi.call(this._longMonthsParse,a))?i:null:-1!==(i=pi.call(this._longMonthsParse,a))?i:-1!==(i=pi.call(this._shortMonthsParse,a))?i:null}function ft(t,e,n){var r,i,o;if(this._monthsParseExact)return lt.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;12>r;r++){if(i=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function ht(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=O(e);else if(!u(e=t.localeData().monthsParse(e)))return t;return n=Math.min(t.date(),st(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function pt(t){return null!=t?(ht(this,t),e.updateOffset(this,!0),this):H(this,"Month")}function dt(){return st(this.year(),this.month())}function vt(t){return this._monthsParseExact?(f(this,"_monthsRegex")||yt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(f(this,"_monthsShortRegex")||(this._monthsShortRegex=yi),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function gt(t){return this._monthsParseExact?(f(this,"_monthsRegex")||yt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(f(this,"_monthsRegex")||(this._monthsRegex=mi),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function yt(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],o=[];for(e=0;12>e;e++)n=p([2e3,e]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(t),i.sort(t),o.sort(t),e=0;12>e;e++)r[e]=rt(r[e]),i[e]=rt(i[e]);for(e=0;24>e;e++)o[e]=rt(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function mt(t){return bt(t)?366:365}function bt(t){return 0==t%4&&0!=t%100||0==t%400}function xt(){return bt(this.year())}function _t(t,e,n,r,i,o,a){var s=new Date(t,e,n,r,i,o,a);return 100>t&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function wt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function Ot(t,e,n){var r=7+e-n,i;return-((7+wt(t,0,r).getUTCDay()-e)%7)+r-1}function jt(t,e,n,r,i){var o,a,s,u,c=1+7*(e-1)+(7+n-r)%7+Ot(t,r,i);return 0>=c?a=mt(o=t-1)+c:c>mt(t)?(o=t+1,a=c-mt(t)):(o=t,a=c),{year:o,dayOfYear:a}}function St(t,e,n){var r,i,o=Ot(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>a?r=a+Et(i=t.year()-1,e,n):a>Et(t.year(),e,n)?(r=a-Et(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function Et(t,e,n){var r=Ot(t,e,n),i=Ot(t+1,e,n);return(mt(t)-r+i)/7}function Mt(t){return St(t,this._week.dow,this._week.doy).week}function Ct(){return this._week.dow}function Pt(){return this._week.doy}function kt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Tt(t){var e=St(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function At(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function It(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Lt(t,e){return t?i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function Nt(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Dt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Rt(t,e,n){var r,i,o,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;7>r;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(i=pi.call(this._weekdaysParse,a))?i:null:"ddd"===e?-1!==(i=pi.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=pi.call(this._minWeekdaysParse,a))?i:null:"dddd"===e?-1!==(i=pi.call(this._weekdaysParse,a))?i:-1!==(i=pi.call(this._shortWeekdaysParse,a))?i:-1!==(i=pi.call(this._minWeekdaysParse,a))?i:null:"ddd"===e?-1!==(i=pi.call(this._shortWeekdaysParse,a))?i:-1!==(i=pi.call(this._weekdaysParse,a))?i:-1!==(i=pi.call(this._minWeekdaysParse,a))?i:null:-1!==(i=pi.call(this._minWeekdaysParse,a))?i:-1!==(i=pi.call(this._weekdaysParse,a))?i:-1!==(i=pi.call(this._shortWeekdaysParse,a))?i:null}function Ft(t,e,n){var r,i,o;if(this._weekdaysParseExact)return Rt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function zt(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=At(t,this.localeData()),this.add(t-e,"d")):e}function Bt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Yt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=It(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Vt(t){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Gt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(f(this,"_weekdaysRegex")||(this._weekdaysRegex=ji),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Wt(t){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Gt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(f(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Si),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ht(t){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||Gt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(f(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ei),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Gt(){function t(t,e){return e.length-t.length}var e,n,r,i,o,a=[],s=[],u=[],c=[];for(e=0;7>e;e++)n=p([2e3,1]).day(e),r=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),o=this.weekdays(n,""),a.push(r),s.push(i),u.push(o),c.push(r),c.push(i),c.push(o);for(a.sort(t),s.sort(t),u.sort(t),c.sort(t),e=0;7>e;e++)s[e]=rt(s[e]),u[e]=rt(u[e]),c[e]=rt(c[e]);this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function qt(){return this.hours()%12||12}function Ut(){return this.hours()||24}function Kt(t,e){X(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Xt(t,e){return e._meridiemParse}function Zt(t){return"p"===(t+"").toLowerCase().charAt(0)}function $t(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Qt(t){return t?t.toLowerCase().replace("_","-"):t}function Jt(t){for(var e,n,r,i,o=0;o0;){if(r=te(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&j(i,n,!0)>=e-1)break;e--}o++}return null}function te(e){var r=null;if(!ki[e]&&void 0!==t&&t&&t.exports)try{r=Ai._abbr,n(677)("./"+e),ee(r)}catch(t){}return ki[e]}function ee(t,e){var n;return t&&((n=m(e)?ie(t):ne(t,e))&&(Ai=n)),Ai._abbr}function ne(t,e){if(null!==e){var n=Pi;if(e.abbr=t,null!=ki[t])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ki[t]._config;else if(null!=e.parentLocale){if(null==ki[e.parentLocale])return Ti[e.parentLocale]||(Ti[e.parentLocale]=[]),Ti[e.parentLocale].push({name:t,config:e}),null;n=ki[e.parentLocale]._config}return ki[t]=new T(k(n,e)),Ti[t]&&Ti[t].forEach(function(t){ne(t.name,t.config)}),ee(t),ki[t]}return delete ki[t],null}function re(t,e){if(null!=e){var n,r=Pi;null!=ki[t]&&(r=ki[t]._config),(n=new T(e=k(r,e))).parentLocale=ki[t],ki[t]=n,ee(t)}else null!=ki[t]&&(null!=ki[t].parentLocale?ki[t]=ki[t].parentLocale:null!=ki[t]&&delete ki[t]);return ki[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Ai;if(!i(t)){if(e=te(t))return e;t=[t]}return Jt(t)}function oe(){return Sr(ki)}function ae(t){var e,n=t._a;return n&&-2===v(t).overflow&&(e=n[ii]<0||n[ii]>11?ii:n[oi]<1||n[oi]>st(n[ri],n[ii])?oi:n[ai]<0||n[ai]>24||24===n[ai]&&(0!==n[si]||0!==n[ui]||0!==n[ci])?ai:n[si]<0||n[si]>59?si:n[ui]<0||n[ui]>59?ui:n[ci]<0||n[ci]>999?ci:-1,v(t)._overflowDayOfYear&&(ri>e||e>oi)&&(e=oi),v(t)._overflowWeeks&&-1===e&&(e=li),v(t)._overflowWeekday&&-1===e&&(e=fi),v(t).overflow=e),t}function se(t){var e,n,r,i,o,a,s=t._i,u=Ii.exec(s)||Li.exec(s);if(u){for(v(t).iso=!0,e=0,n=Di.length;n>e;e++)if(Di[e][1].exec(u[1])){i=Di[e][0],r=!1!==Di[e][2];break}if(null==i)return void(t._isValid=!1);if(u[3]){for(e=0,n=Ri.length;n>e;e++)if(Ri[e][1].exec(u[3])){o=(u[2]||" ")+Ri[e][0];break}if(null==o)return void(t._isValid=!1)}if(!r&&null!=o)return void(t._isValid=!1);if(u[4]){if(!Ni.exec(u[4]))return void(t._isValid=!1);a="Z"}t._f=i+(o||"")+(a||""),pe(t)}else t._isValid=!1}function ue(t){var n=Fi.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(se(t),void(!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t))))}function ce(t,e,n){return null!=t?t:null!=e?e:n}function le(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function fe(t){var e,n,r,i,o=[];if(!t._d){for(r=le(t),t._w&&null==t._a[oi]&&null==t._a[ii]&&he(t),t._dayOfYear&&(i=ce(t._a[ri],r[ri]),t._dayOfYear>mt(i)&&(v(t)._overflowDayOfYear=!0),n=wt(i,0,t._dayOfYear),t._a[ii]=n.getUTCMonth(),t._a[oi]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=r[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ai]&&0===t._a[si]&&0===t._a[ui]&&0===t._a[ci]&&(t._nextDay=!0,t._a[ai]=0),t._d=(t._useUTC?wt:_t).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ai]=24)}}function he(t){var e,n,r,i,o,a,s,u,c=t._w;null!=c.GG||null!=c.W||null!=c.E?(i=1,o=4,e=ce(c.GG,t._a[ri],St(_e(),1,4).year),n=ce(c.W,1),(1>(r=ce(c.E,1))||r>7)&&(s=!0)):(i=t._locale._week.dow,o=t._locale._week.doy,u=St(_e(),i,o),e=ce(c.gg,t._a[ri],u.year),n=ce(c.w,u.week),null!=c.d?(0>(r=c.d)||r>6)&&(s=!0):null!=c.e?(r=c.e+i,(c.e<0||c.e>6)&&(s=!0)):r=i),1>n||n>Et(e,i,o)?v(t)._overflowWeeks=!0:null!=s?v(t)._overflowWeekday=!0:(a=jt(e,n,r,i,o),t._a[ri]=a.year,t._dayOfYear=a.dayOfYear)}function pe(t){if(t._f!==e.ISO_8601){t._a=[],v(t).empty=!0;var n,r,i,o,a,s=""+t._i,u=s.length,c=0;for(i=J(t._f,t._locale).match(Lr)||[],n=0;n0&&v(t).unusedInput.push(a),s=s.slice(s.indexOf(r)+r.length),c+=r.length),Rr[o]?(r?v(t).empty=!1:v(t).unusedTokens.push(o),at(o,r,t)):t._strict&&!r&&v(t).unusedTokens.push(o);v(t).charsLeftOver=u-c,s.length>0&&v(t).unusedInput.push(s),t._a[ai]<=12&&!0===v(t).bigHour&&t._a[ai]>0&&(v(t).bigHour=void 0),v(t).parsedDateParts=t._a.slice(0),v(t).meridiem=t._meridiem,t._a[ai]=de(t._locale,t._a[ai],t._meridiem),fe(t),ae(t)}else se(t)}function de(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((r=t.isPM(n))&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function ve(t){var e,n,r,i,o;if(0===t._f.length)return v(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;io)&&(r=o,n=e));h(t,n||e)}function ge(t){if(!t._d){var e=B(t._i);t._a=l([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),fe(t)}}function ye(t){var e=new x(ae(me(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function me(t){var e=t._i,n=t._f;return t._locale=t._locale||ie(t._l),null===e||void 0===n&&""===e?y({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new x(ae(e)):(c(e)?t._d=e:i(n)?ve(t):n?pe(t):be(t),g(t)||(t._d=null),t))}function be(t){var n=t._i;void 0===n?t._d=new Date(e.now()):c(n)?t._d=new Date(n.valueOf()):"string"==typeof n?ue(t):i(n)?(t._a=l(n.slice(0),function(t){return parseInt(t,10)}),fe(t)):"object"==(void 0===n?"undefined":o(n))?ge(t):u(n)?t._d=new Date(n):e.createFromInputFallback(t)}function xe(t,e,n,r,o){var u={};return(!0===n||!1===n)&&(r=n,n=void 0),(a(t)&&s(t)||i(t)&&0===t.length)&&(t=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=n,u._i=t,u._f=e,u._strict=r,ye(u)}function _e(t,e,n,r){return xe(t,e,n,r,!1)}function we(t,e){var n,r;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return _e();for(n=e[0],r=1;rt?-1*Math.round(-1*t):Math.round(t)}function Ce(t,e){X(t,0,0,function(){var t=this.utcOffset(),n="+";return 0>t&&(t=-t,n="-"),n+K(~~(t/60),2)+e+K(~~t%60,2)})}function Pe(t,e){var n,r,i,o=(e||"").match(t);return null===o?null:0===(i=60*(r=((n=o[o.length-1]||[])+"").match(Vi)||["-",0,0])[1]+O(r[2]))?0:"+"===r[0]?i:-i}function ke(t,n){var r,i;return n._isUTC?(r=n.clone(),i=(_(t)||c(t)?t.valueOf():_e(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+i),e.updateOffset(r,!1),r):_e(t).local()}function Te(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ae(t,n){var r,i=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Pe(Qr,t)))return this}else Math.abs(t)<16&&(t*=60);return!this._isUTC&&n&&(r=Te(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!n||this._changeInProgress?Ke(this,We(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Te(this)}function Ie(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Le(t){return this.utcOffset(0,t)}function Ne(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Te(this),"m")),this}function De(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var t=Pe($r,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this}function Re(t){return!!this.isValid()&&(t=t?_e(t).utcOffset():0,0==(this.utcOffset()-t)%60)}function Fe(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ze(){var t,e;return m(this._isDSTShifted)?(b(t={},this),(t=me(t))._a?(e=t._isUTC?p(t._a):_e(t._a),this._isDSTShifted=this.isValid()&&j(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted):this._isDSTShifted}function Be(){return!!this.isValid()&&!this._isUTC}function Ye(){return!!this.isValid()&&this._isUTC}function Ve(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function We(t,e){var n,r,i,a=t,s=null;return Ee(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:u(t)?(a={},e?a[e]=t:a.milliseconds=t):(s=Wi.exec(t))?(n="-"===s[1]?-1:1,a={y:0,d:O(s[oi])*n,h:O(s[ai])*n,m:O(s[si])*n,s:O(s[ui])*n,ms:O(Me(1e3*s[ci]))*n}):(s=Hi.exec(t))?(n="-"===s[1]?-1:1,a={y:He(s[2],n),M:He(s[3],n),w:He(s[4],n),d:He(s[5],n),h:He(s[6],n),m:He(s[7],n),s:He(s[8],n)}):null==a?a={}:"object"==(void 0===a?"undefined":o(a))&&("from"in a||"to"in a)&&(i=qe(_e(a.from),_e(a.to)),(a={}).ms=i.milliseconds,a.M=i.months),r=new Se(a),Ee(t)&&f(t,"_locale")&&(r._locale=t._locale),r}function He(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ge(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function qe(t,e){var n;return t.isValid()&&e.isValid()?(e=ke(e,t),t.isBefore(e)?n=Ge(t,e):((n=Ge(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Ue(t,e){return function(n,r){var i,o;return null===r||isNaN(+r)||(M(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),Ke(this,i=We(n="string"==typeof n?+n:n,r),t),this}}function Ke(t,n,r,i){var o=n._milliseconds,a=Me(n._days),s=Me(n._months);t.isValid()&&(i=null==i||i,o&&t._d.setTime(t._d.valueOf()+o*r),a&&G(t,"Date",H(t,"Date")+a*r),s&&ht(t,H(t,"Month")+s*r),i&&e.updateOffset(t,a||s))}function Xe(t,e){var n=t.diff(e,"days",!0);return-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse"}function Ze(t,n){var r=t||_e(),i=ke(r,this).startOf("day"),o=e.calendarFormat(this,i)||"sameElse",a=n&&(C(n[o])?n[o].call(this,r):n[o]);return this.format(a||this.localeData().calendar(o,this,_e(r)))}function $e(){return new x(this)}function Qe(t,e){var n=_(t)?t:_e(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=z(m(e)?"millisecond":e))?this.valueOf()>n.valueOf():n.valueOf()e-o?r=(e-o)/(o-(n=t.clone().add(i-1,"months"))):r=(e-o)/((n=t.clone().add(i+1,"months"))-o),-(i+r)||0}function sn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function un(){var t=this.clone().utc();return 0(o=Et(t,r,i))&&(e=o),Nn.call(this,t,e,n,r,i))}function Nn(t,e,n,r,i){var o=jt(t,e,n,r,i),a=wt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Dn(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Rn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Fn(t,e){e[ci]=O(1e3*("0."+t))}function zn(){return this._isUTC?"UTC":""}function Bn(){return this._isUTC?"Coordinated Universal Time":""}function Yn(t){return _e(1e3*t)}function Vn(){return _e.apply(null,arguments).parseZone()}function Wn(t){return t}function Hn(t,e,n,r){var i=ie(),o=p().set(r,e);return i[n](o,t)}function Gn(t,e,n){var r,i;if(u(t)&&(e=t,t=void 0),t=t||"",null!=e)return Hn(t,e,n,"month");for(i=[],r=0;12>r;r++)i[r]=Hn(t,r,n,"month");return i}function qn(t,e,n,r){var i,o,a,s;if("boolean"==typeof t?(u(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,u(e)&&(n=e,e=void 0),e=e||""),i=ie(),o=t?i._week.dow:0,null!=n)return Hn(e,(n+o)%7,r,"day");for(s=[],a=0;7>a;a++)s[a]=Hn(e,(a+o)%7,r,"day");return s}function Un(t,e){return Gn(t,e,"months")}function Kn(t,e){return Gn(t,e,"monthsShort")}function Xn(t,e,n){return qn(t,e,n,"weekdays")}function Zn(t,e,n){return qn(t,e,n,"weekdaysShort")}function $n(t,e,n){return qn(t,e,n,"weekdaysMin")}function Qn(){var t=this._data;return this._milliseconds=eo(this._milliseconds),this._days=eo(this._days),this._months=eo(this._months),t.milliseconds=eo(t.milliseconds),t.seconds=eo(t.seconds),t.minutes=eo(t.minutes),t.hours=eo(t.hours),t.months=eo(t.months),t.years=eo(t.years),this}function Jn(t,e,n,r){var i=We(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function tr(t,e){return Jn(this,t,e,1)}function er(t,e){return Jn(this,t,e,-1)}function nr(t){return 0>t?Math.floor(t):Math.ceil(t)}function rr(){var t,e,n,r,i,o=this._milliseconds,a=this._days,s=this._months,u=this._data;return o>=0&&a>=0&&s>=0||0>=o&&0>=a&&0>=s||(o+=864e5*nr(or(s)+a),a=0,s=0),u.milliseconds=o%1e3,t=w(o/1e3),u.seconds=t%60,e=w(t/60),u.minutes=e%60,n=w(e/60),u.hours=n%24,s+=i=w(ir(a+=w(n/24))),a-=nr(or(i)),r=w(s/12),s%=12,u.days=a,u.months=s,u.years=r,this}function ir(t){return 4800*t/146097}function or(t){return 146097*t/4800}function ar(t){var e,n,r=this._milliseconds;if("month"===(t=z(t))||"year"===t)return e=this._days+r/864e5,n=this._months+ir(e),"month"===t?n:n/12;switch(e=this._days+Math.round(or(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function sr(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*O(this._months/12)}function ur(t){return function(){return this.as(t)}}function cr(t){return this[(t=z(t))+"s"]()}function lr(t){return function(){return this._data[t]}}function fr(){return w(this.days()/7)}function hr(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function pr(t,e,n){var r=We(t).abs(),i=mo(r.as("s")),o=mo(r.as("m")),a=mo(r.as("h")),s=mo(r.as("d")),u=mo(r.as("M")),c=mo(r.as("y")),l=i=o&&["m"]||o=a&&["h"]||a=s&&["d"]||s=u&&["M"]||u=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,hr.apply(null,l)}function dr(t){return void 0===t?mo:"function"==typeof t&&(mo=t,!0)}function vr(t,e){return void 0!==bo[t]&&(void 0===e?bo[t]:(bo[t]=e,!0))}function gr(t){var e=this.localeData(),n=pr(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function yr(){var t,e,n,r,i,o,a,s,u=xo(this._milliseconds)/1e3,c=xo(this._days),l=xo(this._months),f=w(u/60),h=w(f/60);return u%=60,f%=60,e=t=w(l/12),n=l%=12,r=c,i=h,o=f,a=u,(s=this.asSeconds())?(0>s?"-":"")+"P"+(e?e+"Y":"")+(n?n+"M":"")+(r?r+"D":"")+(i||o||a?"T":"")+(i?i+"H":"")+(o?o+"M":"")+(a?a+"S":""):"P0D"}var mr,br,xr,_r,wr,Or,jr,Sr,Er,Mr,Cr,Pr,kr,Tr,Ar,Ir,Lr,Nr,Dr,Rr,Fr,zr,Br,Yr,Vr,Wr,Hr,Gr,qr,Ur,Kr,Xr,Zr,$r,Qr,Jr,ti,ei,ni,ri,ii,oi,ai,si,ui,ci,li,fi,hi,pi,di,vi,gi,yi,mi,bi,xi,_i,wi,Oi,ji,Si,Ei,Mi,Ci,Pi,ki,Ti,Ai,Ii,Li,Ni,Di,Ri,Fi,zi,Bi,Yi,Vi,Wi,Hi,Gi,qi,Ui,Ki,Xi,Zi,$i,Qi,Ji,to,eo,no,ro,io,oo,ao,so,uo,co,lo,fo,ho,po,vo,go,yo,mo,bo,xo,_o;for(br=Array.prototype.some?Array.prototype.some:function(t){var e,n=Object(this),r=n.length>>>0;for(e=0;r>e;e++)if(e in n&&t.call(this,n[e],e,n))return!0;return!1},xr=br,_r=e.momentProperties=[],wr=!1,Or={},e.suppressDeprecationWarnings=!1,e.deprecationHandler=null,jr=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)f(t,e)&&n.push(e);return n},Sr=jr,Er={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Mr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Cr="Invalid date",Pr="%d",kr=/\d{1,2}/,Tr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ar={},Ir={},Lr=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Nr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Dr={},Rr={},Fr=/\d/,zr=/\d\d/,Br=/\d{3}/,Yr=/\d{4}/,Vr=/[+-]?\d{6}/,Wr=/\d\d?/,Hr=/\d\d\d\d?/,Gr=/\d\d\d\d\d\d?/,qr=/\d{1,3}/,Ur=/\d{1,4}/,Kr=/[+-]?\d{1,6}/,Xr=/\d+/,Zr=/[+-]?\d+/,$r=/Z|[+-]\d\d:?\d\d/gi,Qr=/Z|[+-]\d\d(?::?\d\d)?/gi,Jr=/[+-]?\d+(\.\d{1,3})?/,ti=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ei={},ni={},ri=0,ii=1,oi=2,ai=3,si=4,ui=5,ci=6,li=7,fi=8,hi=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=t?""+t:"+"+t}),X(0,["YY",2],0,function(){return this.year()%100}),X(0,["YYYY",4],0,"year"),X(0,["YYYYY",5],0,"year"),X(0,["YYYYYY",6,!0],0,"year"),F("year","y"),Y("year",1),tt("Y",Zr),tt("YY",Wr,zr),tt("YYYY",Ur,Yr),tt("YYYYY",Kr,Vr),tt("YYYYYY",Kr,Vr),it(["YYYYY","YYYYYY"],ri),it("YYYY",function(t,n){n[ri]=2===t.length?e.parseTwoDigitYear(t):O(t)}),it("YY",function(t,n){n[ri]=e.parseTwoDigitYear(t)}),it("Y",function(t,e){e[ri]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return O(t)+(O(t)>68?1900:2e3)},bi=W("FullYear",!0),X("w",["ww",2],"wo","week"),X("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),Y("week",5),Y("isoWeek",5),tt("w",Wr),tt("ww",Wr,zr),tt("W",Wr),tt("WW",Wr,zr),ot(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=O(t)}),xi={dow:0,doy:6},X("d",0,"do","day"),X("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),X("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),X("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),X("e",0,0,"weekday"),X("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),tt("d",Wr),tt("e",Wr),tt("E",Wr),tt("dd",function(t,e){return e.weekdaysMinRegex(t)}),tt("ddd",function(t,e){return e.weekdaysShortRegex(t)}),tt("dddd",function(t,e){return e.weekdaysRegex(t)}),ot(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:v(n).invalidWeekday=t}),ot(["d","e","E"],function(t,e,n,r){e[r]=O(t)}),_i="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wi="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Oi="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ji=ti,Si=ti,Ei=ti,X("H",["HH",2],0,"hour"),X("h",["hh",2],0,qt),X("k",["kk",2],0,Ut),X("hmm",0,0,function(){return""+qt.apply(this)+K(this.minutes(),2)}),X("hmmss",0,0,function(){return""+qt.apply(this)+K(this.minutes(),2)+K(this.seconds(),2)}),X("Hmm",0,0,function(){return""+this.hours()+K(this.minutes(),2)}),X("Hmmss",0,0,function(){return""+this.hours()+K(this.minutes(),2)+K(this.seconds(),2)}),Kt("a",!0),Kt("A",!1),F("hour","h"),Y("hour",13),tt("a",Xt),tt("A",Xt),tt("H",Wr),tt("h",Wr),tt("HH",Wr,zr),tt("hh",Wr,zr),tt("hmm",Hr),tt("hmmss",Gr),tt("Hmm",Hr),tt("Hmmss",Gr),it(["H","HH"],ai),it(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),it(["h","hh"],function(t,e,n){e[ai]=O(t),v(n).bigHour=!0}),it("hmm",function(t,e,n){var r=t.length-2;e[ai]=O(t.substr(0,r)),e[si]=O(t.substr(r)),v(n).bigHour=!0}),it("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[ai]=O(t.substr(0,r)),e[si]=O(t.substr(r,2)),e[ui]=O(t.substr(i)),v(n).bigHour=!0}),it("Hmm",function(t,e){var n=t.length-2;e[ai]=O(t.substr(0,n)),e[si]=O(t.substr(n))}),it("Hmmss",function(t,e){var n=t.length-4,r=t.length-2;e[ai]=O(t.substr(0,n)),e[si]=O(t.substr(n,2)),e[ui]=O(t.substr(r))}),Mi=/[ap]\.?m?\.?/i,Ci=W("Hours",!0),Pi={calendar:Er,longDateFormat:Mr,invalidDate:Cr,ordinal:Pr,ordinalParse:kr,relativeTime:Tr,months:vi,monthsShort:gi,week:xi,weekdays:_i,weekdaysMin:Oi,weekdaysShort:wi,meridiemParse:Mi},ki={},Ti={},Ii=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Li=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ni=/Z|[+-]\d\d(?::?\d\d)?/,Di=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Ri=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Fi=/^\/?Date\((\-?\d+)/i,e.createFromInputFallback=E("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){},zi=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_e.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:y()}),Bi=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_e.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:y()}),Yi=function t(){return Date.now?Date.now():+new Date},Ce("Z",":"),Ce("ZZ",""),tt("Z",Qr),tt("ZZ",Qr),it(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Pe(Qr,t)}),Vi=/([\+\-]|\d\d)/gi,e.updateOffset=function(){},Wi=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Hi=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/,We.fn=Se.prototype,Gi=Ue(1,"add"),qi=Ue(-1,"subtract"),e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",Ui=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)}),X(0,["gg",2],0,function(){return this.weekYear()%100}),X(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Pn("gggg","weekYear"),Pn("ggggg","weekYear"),Pn("GGGG","isoWeekYear"),Pn("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),tt("G",Zr),tt("g",Zr),tt("GG",Wr,zr),tt("gg",Wr,zr),tt("GGGG",Ur,Yr),tt("gggg",Ur,Yr),tt("GGGGG",Kr,Vr),tt("ggggg",Kr,Vr),ot(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=O(t)}),ot(["gg","GG"],function(t,n,r,i){n[i]=e.parseTwoDigitYear(t)}),X("Q",0,"Qo","quarter"),F("quarter","Q"),Y("quarter",7),tt("Q",Fr),it("Q",function(t,e){e[ii]=3*(O(t)-1)}),X("D",["DD",2],"Do","date"),F("date","D"),Y("date",9),tt("D",Wr),tt("DD",Wr,zr),tt("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),it(["D","DD"],oi),it("Do",function(t,e){e[oi]=O(t.match(Wr)[0],10)}),Ki=W("Date",!0),X("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),Y("dayOfYear",4),tt("DDD",qr),tt("DDDD",Br),it(["DDD","DDDD"],function(t,e,n){n._dayOfYear=O(t)}),X("m",["mm",2],0,"minute"),F("minute","m"),Y("minute",14),tt("m",Wr),tt("mm",Wr,zr),it(["m","mm"],si),Xi=W("Minutes",!1),X("s",["ss",2],0,"second"),F("second","s"),Y("second",15),tt("s",Wr),tt("ss",Wr,zr),it(["s","ss"],ui),Zi=W("Seconds",!1),X("S",0,0,function(){return~~(this.millisecond()/100)}),X(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),X(0,["SSS",3],0,"millisecond"),X(0,["SSSS",4],0,function(){return 10*this.millisecond()}),X(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),X(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),X(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),X(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),X(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),Y("millisecond",16),tt("S",qr,Fr),tt("SS",qr,zr),tt("SSS",qr,Br),$i="SSSS";$i.length<=9;$i+="S")tt($i,Xr);for($i="S";$i.length<=9;$i+="S")it($i,Fn);return Qi=W("Milliseconds",!1),X("z",0,0,"zoneAbbr"),X("zz",0,0,"zoneName"),(Ji=x.prototype).add=Gi,Ji.calendar=Ze,Ji.clone=$e,Ji.diff=on,Ji.endOf=mn,Ji.format=ln,Ji.from=fn,Ji.fromNow=hn,Ji.to=pn,Ji.toNow=dn,Ji.get=q,Ji.invalidAt=Mn,Ji.isAfter=Qe,Ji.isBefore=Je,Ji.isBetween=tn,Ji.isSame=en,Ji.isSameOrAfter=nn,Ji.isSameOrBefore=rn,Ji.isValid=Sn,Ji.lang=Ui,Ji.locale=vn,Ji.localeData=gn,Ji.max=Bi,Ji.min=zi,Ji.parsingFlags=En,Ji.set=U,Ji.startOf=yn,Ji.subtract=qi,Ji.toArray=wn,Ji.toObject=On,Ji.toDate=_n,Ji.toISOString=un,Ji.inspect=cn,Ji.toJSON=jn,Ji.toString=sn,Ji.unix=xn,Ji.valueOf=bn,Ji.creationData=Cn,Ji.year=bi,Ji.isLeapYear=xt,Ji.weekYear=kn,Ji.isoWeekYear=Tn,Ji.quarter=Ji.quarters=Dn,Ji.month=pt,Ji.daysInMonth=dt,Ji.week=Ji.weeks=kt,Ji.isoWeek=Ji.isoWeeks=Tt,Ji.weeksInYear=In,Ji.isoWeeksInYear=An,Ji.date=Ki,Ji.day=Ji.days=zt,Ji.weekday=Bt,Ji.isoWeekday=Yt,Ji.dayOfYear=Rn,Ji.hour=Ji.hours=Ci,Ji.minute=Ji.minutes=Xi,Ji.second=Ji.seconds=Zi,Ji.millisecond=Ji.milliseconds=Qi,Ji.utcOffset=Ae,Ji.utc=Le,Ji.local=Ne,Ji.parseZone=De,Ji.hasAlignedHourOffset=Re,Ji.isDST=Fe,Ji.isLocal=Be,Ji.isUtcOffset=Ye,Ji.isUtc=Ve,Ji.isUTC=Ve,Ji.zoneAbbr=zn,Ji.zoneName=Bn,Ji.dates=E("dates accessor is deprecated. Use date instead.",Ki),Ji.months=E("months accessor is deprecated. Use month instead",pt),Ji.years=E("years accessor is deprecated. Use year instead",bi),Ji.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ie),Ji.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ze),(to=T.prototype).calendar=A,to.longDateFormat=I,to.invalidDate=L,to.ordinal=N,to.preparse=Wn,to.postformat=Wn,to.relativeTime=D,to.pastFuture=R,to.set=P,to.months=ut,to.monthsShort=ct,to.monthsParse=ft,to.monthsRegex=gt,to.monthsShortRegex=vt,to.week=Mt,to.firstDayOfYear=Pt,to.firstDayOfWeek=Ct,to.weekdays=Lt,to.weekdaysMin=Dt,to.weekdaysShort=Nt,to.weekdaysParse=Ft,to.weekdaysRegex=Vt,to.weekdaysShortRegex=Wt,to.weekdaysMinRegex=Ht,to.isPM=Zt,to.meridiem=$t,ee("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function t(e){var n=e%10,r;return e+(1===O(e%100/10)?"th":1===n?"st":2===n?"nd":3===n?"rd":"th")}}),e.lang=E("moment.lang is deprecated. Use moment.locale instead.",ee),e.langData=E("moment.langData is deprecated. Use moment.localeData instead.",ie),eo=Math.abs,no=ur("ms"),ro=ur("s"),io=ur("m"),oo=ur("h"),ao=ur("d"),so=ur("w"),uo=ur("M"),co=ur("y"),lo=lr("milliseconds"),fo=lr("seconds"),ho=lr("minutes"),po=lr("hours"),vo=lr("days"),go=lr("months"),yo=lr("years"),mo=Math.round,bo={s:45,m:45,h:22,d:26,M:11},xo=Math.abs,(_o=Se.prototype).abs=Qn,_o.add=tr,_o.subtract=er,_o.as=ar,_o.asMilliseconds=no,_o.asSeconds=ro,_o.asMinutes=io,_o.asHours=oo,_o.asDays=ao,_o.asWeeks=so,_o.asMonths=uo,_o.asYears=co,_o.valueOf=sr,_o._bubble=rr,_o.get=cr,_o.milliseconds=lo,_o.seconds=fo,_o.minutes=ho,_o.hours=po,_o.days=vo,_o.weeks=fr,_o.months=go,_o.years=yo,_o.humanize=gr,_o.toISOString=yr,_o.toString=yr,_o.toJSON=yr,_o.locale=vn,_o.localeData=gn,_o.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",yr),_o.lang=Ui,X("X",0,0,"unix"),X("x",0,0,"valueOf"),tt("x",Zr),tt("X",Jr),it("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),it("x",function(t,e,n){n._d=new Date(O(t))}),e.version="2.17.0",r(_e),e.fn=Ji,e.min=Oe,e.max=je,e.now=Yi,e.utc=p,e.unix=Yn,e.months=Un,e.isDate=c,e.locale=ee,e.invalid=y,e.duration=We,e.isMoment=_,e.weekdays=Xn,e.parseZone=Vn,e.localeData=ie,e.isDuration=Ee,e.monthsShort=Kn,e.weekdaysMin=$n,e.defineLocale=ne,e.updateLocale=re,e.locales=oe,e.weekdaysShort=Zn,e.normalizeUnits=z,e.relativeTimeRounding=dr,e.relativeTimeThreshold=vr,e.calendarFormat=Xe,e.prototype=Ji,e.defineLocale("zh-cn",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u5468\u65e5_\u5468\u4e00_\u5468\u4e8c_\u5468\u4e09_\u5468\u56db_\u5468\u4e94_\u5468\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"Ah\u70b9mm\u5206",LTS:"Ah\u70b9m\u5206s\u79d2",L:"YYYY-MM-DD",LL:"YYYY\u5e74MMMD\u65e5",LLL:"YYYY\u5e74MMMD\u65e5Ah\u70b9mm\u5206",LLLL:"YYYY\u5e74MMMD\u65e5ddddAh\u70b9mm\u5206",l:"YYYY-MM-DD",ll:"YYYY\u5e74MMMD\u65e5",lll:"YYYY\u5e74MMMD\u65e5Ah\u70b9mm\u5206",llll:"YYYY\u5e74MMMD\u65e5ddddAh\u70b9mm\u5206"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function t(e,n){return 12===e&&(e=0),"\u51cc\u6668"===n||"\u65e9\u4e0a"===n||"\u4e0a\u5348"===n?e:"\u4e0b\u5348"===n||"\u665a\u4e0a"===n?e+12:e>=11?e:e+12},meridiem:function t(e,n){var r=100*e+n;return 600>r?"\u51cc\u6668":900>r?"\u65e9\u4e0a":1130>r?"\u4e0a\u5348":1230>r?"\u4e2d\u5348":1800>r?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:function t(){return 0===this.minutes()?"[\u4eca\u5929]Ah[\u70b9\u6574]":"[\u4eca\u5929]LT"},nextDay:function t(){return 0===this.minutes()?"[\u660e\u5929]Ah[\u70b9\u6574]":"[\u660e\u5929]LT"},lastDay:function t(){return 0===this.minutes()?"[\u6628\u5929]Ah[\u70b9\u6574]":"[\u6628\u5929]LT"},nextWeek:function t(){var n,r;return n=e().startOf("week"),r=this.diff(n,"days")>=7?"[\u4e0b]":"[\u672c]",0===this.minutes()?r+"dddAh\u70b9\u6574":r+"dddAh\u70b9mm"},lastWeek:function t(){var n,r;return n=e().startOf("week"),r=this.unix()=11?e:e+12:"\u4e0b\u5348"===n||"\u665a\u4e0a"===n?e+12:void 0},meridiem:function t(e,n){var r=100*e+n;return 600>r?"\u51cc\u6668":900>r?"\u65e9\u4e0a":1130>r?"\u4e0a\u5348":1230>r?"\u4e2d\u5348":1800>r?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:"[\u4e0b]ddddLT",lastDay:"[\u6628\u5929]LT",lastWeek:"[\u4e0a]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function t(e,n){switch(n){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5167",past:"%s\u524d",s:"\u5e7e\u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}}),e.defineLocale("zh-tw",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"Ah\u9edemm\u5206",LTS:"Ah\u9edem\u5206s\u79d2",L:"YYYY\u5e74MMMD\u65e5",LL:"YYYY\u5e74MMMD\u65e5",LLL:"YYYY\u5e74MMMD\u65e5Ah\u9edemm\u5206",LLLL:"YYYY\u5e74MMMD\u65e5ddddAh\u9edemm\u5206",l:"YYYY\u5e74MMMD\u65e5",ll:"YYYY\u5e74MMMD\u65e5",lll:"YYYY\u5e74MMMD\u65e5Ah\u9edemm\u5206",llll:"YYYY\u5e74MMMD\u65e5ddddAh\u9edemm\u5206"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function t(e,n){return 12===e&&(e=0),"\u51cc\u6668"===n||"\u65e9\u4e0a"===n||"\u4e0a\u5348"===n?e:"\u4e2d\u5348"===n?e>=11?e:e+12:"\u4e0b\u5348"===n||"\u665a\u4e0a"===n?e+12:void 0},meridiem:function t(e,n){var r=100*e+n;return 600>r?"\u51cc\u6668":900>r?"\u65e9\u4e0a":1130>r?"\u4e0a\u5348":1230>r?"\u4e2d\u5348":1800>r?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:"[\u4e0b]ddddLT",lastDay:"[\u6628\u5929]LT",lastWeek:"[\u4e0a]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function t(e,n){switch(n){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5167",past:"%s\u524d",s:"\u5e7e\u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}}),e.defineLocale("ja",{months:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u65e5\u66dc\u65e5_\u6708\u66dc\u65e5_\u706b\u66dc\u65e5_\u6c34\u66dc\u65e5_\u6728\u66dc\u65e5_\u91d1\u66dc\u65e5_\u571f\u66dc\u65e5".split("_"),weekdaysShort:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),weekdaysMin:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),longDateFormat:{LT:"Ah\u6642m\u5206",LTS:"Ah\u6642m\u5206s\u79d2",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5Ah\u6642m\u5206",LLLL:"YYYY\u5e74M\u6708D\u65e5Ah\u6642m\u5206 dddd"},meridiemParse:/\u5348\u524d|\u5348\u5f8c/i,isPM:function t(e){return"\u5348\u5f8c"===e},meridiem:function t(e){return 12>e?"\u5348\u524d":"\u5348\u5f8c"},calendar:{sameDay:"[\u4eca\u65e5] LT",nextDay:"[\u660e\u65e5] LT",nextWeek:"[\u6765\u9031]dddd LT",lastDay:"[\u6628\u65e5] LT",lastWeek:"[\u524d\u9031]dddd LT",sameElse:"L"},ordinalParse:/\d{1,2}\u65e5/,ordinal:function t(e,n){switch(n){case"d":case"D":case"DDD":return e+"\u65e5";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u6570\u79d2",m:"1\u5206",mm:"%d\u5206",h:"1\u6642\u9593",hh:"%d\u6642\u9593",d:"1\u65e5",dd:"%d\u65e5",M:"1\u30f6\u6708",MM:"%d\u30f6\u6708",y:"1\u5e74",yy:"%d\u5e74"}}),e.locale("en"),e},"object"==o(e)&&void 0!==t?t.exports=s():void 0===(i="function"==typeof(r=s)?r.call(e,n,e,t):r)||(t.exports=i)}).call(this,n(676)(t))},function(t,e,n){n(173),n(173),t.exports=n(614)},function(t,e,n){"use strict";var r,i=O(n(498)),o,a=O(n(232)),s,u=O(n(499)),c,l=O(n(500)),f,h=O(n(501)),p,d=O(n(502)),v,g=O(n(504)),y,m=O(n(505)),b,x=O(n(506)),_,w=O(n(507));function O(t){return t&&t.__esModule?t:{default:t}}t.exports={focus:i.default,func:a.default,keyCode:u.default,pickAttrs:l.default,scrollbar:h.default,support:d.default,log:g.default,pickOthers:m.default,obj:x.default,children:w.default}},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(11);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(488));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default,t.exports=e.default},function(t,e){t.exports=window.ReactDOM},function(t,e,n){n(171),n(171),t.exports=n(257)},function(t,e,n){var r=n(131)("wks"),i=n(61),o=n(10).Symbol,a="function"==typeof o,s;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(42),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";n(278),Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(660));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default},function(t,e,n){var r=n(9),i=n(198),o=n(53),a=Object.defineProperty;e.f=n(19)?Object.defineProperty:function t(e,n,s){if(r(e),n=o(n,!0),r(s),i)try{return a(e,n,s)}catch(t){}if("get"in s||"set"in s)throw TypeError("Accessors not supported!");return"value"in s&&(e[n]=s.value),e}},function(t,e,n){t.exports=!n(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n=t.exports={version:"2.6.1"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";e.__esModule=!0;var r,i=u(n(533)),o,a=u(n(545)),s="function"==typeof a.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};function u(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof a.default&&"symbol"===s(i.default)?function(t){return void 0===t?"undefined":s(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":s(t)}},function(t,e,n){!function e(r,i){t.exports=i(n(0))}(this,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=520)}([function(t,e,n){var r=n(157),i=n(25),o=r.mix({},r,{assign:r.mix,merge:r.deepMix,cloneDeep:r.clone,isFinite:isFinite,isNaN:isNaN,snapEqual:r.isNumberEqual,remove:r.pull,inArray:r.contains,toAllPadding:function t(e){var n=0,r=0,i=0,a=0;return o.isNumber(e)||o.isString(e)?n=r=i=a=e:o.isArray(e)?(n=e[0],i=o.isNil(e[1])?e[0]:e[1],a=o.isNil(e[2])?e[0]:e[2],r=o.isNil(e[3])?i:e[3]):o.isObject(e)&&(n=e.top||0,i=e.right||0,a=e.bottom||0,r=e.left||0),[n,i,a,r]},getClipByRange:function t(e){var n=e.tl,r=e.br,o;return new i.Rect({attrs:{x:n.x,y:n.y,width:r.x-n.x,height:r.y-n.y}})}});o.Array={groupToMap:r.groupToMap,group:r.group,merge:r.merge,values:r.valuesOfKey,getRange:r.getRange,firstValue:r.firstValue,remove:r.pull},t.exports=o},function(t,e,n){var r=n(140),i={};r.merge(i,r,{mixin:function t(e,n){var r=e.CFG?"CFG":"ATTRS";if(e&&n){e._mixins=n,e[r]=e[r]||{};var o={};i.each(n,function(t){i.augment(e,t);var n=t[r];n&&i.merge(o,n)}),e[r]=i.merge(o,e[r])}}}),t.exports=i},function(t,e,n){var r=n(38),i=n(4),o=function t(e,n){if(e){var o=void 0;if(i(e))for(var a=0,s=e.length;a0){var u=i.strokeOpacity;r.isNil(u)||1===u||(e.globalAlpha=u),e.stroke()}this.afterPath(e)},afterPath:function t(){},isHitBox:function t(){return!0},isHit:function t(e,n){var r=this,i=[e,n,1];if(this.invert(i),this.isHitBox()){var o=this.getBBox();if(o&&!a.box(o.minX,o.maxX,o.minY,o.maxY,i[0],i[1]))return!1}var s=this._attrs.clip;return s?(s.invert(i,this.get("canvas")),!!s.isPointInPath(i[0],i[1])&&this.isPointInPath(i[0],i[1])):this.isPointInPath(i[0],i[1])},calculateBox:function t(){return null},getHitLineWidth:function t(){var e=this._attrs,n=e.lineAppendWidth||0,r;return(e.lineWidth||0)+n},clearTotalMatrix:function t(){this._cfg.totalMatrix=null,this._cfg.region=null},clearBBox:function t(){this._cfg.box=null,this._cfg.region=null},getBBox:function t(){var e=this._cfg.box;return e||((e=this.calculateBox())&&(e.x=e.minX,e.y=e.minY,e.width=e.maxX-e.minX,e.height=e.maxY-e.minY),this._cfg.box=e),e},clone:function t(){var e=this,t=null,n=this._attrs,i={};return r.each(n,function(t,e){u[e]&&r.isArray(n[e])?i[e]=c(n[e]):i[e]=n[e]}),t=new this.constructor({attrs:i}),t._cfg.zIndex=this._cfg.zIndex,t}}),t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(61),a=n(217),s=n(113),u=n(0),c=n(5),l=n(284),f=n(9),h=n(290),p=n(288),d=n(289),v=n(303),g=["color","shape","size"],y="_origin";function m(t){return(u.isString(t)||u.isPlainObject(t))&&(t=[t]),u.each(t,function(e,n){u.isObject(e)||(t[n]={type:e})}),t}var b=function(t){r(n,t);var e=n.prototype;function n(e){var n;return(n=t.call(this,e)||this).viewTheme=n.get("viewTheme"),u.assign(i(i(n)),h,p,d),n.get("container")&&n._initContainer(),n._initOptions(),n}return e.getDefaultCfg=function t(){return{_id:null,type:"base",coord:null,attrs:{},view:null,data:[],scales:{},container:null,labelContainer:null,shapeContainer:null,attrOptions:{},styleOptions:null,selectedOptions:null,activedOptions:null,hasDefaultAdjust:!1,adjusts:null,shapeType:null,generatePoints:!1,sortable:!1,labelCfg:null,shareTooltip:!0,tooltipCfg:null,animate:!0,animateCfg:null,visible:!0}},e._initOptions=function t(){var e=this.get("adjusts");e&&(e=m(e),this.set("adjusts",e))},e._createScale=function t(e,n){var r=this.get("scales"),i=r[e];return i||(i=this.get("view").createScale(e,n),r[e]=i),i},e._setAttrOptions=function t(e,n){var r;this.get("attrOptions")[e]=n},e._createAttrOption=function t(e,n,r,i){var o={};o.field=n,r?u.isFunction(r)?o.callback=r:o.values=r:"color"!==e&&(o.values=i),this._setAttrOptions(e,o)},e.position=function t(e){return this._setAttrOptions("position",{field:e}),this},e.color=function t(e,n){var r=this.viewTheme||c;return this._createAttrOption("color",e,n,r.colors),this},e.size=function t(e,n){var r=this.viewTheme||c;return this._createAttrOption("size",e,n,r.sizes),this},e.shape=function t(e,n){var r=this.viewTheme||c,i=this.get("type"),o=r.shapes[i]||[];return this._createAttrOption("shape",e,n,o),this},e.opacity=function t(e,n){var r=this.viewTheme||c;return this._createAttrOption("opacity",e,n,r.opacities),this},e.style=function t(e,n){var r=this.get("styleOptions"),i;return r||(r={},this.set("styleOptions",r)),u.isObject(e)&&(n=e,e=null),e&&(i=v(e)),r.fields=i,r.style=n,this},e.label=function t(e,n,r){var i=this,o=this.get("labelCfg"),a;return o||(o={},this.set("labelCfg",o)),e&&(a=v(e)),o.fields=a,u.isFunction(n)?(r||(r={}),o.callback=n):u.isObject(n)&&(r=n),o.globalCfg=r,this},e.tooltip=function t(e,n){var r=this.get("tooltipCfg"),i;(r||(r={}),!1===e)?this.set("tooltipCfg",!1):(e&&(i=v(e)),r.fields=i,r.cfg=n);return this.set("tooltipCfg",r),this},e.animate=function t(e){return this.set("animateCfg",e),this},e.active=function t(e,n){return!1===e?this.set("allowActive",!1):u.isObject(e)?(this.set("allowActive",!0),this.set("activedOptions",e)):(this.set("allowActive",!0),this.set("activedOptions",n)),this},e.adjust=function t(e){return this.get("hasDefaultAdjust")||(e&&(e=m(e)),this.set("adjusts",e)),this},e.select=function t(e,n){return!1===e?this.set("allowSelect",!1):u.isObject(e)?(this.set("allowSelect",!0),this.set("selectedOptions",e)):(this.set("allowSelect",!0),this.set("selectedOptions",n)),this},e.hasAdjust=function t(e){var n=this,r=this.get("adjusts");if(!e)return!1;var i=!1;return u.each(r,function(t){if(t.type===e)return i=!0,!1}),i},e.hasStack=function t(){var e=this.get("isStacked");return u.isNil(e)&&(e=this.hasAdjust("stack"),this.set("isStacked",e)),e},e.isInCircle=function t(){var e=this.get("coord");return e&&e.isPolar},e._initContainer=function t(){var e=this,n=this.get("shapeContainer");if(!n){var r=this.get("container"),i=this.get("view"),o=i&&i.get("_id");n=r.addGroup({viewId:o,visible:this.get("visible")}),this.set("shapeContainer",n)}},e.init=function t(){var e=this;if(e._initContainer(),e._initAttrs(),e.get("tooltipCfg")&&e.get("tooltipCfg").fields){var n=e.get("tooltipCfg").fields;u.each(n,function(t){e._createScale(t)})}var r=e._processData();e.get("adjusts")&&e._adjust(r),e.set("dataArray",r)},e._initAttrs=function t(){var e=this,n=this.get("attrs"),r=this.get("attrOptions"),i=this.get("coord"),a=this.viewTheme||c,s=!1;for(var l in r)if(r.hasOwnProperty(l)){var f=r[l],h=u.upperFirst(l),p=v(f.field);"position"===l&&(f.coord=i,1===p.length&&"theta"===i.type&&(p.unshift("1"),s=!0));for(var d=[],g=0;g1){var b=d[1];b.change({nice:!1,min:0,max:Math.max.apply(null,b.values)})}f.scales=d;var x=new o[h](f);n[l]=x}},e._processData=function t(){for(var e=this,n=this.get("data"),r=[],i=this._groupData(n),o=0;oa&&(a=f)}(on.max)&&n.change({min:o,max:a})},e._adjust=function t(e){var n=this,r=n.get("adjusts"),i=this.viewTheme||c,o=n.getYScale(),s=n.getXScale(),l=s.field,f=o?o.field:null;u.each(r,function(t){var r=u.mix({xField:l,yField:f},t),c=u.upperFirst(t.type),h;if("Dodge"===c){var p=[];if(s.isCategory||s.isIdentity)p.push("x");else{if(o)throw new Error("dodge is not support linear attribute, please use category attribute!");p.push("y")}r.adjustNames=p,r.dodgeRatio=i.widthRatio.column}else if("Stack"===c){var d=n.get("coord");if(!o){r.height=d.getHeight();var v=n.getDefaultValue("size")||3;r.size=v}!d.isTransposed&&u.isNil(r.reverseOrder)&&(r.reverseOrder=!0)}new a[c](r).processAdjust(e),"Stack"===c&&o&&n._updateStackRange(f,o,e)})},e.setCoord=function t(e){this.set("coord",e);var n=this.getAttr("position"),r;this.get("shapeContainer").setMatrix(e.matrix),n&&(n.coord=e)},e.paint=function t(){var e=this,n=this.get("dataArray"),r=[],i=this.getShapeFactory();i.setCoord(this.get("coord")),this.set("shapeFactory",i);var o=this.get("shapeContainer");this._beforeMapping(n);for(var a=0;a=0?n:r<=0?r:0},e._normalizeValues=function t(e,n){var r=[];if(u.isArray(e))for(var i=0;i1)for(var p=0;p0)u.each(r,function(t){n+="-"+e[t]});else{var i=this.get("type"),o=this.getXScale(),a=this.getYScale(),s=o.field||"x",c=a.field||"y",l=e[c],f;f=o.isIdentity?o.value:e[s],n+="interval"===i||"schema"===i?"-"+f:"line"===i||"area"===i||"path"===i?"-"+i:"-"+f+"-"+l;var h=this._getGroupScales();u.isEmpty(h)||u.each(h,function(t){var r=t.field;"identity"!==t.type&&(n+="-"+e[r])})}return n},e.getDrawCfg=function t(e){var n=this,r={origin:e,x:e.x,y:e.y,color:e.color,size:e.size,shape:e.shape,isInCircle:this.isInCircle(),opacity:e.opacity},i=this.get("styleOptions");return i&&i.style&&(r.style=this.getCallbackCfg(i.fields,i.style,e._origin)),this.get("generatePoints")&&(r.points=e.points,r.nextPoints=e.nextPoints),this.get("animate")&&(r._id=this._getShapeId(e._origin)),r},e.appendShapeInfo=function t(e,n){e&&(e.setSilent("index",n),e.setSilent("coord",this.get("coord")),this.get("animate")&&this.get("animateCfg")&&e.setSilent("animateCfg",this.get("animateCfg")))},e._applyViewThemeShapeStyle=function t(e,n,r){var i=this,o=this.viewTheme||c,a=r.name;n?n&&(n.indexOf("hollow")>-1||n.indexOf("liquid")>-1)&&(a="hollow"+u.upperFirst(a)):r.defaultShapeType.indexOf("hollow")>-1&&(a="hollow"+u.upperFirst(a));var s=o.shape[a]||{};e.style=u.mix({},s,e.style)},e.drawPoint=function t(e,n,r,i){var o=this,a=e.shape,s=this.getDrawCfg(e);this._applyViewThemeShapeStyle(s,a,r);var u=r.drawShape(a,s,n);this.appendShapeInfo(u,i)},e.getAttr=function t(e){return this.get("attrs")[e]},e.getXScale=function t(){return this.getAttr("position").scales[0]},e.getYScale=function t(){return this.getAttr("position").scales[1]},e.getShapes=function t(){var e=[],n,r=this.get("shapeContainer").get("children");return u.each(r,function(t){t.get("origin")&&e.push(t)}),e},e.getAttrsForLegend=function t(){var e=this.get("attrs"),n=[];return u.each(e,function(t){-1!==g.indexOf(t.type)&&n.push(t)}),n},e.getFieldsForLegend=function t(){var e=[],n=this.get("attrOptions");return u.each(g,function(t){var r=n[t];r&&r.field&&u.isString(r.field)&&(e=e.concat(r.field.split("*")))}),u.uniq(e)},e.changeVisible=function t(e,n){var r;this.set("visible",e);var i=this.get("shapeContainer");i&&i.set("visible",e);var o=this.get("labelContainer"),a;(o&&o.set("visible",e),!n&&i)&&i.get("canvas").draw()},e.reset=function t(){this.set("attrOptions",{}),this.clearInner()},e.clearInner=function t(){this.clearActivedShapes(),this.clearSelected();var e=this.get("shapeContainer");e&&e.clear();var n=this.get("labelContainer");n&&n.remove(),this.set("attrs",{}),this.set("groupScales",null),this.set("labelContainer",null),this.set("xDistance",null),this.set("isStacked",null)},e.clear=function t(){this.clearInner(),this.set("scales",{})},e.destroy=function e(){this.clear();var n=this.get("shapeContainer");n&&n.remove(),this.offEvents(),t.prototype.destroy.call(this)},e.bindEvents=function t(){this.get("view")&&(this._bindActiveAction(),this._bindSelectedAction())},e.offEvents=function t(){this.get("view")&&(this._offActiveAction(),this._offSelectedAction())},n}(s);t.exports=b},function(t,e,n){var r=n(0),i=n(24),o=r.PathUtil,a={},s={_coord:null,draw:function t(e,n){return this.drawShape?this.drawShape(e,n):null},setCoord:function t(e){this._coord=e},parsePath:function t(e,n){var r=this._coord;return e=o.parsePathString(e),e=r.isPolar&&!1!==n?i.convertPolarPath(r,e):i.convertNormalPath(r,e)},parsePoint:function t(e){var n;return this._coord.convertPoint(e)},parsePoints:function t(e){var n=this._coord,i=[];return r.each(e,function(t){i.push(n.convertPoint(t))}),i}},u={defaultShapeType:null,setCoord:function t(e){this._coord=e},getShape:function t(e){var n=this;r.isArray(e)&&(e=e[0]);var i=this[e]||this[this.defaultShapeType];return i._coord=this._coord,i},getShapePoints:function t(e,n){var r=this.getShape(e),i,o;return(r.getPoints||r.getShapePoints||this.getDefaultPoints)(n)},getDefaultPoints:function t(){return[]},getMarkerCfg:function t(e,n){var r=this.getShape(e);if(!r.getMarkerCfg){var i=this.defaultShapeType;r=this.getShape(i)}return r.getMarkerCfg(n)},getSelectedCfg:function t(){return{}},drawShape:function t(e,n,r){var i,o=this.getShape(e).draw(n,r);return o&&(o.setSilent("origin",n.origin),o._id=n.yIndex?n._id+n.yIndex:n._id,o.name=this.name),o}};a.registerFactory=function(t,e){var n=r.upperFirst(t),i=r.assign({},u,e);return a[n]=i,i.name=t,i},a.registerShape=function(t,e,n){var i=r.upperFirst(t),o=a[i],u=r.assign({},s,n);return o[e]=u,u},a.getShapeFactory=function(t){var e=this,n;return t=t||"point",this[r.upperFirst(t)]},t.exports=a},function(t,e){function n(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}var r=function t(e,r,i,o){return r&&n(e,r),i&&n(e,i),o&&n(e,o),e};t.exports=r},function(t,e,n){var r=n(15),i=function t(e){return r(e,"Number")};t.exports=i},function(t,e,n){"use strict";var r=n(83);n.d(e,"f",function(){return r.h}),n.d(e,"e",function(){return r.g}),n.d(e,"d",function(){return r.f});var i=n(421);n.d(e,"c",function(){return i.b}),n.d(e,"b",function(){return i.a});var o=n(420);n.d(e,"a",function(){return o.a})},function(t,e,n){var r=n(15),i=function t(e){return r(e,"Function")};t.exports=i},function(t,e,n){var r=n(15),i=function t(e){return r(e,"String")};t.exports=i},function(t,e){var n={}.toString,r=function t(e,r){return n.call(e)==="[object "+r+"]"};t.exports=r},function(t,e,n){"use strict";n.d(e,"c",function(){return I}),e.b=L;var r=n(485),i=n(486),o=n(474),a=n(468),s=n(207),u=n(473),c=n(478),l=n(481),f=n(488),h=n(465),p=n(480),d=n(479),v=n(487),g=n(472),y=n(471),m=n(464),b=n(209),x=n(482),_=n(466),w=n(489),O=n(475),j=n(483),S=n(477),E=n(463),M=n(476),C=n(484),P=n(467),k=n(469),T=n(92),A=n(470),I=[null];function L(t,e){this._groups=t,this._parents=e}function N(){return new L([[document.documentElement]],I)}L.prototype=N.prototype={constructor:L,select:r.a,selectAll:i.a,filter:o.a,data:a.a,enter:s.a,exit:u.a,merge:c.a,order:l.a,sort:f.a,call:h.a,nodes:p.a,node:d.a,size:v.a,empty:g.a,each:y.a,attr:m.a,style:b.b,property:x.a,classed:_.a,text:w.a,html:O.a,raise:j.a,lower:S.a,append:E.a,insert:M.a,remove:C.a,clone:P.a,datum:k.a,on:T.c,dispatch:A.a},e.a=N},function(t,e,n){"use strict";n.d(e,"d",function(){return u}),n.d(e,"a",function(){return c}),n.d(e,"b",function(){return h}),n.d(e,"c",function(){return p}),e.g=d,e.e=v,e.f=g;var r=n(423),i=n(96),o=n.i(r.a)("start","end","interrupt"),a=[],s=0,u=1,c=2,l=3,f=4,h=5,p=6;function d(t,e){var n=g(t,e);if(n.state>s)throw new Error("too late; already scheduled");return n}function v(t,e){var n=g(t,e);if(n.state>c)throw new Error("too late; already started");return n}function g(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function y(t,e,r){var o=t.__transition,a;function s(t){r.state=u,r.timer.restart(d,r.delay,r.time),r.delay<=t&&d(t-r.delay)}function d(s){var h,y,m,b;if(r.state!==u)return g();for(h in o)if((b=o[h]).name===r.name){if(b.state===l)return n.i(i.timeout)(d);b.state===f?(b.state=p,b.timer.stop(),b.on.call("interrupt",t,t.__data__,b.index,b.group),delete o[h]):+h=s[l]?1:0,p=f>Math.PI?1:0,d=n.convertPoint(u),v=a(n,d);if(v>=.5)if(f===2*Math.PI){var g={x:(u.x+s.x)/2,y:(u.y+s.y)/2},y=n.convertPoint(g);c.push(["A",v,v,0,p,h,y.x,y.y]),c.push(["A",v,v,0,p,h,d.x,d.y])}else c.push(["A",v,v,0,p,h,d.x,d.y]);return c}function c(t){r.each(t,function(e,n){var r;if("a"===e[0].toLowerCase()){var i=t[n-1],o=t[n+1];o&&"a"===o[0].toLowerCase()?i&&"l"===i[0].toLowerCase()&&(i[0]="M"):i&&"a"===i[0].toLowerCase()&&o&&"l"===o[0].toLowerCase()&&(o[0]="M")}})}var l={getLinePath:function t(e,n){return o(e,n)},getSplinePath:function t(e,n,o){var a=[],s=e[0],u=null;if(e.length<=2)return l.getLinePath(e,n);r.each(e,function(t){u&&u.x===t.x&&u.y===t.y||(a.push(t.x),a.push(t.y),u=t)}),o=o||[[0,0],[1,1]];var c=i.catmullRom2bezier(a,n,o);return c.unshift(["M",s.x,s.y]),c},getPointRadius:function t(e,n){var r;return a(e,n)},getPointAngle:function t(e,n){var r=e.getCenter(),i;return Math.atan2(n.y-r.y,n.x-r.x)},convertNormalPath:function t(e,n){var i=[];return r.each(n,function(t){var n;switch(t[0].toLowerCase()){case"m":case"l":case"c":i.push(s(t,e));break;case"z":default:i.push(t)}}),i},convertPolarPath:function t(e,n){var i=[],o,a,l,f;return r.each(n,function(t,r){var c;switch(t[0].toLowerCase()){case"m":case"c":case"q":i.push(s(t,e));break;case"l":o=n[r-1],a=t,l=e.isTransposed,(f=l?o[o.length-2]===a[1]:o[o.length-1]===a[2])?i=i.concat(u(o,a,e)):i.push(s(t,e));break;case"z":default:i.push(t)}}),c(i),i}};t.exports=l},function(t,e,n){var r=n(35);t.exports=r},function(t,e,n){var r=n(10),i=n(2),o=n(38),a=n(6),s=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),r(this,t),this.init()}return t._initDefaultCfg=function t(){this.type="base",this.formatter=null,this.range=[0,1],this.ticks=null,this.values=[]},t.init=function t(){},t.getTicks=function t(){var e=this,n=e.ticks,r=[];return i(n,function(t){var n;n=o(t)?t:{text:e.getText(t),tickValue:t,value:e.scale(t)},r.push(n)}),r},t.getText=function t(e,n){var r=this.formatter;return e=r?r(e,n):e,!a(e)&&e.toString||(e=""),e.toString()},t.rangeMin=function t(){return this.range[0]},t.rangeMax=function t(){var e=this.range;return e[e.length-1]},t.invert=function t(e){return e},t.translate=function t(e){return e},t.scale=function t(e){return e},t.clone=function t(){var e=this,n=e.constructor,r={};return i(e,function(t,n){r[n]=e[n]}),new n(r)},t.change=function t(e){return this.ticks=null,r(this,e),this.init(),this},e}();t.exports=s},function(t,e,n){"use strict";e.b=w,e.a=O,e.c=j;var r=n(21),i=n(499),o=n(500),a=n(501),s=n(502),u=n(503),c=n(504),l=n(505),f=n(506),h=n(507),p=n(508),d=n(509),v=n(510),g=n(511),y=n(512),m=n(513),b=n(514),x=n(59),_=0;function w(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function O(t){return n.i(r.selection)().transition(t)}function j(){return++_}var S=r.selection.prototype;w.prototype=O.prototype={constructor:w,select:p.a,selectAll:d.a,filter:c.a,merge:l.a,selection:v.a,transition:b.a,call:S.call,nodes:S.nodes,node:S.node,size:S.size,empty:S.empty,each:S.each,on:f.a,attr:i.a,attrTween:o.a,style:g.a,styleTween:y.a,text:m.a,remove:h.a,tween:x.a,delay:a.a,duration:s.a,ease:u.a}},function(t,e,n){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,i=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},o=!0;t.exports=n(518)(i,!0)},function(t,e,n){t.exports={Axis:n(230),Component:n(62),Guide:n(238),Label:n(242),Legend:n(248),Tooltip:n(253)}},function(t,e,n){"use strict";e.b=a,e.c=s,e.a=u;var r=n(200);function i(t,e){return function(n){return t+n*e}}function o(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function a(t,e){var o=e-t;return o?i(t,o>180||o<-180?o-360*Math.round(o/360):o):n.i(r.a)(isNaN(t)?e:t)}function s(t){return 1==(t=+t)?u:function(e,i){return i-e?o(e,i,t):n.i(r.a)(isNaN(e)?i:e)}}function u(t,e){var o=e-t;return o?i(t,o):n.i(r.a)(isNaN(t)?e:t)}},function(t,e,n){var r=n(10),i=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),r(this,t)}return t._initDefaultCfg=function t(){this.adjustNames=["x","y"]},t.processAdjust=function t(){},e}();t.exports=i},function(t,e,n){var r=n(14),i=n(4),o=n(6),a=n(10),s=n(2);function u(t,e){return r(e)?e:t.invert(t.scale(e))}var c=function(){function t(t){var e=this;this.type="base",this.name=null,this.method=null,this.values=[],this.scales=[],this.linear=null;var n=null,r=this.callback;if(t.callback){var i=t.callback;n=function t(){for(var n=arguments.length,a=new Array(n),s=0;s1&&(n=(e[1].value-e[0].value)/2);for(var r=[],i=0;i0){var o=t.value-a[n-1].value;o/=e.get("subTickCount")+1;for(var u=1;u<=r;u++){var c={text:"",value:n?a[n-1].value+u*o:u*o},l=e.getTickPoint(c.value),f=void 0;f=s&&s.length?s.length:parseInt(.6*i.length,10),e._addTickItem(u-1,l,f,"sub")}}})}},n._addTickLine=function t(e,n){var r=this,i=o.mix({},n),a=[];o.each(e,function(t){a.push(["M",t.x1,t.y1]),a.push(["L",t.x2,t.y2])}),delete i.length,i.path=a;var s,u=this.get("group").addShape("path",{attrs:i});u.name="axis-ticks",u._id=this.get("_id")+"-ticks",u.set("coord",this.get("coord")),this.get("appendInfo")&&u.setSilent("appendInfo",this.get("appendInfo"))},n._renderTicks=function t(){var e=this,n=this.get("tickItems"),r=this.get("subTickItems");if(!o.isEmpty(n)){var i=this.get("tickLine");this._addTickLine(n,i)}if(!o.isEmpty(r)){var a=this.get("subTickLine")||this.get("tickLine");this._addTickLine(r,a)}},n._renderGrid=function t(){var e=this.get("grid");if(e){e.coord=this.get("coord"),e.appendInfo=this.get("appendInfo");var n=this.get("group");this.set("gridGroup",n.addGroup(a,e))}},n._renderLabels=function t(){var e=this,n=this.get("labelRenderer"),r=this.get("labelItems");n&&(n.set("items",r),n._dryDraw())},n.paint=function t(){var e=this,n=this.get("tickLine"),r=!0;n&&n.hasOwnProperty("alignWithLabel")&&(r=n.alignWithLabel),this._renderLine();var i=this.get("type"),o;("cat"===i||"timeCat"===i)&&!1===r?this._processCatTicks():this._processTicks(),this._renderTicks(),this._renderGrid(),this._renderLabels();var a=this.get("label");a&&a.autoRotate&&this.autoRotateLabels(),a&&a.autoHide&&this.autoHideLabels()},n.parseTick=function t(e,n,r){return{text:e,value:n/(r-1)}},n.getTextAnchor=function t(e){var n,r;return r=Math.abs(e[1]/e[0])>=1?"center":e[0]>0?"start":"end"},n.getMaxLabelWidth=function t(e){var n=e.getLabels(),r=0;return o.each(n,function(t){var e,n=t.getBBox().width;r1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}r.each(t,function(e,n){isNaN(e)||(t[n]=+e)}),e[n]=t}),e):void 0}}},function(t,e,n){var r=n(6);function i(t){return r(t)?"":t.toString()}t.exports=i},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function t(e){var r=void 0===e?"undefined":n(e);return null!==e&&"object"===r||"function"===r};t.exports=r},function(t,e,n){var r=n(80),i=n(15),o=function t(e){if(!r(e)||!i(e,"Object"))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n};t.exports=o},function(t,e,n){"use strict";e.b=a,e.c=s,e.a=u;var r=n(193);function i(t,e){return function(n){return t+n*e}}function o(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function a(t,e){var o=e-t;return o?i(t,o>180||o<-180?o-360*Math.round(o/360):o):n.i(r.a)(isNaN(t)?e:t)}function s(t){return 1==(t=+t)?u:function(e,i){return i-e?o(e,i,t):n.i(r.a)(isNaN(e)?i:e)}}function u(t,e){var o=e-t;return o?i(t,o):n.i(r.a)(isNaN(t)?e:t)}},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0,i=this.matrix,o=[e,n,r];return c.transformMat3(o,o,i),o}},{key:"invertMatrix",value:function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.matrix,o=u.invert([],i),a=[e,n,r];return c.transformMat3(a,a,o),a}},{key:"convert",value:function t(e){var n=this.convertPoint(e),r=n.x,i=n.y,o=this.applyMatrix(r,i,1);return{x:o[0],y:o[1]}}},{key:"invert",value:function t(e){var n=this.invertMatrix(e.x,e.y,1);return this.invertPoint({x:n[0],y:n[1]})}},{key:"rotate",value:function t(e){var n=this.matrix,r=this.center;return u.translate(n,n,[-r.x,-r.y]),u.rotate(n,n,e),u.translate(n,n,[r.x,r.y]),this}},{key:"reflect",value:function t(e){switch(e){case"x":this._swapDim("x");break;case"y":this._swapDim("y");break;default:this._swapDim("y")}return this}},{key:"scale",value:function t(e,n){var r=this.matrix,i=this.center;return u.translate(r,r,[-i.x,-i.y]),u.scale(r,r,[e,n]),u.translate(r,r,[i.x,i.y]),this}},{key:"translate",value:function t(e,n){var r=this.matrix;return u.translate(r,r,[e,n]),this}},{key:"transpose",value:function t(){return this.isTransposed=!this.isTransposed,this}}]),t}();t.exports=l},function(t,e,n){var r=n(5),i=n(0),o=i.assign,a=i.isNil,s=i.isArray,u=i.cloneDeep,c=i.wrapBehavior,l=i.getWrapBehavior,f=function(){var t=e.prototype;function e(t){var e=this.getDefaultCfg();o(this,e,t),this.init()}return t.getDefaultCfg=function t(){return{chart:null,group:null,showTitle:!0,autoSetAxis:!0,padding:10,eachView:null,fields:[],colTitle:{offsetY:-15,style:{fontSize:14,textAlign:"center",fill:"#666",fontFamily:r.fontFamily}},rowTitle:{offsetX:15,style:{fontSize:14,textAlign:"center",rotate:90,fill:"#666",fontFamily:r.fontFamily}}}},t.init=function t(){if(!this.chart)throw new Error("Facets Error: please specify the chart!");this._bindEvent(),this.initContainer(),this.chart.get("data")&&this.initViews()},t.initContainer=function t(){var e,n,r=this.chart.get("frontPlot").addGroup();this.group=r},t.initViews=function t(){for(var e=this.chart,n=e.get("data"),r=this.eachView,i=this.generateFacets(n),o=0;on&&(i=2*Math.PI-t+e,o=t-n):(i=t-e,o=n-t),i>o?n:e}function a(t,e,n,i){var a=0;return n-e>=2*Math.PI&&(a=2*Math.PI),e=r.mod(e,2*Math.PI),n=r.mod(n,2*Math.PI)+a,t=r.mod(t,2*Math.PI),i?e>=n?t>n&&tn?t:o(t,e,n):e<=n?ee||tt.x&&(v=t.x),gt.y&&(y=t.y),m0&&f>0?c=Math.PI/2-p:l<0&&f<0?c=-Math.PI/2-p:l>=0&&f<0?c=-p-Math.PI/2:l<=0&&f>0&&(c=Math.PI/2-p);var d=h(s);if(d){u&&(a?(i+=Math.sin(Math.abs(p))*u,o=o+Math.cos(Math.abs(p))*u-.5*t.lineWidth):(i-=Math.sin(Math.abs(p))*u,o=o-Math.cos(Math.abs(p))*u+.5*t.lineWidth)),t.save(),t.beginPath(),t.translate(i,o),t.rotate(c);for(var v=0;v1&&(o*=Math.sqrt(y),a*=Math.sqrt(y));var m=o*o*(g*g)+a*a*(p*p),b=Math.sqrt((o*o*(a*a)-m)/m);n===i&&(b*=-1),isNaN(b)&&(b=0);var x=b*o*g/a,_=b*-a*p/o,w=(c+f)/2+Math.cos(u)*x-Math.sin(u)*_,O=(l+h)/2+Math.sin(u)*x+Math.cos(u)*_,j=v([1,0],[(p-x)/o,(g-_)/a]),S=[(p-x)/o,(g-_)/a],E=[(-1*p-x)/o,(-1*g-_)/a],M=v(S,E);return d(S,E)<=-1&&(M=Math.PI),d(S,E)>=1&&(M=0),0===i&&M>0&&(M-=2*Math.PI),1===i&&M<0&&(M+=2*Math.PI),[t,w,O,o,a,j,M,u,i]}var y=function t(e,n,r){this.preSegment=n,this.isLast=r,this.init(e,n)};r.augment(y,{init:function t(e,n){var i=e[0];n=n||{endPoint:{x:0,y:0}};var o=l.indexOf(i)>=0,a=o?i.toUpperCase():i,s=e,u,c,p,d,v=n.endPoint,y=s[1],m=s[2];switch(a){default:break;case"M":d=o?f(y,m,v):{x:y,y:m},this.command="M",this.params=[v,d],this.subStart=d,this.endPoint=d;break;case"L":d=o?f(y,m,v):{x:y,y:m},this.command="L",this.params=[v,d],this.subStart=n.subStart,this.endPoint=d,this.endTangent=function(){return[d.x-v.x,d.y-v.y]},this.startTangent=function(){return[v.x-d.x,v.y-d.y]};break;case"H":d=o?f(y,0,v):{x:y,y:v.y},this.command="L",this.params=[v,d],this.subStart=n.subStart,this.endPoint=d,this.endTangent=function(){return[d.x-v.x,d.y-v.y]},this.startTangent=function(){return[v.x-d.x,v.y-d.y]};break;case"V":d=o?f(0,y,v):{x:v.x,y:y},this.command="L",this.params=[v,d],this.subStart=n.subStart,this.endPoint=d,this.endTangent=function(){return[d.x-v.x,d.y-v.y]},this.startTangent=function(){return[v.x-d.x,v.y-d.y]};break;case"Q":o?(u=f(y,m,v),c=f(s[3],s[4],v)):(u={x:y,y:m},c={x:s[3],y:s[4]}),this.command="Q",this.params=[v,u,c],this.subStart=n.subStart,this.endPoint=c,this.endTangent=function(){return[c.x-u.x,c.y-u.y]},this.startTangent=function(){return[v.x-u.x,v.y-u.y]};break;case"T":c=o?f(y,m,v):{x:y,y:m},"Q"===n.command?(u=h(n.params[1],v),this.command="Q",this.params=[v,u,c],this.subStart=n.subStart,this.endPoint=c,this.endTangent=function(){return[c.x-u.x,c.y-u.y]},this.startTangent=function(){return[v.x-u.x,v.y-u.y]}):(this.command="TL",this.params=[v,c],this.subStart=n.subStart,this.endPoint=c,this.endTangent=function(){return[c.x-v.x,c.y-v.y]},this.startTangent=function(){return[v.x-c.x,v.y-c.y]});break;case"C":o?(u=f(y,m,v),c=f(s[3],s[4],v),p=f(s[5],s[6],v)):(u={x:y,y:m},c={x:s[3],y:s[4]},p={x:s[5],y:s[6]}),this.command="C",this.params=[v,u,c,p],this.subStart=n.subStart,this.endPoint=p,this.endTangent=function(){return[p.x-c.x,p.y-c.y]},this.startTangent=function(){return[v.x-u.x,v.y-u.y]};break;case"S":o?(c=f(y,m,v),p=f(s[3],s[4],v)):(c={x:y,y:m},p={x:s[3],y:s[4]}),"C"===n.command?(u=h(n.params[2],v),this.command="C",this.params=[v,u,c,p],this.subStart=n.subStart,this.endPoint=p,this.endTangent=function(){return[p.x-c.x,p.y-c.y]},this.startTangent=function(){return[v.x-u.x,v.y-u.y]}):(this.command="SQ",this.params=[v,c,p],this.subStart=n.subStart,this.endPoint=p,this.endTangent=function(){return[p.x-c.x,p.y-c.y]},this.startTangent=function(){return[v.x-c.x,v.y-c.y]});break;case"A":var b=y,x=m,_=s[3],w=s[4],O=s[5];d=o?f(s[6],s[7],v):{x:s[6],y:s[7]},this.command="A";var j=g(v,d,w,O,b,x,_);this.params=j;var S=n.subStart;this.subStart=S,this.endPoint=d;var E=j[5]%(2*Math.PI);r.isNumberEqual(E,2*Math.PI)&&(E=0);var M=j[6]%(2*Math.PI);r.isNumberEqual(M,2*Math.PI)&&(M=0);var C=.001;this.startTangent=function(){0===O&&(C*=-1);var t=j[3]*Math.cos(E-C)+j[1],e=j[4]*Math.sin(E-C)+j[2];return[t-S.x,e-S.y]},this.endTangent=function(){var t=j[6];t-2*Math.PI<1e-4&&(t=0);var e=j[3]*Math.cos(E+t+C)+j[1],n=j[4]*Math.sin(E+t-C)+j[2];return[v.x-e,v.y-n]};break;case"Z":this.command="Z",this.params=[v,n.subStart],this.subStart=n.subStart,this.endPoint=n.subStart}},isInside:function t(e,n,r){var o=this,a=this.command,s=this.params,l=this.box;if(l&&!i.box(l.minX,l.maxX,l.minY,l.maxY,e,n))return!1;switch(a){default:break;case"M":return!1;case"TL":case"L":case"Z":return i.line(s[0].x,s[0].y,s[1].x,s[1].y,r,e,n);case"SQ":case"Q":return i.quadraticline(s[0].x,s[0].y,s[1].x,s[1].y,s[2].x,s[2].y,r,e,n);case"C":return i.cubicline(s[0].x,s[0].y,s[1].x,s[1].y,s[2].x,s[2].y,s[3].x,s[3].y,r,e,n);case"A":var f=s,h=f[1],p=f[2],d=f[3],v=f[4],g=f[5],y=f[6],m=f[7],b=f[8],x=d>v?d:v,_=d>v?1:d/v,w=d>v?v/d:1;f=[e,n,1];var O=[1,0,0,0,1,0,0,0,1];return c.translate(O,O,[-h,-p]),c.rotate(O,O,-m),c.scale(O,O,[1/_,1/w]),u.transformMat3(f,f,O),i.arcline(0,0,x,g,g+y,1-b,r,f[0],f[1])}return!1},draw:function t(e){var n=this.command,r=this.params,i,o,a;switch(n){default:break;case"M":e.moveTo(r[1].x,r[1].y);break;case"TL":case"L":e.lineTo(r[1].x,r[1].y);break;case"SQ":case"Q":i=r[1],o=r[2],e.quadraticCurveTo(i.x,i.y,o.x,o.y);break;case"C":i=r[1],o=r[2],a=r[3],e.bezierCurveTo(i.x,i.y,o.x,o.y,a.x,a.y);break;case"A":var s=r,u,c,l=s[1],f=s[2],h=s[3],p=s[4],d=s[5],v=s[6],g=s[7],y=s[8],m=h>p?h:p,b=h>p?1:h/p,x=h>p?p/h:1;e.translate(l,f),e.rotate(g),e.scale(b,x),e.arc(0,0,m,d,d+v,1-y),e.scale(1/b,1/x),e.rotate(-g),e.translate(-l,-f);break;case"Z":e.closePath()}},getBBox:function t(e){var n=e/2,r=this.params,i,u,c,l;switch(this.command){default:case"M":case"Z":break;case"TL":case"L":this.box={minX:Math.min(r[0].x,r[1].x)-n,maxX:Math.max(r[0].x,r[1].x)+n,minY:Math.min(r[0].y,r[1].y)-n,maxY:Math.max(r[0].y,r[1].y)+n};break;case"SQ":case"Q":for(c=0,l=(u=a.extrema(r[0].x,r[1].x,r[2].x)).length;cj&&(j=M)}var C=s.yExtrema(m,d,v),P=1/0,k=-1/0,T=[x,_];for(c=2*-Math.PI;c<=2*Math.PI;c+=Math.PI){var A=C+c;1===b?xk&&(k=I)}this.box={minX:O-n,maxX:j+n,minY:P-n,maxY:k+n}}}}),t.exports=y},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(6),o=n(2),a=n(26),s=n(331),u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function e(){t.prototype._initDefaultCfg.call(this);var n=this;this.type="linear",this.isLinear=!0,this.nice=!1,this.min=null,this.minLimit=null,this.max=null,this.maxLimit=null,this.tickCount=null,this.tickInterval=null,this.minTickInterval=null,this.snapArray=null},n.init=function t(){var e=this;if(this.ticks){var n=this.ticks,r=this.translate(n[0]),o=this.translate(n[n.length-1]);(i(this.min)||this.min>r)&&(this.min=r),(i(this.max)||this.max=e.min&&t<=e.max&&r.push(t)}),r.length||(r.push(e.min),r.push(e.max)),e.ticks=r}},n.scale=function t(e){if(i(e))return NaN;var n=this.max,r=this.min;if(n===r)return 0;var o=(e-r)/(n-r),a=this.rangeMin(),s;return a+o*(this.rangeMax()-a)},n.invert=function t(e){var n=(e-this.rangeMin())/(this.rangeMax()-this.rangeMin());return this.min+n*(this.max-this.min)},e}(a);a.Linear=u,t.exports=u},function(t,e,n){var r=n(20),i=Array.prototype.indexOf,o=function t(e,n){return!!r(e)&&i.call(e,n)>-1};t.exports=o},function(t,e){var n=function t(e){for(var n=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:1e-5;return Math.abs(e-n)1&&void 0!==arguments[1]?arguments[1]:[],r={};return i.Util.each(e,function(t,e){-1===i.Util.indexOf(n,e)&&(r[e]=t)}),r},length:a})},function(t,e,n){"use strict";e.a=function(t,e){return e-=t=+t,function(n){return t+e*n}}},function(t,e,n){"use strict";e.a=function(t,e){return e-=t=+t,function(n){return t+e*n}}},function(t,e,n){"use strict";var r=n(90),i=n(91);function o(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===i.b&&e.documentElement.namespaceURI===i.b?e.createElement(t):e.createElementNS(n,t)}}function a(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}e.a=function(t){var e=n.i(r.a)(t);return(e.local?a:o)(e)}},function(t,e,n){"use strict";e.a=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}},function(t,e,n){"use strict";e.b=a;var r=n(17);function i(t,e){var i,o;return function(){var a=n.i(r.e)(this,t),s=a.tween;if(s!==i)for(var u=0,c=(o=i=s).length;u1&&(e=parseInt(e,10),n=parseInt(n,10)),r.attr("text",this._formatItemValue(e)+""),i.attr("text",this._formatItemValue(n)+"")},n._onMouseLeave=function t(){var e=this.get("group").findById("hoverPointer");e&&e.destroy();var n=this.get("group").findById("hoverText");n&&n.destroy(),this.get("canvas").draw()},n._onMouseMove=function t(e){var n=this.get("height"),r=this.get("width"),i=this.get("items"),o,a=this.get("canvas").get("el").getBoundingClientRect(),s=this.get("group").getBBox(),u;if("vertical"===this.get("layout")){var c=5;"color-legend"===this.get("type")&&(c=30);var l=this.get("titleGap"),f=this.get("titleShape");f&&(l+=f.getBBox().maxY-f.getBBox().minY);var h=e.clientY||e.event.clientY;h=h-a.y-this.get("group").attr("matrix")[7]+s.y-c+l,u=i[0].value+(1-h/n)*(i[i.length-1].value-i[0].value)}else{var p=e.clientX||e.event.clientX;p=p-a.x-this.get("group").attr("matrix")[6],u=i[0].value+p/r*(i[i.length-1].value-i[0].value)}u=u.toFixed(2),this.activate(u),this.emit("mousehover",{value:u})},n.activate=function t(e){if(e){var n=this.get("group").findById("hoverPointer"),r=this.get("group").findById("hoverText"),o=this.get("items");if(!(eo[o.length-1].value)){var a=this.get("height"),s=this.get("width"),u=this.get("titleShape"),c=this.get("titleGap"),l=[],f=(e-o[0].value)/(o[o.length-1].value-o[0].value),h;if("vertical"===this.get("layout")){var p=0,d=0;"color-legend"===this.get("type")&&(p=c,u&&(p+=u.getBBox().height)),this.get("slidable")&&("color-legend"===this.get("type")?p-=13:(p=c-15,u&&(p+=u.getBBox().height)),d+=10),l=[[d,(f=(1-f)*a)+p],[d-10,f+p-5],[d-10,f+p+5]],h=i.mix({},{x:s+this.get("textOffset")/2+d,y:f+p,text:this._formatItemValue(e)+""},this.get("textStyle"),{textAlign:"start"})}else{var v=0,g=0;"color-legend"===this.get("type")&&(v=c,u&&(v+=u.getBBox().height)),this.get("slidable")&&("color-legend"===this.get("type")?v-=7:(v=c,u||(v-=7)),g+=10),l=[[(f*=s)+g,v],[f+g-5,v-10],[f+g+5,v-10]],h=i.mix({},{x:f-5,y:a+this.get("textOffset")+v,text:this._formatItemValue(e)+""},this.get("textStyle"))}var y=i.mix(h,this.get("hoverTextStyle"));r?r.attr(y):(r=this.get("group").addShape("text",{attrs:y})).set("id","hoverText"),n?n.attr(i.mix({points:l},this.get("pointerStyle"))):(n=this.get("group").addShape("Polygon",{attrs:i.mix({points:l},this.get("pointerStyle"))})).set("id","hoverPointer"),this.get("canvas").draw()}}},n.deactivate=function t(){var e=this.get("group").findById("hoverPointer");e&&e.destroy();var n=this.get("group").findById("hoverText");n&&n.destroy(),this.get("canvas").draw()},e}(o);t.exports=h},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(62),o=n(3),a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return o.mix({},n,{x:0,y:0,items:null,titleContent:null,showTitle:!0,plotRange:null,offset:10,timeStamp:0,inPlot:!0,crosshairs:null})},n.isContentChange=function t(e,n){var r=this.get("titleContent"),i=this.get("items"),a=!(e===r&&i.length===n.length);return a||o.each(n,function(t,e){var n=i[e];for(var r in t)if(t.hasOwnProperty(r)&&!o.isObject(t[r])&&t[r]!==n[r]){a=!0;break}if(a)return!1}),a},n.setContent=function t(e,n){var r=(new Date).valueOf();return this.set("items",n),this.set("titleContent",e),this.set("timeStamp",r),this.render(),this},n.setPosition=function t(e,n){this.set("x",e),this.set("y",n)},n.render=function t(){},n.clear=function t(){},n.show=function t(){this.set("visible",!0)},n.hide=function t(){this.set("visible",!1)},n.destroy=function t(){},e}(i);t.exports=a},function(t,e,n){var r=n(144),i=n(25),o=n(112),a=n(114),s=n(5),u=n(9),c=n(0),l={version:s.version,Animate:o,Chart:a,Global:s,Scale:r,Shape:u,Util:c,G:i,DomUtil:c.DomUtil,MatrixUtil:c.MatrixUtil,PathUtil:c.PathUtil,track:function(){console.warn("G2 tracks nothing ;-)")}};"undefined"!=typeof window&&(window.G2?console.warn("There are multiple versions of G2. Version "+l.version+"'s reference is 'window.G2_3'"):window.G2=l),t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=n(25).Group,a,s=n(29).Label,u=n(5),c=n(0),l=["line","point","path"],f="_origin";function h(t){var e=0;return c.each(t,function(t){e+=t}),e/t.length}function p(t,e){for(var n=-1,r=0,i=0,o,a=t.length-1,s,u=0;++n0&&n.lineToLabel(t)})},n.lineToLabel=function t(){},n.getLabelPoint=function t(e,n,r){var i=this,o=this.get("coord"),a=e.text.length;function s(t,n){return c.isArray(t)&&(t=1===e.text.length?t.length<=2?t[t.length-1]:h(t):t[n]),t}var u={text:e.text[r]};if(n&&"polygon"===this.get("geomType")){var l=p(n.x,n.y);u.x=l[0],u.y=l[1]}else u.x=s(n.x,r),u.y=s(n.y,r);if(n&&n.nextPoints&&("funnel"===n.shape||"pyramid"===n.shape)){var f=-1/0;n.nextPoints.forEach(function(t){(t=o.convert(t)).x>f&&(f=t.x)}),u.x=(u.x+f)/2}"pyramid"===n.shape&&!n.nextPoints&&n.points&&n.points.forEach(function(t){t=o.convert(t),(c.isArray(t.x)&&-1===n.x.indexOf(t.x)||c.isNumber(t.x)&&n.x!==t.x)&&(u.x=(u.x+t.x)/2)}),e.position&&this.setLabelPosition(u,n,r,e.position);var d=this.getLabelOffset(e,r,a);return e.offsetX&&(d.x+=e.offsetX),e.offsetY&&(d.y+=e.offsetY),this.transLabelPoint(u),u.start={x:u.x,y:u.y},u.x+=d.x,u.y+=d.y,u.color=n.color,u},n.setLabelPosition=function t(){},n.transLabelPoint=function t(e){var n=this,r,i=this.get("coord").applyMatrix(e.x,e.y,1);e.x=i[0],e.y=i[1]},n.getOffsetVector=function t(e){var n=this,r=e.offset||0,i=this.get("coord"),o;return o=i.isTransposed?i.applyMatrix(r,0):i.applyMatrix(0,r)},n.getDefaultOffset=function t(e){var n=this,r=0,i=this.get("coord"),o=this.getOffsetVector(e);return r=i.isTransposed?o[0]:o[1]},n.getLabelOffset=function t(e,n,r){var i=this,o=this.getDefaultOffset(e),a,s=this.get("coord").isTransposed,u=s?"x":"y",c=s?1:-1,l={x:0,y:0};return l[u]=n>0||1===r?o*c:o*c*-1,l},n.getLabelAlign=function t(e,n,r){var i=this,o="center",a;if(this.get("coord").isTransposed){var s=this.getDefaultOffset(e);o=s<0?"right":0===s?"center":"left",r>1&&0===n&&("right"===o?o="left":"left"===o&&(o="right"))}return o},n._getLabelValue=function t(e,n){c.isArray(n)||(n=[n]);var r=[];return c.each(n,function(t){var n=e[t.field];if(c.isArray(n)){var i=[];c.each(n,function(e){i.push(t.getText(e))}),n=i}else n=t.getText(n);(c.isNil(n)||""===n)&&r.push(null),r.push(n)}),r},n._getLabelCfgs=function t(e){var n=this,r=this.get("labelCfg"),i=r.scales,o=this.get("label"),a=[];r.globalCfg&&r.globalCfg.type&&n.set("type",r.globalCfg.type),c.each(e,function(t,e){var s={},u=t._origin,l=n._getLabelValue(u,i);if(r.callback){var f=i.map(function(t){return u[t.field]});s=r.callback.apply(null,f)}if(s||0===s){if(c.isString(s)||c.isNumber(s)?s={text:s}:(s.text=s.content||l[0],delete s.content),s=c.mix({},o,r.globalCfg||{},s),t.point=u,s.htmlTemplate&&(s.useHtml=!0,s.text=s.htmlTemplate.call(null,s.text,t,e),delete s.htmlTemplate),s.formatter&&(s.text=s.formatter.call(null,s.text,t,e),delete s.formatter),s.label){var h=s.label;delete s.label,s=c.mix(s,h)}if(s.textStyle){delete s.textStyle.offset;var p=s.textStyle;c.isFunction(p)&&(s.textStyle=p.call(null,s.text,t,e))}s.labelLine&&(s.labelLine=c.mix({},o.labelLine,s.labelLine)),s.textStyle=c.mix({},o.textStyle,s.textStyle),delete s.items,a.push(s)}else a.push(null)}),this.set("labelItemCfgs",a)},n.showLabels=function t(e,n){var r=this,i=this.get("labelRenderer"),o=this.getLabelsItems(e,n);n=[].concat(n);var a=this.get("type");o=this.adjustItems(o,n),this.drawLines(o),i.set("items",o.filter(function(t,e){return!!t||(n.splice(e,1),!1)})),a&&(i.set("shapes",n),i.set("type",a),i.set("points",e)),i.set("canvas",this.get("canvas")),i.draw()},n.destroy=function e(){this.get("labelRenderer").destroy(),t.prototype.destroy.call(this)},e}(o);t.exports=d},function(t,e,n){var r=n(5),i=n(0);function o(t,e){var n=t.length;i.isString(t[0])&&(t=t.map(function(t){return e.translate(t)}));for(var r=t[1]-t[0],o=2;oa&&(r=a)}return r}var a={getDefaultSize:function t(){var e=this.get("defaultSize"),n=this.get("viewTheme")||r;if(!e){var i=this.get("coord"),a=this.getXScale(),s=a.values,u=this.get("dataArray"),c;if(a.isLinear&&s.length>1){s.sort();var l=o(s,a);c=(a.max-a.min)/l,s.length>c&&(c=s.length)}else c=s.length;var f=a.range,h=1/c,p=1,d;if(this.isInCircle()?p=i.isTransposed&&c>1?n.widthRatio.multiplePie:n.widthRatio.rose:(a.isLinear&&(h*=f[1]-f[0]),p=n.widthRatio.column),h*=p,this.hasAdjust("dodge"))h/=this._getDodgeCount(u);e=h,this.set("defaultSize",e)}return e},_getDodgeCount:function t(e){var n=this.get("adjusts"),r,o=e.length;if(i.each(n,function(t){"dodge"===t.type&&(r=t.dodgeBy)}),r){var a=i.Array.merge(e),s;o=i.Array.values(a,r).length}return o},getDimWidth:function t(e){var n=this.get("coord"),r=n.convertPoint({x:0,y:0}),i=n.convertPoint({x:"x"===e?1:0,y:"x"===e?0:1}),o=0;return r&&i&&(o=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2))),o},_getWidth:function t(){var e=this.get("coord"),n;return n=this.isInCircle()&&!e.isTransposed?(e.endAngle-e.startAngle)*e.radius:this.getDimWidth("x")},_toNormalizedSize:function t(e){var n;return e/this._getWidth()},_toCoordSize:function t(e){var n;return this._getWidth()*e},getNormalizedSize:function t(e){var n=this.getAttrValue("size",e);return n=i.isNil(n)?this.getDefaultSize():this._toNormalizedSize(n)},getSize:function t(e){var n=this.getAttrValue("size",e);if(i.isNil(n)){var r=this.getDefaultSize();n=this._toCoordSize(r)}return n}};t.exports=a},function(t,e,n){var r=n(1),i=n(7),o=n(36),a=n(47),s=function t(e){t.superclass.constructor.call(this,e)};s.Symbols={circle:function t(e,n,r){return[["M",e,n],["m",-r,0],["a",r,r,0,1,0,2*r,0],["a",r,r,0,1,0,2*-r,0]]},square:function t(e,n,r){return[["M",e-r,n-r],["L",e+r,n-r],["L",e+r,n+r],["L",e-r,n+r],["Z"]]},diamond:function t(e,n,r){return[["M",e-r,n],["L",e,n-r],["L",e+r,n],["L",e,n+r],["Z"]]},triangle:function t(e,n,r){var i=r*Math.sin(1/3*Math.PI);return[["M",e-r,n+i],["L",e,n-i],["L",e+r,n+i],["z"]]},"triangle-down":function t(e,n,r){var i=r*Math.sin(1/3*Math.PI);return[["M",e-r,n-i],["L",e+r,n-i],["L",e,n+i],["Z"]]}},s.ATTRS={path:null,lineWidth:1},r.extend(s,i),r.augment(s,{type:"marker",canFill:!0,canStroke:!0,getDefaultAttrs:function t(){return{x:0,y:0,lineWidth:1}},calculateBox:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.radius,o,a=this.getHitLineWidth()/2+i;return{minX:n-a,minY:r-a,maxX:n+a,maxY:r+a}},_getPath:function t(){var e=this._attrs,n=e.x,i=e.y,o=e.radius||e.r,a=e.symbol||"circle",u;return(u=r.isFunction(a)?a:s.Symbols[a])(n,i,o)},createPath:function t(e){var n=this._cfg.segments;if(!n||this._cfg.hasUpdate){var r=o.parsePath(this._getPath()),i;e.beginPath(),n=[];for(var s=0;s=0&&m=0&&c<=1&&u.push(c);else{var h=a*a-4*o*s;r.isNumberEqual(h,0)?u.push(-a/(2*o)):h>0&&(l=(-a-(f=Math.sqrt(h)))/(2*o),(c=(-a+f)/(2*o))>=0&&c<=1&&u.push(c),l>=0&&l<=1&&u.push(l))}return u}function c(t,e,n,r,i){var o,a;return t*(t*(-3*e+9*n-9*r+3*i)+6*e-12*n+6*r)-3*e+3*n}function l(t,e,n,i,o,a,s,u,l){r.isNil(l)&&(l=1);for(var f=(l=l>1?1:l<0?0:l)/2,h=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],v=0,g=0;g2&&(r.push([e].concat(o.splice(0,2))),s="l",e="m"===e?"l":"L"),"o"===s&&1===o.length&&r.push([e,o[0]]),"r"===s)r.push([e].concat(o));else for(;o.length>=n[s]&&(r.push([e].concat(o.splice(0,n[s]))),n[s]););}),r},u=function t(e,n){for(var r=[],i=0,o=e.length;o-2*!n>i;i+=2){var a=[{x:+e[i-2],y:+e[i-1]},{x:+e[i],y:+e[i+1]},{x:+e[i+2],y:+e[i+3]},{x:+e[i+4],y:+e[i+5]}];n?i?o-4===i?a[3]={x:+e[0],y:+e[1]}:o-2===i&&(a[2]={x:+e[0],y:+e[1]},a[3]={x:+e[2],y:+e[3]}):a[0]={x:+e[o-2],y:+e[o-1]}:o-4===i?a[3]=a[2]:i||(a[0]={x:+e[i],y:+e[i+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r},c=function t(e,n,r,i,o){var a=[];if(null===o&&null===i&&(i=r),e=+e,n=+n,r=+r,i=+i,null!==o){var s=Math.PI/180,u=e+r*Math.cos(-i*s),c=e+r*Math.cos(-o*s),l,f;a=[["M",u,n+r*Math.sin(-i*s)],["A",r,r,0,+(o-i>180),0,c,n+r*Math.sin(-o*s)]]}else a=[["M",e,n],["m",0,-i],["a",r,i,0,1,1,0,2*i],["a",r,i,0,1,1,0,-2*i],["z"]];return a},l=function t(e){if(!(e=s(e))||!e.length)return[["M",0,0]];var n=[],r=0,i=0,o=0,a=0,l=0,f,h;"M"===e[0][0]&&(o=r=+e[0][1],a=i=+e[0][2],l++,n[0]=["M",r,i]);for(var p=3===e.length&&"M"===e[0][0]&&"R"===e[1][0].toUpperCase()&&"Z"===e[2][0].toUpperCase(),d,v,g=l,y=e.length;g1&&(r*=w=Math.sqrt(w),i*=w);var O=r*r,j=i*i,S=(a===s?-1:1)*Math.sqrt(Math.abs((O*j-O*_*_-j*x*x)/(O*_*_+j*x*x)));y=S*r*_/i+(e+u)/2,m=S*-i*x/r+(n+c)/2,v=Math.asin(((n-m)/i).toFixed(9)),g=Math.asin(((c-m)/i).toFixed(9)),v=eg&&(v-=2*Math.PI),!s&&g>v&&(g-=2*Math.PI)}var E=g-v;if(Math.abs(E)>f){var M=g,C=u,P=c;g=v+f*(s&&g>v?1:-1),p=t(u=y+r*Math.cos(g),c=m+i*Math.sin(g),r,i,o,0,s,C,P,[g,M,y,m])}E=g-v;var k=Math.cos(v),T=Math.sin(v),A=Math.cos(g),I=Math.sin(g),L=Math.tan(E/4),N=4/3*r*L,D=4/3*i*L,R=[e,n],F=[e+N*T,n-D*k],z=[u+N*I,c-D*A],B=[u,c];if(F[0]=2*R[0]-F[0],F[1]=2*R[1]-F[1],l)return[F,z,B].concat(p);for(var Y=[],V=0,W=(p=[F,z,B].concat(p).join().split(",")).length;V7){e[n].shift();for(var o=e[n];o.length;)s[n]="A",i&&(u[n]="A"),e.splice(n++,0,["C"].concat(o.splice(0,6)));e.splice(n,1),v=Math.max(r.length,i&&i.length||0)}},m=function t(e,n,o,a,s){e&&n&&"M"===e[s][0]&&"M"!==n[s][0]&&(n.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=e[s][1],o.y=e[s][2],v=Math.max(r.length,i&&i.length||0))};v=Math.max(r.length,i&&i.length||0);for(var b=0;b1?1:c<0?0:c)/2,f=12,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,v=0;v0&&d<1&&c.push(d)}else{var g=h*h-4*p*f,y=Math.sqrt(g);if(!(g<0)){var m=(-h+y)/(2*f);m>0&&m<1&&c.push(m);var b=(-h-y)/(2*f);b>0&&b<1&&c.push(b)}}for(var x=c.length,_=x,w;x--;)w=1-(d=c[x]),l[0][x]=w*w*w*e+3*w*w*d*r+3*w*d*d*o+d*d*d*s,l[1][x]=w*w*w*n+3*w*w*d*i+3*w*d*d*a+d*d*d*u;return l[0][_]=e,l[1][_]=n,l[0][_+1]=s,l[1][_+1]=u,l[0].length=l[1].length=_+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}},x=function t(e,n,r,i,o,a,s,u){if(!(Math.max(e,r)Math.max(o,s)||Math.max(n,i)Math.max(a,u))){var c,l,f=(e-r)*(a-u)-(n-i)*(o-s);if(f){var h=((e*i-n*r)*(o-s)-(e-r)*(o*u-a*s))/f,p=((e*i-n*r)*(a-u)-(n-i)*(o*u-a*s))/f,d=+h.toFixed(2),v=+p.toFixed(2);if(!(d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(o,s).toFixed(2)||d>+Math.max(o,s).toFixed(2)||v<+Math.min(n,i).toFixed(2)||v>+Math.max(n,i).toFixed(2)||v<+Math.min(a,u).toFixed(2)||v>+Math.max(a,u).toFixed(2)))return{x:h,y:p}}}},_=function t(e,n,r){return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height},w=function t(e,n,r,i,o){if(o)return[["M",+e+ +o,n],["l",r-2*o,0],["a",o,o,0,0,1,o,o],["l",0,i-2*o],["a",o,o,0,0,1,-o,o],["l",2*o-r,0],["a",o,o,0,0,1,-o,-o],["l",0,2*o-i],["a",o,o,0,0,1,o,-o],["z"]];var a=[["M",e,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return a.parsePathArray=g,a},O=function t(e,n,r,i){return null===e&&(e=n=r=i=0),null===n&&(n=e.y,r=e.width,i=e.height,e=e.x),{x:e,y:n,width:r,w:r,height:i,h:i,x2:e+r,y2:n+i,cx:e+r/2,cy:n+i/2,r1:Math.min(r,i)/2,r2:Math.max(r,i)/2,r0:Math.sqrt(r*r+i*i)/2,path:w(e,n,r,i),vb:[e,n,r,i].join(" ")}},j=function t(e,n){return e=O(e),n=O(n),_(n,e.x,e.y)||_(n,e.x2,e.y)||_(n,e.x,e.y2)||_(n,e.x2,e.y2)||_(e,n.x,n.y)||_(e,n.x2,n.y)||_(e,n.x,n.y2)||_(e,n.x2,n.y2)||(e.xn.x||n.xe.x)&&(e.yn.y||n.ye.y)},S=function t(e,n,i,o,a,s,u,c){r.isArray(e)||(e=[e,n,i,o,a,s,u,c]);var l=b.apply(null,e);return O(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},E=function t(e,n,r,i,o,a,s,u,c){var l=1-c,f=Math.pow(l,3),h=Math.pow(l,2),p=c*c,d=p*c,v,g,y=e+2*c*(r-e)+p*(o-2*r+e),m=n+2*c*(i-n)+p*(a-2*i+n),b=r+2*c*(o-r)+p*(s-2*o+r),x=i+2*c*(a-i)+p*(u-2*a+i),_,w,O,j,S;return{x:f*e+3*h*c*r+3*l*c*c*o+d*s,y:f*n+3*h*c*i+3*l*c*c*a+d*u,m:{x:y,y:m},n:{x:b,y:x},start:{x:l*e+c*r,y:l*n+c*i},end:{x:l*o+c*s,y:l*a+c*u},alpha:90-180*Math.atan2(y-b,m-x)/Math.PI}},M=function t(e,n,r){var i=S(e),o=S(n);if(!j(i,o))return r?0:[];for(var a,s,u=~~(m.apply(0,e)/8),c=~~(m.apply(0,n)/8),l=[],f=[],h={},p=r?0:[],d=0;d=0&&A<=1&&I>=0&&I<=1&&(r?p++:p.push({x:T.x,y:T.y,t1:A,t2:I}))}}return p},C=function t(e,n,r){var i,o,a,s,u,c,l,f,h,p;e=d(e),n=d(n);for(var v=r?0:[],g=0,y=e.length;g=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])})}var A=function t(e,n,r){if(1===r)return[[].concat(e)];var i=[];if("L"===n[0]||"C"===n[0]||"Q"===n[0])i=i.concat(T(e,n,r));else{var o=[].concat(e);"M"===o[0]&&(o[0]="L");for(var a=0;a<=r-1;a++)i.push(o)}return i},I=function t(e,n){if(1===e.length)return e;var r=e.length-1,i=n.length-1,o=r/i,a=[];if(1===e.length&&"M"===e[0][0]){for(var s=0;s=0;h--)s=a[h].index,"add"===a[h].type?e.splice(s,0,[].concat(e[s])):e.splice(s,1)}var p=o-(i=e.length);if(i0)){e[i]=n[i];break}r=F(r,e[i-1],1)}e[i]=["Q"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"T":e[i]=["T"].concat(r[0]);break;case"C":if(r.length<3){if(!(i>0)){e[i]=n[i];break}r=F(r,e[i-1],2)}e[i]=["C"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(r.length<2){if(!(i>0)){e[i]=n[i];break}r=F(r,e[i-1],1)}e[i]=["S"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;default:e[i]=n[i]}return e};t.exports={parsePathString:s,parsePathArray:g,pathTocurve:d,pathToAbsolute:l,catmullRomToBezier:u,rectPath:w,fillPath:I,fillPathByDiff:R,formatPath:B,intersection:P}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=a,e.toRadian=u,e.equals=c;var r=e.EPSILON=1e-6,i=e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,o=e.RANDOM=Math.random;function a(t){e.ARRAY_TYPE=i=t}var s=Math.PI/180;function u(t){return t*s}function c(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))}},function(t,e,n){var r=n(6),i=n(4),o=n(2);t.exports=function t(e,n){for(var a=[],s={},u=0;ur?r:e};t.exports=n},function(t,e,n){var r=n(328);r.translate=function(t,e,n){var i=new Array(9);return r.fromTranslation(i,n),r.multiply(t,i,e)},r.rotate=function(t,e,n){var i=new Array(9);return r.fromRotation(i,n),r.multiply(t,i,e)},r.scale=function(t,e,n){var i=new Array(9);return r.fromScaling(i,n),r.multiply(t,i,e)},t.exports=r},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function t(e){return"object"===(void 0===e?"undefined":n(e))&&null!==e};t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={Chart:"deleteChart",Coord:"deleteCoord",Geom:"deleteGeom",Axis:"deleteAxis",Tooltip:"deleteTooltip",Legend:"deleteLegend",Label:"deleteLabel",View:"deleteView",Guide:"deleteGuide",GuideLine:"deleteTypedGuide",GuideImage:"deleteTypedGuide",GuideText:"deleteTypedGuide",GuideRegion:"deleteTypedGuide",GuideHtml:"deleteTypedGuide",GuideArc:"deleteTypedGuide",GuideRegionFilter:"deleteTypedGuide",GuideDataMarker:"deleteTypedGuide",GuideDataRegion:"deleteTypedGuide",Facet:"deleteFacet"},i={merge:function t(e,n,r,i){this.mergeDelete(e,n,r),this.mergeUpdate(e,i)},mergeDelete:function t(e,n,i){var o=this;Object.keys(n).forEach(function(t){var n=r[i[t].name],a=e;i[t].viewId&&(a=e.views[i[t].viewId]),o[n]&&o[n](a,t,i[t].parentInfo.id)})},deleteAxis:function t(e,n){e&&delete e.axises[n]},deleteTooltip:function t(e){e&&delete e.tooltip},deleteCoord:function t(e){e&&delete e.coord},deleteLegend:function t(e,n){e&&delete e.legends[n]},deleteGuide:function t(e){e&&delete e.guide},deleteGeom:function t(e,n){e&&e.geoms&&delete e.geoms[n]},deleteLabel:function t(e,n,r){e&&e.geoms&&e.geoms[r]&&delete e.geoms[r].label},deleteFacet:function t(e){e&&delete e.facet},deleteTypedGuide:function t(e,n){e&&e.guide&&delete e.guide.elements[n]},deleteView:function t(e,n){e&&delete e.views[n]},mergeUpdate:function t(e,n){this.mergeChart(e,n),this.mergeAxises(e,n),this.mergeCoord(e,n),this.mergeGeoms(e.geoms,n),this.mergeLegends(e.legends,n),this.mergeTooltip(e,n),this.mergeViews(e.views,n),this.mergeGuide(e.guide,n)},mergeChart:function t(e,n){e.chart&&e.chart.updateProps&&(e.chart.props=e.chart.updateProps),n&&delete e.chart.g2Instance},mergeAxises:function t(e,n){var r=e.axises;if(null!=!r)for(var i in r)r[i]&&r[i].updateProps&&(r[i].props=r[i].updateProps),n&&delete r[i].g2Instance},mergeTooltip:function t(e,n){e.tooltip&&(n&&delete e.tooltip.g2Instance,e.tooltip.updateProps&&(e.tooltip.props=e.tooltip.updateProps))},mergeCoord:function t(e,n){e.coord&&(n&&delete e.coord.g2Instance,e.coord.updateProps&&(e.coord.props=e.coord.updateProps))},mergeLegends:function t(e,n){if(e)for(var r in e)if(e[r]){var i=e[r];n&&delete i.g2Instance,i.updateProps&&(i.props=i.updateProps)}},mergeGeoms:function t(e,n){if(null!=e)for(var r in e)e[r]&&(n&&(delete e[r].g2Instance,e[r].label&&e[r].label.g2Instance&&(e[r].label.updateProps&&(e[r].label.props=e[r].label.updateProps),delete e[r].label.g2Instance)),e[r].updateProps&&(e[r].props=e[r].updateProps))},mergeGuide:function t(e,n){if(null!=e){var r=e.elements;for(var i in r)r[i]&&(n&&delete r[i].g2Instance,r[i].updateProps&&(r[i].props=r[i].updateProps))}},mergeView:function t(e,n){e&&(n&&e.g2Instance&&delete e.g2Instance,e.updateProps&&(e.props=e.updateProps),this.mergeCoord(e,n),this.mergeAxises(e,n),this.mergeGeoms(e.geoms,n),this.mergeGuide(e.guide,n))},mergeViews:function t(e,n){if(null!=e)for(var r in e)e[r]&&this.mergeView(e[r],n)}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Prop=e.Util=void 0;var r,i=s(n(54)),o,a=s(n(418));function s(t){return t&&t.__esModule?t:{default:t}}e.Util=i.default,e.Prop=a.default},function(t,e,n){"use strict";e.c=i,n.d(e,"e",function(){return o}),n.d(e,"d",function(){return a}),e.h=b,e.b=w,e.g=O,e.a=j,e.f=C;var r=n(84);function i(){}var o=.7,a=1/o,s="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l=/^#([0-9a-f]{3})$/,f=/^#([0-9a-f]{6})$/,h=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),p=new RegExp("^rgb\\("+[c,c,c]+"\\)$"),d=new RegExp("^rgba\\("+[s,s,s,u]+"\\)$"),v=new RegExp("^rgba\\("+[c,c,c,u]+"\\)$"),g=new RegExp("^hsl\\("+[u,c,c]+"\\)$"),y=new RegExp("^hsla\\("+[u,c,c,u]+"\\)$"),m={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function b(t){var e;return t=(t+"").trim().toLowerCase(),(e=l.exec(t))?new j((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=f.exec(t))?x(parseInt(e[1],16)):(e=h.exec(t))?new j(e[1],e[2],e[3],1):(e=p.exec(t))?new j(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=d.exec(t))?_(e[1],e[2],e[3],e[4]):(e=v.exec(t))?_(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=g.exec(t))?E(e[1],e[2]/100,e[3]/100,1):(e=y.exec(t))?E(e[1],e[2]/100,e[3]/100,e[4]):m.hasOwnProperty(t)?x(m[t]):"transparent"===t?new j(NaN,NaN,NaN,0):null}function x(t){return new j(t>>16&255,t>>8&255,255&t,1)}function _(t,e,n,r){return r<=0&&(t=e=n=NaN),new j(t,e,n,r)}function w(t){return t instanceof i||(t=b(t)),t?new j((t=t.rgb()).r,t.g,t.b,t.opacity):new j}function O(t,e,n,r){return 1===arguments.length?w(t):new j(t,e,n,null==r?1:r)}function j(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function S(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function E(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new P(t,e,n,r)}function M(t){if(t instanceof P)return new P(t.h,t.s,t.l,t.opacity);if(t instanceof i||(t=b(t)),!t)return new P;if(t instanceof P)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,u=a-o,c=(a+o)/2;return u?(s=e===a?(n-r)/u+6*(n0&&c<1?0:s,new P(s,u,c,t.opacity)}function C(t,e,n,r){return 1===arguments.length?M(t):new P(t,e,n,null==r?1:r)}function P(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function k(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}n.i(r.a)(i,b,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),n.i(r.a)(j,O,n.i(r.b)(i,{brighter:function(t){return t=null==t?a:Math.pow(a,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?o:Math.pow(o,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+S(this.r)+S(this.g)+S(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),n.i(r.a)(P,C,n.i(r.b)(i,{brighter:function(t){return t=null==t?a:Math.pow(a,t),new P(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?o:Math.pow(o,t),new P(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new j(k(t>=240?t-240:t+120,i,r),k(t,i,r),k(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}))},function(t,e,n){"use strict";function r(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}e.b=r,e.a=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t}},function(t,e,n){"use strict";function r(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}e.b=r,e.a=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[i],a=t[i+1],s=i>0?t[i-1]:2*o-a,u=i=1?(n=1,e-1):Math.floor(n*e),o=t[i],a=t[i+1],s=i>0?t[i-1]:2*o-a,u=i=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r.a.hasOwnProperty(e)?{space:r.a[e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return r});var r="http://www.w3.org/1999/xhtml";e.a={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),e.b=f;var r={},i=null,o;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(r={mouseenter:"mouseover",mouseleave:"mouseout"}));function a(t,e,n){return t=s(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function s(t,e,n){return function(r){var o=i;i=r;try{t.call(this,this.__data__,e,n)}finally{i=o}}}function u(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function c(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n=0&&t._call.call(null,e),t=t._next;--r}function b(){l=(c=h.now())+f,r=i=0;try{m()}finally{r=0,_(),l=0}}function x(){var t=h.now(),e=t-c;e>a&&(f-=e,c=t)}function _(){for(var t,e=s,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:s=n);u=t,w(r)}function w(t){var e;r||(i&&(i=clearTimeout(i)),t-l>24?(t<1/0&&(i=setTimeout(b,t-h.now()-f)),o&&(o=clearInterval(o))):(o||(c=h.now(),o=setInterval(x,a)),r=1,p(b)))}g.prototype=y.prototype={constructor:g,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?d():+n)+(null==e?0:+e),this._next||u===this||(u?u._next=this:s=this,u=this),this._call=t,this._time=n,w()},stop:function(){this._call&&(this._call=null,this._time=1/0,w())}}},function(t,e,n){var r; /*! * EventEmitter v5.1.0 - git.io/ee * Unlicense - http://unlicense.org/ * Oliver Caldwell - http://oli.me.uk/ * @preserve - */!function(e){"use strict";function i(){}var o=i.prototype,a=e.EventEmitter;function s(t,e){for(var n=t.length;n--;)if(t[n].listener===e)return n;return-1}function u(t){return function e(){return this[t].apply(this,arguments)}}function c(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&c(t.listener)}o.getListeners=function t(e){var n=this._getEvents(),r,i;if(e instanceof RegExp)for(i in r={},n)n.hasOwnProperty(i)&&e.test(i)&&(r[i]=n[i]);else r=n[e]||(n[e]=[]);return r},o.flattenListeners=function t(e){var n=[],r;for(r=0;r=0},_getDimValues:function t(e){var n=this,r={},a=[];if(this.xField&&this.isAdjust("x")&&a.push(this.xField),this.yField&&this.isAdjust("y")&&a.push(this.yField),i(a,function(t){var n=o.values(e,t);n.sort(function(t,e){return t-e}),r[t]=n}),!this.yField&&this.isAdjust("y")){var s="y",u=[0,1];r.y=u}return r},adjustData:function t(e,n){var r=this,o=r._getDimValues(n);i(e,function(t,n){i(o,function(i,o){r.adjustDim(o,i,t,e.length,n)})})},getAdjustRange:function t(e,n,r){var i=this,o=r.indexOf(n),a=r.length,s,u;return!this.yField&&this.isAdjust("y")?(s=0,u=1):a>1?(s=0===o?r[0]:r[o-1],u=o===a-1?r[a-1]:r[o+1],0!==o?s+=(n-s)/2:s-=(u-n)/2,o!==a-1?u-=(u-n)/2:u+=(n-r[a-2])/2):(s=0===n?0:n-.5,u=0===n?1:n+.5),{pre:s,next:u}},groupData:function t(e,n){var r={};return i(e,function(t){var e=t[n];void 0===e&&(e=t[n]=0),r[e]||(r[e]=[]),r[e].push(t)}),r}}},function(t,e,n){var r=n(11),i=n(14),o=n(2),a=/rgba?\(([\s.,0-9]+)\)/;function s(){var t=document.createElement("i");return t.title="Web Colour Picker",t.style.display="none",document.body.appendChild(t),t}function u(t,e,n,r){var i;return t[r]+(e[r]-t[r])*n}function c(t){return"#"+l(t[0])+l(t[1])+l(t[2])}function l(t){return 1===(t=(t=Math.round(t)).toString(16)).length&&(t="0"+t),t}function f(t,e){(isNaN(e)||!r(e)||e<0)&&(e=0),e>1&&(e=1);var n=t.length-1,i=Math.floor(n*e),o=n*e-i,a=t[i],s=i===n?a:t[i+1],l;return c([u(a,s,o,0),u(a,s,o,1),u(a,s,o,2)])}function h(t){var e=[];return e.push(parseInt(t.substr(1,2),16)),e.push(parseInt(t.substr(3,2),16)),e.push(parseInt(t.substr(5,2),16)),e}var p={},d=null,v={toRGB:function t(e){if("#"===e[0]&&7===e.length)return e;var n,r,i;(d||(d=s()),p[e])?n=p[e]:(d.style.color=e,n=document.defaultView.getComputedStyle(d,"").getPropertyValue("color"),n=c(a.exec(n)[1].split(/\s*,\s*/)),p[e]=n);return n},rgb2arr:h,gradient:function t(e){var n=[];return i(e)&&(e=e.split("-")),o(e,function(t){-1===t.indexOf("#")&&(t=v.toRGB(t)),n.push(h(t))}),function(t){return f(n,t)}}};t.exports=v},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=n(35).Group,a=n(3),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function t(){return{zIndex:1,type:"line",lineStyle:null,items:null,alternateColor:null,matrix:null,hideFirstLine:!1,hideLastLine:!1,hightLightZero:!1,zeroLineStyle:{stroke:"#595959",lineDash:[0,0]}}},n._renderUI=function e(){t.prototype._renderUI.call(this),this._drawLines()},n._drawLines=function t(){var e=this,n=this.get("lineStyle"),r=this.get("items");r&&r.length&&(this._precessItems(r),this._drawGridLines(r,n))},n._precessItems=function t(e){var n=this,r;a.each(e,function(t,e){r&&n.get("alternateColor")&&n._drawAlternativeBg(t,r,e),r=t})},n._drawGridLines=function t(e,n){var r=this,i=this.get("type"),o,s,u,c,l=e.length;"line"===i||"polygon"===i?a.each(e,function(t,e){r.get("hideFirstLine")&&0===e||r.get("hideLastLine")&&e===l-1||(c=t.points,s=[],"line"===i?(s.push(["M",c[0].x,c[0].y]),s.push(["L",c[c.length-1].x,c[c.length-1].y])):a.each(c,function(t,e){0===e?s.push(["M",t.x,t.y]):s.push(["L",t.x,t.y])}),u=r._drawZeroLine(i,e)?a.mix({},r.get("zeroLineStyle"),{path:s}):a.mix({},n,{path:s}),(o=r.addShape("path",{attrs:u})).name="axis-grid",o._id=t._id,o.set("coord",r.get("coord")),r.get("appendInfo")&&o.setSilent("appendInfo",r.get("appendInfo")))}):a.each(e,function(t,e){r.get("hideFirstLine")&&0===e||r.get("hideLastLine")&&e===l-1||(c=t.points,s=[],a.each(c,function(t,e){var n=t.radius;0===e?s.push(["M",t.x,t.y]):s.push(["A",n,n,0,0,t.flag,t.x,t.y])}),u=a.mix({},n,{path:s}),(o=r.addShape("path",{attrs:u})).name="axis-grid",o._id=t._id,o.set("coord",r.get("coord")),r.get("appendInfo")&&o.setSilent("appendInfo",r.get("appendInfo")))})},n._drawZeroLine=function t(e,n){var r=this,i=this.get("tickValues");return!("line"!==e||!i||0!==i[n]||!this.get("hightLightZero"))},n._drawAlternativeBg=function t(e,n,r){var i=this,o=this.get("alternateColor"),s,u,c;a.isString(o)?u=o:a.isArray(o)&&(u=o[0],c=o[1]),r%2==0?c&&(s=this._getBackItem(n.points,e.points,c)):u&&(s=this._getBackItem(n.points,e.points,u));var l=this.addShape("Path",{attrs:s});l.name="axis-grid-rect",l._id=e._id&&e._id.replace("grid","grid-rect"),l.set("coord",this.get("coord")),this.get("appendInfo")&&l.setSilent("appendInfo",this.get("appendInfo"))},n._getBackItem=function t(e,n,r){var i=[],o=this.get("type");if("line"===o)i.push(["M",e[0].x,e[0].y]),i.push(["L",e[e.length-1].x,e[e.length-1].y]),i.push(["L",n[n.length-1].x,n[n.length-1].y]),i.push(["L",n[0].x,n[0].y]),i.push(["Z"]);else if("polygon"===o){a.each(e,function(t,e){0===e?i.push(["M",t.x,t.y]):i.push(["L",t.x,t.y])});for(var s=n.length-1;s>=0;s--)i.push(["L",n[s].x,n[s].y]);i.push(["Z"])}else{var u=e[0].flag;a.each(e,function(t,e){var n=t.radius;0===e?i.push(["M",t.x,t.y]):i.push(["A",n,n,0,0,t.flag,t.x,t.y])});for(var c=n.length-1;c>=0;c--){var l=n[c],f=l.radius;c===n.length-1?i.push(["M",l.x,l.y]):i.push(["A",f,f,0,0,1===u?0:1,l.x,l.y])}}return{fill:r,path:i}},e}(o);t.exports=s},function(t,e,n){var r=n(3);t.exports={getFirstScale:function t(e){var n;return r.each(e,function(t){if(t)return n=t,!1}),n}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=i.DomUtil,a=n(34),s,u,c,l={scatter:n(244),map:n(245),treemap:n(243)},f=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"label",type:"default",textStyle:null,formatter:null,items:null,useHtml:!1,containerTpl:'
',itemTpl:'
{text}
',labelLine:!1,lineGroup:null,shapes:null,config:!0,capture:!0})},n.clear=function e(){var n=this.get("group"),r=this.get("container");n&&!n.get("destroyed")&&n.clear(),r&&(r.innerHTML=""),t.prototype.clear.call(this)},n.destroy=function t(){var e=this.get("group"),n=this.get("container");e.destroy||e.destroy(),n&&(n.innerHTML="")},n.render=function t(){this.clear(),this._init(),this.beforeDraw(),this.draw(),this.afterDraw()},n._dryDraw=function t(){var e=this,n=e.get("items"),r=e.getLabels(),o=r.length;i.each(n,function(t,n){if(n=n.length;a--)r[a].remove();e._adjustLabels(),!e.get("labelLine")&&e.get("config")||e.drawLines()},n.draw=function t(){this._dryDraw(),this.get("canvas").draw()},n.changeLabel=function t(e,n){if(e)if(e.tagName){var r=this._createDom(n);e.innerHTML=r.innerHTML,this._setCustomPosition(n,e)}else e._id=n._id,e.attr("text",n.text),e.attr("x")===n.x&&e.attr("y")===n.y||(e.resetMatrix(),n.textStyle.rotate&&(e.rotateAtStart(n.textStyle.rotate),delete n.textStyle.rotate),e.attr(n))},n.show=function t(){var e=this.get("group"),n=this.get("container");e&&e.show(),n&&(n.style.opacity=1)},n.hide=function t(){var e=this.get("group"),n=this.get("container");e&&e.hide(),n&&(n.style.opacity=0)},n.drawLines=function t(){var e=this,n;"boolean"==typeof e.get("labelLine")&&e.set("labelLine",{});var r=e.get("lineGroup");!r||r.get("destroyed")?(r=e.get("group").addGroup({elCls:"x-line-group"}),e.set("lineGroup",r)):r.clear(),i.each(e.get("items"),function(t){e.lineToLabel(t,r)})},n.lineToLabel=function t(e,n){var r=this;if(this.get("config")||e.labelLine){var o=e.labelLine||this.get("labelLine"),a=void 0===e.capture?this.get("capture"):e.capture,s=o.path;if(s&&i.isFunction(o.path)&&(s=o.path(e)),!s){var u=e.start||{x:e.x-e._offset.x,y:e.y-e._offset.y};s=[["M",u.x,u.y],["L",e.x,e.y]]}var c=e.color;c||(c=e.textStyle&&e.textStyle.fill?e.textStyle.fill:"#000");var l=n.addShape("path",{attrs:i.mix({path:s,fill:null,stroke:c},o),capture:a});l.name=this.get("name"),l._id=e._id&&e._id.replace("glabel","glabelline"),l.set("coord",this.get("coord"))}},n._adjustLabels=function t(){var e=this,n=this.get("type"),r=this.getLabels(),i=this.get("shapes"),o=l[n];"default"!==n&&o&&o(r,i)},n.getLabels=function t(){var e=this.get("container");return e?i.toArray(e.childNodes):this.get("group").get("children")},n._addLabel=function t(e,n){var r=e;return this.get("config")&&(r=this._getLabelCfg(e,n)),this._createText(r)},n._getLabelCfg=function t(e,n){var r=this.get("textStyle")||{},o=this.get("formatter"),a=this.get("htmlTemplate"),s;if(!i.isObject(e)){var u=e;(e={}).text=u}return i.isFunction(r)&&(r=r(e.text,e,n)),o&&(e.text=o(e.text,e,n)),a&&(e.useHtml=!0,i.isFunction(a)&&(e.text=a(e.text,e,n))),i.isNil(e.text)&&(e.text=""),e.text=e.text+"",i.mix({},e,{textStyle:r},{x:e.x||0,y:e.y||0})},n._init=function t(){if(!this.get("group")){var e=this.get("canvas").addGroup({id:"label-group"});this.set("group",e)}},n.initHtmlContainer=function t(){var e=this.get("container");if(e)i.isString(e)&&(e=document.getElementById(e))&&this.set("container",e);else{var n=this.get("containerTpl"),r=this.get("canvas").get("el").parentNode;e=o.createDom(n),r.style.position="relative",r.appendChild(e),this.set("container",e)}return e},n._createText=function t(e){var n=this.get("container"),r=void 0===e.capture?this.get("capture"):e.capture,o;if(!e.useHtml&&!e.htmlTemplate){var a=this.get("name"),s=e.point,u=this.get("group");delete e.point;var c=e.rotate;return e.textStyle&&(e.textStyle.rotate&&(c=e.textStyle.rotate,delete e.textStyle.rotate),e=i.mix({x:e.x,y:e.y,textAlign:e.textAlign,text:e.text},e.textStyle)),o=u.addShape("text",{attrs:e,capture:r}),c&&(Math.abs(c)>2*Math.PI&&(c=c/180*Math.PI),o.transform([["t",-e.x,-e.y],["r",c],["t",e.x,e.y]])),o.setSilent("origin",s||e),o.name=a,this.get("appendInfo")&&o.setSilent("appendInfo",this.get("appendInfo")),o}n||(n=this.initHtmlContainer());var l=this._createDom(e);n.appendChild(l),this._setCustomPosition(e,l)},n._createDom=function t(e){var n=this.get("itemTpl"),r=i.substitute(n,{text:e.text});return o.createDom(r)},n._setCustomPosition=function t(e,n){var r=e.textAlign||"left",i=e.y,a=e.x,s=o.getOuterWidth(n),u;i-=o.getOuterHeight(n)/2,"center"===r?a-=s/2:"right"===r&&(a-=s),n.style.top=parseInt(i,10)+"px",n.style.left=parseInt(a,10)+"px"},e}(a);t.exports=f},function(t,e){var n=function(){function t(){this.bitmap=[]}var e=t.prototype;return e.hasGap=function t(e){for(var t=!0,n=this.bitmap,r=Math.floor(e.minX),i=Math.ceil(e.maxX),o=Math.floor(e.minY),a=Math.ceil(e.maxY)-1,s=r;s-1?t:t.parentNode?t.parentNode.className===l?t.parentNode:y(t.parentNode,e):null}function m(t,e){var n=null,r=e instanceof c?e.get("value"):e;return i.each(t,function(t){if(t.value===r)return n=t,!1}),n}var b=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"category-legend",container:null,containerTpl:'

    ',itemTpl:'
  • {value}
  • ',legendStyle:{},textStyle:{fill:"#333",fontSize:12,textAlign:"middle",textBaseline:"top",fontFamily:s},abridgeText:!1,tipTpl:'
    ',tipStyle:{display:"none",fontSize:"12px",backgroundColor:"#fff",position:"absolute",width:"auto",height:"auto",padding:"3px",boxShadow:"2px 2px 5px #888"},autoPosition:!0})},n._init=function t(){},n.beforeRender=function t(){},n.render=function t(){this._renderHTML()},n._bindEvents=function t(){var e=this,n,r=g(this.get("legendWrapper"),h);this.get("hoverable")&&(r.onmousemove=function(t){return e._onMousemove(t)},r.onmouseout=function(t){return e._onMouseleave(t)}),this.get("clickable")&&(r.onclick=function(t){return e._onClick(t)})},n._onMousemove=function t(e){var n=this.get("items"),r=e.target,i=r.className;if(!((i=i.split(" ")).indexOf(l)>-1||i.indexOf(h)>-1)){var o=y(r,p),a=m(n,o.getAttribute("data-value"));a?(this.deactivate(),this.activate(o.getAttribute("data-value")),this.emit("itemhover",{item:a,currentTarget:o,checked:a.checked})):a||(this.deactivate(),this.emit("itemunhover",e))}},n._onMouseleave=function t(e){this.deactivate(),this.emit("itemunhover",e)},n._onClick=function t(e){var n=this,r,o=g(this.get("legendWrapper"),h),a=this.get("unCheckColor"),s=this.get("items"),u=this.get("selectedMode"),c=o.childNodes,f=e.target,b=f.className;if(!((b=b.split(" ")).indexOf(l)>-1||b.indexOf(h)>-1)){var x=y(f,p),_=g(x,d),w=g(x,v),O=m(s,x.getAttribute("data-value"));if(O){var j=x.className,S=x.getAttribute("data-color");if("single"===u)O.checked=!0,i.each(c,function(t){var e,r;t!==x?(g(t,v).style.backgroundColor=a,t.className=t.className.replace("checked","unChecked"),t.style.color=a,m(s,t.getAttribute("data-value")).checked=!1):(_&&(_.style.color=n.get("textStyle").fill),w&&(w.style.backgroundColor=S),x.className=j.replace("unChecked","checked"))});else{var E=-1!==j.indexOf("checked"),M=0;if(i.each(c,function(t){-1!==t.className.indexOf("checked")&&M++}),!this.get("allowAllCanceled")&&E&&1===M)return void this.emit("clicklastitem",{item:O,currentTarget:x,checked:"single"===u||O.checked});O.checked=!O.checked,E?(w&&(w.style.backgroundColor=a),x.className=j.replace("checked","unChecked"),x.style.color=a):(w&&(w.style.backgroundColor=S),x.className=j.replace("unChecked","checked"),x.style.color=this.get("textStyle").fill)}this.emit("itemclick",{item:O,currentTarget:x,checked:"single"===u||O.checked})}}},n.activate=function t(e){var n=this,r=this,i=r.get("items"),o=m(i,e),a,s,u;g(r.get("legendWrapper"),h).childNodes.forEach(function(t){var e=g(t,v),a=m(i,t.getAttribute("data-value"));if(n.get("highlight")){if(a===o&&a.checked)return void(e.style.border="1px solid #333")}else a===o?e.style.opacity=r.get("activeOpacity"):a.checked&&(e.style.opacity=r.get("inactiveOpacity"))})},n.deactivate=function t(){var e=this,n=this,r,i,o;g(n.get("legendWrapper"),h).childNodes.forEach(function(t){var r=g(t,v);e.get("highlight")?r.style.border="1px solid #fff":r.style.opacity=n.get("inactiveOpacity")})},n._renderHTML=function t(){var e=this,n=this.get("container"),r=this.get("title"),o=this.get("containerTpl"),a=u.createDom(o),c=g(a,f),y=g(a,h),m=this.get("unCheckColor"),b=i.deepMix({},{CONTAINER_CLASS:{height:"auto",width:"auto",position:"absolute",overflowY:"auto",fontSize:"12px",fontFamily:s,lineHeight:"20px",color:"#8C8C8C"},TITLE_CLASS:{marginBottom:this.get("titleGap")+"px",fontSize:"12px",color:"#333",textBaseline:"middle",fontFamily:s},LIST_CLASS:{listStyleType:"none",margin:0,padding:0,textAlign:"center"},LIST_ITEM_CLASS:{cursor:"pointer",marginBottom:"5px",marginRight:"24px"},MARKER_CLASS:{width:"9px",height:"9px",borderRadius:"50%",display:"inline-block",marginRight:"4px",verticalAlign:"middle"}},this.get("legendStyle"));if(/^\#/.test(n)||"string"==typeof n&&n.constructor===String){var x=n.replace("#","");(n=document.getElementById(x)).appendChild(a)}else{var _=this.get("position"),w={};w="left"===_||"right"===_?{maxHeight:(this.get("maxLength")||n.offsetHeight)+"px"}:{maxWidth:(this.get("maxLength")||n.offsetWidth)+"px"},u.modifyCSS(a,i.mix({},b.CONTAINER_CLASS,w,this.get(l))),n.appendChild(a)}u.modifyCSS(y,i.mix({},b.LIST_CLASS,this.get(h))),c&&(r&&r.text?(c.innerHTML=r.text,u.modifyCSS(c,i.mix({},b.TITLE_CLASS,this.get(f),r))):a.removeChild(c));var O=this.get("items"),j=this.get("itemTpl"),S=this.get("position"),E=this.get("layout"),M="right"===S||"left"===S||"vertical"===E?"block":"inline-block",C=i.mix({},b.LIST_ITEM_CLASS,{display:M},this.get(p)),P=i.mix({},b.MARKER_CLASS,this.get(v));if(i.each(O,function(t,n){var r=t.checked,o=e._formatItemValue(t.value),s=t.marker.fill||t.marker.stroke,c=r?s:m,l;l=i.isFunction(j)?j(o,c,r,n):j;var f=i.substitute(l,i.mix({},t,{index:n,checked:r?"checked":"unChecked",value:o,color:c,originColor:s,originValue:t.value.replace(/\"/g,""")})),h=u.createDom(f);h.style.color=e.get("textStyle").fill;var p=g(h,v),b=g(h,d);if(u.modifyCSS(h,C),p&&u.modifyCSS(p,P),r||(h.style.color=m,p&&(p.style.backgroundColor=m)),y.appendChild(h),e.get("abridgeText")){var x=o,_=h.offsetWidth,w=e.get("textStyle").fontSize;isNaN(w)&&(-1!==w.indexOf("pt")?w=1*parseFloat(w.substr(0,w.length-2))/72*96:-1!==w.indexOf("px")&&(w=parseFloat(w.substr(0,w.length-2))));var O=w*x.length,S=Math.floor(_/w);_<2*w?x="":_1&&(x=x.substr(0,S-1)+"..."),b.innerText=x,h.addEventListener("mouseover",function(){var t=g(a.parentNode,"textTip");t.style.display="block",t.style.left=h.offsetLeft+h.offsetWidth+"px",t.style.top=h.offsetTop+15+"px",t.innerText=o}),h.addEventListener("mouseout",function(){var t;g(a.parentNode,"textTip").style.display="none"})}}),this.get("abridgeText")){var k=this.get("tipTpl"),T=u.createDom(k),A=this.get("tipStyle");u.modifyCSS(T,A),a.parentNode.appendChild(T),T.addEventListener("mouseover",function(){T.style.display="none"})}this.set("legendWrapper",a)},n._adjustPositionOffset=function t(){var e=this.get("position"),n=this.get("offset"),r=this.get("offsetX"),i=this.get("offsetY");r&&(n[0]=r),i&&(n[1]=i);var o=this.get("legendWrapper");o.style.left=e[0]+"px",o.style.top=e[1]+"px",o.style.marginLeft=n[0]+"px",o.style.marginTop=n[1]+"px"},n.getWidth=function t(){return u.getOuterWidth(this.get("legendWrapper"))},n.getHeight=function t(){return u.getOuterHeight(this.get("legendWrapper"))},n.move=function e(n,r){/^\#/.test(this.get("container"))?t.prototype.move.call(this,n,r):(u.modifyCSS(this.get("legendWrapper"),{left:n+"px",top:r+"px"}),this.set("x",n),this.set("y",r))},n.destroy=function t(){var e=this.get("legendWrapper");e&&e.parentNode&&e.parentNode.removeChild(e)},e}(o);t.exports=b},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(105),a,s=n(18).FONT_FAMILY,u=i.Event,c=i.Group;function l(t,e){var n=null,r=e instanceof c||"legendGroup"===e.name?e.get("value"):e;return i.each(t,function(t){if(t.value===r)return n=t,!1}),n}function f(t,e){return t.findBy(function(t){return t.name===e})}var h=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"category-legend",items:null,itemGap:5,itemMarginBottom:8,itemsGroup:null,layout:"horizontal",allowAllCanceled:!1,backPadding:[0,0,0,0],unCheckColor:"#ccc",background:{fill:"#fff",fillOpacity:0},itemWidth:null,textStyle:{fill:"#333",fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:s},_wordSpaceing:8,clickable:!0,selectedMode:"multiple",reversed:!1,autoWrap:!0,highlight:!1,activeOpacity:.7,inactiveOpacity:1})},n.render=function e(){t.prototype.render.call(this),this._renderItems(),this.get("autoWrap")&&this._adjustItems()},n._bindEvents=function t(){this.get("hoverable")&&(this.get("group").on("mousemove",i.wrapBehavior(this,"_onMousemove")),this.get("group").on("mouseleave",i.wrapBehavior(this,"_onMouseleave"))),this.get("clickable")&&this.get("group").on("click",i.wrapBehavior(this,"_onClick"))},n._getLegendItem=function t(e){var n=e.get("parent");return n&&"legendGroup"===n.name?n:null},n.activate=function t(e){var n=this,r=this,i,o,a=void 0;r.get("itemsGroup").get("children").forEach(function(t){if(a=f(t,"legend-marker")){var i=t.get("checked");n.get("highlight")?t.get("value")===e&&i?a.attr("stroke","#333"):a.attr("stroke",null):t.get("value")===e&&a.attr("fillOpacity",r.get("activeOpacity"))}}),this.get("canvas").draw()},n.deactivate=function t(){var e=this,n=this,r,i=n.get("itemsGroup").get("children"),o=void 0,a=this.get("unCheckColor");i.forEach(function(t){if(o=f(t,"legend-marker"))if(e.get("highlight")){var r=o.get("oriStroke"),i=t.get("checked");r=r&&!i?a:"",o.attr("stroke",r)}else o.attr("fillOpacity",n.get("inactiveOpacity"))}),this.get("canvas").draw()},n._onMousemove=function t(e){var n=this._getLegendItem(e.currentTarget);if(n&&n.get("checked")){var r=this.get("items"),i=new u("itemhover",e,!0,!0);i.item=l(r,n),i.checked=n.get("checked"),i.currentTarget=e.currentTarget,this.deactivate(),this.activate(n.get("value")),this.emit("itemhover",i)}else this.deactivate(),this.emit("itemunhover",e);this.get("canvas").draw()},n._onMouseleave=function t(e){this.deactivate(),this.get("canvas").draw(),this.emit("itemunhover",e)},n._onClick=function t(e){var n=this._getLegendItem(e.currentTarget),r=this.get("items");if(n&&!n.get("destroyed")){var o=n.get("checked"),a=this.get("selectedMode"),s=l(r,n),c=new u("itemclick",e,!0,!0);if(c.item=s,c.currentTarget=n,c.appendInfo=e.currentTarget.get("appendInfo"),c.checked="single"===a||!o,!this.get("allowAllCanceled")&&o&&1===this.getCheckedCount())return void this.emit("clicklastitem",c);var h=this.get("unCheckColor"),p=this.get("textStyle").fill,d=void 0,v=void 0,g=void 0;if("single"===a){var y,m=this.get("itemsGroup").get("children");i.each(m,function(t){d=f(t,"legend-marker"),v=f(t,"legend-text"),g=f(t,"legend-item"),t!==n?(d.attr("fill")&&d.attr("fill",h),d.attr("stroke")&&d.attr("stroke",h),v.attr("fill",h),d.setSilent("checked",!1),v.setSilent("checked",!1),g.setSilent("checked",!1),t.setSilent("checked",!1)):(d.attr("fill")&&s&&s.marker&&d.attr("fill",s.marker.fill),d.attr("stroke")&&s&&s.marker&&d.attr("stroke",s.marker.stroke),v.attr("fill",p),d.setSilent("checked",!0),v.setSilent("checked",!0),g.setSilent("checked",!0),t.setSilent("checked",!0))})}else d=f(n,"legend-marker"),v=f(n,"legend-text"),g=f(n,"legend-item"),d.attr("fill")&&s&&s.marker&&d.attr("fill",o?h:s.marker.fill),d.attr("stroke")&&s&&s.marker&&d.attr("stroke",o?h:s.marker.stroke),v.attr("fill",o?h:p),n.setSilent("checked",!o),d.setSilent("checked",!o),v.setSilent("checked",!o),g.setSilent("checked",!o);this.emit("itemclick",c)}this.get("canvas").draw()},n._renderItems=function t(){var e=this,n=this.get("items");if(this.get("reversed")&&n.reverse(),i.each(n,function(t,n){e._addItem(t,n)}),this.get("highlight")){var r,o,a=void 0;this.get("itemsGroup").get("children").forEach(function(t){var e;(a=f(t,"legend-marker")).get("oriStroke")||(a.attr("stroke")?a.set("oriStroke",a.attr("stroke")):a.set("oriStroke",""))})}},n._formatItemValue=function t(e){var n=this.get("formatter")||this.get("itemFormatter");return n&&(e=n.call(this,e)),e},n._getNextX=function t(){var e=this.get("layout"),n=this.get("itemGap"),r=this.get("itemsGroup"),o=this.get("itemWidth"),a=r.get("children"),s=0;return"horizontal"===e&&i.each(a,function(t){s+=(o||t.getBBox().width)+n}),s},n._getNextY=function t(){var e=this.get("itemMarginBottom"),n=this.get("titleShape")?this.get("titleGap"):0,r=this.get("layout"),o=this.get("itemsGroup"),a=this.get("titleShape"),s=o.get("children"),u=n;return a&&(u+=a.getBBox().height),"vertical"===r&&i.each(s,function(t){u+=t.getBBox().height+e}),u},n._addItem=function t(e){var n=this.get("itemsGroup"),r=this._getNextX(),o=this._getNextY(),a=this.get("unCheckColor"),u=n.addGroup({x:r,y:o,value:e.value,checked:e.checked});u.set("viewId",this.get("viewId"));var c=this.get("textStyle"),l=this.get("_wordSpaceing"),f=0;if(e.marker){var h=i.mix({},e.marker,{x:e.marker.radius+r,y:o});e.checked||(h.fill&&(h.fill=a),h.stroke&&(h.stroke=a));var p=u.addShape("marker",{type:"marker",attrs:h});p.attr("cursor","pointer"),p.name="legend-marker",f+=p.getBBox().width+l}var d=i.mix({},{fill:"#333",fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:s},c,{x:f+r,y:o,text:this._formatItemValue(e.value)});e.checked||i.mix(d,{fill:a});var v=u.addShape("text",{attrs:d});v.attr("cursor","pointer"),v.name="legend-text",this.get("appendInfo")&&v.setSilent("appendInfo",this.get("appendInfo"));var g=u.getBBox(),y=this.get("itemWidth"),m=u.addShape("rect",{attrs:{x:r,y:o-g.height/2,fill:"#fff",fillOpacity:0,width:y||g.width,height:g.height}});return m.attr("cursor","pointer"),m.setSilent("origin",e),m.name="legend-item",this.get("appendInfo")&&m.setSilent("appendInfo",this.get("appendInfo")),u.name="legendGroup",u},n._adjustHorizontal=function t(){var e=this.get("itemsGroup"),n=e.get("children"),r=this.get("maxLength"),o=this.get("itemGap"),a=this.get("itemMarginBottom"),s=this.get("titleShape")?this.get("titleGap"):0,u=0,c=0,l=void 0,f=void 0,h=void 0,p=this.get("itemWidth");e.getBBox().width>r&&i.each(n,function(t){h=t.getBBox(),l=p||h.width,f=h.height+a,r-co&&i.each(r,function(t){d=t.getBBox(),h=d.width,p=d.height,l?v=l+a:h>v&&(v=h+a),o-f1&&a[u]>s[u]&&(l=s[u]),this.get("width"))r.attr(u,l-this.get("crosshairs").width/2),r.attr(c,this.get("width"));else if(o.isArray(a.point[u])&&!a.size){var f=a.point[u][1]-a.point[u][0];r.attr(u,a.point[u][0]),r.attr(c,f)}else n=3*a.size/4,r.attr(u,l-n),1===e.length?r.attr(c,3*a.size/2):r.attr(c,Math.abs(s[u]-a[u])+2*n)},e.render=function t(){var e=this.get("canvas"),n=this.get("plotRange"),r=this.get("isTransposed");switch(this.clear(),this.get("type")){case"x":this._renderHorizontalLine(e,n);break;case"y":this._renderVerticalLine(e,n);break;case"cross":this._renderHorizontalLine(e,n),this._renderVerticalLine(e,n);break;case"rect":this._renderBackground(e,n);break;default:r?this._renderHorizontalLine(e,n):this._renderVerticalLine(e,n)}},e.show=function e(){var n=this.get("container");t.prototype.show.call(this),n.show()},e.hide=function e(){var n=this.get("container");t.prototype.hide.call(this),n.hide()},e.clear=function e(){var n=this.get("container");this.set("crossLineShapeX",null),this.set("crossLineShapeY",null),this.set("crosshairsRectShape",null),t.prototype.clear.call(this),n.clear()},e.destroy=function e(){var n=this.get("container");t.prototype.destroy.call(this),n.remove()},e.setPosition=function t(e,n,r){var i=this.get("crossLineShapeX"),o=this.get("crossLineShapeY"),a=this.get("crosshairsRectShape");o&&!o.get("destroyed")&&o.move(e,0),i&&!i.get("destroyed")&&i.move(0,n),a&&!a.get("destroyed")&&this._updateRectShape(r)},n}(i);t.exports=a},function(t,e,n){var r=n(3),i={setMarkers:function t(e,n){var i=this,o=this.get("markerGroup"),a=this.get("frontPlot");o?o.clear():(o=a.addGroup({zIndex:1,capture:!1}),this.set("markerGroup",o)),r.each(e,function(t){o.addShape("marker",{color:t.color,attrs:r.mix({fill:t.color,symbol:"circle",shadowColor:t.color},n,{x:t.x,y:t.y})})}),this.set("markerItems",e)},clearMarkers:function t(){var e=this.get("markerGroup");e&&e.clear()}};t.exports=i},function(t,e){var n=20,r={_calcTooltipPosition:function t(e,n,r,i,o,a){var s=0,u=0,c=20;if(a){var l=a.getBBox();s=l.width,u=l.height,e=l.x,n=l.y,c=5}switch(r){case"inside":e=e+s/2-i/2,n=n+u/2-o/2;break;case"top":e=e+s/2-i/2,n=n-o-c;break;case"left":e=e-i-c,n=n+u/2-o/2;break;case"right":e=e+s+c,n=n+u/2-o/2;break;case"bottom":default:e=e+s/2-i/2,n=n+u+c}return[e,n]},_constraintPositionInBoundary:function t(e,n,r,i,o,a){return e+r+20>o?e=(e-=r+20)<0?0:e:e+20<0?e=20:e+=20,n+i+20>a?n=(n-=i+20)<0?0:n:n+20<0?n=20:n+=20,[e,n]},_constraintPositionInPlot:function t(e,n,r,i,o,a){return e+r>o.tr.x&&(e-=r+40),eo.bl.y&&(n-=i+40),n');e.appendChild(a),this.set("wrapperEl",a),this.get("forceFit")&&(r=u.getWidth(e,r),this.set("width",r));var c=this.get("renderer"),l=new s({containerDOM:a,width:r,height:o,pixelRatio:"svg"===c?1:this.get("pixelRatio"),renderer:c});this.set("canvas",l)},n._initPlot=function t(){var e=this;this._initPlotBack();var n=this.get("canvas"),r=n.addGroup({zIndex:1}),i=n.addGroup({zIndex:0}),o=n.addGroup({zIndex:3});this.set("backPlot",r),this.set("middlePlot",i),this.set("frontPlot",o)},n._initPlotBack=function t(){var e=this,n=this.get("canvas"),r=this.get("viewTheme"),o=n.addGroup(l,{padding:this.get("padding"),plotBackground:i.mix({},r.plotBackground,this.get("plotBackground")),background:i.mix({},r.background,this.get("background"))});this.set("plot",o),this.set("plotRange",o.get("plotRange"))},n._initEvents=function t(){this.get("forceFit")&&window.addEventListener("resize",i.wrapBehavior(this,"_initForceFitEvent"))},n._initForceFitEvent=function t(){var e=setTimeout(i.wrapBehavior(this,"forceFit"),200);clearTimeout(this.get("resizeTimer")),this.set("resizeTimer",e)},n._renderLegends=function t(){var e,n=this.get("options").legends;if(i.isNil(n)||!1!==n){var r=this.get("legendController");if(r.options=n||{},r.plotRange=this.get("plotRange"),n&&n.custom)r.addCustomLegend();else{var o=this.getAllGeoms(),a=[];i.each(o,function(t){var e=t.get("view"),n=t.getAttrsForLegend();i.each(n,function(n){var i=n.type,o=n.getScale(i);if(o.field&&"identity"!==o.type&&!p(a,o)){a.push(o);var s=e.getFilteredOutValues(o.field);r.addLegend(o,n,t,s)}})});var s=this.getYScales();0===a.length&&s.length>1&&r.addMixedLegend(s,o)}r.alignLegends()}},n._renderTooltips=function t(){var e=this.get("options");if(i.isNil(e.tooltip)||!1!==e.tooltip){var n=this.get("tooltipController");n.options=e.tooltip||{},n.renderTooltip()}},n.getAllGeoms=function t(){var e=[];e=e.concat(this.get("geoms"));var n=this.get("views");return i.each(n,function(t){e=e.concat(t.get("geoms"))}),e},n.forceFit=function t(){var e=this;if(this&&!this.destroyed){var n=this.get("container"),r=this.get("width"),i=u.getWidth(n,r);if(0!==i&&i!==r){var o=this.get("height");this.changeSize(i,o)}return this}},n.resetPlot=function t(){var e=this.get("plot"),n=this.get("padding");v(n,e.get("padding"))||(e.set("padding",n),e.repaint())},n.changeSize=function t(e,n){var r=this,i;this.get("canvas").changeSize(e,n);var o=this.get("plot");return this.set("width",e),this.set("height",n),o.repaint(),this.set("keepPadding",!0),this.repaint(),this.set("keepPadding",!1),this.emit("afterchangesize"),this},n.changeWidth=function t(e){return this.changeSize(e,this.get("height"))},n.changeHeight=function t(e){return this.changeSize(this.get("width"),e)},n.view=function t(e){(e=e||{}).theme=this.get("theme"),e.parent=this,e.backPlot=this.get("backPlot"),e.middlePlot=this.get("middlePlot"),e.frontPlot=this.get("frontPlot"),e.canvas=this.get("canvas"),i.isNil(e.animate)&&(e.animate=this.get("animate")),e.options=i.mix({},this._getSharedOptions(),e.options);var t=new o(e);return t.set("_id","view"+this.get("views").length),this.get("views").push(t),this.emit("addview",{view:t}),t},n.removeView=function t(e){var n=this.get("views");i.Array.remove(n,e),e.destroy()},n._getSharedOptions=function t(){var e=this.get("options"),n={};return i.each(["scales","coord","axes"],function(t){n[t]=i.cloneDeep(e[t])}),n},n.getViewRegion=function t(){var e=this.get("plotRange");return{start:e.bl,end:e.tr}},n.legend=function t(e,n){var r=this.get("options");r.legends||(r.legends={});var o={};return!1===e?r.legends=!1:i.isObject(e)?o=e:i.isString(e)?o[e]=n:o=n,i.mix(r.legends,o),this},n.tooltip=function t(e,n){var r=this.get("options");return r.tooltip||(r.tooltip={}),!1===e?r.tooltip=!1:i.isObject(e)?i.mix(r.tooltip,e):i.mix(r.tooltip,n),this},n.clear=function e(){this.emit("beforeclear");for(var n=this.get("views");n.length>0;){var r;n.shift().destroy()}t.prototype.clear.call(this);var i=this.get("canvas");return this.resetPlot(),i.draw(),this.emit("afterclear"),this},n.clearInner=function e(){var n=this.get("views");i.each(n,function(t){t.clearInner()});var r=this.get("tooltipController");if(r&&r.clear(),!this.get("keepLegend")){var o=this.get("legendController");o&&o.clear()}t.prototype.clearInner.call(this)},n.drawComponents=function e(){t.prototype.drawComponents.call(this),this.get("keepLegend")||this._renderLegends()},n.render=function e(){var n=this;if(!this.get("keepPadding")&&this._isAutoPadding()){this.beforeRender(),this.drawComponents();var r=this._getAutoPadding(),o=this.get("plot");v(o.get("padding"),r)||(o.set("padding",r),o.repaint())}var a=this.get("middlePlot");if(this.get("limitInPlot")&&!a.attr("clip")){var s=i.getClipByRange(this.get("plotRange"));a.attr("clip",s)}t.prototype.render.call(this),this._renderTooltips()},n.repaint=function e(){this.get("keepPadding")||this.resetPlot(),t.prototype.repaint.call(this)},n.changeVisible=function t(e){var n=this.get("wrapperEl"),r=e?"":"none";n.style.display=r},n.toDataURL=function t(){var e=this,n=this.get("canvas"),r=this.get("renderer"),i=n.get("el"),o="";if("svg"===r){var a=i.cloneNode(!0),s=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),u=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",s);u.replaceChild(a,u.documentElement);var c=(new XMLSerializer).serializeToString(u);o="data:image/svg+xml;charset=utf8,"+encodeURIComponent(c)}else"canvas"===r&&(o=i.toDataURL("image/png"));return o},n.downloadImage=function t(e){var n=this,r=document.createElement("a"),i=n.get("renderer"),o=(e||"chart")+("svg"===i?".svg":".png"),a;n.get("canvas").get("timeline").stopAllAnimations(),setTimeout(function(){var t=n.toDataURL();if(window.Blob&&window.URL&&"svg"!==i){for(var e=t.split(","),a=e[0].match(/:(.*?);/)[1],s=atob(e[1]),u=s.length,c=new Uint8Array(u);u--;)c[u]=s.charCodeAt(u);var l=new Blob([c],{type:a});window.navigator.msSaveBlob?window.navigator.msSaveBlob(l,o):r.addEventListener("click",function(){r.download=o,r.href=window.URL.createObjectURL(l)})}else r.addEventListener("click",function(){r.download=o,r.href=t});var f=document.createEvent("MouseEvents");f.initEvent("click",!1,!1),r.dispatchEvent(f)},16)},n.showTooltip=function t(e){var n=this.getViewsByPoint(e),r;n.length&&this.get("tooltipController").showTooltip(e,n);return this},n.hideTooltip=function t(){var e;return this.get("tooltipController").hideTooltip(),this},n.getTooltipItems=function t(e){var n=this,r=this.getViewsByPoint(e),o=[];return i.each(r,function(t){var n=t.get("geoms");i.each(n,function(t){var n=t.get("dataArray"),r=[];i.each(n,function(n){var i=t.findPoint(e,n);if(i){var o=t.getTipItems(i);r=r.concat(o)}}),o=o.concat(r)})}),o},n.destroy=function e(){this.emit("beforedestroy"),clearTimeout(this.get("resizeTimer"));var n=this.get("canvas"),r=this.get("wrapperEl");r.parentNode.removeChild(r),t.prototype.destroy.call(this),n.destroy(),window.removeEventListener("resize",i.getWrapBehavior(this,"_initForceFitEvent")),this.emit("afterdestroy")},e}(o);t.exports=g},function(t,e,n){t.exports={Scale:n(267),Coord:n(263),Axis:n(262),Guide:n(265),Legend:n(266),Tooltip:n(268),Event:n(264)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="list",n.cols=null,n},n.generateFacets=function t(e){var n=this,r,i=n.fields[0];if(!i)throw"Please specify for the field for facet!";var o=n.getFieldValues(i,e),a=o.length,s=n.cols||a,u=parseInt((a+s-1)/s),c=[];return o.forEach(function(t,r){var l=parseInt(r/s),f=r%s,h=[{field:i,value:t,values:o}],p=n.getFilter(h),d=e.filter(p),v={type:n.type,count:a,colValue:t,colField:i,rowField:null,rowValue:t,colIndex:f,rowIndex:l,cols:s,rows:u,data:d,region:n.getRegion(u,s,f,l)};c.push(v)}),c},n.setXAxis=function t(e,n,r){r.rowIndex!==r.rows-1&&r.cols*r.rowIndex+r.colIndex+1+r.cols<=r.count&&(n[e].label=null,n[e].title=null)},n.setYAxis=function t(e,n,r){0!==r.colIndex&&(n[e].title=null,n[e].label=null)},e}(n(43));t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="rect",n},n.generateFacets=function t(e){var n=this,r=n.fields,i=[],o=1,a=1,s=r[0],u=r[1],c=[""],l=[""];return s&&(c=n.getFieldValues(s,e),a=c.length),u&&(l=n.getFieldValues(u,e),o=l.length),c.forEach(function(t,r){l.forEach(function(f,h){var p=[{field:s,value:t,values:c},{field:u,value:f,values:l}],d=n.getFilter(p),v=e.filter(d),g={type:n.type,colValue:t,rowValue:f,colField:s,rowField:u,colIndex:r,rowIndex:h,cols:a,rows:o,data:v,region:n.getRegion(o,a,r,h)};i.push(g)})}),i},n.setXAxis=function t(e,n,r){r.rowIndex!==r.rows-1?(n[e].title=null,n[e].label=null):r.colIndex!==parseInt((r.cols-1)/2)&&(n[e].title=null)},n.setYAxis=function t(e,n,r){0!==r.colIndex?(n[e].title=null,n[e].label=null):r.rowIndex!==parseInt((r.rows-1)/2)&&(n[e].title=null)},n.renderTitle=function t(e,n){0===n.rowIndex&&this.drawColTitle(e,n),n.colIndex===n.cols-1&&this.drawRowTitle(e,n)},e}(n(43));t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(66),o=n(24),a=n(0),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getPointRauis=function t(e,n){return o.getPointRadius(e,n)},n.getCirclePoint=function t(e,n,r){var i=this,o=this.get("coord"),a=o.getCenter(),s=this._isEmitLabels(),u=this.getPointRauis(o,r),c;if(0===u)return null;o.isTransposed&&u>n&&!s?e+=2*Math.asin(n/(2*u)):u+=n;return{x:a.x+u*Math.cos(e),y:a.y+u*Math.sin(e),angle:e,r:u}},n.getArcPoint=function t(e,n){var r=this,i;return n=n||0,i=a.isArray(e.x)||a.isArray(e.y)?{x:a.isArray(e.x)?e.x[n]:e.x,y:a.isArray(e.y)?e.y[n]:e.y}:e,this.transLabelPoint(i),i},n.getPointAngle=function t(e){var n=this,r=this.get("coord");return o.getPointAngle(r,e)},n.getMiddlePoint=function t(e){var n=this,r=this.get("coord"),i=e.length,o={x:0,y:0};return a.each(e,function(t){o.x+=t.x,o.y+=t.y}),o.x/=i,o.y/=i,o=r.convert(o)},n._isToMiddle=function t(e){return e.x.length>2},n.getLabelPoint=function t(e,n,r){var i=this,o=e.text[r],a=1,s;this._isToMiddle(n)?s=this.getMiddlePoint(n.points):(1===e.text.length&&0===r?r=1:0===r&&(a=-1),s=this.getArcPoint(n,r));var u=this.getDefaultOffset(e);u*=a;var c=this.getPointAngle(s),l=this.getCirclePoint(c,u,s);if(l?(l.text=o,l.angle=c,l.color=n.color):l={text:""},e.autoRotate||void 0===e.autoRotate){var f=l.textStyle?l.textStyle.rotate:null;f||(f=l.rotate||this.getLabelRotate(c,u,n)),l.rotate=f}return l.start={x:s.x,y:s.y},l},n._isEmitLabels=function t(){var e;return this.get("label").labelEmit},n.getLabelRotate=function t(e){var n=this,r;return r=180*e/Math.PI,r+=90,this._isEmitLabels()&&(r-=90),r&&(r>90?r-=180:r<-90&&(r+=180)),r/180*Math.PI},n.getLabelAlign=function t(e){var n=this,r=this.get("coord"),i;if(this._isEmitLabels())i=e.angle<=Math.PI/2&&e.angle>-Math.PI/2?"left":"right";else if(r.isTransposed){var o=r.getCenter(),a=this.getDefaultOffset(e);i=Math.abs(e.x-o.x)<1?"center":e.angle>Math.PI||e.angle<=0?a>0?"left":"right":a>0?"right":"left"}else i="center";return i},e}(i);t.exports=s},function(t,e,n){var r=n(0),i=n(5);t.exports={splitData:function t(e){var n=this.get("viewTheme")||i;if(!e.length)return[];var o=[],a=[],s,u=this.getYScale().field,c;return r.each(e,function(t){c=t._origin?t._origin[u]:t[u],n.connectNulls?r.isNil(c)||a.push(t):r.isArray(c)&&r.isNil(c[0])||r.isNil(c)?a.length&&(o.push(a),a=[]):a.push(t)}),a.length&&o.push(a),o}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(8),a=n(119),s=n(0),u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,s.assign(i(i(n)),a),n}return e.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="path",n.shapeType="line",n},e.getDrawCfg=function e(n){var r=t.prototype.getDrawCfg.call(this,n);return r.isStack=this.hasStack(),r},e.draw=function t(e,n,r,i){var o=this,a=this.splitData(e),u=this.getDrawCfg(e[0]);o._applyViewThemeShapeStyle(u,u.shape,r),u.origin=e,s.each(a,function(t,e){if(!s.isEmpty(t)){u.splitedIndex=e,u.points=t;var a=r.drawShape(u.shape,u,n);o.appendShapeInfo(a,i+e)}})},n}(o);o.Path=u,t.exports=u},function(t,e){var n,r,i="#1890FF",o,a,s,u,c,l='"-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, "sans-serif"',f="g2-tooltip",h="g2-tooltip-title",p="g2-tooltip-list",d="g2-tooltip-list-item",v="g2-tooltip-marker",g="g2-tooltip-value",y="g2-legend",m="g2-legend-title",b="g2-legend-list",x="g2-legend-list-item",_="g2-legend-marker",w={defaultColor:"#1890FF",plotCfg:{padding:[20,20,95,80]},fontFamily:l,defaultLegendPosition:"bottom",colors:["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],colors_16:["#1890FF","#41D9C7","#2FC25B","#FACC14","#E6965C","#223273","#7564CC","#8543E0","#5C8EE6","#13C2C2","#5CA3E6","#3436C7","#B381E6","#F04864","#D598D9"],colors_24:["#1890FF","#66B5FF","#41D9C7","#2FC25B","#6EDB8F","#9AE65C","#FACC14","#E6965C","#57AD71","#223273","#738AE6","#7564CC","#8543E0","#A877ED","#5C8EE6","#13C2C2","#70E0E0","#5CA3E6","#3436C7","#8082FF","#DD81E6","#F04864","#FA7D92","#D598D9"],colors_pie:["#1890FF","#13C2C2","#2FC25B","#FACC14","#F04864","#8543E0","#3436C7","#223273"],colors_pie_16:["#1890FF","#73C9E6","#13C2C2","#6CD9B3","#2FC25B","#9DD96C","#FACC14","#E6965C","#F04864","#D66BCA","#8543E0","#8E77ED","#3436C7","#737EE6","#223273","#7EA2E6"],shapes:{point:["hollowCircle","hollowSquare","hollowDiamond","hollowBowtie","hollowTriangle","hollowHexagon","cross","tick","plus","hyphen","line"],line:["line","dash","dot"],area:["area"]},sizes:[1,10],opacities:[.1,.9],axis:{top:{position:"top",title:null,label:{offset:16,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:l},autoRotate:!0},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0}},bottom:{position:"bottom",title:null,label:{offset:16,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:l}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0}},left:{position:"left",title:null,label:{offset:8,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:l}},line:null,tickLine:null,grid:{zIndex:-1,lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},right:{position:"right",title:null,label:{offset:8,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:l}},line:null,tickLine:null,grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},circle:{zIndex:1,title:null,label:{offset:8,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,fontFamily:l}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0},grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},radius:{zIndex:0,label:{offset:12,textStyle:{fill:"#545454",fontSize:12,textBaseline:"middle",lineHeight:16,fontFamily:l}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0},grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},type:"circle"}},helix:{grid:null,label:null,title:null,line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,length:4,stroke:"#BFBFBF",alignWithLabel:!0}}},label:{offset:20,textStyle:{fill:"#545454",fontSize:12,textBaseline:"middle",fontFamily:l}},treemapLabels:{offset:10,textStyle:{fill:"#fff",fontSize:12,textBaseline:"top",fontStyle:"bold",fontFamily:l}},innerLabels:{textStyle:{fill:"#fff",fontSize:12,textBaseline:"middle",fontFamily:l}},thetaLabels:{labelHeight:14,offset:30},legend:{right:{position:"right",layout:"vertical",itemMarginBottom:8,width:16,height:156,title:null,legendStyle:{LIST_CLASS:{textAlign:"left"}},textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:0,fontFamily:l},unCheckColor:"#bfbfbf"},left:{position:"left",layout:"vertical",itemMarginBottom:8,width:16,height:156,title:null,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:l},unCheckColor:"#bfbfbf"},top:{position:"top",offset:[0,6],layout:"horizontal",title:null,itemGap:10,width:156,height:16,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:l},unCheckColor:"#bfbfbf"},bottom:{position:"bottom",offset:[0,6],layout:"horizontal",title:null,itemGap:10,width:156,height:16,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:l},unCheckColor:"#bfbfbf"},html:(n={},n["g2-legend"]={height:"auto",width:"auto",position:"absolute",overflow:"auto",fontSize:"12px",fontFamily:l,lineHeight:"20px",color:"#8C8C8C"},n["g2-legend-title"]={marginBottom:"4px"},n["g2-legend-list"]={listStyleType:"none",margin:0,padding:0},n["g2-legend-list-item"]={cursor:"pointer",marginBottom:"5px",marginRight:"24px"},n["g2-legend-marker"]={width:"9px",height:"9px",borderRadius:"50%",display:"inline-block",marginRight:"8px",verticalAlign:"middle"},n),gradient:{textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"center",textBaseline:"middle",lineHeight:20,fontFamily:l},lineStyle:{lineWidth:1,stroke:"#fff"},unCheckColor:"#bfbfbf"},margin:[0,5,24,5],legendMargin:24},tooltip:(r={useHtml:!0,crosshairs:!1,offset:15},r["g2-tooltip"]={position:"absolute",visibility:"hidden",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:l,lineHeight:"20px",padding:"10px 10px 6px 10px"},r["g2-tooltip-title"]={marginBottom:"4px"},r["g2-tooltip-list"]={margin:0,listStyleType:"none",padding:0},r["g2-tooltip-list-item"]={marginBottom:"4px"},r["g2-tooltip-marker"]={width:"5px",height:"5px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},r["g2-tooltip-value"]={display:"inline-block",float:"right",marginLeft:"30px"},r),tooltipMarker:{symbol:function t(e,n,r){return[["M",e,n],["m",-r,0],["a",r,r,0,1,0,2*r,0],["a",r,r,0,1,0,2*-r,0]]},stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffSetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,radius:4},tooltipCrosshairsRect:{type:"rect",rectStyle:{fill:"#CCD6EC",opacity:.3}},tooltipCrosshairsLine:{lineStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:1}},shape:{point:{lineWidth:1,fill:"#1890FF",radius:4},hollowPoint:{fill:"#fff",lineWidth:1,stroke:"#1890FF",radius:3},interval:{lineWidth:0,fill:"#1890FF",fillOpacity:.85},hollowInterval:{fill:"#fff",stroke:"#1890FF",fillOpacity:0,lineWidth:2},area:{lineWidth:0,fill:"#1890FF",fillOpacity:.6},polygon:{lineWidth:0,fill:"#1890FF",fillOpacity:1},hollowPolygon:{fill:"#fff",stroke:"#1890FF",fillOpacity:0,lineWidth:2},hollowArea:{fill:"#fff",stroke:"#1890FF",fillOpacity:0,lineWidth:2},line:{stroke:"#1890FF",lineWidth:2,fill:null},edge:{stroke:"#1890FF",lineWidth:1,fill:null},schema:{stroke:"#1890FF",lineWidth:1,fill:null}},guide:{line:{lineStyle:{stroke:"rgba(0, 0, 0, .65)",lineDash:[2,2],lineWidth:1},text:{position:"start",autoRotate:!0,style:{fill:"rgba(0, 0, 0, .45)",fontSize:12,textAlign:"start",fontFamily:l,textBaseline:"bottom"}}},text:{style:{fill:"rgba(0,0,0,.5)",fontSize:12,textBaseline:"middle",textAlign:"start",fontFamily:l}},region:{style:{lineWidth:0,fill:"#000",fillOpacity:.04}},html:{alignX:"middle",alignY:"middle"},dataRegion:{style:{region:{lineWidth:0,fill:"#000000",opacity:.04},text:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:"rgba(0, 0, 0, .65)"}}},dataMarker:{top:!0,style:{point:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2},line:{stroke:"#A3B1BF",lineWidth:1},text:{fill:"rgba(0, 0, 0, .65)",opacity:1,fontSize:12,textAlign:"start"}},display:{point:!0,line:!0,text:!0},lineLength:20,direction:"upward",autoAdjust:!0}},pixelRatio:null};t.exports=w},function(t,e,n){var r={default:n(121),dark:n(307)};t.exports=r},function(t,e,n){var r=n(1),i=n(310),o=n(313),a=n(309),s=n(98),u=function t(e){this._cfg={zIndex:0,capture:!0,visible:!0,destroyed:!1},r.assign(this._cfg,this.getDefaultCfg(),e),this.initAttrs(this._cfg.attrs),this._cfg.attrs={},this.initTransform(),this.init()};u.CFG={id:null,zIndex:0,canvas:null,parent:null,capture:!0,context:null,visible:!0,destroyed:!1},r.augment(u,i,o,s,a,{init:function t(){this.setSilent("animable",!0),this.setSilent("animating",!1)},getParent:function t(){return this._cfg.parent},getDefaultCfg:function t(){return{}},set:function t(e,n){return"zIndex"===e&&this._beforeSetZIndex&&this._beforeSetZIndex(n),"loading"===e&&this._beforeSetLoading&&this._beforeSetLoading(n),this._cfg[e]=n,this},setSilent:function t(e,n){this._cfg[e]=n},get:function t(e){return this._cfg[e]},show:function t(){return this._cfg.visible=!0,this},hide:function t(){return this._cfg.visible=!1,this},remove:function t(e,n){var i=this._cfg,o=i.parent,a=i.el;return o&&r.remove(o.get("children"),this),a&&(n?o&&o._cfg.tobeRemoved.push(a):a.parentNode.removeChild(a)),(e||void 0===e)&&this.destroy(),this},destroy:function t(){var e;this.get("destroyed")||(this._attrs=null,this.removeEvent(),this._cfg={destroyed:!0})},toFront:function t(){var e=this._cfg,n=e.parent;if(n){var r=n._cfg.children,i=e.el,o=r.indexOf(this);r.splice(o,1),r.push(this),i&&(i.parentNode.removeChild(i),e.el=null)}},toBack:function t(){var e=this._cfg,n=e.parent;if(n){var r=n._cfg.children,i=e.el,o=r.indexOf(this);if(r.splice(o,1),r.unshift(this),i){var a=i.parentNode;a.removeChild(i),a.insertBefore(i,a.firstChild)}}},_beforeSetZIndex:function t(e){var n=this._cfg.parent;this._cfg.zIndex=e,r.isNil(n)||n.sort();var i=this._cfg.el;if(i){var o=n._cfg.children,a=o.indexOf(this),s=i.parentNode;s.removeChild(i),a===o.length-1?s.appendChild(i):s.insertBefore(i,s.childNodes[a])}return e},_setAttrs:function t(e){return this.attr(e),e},setZIndex:function t(e){return this._cfg.zIndex=e,this._beforeSetZIndex(e)},clone:function t(){return r.clone(this)},getBBox:function t(){}}),t.exports=u},function(t,e,n){var r=n(1),i=n(123),o=n(327),a={},s="_INDEX";function u(t){return function(e,n){var r=t(e,n);return 0===r?e[s]-n[s]:r}}function c(t,e,n){for(var r,i=t.length-1;i>=0;i--){var o=t[i];if(o._cfg.visible&&o._cfg.capture&&(o.isGroup?r=o.getShape(e,n):o.isHit(e,n)&&(r=o)),r)break}return r}var l=function t(e){t.superclass.constructor.call(this,e),this.set("children",[]),this.set("tobeRemoved",[]),this._beforeRenderUI(),this._renderUI(),this._bindUI()};function f(t){if(!t._cfg&&t!==l){var e=t.superclass.constructor;e&&!e._cfg&&f(e),t._cfg={},r.merge(t._cfg,e._cfg),r.merge(t._cfg,t.CFG)}}r.extend(l,i),r.augment(l,{isGroup:!0,type:"group",canFill:!0,canStroke:!0,getDefaultCfg:function t(){return f(this.constructor),r.merge({},this.constructor._cfg)},_beforeRenderUI:function t(){},_renderUI:function t(){},_bindUI:function t(){},addShape:function t(e,n){var i=this.get("canvas");n=n||{};var s=a[e];if(s||(s=r.upperFirst(e),a[e]=s),n.attrs&&i){var u=n.attrs;if("text"===e){var c=i.get("fontFamily");c&&(u.fontFamily=u.fontFamily?u.fontFamily:c)}}n.canvas=i,n.type=e;var l=new o[s](n);return this.add(l),l},addGroup:function t(e,n){var i=this.get("canvas"),o;if(n=r.merge({},n),r.isFunction(e))n?(n.canvas=i,n.parent=this,o=new e(n)):o=new e({canvas:i,parent:this}),this.add(o);else if(r.isObject(e))e.canvas=i,o=new l(e),this.add(o);else{if(void 0!==e)return!1;o=new l,this.add(o)}return o},renderBack:function t(e,n){var i=this.get("backShape"),o=this.getBBox();return r.merge(n,{x:o.minX-e[3],y:o.minY-e[0],width:o.width+e[1]+e[3],height:o.height+e[0]+e[2]}),i?i.attr(n):i=this.addShape("rect",{zIndex:-1,attrs:n}),this.set("backShape",i),this.sort(),i},removeChild:function t(e,n){if(arguments.length>=2)this.contain(e)&&e.remove(n);else{if(1===arguments.length){if(!r.isBoolean(e))return this.contain(e)&&e.remove(!0),this;n=e}0===arguments.length&&(n=!0),l.superclass.remove.call(this,n)}return this},add:function t(e){var n=this,i=n.get("children");if(r.isArray(e))r.each(e,function(t){var e=t.get("parent");e&&e.removeChild(t,!1),n._setCfgProperty(t)}),n._cfg.children=i.concat(e);else{var o=e,a=o.get("parent");a&&a.removeChild(o,!1),n._setCfgProperty(o),i.push(o)}return n},_setCfgProperty:function t(e){var n=this._cfg;e.set("parent",this),e.set("canvas",n.canvas),n.timeline&&e.set("timeline",n.timeline)},contain:function t(e){var n;return this.get("children").indexOf(e)>-1},getChildByIndex:function t(e){var n;return this.get("children")[e]},getFirst:function t(){return this.getChildByIndex(0)},getLast:function t(){var e=this.get("children").length-1;return this.getChildByIndex(e)},getBBox:function t(){var e=this,n=1/0,i=-1/0,o=1/0,a=-1/0,s=this.get("children");s.length>0?r.each(s,function(t){if(t.get("visible")){if(t.isGroup&&0===t.get("children").length)return;var e=t.getBBox();if(!e)return!0;var r=[e.minX,e.minY,1],s=[e.minX,e.maxY,1],u=[e.maxX,e.minY,1],c=[e.maxX,e.maxY,1];t.apply(r),t.apply(s),t.apply(u),t.apply(c);var l=Math.min(r[0],s[0],u[0],c[0]),f=Math.max(r[0],s[0],u[0],c[0]),h=Math.min(r[1],s[1],u[1],c[1]),p=Math.max(r[1],s[1],u[1],c[1]);li&&(i=f),ha&&(a=p)}}):(n=0,i=0,o=0,a=0);var u={minX:n,minY:o,maxX:i,maxY:a};return u.x=u.minX,u.y=u.minY,u.width=u.maxX-u.minX,u.height=u.maxY-u.minY,u},getCount:function t(){return this.get("children").length},sort:function t(){var e=this.get("children");return r.each(e,function(t,e){return t[s]=e,t}),e.sort(u(function(t,e){return t.get("zIndex")-e.get("zIndex")})),this},findById:function t(e){return this.find(function(t){return t.get("id")===e})},find:function t(e){if(r.isString(e))return this.findById(e);var n=this.get("children"),i=null;return r.each(n,function(t){if(e(t)?i=t:t.find&&(i=t.find(e)),i)return!1}),i},findAll:function t(e){var n=this.get("children"),i=[],o=[];return r.each(n,function(t){e(t)&&i.push(t),t.findAllBy&&(o=t.findAllBy(e),i=i.concat(o))}),i},findBy:function t(e){var n=this.get("children"),i=null;return r.each(n,function(t){if(e(t)?i=t:t.findBy&&(i=t.findBy(e)),i)return!1}),i},findAllBy:function t(e){var n=this.get("children"),i=[],o=[];return r.each(n,function(t){e(t)&&i.push(t),t.findAllBy&&(o=t.findAllBy(e),i=i.concat(o))}),i},getShape:function t(e,n){var r=this,i=this._attrs.clip,o=this._cfg.children,a;if(i){var s=[e,n,1];i.invert(s,this.get("canvas")),i.isPointInPath(s[0],s[1])&&(a=c(o,e,n))}else a=c(o,e,n);return a},clearTotalMatrix:function t(){var e;if(this.get("totalMatrix")){this.setSilent("totalMatrix",null);for(var n=this._cfg.children,r=0;r=0;r--)n[r].remove(!0,e);return this._cfg.children=[],this},destroy:function t(){this.get("destroyed")||(this.clear(),l.superclass.destroy.call(this))},clone:function t(){var e=this,n=this._cfg.children,t=new l;return r.each(n,function(e){t.add(e.clone())}),t}}),t.exports=l},function(t,e,n){var r=n(1),i=function t(e,n,r,i){this.type=e,this.target=null,this.currentTarget=null,this.bubbles=r,this.cancelable=i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.removed=!1,this.event=n};r.augment(i,{preventDefault:function t(){this.defaultPrevented=this.cancelable&&!0},stopPropagation:function t(){this.propagationStopped=!0},remove:function t(){this.remove=!0},clone:function t(){return r.clone(this)},toString:function t(){return"[Event (type="+this.type+")]"}}),t.exports=i},function(t,e,n){var r=n(1),i=n(7),o=n(44),a=n(46);function s(t,e,n){return t+e*Math.cos(n)}function u(t,e,n){return t+e*Math.sin(n)}var c=function t(e){t.superclass.constructor.call(this,e)};c.ATTRS={x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(c,i),r.augment(c,{canStroke:!0,type:"arc",getDefaultAttrs:function t(){return{x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.r,a=e.startAngle,s=e.endAngle,u=e.clockwise,c,l=this.getHitLineWidth()/2,f=o.box(n,r,i,a,s,u);return f.minX-=l,f.minY-=l,f.maxX+=l,f.maxY+=l,f},getStartTangent:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.startAngle,o=e.r,a=e.clockwise,c=Math.PI/180;a&&(c*=-1);var l=[],f=s(n,o,i+c),h=u(r,o,i+c),p=s(n,o,i),d=u(r,o,i);return l.push([f,h]),l.push([p,d]),l},getEndTangent:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.endAngle,o=e.r,a=e.clockwise,c=Math.PI/180,l=[];a&&(c*=-1);var f=s(n,o,i+c),h=u(r,o,i+c),p=s(n,o,i),d=u(r,o,i);return l.push([p,d]),l.push([f,h]),l},createPath:function t(e){var n=this._attrs,r=n.x,i=n.y,o=n.r,a=n.startAngle,s=n.endAngle,u=n.clockwise;(e=e||self.get("context")).beginPath(),e.arc(r,i,o,a,s,u)},afterPath:function t(e){var n=this._attrs;if(e=e||this.get("context"),n.startArrow){var r=this.getStartTangent();a.addStartArrow(e,n,r[0][0],r[0][1],r[1][0],r[1][1])}if(n.endArrow){var i=this.getEndTangent();a.addEndArrow(e,n,i[0][0],i[0][1],i[1][0],i[1][1])}}}),t.exports=c},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,r:0,lineWidth:1},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"circle",getDefaultAttrs:function t(){return{lineWidth:1}},calculateBox:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.r,o,a=this.getHitLineWidth()/2+i;return{minX:n-a,minY:r-a,maxX:n+a,maxY:r+a}},createPath:function t(e){var n=this._attrs,r=n.x,i=n.y,o=n.r;e.beginPath(),e.arc(r,i,o,0,2*Math.PI,!1),e.closePath()}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"dom",calculateBox:function t(){var e=this,n=this._attrs,r=n.x,i=n.y,o=n.width,a=n.height,s,u=this.getHitLineWidth()/2;return{minX:r-u,minY:i-u,maxX:r+o+u,maxY:i+a+u}}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,rx:1,ry:1,lineWidth:1},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"ellipse",getDefaultAttrs:function t(){return{lineWidth:1}},calculateBox:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.rx,o=e.ry,a=this.getHitLineWidth(),s=i+a/2,u=o+a/2;return{minX:n-s,minY:r-u,maxX:n+s,maxY:r+u}},createPath:function t(e){var n=this._attrs,i=n.x,o=n.y,a=n.rx,s=n.ry;e=e||self.get("context");var u=a>s?a:s,c=a>s?1:a/s,l=a>s?s/a:1,f=[1,0,0,0,1,0,0,0,1];r.mat3.scale(f,f,[c,l]),r.mat3.translate(f,f,[i,o]),e.beginPath(),e.save(),e.transform(f[0],f[1],f[3],f[4],f[6],f[7]),e.arc(0,0,u,0,2*Math.PI),e.restore(),e.closePath()}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=n(44),a=function t(e){t.superclass.constructor.call(this,e)};a.ATTRS={x:0,y:0,rs:0,re:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1},r.extend(a,i),r.augment(a,{canFill:!0,canStroke:!0,type:"fan",getDefaultAttrs:function t(){return{clockwise:!1,lineWidth:1,rs:0,re:0}},calculateBox:function t(){var e=this,n=this._attrs,r=n.x,i=n.y,a=n.rs,s=n.re,u=n.startAngle,c=n.endAngle,l=n.clockwise,f=this.getHitLineWidth(),h=o.box(r,i,a,u,c,l),p=o.box(r,i,s,u,c,l),d,v,g,y,m=f/2;return{minX:Math.min(h.minX,p.minX)-m,minY:Math.min(h.minY,p.minY)-m,maxX:Math.max(h.maxX,p.maxX)+m,maxY:Math.max(h.maxY,p.maxY)+m}},createPath:function t(e){var n=this._attrs,r=n.x,i=n.y,o=n.rs,a=n.re,s=n.startAngle,u=n.endAngle,c=n.clockwise,l={x:Math.cos(s)*o+r,y:Math.sin(s)*o+i},f={x:Math.cos(s)*a+r,y:Math.sin(s)*a+i},h={x:Math.cos(u)*o+r,y:Math.sin(u)*o+i};(e=e||self.get("context")).beginPath(),e.moveTo(l.x,l.y),e.lineTo(f.x,f.y),e.arc(r,i,a,s,u,c),e.lineTo(h.x,h.y),e.arc(r,i,o,u,s,!c),e.closePath()}}),t.exports=a},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,img:void 0,width:0,height:0,sx:null,sy:null,swidth:null,sheight:null},r.extend(o,i),r.augment(o,{type:"image",isHitBox:function t(){return!1},calculateBox:function t(){var e=this._attrs;this._cfg.attrs&&this._cfg.attrs.img===e.img||this._setAttrImg();var n=e.x,r=e.y,i,o;return{minX:n,minY:r,maxX:n+e.width,maxY:r+e.height}},_beforeSetLoading:function t(e){var n=this.get("canvas");return!1===e&&!0===this.get("toDraw")&&(this._cfg.loading=!1,n.draw()),e},_setAttrImg:function t(){var e=this,n=e._attrs,i=n.img;if(!r.isString(i))return i instanceof Image?(n.width||e.attr("width",i.width),n.height||e.attr("height",i.height),i):i instanceof HTMLElement&&r.isString(i.nodeName)&&"CANVAS"===i.nodeName.toUpperCase()?(n.width||e.attr("width",Number(i.getAttribute("width"))),n.height||e.attr("height",Number(i.getAttribute("height"))),i):i instanceof ImageData?(n.width||e.attr("width",i.width),n.height||e.attr("height",i.height),i):null;var o=new Image;o.onload=function(){if(e.get("destroyed"))return!1;e.attr("imgSrc",i),e.attr("img",o);var t=e.get("callback");t&&t.call(e),e.set("loading",!1)},o.src=i,o.crossOrigin="Anonymous",e.set("loading",!0)},drawInner:function t(e){this._cfg.hasUpdate&&this._setAttrImg(),this.get("loading")?this.set("toDraw",!0):(this._drawImage(e),this._cfg.hasUpdate=!1)},_drawImage:function t(e){var n=this._attrs,i=n.x,o=n.y,a=n.img,s=n.width,u=n.height,c=n.sx,l=n.sy,f=n.swidth,h=n.sheight;this.set("toDraw",!1);var p=a;if(p instanceof ImageData&&((p=new Image).src=a),p instanceof Image||p instanceof HTMLElement&&r.isString(p.nodeName)&&"CANVAS"===p.nodeName.toUpperCase()){if(r.isNil(c)||r.isNil(l)||r.isNil(f)||r.isNil(h))return void e.drawImage(p,i,o,s,u);if(!(r.isNil(c)||r.isNil(l)||r.isNil(f)||r.isNil(h)))return void e.drawImage(p,c,l,f,h,i,o,s,u)}}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=n(46),a=n(45),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={x1:0,y1:0,x2:0,y2:0,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(s,i),r.augment(s,{canStroke:!0,type:"line",getDefaultAttrs:function t(){return{lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function t(){var e=this._attrs,n=e.x1,r=e.y1,i=e.x2,o=e.y2,s=this.getHitLineWidth();return a.box(n,r,i,o,s)},createPath:function t(e){var n=this._attrs,r=n.x1,i=n.y1,o=n.x2,a=n.y2;(e=e||self.get("context")).beginPath(),e.moveTo(r,i),e.lineTo(o,a)},afterPath:function t(e){var n=this._attrs,r=n.x1,i=n.y1,a=n.x2,s=n.y2;e=e||this.get("context"),n.startArrow&&o.addStartArrow(e,n,a,s,r,i),n.endArrow&&o.addEndArrow(e,n,r,i,a,s)},getPoint:function t(e){var n=this._attrs;return{x:a.at(n.x1,n.x2,e),y:a.at(n.y1,n.y2,e)}}}),t.exports=s},function(t,e){t.exports={xAt:function t(e,n,r,i,o){return n*Math.cos(e)*Math.cos(o)-r*Math.sin(e)*Math.sin(o)+i},yAt:function t(e,n,r,i,o){return n*Math.sin(e)*Math.cos(o)+r*Math.cos(e)*Math.sin(o)+i},xExtrema:function t(e,n,r){return Math.atan(-r/n*Math.tan(e))},yExtrema:function t(e,n,r){return Math.atan(r/(n*Math.tan(e)))}}},function(t,e,n){var r=n(1),i=r.vec2;function o(t,e,n,r){var i=1-r;return i*(i*t+2*r*e)+r*r*n}function a(t,e,n,r,a,s,u,c,l){var f,h=.005,p=1/0,d,v,g,y,m,b,x=1e-4,_=[u,c];for(y=0;y<1;y+=.05)v=[o(t,n,a,y),o(e,r,s,y)],(d=i.squaredDistance(_,v))=0&&d=0?[o]:[]}t.exports={at:o,projectPoint:function t(e,n,r,i,o,s,u,c){var l={};return a(e,n,r,i,o,s,u,c,l),l},pointDistance:a,extrema:s}},function(t,e,n){var r=n(1),i=n(7),o=n(47),a=n(36),s=n(46),u=n(71),c=n(69),l=function t(e){t.superclass.constructor.call(this,e)};l.ATTRS={path:null,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(l,i),r.augment(l,{canFill:!0,canStroke:!0,type:"path",getDefaultAttrs:function t(){return{lineWidth:1,startArrow:!1,endArrow:!1}},_afterSetAttrPath:function t(e){var n=this;if(r.isNil(e))return this.setSilent("segments",null),void this.setSilent("box",void 0);var i=a.parsePath(e),s,u=[];if(r.isArray(i)&&0!==i.length&&("M"===i[0][0]||"m"===i[0][0])){for(var c=i.length,l=0;la&&(a=e.maxX),e.minYu&&(u=e.maxY))}),o===1/0||s===1/0?{minX:0,minY:0,maxX:0,maxY:0}:{minX:o,minY:s,maxX:a,maxY:u}},_setTcache:function t(){var e=0,n=0,i=[],o,a,s,u,l=this._cfg.curve;l&&(r.each(l,function(t,n){s=l[n+1],u=t.length,s&&(e+=c.len(t[u-2],t[u-1],s[1],s[2],s[3],s[4],s[5],s[6]))}),r.each(l,function(t,r){s=l[r+1],u=t.length,s&&((o=[])[0]=n/e,a=c.len(t[u-2],t[u-1],s[1],s[2],s[3],s[4],s[5],s[6]),n+=a,o[1]=n/e,i.push(o))}),this._cfg.tCache=i)},_calculateCurve:function t(){var e=this,n,r=this._attrs.path;this._cfg.curve=u.pathTocurve(r)},getStartTangent:function t(){var e=this.get("segments"),n,i,o,a;if(e.length>1)if(n=e[0].endPoint,i=e[1].endPoint,o=e[1].startTangent,a=[],r.isFunction(o)){var s=o();a.push([n.x-s[0],n.y-s[1]]),a.push([n.x,n.y])}else a.push([i.x,i.y]),a.push([n.x,n.y]);return a},getEndTangent:function t(){var e=this.get("segments"),n=e.length,i,o,a,s;if(n>1)if(i=e[n-2].endPoint,o=e[n-1].endPoint,a=e[n-1].endTangent,s=[],r.isFunction(a)){var u=a();s.push([o.x-u[0],o.y-u[1]]),s.push([o.x,o.y])}else s.push([i.x,i.y]),s.push([o.x,o.y]);return s},getPoint:function t(e){var n=this._cfg.tCache,i,o;n||(this._calculateCurve(),this._setTcache(),n=this._cfg.tCache);var a=this._cfg.curve;if(!n)return a?{x:a[0][1],y:a[0][2]}:null;r.each(n,function(t,n){e>=t[0]&&e<=t[1]&&(i=(e-t[0])/(t[1]-t[0]),o=n)});var s=a[o];if(r.isNil(s)||r.isNil(o))return null;var u=s.length,l=a[o+1];return{x:c.at(s[u-2],l[1],l[3],l[5],1-i),y:c.at(s[u-1],l[2],l[4],l[6],1-i)}},createPath:function t(e){var n=this,i=this.get("segments");if(r.isArray(i)){(e=e||this.get("context")).beginPath();for(var o=i.length,a=0;au&&(u=e),nc&&(c=n)});var l=o/2;return{minX:a-l,minY:s-l,maxX:u+l,maxY:c+l}},createPath:function t(e){var n=this,i,o=this._attrs.points;o.length<2||((e=e||this.get("context")).beginPath(),r.each(o,function(t,n){0===n?e.moveTo(t[0],t[1]):e.lineTo(t[0],t[1])}),e.closePath())}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=n(46),a=n(45),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={points:null,lineWidth:1,startArrow:!1,endArrow:!1,tCache:null},r.extend(s,i),r.augment(s,{canStroke:!0,type:"polyline",tCache:null,getDefaultAttrs:function t(){return{lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function t(){var e=this,n=this._attrs,i=this.getHitLineWidth(),o=n.points;if(!o||0===o.length)return null;var a=1/0,s=1/0,u=-1/0,c=-1/0;r.each(o,function(t){var e=t[0],n=t[1];eu&&(u=e),nc&&(c=n)});var l=i/2;return{minX:a-l,minY:s-l,maxX:u+l,maxY:c+l}},_setTcache:function t(){var e=this,n,i=this._attrs.points,o=0,s=0,u=[],c,l;i&&0!==i.length&&(r.each(i,function(t,e){i[e+1]&&(o+=a.len(t[0],t[1],i[e+1][0],i[e+1][1]))}),o<=0||(r.each(i,function(t,e){i[e+1]&&((c=[])[0]=s/o,l=a.len(t[0],t[1],i[e+1][0],i[e+1][1]),s+=l,c[1]=s/o,u.push(c))}),this.tCache=u))},createPath:function t(e){var n=this,r,i=this._attrs.points,o,a;if(!(i.length<2)){for((e=e||this.get("context")).beginPath(),e.moveTo(i[0][0],i[0][1]),a=1,o=i.length-1;a=t[0]&&e<=t[1]&&(s=(e-t[0])/(t[1]-t[0]),u=n)}),{x:a.at(i[u][0],i[u+1][0],s),y:a.at(i[u][1],i[u+1][1],s)}}}),t.exports=s},function(t,e,n){var r=n(1),i,o=n(36).parseRadius,a=n(7),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={x:0,y:0,width:0,height:0,radius:0,lineWidth:1},r.extend(s,a),r.augment(s,{canFill:!0,canStroke:!0,type:"rect",getDefaultAttrs:function t(){return{lineWidth:1,radius:0}},calculateBox:function t(){var e=this,n=this._attrs,r=n.x,i=n.y,o=n.width,a=n.height,s,u=this.getHitLineWidth()/2;return{minX:r-u,minY:i-u,maxX:r+o+u,maxY:i+a+u}},createPath:function t(e){var n=this,r=this._attrs,i=r.x,a=r.y,s=r.width,u=r.height,c=r.radius;if((e=e||this.get("context")).beginPath(),0===c)e.rect(i,a,s,u);else{var l=o(c);e.moveTo(i+l.r1,a),e.lineTo(i+s-l.r2,a),0!==l.r2&&e.arc(i+s-l.r2,a+l.r2,l.r2,-Math.PI/2,0),e.lineTo(i+s,a+u-l.r3),0!==l.r3&&e.arc(i+s-l.r3,a+u-l.r3,l.r3,0,Math.PI/2),e.lineTo(i+l.r4,a+u),0!==l.r4&&e.arc(i+l.r4,a+u-l.r4,l.r4,Math.PI/2,Math.PI),e.lineTo(i,a+l.r1),0!==l.r1&&e.arc(i+l.r1,a+l.r1,l.r1,Math.PI,1.5*Math.PI),e.closePath()}}}),t.exports=s},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom",lineHeight:null,textArr:null},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"text",getDefaultAttrs:function t(){return{lineWidth:1,lineCount:1,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"}},initTransform:function t(){var e=this._attrs.fontSize;e&&+e<12&&this.transform([["t",-1*this._attrs.x,-1*this._attrs.y],["s",+e/12,+e/12],["t",this._attrs.x,this._attrs.y]])},_assembleFont:function t(){var e=this._attrs,n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;e.font=[o,a,i,n+"px",r].join(" ")},_setAttrText:function t(){var e=this._attrs,n=e.text,i=null;if(r.isString(n)&&-1!==n.indexOf("\n")){var o=(i=n.split("\n")).length;e.lineCount=o}e.textArr=i},_getTextHeight:function t(){var e=this._attrs,n=e.lineCount,r=1*e.fontSize,i;return n>1?r*n+this._getSpaceingY()*(n-1):r},isHitBox:function t(){return!1},calculateBox:function t(){var e=this,n=this._attrs,r=this._cfg;r.attrs&&!r.hasUpdate||(this._assembleFont(),this._setAttrText()),n.textArr||this._setAttrText();var i=n.x,o=n.y,a=this.measureText();if(!a)return{minX:i,minY:o,maxX:i,maxY:o};var s=this._getTextHeight(),u=n.textAlign,c=n.textBaseline,l=this.getHitLineWidth(),f={x:i,y:o-s};u&&("end"===u||"right"===u?f.x-=a:"center"===u&&(f.x-=a/2)),c&&("top"===c?f.y+=s:"middle"===c&&(f.y+=s/2)),this.set("startPoint",f);var h=l/2;return{minX:f.x-h,minY:f.y-h,maxX:f.x+a+h,maxY:f.y+s+h}},_getSpaceingY:function t(){var e=this._attrs,n=e.lineHeight,r=1*e.fontSize;return n?n-r:.14*r},drawInner:function t(e){var n=this,i=this._attrs,o=this._cfg;o.attrs&&!o.hasUpdate||(this._assembleFont(),this._setAttrText()),e.font=i.font;var a=i.text;if(a){var s=i.textArr,u=i.x,c=i.y;if(e.beginPath(),this.hasStroke()){var l=i.strokeOpacity;r.isNil(l)||1===l||(e.globalAlpha=l),s?this._drawTextArr(e,!1):e.strokeText(a,u,c),e.globalAlpha=1}if(this.hasFill()){var f=i.fillOpacity;r.isNil(f)||1===f||(e.globalAlpha=f),s?this._drawTextArr(e,!0):e.fillText(a,u,c)}o.hasUpdate=!1}},_drawTextArr:function t(e,n){var i=this._attrs.textArr,o=this._attrs.textBaseline,a=1*this._attrs.fontSize,s=this._getSpaceingY(),u=this._attrs.x,c=this._attrs.y,l=this.getBBox(),f=l.maxY-l.minY,h;r.each(i,function(t,r){h=c+r*(s+a)-f+a,"middle"===o&&(h+=f-a-(f-a)/2),"top"===o&&(h+=f-a),n?e.fillText(t,u,h):e.strokeText(t,u,h)})},measureText:function t(){var e=this,n=this._attrs,i=n.text,o=n.font,a=n.textArr,s,u=0;if(!r.isNil(i)){var c=document.createElement("canvas").getContext("2d");return c.save(),c.font=o,a?r.each(a,function(t){s=c.measureText(t).width,u0&&t%n!=0;n--);if(1===n)for(n=e;n>0&&(t-1)%n!=0;n--);return n}t.exports=function(t){var e={},n=[],r=t.isRounding,i=a(t.data),o=i.length,u=t.maxCount||8,c;if(r?2===(c=s(o-1,u-1)+1)?c=u:cn&&(e=parseFloat(e.toFixed(r)))}else for(;t>10;)e*=10,t/=10;return e}function i(t,e){var n=t.length;if(0===n)return NaN;var r=t[0];if(e=t[n-1])return t[n-1];for(var i=1;it[n-1])return NaN;if(en&&(c=e/parseInt(1/s)*(s>0?1:-1));return c},snapMultiple:function t(e,n,r){var i;return(i="ceil"===r?Math.ceil(e/n):"floor"===r?Math.floor(e/n):Math.round(e/n))*n},snapTo:function t(e,n){var r=i(e,n),a=o(e,n);if(isNaN(r)||isNaN(a)){if(e[0]>=n)return e[0];var s=e[e.length-1];if(s<=n)return s}return Math.abs(n-r)20&&(o=20),parseFloat(e.toFixed(o))}};t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(26),o=n(141),a=n(2),s=n(11),u=n(14),c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function e(){t.prototype._initDefaultCfg.call(this),this.type="cat",this.isCategory=!0,this.isRounding=!0},n.init=function t(){var e=this,n=this.values,r=this.tickCount;if(a(n,function(t,e){n[e]=t.toString()}),!this.ticks){var i=n,s;if(r)i=o({maxCount:r,data:n,isRounding:this.isRounding}).ticks;this.ticks=i}},n.getText=function e(n){return-1===this.values.indexOf(n)&&s(n)&&(n=this.values[Math.round(n)]),t.prototype.getText.call(this,n)},n.translate=function t(e){var n=this.values.indexOf(e);return-1===n&&s(e)?n=e:-1===n&&(n=NaN),n},n.scale=function t(e){var n=this.rangeMin(),r=this.rangeMax(),i;return(u(e)||-1!==this.values.indexOf(e))&&(e=this.translate(e)),n+(i=this.values.length>1?e/(this.values.length-1):e)*(r-n)},n.invert=function t(e){if(u(e))return e;var n=this.rangeMin(),r=this.rangeMax();er&&(e=r);var i=(e-n)/(r-n),o=Math.round(i*(this.values.length-1))%this.values.length;return o=o||0,this.values[o]},e}(i);i.Cat=c,t.exports=c},function(t,e,n){var r=n(178),i=n(26);i.Linear=n(48),i.Identity=n(333),i.Cat=n(143),i.Time=n(337),i.TimeCat=n(336),i.Log=n(334),i.Pow=n(335);var o=function t(e){if(i.hasOwnProperty(e)){var n=r(e);i[n]=function(t){return new i[e](t)}}};for(var a in i)o(a);var s=["cat","timeCat"];i.isCategory=function(t){return s.indexOf(t)>=0},t.exports=i},function(t,e,n){var r=n(14),i=n(183);t.exports={toTimeStamp:function t(e){return r(e)&&(e=e.indexOf("T")>0?new Date(e).getTime():new Date(e.replace(/-/gi,"/")).getTime()),i(e)&&(e=e.getTime()),e}}},function(t,e,n){var r=n(20),i=Array.prototype.splice,o=function t(e,n){if(!r(e))return[];for(var o=e?n.length:0,a=o-1;o--;){var s=void 0,u=n[o];o!==a&&u===s||(s=u,i.call(e,u,1))}return e};t.exports=o},function(t,e){var n=Array.prototype,r=n.splice,i=n.indexOf,o=n.slice,a=function t(e){for(var n=o.call(arguments,1),a=0;a-1;)r.call(e,u,1);return e};t.exports=a},function(t,e,n){var r=n(2),i=n(49),o=function t(e){var n=[];return r(e,function(t){i(n,t)||n.push(t)}),n};t.exports=o},function(t,e,n){var r=n(13),i=n(53),o=n(10),a=function t(e){for(var n=i(arguments),a=1;a]*>/,o={tr:document.createElement("tbody"),tbody:n,thead:n,tfoot:n,td:r,th:r,"*":document.createElement("div")};t.exports=function t(e){var n=i.test(e)&&RegExp.$1;n in o||(n="*");var r=o[n];e=e.replace(/(^\s*)|(\s*$)/g,""),r.innerHTML=""+e;var a=r.childNodes[0];return r.removeChild(a),a}},function(t,e){t.exports=function t(e,n){if(e)for(var r in n)n.hasOwnProperty(r)&&(e.style[r]=n[r]);return e}},function(t,e){t.exports=function t(e){var n;return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)})(e)}},function(t,e,n){var r=n(13),i=n(10),o=function t(e,n,o,a){r(n)||(o=n,n=e,e=function t(){});var s=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},u=s(n.prototype,e);return e.prototype=i(u,e.prototype),e.superclass=s(n.prototype,n),i(u,o),i(e,a),e};t.exports=o},function(t,e,n){var r=n(2),i=n(4),o=Object.prototype.hasOwnProperty,a=function t(e,n){if(!n||!i(e))return e;var a={},s=null;return r(e,function(t){s=n(t),o.call(a,s)?a[s].push(t):a[s]=[t]}),a};t.exports=a},function(t,e,n){var r=n(13),i=n(4),o=n(154),a=function t(e,n){if(!n)return{0:e};if(!r(n)){var a=i(n)?n:n.replace(/\s+/g,"").split("*");n=function t(e){for(var n="_",r=0,i=a.length;rs&&(a=t,s=u)}),a}};t.exports=a},function(t,e){var n=function t(e,n){return(e%n+n)%n};t.exports=n},function(t,e){var n=180/Math.PI,r=function t(e){return n*e};t.exports=r},function(t,e){t.exports=parseInt},function(t,e){var n=Math.PI/180,r=function t(e){return n*e};t.exports=r},function(t,e,n){var r=n(74),i=n(2),o=n(79);t.exports=function t(e,n){return e=r(e),i(n,function(t){switch(t[0]){case"t":o.translate(e,e,[t[1],t[2]]);break;case"s":o.scale(e,e,[t[1],t[2]]);break;case"r":o.rotate(e,e,t[1]);break;case"m":o.multiply(e,e,t[1]);break;default:return!1}}),e}},function(t,e,n){var r=n(329),i=n(78);r.angle=function(t,e){var n=r.dot(t,e)/(r.length(t)*r.length(e));return Math.acos(i(n,-1,1))},r.direction=function(t,e){return t[0]*e[1]-e[0]*t[1]},r.angleTo=function(t,e,n){var i=r.angle(t,e),o=r.direction(t,e)>=0;return n?o?2*Math.PI-i:i:o?i:2*Math.PI-i},r.vertical=function(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t},t.exports=r},function(t,e,n){var r=n(330);t.exports=r},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,n){var r=n(169),i=n(6);function o(t,e){var n=r(e),o=n.length;if(i(t))return!o;for(var a=0;ai;i+=2){var a=[{x:+e[i-2],y:+e[i-1]},{x:+e[i],y:+e[i+1]},{x:+e[i+2],y:+e[i+3]},{x:+e[i+4],y:+e[i+5]}];n?i?o-4===i?a[3]={x:+e[0],y:+e[1]}:o-2===i&&(a[2]={x:+e[0],y:+e[1]},a[3]={x:+e[2],y:+e[3]}):a[0]={x:+e[o-2],y:+e[o-1]}:o-4===i?a[3]=a[2]:i||(a[0]={x:+e[i],y:+e[i+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r}},function(t,e){var n=/,?([a-z]),?/gi;t.exports=function t(e){return e.join(",").replace(n,"$1")}},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",i=new RegExp("([a-z])["+r+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+r+"]*,?["+r+"]*)+)","ig"),o=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+r+"]*,?["+r+"]*","ig");t.exports=function t(e){if(!e)return null;if((void 0===e?"undefined":n(e))===n([]))return e;var r={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},a=[];return String(e).replace(i,function(t,e,n){var i=[],s=e.toLowerCase();if(n.replace(o,function(t,e){e&&i.push(+e)}),"m"===s&&i.length>2&&(a.push([e].concat(i.splice(0,2))),s="l",e="m"===e?"l":"L"),"o"===s&&1===i.length&&a.push([e,i[0]]),"r"===s)a.push([e].concat(i));else for(;i.length>=r[s]&&(a.push([e].concat(i.splice(0,r[s]))),r[s]););}),a}},function(t,e,n){var r=n(173),i=n(171);function o(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),u=t+n*Math.cos(-i*a),c,l;o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,u,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o}t.exports=function t(e){if(!(e=r(e))||!e.length)return[["M",0,0]];var n=[],a=0,s=0,u=0,c=0,l=0,f=void 0,h=void 0;"M"===e[0][0]&&(u=a=+e[0][1],c=s=+e[0][2],l++,n[0]=["M",a,s]);for(var p=3===e.length&&"M"===e[0][0]&&"R"===e[1][0].toUpperCase()&&"Z"===e[2][0].toUpperCase(),d,v,g=l,y=e.length;g1&&(r*=w=Math.sqrt(w),i*=w);var O=r*r,j=i*i,S=(a===s?-1:1)*Math.sqrt(Math.abs((O*j-O*_*_-j*x*x)/(O*_*_+j*x*x)));y=S*r*_/i+(e+u)/2,m=S*-i*x/r+(n+c)/2,v=Math.asin(((n-m)/i).toFixed(9)),g=Math.asin(((c-m)/i).toFixed(9)),v=eg&&(v-=2*Math.PI),!s&&g>v&&(g-=2*Math.PI)}var E=g-v;if(Math.abs(E)>f){var M=g,C=u,P=c;g=v+f*(s&&g>v?1:-1),p=t(u=y+r*Math.cos(g),c=m+i*Math.sin(g),r,i,o,0,s,C,P,[g,M,y,m])}E=g-v;var k=Math.cos(v),T=Math.sin(v),A=Math.cos(g),I=Math.sin(g),L=Math.tan(E/4),N=4/3*r*L,D=4/3*i*L,R=[e,n],F=[e+N*T,n-D*k],z=[u+N*I,c-D*A],B=[u,c];if(F[0]=2*R[0]-F[0],F[1]=2*R[1]-F[1],l)return[F,z,B].concat(p);for(var Y=[],V=0,W=(p=[F,z,B].concat(p).join().split(",")).length;V7){e[n].shift();for(var r=e[n];r.length;)f[n]="A",u&&(h[n]="A"),e.splice(n++,0,["C"].concat(r.splice(0,6)));e.splice(n,1),v=Math.max(s.length,u&&u.length||0)}},m=function t(e,n,r,i,o){e&&n&&"M"===e[o][0]&&"M"!==n[o][0]&&(n.splice(o,0,["M",i.x,i.y]),r.bx=0,r.by=0,r.x=e[o][1],r.y=e[o][2],v=Math.max(s.length,u&&u.length||0))};v=Math.max(s.length,u&&u.length||0);for(var b=0;b1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];a.default.each(e,function(e){var r=e.prop,i=e.event,o=n[r];if(a.default.isFunction(o))t.on(i,o);else if(a.default.isObject(o))for(var s in o)void 0!==o[s]&&t.on(s+":"+i,o[s])})}function O(t,e){w(t,b,e)}function j(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments[3];a.default.each(e,function(e){var i=e.prop,o=e.event,s=n[i],u=r[i],c=void 0;if(!a.default.shallowEqual(s,u))if(a.default.isFunction(s)&&a.default.isFunction(u))t.off(o,s),t.on(o,u);else if(a.default.isObject(s)&&a.default.isObject(u)){for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&t.off(c+":"+o,s[c]);for(c in u)Object.prototype.hasOwnProperty.call(u,c)&&t.on(c+":"+o,u[c])}})}function S(t,e,n){j(t,b,e,n)}function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];a.default.each(e,function(e){var r=e.prop,i=e.event,o=n[r];if(a.default.isFunction(o))t.off(i,o);else if(a.default.isObject(o))for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&t.off(s+":"+i,o[s])})}function M(t,e){E(t,b,e)}e.default={baseEventObjectTypes:x,baseEventFuncTypes:_,genBaseEvents:y,genItemBaseEvents:m,bindEvents:w,bindBaseEvents:O,updateEvents:j,updateBaseEvents:S,unbindEvents:E,unbindBaseEvents:M,chartEvents:g}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var y=u.default.COORD_FUNC_PROPS,m=u.default.GEOM_FUNC_PROPS;e.default={createChart:function t(e){var n=e.chart,r=new o.Chart(n.props);return n.g2Instance=r,r},executeChartConfig:function t(e,n){var r,i=n.chart.props;e.coord("rect",{}),e.source(i.data,i.scale),(n.facet||i.axis)&&n.facet&&!1!==i.axis||e.axis(!1),e.legend(!1),e.tooltip(!1),i.filter&&i.filter.forEach(function(t){e.filter(t[0],t[1])}),l.default.bindEvents(e,l.default.chartEvents,i),l.default.bindBaseEvents(e,i)},coord:function t(e,n){var r=n.coord;if(r&&!r.g2Instance){var i=r.props,o=i.type,s=g(i,["type"]),u=e.coord(o||"rect",a.Util.without(s,y));a.Prop.init(y,s,function(t,e){"reflect"===e?a.Util.each(t,function(t){return u[e](t)}):u[e].apply(u,v(t))}),r.g2Instance=u}},createLabel:function t(e,n){if(n&&!n.g2Instance){var r=n.props,i=r.content,o=g(r,["content"]);i&&(a.Util.isArray(i)?n.g2Instance=e.label(i[0],i[1],o):n.g2Instance=e.label(i,o))}},createGeom:function t(e,n){if(n.g2Instance)n.label&&this.createLabel(n.g2Instance,n.label);else{var r=n.props,i=e[r.type||"interval"]();r.adjust&&i.adjust(r.adjust),a.Prop.init(m,r,function(t,e){i[e].apply(i,v(t))}),n.g2Instance=i,this.createLabel(i,n.label)}},geoms:function t(e,n){var t=n.geoms;if(t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.createGeom(e,t[r])},legends:function t(e,n){var t=n.legends;for(var r in t)if(t[r]){var i=t[r];if(i.g2Instance)return;var o=i.props,a=o.name,s=o.visible,u=g(o,["name","visible"]),c=s;Object.prototype.hasOwnProperty.call(i.props,"visible")||(c=!0);var l=c?u:c;i.g2Instance=e.legend.apply(e,v(a?[a,l]:[l]))}},tooltip:function t(e,n){var i=n.tooltip;i&&!i.g2Instance&&(i.g2Instance=e.tooltip(r({},i.props)))},createAxis:function t(e,n){if(!n.g2Instance){var r=n.props,i=r.name,o=r.visible,a=g(r,["name","visible"]);o||!Object.prototype.hasOwnProperty.call(n.props,"visible")?n.g2Instance=e.axis(i,a):n.g2Instance=e.axis(i,!1)}},axises:function t(e,n){var t=n.axises;for(var r in t)t[r]&&this.createAxis(e,t[r])},views:function t(e,n){var t=n.views;for(var r in t)t[r]&&this.createView(e,t[r])},createView:function t(e,n){if("Facet"!==n.parentInfo.name){if(n.g2Instance)return n.filter&&n.filter.forEach(function(t){n.g2Instance.filter(t[0],t[1])}),this.coord(n.g2Instance,n),this.axises(n.g2Instance,n),this.geoms(n.g2Instance,n),void this.guide(n.g2Instance,n.guide);var i=n.props,o=i.scale,a=i.data,s=i.instance,u=i.axis,c=i.filter,l=i.geoms,f=g(i,["scale","data","instance","axis","filter","geoms"]),h=void 0;h=s||e.view(r({},f)),a&&h.source(a,o),o&&h.scale(o),c&&c.forEach(function(t){h.filter(t[0],t[1])}),!0===u||s||h.axis(!1),n.g2Instance=h,this.coord(h,n),this.axises(h,n),this.geoms(h,n),this.guide(h,n.guide)}},facetView:function t(e,n){var r=n.props,i=r.scale,o=r.data,a=r.axis,s=r.geoms,u=g(r,["scale","data","axis","geoms"]);o&&e.source(o,i),i&&e.scale(i),!1===a&&e.axis(!1),this.coord(e,n),this.axises(e,n),this.geoms(e,n),this.guide(e,n.guide),h.default.mergeView(n,!0)},guide:function t(e,n){if(n){var r=n.elements;for(var i in r)if(r[i]){var o=r[i];if(!o.g2Instance){var a=o.props,s=a.type,u=g(a,["type"]);o.g2Instance=e.guide()[o.type](u)}}}},facet:function t(e,n){var r=this,i=n.facet;if(i&&!i.g2Instance){var o=i.props,a=o.children,s=o.type,u=g(o,["children","type"]);if(a){var c=n.views,l=null;for(var f in c)if(c[f]&&"Facet"===c[f].parentInfo.name&&c[f].parentInfo.id===i.id){l=c[f];break}l&&(h.default.mergeView(l,!0),u.eachView=function(t){r.facetView(t,l)},e.facet(s,u))}else e.facet(s,u)}},synchronizeG2Add:function t(e,n){this.coord(e,n),this.axises(e,n),this.legends(e,n),this.tooltip(e,n),this.geoms(e,n),this.facet(e,n),this.views(e,n),this.guide(e,n.guide)},synchronizeG2Views:function t(e,n){var r=n.views;for(var i in r)r[i]&&this.synchronizeG2View(r[i].g2Instance,r[i])},synchronizeG2View:function t(e,n){e.clear(),this.clearViewG2Instance(n);var r=n.props,i=r.scale,o=r.data,a=r.instance,s=r.axis,u=r.geoms,c=g(r,["scale","data","instance","axis","geoms"]);o&&e.source(o,i),i&&e.scale(i),!0===s||a||e.axis(!1),this.coord(e,n),this.axises(e,n),this.geoms(e,n),this.guide(e,n.guide)},clearViewG2Instance:function t(e){e.coord&&delete e.coord.g2Instance,e.axises&&Object.keys(e.axises).forEach(function(t){delete e.axises[t].g2Instance}),e.geoms&&Object.keys(e.geoms).forEach(function(t){delete e.geoms[t].g2Instance,e.geoms[t].label&&delete e.geoms[t].label.g2Instance}),e.guide&&e.guide.elements&&Object.keys(e.guide.elements).forEach(function(t){delete e.guide.elements[t].g2Instance})}}},function(t,e,n){"use strict";n.d(e,"b",function(){return r}),n.d(e,"a",function(){return i});var r=Math.PI/180,i=180/Math.PI},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(430);n.d(e,"easeLinear",function(){return r.a});var i=n(432);n.d(e,"easeQuad",function(){return i.a}),n.d(e,"easeQuadIn",function(){return i.b}),n.d(e,"easeQuadOut",function(){return i.c}),n.d(e,"easeQuadInOut",function(){return i.a});var o=n(427);n.d(e,"easeCubic",function(){return o.a}),n.d(e,"easeCubicIn",function(){return o.b}),n.d(e,"easeCubicOut",function(){return o.c}),n.d(e,"easeCubicInOut",function(){return o.a});var a=n(431);n.d(e,"easePoly",function(){return a.a}),n.d(e,"easePolyIn",function(){return a.b}),n.d(e,"easePolyOut",function(){return a.c}),n.d(e,"easePolyInOut",function(){return a.a});var s=n(433);n.d(e,"easeSin",function(){return s.a}),n.d(e,"easeSinIn",function(){return s.b}),n.d(e,"easeSinOut",function(){return s.c}),n.d(e,"easeSinInOut",function(){return s.a});var u=n(429);n.d(e,"easeExp",function(){return u.a}),n.d(e,"easeExpIn",function(){return u.b}),n.d(e,"easeExpOut",function(){return u.c}),n.d(e,"easeExpInOut",function(){return u.a});var c=n(426);n.d(e,"easeCircle",function(){return c.a}),n.d(e,"easeCircleIn",function(){return c.b}),n.d(e,"easeCircleOut",function(){return c.c}),n.d(e,"easeCircleInOut",function(){return c.a});var l=n(425);n.d(e,"easeBounce",function(){return l.a}),n.d(e,"easeBounceIn",function(){return l.b}),n.d(e,"easeBounceOut",function(){return l.a}),n.d(e,"easeBounceInOut",function(){return l.c});var f=n(424);n.d(e,"easeBack",function(){return f.a}),n.d(e,"easeBackIn",function(){return f.b}),n.d(e,"easeBackOut",function(){return f.c}),n.d(e,"easeBackInOut",function(){return f.a});var h=n(428);n.d(e,"easeElastic",function(){return h.a}),n.d(e,"easeElasticIn",function(){return h.b}),n.d(e,"easeElasticOut",function(){return h.a}),n.d(e,"easeElasticInOut",function(){return h.c})},function(t,e,n){"use strict";var r=n(86);e.a=function(t,e){var i=e?e.length:0,o=t?Math.min(i,t.length):0,a=new Array(o),s=new Array(i),u;for(u=0;uu&&(f=e.slice(u,f),p[h]?p[h]+=f:p[++h]=f),(c=c[0])===(l=l[0])?p[h]?p[h]+=l:p[++h]=l:(p[++h]=null,d.push({i:h,x:n.i(r.a)(c,l)})),u=o.lastIndex;return uu&&(f=e.slice(u,f),p[h]?p[h]+=f:p[++h]=f),(c=c[0])===(l=l[0])?p[h]?p[h]+=l:p[++h]=l:(p[++h]=null,d.push({i:h,x:n.i(r.a)(c,l)})),u=o.lastIndex;return u1?this.each((null==e?i:"function"==typeof e?a:o)(t,e,null==n?"":n)):s(this.node(),t)}},function(t,e,n){"use strict";function r(){return[]}e.a=function(t){return null==t?r:function(){return this.querySelectorAll(t)}}},function(t,e,n){"use strict";var r=n(17);e.a=function(t,e){var n=t.__transition,i,o,a=!0,s;if(n){for(s in e=null==e?null:e+"",n)(i=n[s]).name===e?(o=i.state>r.a&&i.state3?0:(e-e%10!=10)*e%10]}};var x={D:function(t){return t.getDate()},DD:function(t){return v(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return v(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return v(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return String(t.getFullYear()).substr(2)},YYYY:function(t){return v(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return v(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return v(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return v(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return v(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return v(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return v(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+v(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)}},_={D:[s,function(t,e){t.day=e}],Do:[new RegExp(s.source+l.source),function(t,e){t.day=parseInt(e,10)}],M:[s,function(t,e){t.month=e-1}],YY:[s,function(t,e){var n,r=+(""+(new Date).getFullYear()).substr(0,2);t.year=""+(e>68?r-1:r)+e}],h:[s,function(t,e){t.hour=e}],m:[s,function(t,e){t.minute=e}],s:[s,function(t,e){t.second=e}],YYYY:[c,function(t,e){t.year=e}],S:[/\d/,function(t,e){t.millisecond=100*e}],SS:[/\d{2}/,function(t,e){t.millisecond=10*e}],SSS:[u,function(t,e){t.millisecond=e}],d:[s,h],ddd:[l,h],MMM:[l,d("monthNamesShort")],MMMM:[l,d("monthNames")],a:[l,function(t,e,n){var r=e.toLowerCase();r===n.amPm[0]?t.isPm=!1:r===n.amPm[1]&&(t.isPm=!0)}],ZZ:[/([\+\-]\d\d:?\d\d|Z)/,function(t,e){"Z"===e&&(e="+00:00");var n=(e+"").match(/([\+\-]|\d\d)/gi),r;n&&(r=60*n[1]+parseInt(n[2],10),t.timezoneOffset="+"===n[0]?r:-r)}]};_.dd=_.d,_.dddd=_.ddd,_.DD=_.D,_.mm=_.m,_.hh=_.H=_.HH=_.h,_.MM=_.M,_.ss=_.s,_.A=_.a,o.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},o.format=function(t,e,n){var r=n||o.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");var i=[];return(e=(e=(e=o.masks[e]||e||o.masks.default).replace(f,function(t,e){return i.push(e),"??"})).replace(a,function(e){return e in x?x[e](t,r):e.slice(1,e.length-1)})).replace(/\?\?/g,function(){return i.shift()})},o.parse=function(t,e,n){var r=n||o.i18n;if("string"!=typeof e)throw new Error("Invalid format in fecha.parse");if(e=o.masks[e]||e,t.length>1e3)return!1;var i=!0,s={};if(e.replace(a,function(e){if(_[e]){var n=_[e],o=t.search(n[0]);~o?t.replace(n[0],function(e){return n[1](s,e,r),t=t.substr(o+e.length),e}):i=!1}return _[e]?"":e.slice(1,e.length-1)}),!i)return!1;var u=new Date,c;return!0===s.isPm&&null!=s.hour&&12!=+s.hour?s.hour=+s.hour+12:!1===s.isPm&&12==+s.hour&&(s.hour=0),null!=s.timezoneOffset?(s.minute=+(s.minute||0)-+s.timezoneOffset,c=new Date(Date.UTC(s.year||u.getFullYear(),s.month||0,s.day||1,s.hour||0,s.minute||0,s.second||0,s.millisecond||0))):c=new Date(s.year||u.getFullYear(),s.month||0,s.day||1,s.hour||0,s.minute||0,s.second||0,s.millisecond||0),c},void 0!==t&&t.exports?t.exports=o:void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}(this)},function(t,e,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r},function(t,e,n){"use strict";var r=function(){};r=function(t,e,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i=0?"positive":"negative";u[y][g]||(u[y][g]=0),p[a]=[u[y][g],v+u[y][g]],u[y][g]+=v}}},e}(a);a.Stack=s,t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(2),o=n(159),a=n(4),s={merge:n(50)},u=n(31),c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function t(){this.xField=null,this.yField=null,this.cacheMax=null,this.adjustNames=["y"],this.groupFields=null},n._getMax=function t(e){var n=this,r=this.mergeData,i,s=o(r,function(t){var n=t[e];return a(n)?Math.max.apply(null,n):n})[e],u;return a(s)?Math.max.apply(null,s):s},n._getXValuesMax=function t(){var e=this,n=this.yField,r=this.xField,o={},s=this.mergeData;return i(s,function(t){var e=t[r],i=t[n],s=a(i)?Math.max.apply(null,i):i;o[e]=o[e]||0,o[e]0?n="left":e[0]<0&&(n="right"),n},n.getLinePath=function t(){var e=this,n=this.get("center"),r=n.x,i=n.y,o=this.get("radius"),a=o,s=this.get("startAngle"),u=this.get("endAngle"),c=this.get("inner"),l=[];if(Math.abs(u-s)===2*Math.PI)l=[["M",r,i],["m",0,-a],["a",o,a,0,1,1,0,2*a],["a",o,a,0,1,1,0,-2*a],["z"]];else{var f=this._getCirclePoint(s),h=this._getCirclePoint(u),p=Math.abs(u-s)>Math.PI?1:0,d=s>u?0:1;if(c){var v=this.getSideVector(c*o,f),g=this.getSideVector(c*o,h),y={x:v[0]+r,y:v[1]+i},m={x:g[0]+r,y:g[1]+i};l=[["M",y.x,y.y],["L",f.x,f.y],["A",o,a,0,p,d,h.x,h.y],["L",m.x,m.y],["A",o*c,a*c,0,p,Math.abs(d-1),y.x,y.y]]}else l=[["M",r,i],["L",f.x,f.y],["A",o,a,0,p,d,h.x,h.y],["L",r,i]]}return l},n.addLabel=function e(n,r,i){var o=this,a=this.get("label").offset||this.get("_labelOffset")||.001;r=this.getSidePoint(r,a),t.prototype.addLabel.call(this,n,r,i)},n.autoRotateLabels=function t(){var e=this,n=this.get("ticks"),r=this.get("labelRenderer");if(r&&n.length>12){var o=this.get("radius"),a=this.get("startAngle"),s,u=this.get("endAngle")-a,c=u/(n.length-1),l=Math.sin(c/2)*o*2,f=this.getMaxLabelWidth(r);i.each(r.get("group").get("children"),function(t,e){var r,i=n[e].value*u+a,o=i%(2*Math.PI);fMath.PI&&(i-=Math.PI),i-=Math.PI/2,t.attr("textAlign","center")):o>Math.PI/2?i-=Math.PI:ou.x)&&(f=!0);var h=s.vertical([],l,f);return s.scale([],h,e*i)},n.getAxisVector=function t(){var e=this.get("start"),n=this.get("end");return[n.x-e.x,n.y-e.y]},n.getLinePath=function t(){var e=this,n=this.get("start"),r=this.get("end"),i=[];return i.push(["M",n.x,n.y]),i.push(["L",r.x,r.y]),i},n.getTickEnd=function t(e,n){var r=this,i=this.getSideVector(n);return{x:e.x+i[0],y:e.y+i[1]}},n.getTickPoint=function t(e){var n=this,r=this.get("start"),i=this.get("end"),o=i.x-r.x,a=i.y-r.y;return{x:r.x+o*e,y:r.y+a*e}},n.renderTitle=function t(){var e=this,n=this.get("title"),r=this.getTickPoint(.5),i=n.offset;if(o.isNil(i)){i=20;var a=this.get("labelsGroup"),u,c;if(a)i+=this.getMaxLabelWidth(a)+(this.get("label").offset||this.get("_labelOffset"))}var l=n.textStyle,f=o.mix({},l);if(n.text){var h=this.getAxisVector();if(n.autoRotate&&o.isNil(l.rotate)){var p=0;if(!o.snapEqual(h[1],0)){var d=[1,0],v=[h[0],h[1]];p=s.angleTo(v,d,!0)}f.rotate=p*(180/Math.PI)}else o.isNil(l.rotate)||(f.rotate=l.rotate/180*Math.PI);var g=this.getSideVector(i),y,m=n.position;y="start"===m?{x:this.get("start").x+g[0],y:this.get("start").y+g[1]}:"end"===m?{x:this.get("end").x+g[0],y:this.get("end").y+g[1]}:{x:r.x+g[0],y:r.y+g[1]},f.x=y.x,f.y=y.y,f.text=n.text;var b,x=this.get("group").addShape("Text",{zIndex:2,attrs:f});x.name="axis-title",this.get("appendInfo")&&x.setSilent("appendInfo",this.get("appendInfo"))}},n.autoRotateLabels=function t(){var e=this,n=this.get("labelRenderer"),r=this.get("title");if(n){var i,a=n.get("group").get("children"),s=this.get("label").offset,u=12,c=r?r.offset:48;if(c<0)return;var l=this.getAxisVector(),f,h;if(o.snapEqual(l[0],0)&&r&&r.text)(h=this.getMaxLabelWidth(n))>c-s-12&&(f=-1*Math.acos((c-s-12)/h));else if(o.snapEqual(l[1],0)&&a.length>1){var p=Math.abs(this._getAvgLabelLength(n));(h=this.getMaxLabelWidth(n))>p&&(f=Math.asin(1.25*(c-s-12)/h))}if(f){var d=this.get("factor");o.each(a,function(t){t.rotateAtStart(f),o.snapEqual(l[1],0)&&(d>0?t.attr("textAlign","left"):t.attr("textAlign","right"))})}}},n.autoHideLabels=function t(){var e=this,n=this.get("labelRenderer"),r,i,a=8;if(n){var s,u=n.get("group").get("children"),c=this.getAxisVector();if(u.length<2)return;if(o.snapEqual(c[0],0)){var l=this.getMaxLabelHeight(n)+8,f=Math.abs(this._getAvgLabelHeightSpace(n));l>f&&(r=l,i=f)}else if(o.snapEqual(c[1],0)&&u.length>1){var h=this.getMaxLabelWidth(n)+8,p=Math.abs(this._getAvgLabelLength(n));h>p&&(r=h,i=p)}if(r&&i){var d=Math.ceil(r/i);o.each(u,function(t,e){e%d!=0&&t.attr("text","")})}}},e}(i);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(33),a=i.MatrixUtil,s=i.PathUtil,u=a.vec2,c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"polyline"})},n.getLinePath=function t(){var e=this,n=this.get("tickPoints"),r=this.get("start"),o=this.get("end"),a=[];a.push(r.x),a.push(r.y),i.each(n,function(t){a.push(t.x),a.push(t.y)}),a.push(o.x),a.push(o.y);var u=s.catmullRomToBezier(a);return u.unshift(["M",r.x,r.y]),u},n.getTickPoint=function t(e,n){var r;return this.get("tickPoints")[n]},n.getTickEnd=function t(e,n,r){var i=this,o=this.get("tickLine"),a=n||o.length,s=this.getSideVector(a,e,r);return{x:e.x+s[0],y:e.y+s[1]}},n.getSideVector=function t(e,n,r){var i=this,o,a;if(0===r){if((o=this.get("start")).x===n.x&&o.y===n.y)return[0,0]}else o=this.get("tickPoints")[r-1];var s=[n.x-o.x,n.y-o.y],c=u.normalize([],s),l=u.vertical([],c,!1);return u.scale([],l,e)},e}(o);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(19),a=Math.PI,s=Math.atan;function u(t,e){var n=t.x-e.x,r=t.y-e.y,i;return 0===r?i=n<0?a/2:270*a/180:n>=0&&r>0?i=2*a-s(n/r):n<=0&&r<0?i=a-s(n/r):n>0&&r<0?i=a+s(-n/r):n<0&&r>0&&(i=s(n/-r)),i}var c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"arc",start:null,end:null,style:{stroke:"#999",lineWidth:1}})},n.render=function t(e,n){var r=this,o=this.parsePoint(e,this.get("start")),s=this.parsePoint(e,this.get("end")),c=e.getCenter(),l=Math.sqrt((o.x-c.x)*(o.x-c.x)+(o.y-c.y)*(o.y-c.y)),f,h=u(o,c),p=u(s,c);if(pa?1:0;f=[["M",o.x,o.y],["A",l,l,0,v,1,s.x,s.y]]}var g=n.addShape("path",{zIndex:this.get("zIndex"),attrs:i.mix({path:f},this.get("style"))});g.name="guide-arc",this.get("appendInfo")&&g.setSilent("appendInfo",this.get("appendInfo")),this.set("el",g)},e}(o);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"dataMarker",zIndex:1,top:!0,position:null,style:{point:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2},line:{stroke:"#A3B1BF",lineWidth:1},text:{fill:"#000000",opacity:.65,fontSize:12,textAlign:"start"}},display:{point:!0,line:!0,text:!0},lineLength:20,direction:"upward",autoAdjust:!0})},n.render=function t(e,n){var r=this,i=this.parsePoint(e,this.get("position")),o=n.addGroup();o.name="guide-data-marker";var a=this._getElementPosition(i),s=this.get("display"),u,c;if(s.line){var l=a.line;u=this._drawLine(l,o)}if(s.text&&this.get("content")){var f=a.text;c=this._drawText(f,o)}if(s.point){var h=a.point;this._drawPoint(h,o)}if(this.get("autoAdjust")){var p=o.getBBox(),d=p.minX,v=p.minY,g=p.maxX,y=p.maxY,m=e.start,b=e.end;if(c){d<=m.x&&c.attr("textAlign","start"),g>=b.x&&c.attr("textAlign","end");var x=this.get("direction");if("upward"===x&&v<=b.y||"upward"!==x&&y>=m.y){var _,w;"upward"===x&&v<=b.y?(_="top",w=1):(_="bottom",w=-1),c.attr("textBaseline",_);var O=0;if(this.get("display").line){O=this.get("lineLength");var j=[["M",i.x,i.y],["L",i.x,i.y+O*w]];u.attr("path",j)}var S=i.y+(O+2)*w;c.attr("y",S)}}}this.get("appendInfo")&&o.setSilent("appendInfo",this.get("appendInfo")),this.set("el",o)},n._getElementPosition=function t(e){var n=this,r=e.x,i=e.y,o=this.get("display").line?this.get("lineLength"):0,a=this.get("direction"),s;this.get("style").text.textBaseline="upward"===a?"bottom":"top";var u="upward"===a?-1:1,c,l,f,h;return{point:{x:r,y:i},line:[{x:r,y:i},{x:r,y:o*u+i}],text:{x:r,y:(o+2)*u+i}}},n._drawLine=function t(e,n){var r=this,o=this.get("style").line,a=[["M",e[0].x,e[0].y],["L",e[1].x,e[1].y]],s;return n.addShape("path",{attrs:i.mix({path:a},o)})},n._drawText=function t(e,n){var r=this,o=this.get("style").text,a;return n.addShape("text",{attrs:i.mix({text:this.get("content")},o,e)})},n._drawPoint=function t(e,n){var r=this,o=this.get("style").point,a;return n.addShape("circle",{attrs:i.mix({},o,e)})},e}(n(19));t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(102),a,s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"dataRegion",start:null,end:null,content:"",style:{region:{lineWidth:0,fill:"#000000",opacity:.04},text:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:"rgba(0, 0, 0, .65)"}}})},n.render=function t(e,n,r){var o=this,a=this.get("lineLength")||0,s=this._getRegionData(e,r);if(s.length){var u=this._getBBox(s),c=[];c.push(["M",s[0].x,u.yMin-a]);for(var l=0,f=s.length;l=h&&p.push(this.parsePoint(e,[g[u],g[c]])),g[u]===f)break}return p},n._getBBox=function t(e){for(var n=[],r=[],o=0;o');s.appendChild(u);var c=this.get("htmlContent")||this.get("html"),l,f;i.isFunction(c)&&(c=c(this.get("xScales"),this.get("yScales")));var h=o.createDom(c);u.appendChild(h),o.modifyCSS(u,{position:"absolute"}),this._setDomPosition(u,h,a),this.set("el",u)},n._setDomPosition=function t(e,n,r){var i=this,a=this.get("alignX"),s=this.get("alignY"),u=o.getOuterWidth(n),c=o.getOuterHeight(n),l={x:r.x,y:r.y};"middle"===a&&"top"===s?l.x-=Math.round(u/2):"middle"===a&&"bottom"===s?(l.x-=Math.round(u/2),l.y-=Math.round(c)):"left"===a&&"bottom"===s?l.y-=Math.round(c):"left"===a&&"middle"===s?l.y-=Math.round(c/2):"left"===a&&"top"===s?(l.x=r.x,l.y=r.y):"right"===a&&"bottom"===s?(l.x-=Math.round(u),l.y-=Math.round(c)):"right"===a&&"middle"===s?(l.x-=Math.round(u),l.y-=Math.round(c/2)):"right"===a&&"top"===s?l.x-=Math.round(u):(l.x-=Math.round(u/2),l.y-=Math.round(c/2));var f=this.get("offsetX");f&&(l.x+=f);var h=this.get("offsetY");h&&(l.y+=h),o.modifyCSS(e,{top:Math.round(l.y)+"px",left:Math.round(l.x)+"px",visibility:"visible",zIndex:this.get("zIndex")})},n.clear=function t(){var e=this,n=this.get("el");n&&n.parentNode&&n.parentNode.removeChild(n)},e}(n(19));t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"image",start:null,end:null,src:null,offsetX:null,offsetY:null})},n.render=function t(e,n){var r=this,i=this.parsePoint(e,this.get("start")),o={x:i.x,y:i.y};if(o.img=this.get("src"),this.get("end")){var a=this.parsePoint(e,this.get("end"));o.width=a.x-i.x,o.height=a.y-i.y}else o.width=this.get("width")||32,o.height=this.get("height")||32;this.get("offsetX")&&(o.x+=this.get("offsetX")),this.get("offsetY")&&(o.y+=this.get("offsetY"));var s=n.addShape("Image",{zIndex:1,attrs:o});s.name="guide-image",this.get("appendInfo")&&s.setSilent("appendInfo",this.get("appendInfo")),this.set("el",s)},e}(n(19));t.exports=a},function(t,e,n){t.exports={Guide:n(19),Arc:n(233),DataMarker:n(234),DataRegion:n(235),Html:n(236),Image:n(237),Line:n(239),Region:n(240),Text:n(241)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(19),a=i.MatrixUtil.vec2,s,u=n(18).FONT_FAMILY,c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"line",start:null,end:null,lineStyle:{stroke:"#000",lineWidth:1},text:{position:"end",autoRotate:!0,style:{fill:"#999",fontSize:12,fontWeight:500,fontFamily:u},content:null}})},n.render=function t(e,n){var r=this,i=this.parsePoint(e,this.get("start")),o=this.parsePoint(e,this.get("end")),a=n.addGroup({viewId:n.get("viewId")});this._drawLines(i,o,a);var s=this.get("text");s&&s.content&&this._drawText(i,o,a),this.set("el",a)},n._drawLines=function t(e,n,r){var o=[["M",e.x,e.y],["L",n.x,n.y]],a=r.addShape("Path",{attrs:i.mix({path:o},this.get("lineStyle"))});a.name="guide-line",this.get("appendInfo")&&a.setSilent("appendInfo",this.get("appendInfo"))},n._drawText=function t(e,n,r){var o=this.get("text"),s=o.position,u=o.style||{},c;((c="start"===s?0:"center"===s?.5:i.isString(s)&&-1!==s.indexOf("%")?parseInt(s,10)/100:i.isNumber(s)?s:1)>1||c<0)&&(c=1);var l={x:e.x+(n.x-e.x)*c,y:e.y+(n.y-e.y)*c};if(o.offsetX&&(l.x+=o.offsetX),o.offsetY&&(l.y+=o.offsetY),l.text=o.content,l=i.mix({},l,u),o.autoRotate&&i.isNil(u.rotate)){var f=a.angleTo([n.x-e.x,n.y-e.y],[1,0],1);l.rotate=f}else i.isNil(u.rotate)||(l.rotate=u.rotate*Math.PI/180);var h=r.addShape("Text",{attrs:l});h.name="guide-line-text",this.get("appendInfo")&&h.setSilent("appendInfo",this.get("appendInfo"))},e}(o);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"region",zIndex:1,start:null,end:null,style:{lineWidth:0,fill:"#CCD7EB",opacity:.4}})},n.render=function t(e,n){var r=this,o=this.get("style"),a=this._getPath(e),s=n.addShape("path",{zIndex:this.get("zIndex"),attrs:i.mix({path:a},o)});s.name="guide-region",this.get("appendInfo")&&s.setSilent("appendInfo",this.get("appendInfo")),this.set("el",s)},n._getPath=function t(e){var n=this,r=this.parsePoint(e,this.get("start")),i=this.parsePoint(e,this.get("end")),o;return[["M",r.x,r.y],["L",i.x,r.y],["L",i.x,i.y],["L",r.x,i.y],["z"]]},e}(n(19));t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"text",position:null,content:null,style:{fill:"#999",fontSize:12,fontWeight:500,textAlign:"center"},offsetX:null,offsetY:null,top:!0})},n.render=function t(e,n){var r=this,o=this.parsePoint(e,this.get("position")),a=i.mix({},this.get("style")),s=this.get("offsetX"),u=this.get("offsetY");s&&(o.x+=s),u&&(o.y+=u),a.rotate&&(a.rotate=a.rotate*Math.PI/180);var c=n.addShape("Text",{zIndex:this.get("zIndex"),attrs:i.mix({text:this.get("content")},a,o)});c.name="guide-text",this.get("appendInfo")&&c.setSilent("appendInfo",this.get("appendInfo")),this.set("el",c)},e}(n(19));t.exports=a},function(t,e,n){var r=n(103);t.exports=r},function(t,e){t.exports=function t(e,n){for(var r,i,o=[],a=0;ai.width||r.height>i.height?o.push(e[a]):r.width*r.height>i.width*i.height&&o.push(e[a]);for(var s=0;s

    1

    /2

    ',slipWidth:65,legendOverflow:"unset"})},n.render=function e(){t.prototype._renderHTML.call(this),this._renderFlipPage()},n._renderFlipPage=function t(){var e=document.getElementsByClassName("g2-legend")[0],n=g(e,c),r=this.get("position"),o=this.get("layout"),a="right"===r||"left"===r||"vertical"===o?"block":"inline-block";if(e.scrollHeight>e.offsetHeight){var s=this.get("slipTpl"),l=u.createDom(s),f=g(l,"g2-caret-up"),h=g(l,"g2-caret-down");u.modifyCSS(f,this.get("caretStyle")),u.modifyCSS(f,{fill:"rgba(0,0,0,0.25)"}),u.modifyCSS(h,this.get("caretStyle"));var p=g(l,"cur-pagenum"),d=g(l,"next-pagenum"),v=this.get("pageNumStyle");u.modifyCSS(p,i.mix({},v,{paddingLeft:"10px"})),u.modifyCSS(d,i.mix({},v,{opacity:.3,paddingRight:"10px"})),u.modifyCSS(l,i.mix({},this.get("slipDomStyle"),{top:e.offsetHeight+"px"})),e.style.overflow=this.get("legendOverflow"),e.appendChild(l);for(var y=n.childNodes,m=0,b=1,x=[],_=0;_=e.offsetHeight&&(b++,x.forEach(function(t){t.style.display="none"}),x=[]),x.push(y[_]);d.innerText="/"+b,y.forEach(function(t){t.style.display=a,(m=t.offsetTop+t.offsetHeight)>e.offsetHeight&&(t.style.display="none")}),f.addEventListener("click",function(){if(y[0].style.display!==a){var t=-1;y.forEach(function(e,n){e.style.display===a&&(t=-1===t?n:t,e.style.display="none")});for(var n=t-1;n>=0&&(y[n].style.display=a,m=y[t-1].offsetTop+y[t-1].offsetHeight,y[n].style.display="none",m0){var g=o.toRGB(u[v-1].color);c+=1-u[v].percentage+":"+g+" "}p.addShape("text",{attrs:a.mix({},{x:r+this.get("textOffset")/2,y:i-u[v].percentage*i,text:this._formatItemValue(u[v].value)+""},this.get("textStyle"),{textAlign:"start"})})}}else{c+="l (0) ";for(var y=0;y0){var m=o.toRGB(u[y-1].color);c+=u[y].percentage+":"+m+" "}c+=u[y].percentage+":"+l+" ",p.addShape("text",{attrs:a.mix({},{x:u[y].percentage*r,y:i+5+this.get("textOffset"),text:this._formatItemValue(u[y].value)+""},this.get("textStyle"))})}}p.addShape("rect",{attrs:{x:0,y:0,width:r,height:i,fill:c,strokeOpacity:0}}),p.addShape("path",{attrs:a.mix({path:f},this.get("lineStyle"))}),p.move(0,n)},e}(n(63));t.exports=u},function(t,e,n){t.exports={Category:n(107),CatHtml:n(106),CatPageHtml:n(246),Color:n(247),Size:n(250),CircleSize:n(249)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=2,s=16,u=16,c=5,l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"size-circle-legend",width:100,height:200,_unslidableCircleStyle:{stroke:"rgb(99, 161, 248)",fill:"rgb(99, 161, 248)",fillOpacity:.3,lineWidth:1.5},triggerAttr:{fill:"white",shadowOffsetX:-2,shadowOffsetY:2,shadowBlur:10,shadowColor:"#ccc"},frontMiddleBarStyle:{fill:"rgb(64, 141, 251)"}})},n._renderSliderShape=function t(){var e=5,n,r=this.get("slider").get("backgroundElement"),o=this.get("layout"),a="vertical"===o?2:this.get("width"),s="vertical"===o?this.get("height"):2,u=5,c=this.get("height")/2,l=this.get("frontMiddleBarStyle"),f="vertical"===o?[[0,0],[a,0],[a,s],[0,s]]:[[0,c+s],[0,c-s],[5+a-4,c-s],[5+a-4,c+s]];return this._addMiddleBar(r,"Polygon",i.mix({points:f},l))},n._addHorizontalTrigger=function t(e,n,r,o){var a,s=this.get("slider").get(e+"HandleElement"),u=-this.get("height")/2,c=s.addShape("circle",{attrs:i.mix({x:0,y:u,r:o},n)}),l=s.addShape("text",{attrs:i.mix(r,{x:0,y:u+o+10,textAlign:"center",textBaseline:"middle"})}),f,h="vertical"===this.get("layout")?"ns-resize":"ew-resize";c.attr("cursor",h),l.attr("cursor",h),this.set(e+"ButtonElement",c),this.set(e+"TextElement",l)},n._addVerticalTrigger=function t(e,n,r,o){var a,s=this.get("slider").get(e+"HandleElement"),u=s.addShape("circle",{attrs:i.mix({x:0,y:0,r:o},n)}),c=s.addShape("text",{attrs:i.mix(r,{x:o+10,y:0,textAlign:"start",textBaseline:"middle"})}),l,f="vertical"===this.get("layout")?"ns-resize":"ew-resize";u.attr("cursor",f),c.attr("cursor",f),this.set(e+"ButtonElement",u),this.set(e+"TextElement",c)},n._renderTrigger=function t(){var e=this.get("firstItem"),n=this.get("lastItem"),r=this.get("layout"),o=this.get("textStyle"),a=this.get("triggerAttr"),s=i.mix({},a),u=i.mix({},a),c=5,l=16,f=i.mix({text:this._formatItemValue(e.value)+""},o),h=i.mix({text:this._formatItemValue(n.value)+""},o);"vertical"===r?(this._addVerticalTrigger("min",s,f,5),this._addVerticalTrigger("max",u,h,16)):(this._addHorizontalTrigger("min",s,f,5),this._addHorizontalTrigger("max",u,h,16))},n._bindEvents=function t(){var e=this,n;this.get("slidable")&&this.get("slider").on("sliderchange",function(t){var n=t.range,r=e.get("firstItem").value,i=e.get("lastItem").value,o=r+n[0]/100*(i-r),a=r+n[1]/100*(i-r),s=5+n[0]/100*11,u=5+n[1]/100*11;e._updateElement(o,a,s,u);var c=new Event("itemfilter",t,!0,!0);c.range=[o,a],e.emit("itemfilter",c)})},n._updateElement=function e(n,r,i,o){t.prototype._updateElement.call(this,n,r);var a=this.get("minTextElement"),s=this.get("maxTextElement"),u=this.get("minButtonElement"),c=this.get("maxButtonElement"),l;if(u.attr("r",i),c.attr("r",o),"vertical"===this.get("layout"))a.attr("x",i+10),s.attr("x",o+10);else{var f=-this.get("height")/2;a.attr("y",f+i+10),s.attr("y",f+o+10)}},n._addCircle=function t(e,n,r,o,a){var s,u=this.get("group").addGroup(),c=this.get("_unslidableCircleStyle"),l=this.get("textStyle"),f=this.get("titleShape"),h=this.get("titleGap");f&&(h+=f.getBBox().height),u.addShape("circle",{attrs:i.mix({x:e,y:n+h,r:0===r?1:r},c)}),"vertical"===this.get("layout")?u.addShape("text",{attrs:i.mix({x:a+20+this.get("textOffset"),y:n+h,text:0===o?"0":o},l)}):u.addShape("text",{attrs:i.mix({x:e,y:n+h+a+13+this.get("textOffset"),text:0===o?"0":o},l)})},n._renderUnslidable=function t(){var e=this.get("firstItem").value,n=this.get("lastItem").value;if(e>n){var r=n;n=e,e=r}var i=this._formatItemValue(e),o=this._formatItemValue(n),a=e<5?5:e,s=n>16?16:n;a>s&&(a=5,s=16),"vertical"===this.get("layout")?(this._addCircle(s,s,a,i,2*s),this._addCircle(s,2*s+16+a,s,o,2*s)):(this._addCircle(s,s,a,i,2*s),this._addCircle(2*s+16+a,s,s,o,2*s))},n.activate=function e(n){this.get("slidable")&&t.prototype.activate.call(this,n)},e}(n(63));t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"size-legend",width:100,height:200,_unslidableElementStyle:{fill:"#4E7CCC",fillOpacity:1},frontMiddleBarStyle:{fill:"rgb(64, 141, 251)"}})},n._renderSliderShape=function t(){var e,n=this.get("slider").get("backgroundElement"),r=this.get("layout"),o=this.get("width"),a=this.get("height"),s=this.get("height")/2,u=this.get("frontMiddleBarStyle"),c="vertical"===r?[[0,0],[o,0],[o,a],[o-4,a]]:[[0,s+a/2],[0,s+a/2-4],[o,s-a/2],[o,s+a/2]];return this._addMiddleBar(n,"Polygon",i.mix({points:c},u))},n._renderUnslidable=function t(){var e=this.get("layout"),n=this.get("width"),r=this.get("height"),o=this.get("frontMiddleBarStyle"),a="vertical"===e?[[0,0],[n,0],[n,r],[n-4,r]]:[[0,r],[0,r-4],[n,0],[n,r]],s,u;this.get("group").addGroup().addShape("Polygon",{attrs:i.mix({points:a},o)});var c=this._formatItemValue(this.get("firstItem").value),l=this._formatItemValue(this.get("lastItem").value);"vertical"===this.get("layout")?(this._addText(n+10,r-3,c),this._addText(n+10,3,l)):(this._addText(0,r,c),this._addText(n,r,l))},n._addText=function t(e,n,r){var o,a=this.get("group").addGroup(),s=this.get("textStyle"),u=this.get("titleShape"),c=this.get("titleGap");u&&(c+=u.getBBox().height),"vertical"===this.get("layout")?a.addShape("text",{attrs:i.mix({x:e+this.get("textOffset"),y:n,text:0===r?"0":r},s)}):(n+=c+this.get("textOffset")-20,u||(n+=10),a.addShape("text",{attrs:i.mix({x:e,y:n,text:0===r?"0":r},s)}))},e}(n(63));t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=i.DomUtil,a,s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function t(){return{range:null,middleAttr:{fill:"#fff",fillOpacity:0},backgroundElement:null,minHandleElement:null,maxHandleElement:null,middleHandleElement:null,currentTarget:null,layout:"vertical",width:null,height:null,pageX:null,pageY:null}},n._beforeRenderUI=function t(){var e=this.get("layout"),n=this.get("backgroundElement"),r=this.get("minHandleElement"),i=this.get("maxHandleElement"),o=this.addShape("rect",{attrs:this.get("middleAttr")}),a="vertical"===e?"ns-resize":"ew-resize";this.add([n,r,i]),this.set("middleHandleElement",o),n.set("zIndex",0),o.set("zIndex",1),r.set("zIndex",2),i.set("zIndex",2),o.attr("cursor","move"),r.attr("cursor",a),i.attr("cursor",a),this.sort()},n._renderUI=function t(){"horizontal"===this.get("layout")?this._renderHorizontal():this._renderVertical()},n._transform=function t(e){var n=this.get("range"),r=n[0]/100,i=n[1]/100,o=this.get("width"),a=this.get("height"),s=this.get("minHandleElement"),u=this.get("maxHandleElement"),c=this.get("middleHandleElement");s.resetMatrix(),u.resetMatrix(),"horizontal"===e?(c.attr({x:o*r,y:0,width:(i-r)*o,height:a}),s.translate(r*o,a),u.translate(i*o,a)):(c.attr({x:0,y:a*(1-i),width:o,height:(i-r)*a}),s.translate(1,(1-r)*a),u.translate(1,(1-i)*a))},n._renderHorizontal=function t(){this._transform("horizontal")},n._renderVertical=function t(){this._transform("vertical")},n._bindUI=function t(){this.on("mousedown",i.wrapBehavior(this,"_onMouseDown"))},n._isElement=function t(e,n){var r=this.get(n),i;return e===r||!!r.isGroup&&r.get("children").indexOf(e)>-1},n._getRange=function t(e,n){var r=e+n;return r=(r=r>100?100:r)<0?0:r},n._updateStatus=function t(e,n){var r="x"===e?this.get("width"):this.get("height");e=i.upperFirst(e);var o=this.get("range"),a=this.get("page"+e),s=this.get("currentTarget"),u=this.get("rangeStash"),c,l="vertical"===this.get("layout")?-1:1,f=n["page"+e],h,p=(f-a)/r*100*l,d;o[1]<=o[0]?(this._isElement(s,"minHandleElement")||this._isElement(s,"maxHandleElement"))&&(o[0]=this._getRange(p,o[0]),o[1]=this._getRange(p,o[0])):(this._isElement(s,"minHandleElement")&&(o[0]=this._getRange(p,o[0])),this._isElement(s,"maxHandleElement")&&(o[1]=this._getRange(p,o[1]))),this._isElement(s,"middleHandleElement")&&(d=u[1]-u[0],o[0]=this._getRange(p,o[0]),o[1]=o[0]+d,o[1]>100&&(o[1]=100,o[0]=o[1]-d)),this.emit("sliderchange",{range:o}),this.set("page"+e,f),this._renderUI(),this.get("canvas").draw()},n._onMouseDown=function t(e){var n=e.currentTarget,r=e.event,i=this.get("range");r.stopPropagation(),r.preventDefault(),this.set("pageX",r.pageX),this.set("pageY",r.pageY),this.set("currentTarget",n),this.set("rangeStash",[i[0],i[1]]),this._bindCanvasEvents()},n._bindCanvasEvents=function t(){var e=this.get("canvas").get("containerDOM");this.onMouseMoveListener=o.addEventListener(e,"mousemove",i.wrapBehavior(this,"_onCanvasMouseMove")),this.onMouseUpListener=o.addEventListener(e,"mouseup",i.wrapBehavior(this,"_onCanvasMouseUp")),this.onMouseLeaveListener=o.addEventListener(e,"mouseleave",i.wrapBehavior(this,"_onCanvasMouseUp"))},n._onCanvasMouseMove=function t(e){var n;this._mouseOutArea(e)||("horizontal"===this.get("layout")?this._updateStatus("x",e):this._updateStatus("y",e))},n._onCanvasMouseUp=function t(){this._removeDocumentEvents()},n._removeDocumentEvents=function t(){this.onMouseMoveListener.remove(),this.onMouseUpListener.remove()},n._mouseOutArea=function t(e){var n,r=this.get("canvas").get("el").getBoundingClientRect(),i=this.get("parent"),o=i.getBBox(),a=i.attr("matrix")[6],s=i.attr("matrix")[7],u=a+o.width,c=s+o.height,l=e.clientX-r.x,f=e.clientY-r.y;return lu||fc},e}(i.Group);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(64),a=n(3),s=a.DomUtil,u=n(255),c=n(109),l=n(111),f=n(110),h="g2-tooltip",p="g2-tooltip-title",d="g2-tooltip-list",v="g2-tooltip-marker",g="g2-tooltip-value",y="g2-tooltip-list-item";function m(t,e){return t.getElementsByClassName(e)[0]}function b(t,e){return Object.keys(t).forEach(function(n){e[n]&&(t[n]=a.mix(t[n],e[n]))}),t}var x=function(t){r(n,t);var e=n.prototype;function n(e){var n;n=t.call(this,e)||this,a.assign(i(i(n)),l),a.assign(i(i(n)),f);var r=u;n.style=b(r,e),n._init_(),n.get("items")&&n.render();var o=n.get("crosshairs");if(o){var s="rect"===o.type?n.get("backPlot"):n.get("frontPlot"),h=new c(a.mix({plot:s,plotRange:n.get("plotRange"),canvas:n.get("canvas")},n.get("crosshairs")));h.hide(),n.set("crosshairGroup",h)}return n}return e.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return a.mix({},n,{containerTpl:'
      ',itemTpl:'
    • =0&&r<=1&&(u*=r);var c=Math.floor(u*(1-i)/s),l=c/(2*Math.PI),f={start:o,end:a},h={start:i*u,end:i*u+.99*c};this.a=l,this.d=c,this.x=f,this.y=h}},{key:"getCenter",value:function t(){return this.center}},{key:"convertPoint",value:function t(e){var n=this.a,r=this.center,i,o;this.isTransposed?(i=e.y,o=e.x):(i=e.x,o=e.y);var a=this.convertDim(i,"x"),s=n*a,u=this.convertDim(o,"y");return{x:r.x+Math.cos(a)*(s+u),y:r.y+Math.sin(a)*(s+u)}}},{key:"invertPoint",value:function t(e){var n=this.center,r=this.a,i=this.d+this.y.start,o=m.subtract([],[e.x,e.y],[n.x,n.y]),a=m.angleTo(o,[1,0],!0),s=a*r,u;m.length(o)f/s?(p=f/s,d={x:r.x-(.5-c)*f,y:r.y-(.5-l)*p*u}):(p=h/u,d={x:r.x-(.5-c)*p*s,y:r.y-(.5-l)*h}),e?e>0&&e<=1?e*=p:(e<=0||e>p)&&(e=p):e=p;var v={start:i,end:o},g={start:n*e,end:e};this.x=v,this.y=g,this.radius=e,this.circleCentre=d,this.center=d}},{key:"getCenter",value:function t(){return this.circleCentre}},{key:"getOneBox",value:function t(){var e=this.startAngle,n=this.endAngle;if(Math.abs(n-e)>=2*Math.PI)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var r=[0,Math.cos(e),Math.cos(n)],i=[0,Math.sin(e),Math.sin(n)],o=Math.min(e,n);o0?c:-c;var l=this.invertDim(u,"y"),f={};return f.x=this.isTransposed?l:c,f.y=this.isTransposed?c:l,f}}]),e}(y);t.exports=_},function(t,e,n){var r=n(0),i=n(25),o=r.PathUtil;function a(t){var e=t.start,n=t.end,r=t.getWidth(),o=t.getHeight(),a=200,s,u,c,l,f;return t.isPolar?(l=t.getRadius(),c=t.getCenter(),s=t.startAngle,u=t.endAngle,(f=new i.Fan({attrs:{x:c.x,y:c.y,rs:0,re:l+200,startAngle:s,endAngle:s}})).endState={endAngle:u}):(f=new i.Rect({attrs:{x:e.x-200,y:n.y-200,width:t.isTransposed?r+400:0,height:t.isTransposed?0:o+400}}),t.isTransposed?f.endState={height:o+400}:f.endState={width:r+400}),f.isClip=!0,f}function s(t){if(r.isEmpty(t))return null;var e=t[0].x,n=t[0].x,i=t[0].y,o=t[0].y;return r.each(t,function(t){e=e>t.x?t.x:e,n=nt.y?t.y:i,o=o0?i.maxX:i.minX,s,1];t.apply(u),t.attr({transform:[["t",-a,-s],["s",.01,1],["t",a,s]]});var l={transform:[["t",-a,-s],["s",100,1],["t",a,s]]},f=c(e,r,n,l);t.animate(l,f.duration,f.easing,f.callback,f.delay)}function h(t,e){var n={lineWidth:0,opacity:0},r=t._id,i,o=c(e,t.get("index"),r,n);t.animate(n,o.duration,o.easing,function(){t.remove()},o.delay)}function p(t,e,n){var r=t._id,i=t.get("index"),o,a;if(n.isPolar&&"point"!==t.name)o=n.getCenter().x,a=n.getCenter().y;else{var s=t.getBBox();o=(s.minX+s.maxX)/2,a=(s.minY+s.maxY)/2}var u=[o,a,1];t.apply(u),t.attr({transform:[["t",-o,-a],["s",.01,.01],["t",o,a]]});var l={transform:[["t",-o,-a],["s",100,100],["t",o,a]]},f=c(e,i,r,l);t.animate(l,f.duration,f.easing,f.callback,f.delay)}function d(t,e,n){var r=t._id,i=t.get("index"),o,a;if(n.isPolar&&"point"!==t.name)o=n.getCenter().x,a=n.getCenter().y;else{var s=t.getBBox();o=(s.minX+s.maxX)/2,a=(s.minY+s.maxY)/2}var u=[o,a,1];t.apply(u);var l={transform:[["t",-o,-a],["s",.01,.01],["t",o,a]]},f=c(e,i,r,l);t.animate(l,f.duration,f.easing,function(){t.remove()},f.delay)}function v(t,e){if("path"===t.get("type")){var n=t._id,r=t.get("index"),i=o.pathToAbsolute(t.attr("path"));t.attr("path",[i[0]]);var a={path:i},s=c(e,r,n,a);t.animate(a,s.duration,s.easing,s.callback,s.delay)}}function g(t,e){if("path"===t.get("type")){var n=t._id,r=t.get("index"),i,a={path:[o.pathToAbsolute(t.attr("path"))[0]]},s=c(e,r,n,a);t.animate(a,s.duration,s.easing,function(){t.remove()},s.delay)}}function y(t,e,n,r,i){var o=a(n),s=t.get("canvas"),u=t._id,l=t.get("index"),f;r?(o.attr("startAngle",r),o.attr("endAngle",r),f={endAngle:i}):f=o.endState,o.set("canvas",s),t.attr("clip",o),t.setSilent("animating",!0);var h=c(e,l,u,f);o.animate(f,h.duration,h.easing,function(){t&&!t.get("destroyed")&&(t.attr("clip",null),t.setSilent("cacheShape",null),t.setSilent("animating",!1),o.remove())},h.delay)}function m(t,e){var n=t._id,i=t.get("index"),o=r.isNil(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),a=r.isNil(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity");t.attr("fillOpacity",0),t.attr("strokeOpacity",0);var s={fillOpacity:o,strokeOpacity:a},u=c(e,i,n,s);t.animate(s,u.duration,u.easing,u.callback,u.delay)}function b(t,e){var n=t._id,r,i={fillOpacity:0,strokeOpacity:0},o=c(e,t.get("index"),n,i);t.animate(i,o.duration,o.easing,function(){t.remove()},o.delay)}function x(t,e,n){var r=u(t,n),i=r.endAngle,o;y(t,e,n,r.startAngle,i)}t.exports={enter:{clipIn:y,zoomIn:p,pathIn:v,scaleInY:l,scaleInX:f,fanIn:x,fadeIn:m},leave:{lineWidthOut:h,zoomOut:d,pathOut:g,fadeOut:b},appear:{clipIn:y,zoomIn:p,pathIn:v,scaleInY:l,scaleInX:f,fanIn:x,fadeIn:m},update:{fadeIn:m,fanIn:x}}},function(t,e,n){var r=n(0),i=n(112),o,a=r.MatrixUtil.mat3;function s(t,e){var n=[];if(!1===t.get("animate"))return[];var i=t.get("children");return r.each(i,function(t){if(t.isGroup)n=n.concat(s(t,e));else if(t.isShape&&t._id){var r=t._id;(r=r.split("-")[0])===e&&n.push(t)}}),n}function u(t){var e={};return r.each(t,function(t){if(t._id&&!t.isClip){var n=t._id;e[n]={_id:n,type:t.get("type"),attrs:r.cloneDeep(t.attr()),name:t.name,index:t.get("index"),animateCfg:t.get("animateCfg"),coord:t.get("coord")}}}),e}function c(t,e,n,r){var o;return o=r?i.Action[n][r]:i.getAnimation(t,e,n)}function l(t,e,n){var o=i.getAnimateCfg(t,e);return n&&n[e]?r.deepMix({},o,n[e]):o}function f(t,e,n,i){var o,s,u=!1;if(i){var f=[],h=[];r.each(e,function(e){var n=t[e._id];n?(e.setSilent("cacheShape",n),f.push(e),delete t[e._id]):h.push(e)}),r.each(t,function(t){var e=t.name,i=t.coord,f=t._id,h=t.attrs,p=t.index,d=t.type;if(s=l(e,"leave",t.animateCfg),o=c(e,i,"leave",s.animation),r.isFunction(o)){var v=n.addShape(d,{attrs:h,index:p});if(v._id=f,v.name=e,i&&"label"!==e){var g=v.getMatrix(),y=a.multiply([],g,i.matrix);v.setMatrix(y)}u=!0,o(v,s,i)}}),r.each(f,function(t){var e=t.name,n=t.get("coord"),i=t.get("cacheShape").attrs;if(!r.isEqual(i,t.attr())){if(s=l(e,"update",t.get("animateCfg")),o=c(e,n,"update",s.animation),r.isFunction(o))o(t,s,n);else{var a=r.cloneDeep(t.attr());t.attr(i),t.animate(a,s.duration,s.easing,function(){t.setSilent("cacheShape",null)})}u=!0}}),r.each(h,function(t){var e=t.name,n=t.get("coord");s=l(e,"enter",t.get("animateCfg")),o=c(e,n,"enter",s.animation),r.isFunction(o)&&(o(t,s,n),u=!0)})}else r.each(e,function(t){var e=t.name,n=t.get("coord");s=l(e,"appear",t.get("animateCfg")),o=c(e,n,"appear",s.animation),r.isFunction(o)&&(o(t,s,n),u=!0)});return u}t.exports={execAnimation:function t(e,n){var r=e.get("middlePlot"),i=e.get("backPlot"),o=e.get("_id"),a=e.get("canvas"),c=a.get(o+"caches")||[];0===c.length&&(n=!1);var l=s(r,o),h=s(i,o),p=l.concat(h),d;a.setSilent(o+"caches",u(p)),(d=f(c,n?p:l,a,n))||a.draw()}}},function(t,e,n){var r=n(0),i,o=n(29).Axis,a=r.MatrixUtil.vec2;function s(t){var e=[];if(t.length>0){var n=(e=t.slice(0))[0],r=e[e.length-1];0!==n.value&&e.unshift({value:0}),1!==r.value&&e.push({value:1})}return e}function u(t,e,n){var r=[];return t.length<1?r:(t.length>=2&&e&&n&&r.push({text:"",tickValue:"",value:0}),0!==t[0].value&&r.push({text:"",tickValue:"",value:0}),1!==(r=r.concat(t))[r.length-1].value&&r.push({text:"",tickValue:"",value:1}),r)}function c(t,e){return void 0===e&&(e=0),"middle"===t&&(e=.5),-1!==t.indexOf("%")&&(e=parseInt(t,10)/100),e}var l=function(){function t(t){this.visible=!0,this.canvas=null,this.container=null,this.coord=null,this.options=null,this.axes=[],r.mix(this,t)}var e=t.prototype;return e._isHide=function t(e){var n=this.options;return!(!n||!1!==n[e])},e._getMiddleValue=function t(e,n,r,i){if(0===e&&!i)return 0;if(1===e)return 1;var o=n[r+1].value;return i||1!==o?(e+o)/2:1},e._getLineRange=function t(e,n,r,i){var o,a,s,u=n.field,l=this.options,f="";if(l[u]&&l[u].position&&(f=l[u].position),"x"===r){var h="top"===f?1:0;o={x:0,y:h=c(f,h)},a={x:1,y:h},s=!1}else{if(i){var p="left"===f?0:1;o={x:p=c(f,p),y:0},a={x:p,y:1}}else{var d="right"===f?1:0;o={x:d=c(f,d),y:0},a={x:d,y:1}}s=!0}return{start:o=e.convert(o),end:a=e.convert(a),isVertical:s}},e._getLineCfg=function t(e,n,r,i){var o,a=this._getLineRange(e,n,r,i),s=a.isVertical,u=a.start,c=a.end,l=e.center;return e.isTransposed&&(s=!s),{isVertical:s,factor:o=s&&u.x>l.x||!s&&u.y>l.y?1:-1,start:u,end:c}},e._getCircleCfg=function t(e){var n={},r=e.x,i=e.y,o=i.start>i.end,s;s=e.isTransposed?{x:o?0:1,y:0}:{x:0,y:o?0:1},s=e.convert(s);var u=e.circleCentre,c=[s.x-u.x,s.y-u.y],l=[1,0],f,h=(f=s.y>u.y?a.angle(c,l):-1*a.angle(c,l))+(r.end-r.start);return n.startAngle=f,n.endAngle=h,n.center=u,n.radius=Math.sqrt(Math.pow(s.x-u.x,2)+Math.pow(s.y-u.y,2)),n.inner=e.innerRadius||0,n},e._getRadiusCfg=function t(e){var n,r=e.x.start<0?-1:1,i,o;return e.isTransposed?(i={x:0,y:0},o={x:1,y:0}):(i={x:0,y:0},o={x:0,y:1}),{factor:r,start:e.convert(i),end:e.convert(o)}},e._getAxisPosition=function t(e,n,r,i){var o="",a=this.options;if(a[i]&&a[i].position)o=a[i].position;else{var s=e.type;e.isRect?"x"===n?o="bottom":"y"===n&&(o=r?"right":"left"):o="helix"===s?"helix":"x"===n?e.isTransposed?"radius":"circle":e.isTransposed?"circle":"radius"}return o},e._getAxisDefaultCfg=function t(e,n,i,o){var a=this,s=this.viewTheme,u={},c=this.options,l=n.field;if((u=r.deepMix({},s.axis[o],u,c[l])).viewTheme=s,u.title){var f=r.isPlainObject(u.title)?u.title:{};f.text=f.text||n.alias||l,r.deepMix(u,{title:f})}return u.ticks=n.getTicks(),e.isPolar&&!n.isCategory&&"x"===i&&Math.abs(e.endAngle-e.startAngle)===2*Math.PI&&u.ticks.pop(),u.coord=e,u.label&&r.isNil(u.label.autoRotate)&&(u.label.autoRotate=!0),c.hasOwnProperty("xField")&&c.xField.hasOwnProperty("grid")&&"left"===u.position&&r.deepMix(u,c.xField),u},e._getAxisCfg=function t(e,n,i,o,a,c){void 0===a&&(a="");var l=this,f=l._getAxisPosition(e,o,a,n.field),h=l._getAxisDefaultCfg(e,n,o,f);if(!r.isEmpty(h.grid)&&i){var p=[],d=[],v=s(i.getTicks());if(v.length){var g=u(h.ticks,n.isLinear,"center"===h.grid.align);r.each(g,function(t,i){d.push(t.tickValue);var s=[],u=t.value;if("center"===h.grid.align&&(u=l._getMiddleValue(u,g,i,n.isLinear)),!r.isNil(u)){var f=e.x,y=e.y;r.each(v,function(t){var n="x"===o?u:t.value,r="x"===o?t.value:u,i=e.convert({x:n,y:r});if(e.isPolar){var a=e.circleCentre;y.start>y.end&&(r=1-r),i.flag=f.start>f.end?0:1,i.radius=Math.sqrt(Math.pow(i.x-a.x,2)+Math.pow(i.y-a.y,2))}s.push(i)}),p.push({_id:c+"-"+o+a+"-grid-"+t.tickValue,points:s})}})}h.grid.items=p,h.grid.tickValues=d}return h.type=n.type,h},e._getHelixCfg=function t(e){for(var n={},r=e.a,i=e.startAngle,o=e.endAngle,a=100,s=[],u=0;u<=100;u++){var c=e.convert({x:u/100,y:0});s.push(c.x),s.push(c.y)}var l=e.convert({x:0,y:0});return n.a=r,n.startAngle=i,n.endAngle=o,n.crp=s,n.axisStart=l,n.center=e.center,n.inner=e.y.start,n},e._drawAxis=function t(e,n,i,a,s,u,c){var l=this.container,f=this.canvas,h,p;"cartesian"===e.type?(h=o.Line,p=this._getLineCfg(e,n,a,c)):"helix"===e.type&&"x"===a?(h=o.Helix,p=this._getHelixCfg(e)):"x"===a?(h=o.Circle,p=this._getCircleCfg(e)):(h=o.Line,p=this._getRadiusCfg(e));var d=this._getAxisCfg(e,n,i,a,c,s);d=r.mix({},d,p),"y"===a&&u&&"circle"===u.get("type")&&(d.circle=u),d._id=s+"-"+a,r.isNil(c)||(d._id=s+"-"+a+c),r.mix(d,{canvas:f,group:l});var v=new h(d);return v.render(),this.axes.push(v),v},e.createAxis=function t(e,n,i){var o=this,a=this.coord,s=a.type,u;"theta"===s||"polar"===s&&a.isTransposed||(e&&!o._isHide(e.field)&&(u=o._drawAxis(a,e,n[0],"x",i)),r.isEmpty(n)||"helix"===s||r.each(n,function(t,n){o._isHide(t.field)||o._drawAxis(a,t,e,"y",i,u,n)}))},e.changeVisible=function t(e){var n=this.axes;r.each(n,function(t){t.set("visible",e)})},e.clear=function t(){var e=this,n=this.axes;r.each(n,function(t){t.clear()}),this.axes=[]},t}();t.exports=l},function(t,e,n){var r=n(0),i=n(258),o=function(){function t(t){this.type="rect",this.actions=[],this.cfg={},r.mix(this,t),this.option=t||{}}var e=t.prototype;return e.reset=function t(e){return this.actions=e.actions||[],this.type=e.type,this.cfg=e.cfg,this.option.actions=this.actions,this.option.type=this.type,this.option.cfg=this.cfg,this},e._execActions=function t(e){var n=this.actions;r.each(n,function(t){var n=t[0];e[n](t[1],t[2])})},e.hasAction=function t(e){var n=this.actions,i=!1;return r.each(n,function(t){if(e===t[0])return i=!0,!1}),i},e.createCoord=function t(e,n){var o=this,a=this.type,s=this.cfg,u,c,l=r.mix({start:e,end:n},s);return"theta"===a?(u=i.Polar,this.hasAction("transpose")||this.transpose(),(c=new u(l)).type=a):c=new(u=i[r.upperFirst(a||"")]||i.Rect)(l),this._execActions(c),c},e.rotate=function t(e){return e=e*Math.PI/180,this.actions.push(["rotate",e]),this},e.reflect=function t(e){return this.actions.push(["reflect",e]),this},e.scale=function t(e,n){return this.actions.push(["scale",e,n]),this},e.transpose=function t(){return this.actions.push(["transpose"]),this},t}();t.exports=o},function(t,e,n){var r=n(0);function i(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isNil(n)&&r.isNil(i)?r.isEqual(t,e):r.isEqual(n,i)}function o(t){t.shape&&t.shape.get("origin")&&(t.data=t.shape.get("origin"))}var a=function(){function t(t){this.view=null,this.canvas=null,r.assign(this,t),this._init()}var e=t.prototype;return e._init=function t(){this.pixelRatio=this.canvas.get("pixelRatio")},e._getShapeEventObj=function t(e){return{x:e.x/this.pixelRatio,y:e.y/this.pixelRatio,target:e.target,toElement:e.event.toElement||e.event.relatedTarget}},e._getShape=function t(e,n){var r,i;return this.view.get("canvas").getShape(e,n)},e._getPointInfo=function t(e){var n=this.view,r={x:e.x/this.pixelRatio,y:e.y/this.pixelRatio},i=n.getViewsByPoint(r);return r.views=i,r},e._getEventObj=function t(e,n,r){return{x:n.x,y:n.y,target:e.target,toElement:e.event.toElement||e.event.relatedTarget,views:r}},e.bindEvents=function t(){var e=this.canvas;e.on("mousedown",r.wrapBehavior(this,"onDown")),e.on("mousemove",r.wrapBehavior(this,"onMove")),e.on("mouseleave",r.wrapBehavior(this,"onOut")),e.on("mouseup",r.wrapBehavior(this,"onUp")),e.on("click",r.wrapBehavior(this,"onClick")),e.on("dblclick",r.wrapBehavior(this,"onClick")),e.on("touchstart",r.wrapBehavior(this,"onTouchstart")),e.on("touchmove",r.wrapBehavior(this,"onTouchmove")),e.on("touchend",r.wrapBehavior(this,"onTouchend"))},e._triggerShapeEvent=function t(e,n,r){if(e&&e.name&&!e.get("destroyed")){var i=this.view;if(i.isShapeInView(e)){var o=e.name+":"+n;r.view=i,r.appendInfo=e.get("appendInfo"),i.emit(o,r);var a=i.get("parent");a&&a.emit(o,r)}}},e.onDown=function t(e){var n=this.view,r=this._getShapeEventObj(e);r.shape=this.currentShape,o(r),n.emit("mousedown",r),this._triggerShapeEvent(this.currentShape,"mousedown",r)},e.onMove=function t(e){var n=this,r=this.view,a=this.currentShape;a&&a.get("destroyed")&&(a=null,this.currentShape=null);var s=this._getShape(e.x,e.y)||e.currentTarget,u=this._getShapeEventObj(e);if(u.shape=s,o(u),r.emit("mousemove",u),this._triggerShapeEvent(s,"mousemove",u),a&&!i(a,s)){var c=this._getShapeEventObj(e);c.shape=a,c.toShape=s,o(c),this._triggerShapeEvent(a,"mouseleave",c)}if(s&&!i(a,s)){var l=this._getShapeEventObj(e);l.shape=s,l.fromShape=a,o(l),this._triggerShapeEvent(s,"mouseenter",l)}this.currentShape=s;var f=this._getPointInfo(e),h=this.curViews||[];0===h.length&&f.views.length&&r.emit("plotenter",this._getEventObj(e,f,f.views)),h.length&&0===f.views.length&&r.emit("plotleave",this._getEventObj(e,f,h)),f.views.length&&((u=this._getEventObj(e,f,f.views)).shape=s,o(u),r.emit("plotmove",u)),this.curViews=f.views},e.onOut=function t(e){var n=this,r=this.view,i=this._getPointInfo(e),o=this.curViews||[],a=this._getEventObj(e,i,o);!this.curViews||0===this.curViews.length||a.toElement&&"CANVAS"===a.toElement.tagName||(r.emit("plotleave",a),this.curViews=[])},e.onUp=function t(e){var n=this.view,r=this._getShapeEventObj(e);r.shape=this.currentShape,n.emit("mouseup",r),this._triggerShapeEvent(this.currentShape,"mouseup",r)},e.onClick=function t(e){var n=this,i=this.view,a=this._getShape(e.x,e.y)||e.currentTarget,s=this._getShapeEventObj(e);s.shape=a,o(s),i.emit("click",s),this._triggerShapeEvent(a,e.type,s),this.currentShape=a;var u=this._getPointInfo(e),c=u.views;if(!r.isEmpty(c)){var l=this._getEventObj(e,u,c);if(this.currentShape){var f=this.currentShape;l.shape=f,o(l)}i.emit("plotclick",l),"dblclick"===e.type&&(i.emit("plotdblclick",l),i.emit("dblclick",s))}},e.onTouchstart=function t(e){var n=this.view,r=this._getShape(e.x,e.y)||e.currentTarget,i=this._getShapeEventObj(e);i.shape=r,o(i),n.emit("touchstart",i),this._triggerShapeEvent(r,"touchstart",i),this.currentShape=r},e.onTouchmove=function t(e){var n=this.view,r=this._getShape(e.x,e.y)||e.currentTarget,i=this._getShapeEventObj(e);i.shape=r,o(i),n.emit("touchmove",i),this._triggerShapeEvent(r,"touchmove",i),this.currentShape=r},e.onTouchend=function t(e){var n=this.view,r=this._getShapeEventObj(e);r.shape=this.currentShape,o(r),n.emit("touchend",r),this._triggerShapeEvent(this.currentShape,"touchend",r)},e.clearEvents=function t(){var e=this.canvas;e.off("mousemove",r.getWrapBehavior(this,"onMove")),e.off("mouseleave",r.getWrapBehavior(this,"onOut")),e.off("mousedown",r.getWrapBehavior(this,"onDown")),e.off("mouseup",r.getWrapBehavior(this,"onUp")),e.off("click",r.getWrapBehavior(this,"onClick")),e.off("dblclick",r.getWrapBehavior(this,"onClick")),e.off("touchstart",r.getWrapBehavior(this,"onTouchstart")),e.off("touchmove",r.getWrapBehavior(this,"onTouchmove")),e.off("touchend",r.getWrapBehavior(this,"onTouchend"))},t}();t.exports=a},function(t,e,n){var r=n(0),i=n(270),o=function(){function t(t){this.guides=[],this.options=[],this.xScales=null,this.yScales=null,this.view=null,this.viewTheme=null,this.frontGroup=null,this.backGroup=null,r.mix(this,t)}var e=t.prototype;return e._creatGuides=function t(){var e=this,n=this.options,o=this.xScales,a=this.yScales,s=this.view,u=this.viewTheme;return this.backContainer&&s&&(this.backGroup=this.backContainer.addGroup({viewId:s.get("_id")})),this.frontContainer&&s&&(this.frontGroup=this.frontContainer.addGroup({viewId:s.get("_id")})),n.forEach(function(t){var n=t.type,s=r.deepMix({xScales:o,yScales:a,viewTheme:u},u?u.guide[n]:{},t);n=r.upperFirst(n);var c=new i[n](s);e.guides.push(c)}),e.guides},e.line=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"line"},e)),this},e.arc=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"arc"},e)),this},e.text=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"text"},e)),this},e.image=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"image"},e)),this},e.region=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"region"},e)),this},e.regionFilter=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"regionFilter"},e)),this},e.dataMarker=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"dataMarker"},e)),this},e.dataRegion=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"dataRegion"},e)),this},e.html=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"html"},e)),this},e.render=function t(e){var n=this,i=n.view,o=i&&i.get("data"),a=n._creatGuides();r.each(a,function(t){var r;r=t.get("top")?n.frontGroup||n.frontContainer:n.backGroup||n.backContainer,t.render(e,r,o,i)})},e.clear=function t(){this.options=[],this.reset()},e.changeVisible=function t(e){var n=this.guides;r.each(n,function(t){t.changeVisible(e)})},e.reset=function t(){var e=this.guides;r.each(e,function(t){t.clear()}),this.guides=[],this.backGroup&&this.backGroup.remove(),this.frontGroup&&this.frontGroup.remove()},t}();t.exports=o},function(t,e,n){var r=n(0),i,o=n(29).Legend,a=n(272),s=n(9),u="_origin",c=4.5,l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;function f(t,e,n){var i;return!r.isNil(n)&&(t=n.translate(t),e=n.translate(e),i=n.isCategory?t===e:Math.abs(t-e)<=1)}function h(t,e){var n;return r.each(t,function(t){var r;if(t.get("visible")&&t.getYScale().field===e)return void(n=t)}),n}var p=function(){function t(t){var e=this;this.options={},r.mix(this,t),this.clear();var n=this.chart;this.container=n.get("frontPlot"),this.plotRange=n.get("plotRange")}var e=t.prototype;return e.clear=function t(){var e=this.legends;this.backRange=null,r.each(e,function(t){r.each(t,function(t){t.destroy()})}),this.legends={}},e.getBackRange=function t(){var e=this.backRange;if(!e){e=this.chart.get("backPlot").getBBox();var n=this.plotRange;e.maxX-e.minX0){var a=n.getXScale(),s=n.getYScale(),u=a.field,c=s.field,l=e.get("origin")._origin,f,h=n.get("labelContainer").get("labelsGroup").get("children");r.each(h,function(t){var n=t.get("origin")||[];n[u]===l[u]&&n[c]===l[c]&&(t.set("visible",i),e.set("gLabel",t))})}}},e._bindFilterEvent=function t(e,n){var i=this,o=this.chart,a=n.field;e.on("itemfilter",function(t){var e=t.range;o.filterShape(function(t,n,o){if(!r.isNil(t[a])){var s=t[a]>=e[0]&&t[a]<=e[1];return i._filterLabels(n,o,s),s}return!0});for(var n=o.getAllGeoms()||[],s=function t(r){var i=n[r];"heatmap"===i.get("type")&&l(function(){i.drawWithRange(e)})},u=0;u1?f:r;if("left"===_[0]||"right"===_[0])l=h.br.y,w=this._getXAlign(_[0],c,r,p,y,m),O=n?n.get("group").get("y")+n.getHeight()+b:this._getYAlignVertical(_[1],l,j,p,0,m,u.get("height"));else if("top"===_[0]||"bottom"===_[0])if(O=this._getYAlignHorizontal(_[0],l,r,p,g,m),n){var S=n.getWidth();w=n.get("group").get("x")+S+b}else w=this._getXAlign(_[1],c,j,p,0,m),"right"===_[1]&&(w=h.br.x-j.totalWidth);e.move(w+d,O+v)},e._getXAlign=function t(e,n,r,i,o,a){var s="left"===e?i.minX-o-a[3]:i.maxX+a[1];return"center"===e&&(s=(n-r.totalWidth)/2),s},e._getYAlignHorizontal=function t(e,n,r,i,o,a){var s;return"top"===e?i.minY-o-a[0]:i.maxY+a[2]},e._getYAlignVertical=function t(e,n,r,i,o,a,s){var u="top"===e?i.minY-o-a[0]:n-r.totalHeight;return"center"===e&&(u=(s-r.totalHeight)/2),u},e._getSubRegion=function t(e){var n=0,i=0,o=0,a=0;return r.each(e,function(t){var e=t.getWidth(),r=t.getHeight();n1){var v=Array(p.callback.length-1).fill("");f.color=p.mapping.apply(p,[c].concat(v)).join("")||w.defaultColor}else f.color=p.mapping(c).join("")||w.defaultColor;if(m&&d)if(d.callback&&d.callback.length>1){var y=Array(d.callback.length-1).fill("");x=d.mapping.apply(d,[c].concat(y)).join("")}else x=d.mapping(c).join("");var _,O=s.getShapeFactory(b).getMarkerCfg(x,f);r.isFunction(x)&&(O.symbol=x),g.push({value:o,dataValue:c,checked:h,marker:O})});var M=r.deepMix({},w.legend[S[0]],h[f]||h,{viewId:_.get("_id"),maxLength:E,items:g,container:v,position:[0,0]}),C;if(M.title&&r.deepMix(M,{title:{text:e.alias||e.field}}),l._isTailLegend(h,i))M.chart=l.chart,M.geom=i,C=new a(M);else if(h.useHtml){var P=v.get("canvas").get("el");if(v=h.container,r.isString(v)&&/^\#/.test(v)){var k=v.replace("#","");v=document.getElementById(k)}v||(v=P.parentNode),M.container=v,void 0===M.legendStyle&&(M.legendStyle={}),M.legendStyle.CONTAINER_CLASS={position:"absolute",overflow:"auto","z-index":""===P.style.zIndex?1:parseInt(P.style.zIndex,10)+1},h.flipPage?(M.legendStyle.CONTAINER_CLASS.height="right"===S[0]||"left"===S[0]?E+"px":"auto",M.legendStyle.CONTAINER_CLASS.width="right"!==S[0]&&"left"!==S[0]?E+"px":"auto",C=new o.CatPageHtml(M)):C=new o.CatHtml(M)}else C=new o.Category(M);return l._bindClickEvent(C,e,u),d[c].push(C),C},e._bindChartMove=function t(e){var n=this.chart,i=this.legends;n.on("plotmove",function(t){var n=!1;if(t.target){var o=t.target.get("origin");if(o){var a=o._origin||o[0]._origin,s=e.field;if(a){var u=a[s];r.each(i,function(t){r.each(t,function(t){n=!0,!t.destroyed&&t.activate(u)})})}}}n||r.each(i,function(t){r.each(t,function(t){!t.destroyed&&t.deactivate()})})})},e._addContinuousLegend=function t(e,n,i){var a=this,s=this.legends;s[i]=s[i]||[];var u=this.container,c=e.field,l=e.getTicks(),f=[],h,p,d,v=this.viewTheme;r.each(l,function(t){var r=t.value,i=e.invert(r),o=n.mapping(i).join("");f.push({value:t.tickValue,attrValue:o,color:o,scaleValue:r}),0===r&&(p=!0),1===r&&(d=!0)}),p||f.push({value:e.min,attrValue:n.mapping(0).join(""),color:n.mapping(0).join(""),scaleValue:0}),d||f.push({value:e.max,attrValue:n.mapping(1).join(""),color:n.mapping(1).join(""),scaleValue:1});var g=this.options,y=i.split("-"),m=v.legend[y[0]];(g&&!1===g.slidable||g[c]&&!1===g[c].slidable)&&(m=r.mix({},m,v.legend.gradient));var b=r.deepMix({},m,g[c]||g,{items:f,attr:n,formatter:e.formatter,container:u,position:[0,0]});if(b.title&&r.deepMix(b,{title:{text:e.alias||e.field}}),"color"===n.type)h=new o.Color(b);else{if("size"!==n.type)return;h=g&&"circle"===g.sizeType?new o.CircleSize(b):new o.Size(b)}return this._bindFilterEvent(h,e),s[i].push(h),h},e._isTailLegend=function t(e,n){if(e.hasOwnProperty("attachLast")&&e.attachLast){var r=n.get("type");if("line"===r||"lineStack"===r||"area"===r||"areaStack"===r)return!0}return!1},e._adjustPosition=function t(e,n){var i;if(n)i="right-top";else if(r.isArray(e))i=String(e[0])+"-"+String(e[1]);else{var o=e.split("-");1===o.length?("left"===o[0]&&(i="left-bottom"),"right"===o[0]&&(i="right-bottom"),"top"===o[0]&&(i="top-center"),"bottom"===o[0]&&(i="bottom-center")):i=e}return i},e.addLegend=function t(e,n,r,i){var o=this,a=this.options,s=e.field,u=a[s],c=this.viewTheme;if(!1===u)return null;if(u&&u.custom)this.addCustomLegend(s);else{var l=a.position||c.defaultLegendPosition,f;l=this._adjustPosition(l,this._isTailLegend(a,r)),u&&u.position&&(l=this._adjustPosition(u.position,this._isTailLegend(u,r))),(f=e.isLinear?this._addContinuousLegend(e,n,l):this._addCategoryLegend(e,n,r,i,l))&&(this._bindHoverEvent(f,s),a.reactive&&this._bindChartMove(e))}},e.addCustomLegend=function t(e){var n=this,i=this.chart,a=this.viewTheme,s=this.container,u=this.options;e&&(u=u[e]);var c=u.position||a.defaultLegendPosition;c=this._adjustPosition(c);var l=this.legends;l[c]=l[c]||[];var f=u.items;if(f){var p=i.getAllGeoms();r.each(f,function(t){var e=h(p,t.value);r.isObject(t.marker)?t.marker.radius=t.marker.radius||4.5:t.marker={symbol:t.marker?t.marker:"circle",fill:t.fill,radius:4.5},t.checked=!!r.isNil(t.checked)||t.checked,t.geom=e});var d=i.get("canvas"),v=this.plotRange,g=c.split("-"),y="right"===g[0]||"left"===g[0]?v.bl.y-v.tr.y:d.get("width"),m=r.deepMix({},a.legend[g[0]],u,{maxLength:y,items:f,container:s,position:[0,0]}),b;if(u.useHtml){var x=u.container;if(/^\#/.test(s)){var _=x.replace("#","");x=document.getElementById(_)}else x||(x=s.get("canvas").get("el").parentNode);m.container=x,void 0===m.legendStyle&&(m.legendStyle={}),m.legendStyle.CONTAINER_CLASS||(m.legendStyle.CONTAINER_CLASS={height:"right"===g[0]||"left"===g[0]?y+"px":"auto",width:"right"!==g[0]&&"left"!==g[0]?y+"px":"auto",position:"absolute",overflow:"auto"}),b=u.flipPage?new o.CatPageHtml(m):new o.CatHtml(m)}else b=new o.Category(m);return l[c].push(b),b.on("itemclick",function(t){u.onClick&&u.onClick(t)}),this._bindHoverEvent(b),b}},e.addMixedLegend=function t(e,n){var i=this,o=[];r.each(e,function(t){var e=t.field;r.each(n,function(n){if(n.getYScale()===t&&t.values&&t.values.length>0){var r=n.get("shapeType")||"point",i=n.getDefaultValue("shape")||"circle",a=s.getShapeFactory(r),u={color:n.getDefaultValue("color")},c=a.getMarkerCfg(i,u),l={value:e,marker:c};o.push(l)}})});var a={custom:!0,items:o};this.options=r.deepMix({},a,this.options);var u=this.addCustomLegend();this._bindClickEventForMix(u)},e.alignLegends=function t(){var e=this,n=e.legends,i=e._getRegion(n);e.totalRegion=i;var o=0;return r.each(n,function(t,n){var a=i.subs[o];r.each(t,function(r,i){var o=t[i-1];r.get("useHtml")&&!r.get("autoPosition")||e._alignLegend(r,o,a,n)}),o++}),this},t}();t.exports=p},function(t,e,n){var r=n(144),i=n(0),o=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,a="linear",s="cat",u="time",c=function(){function t(t){this.defs={},this.viewTheme={scales:{}},this.filters={},i.assign(this,t)}var e=t.prototype;return e._getDef=function t(e){var n=this.defs,r=this.viewTheme,o=null;return(r.scales[e]||n[e])&&(o=i.mix({},r.scales[e]),i.each(n[e],function(t,e){i.isNil(t)?delete o[e]:o[e]=t}),this.filters[e]&&(delete o.min,delete o.max)),o},e._getDefaultType=function t(e,n){var r=a,c=i.Array.firstValue(n,e);return i.isArray(c)&&(c=c[0]),o.test(c)?r=u:i.isString(c)&&(r=s),r},e._getScaleCfg=function t(e,n,o){var a={field:n},s=i.Array.values(o,n);if(a.values=s,!r.isCategory(e)&&"time"!==e){var u=i.Array.getRange(s);a.min=u.min,a.max=u.max,a.nice=!0}return"time"===e&&(a.nice=!1),a},e.createScale=function t(e,n){var o=this,a=this._getDef(e),s;if(!n||!n.length)return s=a&&a.type?r[a.type](a):r.identity({value:e,field:e.toString(),values:[e]});var u=i.Array.firstValue(n,e);if(i.isNumber(e)||i.isNil(u)&&!a)s=r.identity({value:e,field:e.toString(),values:[e]});else{var c;a&&(c=a.type),c=c||this._getDefaultType(e,n);var l=this._getScaleCfg(c,e,n);a&&i.mix(l,a),s=r[c](l)}return s},t}();t.exports=c},function(t,e,n){var r=n(0),i=n(9),o,a=n(29).Tooltip,s,u=r.MatrixUtil.vec2,c=["line","area","path","areaStack"],l=["line","area"],f=["marker","showMarker"];function h(t,e){var n=-1;return r.each(t,function(t,i){var o=!0;for(var a in e)if(e.hasOwnProperty(a)&&-1===f.indexOf(a)&&!r.isObject(e[a])&&e[a]!==t[a]){o=!1;break}if(o)return n=i,!1}),n}function p(t,e){if(!t)return!1;var n="";return!!t.className&&-1!==(n=r.isNil(t.className.baseVal)?t.className:t.className.baseVal).indexOf(e)}function d(t,e){for(var n=t.parentNode,r=!1;n&&n!==document.body;){if(p(n,e)){r=!0;break}n=n.parentNode}return r}function v(t){var e=[];return r.each(t,function(t){var n=h(e,t);-1===n?e.push(t):e[n]=t}),e}var g=function(){function t(t){r.assign(this,t),this.timeStamp=0}var e=t.prototype;return e._normalizeEvent=function t(e){var n=this.chart,r=this._getCanvas(),i=r.getPointByClient(e.clientX,e.clientY),o=r.get("pixelRatio");i.x=i.x/o,i.y=i.y/o;var a=n.getViewsByPoint(i);return i.views=a,i},e._getCanvas=function t(){return this.chart.get("canvas")},e._getTriggerEvent=function t(){var e,n=this.options.triggerOn,r;return n&&"mousemove"!==n?"click"===n?r="plotclick":"none"===n&&(r=null):r="plotmove",r},e._getDefaultTooltipCfg=function t(){var e=this,n=this.chart,i=this.viewTheme,o=this.options,a=r.mix({},i.tooltip),s=n.getAllGeoms().filter(function(t){return t.get("visible")}),u=[];r.each(s,function(t){var e=t.get("type"),n=t.get("adjusts"),i=!1;n&&r.each(n,function(t){if("symmetric"===t.type||"Symmetric"===t.type)return i=!0,!1}),-1!==r.indexOf(u,e)||i||u.push(e)});var c=!(!s.length||!s[0].get("coord"))&&s[0].get("coord").isTransposed,f;if(s.length&&s[0].get("coord")&&"cartesian"===s[0].get("coord").type)if("interval"===u[0]&&!1!==o.shared){var h=r.mix({},i.tooltipCrosshairsRect);h.isTransposed=c,f={zIndex:0,crosshairs:h}}else if(r.indexOf(l,u[0])>-1){var p=r.mix({},i.tooltipCrosshairsLine);p.isTransposed=c,f={crosshairs:p}}return r.mix(a,f,{})},e._bindEvent=function t(){var e=this.chart,n=this._getTriggerEvent();n&&(e.on(n,r.wrapBehavior(this,"onMouseMove")),e.on("plotleave",r.wrapBehavior(this,"onMouseOut")))},e._offEvent=function t(){var e=this.chart,n=this._getTriggerEvent();n&&(e.off(n,r.getWrapBehavior(this,"onMouseMove")),e.off("plotleave",r.getWrapBehavior(this,"onMouseOut")))},e._setTooltip=function t(e,n,i,o){var a=this,s=this.tooltip,u=this.prePoint;if(!u||u.x!==e.x||u.y!==e.y){n=v(n),this.prePoint=e;var c=this.chart,l=this.viewTheme,f=r.isArray(e.x)?e.x[e.x.length-1]:e.x,h=r.isArray(e.y)?e.y[e.y.length-1]:e.y;s.get("visible")||c.emit("tooltip:show",{x:f,y:h,tooltip:s});var p=n[0],d=p.title||p.name,g;s.isContentChange(d,n)&&(c.emit("tooltip:change",{tooltip:s,x:f,y:h,items:n}),d=n[0].title||n[0].name,s.setContent(d,n),r.isEmpty(i)?(s.clearMarkers(),s.set("markerItems",[])):!0===this.options.hideMarkers?s.set("markerItems",i):s.setMarkers(i,l.tooltipMarker)),o===this._getCanvas()&&"mini"===s.get("type")?s.hide():(s.setPosition(f,h,o),s.show())}},e.hideTooltip=function t(){var e=this.tooltip,n=this.chart,r=this._getCanvas();this.prePoint=null,e.hide(),n.emit("tooltip:hide",{tooltip:e}),r.draw()},e.onMouseMove=function t(e){if(!r.isEmpty(e.views)){var n=this.timeStamp,i=+new Date,o={x:e.x,y:e.y};i-n>16&&!this.chart.get("stopTooltip")&&(this.showTooltip(o,e.views,e.shape),this.timeStamp=i)}},e.onMouseOut=function t(e){var n=this.tooltip;n.get("visible")&&n.get("follow")&&(e&&e.toElement&&(p(e.toElement,"g2-tooltip")||d(e.toElement,"g2-tooltip"))||this.hideTooltip())},e.renderTooltip=function t(){var e=this;if(!e.tooltip){var n=e.chart,i=e.viewTheme,o=e._getCanvas(),s=e._getDefaultTooltipCfg(),u=e.options,c;(u=r.deepMix({plotRange:n.get("plotRange"),capture:!1,canvas:o,frontPlot:n.get("frontPlot"),viewTheme:i.tooltip,backPlot:n.get("backPlot")},s,u)).crosshairs&&"rect"===u.crosshairs.type&&(u.zIndex=0),u.visible=!1,"mini"===u.type?(u.crosshairs=!1,u.position="top",c=new a.Mini(u)):c=u.useHtml?new a.Html(u):new a.Canvas(u),e.tooltip=c;var l=e._getTriggerEvent();if(!c.get("enterable")&&"plotmove"===l){var f=c.get("container");f&&(f.onmousemove=function(t){var r=e._normalizeEvent(t);n.emit(l,r)})}e._bindEvent()}},e.showTooltip=function t(e,n,i){var o=this;if(!r.isEmpty(n)&&e){this.tooltip||this.renderTooltip();var a=o.options,s=[],l=[];if(r.each(n,function(t){if(!t.get("tooltipEnable"))return!0;var n=t.get("geoms"),i=t.get("coord");r.each(n,function(t){var n=t.get("type");if(t.get("visible")&&!1!==t.get("tooltipCfg")){var u=t.get("dataArray");if(t.isShareTooltip()||!1===a.shared&&r.inArray(["area","line","path","polygon"],n))r.each(u,function(u){var f=t.findPoint(e,u);if(f){var h=t.getTipItems(f,a.title);r.each(h,function(e){var a=e.point;if(a&&a.x&&a.y){var u=r.isArray(a.x)?a.x[a.x.length-1]:a.x,l=r.isArray(a.y)?a.y[a.y.length-1]:a.y;a=i.applyMatrix(u,l,1),e.x=a[0],e.y=a[1],e.showMarker=!0;var f=o._getItemMarker(t,e.color);e.marker=f,-1!==r.indexOf(c,n)&&s.push(e)}}),l=l.concat(h)}});else{var f=t.get("shapeContainer"),h,p=f.get("canvas").get("pixelRatio"),d=f.getShape(e.x*p,e.y*p);d&&d.get("visible")&&d.get("origin")&&(l=t.getTipItems(d.get("origin"),a.title))}}}),r.each(l,function(t){var e=t.point,n=r.isArray(e.x)?e.x[e.x.length-1]:e.x,o=r.isArray(e.y)?e.y[e.y.length-1]:e.y;e=i.applyMatrix(n,o,1),t.x=e[0],t.y=e[1]})}),l.length){var f=l[0];if(!l.every(function(t){return t.title===f.title})){var h=f,p=1/0;l.forEach(function(t){var n=u.distance([e.x,e.y],[t.x,t.y]);n1){var d=l[0],v=Math.abs(e.y-d.y);r.each(l,function(t){Math.abs(e.y-t.y)<=v&&(d=t,v=Math.abs(e.y-t.y))}),d&&d.x&&d.y&&(s=[d]),l=[d]}o._setTooltip(e,l,s,i)}else o.hideTooltip()}},e.clear=function t(){var e=this.tooltip;e&&e.destroy(),this.tooltip=null,this.prePoint=null,this._offEvent()},e._getItemMarker=function t(e,n){var r=e.get("shapeType")||"point",o=e.getDefaultValue("shape")||"circle",a,s={color:n},u;return i.getShapeFactory(r).getMarkerCfg(o,s)},t}();t.exports=g},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(113),a=n(8),s=n(0),u=n(115),c=n(5),l=n(122),f="_origin",h=n(261);function p(t){var e=t.startAngle,n=t.endAngle;return!(!s.isNil(e)&&!s.isNil(n)&&n-e<2*Math.PI)}function d(t,e,n){var r=(t-e)/(n-e);return r>=0&&r<=1}function v(t,e){var n=!1,r;if(t)if("theta"===t.type){var i=t.start,o=t.end;n=d(e.x,i.x,o.x)&&d(e.y,i.y,o.y)}else{var a=t.invert(e);n=a.x>=0&&a.y>=0&&a.x<=1&&a.y<=1}return n}var g={};s.each(a,function(t,e){var n=s.lowerFirst(e);g[n]=function(e){var n=new t(e);return this.addGeom(n),n}});var y=function(t){r(n,t);var e=n.prototype;function n(e){var n,r=i(i(n=t.call(this,e)||this));return r._setTheme(),s.each(a,function(t,e){var n=s.lowerFirst(e);r[n]=function(e){void 0===e&&(e={}),e.viewTheme=r.get("viewTheme");var n=new t(e);return r.addGeom(n),n}}),r.init(),n}return e.getDefaultCfg=function t(){return{viewContainer:null,coord:null,start:{x:0,y:0},end:{x:1,y:1},geoms:[],scales:{},options:{},scaleController:null,padding:0,theme:null,parent:null,tooltipEnable:!0,animate:c.animate,visible:!0}},e._setTheme=function t(){var e=this,n=this.get("theme"),r={},i={};s.isObject(n)?i=n:-1!==s.indexOf(Object.keys(l),n)&&(i=l[n]),s.deepMix(r,c,i),this.set("viewTheme",r)},e.init=function t(){this._initViewPlot(),this.get("data")&&this._initData(this.get("data")),this._initOptions(),this._initControllers(),this._bindEvents()},e._initOptions=function t(){var e=this,n=s.mix({},e.get("options"));n.scales||(n.scales={}),n.coord||(n.coord={}),!1===n.animate&&this.set("animate",!1),(!1===n.tooltip||s.isNull(n.tooltip))&&this.set("tooltipEnable",!1),n.geoms&&n.geoms.length&&s.each(n.geoms,function(t){e._createGeom(t)});var r=e.get("scaleController");r&&(r.defs=n.scales);var i=e.get("coordController");i&&i.reset(n.coord),this.set("options",n)},e._createGeom=function t(e){var n=e.type,r;this[n]&&(r=this[n](),s.each(e,function(t,e){var n;r[e]&&(s.isObject(t)&&t.field?"label"===t?r[e](t.field,t.callback,t.cfg):(s.each(t,function(t,e){"field"!==e&&(n=t)}),r[e](t.field,n)):r[e](t))}))},e._initControllers=function t(){var e=this,n=this.get("options"),r=this.get("viewTheme"),i=this.get("canvas"),o=new u.Scale({viewTheme:r,defs:n.scales}),a=new u.Coord(n.coord);this.set("scaleController",o),this.set("coordController",a);var s=new u.Axis({canvas:i,viewTheme:r});this.set("axisController",s);var c=new u.Guide({viewTheme:r,options:n.guides||[]});this.set("guideController",c)},e._initViewPlot=function t(){this.get("viewContainer")||this.set("viewContainer",this.get("middlePlot"))},e._initGeoms=function t(){for(var e=this.get("geoms"),n=this.get("filteredData"),r=this.get("coord"),i=this.get("_id"),o=0;o0;){var r;n.shift().destroy()}},e._drawGeoms=function t(){this.emit("beforedrawgeoms");for(var e=this.get("geoms"),n=this.get("coord"),r=0;r0?a.change({min:0}):c<=0&&a.change({max:0}))}}},e._setCatScalesRange=function t(){var e=this,n=this.get("coord"),r=this.get("viewTheme"),i=this.getXScale(),o=this.getYScales(),a=[];i&&a.push(i),a=a.concat(o);var u=n.isPolar&&p(n),c,l=this.get("scaleController").defs;s.each(a,function(t){if((t.isCategory||t.isIdentity)&&t.values&&(!l[t.field]||!l[t.field].range)){var e=t.values.length,i;if(1===e)i=[.5,1];else{var o=1,a=0;i=u?n.isTransposed?[(a=1/e*(o=r.widthRatio.multiplePie))/2,1-a/2]:[0,1-1/e]:[a=1/e*1/2,1-a]}t.range=i}})},e.getXScale=function t(){var e=this.get("geoms"),n=null;return s.isEmpty(e)||(n=e[0].getXScale()),n},e.getYScales=function t(){for(var e=this.get("geoms"),n=[],r=0;rc&&(c=e),e0){var v=l[f-1],g=l[f];v.pos+v.size>g.pos&&(v.size+=g.size,v.targets=v.targets.concat(g.targets),l.splice(f,1),r=!0)}}f=0;var y=this.get("itemsGroup").addGroup();l.forEach(function(t){var r=o+s;t.targets.forEach(function(){var i=e[f].attr("matrix")[7],o=t.pos+r-s/2,a;Math.abs(i-o)>s/2&&n._adjustDenote(y,o,i-n.get("group").attr("matrix")[7]/2),e[f].translate(0,-i),e[f].translate(0,o),r+=s,f++})})},e}(o.Legend.Category);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(0),o,a,s="auto",u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function t(){return{type:"plotBack",padding:null,background:null,plotRange:null,plotBackground:null}},n._beforeRenderUI=function t(){this._calculateRange()},n._renderUI=function t(){this._renderBackground(),this._renderPlotBackground()},n._renderBackground=function t(){var e=this,n=this.get("background");if(n){var r=this.get("canvas"),o,a,s={x:0,y:0,width:this.get("width")||r.get("width"),height:this.get("height")||r.get("height")},u=this.get("backgroundShape");u?u.attr(s):(u=this.addShape("rect",{attrs:i.mix(s,n)}),this.set("backgroundShape",u))}},n._renderPlotBackground=function t(){var e=this,n=this.get("plotBackground");if(n){var r=this.get("plotRange"),o=r.br.x-r.bl.x,a=r.br.y-r.tr.y,s=r.tl,u={x:s.x,y:s.y,width:o,height:a},c=this.get("plotBackShape");c?c.attr(u):(n.image?(u.img=n.image,c=this.addShape("image",{attrs:u})):(i.mix(u,n),c=this.addShape("rect",{attrs:u})),this.set("plotBackShape",c))}},n._convert=function t(e,n){if(i.isString(e))if("auto"===e)e=0;else if(-1!==e.indexOf("%")){var r=this.get("canvas"),o=this.get("width")||r.get("width"),a=this.get("height")||r.get("height");e=parseInt(e,10)/100,e=n?e*o:e*a}return e},n._calculateRange=function t(){var e=this,n=this.get("plotRange");i.isNil(n)&&(n={});var r=this.get("padding"),o=this.get("canvas"),a=this.get("width")||o.get("width"),s=this.get("height")||o.get("height"),u=i.toAllPadding(r),c=this._convert(u[0],!1),l=this._convert(u[1],!0),f=this._convert(u[2],!1),h=this._convert(u[3],!0),p=Math.min(h,a-l),d=Math.max(h,a-l),v=Math.min(s-f,c),g=Math.max(s-f,c);n.tl={x:p,y:v},n.tr={x:d,y:v},n.bl={x:p,y:g},n.br={x:d,y:g},n.cc={x:(d+p)/2,y:(g+v)/2},this.set("plotRange",n)},n.repaint=function t(){return this._calculateRange(),this._renderBackground(),this._renderPlotBackground(),this},e}(n(25).Group);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i;function o(t,e,n){return{x:t.x+e*Math.cos(n),y:t.y+e*Math.sin(n)}}var a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="circle",n},n.getRegion=function t(e,n){var r=.5,i=2*Math.PI/e,a=-1*Math.PI/2+i*n,s=r/(1+1/Math.sin(i/2)),u,c=o({x:.5,y:.5},r-s,a),l=5*Math.PI/4,f=1*Math.PI/4;return{start:o(c,s,l),end:o(c,s,f)}},n.generateFacets=function t(e){var n=this,r,i=n.fields[0];if(!i)throw"Please specify for the field for facet!";var o=n.getFieldValues(i,e),a=o.length,s=[];return o.forEach(function(t,r){var u=[{field:i,value:t,values:o}],c=n.getFilter(u),l=e.filter(c),f={type:n.type,colValue:t,colField:i,colIndex:r,cols:a,rows:1,rowIndex:0,data:l,region:n.getRegion(a,r)};s.push(f)}),s},e}(n(43));t.exports=a},function(t,e,n){var r=n(0),i=n(114),o={};o.Rect=n(117),o.List=n(116),o.Circle=n(274),o.Tree=n(278),o.Mirror=n(277),o.Matrix=n(276),i.prototype.facet=function(t,e){var n=o[r.upperFirst(t)];if(!n)throw new Error("Not support such type of facets as: "+t);var i=this.get("facets");i&&i.destroy(),e.chart=this;var a=new n(e);this.set("facets",a)},t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="matrix",n.showTitle=!1,n},n.generateFacets=function t(e){for(var n=this,r=this.fields,i=r.length,o=i,a=[],s=0;s=0;a--)for(var s=n.getFacetsByLevel(e,a),u=0;ua&&(a=e),e=e[0]}));for(var p=this._getScale(u),v=0;vf&&(f=t.y),t.yc&&(c=f-u);o;)for(p.forEach(function(t){var e=(Math.min.apply(h,t.targets)+Math.max.apply(h,t.targets))/2;t.pos=Math.min(Math.max(h,e-t.size/2),c-t.size)}),o=!1,l=p.length;l--;)if(l>0){var d=p[l-1],v=p[l];d.pos+d.size>v.pos&&(d.size+=v.size,d.targets=d.targets.concat(v.targets),d.pos+d.size>c&&(d.pos=c-d.size),p.splice(l,1),o=!0)}l=0,p.forEach(function(n){var r=u+e/2;n.targets.forEach(function(){t[l].y=n.pos+r,r+=e,l++})}),t.forEach(function(t){var e=t.r*t.r,n=Math.pow(Math.abs(t.y-r.y),2);if(e0&&(n=this._distribute(n,i)),t.prototype.adjustItems.call(this,n)},n._distribute=function t(e,n){var r=this,i=this.get("coord"),o=i.getRadius(),a=this.get("label").labelHeight,s=i.getCenter(),u,c=2*(o+n)+2*a,f={start:i.start,end:i.end},h=this.get("geom");if(h){var p=h.get("view");f=p.getViewRegion()}var d=[[],[]];return e.forEach(function(t){t&&("right"===t.textAlign?d[0].push(t):d[1].push(t))}),d.forEach(function(t,e){var n=parseInt(c/a,10);t.length>n&&(t.sort(function(t,e){return e["..percent"]-t["..percent"]}),t.splice(n,t.length-n)),t.sort(function(t,e){return t.y-e.y}),l(t,a,f,s,e)}),d[0].concat(d[1])},n.lineToLabel=function t(e){var n=this,r=this.get("coord"),i=r.getRadius(),o=e.offset,a=e.orignAngle||e.angle,s=r.getCenter(),u=c(s,a,i+2.5),l=c(s,a,i+o/2);e.labelLine||(e.labelLine=this.get("label").labelLine||{}),e.labelLine.path=["M"+u.x,u.y+" Q"+l.x,l.y+" "+e.x,e.y].join(",")},n.getLabelRotate=function t(e,n){var r;return n<0&&((r=180*e/Math.PI)>90&&(r-=180),r<-90&&(r+=180)),r/180*Math.PI},n.getLabelAlign=function t(e){var n=this,r,i=this.get("coord").getCenter(),o,a;return o=e.angle<=Math.PI/2&&e.x>=i.x?"left":"right",this.getDefaultOffset(e)<=0&&(o="right"===o?"left":"right"),o},n.getArcPoint=function t(e){return e},n.getPointAngle=function t(e){var n=this,r=this.get("coord"),o={x:i.isArray(e.x)?e.x[0]:e.x,y:e.y[0]};this.transLabelPoint(o);var s={x:i.isArray(e.x)?e.x[1]:e.x,y:e.y[1]},u;this.transLabelPoint(s);var c=a.getPointAngle(r,o);if(e.points&&e.points[0].y===e.points[1].y)u=c;else{var l=a.getPointAngle(r,s);c>=l&&(l+=2*Math.PI),u=c+(l-c)/2}return u},n.getCirclePoint=function t(e,n){var r=this,i=this.get("coord"),o=i.getCenter(),a=i.getRadius()+n,s=c(o,e,a);return s.angle=e,s.r=a,s},e}(o);t.exports=f},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),o=n(120);n(297);var a=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="line",n.sortable=!0,n},e}(o),s=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.hasDefaultAdjust=!0,n.adjusts=[{type:"stack"}],n},e}(a);a.Stack=s,i.Line=a,i.LineStack=s,t.exports=a},function(t,e,n){var r=n(0),i="_origin";function o(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isEqual(n,i)}function a(t,e){if(!t)return!0;if(t.length!==e.length)return!0;var n=!1;return r.each(e,function(e,r){if(!o(e,t[r]))return n=!0,!1}),n}function s(t,e){var n={};return r.each(t,function(t,i){var o=e.attr(i);r.isArray(o)&&(o=r.cloneDeep(o)),n[i]=o}),n}var u={_isAllowActive:function t(){var e=this.get("allowActive");if(!r.isNil(e))return e;var n=this.get("view"),i=this.isShareTooltip(),o;return!1===n.get("options").tooltip||!i},_onMouseenter:function t(e){var n=this,r=e.shape,i=this.get("shapeContainer");r&&i.contain(r)&&this._isAllowActive()&&this.setShapesActived(r)},_onMouseleave:function t(){var e=this,n,r=this.get("view").get("canvas");this.get("activeShapes")&&(this.clearActivedShapes(),r.draw())},_bindActiveAction:function t(){var e=this,n=this.get("view"),i=this.get("type");n.on(i+":mouseenter",r.wrapBehavior(this,"_onMouseenter")),n.on(i+":mouseleave",r.wrapBehavior(this,"_onMouseleave"))},_offActiveAction:function t(){var e=this,n=this.get("view"),i=this.get("type");n.off(i+":mouseenter",r.getWrapBehavior(this,"_onMouseenter")),n.off(i+":mouseleave",r.getWrapBehavior(this,"_onMouseleave"))},_setActiveShape:function t(e){var n=this,i=this.get("activedOptions")||{},o=e.get("origin"),a=o.shape||this.getDefaultValue("shape");r.isArray(a)&&(a=a[0]);var u=this.get("shapeFactory"),c=r.mix({},e.attr(),{origin:o}),l=u.getActiveCfg(a,c);i.style&&r.mix(l,i.style);var f=s(l,e);e.setSilent("_originAttrs",f),i.animate?e.animate(l,300):e.attr(l),e.set("zIndex",1)},setShapesActived:function t(e){var n=this;r.isArray(e)||(e=[e]);var i=n.get("activeShapes");if(a(i,e)){var o,s=n.get("view").get("canvas"),u=n.get("shapeContainer"),c=n.get("activedOptions");c&&c.highlight?(r.each(e,function(t){t.get("animating")&&t.stopAnimate()}),n.highlightShapes(e)):(i&&n.clearActivedShapes(),r.each(e,function(t){t.get("animating")&&t.stopAnimate(),t.get("visible")&&!t.get("selected")&&n._setActiveShape(t)})),n.set("activeShapes",e),u.sort(),s.draw()}},clearActivedShapes:function t(){var e=this,n=this.get("shapeContainer"),i=this.get("activedOptions"),o=i&&i.animate;if(n&&!n.get("destroyed")){var a=this.get("activeShapes"),s,u;if(r.each(a,function(t){if(!t.get("selected")){var e=t.get("_originAttrs");o?(t.stopAnimate(),t.animate(e,300)):t.attr(e),t.setZIndex(0),t.set("_originAttrs",null)}}),this.get("preHighlightShapes")){var c=n.get("children");r.each(c,function(t){if(!t.get("selected")){var e=t.get("_originAttrs");e&&(o?(t.stopAnimate(),t.animate(e,300)):t.attr(e),t.setZIndex(0),t.set("_originAttrs",null))}})}n.get("children").sort(function(t,e){return t._INDEX-e._INDEX}),this.set("activeShapes",null),this.set("preHighlightShapes",null)}},getGroupShapesByPoint:function t(e){var n=this,i,o=[];if(this.get("shapeContainer")){var a=this.getXScale().field,s=this.getShapes(),u=this._getOriginByPoint(e);r.each(s,function(t){var e=t.get("origin"),n;t.get("visible")&&e&&(e._origin[a]===u[a]&&o.push(t))})}return o},getSingleShapeByPoint:function t(e){var n=this,r=this.get("shapeContainer"),i,o=r.get("canvas").get("pixelRatio"),a;if(r&&(a=r.getShape(e.x*o,e.y*o)),a&&a.get("origin"))return a},highlightShapes:function t(e,n){var i=this;r.isArray(e)||(e=[e]);var o=this.get("activeShapes");if(a(o,e)){o&&this.clearActivedShapes();var u=this.getShapes(),c=this.get("activedOptions"),l=c&&c.animate,f=c&&c.style;r.each(u,function(t){var i={};t.stopAnimate(),-1!==r.indexOf(e,t)?(r.mix(i,f,n),t.setZIndex(1)):(r.mix(i,{fillOpacity:.3,opacity:.3}),t.setZIndex(0));var o=s(i,t);t.setSilent("_originAttrs",o),l?t.animate(i,300):t.attr(i)}),this.set("preHighlightShapes",e),this.set("activeShapes",e)}}};t.exports=u},function(t,e,n){var r=n(0),i="_origin";function o(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isEqual(n,i)}function a(t,e){var n={};return r.each(t,function(t,i){"transform"===i&&(i="matrix");var o=e.attr(i);r.isArray(o)&&(o=r.cloneDeep(o)),n[i]=o}),n}var s={_isAllowSelect:function t(){var e=this.get("allowSelect");if(!r.isNil(e))return e;var n=this.get("type"),i=this.get("coord"),o=i&&i.type;return"interval"===n&&"theta"===o},_onClick:function t(e){var n=this;if(this._isAllowSelect()){this.clearActivedShapes();var r=e.shape,i=this.get("shapeContainer");r&&!r.get("animating")&&i.contain(r)&&this.setShapeSelected(r)}},_bindSelectedAction:function t(){var e=this,n=this.get("view"),i=this.get("type");n.on(i+":click",r.wrapBehavior(this,"_onClick"))},_offSelectedAction:function t(){var e=this,n=this.get("view"),i=this.get("type");n.off(i+":click",r.getWrapBehavior(this,"_onClick"))},_setShapeStatus:function t(e,n){var i=this,o=this.get("view"),s=this.get("selectedOptions")||{},u=!1!==s.animate,c=o.get("canvas");e.set("selected",n);var l=e.get("origin");if(n){var f=l.shape||this.getDefaultValue("shape");r.isArray(f)&&(f=f[0]);var h=this.get("shapeFactory"),p=r.mix({geom:this,point:l},s),d=h.getSelectedCfg(f,p);r.mix(d,p.style),e.get("_originAttrs")||(e.get("animating")&&e.stopAnimate(),e.set("_originAttrs",a(d,e))),u?e.animate(d,300):(e.attr(d),c.draw())}else{var v=e.get("_originAttrs");e.set("_originAttrs",null),u?e.animate(v,300):(e.attr(v),c.draw())}},setShapeSelected:function t(e){var n=this,i=this._getSelectedShapes(),a=this.get("selectedOptions")||{},s=!1!==a.cancelable;if("multiple"===a.mode)-1===r.indexOf(i,e)?(i.push(e),this._setShapeStatus(e,!0)):s&&(r.Array.remove(i,e),this._setShapeStatus(e,!1));else{var u=i[0];s&&(e=o(u,e)?null:e),o(u,e)||(u&&this._setShapeStatus(u,!1),e&&this._setShapeStatus(e,!0))}},clearSelected:function t(){var e=this,n=e.get("shapeContainer");if(n&&!n.get("destroyed")){var i=e._getSelectedShapes();r.each(i,function(t){e._setShapeStatus(t,!1),t.set("_originAttrs",null)})}},setSelected:function t(e){var n=this,i=n.getShapes();return r.each(i,function(t){var r=t.get("origin");r&&r._origin===e&&n.setShapeSelected(t)}),this},_getSelectedShapes:function t(){var e=this,n=this.getShapes(),i=[];return r.each(n,function(t){t.get("selected")&&i.push(t)}),this.set("selectedShapes",i),i}};t.exports=s},function(t,e,n){var r=n(0),i,o=n(5).defaultColor,a="_origin";function s(t){return t.alias||t.field}var u={_getIntervalSize:function t(e){var n=null,i=this.get("type"),o=this.get("coord");if(o.isRect&&("interval"===i||"schema"===i)){n=this.getSize(e._origin);var a=o.isTransposed?"y":"x",s;if(r.isArray(e[a]))n=n(1+i.rangeMax())/2&&(a=i.rangeMin()),n=i.invert(a),i.isCategory&&(n=i.translate(n)),n},_getOriginByPoint:function t(e){var n=this.getXScale(),r=this.getYScale(),i=n.field,o=r.field,a,s=this.get("coord").invert(e),u=n.invert(s.x),c=r.invert(s.y),l={};return l[i]=u,l[o]=c,l},_getScale:function t(e){var n=this,i=this.get("scales"),o=null;return r.each(i,function(t){if(t.field===e)return o=t,!1}),o},_getTipValueScale:function t(){var e=this.getAttrsForLegend(),n;r.each(e,function(t){var e=t.getScale(t.type);if(e.isLinear)return n=e,!1});var i=this.getXScale(),o=this.getYScale();return!n&&o&&"..y"===o.field?i:n||o||i},_getTipTitleScale:function t(e){var n=this;if(e)return this._getScale(e);var i,o=this.getAttr("position").getFields(),a;return r.each(o,function(t){if(-1===t.indexOf(".."))return a=t,!1}),this._getScale(a)},_filterValue:function t(e,n){var i=this.get("coord"),o=this.getYScale(),a=o.field,s,u=i.invert(n).y;u=o.invert(u);var c=e[e.length-1];return r.each(e,function(t){var e=t._origin;if(e[a][0]<=u&&e[a][1]>=u)return c=t,!1}),c},getXDistance:function t(){var e=this,n=this.get("xDistance");if(!n){var i=this.getXScale();if(i.isCategory)n=1;else{var o=i.values,a=i.translate(o[0]),s=a;r.each(o,function(t){(t=i.translate(t))s&&(s=t)});var u=o.length;n=(s-a)/(u-1)}this.set("xDistance",n)}return n},findPoint:function t(e,n){var i=this,o=i.get("type"),a=i.getXScale(),s=i.getYScale(),u=a.field,c=s.field,l=null;if(r.indexOf(["heatmap","point"],o)>-1){var f,h=i.get("coord").invert(e),p=a.invert(h.x),d=s.invert(h.y),v=1/0;return r.each(n,function(t){var e=Math.pow(t._origin[u]-p,2)+Math.pow(t._origin[c]-d,2);e=m){if(!w)return l=t,!1;r.isArray(l)||(l=[]),l.push(t)}}),r.isArray(l)&&(l=this._filterValue(l,e));else{var O;if(a.isLinear||"timeCat"===a.type){if((m>a.translate(_)||ma.max||mMath.abs(a.translate(O._origin[u])-m)&&(y=O)}var C=i.getXDistance();return!l&&Math.abs(a.translate(y._origin[u])-m)<=C/2&&(l=y),l},getTipTitle:function t(e,n){var r="",i=this._getTipTitleScale(n);if(i){var o=e[i.field];r=i.getText(o)}else if("heatmap"===this.get("type")){var a=this.getXScale(),s=this.getYScale(),u,c;r="( "+a.getText(e[a.field])+", "+s.getText(e[s.field])+" )"}return r},getTipValue:function t(e,n){var i,o=n.field,a=e.key;if(i=e[o],r.isArray(i)){var s=[];r.each(i,function(t){s.push(n.getText(t))}),i=s.join("-")}else i=n.getText(i,a);return i},getTipName:function t(e){var n,i,o=this._getGroupScales();if(o.length&&r.each(o,function(t){return i=t,!1}),i){var a=i.field;n=i.getText(e[a])}else{var u;n=s(this._getTipValueScale())}return n},getTipItems:function t(e,n){var i=this,a=e._origin,u=i.getTipTitle(a,n),c=i.get("tooltipCfg"),l=[],f,h;function p(t,n,a){if(!r.isNil(n)&&""!==n){var s={title:u,point:e,name:t||u,value:n,color:e.color||o,marker:!0};s.size=i._getIntervalSize(e),l.push(r.mix({},s,a))}}if(c){var d=c.fields,v=c.cfg,g=[];if(r.each(d,function(t){g.push(a[t])}),v){r.isFunction(v)&&(v=v.apply(null,g));var y=r.mix({},{point:e,title:u,color:e.color||o,marker:!0},v);y.size=i._getIntervalSize(e),l.push(y)}else r.each(d,function(t){if(!r.isNil(a[t])){var e=i._getScale(t);f=s(e),h=e.getText(a[t]),p(f,h)}})}else{var m=i._getTipValueScale();r.isNil(a[m.field])||(h=i.getTipValue(a,m),p(f=i.getTipName(a),h))}return l},isShareTooltip:function t(){var e=this.get("shareTooltip"),n=this.get("type"),i=this.get("view"),o;if(o=i.get("parent")?i.get("parent").get("options"):i.get("options"),"interval"===n){var a=this.get("coord"),s=a.type;("theta"===s||"polar"===s&&a.isTransposed)&&(e=!1)}else this.getYScale()&&!r.inArray(["contour","point","polygon","edge"],n)||(e=!1);return o.tooltip&&r.isBoolean(o.tooltip.shared)&&(e=o.tooltip.shared),e}};t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),o=n(0);n(298);var a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="point",n.shapeType="point",n.generatePoints=!0,n},n.drawPoint=function t(e,n,r,i){var a=this,s=e.shape,u=a.getDrawCfg(e),c;if(a._applyViewThemeShapeStyle(u,s,r),o.isArray(e.y)){var l=a.hasStack();o.each(e.y,function(t,e){u.y=t,u.yIndex=e,l&&0===e||(c=r.drawShape(s,u,n),a.appendShapeInfo(c,i+e))})}else o.isNil(e.y)||(c=r.drawShape(s,u,n),a.appendShapeInfo(c,i))},e}(i),s=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.hasDefaultAdjust=!0,n.adjusts=[{type:"jitter"}],n},e}(a),u=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.hasDefaultAdjust=!0,n.adjusts=[{type:"stack"}],n},e}(a);a.Jitter=s,a.Stack=u,i.Point=a,i.PointJitter=s,i.PointStack=u,t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),o=n(0);n(299);var a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="polygon",n.shapeType="polygon",n.generatePoints=!0,n},n.createShapePointsCfg=function e(n){var r=t.prototype.createShapePointsCfg.call(this,n),i=this,a=r.x,s=r.y,u;if(!o.isArray(a)||!o.isArray(s)){var c=this.getXScale(),l=this.getYScale(),f,h,p=.5/(c.values?c.values.length:c.ticks.length),d=.5/(l.values?l.values.length:l.ticks.length);c.isCategory&&l.isCategory?(a=[a-p,a-p,a+p,a+p],s=[s-d,s+d,s+d,s-d]):o.isArray(a)?(a=[(u=a)[0],u[0],u[1],u[1]],s=[s-d/2,s+d/2,s+d/2,s-d/2]):o.isArray(s)&&(s=[(u=s)[0],u[1],u[1],u[0]],a=[a-p/2,a-p/2,a+p/2,a+p/2]),r.x=a,r.y=s}return r},e}(i);i.Polygon=a,t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(8),a=n(0),s=n(67);n(300);var u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,a.assign(i(i(n)),s),n}return e.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="schema",n.shapeType="schema",n.generatePoints=!0,n},e.createShapePointsCfg=function e(n){var r=t.prototype.createShapePointsCfg.call(this,n);return r.size=this.getNormalizedSize(n),r},n}(o),c=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.hasDefaultAdjust=!0,n.adjusts=[{type:"dodge"}],n},e}(u);u.Dodge=c,o.Schema=u,o.SchemaDodge=c,t.exports=u},function(t,e,n){var r=n(0),i=n(9),o=n(24),a=n(22),s=n(5);function u(t){var e=s.shape.hollowArea,n=r.mix({},e,t.style);return a.addStrokeAttrs(n,t),r.isNumber(t.size)&&(n.lineWidth=t.size),n}function c(t){var e=s.shape.area,n=r.mix({},e,t.style);return a.addFillAttrs(n,t),t.color&&(n.stroke=n.stroke||t.color),r.isNumber(t.size)&&(n.lineWidth=t.size),n}function l(t,e,n){var i=[],a=[],s=[],u=[],c=t.isInCircle;return r.each(t.points,function(t){s.push(t[1]),u.push(t[0])}),u=u.reverse(),a.push(s,u),r.each(a,function(r,a){var s=[],u=(r=n.parsePoints(r))[0];c&&r.push({x:u.x,y:u.y}),s=e?o.getSplinePath(r,!1,t.constraint):o.getLinePath(r,!1),a>0&&(s[0][0]="L"),i=i.concat(s)}),i.push(["Z"]),i}function f(t){return{symbol:function t(e,n){return[["M",e-5.5,n-4],["L",e+5.5,n-4],["L",e+5.5,n+4],["L",e-5.5,n+4],["Z"]]},radius:5,fill:t.color,fillOpacity:.6}}function h(t,e){var n;if("line"===t||"smoothLine"===t)return{lineWidth:(e.lineWidth||0)+1};var r=e.fillOpacity||e.opacity||1;return{fillOpacity:r-.15,strokeOpacity:r-.15}}function p(t,e,n){var i,o=t._coord.convertPoint(e.points[0][1]);return n.addShape("circle",{attrs:r.mix({x:o.x,y:o.y,r:2,fill:e.color},e.style)})}var d=i.registerFactory("area",{defaultShapeType:"area",getDefaultPoints:function t(e){var n=[],i=e.x,o=e.y,a=e.y0;return o=r.isArray(o)?o:[a,o],r.each(o,function(t){n.push({x:i,y:t})}),n},getActiveCfg:function t(e,n){return h(e,n)},drawShape:function t(e,n,r){var i=this.getShape(e),o;return(o=1===n.points.length&&s.showSinglePoint?p(this,n,r):i.draw(n,r))&&(o.set("origin",n.origin),o._id=n.splitedIndex?n._id+n.splitedIndex:n._id,o.name=this.name),o},getSelectedCfg:function t(e,n){return n&&n.style?n.style:this.getActiveCfg(e,n)}});i.registerShape("area","area",{draw:function t(e,n){var i=c(e),o=l(e,!1,this);return n.addShape("path",{attrs:r.mix(i,{path:o})})},getMarkerCfg:function t(e){return f(e)}}),i.registerShape("area","smooth",{draw:function t(e,n){var i=c(e),o=this._coord;e.constraint=[[o.start.x,o.end.y],[o.end.x,o.start.y]];var a=l(e,!0,this);return n.addShape("path",{attrs:r.mix(i,{path:a})})},getMarkerCfg:function t(e){return f(e)}}),i.registerShape("area","line",{draw:function t(e,n){var i=u(e),o=l(e,!1,this);return n.addShape("path",{attrs:r.mix(i,{path:o})})},getMarkerCfg:function t(e){return f(e)}}),i.registerShape("area","smoothLine",{draw:function t(e,n){var i=u(e),o=l(e,!0,this);return n.addShape("path",{attrs:r.mix(i,{path:o})})},getMarkerCfg:function t(e){return f(e)}}),d.spline=d.smooth,t.exports=d},function(t,e,n){var r=n(0),i=n(9),o=n(22),a=n(5),s=n(24),u=1/3;function c(t){var e=a.shape.edge,n=r.mix({},e,t.style);return o.addStrokeAttrs(n,t),n}var l=i.registerFactory("edge",{defaultShapeType:"line",getDefaultPoints:function t(e){return o.splitPoints(e)},getActiveCfg:function t(e,n){var r;return{lineWidth:(n.lineWidth||0)+1}}});function f(t,e){var n=[];n.push({x:t.x,y:.5*t.y+1*e.y/2}),n.push({y:.5*t.y+1*e.y/2,x:e.x}),n.push(e);var i=["C"];return r.each(n,function(t){i.push(t.x,t.y)}),i}function h(t,e){var n=[];n.push({x:e.x,y:e.y}),n.push(t);var i=["Q"];return r.each(n,function(t){i.push(t.x,t.y)}),i}function p(t,e){var n=f(t,e),r=[["M",t.x,t.y]];return r.push(n),r}function d(t,e,n){var r=h(e,n),i=[["M",t.x,t.y]];return i.push(r),i}function v(t,e){var n=h(t[1],e),r=h(t[3],e),i=[["M",t[0].x,t[0].y]];return i.push(r),i.push(["L",t[3].x,t[3].y]),i.push(["L",t[2].x,t[2].y]),i.push(n),i.push(["L",t[1].x,t[1].y]),i.push(["L",t[0].x,t[0].y]),i.push(["Z"]),i}function g(t,e){var n=[];n.push({y:t.y*(1-u)+e.y*u,x:t.x}),n.push({y:t.y*(1-u)+e.y*u,x:e.x}),n.push(e);var i=[["M",t.x,t.y]];return r.each(n,function(t){i.push(["L",t.x,t.y])}),i}i.registerShape("edge","line",{draw:function t(e,n){var i=this.parsePoints(e.points),o=c(e),a=s.getLinePath(i),u;return n.addShape("path",{attrs:r.mix(o,{path:a})})},getMarkerCfg:function t(e){return r.mix({symbol:"circle",radius:4.5},c(e))}}),i.registerShape("edge","vhv",{draw:function t(e,n){var i=e.points,o=c(e),a=g(i[0],i[1]),s;return a=this.parsePath(a),n.addShape("path",{attrs:r.mix(o,{path:a})})},getMarkerCfg:function t(e){return r.mix({symbol:"circle",radius:4.5},c(e))}}),i.registerShape("edge","smooth",{draw:function t(e,n){var i=e.points,o=c(e),a=p(i[0],i[1]),s;return a=this.parsePath(a),n.addShape("path",{attrs:r.mix(o,{path:a})})},getMarkerCfg:function t(e){return r.mix({symbol:"circle",radius:4.5},c(e))}}),i.registerShape("edge","arc",{draw:function t(e,n){var i=e.points,o=i.length>2?"weight":"normal",a=c(e),s,u;if(e.isInCircle){var l={x:0,y:1};"normal"===o?u=d(i[0],i[1],l):(a.fill=a.stroke,u=v(i,l)),u=this.parsePath(u),s=n.addShape("path",{attrs:r.mix(a,{path:u})})}else if("normal"===o)i=this.parsePoints(i),s=n.addShape("arc",{attrs:r.mix(a,{x:(i[1].x+i[0].x)/2,y:i[0].y,r:Math.abs(i[1].x-i[0].x)/2,startAngle:Math.PI,endAngle:2*Math.PI})});else{u=[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y]];var h=f(i[1],i[3]),p=f(i[2],i[0]);u.push(h),u.push(["L",i[3].x,i[3].y]),u.push(["L",i[2].x,i[2].y]),u.push(p),u.push(["Z"]),u=this.parsePath(u),a.fill=a.stroke,s=n.addShape("path",{attrs:r.mix(a,{path:u})})}return s},getMarkerCfg:function t(e){return r.mix({symbol:"circle",radius:4.5},c(e))}}),t.exports=l},function(t,e,n){var r=n(0),i=n(9),o=n(24),a=n(22),s=n(5),u=n(25),c=r.PathUtil;function l(t,e){var n=t.x,i=t.y,o=t.y0,a=t.size,s=o,u=i,c,l;r.isArray(i)&&(u=i[1],s=i[0]),r.isArray(n)?(c=n[0],l=n[1]):(c=n-a/2,l=n+a/2);var f=[];return f.push({x:c,y:s},{x:c,y:u}),e?f.push({x:l,y:(u+s)/2}):f.push({x:l,y:u},{x:l,y:s}),f}function f(t){for(var e=[],n=0;n0;)r-=2*Math.PI;var c=o-t+(r=r/Math.PI/2*n)-2*t;u.push(["M",c,e]);for(var l=0,f=0;f1?t[1]:e,o,a;return{min:e,max:n,min1:i,max1:t.length>3?t[3]:n,median:t.length>2?t[2]:i}}function u(t,e){r.each(t,function(t){e.push({x:t[0],y:t[1]})})}function c(t){var e=a.shape.schema,n=r.mix({},e,t.style);return o.addStrokeAttrs(n,t),n}function l(t){var e=a.shape.schema,n=r.mix({},e,t.style);return o.addFillAttrs(n,t),t.color&&(n.stroke=n.stroke||t.color),n}function f(t,e,n){var i=[],o,a;return r.isArray(e)?o=[[t-n/2,(a=s(e)).max],[t+n/2,a.max],[t,a.max],[t,a.max1],[t-n/2,a.min1],[t-n/2,a.max1],[t+n/2,a.max1],[t+n/2,a.min1],[t,a.min1],[t,a.min],[t-n/2,a.min],[t+n/2,a.min],[t-n/2,a.median],[t+n/2,a.median]]:(e=e||.5,o=[[(a=s(t)).min,e-n/2],[a.min,e+n/2],[a.min,e],[a.min1,e],[a.min1,e-n/2],[a.min1,e+n/2],[a.max1,e+n/2],[a.max1,e-n/2],[a.max1,e],[a.max,e],[a.max,e-n/2],[a.max,e+n/2],[a.median,e-n/2],[a.median,e+n/2]]),u(o,i),i}function h(t){r.isArray(t)||(t=[t]);var e=t.sort(function(t,e){return t0?h=u(h,d):f.addAnimator(this),h.push(d),this.setSilent("animators",h),this.setSilent("pause",{isPaused:!1})},stopAnimate:function t(){var e=this,n=this.get("animators");r.each(n,function(t){e.attr(t.toAttrs),t.toMatrix&&e.attr("matrix",t.toMatrix),t.callback&&t.callback()}),this.setSilent("animating",!1),this.setSilent("animators",[])},pauseAnimate:function t(){var e=this,n=this.get("timeline");return this.setSilent("pause",{isPaused:!0,pauseTime:n.getTime()}),this},resumeAnimate:function t(){var e=this,n,i=this.get("timeline").getTime(),o=this.get("animators"),a=this.get("pause").pauseTime;return r.each(o,function(t){t.startTime=t.startTime+(i-a),t._paused=!1,t._pauseTime=null}),this.setSilent("pause",{isPaused:!1}),this.setSilent("animators",o),this}}},function(t,e,n){var r=n(1);t.exports={canFill:!1,canStroke:!1,initAttrs:function t(e){return this._attrs={opacity:1,fillOpacity:1,strokeOpacity:1,matrix:[1,0,0,0,1,0,0,0,1]},this.attr(r.assign(this.getDefaultAttrs(),e)),this},getDefaultAttrs:function t(){return{}},attr:function t(e,n){var i=this;if(0===arguments.length)return this._attrs;if(r.isObject(e)){for(var o in e)this._setAttr(o,e[o]);return this.clearBBox(),this._cfg.hasUpdate=!0,this}return 2===arguments.length?(this._setAttr(e,n),this.clearBBox(),this._cfg.hasUpdate=!0,this):this._attrs[e]},_setAttr:function t(e,n){var r=this,i=this._attrs;i[e]=n,"fill"!==e&&"stroke"!==e?"opacity"!==e?"clip"===e&&n?this._setClip(n):"path"===e&&this._afterSetAttrPath?this._afterSetAttrPath(n):"transform"!==e?"rotate"===e&&this.rotateAtStart(n):this.transform(n):i.globalAlpha=n:i[e+"Style"]=n},clearBBox:function t(){this.setSilent("box",null)},hasFill:function t(){return this.canFill&&this._attrs.fillStyle},hasStroke:function t(){return this.canStroke&&this._attrs.strokeStyle},_setClip:function t(e){e._cfg.renderer=this._cfg.renderer,e._cfg.canvas=this._cfg.canvas,e._cfg.parent=this._cfg.parent,e.hasFill=function(){return!0}}}},function(t,e,n){var r=n(1),i=n(70),o={arc:n(44),ellipse:n(133),line:n(45)},a,s=r.createDom('').getContext("2d");function u(t,e,n){return n.createPath(s),s.isPointInPath(t,e)}var c,l,f,h,p,d,v,g,y,m,b,x,_,w={arc:function t(e,n){var r=this._attrs,o=r.x,a=r.y,s=r.r,u=r.startAngle,c=r.endAngle,l=r.clockwise,f=this.getHitLineWidth();return!!this.hasStroke()&&i.arcline(o,a,s,u,c,l,f,e,n)},circle:function t(e,n){var r=this._attrs,o=r.x,a=r.y,s=r.r,u=this.getHitLineWidth(),c=this.hasFill(),l=this.hasStroke();return c&&l?i.circle(o,a,s,e,n)||i.arcline(o,a,s,0,2*Math.PI,!1,u,e,n):c?i.circle(o,a,s,e,n):!!l&&i.arcline(o,a,s,0,2*Math.PI,!1,u,e,n)},dom:function t(e,n){if(!this._cfg.el)return!1;var r=this._cfg.el.getBBox();return i.box(r.x,r.x+r.width,r.y,r.y+r.height,e,n)},ellipse:function t(e,n){var o=this._attrs,a=this.hasFill(),s=this.hasStroke(),u=o.x,c=o.y,l=o.rx,f=o.ry,h=this.getHitLineWidth(),p=l>f?l:f,d=l>f?1:l/f,v=l>f?f/l:1,g=[e,n,1],y=[1,0,0,0,1,0,0,0,1];r.mat3.scale(y,y,[d,v]),r.mat3.translate(y,y,[u,c]);var m=r.mat3.invert([],y);return r.vec3.transformMat3(g,g,m),a&&s?i.circle(0,0,p,g[0],g[1])||i.arcline(0,0,p,0,2*Math.PI,!1,h,g[0],g[1]):a?i.circle(0,0,p,g[0],g[1]):!!s&&i.arcline(0,0,p,0,2*Math.PI,!1,h,g[0],g[1])},fan:function t(e,n){var a=this,s=a.hasFill(),u=a.hasStroke(),c=a._attrs,l=c.x,f=c.y,h=c.rs,p=c.re,d=c.startAngle,v=c.endAngle,g=c.clockwise,y=[1,0],m=[e-l,n-f],b=r.vec2.angleTo(y,m);function x(){var t=o.arc.nearAngle(b,d,v,g);if(r.isNumberEqual(b,t)){var e=r.vec2.squaredLength(m);if(h*h<=e&&e<=p*p)return!0}return!1}function _(){var t=a.getHitLineWidth(),r={x:Math.cos(d)*h+l,y:Math.sin(d)*h+f},o={x:Math.cos(d)*p+l,y:Math.sin(d)*p+f},s={x:Math.cos(v)*h+l,y:Math.sin(v)*h+f},u={x:Math.cos(v)*p+l,y:Math.sin(v)*p+f};return!!i.line(r.x,r.y,o.x,o.y,t,e,n)||(!!i.line(s.x,s.y,u.x,u.y,t,e,n)||(!!i.arcline(l,f,h,d,v,g,t,e,n)||!!i.arcline(l,f,p,d,v,g,t,e,n)))}return s&&u?x()||_():s?x():!!u&&_()},image:function t(e,n){var r=this._attrs;if(this.get("toDraw")||!r.img)return!1;this._cfg.attrs&&this._cfg.attrs.img===r.img||this._setAttrImg();var o=r.x,a=r.y,s=r.width,u=r.height;return i.rect(o,a,s,u,e,n)},line:function t(e,n){var r=this._attrs,o=r.x1,a=r.y1,s=r.x2,u=r.y2,c=this.getHitLineWidth();return!!this.hasStroke()&&i.line(o,a,s,u,c,e,n)},path:function t(e,n){var i=this,o=i.get("segments"),a=i.hasFill(),s=i.hasStroke();function c(){if(!r.isEmpty(o)){for(var t=i.getHitLineWidth(),a=0,s=o.length;a=3&&s.push(o[0]),i.polyline(s,a,e,n)}return o&&a?u(e,n,r)||s():o?u(e,n,r):!!a&&s()},polyline:function t(e,n){var r=this,o=this._attrs;if(this.hasStroke()){var a=o.points;if(a.length<2)return!1;var s=o.lineWidth;return i.polyline(a,s,e,n)}return!1},rect:function t(e,n){var r=this,o=r.hasFill(),a=r.hasStroke();function s(){var t=r._attrs,o=t.x,a=t.y,s=t.width,u=t.height,c=t.radius,l=r.getHitLineWidth();if(0===c){var f=l/2;return i.line(o-f,a,o+s+f,a,l,e,n)||i.line(o+s,a-f,o+s,a+u+f,l,e,n)||i.line(o+s+f,a+u,o-f,a+u,l,e,n)||i.line(o,a+u+f,o,a-f,l,e,n)}return i.line(o+c,a,o+s-c,a,l,e,n)||i.line(o+s,a+c,o+s,a+u-c,l,e,n)||i.line(o+s-c,a+u,o+c,a+u,l,e,n)||i.line(o,a+u-c,o,a+c,l,e,n)||i.arcline(o+s-c,a+c,c,1.5*Math.PI,2*Math.PI,!1,l,e,n)||i.arcline(o+s-c,a+u-c,c,0,.5*Math.PI,!1,l,e,n)||i.arcline(o+c,a+u-c,c,.5*Math.PI,Math.PI,!1,l,e,n)||i.arcline(o+c,a+c,c,Math.PI,1.5*Math.PI,!1,l,e,n)}return o&&a?u(e,n,r)||s():o?u(e,n,r):!!a&&s()},text:function t(e,n){var r=this,o=this.getBBox();if(this.hasFill()||this.hasStroke())return i.box(o.minX,o.maxX,o.minY,o.maxY,e,n)}};t.exports={isPointInPath:function t(e,n){var r=w[this.type];return!!r&&r.call(this,e,n)}}},function(t,e,n){var r=n(1),i=n(71),o=n(96),a=n(190),s=n(434),u=s.interpolate,c=s.interpolateArray,l=function t(e){this._animators=[],this._current=0,this._timer=null,this.canvas=e};function f(t,e,n){var o={},a=e.toAttrs,s=e.fromAttrs,l=e.toMatrix;if(!t.get("destroyed")){var f;for(var h in a)if(!r.isEqual(s[h],a[h]))if("path"===h){var p=a[h],d=s[h];p.length>d.length?(p=i.parsePathString(a[h]),d=i.parsePathString(s[h]),d=i.fillPathByDiff(d,p),d=i.formatPath(d,p),e.fromAttrs.path=d,e.toAttrs.path=p):e.pathFormatted||(p=i.parsePathString(a[h]),d=i.parsePathString(s[h]),d=i.formatPath(d,p),e.fromAttrs.path=d,e.toAttrs.path=p,e.pathFormatted=!0),o[h]=[];for(var v=0;v0){for(var o=e._animators.length-1;o>=0;o--)if((i=e._animators[o]).get("destroyed"))n.removeAnimator(o);else{if(!i.get("pause").isPaused)for(var u=(a=i.get("animators")).length-1;u>=0;u--)s=a[u],(r=h(i,s,t))&&(a.splice(u,1),r=!1,s.callback&&s.callback());0===a.length&&n.removeAnimator(o)}e.canvas.draw()}})},addAnimator:function t(e){this._animators.push(e)},removeAnimator:function t(e){this._animators.splice(e,1)},isAnimating:function t(){return!!this._animators.length},stop:function t(){this._timer&&this._timer.stop()},stopAllAnimations:function t(){this._animators.forEach(function(t){t.stopAnimate()}),this._animators=[],this.canvas.draw()},getTime:function t(){return this._current}}),t.exports=l},function(t,e,n){var r=n(1);function i(t){return 1===t[0]&&0===t[1]&&0===t[3]&&1===t[4]&&0===t[6]&&0===t[7]}function o(t){return 0===t[1]&&0===t[3]&&0===t[6]&&0===t[7]}function a(t,e){i(e)||(o(e)?(t[0]*=e[0],t[4]*=e[4]):r.mat3.multiply(t,t,e))}t.exports={initTransform:function t(){},resetMatrix:function t(){this.attr("matrix",[1,0,0,0,1,0,0,0,1])},translate:function t(e,n){var i=this._attrs.matrix;return r.mat3.translate(i,i,[e,n]),this.clearTotalMatrix(),this.attr("matrix",i),this},rotate:function t(e){var n=this._attrs.matrix;return r.mat3.rotate(n,n,e),this.clearTotalMatrix(),this.attr("matrix",n),this},scale:function t(e,n){var i=this._attrs.matrix;return r.mat3.scale(i,i,[e,n]),this.clearTotalMatrix(),this.attr("matrix",i),this},rotateAtStart:function t(e){var n=this._attrs.x||this._cfg.attrs.x,r=this._attrs.y||this._cfg.attrs.y;return Math.abs(e)>2*Math.PI&&(e=e/180*Math.PI),this.transform([["t",-n,-r],["r",e],["t",n,r]])},move:function t(e,n){var r=this.get("x")||0,i=this.get("y")||0;return this.translate(e-r,n-i),this.set("x",e),this.set("y",n),this},transform:function t(e){var n=this,i=this._attrs.matrix;return r.each(e,function(t){switch(t[0]){case"t":n.translate(t[1],t[2]);break;case"s":n.scale(t[1],t[2]);break;case"r":n.rotate(t[1]);break;case"m":n.attr("matrix",r.mat3.multiply([],i,t[1])),n.clearTotalMatrix()}}),n},setTransform:function t(e){return this.attr("matrix",[1,0,0,0,1,0,0,0,1]),this.transform(e)},getMatrix:function t(){return this.attr("matrix")},setMatrix:function t(e){return this.attr("matrix",e),this.clearTotalMatrix(),this},apply:function t(e,n){var i;return i=n?this._getMatrixByRoot(n):this.attr("matrix"),r.vec3.transformMat3(e,e,i),this},_getMatrixByRoot:function t(e){var n=this;e=e||this;for(var i=this,o=[];i!==e;)o.unshift(i),i=i.get("parent");o.unshift(i);var a=[1,0,0,0,1,0,0,0,1];return r.each(o,function(t){r.mat3.multiply(a,t.attr("matrix"),a)}),a},getTotalMatrix:function t(){var e=this._cfg.totalMatrix;if(!e){e=[1,0,0,0,1,0,0,0,1];var n=this._cfg.parent,r;if(n)a(e,n.getTotalMatrix());a(e,this.attr("matrix")),this._cfg.totalMatrix=e}return e},clearTotalMatrix:function t(){},invert:function t(e){var n=this.getTotalMatrix();if(o(n))e[0]/=n[0],e[1]/=n[4];else{var i=r.mat3.invert([],n);i&&r.vec3.transformMat3(e,e,i)}return this},resetTransform:function t(e){var n=this.attr("matrix");i(n)||e.transform(n[0],n[1],n[3],n[4],n[6],n[7])}}},function(t,e,n){t.exports={painter:n(315)}},function(t,e,n){var r=n(1),i=n(316),o=["fillStyle","font","globalAlpha","lineCap","lineWidth","lineJoin","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","lineDash","lineDashOffset"],a=function(){function t(t){if(!t)return null;var e=r.uniqueId("canvas_"),n=r.createDom('');return t.appendChild(n),this.type="canvas",this.canvas=n,this.context=n.getContext("2d"),this.toDraw=!1,this}var e=t.prototype;return e.beforeDraw=function t(){var e=this.canvas;this.context&&this.context.clearRect(0,0,e.width,e.height)},e.draw=function t(e){var n=this;function i(){n.animateHandler=r.requestAnimationFrame(function(){n.animateHandler=void 0,n.toDraw&&i()}),n.beforeDraw();try{n._drawGroup(e)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),n.toDraw=!1}n.toDraw=!1}n.animateHandler?n.toDraw=!0:i()},e.drawSync=function t(e){this.beforeDraw(),this._drawGroup(e)},e._drawGroup=function t(e){if(!e._cfg.removed&&!e._cfg.destroyed&&e._cfg.visible){var n=this,r=e._cfg.children,i=null;this.setContext(e);for(var o=0;o-1){var u=a[s];"fillStyle"===s&&(u=i.parseStyle(u,e,n)),"strokeStyle"===s&&(u=i.parseStyle(u,e,n)),"lineDash"===s&&n.setLineDash?r.isArray(u)?n.setLineDash(u):r.isString(u)&&n.setLineDash(u.split(" ")):n[s]=u}},t}();t.exports=a},function(t,e,n){var r=n(1),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,o=/[^\s\,]+/gi,a=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,s=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,u=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,c=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function l(t,e){var n=t.match(c);r.each(n,function(t){t=t.split(":"),e.addColorStop(t[0],t[1])})}function f(t,e,n){var i=a.exec(t),o=r.mod(r.toRadian(parseFloat(i[1])),2*Math.PI),s=i[2],u=e.getBBox(),c,f;o>=0&&o<.5*Math.PI?(c={x:u.minX,y:u.minY},f={x:u.maxX,y:u.maxY}):.5*Math.PI<=o&&o1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}r.each(t,function(e,n){isNaN(e)||(t[n]=+e)}),e[n]=t}),e):void 0},parseStyle:function t(e,n,i){if(r.isString(e)){if("("===e[1]||"("===e[2]){if("l"===e[0])return f(e,n,i);if("r"===e[0])return h(e,n,i);if("p"===e[0])return p(e,n,i)}return e}}}},function(t,e,n){t.exports={canvas:n(314),svg:n(325)}},function(t,e,n){var r=n(1),i=n(321),o=n(323),a=n(319),s=n(320),u=n(322),c=function(){function t(t){var e=document.createElementNS("http://www.w3.org/2000/svg","defs"),n=r.uniqueId("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}var e=t.prototype;return e.find=function t(e,n){for(var r=this.children,i=null,o=0;o'}),n}function u(t,e){var n=i.exec(t),o=r.mod(r.toRadian(parseFloat(n[1])),2*Math.PI),a=n[2],u,c;o>=0&&o<.5*Math.PI?(u={x:0,y:0},c={x:1,y:1}):.5*Math.PI<=o&&o';n.innerHTML=r},t}();t.exports=a},function(t,e){var n={svg:"svg",circle:"circle",rect:"rect",text:"text",path:"path",foreignObject:"foreignObject",polygon:"polygon",ellipse:"ellipse",image:"image"};t.exports=function t(e,r,i){var o=i.target||i.srcElement;if(!n[o.tagName]){for(var a=o.parentNode;a&&!n[a.tagName];)a=a.parentNode;o=a}return this._cfg.el===o?this:this.find(function(t){return t._cfg&&t._cfg.el===o})}},function(t,e,n){t.exports={painter:n(326),getShape:n(324)}},function(t,e,n){var r=n(1),i,o=n(36).parseRadius,a=n(68),s=n(318),u={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject",fan:"path",group:"g"},c=.3,l={opacity:"opacity",fillStyle:"fill",strokeOpacity:"stroke-opacity",fillOpacity:"fill-opacity",strokeStyle:"stroke",x:"x",y:"y",r:"r",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"},f={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},h={left:"left",start:"left",center:"middle",right:"end",end:"end"},p=function(){function t(t){if(!t)return null;var e=r.uniqueId("canvas_"),n=r.createDom('');return t.appendChild(n),this.type="svg",this.canvas=n,this.context=new s(n),this.toDraw=!1,this}var e=t.prototype;return e.draw=function t(e){var n=this;function i(){n.animateHandler=r.requestAnimationFrame(function(){n.animateHandler=void 0,n.toDraw&&i()});try{n._drawChildren(e)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),n.toDraw=!1}n.toDraw=!1}n.animateHandler?n.toDraw=!0:i()},e.drawSync=function t(e){this._drawChildren(e)},e._drawGroup=function t(e,n){var i=e._cfg;i.removed||i.destroyed||(i.tobeRemoved&&(r.each(i.tobeRemoved,function(t){t.parentNode&&t.parentNode.removeChild(t)}),i.tobeRemoved=[]),this._drawShape(e,n),i.children&&i.children.length>0&&this._drawChildren(e))},e._drawChildren=function t(e){var n=this,r=e._cfg.children,i;if(r)for(var o=0;ou?1:0,p=Math.abs(c-u)>Math.PI?1:0,d=i.rs,v=i.re,g=n(u,i.rs,a),y=n(c,i.rs,a);i.rs>0?(s.push("M "+f.x+","+f.y),s.push("L "+y.x+","+y.y),s.push("A "+d+","+d+",0,"+p+","+(1===h?0:1)+","+g.x+","+g.y),s.push("L "+l.x+" "+l.y)):(s.push("M "+a.x+","+a.y),s.push("L "+l.x+","+l.y)),s.push("A "+v+","+v+",0,"+p+","+h+","+f.x+","+f.y),i.rs>0?s.push("L "+y.x+","+y.y):s.push("Z"),o.el.setAttribute("d",s.join(" "))},e._updateText=function t(e){var n=this,r=e._attrs,i=e._cfg.attrs,o=e._cfg.el;for(var a in this._setFont(e),r)if(r[a]!==i[a]){if("text"===a){this._setText(e,""+r[a]);continue}if("fillStyle"===a||"strokeStyle"===a){this._setColor(e,a,r[a]);continue}if("matrix"===a){this._setTransform(e);continue}l[a]&&o.setAttribute(l[a],r[a])}e._cfg.attrs=Object.assign({},e._attrs),e._cfg.hasUpdate=!1},e._setFont=function t(e){var n=e.get("el"),r=e._attrs,i=r.fontSize;n.setAttribute("alignment-baseline",f[r.textBaseline]||"baseline"),n.setAttribute("text-anchor",h[r.textAlign]||"left"),i&&+i<12&&(r.matrix=[1,0,0,0,1,0,0,0,1],e.transform([["t",-r.x,-r.y],["s",+i/12,+i/12],["t",r.x,r.y]]))},e._setText=function t(e,n){var i=e._cfg.el,o=e._attrs.textBaseline||"bottom";if(n)if(~n.indexOf("\n")){var a=e._attrs.x,s=n.split("\n"),u=s.length-1,c="";r.each(s,function(t,e){0===e?"alphabetic"===o?c+=''+t+"":"top"===o?c+=''+t+"":"middle"===o?c+=''+t+"":"bottom"===o?c+=''+t+"":"hanging"===o&&(c+=''+t+""):c+=''+t+""}),i.innerHTML=c}else i.innerHTML=n;else i.innerHTML=""},e._setClip=function t(e,n){var r=e._cfg.el;if(n)if(r.hasAttribute("clip-path"))n._cfg.hasUpdate&&this._updateShape(n);else{this._createDom(n),this._updateShape(n);var i=this.context.addClip(n);r.setAttribute("clip-path","url(#"+i+")")}else r.removeAttribute("clip-path")},e._setColor=function t(e,n,r){var i=e._cfg.el,o=this.context;if(r)if(r=r.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(r)){var a=o.find("gradient",r);a||(a=o.addGradient(r)),i.setAttribute(l[n],"url(#"+a+")")}else if(/^[p,P]{1}[\s]*\(/.test(r)){var s=o.find("pattern",r);s||(s=o.addPattern(r)),i.setAttribute(l[n],"url(#"+s+")")}else i.setAttribute(l[n],r);else i.setAttribute(l[n],"none")},e._setShadow=function t(e){var n=e._cfg.el,r=e._attrs,i={dx:r.shadowOffsetX,dy:r.shadowOffsetY,blur:r.shadowBlur,color:r.shadowColor};if(i.dx||i.dy||i.blur||i.color){var o=this.context.find("filter",i);o||(o=this.context.addShadow(i,this)),n.setAttribute("filter","url(#"+o+")")}else n.removeAttribute("filter")},t}();t.exports=p},function(t,e,n){var r=n(7);r.Arc=n(126),r.Circle=n(127),r.Dom=n(128),r.Ellipse=n(129),r.Fan=n(130),r.Image=n(131),r.Line=n(132),r.Marker=n(68),r.Path=n(135),r.Polygon=n(136),r.Polyline=n(137),r.Rect=n(138),r.Text=n(139),t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=a,e.fromMat4=s,e.clone=u,e.copy=c,e.fromValues=l,e.set=f,e.identity=h,e.transpose=p,e.invert=d,e.adjoint=v,e.determinant=g,e.multiply=y,e.translate=m,e.rotate=b,e.scale=x,e.fromTranslation=_,e.fromRotation=w,e.fromScaling=O,e.fromMat2d=j,e.fromQuat=S,e.normalFromMat4=E,e.projection=M,e.str=C,e.frob=P,e.add=k,e.subtract=T,e.multiplyScalar=A,e.multiplyScalarAndAdd=I,e.exactEquals=L,e.equals=N;var r,i=o(n(72));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function a(){var t=new i.ARRAY_TYPE(9);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function u(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function l(t,e,n,r,o,a,s,u,c){var l=new i.ARRAY_TYPE(9);return l[0]=t,l[1]=e,l[2]=n,l[3]=r,l[4]=o,l[5]=a,l[6]=s,l[7]=u,l[8]=c,l}function f(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function h(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function p(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function d(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=l*a-s*c,h=-l*o+s*u,p=c*o-a*u,d=n*f+r*h+i*p;return d?(d=1/d,t[0]=f*d,t[1]=(-l*r+i*c)*d,t[2]=(s*r-i*a)*d,t[3]=h*d,t[4]=(l*n-i*u)*d,t[5]=(-s*n+i*o)*d,t[6]=p*d,t[7]=(-c*n+r*u)*d,t[8]=(a*n-r*o)*d,t):null}function v(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8];return t[0]=a*l-s*c,t[1]=i*c-r*l,t[2]=r*s-i*a,t[3]=s*u-o*l,t[4]=n*l-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function g(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function y(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=n[0],p=n[1],d=n[2],v=n[3],g=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=h*r+p*a+d*c,t[1]=h*i+p*s+d*l,t[2]=h*o+p*u+d*f,t[3]=v*r+g*a+y*c,t[4]=v*i+g*s+y*l,t[5]=v*o+g*u+y*f,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*l,t[8]=m*o+b*u+x*f,t}function m(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=n[0],p=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*r+p*a+c,t[7]=h*i+p*s+l,t[8]=h*o+p*u+f,t}function b(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=Math.sin(n),p=Math.cos(n);return t[0]=p*r+h*a,t[1]=p*i+h*s,t[2]=p*o+h*u,t[3]=p*a-h*r,t[4]=p*s-h*i,t[5]=p*u-h*o,t[6]=c,t[7]=l,t[8]=f,t}function x(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function _(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function w(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function O(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function j(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function S(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,f=r*s,h=i*a,p=i*s,d=i*u,v=o*a,g=o*s,y=o*u;return t[0]=1-f-d,t[3]=l-y,t[6]=h+g,t[1]=l+y,t[4]=1-c-d,t[7]=p-v,t[2]=h-g,t[5]=p+v,t[8]=1-c-f,t}function E(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],g=e[14],y=e[15],m=n*s-r*a,b=n*u-i*a,x=n*c-o*a,_=r*u-i*s,w=r*c-o*s,O=i*c-o*u,j=l*v-f*d,S=l*g-h*d,E=l*y-p*d,M=f*g-h*v,C=f*y-p*v,P=h*y-p*g,k=m*P-b*C+x*M+_*E-w*S+O*j;return k?(k=1/k,t[0]=(s*P-u*C+c*M)*k,t[1]=(u*E-a*P-c*S)*k,t[2]=(a*C-s*E+c*j)*k,t[3]=(i*C-r*P-o*M)*k,t[4]=(n*P-i*E+o*S)*k,t[5]=(r*E-n*C-o*j)*k,t[6]=(v*O-g*w+y*_)*k,t[7]=(g*x-d*O-y*b)*k,t[8]=(d*w-v*x+y*m)*k,t):null}function M(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function C(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function P(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))}function k(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function T(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function A(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function I(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function N(t,e){var n=t[0],r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=e[0],p=e[1],d=e[2],v=e[3],g=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return Math.abs(n-h)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(r-p)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(p))&&Math.abs(o-d)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-v)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(s-g)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(l-b)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(f-x)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(x))}var D=e.mul=y,R=e.sub=T},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=a,e.clone=s,e.fromValues=u,e.copy=c,e.set=l,e.add=f,e.subtract=h,e.multiply=p,e.divide=d,e.ceil=v,e.floor=g,e.min=y,e.max=m,e.round=b,e.scale=x,e.scaleAndAdd=_,e.distance=w,e.squaredDistance=O,e.length=j,e.squaredLength=S,e.negate=E,e.inverse=M,e.normalize=C,e.dot=P,e.cross=k,e.lerp=T,e.random=A,e.transformMat2=I,e.transformMat2d=L,e.transformMat3=N,e.transformMat4=D,e.rotate=R,e.angle=F,e.str=z,e.exactEquals=B,e.equals=Y;var r,i=o(n(72));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function a(){var t=new i.ARRAY_TYPE(2);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function u(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n}function c(t,e){return t[0]=e[0],t[1]=e[1],t}function l(t,e,n){return t[0]=e,t[1]=n,t}function f(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function p(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function d(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function v(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function g(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function y(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function m(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function b(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function x(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function _(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function O(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function j(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function S(t){var e=t[0],n=t[1];return e*e+n*n}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function C(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t}function P(t,e){return t[0]*e[0]+t[1]*e[1]}function k(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function T(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function A(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function I(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function L(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function N(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function D(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function R(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function F(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=n*n+r*r;a>0&&(a=1/Math.sqrt(a));var s=i*i+o*o;s>0&&(s=1/Math.sqrt(s));var u=(n*i+r*o)*a*s;return u>1?0:u<-1?Math.PI:Math.acos(u)}function z(t){return"vec2("+t[0]+", "+t[1]+")"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]}function Y(t,e){var n=t[0],r=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))}var V=e.len=j,W=e.sub=h,H=e.mul=p,G=e.div=d,U=e.dist=w,q=e.sqrDist=O,K=e.sqrLen=S,X=e.forEach=(Z=a(),function(t,e,n,r,i,o){var a=void 0,s=void 0;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function P(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function k(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function T(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function A(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),l=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*l,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*l,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*l,t}function I(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,l=3*o*s,f=3*u*a,h=u*o;return t[0]=e[0]*c+n[0]*l+r[0]*f+i[0]*h,t[1]=e[1]*c+n[1]*l+r[1]*f+i[1]*h,t[2]=e[2]*c+n[2]*l+r[2]*f+i[2]*h,t}function L(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI,r=2*i.RANDOM()-1,o=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=r*e,t}function N(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function D(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function R(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,f=o*s-r*c,h=r*u-i*s,p=i*h-o*f,d=o*l-r*h,v=r*f-i*l,g=2*a;return l*=g,f*=g,h*=g,p*=2,d*=2,v*=2,t[0]=s+l+p,t[1]=u+f+d,t[2]=c+h+v,t}function F(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function z(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function B(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function Y(t,e){var n=c(t[0],t[1],t[2]),r=c(e[0],e[1],e[2]);C(n,n),C(r,r);var i=P(n,r);return i>1?0:i<-1?Math.PI:Math.acos(i)}function V(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function W(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function H(t,e){var n=t[0],r=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(o-u)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))}var G=e.sub=p,U=e.mul=d,q=e.div=v,K=e.dist=O,X=e.sqrDist=j,Z=e.len=u,$=e.sqrLen=S,Q=e.forEach=(J=a(),function(t,e,n,r,i,o){var a=void 0,s=void 0;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a0?e=0:n=0,n-e<5&&!a&&n-e>=1&&(a=1)),r(a)){var b=(n-e)/(g-1);a=o.snapFactorTo(b,m,"ceil"),h!==f&&((y=parseInt((n-e)/a,10))>h&&(y=h),ye&&(j-=a),n=o.fixedBase(O,a),e=o.fixedBase(j,a)}n=Math.min(n,v),e=Math.max(e,d),l.push(e);for(var S=1;Sm&&(m=e);var O=m/w,j=l(o);if(O>.51){for(var S=Math.ceil(O),E=l(s),M=j;M<=E+S;M+=S)n.push(f(M));m=null}else if(O>.0834){for(var C=Math.ceil(O/.0834),P=h(o),k=p(o,s),T=0;T<=k+C;T+=C)n.push(d(j,T+P));m=null}else if(m>.5*_){var A=new Date(o),I=A.getFullYear(),L=A.getMonth(o),N=A.getDate(),D=Math.ceil(m/_),R=v(o,s);m=D*_;for(var F=0;Fu){var z=new Date(o),B=z.getFullYear(),Y=z.getMonth(o),V=z.getDate(),W=z.getHours(),H=r.snapTo(a,Math.ceil(m/u)),G=g(o,s);m=H*u;for(var U=0;U<=G+H;U+=H)n.push(new Date(B,Y,V,W+U).getTime())}else if(m>6e4){var q=y(o,s),K=Math.ceil(m/6e4);m=6e4*K;for(var X=0;X<=q+K;X+=K)n.push(o+6e4*X)}else{m<1e3&&(m=1e3),o=1e3*Math.floor(o/1e3);var Z=Math.ceil((s-o)/1e3),$=Math.ceil(m/1e3);m=1e3*$;for(var Q=0;Q0)r=Math.floor(s(n,this.min));else{var a=this.values,u=this.max;i(a,function(t){t>0&&t1&&(u=1),r=Math.floor(s(n,u)),this._minTick=r,this.positiveMin=u}for(var c=o-r,l=this.tickCount,f=Math.ceil(c/l),h=[],p=r;p=0?Math.floor(a(n,this.min)):0)>i){var o=i;i=r,r=o}for(var s=i-r,u=this.tickCount,c=Math.ceil(s/u),l=[],f=r;f-1?i/(this.values.length-1):0)*(r-n)},n.getText=function t(e){var n="",r=this.translate(e);n=r>-1?this.values[r]:e;var i=this.formatter;return n=parseInt(n,10),n=i?i(n):a.format(n,this.mask)},n.getTicks=function t(){var e=this,n=this.ticks,r=[];return c(n,function(t){var n;n=f(t)?t:{text:h(t)?t:e.getText(t),value:e.scale(t),tickValue:t},r.push(n)}),r},n._toTimeStamp=function t(e){return u.toTimeStamp(e)},e}(o);i.TimeCat=p,t.exports=p},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(213),o=n(2),a=n(6),s=n(14),u=n(26),c=n(48),l=n(332),f=n(145),h=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function e(){t.prototype._initDefaultCfg.call(this),this.type="time",this.mask="YYYY-MM-DD"},n.init=function e(){var n=this,r=n.values;if(r&&r.length){var i=[],s=1/0,u=s,c=0;o(r,function(t){var e=n._toTimeStamp(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t);s>e?(u=s,s=e):u>e&&(u=e),c1&&(n.minTickInterval=u-s),(a(n.min)||n._toTimeStamp(n.min)>s)&&(n.min=s),(a(n.max)||n._toTimeStamp(n.max)1&&void 0!==arguments[1]?arguments[1]:[];return r(e,function(t){return!i(n,t)})};t.exports=o},function(t,e,n){var r=n(13),i=n(39),o=n(168);function a(t,e){var n=void 0;if(r(e)&&(n=e),i(e)&&(n=function t(n){return o(n,e)}),n)for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:[];if(r(e))for(var i=0;in[i])return 1;if(e[i]1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}o(t,function(e,n){isNaN(e)||(t[n]=+e)}),e[n]=t}),e):void 0}},function(t,e,n){var r=n(4);t.exports=function t(e){var n=0,i=0,o=0,a=0;return r(e)?1===e.length?n=i=o=a=e[0]:2===e.length?(n=o=e[0],i=a=e[1]):3===e.length?(n=e[0],i=a=e[1],o=e[2]):(n=e[0],i=e[1],o=e[2],a=e[3]):n=i=o=a=e,{r1:n,r2:i,r3:o,r4:a}}},function(t,e,n){var r=n(20),i=function t(e,n){if(!r(e))return-1;var i=Array.prototype.indexOf;if(i)return i.call(e,n);for(var o=-1,a=0;a20&&(o=20),parseFloat(e.toFixed(o))};t.exports=n},function(t,e,n){var r=n(51);t.exports={clamp:n(78),fixedBase:n(369),isDecimal:n(371),isEven:n(372),isInteger:n(373),isNegative:n(374),isNumberEqual:r,isOdd:n(375),isPositive:n(376),maxBy:n(159),minBy:n(377),mod:n(160),snapEqual:r,toDegree:n(161),toInt:n(162),toInteger:n(162),toRadian:n(163)}},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e%1!=0};t.exports=i},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e%2==0};t.exports=i},function(t,e,n){var r=n(11),i=Number.isInteger?Number.isInteger:function(t){return r(t)&&t%1==0};t.exports=i},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e<0};t.exports=i},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e%2!=0};t.exports=i},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e>0};t.exports=i},function(t,e,n){var r=n(4),i=n(13),o=n(2),a=function t(e,n){if(r(e)){var a=e[0],s=void 0;s=i(n)?n(e[0]):e[0][n];var u=void 0;return o(e,function(t){(u=i(n)?n(t):t[n])=0;p--)u=s[p].index,"add"===s[p].type?e.splice(u,0,[].concat(e[u])):e.splice(u,1)}if((i=e.length)=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])})}function i(t,e,n){if(1===n)return[[].concat(t)];var i=[];if("L"===e[0]||"C"===e[0]||"Q"===e[0])i=i.concat(r(t,e,n));else{var o=[].concat(t);"M"===o[0]&&(o[0]="L");for(var a=0;a<=n-1;a++)i.push(o)}return i}t.exports=function t(e,n){if(1===e.length)return e;var r=e.length-1,o=n.length-1,a=r/o,s=[];if(1===e.length&&"M"===e[0][0]){for(var u=0;u0)){e[a]=i[a];break}o=r(o,e[a-1],1)}e[a]=["Q"].concat(o.reduce(function(t,e){return t.concat(e)},[]));break;case"T":e[a]=["T"].concat(o[0]);break;case"C":if(o.length<3){if(!(a>0)){e[a]=i[a];break}o=r(o,e[a-1],2)}e[a]=["C"].concat(o.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(o.length<2){if(!(a>0)){e[a]=i[a];break}o=r(o,e[a-1],1)}e[a]=["S"].concat(o.reduce(function(t,e){return t.concat(e)},[]));break;default:e[a]=i[a]}return e}},function(t,e,n){var r=n(387),i=n(174),o=n(175),a=n(171);t.exports={catmullRom2Bezier:a,catmullRomToBezier:a,fillPath:n(383),fillPathByDiff:n(382),formatPath:n(384),intersection:r,pathIntersection:r,parsePathArray:n(172),parsePathString:n(173),pathToAbsolute:i,path2absolute:i,pathTocurve:o,path2curve:o,rectPath:n(176)}},function(t,e,n){var r=n(2);t.exports=function t(e,n){if(e.length!==n.length)return!1;var i=!0;return r(e,function(t,e){if(t!==n[e])return i=!1,!1}),i}},function(t,e,n){var r=n(4),i=n(176),o=n(175),a=function t(e,n,r,i,o){var a,s;return e*(e*(-3*n+9*r-9*i+3*o)+6*n-12*r+6*i)-3*n+3*r},s=function t(e,n,r,i,o,s,u,c,l){null===l&&(l=1);for(var f=(l=l>1?1:l<0?0:l)/2,h=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],v=0,g=0;g0&&d<1&&c.push(d)}else{var g=h*h-4*p*f,y=Math.sqrt(g);if(!(g<0)){var m=(-h+y)/(2*f);m>0&&m<1&&c.push(m);var b=(-h-y)/(2*f);b>0&&b<1&&c.push(b)}}for(var x=c.length,_=x,w=void 0;x--;)w=1-(d=c[x]),l[0][x]=w*w*w*e+3*w*w*d*r+3*w*d*d*o+d*d*d*s,l[1][x]=w*w*w*n+3*w*w*d*i+3*w*d*d*a+d*d*d*u;return l[0][_]=e,l[1][_]=n,l[0][_+1]=s,l[1][_+1]=u,l[0].length=l[1].length=_+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}},c=function t(e,n,r,i,o,a,s,u){if(!(Math.max(e,r)Math.max(o,s)||Math.max(n,i)Math.max(a,u))){var c,l,f=(e-r)*(a-u)-(n-i)*(o-s);if(f){var h=((e*i-n*r)*(o-s)-(e-r)*(o*u-a*s))/f,p=((e*i-n*r)*(a-u)-(n-i)*(o*u-a*s))/f,d=+h.toFixed(2),v=+p.toFixed(2);if(!(d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(o,s).toFixed(2)||d>+Math.max(o,s).toFixed(2)||v<+Math.min(n,i).toFixed(2)||v>+Math.max(n,i).toFixed(2)||v<+Math.min(a,u).toFixed(2)||v>+Math.max(a,u).toFixed(2)))return{x:h,y:p}}}},l=function t(e,n,r){return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height},f=function t(e,n,r,o){return null===e&&(e=n=r=o=0),null===n&&(n=e.y,r=e.width,o=e.height,e=e.x),{x:e,y:n,width:r,w:r,height:o,h:o,x2:e+r,y2:n+o,cx:e+r/2,cy:n+o/2,r1:Math.min(r,o)/2,r2:Math.max(r,o)/2,r0:Math.sqrt(r*r+o*o)/2,path:i(e,n,r,o),vb:[e,n,r,o].join(" ")}},h=function t(e,n){return e=f(e),n=f(n),l(n,e.x,e.y)||l(n,e.x2,e.y)||l(n,e.x,e.y2)||l(n,e.x2,e.y2)||l(e,n.x,n.y)||l(e,n.x2,n.y)||l(e,n.x,n.y2)||l(e,n.x2,n.y2)||(e.xn.x||n.xe.x)&&(e.yn.y||n.ye.y)},p=function t(e,n,i,o,a,s,c,l){r(e)||(e=[e,n,i,o,a,s,c,l]);var h=u.apply(null,e);return f(h.min.x,h.min.y,h.max.x-h.min.x,h.max.y-h.min.y)},d=function t(e,n,r,i,o,a,s,u,c){var l=1-c,f=Math.pow(l,3),h=Math.pow(l,2),p=c*c,d=p*c,v,g,y=e+2*c*(r-e)+p*(o-2*r+e),m=n+2*c*(i-n)+p*(a-2*i+n),b=r+2*c*(o-r)+p*(s-2*o+r),x=i+2*c*(a-i)+p*(u-2*a+i),_,w,O,j,S;return{x:f*e+3*h*c*r+3*l*c*c*o+d*s,y:f*n+3*h*c*i+3*l*c*c*a+d*u,m:{x:y,y:m},n:{x:b,y:x},start:{x:l*e+c*r,y:l*n+c*i},end:{x:l*o+c*s,y:l*a+c*u},alpha:90-180*Math.atan2(y-b,m-x)/Math.PI}},v=function t(e,n,r){var i=p(e),o=p(n);if(!h(i,o))return r?0:[];for(var a,u,l=~~(s.apply(0,e)/8),f=~~(s.apply(0,n)/8),v=[],g=[],y={},m=r?0:[],b=0;b=0&&A<=1&&I>=0&&I<=1&&(r?m++:m.push({x:T.x,y:T.y,t1:A,t2:I}))}}return m},g=function t(e,n,r){e=o(e),n=o(n);for(var i=void 0,a=void 0,s=void 0,u=void 0,c=void 0,l=void 0,f=void 0,h=void 0,p=void 0,d=void 0,g=r?0:[],y=0,m=e.length;ye?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}t.exports=n},function(t,e,n){var r=n(15),i={getType:n(181),isArray:n(4),isArrayLike:n(20),isBoolean:n(182),isFunction:n(13),isNil:n(6),isNull:n(397),isNumber:n(11),isObject:n(38),isObjectLike:n(80),isPlainObject:n(39),isPrototype:n(184),isType:r,isUndefined:n(399),isString:n(14),isRegExp:n(398),isDate:n(183),isArguments:n(395),isError:n(396)};t.exports=i},function(t,e,n){var r=n(15),i=function t(e){return r(e,"Arguments")};t.exports=i},function(t,e,n){var r=n(15),i=function t(e){return r(e,"Error")};t.exports=i},function(t,e){var n=function t(e){return null===e};t.exports=n},function(t,e,n){var r=n(15),i=function t(e){return r(e,"RegExp")};t.exports=i},function(t,e){var n=function t(e){return void 0===e};t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(23));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Axis")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n=15.3.0");var d=function(t){function e(){return f(this,e),h(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return p(e,t),r(e,[{key:"render",value:function t(){var e=this.props,n=e.width,r=e.height,i=e.placeholder;return o.default.createElement("div",{style:{width:n,height:r}},i)}}]),e}(o.default.PureComponent||o.default.Component);d.propTypes={width:s.default.oneOfType([s.default.string,s.default.number]),height:s.default.oneOfType([s.default.string,s.default.number]),placeholder:s.default.node},d.defaultProps={width:"100%",placeholder:o.default.createElement("div",{style:{position:"relative",top:"48%",textAlign:"center"}},"\u6682\u65e0\u6570\u636e")},e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e` must be wrapped in ``"),this.id=this.context.createId(),this.context.addElement(this.name,this.id,this.props,this.context.getParentInfo(),this.context.getViewId())}}]),e}(s.default);d.contextTypes={addElement:c.default.func,updateElement:c.default.func,deleteElement:c.default.func,createId:c.default.func,getParentInfo:c.default.func,getViewId:c.default.func},d.childContextTypes={addElement:c.default.func,updateElement:c.default.func,deleteElement:c.default.func,createId:c.default.func,getParentInfo:c.default.func,getViewId:c.default.func},e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=s(n(23)),o,a=s(n(28));function s(t){return t&&t.__esModule?t:{default:t}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var f=function(t){function e(t){return u(this,e),c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,"Legend"))}return l(e,t),e}(i.default);f.contextTypes={addElement:a.default.func,updateElement:a.default.func,deleteElement:a.default.func,createId:a.default.func,getParentInfo:a.default.func,getViewId:a.default.func},f.childContextTypes={addElement:a.default.func,updateElement:a.default.func,deleteElement:a.default.func,createId:a.default.func,getParentInfo:a.default.func,getViewId:a.default.func},f.defaultProps={visible:!0},e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(23));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Tooltip")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var m=u.default.COORD_FUNC_PROPS,b=u.default.GEOM_FUNC_PROPS,x={needRebuildChart:function t(e){if(null==e.chart.props||null==e.chart.updateProps)return!1;var n=e.chart.props,r=e.chart.updateProps;return!(a.Util.shallowEqual(n.padding,r.padding)&&a.Util.shallowEqual(n.background,r.background)&&a.Util.shallowEqual(n.plotBackground,r.plotBackground)&&a.Util.shallowEqual(n.pixelRatio,r.pixelRatio))},needReExecute:function t(e){var n=e.geoms;if(null==n)return!1;for(var r in n)if(n[r].props&&n[r].updateProps&&(n[r].props.type!==n[r].updateProps.type||n[r].props.color&&!n[r].updateProps.color||n[r].props.size&&!n[r].updateProps.size||n[r].props.shape&&!n[r].updateProps.shape))return!0;return!1},synchronizeG2Update:function t(e,n){this.updateChart(e,n.chart),this.updateAxises(e,n.axises),this.updateTooltip(e,n),this.updateCoord(e,n),this.updateLegends(e,n.legends),this.updateGeoms(e,n.geoms),this.updateGuide(e,n.guide),this.updateFacet(e,n),this.updateViews(e,n)},updateChart:function t(e,n){if(n){var r=n.props,i=n.updateProps,o=r.width,s=r.height,u=r.animate,c=r.data,l=r.scale,f=i.width,h=i.height,p=i.animate,v=i.data,g=i.scale;c!==v&&e.changeData(v),a.Util.shallowEqual(l,g)||(a.Util.isArray(g)?e.scale(g[0],g[1]):e.scale(g)),u!==p&&e.animate(p),o!==f&&s!==h?e.changeSize(f,h):o!==f?e.changeWidth(f):s!==h&&e.changeHeight(h),d.default.updateEvents(e,d.default.chartEvents,n.props,i),d.default.updateBaseEvents(e,n.updateProps,i)}},updateAxis:function t(e,n){var r=n.props,i=r.name,s=r.visible,u=y(r,["name","visible"]),c=n.updateProps,l=c.name,f=c.visible,h=y(c,["name","visible"]);(0,o.default)(i===l,"`name` propertry should not be changed in ``"),s!==f&&e.axis(i,!!f),a.Util.shallowEqual(u,h)||e.axis(i,h)},updateAxises:function t(e,n){if(n)for(var r in n)n[r]&&n[r].props&&n[r].updateProps&&this.updateAxis(e,n[r])},updateTooltip:function t(e,n){if(n.tooltip){var i=n.tooltip.props,o=n.tooltip.updateProps;null==i&&null==o||a.Util.shallowEqual(i,o)||e.tooltip(r({},o))}},updateCoord:function t(e,n){var r=n.coord;if(r){var i=r.props,o=r.updateProps;if(null!=i&&null!=o){var s=a.Util.without(o,m.concat(["type"]));if(!a.Util.shallowEqual(i,o)){var u=e.coord(o.type,s);r.g2Instance=u,a.Prop.init(m,o,function(t,e){"reflect"===e?a.Util.each(t,function(t){return u[e](t)}):u[e].apply(u,g(t))})}}}},updateLegend:function t(e,n){var r=n.props,i=n.updateProps;if(i&&!a.Util.shallowEqual(r,i)){var o=i.name,s=i.visible,u=y(i,["name","visible"]),c=s?u:s;e.legend.apply(e,g(o?[o,c]:[c]))}},updateLegends:function t(e,n){if(null!=n)for(var r in n)n[r]&&this.updateLegend(e,n[r])},updateLabel:function t(e,n,r){if(null!=n&&null!=r){var i=n.content,o=y(n,["content"]),s=r.content,u=y(r,["content"]);a.Util.shallowEqual(o,u)&&a.Util.shallowEqual(i,s)||(a.Util.isArray(s)?e.label(s[0],s[1],u):e.label(s,u))}},updateGeom:function t(e,n){var r=n.props,i=n.updateProps;if(r&&i&&r.type===i.type){var o=n.g2Instance;if(a.Util.shallowEqual(r,i))n.label&&this.updateLabel(o,n.label.props,n.label.updateProps);else{var s=r.adjust,u=y(r,["adjust"]),c=i.adjust,l=y(i,["adjust"]);(s||c)&&o.adjust(c),a.Prop.update(b,u,l,function(t,e){o[e].apply(o,g(t))}),n.label&&this.updateLabel(o,n.label.props,n.label.updateProps)}}},updateGeoms:function t(e,n){if(null==n)return!1;for(var r in n)n[r]&&this.updateGeom(e,n[r]);return!1},isTypedGuideChanged:function t(e){return!a.Util.shallowEqual(e.props,e.updateProps)},updateGuide:function t(e,n){if(n&&n.elements){var r=n.elements,i=!1;for(var o in r)if(r[o]&&(r[o].updateProps||this.isTypedGuideChanged(r[o]))){i=!0;break}i&&(h.default.mergeGuide(n,!0),e.guide().clear(),l.default.guide(e,n))}},updateView:function t(e,n){if(n&&n.props&&n.updateProps&&"Facet"!==n.parentInfo.name){var r=n.g2Instance,i=n.props,o=n.updateProps,s=i.scale,u=i.data,c=i.animate,l=i.axis,f=i.filter,h=o.scale,p=o.animate,d=o.data,v=o.axis,g=o.filter;c!==p&&r.animate(p),u!==d&&r.changeData(d),a.Util.shallowEqual(s,h)||r.scale(h),a.Util.shallowEqual(f,g)||g.forEach(function(t){r.filter(t[0],t[1])}),l!==v&&r.axis(v),this.updateCoord(r,n),this.updateAxises(r,n.axises),this.updateGeoms(r,n.geoms),this.updateGuide(r,n.guide)}},updateViews:function t(e,n){var r=n.views;if(r)for(var i in r){var o=r[i];o&&(o.needReExecute||this.needReExecute(o))?(l.default.synchronizeG2View(o.g2Instance,o),r[i].needReExecute=!1):this.updateView(e,o)}},updateFacet:function t(e,n){var r=n.facet;if(r){var i=r.props,o=r.updateProps;if(null!=i&&null!=o){var s=i.type,u=y(i,["type"]),c=o.type,f=y(o,["type"]);s===c&&a.Util.shallowEqual(u,f)||(r.props=o,l.default.facet(e,n))}}}};e.default=x},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var b=function(){function t(){m(this,t),this.config={},this.elementInfos={},this.added=!1,this.initedG2=!1,this.updated=!1,this.deleted=!1,this.deleteInfos={}}return i(t,[{key:"calUpdateFlag",value:function t(e,n){var r=this.elementInfos[n].props,i=r.children,o=y(r,["children"]),a=this.elementInfos[n].updateProps,s=a.children,u=y(a,["children"]);if("Chart"===e||"View"===e){var c=o.data,l=y(o,["data"]),f=u.data,h=y(u,["data"]);c===f&&v.Util.isEqual(l,h)||(this.updated=!0)}else v.Util.isEqual(o,u)||(this.updated=!0)}},{key:"addElement",value:function t(e,n,i,o,s){!this.chart&&this.initedG2||(this.added=!0,this.elementInfos[n]={id:n,viewId:s,parentInfo:o,name:e,props:r({},i)},o&&!this.elementInfos[o.id]&&(this.elementInfos[o.id]={id:o.id,name:o.name}),a.default.addElement(e,this.config,this.elementInfos[n]))}},{key:"updateElement",value:function t(e,n,i){this.elementInfos[n].updateProps=r({},i),this.calUpdateFlag(e,n)}},{key:"deleteElement",value:function t(e,n){this.chart&&(this.deleteInfos[n]=n,this.deleted=!0)}},{key:"createG2Instance",value:function t(){var e=this.config,n=d.default.createChart(e,this.elementInfos);return d.default.executeChartConfig(n,e,this.elementInfos),d.default.synchronizeG2Add(n,e,this.elementInfos),n.render(),this.chart=n,this.initedG2=!0,this.resetStates(),n}},{key:"destory",value:function t(){this.chart.destroy(),this.chart=null}},{key:"resetStates",value:function t(){var e=this.elementInfos;for(var n in e)e[n].updateProps&&delete e[n].updateProps,this.deleteInfos[n]&&delete e[n];this.added=!1,this.updated=!1,this.deleteInfos={}}},{key:"reExecuteChart",value:function t(){return this.chart.clear(),u.default.merge(this.config,this.deleteInfos,this.elementInfos,!0),d.default.executeChartConfig(this.chart,this.config,this.elementInfos),d.default.synchronizeG2Add(this.chart,this.config,this.elementInfos),this.chart.repaint(),this.resetStates(),this.chart}},{key:"batchedUpdate",value:function t(){return null==this.chart?null:this.config.chart.props.forceUpdate||l.default.needRebuildChart(this.config)?(u.default.merge(this.config,this.deleteInfos,this.elementInfos,!0),this.chart.destroy(),this.chart="destroy",this.createG2Instance()):h.default.needReExecute(this.deleteInfos,this.elementInfos)||l.default.needReExecute(this.config)?(this.reExecuteChart(),this.chart):(this.deleted&&(h.default.synchronizeG2Delete(this.chart,this.config,this.deleteInfos,this.elementInfos),u.default.mergeDelete(this.config,this.deleteInfos,this.elementInfos)),this.added&&d.default.synchronizeG2Add(this.chart,this.config),this.updated&&l.default.synchronizeG2Update(this.chart,this.config),(this.added||this.deleted||this.updated)&&this.chart.repaint(),u.default.mergeUpdate(this.config,!1),this.resetStates(),this.chart)}}]),t}();e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(54));function o(t){return t&&t.__esModule?t:{default:t}}e.default={init:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],r=arguments[2];i.default.each(e,function(t){var e=n[t];void 0!==e&&(i.default.isArray(e)||(e=[e]),r(e,t))})},update:function t(e,n,r,o){var a=void 0,s=void 0;i.default.each(e,function(t){a=n[t],s=r[t],i.default.shallowEqual(s,a)||(i.default.isArray(s)||(s=[s]),o(s,t))})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={}},function(t,e,n){"use strict";e.a=v;var r=n(84),i=n(83),o=n(189),a=-.14861,s=1.78277,u=-.29227,c=-.90649,l=1.97294,f=l*c,h=l*s,p=s*u-c*a;function d(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);t instanceof i.a||(t=n.i(i.b)(t));var e=t.r/255,r=t.g/255,a=t.b/255,s=(p*a+f*e-h*r)/(p+f-h),d=a-s,v=(l*(r-s)-u*d)/c,y=Math.sqrt(v*v+d*d)/(l*s*(1-s)),m=y?Math.atan2(v,d)*o.a-120:NaN;return new g(m<0?m+360:m,y,s,t.opacity)}function v(t,e,n,r){return 1===arguments.length?d(t):new g(t,e,n,null==r?1:r)}function g(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}n.i(r.a)(g,v,n.i(r.b)(i.c,{brighter:function(t){return t=null==t?i.d:Math.pow(i.d,t),new g(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?i.e:Math.pow(i.e,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*o.b,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),f=Math.sin(t);return new i.a(255*(e+n*(a*r+s*f)),255*(e+n*(u*r+c*f)),255*(e+n*(l*r)),this.opacity)}}))},function(t,e,n){"use strict";e.b=g,e.a=j;var r=n(84),i=n(83),o=n(189),a=18,s=.96422,u=1,c=.82521,l=4/29,f=6/29,h=3*f*f,p=f*f*f;function d(t){if(t instanceof y)return new y(t.l,t.a,t.b,t.opacity);if(t instanceof S){if(isNaN(t.h))return new y(t.l,0,0,t.opacity);var e=t.h*o.b;return new y(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof i.a||(t=n.i(i.b)(t));var r=_(t.r),a=_(t.g),l=_(t.b),f=m((.2225045*r+.7168786*a+.0606169*l)/u),h,p;return r===a&&a===l?h=p=f:(h=m((.4360747*r+.3850649*a+.1430804*l)/s),p=m((.0139322*r+.0971045*a+.7141733*l)/c)),new y(116*f-16,500*(h-f),200*(f-p),t.opacity)}function v(t,e){return new y(t,0,0,null==e?1:e)}function g(t,e,n,r){return 1===arguments.length?d(t):new y(t,e,n,null==r?1:r)}function y(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function m(t){return t>p?Math.pow(t,1/3):t/h+l}function b(t){return t>f?t*t*t:h*(t-l)}function x(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function _(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function w(t){if(t instanceof S)return new S(t.h,t.c,t.l,t.opacity);if(t instanceof y||(t=d(t)),0===t.a&&0===t.b)return new S(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*o.a;return new S(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function O(t,e,n,r){return 1===arguments.length?w(t):new S(n,e,t,null==r?1:r)}function j(t,e,n,r){return 1===arguments.length?w(t):new S(t,e,n,null==r?1:r)}function S(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}n.i(r.a)(y,g,n.i(r.b)(i.c,{brighter:function(t){return new y(this.l+a*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new y(this.l-a*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=s*b(e),t=u*b(t),n=c*b(n),new i.a(x(3.1338561*e-1.6168667*t-.4906146*n),x(-.9787684*e+1.9161415*t+.033454*n),x(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),n.i(r.a)(S,j,n.i(r.b)(i.c,{brighter:function(t){return new S(this.h,this.c,this.l+a*(null==t?1:t),this.opacity)},darker:function(t){return new S(this.h,this.c,this.l-a*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}))},function(t,e,n){"use strict";var r={value:function(){}};function i(){for(var t=0,e=arguments.length,n={},r;t=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function s(t,e){for(var n=0,r=t.length,i;n0)for(var n=new Array(i),r=0,i,o;r180?e+=360:e-t>180&&(t+=360),s.push({i:i.push(a(i)+"rotate(",null,o)-2,x:n.i(r.a)(t,e)})):e&&i.push(a(i)+"rotate("+e+o)}function c(t,e,i,s){t!==e?s.push({i:i.push(a(i)+"skewX(",null,o)-2,x:n.i(r.a)(t,e)}):e&&i.push(a(i)+"skewX("+e+o)}function l(t,e,i,o,s,u){if(t!==i||e!==o){var c=s.push(a(s)+"scale(",null,",",null,")");u.push({i:c-4,x:n.i(r.a)(t,i)},{i:c-2,x:n.i(r.a)(e,o)})}else 1===i&&1===o||s.push(a(s)+"scale("+i+","+o+")")}return function(e,n){var r=[],i=[];return e=t(e),n=t(n),s(e.translateX,e.translateY,n.translateX,n.translateY,r,i),u(e.rotate,n.rotate,r,i),c(e.skewX,n.skewX,r,i),l(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){for(var e=-1,n=i.length,o;++e180?e+=360:e-t>180&&(t+=360),s.push({i:i.push(a(i)+"rotate(",null,o)-2,x:n.i(r.a)(t,e)})):e&&i.push(a(i)+"rotate("+e+o)}function c(t,e,i,s){t!==e?s.push({i:i.push(a(i)+"skewX(",null,o)-2,x:n.i(r.a)(t,e)}):e&&i.push(a(i)+"skewX("+e+o)}function l(t,e,i,o,s,u){if(t!==i||e!==o){var c=s.push(a(s)+"scale(",null,",",null,")");u.push({i:c-4,x:n.i(r.a)(t,i)},{i:c-2,x:n.i(r.a)(e,o)})}else 1===i&&1===o||s.push(a(s)+"scale("+i+","+o+")")}return function(e,n){var r=[],i=[];return e=t(e),n=t(n),s(e.translateX,e.translateY,n.translateX,n.translateY,r,i),u(e.rotate,n.rotate,r,i),c(e.skewX,n.skewX,r,i),l(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){for(var e=-1,n=i.length,o;++e=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}},e.a=function(t,e){var n=r(t+"");if(arguments.length<2){for(var o=i(this.node()),a=-1,s=n.length;++a=j&&(j=O+1);!(E=_[j])&&++j=0;)(a=r[i])&&(o&&o!==a.nextSibling&&o.parentNode.insertBefore(a,o),o=a);return this}},function(t,e,n){"use strict";function r(t){return function(){delete this[t]}}function i(t,e){return function(){this[t]=e}}function o(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}e.a=function(t,e){return arguments.length>1?this.each((null==e?r:"function"==typeof e?o:i)(t,e)):this.node()[t]}},function(t,e,n){"use strict";function r(){this.nextSibling&&this.parentNode.appendChild(this)}e.a=function(){return this.each(r)}},function(t,e,n){"use strict";function r(){var t=this.parentNode;t&&t.removeChild(this)}e.a=function(){return this.each(r)}},function(t,e,n){"use strict";var r=n(16),i=n(93);e.a=function(t){"function"!=typeof t&&(t=n.i(i.a)(t));for(var e=this._groups,o=e.length,a=new Array(o),s=0;se?1:t>=e?0:NaN}e.a=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=i);for(var n=this._groups,o=n.length,a=new Array(o),s=0;si.d&&a.name===e)return new r.b([[t]],o,e,+s);return null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(496),i=n(27);n.d(e,"transition",function(){return i.a});var o=n(494);n.d(e,"active",function(){return o.a});var a=n(211);n.d(e,"interrupt",function(){return a.a})},function(t,e,n){"use strict";var r=n(21),i=n(497),o=n(498);r.selection.prototype.interrupt=i.a,r.selection.prototype.transition=o.a},function(t,e,n){"use strict";var r=n(211);e.a=function(t){return this.each(function(){n.i(r.a)(this,t)})}},function(t,e,n){"use strict";var r=n(27),i=n(17),o=n(190),a=n(96),s={time:null,delay:0,duration:250,ease:o.easeCubicInOut};function u(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))return s.time=n.i(a.now)(),s;return r}e.a=function(t){var e,o;t instanceof r.b?(e=t._id,t=t._name):(e=n.i(r.c)(),(o=s).time=n.i(a.now)(),t=null==t?null:t+"");for(var c=this._groups,l=c.length,f=0;f=0&&(t=t.slice(0,e)),!t||"start"===t})}function o(t,e,n){var o,a,s=i(e)?r.g:r.e;return function(){var r=s(this,t),i=r.on;i!==o&&(a=(o=i).copy()).on(e,n),r.on=a}}e.a=function(t,e){var i=this._id;return arguments.length<2?n.i(r.f)(this.node(),i).on.on(t):this.each(o(i,t,e))}},function(t,e,n){"use strict";function r(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}e.a=function(){return this.on("end.remove",r(this._id))}},function(t,e,n){"use strict";var r=n(21),i=n(27),o=n(17);e.a=function(t){var e=this._name,a=this._id;"function"!=typeof t&&(t=n.i(r.selector)(t));for(var s=this._groups,u=s.length,c=new Array(u),l=0;l=0},_getDimValues:function t(e){var n=this,r={},a=[];if(this.xField&&this.isAdjust("x")&&a.push(this.xField),this.yField&&this.isAdjust("y")&&a.push(this.yField),i(a,function(t){var n=o.values(e,t);n.sort(function(t,e){return t-e}),r[t]=n}),!this.yField&&this.isAdjust("y")){var s="y",u=[0,1];r.y=u}return r},adjustData:function t(e,n){var r=this,o=r._getDimValues(n);i(e,function(t,n){i(o,function(i,o){r.adjustDim(o,i,t,e.length,n)})})},getAdjustRange:function t(e,n,r){var i=this,o=r.indexOf(n),a=r.length,s,u;return!this.yField&&this.isAdjust("y")?(s=0,u=1):a>1?(s=0===o?r[0]:r[o-1],u=o===a-1?r[a-1]:r[o+1],0!==o?s+=(n-s)/2:s-=(u-n)/2,o!==a-1?u-=(u-n)/2:u+=(n-r[a-2])/2):(s=0===n?0:n-.5,u=0===n?1:n+.5),{pre:s,next:u}},groupData:function t(e,n){var r={};return i(e,function(t){var e=t[n];void 0===e&&(e=t[n]=0),r[e]||(r[e]=[]),r[e].push(t)}),r}}},function(t,e,n){var r=n(11),i=n(14),o=n(2),a=/rgba?\(([\s.,0-9]+)\)/;function s(){var t=document.createElement("i");return t.title="Web Colour Picker",t.style.display="none",document.body.appendChild(t),t}function u(t,e,n,r){var i;return t[r]+(e[r]-t[r])*n}function c(t){return"#"+l(t[0])+l(t[1])+l(t[2])}function l(t){return 1===(t=(t=Math.round(t)).toString(16)).length&&(t="0"+t),t}function f(t,e){(isNaN(e)||!r(e)||e<0)&&(e=0),e>1&&(e=1);var n=t.length-1,i=Math.floor(n*e),o=n*e-i,a=t[i],s=i===n?a:t[i+1],l;return c([u(a,s,o,0),u(a,s,o,1),u(a,s,o,2)])}function h(t){var e=[];return e.push(parseInt(t.substr(1,2),16)),e.push(parseInt(t.substr(3,2),16)),e.push(parseInt(t.substr(5,2),16)),e}var p={},d=null,v={toRGB:function t(e){if("#"===e[0]&&7===e.length)return e;var n,r,i;(d||(d=s()),p[e])?n=p[e]:(d.style.color=e,n=document.defaultView.getComputedStyle(d,"").getPropertyValue("color"),n=c(a.exec(n)[1].split(/\s*,\s*/)),p[e]=n);return n},rgb2arr:h,gradient:function t(e){var n=[];return i(e)&&(e=e.split("-")),o(e,function(t){-1===t.indexOf("#")&&(t=v.toRGB(t)),n.push(h(t))}),function(t){return f(n,t)}}};t.exports=v},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=n(35).Group,a=n(3),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function t(){return{zIndex:1,type:"line",lineStyle:null,items:null,alternateColor:null,matrix:null,hideFirstLine:!1,hideLastLine:!1,hightLightZero:!1,zeroLineStyle:{stroke:"#595959",lineDash:[0,0]}}},n._renderUI=function e(){t.prototype._renderUI.call(this),this._drawLines()},n._drawLines=function t(){var e=this,n=this.get("lineStyle"),r=this.get("items");r&&r.length&&(this._precessItems(r),this._drawGridLines(r,n))},n._precessItems=function t(e){var n=this,r;a.each(e,function(t,e){r&&n.get("alternateColor")&&n._drawAlternativeBg(t,r,e),r=t})},n._drawGridLines=function t(e,n){var r=this,i=this.get("type"),o,s,u,c,l=e.length;"line"===i||"polygon"===i?a.each(e,function(t,e){r.get("hideFirstLine")&&0===e||r.get("hideLastLine")&&e===l-1||(c=t.points,s=[],"line"===i?(s.push(["M",c[0].x,c[0].y]),s.push(["L",c[c.length-1].x,c[c.length-1].y])):a.each(c,function(t,e){0===e?s.push(["M",t.x,t.y]):s.push(["L",t.x,t.y])}),u=r._drawZeroLine(i,e)?a.mix({},r.get("zeroLineStyle"),{path:s}):a.mix({},n,{path:s}),(o=r.addShape("path",{attrs:u})).name="axis-grid",o._id=t._id,o.set("coord",r.get("coord")),r.get("appendInfo")&&o.setSilent("appendInfo",r.get("appendInfo")))}):a.each(e,function(t,e){r.get("hideFirstLine")&&0===e||r.get("hideLastLine")&&e===l-1||(c=t.points,s=[],a.each(c,function(t,e){var n=t.radius;0===e?s.push(["M",t.x,t.y]):s.push(["A",n,n,0,0,t.flag,t.x,t.y])}),u=a.mix({},n,{path:s}),(o=r.addShape("path",{attrs:u})).name="axis-grid",o._id=t._id,o.set("coord",r.get("coord")),r.get("appendInfo")&&o.setSilent("appendInfo",r.get("appendInfo")))})},n._drawZeroLine=function t(e,n){var r=this,i=this.get("tickValues");return!("line"!==e||!i||0!==i[n]||!this.get("hightLightZero"))},n._drawAlternativeBg=function t(e,n,r){var i=this,o=this.get("alternateColor"),s,u,c;a.isString(o)?u=o:a.isArray(o)&&(u=o[0],c=o[1]),r%2==0?c&&(s=this._getBackItem(n.points,e.points,c)):u&&(s=this._getBackItem(n.points,e.points,u));var l=this.addShape("Path",{attrs:s});l.name="axis-grid-rect",l._id=e._id&&e._id.replace("grid","grid-rect"),l.set("coord",this.get("coord")),this.get("appendInfo")&&l.setSilent("appendInfo",this.get("appendInfo"))},n._getBackItem=function t(e,n,r){var i=[],o=this.get("type");if("line"===o)i.push(["M",e[0].x,e[0].y]),i.push(["L",e[e.length-1].x,e[e.length-1].y]),i.push(["L",n[n.length-1].x,n[n.length-1].y]),i.push(["L",n[0].x,n[0].y]),i.push(["Z"]);else if("polygon"===o){a.each(e,function(t,e){0===e?i.push(["M",t.x,t.y]):i.push(["L",t.x,t.y])});for(var s=n.length-1;s>=0;s--)i.push(["L",n[s].x,n[s].y]);i.push(["Z"])}else{var u=e[0].flag;a.each(e,function(t,e){var n=t.radius;0===e?i.push(["M",t.x,t.y]):i.push(["A",n,n,0,0,t.flag,t.x,t.y])});for(var c=n.length-1;c>=0;c--){var l=n[c],f=l.radius;c===n.length-1?i.push(["M",l.x,l.y]):i.push(["A",f,f,0,0,1===u?0:1,l.x,l.y])}}return{fill:r,path:i}},e}(o);t.exports=s},function(t,e,n){var r=n(3);t.exports={getFirstScale:function t(e){var n;return r.each(e,function(t){if(t)return n=t,!1}),n}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=i.DomUtil,a=n(34),s,u,c,l={scatter:n(244),map:n(245),treemap:n(243)},f=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"label",type:"default",textStyle:null,formatter:null,items:null,useHtml:!1,containerTpl:'
      ',itemTpl:'
      {text}
      ',labelLine:!1,lineGroup:null,shapes:null,config:!0,capture:!0})},n.clear=function e(){var n=this.get("group"),r=this.get("container");n&&!n.get("destroyed")&&n.clear(),r&&(r.innerHTML=""),t.prototype.clear.call(this)},n.destroy=function t(){var e=this.get("group"),n=this.get("container");e.destroy||e.destroy(),n&&(n.innerHTML="")},n.render=function t(){this.clear(),this._init(),this.beforeDraw(),this.draw(),this.afterDraw()},n._dryDraw=function t(){var e=this,n=e.get("items"),r=e.getLabels(),o=r.length;i.each(n,function(t,n){if(n=n.length;a--)r[a].remove();e._adjustLabels(),!e.get("labelLine")&&e.get("config")||e.drawLines()},n.draw=function t(){this._dryDraw(),this.get("canvas").draw()},n.changeLabel=function t(e,n){if(e)if(e.tagName){var r=this._createDom(n);e.innerHTML=r.innerHTML,this._setCustomPosition(n,e)}else e._id=n._id,e.attr("text",n.text),e.attr("x")===n.x&&e.attr("y")===n.y||(e.resetMatrix(),n.textStyle.rotate&&(e.rotateAtStart(n.textStyle.rotate),delete n.textStyle.rotate),e.attr(n))},n.show=function t(){var e=this.get("group"),n=this.get("container");e&&e.show(),n&&(n.style.opacity=1)},n.hide=function t(){var e=this.get("group"),n=this.get("container");e&&e.hide(),n&&(n.style.opacity=0)},n.drawLines=function t(){var e=this,n;"boolean"==typeof e.get("labelLine")&&e.set("labelLine",{});var r=e.get("lineGroup");!r||r.get("destroyed")?(r=e.get("group").addGroup({elCls:"x-line-group"}),e.set("lineGroup",r)):r.clear(),i.each(e.get("items"),function(t){e.lineToLabel(t,r)})},n.lineToLabel=function t(e,n){var r=this;if(this.get("config")||e.labelLine){var o=e.labelLine||this.get("labelLine"),a=void 0===e.capture?this.get("capture"):e.capture,s=o.path;if(s&&i.isFunction(o.path)&&(s=o.path(e)),!s){var u=e.start||{x:e.x-e._offset.x,y:e.y-e._offset.y};s=[["M",u.x,u.y],["L",e.x,e.y]]}var c=e.color;c||(c=e.textStyle&&e.textStyle.fill?e.textStyle.fill:"#000");var l=n.addShape("path",{attrs:i.mix({path:s,fill:null,stroke:c},o),capture:a});l.name=this.get("name"),l._id=e._id&&e._id.replace("glabel","glabelline"),l.set("coord",this.get("coord"))}},n._adjustLabels=function t(){var e=this,n=this.get("type"),r=this.getLabels(),i=this.get("shapes"),o=l[n];"default"!==n&&o&&o(r,i)},n.getLabels=function t(){var e=this.get("container");return e?i.toArray(e.childNodes):this.get("group").get("children")},n._addLabel=function t(e,n){var r=e;return this.get("config")&&(r=this._getLabelCfg(e,n)),this._createText(r)},n._getLabelCfg=function t(e,n){var r=this.get("textStyle")||{},o=this.get("formatter"),a=this.get("htmlTemplate"),s;if(!i.isObject(e)){var u=e;(e={}).text=u}return i.isFunction(r)&&(r=r(e.text,e,n)),o&&(e.text=o(e.text,e,n)),a&&(e.useHtml=!0,i.isFunction(a)&&(e.text=a(e.text,e,n))),i.isNil(e.text)&&(e.text=""),e.text=e.text+"",i.mix({},e,{textStyle:r},{x:e.x||0,y:e.y||0})},n._init=function t(){if(!this.get("group")){var e=this.get("canvas").addGroup({id:"label-group"});this.set("group",e)}},n.initHtmlContainer=function t(){var e=this.get("container");if(e)i.isString(e)&&(e=document.getElementById(e))&&this.set("container",e);else{var n=this.get("containerTpl"),r=this.get("canvas").get("el").parentNode;e=o.createDom(n),r.style.position="relative",r.appendChild(e),this.set("container",e)}return e},n._createText=function t(e){var n=this.get("container"),r=void 0===e.capture?this.get("capture"):e.capture,o;if(!e.useHtml&&!e.htmlTemplate){var a=this.get("name"),s=e.point,u=this.get("group");delete e.point;var c=e.rotate;return e.textStyle&&(e.textStyle.rotate&&(c=e.textStyle.rotate,delete e.textStyle.rotate),e=i.mix({x:e.x,y:e.y,textAlign:e.textAlign,text:e.text},e.textStyle)),o=u.addShape("text",{attrs:e,capture:r}),c&&(Math.abs(c)>2*Math.PI&&(c=c/180*Math.PI),o.transform([["t",-e.x,-e.y],["r",c],["t",e.x,e.y]])),o.setSilent("origin",s||e),o.name=a,this.get("appendInfo")&&o.setSilent("appendInfo",this.get("appendInfo")),o}n||(n=this.initHtmlContainer());var l=this._createDom(e);n.appendChild(l),this._setCustomPosition(e,l)},n._createDom=function t(e){var n=this.get("itemTpl"),r=i.substitute(n,{text:e.text});return o.createDom(r)},n._setCustomPosition=function t(e,n){var r=e.textAlign||"left",i=e.y,a=e.x,s=o.getOuterWidth(n),u;i-=o.getOuterHeight(n)/2,"center"===r?a-=s/2:"right"===r&&(a-=s),n.style.top=parseInt(i,10)+"px",n.style.left=parseInt(a,10)+"px"},e}(a);t.exports=f},function(t,e){var n=function(){function t(){this.bitmap=[]}var e=t.prototype;return e.hasGap=function t(e){for(var t=!0,n=this.bitmap,r=Math.floor(e.minX),i=Math.ceil(e.maxX),o=Math.floor(e.minY),a=Math.ceil(e.maxY)-1,s=r;s-1?t:t.parentNode?t.parentNode.className===l?t.parentNode:y(t.parentNode,e):null}function m(t,e){var n=null,r=e instanceof c?e.get("value"):e;return i.each(t,function(t){if(t.value===r)return n=t,!1}),n}var b=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"category-legend",container:null,containerTpl:'

        ',itemTpl:'
      • {value}
      • ',legendStyle:{},textStyle:{fill:"#333",fontSize:12,textAlign:"middle",textBaseline:"top",fontFamily:s},abridgeText:!1,tipTpl:'
        ',tipStyle:{display:"none",fontSize:"12px",backgroundColor:"#fff",position:"absolute",width:"auto",height:"auto",padding:"3px",boxShadow:"2px 2px 5px #888"},autoPosition:!0})},n._init=function t(){},n.beforeRender=function t(){},n.render=function t(){this._renderHTML()},n._bindEvents=function t(){var e=this,n,r=g(this.get("legendWrapper"),h);this.get("hoverable")&&(r.onmousemove=function(t){return e._onMousemove(t)},r.onmouseout=function(t){return e._onMouseleave(t)}),this.get("clickable")&&(r.onclick=function(t){return e._onClick(t)})},n._onMousemove=function t(e){var n=this.get("items"),r=e.target,i=r.className;if(!((i=i.split(" ")).indexOf(l)>-1||i.indexOf(h)>-1)){var o=y(r,p),a=m(n,o.getAttribute("data-value"));a?(this.deactivate(),this.activate(o.getAttribute("data-value")),this.emit("itemhover",{item:a,currentTarget:o,checked:a.checked})):a||(this.deactivate(),this.emit("itemunhover",e))}},n._onMouseleave=function t(e){this.deactivate(),this.emit("itemunhover",e)},n._onClick=function t(e){var n=this,r,o=g(this.get("legendWrapper"),h),a=this.get("unCheckColor"),s=this.get("items"),u=this.get("selectedMode"),c=o.childNodes,f=e.target,b=f.className;if(!((b=b.split(" ")).indexOf(l)>-1||b.indexOf(h)>-1)){var x=y(f,p),_=g(x,d),w=g(x,v),O=m(s,x.getAttribute("data-value"));if(O){var j=x.className,S=x.getAttribute("data-color");if("single"===u)O.checked=!0,i.each(c,function(t){var e,r;t!==x?(g(t,v).style.backgroundColor=a,t.className=t.className.replace("checked","unChecked"),t.style.color=a,m(s,t.getAttribute("data-value")).checked=!1):(_&&(_.style.color=n.get("textStyle").fill),w&&(w.style.backgroundColor=S),x.className=j.replace("unChecked","checked"))});else{var E=-1!==j.indexOf("checked"),M=0;if(i.each(c,function(t){-1!==t.className.indexOf("checked")&&M++}),!this.get("allowAllCanceled")&&E&&1===M)return void this.emit("clicklastitem",{item:O,currentTarget:x,checked:"single"===u||O.checked});O.checked=!O.checked,E?(w&&(w.style.backgroundColor=a),x.className=j.replace("checked","unChecked"),x.style.color=a):(w&&(w.style.backgroundColor=S),x.className=j.replace("unChecked","checked"),x.style.color=this.get("textStyle").fill)}this.emit("itemclick",{item:O,currentTarget:x,checked:"single"===u||O.checked})}}},n.activate=function t(e){var n=this,r=this,i=r.get("items"),o=m(i,e),a,s,u;g(r.get("legendWrapper"),h).childNodes.forEach(function(t){var e=g(t,v),a=m(i,t.getAttribute("data-value"));if(n.get("highlight")){if(a===o&&a.checked)return void(e.style.border="1px solid #333")}else a===o?e.style.opacity=r.get("activeOpacity"):a.checked&&(e.style.opacity=r.get("inactiveOpacity"))})},n.deactivate=function t(){var e=this,n=this,r,i,o;g(n.get("legendWrapper"),h).childNodes.forEach(function(t){var r=g(t,v);e.get("highlight")?r.style.border="1px solid #fff":r.style.opacity=n.get("inactiveOpacity")})},n._renderHTML=function t(){var e=this,n=this.get("container"),r=this.get("title"),o=this.get("containerTpl"),a=u.createDom(o),c=g(a,f),y=g(a,h),m=this.get("unCheckColor"),b=i.deepMix({},{CONTAINER_CLASS:{height:"auto",width:"auto",position:"absolute",overflowY:"auto",fontSize:"12px",fontFamily:s,lineHeight:"20px",color:"#8C8C8C"},TITLE_CLASS:{marginBottom:this.get("titleGap")+"px",fontSize:"12px",color:"#333",textBaseline:"middle",fontFamily:s},LIST_CLASS:{listStyleType:"none",margin:0,padding:0,textAlign:"center"},LIST_ITEM_CLASS:{cursor:"pointer",marginBottom:"5px",marginRight:"24px"},MARKER_CLASS:{width:"9px",height:"9px",borderRadius:"50%",display:"inline-block",marginRight:"4px",verticalAlign:"middle"}},this.get("legendStyle"));if(/^\#/.test(n)||"string"==typeof n&&n.constructor===String){var x=n.replace("#","");(n=document.getElementById(x)).appendChild(a)}else{var _=this.get("position"),w={};w="left"===_||"right"===_?{maxHeight:(this.get("maxLength")||n.offsetHeight)+"px"}:{maxWidth:(this.get("maxLength")||n.offsetWidth)+"px"},u.modifyCSS(a,i.mix({},b.CONTAINER_CLASS,w,this.get(l))),n.appendChild(a)}u.modifyCSS(y,i.mix({},b.LIST_CLASS,this.get(h))),c&&(r&&r.text?(c.innerHTML=r.text,u.modifyCSS(c,i.mix({},b.TITLE_CLASS,this.get(f),r))):a.removeChild(c));var O=this.get("items"),j=this.get("itemTpl"),S=this.get("position"),E=this.get("layout"),M="right"===S||"left"===S||"vertical"===E?"block":"inline-block",C=i.mix({},b.LIST_ITEM_CLASS,{display:M},this.get(p)),P=i.mix({},b.MARKER_CLASS,this.get(v));if(i.each(O,function(t,n){var r=t.checked,o=e._formatItemValue(t.value),s=t.marker.fill||t.marker.stroke,c=r?s:m,l;l=i.isFunction(j)?j(o,c,r,n):j;var f=i.substitute(l,i.mix({},t,{index:n,checked:r?"checked":"unChecked",value:o,color:c,originColor:s,originValue:t.value.replace(/\"/g,""")})),h=u.createDom(f);h.style.color=e.get("textStyle").fill;var p=g(h,v),b=g(h,d);if(u.modifyCSS(h,C),p&&u.modifyCSS(p,P),r||(h.style.color=m,p&&(p.style.backgroundColor=m)),y.appendChild(h),e.get("abridgeText")){var x=o,_=h.offsetWidth,w=e.get("textStyle").fontSize;isNaN(w)&&(-1!==w.indexOf("pt")?w=1*parseFloat(w.substr(0,w.length-2))/72*96:-1!==w.indexOf("px")&&(w=parseFloat(w.substr(0,w.length-2))));var O=w*x.length,S=Math.floor(_/w);_<2*w?x="":_1&&(x=x.substr(0,S-1)+"..."),b.innerText=x,h.addEventListener("mouseover",function(){var t=g(a.parentNode,"textTip");t.style.display="block",t.style.left=h.offsetLeft+h.offsetWidth+"px",t.style.top=h.offsetTop+15+"px",t.innerText=o}),h.addEventListener("mouseout",function(){var t;g(a.parentNode,"textTip").style.display="none"})}}),this.get("abridgeText")){var k=this.get("tipTpl"),T=u.createDom(k),A=this.get("tipStyle");u.modifyCSS(T,A),a.parentNode.appendChild(T),T.addEventListener("mouseover",function(){T.style.display="none"})}this.set("legendWrapper",a)},n._adjustPositionOffset=function t(){var e=this.get("position"),n=this.get("offset"),r=this.get("offsetX"),i=this.get("offsetY");r&&(n[0]=r),i&&(n[1]=i);var o=this.get("legendWrapper");o.style.left=e[0]+"px",o.style.top=e[1]+"px",o.style.marginLeft=n[0]+"px",o.style.marginTop=n[1]+"px"},n.getWidth=function t(){return u.getOuterWidth(this.get("legendWrapper"))},n.getHeight=function t(){return u.getOuterHeight(this.get("legendWrapper"))},n.move=function e(n,r){/^\#/.test(this.get("container"))?t.prototype.move.call(this,n,r):(u.modifyCSS(this.get("legendWrapper"),{left:n+"px",top:r+"px"}),this.set("x",n),this.set("y",r))},n.destroy=function t(){var e=this.get("legendWrapper");e&&e.parentNode&&e.parentNode.removeChild(e)},e}(o);t.exports=b},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(105),a,s=n(18).FONT_FAMILY,u=i.Event,c=i.Group;function l(t,e){var n=null,r=e instanceof c||"legendGroup"===e.name?e.get("value"):e;return i.each(t,function(t){if(t.value===r)return n=t,!1}),n}function f(t,e){return t.findBy(function(t){return t.name===e})}var h=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"category-legend",items:null,itemGap:5,itemMarginBottom:8,itemsGroup:null,layout:"horizontal",allowAllCanceled:!1,backPadding:[0,0,0,0],unCheckColor:"#ccc",background:{fill:"#fff",fillOpacity:0},itemWidth:null,textStyle:{fill:"#333",fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:s},_wordSpaceing:8,clickable:!0,selectedMode:"multiple",reversed:!1,autoWrap:!0,highlight:!1,activeOpacity:.7,inactiveOpacity:1})},n.render=function e(){t.prototype.render.call(this),this._renderItems(),this.get("autoWrap")&&this._adjustItems()},n._bindEvents=function t(){this.get("hoverable")&&(this.get("group").on("mousemove",i.wrapBehavior(this,"_onMousemove")),this.get("group").on("mouseleave",i.wrapBehavior(this,"_onMouseleave"))),this.get("clickable")&&this.get("group").on("click",i.wrapBehavior(this,"_onClick"))},n._getLegendItem=function t(e){var n=e.get("parent");return n&&"legendGroup"===n.name?n:null},n.activate=function t(e){var n=this,r=this,i,o,a=void 0;r.get("itemsGroup").get("children").forEach(function(t){if(a=f(t,"legend-marker")){var i=t.get("checked");n.get("highlight")?t.get("value")===e&&i?a.attr("stroke","#333"):a.attr("stroke",null):t.get("value")===e&&a.attr("fillOpacity",r.get("activeOpacity"))}}),this.get("canvas").draw()},n.deactivate=function t(){var e=this,n=this,r,i=n.get("itemsGroup").get("children"),o=void 0,a=this.get("unCheckColor");i.forEach(function(t){if(o=f(t,"legend-marker"))if(e.get("highlight")){var r=o.get("oriStroke"),i=t.get("checked");r=r&&!i?a:"",o.attr("stroke",r)}else o.attr("fillOpacity",n.get("inactiveOpacity"))}),this.get("canvas").draw()},n._onMousemove=function t(e){var n=this._getLegendItem(e.currentTarget);if(n&&n.get("checked")){var r=this.get("items"),i=new u("itemhover",e,!0,!0);i.item=l(r,n),i.checked=n.get("checked"),i.currentTarget=e.currentTarget,this.deactivate(),this.activate(n.get("value")),this.emit("itemhover",i)}else this.deactivate(),this.emit("itemunhover",e);this.get("canvas").draw()},n._onMouseleave=function t(e){this.deactivate(),this.get("canvas").draw(),this.emit("itemunhover",e)},n._onClick=function t(e){var n=this._getLegendItem(e.currentTarget),r=this.get("items");if(n&&!n.get("destroyed")){var o=n.get("checked"),a=this.get("selectedMode"),s=l(r,n),c=new u("itemclick",e,!0,!0);if(c.item=s,c.currentTarget=n,c.appendInfo=e.currentTarget.get("appendInfo"),c.checked="single"===a||!o,!this.get("allowAllCanceled")&&o&&1===this.getCheckedCount())return void this.emit("clicklastitem",c);var h=this.get("unCheckColor"),p=this.get("textStyle").fill,d=void 0,v=void 0,g=void 0;if("single"===a){var y,m=this.get("itemsGroup").get("children");i.each(m,function(t){d=f(t,"legend-marker"),v=f(t,"legend-text"),g=f(t,"legend-item"),t!==n?(d.attr("fill")&&d.attr("fill",h),d.attr("stroke")&&d.attr("stroke",h),v.attr("fill",h),d.setSilent("checked",!1),v.setSilent("checked",!1),g.setSilent("checked",!1),t.setSilent("checked",!1)):(d.attr("fill")&&s&&s.marker&&d.attr("fill",s.marker.fill),d.attr("stroke")&&s&&s.marker&&d.attr("stroke",s.marker.stroke),v.attr("fill",p),d.setSilent("checked",!0),v.setSilent("checked",!0),g.setSilent("checked",!0),t.setSilent("checked",!0))})}else d=f(n,"legend-marker"),v=f(n,"legend-text"),g=f(n,"legend-item"),d.attr("fill")&&s&&s.marker&&d.attr("fill",o?h:s.marker.fill),d.attr("stroke")&&s&&s.marker&&d.attr("stroke",o?h:s.marker.stroke),v.attr("fill",o?h:p),n.setSilent("checked",!o),d.setSilent("checked",!o),v.setSilent("checked",!o),g.setSilent("checked",!o);this.emit("itemclick",c)}this.get("canvas").draw()},n._renderItems=function t(){var e=this,n=this.get("items");if(this.get("reversed")&&n.reverse(),i.each(n,function(t,n){e._addItem(t,n)}),this.get("highlight")){var r,o,a=void 0;this.get("itemsGroup").get("children").forEach(function(t){var e;(a=f(t,"legend-marker")).get("oriStroke")||(a.attr("stroke")?a.set("oriStroke",a.attr("stroke")):a.set("oriStroke",""))})}},n._formatItemValue=function t(e){var n=this.get("formatter")||this.get("itemFormatter");return n&&(e=n.call(this,e)),e},n._getNextX=function t(){var e=this.get("layout"),n=this.get("itemGap"),r=this.get("itemsGroup"),o=this.get("itemWidth"),a=r.get("children"),s=0;return"horizontal"===e&&i.each(a,function(t){s+=(o||t.getBBox().width)+n}),s},n._getNextY=function t(){var e=this.get("itemMarginBottom"),n=this.get("titleShape")?this.get("titleGap"):0,r=this.get("layout"),o=this.get("itemsGroup"),a=this.get("titleShape"),s=o.get("children"),u=n;return a&&(u+=a.getBBox().height),"vertical"===r&&i.each(s,function(t){u+=t.getBBox().height+e}),u},n._addItem=function t(e){var n=this.get("itemsGroup"),r=this._getNextX(),o=this._getNextY(),a=this.get("unCheckColor"),u=n.addGroup({x:r,y:o,value:e.value,checked:e.checked});u.set("viewId",this.get("viewId"));var c=this.get("textStyle"),l=this.get("_wordSpaceing"),f=0;if(e.marker){var h=i.mix({},e.marker,{x:e.marker.radius+r,y:o});e.checked||(h.fill&&(h.fill=a),h.stroke&&(h.stroke=a));var p=u.addShape("marker",{type:"marker",attrs:h});p.attr("cursor","pointer"),p.name="legend-marker",f+=p.getBBox().width+l}var d=i.mix({},{fill:"#333",fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:s},c,{x:f+r,y:o,text:this._formatItemValue(e.value)});e.checked||i.mix(d,{fill:a});var v=u.addShape("text",{attrs:d});v.attr("cursor","pointer"),v.name="legend-text",this.get("appendInfo")&&v.setSilent("appendInfo",this.get("appendInfo"));var g=u.getBBox(),y=this.get("itemWidth"),m=u.addShape("rect",{attrs:{x:r,y:o-g.height/2,fill:"#fff",fillOpacity:0,width:y||g.width,height:g.height}});return m.attr("cursor","pointer"),m.setSilent("origin",e),m.name="legend-item",this.get("appendInfo")&&m.setSilent("appendInfo",this.get("appendInfo")),u.name="legendGroup",u},n._adjustHorizontal=function t(){var e=this.get("itemsGroup"),n=e.get("children"),r=this.get("maxLength"),o=this.get("itemGap"),a=this.get("itemMarginBottom"),s=this.get("titleShape")?this.get("titleGap"):0,u=0,c=0,l=void 0,f=void 0,h=void 0,p=this.get("itemWidth");e.getBBox().width>r&&i.each(n,function(t){h=t.getBBox(),l=p||h.width,f=h.height+a,r-co&&i.each(r,function(t){d=t.getBBox(),h=d.width,p=d.height,l?v=l+a:h>v&&(v=h+a),o-f1&&a[u]>s[u]&&(l=s[u]),this.get("width"))r.attr(u,l-this.get("crosshairs").width/2),r.attr(c,this.get("width"));else if(o.isArray(a.point[u])&&!a.size){var f=a.point[u][1]-a.point[u][0];r.attr(u,a.point[u][0]),r.attr(c,f)}else n=3*a.size/4,r.attr(u,l-n),1===e.length?r.attr(c,3*a.size/2):r.attr(c,Math.abs(s[u]-a[u])+2*n)},e.render=function t(){var e=this.get("canvas"),n=this.get("plotRange"),r=this.get("isTransposed");switch(this.clear(),this.get("type")){case"x":this._renderHorizontalLine(e,n);break;case"y":this._renderVerticalLine(e,n);break;case"cross":this._renderHorizontalLine(e,n),this._renderVerticalLine(e,n);break;case"rect":this._renderBackground(e,n);break;default:r?this._renderHorizontalLine(e,n):this._renderVerticalLine(e,n)}},e.show=function e(){var n=this.get("container");t.prototype.show.call(this),n.show()},e.hide=function e(){var n=this.get("container");t.prototype.hide.call(this),n.hide()},e.clear=function e(){var n=this.get("container");this.set("crossLineShapeX",null),this.set("crossLineShapeY",null),this.set("crosshairsRectShape",null),t.prototype.clear.call(this),n.clear()},e.destroy=function e(){var n=this.get("container");t.prototype.destroy.call(this),n.remove()},e.setPosition=function t(e,n,r){var i=this.get("crossLineShapeX"),o=this.get("crossLineShapeY"),a=this.get("crosshairsRectShape");o&&!o.get("destroyed")&&o.move(e,0),i&&!i.get("destroyed")&&i.move(0,n),a&&!a.get("destroyed")&&this._updateRectShape(r)},n}(i);t.exports=a},function(t,e,n){var r=n(3),i={setMarkers:function t(e,n){var i=this,o=this.get("markerGroup"),a=this.get("frontPlot");o?o.clear():(o=a.addGroup({zIndex:1,capture:!1}),this.set("markerGroup",o)),r.each(e,function(t){o.addShape("marker",{color:t.color,attrs:r.mix({fill:t.color,symbol:"circle",shadowColor:t.color},n,{x:t.x,y:t.y})})}),this.set("markerItems",e)},clearMarkers:function t(){var e=this.get("markerGroup");e&&e.clear()}};t.exports=i},function(t,e){var n=20,r={_calcTooltipPosition:function t(e,n,r,i,o,a){var s=0,u=0,c=20;if(a){var l=a.getBBox();s=l.width,u=l.height,e=l.x,n=l.y,c=5}switch(r){case"inside":e=e+s/2-i/2,n=n+u/2-o/2;break;case"top":e=e+s/2-i/2,n=n-o-c;break;case"left":e=e-i-c,n=n+u/2-o/2;break;case"right":e=e+s+c,n=n+u/2-o/2;break;case"bottom":default:e=e+s/2-i/2,n=n+u+c}return[e,n]},_constraintPositionInBoundary:function t(e,n,r,i,o,a){return e+r+20>o?e=(e-=r+20)<0?0:e:e+20<0?e=20:e+=20,n+i+20>a?n=(n-=i+20)<0?0:n:n+20<0?n=20:n+=20,[e,n]},_constraintPositionInPlot:function t(e,n,r,i,o,a){return e+r>o.tr.x&&(e-=r+40),eo.bl.y&&(n-=i+40),n');e.appendChild(a),this.set("wrapperEl",a),this.get("forceFit")&&(r=u.getWidth(e,r),this.set("width",r));var c=this.get("renderer"),l=new s({containerDOM:a,width:r,height:o,pixelRatio:"svg"===c?1:this.get("pixelRatio"),renderer:c});this.set("canvas",l)},n._initPlot=function t(){var e=this;this._initPlotBack();var n=this.get("canvas"),r=n.addGroup({zIndex:1}),i=n.addGroup({zIndex:0}),o=n.addGroup({zIndex:3});this.set("backPlot",r),this.set("middlePlot",i),this.set("frontPlot",o)},n._initPlotBack=function t(){var e=this,n=this.get("canvas"),r=this.get("viewTheme"),o=n.addGroup(l,{padding:this.get("padding"),plotBackground:i.mix({},r.plotBackground,this.get("plotBackground")),background:i.mix({},r.background,this.get("background"))});this.set("plot",o),this.set("plotRange",o.get("plotRange"))},n._initEvents=function t(){this.get("forceFit")&&window.addEventListener("resize",i.wrapBehavior(this,"_initForceFitEvent"))},n._initForceFitEvent=function t(){var e=setTimeout(i.wrapBehavior(this,"forceFit"),200);clearTimeout(this.get("resizeTimer")),this.set("resizeTimer",e)},n._renderLegends=function t(){var e,n=this.get("options").legends;if(i.isNil(n)||!1!==n){var r=this.get("legendController");if(r.options=n||{},r.plotRange=this.get("plotRange"),n&&n.custom)r.addCustomLegend();else{var o=this.getAllGeoms(),a=[];i.each(o,function(t){var e=t.get("view"),n=t.getAttrsForLegend();i.each(n,function(n){var i=n.type,o=n.getScale(i);if(o.field&&"identity"!==o.type&&!p(a,o)){a.push(o);var s=e.getFilteredOutValues(o.field);r.addLegend(o,n,t,s)}})});var s=this.getYScales();0===a.length&&s.length>1&&r.addMixedLegend(s,o)}r.alignLegends()}},n._renderTooltips=function t(){var e=this.get("options");if(i.isNil(e.tooltip)||!1!==e.tooltip){var n=this.get("tooltipController");n.options=e.tooltip||{},n.renderTooltip()}},n.getAllGeoms=function t(){var e=[];e=e.concat(this.get("geoms"));var n=this.get("views");return i.each(n,function(t){e=e.concat(t.get("geoms"))}),e},n.forceFit=function t(){var e=this;if(this&&!this.destroyed){var n=this.get("container"),r=this.get("width"),i=u.getWidth(n,r);if(0!==i&&i!==r){var o=this.get("height");this.changeSize(i,o)}return this}},n.resetPlot=function t(){var e=this.get("plot"),n=this.get("padding");v(n,e.get("padding"))||(e.set("padding",n),e.repaint())},n.changeSize=function t(e,n){var r=this,i;this.get("canvas").changeSize(e,n);var o=this.get("plot");return this.set("width",e),this.set("height",n),o.repaint(),this.set("keepPadding",!0),this.repaint(),this.set("keepPadding",!1),this.emit("afterchangesize"),this},n.changeWidth=function t(e){return this.changeSize(e,this.get("height"))},n.changeHeight=function t(e){return this.changeSize(this.get("width"),e)},n.view=function t(e){(e=e||{}).theme=this.get("theme"),e.parent=this,e.backPlot=this.get("backPlot"),e.middlePlot=this.get("middlePlot"),e.frontPlot=this.get("frontPlot"),e.canvas=this.get("canvas"),i.isNil(e.animate)&&(e.animate=this.get("animate")),e.options=i.mix({},this._getSharedOptions(),e.options);var t=new o(e);return t.set("_id","view"+this.get("views").length),this.get("views").push(t),this.emit("addview",{view:t}),t},n.removeView=function t(e){var n=this.get("views");i.Array.remove(n,e),e.destroy()},n._getSharedOptions=function t(){var e=this.get("options"),n={};return i.each(["scales","coord","axes"],function(t){n[t]=i.cloneDeep(e[t])}),n},n.getViewRegion=function t(){var e=this.get("plotRange");return{start:e.bl,end:e.tr}},n.legend=function t(e,n){var r=this.get("options");r.legends||(r.legends={});var o={};return!1===e?r.legends=!1:i.isObject(e)?o=e:i.isString(e)?o[e]=n:o=n,i.mix(r.legends,o),this},n.tooltip=function t(e,n){var r=this.get("options");return r.tooltip||(r.tooltip={}),!1===e?r.tooltip=!1:i.isObject(e)?i.mix(r.tooltip,e):i.mix(r.tooltip,n),this},n.clear=function e(){this.emit("beforeclear");for(var n=this.get("views");n.length>0;){var r;n.shift().destroy()}t.prototype.clear.call(this);var i=this.get("canvas");return this.resetPlot(),i.draw(),this.emit("afterclear"),this},n.clearInner=function e(){var n=this.get("views");i.each(n,function(t){t.clearInner()});var r=this.get("tooltipController");if(r&&r.clear(),!this.get("keepLegend")){var o=this.get("legendController");o&&o.clear()}t.prototype.clearInner.call(this)},n.drawComponents=function e(){t.prototype.drawComponents.call(this),this.get("keepLegend")||this._renderLegends()},n.render=function e(){var n=this;if(!this.get("keepPadding")&&this._isAutoPadding()){this.beforeRender(),this.drawComponents();var r=this._getAutoPadding(),o=this.get("plot");v(o.get("padding"),r)||(o.set("padding",r),o.repaint())}var a=this.get("middlePlot");if(this.get("limitInPlot")&&!a.attr("clip")){var s=i.getClipByRange(this.get("plotRange"));a.attr("clip",s)}t.prototype.render.call(this),this._renderTooltips()},n.repaint=function e(){this.get("keepPadding")||this.resetPlot(),t.prototype.repaint.call(this)},n.changeVisible=function t(e){var n=this.get("wrapperEl"),r=e?"":"none";n.style.display=r},n.toDataURL=function t(){var e=this,n=this.get("canvas"),r=this.get("renderer"),i=n.get("el"),o="";if("svg"===r){var a=i.cloneNode(!0),s=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),u=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",s);u.replaceChild(a,u.documentElement);var c=(new XMLSerializer).serializeToString(u);o="data:image/svg+xml;charset=utf8,"+encodeURIComponent(c)}else"canvas"===r&&(o=i.toDataURL("image/png"));return o},n.downloadImage=function t(e){var n=this,r=document.createElement("a"),i=n.get("renderer"),o=(e||"chart")+("svg"===i?".svg":".png"),a;n.get("canvas").get("timeline").stopAllAnimations(),setTimeout(function(){var t=n.toDataURL();if(window.Blob&&window.URL&&"svg"!==i){for(var e=t.split(","),a=e[0].match(/:(.*?);/)[1],s=atob(e[1]),u=s.length,c=new Uint8Array(u);u--;)c[u]=s.charCodeAt(u);var l=new Blob([c],{type:a});window.navigator.msSaveBlob?window.navigator.msSaveBlob(l,o):r.addEventListener("click",function(){r.download=o,r.href=window.URL.createObjectURL(l)})}else r.addEventListener("click",function(){r.download=o,r.href=t});var f=document.createEvent("MouseEvents");f.initEvent("click",!1,!1),r.dispatchEvent(f)},16)},n.showTooltip=function t(e){var n=this.getViewsByPoint(e),r;n.length&&this.get("tooltipController").showTooltip(e,n);return this},n.hideTooltip=function t(){var e;return this.get("tooltipController").hideTooltip(),this},n.getTooltipItems=function t(e){var n=this,r=this.getViewsByPoint(e),o=[];return i.each(r,function(t){var n=t.get("geoms");i.each(n,function(t){var n=t.get("dataArray"),r=[];i.each(n,function(n){var i=t.findPoint(e,n);if(i){var o=t.getTipItems(i);r=r.concat(o)}}),o=o.concat(r)})}),o},n.destroy=function e(){this.emit("beforedestroy"),clearTimeout(this.get("resizeTimer"));var n=this.get("canvas"),r=this.get("wrapperEl");r.parentNode.removeChild(r),t.prototype.destroy.call(this),n.destroy(),window.removeEventListener("resize",i.getWrapBehavior(this,"_initForceFitEvent")),this.emit("afterdestroy")},e}(o);t.exports=g},function(t,e,n){t.exports={Scale:n(267),Coord:n(263),Axis:n(262),Guide:n(265),Legend:n(266),Tooltip:n(268),Event:n(264)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="list",n.cols=null,n},n.generateFacets=function t(e){var n=this,r,i=n.fields[0];if(!i)throw"Please specify for the field for facet!";var o=n.getFieldValues(i,e),a=o.length,s=n.cols||a,u=parseInt((a+s-1)/s),c=[];return o.forEach(function(t,r){var l=parseInt(r/s),f=r%s,h=[{field:i,value:t,values:o}],p=n.getFilter(h),d=e.filter(p),v={type:n.type,count:a,colValue:t,colField:i,rowField:null,rowValue:t,colIndex:f,rowIndex:l,cols:s,rows:u,data:d,region:n.getRegion(u,s,f,l)};c.push(v)}),c},n.setXAxis=function t(e,n,r){r.rowIndex!==r.rows-1&&r.cols*r.rowIndex+r.colIndex+1+r.cols<=r.count&&(n[e].label=null,n[e].title=null)},n.setYAxis=function t(e,n,r){0!==r.colIndex&&(n[e].title=null,n[e].label=null)},e}(n(43));t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="rect",n},n.generateFacets=function t(e){var n=this,r=n.fields,i=[],o=1,a=1,s=r[0],u=r[1],c=[""],l=[""];return s&&(c=n.getFieldValues(s,e),a=c.length),u&&(l=n.getFieldValues(u,e),o=l.length),c.forEach(function(t,r){l.forEach(function(f,h){var p=[{field:s,value:t,values:c},{field:u,value:f,values:l}],d=n.getFilter(p),v=e.filter(d),g={type:n.type,colValue:t,rowValue:f,colField:s,rowField:u,colIndex:r,rowIndex:h,cols:a,rows:o,data:v,region:n.getRegion(o,a,r,h)};i.push(g)})}),i},n.setXAxis=function t(e,n,r){r.rowIndex!==r.rows-1?(n[e].title=null,n[e].label=null):r.colIndex!==parseInt((r.cols-1)/2)&&(n[e].title=null)},n.setYAxis=function t(e,n,r){0!==r.colIndex?(n[e].title=null,n[e].label=null):r.rowIndex!==parseInt((r.rows-1)/2)&&(n[e].title=null)},n.renderTitle=function t(e,n){0===n.rowIndex&&this.drawColTitle(e,n),n.colIndex===n.cols-1&&this.drawRowTitle(e,n)},e}(n(43));t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(66),o=n(24),a=n(0),s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getPointRauis=function t(e,n){return o.getPointRadius(e,n)},n.getCirclePoint=function t(e,n,r){var i=this,o=this.get("coord"),a=o.getCenter(),s=this._isEmitLabels(),u=this.getPointRauis(o,r),c;if(0===u)return null;o.isTransposed&&u>n&&!s?e+=2*Math.asin(n/(2*u)):u+=n;return{x:a.x+u*Math.cos(e),y:a.y+u*Math.sin(e),angle:e,r:u}},n.getArcPoint=function t(e,n){var r=this,i;return n=n||0,i=a.isArray(e.x)||a.isArray(e.y)?{x:a.isArray(e.x)?e.x[n]:e.x,y:a.isArray(e.y)?e.y[n]:e.y}:e,this.transLabelPoint(i),i},n.getPointAngle=function t(e){var n=this,r=this.get("coord");return o.getPointAngle(r,e)},n.getMiddlePoint=function t(e){var n=this,r=this.get("coord"),i=e.length,o={x:0,y:0};return a.each(e,function(t){o.x+=t.x,o.y+=t.y}),o.x/=i,o.y/=i,o=r.convert(o)},n._isToMiddle=function t(e){return e.x.length>2},n.getLabelPoint=function t(e,n,r){var i=this,o=e.text[r],a=1,s;this._isToMiddle(n)?s=this.getMiddlePoint(n.points):(1===e.text.length&&0===r?r=1:0===r&&(a=-1),s=this.getArcPoint(n,r));var u=this.getDefaultOffset(e);u*=a;var c=this.getPointAngle(s),l=this.getCirclePoint(c,u,s);if(l?(l.text=o,l.angle=c,l.color=n.color):l={text:""},e.autoRotate||void 0===e.autoRotate){var f=l.textStyle?l.textStyle.rotate:null;f||(f=l.rotate||this.getLabelRotate(c,u,n)),l.rotate=f}return l.start={x:s.x,y:s.y},l},n._isEmitLabels=function t(){var e;return this.get("label").labelEmit},n.getLabelRotate=function t(e){var n=this,r;return r=180*e/Math.PI,r+=90,this._isEmitLabels()&&(r-=90),r&&(r>90?r-=180:r<-90&&(r+=180)),r/180*Math.PI},n.getLabelAlign=function t(e){var n=this,r=this.get("coord"),i;if(this._isEmitLabels())i=e.angle<=Math.PI/2&&e.angle>-Math.PI/2?"left":"right";else if(r.isTransposed){var o=r.getCenter(),a=this.getDefaultOffset(e);i=Math.abs(e.x-o.x)<1?"center":e.angle>Math.PI||e.angle<=0?a>0?"left":"right":a>0?"right":"left"}else i="center";return i},e}(i);t.exports=s},function(t,e,n){var r=n(0),i=n(5);t.exports={splitData:function t(e){var n=this.get("viewTheme")||i;if(!e.length)return[];var o=[],a=[],s,u=this.getYScale().field,c;return r.each(e,function(t){c=t._origin?t._origin[u]:t[u],n.connectNulls?r.isNil(c)||a.push(t):r.isArray(c)&&r.isNil(c[0])||r.isNil(c)?a.length&&(o.push(a),a=[]):a.push(t)}),a.length&&o.push(a),o}}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(8),a=n(119),s=n(0),u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,s.assign(i(i(n)),a),n}return e.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="path",n.shapeType="line",n},e.getDrawCfg=function e(n){var r=t.prototype.getDrawCfg.call(this,n);return r.isStack=this.hasStack(),r},e.draw=function t(e,n,r,i){var o=this,a=this.splitData(e),u=this.getDrawCfg(e[0]);o._applyViewThemeShapeStyle(u,u.shape,r),u.origin=e,s.each(a,function(t,e){if(!s.isEmpty(t)){u.splitedIndex=e,u.points=t;var a=r.drawShape(u.shape,u,n);o.appendShapeInfo(a,i+e)}})},n}(o);o.Path=u,t.exports=u},function(t,e){var n,r,i="#1890FF",o,a,s,u,c,l='"-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, "sans-serif"',f="g2-tooltip",h="g2-tooltip-title",p="g2-tooltip-list",d="g2-tooltip-list-item",v="g2-tooltip-marker",g="g2-tooltip-value",y="g2-legend",m="g2-legend-title",b="g2-legend-list",x="g2-legend-list-item",_="g2-legend-marker",w={defaultColor:"#1890FF",plotCfg:{padding:[20,20,95,80]},fontFamily:l,defaultLegendPosition:"bottom",colors:["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],colors_16:["#1890FF","#41D9C7","#2FC25B","#FACC14","#E6965C","#223273","#7564CC","#8543E0","#5C8EE6","#13C2C2","#5CA3E6","#3436C7","#B381E6","#F04864","#D598D9"],colors_24:["#1890FF","#66B5FF","#41D9C7","#2FC25B","#6EDB8F","#9AE65C","#FACC14","#E6965C","#57AD71","#223273","#738AE6","#7564CC","#8543E0","#A877ED","#5C8EE6","#13C2C2","#70E0E0","#5CA3E6","#3436C7","#8082FF","#DD81E6","#F04864","#FA7D92","#D598D9"],colors_pie:["#1890FF","#13C2C2","#2FC25B","#FACC14","#F04864","#8543E0","#3436C7","#223273"],colors_pie_16:["#1890FF","#73C9E6","#13C2C2","#6CD9B3","#2FC25B","#9DD96C","#FACC14","#E6965C","#F04864","#D66BCA","#8543E0","#8E77ED","#3436C7","#737EE6","#223273","#7EA2E6"],shapes:{point:["hollowCircle","hollowSquare","hollowDiamond","hollowBowtie","hollowTriangle","hollowHexagon","cross","tick","plus","hyphen","line"],line:["line","dash","dot"],area:["area"]},sizes:[1,10],opacities:[.1,.9],axis:{top:{position:"top",title:null,label:{offset:16,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:l},autoRotate:!0},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0}},bottom:{position:"bottom",title:null,label:{offset:16,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:l}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0}},left:{position:"left",title:null,label:{offset:8,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:l}},line:null,tickLine:null,grid:{zIndex:-1,lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},right:{position:"right",title:null,label:{offset:8,autoRotate:!0,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,textBaseline:"middle",fontFamily:l}},line:null,tickLine:null,grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},circle:{zIndex:1,title:null,label:{offset:8,textStyle:{fill:"#545454",fontSize:12,lineHeight:16,fontFamily:l}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0},grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},hideFirstLine:!0}},radius:{zIndex:0,label:{offset:12,textStyle:{fill:"#545454",fontSize:12,textBaseline:"middle",lineHeight:16,fontFamily:l}},line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,stroke:"#BFBFBF",length:4,alignWithLabel:!0},grid:{lineStyle:{stroke:"#E9E9E9",lineWidth:1,lineDash:[3,3]},type:"circle"}},helix:{grid:null,label:null,title:null,line:{lineWidth:1,stroke:"#BFBFBF"},tickLine:{lineWidth:1,length:4,stroke:"#BFBFBF",alignWithLabel:!0}}},label:{offset:20,textStyle:{fill:"#545454",fontSize:12,textBaseline:"middle",fontFamily:l}},treemapLabels:{offset:10,textStyle:{fill:"#fff",fontSize:12,textBaseline:"top",fontStyle:"bold",fontFamily:l}},innerLabels:{textStyle:{fill:"#fff",fontSize:12,textBaseline:"middle",fontFamily:l}},thetaLabels:{labelHeight:14,offset:30},legend:{right:{position:"right",layout:"vertical",itemMarginBottom:8,width:16,height:156,title:null,legendStyle:{LIST_CLASS:{textAlign:"left"}},textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:0,fontFamily:l},unCheckColor:"#bfbfbf"},left:{position:"left",layout:"vertical",itemMarginBottom:8,width:16,height:156,title:null,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:l},unCheckColor:"#bfbfbf"},top:{position:"top",offset:[0,6],layout:"horizontal",title:null,itemGap:10,width:156,height:16,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:l},unCheckColor:"#bfbfbf"},bottom:{position:"bottom",offset:[0,6],layout:"horizontal",title:null,itemGap:10,width:156,height:16,textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"start",textBaseline:"middle",lineHeight:20,fontFamily:l},unCheckColor:"#bfbfbf"},html:(n={},n["g2-legend"]={height:"auto",width:"auto",position:"absolute",overflow:"auto",fontSize:"12px",fontFamily:l,lineHeight:"20px",color:"#8C8C8C"},n["g2-legend-title"]={marginBottom:"4px"},n["g2-legend-list"]={listStyleType:"none",margin:0,padding:0},n["g2-legend-list-item"]={cursor:"pointer",marginBottom:"5px",marginRight:"24px"},n["g2-legend-marker"]={width:"9px",height:"9px",borderRadius:"50%",display:"inline-block",marginRight:"8px",verticalAlign:"middle"},n),gradient:{textStyle:{fill:"#8C8C8C",fontSize:12,textAlign:"center",textBaseline:"middle",lineHeight:20,fontFamily:l},lineStyle:{lineWidth:1,stroke:"#fff"},unCheckColor:"#bfbfbf"},margin:[0,5,24,5],legendMargin:24},tooltip:(r={useHtml:!0,crosshairs:!1,offset:15},r["g2-tooltip"]={position:"absolute",visibility:"hidden",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:l,lineHeight:"20px",padding:"10px 10px 6px 10px"},r["g2-tooltip-title"]={marginBottom:"4px"},r["g2-tooltip-list"]={margin:0,listStyleType:"none",padding:0},r["g2-tooltip-list-item"]={marginBottom:"4px"},r["g2-tooltip-marker"]={width:"5px",height:"5px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},r["g2-tooltip-value"]={display:"inline-block",float:"right",marginLeft:"30px"},r),tooltipMarker:{symbol:function t(e,n,r){return[["M",e,n],["m",-r,0],["a",r,r,0,1,0,2*r,0],["a",r,r,0,1,0,2*-r,0]]},stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffSetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,radius:4},tooltipCrosshairsRect:{type:"rect",rectStyle:{fill:"#CCD6EC",opacity:.3}},tooltipCrosshairsLine:{lineStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:1}},shape:{point:{lineWidth:1,fill:"#1890FF",radius:4},hollowPoint:{fill:"#fff",lineWidth:1,stroke:"#1890FF",radius:3},interval:{lineWidth:0,fill:"#1890FF",fillOpacity:.85},hollowInterval:{fill:"#fff",stroke:"#1890FF",fillOpacity:0,lineWidth:2},area:{lineWidth:0,fill:"#1890FF",fillOpacity:.6},polygon:{lineWidth:0,fill:"#1890FF",fillOpacity:1},hollowPolygon:{fill:"#fff",stroke:"#1890FF",fillOpacity:0,lineWidth:2},hollowArea:{fill:"#fff",stroke:"#1890FF",fillOpacity:0,lineWidth:2},line:{stroke:"#1890FF",lineWidth:2,fill:null},edge:{stroke:"#1890FF",lineWidth:1,fill:null},schema:{stroke:"#1890FF",lineWidth:1,fill:null}},guide:{line:{lineStyle:{stroke:"rgba(0, 0, 0, .65)",lineDash:[2,2],lineWidth:1},text:{position:"start",autoRotate:!0,style:{fill:"rgba(0, 0, 0, .45)",fontSize:12,textAlign:"start",fontFamily:l,textBaseline:"bottom"}}},text:{style:{fill:"rgba(0,0,0,.5)",fontSize:12,textBaseline:"middle",textAlign:"start",fontFamily:l}},region:{style:{lineWidth:0,fill:"#000",fillOpacity:.04}},html:{alignX:"middle",alignY:"middle"},dataRegion:{style:{region:{lineWidth:0,fill:"#000000",opacity:.04},text:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:"rgba(0, 0, 0, .65)"}}},dataMarker:{top:!0,style:{point:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2},line:{stroke:"#A3B1BF",lineWidth:1},text:{fill:"rgba(0, 0, 0, .65)",opacity:1,fontSize:12,textAlign:"start"}},display:{point:!0,line:!0,text:!0},lineLength:20,direction:"upward",autoAdjust:!0}},pixelRatio:null};t.exports=w},function(t,e,n){var r={default:n(121),dark:n(307)};t.exports=r},function(t,e,n){var r=n(1),i=n(310),o=n(313),a=n(309),s=n(98),u=function t(e){this._cfg={zIndex:0,capture:!0,visible:!0,destroyed:!1},r.assign(this._cfg,this.getDefaultCfg(),e),this.initAttrs(this._cfg.attrs),this._cfg.attrs={},this.initTransform(),this.init()};u.CFG={id:null,zIndex:0,canvas:null,parent:null,capture:!0,context:null,visible:!0,destroyed:!1},r.augment(u,i,o,s,a,{init:function t(){this.setSilent("animable",!0),this.setSilent("animating",!1)},getParent:function t(){return this._cfg.parent},getDefaultCfg:function t(){return{}},set:function t(e,n){return"zIndex"===e&&this._beforeSetZIndex&&this._beforeSetZIndex(n),"loading"===e&&this._beforeSetLoading&&this._beforeSetLoading(n),this._cfg[e]=n,this},setSilent:function t(e,n){this._cfg[e]=n},get:function t(e){return this._cfg[e]},show:function t(){return this._cfg.visible=!0,this},hide:function t(){return this._cfg.visible=!1,this},remove:function t(e,n){var i=this._cfg,o=i.parent,a=i.el;return o&&r.remove(o.get("children"),this),a&&(n?o&&o._cfg.tobeRemoved.push(a):a.parentNode.removeChild(a)),(e||void 0===e)&&this.destroy(),this},destroy:function t(){var e;this.get("destroyed")||(this._attrs=null,this.removeEvent(),this._cfg={destroyed:!0})},toFront:function t(){var e=this._cfg,n=e.parent;if(n){var r=n._cfg.children,i=e.el,o=r.indexOf(this);r.splice(o,1),r.push(this),i&&(i.parentNode.removeChild(i),e.el=null)}},toBack:function t(){var e=this._cfg,n=e.parent;if(n){var r=n._cfg.children,i=e.el,o=r.indexOf(this);if(r.splice(o,1),r.unshift(this),i){var a=i.parentNode;a.removeChild(i),a.insertBefore(i,a.firstChild)}}},_beforeSetZIndex:function t(e){var n=this._cfg.parent;this._cfg.zIndex=e,r.isNil(n)||n.sort();var i=this._cfg.el;if(i){var o=n._cfg.children,a=o.indexOf(this),s=i.parentNode;s.removeChild(i),a===o.length-1?s.appendChild(i):s.insertBefore(i,s.childNodes[a])}return e},_setAttrs:function t(e){return this.attr(e),e},setZIndex:function t(e){return this._cfg.zIndex=e,this._beforeSetZIndex(e)},clone:function t(){return r.clone(this)},getBBox:function t(){}}),t.exports=u},function(t,e,n){var r=n(1),i=n(123),o=n(327),a={},s="_INDEX";function u(t){return function(e,n){var r=t(e,n);return 0===r?e[s]-n[s]:r}}function c(t,e,n){for(var r,i=t.length-1;i>=0;i--){var o=t[i];if(o._cfg.visible&&o._cfg.capture&&(o.isGroup?r=o.getShape(e,n):o.isHit(e,n)&&(r=o)),r)break}return r}var l=function t(e){t.superclass.constructor.call(this,e),this.set("children",[]),this.set("tobeRemoved",[]),this._beforeRenderUI(),this._renderUI(),this._bindUI()};function f(t){if(!t._cfg&&t!==l){var e=t.superclass.constructor;e&&!e._cfg&&f(e),t._cfg={},r.merge(t._cfg,e._cfg),r.merge(t._cfg,t.CFG)}}r.extend(l,i),r.augment(l,{isGroup:!0,type:"group",canFill:!0,canStroke:!0,getDefaultCfg:function t(){return f(this.constructor),r.merge({},this.constructor._cfg)},_beforeRenderUI:function t(){},_renderUI:function t(){},_bindUI:function t(){},addShape:function t(e,n){var i=this.get("canvas");n=n||{};var s=a[e];if(s||(s=r.upperFirst(e),a[e]=s),n.attrs&&i){var u=n.attrs;if("text"===e){var c=i.get("fontFamily");c&&(u.fontFamily=u.fontFamily?u.fontFamily:c)}}n.canvas=i,n.type=e;var l=new o[s](n);return this.add(l),l},addGroup:function t(e,n){var i=this.get("canvas"),o;if(n=r.merge({},n),r.isFunction(e))n?(n.canvas=i,n.parent=this,o=new e(n)):o=new e({canvas:i,parent:this}),this.add(o);else if(r.isObject(e))e.canvas=i,o=new l(e),this.add(o);else{if(void 0!==e)return!1;o=new l,this.add(o)}return o},renderBack:function t(e,n){var i=this.get("backShape"),o=this.getBBox();return r.merge(n,{x:o.minX-e[3],y:o.minY-e[0],width:o.width+e[1]+e[3],height:o.height+e[0]+e[2]}),i?i.attr(n):i=this.addShape("rect",{zIndex:-1,attrs:n}),this.set("backShape",i),this.sort(),i},removeChild:function t(e,n){if(arguments.length>=2)this.contain(e)&&e.remove(n);else{if(1===arguments.length){if(!r.isBoolean(e))return this.contain(e)&&e.remove(!0),this;n=e}0===arguments.length&&(n=!0),l.superclass.remove.call(this,n)}return this},add:function t(e){var n=this,i=n.get("children");if(r.isArray(e))r.each(e,function(t){var e=t.get("parent");e&&e.removeChild(t,!1),n._setCfgProperty(t)}),n._cfg.children=i.concat(e);else{var o=e,a=o.get("parent");a&&a.removeChild(o,!1),n._setCfgProperty(o),i.push(o)}return n},_setCfgProperty:function t(e){var n=this._cfg;e.set("parent",this),e.set("canvas",n.canvas),n.timeline&&e.set("timeline",n.timeline)},contain:function t(e){var n;return this.get("children").indexOf(e)>-1},getChildByIndex:function t(e){var n;return this.get("children")[e]},getFirst:function t(){return this.getChildByIndex(0)},getLast:function t(){var e=this.get("children").length-1;return this.getChildByIndex(e)},getBBox:function t(){var e=this,n=1/0,i=-1/0,o=1/0,a=-1/0,s=this.get("children");s.length>0?r.each(s,function(t){if(t.get("visible")){if(t.isGroup&&0===t.get("children").length)return;var e=t.getBBox();if(!e)return!0;var r=[e.minX,e.minY,1],s=[e.minX,e.maxY,1],u=[e.maxX,e.minY,1],c=[e.maxX,e.maxY,1];t.apply(r),t.apply(s),t.apply(u),t.apply(c);var l=Math.min(r[0],s[0],u[0],c[0]),f=Math.max(r[0],s[0],u[0],c[0]),h=Math.min(r[1],s[1],u[1],c[1]),p=Math.max(r[1],s[1],u[1],c[1]);li&&(i=f),ha&&(a=p)}}):(n=0,i=0,o=0,a=0);var u={minX:n,minY:o,maxX:i,maxY:a};return u.x=u.minX,u.y=u.minY,u.width=u.maxX-u.minX,u.height=u.maxY-u.minY,u},getCount:function t(){return this.get("children").length},sort:function t(){var e=this.get("children");return r.each(e,function(t,e){return t[s]=e,t}),e.sort(u(function(t,e){return t.get("zIndex")-e.get("zIndex")})),this},findById:function t(e){return this.find(function(t){return t.get("id")===e})},find:function t(e){if(r.isString(e))return this.findById(e);var n=this.get("children"),i=null;return r.each(n,function(t){if(e(t)?i=t:t.find&&(i=t.find(e)),i)return!1}),i},findAll:function t(e){var n=this.get("children"),i=[],o=[];return r.each(n,function(t){e(t)&&i.push(t),t.findAllBy&&(o=t.findAllBy(e),i=i.concat(o))}),i},findBy:function t(e){var n=this.get("children"),i=null;return r.each(n,function(t){if(e(t)?i=t:t.findBy&&(i=t.findBy(e)),i)return!1}),i},findAllBy:function t(e){var n=this.get("children"),i=[],o=[];return r.each(n,function(t){e(t)&&i.push(t),t.findAllBy&&(o=t.findAllBy(e),i=i.concat(o))}),i},getShape:function t(e,n){var r=this,i=this._attrs.clip,o=this._cfg.children,a;if(i){var s=[e,n,1];i.invert(s,this.get("canvas")),i.isPointInPath(s[0],s[1])&&(a=c(o,e,n))}else a=c(o,e,n);return a},clearTotalMatrix:function t(){var e;if(this.get("totalMatrix")){this.setSilent("totalMatrix",null);for(var n=this._cfg.children,r=0;r=0;r--)n[r].remove(!0,e);return this._cfg.children=[],this},destroy:function t(){this.get("destroyed")||(this.clear(),l.superclass.destroy.call(this))},clone:function t(){var e=this,n=this._cfg.children,t=new l;return r.each(n,function(e){t.add(e.clone())}),t}}),t.exports=l},function(t,e,n){var r=n(1),i=function t(e,n,r,i){this.type=e,this.target=null,this.currentTarget=null,this.bubbles=r,this.cancelable=i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.removed=!1,this.event=n};r.augment(i,{preventDefault:function t(){this.defaultPrevented=this.cancelable&&!0},stopPropagation:function t(){this.propagationStopped=!0},remove:function t(){this.remove=!0},clone:function t(){return r.clone(this)},toString:function t(){return"[Event (type="+this.type+")]"}}),t.exports=i},function(t,e,n){var r=n(1),i=n(7),o=n(44),a=n(46);function s(t,e,n){return t+e*Math.cos(n)}function u(t,e,n){return t+e*Math.sin(n)}var c=function t(e){t.superclass.constructor.call(this,e)};c.ATTRS={x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(c,i),r.augment(c,{canStroke:!0,type:"arc",getDefaultAttrs:function t(){return{x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.r,a=e.startAngle,s=e.endAngle,u=e.clockwise,c,l=this.getHitLineWidth()/2,f=o.box(n,r,i,a,s,u);return f.minX-=l,f.minY-=l,f.maxX+=l,f.maxY+=l,f},getStartTangent:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.startAngle,o=e.r,a=e.clockwise,c=Math.PI/180;a&&(c*=-1);var l=[],f=s(n,o,i+c),h=u(r,o,i+c),p=s(n,o,i),d=u(r,o,i);return l.push([f,h]),l.push([p,d]),l},getEndTangent:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.endAngle,o=e.r,a=e.clockwise,c=Math.PI/180,l=[];a&&(c*=-1);var f=s(n,o,i+c),h=u(r,o,i+c),p=s(n,o,i),d=u(r,o,i);return l.push([p,d]),l.push([f,h]),l},createPath:function t(e){var n=this._attrs,r=n.x,i=n.y,o=n.r,a=n.startAngle,s=n.endAngle,u=n.clockwise;(e=e||self.get("context")).beginPath(),e.arc(r,i,o,a,s,u)},afterPath:function t(e){var n=this._attrs;if(e=e||this.get("context"),n.startArrow){var r=this.getStartTangent();a.addStartArrow(e,n,r[0][0],r[0][1],r[1][0],r[1][1])}if(n.endArrow){var i=this.getEndTangent();a.addEndArrow(e,n,i[0][0],i[0][1],i[1][0],i[1][1])}}}),t.exports=c},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,r:0,lineWidth:1},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"circle",getDefaultAttrs:function t(){return{lineWidth:1}},calculateBox:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.r,o,a=this.getHitLineWidth()/2+i;return{minX:n-a,minY:r-a,maxX:n+a,maxY:r+a}},createPath:function t(e){var n=this._attrs,r=n.x,i=n.y,o=n.r;e.beginPath(),e.arc(r,i,o,0,2*Math.PI,!1),e.closePath()}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"dom",calculateBox:function t(){var e=this,n=this._attrs,r=n.x,i=n.y,o=n.width,a=n.height,s,u=this.getHitLineWidth()/2;return{minX:r-u,minY:i-u,maxX:r+o+u,maxY:i+a+u}}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,rx:1,ry:1,lineWidth:1},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"ellipse",getDefaultAttrs:function t(){return{lineWidth:1}},calculateBox:function t(){var e=this._attrs,n=e.x,r=e.y,i=e.rx,o=e.ry,a=this.getHitLineWidth(),s=i+a/2,u=o+a/2;return{minX:n-s,minY:r-u,maxX:n+s,maxY:r+u}},createPath:function t(e){var n=this._attrs,i=n.x,o=n.y,a=n.rx,s=n.ry;e=e||self.get("context");var u=a>s?a:s,c=a>s?1:a/s,l=a>s?s/a:1,f=[1,0,0,0,1,0,0,0,1];r.mat3.scale(f,f,[c,l]),r.mat3.translate(f,f,[i,o]),e.beginPath(),e.save(),e.transform(f[0],f[1],f[3],f[4],f[6],f[7]),e.arc(0,0,u,0,2*Math.PI),e.restore(),e.closePath()}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=n(44),a=function t(e){t.superclass.constructor.call(this,e)};a.ATTRS={x:0,y:0,rs:0,re:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1},r.extend(a,i),r.augment(a,{canFill:!0,canStroke:!0,type:"fan",getDefaultAttrs:function t(){return{clockwise:!1,lineWidth:1,rs:0,re:0}},calculateBox:function t(){var e=this,n=this._attrs,r=n.x,i=n.y,a=n.rs,s=n.re,u=n.startAngle,c=n.endAngle,l=n.clockwise,f=this.getHitLineWidth(),h=o.box(r,i,a,u,c,l),p=o.box(r,i,s,u,c,l),d,v,g,y,m=f/2;return{minX:Math.min(h.minX,p.minX)-m,minY:Math.min(h.minY,p.minY)-m,maxX:Math.max(h.maxX,p.maxX)+m,maxY:Math.max(h.maxY,p.maxY)+m}},createPath:function t(e){var n=this._attrs,r=n.x,i=n.y,o=n.rs,a=n.re,s=n.startAngle,u=n.endAngle,c=n.clockwise,l={x:Math.cos(s)*o+r,y:Math.sin(s)*o+i},f={x:Math.cos(s)*a+r,y:Math.sin(s)*a+i},h={x:Math.cos(u)*o+r,y:Math.sin(u)*o+i};(e=e||self.get("context")).beginPath(),e.moveTo(l.x,l.y),e.lineTo(f.x,f.y),e.arc(r,i,a,s,u,c),e.lineTo(h.x,h.y),e.arc(r,i,o,u,s,!c),e.closePath()}}),t.exports=a},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,img:void 0,width:0,height:0,sx:null,sy:null,swidth:null,sheight:null},r.extend(o,i),r.augment(o,{type:"image",isHitBox:function t(){return!1},calculateBox:function t(){var e=this._attrs;this._cfg.attrs&&this._cfg.attrs.img===e.img||this._setAttrImg();var n=e.x,r=e.y,i,o;return{minX:n,minY:r,maxX:n+e.width,maxY:r+e.height}},_beforeSetLoading:function t(e){var n=this.get("canvas");return!1===e&&!0===this.get("toDraw")&&(this._cfg.loading=!1,n.draw()),e},_setAttrImg:function t(){var e=this,n=e._attrs,i=n.img;if(!r.isString(i))return i instanceof Image?(n.width||e.attr("width",i.width),n.height||e.attr("height",i.height),i):i instanceof HTMLElement&&r.isString(i.nodeName)&&"CANVAS"===i.nodeName.toUpperCase()?(n.width||e.attr("width",Number(i.getAttribute("width"))),n.height||e.attr("height",Number(i.getAttribute("height"))),i):i instanceof ImageData?(n.width||e.attr("width",i.width),n.height||e.attr("height",i.height),i):null;var o=new Image;o.onload=function(){if(e.get("destroyed"))return!1;e.attr("imgSrc",i),e.attr("img",o);var t=e.get("callback");t&&t.call(e),e.set("loading",!1)},o.src=i,o.crossOrigin="Anonymous",e.set("loading",!0)},drawInner:function t(e){this._cfg.hasUpdate&&this._setAttrImg(),this.get("loading")?this.set("toDraw",!0):(this._drawImage(e),this._cfg.hasUpdate=!1)},_drawImage:function t(e){var n=this._attrs,i=n.x,o=n.y,a=n.img,s=n.width,u=n.height,c=n.sx,l=n.sy,f=n.swidth,h=n.sheight;this.set("toDraw",!1);var p=a;if(p instanceof ImageData&&((p=new Image).src=a),p instanceof Image||p instanceof HTMLElement&&r.isString(p.nodeName)&&"CANVAS"===p.nodeName.toUpperCase()){if(r.isNil(c)||r.isNil(l)||r.isNil(f)||r.isNil(h))return void e.drawImage(p,i,o,s,u);if(!(r.isNil(c)||r.isNil(l)||r.isNil(f)||r.isNil(h)))return void e.drawImage(p,c,l,f,h,i,o,s,u)}}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=n(46),a=n(45),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={x1:0,y1:0,x2:0,y2:0,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(s,i),r.augment(s,{canStroke:!0,type:"line",getDefaultAttrs:function t(){return{lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function t(){var e=this._attrs,n=e.x1,r=e.y1,i=e.x2,o=e.y2,s=this.getHitLineWidth();return a.box(n,r,i,o,s)},createPath:function t(e){var n=this._attrs,r=n.x1,i=n.y1,o=n.x2,a=n.y2;(e=e||self.get("context")).beginPath(),e.moveTo(r,i),e.lineTo(o,a)},afterPath:function t(e){var n=this._attrs,r=n.x1,i=n.y1,a=n.x2,s=n.y2;e=e||this.get("context"),n.startArrow&&o.addStartArrow(e,n,a,s,r,i),n.endArrow&&o.addEndArrow(e,n,r,i,a,s)},getPoint:function t(e){var n=this._attrs;return{x:a.at(n.x1,n.x2,e),y:a.at(n.y1,n.y2,e)}}}),t.exports=s},function(t,e){t.exports={xAt:function t(e,n,r,i,o){return n*Math.cos(e)*Math.cos(o)-r*Math.sin(e)*Math.sin(o)+i},yAt:function t(e,n,r,i,o){return n*Math.sin(e)*Math.cos(o)+r*Math.cos(e)*Math.sin(o)+i},xExtrema:function t(e,n,r){return Math.atan(-r/n*Math.tan(e))},yExtrema:function t(e,n,r){return Math.atan(r/(n*Math.tan(e)))}}},function(t,e,n){var r=n(1),i=r.vec2;function o(t,e,n,r){var i=1-r;return i*(i*t+2*r*e)+r*r*n}function a(t,e,n,r,a,s,u,c,l){var f,h=.005,p=1/0,d,v,g,y,m,b,x=1e-4,_=[u,c];for(y=0;y<1;y+=.05)v=[o(t,n,a,y),o(e,r,s,y)],(d=i.squaredDistance(_,v))=0&&d=0?[o]:[]}t.exports={at:o,projectPoint:function t(e,n,r,i,o,s,u,c){var l={};return a(e,n,r,i,o,s,u,c,l),l},pointDistance:a,extrema:s}},function(t,e,n){var r=n(1),i=n(7),o=n(47),a=n(36),s=n(46),u=n(71),c=n(69),l=function t(e){t.superclass.constructor.call(this,e)};l.ATTRS={path:null,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(l,i),r.augment(l,{canFill:!0,canStroke:!0,type:"path",getDefaultAttrs:function t(){return{lineWidth:1,startArrow:!1,endArrow:!1}},_afterSetAttrPath:function t(e){var n=this;if(r.isNil(e))return this.setSilent("segments",null),void this.setSilent("box",void 0);var i=a.parsePath(e),s,u=[];if(r.isArray(i)&&0!==i.length&&("M"===i[0][0]||"m"===i[0][0])){for(var c=i.length,l=0;la&&(a=e.maxX),e.minYu&&(u=e.maxY))}),o===1/0||s===1/0?{minX:0,minY:0,maxX:0,maxY:0}:{minX:o,minY:s,maxX:a,maxY:u}},_setTcache:function t(){var e=0,n=0,i=[],o,a,s,u,l=this._cfg.curve;l&&(r.each(l,function(t,n){s=l[n+1],u=t.length,s&&(e+=c.len(t[u-2],t[u-1],s[1],s[2],s[3],s[4],s[5],s[6]))}),r.each(l,function(t,r){s=l[r+1],u=t.length,s&&((o=[])[0]=n/e,a=c.len(t[u-2],t[u-1],s[1],s[2],s[3],s[4],s[5],s[6]),n+=a,o[1]=n/e,i.push(o))}),this._cfg.tCache=i)},_calculateCurve:function t(){var e=this,n,r=this._attrs.path;this._cfg.curve=u.pathTocurve(r)},getStartTangent:function t(){var e=this.get("segments"),n,i,o,a;if(e.length>1)if(n=e[0].endPoint,i=e[1].endPoint,o=e[1].startTangent,a=[],r.isFunction(o)){var s=o();a.push([n.x-s[0],n.y-s[1]]),a.push([n.x,n.y])}else a.push([i.x,i.y]),a.push([n.x,n.y]);return a},getEndTangent:function t(){var e=this.get("segments"),n=e.length,i,o,a,s;if(n>1)if(i=e[n-2].endPoint,o=e[n-1].endPoint,a=e[n-1].endTangent,s=[],r.isFunction(a)){var u=a();s.push([o.x-u[0],o.y-u[1]]),s.push([o.x,o.y])}else s.push([i.x,i.y]),s.push([o.x,o.y]);return s},getPoint:function t(e){var n=this._cfg.tCache,i,o;n||(this._calculateCurve(),this._setTcache(),n=this._cfg.tCache);var a=this._cfg.curve;if(!n)return a?{x:a[0][1],y:a[0][2]}:null;r.each(n,function(t,n){e>=t[0]&&e<=t[1]&&(i=(e-t[0])/(t[1]-t[0]),o=n)});var s=a[o];if(r.isNil(s)||r.isNil(o))return null;var u=s.length,l=a[o+1];return{x:c.at(s[u-2],l[1],l[3],l[5],1-i),y:c.at(s[u-1],l[2],l[4],l[6],1-i)}},createPath:function t(e){var n=this,i=this.get("segments");if(r.isArray(i)){(e=e||this.get("context")).beginPath();for(var o=i.length,a=0;au&&(u=e),nc&&(c=n)});var l=o/2;return{minX:a-l,minY:s-l,maxX:u+l,maxY:c+l}},createPath:function t(e){var n=this,i,o=this._attrs.points;o.length<2||((e=e||this.get("context")).beginPath(),r.each(o,function(t,n){0===n?e.moveTo(t[0],t[1]):e.lineTo(t[0],t[1])}),e.closePath())}}),t.exports=o},function(t,e,n){var r=n(1),i=n(7),o=n(46),a=n(45),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={points:null,lineWidth:1,startArrow:!1,endArrow:!1,tCache:null},r.extend(s,i),r.augment(s,{canStroke:!0,type:"polyline",tCache:null,getDefaultAttrs:function t(){return{lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function t(){var e=this,n=this._attrs,i=this.getHitLineWidth(),o=n.points;if(!o||0===o.length)return null;var a=1/0,s=1/0,u=-1/0,c=-1/0;r.each(o,function(t){var e=t[0],n=t[1];eu&&(u=e),nc&&(c=n)});var l=i/2;return{minX:a-l,minY:s-l,maxX:u+l,maxY:c+l}},_setTcache:function t(){var e=this,n,i=this._attrs.points,o=0,s=0,u=[],c,l;i&&0!==i.length&&(r.each(i,function(t,e){i[e+1]&&(o+=a.len(t[0],t[1],i[e+1][0],i[e+1][1]))}),o<=0||(r.each(i,function(t,e){i[e+1]&&((c=[])[0]=s/o,l=a.len(t[0],t[1],i[e+1][0],i[e+1][1]),s+=l,c[1]=s/o,u.push(c))}),this.tCache=u))},createPath:function t(e){var n=this,r,i=this._attrs.points,o,a;if(!(i.length<2)){for((e=e||this.get("context")).beginPath(),e.moveTo(i[0][0],i[0][1]),a=1,o=i.length-1;a=t[0]&&e<=t[1]&&(s=(e-t[0])/(t[1]-t[0]),u=n)}),{x:a.at(i[u][0],i[u+1][0],s),y:a.at(i[u][1],i[u+1][1],s)}}}),t.exports=s},function(t,e,n){var r=n(1),i,o=n(36).parseRadius,a=n(7),s=function t(e){t.superclass.constructor.call(this,e)};s.ATTRS={x:0,y:0,width:0,height:0,radius:0,lineWidth:1},r.extend(s,a),r.augment(s,{canFill:!0,canStroke:!0,type:"rect",getDefaultAttrs:function t(){return{lineWidth:1,radius:0}},calculateBox:function t(){var e=this,n=this._attrs,r=n.x,i=n.y,o=n.width,a=n.height,s,u=this.getHitLineWidth()/2;return{minX:r-u,minY:i-u,maxX:r+o+u,maxY:i+a+u}},createPath:function t(e){var n=this,r=this._attrs,i=r.x,a=r.y,s=r.width,u=r.height,c=r.radius;if((e=e||this.get("context")).beginPath(),0===c)e.rect(i,a,s,u);else{var l=o(c);e.moveTo(i+l.r1,a),e.lineTo(i+s-l.r2,a),0!==l.r2&&e.arc(i+s-l.r2,a+l.r2,l.r2,-Math.PI/2,0),e.lineTo(i+s,a+u-l.r3),0!==l.r3&&e.arc(i+s-l.r3,a+u-l.r3,l.r3,0,Math.PI/2),e.lineTo(i+l.r4,a+u),0!==l.r4&&e.arc(i+l.r4,a+u-l.r4,l.r4,Math.PI/2,Math.PI),e.lineTo(i,a+l.r1),0!==l.r1&&e.arc(i+l.r1,a+l.r1,l.r1,Math.PI,1.5*Math.PI),e.closePath()}}}),t.exports=s},function(t,e,n){var r=n(1),i=n(7),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom",lineHeight:null,textArr:null},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"text",getDefaultAttrs:function t(){return{lineWidth:1,lineCount:1,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"}},initTransform:function t(){var e=this._attrs.fontSize;e&&+e<12&&this.transform([["t",-1*this._attrs.x,-1*this._attrs.y],["s",+e/12,+e/12],["t",this._attrs.x,this._attrs.y]])},_assembleFont:function t(){var e=this._attrs,n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;e.font=[o,a,i,n+"px",r].join(" ")},_setAttrText:function t(){var e=this._attrs,n=e.text,i=null;if(r.isString(n)&&-1!==n.indexOf("\n")){var o=(i=n.split("\n")).length;e.lineCount=o}e.textArr=i},_getTextHeight:function t(){var e=this._attrs,n=e.lineCount,r=1*e.fontSize,i;return n>1?r*n+this._getSpaceingY()*(n-1):r},isHitBox:function t(){return!1},calculateBox:function t(){var e=this,n=this._attrs,r=this._cfg;r.attrs&&!r.hasUpdate||(this._assembleFont(),this._setAttrText()),n.textArr||this._setAttrText();var i=n.x,o=n.y,a=this.measureText();if(!a)return{minX:i,minY:o,maxX:i,maxY:o};var s=this._getTextHeight(),u=n.textAlign,c=n.textBaseline,l=this.getHitLineWidth(),f={x:i,y:o-s};u&&("end"===u||"right"===u?f.x-=a:"center"===u&&(f.x-=a/2)),c&&("top"===c?f.y+=s:"middle"===c&&(f.y+=s/2)),this.set("startPoint",f);var h=l/2;return{minX:f.x-h,minY:f.y-h,maxX:f.x+a+h,maxY:f.y+s+h}},_getSpaceingY:function t(){var e=this._attrs,n=e.lineHeight,r=1*e.fontSize;return n?n-r:.14*r},drawInner:function t(e){var n=this,i=this._attrs,o=this._cfg;o.attrs&&!o.hasUpdate||(this._assembleFont(),this._setAttrText()),e.font=i.font;var a=i.text;if(a){var s=i.textArr,u=i.x,c=i.y;if(e.beginPath(),this.hasStroke()){var l=i.strokeOpacity;r.isNil(l)||1===l||(e.globalAlpha=l),s?this._drawTextArr(e,!1):e.strokeText(a,u,c),e.globalAlpha=1}if(this.hasFill()){var f=i.fillOpacity;r.isNil(f)||1===f||(e.globalAlpha=f),s?this._drawTextArr(e,!0):e.fillText(a,u,c)}o.hasUpdate=!1}},_drawTextArr:function t(e,n){var i=this._attrs.textArr,o=this._attrs.textBaseline,a=1*this._attrs.fontSize,s=this._getSpaceingY(),u=this._attrs.x,c=this._attrs.y,l=this.getBBox(),f=l.maxY-l.minY,h;r.each(i,function(t,r){h=c+r*(s+a)-f+a,"middle"===o&&(h+=f-a-(f-a)/2),"top"===o&&(h+=f-a),n?e.fillText(t,u,h):e.strokeText(t,u,h)})},measureText:function t(){var e=this,n=this._attrs,i=n.text,o=n.font,a=n.textArr,s,u=0;if(!r.isNil(i)){var c=document.createElement("canvas").getContext("2d");return c.save(),c.font=o,a?r.each(a,function(t){s=c.measureText(t).width,u0&&t%n!=0;n--);if(1===n)for(n=e;n>0&&(t-1)%n!=0;n--);return n}t.exports=function(t){var e={},n=[],r=t.isRounding,i=a(t.data),o=i.length,u=t.maxCount||8,c;if(r?2===(c=s(o-1,u-1)+1)?c=u:cn&&(e=parseFloat(e.toFixed(r)))}else for(;t>10;)e*=10,t/=10;return e}function i(t,e){var n=t.length;if(0===n)return NaN;var r=t[0];if(e=t[n-1])return t[n-1];for(var i=1;it[n-1])return NaN;if(en&&(c=e/parseInt(1/s)*(s>0?1:-1));return c},snapMultiple:function t(e,n,r){var i;return(i="ceil"===r?Math.ceil(e/n):"floor"===r?Math.floor(e/n):Math.round(e/n))*n},snapTo:function t(e,n){var r=i(e,n),a=o(e,n);if(isNaN(r)||isNaN(a)){if(e[0]>=n)return e[0];var s=e[e.length-1];if(s<=n)return s}return Math.abs(n-r)20&&(o=20),parseFloat(e.toFixed(o))}};t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(26),o=n(141),a=n(2),s=n(11),u=n(14),c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function e(){t.prototype._initDefaultCfg.call(this),this.type="cat",this.isCategory=!0,this.isRounding=!0},n.init=function t(){var e=this,n=this.values,r=this.tickCount;if(a(n,function(t,e){n[e]=t.toString()}),!this.ticks){var i=n,s;if(r)i=o({maxCount:r,data:n,isRounding:this.isRounding}).ticks;this.ticks=i}},n.getText=function e(n){return-1===this.values.indexOf(n)&&s(n)&&(n=this.values[Math.round(n)]),t.prototype.getText.call(this,n)},n.translate=function t(e){var n=this.values.indexOf(e);return-1===n&&s(e)?n=e:-1===n&&(n=NaN),n},n.scale=function t(e){var n=this.rangeMin(),r=this.rangeMax(),i;return(u(e)||-1!==this.values.indexOf(e))&&(e=this.translate(e)),n+(i=this.values.length>1?e/(this.values.length-1):e)*(r-n)},n.invert=function t(e){if(u(e))return e;var n=this.rangeMin(),r=this.rangeMax();er&&(e=r);var i=(e-n)/(r-n),o=Math.round(i*(this.values.length-1))%this.values.length;return o=o||0,this.values[o]},e}(i);i.Cat=c,t.exports=c},function(t,e,n){var r=n(178),i=n(26);i.Linear=n(48),i.Identity=n(333),i.Cat=n(143),i.Time=n(337),i.TimeCat=n(336),i.Log=n(334),i.Pow=n(335);var o=function t(e){if(i.hasOwnProperty(e)){var n=r(e);i[n]=function(t){return new i[e](t)}}};for(var a in i)o(a);var s=["cat","timeCat"];i.isCategory=function(t){return s.indexOf(t)>=0},t.exports=i},function(t,e,n){var r=n(14),i=n(183);t.exports={toTimeStamp:function t(e){return r(e)&&(e=e.indexOf("T")>0?new Date(e).getTime():new Date(e.replace(/-/gi,"/")).getTime()),i(e)&&(e=e.getTime()),e}}},function(t,e,n){var r=n(20),i=Array.prototype.splice,o=function t(e,n){if(!r(e))return[];for(var o=e?n.length:0,a=o-1;o--;){var s=void 0,u=n[o];o!==a&&u===s||(s=u,i.call(e,u,1))}return e};t.exports=o},function(t,e){var n=Array.prototype,r=n.splice,i=n.indexOf,o=n.slice,a=function t(e){for(var n=o.call(arguments,1),a=0;a-1;)r.call(e,u,1);return e};t.exports=a},function(t,e,n){var r=n(2),i=n(49),o=function t(e){var n=[];return r(e,function(t){i(n,t)||n.push(t)}),n};t.exports=o},function(t,e,n){var r=n(13),i=n(53),o=n(10),a=function t(e){for(var n=i(arguments),a=1;a]*>/,o={tr:document.createElement("tbody"),tbody:n,thead:n,tfoot:n,td:r,th:r,"*":document.createElement("div")};t.exports=function t(e){var n=i.test(e)&&RegExp.$1;n in o||(n="*");var r=o[n];e=e.replace(/(^\s*)|(\s*$)/g,""),r.innerHTML=""+e;var a=r.childNodes[0];return r.removeChild(a),a}},function(t,e){t.exports=function t(e,n){if(e)for(var r in n)n.hasOwnProperty(r)&&(e.style[r]=n[r]);return e}},function(t,e){t.exports=function t(e){var n;return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)})(e)}},function(t,e,n){var r=n(13),i=n(10),o=function t(e,n,o,a){r(n)||(o=n,n=e,e=function t(){});var s=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},u=s(n.prototype,e);return e.prototype=i(u,e.prototype),e.superclass=s(n.prototype,n),i(u,o),i(e,a),e};t.exports=o},function(t,e,n){var r=n(2),i=n(4),o=Object.prototype.hasOwnProperty,a=function t(e,n){if(!n||!i(e))return e;var a={},s=null;return r(e,function(t){s=n(t),o.call(a,s)?a[s].push(t):a[s]=[t]}),a};t.exports=a},function(t,e,n){var r=n(13),i=n(4),o=n(154),a=function t(e,n){if(!n)return{0:e};if(!r(n)){var a=i(n)?n:n.replace(/\s+/g,"").split("*");n=function t(e){for(var n="_",r=0,i=a.length;rs&&(a=t,s=u)}),a}};t.exports=a},function(t,e){var n=function t(e,n){return(e%n+n)%n};t.exports=n},function(t,e){var n=180/Math.PI,r=function t(e){return n*e};t.exports=r},function(t,e){t.exports=parseInt},function(t,e){var n=Math.PI/180,r=function t(e){return n*e};t.exports=r},function(t,e,n){var r=n(74),i=n(2),o=n(79);t.exports=function t(e,n){return e=r(e),i(n,function(t){switch(t[0]){case"t":o.translate(e,e,[t[1],t[2]]);break;case"s":o.scale(e,e,[t[1],t[2]]);break;case"r":o.rotate(e,e,t[1]);break;case"m":o.multiply(e,e,t[1]);break;default:return!1}}),e}},function(t,e,n){var r=n(329),i=n(78);r.angle=function(t,e){var n=r.dot(t,e)/(r.length(t)*r.length(e));return Math.acos(i(n,-1,1))},r.direction=function(t,e){return t[0]*e[1]-e[0]*t[1]},r.angleTo=function(t,e,n){var i=r.angle(t,e),o=r.direction(t,e)>=0;return n?o?2*Math.PI-i:i:o?i:2*Math.PI-i},r.vertical=function(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t},t.exports=r},function(t,e,n){var r=n(330);t.exports=r},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,n){var r=n(169),i=n(6);function o(t,e){var n=r(e),o=n.length;if(i(t))return!o;for(var a=0;ai;i+=2){var a=[{x:+e[i-2],y:+e[i-1]},{x:+e[i],y:+e[i+1]},{x:+e[i+2],y:+e[i+3]},{x:+e[i+4],y:+e[i+5]}];n?i?o-4===i?a[3]={x:+e[0],y:+e[1]}:o-2===i&&(a[2]={x:+e[0],y:+e[1]},a[3]={x:+e[2],y:+e[3]}):a[0]={x:+e[o-2],y:+e[o-1]}:o-4===i?a[3]=a[2]:i||(a[0]={x:+e[i],y:+e[i+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r}},function(t,e){var n=/,?([a-z]),?/gi;t.exports=function t(e){return e.join(",").replace(n,"$1")}},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",i=new RegExp("([a-z])["+r+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+r+"]*,?["+r+"]*)+)","ig"),o=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+r+"]*,?["+r+"]*","ig");t.exports=function t(e){if(!e)return null;if((void 0===e?"undefined":n(e))===n([]))return e;var r={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},a=[];return String(e).replace(i,function(t,e,n){var i=[],s=e.toLowerCase();if(n.replace(o,function(t,e){e&&i.push(+e)}),"m"===s&&i.length>2&&(a.push([e].concat(i.splice(0,2))),s="l",e="m"===e?"l":"L"),"o"===s&&1===i.length&&a.push([e,i[0]]),"r"===s)a.push([e].concat(i));else for(;i.length>=r[s]&&(a.push([e].concat(i.splice(0,r[s]))),r[s]););}),a}},function(t,e,n){var r=n(173),i=n(171);function o(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),u=t+n*Math.cos(-i*a),c,l;o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,u,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o}t.exports=function t(e){if(!(e=r(e))||!e.length)return[["M",0,0]];var n=[],a=0,s=0,u=0,c=0,l=0,f=void 0,h=void 0;"M"===e[0][0]&&(u=a=+e[0][1],c=s=+e[0][2],l++,n[0]=["M",a,s]);for(var p=3===e.length&&"M"===e[0][0]&&"R"===e[1][0].toUpperCase()&&"Z"===e[2][0].toUpperCase(),d,v,g=l,y=e.length;g1&&(r*=w=Math.sqrt(w),i*=w);var O=r*r,j=i*i,S=(a===s?-1:1)*Math.sqrt(Math.abs((O*j-O*_*_-j*x*x)/(O*_*_+j*x*x)));y=S*r*_/i+(e+u)/2,m=S*-i*x/r+(n+c)/2,v=Math.asin(((n-m)/i).toFixed(9)),g=Math.asin(((c-m)/i).toFixed(9)),v=eg&&(v-=2*Math.PI),!s&&g>v&&(g-=2*Math.PI)}var E=g-v;if(Math.abs(E)>f){var M=g,C=u,P=c;g=v+f*(s&&g>v?1:-1),p=t(u=y+r*Math.cos(g),c=m+i*Math.sin(g),r,i,o,0,s,C,P,[g,M,y,m])}E=g-v;var k=Math.cos(v),T=Math.sin(v),A=Math.cos(g),I=Math.sin(g),L=Math.tan(E/4),N=4/3*r*L,D=4/3*i*L,R=[e,n],F=[e+N*T,n-D*k],z=[u+N*I,c-D*A],B=[u,c];if(F[0]=2*R[0]-F[0],F[1]=2*R[1]-F[1],l)return[F,z,B].concat(p);for(var Y=[],V=0,W=(p=[F,z,B].concat(p).join().split(",")).length;V7){e[n].shift();for(var r=e[n];r.length;)f[n]="A",u&&(h[n]="A"),e.splice(n++,0,["C"].concat(r.splice(0,6)));e.splice(n,1),v=Math.max(s.length,u&&u.length||0)}},m=function t(e,n,r,i,o){e&&n&&"M"===e[o][0]&&"M"!==n[o][0]&&(n.splice(o,0,["M",i.x,i.y]),r.bx=0,r.by=0,r.x=e[o][1],r.y=e[o][2],v=Math.max(s.length,u&&u.length||0))};v=Math.max(s.length,u&&u.length||0);for(var b=0;b1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];a.default.each(e,function(e){var r=e.prop,i=e.event,o=n[r];if(a.default.isFunction(o))t.on(i,o);else if(a.default.isObject(o))for(var s in o)void 0!==o[s]&&t.on(s+":"+i,o[s])})}function O(t,e){w(t,b,e)}function j(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments[3];a.default.each(e,function(e){var i=e.prop,o=e.event,s=n[i],u=r[i],c=void 0;if(!a.default.shallowEqual(s,u))if(a.default.isFunction(s)&&a.default.isFunction(u))t.off(o,s),t.on(o,u);else if(a.default.isObject(s)&&a.default.isObject(u)){for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&t.off(c+":"+o,s[c]);for(c in u)Object.prototype.hasOwnProperty.call(u,c)&&t.on(c+":"+o,u[c])}})}function S(t,e,n){j(t,b,e,n)}function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];a.default.each(e,function(e){var r=e.prop,i=e.event,o=n[r];if(a.default.isFunction(o))t.off(i,o);else if(a.default.isObject(o))for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&t.off(s+":"+i,o[s])})}function M(t,e){E(t,b,e)}e.default={baseEventObjectTypes:x,baseEventFuncTypes:_,genBaseEvents:y,genItemBaseEvents:m,bindEvents:w,bindBaseEvents:O,updateEvents:j,updateBaseEvents:S,unbindEvents:E,unbindBaseEvents:M,chartEvents:g}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var y=u.default.COORD_FUNC_PROPS,m=u.default.GEOM_FUNC_PROPS;e.default={createChart:function t(e){var n=e.chart,r=new o.Chart(n.props);return n.g2Instance=r,r},executeChartConfig:function t(e,n){var r,i=n.chart.props;e.coord("rect",{}),e.source(i.data,i.scale),(n.facet||i.axis)&&n.facet&&!1!==i.axis||e.axis(!1),e.legend(!1),e.tooltip(!1),i.filter&&i.filter.forEach(function(t){e.filter(t[0],t[1])}),l.default.bindEvents(e,l.default.chartEvents,i),l.default.bindBaseEvents(e,i)},coord:function t(e,n){var r=n.coord;if(r&&!r.g2Instance){var i=r.props,o=i.type,s=g(i,["type"]),u=e.coord(o||"rect",a.Util.without(s,y));a.Prop.init(y,s,function(t,e){"reflect"===e?a.Util.each(t,function(t){return u[e](t)}):u[e].apply(u,v(t))}),r.g2Instance=u}},createLabel:function t(e,n){if(n&&!n.g2Instance){var r=n.props,i=r.content,o=g(r,["content"]);i&&(a.Util.isArray(i)?n.g2Instance=e.label(i[0],i[1],o):n.g2Instance=e.label(i,o))}},createGeom:function t(e,n){if(n.g2Instance)n.label&&this.createLabel(n.g2Instance,n.label);else{var r=n.props,i=e[r.type||"interval"]();r.adjust&&i.adjust(r.adjust),a.Prop.init(m,r,function(t,e){i[e].apply(i,v(t))}),n.g2Instance=i,this.createLabel(i,n.label)}},geoms:function t(e,n){var t=n.geoms;if(t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.createGeom(e,t[r])},legends:function t(e,n){var t=n.legends;for(var r in t)if(t[r]){var i=t[r];if(i.g2Instance)return;var o=i.props,a=o.name,s=o.visible,u=g(o,["name","visible"]),c=s;Object.prototype.hasOwnProperty.call(i.props,"visible")||(c=!0);var l=c?u:c;i.g2Instance=e.legend.apply(e,v(a?[a,l]:[l]))}},tooltip:function t(e,n){var i=n.tooltip;i&&!i.g2Instance&&(i.g2Instance=e.tooltip(r({},i.props)))},createAxis:function t(e,n){if(!n.g2Instance){var r=n.props,i=r.name,o=r.visible,a=g(r,["name","visible"]);o||!Object.prototype.hasOwnProperty.call(n.props,"visible")?n.g2Instance=e.axis(i,a):n.g2Instance=e.axis(i,!1)}},axises:function t(e,n){var t=n.axises;for(var r in t)t[r]&&this.createAxis(e,t[r])},views:function t(e,n){var t=n.views;for(var r in t)t[r]&&this.createView(e,t[r])},createView:function t(e,n){if("Facet"!==n.parentInfo.name){if(n.g2Instance)return n.filter&&n.filter.forEach(function(t){n.g2Instance.filter(t[0],t[1])}),this.coord(n.g2Instance,n),this.axises(n.g2Instance,n),this.geoms(n.g2Instance,n),void this.guide(n.g2Instance,n.guide);var i=n.props,o=i.scale,a=i.data,s=i.instance,u=i.axis,c=i.filter,l=i.geoms,f=g(i,["scale","data","instance","axis","filter","geoms"]),h=void 0;h=s||e.view(r({},f)),a&&h.source(a,o),o&&h.scale(o),c&&c.forEach(function(t){h.filter(t[0],t[1])}),!0===u||s||h.axis(!1),n.g2Instance=h,this.coord(h,n),this.axises(h,n),this.geoms(h,n),this.guide(h,n.guide)}},facetView:function t(e,n){var r=n.props,i=r.scale,o=r.data,a=r.axis,s=r.geoms,u=g(r,["scale","data","axis","geoms"]);o&&e.source(o,i),i&&e.scale(i),!1===a&&e.axis(!1),this.coord(e,n),this.axises(e,n),this.geoms(e,n),this.guide(e,n.guide),h.default.mergeView(n,!0)},guide:function t(e,n){if(n){var r=n.elements;for(var i in r)if(r[i]){var o=r[i];if(!o.g2Instance){var a=o.props,s=a.type,u=g(a,["type"]);o.g2Instance=e.guide()[o.type](u)}}}},facet:function t(e,n){var r=this,i=n.facet;if(i&&!i.g2Instance){var o=i.props,a=o.children,s=o.type,u=g(o,["children","type"]);if(a){var c=n.views,l=null;for(var f in c)if(c[f]&&"Facet"===c[f].parentInfo.name&&c[f].parentInfo.id===i.id){l=c[f];break}l&&(h.default.mergeView(l,!0),u.eachView=function(t){r.facetView(t,l)},e.facet(s,u))}else e.facet(s,u)}},synchronizeG2Add:function t(e,n){this.coord(e,n),this.axises(e,n),this.legends(e,n),this.tooltip(e,n),this.geoms(e,n),this.facet(e,n),this.views(e,n),this.guide(e,n.guide)},synchronizeG2Views:function t(e,n){var r=n.views;for(var i in r)r[i]&&this.synchronizeG2View(r[i].g2Instance,r[i])},synchronizeG2View:function t(e,n){e.clear(),this.clearViewG2Instance(n);var r=n.props,i=r.scale,o=r.data,a=r.instance,s=r.axis,u=r.geoms,c=g(r,["scale","data","instance","axis","geoms"]);o&&e.source(o,i),i&&e.scale(i),!0===s||a||e.axis(!1),this.coord(e,n),this.axises(e,n),this.geoms(e,n),this.guide(e,n.guide)},clearViewG2Instance:function t(e){e.coord&&delete e.coord.g2Instance,e.axises&&Object.keys(e.axises).forEach(function(t){delete e.axises[t].g2Instance}),e.geoms&&Object.keys(e.geoms).forEach(function(t){delete e.geoms[t].g2Instance,e.geoms[t].label&&delete e.geoms[t].label.g2Instance}),e.guide&&e.guide.elements&&Object.keys(e.guide.elements).forEach(function(t){delete e.guide.elements[t].g2Instance})}}},function(t,e,n){"use strict";n.d(e,"b",function(){return r}),n.d(e,"a",function(){return i});var r=Math.PI/180,i=180/Math.PI},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(430);n.d(e,"easeLinear",function(){return r.a});var i=n(432);n.d(e,"easeQuad",function(){return i.a}),n.d(e,"easeQuadIn",function(){return i.b}),n.d(e,"easeQuadOut",function(){return i.c}),n.d(e,"easeQuadInOut",function(){return i.a});var o=n(427);n.d(e,"easeCubic",function(){return o.a}),n.d(e,"easeCubicIn",function(){return o.b}),n.d(e,"easeCubicOut",function(){return o.c}),n.d(e,"easeCubicInOut",function(){return o.a});var a=n(431);n.d(e,"easePoly",function(){return a.a}),n.d(e,"easePolyIn",function(){return a.b}),n.d(e,"easePolyOut",function(){return a.c}),n.d(e,"easePolyInOut",function(){return a.a});var s=n(433);n.d(e,"easeSin",function(){return s.a}),n.d(e,"easeSinIn",function(){return s.b}),n.d(e,"easeSinOut",function(){return s.c}),n.d(e,"easeSinInOut",function(){return s.a});var u=n(429);n.d(e,"easeExp",function(){return u.a}),n.d(e,"easeExpIn",function(){return u.b}),n.d(e,"easeExpOut",function(){return u.c}),n.d(e,"easeExpInOut",function(){return u.a});var c=n(426);n.d(e,"easeCircle",function(){return c.a}),n.d(e,"easeCircleIn",function(){return c.b}),n.d(e,"easeCircleOut",function(){return c.c}),n.d(e,"easeCircleInOut",function(){return c.a});var l=n(425);n.d(e,"easeBounce",function(){return l.a}),n.d(e,"easeBounceIn",function(){return l.b}),n.d(e,"easeBounceOut",function(){return l.a}),n.d(e,"easeBounceInOut",function(){return l.c});var f=n(424);n.d(e,"easeBack",function(){return f.a}),n.d(e,"easeBackIn",function(){return f.b}),n.d(e,"easeBackOut",function(){return f.c}),n.d(e,"easeBackInOut",function(){return f.a});var h=n(428);n.d(e,"easeElastic",function(){return h.a}),n.d(e,"easeElasticIn",function(){return h.b}),n.d(e,"easeElasticOut",function(){return h.a}),n.d(e,"easeElasticInOut",function(){return h.c})},function(t,e,n){"use strict";var r=n(86);e.a=function(t,e){var i=e?e.length:0,o=t?Math.min(i,t.length):0,a=new Array(o),s=new Array(i),u;for(u=0;uu&&(f=e.slice(u,f),p[h]?p[h]+=f:p[++h]=f),(c=c[0])===(l=l[0])?p[h]?p[h]+=l:p[++h]=l:(p[++h]=null,d.push({i:h,x:n.i(r.a)(c,l)})),u=o.lastIndex;return uu&&(f=e.slice(u,f),p[h]?p[h]+=f:p[++h]=f),(c=c[0])===(l=l[0])?p[h]?p[h]+=l:p[++h]=l:(p[++h]=null,d.push({i:h,x:n.i(r.a)(c,l)})),u=o.lastIndex;return u1?this.each((null==e?i:"function"==typeof e?a:o)(t,e,null==n?"":n)):s(this.node(),t)}},function(t,e,n){"use strict";function r(){return[]}e.a=function(t){return null==t?r:function(){return this.querySelectorAll(t)}}},function(t,e,n){"use strict";var r=n(17);e.a=function(t,e){var n=t.__transition,i,o,a=!0,s;if(n){for(s in e=null==e?null:e+"",n)(i=n[s]).name===e?(o=i.state>r.a&&i.state3?0:(e-e%10!=10)*e%10]}};var x={D:function(t){return t.getDate()},DD:function(t){return v(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return v(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return v(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return String(t.getFullYear()).substr(2)},YYYY:function(t){return v(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return v(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return v(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return v(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return v(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return v(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return v(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+v(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)}},_={D:[s,function(t,e){t.day=e}],Do:[new RegExp(s.source+l.source),function(t,e){t.day=parseInt(e,10)}],M:[s,function(t,e){t.month=e-1}],YY:[s,function(t,e){var n,r=+(""+(new Date).getFullYear()).substr(0,2);t.year=""+(e>68?r-1:r)+e}],h:[s,function(t,e){t.hour=e}],m:[s,function(t,e){t.minute=e}],s:[s,function(t,e){t.second=e}],YYYY:[c,function(t,e){t.year=e}],S:[/\d/,function(t,e){t.millisecond=100*e}],SS:[/\d{2}/,function(t,e){t.millisecond=10*e}],SSS:[u,function(t,e){t.millisecond=e}],d:[s,h],ddd:[l,h],MMM:[l,d("monthNamesShort")],MMMM:[l,d("monthNames")],a:[l,function(t,e,n){var r=e.toLowerCase();r===n.amPm[0]?t.isPm=!1:r===n.amPm[1]&&(t.isPm=!0)}],ZZ:[/([\+\-]\d\d:?\d\d|Z)/,function(t,e){"Z"===e&&(e="+00:00");var n=(e+"").match(/([\+\-]|\d\d)/gi),r;n&&(r=60*n[1]+parseInt(n[2],10),t.timezoneOffset="+"===n[0]?r:-r)}]};_.dd=_.d,_.dddd=_.ddd,_.DD=_.D,_.mm=_.m,_.hh=_.H=_.HH=_.h,_.MM=_.M,_.ss=_.s,_.A=_.a,o.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},o.format=function(t,e,n){var r=n||o.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");var i=[];return(e=(e=(e=o.masks[e]||e||o.masks.default).replace(f,function(t,e){return i.push(e),"??"})).replace(a,function(e){return e in x?x[e](t,r):e.slice(1,e.length-1)})).replace(/\?\?/g,function(){return i.shift()})},o.parse=function(t,e,n){var r=n||o.i18n;if("string"!=typeof e)throw new Error("Invalid format in fecha.parse");if(e=o.masks[e]||e,t.length>1e3)return!1;var i=!0,s={};if(e.replace(a,function(e){if(_[e]){var n=_[e],o=t.search(n[0]);~o?t.replace(n[0],function(e){return n[1](s,e,r),t=t.substr(o+e.length),e}):i=!1}return _[e]?"":e.slice(1,e.length-1)}),!i)return!1;var u=new Date,c;return!0===s.isPm&&null!=s.hour&&12!=+s.hour?s.hour=+s.hour+12:!1===s.isPm&&12==+s.hour&&(s.hour=0),null!=s.timezoneOffset?(s.minute=+(s.minute||0)-+s.timezoneOffset,c=new Date(Date.UTC(s.year||u.getFullYear(),s.month||0,s.day||1,s.hour||0,s.minute||0,s.second||0,s.millisecond||0))):c=new Date(s.year||u.getFullYear(),s.month||0,s.day||1,s.hour||0,s.minute||0,s.second||0,s.millisecond||0),c},void 0!==t&&t.exports?t.exports=o:void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}(this)},function(t,e,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r},function(t,e,n){"use strict";var r=function(){};r=function(t,e,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i=0?"positive":"negative";u[y][g]||(u[y][g]=0),p[a]=[u[y][g],v+u[y][g]],u[y][g]+=v}}},e}(a);a.Stack=s,t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(2),o=n(159),a=n(4),s={merge:n(50)},u=n(31),c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function t(){this.xField=null,this.yField=null,this.cacheMax=null,this.adjustNames=["y"],this.groupFields=null},n._getMax=function t(e){var n=this,r=this.mergeData,i,s=o(r,function(t){var n=t[e];return a(n)?Math.max.apply(null,n):n})[e],u;return a(s)?Math.max.apply(null,s):s},n._getXValuesMax=function t(){var e=this,n=this.yField,r=this.xField,o={},s=this.mergeData;return i(s,function(t){var e=t[r],i=t[n],s=a(i)?Math.max.apply(null,i):i;o[e]=o[e]||0,o[e]0?n="left":e[0]<0&&(n="right"),n},n.getLinePath=function t(){var e=this,n=this.get("center"),r=n.x,i=n.y,o=this.get("radius"),a=o,s=this.get("startAngle"),u=this.get("endAngle"),c=this.get("inner"),l=[];if(Math.abs(u-s)===2*Math.PI)l=[["M",r,i],["m",0,-a],["a",o,a,0,1,1,0,2*a],["a",o,a,0,1,1,0,-2*a],["z"]];else{var f=this._getCirclePoint(s),h=this._getCirclePoint(u),p=Math.abs(u-s)>Math.PI?1:0,d=s>u?0:1;if(c){var v=this.getSideVector(c*o,f),g=this.getSideVector(c*o,h),y={x:v[0]+r,y:v[1]+i},m={x:g[0]+r,y:g[1]+i};l=[["M",y.x,y.y],["L",f.x,f.y],["A",o,a,0,p,d,h.x,h.y],["L",m.x,m.y],["A",o*c,a*c,0,p,Math.abs(d-1),y.x,y.y]]}else l=[["M",r,i],["L",f.x,f.y],["A",o,a,0,p,d,h.x,h.y],["L",r,i]]}return l},n.addLabel=function e(n,r,i){var o=this,a=this.get("label").offset||this.get("_labelOffset")||.001;r=this.getSidePoint(r,a),t.prototype.addLabel.call(this,n,r,i)},n.autoRotateLabels=function t(){var e=this,n=this.get("ticks"),r=this.get("labelRenderer");if(r&&n.length>12){var o=this.get("radius"),a=this.get("startAngle"),s,u=this.get("endAngle")-a,c=u/(n.length-1),l=Math.sin(c/2)*o*2,f=this.getMaxLabelWidth(r);i.each(r.get("group").get("children"),function(t,e){var r,i=n[e].value*u+a,o=i%(2*Math.PI);fMath.PI&&(i-=Math.PI),i-=Math.PI/2,t.attr("textAlign","center")):o>Math.PI/2?i-=Math.PI:ou.x)&&(f=!0);var h=s.vertical([],l,f);return s.scale([],h,e*i)},n.getAxisVector=function t(){var e=this.get("start"),n=this.get("end");return[n.x-e.x,n.y-e.y]},n.getLinePath=function t(){var e=this,n=this.get("start"),r=this.get("end"),i=[];return i.push(["M",n.x,n.y]),i.push(["L",r.x,r.y]),i},n.getTickEnd=function t(e,n){var r=this,i=this.getSideVector(n);return{x:e.x+i[0],y:e.y+i[1]}},n.getTickPoint=function t(e){var n=this,r=this.get("start"),i=this.get("end"),o=i.x-r.x,a=i.y-r.y;return{x:r.x+o*e,y:r.y+a*e}},n.renderTitle=function t(){var e=this,n=this.get("title"),r=this.getTickPoint(.5),i=n.offset;if(o.isNil(i)){i=20;var a=this.get("labelsGroup"),u,c;if(a)i+=this.getMaxLabelWidth(a)+(this.get("label").offset||this.get("_labelOffset"))}var l=n.textStyle,f=o.mix({},l);if(n.text){var h=this.getAxisVector();if(n.autoRotate&&o.isNil(l.rotate)){var p=0;if(!o.snapEqual(h[1],0)){var d=[1,0],v=[h[0],h[1]];p=s.angleTo(v,d,!0)}f.rotate=p*(180/Math.PI)}else o.isNil(l.rotate)||(f.rotate=l.rotate/180*Math.PI);var g=this.getSideVector(i),y,m=n.position;y="start"===m?{x:this.get("start").x+g[0],y:this.get("start").y+g[1]}:"end"===m?{x:this.get("end").x+g[0],y:this.get("end").y+g[1]}:{x:r.x+g[0],y:r.y+g[1]},f.x=y.x,f.y=y.y,f.text=n.text;var b,x=this.get("group").addShape("Text",{zIndex:2,attrs:f});x.name="axis-title",this.get("appendInfo")&&x.setSilent("appendInfo",this.get("appendInfo"))}},n.autoRotateLabels=function t(){var e=this,n=this.get("labelRenderer"),r=this.get("title");if(n){var i,a=n.get("group").get("children"),s=this.get("label").offset,u=12,c=r?r.offset:48;if(c<0)return;var l=this.getAxisVector(),f,h;if(o.snapEqual(l[0],0)&&r&&r.text)(h=this.getMaxLabelWidth(n))>c-s-12&&(f=-1*Math.acos((c-s-12)/h));else if(o.snapEqual(l[1],0)&&a.length>1){var p=Math.abs(this._getAvgLabelLength(n));(h=this.getMaxLabelWidth(n))>p&&(f=Math.asin(1.25*(c-s-12)/h))}if(f){var d=this.get("factor");o.each(a,function(t){t.rotateAtStart(f),o.snapEqual(l[1],0)&&(d>0?t.attr("textAlign","left"):t.attr("textAlign","right"))})}}},n.autoHideLabels=function t(){var e=this,n=this.get("labelRenderer"),r,i,a=8;if(n){var s,u=n.get("group").get("children"),c=this.getAxisVector();if(u.length<2)return;if(o.snapEqual(c[0],0)){var l=this.getMaxLabelHeight(n)+8,f=Math.abs(this._getAvgLabelHeightSpace(n));l>f&&(r=l,i=f)}else if(o.snapEqual(c[1],0)&&u.length>1){var h=this.getMaxLabelWidth(n)+8,p=Math.abs(this._getAvgLabelLength(n));h>p&&(r=h,i=p)}if(r&&i){var d=Math.ceil(r/i);o.each(u,function(t,e){e%d!=0&&t.attr("text","")})}}},e}(i);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(33),a=i.MatrixUtil,s=i.PathUtil,u=a.vec2,c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"polyline"})},n.getLinePath=function t(){var e=this,n=this.get("tickPoints"),r=this.get("start"),o=this.get("end"),a=[];a.push(r.x),a.push(r.y),i.each(n,function(t){a.push(t.x),a.push(t.y)}),a.push(o.x),a.push(o.y);var u=s.catmullRomToBezier(a);return u.unshift(["M",r.x,r.y]),u},n.getTickPoint=function t(e,n){var r;return this.get("tickPoints")[n]},n.getTickEnd=function t(e,n,r){var i=this,o=this.get("tickLine"),a=n||o.length,s=this.getSideVector(a,e,r);return{x:e.x+s[0],y:e.y+s[1]}},n.getSideVector=function t(e,n,r){var i=this,o,a;if(0===r){if((o=this.get("start")).x===n.x&&o.y===n.y)return[0,0]}else o=this.get("tickPoints")[r-1];var s=[n.x-o.x,n.y-o.y],c=u.normalize([],s),l=u.vertical([],c,!1);return u.scale([],l,e)},e}(o);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(19),a=Math.PI,s=Math.atan;function u(t,e){var n=t.x-e.x,r=t.y-e.y,i;return 0===r?i=n<0?a/2:270*a/180:n>=0&&r>0?i=2*a-s(n/r):n<=0&&r<0?i=a-s(n/r):n>0&&r<0?i=a+s(-n/r):n<0&&r>0&&(i=s(n/-r)),i}var c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"arc",start:null,end:null,style:{stroke:"#999",lineWidth:1}})},n.render=function t(e,n){var r=this,o=this.parsePoint(e,this.get("start")),s=this.parsePoint(e,this.get("end")),c=e.getCenter(),l=Math.sqrt((o.x-c.x)*(o.x-c.x)+(o.y-c.y)*(o.y-c.y)),f,h=u(o,c),p=u(s,c);if(pa?1:0;f=[["M",o.x,o.y],["A",l,l,0,v,1,s.x,s.y]]}var g=n.addShape("path",{zIndex:this.get("zIndex"),attrs:i.mix({path:f},this.get("style"))});g.name="guide-arc",this.get("appendInfo")&&g.setSilent("appendInfo",this.get("appendInfo")),this.set("el",g)},e}(o);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"dataMarker",zIndex:1,top:!0,position:null,style:{point:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2},line:{stroke:"#A3B1BF",lineWidth:1},text:{fill:"#000000",opacity:.65,fontSize:12,textAlign:"start"}},display:{point:!0,line:!0,text:!0},lineLength:20,direction:"upward",autoAdjust:!0})},n.render=function t(e,n){var r=this,i=this.parsePoint(e,this.get("position")),o=n.addGroup();o.name="guide-data-marker";var a=this._getElementPosition(i),s=this.get("display"),u,c;if(s.line){var l=a.line;u=this._drawLine(l,o)}if(s.text&&this.get("content")){var f=a.text;c=this._drawText(f,o)}if(s.point){var h=a.point;this._drawPoint(h,o)}if(this.get("autoAdjust")){var p=o.getBBox(),d=p.minX,v=p.minY,g=p.maxX,y=p.maxY,m=e.start,b=e.end;if(c){d<=m.x&&c.attr("textAlign","start"),g>=b.x&&c.attr("textAlign","end");var x=this.get("direction");if("upward"===x&&v<=b.y||"upward"!==x&&y>=m.y){var _,w;"upward"===x&&v<=b.y?(_="top",w=1):(_="bottom",w=-1),c.attr("textBaseline",_);var O=0;if(this.get("display").line){O=this.get("lineLength");var j=[["M",i.x,i.y],["L",i.x,i.y+O*w]];u.attr("path",j)}var S=i.y+(O+2)*w;c.attr("y",S)}}}this.get("appendInfo")&&o.setSilent("appendInfo",this.get("appendInfo")),this.set("el",o)},n._getElementPosition=function t(e){var n=this,r=e.x,i=e.y,o=this.get("display").line?this.get("lineLength"):0,a=this.get("direction"),s;this.get("style").text.textBaseline="upward"===a?"bottom":"top";var u="upward"===a?-1:1,c,l,f,h;return{point:{x:r,y:i},line:[{x:r,y:i},{x:r,y:o*u+i}],text:{x:r,y:(o+2)*u+i}}},n._drawLine=function t(e,n){var r=this,o=this.get("style").line,a=[["M",e[0].x,e[0].y],["L",e[1].x,e[1].y]],s;return n.addShape("path",{attrs:i.mix({path:a},o)})},n._drawText=function t(e,n){var r=this,o=this.get("style").text,a;return n.addShape("text",{attrs:i.mix({text:this.get("content")},o,e)})},n._drawPoint=function t(e,n){var r=this,o=this.get("style").point,a;return n.addShape("circle",{attrs:i.mix({},o,e)})},e}(n(19));t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(102),a,s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"dataRegion",start:null,end:null,content:"",style:{region:{lineWidth:0,fill:"#000000",opacity:.04},text:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:"rgba(0, 0, 0, .65)"}}})},n.render=function t(e,n,r){var o=this,a=this.get("lineLength")||0,s=this._getRegionData(e,r);if(s.length){var u=this._getBBox(s),c=[];c.push(["M",s[0].x,u.yMin-a]);for(var l=0,f=s.length;l=h&&p.push(this.parsePoint(e,[g[u],g[c]])),g[u]===f)break}return p},n._getBBox=function t(e){for(var n=[],r=[],o=0;o');s.appendChild(u);var c=this.get("htmlContent")||this.get("html"),l,f;i.isFunction(c)&&(c=c(this.get("xScales"),this.get("yScales")));var h=o.createDom(c);u.appendChild(h),o.modifyCSS(u,{position:"absolute"}),this._setDomPosition(u,h,a),this.set("el",u)},n._setDomPosition=function t(e,n,r){var i=this,a=this.get("alignX"),s=this.get("alignY"),u=o.getOuterWidth(n),c=o.getOuterHeight(n),l={x:r.x,y:r.y};"middle"===a&&"top"===s?l.x-=Math.round(u/2):"middle"===a&&"bottom"===s?(l.x-=Math.round(u/2),l.y-=Math.round(c)):"left"===a&&"bottom"===s?l.y-=Math.round(c):"left"===a&&"middle"===s?l.y-=Math.round(c/2):"left"===a&&"top"===s?(l.x=r.x,l.y=r.y):"right"===a&&"bottom"===s?(l.x-=Math.round(u),l.y-=Math.round(c)):"right"===a&&"middle"===s?(l.x-=Math.round(u),l.y-=Math.round(c/2)):"right"===a&&"top"===s?l.x-=Math.round(u):(l.x-=Math.round(u/2),l.y-=Math.round(c/2));var f=this.get("offsetX");f&&(l.x+=f);var h=this.get("offsetY");h&&(l.y+=h),o.modifyCSS(e,{top:Math.round(l.y)+"px",left:Math.round(l.x)+"px",visibility:"visible",zIndex:this.get("zIndex")})},n.clear=function t(){var e=this,n=this.get("el");n&&n.parentNode&&n.parentNode.removeChild(n)},e}(n(19));t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"image",start:null,end:null,src:null,offsetX:null,offsetY:null})},n.render=function t(e,n){var r=this,i=this.parsePoint(e,this.get("start")),o={x:i.x,y:i.y};if(o.img=this.get("src"),this.get("end")){var a=this.parsePoint(e,this.get("end"));o.width=a.x-i.x,o.height=a.y-i.y}else o.width=this.get("width")||32,o.height=this.get("height")||32;this.get("offsetX")&&(o.x+=this.get("offsetX")),this.get("offsetY")&&(o.y+=this.get("offsetY"));var s=n.addShape("Image",{zIndex:1,attrs:o});s.name="guide-image",this.get("appendInfo")&&s.setSilent("appendInfo",this.get("appendInfo")),this.set("el",s)},e}(n(19));t.exports=a},function(t,e,n){t.exports={Guide:n(19),Arc:n(233),DataMarker:n(234),DataRegion:n(235),Html:n(236),Image:n(237),Line:n(239),Region:n(240),Text:n(241)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=n(19),a=i.MatrixUtil.vec2,s,u=n(18).FONT_FAMILY,c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"line",start:null,end:null,lineStyle:{stroke:"#000",lineWidth:1},text:{position:"end",autoRotate:!0,style:{fill:"#999",fontSize:12,fontWeight:500,fontFamily:u},content:null}})},n.render=function t(e,n){var r=this,i=this.parsePoint(e,this.get("start")),o=this.parsePoint(e,this.get("end")),a=n.addGroup({viewId:n.get("viewId")});this._drawLines(i,o,a);var s=this.get("text");s&&s.content&&this._drawText(i,o,a),this.set("el",a)},n._drawLines=function t(e,n,r){var o=[["M",e.x,e.y],["L",n.x,n.y]],a=r.addShape("Path",{attrs:i.mix({path:o},this.get("lineStyle"))});a.name="guide-line",this.get("appendInfo")&&a.setSilent("appendInfo",this.get("appendInfo"))},n._drawText=function t(e,n,r){var o=this.get("text"),s=o.position,u=o.style||{},c;((c="start"===s?0:"center"===s?.5:i.isString(s)&&-1!==s.indexOf("%")?parseInt(s,10)/100:i.isNumber(s)?s:1)>1||c<0)&&(c=1);var l={x:e.x+(n.x-e.x)*c,y:e.y+(n.y-e.y)*c};if(o.offsetX&&(l.x+=o.offsetX),o.offsetY&&(l.y+=o.offsetY),l.text=o.content,l=i.mix({},l,u),o.autoRotate&&i.isNil(u.rotate)){var f=a.angleTo([n.x-e.x,n.y-e.y],[1,0],1);l.rotate=f}else i.isNil(u.rotate)||(l.rotate=u.rotate*Math.PI/180);var h=r.addShape("Text",{attrs:l});h.name="guide-line-text",this.get("appendInfo")&&h.setSilent("appendInfo",this.get("appendInfo"))},e}(o);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"region",zIndex:1,start:null,end:null,style:{lineWidth:0,fill:"#CCD7EB",opacity:.4}})},n.render=function t(e,n){var r=this,o=this.get("style"),a=this._getPath(e),s=n.addShape("path",{zIndex:this.get("zIndex"),attrs:i.mix({path:a},o)});s.name="guide-region",this.get("appendInfo")&&s.setSilent("appendInfo",this.get("appendInfo")),this.set("el",s)},n._getPath=function t(e){var n=this,r=this.parsePoint(e,this.get("start")),i=this.parsePoint(e,this.get("end")),o;return[["M",r.x,r.y],["L",i.x,r.y],["L",i.x,i.y],["L",r.x,i.y],["z"]]},e}(n(19));t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{name:"text",position:null,content:null,style:{fill:"#999",fontSize:12,fontWeight:500,textAlign:"center"},offsetX:null,offsetY:null,top:!0})},n.render=function t(e,n){var r=this,o=this.parsePoint(e,this.get("position")),a=i.mix({},this.get("style")),s=this.get("offsetX"),u=this.get("offsetY");s&&(o.x+=s),u&&(o.y+=u),a.rotate&&(a.rotate=a.rotate*Math.PI/180);var c=n.addShape("Text",{zIndex:this.get("zIndex"),attrs:i.mix({text:this.get("content")},a,o)});c.name="guide-text",this.get("appendInfo")&&c.setSilent("appendInfo",this.get("appendInfo")),this.set("el",c)},e}(n(19));t.exports=a},function(t,e,n){var r=n(103);t.exports=r},function(t,e){t.exports=function t(e,n){for(var r,i,o=[],a=0;ai.width||r.height>i.height?o.push(e[a]):r.width*r.height>i.width*i.height&&o.push(e[a]);for(var s=0;s

        1

        /2

        ',slipWidth:65,legendOverflow:"unset"})},n.render=function e(){t.prototype._renderHTML.call(this),this._renderFlipPage()},n._renderFlipPage=function t(){var e=document.getElementsByClassName("g2-legend")[0],n=g(e,c),r=this.get("position"),o=this.get("layout"),a="right"===r||"left"===r||"vertical"===o?"block":"inline-block";if(e.scrollHeight>e.offsetHeight){var s=this.get("slipTpl"),l=u.createDom(s),f=g(l,"g2-caret-up"),h=g(l,"g2-caret-down");u.modifyCSS(f,this.get("caretStyle")),u.modifyCSS(f,{fill:"rgba(0,0,0,0.25)"}),u.modifyCSS(h,this.get("caretStyle"));var p=g(l,"cur-pagenum"),d=g(l,"next-pagenum"),v=this.get("pageNumStyle");u.modifyCSS(p,i.mix({},v,{paddingLeft:"10px"})),u.modifyCSS(d,i.mix({},v,{opacity:.3,paddingRight:"10px"})),u.modifyCSS(l,i.mix({},this.get("slipDomStyle"),{top:e.offsetHeight+"px"})),e.style.overflow=this.get("legendOverflow"),e.appendChild(l);for(var y=n.childNodes,m=0,b=1,x=[],_=0;_=e.offsetHeight&&(b++,x.forEach(function(t){t.style.display="none"}),x=[]),x.push(y[_]);d.innerText="/"+b,y.forEach(function(t){t.style.display=a,(m=t.offsetTop+t.offsetHeight)>e.offsetHeight&&(t.style.display="none")}),f.addEventListener("click",function(){if(y[0].style.display!==a){var t=-1;y.forEach(function(e,n){e.style.display===a&&(t=-1===t?n:t,e.style.display="none")});for(var n=t-1;n>=0&&(y[n].style.display=a,m=y[t-1].offsetTop+y[t-1].offsetHeight,y[n].style.display="none",m0){var g=o.toRGB(u[v-1].color);c+=1-u[v].percentage+":"+g+" "}p.addShape("text",{attrs:a.mix({},{x:r+this.get("textOffset")/2,y:i-u[v].percentage*i,text:this._formatItemValue(u[v].value)+""},this.get("textStyle"),{textAlign:"start"})})}}else{c+="l (0) ";for(var y=0;y0){var m=o.toRGB(u[y-1].color);c+=u[y].percentage+":"+m+" "}c+=u[y].percentage+":"+l+" ",p.addShape("text",{attrs:a.mix({},{x:u[y].percentage*r,y:i+5+this.get("textOffset"),text:this._formatItemValue(u[y].value)+""},this.get("textStyle"))})}}p.addShape("rect",{attrs:{x:0,y:0,width:r,height:i,fill:c,strokeOpacity:0}}),p.addShape("path",{attrs:a.mix({path:f},this.get("lineStyle"))}),p.move(0,n)},e}(n(63));t.exports=u},function(t,e,n){t.exports={Category:n(107),CatHtml:n(106),CatPageHtml:n(246),Color:n(247),Size:n(250),CircleSize:n(249)}},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=2,s=16,u=16,c=5,l=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"size-circle-legend",width:100,height:200,_unslidableCircleStyle:{stroke:"rgb(99, 161, 248)",fill:"rgb(99, 161, 248)",fillOpacity:.3,lineWidth:1.5},triggerAttr:{fill:"white",shadowOffsetX:-2,shadowOffsetY:2,shadowBlur:10,shadowColor:"#ccc"},frontMiddleBarStyle:{fill:"rgb(64, 141, 251)"}})},n._renderSliderShape=function t(){var e=5,n,r=this.get("slider").get("backgroundElement"),o=this.get("layout"),a="vertical"===o?2:this.get("width"),s="vertical"===o?this.get("height"):2,u=5,c=this.get("height")/2,l=this.get("frontMiddleBarStyle"),f="vertical"===o?[[0,0],[a,0],[a,s],[0,s]]:[[0,c+s],[0,c-s],[5+a-4,c-s],[5+a-4,c+s]];return this._addMiddleBar(r,"Polygon",i.mix({points:f},l))},n._addHorizontalTrigger=function t(e,n,r,o){var a,s=this.get("slider").get(e+"HandleElement"),u=-this.get("height")/2,c=s.addShape("circle",{attrs:i.mix({x:0,y:u,r:o},n)}),l=s.addShape("text",{attrs:i.mix(r,{x:0,y:u+o+10,textAlign:"center",textBaseline:"middle"})}),f,h="vertical"===this.get("layout")?"ns-resize":"ew-resize";c.attr("cursor",h),l.attr("cursor",h),this.set(e+"ButtonElement",c),this.set(e+"TextElement",l)},n._addVerticalTrigger=function t(e,n,r,o){var a,s=this.get("slider").get(e+"HandleElement"),u=s.addShape("circle",{attrs:i.mix({x:0,y:0,r:o},n)}),c=s.addShape("text",{attrs:i.mix(r,{x:o+10,y:0,textAlign:"start",textBaseline:"middle"})}),l,f="vertical"===this.get("layout")?"ns-resize":"ew-resize";u.attr("cursor",f),c.attr("cursor",f),this.set(e+"ButtonElement",u),this.set(e+"TextElement",c)},n._renderTrigger=function t(){var e=this.get("firstItem"),n=this.get("lastItem"),r=this.get("layout"),o=this.get("textStyle"),a=this.get("triggerAttr"),s=i.mix({},a),u=i.mix({},a),c=5,l=16,f=i.mix({text:this._formatItemValue(e.value)+""},o),h=i.mix({text:this._formatItemValue(n.value)+""},o);"vertical"===r?(this._addVerticalTrigger("min",s,f,5),this._addVerticalTrigger("max",u,h,16)):(this._addHorizontalTrigger("min",s,f,5),this._addHorizontalTrigger("max",u,h,16))},n._bindEvents=function t(){var e=this,n;this.get("slidable")&&this.get("slider").on("sliderchange",function(t){var n=t.range,r=e.get("firstItem").value,i=e.get("lastItem").value,o=r+n[0]/100*(i-r),a=r+n[1]/100*(i-r),s=5+n[0]/100*11,u=5+n[1]/100*11;e._updateElement(o,a,s,u);var c=new Event("itemfilter",t,!0,!0);c.range=[o,a],e.emit("itemfilter",c)})},n._updateElement=function e(n,r,i,o){t.prototype._updateElement.call(this,n,r);var a=this.get("minTextElement"),s=this.get("maxTextElement"),u=this.get("minButtonElement"),c=this.get("maxButtonElement"),l;if(u.attr("r",i),c.attr("r",o),"vertical"===this.get("layout"))a.attr("x",i+10),s.attr("x",o+10);else{var f=-this.get("height")/2;a.attr("y",f+i+10),s.attr("y",f+o+10)}},n._addCircle=function t(e,n,r,o,a){var s,u=this.get("group").addGroup(),c=this.get("_unslidableCircleStyle"),l=this.get("textStyle"),f=this.get("titleShape"),h=this.get("titleGap");f&&(h+=f.getBBox().height),u.addShape("circle",{attrs:i.mix({x:e,y:n+h,r:0===r?1:r},c)}),"vertical"===this.get("layout")?u.addShape("text",{attrs:i.mix({x:a+20+this.get("textOffset"),y:n+h,text:0===o?"0":o},l)}):u.addShape("text",{attrs:i.mix({x:e,y:n+h+a+13+this.get("textOffset"),text:0===o?"0":o},l)})},n._renderUnslidable=function t(){var e=this.get("firstItem").value,n=this.get("lastItem").value;if(e>n){var r=n;n=e,e=r}var i=this._formatItemValue(e),o=this._formatItemValue(n),a=e<5?5:e,s=n>16?16:n;a>s&&(a=5,s=16),"vertical"===this.get("layout")?(this._addCircle(s,s,a,i,2*s),this._addCircle(s,2*s+16+a,s,o,2*s)):(this._addCircle(s,s,a,i,2*s),this._addCircle(2*s+16+a,s,s,o,2*s))},n.activate=function e(n){this.get("slidable")&&t.prototype.activate.call(this,n)},e}(n(63));t.exports=l},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o,a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return i.mix({},n,{type:"size-legend",width:100,height:200,_unslidableElementStyle:{fill:"#4E7CCC",fillOpacity:1},frontMiddleBarStyle:{fill:"rgb(64, 141, 251)"}})},n._renderSliderShape=function t(){var e,n=this.get("slider").get("backgroundElement"),r=this.get("layout"),o=this.get("width"),a=this.get("height"),s=this.get("height")/2,u=this.get("frontMiddleBarStyle"),c="vertical"===r?[[0,0],[o,0],[o,a],[o-4,a]]:[[0,s+a/2],[0,s+a/2-4],[o,s-a/2],[o,s+a/2]];return this._addMiddleBar(n,"Polygon",i.mix({points:c},u))},n._renderUnslidable=function t(){var e=this.get("layout"),n=this.get("width"),r=this.get("height"),o=this.get("frontMiddleBarStyle"),a="vertical"===e?[[0,0],[n,0],[n,r],[n-4,r]]:[[0,r],[0,r-4],[n,0],[n,r]],s,u;this.get("group").addGroup().addShape("Polygon",{attrs:i.mix({points:a},o)});var c=this._formatItemValue(this.get("firstItem").value),l=this._formatItemValue(this.get("lastItem").value);"vertical"===this.get("layout")?(this._addText(n+10,r-3,c),this._addText(n+10,3,l)):(this._addText(0,r,c),this._addText(n,r,l))},n._addText=function t(e,n,r){var o,a=this.get("group").addGroup(),s=this.get("textStyle"),u=this.get("titleShape"),c=this.get("titleGap");u&&(c+=u.getBBox().height),"vertical"===this.get("layout")?a.addShape("text",{attrs:i.mix({x:e+this.get("textOffset"),y:n,text:0===r?"0":r},s)}):(n+=c+this.get("textOffset")-20,u||(n+=10),a.addShape("text",{attrs:i.mix({x:e,y:n,text:0===r?"0":r},s)}))},e}(n(63));t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(3),o=i.DomUtil,a,s=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function t(){return{range:null,middleAttr:{fill:"#fff",fillOpacity:0},backgroundElement:null,minHandleElement:null,maxHandleElement:null,middleHandleElement:null,currentTarget:null,layout:"vertical",width:null,height:null,pageX:null,pageY:null}},n._beforeRenderUI=function t(){var e=this.get("layout"),n=this.get("backgroundElement"),r=this.get("minHandleElement"),i=this.get("maxHandleElement"),o=this.addShape("rect",{attrs:this.get("middleAttr")}),a="vertical"===e?"ns-resize":"ew-resize";this.add([n,r,i]),this.set("middleHandleElement",o),n.set("zIndex",0),o.set("zIndex",1),r.set("zIndex",2),i.set("zIndex",2),o.attr("cursor","move"),r.attr("cursor",a),i.attr("cursor",a),this.sort()},n._renderUI=function t(){"horizontal"===this.get("layout")?this._renderHorizontal():this._renderVertical()},n._transform=function t(e){var n=this.get("range"),r=n[0]/100,i=n[1]/100,o=this.get("width"),a=this.get("height"),s=this.get("minHandleElement"),u=this.get("maxHandleElement"),c=this.get("middleHandleElement");s.resetMatrix(),u.resetMatrix(),"horizontal"===e?(c.attr({x:o*r,y:0,width:(i-r)*o,height:a}),s.translate(r*o,a),u.translate(i*o,a)):(c.attr({x:0,y:a*(1-i),width:o,height:(i-r)*a}),s.translate(1,(1-r)*a),u.translate(1,(1-i)*a))},n._renderHorizontal=function t(){this._transform("horizontal")},n._renderVertical=function t(){this._transform("vertical")},n._bindUI=function t(){this.on("mousedown",i.wrapBehavior(this,"_onMouseDown"))},n._isElement=function t(e,n){var r=this.get(n),i;return e===r||!!r.isGroup&&r.get("children").indexOf(e)>-1},n._getRange=function t(e,n){var r=e+n;return r=(r=r>100?100:r)<0?0:r},n._updateStatus=function t(e,n){var r="x"===e?this.get("width"):this.get("height");e=i.upperFirst(e);var o=this.get("range"),a=this.get("page"+e),s=this.get("currentTarget"),u=this.get("rangeStash"),c,l="vertical"===this.get("layout")?-1:1,f=n["page"+e],h,p=(f-a)/r*100*l,d;o[1]<=o[0]?(this._isElement(s,"minHandleElement")||this._isElement(s,"maxHandleElement"))&&(o[0]=this._getRange(p,o[0]),o[1]=this._getRange(p,o[0])):(this._isElement(s,"minHandleElement")&&(o[0]=this._getRange(p,o[0])),this._isElement(s,"maxHandleElement")&&(o[1]=this._getRange(p,o[1]))),this._isElement(s,"middleHandleElement")&&(d=u[1]-u[0],o[0]=this._getRange(p,o[0]),o[1]=o[0]+d,o[1]>100&&(o[1]=100,o[0]=o[1]-d)),this.emit("sliderchange",{range:o}),this.set("page"+e,f),this._renderUI(),this.get("canvas").draw()},n._onMouseDown=function t(e){var n=e.currentTarget,r=e.event,i=this.get("range");r.stopPropagation(),r.preventDefault(),this.set("pageX",r.pageX),this.set("pageY",r.pageY),this.set("currentTarget",n),this.set("rangeStash",[i[0],i[1]]),this._bindCanvasEvents()},n._bindCanvasEvents=function t(){var e=this.get("canvas").get("containerDOM");this.onMouseMoveListener=o.addEventListener(e,"mousemove",i.wrapBehavior(this,"_onCanvasMouseMove")),this.onMouseUpListener=o.addEventListener(e,"mouseup",i.wrapBehavior(this,"_onCanvasMouseUp")),this.onMouseLeaveListener=o.addEventListener(e,"mouseleave",i.wrapBehavior(this,"_onCanvasMouseUp"))},n._onCanvasMouseMove=function t(e){var n;this._mouseOutArea(e)||("horizontal"===this.get("layout")?this._updateStatus("x",e):this._updateStatus("y",e))},n._onCanvasMouseUp=function t(){this._removeDocumentEvents()},n._removeDocumentEvents=function t(){this.onMouseMoveListener.remove(),this.onMouseUpListener.remove()},n._mouseOutArea=function t(e){var n,r=this.get("canvas").get("el").getBoundingClientRect(),i=this.get("parent"),o=i.getBBox(),a=i.attr("matrix")[6],s=i.attr("matrix")[7],u=a+o.width,c=s+o.height,l=e.clientX-r.x,f=e.clientY-r.y;return lu||fc},e}(i.Group);t.exports=s},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(64),a=n(3),s=a.DomUtil,u=n(255),c=n(109),l=n(111),f=n(110),h="g2-tooltip",p="g2-tooltip-title",d="g2-tooltip-list",v="g2-tooltip-marker",g="g2-tooltip-value",y="g2-tooltip-list-item";function m(t,e){return t.getElementsByClassName(e)[0]}function b(t,e){return Object.keys(t).forEach(function(n){e[n]&&(t[n]=a.mix(t[n],e[n]))}),t}var x=function(t){r(n,t);var e=n.prototype;function n(e){var n;n=t.call(this,e)||this,a.assign(i(i(n)),l),a.assign(i(i(n)),f);var r=u;n.style=b(r,e),n._init_(),n.get("items")&&n.render();var o=n.get("crosshairs");if(o){var s="rect"===o.type?n.get("backPlot"):n.get("frontPlot"),h=new c(a.mix({plot:s,plotRange:n.get("plotRange"),canvas:n.get("canvas")},n.get("crosshairs")));h.hide(),n.set("crosshairGroup",h)}return n}return e.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return a.mix({},n,{containerTpl:'
          ',itemTpl:'
        • =0&&r<=1&&(u*=r);var c=Math.floor(u*(1-i)/s),l=c/(2*Math.PI),f={start:o,end:a},h={start:i*u,end:i*u+.99*c};this.a=l,this.d=c,this.x=f,this.y=h}},{key:"getCenter",value:function t(){return this.center}},{key:"convertPoint",value:function t(e){var n=this.a,r=this.center,i,o;this.isTransposed?(i=e.y,o=e.x):(i=e.x,o=e.y);var a=this.convertDim(i,"x"),s=n*a,u=this.convertDim(o,"y");return{x:r.x+Math.cos(a)*(s+u),y:r.y+Math.sin(a)*(s+u)}}},{key:"invertPoint",value:function t(e){var n=this.center,r=this.a,i=this.d+this.y.start,o=m.subtract([],[e.x,e.y],[n.x,n.y]),a=m.angleTo(o,[1,0],!0),s=a*r,u;m.length(o)f/s?(p=f/s,d={x:r.x-(.5-c)*f,y:r.y-(.5-l)*p*u}):(p=h/u,d={x:r.x-(.5-c)*p*s,y:r.y-(.5-l)*h}),e?e>0&&e<=1?e*=p:(e<=0||e>p)&&(e=p):e=p;var v={start:i,end:o},g={start:n*e,end:e};this.x=v,this.y=g,this.radius=e,this.circleCentre=d,this.center=d}},{key:"getCenter",value:function t(){return this.circleCentre}},{key:"getOneBox",value:function t(){var e=this.startAngle,n=this.endAngle;if(Math.abs(n-e)>=2*Math.PI)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var r=[0,Math.cos(e),Math.cos(n)],i=[0,Math.sin(e),Math.sin(n)],o=Math.min(e,n);o0?c:-c;var l=this.invertDim(u,"y"),f={};return f.x=this.isTransposed?l:c,f.y=this.isTransposed?c:l,f}}]),e}(y);t.exports=_},function(t,e,n){var r=n(0),i=n(25),o=r.PathUtil;function a(t){var e=t.start,n=t.end,r=t.getWidth(),o=t.getHeight(),a=200,s,u,c,l,f;return t.isPolar?(l=t.getRadius(),c=t.getCenter(),s=t.startAngle,u=t.endAngle,(f=new i.Fan({attrs:{x:c.x,y:c.y,rs:0,re:l+200,startAngle:s,endAngle:s}})).endState={endAngle:u}):(f=new i.Rect({attrs:{x:e.x-200,y:n.y-200,width:t.isTransposed?r+400:0,height:t.isTransposed?0:o+400}}),t.isTransposed?f.endState={height:o+400}:f.endState={width:r+400}),f.isClip=!0,f}function s(t){if(r.isEmpty(t))return null;var e=t[0].x,n=t[0].x,i=t[0].y,o=t[0].y;return r.each(t,function(t){e=e>t.x?t.x:e,n=nt.y?t.y:i,o=o0?i.maxX:i.minX,s,1];t.apply(u),t.attr({transform:[["t",-a,-s],["s",.01,1],["t",a,s]]});var l={transform:[["t",-a,-s],["s",100,1],["t",a,s]]},f=c(e,r,n,l);t.animate(l,f.duration,f.easing,f.callback,f.delay)}function h(t,e){var n={lineWidth:0,opacity:0},r=t._id,i,o=c(e,t.get("index"),r,n);t.animate(n,o.duration,o.easing,function(){t.remove()},o.delay)}function p(t,e,n){var r=t._id,i=t.get("index"),o,a;if(n.isPolar&&"point"!==t.name)o=n.getCenter().x,a=n.getCenter().y;else{var s=t.getBBox();o=(s.minX+s.maxX)/2,a=(s.minY+s.maxY)/2}var u=[o,a,1];t.apply(u),t.attr({transform:[["t",-o,-a],["s",.01,.01],["t",o,a]]});var l={transform:[["t",-o,-a],["s",100,100],["t",o,a]]},f=c(e,i,r,l);t.animate(l,f.duration,f.easing,f.callback,f.delay)}function d(t,e,n){var r=t._id,i=t.get("index"),o,a;if(n.isPolar&&"point"!==t.name)o=n.getCenter().x,a=n.getCenter().y;else{var s=t.getBBox();o=(s.minX+s.maxX)/2,a=(s.minY+s.maxY)/2}var u=[o,a,1];t.apply(u);var l={transform:[["t",-o,-a],["s",.01,.01],["t",o,a]]},f=c(e,i,r,l);t.animate(l,f.duration,f.easing,function(){t.remove()},f.delay)}function v(t,e){if("path"===t.get("type")){var n=t._id,r=t.get("index"),i=o.pathToAbsolute(t.attr("path"));t.attr("path",[i[0]]);var a={path:i},s=c(e,r,n,a);t.animate(a,s.duration,s.easing,s.callback,s.delay)}}function g(t,e){if("path"===t.get("type")){var n=t._id,r=t.get("index"),i,a={path:[o.pathToAbsolute(t.attr("path"))[0]]},s=c(e,r,n,a);t.animate(a,s.duration,s.easing,function(){t.remove()},s.delay)}}function y(t,e,n,r,i){var o=a(n),s=t.get("canvas"),u=t._id,l=t.get("index"),f;r?(o.attr("startAngle",r),o.attr("endAngle",r),f={endAngle:i}):f=o.endState,o.set("canvas",s),t.attr("clip",o),t.setSilent("animating",!0);var h=c(e,l,u,f);o.animate(f,h.duration,h.easing,function(){t&&!t.get("destroyed")&&(t.attr("clip",null),t.setSilent("cacheShape",null),t.setSilent("animating",!1),o.remove())},h.delay)}function m(t,e){var n=t._id,i=t.get("index"),o=r.isNil(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),a=r.isNil(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity");t.attr("fillOpacity",0),t.attr("strokeOpacity",0);var s={fillOpacity:o,strokeOpacity:a},u=c(e,i,n,s);t.animate(s,u.duration,u.easing,u.callback,u.delay)}function b(t,e){var n=t._id,r,i={fillOpacity:0,strokeOpacity:0},o=c(e,t.get("index"),n,i);t.animate(i,o.duration,o.easing,function(){t.remove()},o.delay)}function x(t,e,n){var r=u(t,n),i=r.endAngle,o;y(t,e,n,r.startAngle,i)}t.exports={enter:{clipIn:y,zoomIn:p,pathIn:v,scaleInY:l,scaleInX:f,fanIn:x,fadeIn:m},leave:{lineWidthOut:h,zoomOut:d,pathOut:g,fadeOut:b},appear:{clipIn:y,zoomIn:p,pathIn:v,scaleInY:l,scaleInX:f,fanIn:x,fadeIn:m},update:{fadeIn:m,fanIn:x}}},function(t,e,n){var r=n(0),i=n(112),o,a=r.MatrixUtil.mat3;function s(t,e){var n=[];if(!1===t.get("animate"))return[];var i=t.get("children");return r.each(i,function(t){if(t.isGroup)n=n.concat(s(t,e));else if(t.isShape&&t._id){var r=t._id;(r=r.split("-")[0])===e&&n.push(t)}}),n}function u(t){var e={};return r.each(t,function(t){if(t._id&&!t.isClip){var n=t._id;e[n]={_id:n,type:t.get("type"),attrs:r.cloneDeep(t.attr()),name:t.name,index:t.get("index"),animateCfg:t.get("animateCfg"),coord:t.get("coord")}}}),e}function c(t,e,n,r){var o;return o=r?i.Action[n][r]:i.getAnimation(t,e,n)}function l(t,e,n){var o=i.getAnimateCfg(t,e);return n&&n[e]?r.deepMix({},o,n[e]):o}function f(t,e,n,i){var o,s,u=!1;if(i){var f=[],h=[];r.each(e,function(e){var n=t[e._id];n?(e.setSilent("cacheShape",n),f.push(e),delete t[e._id]):h.push(e)}),r.each(t,function(t){var e=t.name,i=t.coord,f=t._id,h=t.attrs,p=t.index,d=t.type;if(s=l(e,"leave",t.animateCfg),o=c(e,i,"leave",s.animation),r.isFunction(o)){var v=n.addShape(d,{attrs:h,index:p});if(v._id=f,v.name=e,i&&"label"!==e){var g=v.getMatrix(),y=a.multiply([],g,i.matrix);v.setMatrix(y)}u=!0,o(v,s,i)}}),r.each(f,function(t){var e=t.name,n=t.get("coord"),i=t.get("cacheShape").attrs;if(!r.isEqual(i,t.attr())){if(s=l(e,"update",t.get("animateCfg")),o=c(e,n,"update",s.animation),r.isFunction(o))o(t,s,n);else{var a=r.cloneDeep(t.attr());t.attr(i),t.animate(a,s.duration,s.easing,function(){t.setSilent("cacheShape",null)})}u=!0}}),r.each(h,function(t){var e=t.name,n=t.get("coord");s=l(e,"enter",t.get("animateCfg")),o=c(e,n,"enter",s.animation),r.isFunction(o)&&(o(t,s,n),u=!0)})}else r.each(e,function(t){var e=t.name,n=t.get("coord");s=l(e,"appear",t.get("animateCfg")),o=c(e,n,"appear",s.animation),r.isFunction(o)&&(o(t,s,n),u=!0)});return u}t.exports={execAnimation:function t(e,n){var r=e.get("middlePlot"),i=e.get("backPlot"),o=e.get("_id"),a=e.get("canvas"),c=a.get(o+"caches")||[];0===c.length&&(n=!1);var l=s(r,o),h=s(i,o),p=l.concat(h),d;a.setSilent(o+"caches",u(p)),(d=f(c,n?p:l,a,n))||a.draw()}}},function(t,e,n){var r=n(0),i,o=n(29).Axis,a=r.MatrixUtil.vec2;function s(t){var e=[];if(t.length>0){var n=(e=t.slice(0))[0],r=e[e.length-1];0!==n.value&&e.unshift({value:0}),1!==r.value&&e.push({value:1})}return e}function u(t,e,n){var r=[];return t.length<1?r:(t.length>=2&&e&&n&&r.push({text:"",tickValue:"",value:0}),0!==t[0].value&&r.push({text:"",tickValue:"",value:0}),1!==(r=r.concat(t))[r.length-1].value&&r.push({text:"",tickValue:"",value:1}),r)}function c(t,e){return void 0===e&&(e=0),"middle"===t&&(e=.5),-1!==t.indexOf("%")&&(e=parseInt(t,10)/100),e}var l=function(){function t(t){this.visible=!0,this.canvas=null,this.container=null,this.coord=null,this.options=null,this.axes=[],r.mix(this,t)}var e=t.prototype;return e._isHide=function t(e){var n=this.options;return!(!n||!1!==n[e])},e._getMiddleValue=function t(e,n,r,i){if(0===e&&!i)return 0;if(1===e)return 1;var o=n[r+1].value;return i||1!==o?(e+o)/2:1},e._getLineRange=function t(e,n,r,i){var o,a,s,u=n.field,l=this.options,f="";if(l[u]&&l[u].position&&(f=l[u].position),"x"===r){var h="top"===f?1:0;o={x:0,y:h=c(f,h)},a={x:1,y:h},s=!1}else{if(i){var p="left"===f?0:1;o={x:p=c(f,p),y:0},a={x:p,y:1}}else{var d="right"===f?1:0;o={x:d=c(f,d),y:0},a={x:d,y:1}}s=!0}return{start:o=e.convert(o),end:a=e.convert(a),isVertical:s}},e._getLineCfg=function t(e,n,r,i){var o,a=this._getLineRange(e,n,r,i),s=a.isVertical,u=a.start,c=a.end,l=e.center;return e.isTransposed&&(s=!s),{isVertical:s,factor:o=s&&u.x>l.x||!s&&u.y>l.y?1:-1,start:u,end:c}},e._getCircleCfg=function t(e){var n={},r=e.x,i=e.y,o=i.start>i.end,s;s=e.isTransposed?{x:o?0:1,y:0}:{x:0,y:o?0:1},s=e.convert(s);var u=e.circleCentre,c=[s.x-u.x,s.y-u.y],l=[1,0],f,h=(f=s.y>u.y?a.angle(c,l):-1*a.angle(c,l))+(r.end-r.start);return n.startAngle=f,n.endAngle=h,n.center=u,n.radius=Math.sqrt(Math.pow(s.x-u.x,2)+Math.pow(s.y-u.y,2)),n.inner=e.innerRadius||0,n},e._getRadiusCfg=function t(e){var n,r=e.x.start<0?-1:1,i,o;return e.isTransposed?(i={x:0,y:0},o={x:1,y:0}):(i={x:0,y:0},o={x:0,y:1}),{factor:r,start:e.convert(i),end:e.convert(o)}},e._getAxisPosition=function t(e,n,r,i){var o="",a=this.options;if(a[i]&&a[i].position)o=a[i].position;else{var s=e.type;e.isRect?"x"===n?o="bottom":"y"===n&&(o=r?"right":"left"):o="helix"===s?"helix":"x"===n?e.isTransposed?"radius":"circle":e.isTransposed?"circle":"radius"}return o},e._getAxisDefaultCfg=function t(e,n,i,o){var a=this,s=this.viewTheme,u={},c=this.options,l=n.field;if((u=r.deepMix({},s.axis[o],u,c[l])).viewTheme=s,u.title){var f=r.isPlainObject(u.title)?u.title:{};f.text=f.text||n.alias||l,r.deepMix(u,{title:f})}return u.ticks=n.getTicks(),e.isPolar&&!n.isCategory&&"x"===i&&Math.abs(e.endAngle-e.startAngle)===2*Math.PI&&u.ticks.pop(),u.coord=e,u.label&&r.isNil(u.label.autoRotate)&&(u.label.autoRotate=!0),c.hasOwnProperty("xField")&&c.xField.hasOwnProperty("grid")&&"left"===u.position&&r.deepMix(u,c.xField),u},e._getAxisCfg=function t(e,n,i,o,a,c){void 0===a&&(a="");var l=this,f=l._getAxisPosition(e,o,a,n.field),h=l._getAxisDefaultCfg(e,n,o,f);if(!r.isEmpty(h.grid)&&i){var p=[],d=[],v=s(i.getTicks());if(v.length){var g=u(h.ticks,n.isLinear,"center"===h.grid.align);r.each(g,function(t,i){d.push(t.tickValue);var s=[],u=t.value;if("center"===h.grid.align&&(u=l._getMiddleValue(u,g,i,n.isLinear)),!r.isNil(u)){var f=e.x,y=e.y;r.each(v,function(t){var n="x"===o?u:t.value,r="x"===o?t.value:u,i=e.convert({x:n,y:r});if(e.isPolar){var a=e.circleCentre;y.start>y.end&&(r=1-r),i.flag=f.start>f.end?0:1,i.radius=Math.sqrt(Math.pow(i.x-a.x,2)+Math.pow(i.y-a.y,2))}s.push(i)}),p.push({_id:c+"-"+o+a+"-grid-"+t.tickValue,points:s})}})}h.grid.items=p,h.grid.tickValues=d}return h.type=n.type,h},e._getHelixCfg=function t(e){for(var n={},r=e.a,i=e.startAngle,o=e.endAngle,a=100,s=[],u=0;u<=100;u++){var c=e.convert({x:u/100,y:0});s.push(c.x),s.push(c.y)}var l=e.convert({x:0,y:0});return n.a=r,n.startAngle=i,n.endAngle=o,n.crp=s,n.axisStart=l,n.center=e.center,n.inner=e.y.start,n},e._drawAxis=function t(e,n,i,a,s,u,c){var l=this.container,f=this.canvas,h,p;"cartesian"===e.type?(h=o.Line,p=this._getLineCfg(e,n,a,c)):"helix"===e.type&&"x"===a?(h=o.Helix,p=this._getHelixCfg(e)):"x"===a?(h=o.Circle,p=this._getCircleCfg(e)):(h=o.Line,p=this._getRadiusCfg(e));var d=this._getAxisCfg(e,n,i,a,c,s);d=r.mix({},d,p),"y"===a&&u&&"circle"===u.get("type")&&(d.circle=u),d._id=s+"-"+a,r.isNil(c)||(d._id=s+"-"+a+c),r.mix(d,{canvas:f,group:l});var v=new h(d);return v.render(),this.axes.push(v),v},e.createAxis=function t(e,n,i){var o=this,a=this.coord,s=a.type,u;"theta"===s||"polar"===s&&a.isTransposed||(e&&!o._isHide(e.field)&&(u=o._drawAxis(a,e,n[0],"x",i)),r.isEmpty(n)||"helix"===s||r.each(n,function(t,n){o._isHide(t.field)||o._drawAxis(a,t,e,"y",i,u,n)}))},e.changeVisible=function t(e){var n=this.axes;r.each(n,function(t){t.set("visible",e)})},e.clear=function t(){var e=this,n=this.axes;r.each(n,function(t){t.clear()}),this.axes=[]},t}();t.exports=l},function(t,e,n){var r=n(0),i=n(258),o=function(){function t(t){this.type="rect",this.actions=[],this.cfg={},r.mix(this,t),this.option=t||{}}var e=t.prototype;return e.reset=function t(e){return this.actions=e.actions||[],this.type=e.type,this.cfg=e.cfg,this.option.actions=this.actions,this.option.type=this.type,this.option.cfg=this.cfg,this},e._execActions=function t(e){var n=this.actions;r.each(n,function(t){var n=t[0];e[n](t[1],t[2])})},e.hasAction=function t(e){var n=this.actions,i=!1;return r.each(n,function(t){if(e===t[0])return i=!0,!1}),i},e.createCoord=function t(e,n){var o=this,a=this.type,s=this.cfg,u,c,l=r.mix({start:e,end:n},s);return"theta"===a?(u=i.Polar,this.hasAction("transpose")||this.transpose(),(c=new u(l)).type=a):c=new(u=i[r.upperFirst(a||"")]||i.Rect)(l),this._execActions(c),c},e.rotate=function t(e){return e=e*Math.PI/180,this.actions.push(["rotate",e]),this},e.reflect=function t(e){return this.actions.push(["reflect",e]),this},e.scale=function t(e,n){return this.actions.push(["scale",e,n]),this},e.transpose=function t(){return this.actions.push(["transpose"]),this},t}();t.exports=o},function(t,e,n){var r=n(0);function i(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isNil(n)&&r.isNil(i)?r.isEqual(t,e):r.isEqual(n,i)}function o(t){t.shape&&t.shape.get("origin")&&(t.data=t.shape.get("origin"))}var a=function(){function t(t){this.view=null,this.canvas=null,r.assign(this,t),this._init()}var e=t.prototype;return e._init=function t(){this.pixelRatio=this.canvas.get("pixelRatio")},e._getShapeEventObj=function t(e){return{x:e.x/this.pixelRatio,y:e.y/this.pixelRatio,target:e.target,toElement:e.event.toElement||e.event.relatedTarget}},e._getShape=function t(e,n){var r,i;return this.view.get("canvas").getShape(e,n)},e._getPointInfo=function t(e){var n=this.view,r={x:e.x/this.pixelRatio,y:e.y/this.pixelRatio},i=n.getViewsByPoint(r);return r.views=i,r},e._getEventObj=function t(e,n,r){return{x:n.x,y:n.y,target:e.target,toElement:e.event.toElement||e.event.relatedTarget,views:r}},e.bindEvents=function t(){var e=this.canvas;e.on("mousedown",r.wrapBehavior(this,"onDown")),e.on("mousemove",r.wrapBehavior(this,"onMove")),e.on("mouseleave",r.wrapBehavior(this,"onOut")),e.on("mouseup",r.wrapBehavior(this,"onUp")),e.on("click",r.wrapBehavior(this,"onClick")),e.on("dblclick",r.wrapBehavior(this,"onClick")),e.on("touchstart",r.wrapBehavior(this,"onTouchstart")),e.on("touchmove",r.wrapBehavior(this,"onTouchmove")),e.on("touchend",r.wrapBehavior(this,"onTouchend"))},e._triggerShapeEvent=function t(e,n,r){if(e&&e.name&&!e.get("destroyed")){var i=this.view;if(i.isShapeInView(e)){var o=e.name+":"+n;r.view=i,r.appendInfo=e.get("appendInfo"),i.emit(o,r);var a=i.get("parent");a&&a.emit(o,r)}}},e.onDown=function t(e){var n=this.view,r=this._getShapeEventObj(e);r.shape=this.currentShape,o(r),n.emit("mousedown",r),this._triggerShapeEvent(this.currentShape,"mousedown",r)},e.onMove=function t(e){var n=this,r=this.view,a=this.currentShape;a&&a.get("destroyed")&&(a=null,this.currentShape=null);var s=this._getShape(e.x,e.y)||e.currentTarget,u=this._getShapeEventObj(e);if(u.shape=s,o(u),r.emit("mousemove",u),this._triggerShapeEvent(s,"mousemove",u),a&&!i(a,s)){var c=this._getShapeEventObj(e);c.shape=a,c.toShape=s,o(c),this._triggerShapeEvent(a,"mouseleave",c)}if(s&&!i(a,s)){var l=this._getShapeEventObj(e);l.shape=s,l.fromShape=a,o(l),this._triggerShapeEvent(s,"mouseenter",l)}this.currentShape=s;var f=this._getPointInfo(e),h=this.curViews||[];0===h.length&&f.views.length&&r.emit("plotenter",this._getEventObj(e,f,f.views)),h.length&&0===f.views.length&&r.emit("plotleave",this._getEventObj(e,f,h)),f.views.length&&((u=this._getEventObj(e,f,f.views)).shape=s,o(u),r.emit("plotmove",u)),this.curViews=f.views},e.onOut=function t(e){var n=this,r=this.view,i=this._getPointInfo(e),o=this.curViews||[],a=this._getEventObj(e,i,o);!this.curViews||0===this.curViews.length||a.toElement&&"CANVAS"===a.toElement.tagName||(r.emit("plotleave",a),this.curViews=[])},e.onUp=function t(e){var n=this.view,r=this._getShapeEventObj(e);r.shape=this.currentShape,n.emit("mouseup",r),this._triggerShapeEvent(this.currentShape,"mouseup",r)},e.onClick=function t(e){var n=this,i=this.view,a=this._getShape(e.x,e.y)||e.currentTarget,s=this._getShapeEventObj(e);s.shape=a,o(s),i.emit("click",s),this._triggerShapeEvent(a,e.type,s),this.currentShape=a;var u=this._getPointInfo(e),c=u.views;if(!r.isEmpty(c)){var l=this._getEventObj(e,u,c);if(this.currentShape){var f=this.currentShape;l.shape=f,o(l)}i.emit("plotclick",l),"dblclick"===e.type&&(i.emit("plotdblclick",l),i.emit("dblclick",s))}},e.onTouchstart=function t(e){var n=this.view,r=this._getShape(e.x,e.y)||e.currentTarget,i=this._getShapeEventObj(e);i.shape=r,o(i),n.emit("touchstart",i),this._triggerShapeEvent(r,"touchstart",i),this.currentShape=r},e.onTouchmove=function t(e){var n=this.view,r=this._getShape(e.x,e.y)||e.currentTarget,i=this._getShapeEventObj(e);i.shape=r,o(i),n.emit("touchmove",i),this._triggerShapeEvent(r,"touchmove",i),this.currentShape=r},e.onTouchend=function t(e){var n=this.view,r=this._getShapeEventObj(e);r.shape=this.currentShape,o(r),n.emit("touchend",r),this._triggerShapeEvent(this.currentShape,"touchend",r)},e.clearEvents=function t(){var e=this.canvas;e.off("mousemove",r.getWrapBehavior(this,"onMove")),e.off("mouseleave",r.getWrapBehavior(this,"onOut")),e.off("mousedown",r.getWrapBehavior(this,"onDown")),e.off("mouseup",r.getWrapBehavior(this,"onUp")),e.off("click",r.getWrapBehavior(this,"onClick")),e.off("dblclick",r.getWrapBehavior(this,"onClick")),e.off("touchstart",r.getWrapBehavior(this,"onTouchstart")),e.off("touchmove",r.getWrapBehavior(this,"onTouchmove")),e.off("touchend",r.getWrapBehavior(this,"onTouchend"))},t}();t.exports=a},function(t,e,n){var r=n(0),i=n(270),o=function(){function t(t){this.guides=[],this.options=[],this.xScales=null,this.yScales=null,this.view=null,this.viewTheme=null,this.frontGroup=null,this.backGroup=null,r.mix(this,t)}var e=t.prototype;return e._creatGuides=function t(){var e=this,n=this.options,o=this.xScales,a=this.yScales,s=this.view,u=this.viewTheme;return this.backContainer&&s&&(this.backGroup=this.backContainer.addGroup({viewId:s.get("_id")})),this.frontContainer&&s&&(this.frontGroup=this.frontContainer.addGroup({viewId:s.get("_id")})),n.forEach(function(t){var n=t.type,s=r.deepMix({xScales:o,yScales:a,viewTheme:u},u?u.guide[n]:{},t);n=r.upperFirst(n);var c=new i[n](s);e.guides.push(c)}),e.guides},e.line=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"line"},e)),this},e.arc=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"arc"},e)),this},e.text=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"text"},e)),this},e.image=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"image"},e)),this},e.region=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"region"},e)),this},e.regionFilter=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"regionFilter"},e)),this},e.dataMarker=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"dataMarker"},e)),this},e.dataRegion=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"dataRegion"},e)),this},e.html=function t(e){return void 0===e&&(e={}),this.options.push(r.mix({type:"html"},e)),this},e.render=function t(e){var n=this,i=n.view,o=i&&i.get("data"),a=n._creatGuides();r.each(a,function(t){var r;r=t.get("top")?n.frontGroup||n.frontContainer:n.backGroup||n.backContainer,t.render(e,r,o,i)})},e.clear=function t(){this.options=[],this.reset()},e.changeVisible=function t(e){var n=this.guides;r.each(n,function(t){t.changeVisible(e)})},e.reset=function t(){var e=this.guides;r.each(e,function(t){t.clear()}),this.guides=[],this.backGroup&&this.backGroup.remove(),this.frontGroup&&this.frontGroup.remove()},t}();t.exports=o},function(t,e,n){var r=n(0),i,o=n(29).Legend,a=n(272),s=n(9),u="_origin",c=4.5,l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;function f(t,e,n){var i;return!r.isNil(n)&&(t=n.translate(t),e=n.translate(e),i=n.isCategory?t===e:Math.abs(t-e)<=1)}function h(t,e){var n;return r.each(t,function(t){var r;if(t.get("visible")&&t.getYScale().field===e)return void(n=t)}),n}var p=function(){function t(t){var e=this;this.options={},r.mix(this,t),this.clear();var n=this.chart;this.container=n.get("frontPlot"),this.plotRange=n.get("plotRange")}var e=t.prototype;return e.clear=function t(){var e=this.legends;this.backRange=null,r.each(e,function(t){r.each(t,function(t){t.destroy()})}),this.legends={}},e.getBackRange=function t(){var e=this.backRange;if(!e){e=this.chart.get("backPlot").getBBox();var n=this.plotRange;e.maxX-e.minX0){var a=n.getXScale(),s=n.getYScale(),u=a.field,c=s.field,l=e.get("origin")._origin,f,h=n.get("labelContainer").get("labelsGroup").get("children");r.each(h,function(t){var n=t.get("origin")||[];n[u]===l[u]&&n[c]===l[c]&&(t.set("visible",i),e.set("gLabel",t))})}}},e._bindFilterEvent=function t(e,n){var i=this,o=this.chart,a=n.field;e.on("itemfilter",function(t){var e=t.range;o.filterShape(function(t,n,o){if(!r.isNil(t[a])){var s=t[a]>=e[0]&&t[a]<=e[1];return i._filterLabels(n,o,s),s}return!0});for(var n=o.getAllGeoms()||[],s=function t(r){var i=n[r];"heatmap"===i.get("type")&&l(function(){i.drawWithRange(e)})},u=0;u1?f:r;if("left"===_[0]||"right"===_[0])l=h.br.y,w=this._getXAlign(_[0],c,r,p,y,m),O=n?n.get("group").get("y")+n.getHeight()+b:this._getYAlignVertical(_[1],l,j,p,0,m,u.get("height"));else if("top"===_[0]||"bottom"===_[0])if(O=this._getYAlignHorizontal(_[0],l,r,p,g,m),n){var S=n.getWidth();w=n.get("group").get("x")+S+b}else w=this._getXAlign(_[1],c,j,p,0,m),"right"===_[1]&&(w=h.br.x-j.totalWidth);e.move(w+d,O+v)},e._getXAlign=function t(e,n,r,i,o,a){var s="left"===e?i.minX-o-a[3]:i.maxX+a[1];return"center"===e&&(s=(n-r.totalWidth)/2),s},e._getYAlignHorizontal=function t(e,n,r,i,o,a){var s;return"top"===e?i.minY-o-a[0]:i.maxY+a[2]},e._getYAlignVertical=function t(e,n,r,i,o,a,s){var u="top"===e?i.minY-o-a[0]:n-r.totalHeight;return"center"===e&&(u=(s-r.totalHeight)/2),u},e._getSubRegion=function t(e){var n=0,i=0,o=0,a=0;return r.each(e,function(t){var e=t.getWidth(),r=t.getHeight();n1){var v=Array(p.callback.length-1).fill("");f.color=p.mapping.apply(p,[c].concat(v)).join("")||w.defaultColor}else f.color=p.mapping(c).join("")||w.defaultColor;if(m&&d)if(d.callback&&d.callback.length>1){var y=Array(d.callback.length-1).fill("");x=d.mapping.apply(d,[c].concat(y)).join("")}else x=d.mapping(c).join("");var _,O=s.getShapeFactory(b).getMarkerCfg(x,f);r.isFunction(x)&&(O.symbol=x),g.push({value:o,dataValue:c,checked:h,marker:O})});var M=r.deepMix({},w.legend[S[0]],h[f]||h,{viewId:_.get("_id"),maxLength:E,items:g,container:v,position:[0,0]}),C;if(M.title&&r.deepMix(M,{title:{text:e.alias||e.field}}),l._isTailLegend(h,i))M.chart=l.chart,M.geom=i,C=new a(M);else if(h.useHtml){var P=v.get("canvas").get("el");if(v=h.container,r.isString(v)&&/^\#/.test(v)){var k=v.replace("#","");v=document.getElementById(k)}v||(v=P.parentNode),M.container=v,void 0===M.legendStyle&&(M.legendStyle={}),M.legendStyle.CONTAINER_CLASS={position:"absolute",overflow:"auto","z-index":""===P.style.zIndex?1:parseInt(P.style.zIndex,10)+1},h.flipPage?(M.legendStyle.CONTAINER_CLASS.height="right"===S[0]||"left"===S[0]?E+"px":"auto",M.legendStyle.CONTAINER_CLASS.width="right"!==S[0]&&"left"!==S[0]?E+"px":"auto",C=new o.CatPageHtml(M)):C=new o.CatHtml(M)}else C=new o.Category(M);return l._bindClickEvent(C,e,u),d[c].push(C),C},e._bindChartMove=function t(e){var n=this.chart,i=this.legends;n.on("plotmove",function(t){var n=!1;if(t.target){var o=t.target.get("origin");if(o){var a=o._origin||o[0]._origin,s=e.field;if(a){var u=a[s];r.each(i,function(t){r.each(t,function(t){n=!0,!t.destroyed&&t.activate(u)})})}}}n||r.each(i,function(t){r.each(t,function(t){!t.destroyed&&t.deactivate()})})})},e._addContinuousLegend=function t(e,n,i){var a=this,s=this.legends;s[i]=s[i]||[];var u=this.container,c=e.field,l=e.getTicks(),f=[],h,p,d,v=this.viewTheme;r.each(l,function(t){var r=t.value,i=e.invert(r),o=n.mapping(i).join("");f.push({value:t.tickValue,attrValue:o,color:o,scaleValue:r}),0===r&&(p=!0),1===r&&(d=!0)}),p||f.push({value:e.min,attrValue:n.mapping(0).join(""),color:n.mapping(0).join(""),scaleValue:0}),d||f.push({value:e.max,attrValue:n.mapping(1).join(""),color:n.mapping(1).join(""),scaleValue:1});var g=this.options,y=i.split("-"),m=v.legend[y[0]];(g&&!1===g.slidable||g[c]&&!1===g[c].slidable)&&(m=r.mix({},m,v.legend.gradient));var b=r.deepMix({},m,g[c]||g,{items:f,attr:n,formatter:e.formatter,container:u,position:[0,0]});if(b.title&&r.deepMix(b,{title:{text:e.alias||e.field}}),"color"===n.type)h=new o.Color(b);else{if("size"!==n.type)return;h=g&&"circle"===g.sizeType?new o.CircleSize(b):new o.Size(b)}return this._bindFilterEvent(h,e),s[i].push(h),h},e._isTailLegend=function t(e,n){if(e.hasOwnProperty("attachLast")&&e.attachLast){var r=n.get("type");if("line"===r||"lineStack"===r||"area"===r||"areaStack"===r)return!0}return!1},e._adjustPosition=function t(e,n){var i;if(n)i="right-top";else if(r.isArray(e))i=String(e[0])+"-"+String(e[1]);else{var o=e.split("-");1===o.length?("left"===o[0]&&(i="left-bottom"),"right"===o[0]&&(i="right-bottom"),"top"===o[0]&&(i="top-center"),"bottom"===o[0]&&(i="bottom-center")):i=e}return i},e.addLegend=function t(e,n,r,i){var o=this,a=this.options,s=e.field,u=a[s],c=this.viewTheme;if(!1===u)return null;if(u&&u.custom)this.addCustomLegend(s);else{var l=a.position||c.defaultLegendPosition,f;l=this._adjustPosition(l,this._isTailLegend(a,r)),u&&u.position&&(l=this._adjustPosition(u.position,this._isTailLegend(u,r))),(f=e.isLinear?this._addContinuousLegend(e,n,l):this._addCategoryLegend(e,n,r,i,l))&&(this._bindHoverEvent(f,s),a.reactive&&this._bindChartMove(e))}},e.addCustomLegend=function t(e){var n=this,i=this.chart,a=this.viewTheme,s=this.container,u=this.options;e&&(u=u[e]);var c=u.position||a.defaultLegendPosition;c=this._adjustPosition(c);var l=this.legends;l[c]=l[c]||[];var f=u.items;if(f){var p=i.getAllGeoms();r.each(f,function(t){var e=h(p,t.value);r.isObject(t.marker)?t.marker.radius=t.marker.radius||4.5:t.marker={symbol:t.marker?t.marker:"circle",fill:t.fill,radius:4.5},t.checked=!!r.isNil(t.checked)||t.checked,t.geom=e});var d=i.get("canvas"),v=this.plotRange,g=c.split("-"),y="right"===g[0]||"left"===g[0]?v.bl.y-v.tr.y:d.get("width"),m=r.deepMix({},a.legend[g[0]],u,{maxLength:y,items:f,container:s,position:[0,0]}),b;if(u.useHtml){var x=u.container;if(/^\#/.test(s)){var _=x.replace("#","");x=document.getElementById(_)}else x||(x=s.get("canvas").get("el").parentNode);m.container=x,void 0===m.legendStyle&&(m.legendStyle={}),m.legendStyle.CONTAINER_CLASS||(m.legendStyle.CONTAINER_CLASS={height:"right"===g[0]||"left"===g[0]?y+"px":"auto",width:"right"!==g[0]&&"left"!==g[0]?y+"px":"auto",position:"absolute",overflow:"auto"}),b=u.flipPage?new o.CatPageHtml(m):new o.CatHtml(m)}else b=new o.Category(m);return l[c].push(b),b.on("itemclick",function(t){u.onClick&&u.onClick(t)}),this._bindHoverEvent(b),b}},e.addMixedLegend=function t(e,n){var i=this,o=[];r.each(e,function(t){var e=t.field;r.each(n,function(n){if(n.getYScale()===t&&t.values&&t.values.length>0){var r=n.get("shapeType")||"point",i=n.getDefaultValue("shape")||"circle",a=s.getShapeFactory(r),u={color:n.getDefaultValue("color")},c=a.getMarkerCfg(i,u),l={value:e,marker:c};o.push(l)}})});var a={custom:!0,items:o};this.options=r.deepMix({},a,this.options);var u=this.addCustomLegend();this._bindClickEventForMix(u)},e.alignLegends=function t(){var e=this,n=e.legends,i=e._getRegion(n);e.totalRegion=i;var o=0;return r.each(n,function(t,n){var a=i.subs[o];r.each(t,function(r,i){var o=t[i-1];r.get("useHtml")&&!r.get("autoPosition")||e._alignLegend(r,o,a,n)}),o++}),this},t}();t.exports=p},function(t,e,n){var r=n(144),i=n(0),o=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,a="linear",s="cat",u="time",c=function(){function t(t){this.defs={},this.viewTheme={scales:{}},this.filters={},i.assign(this,t)}var e=t.prototype;return e._getDef=function t(e){var n=this.defs,r=this.viewTheme,o=null;return(r.scales[e]||n[e])&&(o=i.mix({},r.scales[e]),i.each(n[e],function(t,e){i.isNil(t)?delete o[e]:o[e]=t}),this.filters[e]&&(delete o.min,delete o.max)),o},e._getDefaultType=function t(e,n){var r=a,c=i.Array.firstValue(n,e);return i.isArray(c)&&(c=c[0]),o.test(c)?r=u:i.isString(c)&&(r=s),r},e._getScaleCfg=function t(e,n,o){var a={field:n},s=i.Array.values(o,n);if(a.values=s,!r.isCategory(e)&&"time"!==e){var u=i.Array.getRange(s);a.min=u.min,a.max=u.max,a.nice=!0}return"time"===e&&(a.nice=!1),a},e.createScale=function t(e,n){var o=this,a=this._getDef(e),s;if(!n||!n.length)return s=a&&a.type?r[a.type](a):r.identity({value:e,field:e.toString(),values:[e]});var u=i.Array.firstValue(n,e);if(i.isNumber(e)||i.isNil(u)&&!a)s=r.identity({value:e,field:e.toString(),values:[e]});else{var c;a&&(c=a.type),c=c||this._getDefaultType(e,n);var l=this._getScaleCfg(c,e,n);a&&i.mix(l,a),s=r[c](l)}return s},t}();t.exports=c},function(t,e,n){var r=n(0),i=n(9),o,a=n(29).Tooltip,s,u=r.MatrixUtil.vec2,c=["line","area","path","areaStack"],l=["line","area"],f=["marker","showMarker"];function h(t,e){var n=-1;return r.each(t,function(t,i){var o=!0;for(var a in e)if(e.hasOwnProperty(a)&&-1===f.indexOf(a)&&!r.isObject(e[a])&&e[a]!==t[a]){o=!1;break}if(o)return n=i,!1}),n}function p(t,e){if(!t)return!1;var n="";return!!t.className&&-1!==(n=r.isNil(t.className.baseVal)?t.className:t.className.baseVal).indexOf(e)}function d(t,e){for(var n=t.parentNode,r=!1;n&&n!==document.body;){if(p(n,e)){r=!0;break}n=n.parentNode}return r}function v(t){var e=[];return r.each(t,function(t){var n=h(e,t);-1===n?e.push(t):e[n]=t}),e}var g=function(){function t(t){r.assign(this,t),this.timeStamp=0}var e=t.prototype;return e._normalizeEvent=function t(e){var n=this.chart,r=this._getCanvas(),i=r.getPointByClient(e.clientX,e.clientY),o=r.get("pixelRatio");i.x=i.x/o,i.y=i.y/o;var a=n.getViewsByPoint(i);return i.views=a,i},e._getCanvas=function t(){return this.chart.get("canvas")},e._getTriggerEvent=function t(){var e,n=this.options.triggerOn,r;return n&&"mousemove"!==n?"click"===n?r="plotclick":"none"===n&&(r=null):r="plotmove",r},e._getDefaultTooltipCfg=function t(){var e=this,n=this.chart,i=this.viewTheme,o=this.options,a=r.mix({},i.tooltip),s=n.getAllGeoms().filter(function(t){return t.get("visible")}),u=[];r.each(s,function(t){var e=t.get("type"),n=t.get("adjusts"),i=!1;n&&r.each(n,function(t){if("symmetric"===t.type||"Symmetric"===t.type)return i=!0,!1}),-1!==r.indexOf(u,e)||i||u.push(e)});var c=!(!s.length||!s[0].get("coord"))&&s[0].get("coord").isTransposed,f;if(s.length&&s[0].get("coord")&&"cartesian"===s[0].get("coord").type)if("interval"===u[0]&&!1!==o.shared){var h=r.mix({},i.tooltipCrosshairsRect);h.isTransposed=c,f={zIndex:0,crosshairs:h}}else if(r.indexOf(l,u[0])>-1){var p=r.mix({},i.tooltipCrosshairsLine);p.isTransposed=c,f={crosshairs:p}}return r.mix(a,f,{})},e._bindEvent=function t(){var e=this.chart,n=this._getTriggerEvent();n&&(e.on(n,r.wrapBehavior(this,"onMouseMove")),e.on("plotleave",r.wrapBehavior(this,"onMouseOut")))},e._offEvent=function t(){var e=this.chart,n=this._getTriggerEvent();n&&(e.off(n,r.getWrapBehavior(this,"onMouseMove")),e.off("plotleave",r.getWrapBehavior(this,"onMouseOut")))},e._setTooltip=function t(e,n,i,o){var a=this,s=this.tooltip,u=this.prePoint;if(!u||u.x!==e.x||u.y!==e.y){n=v(n),this.prePoint=e;var c=this.chart,l=this.viewTheme,f=r.isArray(e.x)?e.x[e.x.length-1]:e.x,h=r.isArray(e.y)?e.y[e.y.length-1]:e.y;s.get("visible")||c.emit("tooltip:show",{x:f,y:h,tooltip:s});var p=n[0],d=p.title||p.name,g;s.isContentChange(d,n)&&(c.emit("tooltip:change",{tooltip:s,x:f,y:h,items:n}),d=n[0].title||n[0].name,s.setContent(d,n),r.isEmpty(i)?(s.clearMarkers(),s.set("markerItems",[])):!0===this.options.hideMarkers?s.set("markerItems",i):s.setMarkers(i,l.tooltipMarker)),o===this._getCanvas()&&"mini"===s.get("type")?s.hide():(s.setPosition(f,h,o),s.show())}},e.hideTooltip=function t(){var e=this.tooltip,n=this.chart,r=this._getCanvas();this.prePoint=null,e.hide(),n.emit("tooltip:hide",{tooltip:e}),r.draw()},e.onMouseMove=function t(e){if(!r.isEmpty(e.views)){var n=this.timeStamp,i=+new Date,o={x:e.x,y:e.y};i-n>16&&!this.chart.get("stopTooltip")&&(this.showTooltip(o,e.views,e.shape),this.timeStamp=i)}},e.onMouseOut=function t(e){var n=this.tooltip;n.get("visible")&&n.get("follow")&&(e&&e.toElement&&(p(e.toElement,"g2-tooltip")||d(e.toElement,"g2-tooltip"))||this.hideTooltip())},e.renderTooltip=function t(){var e=this;if(!e.tooltip){var n=e.chart,i=e.viewTheme,o=e._getCanvas(),s=e._getDefaultTooltipCfg(),u=e.options,c;(u=r.deepMix({plotRange:n.get("plotRange"),capture:!1,canvas:o,frontPlot:n.get("frontPlot"),viewTheme:i.tooltip,backPlot:n.get("backPlot")},s,u)).crosshairs&&"rect"===u.crosshairs.type&&(u.zIndex=0),u.visible=!1,"mini"===u.type?(u.crosshairs=!1,u.position="top",c=new a.Mini(u)):c=u.useHtml?new a.Html(u):new a.Canvas(u),e.tooltip=c;var l=e._getTriggerEvent();if(!c.get("enterable")&&"plotmove"===l){var f=c.get("container");f&&(f.onmousemove=function(t){var r=e._normalizeEvent(t);n.emit(l,r)})}e._bindEvent()}},e.showTooltip=function t(e,n,i){var o=this;if(!r.isEmpty(n)&&e){this.tooltip||this.renderTooltip();var a=o.options,s=[],l=[];if(r.each(n,function(t){if(!t.get("tooltipEnable"))return!0;var n=t.get("geoms"),i=t.get("coord");r.each(n,function(t){var n=t.get("type");if(t.get("visible")&&!1!==t.get("tooltipCfg")){var u=t.get("dataArray");if(t.isShareTooltip()||!1===a.shared&&r.inArray(["area","line","path","polygon"],n))r.each(u,function(u){var f=t.findPoint(e,u);if(f){var h=t.getTipItems(f,a.title);r.each(h,function(e){var a=e.point;if(a&&a.x&&a.y){var u=r.isArray(a.x)?a.x[a.x.length-1]:a.x,l=r.isArray(a.y)?a.y[a.y.length-1]:a.y;a=i.applyMatrix(u,l,1),e.x=a[0],e.y=a[1],e.showMarker=!0;var f=o._getItemMarker(t,e.color);e.marker=f,-1!==r.indexOf(c,n)&&s.push(e)}}),l=l.concat(h)}});else{var f=t.get("shapeContainer"),h,p=f.get("canvas").get("pixelRatio"),d=f.getShape(e.x*p,e.y*p);d&&d.get("visible")&&d.get("origin")&&(l=t.getTipItems(d.get("origin"),a.title))}}}),r.each(l,function(t){var e=t.point,n=r.isArray(e.x)?e.x[e.x.length-1]:e.x,o=r.isArray(e.y)?e.y[e.y.length-1]:e.y;e=i.applyMatrix(n,o,1),t.x=e[0],t.y=e[1]})}),l.length){var f=l[0];if(!l.every(function(t){return t.title===f.title})){var h=f,p=1/0;l.forEach(function(t){var n=u.distance([e.x,e.y],[t.x,t.y]);n1){var d=l[0],v=Math.abs(e.y-d.y);r.each(l,function(t){Math.abs(e.y-t.y)<=v&&(d=t,v=Math.abs(e.y-t.y))}),d&&d.x&&d.y&&(s=[d]),l=[d]}o._setTooltip(e,l,s,i)}else o.hideTooltip()}},e.clear=function t(){var e=this.tooltip;e&&e.destroy(),this.tooltip=null,this.prePoint=null,this._offEvent()},e._getItemMarker=function t(e,n){var r=e.get("shapeType")||"point",o=e.getDefaultValue("shape")||"circle",a,s={color:n},u;return i.getShapeFactory(r).getMarkerCfg(o,s)},t}();t.exports=g},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(113),a=n(8),s=n(0),u=n(115),c=n(5),l=n(122),f="_origin",h=n(261);function p(t){var e=t.startAngle,n=t.endAngle;return!(!s.isNil(e)&&!s.isNil(n)&&n-e<2*Math.PI)}function d(t,e,n){var r=(t-e)/(n-e);return r>=0&&r<=1}function v(t,e){var n=!1,r;if(t)if("theta"===t.type){var i=t.start,o=t.end;n=d(e.x,i.x,o.x)&&d(e.y,i.y,o.y)}else{var a=t.invert(e);n=a.x>=0&&a.y>=0&&a.x<=1&&a.y<=1}return n}var g={};s.each(a,function(t,e){var n=s.lowerFirst(e);g[n]=function(e){var n=new t(e);return this.addGeom(n),n}});var y=function(t){r(n,t);var e=n.prototype;function n(e){var n,r=i(i(n=t.call(this,e)||this));return r._setTheme(),s.each(a,function(t,e){var n=s.lowerFirst(e);r[n]=function(e){void 0===e&&(e={}),e.viewTheme=r.get("viewTheme");var n=new t(e);return r.addGeom(n),n}}),r.init(),n}return e.getDefaultCfg=function t(){return{viewContainer:null,coord:null,start:{x:0,y:0},end:{x:1,y:1},geoms:[],scales:{},options:{},scaleController:null,padding:0,theme:null,parent:null,tooltipEnable:!0,animate:c.animate,visible:!0}},e._setTheme=function t(){var e=this,n=this.get("theme"),r={},i={};s.isObject(n)?i=n:-1!==s.indexOf(Object.keys(l),n)&&(i=l[n]),s.deepMix(r,c,i),this.set("viewTheme",r)},e.init=function t(){this._initViewPlot(),this.get("data")&&this._initData(this.get("data")),this._initOptions(),this._initControllers(),this._bindEvents()},e._initOptions=function t(){var e=this,n=s.mix({},e.get("options"));n.scales||(n.scales={}),n.coord||(n.coord={}),!1===n.animate&&this.set("animate",!1),(!1===n.tooltip||s.isNull(n.tooltip))&&this.set("tooltipEnable",!1),n.geoms&&n.geoms.length&&s.each(n.geoms,function(t){e._createGeom(t)});var r=e.get("scaleController");r&&(r.defs=n.scales);var i=e.get("coordController");i&&i.reset(n.coord),this.set("options",n)},e._createGeom=function t(e){var n=e.type,r;this[n]&&(r=this[n](),s.each(e,function(t,e){var n;r[e]&&(s.isObject(t)&&t.field?"label"===t?r[e](t.field,t.callback,t.cfg):(s.each(t,function(t,e){"field"!==e&&(n=t)}),r[e](t.field,n)):r[e](t))}))},e._initControllers=function t(){var e=this,n=this.get("options"),r=this.get("viewTheme"),i=this.get("canvas"),o=new u.Scale({viewTheme:r,defs:n.scales}),a=new u.Coord(n.coord);this.set("scaleController",o),this.set("coordController",a);var s=new u.Axis({canvas:i,viewTheme:r});this.set("axisController",s);var c=new u.Guide({viewTheme:r,options:n.guides||[]});this.set("guideController",c)},e._initViewPlot=function t(){this.get("viewContainer")||this.set("viewContainer",this.get("middlePlot"))},e._initGeoms=function t(){for(var e=this.get("geoms"),n=this.get("filteredData"),r=this.get("coord"),i=this.get("_id"),o=0;o0;){var r;n.shift().destroy()}},e._drawGeoms=function t(){this.emit("beforedrawgeoms");for(var e=this.get("geoms"),n=this.get("coord"),r=0;r0?a.change({min:0}):c<=0&&a.change({max:0}))}}},e._setCatScalesRange=function t(){var e=this,n=this.get("coord"),r=this.get("viewTheme"),i=this.getXScale(),o=this.getYScales(),a=[];i&&a.push(i),a=a.concat(o);var u=n.isPolar&&p(n),c,l=this.get("scaleController").defs;s.each(a,function(t){if((t.isCategory||t.isIdentity)&&t.values&&(!l[t.field]||!l[t.field].range)){var e=t.values.length,i;if(1===e)i=[.5,1];else{var o=1,a=0;i=u?n.isTransposed?[(a=1/e*(o=r.widthRatio.multiplePie))/2,1-a/2]:[0,1-1/e]:[a=1/e*1/2,1-a]}t.range=i}})},e.getXScale=function t(){var e=this.get("geoms"),n=null;return s.isEmpty(e)||(n=e[0].getXScale()),n},e.getYScales=function t(){for(var e=this.get("geoms"),n=[],r=0;rc&&(c=e),e0){var v=l[f-1],g=l[f];v.pos+v.size>g.pos&&(v.size+=g.size,v.targets=v.targets.concat(g.targets),l.splice(f,1),r=!0)}}f=0;var y=this.get("itemsGroup").addGroup();l.forEach(function(t){var r=o+s;t.targets.forEach(function(){var i=e[f].attr("matrix")[7],o=t.pos+r-s/2,a;Math.abs(i-o)>s/2&&n._adjustDenote(y,o,i-n.get("group").attr("matrix")[7]/2),e[f].translate(0,-i),e[f].translate(0,o),r+=s,f++})})},e}(o.Legend.Category);t.exports=c},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(0),o,a,s="auto",u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function t(){return{type:"plotBack",padding:null,background:null,plotRange:null,plotBackground:null}},n._beforeRenderUI=function t(){this._calculateRange()},n._renderUI=function t(){this._renderBackground(),this._renderPlotBackground()},n._renderBackground=function t(){var e=this,n=this.get("background");if(n){var r=this.get("canvas"),o,a,s={x:0,y:0,width:this.get("width")||r.get("width"),height:this.get("height")||r.get("height")},u=this.get("backgroundShape");u?u.attr(s):(u=this.addShape("rect",{attrs:i.mix(s,n)}),this.set("backgroundShape",u))}},n._renderPlotBackground=function t(){var e=this,n=this.get("plotBackground");if(n){var r=this.get("plotRange"),o=r.br.x-r.bl.x,a=r.br.y-r.tr.y,s=r.tl,u={x:s.x,y:s.y,width:o,height:a},c=this.get("plotBackShape");c?c.attr(u):(n.image?(u.img=n.image,c=this.addShape("image",{attrs:u})):(i.mix(u,n),c=this.addShape("rect",{attrs:u})),this.set("plotBackShape",c))}},n._convert=function t(e,n){if(i.isString(e))if("auto"===e)e=0;else if(-1!==e.indexOf("%")){var r=this.get("canvas"),o=this.get("width")||r.get("width"),a=this.get("height")||r.get("height");e=parseInt(e,10)/100,e=n?e*o:e*a}return e},n._calculateRange=function t(){var e=this,n=this.get("plotRange");i.isNil(n)&&(n={});var r=this.get("padding"),o=this.get("canvas"),a=this.get("width")||o.get("width"),s=this.get("height")||o.get("height"),u=i.toAllPadding(r),c=this._convert(u[0],!1),l=this._convert(u[1],!0),f=this._convert(u[2],!1),h=this._convert(u[3],!0),p=Math.min(h,a-l),d=Math.max(h,a-l),v=Math.min(s-f,c),g=Math.max(s-f,c);n.tl={x:p,y:v},n.tr={x:d,y:v},n.bl={x:p,y:g},n.br={x:d,y:g},n.cc={x:(d+p)/2,y:(g+v)/2},this.set("plotRange",n)},n.repaint=function t(){return this._calculateRange(),this._renderBackground(),this._renderPlotBackground(),this},e}(n(25).Group);t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i;function o(t,e,n){return{x:t.x+e*Math.cos(n),y:t.y+e*Math.sin(n)}}var a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="circle",n},n.getRegion=function t(e,n){var r=.5,i=2*Math.PI/e,a=-1*Math.PI/2+i*n,s=r/(1+1/Math.sin(i/2)),u,c=o({x:.5,y:.5},r-s,a),l=5*Math.PI/4,f=1*Math.PI/4;return{start:o(c,s,l),end:o(c,s,f)}},n.generateFacets=function t(e){var n=this,r,i=n.fields[0];if(!i)throw"Please specify for the field for facet!";var o=n.getFieldValues(i,e),a=o.length,s=[];return o.forEach(function(t,r){var u=[{field:i,value:t,values:o}],c=n.getFilter(u),l=e.filter(c),f={type:n.type,colValue:t,colField:i,colIndex:r,cols:a,rows:1,rowIndex:0,data:l,region:n.getRegion(a,r)};s.push(f)}),s},e}(n(43));t.exports=a},function(t,e,n){var r=n(0),i=n(114),o={};o.Rect=n(117),o.List=n(116),o.Circle=n(274),o.Tree=n(278),o.Mirror=n(277),o.Matrix=n(276),i.prototype.facet=function(t,e){var n=o[r.upperFirst(t)];if(!n)throw new Error("Not support such type of facets as: "+t);var i=this.get("facets");i&&i.destroy(),e.chart=this;var a=new n(e);this.set("facets",a)},t.exports=o},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i,o=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="matrix",n.showTitle=!1,n},n.generateFacets=function t(e){for(var n=this,r=this.fields,i=r.length,o=i,a=[],s=0;s=0;a--)for(var s=n.getFacetsByLevel(e,a),u=0;ua&&(a=e),e=e[0]}));for(var p=this._getScale(u),v=0;vf&&(f=t.y),t.yc&&(c=f-u);o;)for(p.forEach(function(t){var e=(Math.min.apply(h,t.targets)+Math.max.apply(h,t.targets))/2;t.pos=Math.min(Math.max(h,e-t.size/2),c-t.size)}),o=!1,l=p.length;l--;)if(l>0){var d=p[l-1],v=p[l];d.pos+d.size>v.pos&&(d.size+=v.size,d.targets=d.targets.concat(v.targets),d.pos+d.size>c&&(d.pos=c-d.size),p.splice(l,1),o=!0)}l=0,p.forEach(function(n){var r=u+e/2;n.targets.forEach(function(){t[l].y=n.pos+r,r+=e,l++})}),t.forEach(function(t){var e=t.r*t.r,n=Math.pow(Math.abs(t.y-r.y),2);if(e0&&(n=this._distribute(n,i)),t.prototype.adjustItems.call(this,n)},n._distribute=function t(e,n){var r=this,i=this.get("coord"),o=i.getRadius(),a=this.get("label").labelHeight,s=i.getCenter(),u,c=2*(o+n)+2*a,f={start:i.start,end:i.end},h=this.get("geom");if(h){var p=h.get("view");f=p.getViewRegion()}var d=[[],[]];return e.forEach(function(t){t&&("right"===t.textAlign?d[0].push(t):d[1].push(t))}),d.forEach(function(t,e){var n=parseInt(c/a,10);t.length>n&&(t.sort(function(t,e){return e["..percent"]-t["..percent"]}),t.splice(n,t.length-n)),t.sort(function(t,e){return t.y-e.y}),l(t,a,f,s,e)}),d[0].concat(d[1])},n.lineToLabel=function t(e){var n=this,r=this.get("coord"),i=r.getRadius(),o=e.offset,a=e.orignAngle||e.angle,s=r.getCenter(),u=c(s,a,i+2.5),l=c(s,a,i+o/2);e.labelLine||(e.labelLine=this.get("label").labelLine||{}),e.labelLine.path=["M"+u.x,u.y+" Q"+l.x,l.y+" "+e.x,e.y].join(",")},n.getLabelRotate=function t(e,n){var r;return n<0&&((r=180*e/Math.PI)>90&&(r-=180),r<-90&&(r+=180)),r/180*Math.PI},n.getLabelAlign=function t(e){var n=this,r,i=this.get("coord").getCenter(),o,a;return o=e.angle<=Math.PI/2&&e.x>=i.x?"left":"right",this.getDefaultOffset(e)<=0&&(o="right"===o?"left":"right"),o},n.getArcPoint=function t(e){return e},n.getPointAngle=function t(e){var n=this,r=this.get("coord"),o={x:i.isArray(e.x)?e.x[0]:e.x,y:e.y[0]};this.transLabelPoint(o);var s={x:i.isArray(e.x)?e.x[1]:e.x,y:e.y[1]},u;this.transLabelPoint(s);var c=a.getPointAngle(r,o);if(e.points&&e.points[0].y===e.points[1].y)u=c;else{var l=a.getPointAngle(r,s);c>=l&&(l+=2*Math.PI),u=c+(l-c)/2}return u},n.getCirclePoint=function t(e,n){var r=this,i=this.get("coord"),o=i.getCenter(),a=i.getRadius()+n,s=c(o,e,a);return s.angle=e,s.r=a,s},e}(o);t.exports=f},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),o=n(120);n(297);var a=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="line",n.sortable=!0,n},e}(o),s=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.hasDefaultAdjust=!0,n.adjusts=[{type:"stack"}],n},e}(a);a.Stack=s,i.Line=a,i.LineStack=s,t.exports=a},function(t,e,n){var r=n(0),i="_origin";function o(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isEqual(n,i)}function a(t,e){if(!t)return!0;if(t.length!==e.length)return!0;var n=!1;return r.each(e,function(e,r){if(!o(e,t[r]))return n=!0,!1}),n}function s(t,e){var n={};return r.each(t,function(t,i){var o=e.attr(i);r.isArray(o)&&(o=r.cloneDeep(o)),n[i]=o}),n}var u={_isAllowActive:function t(){var e=this.get("allowActive");if(!r.isNil(e))return e;var n=this.get("view"),i=this.isShareTooltip(),o;return!1===n.get("options").tooltip||!i},_onMouseenter:function t(e){var n=this,r=e.shape,i=this.get("shapeContainer");r&&i.contain(r)&&this._isAllowActive()&&this.setShapesActived(r)},_onMouseleave:function t(){var e=this,n,r=this.get("view").get("canvas");this.get("activeShapes")&&(this.clearActivedShapes(),r.draw())},_bindActiveAction:function t(){var e=this,n=this.get("view"),i=this.get("type");n.on(i+":mouseenter",r.wrapBehavior(this,"_onMouseenter")),n.on(i+":mouseleave",r.wrapBehavior(this,"_onMouseleave"))},_offActiveAction:function t(){var e=this,n=this.get("view"),i=this.get("type");n.off(i+":mouseenter",r.getWrapBehavior(this,"_onMouseenter")),n.off(i+":mouseleave",r.getWrapBehavior(this,"_onMouseleave"))},_setActiveShape:function t(e){var n=this,i=this.get("activedOptions")||{},o=e.get("origin"),a=o.shape||this.getDefaultValue("shape");r.isArray(a)&&(a=a[0]);var u=this.get("shapeFactory"),c=r.mix({},e.attr(),{origin:o}),l=u.getActiveCfg(a,c);i.style&&r.mix(l,i.style);var f=s(l,e);e.setSilent("_originAttrs",f),i.animate?e.animate(l,300):e.attr(l),e.set("zIndex",1)},setShapesActived:function t(e){var n=this;r.isArray(e)||(e=[e]);var i=n.get("activeShapes");if(a(i,e)){var o,s=n.get("view").get("canvas"),u=n.get("shapeContainer"),c=n.get("activedOptions");c&&c.highlight?(r.each(e,function(t){t.get("animating")&&t.stopAnimate()}),n.highlightShapes(e)):(i&&n.clearActivedShapes(),r.each(e,function(t){t.get("animating")&&t.stopAnimate(),t.get("visible")&&!t.get("selected")&&n._setActiveShape(t)})),n.set("activeShapes",e),u.sort(),s.draw()}},clearActivedShapes:function t(){var e=this,n=this.get("shapeContainer"),i=this.get("activedOptions"),o=i&&i.animate;if(n&&!n.get("destroyed")){var a=this.get("activeShapes"),s,u;if(r.each(a,function(t){if(!t.get("selected")){var e=t.get("_originAttrs");o?(t.stopAnimate(),t.animate(e,300)):t.attr(e),t.setZIndex(0),t.set("_originAttrs",null)}}),this.get("preHighlightShapes")){var c=n.get("children");r.each(c,function(t){if(!t.get("selected")){var e=t.get("_originAttrs");e&&(o?(t.stopAnimate(),t.animate(e,300)):t.attr(e),t.setZIndex(0),t.set("_originAttrs",null))}})}n.get("children").sort(function(t,e){return t._INDEX-e._INDEX}),this.set("activeShapes",null),this.set("preHighlightShapes",null)}},getGroupShapesByPoint:function t(e){var n=this,i,o=[];if(this.get("shapeContainer")){var a=this.getXScale().field,s=this.getShapes(),u=this._getOriginByPoint(e);r.each(s,function(t){var e=t.get("origin"),n;t.get("visible")&&e&&(e._origin[a]===u[a]&&o.push(t))})}return o},getSingleShapeByPoint:function t(e){var n=this,r=this.get("shapeContainer"),i,o=r.get("canvas").get("pixelRatio"),a;if(r&&(a=r.getShape(e.x*o,e.y*o)),a&&a.get("origin"))return a},highlightShapes:function t(e,n){var i=this;r.isArray(e)||(e=[e]);var o=this.get("activeShapes");if(a(o,e)){o&&this.clearActivedShapes();var u=this.getShapes(),c=this.get("activedOptions"),l=c&&c.animate,f=c&&c.style;r.each(u,function(t){var i={};t.stopAnimate(),-1!==r.indexOf(e,t)?(r.mix(i,f,n),t.setZIndex(1)):(r.mix(i,{fillOpacity:.3,opacity:.3}),t.setZIndex(0));var o=s(i,t);t.setSilent("_originAttrs",o),l?t.animate(i,300):t.attr(i)}),this.set("preHighlightShapes",e),this.set("activeShapes",e)}}};t.exports=u},function(t,e,n){var r=n(0),i="_origin";function o(t,e){if(r.isNil(t)||r.isNil(e))return!1;var n=t.get("origin"),i=e.get("origin");return r.isEqual(n,i)}function a(t,e){var n={};return r.each(t,function(t,i){"transform"===i&&(i="matrix");var o=e.attr(i);r.isArray(o)&&(o=r.cloneDeep(o)),n[i]=o}),n}var s={_isAllowSelect:function t(){var e=this.get("allowSelect");if(!r.isNil(e))return e;var n=this.get("type"),i=this.get("coord"),o=i&&i.type;return"interval"===n&&"theta"===o},_onClick:function t(e){var n=this;if(this._isAllowSelect()){this.clearActivedShapes();var r=e.shape,i=this.get("shapeContainer");r&&!r.get("animating")&&i.contain(r)&&this.setShapeSelected(r)}},_bindSelectedAction:function t(){var e=this,n=this.get("view"),i=this.get("type");n.on(i+":click",r.wrapBehavior(this,"_onClick"))},_offSelectedAction:function t(){var e=this,n=this.get("view"),i=this.get("type");n.off(i+":click",r.getWrapBehavior(this,"_onClick"))},_setShapeStatus:function t(e,n){var i=this,o=this.get("view"),s=this.get("selectedOptions")||{},u=!1!==s.animate,c=o.get("canvas");e.set("selected",n);var l=e.get("origin");if(n){var f=l.shape||this.getDefaultValue("shape");r.isArray(f)&&(f=f[0]);var h=this.get("shapeFactory"),p=r.mix({geom:this,point:l},s),d=h.getSelectedCfg(f,p);r.mix(d,p.style),e.get("_originAttrs")||(e.get("animating")&&e.stopAnimate(),e.set("_originAttrs",a(d,e))),u?e.animate(d,300):(e.attr(d),c.draw())}else{var v=e.get("_originAttrs");e.set("_originAttrs",null),u?e.animate(v,300):(e.attr(v),c.draw())}},setShapeSelected:function t(e){var n=this,i=this._getSelectedShapes(),a=this.get("selectedOptions")||{},s=!1!==a.cancelable;if("multiple"===a.mode)-1===r.indexOf(i,e)?(i.push(e),this._setShapeStatus(e,!0)):s&&(r.Array.remove(i,e),this._setShapeStatus(e,!1));else{var u=i[0];s&&(e=o(u,e)?null:e),o(u,e)||(u&&this._setShapeStatus(u,!1),e&&this._setShapeStatus(e,!0))}},clearSelected:function t(){var e=this,n=e.get("shapeContainer");if(n&&!n.get("destroyed")){var i=e._getSelectedShapes();r.each(i,function(t){e._setShapeStatus(t,!1),t.set("_originAttrs",null)})}},setSelected:function t(e){var n=this,i=n.getShapes();return r.each(i,function(t){var r=t.get("origin");r&&r._origin===e&&n.setShapeSelected(t)}),this},_getSelectedShapes:function t(){var e=this,n=this.getShapes(),i=[];return r.each(n,function(t){t.get("selected")&&i.push(t)}),this.set("selectedShapes",i),i}};t.exports=s},function(t,e,n){var r=n(0),i,o=n(5).defaultColor,a="_origin";function s(t){return t.alias||t.field}var u={_getIntervalSize:function t(e){var n=null,i=this.get("type"),o=this.get("coord");if(o.isRect&&("interval"===i||"schema"===i)){n=this.getSize(e._origin);var a=o.isTransposed?"y":"x",s;if(r.isArray(e[a]))n=n(1+i.rangeMax())/2&&(a=i.rangeMin()),n=i.invert(a),i.isCategory&&(n=i.translate(n)),n},_getOriginByPoint:function t(e){var n=this.getXScale(),r=this.getYScale(),i=n.field,o=r.field,a,s=this.get("coord").invert(e),u=n.invert(s.x),c=r.invert(s.y),l={};return l[i]=u,l[o]=c,l},_getScale:function t(e){var n=this,i=this.get("scales"),o=null;return r.each(i,function(t){if(t.field===e)return o=t,!1}),o},_getTipValueScale:function t(){var e=this.getAttrsForLegend(),n;r.each(e,function(t){var e=t.getScale(t.type);if(e.isLinear)return n=e,!1});var i=this.getXScale(),o=this.getYScale();return!n&&o&&"..y"===o.field?i:n||o||i},_getTipTitleScale:function t(e){var n=this;if(e)return this._getScale(e);var i,o=this.getAttr("position").getFields(),a;return r.each(o,function(t){if(-1===t.indexOf(".."))return a=t,!1}),this._getScale(a)},_filterValue:function t(e,n){var i=this.get("coord"),o=this.getYScale(),a=o.field,s,u=i.invert(n).y;u=o.invert(u);var c=e[e.length-1];return r.each(e,function(t){var e=t._origin;if(e[a][0]<=u&&e[a][1]>=u)return c=t,!1}),c},getXDistance:function t(){var e=this,n=this.get("xDistance");if(!n){var i=this.getXScale();if(i.isCategory)n=1;else{var o=i.values,a=i.translate(o[0]),s=a;r.each(o,function(t){(t=i.translate(t))s&&(s=t)});var u=o.length;n=(s-a)/(u-1)}this.set("xDistance",n)}return n},findPoint:function t(e,n){var i=this,o=i.get("type"),a=i.getXScale(),s=i.getYScale(),u=a.field,c=s.field,l=null;if(r.indexOf(["heatmap","point"],o)>-1){var f,h=i.get("coord").invert(e),p=a.invert(h.x),d=s.invert(h.y),v=1/0;return r.each(n,function(t){var e=Math.pow(t._origin[u]-p,2)+Math.pow(t._origin[c]-d,2);e=m){if(!w)return l=t,!1;r.isArray(l)||(l=[]),l.push(t)}}),r.isArray(l)&&(l=this._filterValue(l,e));else{var O;if(a.isLinear||"timeCat"===a.type){if((m>a.translate(_)||ma.max||mMath.abs(a.translate(O._origin[u])-m)&&(y=O)}var C=i.getXDistance();return!l&&Math.abs(a.translate(y._origin[u])-m)<=C/2&&(l=y),l},getTipTitle:function t(e,n){var r="",i=this._getTipTitleScale(n);if(i){var o=e[i.field];r=i.getText(o)}else if("heatmap"===this.get("type")){var a=this.getXScale(),s=this.getYScale(),u,c;r="( "+a.getText(e[a.field])+", "+s.getText(e[s.field])+" )"}return r},getTipValue:function t(e,n){var i,o=n.field,a=e.key;if(i=e[o],r.isArray(i)){var s=[];r.each(i,function(t){s.push(n.getText(t))}),i=s.join("-")}else i=n.getText(i,a);return i},getTipName:function t(e){var n,i,o=this._getGroupScales();if(o.length&&r.each(o,function(t){return i=t,!1}),i){var a=i.field;n=i.getText(e[a])}else{var u;n=s(this._getTipValueScale())}return n},getTipItems:function t(e,n){var i=this,a=e._origin,u=i.getTipTitle(a,n),c=i.get("tooltipCfg"),l=[],f,h;function p(t,n,a){if(!r.isNil(n)&&""!==n){var s={title:u,point:e,name:t||u,value:n,color:e.color||o,marker:!0};s.size=i._getIntervalSize(e),l.push(r.mix({},s,a))}}if(c){var d=c.fields,v=c.cfg,g=[];if(r.each(d,function(t){g.push(a[t])}),v){r.isFunction(v)&&(v=v.apply(null,g));var y=r.mix({},{point:e,title:u,color:e.color||o,marker:!0},v);y.size=i._getIntervalSize(e),l.push(y)}else r.each(d,function(t){if(!r.isNil(a[t])){var e=i._getScale(t);f=s(e),h=e.getText(a[t]),p(f,h)}})}else{var m=i._getTipValueScale();r.isNil(a[m.field])||(h=i.getTipValue(a,m),p(f=i.getTipName(a),h))}return l},isShareTooltip:function t(){var e=this.get("shareTooltip"),n=this.get("type"),i=this.get("view"),o;if(o=i.get("parent")?i.get("parent").get("options"):i.get("options"),"interval"===n){var a=this.get("coord"),s=a.type;("theta"===s||"polar"===s&&a.isTransposed)&&(e=!1)}else this.getYScale()&&!r.inArray(["contour","point","polygon","edge"],n)||(e=!1);return o.tooltip&&r.isBoolean(o.tooltip.shared)&&(e=o.tooltip.shared),e}};t.exports=u},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),o=n(0);n(298);var a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="point",n.shapeType="point",n.generatePoints=!0,n},n.drawPoint=function t(e,n,r,i){var a=this,s=e.shape,u=a.getDrawCfg(e),c;if(a._applyViewThemeShapeStyle(u,s,r),o.isArray(e.y)){var l=a.hasStack();o.each(e.y,function(t,e){u.y=t,u.yIndex=e,l&&0===e||(c=r.drawShape(s,u,n),a.appendShapeInfo(c,i+e))})}else o.isNil(e.y)||(c=r.drawShape(s,u,n),a.appendShapeInfo(c,i))},e}(i),s=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.hasDefaultAdjust=!0,n.adjusts=[{type:"jitter"}],n},e}(a),u=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.hasDefaultAdjust=!0,n.adjusts=[{type:"stack"}],n},e}(a);a.Jitter=s,a.Stack=u,i.Point=a,i.PointJitter=s,i.PointStack=u,t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(8),o=n(0);n(299);var a=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="polygon",n.shapeType="polygon",n.generatePoints=!0,n},n.createShapePointsCfg=function e(n){var r=t.prototype.createShapePointsCfg.call(this,n),i=this,a=r.x,s=r.y,u;if(!o.isArray(a)||!o.isArray(s)){var c=this.getXScale(),l=this.getYScale(),f,h,p=.5/(c.values?c.values.length:c.ticks.length),d=.5/(l.values?l.values.length:l.ticks.length);c.isCategory&&l.isCategory?(a=[a-p,a-p,a+p,a+p],s=[s-d,s+d,s+d,s-d]):o.isArray(a)?(a=[(u=a)[0],u[0],u[1],u[1]],s=[s-d/2,s+d/2,s+d/2,s-d/2]):o.isArray(s)&&(s=[(u=s)[0],u[1],u[1],u[0]],a=[a-p/2,a-p/2,a+p/2,a+p/2]),r.x=a,r.y=s}return r},e}(i);i.Polygon=a,t.exports=a},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var o=n(8),a=n(0),s=n(67);n(300);var u=function(t){r(n,t);var e=n.prototype;function n(e){var n;return n=t.call(this,e)||this,a.assign(i(i(n)),s),n}return e.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.type="schema",n.shapeType="schema",n.generatePoints=!0,n},e.createShapePointsCfg=function e(n){var r=t.prototype.createShapePointsCfg.call(this,n);return r.size=this.getNormalizedSize(n),r},n}(o),c=function(t){function e(){return t.apply(this,arguments)||this}var n;return r(e,t),e.prototype.getDefaultCfg=function e(){var n=t.prototype.getDefaultCfg.call(this);return n.hasDefaultAdjust=!0,n.adjusts=[{type:"dodge"}],n},e}(u);u.Dodge=c,o.Schema=u,o.SchemaDodge=c,t.exports=u},function(t,e,n){var r=n(0),i=n(9),o=n(24),a=n(22),s=n(5);function u(t){var e=s.shape.hollowArea,n=r.mix({},e,t.style);return a.addStrokeAttrs(n,t),r.isNumber(t.size)&&(n.lineWidth=t.size),n}function c(t){var e=s.shape.area,n=r.mix({},e,t.style);return a.addFillAttrs(n,t),t.color&&(n.stroke=n.stroke||t.color),r.isNumber(t.size)&&(n.lineWidth=t.size),n}function l(t,e,n){var i=[],a=[],s=[],u=[],c=t.isInCircle;return r.each(t.points,function(t){s.push(t[1]),u.push(t[0])}),u=u.reverse(),a.push(s,u),r.each(a,function(r,a){var s=[],u=(r=n.parsePoints(r))[0];c&&r.push({x:u.x,y:u.y}),s=e?o.getSplinePath(r,!1,t.constraint):o.getLinePath(r,!1),a>0&&(s[0][0]="L"),i=i.concat(s)}),i.push(["Z"]),i}function f(t){return{symbol:function t(e,n){return[["M",e-5.5,n-4],["L",e+5.5,n-4],["L",e+5.5,n+4],["L",e-5.5,n+4],["Z"]]},radius:5,fill:t.color,fillOpacity:.6}}function h(t,e){var n;if("line"===t||"smoothLine"===t)return{lineWidth:(e.lineWidth||0)+1};var r=e.fillOpacity||e.opacity||1;return{fillOpacity:r-.15,strokeOpacity:r-.15}}function p(t,e,n){var i,o=t._coord.convertPoint(e.points[0][1]);return n.addShape("circle",{attrs:r.mix({x:o.x,y:o.y,r:2,fill:e.color},e.style)})}var d=i.registerFactory("area",{defaultShapeType:"area",getDefaultPoints:function t(e){var n=[],i=e.x,o=e.y,a=e.y0;return o=r.isArray(o)?o:[a,o],r.each(o,function(t){n.push({x:i,y:t})}),n},getActiveCfg:function t(e,n){return h(e,n)},drawShape:function t(e,n,r){var i=this.getShape(e),o;return(o=1===n.points.length&&s.showSinglePoint?p(this,n,r):i.draw(n,r))&&(o.set("origin",n.origin),o._id=n.splitedIndex?n._id+n.splitedIndex:n._id,o.name=this.name),o},getSelectedCfg:function t(e,n){return n&&n.style?n.style:this.getActiveCfg(e,n)}});i.registerShape("area","area",{draw:function t(e,n){var i=c(e),o=l(e,!1,this);return n.addShape("path",{attrs:r.mix(i,{path:o})})},getMarkerCfg:function t(e){return f(e)}}),i.registerShape("area","smooth",{draw:function t(e,n){var i=c(e),o=this._coord;e.constraint=[[o.start.x,o.end.y],[o.end.x,o.start.y]];var a=l(e,!0,this);return n.addShape("path",{attrs:r.mix(i,{path:a})})},getMarkerCfg:function t(e){return f(e)}}),i.registerShape("area","line",{draw:function t(e,n){var i=u(e),o=l(e,!1,this);return n.addShape("path",{attrs:r.mix(i,{path:o})})},getMarkerCfg:function t(e){return f(e)}}),i.registerShape("area","smoothLine",{draw:function t(e,n){var i=u(e),o=l(e,!0,this);return n.addShape("path",{attrs:r.mix(i,{path:o})})},getMarkerCfg:function t(e){return f(e)}}),d.spline=d.smooth,t.exports=d},function(t,e,n){var r=n(0),i=n(9),o=n(22),a=n(5),s=n(24),u=1/3;function c(t){var e=a.shape.edge,n=r.mix({},e,t.style);return o.addStrokeAttrs(n,t),n}var l=i.registerFactory("edge",{defaultShapeType:"line",getDefaultPoints:function t(e){return o.splitPoints(e)},getActiveCfg:function t(e,n){var r;return{lineWidth:(n.lineWidth||0)+1}}});function f(t,e){var n=[];n.push({x:t.x,y:.5*t.y+1*e.y/2}),n.push({y:.5*t.y+1*e.y/2,x:e.x}),n.push(e);var i=["C"];return r.each(n,function(t){i.push(t.x,t.y)}),i}function h(t,e){var n=[];n.push({x:e.x,y:e.y}),n.push(t);var i=["Q"];return r.each(n,function(t){i.push(t.x,t.y)}),i}function p(t,e){var n=f(t,e),r=[["M",t.x,t.y]];return r.push(n),r}function d(t,e,n){var r=h(e,n),i=[["M",t.x,t.y]];return i.push(r),i}function v(t,e){var n=h(t[1],e),r=h(t[3],e),i=[["M",t[0].x,t[0].y]];return i.push(r),i.push(["L",t[3].x,t[3].y]),i.push(["L",t[2].x,t[2].y]),i.push(n),i.push(["L",t[1].x,t[1].y]),i.push(["L",t[0].x,t[0].y]),i.push(["Z"]),i}function g(t,e){var n=[];n.push({y:t.y*(1-u)+e.y*u,x:t.x}),n.push({y:t.y*(1-u)+e.y*u,x:e.x}),n.push(e);var i=[["M",t.x,t.y]];return r.each(n,function(t){i.push(["L",t.x,t.y])}),i}i.registerShape("edge","line",{draw:function t(e,n){var i=this.parsePoints(e.points),o=c(e),a=s.getLinePath(i),u;return n.addShape("path",{attrs:r.mix(o,{path:a})})},getMarkerCfg:function t(e){return r.mix({symbol:"circle",radius:4.5},c(e))}}),i.registerShape("edge","vhv",{draw:function t(e,n){var i=e.points,o=c(e),a=g(i[0],i[1]),s;return a=this.parsePath(a),n.addShape("path",{attrs:r.mix(o,{path:a})})},getMarkerCfg:function t(e){return r.mix({symbol:"circle",radius:4.5},c(e))}}),i.registerShape("edge","smooth",{draw:function t(e,n){var i=e.points,o=c(e),a=p(i[0],i[1]),s;return a=this.parsePath(a),n.addShape("path",{attrs:r.mix(o,{path:a})})},getMarkerCfg:function t(e){return r.mix({symbol:"circle",radius:4.5},c(e))}}),i.registerShape("edge","arc",{draw:function t(e,n){var i=e.points,o=i.length>2?"weight":"normal",a=c(e),s,u;if(e.isInCircle){var l={x:0,y:1};"normal"===o?u=d(i[0],i[1],l):(a.fill=a.stroke,u=v(i,l)),u=this.parsePath(u),s=n.addShape("path",{attrs:r.mix(a,{path:u})})}else if("normal"===o)i=this.parsePoints(i),s=n.addShape("arc",{attrs:r.mix(a,{x:(i[1].x+i[0].x)/2,y:i[0].y,r:Math.abs(i[1].x-i[0].x)/2,startAngle:Math.PI,endAngle:2*Math.PI})});else{u=[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y]];var h=f(i[1],i[3]),p=f(i[2],i[0]);u.push(h),u.push(["L",i[3].x,i[3].y]),u.push(["L",i[2].x,i[2].y]),u.push(p),u.push(["Z"]),u=this.parsePath(u),a.fill=a.stroke,s=n.addShape("path",{attrs:r.mix(a,{path:u})})}return s},getMarkerCfg:function t(e){return r.mix({symbol:"circle",radius:4.5},c(e))}}),t.exports=l},function(t,e,n){var r=n(0),i=n(9),o=n(24),a=n(22),s=n(5),u=n(25),c=r.PathUtil;function l(t,e){var n=t.x,i=t.y,o=t.y0,a=t.size,s=o,u=i,c,l;r.isArray(i)&&(u=i[1],s=i[0]),r.isArray(n)?(c=n[0],l=n[1]):(c=n-a/2,l=n+a/2);var f=[];return f.push({x:c,y:s},{x:c,y:u}),e?f.push({x:l,y:(u+s)/2}):f.push({x:l,y:u},{x:l,y:s}),f}function f(t){for(var e=[],n=0;n0;)r-=2*Math.PI;var c=o-t+(r=r/Math.PI/2*n)-2*t;u.push(["M",c,e]);for(var l=0,f=0;f1?t[1]:e,o,a;return{min:e,max:n,min1:i,max1:t.length>3?t[3]:n,median:t.length>2?t[2]:i}}function u(t,e){r.each(t,function(t){e.push({x:t[0],y:t[1]})})}function c(t){var e=a.shape.schema,n=r.mix({},e,t.style);return o.addStrokeAttrs(n,t),n}function l(t){var e=a.shape.schema,n=r.mix({},e,t.style);return o.addFillAttrs(n,t),t.color&&(n.stroke=n.stroke||t.color),n}function f(t,e,n){var i=[],o,a;return r.isArray(e)?o=[[t-n/2,(a=s(e)).max],[t+n/2,a.max],[t,a.max],[t,a.max1],[t-n/2,a.min1],[t-n/2,a.max1],[t+n/2,a.max1],[t+n/2,a.min1],[t,a.min1],[t,a.min],[t-n/2,a.min],[t+n/2,a.min],[t-n/2,a.median],[t+n/2,a.median]]:(e=e||.5,o=[[(a=s(t)).min,e-n/2],[a.min,e+n/2],[a.min,e],[a.min1,e],[a.min1,e-n/2],[a.min1,e+n/2],[a.max1,e+n/2],[a.max1,e-n/2],[a.max1,e],[a.max,e],[a.max,e-n/2],[a.max,e+n/2],[a.median,e-n/2],[a.median,e+n/2]]),u(o,i),i}function h(t){r.isArray(t)||(t=[t]);var e=t.sort(function(t,e){return t0?h=u(h,d):f.addAnimator(this),h.push(d),this.setSilent("animators",h),this.setSilent("pause",{isPaused:!1})},stopAnimate:function t(){var e=this,n=this.get("animators");r.each(n,function(t){e.attr(t.toAttrs),t.toMatrix&&e.attr("matrix",t.toMatrix),t.callback&&t.callback()}),this.setSilent("animating",!1),this.setSilent("animators",[])},pauseAnimate:function t(){var e=this,n=this.get("timeline");return this.setSilent("pause",{isPaused:!0,pauseTime:n.getTime()}),this},resumeAnimate:function t(){var e=this,n,i=this.get("timeline").getTime(),o=this.get("animators"),a=this.get("pause").pauseTime;return r.each(o,function(t){t.startTime=t.startTime+(i-a),t._paused=!1,t._pauseTime=null}),this.setSilent("pause",{isPaused:!1}),this.setSilent("animators",o),this}}},function(t,e,n){var r=n(1);t.exports={canFill:!1,canStroke:!1,initAttrs:function t(e){return this._attrs={opacity:1,fillOpacity:1,strokeOpacity:1,matrix:[1,0,0,0,1,0,0,0,1]},this.attr(r.assign(this.getDefaultAttrs(),e)),this},getDefaultAttrs:function t(){return{}},attr:function t(e,n){var i=this;if(0===arguments.length)return this._attrs;if(r.isObject(e)){for(var o in e)this._setAttr(o,e[o]);return this.clearBBox(),this._cfg.hasUpdate=!0,this}return 2===arguments.length?(this._setAttr(e,n),this.clearBBox(),this._cfg.hasUpdate=!0,this):this._attrs[e]},_setAttr:function t(e,n){var r=this,i=this._attrs;i[e]=n,"fill"!==e&&"stroke"!==e?"opacity"!==e?"clip"===e&&n?this._setClip(n):"path"===e&&this._afterSetAttrPath?this._afterSetAttrPath(n):"transform"!==e?"rotate"===e&&this.rotateAtStart(n):this.transform(n):i.globalAlpha=n:i[e+"Style"]=n},clearBBox:function t(){this.setSilent("box",null)},hasFill:function t(){return this.canFill&&this._attrs.fillStyle},hasStroke:function t(){return this.canStroke&&this._attrs.strokeStyle},_setClip:function t(e){e._cfg.renderer=this._cfg.renderer,e._cfg.canvas=this._cfg.canvas,e._cfg.parent=this._cfg.parent,e.hasFill=function(){return!0}}}},function(t,e,n){var r=n(1),i=n(70),o={arc:n(44),ellipse:n(133),line:n(45)},a,s=r.createDom('').getContext("2d");function u(t,e,n){return n.createPath(s),s.isPointInPath(t,e)}var c,l,f,h,p,d,v,g,y,m,b,x,_,w={arc:function t(e,n){var r=this._attrs,o=r.x,a=r.y,s=r.r,u=r.startAngle,c=r.endAngle,l=r.clockwise,f=this.getHitLineWidth();return!!this.hasStroke()&&i.arcline(o,a,s,u,c,l,f,e,n)},circle:function t(e,n){var r=this._attrs,o=r.x,a=r.y,s=r.r,u=this.getHitLineWidth(),c=this.hasFill(),l=this.hasStroke();return c&&l?i.circle(o,a,s,e,n)||i.arcline(o,a,s,0,2*Math.PI,!1,u,e,n):c?i.circle(o,a,s,e,n):!!l&&i.arcline(o,a,s,0,2*Math.PI,!1,u,e,n)},dom:function t(e,n){if(!this._cfg.el)return!1;var r=this._cfg.el.getBBox();return i.box(r.x,r.x+r.width,r.y,r.y+r.height,e,n)},ellipse:function t(e,n){var o=this._attrs,a=this.hasFill(),s=this.hasStroke(),u=o.x,c=o.y,l=o.rx,f=o.ry,h=this.getHitLineWidth(),p=l>f?l:f,d=l>f?1:l/f,v=l>f?f/l:1,g=[e,n,1],y=[1,0,0,0,1,0,0,0,1];r.mat3.scale(y,y,[d,v]),r.mat3.translate(y,y,[u,c]);var m=r.mat3.invert([],y);return r.vec3.transformMat3(g,g,m),a&&s?i.circle(0,0,p,g[0],g[1])||i.arcline(0,0,p,0,2*Math.PI,!1,h,g[0],g[1]):a?i.circle(0,0,p,g[0],g[1]):!!s&&i.arcline(0,0,p,0,2*Math.PI,!1,h,g[0],g[1])},fan:function t(e,n){var a=this,s=a.hasFill(),u=a.hasStroke(),c=a._attrs,l=c.x,f=c.y,h=c.rs,p=c.re,d=c.startAngle,v=c.endAngle,g=c.clockwise,y=[1,0],m=[e-l,n-f],b=r.vec2.angleTo(y,m);function x(){var t=o.arc.nearAngle(b,d,v,g);if(r.isNumberEqual(b,t)){var e=r.vec2.squaredLength(m);if(h*h<=e&&e<=p*p)return!0}return!1}function _(){var t=a.getHitLineWidth(),r={x:Math.cos(d)*h+l,y:Math.sin(d)*h+f},o={x:Math.cos(d)*p+l,y:Math.sin(d)*p+f},s={x:Math.cos(v)*h+l,y:Math.sin(v)*h+f},u={x:Math.cos(v)*p+l,y:Math.sin(v)*p+f};return!!i.line(r.x,r.y,o.x,o.y,t,e,n)||(!!i.line(s.x,s.y,u.x,u.y,t,e,n)||(!!i.arcline(l,f,h,d,v,g,t,e,n)||!!i.arcline(l,f,p,d,v,g,t,e,n)))}return s&&u?x()||_():s?x():!!u&&_()},image:function t(e,n){var r=this._attrs;if(this.get("toDraw")||!r.img)return!1;this._cfg.attrs&&this._cfg.attrs.img===r.img||this._setAttrImg();var o=r.x,a=r.y,s=r.width,u=r.height;return i.rect(o,a,s,u,e,n)},line:function t(e,n){var r=this._attrs,o=r.x1,a=r.y1,s=r.x2,u=r.y2,c=this.getHitLineWidth();return!!this.hasStroke()&&i.line(o,a,s,u,c,e,n)},path:function t(e,n){var i=this,o=i.get("segments"),a=i.hasFill(),s=i.hasStroke();function c(){if(!r.isEmpty(o)){for(var t=i.getHitLineWidth(),a=0,s=o.length;a=3&&s.push(o[0]),i.polyline(s,a,e,n)}return o&&a?u(e,n,r)||s():o?u(e,n,r):!!a&&s()},polyline:function t(e,n){var r=this,o=this._attrs;if(this.hasStroke()){var a=o.points;if(a.length<2)return!1;var s=o.lineWidth;return i.polyline(a,s,e,n)}return!1},rect:function t(e,n){var r=this,o=r.hasFill(),a=r.hasStroke();function s(){var t=r._attrs,o=t.x,a=t.y,s=t.width,u=t.height,c=t.radius,l=r.getHitLineWidth();if(0===c){var f=l/2;return i.line(o-f,a,o+s+f,a,l,e,n)||i.line(o+s,a-f,o+s,a+u+f,l,e,n)||i.line(o+s+f,a+u,o-f,a+u,l,e,n)||i.line(o,a+u+f,o,a-f,l,e,n)}return i.line(o+c,a,o+s-c,a,l,e,n)||i.line(o+s,a+c,o+s,a+u-c,l,e,n)||i.line(o+s-c,a+u,o+c,a+u,l,e,n)||i.line(o,a+u-c,o,a+c,l,e,n)||i.arcline(o+s-c,a+c,c,1.5*Math.PI,2*Math.PI,!1,l,e,n)||i.arcline(o+s-c,a+u-c,c,0,.5*Math.PI,!1,l,e,n)||i.arcline(o+c,a+u-c,c,.5*Math.PI,Math.PI,!1,l,e,n)||i.arcline(o+c,a+c,c,Math.PI,1.5*Math.PI,!1,l,e,n)}return o&&a?u(e,n,r)||s():o?u(e,n,r):!!a&&s()},text:function t(e,n){var r=this,o=this.getBBox();if(this.hasFill()||this.hasStroke())return i.box(o.minX,o.maxX,o.minY,o.maxY,e,n)}};t.exports={isPointInPath:function t(e,n){var r=w[this.type];return!!r&&r.call(this,e,n)}}},function(t,e,n){var r=n(1),i=n(71),o=n(96),a=n(190),s=n(434),u=s.interpolate,c=s.interpolateArray,l=function t(e){this._animators=[],this._current=0,this._timer=null,this.canvas=e};function f(t,e,n){var o={},a=e.toAttrs,s=e.fromAttrs,l=e.toMatrix;if(!t.get("destroyed")){var f;for(var h in a)if(!r.isEqual(s[h],a[h]))if("path"===h){var p=a[h],d=s[h];p.length>d.length?(p=i.parsePathString(a[h]),d=i.parsePathString(s[h]),d=i.fillPathByDiff(d,p),d=i.formatPath(d,p),e.fromAttrs.path=d,e.toAttrs.path=p):e.pathFormatted||(p=i.parsePathString(a[h]),d=i.parsePathString(s[h]),d=i.formatPath(d,p),e.fromAttrs.path=d,e.toAttrs.path=p,e.pathFormatted=!0),o[h]=[];for(var v=0;v0){for(var o=e._animators.length-1;o>=0;o--)if((i=e._animators[o]).get("destroyed"))n.removeAnimator(o);else{if(!i.get("pause").isPaused)for(var u=(a=i.get("animators")).length-1;u>=0;u--)s=a[u],(r=h(i,s,t))&&(a.splice(u,1),r=!1,s.callback&&s.callback());0===a.length&&n.removeAnimator(o)}e.canvas.draw()}})},addAnimator:function t(e){this._animators.push(e)},removeAnimator:function t(e){this._animators.splice(e,1)},isAnimating:function t(){return!!this._animators.length},stop:function t(){this._timer&&this._timer.stop()},stopAllAnimations:function t(){this._animators.forEach(function(t){t.stopAnimate()}),this._animators=[],this.canvas.draw()},getTime:function t(){return this._current}}),t.exports=l},function(t,e,n){var r=n(1);function i(t){return 1===t[0]&&0===t[1]&&0===t[3]&&1===t[4]&&0===t[6]&&0===t[7]}function o(t){return 0===t[1]&&0===t[3]&&0===t[6]&&0===t[7]}function a(t,e){i(e)||(o(e)?(t[0]*=e[0],t[4]*=e[4]):r.mat3.multiply(t,t,e))}t.exports={initTransform:function t(){},resetMatrix:function t(){this.attr("matrix",[1,0,0,0,1,0,0,0,1])},translate:function t(e,n){var i=this._attrs.matrix;return r.mat3.translate(i,i,[e,n]),this.clearTotalMatrix(),this.attr("matrix",i),this},rotate:function t(e){var n=this._attrs.matrix;return r.mat3.rotate(n,n,e),this.clearTotalMatrix(),this.attr("matrix",n),this},scale:function t(e,n){var i=this._attrs.matrix;return r.mat3.scale(i,i,[e,n]),this.clearTotalMatrix(),this.attr("matrix",i),this},rotateAtStart:function t(e){var n=this._attrs.x||this._cfg.attrs.x,r=this._attrs.y||this._cfg.attrs.y;return Math.abs(e)>2*Math.PI&&(e=e/180*Math.PI),this.transform([["t",-n,-r],["r",e],["t",n,r]])},move:function t(e,n){var r=this.get("x")||0,i=this.get("y")||0;return this.translate(e-r,n-i),this.set("x",e),this.set("y",n),this},transform:function t(e){var n=this,i=this._attrs.matrix;return r.each(e,function(t){switch(t[0]){case"t":n.translate(t[1],t[2]);break;case"s":n.scale(t[1],t[2]);break;case"r":n.rotate(t[1]);break;case"m":n.attr("matrix",r.mat3.multiply([],i,t[1])),n.clearTotalMatrix()}}),n},setTransform:function t(e){return this.attr("matrix",[1,0,0,0,1,0,0,0,1]),this.transform(e)},getMatrix:function t(){return this.attr("matrix")},setMatrix:function t(e){return this.attr("matrix",e),this.clearTotalMatrix(),this},apply:function t(e,n){var i;return i=n?this._getMatrixByRoot(n):this.attr("matrix"),r.vec3.transformMat3(e,e,i),this},_getMatrixByRoot:function t(e){var n=this;e=e||this;for(var i=this,o=[];i!==e;)o.unshift(i),i=i.get("parent");o.unshift(i);var a=[1,0,0,0,1,0,0,0,1];return r.each(o,function(t){r.mat3.multiply(a,t.attr("matrix"),a)}),a},getTotalMatrix:function t(){var e=this._cfg.totalMatrix;if(!e){e=[1,0,0,0,1,0,0,0,1];var n=this._cfg.parent,r;if(n)a(e,n.getTotalMatrix());a(e,this.attr("matrix")),this._cfg.totalMatrix=e}return e},clearTotalMatrix:function t(){},invert:function t(e){var n=this.getTotalMatrix();if(o(n))e[0]/=n[0],e[1]/=n[4];else{var i=r.mat3.invert([],n);i&&r.vec3.transformMat3(e,e,i)}return this},resetTransform:function t(e){var n=this.attr("matrix");i(n)||e.transform(n[0],n[1],n[3],n[4],n[6],n[7])}}},function(t,e,n){t.exports={painter:n(315)}},function(t,e,n){var r=n(1),i=n(316),o=["fillStyle","font","globalAlpha","lineCap","lineWidth","lineJoin","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","lineDash","lineDashOffset"],a=function(){function t(t){if(!t)return null;var e=r.uniqueId("canvas_"),n=r.createDom('');return t.appendChild(n),this.type="canvas",this.canvas=n,this.context=n.getContext("2d"),this.toDraw=!1,this}var e=t.prototype;return e.beforeDraw=function t(){var e=this.canvas;this.context&&this.context.clearRect(0,0,e.width,e.height)},e.draw=function t(e){var n=this;function i(){n.animateHandler=r.requestAnimationFrame(function(){n.animateHandler=void 0,n.toDraw&&i()}),n.beforeDraw();try{n._drawGroup(e)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),n.toDraw=!1}n.toDraw=!1}n.animateHandler?n.toDraw=!0:i()},e.drawSync=function t(e){this.beforeDraw(),this._drawGroup(e)},e._drawGroup=function t(e){if(!e._cfg.removed&&!e._cfg.destroyed&&e._cfg.visible){var n=this,r=e._cfg.children,i=null;this.setContext(e);for(var o=0;o-1){var u=a[s];"fillStyle"===s&&(u=i.parseStyle(u,e,n)),"strokeStyle"===s&&(u=i.parseStyle(u,e,n)),"lineDash"===s&&n.setLineDash?r.isArray(u)?n.setLineDash(u):r.isString(u)&&n.setLineDash(u.split(" ")):n[s]=u}},t}();t.exports=a},function(t,e,n){var r=n(1),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,o=/[^\s\,]+/gi,a=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,s=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,u=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,c=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function l(t,e){var n=t.match(c);r.each(n,function(t){t=t.split(":"),e.addColorStop(t[0],t[1])})}function f(t,e,n){var i=a.exec(t),o=r.mod(r.toRadian(parseFloat(i[1])),2*Math.PI),s=i[2],u=e.getBBox(),c,f;o>=0&&o<.5*Math.PI?(c={x:u.minX,y:u.minY},f={x:u.maxX,y:u.maxY}):.5*Math.PI<=o&&o1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}r.each(t,function(e,n){isNaN(e)||(t[n]=+e)}),e[n]=t}),e):void 0},parseStyle:function t(e,n,i){if(r.isString(e)){if("("===e[1]||"("===e[2]){if("l"===e[0])return f(e,n,i);if("r"===e[0])return h(e,n,i);if("p"===e[0])return p(e,n,i)}return e}}}},function(t,e,n){t.exports={canvas:n(314),svg:n(325)}},function(t,e,n){var r=n(1),i=n(321),o=n(323),a=n(319),s=n(320),u=n(322),c=function(){function t(t){var e=document.createElementNS("http://www.w3.org/2000/svg","defs"),n=r.uniqueId("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}var e=t.prototype;return e.find=function t(e,n){for(var r=this.children,i=null,o=0;o'}),n}function u(t,e){var n=i.exec(t),o=r.mod(r.toRadian(parseFloat(n[1])),2*Math.PI),a=n[2],u,c;o>=0&&o<.5*Math.PI?(u={x:0,y:0},c={x:1,y:1}):.5*Math.PI<=o&&o';n.innerHTML=r},t}();t.exports=a},function(t,e){var n={svg:"svg",circle:"circle",rect:"rect",text:"text",path:"path",foreignObject:"foreignObject",polygon:"polygon",ellipse:"ellipse",image:"image"};t.exports=function t(e,r,i){var o=i.target||i.srcElement;if(!n[o.tagName]){for(var a=o.parentNode;a&&!n[a.tagName];)a=a.parentNode;o=a}return this._cfg.el===o?this:this.find(function(t){return t._cfg&&t._cfg.el===o})}},function(t,e,n){t.exports={painter:n(326),getShape:n(324)}},function(t,e,n){var r=n(1),i,o=n(36).parseRadius,a=n(68),s=n(318),u={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject",fan:"path",group:"g"},c=.3,l={opacity:"opacity",fillStyle:"fill",strokeOpacity:"stroke-opacity",fillOpacity:"fill-opacity",strokeStyle:"stroke",x:"x",y:"y",r:"r",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"},f={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},h={left:"left",start:"left",center:"middle",right:"end",end:"end"},p=function(){function t(t){if(!t)return null;var e=r.uniqueId("canvas_"),n=r.createDom('');return t.appendChild(n),this.type="svg",this.canvas=n,this.context=new s(n),this.toDraw=!1,this}var e=t.prototype;return e.draw=function t(e){var n=this;function i(){n.animateHandler=r.requestAnimationFrame(function(){n.animateHandler=void 0,n.toDraw&&i()});try{n._drawChildren(e)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),n.toDraw=!1}n.toDraw=!1}n.animateHandler?n.toDraw=!0:i()},e.drawSync=function t(e){this._drawChildren(e)},e._drawGroup=function t(e,n){var i=e._cfg;i.removed||i.destroyed||(i.tobeRemoved&&(r.each(i.tobeRemoved,function(t){t.parentNode&&t.parentNode.removeChild(t)}),i.tobeRemoved=[]),this._drawShape(e,n),i.children&&i.children.length>0&&this._drawChildren(e))},e._drawChildren=function t(e){var n=this,r=e._cfg.children,i;if(r)for(var o=0;ou?1:0,p=Math.abs(c-u)>Math.PI?1:0,d=i.rs,v=i.re,g=n(u,i.rs,a),y=n(c,i.rs,a);i.rs>0?(s.push("M "+f.x+","+f.y),s.push("L "+y.x+","+y.y),s.push("A "+d+","+d+",0,"+p+","+(1===h?0:1)+","+g.x+","+g.y),s.push("L "+l.x+" "+l.y)):(s.push("M "+a.x+","+a.y),s.push("L "+l.x+","+l.y)),s.push("A "+v+","+v+",0,"+p+","+h+","+f.x+","+f.y),i.rs>0?s.push("L "+y.x+","+y.y):s.push("Z"),o.el.setAttribute("d",s.join(" "))},e._updateText=function t(e){var n=this,r=e._attrs,i=e._cfg.attrs,o=e._cfg.el;for(var a in this._setFont(e),r)if(r[a]!==i[a]){if("text"===a){this._setText(e,""+r[a]);continue}if("fillStyle"===a||"strokeStyle"===a){this._setColor(e,a,r[a]);continue}if("matrix"===a){this._setTransform(e);continue}l[a]&&o.setAttribute(l[a],r[a])}e._cfg.attrs=Object.assign({},e._attrs),e._cfg.hasUpdate=!1},e._setFont=function t(e){var n=e.get("el"),r=e._attrs,i=r.fontSize;n.setAttribute("alignment-baseline",f[r.textBaseline]||"baseline"),n.setAttribute("text-anchor",h[r.textAlign]||"left"),i&&+i<12&&(r.matrix=[1,0,0,0,1,0,0,0,1],e.transform([["t",-r.x,-r.y],["s",+i/12,+i/12],["t",r.x,r.y]]))},e._setText=function t(e,n){var i=e._cfg.el,o=e._attrs.textBaseline||"bottom";if(n)if(~n.indexOf("\n")){var a=e._attrs.x,s=n.split("\n"),u=s.length-1,c="";r.each(s,function(t,e){0===e?"alphabetic"===o?c+=''+t+"":"top"===o?c+=''+t+"":"middle"===o?c+=''+t+"":"bottom"===o?c+=''+t+"":"hanging"===o&&(c+=''+t+""):c+=''+t+""}),i.innerHTML=c}else i.innerHTML=n;else i.innerHTML=""},e._setClip=function t(e,n){var r=e._cfg.el;if(n)if(r.hasAttribute("clip-path"))n._cfg.hasUpdate&&this._updateShape(n);else{this._createDom(n),this._updateShape(n);var i=this.context.addClip(n);r.setAttribute("clip-path","url(#"+i+")")}else r.removeAttribute("clip-path")},e._setColor=function t(e,n,r){var i=e._cfg.el,o=this.context;if(r)if(r=r.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(r)){var a=o.find("gradient",r);a||(a=o.addGradient(r)),i.setAttribute(l[n],"url(#"+a+")")}else if(/^[p,P]{1}[\s]*\(/.test(r)){var s=o.find("pattern",r);s||(s=o.addPattern(r)),i.setAttribute(l[n],"url(#"+s+")")}else i.setAttribute(l[n],r);else i.setAttribute(l[n],"none")},e._setShadow=function t(e){var n=e._cfg.el,r=e._attrs,i={dx:r.shadowOffsetX,dy:r.shadowOffsetY,blur:r.shadowBlur,color:r.shadowColor};if(i.dx||i.dy||i.blur||i.color){var o=this.context.find("filter",i);o||(o=this.context.addShadow(i,this)),n.setAttribute("filter","url(#"+o+")")}else n.removeAttribute("filter")},t}();t.exports=p},function(t,e,n){var r=n(7);r.Arc=n(126),r.Circle=n(127),r.Dom=n(128),r.Ellipse=n(129),r.Fan=n(130),r.Image=n(131),r.Line=n(132),r.Marker=n(68),r.Path=n(135),r.Polygon=n(136),r.Polyline=n(137),r.Rect=n(138),r.Text=n(139),t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=a,e.fromMat4=s,e.clone=u,e.copy=c,e.fromValues=l,e.set=f,e.identity=h,e.transpose=p,e.invert=d,e.adjoint=v,e.determinant=g,e.multiply=y,e.translate=m,e.rotate=b,e.scale=x,e.fromTranslation=_,e.fromRotation=w,e.fromScaling=O,e.fromMat2d=j,e.fromQuat=S,e.normalFromMat4=E,e.projection=M,e.str=C,e.frob=P,e.add=k,e.subtract=T,e.multiplyScalar=A,e.multiplyScalarAndAdd=I,e.exactEquals=L,e.equals=N;var r,i=o(n(72));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function a(){var t=new i.ARRAY_TYPE(9);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function u(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function l(t,e,n,r,o,a,s,u,c){var l=new i.ARRAY_TYPE(9);return l[0]=t,l[1]=e,l[2]=n,l[3]=r,l[4]=o,l[5]=a,l[6]=s,l[7]=u,l[8]=c,l}function f(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function h(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function p(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function d(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=l*a-s*c,h=-l*o+s*u,p=c*o-a*u,d=n*f+r*h+i*p;return d?(d=1/d,t[0]=f*d,t[1]=(-l*r+i*c)*d,t[2]=(s*r-i*a)*d,t[3]=h*d,t[4]=(l*n-i*u)*d,t[5]=(-s*n+i*o)*d,t[6]=p*d,t[7]=(-c*n+r*u)*d,t[8]=(a*n-r*o)*d,t):null}function v(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8];return t[0]=a*l-s*c,t[1]=i*c-r*l,t[2]=r*s-i*a,t[3]=s*u-o*l,t[4]=n*l-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function g(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function y(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=n[0],p=n[1],d=n[2],v=n[3],g=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=h*r+p*a+d*c,t[1]=h*i+p*s+d*l,t[2]=h*o+p*u+d*f,t[3]=v*r+g*a+y*c,t[4]=v*i+g*s+y*l,t[5]=v*o+g*u+y*f,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*l,t[8]=m*o+b*u+x*f,t}function m(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=n[0],p=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*r+p*a+c,t[7]=h*i+p*s+l,t[8]=h*o+p*u+f,t}function b(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=Math.sin(n),p=Math.cos(n);return t[0]=p*r+h*a,t[1]=p*i+h*s,t[2]=p*o+h*u,t[3]=p*a-h*r,t[4]=p*s-h*i,t[5]=p*u-h*o,t[6]=c,t[7]=l,t[8]=f,t}function x(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function _(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function w(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function O(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function j(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function S(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,f=r*s,h=i*a,p=i*s,d=i*u,v=o*a,g=o*s,y=o*u;return t[0]=1-f-d,t[3]=l-y,t[6]=h+g,t[1]=l+y,t[4]=1-c-d,t[7]=p-v,t[2]=h-g,t[5]=p+v,t[8]=1-c-f,t}function E(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],g=e[14],y=e[15],m=n*s-r*a,b=n*u-i*a,x=n*c-o*a,_=r*u-i*s,w=r*c-o*s,O=i*c-o*u,j=l*v-f*d,S=l*g-h*d,E=l*y-p*d,M=f*g-h*v,C=f*y-p*v,P=h*y-p*g,k=m*P-b*C+x*M+_*E-w*S+O*j;return k?(k=1/k,t[0]=(s*P-u*C+c*M)*k,t[1]=(u*E-a*P-c*S)*k,t[2]=(a*C-s*E+c*j)*k,t[3]=(i*C-r*P-o*M)*k,t[4]=(n*P-i*E+o*S)*k,t[5]=(r*E-n*C-o*j)*k,t[6]=(v*O-g*w+y*_)*k,t[7]=(g*x-d*O-y*b)*k,t[8]=(d*w-v*x+y*m)*k,t):null}function M(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function C(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function P(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))}function k(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function T(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function A(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function I(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function N(t,e){var n=t[0],r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=e[0],p=e[1],d=e[2],v=e[3],g=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return Math.abs(n-h)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(r-p)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(p))&&Math.abs(o-d)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-v)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(s-g)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(l-b)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(f-x)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(x))}var D=e.mul=y,R=e.sub=T},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=a,e.clone=s,e.fromValues=u,e.copy=c,e.set=l,e.add=f,e.subtract=h,e.multiply=p,e.divide=d,e.ceil=v,e.floor=g,e.min=y,e.max=m,e.round=b,e.scale=x,e.scaleAndAdd=_,e.distance=w,e.squaredDistance=O,e.length=j,e.squaredLength=S,e.negate=E,e.inverse=M,e.normalize=C,e.dot=P,e.cross=k,e.lerp=T,e.random=A,e.transformMat2=I,e.transformMat2d=L,e.transformMat3=N,e.transformMat4=D,e.rotate=R,e.angle=F,e.str=z,e.exactEquals=B,e.equals=Y;var r,i=o(n(72));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function a(){var t=new i.ARRAY_TYPE(2);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function u(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n}function c(t,e){return t[0]=e[0],t[1]=e[1],t}function l(t,e,n){return t[0]=e,t[1]=n,t}function f(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function p(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function d(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function v(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function g(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function y(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function m(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function b(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function x(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function _(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function O(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function j(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function S(t){var e=t[0],n=t[1];return e*e+n*n}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function C(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t}function P(t,e){return t[0]*e[0]+t[1]*e[1]}function k(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function T(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function A(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function I(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function L(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function N(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function D(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function R(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function F(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=n*n+r*r;a>0&&(a=1/Math.sqrt(a));var s=i*i+o*o;s>0&&(s=1/Math.sqrt(s));var u=(n*i+r*o)*a*s;return u>1?0:u<-1?Math.PI:Math.acos(u)}function z(t){return"vec2("+t[0]+", "+t[1]+")"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]}function Y(t,e){var n=t[0],r=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))}var V=e.len=j,W=e.sub=h,H=e.mul=p,G=e.div=d,q=e.dist=w,U=e.sqrDist=O,K=e.sqrLen=S,X=e.forEach=(Z=a(),function(t,e,n,r,i,o){var a=void 0,s=void 0;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function P(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function k(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function T(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function A(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),l=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*l,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*l,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*l,t}function I(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,l=3*o*s,f=3*u*a,h=u*o;return t[0]=e[0]*c+n[0]*l+r[0]*f+i[0]*h,t[1]=e[1]*c+n[1]*l+r[1]*f+i[1]*h,t[2]=e[2]*c+n[2]*l+r[2]*f+i[2]*h,t}function L(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI,r=2*i.RANDOM()-1,o=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=r*e,t}function N(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function D(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function R(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,f=o*s-r*c,h=r*u-i*s,p=i*h-o*f,d=o*l-r*h,v=r*f-i*l,g=2*a;return l*=g,f*=g,h*=g,p*=2,d*=2,v*=2,t[0]=s+l+p,t[1]=u+f+d,t[2]=c+h+v,t}function F(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function z(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function B(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function Y(t,e){var n=c(t[0],t[1],t[2]),r=c(e[0],e[1],e[2]);C(n,n),C(r,r);var i=P(n,r);return i>1?0:i<-1?Math.PI:Math.acos(i)}function V(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function W(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function H(t,e){var n=t[0],r=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(o-u)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))}var G=e.sub=p,q=e.mul=d,U=e.div=v,K=e.dist=O,X=e.sqrDist=j,Z=e.len=u,$=e.sqrLen=S,Q=e.forEach=(J=a(),function(t,e,n,r,i,o){var a=void 0,s=void 0;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a0?e=0:n=0,n-e<5&&!a&&n-e>=1&&(a=1)),r(a)){var b=(n-e)/(g-1);a=o.snapFactorTo(b,m,"ceil"),h!==f&&((y=parseInt((n-e)/a,10))>h&&(y=h),ye&&(j-=a),n=o.fixedBase(O,a),e=o.fixedBase(j,a)}n=Math.min(n,v),e=Math.max(e,d),l.push(e);for(var S=1;Sm&&(m=e);var O=m/w,j=l(o);if(O>.51){for(var S=Math.ceil(O),E=l(s),M=j;M<=E+S;M+=S)n.push(f(M));m=null}else if(O>.0834){for(var C=Math.ceil(O/.0834),P=h(o),k=p(o,s),T=0;T<=k+C;T+=C)n.push(d(j,T+P));m=null}else if(m>.5*_){var A=new Date(o),I=A.getFullYear(),L=A.getMonth(o),N=A.getDate(),D=Math.ceil(m/_),R=v(o,s);m=D*_;for(var F=0;Fu){var z=new Date(o),B=z.getFullYear(),Y=z.getMonth(o),V=z.getDate(),W=z.getHours(),H=r.snapTo(a,Math.ceil(m/u)),G=g(o,s);m=H*u;for(var q=0;q<=G+H;q+=H)n.push(new Date(B,Y,V,W+q).getTime())}else if(m>6e4){var U=y(o,s),K=Math.ceil(m/6e4);m=6e4*K;for(var X=0;X<=U+K;X+=K)n.push(o+6e4*X)}else{m<1e3&&(m=1e3),o=1e3*Math.floor(o/1e3);var Z=Math.ceil((s-o)/1e3),$=Math.ceil(m/1e3);m=1e3*$;for(var Q=0;Q0)r=Math.floor(s(n,this.min));else{var a=this.values,u=this.max;i(a,function(t){t>0&&t1&&(u=1),r=Math.floor(s(n,u)),this._minTick=r,this.positiveMin=u}for(var c=o-r,l=this.tickCount,f=Math.ceil(c/l),h=[],p=r;p=0?Math.floor(a(n,this.min)):0)>i){var o=i;i=r,r=o}for(var s=i-r,u=this.tickCount,c=Math.ceil(s/u),l=[],f=r;f-1?i/(this.values.length-1):0)*(r-n)},n.getText=function t(e){var n="",r=this.translate(e);n=r>-1?this.values[r]:e;var i=this.formatter;return n=parseInt(n,10),n=i?i(n):a.format(n,this.mask)},n.getTicks=function t(){var e=this,n=this.ticks,r=[];return c(n,function(t){var n;n=f(t)?t:{text:h(t)?t:e.getText(t),value:e.scale(t),tickValue:t},r.push(n)}),r},n._toTimeStamp=function t(e){return u.toTimeStamp(e)},e}(o);i.TimeCat=p,t.exports=p},function(t,e,n){function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var i=n(213),o=n(2),a=n(6),s=n(14),u=n(26),c=n(48),l=n(332),f=n(145),h=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n._initDefaultCfg=function e(){t.prototype._initDefaultCfg.call(this),this.type="time",this.mask="YYYY-MM-DD"},n.init=function e(){var n=this,r=n.values;if(r&&r.length){var i=[],s=1/0,u=s,c=0;o(r,function(t){var e=n._toTimeStamp(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t);s>e?(u=s,s=e):u>e&&(u=e),c1&&(n.minTickInterval=u-s),(a(n.min)||n._toTimeStamp(n.min)>s)&&(n.min=s),(a(n.max)||n._toTimeStamp(n.max)1&&void 0!==arguments[1]?arguments[1]:[];return r(e,function(t){return!i(n,t)})};t.exports=o},function(t,e,n){var r=n(13),i=n(39),o=n(168);function a(t,e){var n=void 0;if(r(e)&&(n=e),i(e)&&(n=function t(n){return o(n,e)}),n)for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:[];if(r(e))for(var i=0;in[i])return 1;if(e[i]1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}o(t,function(e,n){isNaN(e)||(t[n]=+e)}),e[n]=t}),e):void 0}},function(t,e,n){var r=n(4);t.exports=function t(e){var n=0,i=0,o=0,a=0;return r(e)?1===e.length?n=i=o=a=e[0]:2===e.length?(n=o=e[0],i=a=e[1]):3===e.length?(n=e[0],i=a=e[1],o=e[2]):(n=e[0],i=e[1],o=e[2],a=e[3]):n=i=o=a=e,{r1:n,r2:i,r3:o,r4:a}}},function(t,e,n){var r=n(20),i=function t(e,n){if(!r(e))return-1;var i=Array.prototype.indexOf;if(i)return i.call(e,n);for(var o=-1,a=0;a20&&(o=20),parseFloat(e.toFixed(o))};t.exports=n},function(t,e,n){var r=n(51);t.exports={clamp:n(78),fixedBase:n(369),isDecimal:n(371),isEven:n(372),isInteger:n(373),isNegative:n(374),isNumberEqual:r,isOdd:n(375),isPositive:n(376),maxBy:n(159),minBy:n(377),mod:n(160),snapEqual:r,toDegree:n(161),toInt:n(162),toInteger:n(162),toRadian:n(163)}},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e%1!=0};t.exports=i},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e%2==0};t.exports=i},function(t,e,n){var r=n(11),i=Number.isInteger?Number.isInteger:function(t){return r(t)&&t%1==0};t.exports=i},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e<0};t.exports=i},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e%2!=0};t.exports=i},function(t,e,n){var r=n(11),i=function t(e){return r(e)&&e>0};t.exports=i},function(t,e,n){var r=n(4),i=n(13),o=n(2),a=function t(e,n){if(r(e)){var a=e[0],s=void 0;s=i(n)?n(e[0]):e[0][n];var u=void 0;return o(e,function(t){(u=i(n)?n(t):t[n])=0;p--)u=s[p].index,"add"===s[p].type?e.splice(u,0,[].concat(e[u])):e.splice(u,1)}if((i=e.length)=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])})}function i(t,e,n){if(1===n)return[[].concat(t)];var i=[];if("L"===e[0]||"C"===e[0]||"Q"===e[0])i=i.concat(r(t,e,n));else{var o=[].concat(t);"M"===o[0]&&(o[0]="L");for(var a=0;a<=n-1;a++)i.push(o)}return i}t.exports=function t(e,n){if(1===e.length)return e;var r=e.length-1,o=n.length-1,a=r/o,s=[];if(1===e.length&&"M"===e[0][0]){for(var u=0;u0)){e[a]=i[a];break}o=r(o,e[a-1],1)}e[a]=["Q"].concat(o.reduce(function(t,e){return t.concat(e)},[]));break;case"T":e[a]=["T"].concat(o[0]);break;case"C":if(o.length<3){if(!(a>0)){e[a]=i[a];break}o=r(o,e[a-1],2)}e[a]=["C"].concat(o.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(o.length<2){if(!(a>0)){e[a]=i[a];break}o=r(o,e[a-1],1)}e[a]=["S"].concat(o.reduce(function(t,e){return t.concat(e)},[]));break;default:e[a]=i[a]}return e}},function(t,e,n){var r=n(387),i=n(174),o=n(175),a=n(171);t.exports={catmullRom2Bezier:a,catmullRomToBezier:a,fillPath:n(383),fillPathByDiff:n(382),formatPath:n(384),intersection:r,pathIntersection:r,parsePathArray:n(172),parsePathString:n(173),pathToAbsolute:i,path2absolute:i,pathTocurve:o,path2curve:o,rectPath:n(176)}},function(t,e,n){var r=n(2);t.exports=function t(e,n){if(e.length!==n.length)return!1;var i=!0;return r(e,function(t,e){if(t!==n[e])return i=!1,!1}),i}},function(t,e,n){var r=n(4),i=n(176),o=n(175),a=function t(e,n,r,i,o){var a,s;return e*(e*(-3*n+9*r-9*i+3*o)+6*n-12*r+6*i)-3*n+3*r},s=function t(e,n,r,i,o,s,u,c,l){null===l&&(l=1);for(var f=(l=l>1?1:l<0?0:l)/2,h=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],v=0,g=0;g0&&d<1&&c.push(d)}else{var g=h*h-4*p*f,y=Math.sqrt(g);if(!(g<0)){var m=(-h+y)/(2*f);m>0&&m<1&&c.push(m);var b=(-h-y)/(2*f);b>0&&b<1&&c.push(b)}}for(var x=c.length,_=x,w=void 0;x--;)w=1-(d=c[x]),l[0][x]=w*w*w*e+3*w*w*d*r+3*w*d*d*o+d*d*d*s,l[1][x]=w*w*w*n+3*w*w*d*i+3*w*d*d*a+d*d*d*u;return l[0][_]=e,l[1][_]=n,l[0][_+1]=s,l[1][_+1]=u,l[0].length=l[1].length=_+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}},c=function t(e,n,r,i,o,a,s,u){if(!(Math.max(e,r)Math.max(o,s)||Math.max(n,i)Math.max(a,u))){var c,l,f=(e-r)*(a-u)-(n-i)*(o-s);if(f){var h=((e*i-n*r)*(o-s)-(e-r)*(o*u-a*s))/f,p=((e*i-n*r)*(a-u)-(n-i)*(o*u-a*s))/f,d=+h.toFixed(2),v=+p.toFixed(2);if(!(d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(o,s).toFixed(2)||d>+Math.max(o,s).toFixed(2)||v<+Math.min(n,i).toFixed(2)||v>+Math.max(n,i).toFixed(2)||v<+Math.min(a,u).toFixed(2)||v>+Math.max(a,u).toFixed(2)))return{x:h,y:p}}}},l=function t(e,n,r){return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height},f=function t(e,n,r,o){return null===e&&(e=n=r=o=0),null===n&&(n=e.y,r=e.width,o=e.height,e=e.x),{x:e,y:n,width:r,w:r,height:o,h:o,x2:e+r,y2:n+o,cx:e+r/2,cy:n+o/2,r1:Math.min(r,o)/2,r2:Math.max(r,o)/2,r0:Math.sqrt(r*r+o*o)/2,path:i(e,n,r,o),vb:[e,n,r,o].join(" ")}},h=function t(e,n){return e=f(e),n=f(n),l(n,e.x,e.y)||l(n,e.x2,e.y)||l(n,e.x,e.y2)||l(n,e.x2,e.y2)||l(e,n.x,n.y)||l(e,n.x2,n.y)||l(e,n.x,n.y2)||l(e,n.x2,n.y2)||(e.xn.x||n.xe.x)&&(e.yn.y||n.ye.y)},p=function t(e,n,i,o,a,s,c,l){r(e)||(e=[e,n,i,o,a,s,c,l]);var h=u.apply(null,e);return f(h.min.x,h.min.y,h.max.x-h.min.x,h.max.y-h.min.y)},d=function t(e,n,r,i,o,a,s,u,c){var l=1-c,f=Math.pow(l,3),h=Math.pow(l,2),p=c*c,d=p*c,v,g,y=e+2*c*(r-e)+p*(o-2*r+e),m=n+2*c*(i-n)+p*(a-2*i+n),b=r+2*c*(o-r)+p*(s-2*o+r),x=i+2*c*(a-i)+p*(u-2*a+i),_,w,O,j,S;return{x:f*e+3*h*c*r+3*l*c*c*o+d*s,y:f*n+3*h*c*i+3*l*c*c*a+d*u,m:{x:y,y:m},n:{x:b,y:x},start:{x:l*e+c*r,y:l*n+c*i},end:{x:l*o+c*s,y:l*a+c*u},alpha:90-180*Math.atan2(y-b,m-x)/Math.PI}},v=function t(e,n,r){var i=p(e),o=p(n);if(!h(i,o))return r?0:[];for(var a,u,l=~~(s.apply(0,e)/8),f=~~(s.apply(0,n)/8),v=[],g=[],y={},m=r?0:[],b=0;b=0&&A<=1&&I>=0&&I<=1&&(r?m++:m.push({x:T.x,y:T.y,t1:A,t2:I}))}}return m},g=function t(e,n,r){e=o(e),n=o(n);for(var i=void 0,a=void 0,s=void 0,u=void 0,c=void 0,l=void 0,f=void 0,h=void 0,p=void 0,d=void 0,g=r?0:[],y=0,m=e.length;ye?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}t.exports=n},function(t,e,n){var r=n(15),i={getType:n(181),isArray:n(4),isArrayLike:n(20),isBoolean:n(182),isFunction:n(13),isNil:n(6),isNull:n(397),isNumber:n(11),isObject:n(38),isObjectLike:n(80),isPlainObject:n(39),isPrototype:n(184),isType:r,isUndefined:n(399),isString:n(14),isRegExp:n(398),isDate:n(183),isArguments:n(395),isError:n(396)};t.exports=i},function(t,e,n){var r=n(15),i=function t(e){return r(e,"Arguments")};t.exports=i},function(t,e,n){var r=n(15),i=function t(e){return r(e,"Error")};t.exports=i},function(t,e){var n=function t(e){return null===e};t.exports=n},function(t,e,n){var r=n(15),i=function t(e){return r(e,"RegExp")};t.exports=i},function(t,e){var n=function t(e){return void 0===e};t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(23));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Axis")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n=15.3.0");var d=function(t){function e(){return f(this,e),h(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return p(e,t),r(e,[{key:"render",value:function t(){var e=this.props,n=e.width,r=e.height,i=e.placeholder;return o.default.createElement("div",{style:{width:n,height:r}},i)}}]),e}(o.default.PureComponent||o.default.Component);d.propTypes={width:s.default.oneOfType([s.default.string,s.default.number]),height:s.default.oneOfType([s.default.string,s.default.number]),placeholder:s.default.node},d.defaultProps={width:"100%",placeholder:o.default.createElement("div",{style:{position:"relative",top:"48%",textAlign:"center"}},"\u6682\u65e0\u6570\u636e")},e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e` must be wrapped in ``"),this.id=this.context.createId(),this.context.addElement(this.name,this.id,this.props,this.context.getParentInfo(),this.context.getViewId())}}]),e}(s.default);d.contextTypes={addElement:c.default.func,updateElement:c.default.func,deleteElement:c.default.func,createId:c.default.func,getParentInfo:c.default.func,getViewId:c.default.func},d.childContextTypes={addElement:c.default.func,updateElement:c.default.func,deleteElement:c.default.func,createId:c.default.func,getParentInfo:c.default.func,getViewId:c.default.func},e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=s(n(23)),o,a=s(n(28));function s(t){return t&&t.__esModule?t:{default:t}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var f=function(t){function e(t){return u(this,e),c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,"Legend"))}return l(e,t),e}(i.default);f.contextTypes={addElement:a.default.func,updateElement:a.default.func,deleteElement:a.default.func,createId:a.default.func,getParentInfo:a.default.func,getViewId:a.default.func},f.childContextTypes={addElement:a.default.func,updateElement:a.default.func,deleteElement:a.default.func,createId:a.default.func,getParentInfo:a.default.func,getViewId:a.default.func},f.defaultProps={visible:!0},e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(23));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default.generateBaseTypedComponent("Tooltip")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var m=u.default.COORD_FUNC_PROPS,b=u.default.GEOM_FUNC_PROPS,x={needRebuildChart:function t(e){if(null==e.chart.props||null==e.chart.updateProps)return!1;var n=e.chart.props,r=e.chart.updateProps;return!(a.Util.shallowEqual(n.padding,r.padding)&&a.Util.shallowEqual(n.background,r.background)&&a.Util.shallowEqual(n.plotBackground,r.plotBackground)&&a.Util.shallowEqual(n.pixelRatio,r.pixelRatio))},needReExecute:function t(e){var n=e.geoms;if(null==n)return!1;for(var r in n)if(n[r].props&&n[r].updateProps&&(n[r].props.type!==n[r].updateProps.type||n[r].props.color&&!n[r].updateProps.color||n[r].props.size&&!n[r].updateProps.size||n[r].props.shape&&!n[r].updateProps.shape))return!0;return!1},synchronizeG2Update:function t(e,n){this.updateChart(e,n.chart),this.updateAxises(e,n.axises),this.updateTooltip(e,n),this.updateCoord(e,n),this.updateLegends(e,n.legends),this.updateGeoms(e,n.geoms),this.updateGuide(e,n.guide),this.updateFacet(e,n),this.updateViews(e,n)},updateChart:function t(e,n){if(n){var r=n.props,i=n.updateProps,o=r.width,s=r.height,u=r.animate,c=r.data,l=r.scale,f=i.width,h=i.height,p=i.animate,v=i.data,g=i.scale;c!==v&&e.changeData(v),a.Util.shallowEqual(l,g)||(a.Util.isArray(g)?e.scale(g[0],g[1]):e.scale(g)),u!==p&&e.animate(p),o!==f&&s!==h?e.changeSize(f,h):o!==f?e.changeWidth(f):s!==h&&e.changeHeight(h),d.default.updateEvents(e,d.default.chartEvents,n.props,i),d.default.updateBaseEvents(e,n.updateProps,i)}},updateAxis:function t(e,n){var r=n.props,i=r.name,s=r.visible,u=y(r,["name","visible"]),c=n.updateProps,l=c.name,f=c.visible,h=y(c,["name","visible"]);(0,o.default)(i===l,"`name` propertry should not be changed in ``"),s!==f&&e.axis(i,!!f),a.Util.shallowEqual(u,h)||e.axis(i,h)},updateAxises:function t(e,n){if(n)for(var r in n)n[r]&&n[r].props&&n[r].updateProps&&this.updateAxis(e,n[r])},updateTooltip:function t(e,n){if(n.tooltip){var i=n.tooltip.props,o=n.tooltip.updateProps;null==i&&null==o||a.Util.shallowEqual(i,o)||e.tooltip(r({},o))}},updateCoord:function t(e,n){var r=n.coord;if(r){var i=r.props,o=r.updateProps;if(null!=i&&null!=o){var s=a.Util.without(o,m.concat(["type"]));if(!a.Util.shallowEqual(i,o)){var u=e.coord(o.type,s);r.g2Instance=u,a.Prop.init(m,o,function(t,e){"reflect"===e?a.Util.each(t,function(t){return u[e](t)}):u[e].apply(u,g(t))})}}}},updateLegend:function t(e,n){var r=n.props,i=n.updateProps;if(i&&!a.Util.shallowEqual(r,i)){var o=i.name,s=i.visible,u=y(i,["name","visible"]),c=s?u:s;e.legend.apply(e,g(o?[o,c]:[c]))}},updateLegends:function t(e,n){if(null!=n)for(var r in n)n[r]&&this.updateLegend(e,n[r])},updateLabel:function t(e,n,r){if(null!=n&&null!=r){var i=n.content,o=y(n,["content"]),s=r.content,u=y(r,["content"]);a.Util.shallowEqual(o,u)&&a.Util.shallowEqual(i,s)||(a.Util.isArray(s)?e.label(s[0],s[1],u):e.label(s,u))}},updateGeom:function t(e,n){var r=n.props,i=n.updateProps;if(r&&i&&r.type===i.type){var o=n.g2Instance;if(a.Util.shallowEqual(r,i))n.label&&this.updateLabel(o,n.label.props,n.label.updateProps);else{var s=r.adjust,u=y(r,["adjust"]),c=i.adjust,l=y(i,["adjust"]);(s||c)&&o.adjust(c),a.Prop.update(b,u,l,function(t,e){o[e].apply(o,g(t))}),n.label&&this.updateLabel(o,n.label.props,n.label.updateProps)}}},updateGeoms:function t(e,n){if(null==n)return!1;for(var r in n)n[r]&&this.updateGeom(e,n[r]);return!1},isTypedGuideChanged:function t(e){return!a.Util.shallowEqual(e.props,e.updateProps)},updateGuide:function t(e,n){if(n&&n.elements){var r=n.elements,i=!1;for(var o in r)if(r[o]&&(r[o].updateProps||this.isTypedGuideChanged(r[o]))){i=!0;break}i&&(h.default.mergeGuide(n,!0),e.guide().clear(),l.default.guide(e,n))}},updateView:function t(e,n){if(n&&n.props&&n.updateProps&&"Facet"!==n.parentInfo.name){var r=n.g2Instance,i=n.props,o=n.updateProps,s=i.scale,u=i.data,c=i.animate,l=i.axis,f=i.filter,h=o.scale,p=o.animate,d=o.data,v=o.axis,g=o.filter;c!==p&&r.animate(p),u!==d&&r.changeData(d),a.Util.shallowEqual(s,h)||r.scale(h),a.Util.shallowEqual(f,g)||g.forEach(function(t){r.filter(t[0],t[1])}),l!==v&&r.axis(v),this.updateCoord(r,n),this.updateAxises(r,n.axises),this.updateGeoms(r,n.geoms),this.updateGuide(r,n.guide)}},updateViews:function t(e,n){var r=n.views;if(r)for(var i in r){var o=r[i];o&&(o.needReExecute||this.needReExecute(o))?(l.default.synchronizeG2View(o.g2Instance,o),r[i].needReExecute=!1):this.updateView(e,o)}},updateFacet:function t(e,n){var r=n.facet;if(r){var i=r.props,o=r.updateProps;if(null!=i&&null!=o){var s=i.type,u=y(i,["type"]),c=o.type,f=y(o,["type"]);s===c&&a.Util.shallowEqual(u,f)||(r.props=o,l.default.facet(e,n))}}}};e.default=x},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var b=function(){function t(){m(this,t),this.config={},this.elementInfos={},this.added=!1,this.initedG2=!1,this.updated=!1,this.deleted=!1,this.deleteInfos={}}return i(t,[{key:"calUpdateFlag",value:function t(e,n){var r=this.elementInfos[n].props,i=r.children,o=y(r,["children"]),a=this.elementInfos[n].updateProps,s=a.children,u=y(a,["children"]);if("Chart"===e||"View"===e){var c=o.data,l=y(o,["data"]),f=u.data,h=y(u,["data"]);c===f&&v.Util.isEqual(l,h)||(this.updated=!0)}else v.Util.isEqual(o,u)||(this.updated=!0)}},{key:"addElement",value:function t(e,n,i,o,s){!this.chart&&this.initedG2||(this.added=!0,this.elementInfos[n]={id:n,viewId:s,parentInfo:o,name:e,props:r({},i)},o&&!this.elementInfos[o.id]&&(this.elementInfos[o.id]={id:o.id,name:o.name}),a.default.addElement(e,this.config,this.elementInfos[n]))}},{key:"updateElement",value:function t(e,n,i){this.elementInfos[n].updateProps=r({},i),this.calUpdateFlag(e,n)}},{key:"deleteElement",value:function t(e,n){this.chart&&(this.deleteInfos[n]=n,this.deleted=!0)}},{key:"createG2Instance",value:function t(){var e=this.config,n=d.default.createChart(e,this.elementInfos);return d.default.executeChartConfig(n,e,this.elementInfos),d.default.synchronizeG2Add(n,e,this.elementInfos),n.render(),this.chart=n,this.initedG2=!0,this.resetStates(),n}},{key:"destory",value:function t(){this.chart.destroy(),this.chart=null}},{key:"resetStates",value:function t(){var e=this.elementInfos;for(var n in e)e[n].updateProps&&delete e[n].updateProps,this.deleteInfos[n]&&delete e[n];this.added=!1,this.updated=!1,this.deleteInfos={}}},{key:"reExecuteChart",value:function t(){return this.chart.clear(),u.default.merge(this.config,this.deleteInfos,this.elementInfos,!0),d.default.executeChartConfig(this.chart,this.config,this.elementInfos),d.default.synchronizeG2Add(this.chart,this.config,this.elementInfos),this.chart.repaint(),this.resetStates(),this.chart}},{key:"batchedUpdate",value:function t(){return null==this.chart?null:this.config.chart.props.forceUpdate||l.default.needRebuildChart(this.config)?(u.default.merge(this.config,this.deleteInfos,this.elementInfos,!0),this.chart.destroy(),this.chart="destroy",this.createG2Instance()):h.default.needReExecute(this.deleteInfos,this.elementInfos)||l.default.needReExecute(this.config)?(this.reExecuteChart(),this.chart):(this.deleted&&(h.default.synchronizeG2Delete(this.chart,this.config,this.deleteInfos,this.elementInfos),u.default.mergeDelete(this.config,this.deleteInfos,this.elementInfos)),this.added&&d.default.synchronizeG2Add(this.chart,this.config),this.updated&&l.default.synchronizeG2Update(this.chart,this.config),(this.added||this.deleted||this.updated)&&this.chart.repaint(),u.default.mergeUpdate(this.config,!1),this.resetStates(),this.chart)}}]),t}();e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=o(n(54));function o(t){return t&&t.__esModule?t:{default:t}}e.default={init:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],r=arguments[2];i.default.each(e,function(t){var e=n[t];void 0!==e&&(i.default.isArray(e)||(e=[e]),r(e,t))})},update:function t(e,n,r,o){var a=void 0,s=void 0;i.default.each(e,function(t){a=n[t],s=r[t],i.default.shallowEqual(s,a)||(i.default.isArray(s)||(s=[s]),o(s,t))})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={}},function(t,e,n){"use strict";e.a=v;var r=n(84),i=n(83),o=n(189),a=-.14861,s=1.78277,u=-.29227,c=-.90649,l=1.97294,f=l*c,h=l*s,p=s*u-c*a;function d(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);t instanceof i.a||(t=n.i(i.b)(t));var e=t.r/255,r=t.g/255,a=t.b/255,s=(p*a+f*e-h*r)/(p+f-h),d=a-s,v=(l*(r-s)-u*d)/c,y=Math.sqrt(v*v+d*d)/(l*s*(1-s)),m=y?Math.atan2(v,d)*o.a-120:NaN;return new g(m<0?m+360:m,y,s,t.opacity)}function v(t,e,n,r){return 1===arguments.length?d(t):new g(t,e,n,null==r?1:r)}function g(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}n.i(r.a)(g,v,n.i(r.b)(i.c,{brighter:function(t){return t=null==t?i.d:Math.pow(i.d,t),new g(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?i.e:Math.pow(i.e,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*o.b,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),f=Math.sin(t);return new i.a(255*(e+n*(a*r+s*f)),255*(e+n*(u*r+c*f)),255*(e+n*(l*r)),this.opacity)}}))},function(t,e,n){"use strict";e.b=g,e.a=j;var r=n(84),i=n(83),o=n(189),a=18,s=.96422,u=1,c=.82521,l=4/29,f=6/29,h=3*f*f,p=f*f*f;function d(t){if(t instanceof y)return new y(t.l,t.a,t.b,t.opacity);if(t instanceof S){if(isNaN(t.h))return new y(t.l,0,0,t.opacity);var e=t.h*o.b;return new y(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof i.a||(t=n.i(i.b)(t));var r=_(t.r),a=_(t.g),l=_(t.b),f=m((.2225045*r+.7168786*a+.0606169*l)/u),h,p;return r===a&&a===l?h=p=f:(h=m((.4360747*r+.3850649*a+.1430804*l)/s),p=m((.0139322*r+.0971045*a+.7141733*l)/c)),new y(116*f-16,500*(h-f),200*(f-p),t.opacity)}function v(t,e){return new y(t,0,0,null==e?1:e)}function g(t,e,n,r){return 1===arguments.length?d(t):new y(t,e,n,null==r?1:r)}function y(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function m(t){return t>p?Math.pow(t,1/3):t/h+l}function b(t){return t>f?t*t*t:h*(t-l)}function x(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function _(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function w(t){if(t instanceof S)return new S(t.h,t.c,t.l,t.opacity);if(t instanceof y||(t=d(t)),0===t.a&&0===t.b)return new S(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*o.a;return new S(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function O(t,e,n,r){return 1===arguments.length?w(t):new S(n,e,t,null==r?1:r)}function j(t,e,n,r){return 1===arguments.length?w(t):new S(t,e,n,null==r?1:r)}function S(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}n.i(r.a)(y,g,n.i(r.b)(i.c,{brighter:function(t){return new y(this.l+a*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new y(this.l-a*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=s*b(e),t=u*b(t),n=c*b(n),new i.a(x(3.1338561*e-1.6168667*t-.4906146*n),x(-.9787684*e+1.9161415*t+.033454*n),x(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),n.i(r.a)(S,j,n.i(r.b)(i.c,{brighter:function(t){return new S(this.h,this.c,this.l+a*(null==t?1:t),this.opacity)},darker:function(t){return new S(this.h,this.c,this.l-a*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}))},function(t,e,n){"use strict";var r={value:function(){}};function i(){for(var t=0,e=arguments.length,n={},r;t=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function s(t,e){for(var n=0,r=t.length,i;n0)for(var n=new Array(i),r=0,i,o;r180?e+=360:e-t>180&&(t+=360),s.push({i:i.push(a(i)+"rotate(",null,o)-2,x:n.i(r.a)(t,e)})):e&&i.push(a(i)+"rotate("+e+o)}function c(t,e,i,s){t!==e?s.push({i:i.push(a(i)+"skewX(",null,o)-2,x:n.i(r.a)(t,e)}):e&&i.push(a(i)+"skewX("+e+o)}function l(t,e,i,o,s,u){if(t!==i||e!==o){var c=s.push(a(s)+"scale(",null,",",null,")");u.push({i:c-4,x:n.i(r.a)(t,i)},{i:c-2,x:n.i(r.a)(e,o)})}else 1===i&&1===o||s.push(a(s)+"scale("+i+","+o+")")}return function(e,n){var r=[],i=[];return e=t(e),n=t(n),s(e.translateX,e.translateY,n.translateX,n.translateY,r,i),u(e.rotate,n.rotate,r,i),c(e.skewX,n.skewX,r,i),l(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){for(var e=-1,n=i.length,o;++e180?e+=360:e-t>180&&(t+=360),s.push({i:i.push(a(i)+"rotate(",null,o)-2,x:n.i(r.a)(t,e)})):e&&i.push(a(i)+"rotate("+e+o)}function c(t,e,i,s){t!==e?s.push({i:i.push(a(i)+"skewX(",null,o)-2,x:n.i(r.a)(t,e)}):e&&i.push(a(i)+"skewX("+e+o)}function l(t,e,i,o,s,u){if(t!==i||e!==o){var c=s.push(a(s)+"scale(",null,",",null,")");u.push({i:c-4,x:n.i(r.a)(t,i)},{i:c-2,x:n.i(r.a)(e,o)})}else 1===i&&1===o||s.push(a(s)+"scale("+i+","+o+")")}return function(e,n){var r=[],i=[];return e=t(e),n=t(n),s(e.translateX,e.translateY,n.translateX,n.translateY,r,i),u(e.rotate,n.rotate,r,i),c(e.skewX,n.skewX,r,i),l(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){for(var e=-1,n=i.length,o;++e=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}},e.a=function(t,e){var n=r(t+"");if(arguments.length<2){for(var o=i(this.node()),a=-1,s=n.length;++a=j&&(j=O+1);!(E=_[j])&&++j=0;)(a=r[i])&&(o&&o!==a.nextSibling&&o.parentNode.insertBefore(a,o),o=a);return this}},function(t,e,n){"use strict";function r(t){return function(){delete this[t]}}function i(t,e){return function(){this[t]=e}}function o(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}e.a=function(t,e){return arguments.length>1?this.each((null==e?r:"function"==typeof e?o:i)(t,e)):this.node()[t]}},function(t,e,n){"use strict";function r(){this.nextSibling&&this.parentNode.appendChild(this)}e.a=function(){return this.each(r)}},function(t,e,n){"use strict";function r(){var t=this.parentNode;t&&t.removeChild(this)}e.a=function(){return this.each(r)}},function(t,e,n){"use strict";var r=n(16),i=n(93);e.a=function(t){"function"!=typeof t&&(t=n.i(i.a)(t));for(var e=this._groups,o=e.length,a=new Array(o),s=0;se?1:t>=e?0:NaN}e.a=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=i);for(var n=this._groups,o=n.length,a=new Array(o),s=0;si.d&&a.name===e)return new r.b([[t]],o,e,+s);return null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(496),i=n(27);n.d(e,"transition",function(){return i.a});var o=n(494);n.d(e,"active",function(){return o.a});var a=n(211);n.d(e,"interrupt",function(){return a.a})},function(t,e,n){"use strict";var r=n(21),i=n(497),o=n(498);r.selection.prototype.interrupt=i.a,r.selection.prototype.transition=o.a},function(t,e,n){"use strict";var r=n(211);e.a=function(t){return this.each(function(){n.i(r.a)(this,t)})}},function(t,e,n){"use strict";var r=n(27),i=n(17),o=n(190),a=n(96),s={time:null,delay:0,duration:250,ease:o.easeCubicInOut};function u(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))return s.time=n.i(a.now)(),s;return r}e.a=function(t){var e,o;t instanceof r.b?(e=t._id,t=t._name):(e=n.i(r.c)(),(o=s).time=n.i(a.now)(),t=null==t?null:t+"");for(var c=this._groups,l=c.length,f=0;f=0&&(t=t.slice(0,e)),!t||"start"===t})}function o(t,e,n){var o,a,s=i(e)?r.g:r.e;return function(){var r=s(this,t),i=r.on;i!==o&&(a=(o=i).copy()).on(e,n),r.on=a}}e.a=function(t,e){var i=this._id;return arguments.length<2?n.i(r.f)(this.node(),i).on.on(t):this.each(o(i,t,e))}},function(t,e,n){"use strict";function r(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}e.a=function(){return this.on("end.remove",r(this._id))}},function(t,e,n){"use strict";var r=n(21),i=n(27),o=n(17);e.a=function(t){var e=this._name,a=this._id;"function"!=typeof t&&(t=n.i(r.selector)(t));for(var s=this._groups,u=s.length,c=new Array(u),l=0;l1){var d=f(i);for(p=0;p-1){var _=t[y.parentIndex[x]],w=Math.atan2(y.x-_.x,y.y-_.y),O=Math.atan2(g.x-_.x,g.y-_.y),j=O-w;j<0&&(j+=2*Math.PI);var S=O-j/2,E=u(m,{x:_.x+_.radius*Math.sin(S),y:_.y+_.radius*Math.cos(S)});E>2*_.radius&&(E=2*_.radius),(null===b||b.width>E)&&(b={circle:_,width:E,p1:y,p2:g})}null!==b&&(h.push(b),c+=s(b.circle.radius,b.width),g=y)}}else{var M=t[0];for(p=1;pMath.abs(M.radius-t[p].radius)){C=!0;break}C?c=l=0:(c=M.radius*M.radius*Math.PI,h.push({circle:M,p1:{x:M.x,y:M.y+M.radius},p2:{x:M.x-r,y:M.y+M.radius},width:2*M.radius}))}return l/=2,e&&(e.area=c+l,e.arcArea=c,e.polygonArea=l,e.arcs=h,e.innerPoints=i,e.intersectionPoints=n),c+l}function o(t,e){for(var n=0;ne[n].radius+r)return!1;return!0}function a(t){for(var e=[],n=0;n=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);var r,i=e-(n*n-t*t+e*e)/(2*n);return s(t,t-(n*n-e*e+t*t)/(2*n))+s(e,i)}function l(t,e){var n=u(t,e),r=t.radius,i=e.radius;if(n>=r+i||n<=Math.abs(r-i))return[];var o=(r*r-i*i+n*n)/(2*n),a=Math.sqrt(r*r-o*o),s=t.x+o*(e.x-t.x)/n,c=t.y+o*(e.y-t.y)/n,l=-(e.y-t.y)*(a/n),f=-(e.x-t.x)*(a/n);return[{x:s+l,y:c-f},{x:s-l,y:c+f}]}function f(t){for(var e={x:0,y:0},n=0;n0)throw"Initial bisect points must have opposite signs";if(0===a)return e;if(0===s)return n;for(var c=0;c=0&&(e=l),Math.abs(u)=d[p-1].fx){var C=!1;if(_.fx>M.fx?(m(w,1+l,x,-l,M),w.fx=t(w),w.fx=1)break;for(v=1;vs+o*i*u||c>=p)h=i;else{if(Math.abs(f)<=-a*u)return i;f*(h-l)>=0&&(h=l),l=i,p=c}return 0}i=i||1,o=o||1e-6,a=a||.1;for(var d=0;d<10;++d){if(m(r.x,1,n.x,i,e),c=r.fx=t(r.x,r.fxprime),f=v(r.fxprime,e),c>s+o*i*u||d&&c>=l)return p(h,i,l);if(Math.abs(f)<=-a*u)return i;if(f>=0)return p(i,h,c);l=c,h=i,i*=2}return i}function _(t,e,n){var r={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()},o=e.slice(),a,s,u=1,c;c=(n=n||{}).maxIterations||20*e.length,r.fx=t(r.x,r.fxprime),y(a=r.fxprime.slice(),r.fxprime,-1);for(var l=0;le}),r=0;r=Math.min(e[o].size,e[a].size)?l=1:t.size<=1e-10&&(l=-1),i[o][a]=i[a][o]=l}),{distances:r,constraints:i}}function M(t,e,n,r){var i=0,o;for(o=0;o0&&d<=f||h<0&&d>=f||(i+=2*v*v,e[2*o]+=4*v*(a-c),e[2*o+1]+=4*v*(s-l),e[2*u]+=4*v*(c-a),e[2*u+1]+=4*v*(l-s))}return i}function C(t,e){var n=k(t,e),r=e.lossFunction||T;if(t.length>=8){var i=P(t,e),o,a;r(i,t)+1e-8=Math.min(r[f].size,r[h].size)&&(c=0),i[f].push({set:h,size:u.size,weight:c}),i[h].push({set:f,size:u.size,weight:c})}var p=[];for(o in i)if(i.hasOwnProperty(o)){var d=0;for(a=0;a0){var o=t[0].x,a=t[0].y;for(r=0;r1){var s=Math.atan2(t[1].x,t[1].y)-e,c=Math.cos(s),l=Math.sin(s),f,h;for(r=0;r2){for(var p=Math.atan2(t[2].x,t[2].y)-e;p<0;)p+=2*Math.PI;for(;p>2*Math.PI;)p-=2*Math.PI;if(p>Math.PI){var d=t[1].y/(1e-10+t[1].x);for(r=0;r=h.length&&(p=0),e},v=w,g=T;function y(f){var h=f.datum(),p={};h.forEach(function(t){0==t.size&&1==t.sets.length&&(p[t.sets[0]]=1)});var y={},m={};if((h=h.filter(function(t){return!t.sets.some(function(t){return t in p})})).length>0){var b=v(h,{lossFunction:g});a&&(b=N(b,o,l)),y=D(b,t,n,r),m=V(y,h)}var x={};function _(t){return t.sets in x?x[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}h.forEach(function(t){t.label&&(x[t.sets]=t.label)}),f.selectAll("svg").data([y]).enter().append("svg");var w=f.select("svg").attr("width",t).attr("height",n),O={},j=!1;w.selectAll(".venn-area path").each(function(t){var n=e.select(this).attr("d");1==t.sets.length&&n&&(j=!0,O[t.sets[0]]=G(n))});var S=function(e){return function(r){var i;return U(e.sets.map(function(e){var i=O[e],o=y[e];return i||(i={x:t/2,y:n/2,radius:1}),o||(o={x:t/2,y:n/2,radius:1}),{x:i.x*(1-r)+o.x*r,y:i.y*(1-r)+o.y*r,radius:i.radius*(1-r)+o.radius*r}}))}},E=w.selectAll(".venn-area").data(h,function(t){return t.sets}),M=E.enter().append("g").attr("class",function(t){return"venn-area venn-"+(1==t.sets.length?"circle":"intersection")}).attr("data-venn-sets",function(t){return t.sets.join("_")}),C=M.append("path"),P=M.append("text").attr("class","label").text(function(t){return _(t)}).attr("text-anchor","middle").attr("dy",".35em").attr("x",t/2).attr("y",n/2);u&&(C.style("fill-opacity","0").filter(function(t){return 1==t.sets.length}).style("fill",function(t){return d(t.sets)}).style("fill-opacity",".25"),P.style("fill",function(t){return 1==t.sets.length?d(t.sets):"#444"}));var k=f;j?(k=f.transition("venn").duration(i)).selectAll("path").attrTween("d",S):k.selectAll("path").attr("d",function(t){return U(t.sets.map(function(t){return y[t]}))});var T=k.selectAll("text").filter(function(t){return t.sets in m}).text(function(t){return _(t)}).attr("x",function(t){return Math.floor(m[t.sets].x)}).attr("y",function(t){return Math.floor(m[t.sets].y)});s&&(j?"on"in T?T.on("end",F(y,_)):T.each("end",F(y,_)):T.each(F(y,_)));var A=E.exit().transition("venn").duration(i).remove();A.selectAll("path").attrTween("d",S);var I=A.selectAll("text").attr("x",t/2).attr("y",n/2);return null!==c&&(P.style("font-size","0px"),T.style("font-size",c),I.style("font-size","0px")),{circles:y,textCentres:m,nodes:E,enter:M,update:k,exit:A}}return y.wrap=function(t){return arguments.length?(s=t,y):s},y.width=function(e){return arguments.length?(t=e,y):t},y.height=function(t){return arguments.length?(n=t,y):n},y.padding=function(t){return arguments.length?(r=t,y):r},y.colours=function(t){return arguments.length?(d=t,y):d},y.fontSize=function(t){return arguments.length?(c=t,y):c},y.duration=function(t){return arguments.length?(i=t,y):i},y.layoutFunction=function(t){return arguments.length?(v=t,y):v},y.normalize=function(t){return arguments.length?(a=t,y):a},y.styled=function(t){return arguments.length?(u=t,y):u},y.orientation=function(t){return arguments.length?(o=t,y):o},y.orientationOrder=function(t){return arguments.length?(l=t,y):l},y.lossFunction=function(t){return arguments.length?(g=t,y):g},y}function F(t,n){return function(){for(var r=e.select(this),i=r.datum(),o=t[i.sets[0]].radius||50,a=n(i)||"",s=a.split(/\s+/).reverse(),u=3,c=(a.length+s.length)/3,l=s.pop(),f=[l],h,p=0,d=1.1,v=r.text(null).append("tspan").text(l);l=s.pop();)f.push(l),h=f.join(" "),v.text(h),h.length>c&&v.node().getComputedTextLength()>o&&(f.pop(),v.text(f.join(" ")),f=[l],v=r.append("tspan").text(l),p++);var g=.35-1.1*p/2,y=r.attr("x"),m=r.attr("y");r.selectAll("tspan").attr("x",y).attr("y",m).attr("dy",function(t,e){return g+1.1*e+"em"})}}function z(t,e,n){var r=e[0].radius-u(e[0],t),i,o;for(i=1;i=s&&(a=n[r],s=c)}var l=b(function(n){return-1*z({x:n[0],y:n[1]},t,e)},[a.x,a.y],{maxIterations:500,minErrorDelta:1e-10}).x,h={x:l[0],y:l[1]},p=!0;for(r=0;rt[r].radius){p=!1;break}for(r=0;r0&&console.log("WARNING: area "+o+" not represented on screen")}return n}function W(t,e){for(var n=Y(t.selectAll("svg").datum()),r={},i=0;iu;o.push("\nA",u,u,0,c?1:0,1,s.p1.x,s.p1.y)}return o.join(" ")}t.intersectionArea=i,t.circleCircleIntersection=l,t.circleOverlap=c,t.circleArea=s,t.distance=u,t.venn=w,t.greedyLayout=k,t.scaleSolution=D,t.normalizeSolution=N,t.bestInitialLayout=C,t.lossFunction=T,t.disjointCluster=I,t.distanceFromIntersectArea=j,t.VennDiagram=R,t.wrapText=F,t.computeTextCentres=V,t.computeTextCentre=B,t.sortAreas=W,t.circlePath=H,t.circleFromPath=G,t.intersectionAreaPath=U,Object.defineProperty(t,"__esModule",{value:!0})})(e,n(21),n(495))},function(t,e,n){n(60),t.exports=n(60)}])})},function(t,e,n){n(478)},function(t,e,n){"use strict";e.__esModule=!0;var r,i=o(n(513));function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):f(t,e))}var g="zh-cn",y={},m=function t(e){return e.displayName||e.name||("string"==typeof e?e:"Component")},b=function t(e){var n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=(i=n=function(n){function i(){return p(this,i),d(this,n.apply(this,arguments))}return v(i,n),i.prototype._getInstance=function t(e){e&&(this.refs=e.refs,this._instance=e)},i.prototype.getInstance=function t(){return this._instance},i.prototype.render=function n(){var s=this.props,u=s.language,l=s.locale,f=void 0===l?{}:l,p=h(s,["language","locale"]),d=void 0,v=void 0,g=void 0,b=void 0;return u||(u=t.get()),d=i.LOCALE&&(i.LOCALE[u]||i.LOCALE["en-us"]),v=m(e),g=y[v]?y[v]:{},b=a.deepMerge?(0,c.default)({},d,g,f):r({},d,g,f),p.ref=this._getInstance.bind(this),o.default.createElement(e,r({locale:b,language:u},p))},i}(o.default.Component),n.propTypes={language:s.default.string,locale:s.default.object},i);return u.displayName="LocaleProvider",t.init(u),u.displayName="LocaleProvider("+m(e)+")",u};b.init=function(t){t.LOCALE=t.LOCALE||{}},b.set=function(t){g=t},b.get=function(){return g},b.setComponents=function(t){y=r({},y,t)},e.default=b,t.exports=e.default},function(t,e,n){n(183),n(183),t.exports=n(57)},function(t,e,n){var r=n(10),i=n(33),o=n(32),a=n(61)("src"),s="toString",u=Function.toString,c=(""+u).split(s);n(20).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,s,function t(){return"function"==typeof this&&this[a]||u.call(this)})},function(t,e,n){var r=n(49);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(2),i=n(8),o=n(49),a=/"/g,s=function(t,e,n,r){var i=String(o(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+""};t.exports=function(t,e){var n={};n[t]=e(s),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=f(n(230)),o,a=f(n(233)),s,u=f(n(234)),c,l=f(n(509));function f(t){return t&&t.__esModule?t:{default:t}}i.default.Gateway=a.default,i.default.Position=u.default,i.default.Popup=l.default,e.default=i.default,t.exports=e.default},function(t,e,n){"use strict";var r=function(t,e,n,r,i,o,a,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,a,s],l=0;(u=new Error(e.replace(/%s/g,function(){return c[l++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}};t.exports=r},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(18),i=n(60);t.exports=n(19)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(93),i=n(49);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(259),i=n(585),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return"[object ArrayBuffer]"===o.call(t)}function u(t){return"undefined"!=typeof FormData&&t instanceof FormData}function c(t){var e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer}function l(t){return"string"==typeof t}function f(t){return"number"==typeof t}function h(t){return void 0===t}function p(t){return null!==t&&"object"==typeof t}function d(t){return"[object Date]"===o.call(t)}function v(t){return"[object File]"===o.call(t)}function g(t){return"[object Blob]"===o.call(t)}function y(t){return"[object Function]"===o.call(t)}function m(t){return p(t)&&y(t.pipe)}function b(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams}function x(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function _(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function w(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n0?r:n)(t)}},function(t,e,n){var r=n(94),i=n(60),o=n(34),a=n(53),s=n(32),u=n(198),c=Object.getOwnPropertyDescriptor;e.f=n(19)?c:function t(e,n){if(e=o(e),n=a(n,!0),u)try{return c(e,n)}catch(t){}if(s(e,n))return i(!r.f.call(e,n),e[n])}},function(t,e,n){var r=n(2),i=n(20),o=n(8);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(t,e,n){var r=n(46),i=n(93),o=n(28),a=n(16),s=n(404);t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,l=4==t,f=6==t,h=5==t||f,p=e||s;return function(e,s,d){for(var v=o(e),g=i(v),y=r(s,d,3),m=a(g.length),b=0,x=n?p(e,m):u?p(e,0):void 0,_,w;m>b;b++)if((h||b in g)&&(w=y(_=g[b],b,v),t))if(n)x[b]=w;else if(w)switch(t){case 3:return!0;case 5:return _;case 6:return b;case 2:x.push(_)}else if(l)return!1;return f?-1:c||l?l:x}}},function(t,e,n){var r=n(47);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";if(n(19)){var r=n(62),i=n(10),o=n(8),a=n(2),s=n(116),u=n(156),c=n(46),l=n(79),f=n(60),h=n(33),p=n(80),d=n(42),v=n(16),g=n(224),y=n(64),m=n(53),b=n(32),x=n(95),_=n(11),w=n(28),O=n(148),j=n(65),S=n(67),E=n(66).f,M=n(150),C=n(61),P=n(15),k=n(45),T=n(106),A=n(96),I=n(152),L=n(76),N=n(109),D=n(78),R=n(151),F=n(215),z=n(18),B=n(43),Y=z.f,V=B.f,W=i.RangeError,H=i.TypeError,G=i.Uint8Array,U="ArrayBuffer",q="SharedArrayBuffer",K="BYTES_PER_ELEMENT",X="prototype",Z=Array.prototype,$=u.ArrayBuffer,Q=u.DataView,J=k(0),tt=k(2),et=k(3),nt=k(4),rt=k(5),it=k(6),ot=T(!0),at=T(!1),st=I.values,ut=I.keys,ct=I.entries,lt=Z.lastIndexOf,ft=Z.reduce,ht=Z.reduceRight,pt=Z.join,dt=Z.sort,vt=Z.slice,gt=Z.toString,yt=Z.toLocaleString,mt=P("iterator"),bt=P("toStringTag"),xt=C("typed_constructor"),_t=C("def_constructor"),wt=s.CONSTR,Ot=s.TYPED,jt=s.VIEW,St="Wrong length!",Et=k(1,function(t,e){return Tt(A(t,t[_t]),e)}),Mt=o(function(){return 1===new G(new Uint16Array([1]).buffer)[0]}),Ct=!!G&&!!G.prototype.set&&o(function(){new G(1).set({})}),Pt=function(t,e){var n=d(t);if(n<0||n%e)throw W("Wrong offset!");return n},kt=function(t){if(_(t)&&Ot in t)return t;throw H(t+" is not a typed array!")},Tt=function(t,e){if(!(_(t)&&xt in t))throw H("It is not a typed array constructor!");return new t(e)},At=function(t,e){return It(A(t,t[_t]),e)},It=function(t,e){for(var n=0,r=e.length,i=Tt(t,r);r>n;)i[n]=e[n++];return i},Lt=function(t,e,n){Y(t,e,{get:function(){return this._d[n]}})},Nt=function t(e){var n=w(e),r=arguments.length,i=r>1?arguments[1]:void 0,o=void 0!==i,a=M(n),s,u,l,f,h,p;if(void 0!=a&&!O(a)){for(p=a.call(n),l=[],s=0;!(h=p.next()).done;s++)l.push(h.value);n=l}for(o&&r>2&&(i=c(i,arguments[2],2)),s=0,u=v(n.length),f=Tt(this,u);u>s;s++)f[s]=o?i(n[s],s):n[s];return f},Dt=function t(){for(var e=0,n=arguments.length,r=Tt(this,n);n>e;)r[e]=arguments[e++];return r},Rt=!!G&&o(function(){yt.call(new G(1))}),Ft=function t(){return yt.apply(Rt?vt.call(kt(this)):kt(this),arguments)},zt={copyWithin:function t(e,n){return F.call(kt(this),e,n,arguments.length>2?arguments[2]:void 0)},every:function t(e){return nt(kt(this),e,arguments.length>1?arguments[1]:void 0)},fill:function t(e){return R.apply(kt(this),arguments)},filter:function t(e){return At(this,tt(kt(this),e,arguments.length>1?arguments[1]:void 0))},find:function t(e){return rt(kt(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function t(e){return it(kt(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function t(e){J(kt(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function t(e){return at(kt(this),e,arguments.length>1?arguments[1]:void 0)},includes:function t(e){return ot(kt(this),e,arguments.length>1?arguments[1]:void 0)},join:function t(e){return pt.apply(kt(this),arguments)},lastIndexOf:function t(e){return lt.apply(kt(this),arguments)},map:function t(e){return Et(kt(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function t(e){return ft.apply(kt(this),arguments)},reduceRight:function t(e){return ht.apply(kt(this),arguments)},reverse:function t(){for(var e=this,n=kt(this).length,r=Math.floor(n/2),i=0,o;i1?arguments[1]:void 0)},sort:function t(e){return dt.call(kt(this),e)},subarray:function t(e,n){var r=kt(this),i=r.length,o=y(e,i);return new(A(r,r[_t]))(r.buffer,r.byteOffset+o*r.BYTES_PER_ELEMENT,v((void 0===n?i:y(n,i))-o))}},Bt=function t(e,n){return At(this,vt.call(kt(this),e,n))},Yt=function t(e){kt(this);var n=Pt(arguments[1],1),r=this.length,i=w(e),o=v(i.length),a=0;if(o+n>r)throw W(St);for(;a255?255:255&r),i.v[p](n*e+i.o,r,Mt)},P=function(t,e){Y(t,e,{get:function(){return M(this,e)},set:function(t){return C(this,e,t)},enumerable:!0})};b?(d=n(function(t,n,r,i){l(t,d,c,"_d");var o=0,a=0,s,u,f,p;if(_(n)){if(!(n instanceof $||(p=x(n))==U||p==q))return Ot in n?It(d,n):Nt.call(d,n);s=n,a=Pt(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw W(St);if((u=y-a)<0)throw W(St)}else if((u=v(i)*e)+a>y)throw W(St);f=u/e}else f=g(n),s=new $(u=f*e);for(h(t,"_d",{b:s,o:a,l:u,e:f,v:new Q(s)});o11?0:p+1,w=0===_?h+1:h,O=(l-g+13)%7,j=d+x+O,S=j,E=[],M=[],C=function t(e){var n=void 0,r=void 0,i=void 0,o=void 0,s=void 0,u=void 0;o=(o=m-x+e)>m?0:o,s=(s=e-x)>d?0:s,u=e-j+O,n=o||s||u,o?(i=y,r=b):s?(i=p,r=h):u&&(i=_,r=w),E.push({value:{timestamp:(0,a.default)().year(r).month(i).date(n).valueOf(),year:r,month:i,date:n,week:(l+e-1)%7==0?7:(l+e-1)%7,valueOf:function t(){return(0,a.default)().year(r).month(i).date(n).valueOf()}},base:{timestamp:f.valueOf(),year:f.year(),month:p,date:f.date(),week:f.isoWeekday(),valueOf:function t(){return f.valueOf()}}}),7===E.length&&(M.push(E),E=[])},P=1;P<=S;P++)C(P);return M}};function f(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function h(t){["defaultProps","propTypes"].forEach(function(e){t[e]=t[e]||{},f(t[e],c[e])}),f(t.prototype,l)}e.default=h,t.exports=e.default},function(t,e,n){n(187),n(187),t.exports=n(654)},function(t,e,n){var r=n(11);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(61)("meta"),i=n(11),o=n(32),a=n(18).f,s=0,u=Object.isExtensible||function(){return!0},c=!n(8)(function(){return u(Object.preventExtensions({}))}),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},f=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!u(t))return"F";if(!e)return"E";l(t)}return t[r].i},h=function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;l(t)}return t[r].w},p=function(t){return c&&d.NEED&&u(t)&&!o(t,r)&&l(t),t},d=t.exports={KEY:r,NEED:!1,fastKey:f,getWeak:h,onFreeze:p}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.6.1"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):g(t,e))}function w(t){t.preventDefault()}var O=(o=i=function(t){function e(n){b(this,e);var r=x(this,t.call(this,n)),i=void 0;return i="value"in n?n.value:n.defaultValue,r.state={value:void 0===i?"":i},r}return _(e,t),e.prototype.componentWillReceiveProps=function t(e){"value"in e&&this.setState({value:void 0===e.value?"":e.value})},e.prototype.handleKeyDown=function t(e){13===e.keyCode&&this.props.onPressEnter(e),this.props.onKeyDown(e)},e.prototype.onChange=function t(e){var n=e.target.value;if(!("value"in this.props)){if(this.isIe()&&this.props.maxLength&&this.props.multiple){var r=parseInt(this.props.maxLength),i;this.getValueLength(n,!0)>r&&this.props.cutString&&(n=(n=(n=n.replace(/\n/g,"\n\n")).substr(0,r)).replace(/\n\n/g,"\n"))}this.setState({value:n})}this.props.trim&&(n=n.trim()),this.props.onChange(n,e)},e.prototype.onFocus=function t(e){this.setState({focus:!0}),this.props.onFocus(e)},e.prototype.onBlur=function t(e){this.setState({focus:!1}),this.props.onBlur(e)},e.prototype.onClear=function t(e){this.props.disabled||("value"in this.props||this.setState({value:""}),this.props.onChange("",e),this.refs.input.focus())},e.prototype.ieGT9=function t(){return"undefined"!=typeof document&&(document.documentMode||0)>9;var e},e.prototype.isIe=function t(){return"undefined"!=typeof document&&0!==(document.documentMode||0);var e},e.prototype.renderInput=function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=this.props.placeholder;o&&this.ieGT9()&&(o=null);var a=this.props,u=a.multiple,c=a.size,l=a.className,h=a.children,p=a.htmlType,v=a.maxLen,g=a.maxLength,b=a.state,x=a.onChange,_=a.style,w=a.addonBefore,O=a.addonAfter,j=a.onPressEnter,S=a.hasFeedback,E=m(a,["multiple","size","className","children","htmlType","maxLen","maxLength","state","onChange","style","addonBefore","addonAfter","onPressEnter","hasFeedback"]),M=this.context.prefix||this.props.prefix,C=u?"multiple":"single",P=u?"textarea":"input",k=r({},E);k.onChange=this.onChange.bind(this),k.value=this.state.value,delete k.defaultValue,!u&&delete k.rows;var T=(0,f.default)((y(e={},M+"input",!0),y(e,M+"input-"+C,!0),y(e,M+"input-"+c,!!c&&"single"===C),y(e,"disabled",!!this.props.disabled),y(e,"clear",this.props.hasClear),y(e,"error","error"===this.props.state),y(e,"focus",this.state.focus),y(e,"hidden","hidden"===this.props.htmlType),y(e,"noborder","file"===this.props.htmlType),y(e,i,!!i),e)),A={textIndent:this.props.textIndent};return this.props.cutString&&(k.maxLength=v||g),s.default.createElement("span",{className:T,style:n},s.default.createElement(P,r({},(0,d.pickAttrs)(k),{style:A,type:p,height:"100%",onKeyDown:this.handleKeyDown.bind(this),onFocus:this.onFocus.bind(this),onBlur:this.onBlur.bind(this),key:"input",ref:"input"})),this.renderControl())},e.prototype.getValueLength=function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=""+e,i=this.props.getValueLength(r);return"number"!=typeof i&&(i=r.length),n&&this.isIe()?i+r.split("\n").length-1:i},e.prototype.renderControl=function t(){var e,n=parseInt(this.props.maxLength||this.props.maxLen),r=this.props.hasLimitHint||this.props.maxLen;this.props.maxLen&&d.log.deprecated("maxLen","maxLength","Input");var i=this.context.prefix||this.props.prefix,o=this.props,a=o.hasClear,u=o.readOnly,c=o.state,l=n>0&&this.state.value?this.getValueLength(this.state.value,this.props.multiple):0,h=(0,f.default)((y(e={},i+"input-len",!0),y(e,"error",l>n),e)),v=null;c&&!this.props.multiple&&("success"===c?v=s.default.createElement(p.default,{type:"success"}):"loading"===c&&(v=s.default.createElement(p.default,{type:"loading"})));var g=a&&!u&&""+this.state.value?s.default.createElement(p.default,{type:"delete-filling",onClick:this.onClear.bind(this),onMouseDown:w}):null,m=n&&r?s.default.createElement("span",{className:h},l,"/",n):null;return g||m||v?s.default.createElement("span",{className:i+"input-control"},g,m,v):null},e.prototype.getInputNode=function t(){return this.refs.input},e.prototype.render=function t(){var e,n,r,i=this.props,o=this.context.prefix||this.props.prefix,a=(0,f.default)((y(e={},o+"input-group",!0),y(e,""+i.size,!!i.size),y(e,"disabled",this.props.disabled),y(e,this.props.className,!!this.props.className),e)),u=o+"input-addon",c=(0,f.default)((y(n={},""+u,!0),y(n,u+"-before",!0),n)),l=(0,f.default)((y(r={},""+u,!0),y(r,u+"-after",!0),r)),h=i.addonBefore?s.default.createElement("span",{className:c},i.addonBefore):null,p=i.addonAfter?s.default.createElement("span",{className:l},i.addonAfter):null;return h||p?s.default.createElement("span",{className:a,style:this.props.style},h,this.renderInput(),p):this.renderInput(this.props.style,this.props.className)},e}(s.default.Component),i.propTypes={prefix:c.default.string,value:c.default.oneOfType([c.default.string,c.default.number]),defaultValue:c.default.oneOfType([c.default.string,c.default.number]),size:c.default.oneOf(["small","medium","large"]),disabled:c.default.bool,multiple:c.default.bool,maxLen:c.default.number,maxLength:c.default.number,hasLimitHint:c.default.bool,cutString:c.default.bool,hasClear:c.default.bool,state:c.default.oneOf(["","error","loading","success"]),style:c.default.object,htmlType:c.default.string,readOnly:c.default.bool,trim:c.default.bool,addonBefore:c.default.node,addonAfter:c.default.node,placeholder:c.default.string,onPressEnter:c.default.func,onFocus:c.default.func,onBlur:c.default.func,onKeyDown:c.default.func,onChange:c.default.func,getValueLength:c.default.func,rows:c.default.number,textIndent:c.default.number,className:c.default.string},i.defaultProps={htmlType:"text",disabled:!1,prefix:"next-",multiple:!1,hasFeedback:!1,maxLen:null,maxLength:null,hasLimitHint:!1,cutString:!0,hasClear:!1,readOnly:!1,trim:!1,state:"",size:"medium",onPressEnter:function t(){},onFocus:function t(){},onBlur:function t(){},onKeyDown:function t(){},onChange:function t(){},getValueLength:function t(){},rows:4},i.contextTypes={prefix:c.default.string},o);O.displayName="Input",e.default=O,t.exports=e.default},function(t,e,n){n(180),n(180),t.exports=n(182)},function(t,e,n){"use strict";n(297),Object.defineProperty(e,"__esModule",{value:!0}),e.FormError=e.FormBinder=e.FormBinderWrapper=void 0;var r,i=c(n(693)),o,a=c(n(694)),s,u=c(n(695));function c(t){return t&&t.__esModule?t:{default:t}}e.default=i.default,e.FormBinderWrapper=i.default,e.FormBinder=a.default,e.FormError=u.default},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=!1},function(t,e,n){var r=n(200),i=n(134);t.exports=Object.keys||function t(e){return r(e,i)}},function(t,e,n){var r=n(42),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(9),i=n(201),o=n(134),a=n(133)("IE_PROTO"),s=function(){},u="prototype",c=function(){var t=n(130)("iframe"),e=o.length,r="<",i=">",a;for(t.style.display="none",n(136).appendChild(t),t.src="javascript:",(a=t.contentWindow.document).open(),a.write("